vendor: 3,595 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = "/"; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 1); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
89/***/ "./Resources/assets/desktop/js/app.js": 90/*!********************************************!*\ 91 !*** ./Resources/assets/desktop/js/app.js ***! 92 \********************************************/ 93/*! no exports provided */ 94/***/ (function(module, __webpack_exports__, __webpack_require__) { 95 96"use strict"; 97__webpack_require__.r(__webpack_exports__); 98/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 99/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__); 100/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js"); 101/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_1__); 102 103 //start sroll to top 104 105jquery__WEBPACK_IMPORTED_MODULE_0__(function () { 106 jquery__WEBPACK_IMPORTED_MODULE_0__('.rollto a.scrolltop').on('click', function () { 107 scrollTo('', 500); 108 }); 109 jquery__WEBPACK_IMPORTED_MODULE_0__('.rollto a.scrollbottom').on('click', function () { 110 scrollTo('.footer'); 111 }); 112 jquery__WEBPACK_IMPORTED_MODULE_0__(window).scroll(function () { 113 var scroller = jquery__WEBPACK_IMPORTED_MODULE_0__('.rollto'); 114 document.documentElement.scrollTop + document.body.scrollTop > 150 ? scroller.fadeIn() : scroller.fadeOut(); 115 }); 116}); 117 118function scrollTo(name, speed) { 119 if (!speed) speed = 300; 120 121 if (!name) { 122 jquery__WEBPACK_IMPORTED_MODULE_0__('html,body').animate({ 123 scrollTop: 0 124 }, speed); 125 } else { 126 if (jquery__WEBPACK_IMPORTED_MODULE_0__(name).length > 0) { 127 jquery__WEBPACK_IMPORTED_MODULE_0__('html,body').animate({ 128 scrollTop: jquery__WEBPACK_IMPORTED_MODULE_0__(name).offset().top 129 }, speed); 130 } 131 } 132} 133 134jquery__WEBPACK_IMPORTED_MODULE_0__('.show-pass').click(function (event) { 135 event.preventDefault(); // alert('Toggled') 136 137 jquery__WEBPACK_IMPORTED_MODULE_0__(this).find('i').toggleClass('fa-eye-slash'); 138 jquery__WEBPACK_IMPORTED_MODULE_0__(this).find('i').toggleClass('fa-eye'); 139}); //end sroll to top 140 141/***/ }), 142
vendor: 143,854 bytes, lines 143-4570
143/***/ "./node_modules/bootstrap/dist/js/bootstrap.js": 144/*!*****************************************************!*\ 145 !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***! 146 \*****************************************************/ 147/*! no static exports found */ 148/***/ (function(module, exports, __webpack_require__) { 149 150/*! 151 * Bootstrap v4.5.3 (https://getbootstrap.com/) 152 * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 153 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 154 */ 155(function (global, factory) { 156 true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : 157 undefined; 158}(this, (function (exports, $, Popper) { 'use strict'; 159 160 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 161 162 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 163 var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper); 164 165 function _defineProperties(target, props) { 166 for (var i = 0; i < props.length; i++) { 167 var descriptor = props[i]; 168 descriptor.enumerable = descriptor.enumerable || false; 169 descriptor.configurable = true; 170 if ("value" in descriptor) descriptor.writable = true; 171 Object.defineProperty(target, descriptor.key, descriptor); 172 } 173 } 174 175 function _createClass(Constructor, protoProps, staticProps) { 176 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 177 if (staticProps) _defineProperties(Constructor, staticProps); 178 return Constructor; 179 } 180 181 function _extends() { 182 _extends = Object.assign || function (target) { 183 for (var i = 1; i < arguments.length; i++) { 184 var source = arguments[i]; 185 186 for (var key in source) { 187 if (Object.prototype.hasOwnProperty.call(source, key)) { 188 target[key] = source[key]; 189 } 190 } 191 } 192 193 return target; 194 }; 195 196 return _extends.apply(this, arguments); 197 } 198 199 function _inheritsLoose(subClass, superClass) { 200 subClass.prototype = Object.create(superClass.prototype); 201 subClass.prototype.constructor = subClass; 202 subClass.__proto__ = superClass; 203 } 204 205 /** 206 * -------------------------------------------------------------------------- 207 * Bootstrap (v4.5.3): util.js 208 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 209 * -------------------------------------------------------------------------- 210 */ 211 /** 212 * ------------------------------------------------------------------------ 213 * Private TransitionEnd Helpers 214 * ------------------------------------------------------------------------ 215 */ 216 217 var TRANSITION_END = 'transitionend'; 218 var MAX_UID = 1000000; 219 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 220 221 function toType(obj) { 222 if (obj === null || typeof obj === 'undefined') { 223 return "" + obj; 224 } 225 226 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 227 } 228 229 function getSpecialTransitionEndEvent() { 230 return { 231 bindType: TRANSITION_END, 232 delegateType: TRANSITION_END, 233 handle: function handle(event) { 234 if ($__default['default'](event.target).is(this)) { 235 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 236 } 237 238 return undefined; 239 } 240 }; 241 } 242 243 function transitionEndEmulator(duration) { 244 var _this = this; 245 246 var called = false; 247 $__default['default'](this).one(Util.TRANSITION_END, function () { 248 called = true; 249 }); 250 setTimeout(function () { 251 if (!called) { 252 Util.triggerTransitionEnd(_this); 253 } 254 }, duration); 255 return this; 256 } 257 258 function setTransitionEndSupport() { 259 $__default['default'].fn.emulateTransitionEnd = transitionEndEmulator; 260 $__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 261 } 262 /** 263 * -------------------------------------------------------------------------- 264 * Public Util Api 265 * -------------------------------------------------------------------------- 266 */ 267 268 269 var Util = { 270 TRANSITION_END: 'bsTransitionEnd', 271 getUID: function getUID(prefix) { 272 do { 273 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 274 } while (document.getElementById(prefix)); 275 276 return prefix; 277 }, 278 getSelectorFromElement: function getSelectorFromElement(element) { 279 var selector = element.getAttribute('data-target'); 280 281 if (!selector || selector === '#') { 282 var hrefAttr = element.getAttribute('href'); 283 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 284 } 285 286 try { 287 return document.querySelector(selector) ? selector : null; 288 } catch (_) { 289 return null; 290 } 291 }, 292 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 293 if (!element) { 294 return 0; 295 } // Get transition-duration of the element 296 297 298 var transitionDuration = $__default['default'](element).css('transition-duration'); 299 var transitionDelay = $__default['default'](element).css('transition-delay'); 300 var floatTransitionDuration = parseFloat(transitionDuration); 301 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 302 303 if (!floatTransitionDuration && !floatTransitionDelay) { 304 return 0; 305 } // If multiple durations are defined, take the first 306 307 308 transitionDuration = transitionDuration.split(',')[0]; 309 transitionDelay = transitionDelay.split(',')[0]; 310 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 311 }, 312 reflow: function reflow(element) { 313 return element.offsetHeight; 314 }, 315 triggerTransitionEnd: function triggerTransitionEnd(element) { 316 $__default['default'](element).trigger(TRANSITION_END); 317 }, 318 supportsTransitionEnd: function supportsTransitionEnd() { 319 return Boolean(TRANSITION_END); 320 }, 321 isElement: function isElement(obj) { 322 return (obj[0] || obj).nodeType; 323 }, 324 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 325 for (var property in configTypes) { 326 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 327 var expectedTypes = configTypes[property]; 328 var value = config[property]; 329 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 330 331 if (!new RegExp(expectedTypes).test(valueType)) { 332 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 333 } 334 } 335 } 336 }, 337 findShadowRoot: function findShadowRoot(element) { 338 if (!document.documentElement.attachShadow) { 339 return null; 340 } // Can find the shadow root otherwise it'll return the document 341 342 343 if (typeof element.getRootNode === 'function') { 344 var root = element.getRootNode(); 345 return root instanceof ShadowRoot ? root : null; 346 } 347 348 if (element instanceof ShadowRoot) { 349 return element; 350 } // when we don't find a shadow root 351 352 353 if (!element.parentNode) { 354 return null; 355 } 356 357 return Util.findShadowRoot(element.parentNode); 358 }, 359 jQueryDetection: function jQueryDetection() { 360 if (typeof $__default['default'] === 'undefined') { 361 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 362 } 363 364 var version = $__default['default'].fn.jquery.split(' ')[0].split('.'); 365 var minMajor = 1; 366 var ltMajor = 2; 367 var minMinor = 9; 368 var minPatch = 1; 369 var maxMajor = 4; 370 371 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 372 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 373 } 374 } 375 }; 376 Util.jQueryDetection(); 377 setTransitionEndSupport(); 378 379 /** 380 * ------------------------------------------------------------------------ 381 * Constants 382 * ------------------------------------------------------------------------ 383 */ 384 385 var NAME = 'alert'; 386 var VERSION = '4.5.3'; 387 var DATA_KEY = 'bs.alert'; 388 var EVENT_KEY = "." + DATA_KEY; 389 var DATA_API_KEY = '.data-api'; 390 var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME]; 391 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 392 var EVENT_CLOSE = "close" + EVENT_KEY; 393 var EVENT_CLOSED = "closed" + EVENT_KEY; 394 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY; 395 var CLASS_NAME_ALERT = 'alert'; 396 var CLASS_NAME_FADE = 'fade'; 397 var CLASS_NAME_SHOW = 'show'; 398 /** 399 * ------------------------------------------------------------------------ 400 * Class Definition 401 * ------------------------------------------------------------------------ 402 */ 403 404 var Alert = /*#__PURE__*/function () { 405 function Alert(element) { 406 this._element = element; 407 } // Getters 408 409 410 var _proto = Alert.prototype; 411 412 // Public 413 _proto.close = function close(element) { 414 var rootElement = this._element; 415 416 if (element) { 417 rootElement = this._getRootElement(element); 418 } 419 420 var customEvent = this._triggerCloseEvent(rootElement); 421 422 if (customEvent.isDefaultPrevented()) { 423 return; 424 } 425 426 this._removeElement(rootElement); 427 }; 428 429 _proto.dispose = function dispose() { 430 $__default['default'].removeData(this._element, DATA_KEY); 431 this._element = null; 432 } // Private 433 ; 434 435 _proto._getRootElement = function _getRootElement(element) { 436 var selector = Util.getSelectorFromElement(element); 437 var parent = false; 438 439 if (selector) { 440 parent = document.querySelector(selector); 441 } 442 443 if (!parent) { 444 parent = $__default['default'](element).closest("." + CLASS_NAME_ALERT)[0]; 445 } 446 447 return parent; 448 }; 449 450 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 451 var closeEvent = $__default['default'].Event(EVENT_CLOSE); 452 $__default['default'](element).trigger(closeEvent); 453 return closeEvent; 454 }; 455 456 _proto._removeElement = function _removeElement(element) { 457 var _this = this; 458 459 $__default['default'](element).removeClass(CLASS_NAME_SHOW); 460 461 if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) { 462 this._destroyElement(element); 463 464 return; 465 } 466 467 var transitionDuration = Util.getTransitionDurationFromElement(element); 468 $__default['default'](element).one(Util.TRANSITION_END, function (event) { 469 return _this._destroyElement(element, event); 470 }).emulateTransitionEnd(transitionDuration); 471 }; 472 473 _proto._destroyElement = function _destroyElement(element) { 474 $__default['default'](element).detach().trigger(EVENT_CLOSED).remove(); 475 } // Static 476 ; 477 478 Alert._jQueryInterface = function _jQueryInterface(config) { 479 return this.each(function () { 480 var $element = $__default['default'](this); 481 var data = $element.data(DATA_KEY); 482 483 if (!data) { 484 data = new Alert(this); 485 $element.data(DATA_KEY, data); 486 } 487 488 if (config === 'close') { 489 data[config](this); 490 } 491 }); 492 }; 493 494 Alert._handleDismiss = function _handleDismiss(alertInstance) { 495 return function (event) { 496 if (event) { 497 event.preventDefault(); 498 } 499 500 alertInstance.close(this); 501 }; 502 }; 503 504 _createClass(Alert, null, [{ 505 key: "VERSION", 506 get: function get() { 507 return VERSION; 508 } 509 }]); 510 511 return Alert; 512 }(); 513 /** 514 * ------------------------------------------------------------------------ 515 * Data Api implementation 516 * ------------------------------------------------------------------------ 517 */ 518 519 520 $__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 521 /** 522 * ------------------------------------------------------------------------ 523 * jQuery 524 * ------------------------------------------------------------------------ 525 */ 526 527 $__default['default'].fn[NAME] = Alert._jQueryInterface; 528 $__default['default'].fn[NAME].Constructor = Alert; 529 530 $__default['default'].fn[NAME].noConflict = function () { 531 $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT; 532 return Alert._jQueryInterface; 533 }; 534 535 /** 536 * ------------------------------------------------------------------------ 537 * Constants 538 * ------------------------------------------------------------------------ 539 */ 540 541 var NAME$1 = 'button'; 542 var VERSION$1 = '4.5.3'; 543 var DATA_KEY$1 = 'bs.button'; 544 var EVENT_KEY$1 = "." + DATA_KEY$1; 545 var DATA_API_KEY$1 = '.data-api'; 546 var JQUERY_NO_CONFLICT$1 = $__default['default'].fn[NAME$1]; 547 var CLASS_NAME_ACTIVE = 'active'; 548 var CLASS_NAME_BUTTON = 'btn'; 549 var CLASS_NAME_FOCUS = 'focus'; 550 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 551 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 552 var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'; 553 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 554 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 555 var SELECTOR_ACTIVE = '.active'; 556 var SELECTOR_BUTTON = '.btn'; 557 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1; 558 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1); 559 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1; 560 /** 561 * ------------------------------------------------------------------------ 562 * Class Definition 563 * ------------------------------------------------------------------------ 564 */ 565 566 var Button = /*#__PURE__*/function () { 567 function Button(element) { 568 this._element = element; 569 this.shouldAvoidTriggerChange = false; 570 } // Getters 571 572 573 var _proto = Button.prototype; 574 575 // Public 576 _proto.toggle = function toggle() { 577 var triggerChangeEvent = true; 578 var addAriaPressed = true; 579 var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 580 581 if (rootElement) { 582 var input = this._element.querySelector(SELECTOR_INPUT); 583 584 if (input) { 585 if (input.type === 'radio') { 586 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) { 587 triggerChangeEvent = false; 588 } else { 589 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE); 590 591 if (activeElement) { 592 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE); 593 } 594 } 595 } 596 597 if (triggerChangeEvent) { 598 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 599 if (input.type === 'checkbox' || input.type === 'radio') { 600 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE); 601 } 602 603 if (!this.shouldAvoidTriggerChange) { 604 $__default['default'](input).trigger('change'); 605 } 606 } 607 608 input.focus(); 609 addAriaPressed = false; 610 } 611 } 612 613 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 614 if (addAriaPressed) { 615 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE)); 616 } 617 618 if (triggerChangeEvent) { 619 $__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE); 620 } 621 } 622 }; 623 624 _proto.dispose = function dispose() { 625 $__default['default'].removeData(this._element, DATA_KEY$1); 626 this._element = null; 627 } // Static 628 ; 629 630 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 631 return this.each(function () { 632 var $element = $__default['default'](this); 633 var data = $element.data(DATA_KEY$1); 634 635 if (!data) { 636 data = new Button(this); 637 $element.data(DATA_KEY$1, data); 638 } 639 640 data.shouldAvoidTriggerChange = avoidTriggerChange; 641 642 if (config === 'toggle') { 643 data[config](); 644 } 645 }); 646 }; 647 648 _createClass(Button, null, [{ 649 key: "VERSION", 650 get: function get() { 651 return VERSION$1; 652 } 653 }]); 654 655 return Button; 656 }(); 657 /** 658 * ------------------------------------------------------------------------ 659 * Data Api implementation 660 * ------------------------------------------------------------------------ 661 */ 662 663 664 $__default['default'](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 665 var button = event.target; 666 var initialButton = button; 667 668 if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) { 669 button = $__default['default'](button).closest(SELECTOR_BUTTON)[0]; 670 } 671 672 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 673 event.preventDefault(); // work around Firefox bug #1540995 674 } else { 675 var inputBtn = button.querySelector(SELECTOR_INPUT); 676 677 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 678 event.preventDefault(); // work around Firefox bug #1540995 679 680 return; 681 } 682 683 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 684 Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT'); 685 } 686 } 687 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 688 var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0]; 689 $__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 690 }); 691 $__default['default'](window).on(EVENT_LOAD_DATA_API, function () { 692 // ensure correct active class is set to match the controls' actual values/states 693 // find all checkboxes/readio buttons inside data-toggle groups 694 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 695 696 for (var i = 0, len = buttons.length; i < len; i++) { 697 var button = buttons[i]; 698 var input = button.querySelector(SELECTOR_INPUT); 699 700 if (input.checked || input.hasAttribute('checked')) { 701 button.classList.add(CLASS_NAME_ACTIVE); 702 } else { 703 button.classList.remove(CLASS_NAME_ACTIVE); 704 } 705 } // find all button toggles 706 707 708 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE)); 709 710 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 711 var _button = buttons[_i]; 712 713 if (_button.getAttribute('aria-pressed') === 'true') { 714 _button.classList.add(CLASS_NAME_ACTIVE); 715 } else { 716 _button.classList.remove(CLASS_NAME_ACTIVE); 717 } 718 } 719 }); 720 /** 721 * ------------------------------------------------------------------------ 722 * jQuery 723 * ------------------------------------------------------------------------ 724 */ 725 726 $__default['default'].fn[NAME$1] = Button._jQueryInterface; 727 $__default['default'].fn[NAME$1].Constructor = Button; 728 729 $__default['default'].fn[NAME$1].noConflict = function () { 730 $__default['default'].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 731 return Button._jQueryInterface; 732 }; 733 734 /** 735 * ------------------------------------------------------------------------ 736 * Constants 737 * ------------------------------------------------------------------------ 738 */ 739 740 var NAME$2 = 'carousel'; 741 var VERSION$2 = '4.5.3'; 742 var DATA_KEY$2 = 'bs.carousel'; 743 var EVENT_KEY$2 = "." + DATA_KEY$2; 744 var DATA_API_KEY$2 = '.data-api'; 745 var JQUERY_NO_CONFLICT$2 = $__default['default'].fn[NAME$2]; 746 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 747 748 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 749 750 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 751 752 var SWIPE_THRESHOLD = 40; 753 var Default = { 754 interval: 5000, 755 keyboard: true, 756 slide: false, 757 pause: 'hover', 758 wrap: true, 759 touch: true 760 }; 761 var DefaultType = { 762 interval: '(number|boolean)', 763 keyboard: 'boolean', 764 slide: '(boolean|string)', 765 pause: '(string|boolean)', 766 wrap: 'boolean', 767 touch: 'boolean' 768 }; 769 var DIRECTION_NEXT = 'next'; 770 var DIRECTION_PREV = 'prev'; 771 var DIRECTION_LEFT = 'left'; 772 var DIRECTION_RIGHT = 'right'; 773 var EVENT_SLIDE = "slide" + EVENT_KEY$2; 774 var EVENT_SLID = "slid" + EVENT_KEY$2; 775 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2; 776 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2; 777 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2; 778 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2; 779 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2; 780 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2; 781 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2; 782 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2; 783 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2; 784 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2; 785 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2; 786 var CLASS_NAME_CAROUSEL = 'carousel'; 787 var CLASS_NAME_ACTIVE$1 = 'active'; 788 var CLASS_NAME_SLIDE = 'slide'; 789 var CLASS_NAME_RIGHT = 'carousel-item-right'; 790 var CLASS_NAME_LEFT = 'carousel-item-left'; 791 var CLASS_NAME_NEXT = 'carousel-item-next'; 792 var CLASS_NAME_PREV = 'carousel-item-prev'; 793 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 794 var SELECTOR_ACTIVE$1 = '.active'; 795 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 796 var SELECTOR_ITEM = '.carousel-item'; 797 var SELECTOR_ITEM_IMG = '.carousel-item img'; 798 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 799 var SELECTOR_INDICATORS = '.carousel-indicators'; 800 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 801 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 802 var PointerType = { 803 TOUCH: 'touch', 804 PEN: 'pen' 805 }; 806 /** 807 * ------------------------------------------------------------------------ 808 * Class Definition 809 * ------------------------------------------------------------------------ 810 */ 811 812 var Carousel = /*#__PURE__*/function () { 813 function Carousel(element, config) { 814 this._items = null; 815 this._interval = null; 816 this._activeElement = null; 817 this._isPaused = false; 818 this._isSliding = false; 819 this.touchTimeout = null; 820 this.touchStartX = 0; 821 this.touchDeltaX = 0; 822 this._config = this._getConfig(config); 823 this._element = element; 824 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 825 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 826 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 827 828 this._addEventListeners(); 829 } // Getters 830 831 832 var _proto = Carousel.prototype; 833 834 // Public 835 _proto.next = function next() { 836 if (!this._isSliding) { 837 this._slide(DIRECTION_NEXT); 838 } 839 }; 840 841 _proto.nextWhenVisible = function nextWhenVisible() { 842 var $element = $__default['default'](this._element); // Don't call next when the page isn't visible 843 // or the carousel or its parent isn't visible 844 845 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 846 this.next(); 847 } 848 }; 849 850 _proto.prev = function prev() { 851 if (!this._isSliding) { 852 this._slide(DIRECTION_PREV); 853 } 854 }; 855 856 _proto.pause = function pause(event) { 857 if (!event) { 858 this._isPaused = true; 859 } 860 861 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 862 Util.triggerTransitionEnd(this._element); 863 this.cycle(true); 864 } 865 866 clearInterval(this._interval); 867 this._interval = null; 868 }; 869 870 _proto.cycle = function cycle(event) { 871 if (!event) { 872 this._isPaused = false; 873 } 874 875 if (this._interval) { 876 clearInterval(this._interval); 877 this._interval = null; 878 } 879 880 if (this._config.interval && !this._isPaused) { 881 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 882 } 883 }; 884 885 _proto.to = function to(index) { 886 var _this = this; 887 888 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 889 890 var activeIndex = this._getItemIndex(this._activeElement); 891 892 if (index > this._items.length - 1 || index < 0) { 893 return; 894 } 895 896 if (this._isSliding) { 897 $__default['default'](this._element).one(EVENT_SLID, function () { 898 return _this.to(index); 899 }); 900 return; 901 } 902 903 if (activeIndex === index) { 904 this.pause(); 905 this.cycle(); 906 return; 907 } 908 909 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 910 911 this._slide(direction, this._items[index]); 912 }; 913 914 _proto.dispose = function dispose() { 915 $__default['default'](this._element).off(EVENT_KEY$2); 916 $__default['default'].removeData(this._element, DATA_KEY$2); 917 this._items = null; 918 this._config = null; 919 this._element = null; 920 this._interval = null; 921 this._isPaused = null; 922 this._isSliding = null; 923 this._activeElement = null; 924 this._indicatorsElement = null; 925 } // Private 926 ; 927 928 _proto._getConfig = function _getConfig(config) { 929 config = _extends({}, Default, config); 930 Util.typeCheckConfig(NAME$2, config, DefaultType); 931 return config; 932 }; 933 934 _proto._handleSwipe = function _handleSwipe() { 935 var absDeltax = Math.abs(this.touchDeltaX); 936 937 if (absDeltax <= SWIPE_THRESHOLD) { 938 return; 939 } 940 941 var direction = absDeltax / this.touchDeltaX; 942 this.touchDeltaX = 0; // swipe left 943 944 if (direction > 0) { 945 this.prev(); 946 } // swipe right 947 948 949 if (direction < 0) { 950 this.next(); 951 } 952 }; 953 954 _proto._addEventListeners = function _addEventListeners() { 955 var _this2 = this; 956 957 if (this._config.keyboard) { 958 $__default['default'](this._element).on(EVENT_KEYDOWN, function (event) { 959 return _this2._keydown(event); 960 }); 961 } 962 963 if (this._config.pause === 'hover') { 964 $__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) { 965 return _this2.pause(event); 966 }).on(EVENT_MOUSELEAVE, function (event) { 967 return _this2.cycle(event); 968 }); 969 } 970 971 if (this._config.touch) { 972 this._addTouchEventListeners(); 973 } 974 }; 975 976 _proto._addTouchEventListeners = function _addTouchEventListeners() { 977 var _this3 = this; 978 979 if (!this._touchSupported) { 980 return; 981 } 982 983 var start = function start(event) { 984 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 985 _this3.touchStartX = event.originalEvent.clientX; 986 } else if (!_this3._pointerEvent) { 987 _this3.touchStartX = event.originalEvent.touches[0].clientX; 988 } 989 }; 990 991 var move = function move(event) { 992 // ensure swiping with one touch and not pinching 993 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 994 _this3.touchDeltaX = 0; 995 } else { 996 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 997 } 998 }; 999 1000 var end = function end(event) { 1001 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1002 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 1003 } 1004 1005 _this3._handleSwipe(); 1006 1007 if (_this3._config.pause === 'hover') { 1008 // If it's a touch-enabled device, mouseenter/leave are fired as 1009 // part of the mouse compatibility events on first tap - the carousel 1010 // would stop cycling until user tapped out of it; 1011 // here, we listen for touchend, explicitly pause the carousel 1012 // (as if it's the second time we tap on it, mouseenter compat event 1013 // is NOT fired) and after a timeout (to allow for mouse compatibility 1014 // events to fire) we explicitly restart cycling 1015 _this3.pause(); 1016 1017 if (_this3.touchTimeout) { 1018 clearTimeout(_this3.touchTimeout); 1019 } 1020 1021 _this3.touchTimeout = setTimeout(function (event) { 1022 return _this3.cycle(event); 1023 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 1024 } 1025 }; 1026 1027 $__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 1028 return e.preventDefault(); 1029 }); 1030 1031 if (this._pointerEvent) { 1032 $__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) { 1033 return start(event); 1034 }); 1035 $__default['default'](this._element).on(EVENT_POINTERUP, function (event) { 1036 return end(event); 1037 }); 1038 1039 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 1040 } else { 1041 $__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) { 1042 return start(event); 1043 }); 1044 $__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) { 1045 return move(event); 1046 }); 1047 $__default['default'](this._element).on(EVENT_TOUCHEND, function (event) { 1048 return end(event); 1049 }); 1050 } 1051 }; 1052 1053 _proto._keydown = function _keydown(event) { 1054 if (/input|textarea/i.test(event.target.tagName)) { 1055 return; 1056 } 1057 1058 switch (event.which) { 1059 case ARROW_LEFT_KEYCODE: 1060 event.preventDefault(); 1061 this.prev(); 1062 break; 1063 1064 case ARROW_RIGHT_KEYCODE: 1065 event.preventDefault(); 1066 this.next(); 1067 break; 1068 } 1069 }; 1070 1071 _proto._getItemIndex = function _getItemIndex(element) { 1072 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 1073 return this._items.indexOf(element); 1074 }; 1075 1076 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 1077 var isNextDirection = direction === DIRECTION_NEXT; 1078 var isPrevDirection = direction === DIRECTION_PREV; 1079 1080 var activeIndex = this._getItemIndex(activeElement); 1081 1082 var lastItemIndex = this._items.length - 1; 1083 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1084 1085 if (isGoingToWrap && !this._config.wrap) { 1086 return activeElement; 1087 } 1088 1089 var delta = direction === DIRECTION_PREV ? -1 : 1; 1090 var itemIndex = (activeIndex + delta) % this._items.length; 1091 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1092 }; 1093 1094 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1095 var targetIndex = this._getItemIndex(relatedTarget); 1096 1097 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 1098 1099 var slideEvent = $__default['default'].Event(EVENT_SLIDE, { 1100 relatedTarget: relatedTarget, 1101 direction: eventDirectionName, 1102 from: fromIndex, 1103 to: targetIndex 1104 }); 1105 $__default['default'](this._element).trigger(slideEvent); 1106 return slideEvent; 1107 }; 1108 1109 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 1110 if (this._indicatorsElement) { 1111 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 1112 $__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE$1); 1113 1114 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1115 1116 if (nextIndicator) { 1117 $__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE$1); 1118 } 1119 } 1120 }; 1121 1122 _proto._slide = function _slide(direction, element) { 1123 var _this4 = this; 1124 1125 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 1126 1127 var activeElementIndex = this._getItemIndex(activeElement); 1128 1129 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1130 1131 var nextElementIndex = this._getItemIndex(nextElement); 1132 1133 var isCycling = Boolean(this._interval); 1134 var directionalClassName; 1135 var orderClassName; 1136 var eventDirectionName; 1137 1138 if (direction === DIRECTION_NEXT) { 1139 directionalClassName = CLASS_NAME_LEFT; 1140 orderClassName = CLASS_NAME_NEXT; 1141 eventDirectionName = DIRECTION_LEFT; 1142 } else { 1143 directionalClassName = CLASS_NAME_RIGHT; 1144 orderClassName = CLASS_NAME_PREV; 1145 eventDirectionName = DIRECTION_RIGHT; 1146 } 1147 1148 if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE$1)) { 1149 this._isSliding = false; 1150 return; 1151 } 1152 1153 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1154 1155 if (slideEvent.isDefaultPrevented()) { 1156 return; 1157 } 1158 1159 if (!activeElement || !nextElement) { 1160 // Some weirdness is happening, so we bail 1161 return; 1162 } 1163 1164 this._isSliding = true; 1165 1166 if (isCycling) { 1167 this.pause(); 1168 } 1169 1170 this._setActiveIndicatorElement(nextElement); 1171 1172 var slidEvent = $__default['default'].Event(EVENT_SLID, { 1173 relatedTarget: nextElement, 1174 direction: eventDirectionName, 1175 from: activeElementIndex, 1176 to: nextElementIndex 1177 }); 1178 1179 if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) { 1180 $__default['default'](nextElement).addClass(orderClassName); 1181 Util.reflow(nextElement); 1182 $__default['default'](activeElement).addClass(directionalClassName); 1183 $__default['default'](nextElement).addClass(directionalClassName); 1184 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1185 1186 if (nextElementInterval) { 1187 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1188 this._config.interval = nextElementInterval; 1189 } else { 1190 this._config.interval = this._config.defaultInterval || this._config.interval; 1191 } 1192 1193 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1194 $__default['default'](activeElement).one(Util.TRANSITION_END, function () { 1195 $__default['default'](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1); 1196 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName); 1197 _this4._isSliding = false; 1198 setTimeout(function () { 1199 return $__default['default'](_this4._element).trigger(slidEvent); 1200 }, 0); 1201 }).emulateTransitionEnd(transitionDuration); 1202 } else { 1203 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1); 1204 $__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE$1); 1205 this._isSliding = false; 1206 $__default['default'](this._element).trigger(slidEvent); 1207 } 1208 1209 if (isCycling) { 1210 this.cycle(); 1211 } 1212 } // Static 1213 ; 1214 1215 Carousel._jQueryInterface = function _jQueryInterface(config) { 1216 return this.each(function () { 1217 var data = $__default['default'](this).data(DATA_KEY$2); 1218 1219 var _config = _extends({}, Default, $__default['default'](this).data()); 1220 1221 if (typeof config === 'object') { 1222 _config = _extends({}, _config, config); 1223 } 1224 1225 var action = typeof config === 'string' ? config : _config.slide; 1226 1227 if (!data) { 1228 data = new Carousel(this, _config); 1229 $__default['default'](this).data(DATA_KEY$2, data); 1230 } 1231 1232 if (typeof config === 'number') { 1233 data.to(config); 1234 } else if (typeof action === 'string') { 1235 if (typeof data[action] === 'undefined') { 1236 throw new TypeError("No method named \"" + action + "\""); 1237 } 1238 1239 data[action](); 1240 } else if (_config.interval && _config.ride) { 1241 data.pause(); 1242 data.cycle(); 1243 } 1244 }); 1245 }; 1246 1247 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1248 var selector = Util.getSelectorFromElement(this); 1249 1250 if (!selector) { 1251 return; 1252 } 1253 1254 var target = $__default['default'](selector)[0]; 1255 1256 if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) { 1257 return; 1258 } 1259 1260 var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); 1261 1262 var slideIndex = this.getAttribute('data-slide-to'); 1263 1264 if (slideIndex) { 1265 config.interval = false; 1266 } 1267 1268 Carousel._jQueryInterface.call($__default['default'](target), config); 1269 1270 if (slideIndex) { 1271 $__default['default'](target).data(DATA_KEY$2).to(slideIndex); 1272 } 1273 1274 event.preventDefault(); 1275 }; 1276 1277 _createClass(Carousel, null, [{ 1278 key: "VERSION", 1279 get: function get() { 1280 return VERSION$2; 1281 } 1282 }, { 1283 key: "Default", 1284 get: function get() { 1285 return Default; 1286 } 1287 }]); 1288 1289 return Carousel; 1290 }(); 1291 /** 1292 * ------------------------------------------------------------------------ 1293 * Data Api implementation 1294 * ------------------------------------------------------------------------ 1295 */ 1296 1297 1298 $__default['default'](document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 1299 $__default['default'](window).on(EVENT_LOAD_DATA_API$1, function () { 1300 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 1301 1302 for (var i = 0, len = carousels.length; i < len; i++) { 1303 var $carousel = $__default['default'](carousels[i]); 1304 1305 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1306 } 1307 }); 1308 /** 1309 * ------------------------------------------------------------------------ 1310 * jQuery 1311 * ------------------------------------------------------------------------ 1312 */ 1313 1314 $__default['default'].fn[NAME$2] = Carousel._jQueryInterface; 1315 $__default['default'].fn[NAME$2].Constructor = Carousel; 1316 1317 $__default['default'].fn[NAME$2].noConflict = function () { 1318 $__default['default'].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1319 return Carousel._jQueryInterface; 1320 }; 1321 1322 /** 1323 * ------------------------------------------------------------------------ 1324 * Constants 1325 * ------------------------------------------------------------------------ 1326 */ 1327 1328 var NAME$3 = 'collapse'; 1329 var VERSION$3 = '4.5.3'; 1330 var DATA_KEY$3 = 'bs.collapse'; 1331 var EVENT_KEY$3 = "." + DATA_KEY$3; 1332 var DATA_API_KEY$3 = '.data-api'; 1333 var JQUERY_NO_CONFLICT$3 = $__default['default'].fn[NAME$3]; 1334 var Default$1 = { 1335 toggle: true, 1336 parent: '' 1337 }; 1338 var DefaultType$1 = { 1339 toggle: 'boolean', 1340 parent: '(string|element)' 1341 }; 1342 var EVENT_SHOW = "show" + EVENT_KEY$3; 1343 var EVENT_SHOWN = "shown" + EVENT_KEY$3; 1344 var EVENT_HIDE = "hide" + EVENT_KEY$3; 1345 var EVENT_HIDDEN = "hidden" + EVENT_KEY$3; 1346 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3; 1347 var CLASS_NAME_SHOW$1 = 'show'; 1348 var CLASS_NAME_COLLAPSE = 'collapse'; 1349 var CLASS_NAME_COLLAPSING = 'collapsing'; 1350 var CLASS_NAME_COLLAPSED = 'collapsed'; 1351 var DIMENSION_WIDTH = 'width'; 1352 var DIMENSION_HEIGHT = 'height'; 1353 var SELECTOR_ACTIVES = '.show, .collapsing'; 1354 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]'; 1355 /** 1356 * ------------------------------------------------------------------------ 1357 * Class Definition 1358 * ------------------------------------------------------------------------ 1359 */ 1360 1361 var Collapse = /*#__PURE__*/function () { 1362 function Collapse(element, config) { 1363 this._isTransitioning = false; 1364 this._element = element; 1365 this._config = this._getConfig(config); 1366 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1367 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1)); 1368 1369 for (var i = 0, len = toggleList.length; i < len; i++) { 1370 var elem = toggleList[i]; 1371 var selector = Util.getSelectorFromElement(elem); 1372 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1373 return foundElem === element; 1374 }); 1375 1376 if (selector !== null && filterElement.length > 0) { 1377 this._selector = selector; 1378 1379 this._triggerArray.push(elem); 1380 } 1381 } 1382 1383 this._parent = this._config.parent ? this._getParent() : null; 1384 1385 if (!this._config.parent) { 1386 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1387 } 1388 1389 if (this._config.toggle) { 1390 this.toggle(); 1391 } 1392 } // Getters 1393 1394 1395 var _proto = Collapse.prototype; 1396 1397 // Public 1398 _proto.toggle = function toggle() { 1399 if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1400 this.hide(); 1401 } else { 1402 this.show(); 1403 } 1404 }; 1405 1406 _proto.show = function show() { 1407 var _this = this; 1408 1409 if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1410 return; 1411 } 1412 1413 var actives; 1414 var activesData; 1415 1416 if (this._parent) { 1417 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 1418 if (typeof _this._config.parent === 'string') { 1419 return elem.getAttribute('data-parent') === _this._config.parent; 1420 } 1421 1422 return elem.classList.contains(CLASS_NAME_COLLAPSE); 1423 }); 1424 1425 if (actives.length === 0) { 1426 actives = null; 1427 } 1428 } 1429 1430 if (actives) { 1431 activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY$3); 1432 1433 if (activesData && activesData._isTransitioning) { 1434 return; 1435 } 1436 } 1437 1438 var startEvent = $__default['default'].Event(EVENT_SHOW); 1439 $__default['default'](this._element).trigger(startEvent); 1440 1441 if (startEvent.isDefaultPrevented()) { 1442 return; 1443 } 1444 1445 if (actives) { 1446 Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide'); 1447 1448 if (!activesData) { 1449 $__default['default'](actives).data(DATA_KEY$3, null); 1450 } 1451 } 1452 1453 var dimension = this._getDimension(); 1454 1455 $__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 1456 this._element.style[dimension] = 0; 1457 1458 if (this._triggerArray.length) { 1459 $__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 1460 } 1461 1462 this.setTransitioning(true); 1463 1464 var complete = function complete() { 1465 $__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 1466 _this._element.style[dimension] = ''; 1467 1468 _this.setTransitioning(false); 1469 1470 $__default['default'](_this._element).trigger(EVENT_SHOWN); 1471 }; 1472 1473 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1474 var scrollSize = "scroll" + capitalizedDimension; 1475 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1476 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1477 this._element.style[dimension] = this._element[scrollSize] + "px"; 1478 }; 1479 1480 _proto.hide = function hide() { 1481 var _this2 = this; 1482 1483 if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1484 return; 1485 } 1486 1487 var startEvent = $__default['default'].Event(EVENT_HIDE); 1488 $__default['default'](this._element).trigger(startEvent); 1489 1490 if (startEvent.isDefaultPrevented()) { 1491 return; 1492 } 1493 1494 var dimension = this._getDimension(); 1495 1496 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1497 Util.reflow(this._element); 1498 $__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 1499 var triggerArrayLength = this._triggerArray.length; 1500 1501 if (triggerArrayLength > 0) { 1502 for (var i = 0; i < triggerArrayLength; i++) { 1503 var trigger = this._triggerArray[i]; 1504 var selector = Util.getSelectorFromElement(trigger); 1505 1506 if (selector !== null) { 1507 var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector))); 1508 1509 if (!$elem.hasClass(CLASS_NAME_SHOW$1)) { 1510 $__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 1511 } 1512 } 1513 } 1514 } 1515 1516 this.setTransitioning(true); 1517 1518 var complete = function complete() { 1519 _this2.setTransitioning(false); 1520 1521 $__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN); 1522 }; 1523 1524 this._element.style[dimension] = ''; 1525 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1526 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1527 }; 1528 1529 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1530 this._isTransitioning = isTransitioning; 1531 }; 1532 1533 _proto.dispose = function dispose() { 1534 $__default['default'].removeData(this._element, DATA_KEY$3); 1535 this._config = null; 1536 this._parent = null; 1537 this._element = null; 1538 this._triggerArray = null; 1539 this._isTransitioning = null; 1540 } // Private 1541 ; 1542 1543 _proto._getConfig = function _getConfig(config) { 1544 config = _extends({}, Default$1, config); 1545 config.toggle = Boolean(config.toggle); // Coerce string values 1546 1547 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 1548 return config; 1549 }; 1550 1551 _proto._getDimension = function _getDimension() { 1552 var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH); 1553 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 1554 }; 1555 1556 _proto._getParent = function _getParent() { 1557 var _this3 = this; 1558 1559 var parent; 1560 1561 if (Util.isElement(this._config.parent)) { 1562 parent = this._config.parent; // It's a jQuery object 1563 1564 if (typeof this._config.parent.jquery !== 'undefined') { 1565 parent = this._config.parent[0]; 1566 } 1567 } else { 1568 parent = document.querySelector(this._config.parent); 1569 } 1570 1571 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1572 var children = [].slice.call(parent.querySelectorAll(selector)); 1573 $__default['default'](children).each(function (i, element) { 1574 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1575 }); 1576 return parent; 1577 }; 1578 1579 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1580 var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW$1); 1581 1582 if (triggerArray.length) { 1583 $__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1584 } 1585 } // Static 1586 ; 1587 1588 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1589 var selector = Util.getSelectorFromElement(element); 1590 return selector ? document.querySelector(selector) : null; 1591 }; 1592 1593 Collapse._jQueryInterface = function _jQueryInterface(config) { 1594 return this.each(function () { 1595 var $element = $__default['default'](this); 1596 var data = $element.data(DATA_KEY$3); 1597 1598 var _config = _extends({}, Default$1, $element.data(), typeof config === 'object' && config ? config : {}); 1599 1600 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 1601 _config.toggle = false; 1602 } 1603 1604 if (!data) { 1605 data = new Collapse(this, _config); 1606 $element.data(DATA_KEY$3, data); 1607 } 1608 1609 if (typeof config === 'string') { 1610 if (typeof data[config] === 'undefined') { 1611 throw new TypeError("No method named \"" + config + "\""); 1612 } 1613 1614 data[config](); 1615 } 1616 }); 1617 }; 1618 1619 _createClass(Collapse, null, [{ 1620 key: "VERSION", 1621 get: function get() { 1622 return VERSION$3; 1623 } 1624 }, { 1625 key: "Default", 1626 get: function get() { 1627 return Default$1; 1628 } 1629 }]); 1630 1631 return Collapse; 1632 }(); 1633 /** 1634 * ------------------------------------------------------------------------ 1635 * Data Api implementation 1636 * ------------------------------------------------------------------------ 1637 */ 1638 1639 1640 $__default['default'](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) { 1641 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1642 if (event.currentTarget.tagName === 'A') { 1643 event.preventDefault(); 1644 } 1645 1646 var $trigger = $__default['default'](this); 1647 var selector = Util.getSelectorFromElement(this); 1648 var selectors = [].slice.call(document.querySelectorAll(selector)); 1649 $__default['default'](selectors).each(function () { 1650 var $target = $__default['default'](this); 1651 var data = $target.data(DATA_KEY$3); 1652 var config = data ? 'toggle' : $trigger.data(); 1653 1654 Collapse._jQueryInterface.call($target, config); 1655 }); 1656 }); 1657 /** 1658 * ------------------------------------------------------------------------ 1659 * jQuery 1660 * ------------------------------------------------------------------------ 1661 */ 1662 1663 $__default['default'].fn[NAME$3] = Collapse._jQueryInterface; 1664 $__default['default'].fn[NAME$3].Constructor = Collapse; 1665 1666 $__default['default'].fn[NAME$3].noConflict = function () { 1667 $__default['default'].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 1668 return Collapse._jQueryInterface; 1669 }; 1670 1671 /** 1672 * ------------------------------------------------------------------------ 1673 * Constants 1674 * ------------------------------------------------------------------------ 1675 */ 1676 1677 var NAME$4 = 'dropdown'; 1678 var VERSION$4 = '4.5.3'; 1679 var DATA_KEY$4 = 'bs.dropdown'; 1680 var EVENT_KEY$4 = "." + DATA_KEY$4; 1681 var DATA_API_KEY$4 = '.data-api'; 1682 var JQUERY_NO_CONFLICT$4 = $__default['default'].fn[NAME$4]; 1683 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 1684 1685 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 1686 1687 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 1688 1689 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 1690 1691 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 1692 1693 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 1694 1695 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 1696 var EVENT_HIDE$1 = "hide" + EVENT_KEY$4; 1697 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4; 1698 var EVENT_SHOW$1 = "show" + EVENT_KEY$4; 1699 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4; 1700 var EVENT_CLICK = "click" + EVENT_KEY$4; 1701 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4; 1702 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4; 1703 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4; 1704 var CLASS_NAME_DISABLED = 'disabled'; 1705 var CLASS_NAME_SHOW$2 = 'show'; 1706 var CLASS_NAME_DROPUP = 'dropup'; 1707 var CLASS_NAME_DROPRIGHT = 'dropright'; 1708 var CLASS_NAME_DROPLEFT = 'dropleft'; 1709 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 1710 var CLASS_NAME_POSITION_STATIC = 'position-static'; 1711 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 1712 var SELECTOR_FORM_CHILD = '.dropdown form'; 1713 var SELECTOR_MENU = '.dropdown-menu'; 1714 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 1715 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 1716 var PLACEMENT_TOP = 'top-start'; 1717 var PLACEMENT_TOPEND = 'top-end'; 1718 var PLACEMENT_BOTTOM = 'bottom-start'; 1719 var PLACEMENT_BOTTOMEND = 'bottom-end'; 1720 var PLACEMENT_RIGHT = 'right-start'; 1721 var PLACEMENT_LEFT = 'left-start'; 1722 var Default$2 = { 1723 offset: 0, 1724 flip: true, 1725 boundary: 'scrollParent', 1726 reference: 'toggle', 1727 display: 'dynamic', 1728 popperConfig: null 1729 }; 1730 var DefaultType$2 = { 1731 offset: '(number|string|function)', 1732 flip: 'boolean', 1733 boundary: '(string|element)', 1734 reference: '(string|element)', 1735 display: 'string', 1736 popperConfig: '(null|object)' 1737 }; 1738 /** 1739 * ------------------------------------------------------------------------ 1740 * Class Definition 1741 * ------------------------------------------------------------------------ 1742 */ 1743 1744 var Dropdown = /*#__PURE__*/function () { 1745 function Dropdown(element, config) { 1746 this._element = element; 1747 this._popper = null; 1748 this._config = this._getConfig(config); 1749 this._menu = this._getMenuElement(); 1750 this._inNavbar = this._detectNavbar(); 1751 1752 this._addEventListeners(); 1753 } // Getters 1754 1755 1756 var _proto = Dropdown.prototype; 1757 1758 // Public 1759 _proto.toggle = function toggle() { 1760 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) { 1761 return; 1762 } 1763 1764 var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2); 1765 1766 Dropdown._clearMenus(); 1767 1768 if (isActive) { 1769 return; 1770 } 1771 1772 this.show(true); 1773 }; 1774 1775 _proto.show = function show(usePopper) { 1776 if (usePopper === void 0) { 1777 usePopper = false; 1778 } 1779 1780 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) { 1781 return; 1782 } 1783 1784 var relatedTarget = { 1785 relatedTarget: this._element 1786 }; 1787 var showEvent = $__default['default'].Event(EVENT_SHOW$1, relatedTarget); 1788 1789 var parent = Dropdown._getParentFromElement(this._element); 1790 1791 $__default['default'](parent).trigger(showEvent); 1792 1793 if (showEvent.isDefaultPrevented()) { 1794 return; 1795 } // Disable totally Popper.js for Dropdown in Navbar 1796 1797 1798 if (!this._inNavbar && usePopper) { 1799 /** 1800 * Check for Popper dependency 1801 * Popper - https://popper.js.org 1802 */ 1803 if (typeof Popper__default['default'] === 'undefined') { 1804 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 1805 } 1806 1807 var referenceElement = this._element; 1808 1809 if (this._config.reference === 'parent') { 1810 referenceElement = parent; 1811 } else if (Util.isElement(this._config.reference)) { 1812 referenceElement = this._config.reference; // Check if it's jQuery element 1813 1814 if (typeof this._config.reference.jquery !== 'undefined') { 1815 referenceElement = this._config.reference[0]; 1816 } 1817 } // If boundary is not `scrollParent`, then set position to `static` 1818 // to allow the menu to "escape" the scroll parent's boundaries 1819 // https://github.com/twbs/bootstrap/issues/24251 1820 1821 1822 if (this._config.boundary !== 'scrollParent') { 1823 $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC); 1824 } 1825 1826 this._popper = new Popper__default['default'](referenceElement, this._menu, this._getPopperConfig()); 1827 } // If this is a touch-enabled device we add extra 1828 // empty mouseover listeners to the body's immediate children; 1829 // only needed because of broken event delegation on iOS 1830 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 1831 1832 1833 if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 1834 $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); 1835 } 1836 1837 this._element.focus(); 1838 1839 this._element.setAttribute('aria-expanded', true); 1840 1841 $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2); 1842 $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_SHOWN$1, relatedTarget)); 1843 }; 1844 1845 _proto.hide = function hide() { 1846 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) { 1847 return; 1848 } 1849 1850 var relatedTarget = { 1851 relatedTarget: this._element 1852 }; 1853 var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget); 1854 1855 var parent = Dropdown._getParentFromElement(this._element); 1856 1857 $__default['default'](parent).trigger(hideEvent); 1858 1859 if (hideEvent.isDefaultPrevented()) { 1860 return; 1861 } 1862 1863 if (this._popper) { 1864 this._popper.destroy(); 1865 } 1866 1867 $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2); 1868 $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget)); 1869 }; 1870 1871 _proto.dispose = function dispose() { 1872 $__default['default'].removeData(this._element, DATA_KEY$4); 1873 $__default['default'](this._element).off(EVENT_KEY$4); 1874 this._element = null; 1875 this._menu = null; 1876 1877 if (this._popper !== null) { 1878 this._popper.destroy(); 1879 1880 this._popper = null; 1881 } 1882 }; 1883 1884 _proto.update = function update() { 1885 this._inNavbar = this._detectNavbar(); 1886 1887 if (this._popper !== null) { 1888 this._popper.scheduleUpdate(); 1889 } 1890 } // Private 1891 ; 1892 1893 _proto._addEventListeners = function _addEventListeners() { 1894 var _this = this; 1895 1896 $__default['default'](this._element).on(EVENT_CLICK, function (event) { 1897 event.preventDefault(); 1898 event.stopPropagation(); 1899 1900 _this.toggle(); 1901 }); 1902 }; 1903 1904 _proto._getConfig = function _getConfig(config) { 1905 config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config); 1906 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 1907 return config; 1908 }; 1909 1910 _proto._getMenuElement = function _getMenuElement() { 1911 if (!this._menu) { 1912 var parent = Dropdown._getParentFromElement(this._element); 1913 1914 if (parent) { 1915 this._menu = parent.querySelector(SELECTOR_MENU); 1916 } 1917 } 1918 1919 return this._menu; 1920 }; 1921 1922 _proto._getPlacement = function _getPlacement() { 1923 var $parentDropdown = $__default['default'](this._element.parentNode); 1924 var placement = PLACEMENT_BOTTOM; // Handle dropup 1925 1926 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 1927 placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 1928 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 1929 placement = PLACEMENT_RIGHT; 1930 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 1931 placement = PLACEMENT_LEFT; 1932 } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 1933 placement = PLACEMENT_BOTTOMEND; 1934 } 1935 1936 return placement; 1937 }; 1938 1939 _proto._detectNavbar = function _detectNavbar() { 1940 return $__default['default'](this._element).closest('.navbar').length > 0; 1941 }; 1942 1943 _proto._getOffset = function _getOffset() { 1944 var _this2 = this; 1945 1946 var offset = {}; 1947 1948 if (typeof this._config.offset === 'function') { 1949 offset.fn = function (data) { 1950 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 1951 return data; 1952 }; 1953 } else { 1954 offset.offset = this._config.offset; 1955 } 1956 1957 return offset; 1958 }; 1959 1960 _proto._getPopperConfig = function _getPopperConfig() { 1961 var popperConfig = { 1962 placement: this._getPlacement(), 1963 modifiers: { 1964 offset: this._getOffset(), 1965 flip: { 1966 enabled: this._config.flip 1967 }, 1968 preventOverflow: { 1969 boundariesElement: this._config.boundary 1970 } 1971 } 1972 }; // Disable Popper.js if we have a static display 1973 1974 if (this._config.display === 'static') { 1975 popperConfig.modifiers.applyStyle = { 1976 enabled: false 1977 }; 1978 } 1979 1980 return _extends({}, popperConfig, this._config.popperConfig); 1981 } // Static 1982 ; 1983 1984 Dropdown._jQueryInterface = function _jQueryInterface(config) { 1985 return this.each(function () { 1986 var data = $__default['default'](this).data(DATA_KEY$4); 1987 1988 var _config = typeof config === 'object' ? config : null; 1989 1990 if (!data) { 1991 data = new Dropdown(this, _config); 1992 $__default['default'](this).data(DATA_KEY$4, data); 1993 } 1994 1995 if (typeof config === 'string') { 1996 if (typeof data[config] === 'undefined') { 1997 throw new TypeError("No method named \"" + config + "\""); 1998 } 1999 2000 data[config](); 2001 } 2002 }); 2003 }; 2004 2005 Dropdown._clearMenus = function _clearMenus(event) { 2006 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 2007 return; 2008 } 2009 2010 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 2011 2012 for (var i = 0, len = toggles.length; i < len; i++) { 2013 var parent = Dropdown._getParentFromElement(toggles[i]); 2014 2015 var context = $__default['default'](toggles[i]).data(DATA_KEY$4); 2016 var relatedTarget = { 2017 relatedTarget: toggles[i] 2018 }; 2019 2020 if (event && event.type === 'click') { 2021 relatedTarget.clickEvent = event; 2022 } 2023 2024 if (!context) { 2025 continue; 2026 } 2027 2028 var dropdownMenu = context._menu; 2029 2030 if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW$2)) { 2031 continue; 2032 } 2033 2034 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default['default'].contains(parent, event.target)) { 2035 continue; 2036 } 2037 2038 var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget); 2039 $__default['default'](parent).trigger(hideEvent); 2040 2041 if (hideEvent.isDefaultPrevented()) { 2042 continue; 2043 } // If this is a touch-enabled device we remove the extra 2044 // empty mouseover listeners we added for iOS support 2045 2046 2047 if ('ontouchstart' in document.documentElement) { 2048 $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); 2049 } 2050 2051 toggles[i].setAttribute('aria-expanded', 'false'); 2052 2053 if (context._popper) { 2054 context._popper.destroy(); 2055 } 2056 2057 $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW$2); 2058 $__default['default'](parent).removeClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget)); 2059 } 2060 }; 2061 2062 Dropdown._getParentFromElement = function _getParentFromElement(element) { 2063 var parent; 2064 var selector = Util.getSelectorFromElement(element); 2065 2066 if (selector) { 2067 parent = document.querySelector(selector); 2068 } 2069 2070 return parent || element.parentNode; 2071 } // eslint-disable-next-line complexity 2072 ; 2073 2074 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 2075 // If not input/textarea: 2076 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 2077 // If input/textarea: 2078 // - If space key => not a dropdown command 2079 // - If key is other than escape 2080 // - If key is not up or down => not a dropdown command 2081 // - If trigger inside the menu => not a dropdown command 2082 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default['default'](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 2083 return; 2084 } 2085 2086 if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) { 2087 return; 2088 } 2089 2090 var parent = Dropdown._getParentFromElement(this); 2091 2092 var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW$2); 2093 2094 if (!isActive && event.which === ESCAPE_KEYCODE) { 2095 return; 2096 } 2097 2098 event.preventDefault(); 2099 event.stopPropagation(); 2100 2101 if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) { 2102 if (event.which === ESCAPE_KEYCODE) { 2103 $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 2104 } 2105 2106 $__default['default'](this).trigger('click'); 2107 return; 2108 } 2109 2110 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 2111 return $__default['default'](item).is(':visible'); 2112 }); 2113 2114 if (items.length === 0) { 2115 return; 2116 } 2117 2118 var index = items.indexOf(event.target); 2119 2120 if (event.which === ARROW_UP_KEYCODE && index > 0) { 2121 // Up 2122 index--; 2123 } 2124 2125 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 2126 // Down 2127 index++; 2128 } 2129 2130 if (index < 0) { 2131 index = 0; 2132 } 2133 2134 items[index].focus(); 2135 }; 2136 2137 _createClass(Dropdown, null, [{ 2138 key: "VERSION", 2139 get: function get() { 2140 return VERSION$4; 2141 } 2142 }, { 2143 key: "Default", 2144 get: function get() { 2145 return Default$2; 2146 } 2147 }, { 2148 key: "DefaultType", 2149 get: function get() { 2150 return DefaultType$2; 2151 } 2152 }]); 2153 2154 return Dropdown; 2155 }(); 2156 /** 2157 * ------------------------------------------------------------------------ 2158 * Data Api implementation 2159 * ------------------------------------------------------------------------ 2160 */ 2161 2162 2163 $__default['default'](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$4 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) { 2164 event.preventDefault(); 2165 event.stopPropagation(); 2166 2167 Dropdown._jQueryInterface.call($__default['default'](this), 'toggle'); 2168 }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) { 2169 e.stopPropagation(); 2170 }); 2171 /** 2172 * ------------------------------------------------------------------------ 2173 * jQuery 2174 * ------------------------------------------------------------------------ 2175 */ 2176 2177 $__default['default'].fn[NAME$4] = Dropdown._jQueryInterface; 2178 $__default['default'].fn[NAME$4].Constructor = Dropdown; 2179 2180 $__default['default'].fn[NAME$4].noConflict = function () { 2181 $__default['default'].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 2182 return Dropdown._jQueryInterface; 2183 }; 2184 2185 /** 2186 * ------------------------------------------------------------------------ 2187 * Constants 2188 * ------------------------------------------------------------------------ 2189 */ 2190 2191 var NAME$5 = 'modal'; 2192 var VERSION$5 = '4.5.3'; 2193 var DATA_KEY$5 = 'bs.modal'; 2194 var EVENT_KEY$5 = "." + DATA_KEY$5; 2195 var DATA_API_KEY$5 = '.data-api'; 2196 var JQUERY_NO_CONFLICT$5 = $__default['default'].fn[NAME$5]; 2197 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 2198 2199 var Default$3 = { 2200 backdrop: true, 2201 keyboard: true, 2202 focus: true, 2203 show: true 2204 }; 2205 var DefaultType$3 = { 2206 backdrop: '(boolean|string)', 2207 keyboard: 'boolean', 2208 focus: 'boolean', 2209 show: 'boolean' 2210 }; 2211 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 2212 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 2213 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 2214 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 2215 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 2216 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 2217 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 2218 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5; 2219 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 2220 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 2221 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 2222 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5; 2223 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 2224 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 2225 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 2226 var CLASS_NAME_OPEN = 'modal-open'; 2227 var CLASS_NAME_FADE$1 = 'fade'; 2228 var CLASS_NAME_SHOW$3 = 'show'; 2229 var CLASS_NAME_STATIC = 'modal-static'; 2230 var SELECTOR_DIALOG = '.modal-dialog'; 2231 var SELECTOR_MODAL_BODY = '.modal-body'; 2232 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]'; 2233 var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]'; 2234 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 2235 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 2236 /** 2237 * ------------------------------------------------------------------------ 2238 * Class Definition 2239 * ------------------------------------------------------------------------ 2240 */ 2241 2242 var Modal = /*#__PURE__*/function () { 2243 function Modal(element, config) { 2244 this._config = this._getConfig(config); 2245 this._element = element; 2246 this._dialog = element.querySelector(SELECTOR_DIALOG); 2247 this._backdrop = null; 2248 this._isShown = false; 2249 this._isBodyOverflowing = false; 2250 this._ignoreBackdropClick = false; 2251 this._isTransitioning = false; 2252 this._scrollbarWidth = 0; 2253 } // Getters 2254 2255 2256 var _proto = Modal.prototype; 2257 2258 // Public 2259 _proto.toggle = function toggle(relatedTarget) { 2260 return this._isShown ? this.hide() : this.show(relatedTarget); 2261 }; 2262 2263 _proto.show = function show(relatedTarget) { 2264 var _this = this; 2265 2266 if (this._isShown || this._isTransitioning) { 2267 return; 2268 } 2269 2270 if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) { 2271 this._isTransitioning = true; 2272 } 2273 2274 var showEvent = $__default['default'].Event(EVENT_SHOW$2, { 2275 relatedTarget: relatedTarget 2276 }); 2277 $__default['default'](this._element).trigger(showEvent); 2278 2279 if (this._isShown || showEvent.isDefaultPrevented()) { 2280 return; 2281 } 2282 2283 this._isShown = true; 2284 2285 this._checkScrollbar(); 2286 2287 this._setScrollbar(); 2288 2289 this._adjustDialog(); 2290 2291 this._setEscapeEvent(); 2292 2293 this._setResizeEvent(); 2294 2295 $__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) { 2296 return _this.hide(event); 2297 }); 2298 $__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 2299 $__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 2300 if ($__default['default'](event.target).is(_this._element)) { 2301 _this._ignoreBackdropClick = true; 2302 } 2303 }); 2304 }); 2305 2306 this._showBackdrop(function () { 2307 return _this._showElement(relatedTarget); 2308 }); 2309 }; 2310 2311 _proto.hide = function hide(event) { 2312 var _this2 = this; 2313 2314 if (event) { 2315 event.preventDefault(); 2316 } 2317 2318 if (!this._isShown || this._isTransitioning) { 2319 return; 2320 } 2321 2322 var hideEvent = $__default['default'].Event(EVENT_HIDE$2); 2323 $__default['default'](this._element).trigger(hideEvent); 2324 2325 if (!this._isShown || hideEvent.isDefaultPrevented()) { 2326 return; 2327 } 2328 2329 this._isShown = false; 2330 var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1); 2331 2332 if (transition) { 2333 this._isTransitioning = true; 2334 } 2335 2336 this._setEscapeEvent(); 2337 2338 this._setResizeEvent(); 2339 2340 $__default['default'](document).off(EVENT_FOCUSIN); 2341 $__default['default'](this._element).removeClass(CLASS_NAME_SHOW$3); 2342 $__default['default'](this._element).off(EVENT_CLICK_DISMISS); 2343 $__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 2344 2345 if (transition) { 2346 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 2347 $__default['default'](this._element).one(Util.TRANSITION_END, function (event) { 2348 return _this2._hideModal(event); 2349 }).emulateTransitionEnd(transitionDuration); 2350 } else { 2351 this._hideModal(); 2352 } 2353 }; 2354 2355 _proto.dispose = function dispose() { 2356 [window, this._element, this._dialog].forEach(function (htmlElement) { 2357 return $__default['default'](htmlElement).off(EVENT_KEY$5); 2358 }); 2359 /** 2360 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 2361 * Do not move `document` in `htmlElements` array 2362 * It will remove `EVENT_CLICK_DATA_API` event that should remain 2363 */ 2364 2365 $__default['default'](document).off(EVENT_FOCUSIN); 2366 $__default['default'].removeData(this._element, DATA_KEY$5); 2367 this._config = null; 2368 this._element = null; 2369 this._dialog = null; 2370 this._backdrop = null; 2371 this._isShown = null; 2372 this._isBodyOverflowing = null; 2373 this._ignoreBackdropClick = null; 2374 this._isTransitioning = null; 2375 this._scrollbarWidth = null; 2376 }; 2377 2378 _proto.handleUpdate = function handleUpdate() { 2379 this._adjustDialog(); 2380 } // Private 2381 ; 2382 2383 _proto._getConfig = function _getConfig(config) { 2384 config = _extends({}, Default$3, config); 2385 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 2386 return config; 2387 }; 2388 2389 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 2390 var _this3 = this; 2391 2392 if (this._config.backdrop === 'static') { 2393 var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED); 2394 $__default['default'](this._element).trigger(hideEventPrevented); 2395 2396 if (hideEventPrevented.isDefaultPrevented()) { 2397 return; 2398 } 2399 2400 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2401 2402 if (!isModalOverflowing) { 2403 this._element.style.overflowY = 'hidden'; 2404 } 2405 2406 this._element.classList.add(CLASS_NAME_STATIC); 2407 2408 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 2409 $__default['default'](this._element).off(Util.TRANSITION_END); 2410 $__default['default'](this._element).one(Util.TRANSITION_END, function () { 2411 _this3._element.classList.remove(CLASS_NAME_STATIC); 2412 2413 if (!isModalOverflowing) { 2414 $__default['default'](_this3._element).one(Util.TRANSITION_END, function () { 2415 _this3._element.style.overflowY = ''; 2416 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 2417 } 2418 }).emulateTransitionEnd(modalTransitionDuration); 2419 2420 this._element.focus(); 2421 } else { 2422 this.hide(); 2423 } 2424 }; 2425 2426 _proto._showElement = function _showElement(relatedTarget) { 2427 var _this4 = this; 2428 2429 var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1); 2430 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 2431 2432 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 2433 // Don't move modal's DOM position 2434 document.body.appendChild(this._element); 2435 } 2436 2437 this._element.style.display = 'block'; 2438 2439 this._element.removeAttribute('aria-hidden'); 2440 2441 this._element.setAttribute('aria-modal', true); 2442 2443 this._element.setAttribute('role', 'dialog'); 2444 2445 if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 2446 modalBody.scrollTop = 0; 2447 } else { 2448 this._element.scrollTop = 0; 2449 } 2450 2451 if (transition) { 2452 Util.reflow(this._element); 2453 } 2454 2455 $__default['default'](this._element).addClass(CLASS_NAME_SHOW$3); 2456 2457 if (this._config.focus) { 2458 this._enforceFocus(); 2459 } 2460 2461 var shownEvent = $__default['default'].Event(EVENT_SHOWN$2, { 2462 relatedTarget: relatedTarget 2463 }); 2464 2465 var transitionComplete = function transitionComplete() { 2466 if (_this4._config.focus) { 2467 _this4._element.focus(); 2468 } 2469 2470 _this4._isTransitioning = false; 2471 $__default['default'](_this4._element).trigger(shownEvent); 2472 }; 2473 2474 if (transition) { 2475 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 2476 $__default['default'](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 2477 } else { 2478 transitionComplete(); 2479 } 2480 }; 2481 2482 _proto._enforceFocus = function _enforceFocus() { 2483 var _this5 = this; 2484 2485 $__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 2486 .on(EVENT_FOCUSIN, function (event) { 2487 if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) { 2488 _this5._element.focus(); 2489 } 2490 }); 2491 }; 2492 2493 _proto._setEscapeEvent = function _setEscapeEvent() { 2494 var _this6 = this; 2495 2496 if (this._isShown) { 2497 $__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 2498 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 2499 event.preventDefault(); 2500 2501 _this6.hide(); 2502 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 2503 _this6._triggerBackdropTransition(); 2504 } 2505 }); 2506 } else if (!this._isShown) { 2507 $__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS); 2508 } 2509 }; 2510 2511 _proto._setResizeEvent = function _setResizeEvent() { 2512 var _this7 = this; 2513 2514 if (this._isShown) { 2515 $__default['default'](window).on(EVENT_RESIZE, function (event) { 2516 return _this7.handleUpdate(event); 2517 }); 2518 } else { 2519 $__default['default'](window).off(EVENT_RESIZE); 2520 } 2521 }; 2522 2523 _proto._hideModal = function _hideModal() { 2524 var _this8 = this; 2525 2526 this._element.style.display = 'none'; 2527 2528 this._element.setAttribute('aria-hidden', true); 2529 2530 this._element.removeAttribute('aria-modal'); 2531 2532 this._element.removeAttribute('role'); 2533 2534 this._isTransitioning = false; 2535 2536 this._showBackdrop(function () { 2537 $__default['default'](document.body).removeClass(CLASS_NAME_OPEN); 2538 2539 _this8._resetAdjustments(); 2540 2541 _this8._resetScrollbar(); 2542 2543 $__default['default'](_this8._element).trigger(EVENT_HIDDEN$2); 2544 }); 2545 }; 2546 2547 _proto._removeBackdrop = function _removeBackdrop() { 2548 if (this._backdrop) { 2549 $__default['default'](this._backdrop).remove(); 2550 this._backdrop = null; 2551 } 2552 }; 2553 2554 _proto._showBackdrop = function _showBackdrop(callback) { 2555 var _this9 = this; 2556 2557 var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : ''; 2558 2559 if (this._isShown && this._config.backdrop) { 2560 this._backdrop = document.createElement('div'); 2561 this._backdrop.className = CLASS_NAME_BACKDROP; 2562 2563 if (animate) { 2564 this._backdrop.classList.add(animate); 2565 } 2566 2567 $__default['default'](this._backdrop).appendTo(document.body); 2568 $__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) { 2569 if (_this9._ignoreBackdropClick) { 2570 _this9._ignoreBackdropClick = false; 2571 return; 2572 } 2573 2574 if (event.target !== event.currentTarget) { 2575 return; 2576 } 2577 2578 _this9._triggerBackdropTransition(); 2579 }); 2580 2581 if (animate) { 2582 Util.reflow(this._backdrop); 2583 } 2584 2585 $__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW$3); 2586 2587 if (!callback) { 2588 return; 2589 } 2590 2591 if (!animate) { 2592 callback(); 2593 return; 2594 } 2595 2596 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2597 $__default['default'](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 2598 } else if (!this._isShown && this._backdrop) { 2599 $__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW$3); 2600 2601 var callbackRemove = function callbackRemove() { 2602 _this9._removeBackdrop(); 2603 2604 if (callback) { 2605 callback(); 2606 } 2607 }; 2608 2609 if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) { 2610 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 2611 2612 $__default['default'](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 2613 } else { 2614 callbackRemove(); 2615 } 2616 } else if (callback) { 2617 callback(); 2618 } 2619 } // ---------------------------------------------------------------------- 2620 // the following methods are used to handle overflowing modals 2621 // todo (fat): these should probably be refactored out of modal.js 2622 // ---------------------------------------------------------------------- 2623 ; 2624 2625 _proto._adjustDialog = function _adjustDialog() { 2626 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 2627 2628 if (!this._isBodyOverflowing && isModalOverflowing) { 2629 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 2630 } 2631 2632 if (this._isBodyOverflowing && !isModalOverflowing) { 2633 this._element.style.paddingRight = this._scrollbarWidth + "px"; 2634 } 2635 }; 2636 2637 _proto._resetAdjustments = function _resetAdjustments() { 2638 this._element.style.paddingLeft = ''; 2639 this._element.style.paddingRight = ''; 2640 }; 2641 2642 _proto._checkScrollbar = function _checkScrollbar() { 2643 var rect = document.body.getBoundingClientRect(); 2644 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 2645 this._scrollbarWidth = this._getScrollbarWidth(); 2646 }; 2647 2648 _proto._setScrollbar = function _setScrollbar() { 2649 var _this10 = this; 2650 2651 if (this._isBodyOverflowing) { 2652 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 2653 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 2654 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 2655 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 2656 2657 $__default['default'](fixedContent).each(function (index, element) { 2658 var actualPadding = element.style.paddingRight; 2659 var calculatedPadding = $__default['default'](element).css('padding-right'); 2660 $__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 2661 }); // Adjust sticky content margin 2662 2663 $__default['default'](stickyContent).each(function (index, element) { 2664 var actualMargin = element.style.marginRight; 2665 var calculatedMargin = $__default['default'](element).css('margin-right'); 2666 $__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 2667 }); // Adjust body padding 2668 2669 var actualPadding = document.body.style.paddingRight; 2670 var calculatedPadding = $__default['default'](document.body).css('padding-right'); 2671 $__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 2672 } 2673 2674 $__default['default'](document.body).addClass(CLASS_NAME_OPEN); 2675 }; 2676 2677 _proto._resetScrollbar = function _resetScrollbar() { 2678 // Restore fixed content padding 2679 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 2680 $__default['default'](fixedContent).each(function (index, element) { 2681 var padding = $__default['default'](element).data('padding-right'); 2682 $__default['default'](element).removeData('padding-right'); 2683 element.style.paddingRight = padding ? padding : ''; 2684 }); // Restore sticky content 2685 2686 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 2687 $__default['default'](elements).each(function (index, element) { 2688 var margin = $__default['default'](element).data('margin-right'); 2689 2690 if (typeof margin !== 'undefined') { 2691 $__default['default'](element).css('margin-right', margin).removeData('margin-right'); 2692 } 2693 }); // Restore body padding 2694 2695 var padding = $__default['default'](document.body).data('padding-right'); 2696 $__default['default'](document.body).removeData('padding-right'); 2697 document.body.style.paddingRight = padding ? padding : ''; 2698 }; 2699 2700 _proto._getScrollbarWidth = function _getScrollbarWidth() { 2701 // thx d.walsh 2702 var scrollDiv = document.createElement('div'); 2703 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 2704 document.body.appendChild(scrollDiv); 2705 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 2706 document.body.removeChild(scrollDiv); 2707 return scrollbarWidth; 2708 } // Static 2709 ; 2710 2711 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 2712 return this.each(function () { 2713 var data = $__default['default'](this).data(DATA_KEY$5); 2714 2715 var _config = _extends({}, Default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {}); 2716 2717 if (!data) { 2718 data = new Modal(this, _config); 2719 $__default['default'](this).data(DATA_KEY$5, data); 2720 } 2721 2722 if (typeof config === 'string') { 2723 if (typeof data[config] === 'undefined') { 2724 throw new TypeError("No method named \"" + config + "\""); 2725 } 2726 2727 data[config](relatedTarget); 2728 } else if (_config.show) { 2729 data.show(relatedTarget); 2730 } 2731 }); 2732 }; 2733 2734 _createClass(Modal, null, [{ 2735 key: "VERSION", 2736 get: function get() { 2737 return VERSION$5; 2738 } 2739 }, { 2740 key: "Default", 2741 get: function get() { 2742 return Default$3; 2743 } 2744 }]); 2745 2746 return Modal; 2747 }(); 2748 /** 2749 * ------------------------------------------------------------------------ 2750 * Data Api implementation 2751 * ------------------------------------------------------------------------ 2752 */ 2753 2754 2755 $__default['default'](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) { 2756 var _this11 = this; 2757 2758 var target; 2759 var selector = Util.getSelectorFromElement(this); 2760 2761 if (selector) { 2762 target = document.querySelector(selector); 2763 } 2764 2765 var config = $__default['default'](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); 2766 2767 if (this.tagName === 'A' || this.tagName === 'AREA') { 2768 event.preventDefault(); 2769 } 2770 2771 var $target = $__default['default'](target).one(EVENT_SHOW$2, function (showEvent) { 2772 if (showEvent.isDefaultPrevented()) { 2773 // Only register focus restorer if modal will actually get shown 2774 return; 2775 } 2776 2777 $target.one(EVENT_HIDDEN$2, function () { 2778 if ($__default['default'](_this11).is(':visible')) { 2779 _this11.focus(); 2780 } 2781 }); 2782 }); 2783 2784 Modal._jQueryInterface.call($__default['default'](target), config, this); 2785 }); 2786 /** 2787 * ------------------------------------------------------------------------ 2788 * jQuery 2789 * ------------------------------------------------------------------------ 2790 */ 2791 2792 $__default['default'].fn[NAME$5] = Modal._jQueryInterface; 2793 $__default['default'].fn[NAME$5].Constructor = Modal; 2794 2795 $__default['default'].fn[NAME$5].noConflict = function () { 2796 $__default['default'].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 2797 return Modal._jQueryInterface; 2798 }; 2799 2800 /** 2801 * -------------------------------------------------------------------------- 2802 * Bootstrap (v4.5.3): tools/sanitizer.js 2803 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 2804 * -------------------------------------------------------------------------- 2805 */ 2806 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 2807 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 2808 var DefaultWhitelist = { 2809 // Global attributes allowed on any supplied element below. 2810 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 2811 a: ['target', 'href', 'title', 'rel'], 2812 area: [], 2813 b: [], 2814 br: [], 2815 col: [], 2816 code: [], 2817 div: [], 2818 em: [], 2819 hr: [], 2820 h1: [], 2821 h2: [], 2822 h3: [], 2823 h4: [], 2824 h5: [], 2825 h6: [], 2826 i: [], 2827 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 2828 li: [], 2829 ol: [], 2830 p: [], 2831 pre: [], 2832 s: [], 2833 small: [], 2834 span: [], 2835 sub: [], 2836 sup: [], 2837 strong: [], 2838 u: [], 2839 ul: [] 2840 }; 2841 /** 2842 * A pattern that recognizes a commonly useful subset of URLs that are safe. 2843 * 2844 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 2845 */ 2846 2847 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi; 2848 /** 2849 * A pattern that matches safe data URLs. Only matches image, video and audio types. 2850 * 2851 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 2852 */ 2853 2854 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 2855 2856 function allowedAttribute(attr, allowedAttributeList) { 2857 var attrName = attr.nodeName.toLowerCase(); 2858 2859 if (allowedAttributeList.indexOf(attrName) !== -1) { 2860 if (uriAttrs.indexOf(attrName) !== -1) { 2861 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 2862 } 2863 2864 return true; 2865 } 2866 2867 var regExp = allowedAttributeList.filter(function (attrRegex) { 2868 return attrRegex instanceof RegExp; 2869 }); // Check if a regular expression validates the attribute. 2870 2871 for (var i = 0, len = regExp.length; i < len; i++) { 2872 if (attrName.match(regExp[i])) { 2873 return true; 2874 } 2875 } 2876 2877 return false; 2878 } 2879 2880 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 2881 if (unsafeHtml.length === 0) { 2882 return unsafeHtml; 2883 } 2884 2885 if (sanitizeFn && typeof sanitizeFn === 'function') { 2886 return sanitizeFn(unsafeHtml); 2887 } 2888 2889 var domParser = new window.DOMParser(); 2890 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 2891 var whitelistKeys = Object.keys(whiteList); 2892 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 2893 2894 var _loop = function _loop(i, len) { 2895 var el = elements[i]; 2896 var elName = el.nodeName.toLowerCase(); 2897 2898 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 2899 el.parentNode.removeChild(el); 2900 return "continue"; 2901 } 2902 2903 var attributeList = [].slice.call(el.attributes); 2904 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 2905 attributeList.forEach(function (attr) { 2906 if (!allowedAttribute(attr, whitelistedAttributes)) { 2907 el.removeAttribute(attr.nodeName); 2908 } 2909 }); 2910 }; 2911 2912 for (var i = 0, len = elements.length; i < len; i++) { 2913 var _ret = _loop(i); 2914 2915 if (_ret === "continue") continue; 2916 } 2917 2918 return createdDocument.body.innerHTML; 2919 } 2920 2921 /** 2922 * ------------------------------------------------------------------------ 2923 * Constants 2924 * ------------------------------------------------------------------------ 2925 */ 2926 2927 var NAME$6 = 'tooltip'; 2928 var VERSION$6 = '4.5.3'; 2929 var DATA_KEY$6 = 'bs.tooltip'; 2930 var EVENT_KEY$6 = "." + DATA_KEY$6; 2931 var JQUERY_NO_CONFLICT$6 = $__default['default'].fn[NAME$6]; 2932 var CLASS_PREFIX = 'bs-tooltip'; 2933 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 2934 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 2935 var DefaultType$4 = { 2936 animation: 'boolean', 2937 template: 'string', 2938 title: '(string|element|function)', 2939 trigger: 'string', 2940 delay: '(number|object)', 2941 html: 'boolean', 2942 selector: '(string|boolean)', 2943 placement: '(string|function)', 2944 offset: '(number|string|function)', 2945 container: '(string|element|boolean)', 2946 fallbackPlacement: '(string|array)', 2947 boundary: '(string|element)', 2948 sanitize: 'boolean', 2949 sanitizeFn: '(null|function)', 2950 whiteList: 'object', 2951 popperConfig: '(null|object)' 2952 }; 2953 var AttachmentMap = { 2954 AUTO: 'auto', 2955 TOP: 'top', 2956 RIGHT: 'right', 2957 BOTTOM: 'bottom', 2958 LEFT: 'left' 2959 }; 2960 var Default$4 = { 2961 animation: true, 2962 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 2963 trigger: 'hover focus', 2964 title: '', 2965 delay: 0, 2966 html: false, 2967 selector: false, 2968 placement: 'top', 2969 offset: 0, 2970 container: false, 2971 fallbackPlacement: 'flip', 2972 boundary: 'scrollParent', 2973 sanitize: true, 2974 sanitizeFn: null, 2975 whiteList: DefaultWhitelist, 2976 popperConfig: null 2977 }; 2978 var HOVER_STATE_SHOW = 'show'; 2979 var HOVER_STATE_OUT = 'out'; 2980 var Event = { 2981 HIDE: "hide" + EVENT_KEY$6, 2982 HIDDEN: "hidden" + EVENT_KEY$6, 2983 SHOW: "show" + EVENT_KEY$6, 2984 SHOWN: "shown" + EVENT_KEY$6, 2985 INSERTED: "inserted" + EVENT_KEY$6, 2986 CLICK: "click" + EVENT_KEY$6, 2987 FOCUSIN: "focusin" + EVENT_KEY$6, 2988 FOCUSOUT: "focusout" + EVENT_KEY$6, 2989 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 2990 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 2991 }; 2992 var CLASS_NAME_FADE$2 = 'fade'; 2993 var CLASS_NAME_SHOW$4 = 'show'; 2994 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 2995 var SELECTOR_ARROW = '.arrow'; 2996 var TRIGGER_HOVER = 'hover'; 2997 var TRIGGER_FOCUS = 'focus'; 2998 var TRIGGER_CLICK = 'click'; 2999 var TRIGGER_MANUAL = 'manual'; 3000 /** 3001 * ------------------------------------------------------------------------ 3002 * Class Definition 3003 * ------------------------------------------------------------------------ 3004 */ 3005 3006 var Tooltip = /*#__PURE__*/function () { 3007 function Tooltip(element, config) { 3008 if (typeof Popper__default['default'] === 'undefined') { 3009 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 3010 } // private 3011 3012 3013 this._isEnabled = true; 3014 this._timeout = 0; 3015 this._hoverState = ''; 3016 this._activeTrigger = {}; 3017 this._popper = null; // Protected 3018 3019 this.element = element; 3020 this.config = this._getConfig(config); 3021 this.tip = null; 3022 3023 this._setListeners(); 3024 } // Getters 3025 3026 3027 var _proto = Tooltip.prototype; 3028 3029 // Public 3030 _proto.enable = function enable() { 3031 this._isEnabled = true; 3032 }; 3033 3034 _proto.disable = function disable() { 3035 this._isEnabled = false; 3036 }; 3037 3038 _proto.toggleEnabled = function toggleEnabled() { 3039 this._isEnabled = !this._isEnabled; 3040 }; 3041 3042 _proto.toggle = function toggle(event) { 3043 if (!this._isEnabled) { 3044 return; 3045 } 3046 3047 if (event) { 3048 var dataKey = this.constructor.DATA_KEY; 3049 var context = $__default['default'](event.currentTarget).data(dataKey); 3050 3051 if (!context) { 3052 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3053 $__default['default'](event.currentTarget).data(dataKey, context); 3054 } 3055 3056 context._activeTrigger.click = !context._activeTrigger.click; 3057 3058 if (context._isWithActiveTrigger()) { 3059 context._enter(null, context); 3060 } else { 3061 context._leave(null, context); 3062 } 3063 } else { 3064 if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) { 3065 this._leave(null, this); 3066 3067 return; 3068 } 3069 3070 this._enter(null, this); 3071 } 3072 }; 3073 3074 _proto.dispose = function dispose() { 3075 clearTimeout(this._timeout); 3076 $__default['default'].removeData(this.element, this.constructor.DATA_KEY); 3077 $__default['default'](this.element).off(this.constructor.EVENT_KEY); 3078 $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 3079 3080 if (this.tip) { 3081 $__default['default'](this.tip).remove(); 3082 } 3083 3084 this._isEnabled = null; 3085 this._timeout = null; 3086 this._hoverState = null; 3087 this._activeTrigger = null; 3088 3089 if (this._popper) { 3090 this._popper.destroy(); 3091 } 3092 3093 this._popper = null; 3094 this.element = null; 3095 this.config = null; 3096 this.tip = null; 3097 }; 3098 3099 _proto.show = function show() { 3100 var _this = this; 3101 3102 if ($__default['default'](this.element).css('display') === 'none') { 3103 throw new Error('Please use show on visible elements'); 3104 } 3105 3106 var showEvent = $__default['default'].Event(this.constructor.Event.SHOW); 3107 3108 if (this.isWithContent() && this._isEnabled) { 3109 $__default['default'](this.element).trigger(showEvent); 3110 var shadowRoot = Util.findShadowRoot(this.element); 3111 var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 3112 3113 if (showEvent.isDefaultPrevented() || !isInTheDom) { 3114 return; 3115 } 3116 3117 var tip = this.getTipElement(); 3118 var tipId = Util.getUID(this.constructor.NAME); 3119 tip.setAttribute('id', tipId); 3120 this.element.setAttribute('aria-describedby', tipId); 3121 this.setContent(); 3122 3123 if (this.config.animation) { 3124 $__default['default'](tip).addClass(CLASS_NAME_FADE$2); 3125 } 3126 3127 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 3128 3129 var attachment = this._getAttachment(placement); 3130 3131 this.addAttachmentClass(attachment); 3132 3133 var container = this._getContainer(); 3134 3135 $__default['default'](tip).data(this.constructor.DATA_KEY, this); 3136 3137 if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) { 3138 $__default['default'](tip).appendTo(container); 3139 } 3140 3141 $__default['default'](this.element).trigger(this.constructor.Event.INSERTED); 3142 this._popper = new Popper__default['default'](this.element, tip, this._getPopperConfig(attachment)); 3143 $__default['default'](tip).addClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we add extra 3144 // empty mouseover listeners to the body's immediate children; 3145 // only needed because of broken event delegation on iOS 3146 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3147 3148 if ('ontouchstart' in document.documentElement) { 3149 $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); 3150 } 3151 3152 var complete = function complete() { 3153 if (_this.config.animation) { 3154 _this._fixTransition(); 3155 } 3156 3157 var prevHoverState = _this._hoverState; 3158 _this._hoverState = null; 3159 $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN); 3160 3161 if (prevHoverState === HOVER_STATE_OUT) { 3162 _this._leave(null, _this); 3163 } 3164 }; 3165 3166 if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) { 3167 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 3168 $__default['default'](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3169 } else { 3170 complete(); 3171 } 3172 } 3173 }; 3174 3175 _proto.hide = function hide(callback) { 3176 var _this2 = this; 3177 3178 var tip = this.getTipElement(); 3179 var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE); 3180 3181 var complete = function complete() { 3182 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 3183 tip.parentNode.removeChild(tip); 3184 } 3185 3186 _this2._cleanTipClass(); 3187 3188 _this2.element.removeAttribute('aria-describedby'); 3189 3190 $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 3191 3192 if (_this2._popper !== null) { 3193 _this2._popper.destroy(); 3194 } 3195 3196 if (callback) { 3197 callback(); 3198 } 3199 }; 3200 3201 $__default['default'](this.element).trigger(hideEvent); 3202 3203 if (hideEvent.isDefaultPrevented()) { 3204 return; 3205 } 3206 3207 $__default['default'](tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra 3208 // empty mouseover listeners we added for iOS support 3209 3210 if ('ontouchstart' in document.documentElement) { 3211 $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); 3212 } 3213 3214 this._activeTrigger[TRIGGER_CLICK] = false; 3215 this._activeTrigger[TRIGGER_FOCUS] = false; 3216 this._activeTrigger[TRIGGER_HOVER] = false; 3217 3218 if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) { 3219 var transitionDuration = Util.getTransitionDurationFromElement(tip); 3220 $__default['default'](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3221 } else { 3222 complete(); 3223 } 3224 3225 this._hoverState = ''; 3226 }; 3227 3228 _proto.update = function update() { 3229 if (this._popper !== null) { 3230 this._popper.scheduleUpdate(); 3231 } 3232 } // Protected 3233 ; 3234 3235 _proto.isWithContent = function isWithContent() { 3236 return Boolean(this.getTitle()); 3237 }; 3238 3239 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3240 $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 3241 }; 3242 3243 _proto.getTipElement = function getTipElement() { 3244 this.tip = this.tip || $__default['default'](this.config.template)[0]; 3245 return this.tip; 3246 }; 3247 3248 _proto.setContent = function setContent() { 3249 var tip = this.getTipElement(); 3250 this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 3251 $__default['default'](tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4); 3252 }; 3253 3254 _proto.setElementContent = function setElementContent($element, content) { 3255 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 3256 // Content is a DOM node or a jQuery 3257 if (this.config.html) { 3258 if (!$__default['default'](content).parent().is($element)) { 3259 $element.empty().append(content); 3260 } 3261 } else { 3262 $element.text($__default['default'](content).text()); 3263 } 3264 3265 return; 3266 } 3267 3268 if (this.config.html) { 3269 if (this.config.sanitize) { 3270 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 3271 } 3272 3273 $element.html(content); 3274 } else { 3275 $element.text(content); 3276 } 3277 }; 3278 3279 _proto.getTitle = function getTitle() { 3280 var title = this.element.getAttribute('data-original-title'); 3281 3282 if (!title) { 3283 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 3284 } 3285 3286 return title; 3287 } // Private 3288 ; 3289 3290 _proto._getPopperConfig = function _getPopperConfig(attachment) { 3291 var _this3 = this; 3292 3293 var defaultBsConfig = { 3294 placement: attachment, 3295 modifiers: { 3296 offset: this._getOffset(), 3297 flip: { 3298 behavior: this.config.fallbackPlacement 3299 }, 3300 arrow: { 3301 element: SELECTOR_ARROW 3302 }, 3303 preventOverflow: { 3304 boundariesElement: this.config.boundary 3305 } 3306 }, 3307 onCreate: function onCreate(data) { 3308 if (data.originalPlacement !== data.placement) { 3309 _this3._handlePopperPlacementChange(data); 3310 } 3311 }, 3312 onUpdate: function onUpdate(data) { 3313 return _this3._handlePopperPlacementChange(data); 3314 } 3315 }; 3316 return _extends({}, defaultBsConfig, this.config.popperConfig); 3317 }; 3318 3319 _proto._getOffset = function _getOffset() { 3320 var _this4 = this; 3321 3322 var offset = {}; 3323 3324 if (typeof this.config.offset === 'function') { 3325 offset.fn = function (data) { 3326 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {}); 3327 return data; 3328 }; 3329 } else { 3330 offset.offset = this.config.offset; 3331 } 3332 3333 return offset; 3334 }; 3335 3336 _proto._getContainer = function _getContainer() { 3337 if (this.config.container === false) { 3338 return document.body; 3339 } 3340 3341 if (Util.isElement(this.config.container)) { 3342 return $__default['default'](this.config.container); 3343 } 3344 3345 return $__default['default'](document).find(this.config.container); 3346 }; 3347 3348 _proto._getAttachment = function _getAttachment(placement) { 3349 return AttachmentMap[placement.toUpperCase()]; 3350 }; 3351 3352 _proto._setListeners = function _setListeners() { 3353 var _this5 = this; 3354 3355 var triggers = this.config.trigger.split(' '); 3356 triggers.forEach(function (trigger) { 3357 if (trigger === 'click') { 3358 $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 3359 return _this5.toggle(event); 3360 }); 3361 } else if (trigger !== TRIGGER_MANUAL) { 3362 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 3363 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 3364 $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) { 3365 return _this5._enter(event); 3366 }).on(eventOut, _this5.config.selector, function (event) { 3367 return _this5._leave(event); 3368 }); 3369 } 3370 }); 3371 3372 this._hideModalHandler = function () { 3373 if (_this5.element) { 3374 _this5.hide(); 3375 } 3376 }; 3377 3378 $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 3379 3380 if (this.config.selector) { 3381 this.config = _extends({}, this.config, { 3382 trigger: 'manual', 3383 selector: '' 3384 }); 3385 } else { 3386 this._fixTitle(); 3387 } 3388 }; 3389 3390 _proto._fixTitle = function _fixTitle() { 3391 var titleType = typeof this.element.getAttribute('data-original-title'); 3392 3393 if (this.element.getAttribute('title') || titleType !== 'string') { 3394 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 3395 this.element.setAttribute('title', ''); 3396 } 3397 }; 3398 3399 _proto._enter = function _enter(event, context) { 3400 var dataKey = this.constructor.DATA_KEY; 3401 context = context || $__default['default'](event.currentTarget).data(dataKey); 3402 3403 if (!context) { 3404 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3405 $__default['default'](event.currentTarget).data(dataKey, context); 3406 } 3407 3408 if (event) { 3409 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 3410 } 3411 3412 if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) { 3413 context._hoverState = HOVER_STATE_SHOW; 3414 return; 3415 } 3416 3417 clearTimeout(context._timeout); 3418 context._hoverState = HOVER_STATE_SHOW; 3419 3420 if (!context.config.delay || !context.config.delay.show) { 3421 context.show(); 3422 return; 3423 } 3424 3425 context._timeout = setTimeout(function () { 3426 if (context._hoverState === HOVER_STATE_SHOW) { 3427 context.show(); 3428 } 3429 }, context.config.delay.show); 3430 }; 3431 3432 _proto._leave = function _leave(event, context) { 3433 var dataKey = this.constructor.DATA_KEY; 3434 context = context || $__default['default'](event.currentTarget).data(dataKey); 3435 3436 if (!context) { 3437 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3438 $__default['default'](event.currentTarget).data(dataKey, context); 3439 } 3440 3441 if (event) { 3442 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 3443 } 3444 3445 if (context._isWithActiveTrigger()) { 3446 return; 3447 } 3448 3449 clearTimeout(context._timeout); 3450 context._hoverState = HOVER_STATE_OUT; 3451 3452 if (!context.config.delay || !context.config.delay.hide) { 3453 context.hide(); 3454 return; 3455 } 3456 3457 context._timeout = setTimeout(function () { 3458 if (context._hoverState === HOVER_STATE_OUT) { 3459 context.hide(); 3460 } 3461 }, context.config.delay.hide); 3462 }; 3463 3464 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 3465 for (var trigger in this._activeTrigger) { 3466 if (this._activeTrigger[trigger]) { 3467 return true; 3468 } 3469 } 3470 3471 return false; 3472 }; 3473 3474 _proto._getConfig = function _getConfig(config) { 3475 var dataAttributes = $__default['default'](this.element).data(); 3476 Object.keys(dataAttributes).forEach(function (dataAttr) { 3477 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 3478 delete dataAttributes[dataAttr]; 3479 } 3480 }); 3481 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 3482 3483 if (typeof config.delay === 'number') { 3484 config.delay = { 3485 show: config.delay, 3486 hide: config.delay 3487 }; 3488 } 3489 3490 if (typeof config.title === 'number') { 3491 config.title = config.title.toString(); 3492 } 3493 3494 if (typeof config.content === 'number') { 3495 config.content = config.content.toString(); 3496 } 3497 3498 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 3499 3500 if (config.sanitize) { 3501 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 3502 } 3503 3504 return config; 3505 }; 3506 3507 _proto._getDelegateConfig = function _getDelegateConfig() { 3508 var config = {}; 3509 3510 if (this.config) { 3511 for (var key in this.config) { 3512 if (this.constructor.Default[key] !== this.config[key]) { 3513 config[key] = this.config[key]; 3514 } 3515 } 3516 } 3517 3518 return config; 3519 }; 3520 3521 _proto._cleanTipClass = function _cleanTipClass() { 3522 var $tip = $__default['default'](this.getTipElement()); 3523 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 3524 3525 if (tabClass !== null && tabClass.length) { 3526 $tip.removeClass(tabClass.join('')); 3527 } 3528 }; 3529 3530 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 3531 this.tip = popperData.instance.popper; 3532 3533 this._cleanTipClass(); 3534 3535 this.addAttachmentClass(this._getAttachment(popperData.placement)); 3536 }; 3537 3538 _proto._fixTransition = function _fixTransition() { 3539 var tip = this.getTipElement(); 3540 var initConfigAnimation = this.config.animation; 3541 3542 if (tip.getAttribute('x-placement') !== null) { 3543 return; 3544 } 3545 3546 $__default['default'](tip).removeClass(CLASS_NAME_FADE$2); 3547 this.config.animation = false; 3548 this.hide(); 3549 this.show(); 3550 this.config.animation = initConfigAnimation; 3551 } // Static 3552 ; 3553 3554 Tooltip._jQueryInterface = function _jQueryInterface(config) { 3555 return this.each(function () { 3556 var $element = $__default['default'](this); 3557 var data = $element.data(DATA_KEY$6); 3558 3559 var _config = typeof config === 'object' && config; 3560 3561 if (!data && /dispose|hide/.test(config)) { 3562 return; 3563 } 3564 3565 if (!data) { 3566 data = new Tooltip(this, _config); 3567 $element.data(DATA_KEY$6, data); 3568 } 3569 3570 if (typeof config === 'string') { 3571 if (typeof data[config] === 'undefined') { 3572 throw new TypeError("No method named \"" + config + "\""); 3573 } 3574 3575 data[config](); 3576 } 3577 }); 3578 }; 3579 3580 _createClass(Tooltip, null, [{ 3581 key: "VERSION", 3582 get: function get() { 3583 return VERSION$6; 3584 } 3585 }, { 3586 key: "Default", 3587 get: function get() { 3588 return Default$4; 3589 } 3590 }, { 3591 key: "NAME", 3592 get: function get() { 3593 return NAME$6; 3594 } 3595 }, { 3596 key: "DATA_KEY", 3597 get: function get() { 3598 return DATA_KEY$6; 3599 } 3600 }, { 3601 key: "Event", 3602 get: function get() { 3603 return Event; 3604 } 3605 }, { 3606 key: "EVENT_KEY", 3607 get: function get() { 3608 return EVENT_KEY$6; 3609 } 3610 }, { 3611 key: "DefaultType", 3612 get: function get() { 3613 return DefaultType$4; 3614 } 3615 }]); 3616 3617 return Tooltip; 3618 }(); 3619 /** 3620 * ------------------------------------------------------------------------ 3621 * jQuery 3622 * ------------------------------------------------------------------------ 3623 */ 3624 3625 3626 $__default['default'].fn[NAME$6] = Tooltip._jQueryInterface; 3627 $__default['default'].fn[NAME$6].Constructor = Tooltip; 3628 3629 $__default['default'].fn[NAME$6].noConflict = function () { 3630 $__default['default'].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 3631 return Tooltip._jQueryInterface; 3632 }; 3633 3634 /** 3635 * ------------------------------------------------------------------------ 3636 * Constants 3637 * ------------------------------------------------------------------------ 3638 */ 3639 3640 var NAME$7 = 'popover'; 3641 var VERSION$7 = '4.5.3'; 3642 var DATA_KEY$7 = 'bs.popover'; 3643 var EVENT_KEY$7 = "." + DATA_KEY$7; 3644 var JQUERY_NO_CONFLICT$7 = $__default['default'].fn[NAME$7]; 3645 var CLASS_PREFIX$1 = 'bs-popover'; 3646 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 3647 3648 var Default$5 = _extends({}, Tooltip.Default, { 3649 placement: 'right', 3650 trigger: 'click', 3651 content: '', 3652 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 3653 }); 3654 3655 var DefaultType$5 = _extends({}, Tooltip.DefaultType, { 3656 content: '(string|element|function)' 3657 }); 3658 3659 var CLASS_NAME_FADE$3 = 'fade'; 3660 var CLASS_NAME_SHOW$5 = 'show'; 3661 var SELECTOR_TITLE = '.popover-header'; 3662 var SELECTOR_CONTENT = '.popover-body'; 3663 var Event$1 = { 3664 HIDE: "hide" + EVENT_KEY$7, 3665 HIDDEN: "hidden" + EVENT_KEY$7, 3666 SHOW: "show" + EVENT_KEY$7, 3667 SHOWN: "shown" + EVENT_KEY$7, 3668 INSERTED: "inserted" + EVENT_KEY$7, 3669 CLICK: "click" + EVENT_KEY$7, 3670 FOCUSIN: "focusin" + EVENT_KEY$7, 3671 FOCUSOUT: "focusout" + EVENT_KEY$7, 3672 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 3673 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 3674 }; 3675 /** 3676 * ------------------------------------------------------------------------ 3677 * Class Definition 3678 * ------------------------------------------------------------------------ 3679 */ 3680 3681 var Popover = /*#__PURE__*/function (_Tooltip) { 3682 _inheritsLoose(Popover, _Tooltip); 3683 3684 function Popover() { 3685 return _Tooltip.apply(this, arguments) || this; 3686 } 3687 3688 var _proto = Popover.prototype; 3689 3690 // Overrides 3691 _proto.isWithContent = function isWithContent() { 3692 return this.getTitle() || this._getContent(); 3693 }; 3694 3695 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 3696 $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 3697 }; 3698 3699 _proto.getTipElement = function getTipElement() { 3700 this.tip = this.tip || $__default['default'](this.config.template)[0]; 3701 return this.tip; 3702 }; 3703 3704 _proto.setContent = function setContent() { 3705 var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events 3706 3707 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 3708 3709 var content = this._getContent(); 3710 3711 if (typeof content === 'function') { 3712 content = content.call(this.element); 3713 } 3714 3715 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 3716 $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5); 3717 } // Private 3718 ; 3719 3720 _proto._getContent = function _getContent() { 3721 return this.element.getAttribute('data-content') || this.config.content; 3722 }; 3723 3724 _proto._cleanTipClass = function _cleanTipClass() { 3725 var $tip = $__default['default'](this.getTipElement()); 3726 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 3727 3728 if (tabClass !== null && tabClass.length > 0) { 3729 $tip.removeClass(tabClass.join('')); 3730 } 3731 } // Static 3732 ; 3733 3734 Popover._jQueryInterface = function _jQueryInterface(config) { 3735 return this.each(function () { 3736 var data = $__default['default'](this).data(DATA_KEY$7); 3737 3738 var _config = typeof config === 'object' ? config : null; 3739 3740 if (!data && /dispose|hide/.test(config)) { 3741 return; 3742 } 3743 3744 if (!data) { 3745 data = new Popover(this, _config); 3746 $__default['default'](this).data(DATA_KEY$7, data); 3747 } 3748 3749 if (typeof config === 'string') { 3750 if (typeof data[config] === 'undefined') { 3751 throw new TypeError("No method named \"" + config + "\""); 3752 } 3753 3754 data[config](); 3755 } 3756 }); 3757 }; 3758 3759 _createClass(Popover, null, [{ 3760 key: "VERSION", 3761 // Getters 3762 get: function get() { 3763 return VERSION$7; 3764 } 3765 }, { 3766 key: "Default", 3767 get: function get() { 3768 return Default$5; 3769 } 3770 }, { 3771 key: "NAME", 3772 get: function get() { 3773 return NAME$7; 3774 } 3775 }, { 3776 key: "DATA_KEY", 3777 get: function get() { 3778 return DATA_KEY$7; 3779 } 3780 }, { 3781 key: "Event", 3782 get: function get() { 3783 return Event$1; 3784 } 3785 }, { 3786 key: "EVENT_KEY", 3787 get: function get() { 3788 return EVENT_KEY$7; 3789 } 3790 }, { 3791 key: "DefaultType", 3792 get: function get() { 3793 return DefaultType$5; 3794 } 3795 }]); 3796 3797 return Popover; 3798 }(Tooltip); 3799 /** 3800 * ------------------------------------------------------------------------ 3801 * jQuery 3802 * ------------------------------------------------------------------------ 3803 */ 3804 3805 3806 $__default['default'].fn[NAME$7] = Popover._jQueryInterface; 3807 $__default['default'].fn[NAME$7].Constructor = Popover; 3808 3809 $__default['default'].fn[NAME$7].noConflict = function () { 3810 $__default['default'].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 3811 return Popover._jQueryInterface; 3812 }; 3813 3814 /** 3815 * ------------------------------------------------------------------------ 3816 * Constants 3817 * ------------------------------------------------------------------------ 3818 */ 3819 3820 var NAME$8 = 'scrollspy'; 3821 var VERSION$8 = '4.5.3'; 3822 var DATA_KEY$8 = 'bs.scrollspy'; 3823 var EVENT_KEY$8 = "." + DATA_KEY$8; 3824 var DATA_API_KEY$6 = '.data-api'; 3825 var JQUERY_NO_CONFLICT$8 = $__default['default'].fn[NAME$8]; 3826 var Default$6 = { 3827 offset: 10, 3828 method: 'auto', 3829 target: '' 3830 }; 3831 var DefaultType$6 = { 3832 offset: 'number', 3833 method: 'string', 3834 target: '(string|element)' 3835 }; 3836 var EVENT_ACTIVATE = "activate" + EVENT_KEY$8; 3837 var EVENT_SCROLL = "scroll" + EVENT_KEY$8; 3838 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6; 3839 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 3840 var CLASS_NAME_ACTIVE$2 = 'active'; 3841 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 3842 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 3843 var SELECTOR_NAV_LINKS = '.nav-link'; 3844 var SELECTOR_NAV_ITEMS = '.nav-item'; 3845 var SELECTOR_LIST_ITEMS = '.list-group-item'; 3846 var SELECTOR_DROPDOWN = '.dropdown'; 3847 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 3848 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 3849 var METHOD_OFFSET = 'offset'; 3850 var METHOD_POSITION = 'position'; 3851 /** 3852 * ------------------------------------------------------------------------ 3853 * Class Definition 3854 * ------------------------------------------------------------------------ 3855 */ 3856 3857 var ScrollSpy = /*#__PURE__*/function () { 3858 function ScrollSpy(element, config) { 3859 var _this = this; 3860 3861 this._element = element; 3862 this._scrollElement = element.tagName === 'BODY' ? window : element; 3863 this._config = this._getConfig(config); 3864 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 3865 this._offsets = []; 3866 this._targets = []; 3867 this._activeTarget = null; 3868 this._scrollHeight = 0; 3869 $__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) { 3870 return _this._process(event); 3871 }); 3872 this.refresh(); 3873 3874 this._process(); 3875 } // Getters 3876 3877 3878 var _proto = ScrollSpy.prototype; 3879 3880 // Public 3881 _proto.refresh = function refresh() { 3882 var _this2 = this; 3883 3884 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 3885 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 3886 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 3887 this._offsets = []; 3888 this._targets = []; 3889 this._scrollHeight = this._getScrollHeight(); 3890 var targets = [].slice.call(document.querySelectorAll(this._selector)); 3891 targets.map(function (element) { 3892 var target; 3893 var targetSelector = Util.getSelectorFromElement(element); 3894 3895 if (targetSelector) { 3896 target = document.querySelector(targetSelector); 3897 } 3898 3899 if (target) { 3900 var targetBCR = target.getBoundingClientRect(); 3901 3902 if (targetBCR.width || targetBCR.height) { 3903 // TODO (fat): remove sketch reliance on jQuery position/offset 3904 return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector]; 3905 } 3906 } 3907 3908 return null; 3909 }).filter(function (item) { 3910 return item; 3911 }).sort(function (a, b) { 3912 return a[0] - b[0]; 3913 }).forEach(function (item) { 3914 _this2._offsets.push(item[0]); 3915 3916 _this2._targets.push(item[1]); 3917 }); 3918 }; 3919 3920 _proto.dispose = function dispose() { 3921 $__default['default'].removeData(this._element, DATA_KEY$8); 3922 $__default['default'](this._scrollElement).off(EVENT_KEY$8); 3923 this._element = null; 3924 this._scrollElement = null; 3925 this._config = null; 3926 this._selector = null; 3927 this._offsets = null; 3928 this._targets = null; 3929 this._activeTarget = null; 3930 this._scrollHeight = null; 3931 } // Private 3932 ; 3933 3934 _proto._getConfig = function _getConfig(config) { 3935 config = _extends({}, Default$6, typeof config === 'object' && config ? config : {}); 3936 3937 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 3938 var id = $__default['default'](config.target).attr('id'); 3939 3940 if (!id) { 3941 id = Util.getUID(NAME$8); 3942 $__default['default'](config.target).attr('id', id); 3943 } 3944 3945 config.target = "#" + id; 3946 } 3947 3948 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 3949 return config; 3950 }; 3951 3952 _proto._getScrollTop = function _getScrollTop() { 3953 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 3954 }; 3955 3956 _proto._getScrollHeight = function _getScrollHeight() { 3957 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 3958 }; 3959 3960 _proto._getOffsetHeight = function _getOffsetHeight() { 3961 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 3962 }; 3963 3964 _proto._process = function _process() { 3965 var scrollTop = this._getScrollTop() + this._config.offset; 3966 3967 var scrollHeight = this._getScrollHeight(); 3968 3969 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 3970 3971 if (this._scrollHeight !== scrollHeight) { 3972 this.refresh(); 3973 } 3974 3975 if (scrollTop >= maxScroll) { 3976 var target = this._targets[this._targets.length - 1]; 3977 3978 if (this._activeTarget !== target) { 3979 this._activate(target); 3980 } 3981 3982 return; 3983 } 3984 3985 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 3986 this._activeTarget = null; 3987 3988 this._clear(); 3989 3990 return; 3991 } 3992 3993 for (var i = this._offsets.length; i--;) { 3994 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 3995 3996 if (isActiveTarget) { 3997 this._activate(this._targets[i]); 3998 } 3999 } 4000 }; 4001 4002 _proto._activate = function _activate(target) { 4003 this._activeTarget = target; 4004 4005 this._clear(); 4006 4007 var queries = this._selector.split(',').map(function (selector) { 4008 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 4009 }); 4010 4011 var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(',')))); 4012 4013 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 4014 $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2); 4015 $link.addClass(CLASS_NAME_ACTIVE$2); 4016 } else { 4017 // Set triggered link as active 4018 $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active 4019 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 4020 4021 $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$2); // Handle special case when .nav-link is inside .nav-item 4022 4023 $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2); 4024 } 4025 4026 $__default['default'](this._scrollElement).trigger(EVENT_ACTIVATE, { 4027 relatedTarget: target 4028 }); 4029 }; 4030 4031 _proto._clear = function _clear() { 4032 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 4033 return node.classList.contains(CLASS_NAME_ACTIVE$2); 4034 }).forEach(function (node) { 4035 return node.classList.remove(CLASS_NAME_ACTIVE$2); 4036 }); 4037 } // Static 4038 ; 4039 4040 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 4041 return this.each(function () { 4042 var data = $__default['default'](this).data(DATA_KEY$8); 4043 4044 var _config = typeof config === 'object' && config; 4045 4046 if (!data) { 4047 data = new ScrollSpy(this, _config); 4048 $__default['default'](this).data(DATA_KEY$8, data); 4049 } 4050 4051 if (typeof config === 'string') { 4052 if (typeof data[config] === 'undefined') { 4053 throw new TypeError("No method named \"" + config + "\""); 4054 } 4055 4056 data[config](); 4057 } 4058 }); 4059 }; 4060 4061 _createClass(ScrollSpy, null, [{ 4062 key: "VERSION", 4063 get: function get() { 4064 return VERSION$8; 4065 } 4066 }, { 4067 key: "Default", 4068 get: function get() { 4069 return Default$6; 4070 } 4071 }]); 4072 4073 return ScrollSpy; 4074 }(); 4075 /** 4076 * ------------------------------------------------------------------------ 4077 * Data Api implementation 4078 * ------------------------------------------------------------------------ 4079 */ 4080 4081 4082 $__default['default'](window).on(EVENT_LOAD_DATA_API$2, function () { 4083 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 4084 var scrollSpysLength = scrollSpys.length; 4085 4086 for (var i = scrollSpysLength; i--;) { 4087 var $spy = $__default['default'](scrollSpys[i]); 4088 4089 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 4090 } 4091 }); 4092 /** 4093 * ------------------------------------------------------------------------ 4094 * jQuery 4095 * ------------------------------------------------------------------------ 4096 */ 4097 4098 $__default['default'].fn[NAME$8] = ScrollSpy._jQueryInterface; 4099 $__default['default'].fn[NAME$8].Constructor = ScrollSpy; 4100 4101 $__default['default'].fn[NAME$8].noConflict = function () { 4102 $__default['default'].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 4103 return ScrollSpy._jQueryInterface; 4104 }; 4105 4106 /** 4107 * ------------------------------------------------------------------------ 4108 * Constants 4109 * ------------------------------------------------------------------------ 4110 */ 4111 4112 var NAME$9 = 'tab'; 4113 var VERSION$9 = '4.5.3'; 4114 var DATA_KEY$9 = 'bs.tab'; 4115 var EVENT_KEY$9 = "." + DATA_KEY$9; 4116 var DATA_API_KEY$7 = '.data-api'; 4117 var JQUERY_NO_CONFLICT$9 = $__default['default'].fn[NAME$9]; 4118 var EVENT_HIDE$3 = "hide" + EVENT_KEY$9; 4119 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9; 4120 var EVENT_SHOW$3 = "show" + EVENT_KEY$9; 4121 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9; 4122 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7; 4123 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 4124 var CLASS_NAME_ACTIVE$3 = 'active'; 4125 var CLASS_NAME_DISABLED$1 = 'disabled'; 4126 var CLASS_NAME_FADE$4 = 'fade'; 4127 var CLASS_NAME_SHOW$6 = 'show'; 4128 var SELECTOR_DROPDOWN$1 = '.dropdown'; 4129 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 4130 var SELECTOR_ACTIVE$2 = '.active'; 4131 var SELECTOR_ACTIVE_UL = '> li > .active'; 4132 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 4133 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 4134 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 4135 /** 4136 * ------------------------------------------------------------------------ 4137 * Class Definition 4138 * ------------------------------------------------------------------------ 4139 */ 4140 4141 var Tab = /*#__PURE__*/function () { 4142 function Tab(element) { 4143 this._element = element; 4144 } // Getters 4145 4146 4147 var _proto = Tab.prototype; 4148 4149 // Public 4150 _proto.show = function show() { 4151 var _this = this; 4152 4153 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default['default'](this._element).hasClass(CLASS_NAME_ACTIVE$3) || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 4154 return; 4155 } 4156 4157 var target; 4158 var previous; 4159 var listElement = $__default['default'](this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0]; 4160 var selector = Util.getSelectorFromElement(this._element); 4161 4162 if (listElement) { 4163 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2; 4164 previous = $__default['default'].makeArray($__default['default'](listElement).find(itemSelector)); 4165 previous = previous[previous.length - 1]; 4166 } 4167 4168 var hideEvent = $__default['default'].Event(EVENT_HIDE$3, { 4169 relatedTarget: this._element 4170 }); 4171 var showEvent = $__default['default'].Event(EVENT_SHOW$3, { 4172 relatedTarget: previous 4173 }); 4174 4175 if (previous) { 4176 $__default['default'](previous).trigger(hideEvent); 4177 } 4178 4179 $__default['default'](this._element).trigger(showEvent); 4180 4181 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 4182 return; 4183 } 4184 4185 if (selector) { 4186 target = document.querySelector(selector); 4187 } 4188 4189 this._activate(this._element, listElement); 4190 4191 var complete = function complete() { 4192 var hiddenEvent = $__default['default'].Event(EVENT_HIDDEN$3, { 4193 relatedTarget: _this._element 4194 }); 4195 var shownEvent = $__default['default'].Event(EVENT_SHOWN$3, { 4196 relatedTarget: previous 4197 }); 4198 $__default['default'](previous).trigger(hiddenEvent); 4199 $__default['default'](_this._element).trigger(shownEvent); 4200 }; 4201 4202 if (target) { 4203 this._activate(target, target.parentNode, complete); 4204 } else { 4205 complete(); 4206 } 4207 }; 4208 4209 _proto.dispose = function dispose() { 4210 $__default['default'].removeData(this._element, DATA_KEY$9); 4211 this._element = null; 4212 } // Private 4213 ; 4214 4215 _proto._activate = function _activate(element, container, callback) { 4216 var _this2 = this; 4217 4218 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default['default'](container).find(SELECTOR_ACTIVE_UL) : $__default['default'](container).children(SELECTOR_ACTIVE$2); 4219 var active = activeElements[0]; 4220 var isTransitioning = callback && active && $__default['default'](active).hasClass(CLASS_NAME_FADE$4); 4221 4222 var complete = function complete() { 4223 return _this2._transitionComplete(element, active, callback); 4224 }; 4225 4226 if (active && isTransitioning) { 4227 var transitionDuration = Util.getTransitionDurationFromElement(active); 4228 $__default['default'](active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4229 } else { 4230 complete(); 4231 } 4232 }; 4233 4234 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 4235 if (active) { 4236 $__default['default'](active).removeClass(CLASS_NAME_ACTIVE$3); 4237 var dropdownChild = $__default['default'](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 4238 4239 if (dropdownChild) { 4240 $__default['default'](dropdownChild).removeClass(CLASS_NAME_ACTIVE$3); 4241 } 4242 4243 if (active.getAttribute('role') === 'tab') { 4244 active.setAttribute('aria-selected', false); 4245 } 4246 } 4247 4248 $__default['default'](element).addClass(CLASS_NAME_ACTIVE$3); 4249 4250 if (element.getAttribute('role') === 'tab') { 4251 element.setAttribute('aria-selected', true); 4252 } 4253 4254 Util.reflow(element); 4255 4256 if (element.classList.contains(CLASS_NAME_FADE$4)) { 4257 element.classList.add(CLASS_NAME_SHOW$6); 4258 } 4259 4260 if (element.parentNode && $__default['default'](element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 4261 var dropdownElement = $__default['default'](element).closest(SELECTOR_DROPDOWN$1)[0]; 4262 4263 if (dropdownElement) { 4264 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1)); 4265 $__default['default'](dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3); 4266 } 4267 4268 element.setAttribute('aria-expanded', true); 4269 } 4270 4271 if (callback) { 4272 callback(); 4273 } 4274 } // Static 4275 ; 4276 4277 Tab._jQueryInterface = function _jQueryInterface(config) { 4278 return this.each(function () { 4279 var $this = $__default['default'](this); 4280 var data = $this.data(DATA_KEY$9); 4281 4282 if (!data) { 4283 data = new Tab(this); 4284 $this.data(DATA_KEY$9, data); 4285 } 4286 4287 if (typeof config === 'string') { 4288 if (typeof data[config] === 'undefined') { 4289 throw new TypeError("No method named \"" + config + "\""); 4290 } 4291 4292 data[config](); 4293 } 4294 }); 4295 }; 4296 4297 _createClass(Tab, null, [{ 4298 key: "VERSION", 4299 get: function get() { 4300 return VERSION$9; 4301 } 4302 }]); 4303 4304 return Tab; 4305 }(); 4306 /** 4307 * ------------------------------------------------------------------------ 4308 * Data Api implementation 4309 * ------------------------------------------------------------------------ 4310 */ 4311 4312 4313 $__default['default'](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) { 4314 event.preventDefault(); 4315 4316 Tab._jQueryInterface.call($__default['default'](this), 'show'); 4317 }); 4318 /** 4319 * ------------------------------------------------------------------------ 4320 * jQuery 4321 * ------------------------------------------------------------------------ 4322 */ 4323 4324 $__default['default'].fn[NAME$9] = Tab._jQueryInterface; 4325 $__default['default'].fn[NAME$9].Constructor = Tab; 4326 4327 $__default['default'].fn[NAME$9].noConflict = function () { 4328 $__default['default'].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 4329 return Tab._jQueryInterface; 4330 }; 4331 4332 /** 4333 * ------------------------------------------------------------------------ 4334 * Constants 4335 * ------------------------------------------------------------------------ 4336 */ 4337 4338 var NAME$a = 'toast'; 4339 var VERSION$a = '4.5.3'; 4340 var DATA_KEY$a = 'bs.toast'; 4341 var EVENT_KEY$a = "." + DATA_KEY$a; 4342 var JQUERY_NO_CONFLICT$a = $__default['default'].fn[NAME$a]; 4343 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a; 4344 var EVENT_HIDE$4 = "hide" + EVENT_KEY$a; 4345 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a; 4346 var EVENT_SHOW$4 = "show" + EVENT_KEY$a; 4347 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a; 4348 var CLASS_NAME_FADE$5 = 'fade'; 4349 var CLASS_NAME_HIDE = 'hide'; 4350 var CLASS_NAME_SHOW$7 = 'show'; 4351 var CLASS_NAME_SHOWING = 'showing'; 4352 var DefaultType$7 = { 4353 animation: 'boolean', 4354 autohide: 'boolean', 4355 delay: 'number' 4356 }; 4357 var Default$7 = { 4358 animation: true, 4359 autohide: true, 4360 delay: 500 4361 }; 4362 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]'; 4363 /** 4364 * ------------------------------------------------------------------------ 4365 * Class Definition 4366 * ------------------------------------------------------------------------ 4367 */ 4368 4369 var Toast = /*#__PURE__*/function () { 4370 function Toast(element, config) { 4371 this._element = element; 4372 this._config = this._getConfig(config); 4373 this._timeout = null; 4374 4375 this._setListeners(); 4376 } // Getters 4377 4378 4379 var _proto = Toast.prototype; 4380 4381 // Public 4382 _proto.show = function show() { 4383 var _this = this; 4384 4385 var showEvent = $__default['default'].Event(EVENT_SHOW$4); 4386 $__default['default'](this._element).trigger(showEvent); 4387 4388 if (showEvent.isDefaultPrevented()) { 4389 return; 4390 } 4391 4392 this._clearTimeout(); 4393 4394 if (this._config.animation) { 4395 this._element.classList.add(CLASS_NAME_FADE$5); 4396 } 4397 4398 var complete = function complete() { 4399 _this._element.classList.remove(CLASS_NAME_SHOWING); 4400 4401 _this._element.classList.add(CLASS_NAME_SHOW$7); 4402 4403 $__default['default'](_this._element).trigger(EVENT_SHOWN$4); 4404 4405 if (_this._config.autohide) { 4406 _this._timeout = setTimeout(function () { 4407 _this.hide(); 4408 }, _this._config.delay); 4409 } 4410 }; 4411 4412 this._element.classList.remove(CLASS_NAME_HIDE); 4413 4414 Util.reflow(this._element); 4415 4416 this._element.classList.add(CLASS_NAME_SHOWING); 4417 4418 if (this._config.animation) { 4419 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4420 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4421 } else { 4422 complete(); 4423 } 4424 }; 4425 4426 _proto.hide = function hide() { 4427 if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) { 4428 return; 4429 } 4430 4431 var hideEvent = $__default['default'].Event(EVENT_HIDE$4); 4432 $__default['default'](this._element).trigger(hideEvent); 4433 4434 if (hideEvent.isDefaultPrevented()) { 4435 return; 4436 } 4437 4438 this._close(); 4439 }; 4440 4441 _proto.dispose = function dispose() { 4442 this._clearTimeout(); 4443 4444 if (this._element.classList.contains(CLASS_NAME_SHOW$7)) { 4445 this._element.classList.remove(CLASS_NAME_SHOW$7); 4446 } 4447 4448 $__default['default'](this._element).off(EVENT_CLICK_DISMISS$1); 4449 $__default['default'].removeData(this._element, DATA_KEY$a); 4450 this._element = null; 4451 this._config = null; 4452 } // Private 4453 ; 4454 4455 _proto._getConfig = function _getConfig(config) { 4456 config = _extends({}, Default$7, $__default['default'](this._element).data(), typeof config === 'object' && config ? config : {}); 4457 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 4458 return config; 4459 }; 4460 4461 _proto._setListeners = function _setListeners() { 4462 var _this2 = this; 4463 4464 $__default['default'](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () { 4465 return _this2.hide(); 4466 }); 4467 }; 4468 4469 _proto._close = function _close() { 4470 var _this3 = this; 4471 4472 var complete = function complete() { 4473 _this3._element.classList.add(CLASS_NAME_HIDE); 4474 4475 $__default['default'](_this3._element).trigger(EVENT_HIDDEN$4); 4476 }; 4477 4478 this._element.classList.remove(CLASS_NAME_SHOW$7); 4479 4480 if (this._config.animation) { 4481 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4482 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4483 } else { 4484 complete(); 4485 } 4486 }; 4487 4488 _proto._clearTimeout = function _clearTimeout() { 4489 clearTimeout(this._timeout); 4490 this._timeout = null; 4491 } // Static 4492 ; 4493 4494 Toast._jQueryInterface = function _jQueryInterface(config) { 4495 return this.each(function () { 4496 var $element = $__default['default'](this); 4497 var data = $element.data(DATA_KEY$a); 4498 4499 var _config = typeof config === 'object' && config; 4500 4501 if (!data) { 4502 data = new Toast(this, _config); 4503 $element.data(DATA_KEY$a, data); 4504 } 4505 4506 if (typeof config === 'string') { 4507 if (typeof data[config] === 'undefined') { 4508 throw new TypeError("No method named \"" + config + "\""); 4509 } 4510 4511 data[config](this); 4512 } 4513 }); 4514 }; 4515 4516 _createClass(Toast, null, [{ 4517 key: "VERSION", 4518 get: function get() { 4519 return VERSION$a; 4520 } 4521 }, { 4522 key: "DefaultType", 4523 get: function get() { 4524 return DefaultType$7; 4525 } 4526 }, { 4527 key: "Default", 4528 get: function get() { 4529 return Default$7; 4530 } 4531 }]); 4532 4533 return Toast; 4534 }(); 4535 /** 4536 * ------------------------------------------------------------------------ 4537 * jQuery 4538 * ------------------------------------------------------------------------ 4539 */ 4540 4541 4542 $__default['default'].fn[NAME$a] = Toast._jQueryInterface; 4543 $__default['default'].fn[NAME$a].Constructor = Toast; 4544 4545 $__default['default'].fn[NAME$a].noConflict = function () { 4546 $__default['default'].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 4547 return Toast._jQueryInterface; 4548 }; 4549 4550 exports.Alert = Alert; 4551 exports.Button = Button; 4552 exports.Carousel = Carousel; 4553 exports.Collapse = Collapse; 4554 exports.Dropdown = Dropdown; 4555 exports.Modal = Modal; 4556 exports.Popover = Popover; 4557 exports.Scrollspy = ScrollSpy; 4558 exports.Tab = Tab; 4559 exports.Toast = Toast; 4560 exports.Tooltip = Tooltip; 4561 exports.Util = Util; 4562 4563 Object.defineProperty(exports, '__esModule', { value: true }); 4564 4565}))); 4566//# sourceMappingURL=bootstrap.js.map 4567 4568 4569/***/ }), 4570
vendor: 288,125 bytes, lines 4571-15454
4571/***/ "./node_modules/jquery/dist/jquery.js": 4572/*!********************************************!*\ 4573 !*** ./node_modules/jquery/dist/jquery.js ***! 4574 \********************************************/ 4575/*! no static exports found */ 4576/***/ (function(module, exports, __webpack_require__) { 4577 4578var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 4579 * jQuery JavaScript Library v3.5.1 4580 * https://jquery.com/ 4581 * 4582 * Includes Sizzle.js 4583 * https://sizzlejs.com/ 4584 * 4585 * Copyright JS Foundation and other contributors 4586 * Released under the MIT license 4587 * https://jquery.org/license 4588 * 4589 * Date: 2020-05-04T22:49Z 4590 */ 4591( function( global, factory ) { 4592 4593 "use strict"; 4594 4595 if ( true && typeof module.exports === "object" ) { 4596 4597 // For CommonJS and CommonJS-like environments where a proper `window` 4598 // is present, execute the factory and get jQuery. 4599 // For environments that do not have a `window` with a `document` 4600 // (such as Node.js), expose a factory as module.exports. 4601 // This accentuates the need for the creation of a real `window`. 4602 // e.g. var jQuery = require("jquery")(window); 4603 // See ticket #14549 for more info. 4604 module.exports = global.document ? 4605 factory( global, true ) : 4606 function( w ) { 4607 if ( !w.document ) { 4608 throw new Error( "jQuery requires a window with a document" ); 4609 } 4610 return factory( w ); 4611 }; 4612 } else { 4613 factory( global ); 4614 } 4615 4616// Pass this if window is not defined yet 4617} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 4618 4619// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 4620// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 4621// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 4622// enough that all such attempts are guarded in a try block. 4623"use strict"; 4624 4625var arr = []; 4626 4627var getProto = Object.getPrototypeOf; 4628 4629var slice = arr.slice; 4630 4631var flat = arr.flat ? function( array ) { 4632 return arr.flat.call( array ); 4633} : function( array ) { 4634 return arr.concat.apply( [], array ); 4635}; 4636 4637 4638var push = arr.push; 4639 4640var indexOf = arr.indexOf; 4641 4642var class2type = {}; 4643 4644var toString = class2type.toString; 4645 4646var hasOwn = class2type.hasOwnProperty; 4647 4648var fnToString = hasOwn.toString; 4649 4650var ObjectFunctionString = fnToString.call( Object ); 4651 4652var support = {}; 4653 4654var isFunction = function isFunction( obj ) { 4655 4656 // Support: Chrome <=57, Firefox <=52 4657 // In some browsers, typeof returns "function" for HTML <object> elements 4658 // (i.e., `typeof document.createElement( "object" ) === "function"`). 4659 // We don't want to classify *any* DOM node as a function. 4660 return typeof obj === "function" && typeof obj.nodeType !== "number"; 4661 }; 4662 4663 4664var isWindow = function isWindow( obj ) { 4665 return obj != null && obj === obj.window; 4666 }; 4667 4668 4669var document = window.document; 4670 4671 4672 4673 var preservedScriptAttributes = { 4674 type: true, 4675 src: true, 4676 nonce: true, 4677 noModule: true 4678 }; 4679 4680 function DOMEval( code, node, doc ) { 4681 doc = doc || document; 4682 4683 var i, val, 4684 script = doc.createElement( "script" ); 4685 4686 script.text = code; 4687 if ( node ) { 4688 for ( i in preservedScriptAttributes ) { 4689 4690 // Support: Firefox 64+, Edge 18+ 4691 // Some browsers don't support the "nonce" property on scripts. 4692 // On the other hand, just using `getAttribute` is not enough as 4693 // the `nonce` attribute is reset to an empty string whenever it 4694 // becomes browsing-context connected. 4695 // See https://github.com/whatwg/html/issues/2369 4696 // See https://html.spec.whatwg.org/#nonce-attributes 4697 // The `node.getAttribute` check was added for the sake of 4698 // `jQuery.globalEval` so that it can fake a nonce-containing node 4699 // via an object. 4700 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 4701 if ( val ) { 4702 script.setAttribute( i, val ); 4703 } 4704 } 4705 } 4706 doc.head.appendChild( script ).parentNode.removeChild( script ); 4707 } 4708 4709 4710function toType( obj ) { 4711 if ( obj == null ) { 4712 return obj + ""; 4713 } 4714 4715 // Support: Android <=2.3 only (functionish RegExp) 4716 return typeof obj === "object" || typeof obj === "function" ? 4717 class2type[ toString.call( obj ) ] || "object" : 4718 typeof obj; 4719} 4720/* global Symbol */ 4721// Defining this global in .eslintrc.json would create a danger of using the global 4722// unguarded in another place, it seems safer to define global only for this module 4723 4724 4725 4726var 4727 version = "3.5.1", 4728 4729 // Define a local copy of jQuery 4730 jQuery = function( selector, context ) { 4731 4732 // The jQuery object is actually just the init constructor 'enhanced' 4733 // Need init if jQuery is called (just allow error to be thrown if not included) 4734 return new jQuery.fn.init( selector, context ); 4735 }; 4736 4737jQuery.fn = jQuery.prototype = { 4738 4739 // The current version of jQuery being used 4740 jquery: version, 4741 4742 constructor: jQuery, 4743 4744 // The default length of a jQuery object is 0 4745 length: 0, 4746 4747 toArray: function() { 4748 return slice.call( this ); 4749 }, 4750 4751 // Get the Nth element in the matched element set OR 4752 // Get the whole matched element set as a clean array 4753 get: function( num ) { 4754 4755 // Return all the elements in a clean array 4756 if ( num == null ) { 4757 return slice.call( this ); 4758 } 4759 4760 // Return just the one element from the set 4761 return num < 0 ? this[ num + this.length ] : this[ num ]; 4762 }, 4763 4764 // Take an array of elements and push it onto the stack 4765 // (returning the new matched element set) 4766 pushStack: function( elems ) { 4767 4768 // Build a new jQuery matched element set 4769 var ret = jQuery.merge( this.constructor(), elems ); 4770 4771 // Add the old object onto the stack (as a reference) 4772 ret.prevObject = this; 4773 4774 // Return the newly-formed element set 4775 return ret; 4776 }, 4777 4778 // Execute a callback for every element in the matched set. 4779 each: function( callback ) { 4780 return jQuery.each( this, callback ); 4781 }, 4782 4783 map: function( callback ) { 4784 return this.pushStack( jQuery.map( this, function( elem, i ) { 4785 return callback.call( elem, i, elem ); 4786 } ) ); 4787 }, 4788 4789 slice: function() { 4790 return this.pushStack( slice.apply( this, arguments ) ); 4791 }, 4792 4793 first: function() { 4794 return this.eq( 0 ); 4795 }, 4796 4797 last: function() { 4798 return this.eq( -1 ); 4799 }, 4800 4801 even: function() { 4802 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 4803 return ( i + 1 ) % 2; 4804 } ) ); 4805 }, 4806 4807 odd: function() { 4808 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 4809 return i % 2; 4810 } ) ); 4811 }, 4812 4813 eq: function( i ) { 4814 var len = this.length, 4815 j = +i + ( i < 0 ? len : 0 ); 4816 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 4817 }, 4818 4819 end: function() { 4820 return this.prevObject || this.constructor(); 4821 }, 4822 4823 // For internal use only. 4824 // Behaves like an Array's method, not like a jQuery method. 4825 push: push, 4826 sort: arr.sort, 4827 splice: arr.splice 4828}; 4829 4830jQuery.extend = jQuery.fn.extend = function() { 4831 var options, name, src, copy, copyIsArray, clone, 4832 target = arguments[ 0 ] || {}, 4833 i = 1, 4834 length = arguments.length, 4835 deep = false; 4836 4837 // Handle a deep copy situation 4838 if ( typeof target === "boolean" ) { 4839 deep = target; 4840 4841 // Skip the boolean and the target 4842 target = arguments[ i ] || {}; 4843 i++; 4844 } 4845 4846 // Handle case when target is a string or something (possible in deep copy) 4847 if ( typeof target !== "object" && !isFunction( target ) ) { 4848 target = {}; 4849 } 4850 4851 // Extend jQuery itself if only one argument is passed 4852 if ( i === length ) { 4853 target = this; 4854 i--; 4855 } 4856 4857 for ( ; i < length; i++ ) { 4858 4859 // Only deal with non-null/undefined values 4860 if ( ( options = arguments[ i ] ) != null ) { 4861 4862 // Extend the base object 4863 for ( name in options ) { 4864 copy = options[ name ]; 4865 4866 // Prevent Object.prototype pollution 4867 // Prevent never-ending loop 4868 if ( name === "__proto__" || target === copy ) { 4869 continue; 4870 } 4871 4872 // Recurse if we're merging plain objects or arrays 4873 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 4874 ( copyIsArray = Array.isArray( copy ) ) ) ) { 4875 src = target[ name ]; 4876 4877 // Ensure proper type for the source value 4878 if ( copyIsArray && !Array.isArray( src ) ) { 4879 clone = []; 4880 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 4881 clone = {}; 4882 } else { 4883 clone = src; 4884 } 4885 copyIsArray = false; 4886 4887 // Never move original objects, clone them 4888 target[ name ] = jQuery.extend( deep, clone, copy ); 4889 4890 // Don't bring in undefined values 4891 } else if ( copy !== undefined ) { 4892 target[ name ] = copy; 4893 } 4894 } 4895 } 4896 } 4897 4898 // Return the modified object 4899 return target; 4900}; 4901 4902jQuery.extend( { 4903 4904 // Unique for each copy of jQuery on the page 4905 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 4906 4907 // Assume jQuery is ready without the ready module 4908 isReady: true, 4909 4910 error: function( msg ) { 4911 throw new Error( msg ); 4912 }, 4913 4914 noop: function() {}, 4915 4916 isPlainObject: function( obj ) { 4917 var proto, Ctor; 4918 4919 // Detect obvious negatives 4920 // Use toString instead of jQuery.type to catch host objects 4921 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 4922 return false; 4923 } 4924 4925 proto = getProto( obj ); 4926 4927 // Objects with no prototype (e.g., `Object.create( null )`) are plain 4928 if ( !proto ) { 4929 return true; 4930 } 4931 4932 // Objects with prototype are plain iff they were constructed by a global Object function 4933 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 4934 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 4935 }, 4936 4937 isEmptyObject: function( obj ) { 4938 var name; 4939 4940 for ( name in obj ) { 4941 return false; 4942 } 4943 return true; 4944 }, 4945 4946 // Evaluates a script in a provided context; falls back to the global one 4947 // if not specified. 4948 globalEval: function( code, options, doc ) { 4949 DOMEval( code, { nonce: options && options.nonce }, doc ); 4950 }, 4951 4952 each: function( obj, callback ) { 4953 var length, i = 0; 4954 4955 if ( isArrayLike( obj ) ) { 4956 length = obj.length; 4957 for ( ; i < length; i++ ) { 4958 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 4959 break; 4960 } 4961 } 4962 } else { 4963 for ( i in obj ) { 4964 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 4965 break; 4966 } 4967 } 4968 } 4969 4970 return obj; 4971 }, 4972 4973 // results is for internal usage only 4974 makeArray: function( arr, results ) { 4975 var ret = results || []; 4976 4977 if ( arr != null ) { 4978 if ( isArrayLike( Object( arr ) ) ) { 4979 jQuery.merge( ret, 4980 typeof arr === "string" ? 4981 [ arr ] : arr 4982 ); 4983 } else { 4984 push.call( ret, arr ); 4985 } 4986 } 4987 4988 return ret; 4989 }, 4990 4991 inArray: function( elem, arr, i ) { 4992 return arr == null ? -1 : indexOf.call( arr, elem, i ); 4993 }, 4994 4995 // Support: Android <=4.0 only, PhantomJS 1 only 4996 // push.apply(_, arraylike) throws on ancient WebKit 4997 merge: function( first, second ) { 4998 var len = +second.length, 4999 j = 0, 5000 i = first.length; 5001 5002 for ( ; j < len; j++ ) { 5003 first[ i++ ] = second[ j ]; 5004 } 5005 5006 first.length = i; 5007 5008 return first; 5009 }, 5010 5011 grep: function( elems, callback, invert ) { 5012 var callbackInverse, 5013 matches = [], 5014 i = 0, 5015 length = elems.length, 5016 callbackExpect = !invert; 5017 5018 // Go through the array, only saving the items 5019 // that pass the validator function 5020 for ( ; i < length; i++ ) { 5021 callbackInverse = !callback( elems[ i ], i ); 5022 if ( callbackInverse !== callbackExpect ) { 5023 matches.push( elems[ i ] ); 5024 } 5025 } 5026 5027 return matches; 5028 }, 5029 5030 // arg is for internal usage only 5031 map: function( elems, callback, arg ) { 5032 var length, value, 5033 i = 0, 5034 ret = []; 5035 5036 // Go through the array, translating each of the items to their new values 5037 if ( isArrayLike( elems ) ) { 5038 length = elems.length; 5039 for ( ; i < length; i++ ) { 5040 value = callback( elems[ i ], i, arg ); 5041 5042 if ( value != null ) { 5043 ret.push( value ); 5044 } 5045 } 5046 5047 // Go through every key on the object, 5048 } else { 5049 for ( i in elems ) { 5050 value = callback( elems[ i ], i, arg ); 5051 5052 if ( value != null ) { 5053 ret.push( value ); 5054 } 5055 } 5056 } 5057 5058 // Flatten any nested arrays 5059 return flat( ret ); 5060 }, 5061 5062 // A global GUID counter for objects 5063 guid: 1, 5064 5065 // jQuery.support is not used in Core but other projects attach their 5066 // properties to it so it needs to exist. 5067 support: support 5068} ); 5069 5070if ( typeof Symbol === "function" ) { 5071 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 5072} 5073 5074// Populate the class2type map 5075jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 5076function( _i, name ) { 5077 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 5078} ); 5079 5080function isArrayLike( obj ) { 5081 5082 // Support: real iOS 8.2 only (not reproducible in simulator) 5083 // `in` check used to prevent JIT error (gh-2145) 5084 // hasOwn isn't used here due to false negatives 5085 // regarding Nodelist length in IE 5086 var length = !!obj && "length" in obj && obj.length, 5087 type = toType( obj ); 5088 5089 if ( isFunction( obj ) || isWindow( obj ) ) { 5090 return false; 5091 } 5092 5093 return type === "array" || length === 0 || 5094 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 5095} 5096var Sizzle = 5097/*! 5098 * Sizzle CSS Selector Engine v2.3.5 5099 * https://sizzlejs.com/ 5100 * 5101 * Copyright JS Foundation and other contributors 5102 * Released under the MIT license 5103 * https://js.foundation/ 5104 * 5105 * Date: 2020-03-14 5106 */ 5107( function( window ) { 5108var i, 5109 support, 5110 Expr, 5111 getText, 5112 isXML, 5113 tokenize, 5114 compile, 5115 select, 5116 outermostContext, 5117 sortInput, 5118 hasDuplicate, 5119 5120 // Local document vars 5121 setDocument, 5122 document, 5123 docElem, 5124 documentIsHTML, 5125 rbuggyQSA, 5126 rbuggyMatches, 5127 matches, 5128 contains, 5129 5130 // Instance-specific data 5131 expando = "sizzle" + 1 * new Date(), 5132 preferredDoc = window.document, 5133 dirruns = 0, 5134 done = 0, 5135 classCache = createCache(), 5136 tokenCache = createCache(), 5137 compilerCache = createCache(), 5138 nonnativeSelectorCache = createCache(), 5139 sortOrder = function( a, b ) { 5140 if ( a === b ) { 5141 hasDuplicate = true; 5142 } 5143 return 0; 5144 }, 5145 5146 // Instance methods 5147 hasOwn = ( {} ).hasOwnProperty, 5148 arr = [], 5149 pop = arr.pop, 5150 pushNative = arr.push, 5151 push = arr.push, 5152 slice = arr.slice, 5153 5154 // Use a stripped-down indexOf as it's faster than native 5155 // https://jsperf.com/thor-indexof-vs-for/5 5156 indexOf = function( list, elem ) { 5157 var i = 0, 5158 len = list.length; 5159 for ( ; i < len; i++ ) { 5160 if ( list[ i ] === elem ) { 5161 return i; 5162 } 5163 } 5164 return -1; 5165 }, 5166 5167 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 5168 "ismap|loop|multiple|open|readonly|required|scoped", 5169 5170 // Regular expressions 5171 5172 // http://www.w3.org/TR/css3-selectors/#whitespace 5173 whitespace = "[\\x20\\t\\r\\n\\f]", 5174 5175 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 5176 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 5177 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 5178 5179 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 5180 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 5181 5182 // Operator (capture 2) 5183 "*([*^$|!~]?=)" + whitespace + 5184 5185 // "Attribute values must be CSS identifiers [capture 5] 5186 // or strings [capture 3 or capture 4]" 5187 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 5188 whitespace + "*\\]", 5189 5190 pseudos = ":(" + identifier + ")(?:\\((" + 5191 5192 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 5193 // 1. quoted (capture 3; capture 4 or capture 5) 5194 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 5195 5196 // 2. simple (capture 6) 5197 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 5198 5199 // 3. anything else (capture 2) 5200 ".*" + 5201 ")\\)|)", 5202 5203 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 5204 rwhitespace = new RegExp( whitespace + "+", "g" ), 5205 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 5206 whitespace + "+$", "g" ), 5207 5208 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 5209 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 5210 "*" ), 5211 rdescend = new RegExp( whitespace + "|>" ), 5212 5213 rpseudo = new RegExp( pseudos ), 5214 ridentifier = new RegExp( "^" + identifier + "$" ), 5215 5216 matchExpr = { 5217 "ID": new RegExp( "^#(" + identifier + ")" ), 5218 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 5219 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 5220 "ATTR": new RegExp( "^" + attributes ), 5221 "PSEUDO": new RegExp( "^" + pseudos ), 5222 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 5223 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 5224 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 5225 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 5226 5227 // For use in libraries implementing .is() 5228 // We use this for POS matching in `select` 5229 "needsContext": new RegExp( "^" + whitespace + 5230 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 5231 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 5232 }, 5233 5234 rhtml = /HTML$/i, 5235 rinputs = /^(?:input|select|textarea|button)$/i, 5236 rheader = /^h\d$/i, 5237 5238 rnative = /^[^{]+\{\s*\[native \w/, 5239 5240 // Easily-parseable/retrievable ID or TAG or CLASS selectors 5241 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 5242 5243 rsibling = /[+~]/, 5244 5245 // CSS escapes 5246 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 5247 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 5248 funescape = function( escape, nonHex ) { 5249 var high = "0x" + escape.slice( 1 ) - 0x10000; 5250 5251 return nonHex ? 5252 5253 // Strip the backslash prefix from a non-hex escape sequence 5254 nonHex : 5255 5256 // Replace a hexadecimal escape sequence with the encoded Unicode code point 5257 // Support: IE <=11+ 5258 // For values outside the Basic Multilingual Plane (BMP), manually construct a 5259 // surrogate pair 5260 high < 0 ? 5261 String.fromCharCode( high + 0x10000 ) : 5262 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 5263 }, 5264 5265 // CSS string/identifier serialization 5266 // https://drafts.csswg.org/cssom/#common-serializing-idioms 5267 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 5268 fcssescape = function( ch, asCodePoint ) { 5269 if ( asCodePoint ) { 5270 5271 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 5272 if ( ch === "\0" ) { 5273 return "\uFFFD"; 5274 } 5275 5276 // Control characters and (dependent upon position) numbers get escaped as code points 5277 return ch.slice( 0, -1 ) + "\\" + 5278 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 5279 } 5280 5281 // Other potentially-special ASCII characters get backslash-escaped 5282 return "\\" + ch; 5283 }, 5284 5285 // Used for iframes 5286 // See setDocument() 5287 // Removing the function wrapper causes a "Permission Denied" 5288 // error in IE 5289 unloadHandler = function() { 5290 setDocument(); 5291 }, 5292 5293 inDisabledFieldset = addCombinator( 5294 function( elem ) { 5295 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 5296 }, 5297 { dir: "parentNode", next: "legend" } 5298 ); 5299 5300// Optimize for push.apply( _, NodeList ) 5301try { 5302 push.apply( 5303 ( arr = slice.call( preferredDoc.childNodes ) ), 5304 preferredDoc.childNodes 5305 ); 5306 5307 // Support: Android<4.0 5308 // Detect silently failing push.apply 5309 // eslint-disable-next-line no-unused-expressions 5310 arr[ preferredDoc.childNodes.length ].nodeType; 5311} catch ( e ) { 5312 push = { apply: arr.length ? 5313 5314 // Leverage slice if possible 5315 function( target, els ) { 5316 pushNative.apply( target, slice.call( els ) ); 5317 } : 5318 5319 // Support: IE<9 5320 // Otherwise append directly 5321 function( target, els ) { 5322 var j = target.length, 5323 i = 0; 5324 5325 // Can't trust NodeList.length 5326 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 5327 target.length = j - 1; 5328 } 5329 }; 5330} 5331 5332function Sizzle( selector, context, results, seed ) { 5333 var m, i, elem, nid, match, groups, newSelector, 5334 newContext = context && context.ownerDocument, 5335 5336 // nodeType defaults to 9, since context defaults to document 5337 nodeType = context ? context.nodeType : 9; 5338 5339 results = results || []; 5340 5341 // Return early from calls with invalid selector or context 5342 if ( typeof selector !== "string" || !selector || 5343 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 5344 5345 return results; 5346 } 5347 5348 // Try to shortcut find operations (as opposed to filters) in HTML documents 5349 if ( !seed ) { 5350 setDocument( context ); 5351 context = context || document; 5352 5353 if ( documentIsHTML ) { 5354 5355 // If the selector is sufficiently simple, try using a "get*By*" DOM method 5356 // (excepting DocumentFragment context, where the methods don't exist) 5357 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 5358 5359 // ID selector 5360 if ( ( m = match[ 1 ] ) ) { 5361 5362 // Document context 5363 if ( nodeType === 9 ) { 5364 if ( ( elem = context.getElementById( m ) ) ) { 5365 5366 // Support: IE, Opera, Webkit 5367 // TODO: identify versions 5368 // getElementById can match elements by name instead of ID 5369 if ( elem.id === m ) { 5370 results.push( elem ); 5371 return results; 5372 } 5373 } else { 5374 return results; 5375 } 5376 5377 // Element context 5378 } else { 5379 5380 // Support: IE, Opera, Webkit 5381 // TODO: identify versions 5382 // getElementById can match elements by name instead of ID 5383 if ( newContext && ( elem = newContext.getElementById( m ) ) && 5384 contains( context, elem ) && 5385 elem.id === m ) { 5386 5387 results.push( elem ); 5388 return results; 5389 } 5390 } 5391 5392 // Type selector 5393 } else if ( match[ 2 ] ) { 5394 push.apply( results, context.getElementsByTagName( selector ) ); 5395 return results; 5396 5397 // Class selector 5398 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 5399 context.getElementsByClassName ) { 5400 5401 push.apply( results, context.getElementsByClassName( m ) ); 5402 return results; 5403 } 5404 } 5405 5406 // Take advantage of querySelectorAll 5407 if ( support.qsa && 5408 !nonnativeSelectorCache[ selector + " " ] && 5409 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 5410 5411 // Support: IE 8 only 5412 // Exclude object elements 5413 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 5414 5415 newSelector = selector; 5416 newContext = context; 5417 5418 // qSA considers elements outside a scoping root when evaluating child or 5419 // descendant combinators, which is not what we want. 5420 // In such cases, we work around the behavior by prefixing every selector in the 5421 // list with an ID selector referencing the scope context. 5422 // The technique has to be used as well when a leading combinator is used 5423 // as such selectors are not recognized by querySelectorAll. 5424 // Thanks to Andrew Dupont for this technique. 5425 if ( nodeType === 1 && 5426 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 5427 5428 // Expand context for sibling selectors 5429 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 5430 context; 5431 5432 // We can use :scope instead of the ID hack if the browser 5433 // supports it & if we're not changing the context. 5434 if ( newContext !== context || !support.scope ) { 5435 5436 // Capture the context ID, setting it first if necessary 5437 if ( ( nid = context.getAttribute( "id" ) ) ) { 5438 nid = nid.replace( rcssescape, fcssescape ); 5439 } else { 5440 context.setAttribute( "id", ( nid = expando ) ); 5441 } 5442 } 5443 5444 // Prefix every selector in the list 5445 groups = tokenize( selector ); 5446 i = groups.length; 5447 while ( i-- ) { 5448 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 5449 toSelector( groups[ i ] ); 5450 } 5451 newSelector = groups.join( "," ); 5452 } 5453 5454 try { 5455 push.apply( results, 5456 newContext.querySelectorAll( newSelector ) 5457 ); 5458 return results; 5459 } catch ( qsaError ) { 5460 nonnativeSelectorCache( selector, true ); 5461 } finally { 5462 if ( nid === expando ) { 5463 context.removeAttribute( "id" ); 5464 } 5465 } 5466 } 5467 } 5468 } 5469 5470 // All others 5471 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 5472} 5473 5474/** 5475 * Create key-value caches of limited size 5476 * @returns {function(string, object)} Returns the Object data after storing it on itself with 5477 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 5478 * deleting the oldest entry 5479 */ 5480function createCache() { 5481 var keys = []; 5482 5483 function cache( key, value ) { 5484 5485 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 5486 if ( keys.push( key + " " ) > Expr.cacheLength ) { 5487 5488 // Only keep the most recent entries 5489 delete cache[ keys.shift() ]; 5490 } 5491 return ( cache[ key + " " ] = value ); 5492 } 5493 return cache; 5494} 5495 5496/** 5497 * Mark a function for special use by Sizzle 5498 * @param {Function} fn The function to mark 5499 */ 5500function markFunction( fn ) { 5501 fn[ expando ] = true; 5502 return fn; 5503} 5504 5505/** 5506 * Support testing using an element 5507 * @param {Function} fn Passed the created element and returns a boolean result 5508 */ 5509function assert( fn ) { 5510 var el = document.createElement( "fieldset" ); 5511 5512 try { 5513 return !!fn( el ); 5514 } catch ( e ) { 5515 return false; 5516 } finally { 5517 5518 // Remove from its parent by default 5519 if ( el.parentNode ) { 5520 el.parentNode.removeChild( el ); 5521 } 5522 5523 // release memory in IE 5524 el = null; 5525 } 5526} 5527 5528/** 5529 * Adds the same handler for all of the specified attrs 5530 * @param {String} attrs Pipe-separated list of attributes 5531 * @param {Function} handler The method that will be applied 5532 */ 5533function addHandle( attrs, handler ) { 5534 var arr = attrs.split( "|" ), 5535 i = arr.length; 5536 5537 while ( i-- ) { 5538 Expr.attrHandle[ arr[ i ] ] = handler; 5539 } 5540} 5541 5542/** 5543 * Checks document order of two siblings 5544 * @param {Element} a 5545 * @param {Element} b 5546 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 5547 */ 5548function siblingCheck( a, b ) { 5549 var cur = b && a, 5550 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 5551 a.sourceIndex - b.sourceIndex; 5552 5553 // Use IE sourceIndex if available on both nodes 5554 if ( diff ) { 5555 return diff; 5556 } 5557 5558 // Check if b follows a 5559 if ( cur ) { 5560 while ( ( cur = cur.nextSibling ) ) { 5561 if ( cur === b ) { 5562 return -1; 5563 } 5564 } 5565 } 5566 5567 return a ? 1 : -1; 5568} 5569 5570/** 5571 * Returns a function to use in pseudos for input types 5572 * @param {String} type 5573 */ 5574function createInputPseudo( type ) { 5575 return function( elem ) { 5576 var name = elem.nodeName.toLowerCase(); 5577 return name === "input" && elem.type === type; 5578 }; 5579} 5580 5581/** 5582 * Returns a function to use in pseudos for buttons 5583 * @param {String} type 5584 */ 5585function createButtonPseudo( type ) { 5586 return function( elem ) { 5587 var name = elem.nodeName.toLowerCase(); 5588 return ( name === "input" || name === "button" ) && elem.type === type; 5589 }; 5590} 5591 5592/** 5593 * Returns a function to use in pseudos for :enabled/:disabled 5594 * @param {Boolean} disabled true for :disabled; false for :enabled 5595 */ 5596function createDisabledPseudo( disabled ) { 5597 5598 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 5599 return function( elem ) { 5600 5601 // Only certain elements can match :enabled or :disabled 5602 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 5603 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 5604 if ( "form" in elem ) { 5605 5606 // Check for inherited disabledness on relevant non-disabled elements: 5607 // * listed form-associated elements in a disabled fieldset 5608 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 5609 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 5610 // * option elements in a disabled optgroup 5611 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 5612 // All such elements have a "form" property. 5613 if ( elem.parentNode && elem.disabled === false ) { 5614 5615 // Option elements defer to a parent optgroup if present 5616 if ( "label" in elem ) { 5617 if ( "label" in elem.parentNode ) { 5618 return elem.parentNode.disabled === disabled; 5619 } else { 5620 return elem.disabled === disabled; 5621 } 5622 } 5623 5624 // Support: IE 6 - 11 5625 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 5626 return elem.isDisabled === disabled || 5627 5628 // Where there is no isDisabled, check manually 5629 /* jshint -W018 */ 5630 elem.isDisabled !== !disabled && 5631 inDisabledFieldset( elem ) === disabled; 5632 } 5633 5634 return elem.disabled === disabled; 5635 5636 // Try to winnow out elements that can't be disabled before trusting the disabled property. 5637 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 5638 // even exist on them, let alone have a boolean value. 5639 } else if ( "label" in elem ) { 5640 return elem.disabled === disabled; 5641 } 5642 5643 // Remaining elements are neither :enabled nor :disabled 5644 return false; 5645 }; 5646} 5647 5648/** 5649 * Returns a function to use in pseudos for positionals 5650 * @param {Function} fn 5651 */ 5652function createPositionalPseudo( fn ) { 5653 return markFunction( function( argument ) { 5654 argument = +argument; 5655 return markFunction( function( seed, matches ) { 5656 var j, 5657 matchIndexes = fn( [], seed.length, argument ), 5658 i = matchIndexes.length; 5659 5660 // Match elements found at the specified indexes 5661 while ( i-- ) { 5662 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 5663 seed[ j ] = !( matches[ j ] = seed[ j ] ); 5664 } 5665 } 5666 } ); 5667 } ); 5668} 5669 5670/** 5671 * Checks a node for validity as a Sizzle context 5672 * @param {Element|Object=} context 5673 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 5674 */ 5675function testContext( context ) { 5676 return context && typeof context.getElementsByTagName !== "undefined" && context; 5677} 5678 5679// Expose support vars for convenience 5680support = Sizzle.support = {}; 5681 5682/** 5683 * Detects XML nodes 5684 * @param {Element|Object} elem An element or a document 5685 * @returns {Boolean} True iff elem is a non-HTML XML node 5686 */ 5687isXML = Sizzle.isXML = function( elem ) { 5688 var namespace = elem.namespaceURI, 5689 docElem = ( elem.ownerDocument || elem ).documentElement; 5690 5691 // Support: IE <=8 5692 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 5693 // https://bugs.jquery.com/ticket/4833 5694 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 5695}; 5696 5697/** 5698 * Sets document-related variables once based on the current document 5699 * @param {Element|Object} [doc] An element or document object to use to set the document 5700 * @returns {Object} Returns the current document 5701 */ 5702setDocument = Sizzle.setDocument = function( node ) { 5703 var hasCompare, subWindow, 5704 doc = node ? node.ownerDocument || node : preferredDoc; 5705 5706 // Return early if doc is invalid or already selected 5707 // Support: IE 11+, Edge 17 - 18+ 5708 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5709 // two documents; shallow comparisons work. 5710 // eslint-disable-next-line eqeqeq 5711 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 5712 return document; 5713 } 5714 5715 // Update global variables 5716 document = doc; 5717 docElem = document.documentElement; 5718 documentIsHTML = !isXML( document ); 5719 5720 // Support: IE 9 - 11+, Edge 12 - 18+ 5721 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 5722 // Support: IE 11+, Edge 17 - 18+ 5723 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 5724 // two documents; shallow comparisons work. 5725 // eslint-disable-next-line eqeqeq 5726 if ( preferredDoc != document && 5727 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 5728 5729 // Support: IE 11, Edge 5730 if ( subWindow.addEventListener ) { 5731 subWindow.addEventListener( "unload", unloadHandler, false ); 5732 5733 // Support: IE 9 - 10 only 5734 } else if ( subWindow.attachEvent ) { 5735 subWindow.attachEvent( "onunload", unloadHandler ); 5736 } 5737 } 5738 5739 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 5740 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 5741 // IE/Edge & older browsers don't support the :scope pseudo-class. 5742 // Support: Safari 6.0 only 5743 // Safari 6.0 supports :scope but it's an alias of :root there. 5744 support.scope = assert( function( el ) { 5745 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 5746 return typeof el.querySelectorAll !== "undefined" && 5747 !el.querySelectorAll( ":scope fieldset div" ).length; 5748 } ); 5749 5750 /* Attributes 5751 ---------------------------------------------------------------------- */ 5752 5753 // Support: IE<8 5754 // Verify that getAttribute really returns attributes and not properties 5755 // (excepting IE8 booleans) 5756 support.attributes = assert( function( el ) { 5757 el.className = "i"; 5758 return !el.getAttribute( "className" ); 5759 } ); 5760 5761 /* getElement(s)By* 5762 ---------------------------------------------------------------------- */ 5763 5764 // Check if getElementsByTagName("*") returns only elements 5765 support.getElementsByTagName = assert( function( el ) { 5766 el.appendChild( document.createComment( "" ) ); 5767 return !el.getElementsByTagName( "*" ).length; 5768 } ); 5769 5770 // Support: IE<9 5771 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 5772 5773 // Support: IE<10 5774 // Check if getElementById returns elements by name 5775 // The broken getElementById methods don't pick up programmatically-set names, 5776 // so use a roundabout getElementsByName test 5777 support.getById = assert( function( el ) { 5778 docElem.appendChild( el ).id = expando; 5779 return !document.getElementsByName || !document.getElementsByName( expando ).length; 5780 } ); 5781 5782 // ID filter and find 5783 if ( support.getById ) { 5784 Expr.filter[ "ID" ] = function( id ) { 5785 var attrId = id.replace( runescape, funescape ); 5786 return function( elem ) { 5787 return elem.getAttribute( "id" ) === attrId; 5788 }; 5789 }; 5790 Expr.find[ "ID" ] = function( id, context ) { 5791 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 5792 var elem = context.getElementById( id ); 5793 return elem ? [ elem ] : []; 5794 } 5795 }; 5796 } else { 5797 Expr.filter[ "ID" ] = function( id ) { 5798 var attrId = id.replace( runescape, funescape ); 5799 return function( elem ) { 5800 var node = typeof elem.getAttributeNode !== "undefined" && 5801 elem.getAttributeNode( "id" ); 5802 return node && node.value === attrId; 5803 }; 5804 }; 5805 5806 // Support: IE 6 - 7 only 5807 // getElementById is not reliable as a find shortcut 5808 Expr.find[ "ID" ] = function( id, context ) { 5809 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 5810 var node, i, elems, 5811 elem = context.getElementById( id ); 5812 5813 if ( elem ) { 5814 5815 // Verify the id attribute 5816 node = elem.getAttributeNode( "id" ); 5817 if ( node && node.value === id ) { 5818 return [ elem ]; 5819 } 5820 5821 // Fall back on getElementsByName 5822 elems = context.getElementsByName( id ); 5823 i = 0; 5824 while ( ( elem = elems[ i++ ] ) ) { 5825 node = elem.getAttributeNode( "id" ); 5826 if ( node && node.value === id ) { 5827 return [ elem ]; 5828 } 5829 } 5830 } 5831 5832 return []; 5833 } 5834 }; 5835 } 5836 5837 // Tag 5838 Expr.find[ "TAG" ] = support.getElementsByTagName ? 5839 function( tag, context ) { 5840 if ( typeof context.getElementsByTagName !== "undefined" ) { 5841 return context.getElementsByTagName( tag ); 5842 5843 // DocumentFragment nodes don't have gEBTN 5844 } else if ( support.qsa ) { 5845 return context.querySelectorAll( tag ); 5846 } 5847 } : 5848 5849 function( tag, context ) { 5850 var elem, 5851 tmp = [], 5852 i = 0, 5853 5854 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 5855 results = context.getElementsByTagName( tag ); 5856 5857 // Filter out possible comments 5858 if ( tag === "*" ) { 5859 while ( ( elem = results[ i++ ] ) ) { 5860 if ( elem.nodeType === 1 ) { 5861 tmp.push( elem ); 5862 } 5863 } 5864 5865 return tmp; 5866 } 5867 return results; 5868 }; 5869 5870 // Class 5871 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 5872 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 5873 return context.getElementsByClassName( className ); 5874 } 5875 }; 5876 5877 /* QSA/matchesSelector 5878 ---------------------------------------------------------------------- */ 5879 5880 // QSA and matchesSelector support 5881 5882 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 5883 rbuggyMatches = []; 5884 5885 // qSa(:focus) reports false when true (Chrome 21) 5886 // We allow this because of a bug in IE8/9 that throws an error 5887 // whenever `document.activeElement` is accessed on an iframe 5888 // So, we allow :focus to pass through QSA all the time to avoid the IE error 5889 // See https://bugs.jquery.com/ticket/13378 5890 rbuggyQSA = []; 5891 5892 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 5893 5894 // Build QSA regex 5895 // Regex strategy adopted from Diego Perini 5896 assert( function( el ) { 5897 5898 var input; 5899 5900 // Select is set to empty string on purpose 5901 // This is to test IE's treatment of not explicitly 5902 // setting a boolean content attribute, 5903 // since its presence should be enough 5904 // https://bugs.jquery.com/ticket/12359 5905 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 5906 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 5907 "<option selected=''></option></select>"; 5908 5909 // Support: IE8, Opera 11-12.16 5910 // Nothing should be selected when empty strings follow ^= or $= or *= 5911 // The test attribute must be unknown in Opera but "safe" for WinRT 5912 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 5913 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 5914 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 5915 } 5916 5917 // Support: IE8 5918 // Boolean attributes and "value" are not treated correctly 5919 if ( !el.querySelectorAll( "[selected]" ).length ) { 5920 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 5921 } 5922 5923 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 5924 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 5925 rbuggyQSA.push( "~=" ); 5926 } 5927 5928 // Support: IE 11+, Edge 15 - 18+ 5929 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 5930 // Adding a temporary attribute to the document before the selection works 5931 // around the issue. 5932 // Interestingly, IE 10 & older don't seem to have the issue. 5933 input = document.createElement( "input" ); 5934 input.setAttribute( "name", "" ); 5935 el.appendChild( input ); 5936 if ( !el.querySelectorAll( "[name='']" ).length ) { 5937 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 5938 whitespace + "*(?:''|\"\")" ); 5939 } 5940 5941 // Webkit/Opera - :checked should return selected option elements 5942 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 5943 // IE8 throws error here and will not see later tests 5944 if ( !el.querySelectorAll( ":checked" ).length ) { 5945 rbuggyQSA.push( ":checked" ); 5946 } 5947 5948 // Support: Safari 8+, iOS 8+ 5949 // https://bugs.webkit.org/show_bug.cgi?id=136851 5950 // In-page `selector#id sibling-combinator selector` fails 5951 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 5952 rbuggyQSA.push( ".#.+[+~]" ); 5953 } 5954 5955 // Support: Firefox <=3.6 - 5 only 5956 // Old Firefox doesn't throw on a badly-escaped identifier. 5957 el.querySelectorAll( "\\\f" ); 5958 rbuggyQSA.push( "[\\r\\n\\f]" ); 5959 } ); 5960 5961 assert( function( el ) { 5962 el.innerHTML = "<a href='' disabled='disabled'></a>" + 5963 "<select disabled='disabled'><option/></select>"; 5964 5965 // Support: Windows 8 Native Apps 5966 // The type and name attributes are restricted during .innerHTML assignment 5967 var input = document.createElement( "input" ); 5968 input.setAttribute( "type", "hidden" ); 5969 el.appendChild( input ).setAttribute( "name", "D" ); 5970 5971 // Support: IE8 5972 // Enforce case-sensitivity of name attribute 5973 if ( el.querySelectorAll( "[name=d]" ).length ) { 5974 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 5975 } 5976 5977 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 5978 // IE8 throws error here and will not see later tests 5979 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 5980 rbuggyQSA.push( ":enabled", ":disabled" ); 5981 } 5982 5983 // Support: IE9-11+ 5984 // IE's :disabled selector does not pick up the children of disabled fieldsets 5985 docElem.appendChild( el ).disabled = true; 5986 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 5987 rbuggyQSA.push( ":enabled", ":disabled" ); 5988 } 5989 5990 // Support: Opera 10 - 11 only 5991 // Opera 10-11 does not throw on post-comma invalid pseudos 5992 el.querySelectorAll( "*,:x" ); 5993 rbuggyQSA.push( ",.*:" ); 5994 } ); 5995 } 5996 5997 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 5998 docElem.webkitMatchesSelector || 5999 docElem.mozMatchesSelector || 6000 docElem.oMatchesSelector || 6001 docElem.msMatchesSelector ) ) ) ) { 6002 6003 assert( function( el ) { 6004 6005 // Check to see if it's possible to do matchesSelector 6006 // on a disconnected node (IE 9) 6007 support.disconnectedMatch = matches.call( el, "*" ); 6008 6009 // This should fail with an exception 6010 // Gecko does not error, returns false instead 6011 matches.call( el, "[s!='']:x" ); 6012 rbuggyMatches.push( "!=", pseudos ); 6013 } ); 6014 } 6015 6016 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 6017 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 6018 6019 /* Contains 6020 ---------------------------------------------------------------------- */ 6021 hasCompare = rnative.test( docElem.compareDocumentPosition ); 6022 6023 // Element contains another 6024 // Purposefully self-exclusive 6025 // As in, an element does not contain itself 6026 contains = hasCompare || rnative.test( docElem.contains ) ? 6027 function( a, b ) { 6028 var adown = a.nodeType === 9 ? a.documentElement : a, 6029 bup = b && b.parentNode; 6030 return a === bup || !!( bup && bup.nodeType === 1 && ( 6031 adown.contains ? 6032 adown.contains( bup ) : 6033 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 6034 ) ); 6035 } : 6036 function( a, b ) { 6037 if ( b ) { 6038 while ( ( b = b.parentNode ) ) { 6039 if ( b === a ) { 6040 return true; 6041 } 6042 } 6043 } 6044 return false; 6045 }; 6046 6047 /* Sorting 6048 ---------------------------------------------------------------------- */ 6049 6050 // Document order sorting 6051 sortOrder = hasCompare ? 6052 function( a, b ) { 6053 6054 // Flag for duplicate removal 6055 if ( a === b ) { 6056 hasDuplicate = true; 6057 return 0; 6058 } 6059 6060 // Sort on method existence if only one input has compareDocumentPosition 6061 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 6062 if ( compare ) { 6063 return compare; 6064 } 6065 6066 // Calculate position if both inputs belong to the same document 6067 // Support: IE 11+, Edge 17 - 18+ 6068 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6069 // two documents; shallow comparisons work. 6070 // eslint-disable-next-line eqeqeq 6071 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 6072 a.compareDocumentPosition( b ) : 6073 6074 // Otherwise we know they are disconnected 6075 1; 6076 6077 // Disconnected nodes 6078 if ( compare & 1 || 6079 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 6080 6081 // Choose the first element that is related to our preferred document 6082 // Support: IE 11+, Edge 17 - 18+ 6083 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6084 // two documents; shallow comparisons work. 6085 // eslint-disable-next-line eqeqeq 6086 if ( a == document || a.ownerDocument == preferredDoc && 6087 contains( preferredDoc, a ) ) { 6088 return -1; 6089 } 6090 6091 // Support: IE 11+, Edge 17 - 18+ 6092 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6093 // two documents; shallow comparisons work. 6094 // eslint-disable-next-line eqeqeq 6095 if ( b == document || b.ownerDocument == preferredDoc && 6096 contains( preferredDoc, b ) ) { 6097 return 1; 6098 } 6099 6100 // Maintain original order 6101 return sortInput ? 6102 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6103 0; 6104 } 6105 6106 return compare & 4 ? -1 : 1; 6107 } : 6108 function( a, b ) { 6109 6110 // Exit early if the nodes are identical 6111 if ( a === b ) { 6112 hasDuplicate = true; 6113 return 0; 6114 } 6115 6116 var cur, 6117 i = 0, 6118 aup = a.parentNode, 6119 bup = b.parentNode, 6120 ap = [ a ], 6121 bp = [ b ]; 6122 6123 // Parentless nodes are either documents or disconnected 6124 if ( !aup || !bup ) { 6125 6126 // Support: IE 11+, Edge 17 - 18+ 6127 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6128 // two documents; shallow comparisons work. 6129 /* eslint-disable eqeqeq */ 6130 return a == document ? -1 : 6131 b == document ? 1 : 6132 /* eslint-enable eqeqeq */ 6133 aup ? -1 : 6134 bup ? 1 : 6135 sortInput ? 6136 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 6137 0; 6138 6139 // If the nodes are siblings, we can do a quick check 6140 } else if ( aup === bup ) { 6141 return siblingCheck( a, b ); 6142 } 6143 6144 // Otherwise we need full lists of their ancestors for comparison 6145 cur = a; 6146 while ( ( cur = cur.parentNode ) ) { 6147 ap.unshift( cur ); 6148 } 6149 cur = b; 6150 while ( ( cur = cur.parentNode ) ) { 6151 bp.unshift( cur ); 6152 } 6153 6154 // Walk down the tree looking for a discrepancy 6155 while ( ap[ i ] === bp[ i ] ) { 6156 i++; 6157 } 6158 6159 return i ? 6160 6161 // Do a sibling check if the nodes have a common ancestor 6162 siblingCheck( ap[ i ], bp[ i ] ) : 6163 6164 // Otherwise nodes in our document sort first 6165 // Support: IE 11+, Edge 17 - 18+ 6166 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6167 // two documents; shallow comparisons work. 6168 /* eslint-disable eqeqeq */ 6169 ap[ i ] == preferredDoc ? -1 : 6170 bp[ i ] == preferredDoc ? 1 : 6171 /* eslint-enable eqeqeq */ 6172 0; 6173 }; 6174 6175 return document; 6176}; 6177 6178Sizzle.matches = function( expr, elements ) { 6179 return Sizzle( expr, null, null, elements ); 6180}; 6181 6182Sizzle.matchesSelector = function( elem, expr ) { 6183 setDocument( elem ); 6184 6185 if ( support.matchesSelector && documentIsHTML && 6186 !nonnativeSelectorCache[ expr + " " ] && 6187 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 6188 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 6189 6190 try { 6191 var ret = matches.call( elem, expr ); 6192 6193 // IE 9's matchesSelector returns false on disconnected nodes 6194 if ( ret || support.disconnectedMatch || 6195 6196 // As well, disconnected nodes are said to be in a document 6197 // fragment in IE 9 6198 elem.document && elem.document.nodeType !== 11 ) { 6199 return ret; 6200 } 6201 } catch ( e ) { 6202 nonnativeSelectorCache( expr, true ); 6203 } 6204 } 6205 6206 return Sizzle( expr, document, null, [ elem ] ).length > 0; 6207}; 6208 6209Sizzle.contains = function( context, elem ) { 6210 6211 // Set document vars if needed 6212 // Support: IE 11+, Edge 17 - 18+ 6213 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6214 // two documents; shallow comparisons work. 6215 // eslint-disable-next-line eqeqeq 6216 if ( ( context.ownerDocument || context ) != document ) { 6217 setDocument( context ); 6218 } 6219 return contains( context, elem ); 6220}; 6221 6222Sizzle.attr = function( elem, name ) { 6223 6224 // Set document vars if needed 6225 // Support: IE 11+, Edge 17 - 18+ 6226 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6227 // two documents; shallow comparisons work. 6228 // eslint-disable-next-line eqeqeq 6229 if ( ( elem.ownerDocument || elem ) != document ) { 6230 setDocument( elem ); 6231 } 6232 6233 var fn = Expr.attrHandle[ name.toLowerCase() ], 6234 6235 // Don't get fooled by Object.prototype properties (jQuery #13807) 6236 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 6237 fn( elem, name, !documentIsHTML ) : 6238 undefined; 6239 6240 return val !== undefined ? 6241 val : 6242 support.attributes || !documentIsHTML ? 6243 elem.getAttribute( name ) : 6244 ( val = elem.getAttributeNode( name ) ) && val.specified ? 6245 val.value : 6246 null; 6247}; 6248 6249Sizzle.escape = function( sel ) { 6250 return ( sel + "" ).replace( rcssescape, fcssescape ); 6251}; 6252 6253Sizzle.error = function( msg ) { 6254 throw new Error( "Syntax error, unrecognized expression: " + msg ); 6255}; 6256 6257/** 6258 * Document sorting and removing duplicates 6259 * @param {ArrayLike} results 6260 */ 6261Sizzle.uniqueSort = function( results ) { 6262 var elem, 6263 duplicates = [], 6264 j = 0, 6265 i = 0; 6266 6267 // Unless we *know* we can detect duplicates, assume their presence 6268 hasDuplicate = !support.detectDuplicates; 6269 sortInput = !support.sortStable && results.slice( 0 ); 6270 results.sort( sortOrder ); 6271 6272 if ( hasDuplicate ) { 6273 while ( ( elem = results[ i++ ] ) ) { 6274 if ( elem === results[ i ] ) { 6275 j = duplicates.push( i ); 6276 } 6277 } 6278 while ( j-- ) { 6279 results.splice( duplicates[ j ], 1 ); 6280 } 6281 } 6282 6283 // Clear input after sorting to release objects 6284 // See https://github.com/jquery/sizzle/pull/225 6285 sortInput = null; 6286 6287 return results; 6288}; 6289 6290/** 6291 * Utility function for retrieving the text value of an array of DOM nodes 6292 * @param {Array|Element} elem 6293 */ 6294getText = Sizzle.getText = function( elem ) { 6295 var node, 6296 ret = "", 6297 i = 0, 6298 nodeType = elem.nodeType; 6299 6300 if ( !nodeType ) { 6301 6302 // If no nodeType, this is expected to be an array 6303 while ( ( node = elem[ i++ ] ) ) { 6304 6305 // Do not traverse comment nodes 6306 ret += getText( node ); 6307 } 6308 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 6309 6310 // Use textContent for elements 6311 // innerText usage removed for consistency of new lines (jQuery #11153) 6312 if ( typeof elem.textContent === "string" ) { 6313 return elem.textContent; 6314 } else { 6315 6316 // Traverse its children 6317 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6318 ret += getText( elem ); 6319 } 6320 } 6321 } else if ( nodeType === 3 || nodeType === 4 ) { 6322 return elem.nodeValue; 6323 } 6324 6325 // Do not include comment or processing instruction nodes 6326 6327 return ret; 6328}; 6329 6330Expr = Sizzle.selectors = { 6331 6332 // Can be adjusted by the user 6333 cacheLength: 50, 6334 6335 createPseudo: markFunction, 6336 6337 match: matchExpr, 6338 6339 attrHandle: {}, 6340 6341 find: {}, 6342 6343 relative: { 6344 ">": { dir: "parentNode", first: true }, 6345 " ": { dir: "parentNode" }, 6346 "+": { dir: "previousSibling", first: true }, 6347 "~": { dir: "previousSibling" } 6348 }, 6349 6350 preFilter: { 6351 "ATTR": function( match ) { 6352 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 6353 6354 // Move the given value to match[3] whether quoted or unquoted 6355 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 6356 match[ 5 ] || "" ).replace( runescape, funescape ); 6357 6358 if ( match[ 2 ] === "~=" ) { 6359 match[ 3 ] = " " + match[ 3 ] + " "; 6360 } 6361 6362 return match.slice( 0, 4 ); 6363 }, 6364 6365 "CHILD": function( match ) { 6366 6367 /* matches from matchExpr["CHILD"] 6368 1 type (only|nth|...) 6369 2 what (child|of-type) 6370 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 6371 4 xn-component of xn+y argument ([+-]?\d*n|) 6372 5 sign of xn-component 6373 6 x of xn-component 6374 7 sign of y-component 6375 8 y of y-component 6376 */ 6377 match[ 1 ] = match[ 1 ].toLowerCase(); 6378 6379 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 6380 6381 // nth-* requires argument 6382 if ( !match[ 3 ] ) { 6383 Sizzle.error( match[ 0 ] ); 6384 } 6385 6386 // numeric x and y parameters for Expr.filter.CHILD 6387 // remember that false/true cast respectively to 0/1 6388 match[ 4 ] = +( match[ 4 ] ? 6389 match[ 5 ] + ( match[ 6 ] || 1 ) : 6390 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 6391 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 6392 6393 // other types prohibit arguments 6394 } else if ( match[ 3 ] ) { 6395 Sizzle.error( match[ 0 ] ); 6396 } 6397 6398 return match; 6399 }, 6400 6401 "PSEUDO": function( match ) { 6402 var excess, 6403 unquoted = !match[ 6 ] && match[ 2 ]; 6404 6405 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 6406 return null; 6407 } 6408 6409 // Accept quoted arguments as-is 6410 if ( match[ 3 ] ) { 6411 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 6412 6413 // Strip excess characters from unquoted arguments 6414 } else if ( unquoted && rpseudo.test( unquoted ) && 6415 6416 // Get excess from tokenize (recursively) 6417 ( excess = tokenize( unquoted, true ) ) && 6418 6419 // advance to the next closing parenthesis 6420 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 6421 6422 // excess is a negative index 6423 match[ 0 ] = match[ 0 ].slice( 0, excess ); 6424 match[ 2 ] = unquoted.slice( 0, excess ); 6425 } 6426 6427 // Return only captures needed by the pseudo filter method (type and argument) 6428 return match.slice( 0, 3 ); 6429 } 6430 }, 6431 6432 filter: { 6433 6434 "TAG": function( nodeNameSelector ) { 6435 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 6436 return nodeNameSelector === "*" ? 6437 function() { 6438 return true; 6439 } : 6440 function( elem ) { 6441 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 6442 }; 6443 }, 6444 6445 "CLASS": function( className ) { 6446 var pattern = classCache[ className + " " ]; 6447 6448 return pattern || 6449 ( pattern = new RegExp( "(^|" + whitespace + 6450 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 6451 className, function( elem ) { 6452 return pattern.test( 6453 typeof elem.className === "string" && elem.className || 6454 typeof elem.getAttribute !== "undefined" && 6455 elem.getAttribute( "class" ) || 6456 "" 6457 ); 6458 } ); 6459 }, 6460 6461 "ATTR": function( name, operator, check ) { 6462 return function( elem ) { 6463 var result = Sizzle.attr( elem, name ); 6464 6465 if ( result == null ) { 6466 return operator === "!="; 6467 } 6468 if ( !operator ) { 6469 return true; 6470 } 6471 6472 result += ""; 6473 6474 /* eslint-disable max-len */ 6475 6476 return operator === "=" ? result === check : 6477 operator === "!=" ? result !== check : 6478 operator === "^=" ? check && result.indexOf( check ) === 0 : 6479 operator === "*=" ? check && result.indexOf( check ) > -1 : 6480 operator === "$=" ? check && result.slice( -check.length ) === check : 6481 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 6482 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 6483 false; 6484 /* eslint-enable max-len */ 6485 6486 }; 6487 }, 6488 6489 "CHILD": function( type, what, _argument, first, last ) { 6490 var simple = type.slice( 0, 3 ) !== "nth", 6491 forward = type.slice( -4 ) !== "last", 6492 ofType = what === "of-type"; 6493 6494 return first === 1 && last === 0 ? 6495 6496 // Shortcut for :nth-*(n) 6497 function( elem ) { 6498 return !!elem.parentNode; 6499 } : 6500 6501 function( elem, _context, xml ) { 6502 var cache, uniqueCache, outerCache, node, nodeIndex, start, 6503 dir = simple !== forward ? "nextSibling" : "previousSibling", 6504 parent = elem.parentNode, 6505 name = ofType && elem.nodeName.toLowerCase(), 6506 useCache = !xml && !ofType, 6507 diff = false; 6508 6509 if ( parent ) { 6510 6511 // :(first|last|only)-(child|of-type) 6512 if ( simple ) { 6513 while ( dir ) { 6514 node = elem; 6515 while ( ( node = node[ dir ] ) ) { 6516 if ( ofType ? 6517 node.nodeName.toLowerCase() === name : 6518 node.nodeType === 1 ) { 6519 6520 return false; 6521 } 6522 } 6523 6524 // Reverse direction for :only-* (if we haven't yet done so) 6525 start = dir = type === "only" && !start && "nextSibling"; 6526 } 6527 return true; 6528 } 6529 6530 start = [ forward ? parent.firstChild : parent.lastChild ]; 6531 6532 // non-xml :nth-child(...) stores cache data on `parent` 6533 if ( forward && useCache ) { 6534 6535 // Seek `elem` from a previously-cached index 6536 6537 // ...in a gzip-friendly way 6538 node = parent; 6539 outerCache = node[ expando ] || ( node[ expando ] = {} ); 6540 6541 // Support: IE <9 only 6542 // Defend against cloned attroperties (jQuery gh-1709) 6543 uniqueCache = outerCache[ node.uniqueID ] || 6544 ( outerCache[ node.uniqueID ] = {} ); 6545 6546 cache = uniqueCache[ type ] || []; 6547 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6548 diff = nodeIndex && cache[ 2 ]; 6549 node = nodeIndex && parent.childNodes[ nodeIndex ]; 6550 6551 while ( ( node = ++nodeIndex && node && node[ dir ] || 6552 6553 // Fallback to seeking `elem` from the start 6554 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 6555 6556 // When found, cache indexes on `parent` and break 6557 if ( node.nodeType === 1 && ++diff && node === elem ) { 6558 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 6559 break; 6560 } 6561 } 6562 6563 } else { 6564 6565 // Use previously-cached element index if available 6566 if ( useCache ) { 6567 6568 // ...in a gzip-friendly way 6569 node = elem; 6570 outerCache = node[ expando ] || ( node[ expando ] = {} ); 6571 6572 // Support: IE <9 only 6573 // Defend against cloned attroperties (jQuery gh-1709) 6574 uniqueCache = outerCache[ node.uniqueID ] || 6575 ( outerCache[ node.uniqueID ] = {} ); 6576 6577 cache = uniqueCache[ type ] || []; 6578 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 6579 diff = nodeIndex; 6580 } 6581 6582 // xml :nth-child(...) 6583 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 6584 if ( diff === false ) { 6585 6586 // Use the same loop as above to seek `elem` from the start 6587 while ( ( node = ++nodeIndex && node && node[ dir ] || 6588 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 6589 6590 if ( ( ofType ? 6591 node.nodeName.toLowerCase() === name : 6592 node.nodeType === 1 ) && 6593 ++diff ) { 6594 6595 // Cache the index of each encountered element 6596 if ( useCache ) { 6597 outerCache = node[ expando ] || 6598 ( node[ expando ] = {} ); 6599 6600 // Support: IE <9 only 6601 // Defend against cloned attroperties (jQuery gh-1709) 6602 uniqueCache = outerCache[ node.uniqueID ] || 6603 ( outerCache[ node.uniqueID ] = {} ); 6604 6605 uniqueCache[ type ] = [ dirruns, diff ]; 6606 } 6607 6608 if ( node === elem ) { 6609 break; 6610 } 6611 } 6612 } 6613 } 6614 } 6615 6616 // Incorporate the offset, then check against cycle size 6617 diff -= last; 6618 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 6619 } 6620 }; 6621 }, 6622 6623 "PSEUDO": function( pseudo, argument ) { 6624 6625 // pseudo-class names are case-insensitive 6626 // http://www.w3.org/TR/selectors/#pseudo-classes 6627 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 6628 // Remember that setFilters inherits from pseudos 6629 var args, 6630 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 6631 Sizzle.error( "unsupported pseudo: " + pseudo ); 6632 6633 // The user may use createPseudo to indicate that 6634 // arguments are needed to create the filter function 6635 // just as Sizzle does 6636 if ( fn[ expando ] ) { 6637 return fn( argument ); 6638 } 6639 6640 // But maintain support for old signatures 6641 if ( fn.length > 1 ) { 6642 args = [ pseudo, pseudo, "", argument ]; 6643 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 6644 markFunction( function( seed, matches ) { 6645 var idx, 6646 matched = fn( seed, argument ), 6647 i = matched.length; 6648 while ( i-- ) { 6649 idx = indexOf( seed, matched[ i ] ); 6650 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 6651 } 6652 } ) : 6653 function( elem ) { 6654 return fn( elem, 0, args ); 6655 }; 6656 } 6657 6658 return fn; 6659 } 6660 }, 6661 6662 pseudos: { 6663 6664 // Potentially complex pseudos 6665 "not": markFunction( function( selector ) { 6666 6667 // Trim the selector passed to compile 6668 // to avoid treating leading and trailing 6669 // spaces as combinators 6670 var input = [], 6671 results = [], 6672 matcher = compile( selector.replace( rtrim, "$1" ) ); 6673 6674 return matcher[ expando ] ? 6675 markFunction( function( seed, matches, _context, xml ) { 6676 var elem, 6677 unmatched = matcher( seed, null, xml, [] ), 6678 i = seed.length; 6679 6680 // Match elements unmatched by `matcher` 6681 while ( i-- ) { 6682 if ( ( elem = unmatched[ i ] ) ) { 6683 seed[ i ] = !( matches[ i ] = elem ); 6684 } 6685 } 6686 } ) : 6687 function( elem, _context, xml ) { 6688 input[ 0 ] = elem; 6689 matcher( input, null, xml, results ); 6690 6691 // Don't keep the element (issue #299) 6692 input[ 0 ] = null; 6693 return !results.pop(); 6694 }; 6695 } ), 6696 6697 "has": markFunction( function( selector ) { 6698 return function( elem ) { 6699 return Sizzle( selector, elem ).length > 0; 6700 }; 6701 } ), 6702 6703 "contains": markFunction( function( text ) { 6704 text = text.replace( runescape, funescape ); 6705 return function( elem ) { 6706 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 6707 }; 6708 } ), 6709 6710 // "Whether an element is represented by a :lang() selector 6711 // is based solely on the element's language value 6712 // being equal to the identifier C, 6713 // or beginning with the identifier C immediately followed by "-". 6714 // The matching of C against the element's language value is performed case-insensitively. 6715 // The identifier C does not have to be a valid language name." 6716 // http://www.w3.org/TR/selectors/#lang-pseudo 6717 "lang": markFunction( function( lang ) { 6718 6719 // lang value must be a valid identifier 6720 if ( !ridentifier.test( lang || "" ) ) { 6721 Sizzle.error( "unsupported lang: " + lang ); 6722 } 6723 lang = lang.replace( runescape, funescape ).toLowerCase(); 6724 return function( elem ) { 6725 var elemLang; 6726 do { 6727 if ( ( elemLang = documentIsHTML ? 6728 elem.lang : 6729 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 6730 6731 elemLang = elemLang.toLowerCase(); 6732 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 6733 } 6734 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 6735 return false; 6736 }; 6737 } ), 6738 6739 // Miscellaneous 6740 "target": function( elem ) { 6741 var hash = window.location && window.location.hash; 6742 return hash && hash.slice( 1 ) === elem.id; 6743 }, 6744 6745 "root": function( elem ) { 6746 return elem === docElem; 6747 }, 6748 6749 "focus": function( elem ) { 6750 return elem === document.activeElement && 6751 ( !document.hasFocus || document.hasFocus() ) && 6752 !!( elem.type || elem.href || ~elem.tabIndex ); 6753 }, 6754 6755 // Boolean properties 6756 "enabled": createDisabledPseudo( false ), 6757 "disabled": createDisabledPseudo( true ), 6758 6759 "checked": function( elem ) { 6760 6761 // In CSS3, :checked should return both checked and selected elements 6762 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 6763 var nodeName = elem.nodeName.toLowerCase(); 6764 return ( nodeName === "input" && !!elem.checked ) || 6765 ( nodeName === "option" && !!elem.selected ); 6766 }, 6767 6768 "selected": function( elem ) { 6769 6770 // Accessing this property makes selected-by-default 6771 // options in Safari work properly 6772 if ( elem.parentNode ) { 6773 // eslint-disable-next-line no-unused-expressions 6774 elem.parentNode.selectedIndex; 6775 } 6776 6777 return elem.selected === true; 6778 }, 6779 6780 // Contents 6781 "empty": function( elem ) { 6782 6783 // http://www.w3.org/TR/selectors/#empty-pseudo 6784 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 6785 // but not by others (comment: 8; processing instruction: 7; etc.) 6786 // nodeType < 6 works because attributes (2) do not appear as children 6787 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 6788 if ( elem.nodeType < 6 ) { 6789 return false; 6790 } 6791 } 6792 return true; 6793 }, 6794 6795 "parent": function( elem ) { 6796 return !Expr.pseudos[ "empty" ]( elem ); 6797 }, 6798 6799 // Element/input types 6800 "header": function( elem ) { 6801 return rheader.test( elem.nodeName ); 6802 }, 6803 6804 "input": function( elem ) { 6805 return rinputs.test( elem.nodeName ); 6806 }, 6807 6808 "button": function( elem ) { 6809 var name = elem.nodeName.toLowerCase(); 6810 return name === "input" && elem.type === "button" || name === "button"; 6811 }, 6812 6813 "text": function( elem ) { 6814 var attr; 6815 return elem.nodeName.toLowerCase() === "input" && 6816 elem.type === "text" && 6817 6818 // Support: IE<8 6819 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 6820 ( ( attr = elem.getAttribute( "type" ) ) == null || 6821 attr.toLowerCase() === "text" ); 6822 }, 6823 6824 // Position-in-collection 6825 "first": createPositionalPseudo( function() { 6826 return [ 0 ]; 6827 } ), 6828 6829 "last": createPositionalPseudo( function( _matchIndexes, length ) { 6830 return [ length - 1 ]; 6831 } ), 6832 6833 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 6834 return [ argument < 0 ? argument + length : argument ]; 6835 } ), 6836 6837 "even": createPositionalPseudo( function( matchIndexes, length ) { 6838 var i = 0; 6839 for ( ; i < length; i += 2 ) { 6840 matchIndexes.push( i ); 6841 } 6842 return matchIndexes; 6843 } ), 6844 6845 "odd": createPositionalPseudo( function( matchIndexes, length ) { 6846 var i = 1; 6847 for ( ; i < length; i += 2 ) { 6848 matchIndexes.push( i ); 6849 } 6850 return matchIndexes; 6851 } ), 6852 6853 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 6854 var i = argument < 0 ? 6855 argument + length : 6856 argument > length ? 6857 length : 6858 argument; 6859 for ( ; --i >= 0; ) { 6860 matchIndexes.push( i ); 6861 } 6862 return matchIndexes; 6863 } ), 6864 6865 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 6866 var i = argument < 0 ? argument + length : argument; 6867 for ( ; ++i < length; ) { 6868 matchIndexes.push( i ); 6869 } 6870 return matchIndexes; 6871 } ) 6872 } 6873}; 6874 6875Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 6876 6877// Add button/input type pseudos 6878for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 6879 Expr.pseudos[ i ] = createInputPseudo( i ); 6880} 6881for ( i in { submit: true, reset: true } ) { 6882 Expr.pseudos[ i ] = createButtonPseudo( i ); 6883} 6884 6885// Easy API for creating new setFilters 6886function setFilters() {} 6887setFilters.prototype = Expr.filters = Expr.pseudos; 6888Expr.setFilters = new setFilters(); 6889 6890tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 6891 var matched, match, tokens, type, 6892 soFar, groups, preFilters, 6893 cached = tokenCache[ selector + " " ]; 6894 6895 if ( cached ) { 6896 return parseOnly ? 0 : cached.slice( 0 ); 6897 } 6898 6899 soFar = selector; 6900 groups = []; 6901 preFilters = Expr.preFilter; 6902 6903 while ( soFar ) { 6904 6905 // Comma and first run 6906 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 6907 if ( match ) { 6908 6909 // Don't consume trailing commas as valid 6910 soFar = soFar.slice( match[ 0 ].length ) || soFar; 6911 } 6912 groups.push( ( tokens = [] ) ); 6913 } 6914 6915 matched = false; 6916 6917 // Combinators 6918 if ( ( match = rcombinators.exec( soFar ) ) ) { 6919 matched = match.shift(); 6920 tokens.push( { 6921 value: matched, 6922 6923 // Cast descendant combinators to space 6924 type: match[ 0 ].replace( rtrim, " " ) 6925 } ); 6926 soFar = soFar.slice( matched.length ); 6927 } 6928 6929 // Filters 6930 for ( type in Expr.filter ) { 6931 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 6932 ( match = preFilters[ type ]( match ) ) ) ) { 6933 matched = match.shift(); 6934 tokens.push( { 6935 value: matched, 6936 type: type, 6937 matches: match 6938 } ); 6939 soFar = soFar.slice( matched.length ); 6940 } 6941 } 6942 6943 if ( !matched ) { 6944 break; 6945 } 6946 } 6947 6948 // Return the length of the invalid excess 6949 // if we're just parsing 6950 // Otherwise, throw an error or return tokens 6951 return parseOnly ? 6952 soFar.length : 6953 soFar ? 6954 Sizzle.error( selector ) : 6955 6956 // Cache the tokens 6957 tokenCache( selector, groups ).slice( 0 ); 6958}; 6959 6960function toSelector( tokens ) { 6961 var i = 0, 6962 len = tokens.length, 6963 selector = ""; 6964 for ( ; i < len; i++ ) { 6965 selector += tokens[ i ].value; 6966 } 6967 return selector; 6968} 6969 6970function addCombinator( matcher, combinator, base ) { 6971 var dir = combinator.dir, 6972 skip = combinator.next, 6973 key = skip || dir, 6974 checkNonElements = base && key === "parentNode", 6975 doneName = done++; 6976 6977 return combinator.first ? 6978 6979 // Check against closest ancestor/preceding element 6980 function( elem, context, xml ) { 6981 while ( ( elem = elem[ dir ] ) ) { 6982 if ( elem.nodeType === 1 || checkNonElements ) { 6983 return matcher( elem, context, xml ); 6984 } 6985 } 6986 return false; 6987 } : 6988 6989 // Check against all ancestor/preceding elements 6990 function( elem, context, xml ) { 6991 var oldCache, uniqueCache, outerCache, 6992 newCache = [ dirruns, doneName ]; 6993 6994 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 6995 if ( xml ) { 6996 while ( ( elem = elem[ dir ] ) ) { 6997 if ( elem.nodeType === 1 || checkNonElements ) { 6998 if ( matcher( elem, context, xml ) ) { 6999 return true; 7000 } 7001 } 7002 } 7003 } else { 7004 while ( ( elem = elem[ dir ] ) ) { 7005 if ( elem.nodeType === 1 || checkNonElements ) { 7006 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 7007 7008 // Support: IE <9 only 7009 // Defend against cloned attroperties (jQuery gh-1709) 7010 uniqueCache = outerCache[ elem.uniqueID ] || 7011 ( outerCache[ elem.uniqueID ] = {} ); 7012 7013 if ( skip && skip === elem.nodeName.toLowerCase() ) { 7014 elem = elem[ dir ] || elem; 7015 } else if ( ( oldCache = uniqueCache[ key ] ) && 7016 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 7017 7018 // Assign to newCache so results back-propagate to previous elements 7019 return ( newCache[ 2 ] = oldCache[ 2 ] ); 7020 } else { 7021 7022 // Reuse newcache so results back-propagate to previous elements 7023 uniqueCache[ key ] = newCache; 7024 7025 // A match means we're done; a fail means we have to keep checking 7026 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 7027 return true; 7028 } 7029 } 7030 } 7031 } 7032 } 7033 return false; 7034 }; 7035} 7036 7037function elementMatcher( matchers ) { 7038 return matchers.length > 1 ? 7039 function( elem, context, xml ) { 7040 var i = matchers.length; 7041 while ( i-- ) { 7042 if ( !matchers[ i ]( elem, context, xml ) ) { 7043 return false; 7044 } 7045 } 7046 return true; 7047 } : 7048 matchers[ 0 ]; 7049} 7050 7051function multipleContexts( selector, contexts, results ) { 7052 var i = 0, 7053 len = contexts.length; 7054 for ( ; i < len; i++ ) { 7055 Sizzle( selector, contexts[ i ], results ); 7056 } 7057 return results; 7058} 7059 7060function condense( unmatched, map, filter, context, xml ) { 7061 var elem, 7062 newUnmatched = [], 7063 i = 0, 7064 len = unmatched.length, 7065 mapped = map != null; 7066 7067 for ( ; i < len; i++ ) { 7068 if ( ( elem = unmatched[ i ] ) ) { 7069 if ( !filter || filter( elem, context, xml ) ) { 7070 newUnmatched.push( elem ); 7071 if ( mapped ) { 7072 map.push( i ); 7073 } 7074 } 7075 } 7076 } 7077 7078 return newUnmatched; 7079} 7080 7081function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 7082 if ( postFilter && !postFilter[ expando ] ) { 7083 postFilter = setMatcher( postFilter ); 7084 } 7085 if ( postFinder && !postFinder[ expando ] ) { 7086 postFinder = setMatcher( postFinder, postSelector ); 7087 } 7088 return markFunction( function( seed, results, context, xml ) { 7089 var temp, i, elem, 7090 preMap = [], 7091 postMap = [], 7092 preexisting = results.length, 7093 7094 // Get initial elements from seed or context 7095 elems = seed || multipleContexts( 7096 selector || "*", 7097 context.nodeType ? [ context ] : context, 7098 [] 7099 ), 7100 7101 // Prefilter to get matcher input, preserving a map for seed-results synchronization 7102 matcherIn = preFilter && ( seed || !selector ) ? 7103 condense( elems, preMap, preFilter, context, xml ) : 7104 elems, 7105 7106 matcherOut = matcher ? 7107 7108 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 7109 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 7110 7111 // ...intermediate processing is necessary 7112 [] : 7113 7114 // ...otherwise use results directly 7115 results : 7116 matcherIn; 7117 7118 // Find primary matches 7119 if ( matcher ) { 7120 matcher( matcherIn, matcherOut, context, xml ); 7121 } 7122 7123 // Apply postFilter 7124 if ( postFilter ) { 7125 temp = condense( matcherOut, postMap ); 7126 postFilter( temp, [], context, xml ); 7127 7128 // Un-match failing elements by moving them back to matcherIn 7129 i = temp.length; 7130 while ( i-- ) { 7131 if ( ( elem = temp[ i ] ) ) { 7132 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 7133 } 7134 } 7135 } 7136 7137 if ( seed ) { 7138 if ( postFinder || preFilter ) { 7139 if ( postFinder ) { 7140 7141 // Get the final matcherOut by condensing this intermediate into postFinder contexts 7142 temp = []; 7143 i = matcherOut.length; 7144 while ( i-- ) { 7145 if ( ( elem = matcherOut[ i ] ) ) { 7146 7147 // Restore matcherIn since elem is not yet a final match 7148 temp.push( ( matcherIn[ i ] = elem ) ); 7149 } 7150 } 7151 postFinder( null, ( matcherOut = [] ), temp, xml ); 7152 } 7153 7154 // Move matched elements from seed to results to keep them synchronized 7155 i = matcherOut.length; 7156 while ( i-- ) { 7157 if ( ( elem = matcherOut[ i ] ) && 7158 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 7159 7160 seed[ temp ] = !( results[ temp ] = elem ); 7161 } 7162 } 7163 } 7164 7165 // Add elements to results, through postFinder if defined 7166 } else { 7167 matcherOut = condense( 7168 matcherOut === results ? 7169 matcherOut.splice( preexisting, matcherOut.length ) : 7170 matcherOut 7171 ); 7172 if ( postFinder ) { 7173 postFinder( null, results, matcherOut, xml ); 7174 } else { 7175 push.apply( results, matcherOut ); 7176 } 7177 } 7178 } ); 7179} 7180 7181function matcherFromTokens( tokens ) { 7182 var checkContext, matcher, j, 7183 len = tokens.length, 7184 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 7185 implicitRelative = leadingRelative || Expr.relative[ " " ], 7186 i = leadingRelative ? 1 : 0, 7187 7188 // The foundational matcher ensures that elements are reachable from top-level context(s) 7189 matchContext = addCombinator( function( elem ) { 7190 return elem === checkContext; 7191 }, implicitRelative, true ), 7192 matchAnyContext = addCombinator( function( elem ) { 7193 return indexOf( checkContext, elem ) > -1; 7194 }, implicitRelative, true ), 7195 matchers = [ function( elem, context, xml ) { 7196 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 7197 ( checkContext = context ).nodeType ? 7198 matchContext( elem, context, xml ) : 7199 matchAnyContext( elem, context, xml ) ); 7200 7201 // Avoid hanging onto element (issue #299) 7202 checkContext = null; 7203 return ret; 7204 } ]; 7205 7206 for ( ; i < len; i++ ) { 7207 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 7208 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 7209 } else { 7210 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 7211 7212 // Return special upon seeing a positional matcher 7213 if ( matcher[ expando ] ) { 7214 7215 // Find the next relative operator (if any) for proper handling 7216 j = ++i; 7217 for ( ; j < len; j++ ) { 7218 if ( Expr.relative[ tokens[ j ].type ] ) { 7219 break; 7220 } 7221 } 7222 return setMatcher( 7223 i > 1 && elementMatcher( matchers ), 7224 i > 1 && toSelector( 7225 7226 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 7227 tokens 7228 .slice( 0, i - 1 ) 7229 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 7230 ).replace( rtrim, "$1" ), 7231 matcher, 7232 i < j && matcherFromTokens( tokens.slice( i, j ) ), 7233 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 7234 j < len && toSelector( tokens ) 7235 ); 7236 } 7237 matchers.push( matcher ); 7238 } 7239 } 7240 7241 return elementMatcher( matchers ); 7242} 7243 7244function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 7245 var bySet = setMatchers.length > 0, 7246 byElement = elementMatchers.length > 0, 7247 superMatcher = function( seed, context, xml, results, outermost ) { 7248 var elem, j, matcher, 7249 matchedCount = 0, 7250 i = "0", 7251 unmatched = seed && [], 7252 setMatched = [], 7253 contextBackup = outermostContext, 7254 7255 // We must always have either seed elements or outermost context 7256 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 7257 7258 // Use integer dirruns iff this is the outermost matcher 7259 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 7260 len = elems.length; 7261 7262 if ( outermost ) { 7263 7264 // Support: IE 11+, Edge 17 - 18+ 7265 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7266 // two documents; shallow comparisons work. 7267 // eslint-disable-next-line eqeqeq 7268 outermostContext = context == document || context || outermost; 7269 } 7270 7271 // Add elements passing elementMatchers directly to results 7272 // Support: IE<9, Safari 7273 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 7274 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 7275 if ( byElement && elem ) { 7276 j = 0; 7277 7278 // Support: IE 11+, Edge 17 - 18+ 7279 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7280 // two documents; shallow comparisons work. 7281 // eslint-disable-next-line eqeqeq 7282 if ( !context && elem.ownerDocument != document ) { 7283 setDocument( elem ); 7284 xml = !documentIsHTML; 7285 } 7286 while ( ( matcher = elementMatchers[ j++ ] ) ) { 7287 if ( matcher( elem, context || document, xml ) ) { 7288 results.push( elem ); 7289 break; 7290 } 7291 } 7292 if ( outermost ) { 7293 dirruns = dirrunsUnique; 7294 } 7295 } 7296 7297 // Track unmatched elements for set filters 7298 if ( bySet ) { 7299 7300 // They will have gone through all possible matchers 7301 if ( ( elem = !matcher && elem ) ) { 7302 matchedCount--; 7303 } 7304 7305 // Lengthen the array for every element, matched or not 7306 if ( seed ) { 7307 unmatched.push( elem ); 7308 } 7309 } 7310 } 7311 7312 // `i` is now the count of elements visited above, and adding it to `matchedCount` 7313 // makes the latter nonnegative. 7314 matchedCount += i; 7315 7316 // Apply set filters to unmatched elements 7317 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 7318 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 7319 // no element matchers and no seed. 7320 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 7321 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 7322 // numerically zero. 7323 if ( bySet && i !== matchedCount ) { 7324 j = 0; 7325 while ( ( matcher = setMatchers[ j++ ] ) ) { 7326 matcher( unmatched, setMatched, context, xml ); 7327 } 7328 7329 if ( seed ) { 7330 7331 // Reintegrate element matches to eliminate the need for sorting 7332 if ( matchedCount > 0 ) { 7333 while ( i-- ) { 7334 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 7335 setMatched[ i ] = pop.call( results ); 7336 } 7337 } 7338 } 7339 7340 // Discard index placeholder values to get only actual matches 7341 setMatched = condense( setMatched ); 7342 } 7343 7344 // Add matches to results 7345 push.apply( results, setMatched ); 7346 7347 // Seedless set matches succeeding multiple successful matchers stipulate sorting 7348 if ( outermost && !seed && setMatched.length > 0 && 7349 ( matchedCount + setMatchers.length ) > 1 ) { 7350 7351 Sizzle.uniqueSort( results ); 7352 } 7353 } 7354 7355 // Override manipulation of globals by nested matchers 7356 if ( outermost ) { 7357 dirruns = dirrunsUnique; 7358 outermostContext = contextBackup; 7359 } 7360 7361 return unmatched; 7362 }; 7363 7364 return bySet ? 7365 markFunction( superMatcher ) : 7366 superMatcher; 7367} 7368 7369compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 7370 var i, 7371 setMatchers = [], 7372 elementMatchers = [], 7373 cached = compilerCache[ selector + " " ]; 7374 7375 if ( !cached ) { 7376 7377 // Generate a function of recursive functions that can be used to check each element 7378 if ( !match ) { 7379 match = tokenize( selector ); 7380 } 7381 i = match.length; 7382 while ( i-- ) { 7383 cached = matcherFromTokens( match[ i ] ); 7384 if ( cached[ expando ] ) { 7385 setMatchers.push( cached ); 7386 } else { 7387 elementMatchers.push( cached ); 7388 } 7389 } 7390 7391 // Cache the compiled function 7392 cached = compilerCache( 7393 selector, 7394 matcherFromGroupMatchers( elementMatchers, setMatchers ) 7395 ); 7396 7397 // Save selector and tokenization 7398 cached.selector = selector; 7399 } 7400 return cached; 7401}; 7402 7403/** 7404 * A low-level selection function that works with Sizzle's compiled 7405 * selector functions 7406 * @param {String|Function} selector A selector or a pre-compiled 7407 * selector function built with Sizzle.compile 7408 * @param {Element} context 7409 * @param {Array} [results] 7410 * @param {Array} [seed] A set of elements to match against 7411 */ 7412select = Sizzle.select = function( selector, context, results, seed ) { 7413 var i, tokens, token, type, find, 7414 compiled = typeof selector === "function" && selector, 7415 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 7416 7417 results = results || []; 7418 7419 // Try to minimize operations if there is only one selector in the list and no seed 7420 // (the latter of which guarantees us context) 7421 if ( match.length === 1 ) { 7422 7423 // Reduce context if the leading compound selector is an ID 7424 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 7425 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 7426 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 7427 7428 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 7429 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 7430 if ( !context ) { 7431 return results; 7432 7433 // Precompiled matchers will still verify ancestry, so step up a level 7434 } else if ( compiled ) { 7435 context = context.parentNode; 7436 } 7437 7438 selector = selector.slice( tokens.shift().value.length ); 7439 } 7440 7441 // Fetch a seed set for right-to-left matching 7442 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 7443 while ( i-- ) { 7444 token = tokens[ i ]; 7445 7446 // Abort if we hit a combinator 7447 if ( Expr.relative[ ( type = token.type ) ] ) { 7448 break; 7449 } 7450 if ( ( find = Expr.find[ type ] ) ) { 7451 7452 // Search, expanding context for leading sibling combinators 7453 if ( ( seed = find( 7454 token.matches[ 0 ].replace( runescape, funescape ), 7455 rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || 7456 context 7457 ) ) ) { 7458 7459 // If seed is empty or no tokens remain, we can return early 7460 tokens.splice( i, 1 ); 7461 selector = seed.length && toSelector( tokens ); 7462 if ( !selector ) { 7463 push.apply( results, seed ); 7464 return results; 7465 } 7466 7467 break; 7468 } 7469 } 7470 } 7471 } 7472 7473 // Compile and execute a filtering function if one is not provided 7474 // Provide `match` to avoid retokenization if we modified the selector above 7475 ( compiled || compile( selector, match ) )( 7476 seed, 7477 context, 7478 !documentIsHTML, 7479 results, 7480 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 7481 ); 7482 return results; 7483}; 7484 7485// One-time assignments 7486 7487// Sort stability 7488support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 7489 7490// Support: Chrome 14-35+ 7491// Always assume duplicates if they aren't passed to the comparison function 7492support.detectDuplicates = !!hasDuplicate; 7493 7494// Initialize against the default document 7495setDocument(); 7496 7497// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 7498// Detached nodes confoundingly follow *each other* 7499support.sortDetached = assert( function( el ) { 7500 7501 // Should return 1, but returns 4 (following) 7502 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 7503} ); 7504 7505// Support: IE<8 7506// Prevent attribute/property "interpolation" 7507// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 7508if ( !assert( function( el ) { 7509 el.innerHTML = "<a href='#'></a>"; 7510 return el.firstChild.getAttribute( "href" ) === "#"; 7511} ) ) { 7512 addHandle( "type|href|height|width", function( elem, name, isXML ) { 7513 if ( !isXML ) { 7514 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 7515 } 7516 } ); 7517} 7518 7519// Support: IE<9 7520// Use defaultValue in place of getAttribute("value") 7521if ( !support.attributes || !assert( function( el ) { 7522 el.innerHTML = "<input/>"; 7523 el.firstChild.setAttribute( "value", "" ); 7524 return el.firstChild.getAttribute( "value" ) === ""; 7525} ) ) { 7526 addHandle( "value", function( elem, _name, isXML ) { 7527 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 7528 return elem.defaultValue; 7529 } 7530 } ); 7531} 7532 7533// Support: IE<9 7534// Use getAttributeNode to fetch booleans when getAttribute lies 7535if ( !assert( function( el ) { 7536 return el.getAttribute( "disabled" ) == null; 7537} ) ) { 7538 addHandle( booleans, function( elem, name, isXML ) { 7539 var val; 7540 if ( !isXML ) { 7541 return elem[ name ] === true ? name.toLowerCase() : 7542 ( val = elem.getAttributeNode( name ) ) && val.specified ? 7543 val.value : 7544 null; 7545 } 7546 } ); 7547} 7548 7549return Sizzle; 7550 7551} )( window ); 7552 7553 7554 7555jQuery.find = Sizzle; 7556jQuery.expr = Sizzle.selectors; 7557 7558// Deprecated 7559jQuery.expr[ ":" ] = jQuery.expr.pseudos; 7560jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 7561jQuery.text = Sizzle.getText; 7562jQuery.isXMLDoc = Sizzle.isXML; 7563jQuery.contains = Sizzle.contains; 7564jQuery.escapeSelector = Sizzle.escape; 7565 7566 7567 7568 7569var dir = function( elem, dir, until ) { 7570 var matched = [], 7571 truncate = until !== undefined; 7572 7573 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 7574 if ( elem.nodeType === 1 ) { 7575 if ( truncate && jQuery( elem ).is( until ) ) { 7576 break; 7577 } 7578 matched.push( elem ); 7579 } 7580 } 7581 return matched; 7582}; 7583 7584 7585var siblings = function( n, elem ) { 7586 var matched = []; 7587 7588 for ( ; n; n = n.nextSibling ) { 7589 if ( n.nodeType === 1 && n !== elem ) { 7590 matched.push( n ); 7591 } 7592 } 7593 7594 return matched; 7595}; 7596 7597 7598var rneedsContext = jQuery.expr.match.needsContext; 7599 7600 7601 7602function nodeName( elem, name ) { 7603 7604 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 7605 7606}; 7607var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 7608 7609 7610 7611// Implement the identical functionality for filter and not 7612function winnow( elements, qualifier, not ) { 7613 if ( isFunction( qualifier ) ) { 7614 return jQuery.grep( elements, function( elem, i ) { 7615 return !!qualifier.call( elem, i, elem ) !== not; 7616 } ); 7617 } 7618 7619 // Single element 7620 if ( qualifier.nodeType ) { 7621 return jQuery.grep( elements, function( elem ) { 7622 return ( elem === qualifier ) !== not; 7623 } ); 7624 } 7625 7626 // Arraylike of elements (jQuery, arguments, Array) 7627 if ( typeof qualifier !== "string" ) { 7628 return jQuery.grep( elements, function( elem ) { 7629 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 7630 } ); 7631 } 7632 7633 // Filtered directly for both simple and complex selectors 7634 return jQuery.filter( qualifier, elements, not ); 7635} 7636 7637jQuery.filter = function( expr, elems, not ) { 7638 var elem = elems[ 0 ]; 7639 7640 if ( not ) { 7641 expr = ":not(" + expr + ")"; 7642 } 7643 7644 if ( elems.length === 1 && elem.nodeType === 1 ) { 7645 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 7646 } 7647 7648 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 7649 return elem.nodeType === 1; 7650 } ) ); 7651}; 7652 7653jQuery.fn.extend( { 7654 find: function( selector ) { 7655 var i, ret, 7656 len = this.length, 7657 self = this; 7658 7659 if ( typeof selector !== "string" ) { 7660 return this.pushStack( jQuery( selector ).filter( function() { 7661 for ( i = 0; i < len; i++ ) { 7662 if ( jQuery.contains( self[ i ], this ) ) { 7663 return true; 7664 } 7665 } 7666 } ) ); 7667 } 7668 7669 ret = this.pushStack( [] ); 7670 7671 for ( i = 0; i < len; i++ ) { 7672 jQuery.find( selector, self[ i ], ret ); 7673 } 7674 7675 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 7676 }, 7677 filter: function( selector ) { 7678 return this.pushStack( winnow( this, selector || [], false ) ); 7679 }, 7680 not: function( selector ) { 7681 return this.pushStack( winnow( this, selector || [], true ) ); 7682 }, 7683 is: function( selector ) { 7684 return !!winnow( 7685 this, 7686 7687 // If this is a positional/relative selector, check membership in the returned set 7688 // so $("p:first").is("p:last") won't return true for a doc with two "p". 7689 typeof selector === "string" && rneedsContext.test( selector ) ? 7690 jQuery( selector ) : 7691 selector || [], 7692 false 7693 ).length; 7694 } 7695} ); 7696 7697 7698// Initialize a jQuery object 7699 7700 7701// A central reference to the root jQuery(document) 7702var rootjQuery, 7703 7704 // A simple way to check for HTML strings 7705 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 7706 // Strict HTML recognition (#11290: must start with <) 7707 // Shortcut simple #id case for speed 7708 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 7709 7710 init = jQuery.fn.init = function( selector, context, root ) { 7711 var match, elem; 7712 7713 // HANDLE: $(""), $(null), $(undefined), $(false) 7714 if ( !selector ) { 7715 return this; 7716 } 7717 7718 // Method init() accepts an alternate rootjQuery 7719 // so migrate can support jQuery.sub (gh-2101) 7720 root = root || rootjQuery; 7721 7722 // Handle HTML strings 7723 if ( typeof selector === "string" ) { 7724 if ( selector[ 0 ] === "<" && 7725 selector[ selector.length - 1 ] === ">" && 7726 selector.length >= 3 ) { 7727 7728 // Assume that strings that start and end with <> are HTML and skip the regex check 7729 match = [ null, selector, null ]; 7730 7731 } else { 7732 match = rquickExpr.exec( selector ); 7733 } 7734 7735 // Match html or make sure no context is specified for #id 7736 if ( match && ( match[ 1 ] || !context ) ) { 7737 7738 // HANDLE: $(html) -> $(array) 7739 if ( match[ 1 ] ) { 7740 context = context instanceof jQuery ? context[ 0 ] : context; 7741 7742 // Option to run scripts is true for back-compat 7743 // Intentionally let the error be thrown if parseHTML is not present 7744 jQuery.merge( this, jQuery.parseHTML( 7745 match[ 1 ], 7746 context && context.nodeType ? context.ownerDocument || context : document, 7747 true 7748 ) ); 7749 7750 // HANDLE: $(html, props) 7751 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 7752 for ( match in context ) { 7753 7754 // Properties of context are called as methods if possible 7755 if ( isFunction( this[ match ] ) ) { 7756 this[ match ]( context[ match ] ); 7757 7758 // ...and otherwise set as attributes 7759 } else { 7760 this.attr( match, context[ match ] ); 7761 } 7762 } 7763 } 7764 7765 return this; 7766 7767 // HANDLE: $(#id) 7768 } else { 7769 elem = document.getElementById( match[ 2 ] ); 7770 7771 if ( elem ) { 7772 7773 // Inject the element directly into the jQuery object 7774 this[ 0 ] = elem; 7775 this.length = 1; 7776 } 7777 return this; 7778 } 7779 7780 // HANDLE: $(expr, $(...)) 7781 } else if ( !context || context.jquery ) { 7782 return ( context || root ).find( selector ); 7783 7784 // HANDLE: $(expr, context) 7785 // (which is just equivalent to: $(context).find(expr) 7786 } else { 7787 return this.constructor( context ).find( selector ); 7788 } 7789 7790 // HANDLE: $(DOMElement) 7791 } else if ( selector.nodeType ) { 7792 this[ 0 ] = selector; 7793 this.length = 1; 7794 return this; 7795 7796 // HANDLE: $(function) 7797 // Shortcut for document ready 7798 } else if ( isFunction( selector ) ) { 7799 return root.ready !== undefined ? 7800 root.ready( selector ) : 7801 7802 // Execute immediately if ready is not present 7803 selector( jQuery ); 7804 } 7805 7806 return jQuery.makeArray( selector, this ); 7807 }; 7808 7809// Give the init function the jQuery prototype for later instantiation 7810init.prototype = jQuery.fn; 7811 7812// Initialize central reference 7813rootjQuery = jQuery( document ); 7814 7815 7816var rparentsprev = /^(?:parents|prev(?:Until|All))/, 7817 7818 // Methods guaranteed to produce a unique set when starting from a unique set 7819 guaranteedUnique = { 7820 children: true, 7821 contents: true, 7822 next: true, 7823 prev: true 7824 }; 7825 7826jQuery.fn.extend( { 7827 has: function( target ) { 7828 var targets = jQuery( target, this ), 7829 l = targets.length; 7830 7831 return this.filter( function() { 7832 var i = 0; 7833 for ( ; i < l; i++ ) { 7834 if ( jQuery.contains( this, targets[ i ] ) ) { 7835 return true; 7836 } 7837 } 7838 } ); 7839 }, 7840 7841 closest: function( selectors, context ) { 7842 var cur, 7843 i = 0, 7844 l = this.length, 7845 matched = [], 7846 targets = typeof selectors !== "string" && jQuery( selectors ); 7847 7848 // Positional selectors never match, since there's no _selection_ context 7849 if ( !rneedsContext.test( selectors ) ) { 7850 for ( ; i < l; i++ ) { 7851 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 7852 7853 // Always skip document fragments 7854 if ( cur.nodeType < 11 && ( targets ? 7855 targets.index( cur ) > -1 : 7856 7857 // Don't pass non-elements to Sizzle 7858 cur.nodeType === 1 && 7859 jQuery.find.matchesSelector( cur, selectors ) ) ) { 7860 7861 matched.push( cur ); 7862 break; 7863 } 7864 } 7865 } 7866 } 7867 7868 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 7869 }, 7870 7871 // Determine the position of an element within the set 7872 index: function( elem ) { 7873 7874 // No argument, return index in parent 7875 if ( !elem ) { 7876 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 7877 } 7878 7879 // Index in selector 7880 if ( typeof elem === "string" ) { 7881 return indexOf.call( jQuery( elem ), this[ 0 ] ); 7882 } 7883 7884 // Locate the position of the desired element 7885 return indexOf.call( this, 7886 7887 // If it receives a jQuery object, the first element is used 7888 elem.jquery ? elem[ 0 ] : elem 7889 ); 7890 }, 7891 7892 add: function( selector, context ) { 7893 return this.pushStack( 7894 jQuery.uniqueSort( 7895 jQuery.merge( this.get(), jQuery( selector, context ) ) 7896 ) 7897 ); 7898 }, 7899 7900 addBack: function( selector ) { 7901 return this.add( selector == null ? 7902 this.prevObject : this.prevObject.filter( selector ) 7903 ); 7904 } 7905} ); 7906 7907function sibling( cur, dir ) { 7908 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 7909 return cur; 7910} 7911 7912jQuery.each( { 7913 parent: function( elem ) { 7914 var parent = elem.parentNode; 7915 return parent && parent.nodeType !== 11 ? parent : null; 7916 }, 7917 parents: function( elem ) { 7918 return dir( elem, "parentNode" ); 7919 }, 7920 parentsUntil: function( elem, _i, until ) { 7921 return dir( elem, "parentNode", until ); 7922 }, 7923 next: function( elem ) { 7924 return sibling( elem, "nextSibling" ); 7925 }, 7926 prev: function( elem ) { 7927 return sibling( elem, "previousSibling" ); 7928 }, 7929 nextAll: function( elem ) { 7930 return dir( elem, "nextSibling" ); 7931 }, 7932 prevAll: function( elem ) { 7933 return dir( elem, "previousSibling" ); 7934 }, 7935 nextUntil: function( elem, _i, until ) { 7936 return dir( elem, "nextSibling", until ); 7937 }, 7938 prevUntil: function( elem, _i, until ) { 7939 return dir( elem, "previousSibling", until ); 7940 }, 7941 siblings: function( elem ) { 7942 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 7943 }, 7944 children: function( elem ) { 7945 return siblings( elem.firstChild ); 7946 }, 7947 contents: function( elem ) { 7948 if ( elem.contentDocument != null && 7949 7950 // Support: IE 11+ 7951 // <object> elements with no `data` attribute has an object 7952 // `contentDocument` with a `null` prototype. 7953 getProto( elem.contentDocument ) ) { 7954 7955 return elem.contentDocument; 7956 } 7957 7958 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 7959 // Treat the template element as a regular one in browsers that 7960 // don't support it. 7961 if ( nodeName( elem, "template" ) ) { 7962 elem = elem.content || elem; 7963 } 7964 7965 return jQuery.merge( [], elem.childNodes ); 7966 } 7967}, function( name, fn ) { 7968 jQuery.fn[ name ] = function( until, selector ) { 7969 var matched = jQuery.map( this, fn, until ); 7970 7971 if ( name.slice( -5 ) !== "Until" ) { 7972 selector = until; 7973 } 7974 7975 if ( selector && typeof selector === "string" ) { 7976 matched = jQuery.filter( selector, matched ); 7977 } 7978 7979 if ( this.length > 1 ) { 7980 7981 // Remove duplicates 7982 if ( !guaranteedUnique[ name ] ) { 7983 jQuery.uniqueSort( matched ); 7984 } 7985 7986 // Reverse order for parents* and prev-derivatives 7987 if ( rparentsprev.test( name ) ) { 7988 matched.reverse(); 7989 } 7990 } 7991 7992 return this.pushStack( matched ); 7993 }; 7994} ); 7995var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 7996 7997 7998 7999// Convert String-formatted options into Object-formatted ones 8000function createOptions( options ) { 8001 var object = {}; 8002 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 8003 object[ flag ] = true; 8004 } ); 8005 return object; 8006} 8007 8008/* 8009 * Create a callback list using the following parameters: 8010 * 8011 * options: an optional list of space-separated options that will change how 8012 * the callback list behaves or a more traditional option object 8013 * 8014 * By default a callback list will act like an event callback list and can be 8015 * "fired" multiple times. 8016 * 8017 * Possible options: 8018 * 8019 * once: will ensure the callback list can only be fired once (like a Deferred) 8020 * 8021 * memory: will keep track of previous values and will call any callback added 8022 * after the list has been fired right away with the latest "memorized" 8023 * values (like a Deferred) 8024 * 8025 * unique: will ensure a callback can only be added once (no duplicate in the list) 8026 * 8027 * stopOnFalse: interrupt callings when a callback returns false 8028 * 8029 */ 8030jQuery.Callbacks = function( options ) { 8031 8032 // Convert options from String-formatted to Object-formatted if needed 8033 // (we check in cache first) 8034 options = typeof options === "string" ? 8035 createOptions( options ) : 8036 jQuery.extend( {}, options ); 8037 8038 var // Flag to know if list is currently firing 8039 firing, 8040 8041 // Last fire value for non-forgettable lists 8042 memory, 8043 8044 // Flag to know if list was already fired 8045 fired, 8046 8047 // Flag to prevent firing 8048 locked, 8049 8050 // Actual callback list 8051 list = [], 8052 8053 // Queue of execution data for repeatable lists 8054 queue = [], 8055 8056 // Index of currently firing callback (modified by add/remove as needed) 8057 firingIndex = -1, 8058 8059 // Fire callbacks 8060 fire = function() { 8061 8062 // Enforce single-firing 8063 locked = locked || options.once; 8064 8065 // Execute callbacks for all pending executions, 8066 // respecting firingIndex overrides and runtime changes 8067 fired = firing = true; 8068 for ( ; queue.length; firingIndex = -1 ) { 8069 memory = queue.shift(); 8070 while ( ++firingIndex < list.length ) { 8071 8072 // Run callback and check for early termination 8073 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 8074 options.stopOnFalse ) { 8075 8076 // Jump to end and forget the data so .add doesn't re-fire 8077 firingIndex = list.length; 8078 memory = false; 8079 } 8080 } 8081 } 8082 8083 // Forget the data if we're done with it 8084 if ( !options.memory ) { 8085 memory = false; 8086 } 8087 8088 firing = false; 8089 8090 // Clean up if we're done firing for good 8091 if ( locked ) { 8092 8093 // Keep an empty list if we have data for future add calls 8094 if ( memory ) { 8095 list = []; 8096 8097 // Otherwise, this object is spent 8098 } else { 8099 list = ""; 8100 } 8101 } 8102 }, 8103 8104 // Actual Callbacks object 8105 self = { 8106 8107 // Add a callback or a collection of callbacks to the list 8108 add: function() { 8109 if ( list ) { 8110 8111 // If we have memory from a past run, we should fire after adding 8112 if ( memory && !firing ) { 8113 firingIndex = list.length - 1; 8114 queue.push( memory ); 8115 } 8116 8117 ( function add( args ) { 8118 jQuery.each( args, function( _, arg ) { 8119 if ( isFunction( arg ) ) { 8120 if ( !options.unique || !self.has( arg ) ) { 8121 list.push( arg ); 8122 } 8123 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 8124 8125 // Inspect recursively 8126 add( arg ); 8127 } 8128 } ); 8129 } )( arguments ); 8130 8131 if ( memory && !firing ) { 8132 fire(); 8133 } 8134 } 8135 return this; 8136 }, 8137 8138 // Remove a callback from the list 8139 remove: function() { 8140 jQuery.each( arguments, function( _, arg ) { 8141 var index; 8142 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 8143 list.splice( index, 1 ); 8144 8145 // Handle firing indexes 8146 if ( index <= firingIndex ) { 8147 firingIndex--; 8148 } 8149 } 8150 } ); 8151 return this; 8152 }, 8153 8154 // Check if a given callback is in the list. 8155 // If no argument is given, return whether or not list has callbacks attached. 8156 has: function( fn ) { 8157 return fn ? 8158 jQuery.inArray( fn, list ) > -1 : 8159 list.length > 0; 8160 }, 8161 8162 // Remove all callbacks from the list 8163 empty: function() { 8164 if ( list ) { 8165 list = []; 8166 } 8167 return this; 8168 }, 8169 8170 // Disable .fire and .add 8171 // Abort any current/pending executions 8172 // Clear all callbacks and values 8173 disable: function() { 8174 locked = queue = []; 8175 list = memory = ""; 8176 return this; 8177 }, 8178 disabled: function() { 8179 return !list; 8180 }, 8181 8182 // Disable .fire 8183 // Also disable .add unless we have memory (since it would have no effect) 8184 // Abort any pending executions 8185 lock: function() { 8186 locked = queue = []; 8187 if ( !memory && !firing ) { 8188 list = memory = ""; 8189 } 8190 return this; 8191 }, 8192 locked: function() { 8193 return !!locked; 8194 }, 8195 8196 // Call all callbacks with the given context and arguments 8197 fireWith: function( context, args ) { 8198 if ( !locked ) { 8199 args = args || []; 8200 args = [ context, args.slice ? args.slice() : args ]; 8201 queue.push( args ); 8202 if ( !firing ) { 8203 fire(); 8204 } 8205 } 8206 return this; 8207 }, 8208 8209 // Call all the callbacks with the given arguments 8210 fire: function() { 8211 self.fireWith( this, arguments ); 8212 return this; 8213 }, 8214 8215 // To know if the callbacks have already been called at least once 8216 fired: function() { 8217 return !!fired; 8218 } 8219 }; 8220 8221 return self; 8222}; 8223 8224 8225function Identity( v ) { 8226 return v; 8227} 8228function Thrower( ex ) { 8229 throw ex; 8230} 8231 8232function adoptValue( value, resolve, reject, noValue ) { 8233 var method; 8234 8235 try { 8236 8237 // Check for promise aspect first to privilege synchronous behavior 8238 if ( value && isFunction( ( method = value.promise ) ) ) { 8239 method.call( value ).done( resolve ).fail( reject ); 8240 8241 // Other thenables 8242 } else if ( value && isFunction( ( method = value.then ) ) ) { 8243 method.call( value, resolve, reject ); 8244 8245 // Other non-thenables 8246 } else { 8247 8248 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 8249 // * false: [ value ].slice( 0 ) => resolve( value ) 8250 // * true: [ value ].slice( 1 ) => resolve() 8251 resolve.apply( undefined, [ value ].slice( noValue ) ); 8252 } 8253 8254 // For Promises/A+, convert exceptions into rejections 8255 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 8256 // Deferred#then to conditionally suppress rejection. 8257 } catch ( value ) { 8258 8259 // Support: Android 4.0 only 8260 // Strict mode functions invoked without .call/.apply get global-object context 8261 reject.apply( undefined, [ value ] ); 8262 } 8263} 8264 8265jQuery.extend( { 8266 8267 Deferred: function( func ) { 8268 var tuples = [ 8269 8270 // action, add listener, callbacks, 8271 // ... .then handlers, argument index, [final state] 8272 [ "notify", "progress", jQuery.Callbacks( "memory" ), 8273 jQuery.Callbacks( "memory" ), 2 ], 8274 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 8275 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 8276 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 8277 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 8278 ], 8279 state = "pending", 8280 promise = { 8281 state: function() { 8282 return state; 8283 }, 8284 always: function() { 8285 deferred.done( arguments ).fail( arguments ); 8286 return this; 8287 }, 8288 "catch": function( fn ) { 8289 return promise.then( null, fn ); 8290 }, 8291 8292 // Keep pipe for back-compat 8293 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 8294 var fns = arguments; 8295 8296 return jQuery.Deferred( function( newDefer ) { 8297 jQuery.each( tuples, function( _i, tuple ) { 8298 8299 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 8300 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 8301 8302 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 8303 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 8304 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 8305 deferred[ tuple[ 1 ] ]( function() { 8306 var returned = fn && fn.apply( this, arguments ); 8307 if ( returned && isFunction( returned.promise ) ) { 8308 returned.promise() 8309 .progress( newDefer.notify ) 8310 .done( newDefer.resolve ) 8311 .fail( newDefer.reject ); 8312 } else { 8313 newDefer[ tuple[ 0 ] + "With" ]( 8314 this, 8315 fn ? [ returned ] : arguments 8316 ); 8317 } 8318 } ); 8319 } ); 8320 fns = null; 8321 } ).promise(); 8322 }, 8323 then: function( onFulfilled, onRejected, onProgress ) { 8324 var maxDepth = 0; 8325 function resolve( depth, deferred, handler, special ) { 8326 return function() { 8327 var that = this, 8328 args = arguments, 8329 mightThrow = function() { 8330 var returned, then; 8331 8332 // Support: Promises/A+ section 2.3.3.3.3 8333 // https://promisesaplus.com/#point-59 8334 // Ignore double-resolution attempts 8335 if ( depth < maxDepth ) { 8336 return; 8337 } 8338 8339 returned = handler.apply( that, args ); 8340 8341 // Support: Promises/A+ section 2.3.1 8342 // https://promisesaplus.com/#point-48 8343 if ( returned === deferred.promise() ) { 8344 throw new TypeError( "Thenable self-resolution" ); 8345 } 8346 8347 // Support: Promises/A+ sections 2.3.3.1, 3.5 8348 // https://promisesaplus.com/#point-54 8349 // https://promisesaplus.com/#point-75 8350 // Retrieve `then` only once 8351 then = returned && 8352 8353 // Support: Promises/A+ section 2.3.4 8354 // https://promisesaplus.com/#point-64 8355 // Only check objects and functions for thenability 8356 ( typeof returned === "object" || 8357 typeof returned === "function" ) && 8358 returned.then; 8359 8360 // Handle a returned thenable 8361 if ( isFunction( then ) ) { 8362 8363 // Special processors (notify) just wait for resolution 8364 if ( special ) { 8365 then.call( 8366 returned, 8367 resolve( maxDepth, deferred, Identity, special ), 8368 resolve( maxDepth, deferred, Thrower, special ) 8369 ); 8370 8371 // Normal processors (resolve) also hook into progress 8372 } else { 8373 8374 // ...and disregard older resolution values 8375 maxDepth++; 8376 8377 then.call( 8378 returned, 8379 resolve( maxDepth, deferred, Identity, special ), 8380 resolve( maxDepth, deferred, Thrower, special ), 8381 resolve( maxDepth, deferred, Identity, 8382 deferred.notifyWith ) 8383 ); 8384 } 8385 8386 // Handle all other returned values 8387 } else { 8388 8389 // Only substitute handlers pass on context 8390 // and multiple values (non-spec behavior) 8391 if ( handler !== Identity ) { 8392 that = undefined; 8393 args = [ returned ]; 8394 } 8395 8396 // Process the value(s) 8397 // Default process is resolve 8398 ( special || deferred.resolveWith )( that, args ); 8399 } 8400 }, 8401 8402 // Only normal processors (resolve) catch and reject exceptions 8403 process = special ? 8404 mightThrow : 8405 function() { 8406 try { 8407 mightThrow(); 8408 } catch ( e ) { 8409 8410 if ( jQuery.Deferred.exceptionHook ) { 8411 jQuery.Deferred.exceptionHook( e, 8412 process.stackTrace ); 8413 } 8414 8415 // Support: Promises/A+ section 2.3.3.3.4.1 8416 // https://promisesaplus.com/#point-61 8417 // Ignore post-resolution exceptions 8418 if ( depth + 1 >= maxDepth ) { 8419 8420 // Only substitute handlers pass on context 8421 // and multiple values (non-spec behavior) 8422 if ( handler !== Thrower ) { 8423 that = undefined; 8424 args = [ e ]; 8425 } 8426 8427 deferred.rejectWith( that, args ); 8428 } 8429 } 8430 }; 8431 8432 // Support: Promises/A+ section 2.3.3.3.1 8433 // https://promisesaplus.com/#point-57 8434 // Re-resolve promises immediately to dodge false rejection from 8435 // subsequent errors 8436 if ( depth ) { 8437 process(); 8438 } else { 8439 8440 // Call an optional hook to record the stack, in case of exception 8441 // since it's otherwise lost when execution goes async 8442 if ( jQuery.Deferred.getStackHook ) { 8443 process.stackTrace = jQuery.Deferred.getStackHook(); 8444 } 8445 window.setTimeout( process ); 8446 } 8447 }; 8448 } 8449 8450 return jQuery.Deferred( function( newDefer ) { 8451 8452 // progress_handlers.add( ... ) 8453 tuples[ 0 ][ 3 ].add( 8454 resolve( 8455 0, 8456 newDefer, 8457 isFunction( onProgress ) ? 8458 onProgress : 8459 Identity, 8460 newDefer.notifyWith 8461 ) 8462 ); 8463 8464 // fulfilled_handlers.add( ... ) 8465 tuples[ 1 ][ 3 ].add( 8466 resolve( 8467 0, 8468 newDefer, 8469 isFunction( onFulfilled ) ? 8470 onFulfilled : 8471 Identity 8472 ) 8473 ); 8474 8475 // rejected_handlers.add( ... ) 8476 tuples[ 2 ][ 3 ].add( 8477 resolve( 8478 0, 8479 newDefer, 8480 isFunction( onRejected ) ? 8481 onRejected : 8482 Thrower 8483 ) 8484 ); 8485 } ).promise(); 8486 }, 8487 8488 // Get a promise for this deferred 8489 // If obj is provided, the promise aspect is added to the object 8490 promise: function( obj ) { 8491 return obj != null ? jQuery.extend( obj, promise ) : promise; 8492 } 8493 }, 8494 deferred = {}; 8495 8496 // Add list-specific methods 8497 jQuery.each( tuples, function( i, tuple ) { 8498 var list = tuple[ 2 ], 8499 stateString = tuple[ 5 ]; 8500 8501 // promise.progress = list.add 8502 // promise.done = list.add 8503 // promise.fail = list.add 8504 promise[ tuple[ 1 ] ] = list.add; 8505 8506 // Handle state 8507 if ( stateString ) { 8508 list.add( 8509 function() { 8510 8511 // state = "resolved" (i.e., fulfilled) 8512 // state = "rejected" 8513 state = stateString; 8514 }, 8515 8516 // rejected_callbacks.disable 8517 // fulfilled_callbacks.disable 8518 tuples[ 3 - i ][ 2 ].disable, 8519 8520 // rejected_handlers.disable 8521 // fulfilled_handlers.disable 8522 tuples[ 3 - i ][ 3 ].disable, 8523 8524 // progress_callbacks.lock 8525 tuples[ 0 ][ 2 ].lock, 8526 8527 // progress_handlers.lock 8528 tuples[ 0 ][ 3 ].lock 8529 ); 8530 } 8531 8532 // progress_handlers.fire 8533 // fulfilled_handlers.fire 8534 // rejected_handlers.fire 8535 list.add( tuple[ 3 ].fire ); 8536 8537 // deferred.notify = function() { deferred.notifyWith(...) } 8538 // deferred.resolve = function() { deferred.resolveWith(...) } 8539 // deferred.reject = function() { deferred.rejectWith(...) } 8540 deferred[ tuple[ 0 ] ] = function() { 8541 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 8542 return this; 8543 }; 8544 8545 // deferred.notifyWith = list.fireWith 8546 // deferred.resolveWith = list.fireWith 8547 // deferred.rejectWith = list.fireWith 8548 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 8549 } ); 8550 8551 // Make the deferred a promise 8552 promise.promise( deferred ); 8553 8554 // Call given func if any 8555 if ( func ) { 8556 func.call( deferred, deferred ); 8557 } 8558 8559 // All done! 8560 return deferred; 8561 }, 8562 8563 // Deferred helper 8564 when: function( singleValue ) { 8565 var 8566 8567 // count of uncompleted subordinates 8568 remaining = arguments.length, 8569 8570 // count of unprocessed arguments 8571 i = remaining, 8572 8573 // subordinate fulfillment data 8574 resolveContexts = Array( i ), 8575 resolveValues = slice.call( arguments ), 8576 8577 // the master Deferred 8578 master = jQuery.Deferred(), 8579 8580 // subordinate callback factory 8581 updateFunc = function( i ) { 8582 return function( value ) { 8583 resolveContexts[ i ] = this; 8584 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 8585 if ( !( --remaining ) ) { 8586 master.resolveWith( resolveContexts, resolveValues ); 8587 } 8588 }; 8589 }; 8590 8591 // Single- and empty arguments are adopted like Promise.resolve 8592 if ( remaining <= 1 ) { 8593 adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, 8594 !remaining ); 8595 8596 // Use .then() to unwrap secondary thenables (cf. gh-3000) 8597 if ( master.state() === "pending" || 8598 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 8599 8600 return master.then(); 8601 } 8602 } 8603 8604 // Multiple arguments are aggregated like Promise.all array elements 8605 while ( i-- ) { 8606 adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); 8607 } 8608 8609 return master.promise(); 8610 } 8611} ); 8612 8613 8614// These usually indicate a programmer mistake during development, 8615// warn about them ASAP rather than swallowing them by default. 8616var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 8617 8618jQuery.Deferred.exceptionHook = function( error, stack ) { 8619 8620 // Support: IE 8 - 9 only 8621 // Console exists when dev tools are open, which can happen at any time 8622 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 8623 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 8624 } 8625}; 8626 8627 8628 8629 8630jQuery.readyException = function( error ) { 8631 window.setTimeout( function() { 8632 throw error; 8633 } ); 8634}; 8635 8636 8637 8638 8639// The deferred used on DOM ready 8640var readyList = jQuery.Deferred(); 8641 8642jQuery.fn.ready = function( fn ) { 8643 8644 readyList 8645 .then( fn ) 8646 8647 // Wrap jQuery.readyException in a function so that the lookup 8648 // happens at the time of error handling instead of callback 8649 // registration. 8650 .catch( function( error ) { 8651 jQuery.readyException( error ); 8652 } ); 8653 8654 return this; 8655}; 8656 8657jQuery.extend( { 8658 8659 // Is the DOM ready to be used? Set to true once it occurs. 8660 isReady: false, 8661 8662 // A counter to track how many items to wait for before 8663 // the ready event fires. See #6781 8664 readyWait: 1, 8665 8666 // Handle when the DOM is ready 8667 ready: function( wait ) { 8668 8669 // Abort if there are pending holds or we're already ready 8670 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 8671 return; 8672 } 8673 8674 // Remember that the DOM is ready 8675 jQuery.isReady = true; 8676 8677 // If a normal DOM Ready event fired, decrement, and wait if need be 8678 if ( wait !== true && --jQuery.readyWait > 0 ) { 8679 return; 8680 } 8681 8682 // If there are functions bound, to execute 8683 readyList.resolveWith( document, [ jQuery ] ); 8684 } 8685} ); 8686 8687jQuery.ready.then = readyList.then; 8688 8689// The ready event handler and self cleanup method 8690function completed() { 8691 document.removeEventListener( "DOMContentLoaded", completed ); 8692 window.removeEventListener( "load", completed ); 8693 jQuery.ready(); 8694} 8695 8696// Catch cases where $(document).ready() is called 8697// after the browser event has already occurred. 8698// Support: IE <=9 - 10 only 8699// Older IE sometimes signals "interactive" too soon 8700if ( document.readyState === "complete" || 8701 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 8702 8703 // Handle it asynchronously to allow scripts the opportunity to delay ready 8704 window.setTimeout( jQuery.ready ); 8705 8706} else { 8707 8708 // Use the handy event callback 8709 document.addEventListener( "DOMContentLoaded", completed ); 8710 8711 // A fallback to window.onload, that will always work 8712 window.addEventListener( "load", completed ); 8713} 8714 8715 8716 8717 8718// Multifunctional method to get and set values of a collection 8719// The value/s can optionally be executed if it's a function 8720var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 8721 var i = 0, 8722 len = elems.length, 8723 bulk = key == null; 8724 8725 // Sets many values 8726 if ( toType( key ) === "object" ) { 8727 chainable = true; 8728 for ( i in key ) { 8729 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 8730 } 8731 8732 // Sets one value 8733 } else if ( value !== undefined ) { 8734 chainable = true; 8735 8736 if ( !isFunction( value ) ) { 8737 raw = true; 8738 } 8739 8740 if ( bulk ) { 8741 8742 // Bulk operations run against the entire set 8743 if ( raw ) { 8744 fn.call( elems, value ); 8745 fn = null; 8746 8747 // ...except when executing function values 8748 } else { 8749 bulk = fn; 8750 fn = function( elem, _key, value ) { 8751 return bulk.call( jQuery( elem ), value ); 8752 }; 8753 } 8754 } 8755 8756 if ( fn ) { 8757 for ( ; i < len; i++ ) { 8758 fn( 8759 elems[ i ], key, raw ? 8760 value : 8761 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 8762 ); 8763 } 8764 } 8765 } 8766 8767 if ( chainable ) { 8768 return elems; 8769 } 8770 8771 // Gets 8772 if ( bulk ) { 8773 return fn.call( elems ); 8774 } 8775 8776 return len ? fn( elems[ 0 ], key ) : emptyGet; 8777}; 8778 8779 8780// Matches dashed string for camelizing 8781var rmsPrefix = /^-ms-/, 8782 rdashAlpha = /-([a-z])/g; 8783 8784// Used by camelCase as callback to replace() 8785function fcamelCase( _all, letter ) { 8786 return letter.toUpperCase(); 8787} 8788 8789// Convert dashed to camelCase; used by the css and data modules 8790// Support: IE <=9 - 11, Edge 12 - 15 8791// Microsoft forgot to hump their vendor prefix (#9572) 8792function camelCase( string ) { 8793 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 8794} 8795var acceptData = function( owner ) { 8796 8797 // Accepts only: 8798 // - Node 8799 // - Node.ELEMENT_NODE 8800 // - Node.DOCUMENT_NODE 8801 // - Object 8802 // - Any 8803 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 8804}; 8805 8806 8807 8808 8809function Data() { 8810 this.expando = jQuery.expando + Data.uid++; 8811} 8812 8813Data.uid = 1; 8814 8815Data.prototype = { 8816 8817 cache: function( owner ) { 8818 8819 // Check if the owner object already has a cache 8820 var value = owner[ this.expando ]; 8821 8822 // If not, create one 8823 if ( !value ) { 8824 value = {}; 8825 8826 // We can accept data for non-element nodes in modern browsers, 8827 // but we should not, see #8335. 8828 // Always return an empty object. 8829 if ( acceptData( owner ) ) { 8830 8831 // If it is a node unlikely to be stringify-ed or looped over 8832 // use plain assignment 8833 if ( owner.nodeType ) { 8834 owner[ this.expando ] = value; 8835 8836 // Otherwise secure it in a non-enumerable property 8837 // configurable must be true to allow the property to be 8838 // deleted when data is removed 8839 } else { 8840 Object.defineProperty( owner, this.expando, { 8841 value: value, 8842 configurable: true 8843 } ); 8844 } 8845 } 8846 } 8847 8848 return value; 8849 }, 8850 set: function( owner, data, value ) { 8851 var prop, 8852 cache = this.cache( owner ); 8853 8854 // Handle: [ owner, key, value ] args 8855 // Always use camelCase key (gh-2257) 8856 if ( typeof data === "string" ) { 8857 cache[ camelCase( data ) ] = value; 8858 8859 // Handle: [ owner, { properties } ] args 8860 } else { 8861 8862 // Copy the properties one-by-one to the cache object 8863 for ( prop in data ) { 8864 cache[ camelCase( prop ) ] = data[ prop ]; 8865 } 8866 } 8867 return cache; 8868 }, 8869 get: function( owner, key ) { 8870 return key === undefined ? 8871 this.cache( owner ) : 8872 8873 // Always use camelCase key (gh-2257) 8874 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 8875 }, 8876 access: function( owner, key, value ) { 8877 8878 // In cases where either: 8879 // 8880 // 1. No key was specified 8881 // 2. A string key was specified, but no value provided 8882 // 8883 // Take the "read" path and allow the get method to determine 8884 // which value to return, respectively either: 8885 // 8886 // 1. The entire cache object 8887 // 2. The data stored at the key 8888 // 8889 if ( key === undefined || 8890 ( ( key && typeof key === "string" ) && value === undefined ) ) { 8891 8892 return this.get( owner, key ); 8893 } 8894 8895 // When the key is not a string, or both a key and value 8896 // are specified, set or extend (existing objects) with either: 8897 // 8898 // 1. An object of properties 8899 // 2. A key and value 8900 // 8901 this.set( owner, key, value ); 8902 8903 // Since the "set" path can have two possible entry points 8904 // return the expected data based on which path was taken[*] 8905 return value !== undefined ? value : key; 8906 }, 8907 remove: function( owner, key ) { 8908 var i, 8909 cache = owner[ this.expando ]; 8910 8911 if ( cache === undefined ) { 8912 return; 8913 } 8914 8915 if ( key !== undefined ) { 8916 8917 // Support array or space separated string of keys 8918 if ( Array.isArray( key ) ) { 8919 8920 // If key is an array of keys... 8921 // We always set camelCase keys, so remove that. 8922 key = key.map( camelCase ); 8923 } else { 8924 key = camelCase( key ); 8925 8926 // If a key with the spaces exists, use it. 8927 // Otherwise, create an array by matching non-whitespace 8928 key = key in cache ? 8929 [ key ] : 8930 ( key.match( rnothtmlwhite ) || [] ); 8931 } 8932 8933 i = key.length; 8934 8935 while ( i-- ) { 8936 delete cache[ key[ i ] ]; 8937 } 8938 } 8939 8940 // Remove the expando if there's no more data 8941 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 8942 8943 // Support: Chrome <=35 - 45 8944 // Webkit & Blink performance suffers when deleting properties 8945 // from DOM nodes, so set to undefined instead 8946 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 8947 if ( owner.nodeType ) { 8948 owner[ this.expando ] = undefined; 8949 } else { 8950 delete owner[ this.expando ]; 8951 } 8952 } 8953 }, 8954 hasData: function( owner ) { 8955 var cache = owner[ this.expando ]; 8956 return cache !== undefined && !jQuery.isEmptyObject( cache ); 8957 } 8958}; 8959var dataPriv = new Data(); 8960 8961var dataUser = new Data(); 8962 8963 8964 8965// Implementation Summary 8966// 8967// 1. Enforce API surface and semantic compatibility with 1.9.x branch 8968// 2. Improve the module's maintainability by reducing the storage 8969// paths to a single mechanism. 8970// 3. Use the same single mechanism to support "private" and "user" data. 8971// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 8972// 5. Avoid exposing implementation details on user objects (eg. expando properties) 8973// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 8974 8975var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 8976 rmultiDash = /[A-Z]/g; 8977 8978function getData( data ) { 8979 if ( data === "true" ) { 8980 return true; 8981 } 8982 8983 if ( data === "false" ) { 8984 return false; 8985 } 8986 8987 if ( data === "null" ) { 8988 return null; 8989 } 8990 8991 // Only convert to a number if it doesn't change the string 8992 if ( data === +data + "" ) { 8993 return +data; 8994 } 8995 8996 if ( rbrace.test( data ) ) { 8997 return JSON.parse( data ); 8998 } 8999 9000 return data; 9001} 9002 9003function dataAttr( elem, key, data ) { 9004 var name; 9005 9006 // If nothing was found internally, try to fetch any 9007 // data from the HTML5 data-* attribute 9008 if ( data === undefined && elem.nodeType === 1 ) { 9009 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 9010 data = elem.getAttribute( name ); 9011 9012 if ( typeof data === "string" ) { 9013 try { 9014 data = getData( data ); 9015 } catch ( e ) {} 9016 9017 // Make sure we set the data so it isn't changed later 9018 dataUser.set( elem, key, data ); 9019 } else { 9020 data = undefined; 9021 } 9022 } 9023 return data; 9024} 9025 9026jQuery.extend( { 9027 hasData: function( elem ) { 9028 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 9029 }, 9030 9031 data: function( elem, name, data ) { 9032 return dataUser.access( elem, name, data ); 9033 }, 9034 9035 removeData: function( elem, name ) { 9036 dataUser.remove( elem, name ); 9037 }, 9038 9039 // TODO: Now that all calls to _data and _removeData have been replaced 9040 // with direct calls to dataPriv methods, these can be deprecated. 9041 _data: function( elem, name, data ) { 9042 return dataPriv.access( elem, name, data ); 9043 }, 9044 9045 _removeData: function( elem, name ) { 9046 dataPriv.remove( elem, name ); 9047 } 9048} ); 9049 9050jQuery.fn.extend( { 9051 data: function( key, value ) { 9052 var i, name, data, 9053 elem = this[ 0 ], 9054 attrs = elem && elem.attributes; 9055 9056 // Gets all values 9057 if ( key === undefined ) { 9058 if ( this.length ) { 9059 data = dataUser.get( elem ); 9060 9061 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 9062 i = attrs.length; 9063 while ( i-- ) { 9064 9065 // Support: IE 11 only 9066 // The attrs elements can be null (#14894) 9067 if ( attrs[ i ] ) { 9068 name = attrs[ i ].name; 9069 if ( name.indexOf( "data-" ) === 0 ) { 9070 name = camelCase( name.slice( 5 ) ); 9071 dataAttr( elem, name, data[ name ] ); 9072 } 9073 } 9074 } 9075 dataPriv.set( elem, "hasDataAttrs", true ); 9076 } 9077 } 9078 9079 return data; 9080 } 9081 9082 // Sets multiple values 9083 if ( typeof key === "object" ) { 9084 return this.each( function() { 9085 dataUser.set( this, key ); 9086 } ); 9087 } 9088 9089 return access( this, function( value ) { 9090 var data; 9091 9092 // The calling jQuery object (element matches) is not empty 9093 // (and therefore has an element appears at this[ 0 ]) and the 9094 // `value` parameter was not undefined. An empty jQuery object 9095 // will result in `undefined` for elem = this[ 0 ] which will 9096 // throw an exception if an attempt to read a data cache is made. 9097 if ( elem && value === undefined ) { 9098 9099 // Attempt to get data from the cache 9100 // The key will always be camelCased in Data 9101 data = dataUser.get( elem, key ); 9102 if ( data !== undefined ) { 9103 return data; 9104 } 9105 9106 // Attempt to "discover" the data in 9107 // HTML5 custom data-* attrs 9108 data = dataAttr( elem, key ); 9109 if ( data !== undefined ) { 9110 return data; 9111 } 9112 9113 // We tried really hard, but the data doesn't exist. 9114 return; 9115 } 9116 9117 // Set the data... 9118 this.each( function() { 9119 9120 // We always store the camelCased key 9121 dataUser.set( this, key, value ); 9122 } ); 9123 }, null, value, arguments.length > 1, null, true ); 9124 }, 9125 9126 removeData: function( key ) { 9127 return this.each( function() { 9128 dataUser.remove( this, key ); 9129 } ); 9130 } 9131} ); 9132 9133 9134jQuery.extend( { 9135 queue: function( elem, type, data ) { 9136 var queue; 9137 9138 if ( elem ) { 9139 type = ( type || "fx" ) + "queue"; 9140 queue = dataPriv.get( elem, type ); 9141 9142 // Speed up dequeue by getting out quickly if this is just a lookup 9143 if ( data ) { 9144 if ( !queue || Array.isArray( data ) ) { 9145 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 9146 } else { 9147 queue.push( data ); 9148 } 9149 } 9150 return queue || []; 9151 } 9152 }, 9153 9154 dequeue: function( elem, type ) { 9155 type = type || "fx"; 9156 9157 var queue = jQuery.queue( elem, type ), 9158 startLength = queue.length, 9159 fn = queue.shift(), 9160 hooks = jQuery._queueHooks( elem, type ), 9161 next = function() { 9162 jQuery.dequeue( elem, type ); 9163 }; 9164 9165 // If the fx queue is dequeued, always remove the progress sentinel 9166 if ( fn === "inprogress" ) { 9167 fn = queue.shift(); 9168 startLength--; 9169 } 9170 9171 if ( fn ) { 9172 9173 // Add a progress sentinel to prevent the fx queue from being 9174 // automatically dequeued 9175 if ( type === "fx" ) { 9176 queue.unshift( "inprogress" ); 9177 } 9178 9179 // Clear up the last queue stop function 9180 delete hooks.stop; 9181 fn.call( elem, next, hooks ); 9182 } 9183 9184 if ( !startLength && hooks ) { 9185 hooks.empty.fire(); 9186 } 9187 }, 9188 9189 // Not public - generate a queueHooks object, or return the current one 9190 _queueHooks: function( elem, type ) { 9191 var key = type + "queueHooks"; 9192 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 9193 empty: jQuery.Callbacks( "once memory" ).add( function() { 9194 dataPriv.remove( elem, [ type + "queue", key ] ); 9195 } ) 9196 } ); 9197 } 9198} ); 9199 9200jQuery.fn.extend( { 9201 queue: function( type, data ) { 9202 var setter = 2; 9203 9204 if ( typeof type !== "string" ) { 9205 data = type; 9206 type = "fx"; 9207 setter--; 9208 } 9209 9210 if ( arguments.length < setter ) { 9211 return jQuery.queue( this[ 0 ], type ); 9212 } 9213 9214 return data === undefined ? 9215 this : 9216 this.each( function() { 9217 var queue = jQuery.queue( this, type, data ); 9218 9219 // Ensure a hooks for this queue 9220 jQuery._queueHooks( this, type ); 9221 9222 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 9223 jQuery.dequeue( this, type ); 9224 } 9225 } ); 9226 }, 9227 dequeue: function( type ) { 9228 return this.each( function() { 9229 jQuery.dequeue( this, type ); 9230 } ); 9231 }, 9232 clearQueue: function( type ) { 9233 return this.queue( type || "fx", [] ); 9234 }, 9235 9236 // Get a promise resolved when queues of a certain type 9237 // are emptied (fx is the type by default) 9238 promise: function( type, obj ) { 9239 var tmp, 9240 count = 1, 9241 defer = jQuery.Deferred(), 9242 elements = this, 9243 i = this.length, 9244 resolve = function() { 9245 if ( !( --count ) ) { 9246 defer.resolveWith( elements, [ elements ] ); 9247 } 9248 }; 9249 9250 if ( typeof type !== "string" ) { 9251 obj = type; 9252 type = undefined; 9253 } 9254 type = type || "fx"; 9255 9256 while ( i-- ) { 9257 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 9258 if ( tmp && tmp.empty ) { 9259 count++; 9260 tmp.empty.add( resolve ); 9261 } 9262 } 9263 resolve(); 9264 return defer.promise( obj ); 9265 } 9266} ); 9267var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 9268 9269var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 9270 9271 9272var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 9273 9274var documentElement = document.documentElement; 9275 9276 9277 9278 var isAttached = function( elem ) { 9279 return jQuery.contains( elem.ownerDocument, elem ); 9280 }, 9281 composed = { composed: true }; 9282 9283 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 9284 // Check attachment across shadow DOM boundaries when possible (gh-3504) 9285 // Support: iOS 10.0-10.2 only 9286 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 9287 // leading to errors. We need to check for `getRootNode`. 9288 if ( documentElement.getRootNode ) { 9289 isAttached = function( elem ) { 9290 return jQuery.contains( elem.ownerDocument, elem ) || 9291 elem.getRootNode( composed ) === elem.ownerDocument; 9292 }; 9293 } 9294var isHiddenWithinTree = function( elem, el ) { 9295 9296 // isHiddenWithinTree might be called from jQuery#filter function; 9297 // in that case, element will be second argument 9298 elem = el || elem; 9299 9300 // Inline style trumps all 9301 return elem.style.display === "none" || 9302 elem.style.display === "" && 9303 9304 // Otherwise, check computed style 9305 // Support: Firefox <=43 - 45 9306 // Disconnected elements can have computed display: none, so first confirm that elem is 9307 // in the document. 9308 isAttached( elem ) && 9309 9310 jQuery.css( elem, "display" ) === "none"; 9311 }; 9312 9313 9314 9315function adjustCSS( elem, prop, valueParts, tween ) { 9316 var adjusted, scale, 9317 maxIterations = 20, 9318 currentValue = tween ? 9319 function() { 9320 return tween.cur(); 9321 } : 9322 function() { 9323 return jQuery.css( elem, prop, "" ); 9324 }, 9325 initial = currentValue(), 9326 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 9327 9328 // Starting value computation is required for potential unit mismatches 9329 initialInUnit = elem.nodeType && 9330 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 9331 rcssNum.exec( jQuery.css( elem, prop ) ); 9332 9333 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 9334 9335 // Support: Firefox <=54 9336 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 9337 initial = initial / 2; 9338 9339 // Trust units reported by jQuery.css 9340 unit = unit || initialInUnit[ 3 ]; 9341 9342 // Iteratively approximate from a nonzero starting point 9343 initialInUnit = +initial || 1; 9344 9345 while ( maxIterations-- ) { 9346 9347 // Evaluate and update our best guess (doubling guesses that zero out). 9348 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 9349 jQuery.style( elem, prop, initialInUnit + unit ); 9350 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 9351 maxIterations = 0; 9352 } 9353 initialInUnit = initialInUnit / scale; 9354 9355 } 9356 9357 initialInUnit = initialInUnit * 2; 9358 jQuery.style( elem, prop, initialInUnit + unit ); 9359 9360 // Make sure we update the tween properties later on 9361 valueParts = valueParts || []; 9362 } 9363 9364 if ( valueParts ) { 9365 initialInUnit = +initialInUnit || +initial || 0; 9366 9367 // Apply relative offset (+=/-=) if specified 9368 adjusted = valueParts[ 1 ] ? 9369 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 9370 +valueParts[ 2 ]; 9371 if ( tween ) { 9372 tween.unit = unit; 9373 tween.start = initialInUnit; 9374 tween.end = adjusted; 9375 } 9376 } 9377 return adjusted; 9378} 9379 9380 9381var defaultDisplayMap = {}; 9382 9383function getDefaultDisplay( elem ) { 9384 var temp, 9385 doc = elem.ownerDocument, 9386 nodeName = elem.nodeName, 9387 display = defaultDisplayMap[ nodeName ]; 9388 9389 if ( display ) { 9390 return display; 9391 } 9392 9393 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 9394 display = jQuery.css( temp, "display" ); 9395 9396 temp.parentNode.removeChild( temp ); 9397 9398 if ( display === "none" ) { 9399 display = "block"; 9400 } 9401 defaultDisplayMap[ nodeName ] = display; 9402 9403 return display; 9404} 9405 9406function showHide( elements, show ) { 9407 var display, elem, 9408 values = [], 9409 index = 0, 9410 length = elements.length; 9411 9412 // Determine new display value for elements that need to change 9413 for ( ; index < length; index++ ) { 9414 elem = elements[ index ]; 9415 if ( !elem.style ) { 9416 continue; 9417 } 9418 9419 display = elem.style.display; 9420 if ( show ) { 9421 9422 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 9423 // check is required in this first loop unless we have a nonempty display value (either 9424 // inline or about-to-be-restored) 9425 if ( display === "none" ) { 9426 values[ index ] = dataPriv.get( elem, "display" ) || null; 9427 if ( !values[ index ] ) { 9428 elem.style.display = ""; 9429 } 9430 } 9431 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 9432 values[ index ] = getDefaultDisplay( elem ); 9433 } 9434 } else { 9435 if ( display !== "none" ) { 9436 values[ index ] = "none"; 9437 9438 // Remember what we're overwriting 9439 dataPriv.set( elem, "display", display ); 9440 } 9441 } 9442 } 9443 9444 // Set the display of the elements in a second loop to avoid constant reflow 9445 for ( index = 0; index < length; index++ ) { 9446 if ( values[ index ] != null ) { 9447 elements[ index ].style.display = values[ index ]; 9448 } 9449 } 9450 9451 return elements; 9452} 9453 9454jQuery.fn.extend( { 9455 show: function() { 9456 return showHide( this, true ); 9457 }, 9458 hide: function() { 9459 return showHide( this ); 9460 }, 9461 toggle: function( state ) { 9462 if ( typeof state === "boolean" ) { 9463 return state ? this.show() : this.hide(); 9464 } 9465 9466 return this.each( function() { 9467 if ( isHiddenWithinTree( this ) ) { 9468 jQuery( this ).show(); 9469 } else { 9470 jQuery( this ).hide(); 9471 } 9472 } ); 9473 } 9474} ); 9475var rcheckableType = ( /^(?:checkbox|radio)$/i ); 9476 9477var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 9478 9479var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 9480 9481 9482 9483( function() { 9484 var fragment = document.createDocumentFragment(), 9485 div = fragment.appendChild( document.createElement( "div" ) ), 9486 input = document.createElement( "input" ); 9487 9488 // Support: Android 4.0 - 4.3 only 9489 // Check state lost if the name is set (#11217) 9490 // Support: Windows Web Apps (WWA) 9491 // `name` and `type` must use .setAttribute for WWA (#14901) 9492 input.setAttribute( "type", "radio" ); 9493 input.setAttribute( "checked", "checked" ); 9494 input.setAttribute( "name", "t" ); 9495 9496 div.appendChild( input ); 9497 9498 // Support: Android <=4.1 only 9499 // Older WebKit doesn't clone checked state correctly in fragments 9500 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 9501 9502 // Support: IE <=11 only 9503 // Make sure textarea (and checkbox) defaultValue is properly cloned 9504 div.innerHTML = "<textarea>x</textarea>"; 9505 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 9506 9507 // Support: IE <=9 only 9508 // IE <=9 replaces <option> tags with their contents when inserted outside of 9509 // the select element. 9510 div.innerHTML = "<option></option>"; 9511 support.option = !!div.lastChild; 9512} )(); 9513 9514 9515// We have to close these tags to support XHTML (#13200) 9516var wrapMap = { 9517 9518 // XHTML parsers do not magically insert elements in the 9519 // same way that tag soup parsers do. So we cannot shorten 9520 // this by omitting <tbody> or other required elements. 9521 thead: [ 1, "<table>", "</table>" ], 9522 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 9523 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 9524 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 9525 9526 _default: [ 0, "", "" ] 9527}; 9528 9529wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 9530wrapMap.th = wrapMap.td; 9531 9532// Support: IE <=9 only 9533if ( !support.option ) { 9534 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 9535} 9536 9537 9538function getAll( context, tag ) { 9539 9540 // Support: IE <=9 - 11 only 9541 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 9542 var ret; 9543 9544 if ( typeof context.getElementsByTagName !== "undefined" ) { 9545 ret = context.getElementsByTagName( tag || "*" ); 9546 9547 } else if ( typeof context.querySelectorAll !== "undefined" ) { 9548 ret = context.querySelectorAll( tag || "*" ); 9549 9550 } else { 9551 ret = []; 9552 } 9553 9554 if ( tag === undefined || tag && nodeName( context, tag ) ) { 9555 return jQuery.merge( [ context ], ret ); 9556 } 9557 9558 return ret; 9559} 9560 9561 9562// Mark scripts as having already been evaluated 9563function setGlobalEval( elems, refElements ) { 9564 var i = 0, 9565 l = elems.length; 9566 9567 for ( ; i < l; i++ ) { 9568 dataPriv.set( 9569 elems[ i ], 9570 "globalEval", 9571 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 9572 ); 9573 } 9574} 9575 9576 9577var rhtml = /<|&#?\w+;/; 9578 9579function buildFragment( elems, context, scripts, selection, ignored ) { 9580 var elem, tmp, tag, wrap, attached, j, 9581 fragment = context.createDocumentFragment(), 9582 nodes = [], 9583 i = 0, 9584 l = elems.length; 9585 9586 for ( ; i < l; i++ ) { 9587 elem = elems[ i ]; 9588 9589 if ( elem || elem === 0 ) { 9590 9591 // Add nodes directly 9592 if ( toType( elem ) === "object" ) { 9593 9594 // Support: Android <=4.0 only, PhantomJS 1 only 9595 // push.apply(_, arraylike) throws on ancient WebKit 9596 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 9597 9598 // Convert non-html into a text node 9599 } else if ( !rhtml.test( elem ) ) { 9600 nodes.push( context.createTextNode( elem ) ); 9601 9602 // Convert html into DOM nodes 9603 } else { 9604 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 9605 9606 // Deserialize a standard representation 9607 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 9608 wrap = wrapMap[ tag ] || wrapMap._default; 9609 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 9610 9611 // Descend through wrappers to the right content 9612 j = wrap[ 0 ]; 9613 while ( j-- ) { 9614 tmp = tmp.lastChild; 9615 } 9616 9617 // Support: Android <=4.0 only, PhantomJS 1 only 9618 // push.apply(_, arraylike) throws on ancient WebKit 9619 jQuery.merge( nodes, tmp.childNodes ); 9620 9621 // Remember the top-level container 9622 tmp = fragment.firstChild; 9623 9624 // Ensure the created nodes are orphaned (#12392) 9625 tmp.textContent = ""; 9626 } 9627 } 9628 } 9629 9630 // Remove wrapper from fragment 9631 fragment.textContent = ""; 9632 9633 i = 0; 9634 while ( ( elem = nodes[ i++ ] ) ) { 9635 9636 // Skip elements already in the context collection (trac-4087) 9637 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 9638 if ( ignored ) { 9639 ignored.push( elem ); 9640 } 9641 continue; 9642 } 9643 9644 attached = isAttached( elem ); 9645 9646 // Append to fragment 9647 tmp = getAll( fragment.appendChild( elem ), "script" ); 9648 9649 // Preserve script evaluation history 9650 if ( attached ) { 9651 setGlobalEval( tmp ); 9652 } 9653 9654 // Capture executables 9655 if ( scripts ) { 9656 j = 0; 9657 while ( ( elem = tmp[ j++ ] ) ) { 9658 if ( rscriptType.test( elem.type || "" ) ) { 9659 scripts.push( elem ); 9660 } 9661 } 9662 } 9663 } 9664 9665 return fragment; 9666} 9667 9668 9669var 9670 rkeyEvent = /^key/, 9671 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 9672 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 9673 9674function returnTrue() { 9675 return true; 9676} 9677 9678function returnFalse() { 9679 return false; 9680} 9681 9682// Support: IE <=9 - 11+ 9683// focus() and blur() are asynchronous, except when they are no-op. 9684// So expect focus to be synchronous when the element is already active, 9685// and blur to be synchronous when the element is not already active. 9686// (focus and blur are always synchronous in other supported browsers, 9687// this just defines when we can count on it). 9688function expectSync( elem, type ) { 9689 return ( elem === safeActiveElement() ) === ( type === "focus" ); 9690} 9691 9692// Support: IE <=9 only 9693// Accessing document.activeElement can throw unexpectedly 9694// https://bugs.jquery.com/ticket/13393 9695function safeActiveElement() { 9696 try { 9697 return document.activeElement; 9698 } catch ( err ) { } 9699} 9700 9701function on( elem, types, selector, data, fn, one ) { 9702 var origFn, type; 9703 9704 // Types can be a map of types/handlers 9705 if ( typeof types === "object" ) { 9706 9707 // ( types-Object, selector, data ) 9708 if ( typeof selector !== "string" ) { 9709 9710 // ( types-Object, data ) 9711 data = data || selector; 9712 selector = undefined; 9713 } 9714 for ( type in types ) { 9715 on( elem, type, selector, data, types[ type ], one ); 9716 } 9717 return elem; 9718 } 9719 9720 if ( data == null && fn == null ) { 9721 9722 // ( types, fn ) 9723 fn = selector; 9724 data = selector = undefined; 9725 } else if ( fn == null ) { 9726 if ( typeof selector === "string" ) { 9727 9728 // ( types, selector, fn ) 9729 fn = data; 9730 data = undefined; 9731 } else { 9732 9733 // ( types, data, fn ) 9734 fn = data; 9735 data = selector; 9736 selector = undefined; 9737 } 9738 } 9739 if ( fn === false ) { 9740 fn = returnFalse; 9741 } else if ( !fn ) { 9742 return elem; 9743 } 9744 9745 if ( one === 1 ) { 9746 origFn = fn; 9747 fn = function( event ) { 9748 9749 // Can use an empty set, since event contains the info 9750 jQuery().off( event ); 9751 return origFn.apply( this, arguments ); 9752 }; 9753 9754 // Use same guid so caller can remove using origFn 9755 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 9756 } 9757 return elem.each( function() { 9758 jQuery.event.add( this, types, fn, data, selector ); 9759 } ); 9760} 9761 9762/* 9763 * Helper functions for managing events -- not part of the public interface. 9764 * Props to Dean Edwards' addEvent library for many of the ideas. 9765 */ 9766jQuery.event = { 9767 9768 global: {}, 9769 9770 add: function( elem, types, handler, data, selector ) { 9771 9772 var handleObjIn, eventHandle, tmp, 9773 events, t, handleObj, 9774 special, handlers, type, namespaces, origType, 9775 elemData = dataPriv.get( elem ); 9776 9777 // Only attach events to objects that accept data 9778 if ( !acceptData( elem ) ) { 9779 return; 9780 } 9781 9782 // Caller can pass in an object of custom data in lieu of the handler 9783 if ( handler.handler ) { 9784 handleObjIn = handler; 9785 handler = handleObjIn.handler; 9786 selector = handleObjIn.selector; 9787 } 9788 9789 // Ensure that invalid selectors throw exceptions at attach time 9790 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 9791 if ( selector ) { 9792 jQuery.find.matchesSelector( documentElement, selector ); 9793 } 9794 9795 // Make sure that the handler has a unique ID, used to find/remove it later 9796 if ( !handler.guid ) { 9797 handler.guid = jQuery.guid++; 9798 } 9799 9800 // Init the element's event structure and main handler, if this is the first 9801 if ( !( events = elemData.events ) ) { 9802 events = elemData.events = Object.create( null ); 9803 } 9804 if ( !( eventHandle = elemData.handle ) ) { 9805 eventHandle = elemData.handle = function( e ) { 9806 9807 // Discard the second event of a jQuery.event.trigger() and 9808 // when an event is called after a page has unloaded 9809 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 9810 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 9811 }; 9812 } 9813 9814 // Handle multiple events separated by a space 9815 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9816 t = types.length; 9817 while ( t-- ) { 9818 tmp = rtypenamespace.exec( types[ t ] ) || []; 9819 type = origType = tmp[ 1 ]; 9820 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9821 9822 // There *must* be a type, no attaching namespace-only handlers 9823 if ( !type ) { 9824 continue; 9825 } 9826 9827 // If event changes its type, use the special event handlers for the changed type 9828 special = jQuery.event.special[ type ] || {}; 9829 9830 // If selector defined, determine special event api type, otherwise given type 9831 type = ( selector ? special.delegateType : special.bindType ) || type; 9832 9833 // Update special based on newly reset type 9834 special = jQuery.event.special[ type ] || {}; 9835 9836 // handleObj is passed to all event handlers 9837 handleObj = jQuery.extend( { 9838 type: type, 9839 origType: origType, 9840 data: data, 9841 handler: handler, 9842 guid: handler.guid, 9843 selector: selector, 9844 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 9845 namespace: namespaces.join( "." ) 9846 }, handleObjIn ); 9847 9848 // Init the event handler queue if we're the first 9849 if ( !( handlers = events[ type ] ) ) { 9850 handlers = events[ type ] = []; 9851 handlers.delegateCount = 0; 9852 9853 // Only use addEventListener if the special events handler returns false 9854 if ( !special.setup || 9855 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 9856 9857 if ( elem.addEventListener ) { 9858 elem.addEventListener( type, eventHandle ); 9859 } 9860 } 9861 } 9862 9863 if ( special.add ) { 9864 special.add.call( elem, handleObj ); 9865 9866 if ( !handleObj.handler.guid ) { 9867 handleObj.handler.guid = handler.guid; 9868 } 9869 } 9870 9871 // Add to the element's handler list, delegates in front 9872 if ( selector ) { 9873 handlers.splice( handlers.delegateCount++, 0, handleObj ); 9874 } else { 9875 handlers.push( handleObj ); 9876 } 9877 9878 // Keep track of which events have ever been used, for event optimization 9879 jQuery.event.global[ type ] = true; 9880 } 9881 9882 }, 9883 9884 // Detach an event or set of events from an element 9885 remove: function( elem, types, handler, selector, mappedTypes ) { 9886 9887 var j, origCount, tmp, 9888 events, t, handleObj, 9889 special, handlers, type, namespaces, origType, 9890 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 9891 9892 if ( !elemData || !( events = elemData.events ) ) { 9893 return; 9894 } 9895 9896 // Once for each type.namespace in types; type may be omitted 9897 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 9898 t = types.length; 9899 while ( t-- ) { 9900 tmp = rtypenamespace.exec( types[ t ] ) || []; 9901 type = origType = tmp[ 1 ]; 9902 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 9903 9904 // Unbind all events (on this namespace, if provided) for the element 9905 if ( !type ) { 9906 for ( type in events ) { 9907 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 9908 } 9909 continue; 9910 } 9911 9912 special = jQuery.event.special[ type ] || {}; 9913 type = ( selector ? special.delegateType : special.bindType ) || type; 9914 handlers = events[ type ] || []; 9915 tmp = tmp[ 2 ] && 9916 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 9917 9918 // Remove matching events 9919 origCount = j = handlers.length; 9920 while ( j-- ) { 9921 handleObj = handlers[ j ]; 9922 9923 if ( ( mappedTypes || origType === handleObj.origType ) && 9924 ( !handler || handler.guid === handleObj.guid ) && 9925 ( !tmp || tmp.test( handleObj.namespace ) ) && 9926 ( !selector || selector === handleObj.selector || 9927 selector === "**" && handleObj.selector ) ) { 9928 handlers.splice( j, 1 ); 9929 9930 if ( handleObj.selector ) { 9931 handlers.delegateCount--; 9932 } 9933 if ( special.remove ) { 9934 special.remove.call( elem, handleObj ); 9935 } 9936 } 9937 } 9938 9939 // Remove generic event handler if we removed something and no more handlers exist 9940 // (avoids potential for endless recursion during removal of special event handlers) 9941 if ( origCount && !handlers.length ) { 9942 if ( !special.teardown || 9943 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 9944 9945 jQuery.removeEvent( elem, type, elemData.handle ); 9946 } 9947 9948 delete events[ type ]; 9949 } 9950 } 9951 9952 // Remove data and the expando if it's no longer used 9953 if ( jQuery.isEmptyObject( events ) ) { 9954 dataPriv.remove( elem, "handle events" ); 9955 } 9956 }, 9957 9958 dispatch: function( nativeEvent ) { 9959 9960 var i, j, ret, matched, handleObj, handlerQueue, 9961 args = new Array( arguments.length ), 9962 9963 // Make a writable jQuery.Event from the native event object 9964 event = jQuery.event.fix( nativeEvent ), 9965 9966 handlers = ( 9967 dataPriv.get( this, "events" ) || Object.create( null ) 9968 )[ event.type ] || [], 9969 special = jQuery.event.special[ event.type ] || {}; 9970 9971 // Use the fix-ed jQuery.Event rather than the (read-only) native event 9972 args[ 0 ] = event; 9973 9974 for ( i = 1; i < arguments.length; i++ ) { 9975 args[ i ] = arguments[ i ]; 9976 } 9977 9978 event.delegateTarget = this; 9979 9980 // Call the preDispatch hook for the mapped type, and let it bail if desired 9981 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 9982 return; 9983 } 9984 9985 // Determine handlers 9986 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 9987 9988 // Run delegates first; they may want to stop propagation beneath us 9989 i = 0; 9990 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 9991 event.currentTarget = matched.elem; 9992 9993 j = 0; 9994 while ( ( handleObj = matched.handlers[ j++ ] ) && 9995 !event.isImmediatePropagationStopped() ) { 9996 9997 // If the event is namespaced, then each handler is only invoked if it is 9998 // specially universal or its namespaces are a superset of the event's. 9999 if ( !event.rnamespace || handleObj.namespace === false || 10000 event.rnamespace.test( handleObj.namespace ) ) { 10001 10002 event.handleObj = handleObj; 10003 event.data = handleObj.data; 10004 10005 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 10006 handleObj.handler ).apply( matched.elem, args ); 10007 10008 if ( ret !== undefined ) { 10009 if ( ( event.result = ret ) === false ) { 10010 event.preventDefault(); 10011 event.stopPropagation(); 10012 } 10013 } 10014 } 10015 } 10016 } 10017 10018 // Call the postDispatch hook for the mapped type 10019 if ( special.postDispatch ) { 10020 special.postDispatch.call( this, event ); 10021 } 10022 10023 return event.result; 10024 }, 10025 10026 handlers: function( event, handlers ) { 10027 var i, handleObj, sel, matchedHandlers, matchedSelectors, 10028 handlerQueue = [], 10029 delegateCount = handlers.delegateCount, 10030 cur = event.target; 10031 10032 // Find delegate handlers 10033 if ( delegateCount && 10034 10035 // Support: IE <=9 10036 // Black-hole SVG <use> instance trees (trac-13180) 10037 cur.nodeType && 10038 10039 // Support: Firefox <=42 10040 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 10041 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 10042 // Support: IE 11 only 10043 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 10044 !( event.type === "click" && event.button >= 1 ) ) { 10045 10046 for ( ; cur !== this; cur = cur.parentNode || this ) { 10047 10048 // Don't check non-elements (#13208) 10049 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 10050 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 10051 matchedHandlers = []; 10052 matchedSelectors = {}; 10053 for ( i = 0; i < delegateCount; i++ ) { 10054 handleObj = handlers[ i ]; 10055 10056 // Don't conflict with Object.prototype properties (#13203) 10057 sel = handleObj.selector + " "; 10058 10059 if ( matchedSelectors[ sel ] === undefined ) { 10060 matchedSelectors[ sel ] = handleObj.needsContext ? 10061 jQuery( sel, this ).index( cur ) > -1 : 10062 jQuery.find( sel, this, null, [ cur ] ).length; 10063 } 10064 if ( matchedSelectors[ sel ] ) { 10065 matchedHandlers.push( handleObj ); 10066 } 10067 } 10068 if ( matchedHandlers.length ) { 10069 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 10070 } 10071 } 10072 } 10073 } 10074 10075 // Add the remaining (directly-bound) handlers 10076 cur = this; 10077 if ( delegateCount < handlers.length ) { 10078 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 10079 } 10080 10081 return handlerQueue; 10082 }, 10083 10084 addProp: function( name, hook ) { 10085 Object.defineProperty( jQuery.Event.prototype, name, { 10086 enumerable: true, 10087 configurable: true, 10088 10089 get: isFunction( hook ) ? 10090 function() { 10091 if ( this.originalEvent ) { 10092 return hook( this.originalEvent ); 10093 } 10094 } : 10095 function() { 10096 if ( this.originalEvent ) { 10097 return this.originalEvent[ name ]; 10098 } 10099 }, 10100 10101 set: function( value ) { 10102 Object.defineProperty( this, name, { 10103 enumerable: true, 10104 configurable: true, 10105 writable: true, 10106 value: value 10107 } ); 10108 } 10109 } ); 10110 }, 10111 10112 fix: function( originalEvent ) { 10113 return originalEvent[ jQuery.expando ] ? 10114 originalEvent : 10115 new jQuery.Event( originalEvent ); 10116 }, 10117 10118 special: { 10119 load: { 10120 10121 // Prevent triggered image.load events from bubbling to window.load 10122 noBubble: true 10123 }, 10124 click: { 10125 10126 // Utilize native event to ensure correct state for checkable inputs 10127 setup: function( data ) { 10128 10129 // For mutual compressibility with _default, replace `this` access with a local var. 10130 // `|| data` is dead code meant only to preserve the variable through minification. 10131 var el = this || data; 10132 10133 // Claim the first handler 10134 if ( rcheckableType.test( el.type ) && 10135 el.click && nodeName( el, "input" ) ) { 10136 10137 // dataPriv.set( el, "click", ... ) 10138 leverageNative( el, "click", returnTrue ); 10139 } 10140 10141 // Return false to allow normal processing in the caller 10142 return false; 10143 }, 10144 trigger: function( data ) { 10145 10146 // For mutual compressibility with _default, replace `this` access with a local var. 10147 // `|| data` is dead code meant only to preserve the variable through minification. 10148 var el = this || data; 10149 10150 // Force setup before triggering a click 10151 if ( rcheckableType.test( el.type ) && 10152 el.click && nodeName( el, "input" ) ) { 10153 10154 leverageNative( el, "click" ); 10155 } 10156 10157 // Return non-false to allow normal event-path propagation 10158 return true; 10159 }, 10160 10161 // For cross-browser consistency, suppress native .click() on links 10162 // Also prevent it if we're currently inside a leveraged native-event stack 10163 _default: function( event ) { 10164 var target = event.target; 10165 return rcheckableType.test( target.type ) && 10166 target.click && nodeName( target, "input" ) && 10167 dataPriv.get( target, "click" ) || 10168 nodeName( target, "a" ); 10169 } 10170 }, 10171 10172 beforeunload: { 10173 postDispatch: function( event ) { 10174 10175 // Support: Firefox 20+ 10176 // Firefox doesn't alert if the returnValue field is not set. 10177 if ( event.result !== undefined && event.originalEvent ) { 10178 event.originalEvent.returnValue = event.result; 10179 } 10180 } 10181 } 10182 } 10183}; 10184 10185// Ensure the presence of an event listener that handles manually-triggered 10186// synthetic events by interrupting progress until reinvoked in response to 10187// *native* events that it fires directly, ensuring that state changes have 10188// already occurred before other listeners are invoked. 10189function leverageNative( el, type, expectSync ) { 10190 10191 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 10192 if ( !expectSync ) { 10193 if ( dataPriv.get( el, type ) === undefined ) { 10194 jQuery.event.add( el, type, returnTrue ); 10195 } 10196 return; 10197 } 10198 10199 // Register the controller as a special universal handler for all event namespaces 10200 dataPriv.set( el, type, false ); 10201 jQuery.event.add( el, type, { 10202 namespace: false, 10203 handler: function( event ) { 10204 var notAsync, result, 10205 saved = dataPriv.get( this, type ); 10206 10207 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 10208 10209 // Interrupt processing of the outer synthetic .trigger()ed event 10210 // Saved data should be false in such cases, but might be a leftover capture object 10211 // from an async native handler (gh-4350) 10212 if ( !saved.length ) { 10213 10214 // Store arguments for use when handling the inner native event 10215 // There will always be at least one argument (an event object), so this array 10216 // will not be confused with a leftover capture object. 10217 saved = slice.call( arguments ); 10218 dataPriv.set( this, type, saved ); 10219 10220 // Trigger the native event and capture its result 10221 // Support: IE <=9 - 11+ 10222 // focus() and blur() are asynchronous 10223 notAsync = expectSync( this, type ); 10224 this[ type ](); 10225 result = dataPriv.get( this, type ); 10226 if ( saved !== result || notAsync ) { 10227 dataPriv.set( this, type, false ); 10228 } else { 10229 result = {}; 10230 } 10231 if ( saved !== result ) { 10232 10233 // Cancel the outer synthetic event 10234 event.stopImmediatePropagation(); 10235 event.preventDefault(); 10236 return result.value; 10237 } 10238 10239 // If this is an inner synthetic event for an event with a bubbling surrogate 10240 // (focus or blur), assume that the surrogate already propagated from triggering the 10241 // native event and prevent that from happening again here. 10242 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 10243 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 10244 // less bad than duplication. 10245 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 10246 event.stopPropagation(); 10247 } 10248 10249 // If this is a native event triggered above, everything is now in order 10250 // Fire an inner synthetic event with the original arguments 10251 } else if ( saved.length ) { 10252 10253 // ...and capture the result 10254 dataPriv.set( this, type, { 10255 value: jQuery.event.trigger( 10256 10257 // Support: IE <=9 - 11+ 10258 // Extend with the prototype to reset the above stopImmediatePropagation() 10259 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 10260 saved.slice( 1 ), 10261 this 10262 ) 10263 } ); 10264 10265 // Abort handling of the native event 10266 event.stopImmediatePropagation(); 10267 } 10268 } 10269 } ); 10270} 10271 10272jQuery.removeEvent = function( elem, type, handle ) { 10273 10274 // This "if" is needed for plain objects 10275 if ( elem.removeEventListener ) { 10276 elem.removeEventListener( type, handle ); 10277 } 10278}; 10279 10280jQuery.Event = function( src, props ) { 10281 10282 // Allow instantiation without the 'new' keyword 10283 if ( !( this instanceof jQuery.Event ) ) { 10284 return new jQuery.Event( src, props ); 10285 } 10286 10287 // Event object 10288 if ( src && src.type ) { 10289 this.originalEvent = src; 10290 this.type = src.type; 10291 10292 // Events bubbling up the document may have been marked as prevented 10293 // by a handler lower down the tree; reflect the correct value. 10294 this.isDefaultPrevented = src.defaultPrevented || 10295 src.defaultPrevented === undefined && 10296 10297 // Support: Android <=2.3 only 10298 src.returnValue === false ? 10299 returnTrue : 10300 returnFalse; 10301 10302 // Create target properties 10303 // Support: Safari <=6 - 7 only 10304 // Target should not be a text node (#504, #13143) 10305 this.target = ( src.target && src.target.nodeType === 3 ) ? 10306 src.target.parentNode : 10307 src.target; 10308 10309 this.currentTarget = src.currentTarget; 10310 this.relatedTarget = src.relatedTarget; 10311 10312 // Event type 10313 } else { 10314 this.type = src; 10315 } 10316 10317 // Put explicitly provided properties onto the event object 10318 if ( props ) { 10319 jQuery.extend( this, props ); 10320 } 10321 10322 // Create a timestamp if incoming event doesn't have one 10323 this.timeStamp = src && src.timeStamp || Date.now(); 10324 10325 // Mark it as fixed 10326 this[ jQuery.expando ] = true; 10327}; 10328 10329// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 10330// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 10331jQuery.Event.prototype = { 10332 constructor: jQuery.Event, 10333 isDefaultPrevented: returnFalse, 10334 isPropagationStopped: returnFalse, 10335 isImmediatePropagationStopped: returnFalse, 10336 isSimulated: false, 10337 10338 preventDefault: function() { 10339 var e = this.originalEvent; 10340 10341 this.isDefaultPrevented = returnTrue; 10342 10343 if ( e && !this.isSimulated ) { 10344 e.preventDefault(); 10345 } 10346 }, 10347 stopPropagation: function() { 10348 var e = this.originalEvent; 10349 10350 this.isPropagationStopped = returnTrue; 10351 10352 if ( e && !this.isSimulated ) { 10353 e.stopPropagation(); 10354 } 10355 }, 10356 stopImmediatePropagation: function() { 10357 var e = this.originalEvent; 10358 10359 this.isImmediatePropagationStopped = returnTrue; 10360 10361 if ( e && !this.isSimulated ) { 10362 e.stopImmediatePropagation(); 10363 } 10364 10365 this.stopPropagation(); 10366 } 10367}; 10368 10369// Includes all common event props including KeyEvent and MouseEvent specific props 10370jQuery.each( { 10371 altKey: true, 10372 bubbles: true, 10373 cancelable: true, 10374 changedTouches: true, 10375 ctrlKey: true, 10376 detail: true, 10377 eventPhase: true, 10378 metaKey: true, 10379 pageX: true, 10380 pageY: true, 10381 shiftKey: true, 10382 view: true, 10383 "char": true, 10384 code: true, 10385 charCode: true, 10386 key: true, 10387 keyCode: true, 10388 button: true, 10389 buttons: true, 10390 clientX: true, 10391 clientY: true, 10392 offsetX: true, 10393 offsetY: true, 10394 pointerId: true, 10395 pointerType: true, 10396 screenX: true, 10397 screenY: true, 10398 targetTouches: true, 10399 toElement: true, 10400 touches: true, 10401 10402 which: function( event ) { 10403 var button = event.button; 10404 10405 // Add which for key events 10406 if ( event.which == null && rkeyEvent.test( event.type ) ) { 10407 return event.charCode != null ? event.charCode : event.keyCode; 10408 } 10409 10410 // Add which for click: 1 === left; 2 === middle; 3 === right 10411 if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { 10412 if ( button & 1 ) { 10413 return 1; 10414 } 10415 10416 if ( button & 2 ) { 10417 return 3; 10418 } 10419 10420 if ( button & 4 ) { 10421 return 2; 10422 } 10423 10424 return 0; 10425 } 10426 10427 return event.which; 10428 } 10429}, jQuery.event.addProp ); 10430 10431jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 10432 jQuery.event.special[ type ] = { 10433 10434 // Utilize native event if possible so blur/focus sequence is correct 10435 setup: function() { 10436 10437 // Claim the first handler 10438 // dataPriv.set( this, "focus", ... ) 10439 // dataPriv.set( this, "blur", ... ) 10440 leverageNative( this, type, expectSync ); 10441 10442 // Return false to allow normal processing in the caller 10443 return false; 10444 }, 10445 trigger: function() { 10446 10447 // Force setup before trigger 10448 leverageNative( this, type ); 10449 10450 // Return non-false to allow normal event-path propagation 10451 return true; 10452 }, 10453 10454 delegateType: delegateType 10455 }; 10456} ); 10457 10458// Create mouseenter/leave events using mouseover/out and event-time checks 10459// so that event delegation works in jQuery. 10460// Do the same for pointerenter/pointerleave and pointerover/pointerout 10461// 10462// Support: Safari 7 only 10463// Safari sends mouseenter too often; see: 10464// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 10465// for the description of the bug (it existed in older Chrome versions as well). 10466jQuery.each( { 10467 mouseenter: "mouseover", 10468 mouseleave: "mouseout", 10469 pointerenter: "pointerover", 10470 pointerleave: "pointerout" 10471}, function( orig, fix ) { 10472 jQuery.event.special[ orig ] = { 10473 delegateType: fix, 10474 bindType: fix, 10475 10476 handle: function( event ) { 10477 var ret, 10478 target = this, 10479 related = event.relatedTarget, 10480 handleObj = event.handleObj; 10481 10482 // For mouseenter/leave call the handler if related is outside the target. 10483 // NB: No relatedTarget if the mouse left/entered the browser window 10484 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 10485 event.type = handleObj.origType; 10486 ret = handleObj.handler.apply( this, arguments ); 10487 event.type = fix; 10488 } 10489 return ret; 10490 } 10491 }; 10492} ); 10493 10494jQuery.fn.extend( { 10495 10496 on: function( types, selector, data, fn ) { 10497 return on( this, types, selector, data, fn ); 10498 }, 10499 one: function( types, selector, data, fn ) { 10500 return on( this, types, selector, data, fn, 1 ); 10501 }, 10502 off: function( types, selector, fn ) { 10503 var handleObj, type; 10504 if ( types && types.preventDefault && types.handleObj ) { 10505 10506 // ( event ) dispatched jQuery.Event 10507 handleObj = types.handleObj; 10508 jQuery( types.delegateTarget ).off( 10509 handleObj.namespace ? 10510 handleObj.origType + "." + handleObj.namespace : 10511 handleObj.origType, 10512 handleObj.selector, 10513 handleObj.handler 10514 ); 10515 return this; 10516 } 10517 if ( typeof types === "object" ) { 10518 10519 // ( types-object [, selector] ) 10520 for ( type in types ) { 10521 this.off( type, selector, types[ type ] ); 10522 } 10523 return this; 10524 } 10525 if ( selector === false || typeof selector === "function" ) { 10526 10527 // ( types [, fn] ) 10528 fn = selector; 10529 selector = undefined; 10530 } 10531 if ( fn === false ) { 10532 fn = returnFalse; 10533 } 10534 return this.each( function() { 10535 jQuery.event.remove( this, types, fn, selector ); 10536 } ); 10537 } 10538} ); 10539 10540 10541var 10542 10543 // Support: IE <=10 - 11, Edge 12 - 13 only 10544 // In IE/Edge using regex groups here causes severe slowdowns. 10545 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 10546 rnoInnerhtml = /<script|<style|<link/i, 10547 10548 // checked="checked" or checked 10549 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 10550 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 10551 10552// Prefer a tbody over its parent table for containing new rows 10553function manipulationTarget( elem, content ) { 10554 if ( nodeName( elem, "table" ) && 10555 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 10556 10557 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 10558 } 10559 10560 return elem; 10561} 10562 10563// Replace/restore the type attribute of script elements for safe DOM manipulation 10564function disableScript( elem ) { 10565 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 10566 return elem; 10567} 10568function restoreScript( elem ) { 10569 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 10570 elem.type = elem.type.slice( 5 ); 10571 } else { 10572 elem.removeAttribute( "type" ); 10573 } 10574 10575 return elem; 10576} 10577 10578function cloneCopyEvent( src, dest ) { 10579 var i, l, type, pdataOld, udataOld, udataCur, events; 10580 10581 if ( dest.nodeType !== 1 ) { 10582 return; 10583 } 10584 10585 // 1. Copy private data: events, handlers, etc. 10586 if ( dataPriv.hasData( src ) ) { 10587 pdataOld = dataPriv.get( src ); 10588 events = pdataOld.events; 10589 10590 if ( events ) { 10591 dataPriv.remove( dest, "handle events" ); 10592 10593 for ( type in events ) { 10594 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 10595 jQuery.event.add( dest, type, events[ type ][ i ] ); 10596 } 10597 } 10598 } 10599 } 10600 10601 // 2. Copy user data 10602 if ( dataUser.hasData( src ) ) { 10603 udataOld = dataUser.access( src ); 10604 udataCur = jQuery.extend( {}, udataOld ); 10605 10606 dataUser.set( dest, udataCur ); 10607 } 10608} 10609 10610// Fix IE bugs, see support tests 10611function fixInput( src, dest ) { 10612 var nodeName = dest.nodeName.toLowerCase(); 10613 10614 // Fails to persist the checked state of a cloned checkbox or radio button. 10615 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 10616 dest.checked = src.checked; 10617 10618 // Fails to return the selected option to the default selected state when cloning options 10619 } else if ( nodeName === "input" || nodeName === "textarea" ) { 10620 dest.defaultValue = src.defaultValue; 10621 } 10622} 10623 10624function domManip( collection, args, callback, ignored ) { 10625 10626 // Flatten any nested arrays 10627 args = flat( args ); 10628 10629 var fragment, first, scripts, hasScripts, node, doc, 10630 i = 0, 10631 l = collection.length, 10632 iNoClone = l - 1, 10633 value = args[ 0 ], 10634 valueIsFunction = isFunction( value ); 10635 10636 // We can't cloneNode fragments that contain checked, in WebKit 10637 if ( valueIsFunction || 10638 ( l > 1 && typeof value === "string" && 10639 !support.checkClone && rchecked.test( value ) ) ) { 10640 return collection.each( function( index ) { 10641 var self = collection.eq( index ); 10642 if ( valueIsFunction ) { 10643 args[ 0 ] = value.call( this, index, self.html() ); 10644 } 10645 domManip( self, args, callback, ignored ); 10646 } ); 10647 } 10648 10649 if ( l ) { 10650 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 10651 first = fragment.firstChild; 10652 10653 if ( fragment.childNodes.length === 1 ) { 10654 fragment = first; 10655 } 10656 10657 // Require either new content or an interest in ignored elements to invoke the callback 10658 if ( first || ignored ) { 10659 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 10660 hasScripts = scripts.length; 10661 10662 // Use the original fragment for the last item 10663 // instead of the first because it can end up 10664 // being emptied incorrectly in certain situations (#8070). 10665 for ( ; i < l; i++ ) { 10666 node = fragment; 10667 10668 if ( i !== iNoClone ) { 10669 node = jQuery.clone( node, true, true ); 10670 10671 // Keep references to cloned scripts for later restoration 10672 if ( hasScripts ) { 10673 10674 // Support: Android <=4.0 only, PhantomJS 1 only 10675 // push.apply(_, arraylike) throws on ancient WebKit 10676 jQuery.merge( scripts, getAll( node, "script" ) ); 10677 } 10678 } 10679 10680 callback.call( collection[ i ], node, i ); 10681 } 10682 10683 if ( hasScripts ) { 10684 doc = scripts[ scripts.length - 1 ].ownerDocument; 10685 10686 // Reenable scripts 10687 jQuery.map( scripts, restoreScript ); 10688 10689 // Evaluate executable scripts on first document insertion 10690 for ( i = 0; i < hasScripts; i++ ) { 10691 node = scripts[ i ]; 10692 if ( rscriptType.test( node.type || "" ) && 10693 !dataPriv.access( node, "globalEval" ) && 10694 jQuery.contains( doc, node ) ) { 10695 10696 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 10697 10698 // Optional AJAX dependency, but won't run scripts if not present 10699 if ( jQuery._evalUrl && !node.noModule ) { 10700 jQuery._evalUrl( node.src, { 10701 nonce: node.nonce || node.getAttribute( "nonce" ) 10702 }, doc ); 10703 } 10704 } else { 10705 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 10706 } 10707 } 10708 } 10709 } 10710 } 10711 } 10712 10713 return collection; 10714} 10715 10716function remove( elem, selector, keepData ) { 10717 var node, 10718 nodes = selector ? jQuery.filter( selector, elem ) : elem, 10719 i = 0; 10720 10721 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 10722 if ( !keepData && node.nodeType === 1 ) { 10723 jQuery.cleanData( getAll( node ) ); 10724 } 10725 10726 if ( node.parentNode ) { 10727 if ( keepData && isAttached( node ) ) { 10728 setGlobalEval( getAll( node, "script" ) ); 10729 } 10730 node.parentNode.removeChild( node ); 10731 } 10732 } 10733 10734 return elem; 10735} 10736 10737jQuery.extend( { 10738 htmlPrefilter: function( html ) { 10739 return html; 10740 }, 10741 10742 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 10743 var i, l, srcElements, destElements, 10744 clone = elem.cloneNode( true ), 10745 inPage = isAttached( elem ); 10746 10747 // Fix IE cloning issues 10748 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 10749 !jQuery.isXMLDoc( elem ) ) { 10750 10751 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 10752 destElements = getAll( clone ); 10753 srcElements = getAll( elem ); 10754 10755 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10756 fixInput( srcElements[ i ], destElements[ i ] ); 10757 } 10758 } 10759 10760 // Copy the events from the original to the clone 10761 if ( dataAndEvents ) { 10762 if ( deepDataAndEvents ) { 10763 srcElements = srcElements || getAll( elem ); 10764 destElements = destElements || getAll( clone ); 10765 10766 for ( i = 0, l = srcElements.length; i < l; i++ ) { 10767 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 10768 } 10769 } else { 10770 cloneCopyEvent( elem, clone ); 10771 } 10772 } 10773 10774 // Preserve script evaluation history 10775 destElements = getAll( clone, "script" ); 10776 if ( destElements.length > 0 ) { 10777 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 10778 } 10779 10780 // Return the cloned set 10781 return clone; 10782 }, 10783 10784 cleanData: function( elems ) { 10785 var data, elem, type, 10786 special = jQuery.event.special, 10787 i = 0; 10788 10789 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 10790 if ( acceptData( elem ) ) { 10791 if ( ( data = elem[ dataPriv.expando ] ) ) { 10792 if ( data.events ) { 10793 for ( type in data.events ) { 10794 if ( special[ type ] ) { 10795 jQuery.event.remove( elem, type ); 10796 10797 // This is a shortcut to avoid jQuery.event.remove's overhead 10798 } else { 10799 jQuery.removeEvent( elem, type, data.handle ); 10800 } 10801 } 10802 } 10803 10804 // Support: Chrome <=35 - 45+ 10805 // Assign undefined instead of using delete, see Data#remove 10806 elem[ dataPriv.expando ] = undefined; 10807 } 10808 if ( elem[ dataUser.expando ] ) { 10809 10810 // Support: Chrome <=35 - 45+ 10811 // Assign undefined instead of using delete, see Data#remove 10812 elem[ dataUser.expando ] = undefined; 10813 } 10814 } 10815 } 10816 } 10817} ); 10818 10819jQuery.fn.extend( { 10820 detach: function( selector ) { 10821 return remove( this, selector, true ); 10822 }, 10823 10824 remove: function( selector ) { 10825 return remove( this, selector ); 10826 }, 10827 10828 text: function( value ) { 10829 return access( this, function( value ) { 10830 return value === undefined ? 10831 jQuery.text( this ) : 10832 this.empty().each( function() { 10833 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10834 this.textContent = value; 10835 } 10836 } ); 10837 }, null, value, arguments.length ); 10838 }, 10839 10840 append: function() { 10841 return domManip( this, arguments, function( elem ) { 10842 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10843 var target = manipulationTarget( this, elem ); 10844 target.appendChild( elem ); 10845 } 10846 } ); 10847 }, 10848 10849 prepend: function() { 10850 return domManip( this, arguments, function( elem ) { 10851 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 10852 var target = manipulationTarget( this, elem ); 10853 target.insertBefore( elem, target.firstChild ); 10854 } 10855 } ); 10856 }, 10857 10858 before: function() { 10859 return domManip( this, arguments, function( elem ) { 10860 if ( this.parentNode ) { 10861 this.parentNode.insertBefore( elem, this ); 10862 } 10863 } ); 10864 }, 10865 10866 after: function() { 10867 return domManip( this, arguments, function( elem ) { 10868 if ( this.parentNode ) { 10869 this.parentNode.insertBefore( elem, this.nextSibling ); 10870 } 10871 } ); 10872 }, 10873 10874 empty: function() { 10875 var elem, 10876 i = 0; 10877 10878 for ( ; ( elem = this[ i ] ) != null; i++ ) { 10879 if ( elem.nodeType === 1 ) { 10880 10881 // Prevent memory leaks 10882 jQuery.cleanData( getAll( elem, false ) ); 10883 10884 // Remove any remaining nodes 10885 elem.textContent = ""; 10886 } 10887 } 10888 10889 return this; 10890 }, 10891 10892 clone: function( dataAndEvents, deepDataAndEvents ) { 10893 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 10894 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 10895 10896 return this.map( function() { 10897 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 10898 } ); 10899 }, 10900 10901 html: function( value ) { 10902 return access( this, function( value ) { 10903 var elem = this[ 0 ] || {}, 10904 i = 0, 10905 l = this.length; 10906 10907 if ( value === undefined && elem.nodeType === 1 ) { 10908 return elem.innerHTML; 10909 } 10910 10911 // See if we can take a shortcut and just use innerHTML 10912 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 10913 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 10914 10915 value = jQuery.htmlPrefilter( value ); 10916 10917 try { 10918 for ( ; i < l; i++ ) { 10919 elem = this[ i ] || {}; 10920 10921 // Remove element nodes and prevent memory leaks 10922 if ( elem.nodeType === 1 ) { 10923 jQuery.cleanData( getAll( elem, false ) ); 10924 elem.innerHTML = value; 10925 } 10926 } 10927 10928 elem = 0; 10929 10930 // If using innerHTML throws an exception, use the fallback method 10931 } catch ( e ) {} 10932 } 10933 10934 if ( elem ) { 10935 this.empty().append( value ); 10936 } 10937 }, null, value, arguments.length ); 10938 }, 10939 10940 replaceWith: function() { 10941 var ignored = []; 10942 10943 // Make the changes, replacing each non-ignored context element with the new content 10944 return domManip( this, arguments, function( elem ) { 10945 var parent = this.parentNode; 10946 10947 if ( jQuery.inArray( this, ignored ) < 0 ) { 10948 jQuery.cleanData( getAll( this ) ); 10949 if ( parent ) { 10950 parent.replaceChild( elem, this ); 10951 } 10952 } 10953 10954 // Force callback invocation 10955 }, ignored ); 10956 } 10957} ); 10958 10959jQuery.each( { 10960 appendTo: "append", 10961 prependTo: "prepend", 10962 insertBefore: "before", 10963 insertAfter: "after", 10964 replaceAll: "replaceWith" 10965}, function( name, original ) { 10966 jQuery.fn[ name ] = function( selector ) { 10967 var elems, 10968 ret = [], 10969 insert = jQuery( selector ), 10970 last = insert.length - 1, 10971 i = 0; 10972 10973 for ( ; i <= last; i++ ) { 10974 elems = i === last ? this : this.clone( true ); 10975 jQuery( insert[ i ] )[ original ]( elems ); 10976 10977 // Support: Android <=4.0 only, PhantomJS 1 only 10978 // .get() because push.apply(_, arraylike) throws on ancient WebKit 10979 push.apply( ret, elems.get() ); 10980 } 10981 10982 return this.pushStack( ret ); 10983 }; 10984} ); 10985var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 10986 10987var getStyles = function( elem ) { 10988 10989 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 10990 // IE throws on elements created in popups 10991 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 10992 var view = elem.ownerDocument.defaultView; 10993 10994 if ( !view || !view.opener ) { 10995 view = window; 10996 } 10997 10998 return view.getComputedStyle( elem ); 10999 }; 11000 11001var swap = function( elem, options, callback ) { 11002 var ret, name, 11003 old = {}; 11004 11005 // Remember the old values, and insert the new ones 11006 for ( name in options ) { 11007 old[ name ] = elem.style[ name ]; 11008 elem.style[ name ] = options[ name ]; 11009 } 11010 11011 ret = callback.call( elem ); 11012 11013 // Revert the old values 11014 for ( name in options ) { 11015 elem.style[ name ] = old[ name ]; 11016 } 11017 11018 return ret; 11019}; 11020 11021 11022var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 11023 11024 11025 11026( function() { 11027 11028 // Executing both pixelPosition & boxSizingReliable tests require only one layout 11029 // so they're executed at the same time to save the second computation. 11030 function computeStyleTests() { 11031 11032 // This is a singleton, we need to execute it only once 11033 if ( !div ) { 11034 return; 11035 } 11036 11037 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 11038 "margin-top:1px;padding:0;border:0"; 11039 div.style.cssText = 11040 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 11041 "margin:auto;border:1px;padding:1px;" + 11042 "width:60%;top:1%"; 11043 documentElement.appendChild( container ).appendChild( div ); 11044 11045 var divStyle = window.getComputedStyle( div ); 11046 pixelPositionVal = divStyle.top !== "1%"; 11047 11048 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 11049 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 11050 11051 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 11052 // Some styles come back with percentage values, even though they shouldn't 11053 div.style.right = "60%"; 11054 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 11055 11056 // Support: IE 9 - 11 only 11057 // Detect misreporting of content dimensions for box-sizing:border-box elements 11058 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 11059 11060 // Support: IE 9 only 11061 // Detect overflow:scroll screwiness (gh-3699) 11062 // Support: Chrome <=64 11063 // Don't get tricked when zoom affects offsetWidth (gh-4029) 11064 div.style.position = "absolute"; 11065 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 11066 11067 documentElement.removeChild( container ); 11068 11069 // Nullify the div so it wouldn't be stored in the memory and 11070 // it will also be a sign that checks already performed 11071 div = null; 11072 } 11073 11074 function roundPixelMeasures( measure ) { 11075 return Math.round( parseFloat( measure ) ); 11076 } 11077 11078 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 11079 reliableTrDimensionsVal, reliableMarginLeftVal, 11080 container = document.createElement( "div" ), 11081 div = document.createElement( "div" ); 11082 11083 // Finish early in limited (non-browser) environments 11084 if ( !div.style ) { 11085 return; 11086 } 11087 11088 // Support: IE <=9 - 11 only 11089 // Style of cloned element affects source element cloned (#8908) 11090 div.style.backgroundClip = "content-box"; 11091 div.cloneNode( true ).style.backgroundClip = ""; 11092 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 11093 11094 jQuery.extend( support, { 11095 boxSizingReliable: function() { 11096 computeStyleTests(); 11097 return boxSizingReliableVal; 11098 }, 11099 pixelBoxStyles: function() { 11100 computeStyleTests(); 11101 return pixelBoxStylesVal; 11102 }, 11103 pixelPosition: function() { 11104 computeStyleTests(); 11105 return pixelPositionVal; 11106 }, 11107 reliableMarginLeft: function() { 11108 computeStyleTests(); 11109 return reliableMarginLeftVal; 11110 }, 11111 scrollboxSize: function() { 11112 computeStyleTests(); 11113 return scrollboxSizeVal; 11114 }, 11115 11116 // Support: IE 9 - 11+, Edge 15 - 18+ 11117 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11118 // set in CSS while `offset*` properties report correct values. 11119 // Behavior in IE 9 is more subtle than in newer versions & it passes 11120 // some versions of this test; make sure not to make it pass there! 11121 reliableTrDimensions: function() { 11122 var table, tr, trChild, trStyle; 11123 if ( reliableTrDimensionsVal == null ) { 11124 table = document.createElement( "table" ); 11125 tr = document.createElement( "tr" ); 11126 trChild = document.createElement( "div" ); 11127 11128 table.style.cssText = "position:absolute;left:-11111px"; 11129 tr.style.height = "1px"; 11130 trChild.style.height = "9px"; 11131 11132 documentElement 11133 .appendChild( table ) 11134 .appendChild( tr ) 11135 .appendChild( trChild ); 11136 11137 trStyle = window.getComputedStyle( tr ); 11138 reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; 11139 11140 documentElement.removeChild( table ); 11141 } 11142 return reliableTrDimensionsVal; 11143 } 11144 } ); 11145} )(); 11146 11147 11148function curCSS( elem, name, computed ) { 11149 var width, minWidth, maxWidth, ret, 11150 11151 // Support: Firefox 51+ 11152 // Retrieving style before computed somehow 11153 // fixes an issue with getting wrong values 11154 // on detached elements 11155 style = elem.style; 11156 11157 computed = computed || getStyles( elem ); 11158 11159 // getPropertyValue is needed for: 11160 // .css('filter') (IE 9 only, #12537) 11161 // .css('--customProperty) (#3144) 11162 if ( computed ) { 11163 ret = computed.getPropertyValue( name ) || computed[ name ]; 11164 11165 if ( ret === "" && !isAttached( elem ) ) { 11166 ret = jQuery.style( elem, name ); 11167 } 11168 11169 // A tribute to the "awesome hack by Dean Edwards" 11170 // Android Browser returns percentage for some values, 11171 // but width seems to be reliably pixels. 11172 // This is against the CSSOM draft spec: 11173 // https://drafts.csswg.org/cssom/#resolved-values 11174 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 11175 11176 // Remember the original values 11177 width = style.width; 11178 minWidth = style.minWidth; 11179 maxWidth = style.maxWidth; 11180 11181 // Put in the new values to get a computed value out 11182 style.minWidth = style.maxWidth = style.width = ret; 11183 ret = computed.width; 11184 11185 // Revert the changed values 11186 style.width = width; 11187 style.minWidth = minWidth; 11188 style.maxWidth = maxWidth; 11189 } 11190 } 11191 11192 return ret !== undefined ? 11193 11194 // Support: IE <=9 - 11 only 11195 // IE returns zIndex value as an integer. 11196 ret + "" : 11197 ret; 11198} 11199 11200 11201function addGetHookIf( conditionFn, hookFn ) { 11202 11203 // Define the hook, we'll check on the first run if it's really needed. 11204 return { 11205 get: function() { 11206 if ( conditionFn() ) { 11207 11208 // Hook not needed (or it's not possible to use it due 11209 // to missing dependency), remove it. 11210 delete this.get; 11211 return; 11212 } 11213 11214 // Hook needed; redefine it so that the support test is not executed again. 11215 return ( this.get = hookFn ).apply( this, arguments ); 11216 } 11217 }; 11218} 11219 11220 11221var cssPrefixes = [ "Webkit", "Moz", "ms" ], 11222 emptyStyle = document.createElement( "div" ).style, 11223 vendorProps = {}; 11224 11225// Return a vendor-prefixed property or undefined 11226function vendorPropName( name ) { 11227 11228 // Check for vendor prefixed names 11229 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 11230 i = cssPrefixes.length; 11231 11232 while ( i-- ) { 11233 name = cssPrefixes[ i ] + capName; 11234 if ( name in emptyStyle ) { 11235 return name; 11236 } 11237 } 11238} 11239 11240// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 11241function finalPropName( name ) { 11242 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 11243 11244 if ( final ) { 11245 return final; 11246 } 11247 if ( name in emptyStyle ) { 11248 return name; 11249 } 11250 return vendorProps[ name ] = vendorPropName( name ) || name; 11251} 11252 11253 11254var 11255 11256 // Swappable if display is none or starts with table 11257 // except "table", "table-cell", or "table-caption" 11258 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 11259 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 11260 rcustomProp = /^--/, 11261 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 11262 cssNormalTransform = { 11263 letterSpacing: "0", 11264 fontWeight: "400" 11265 }; 11266 11267function setPositiveNumber( _elem, value, subtract ) { 11268 11269 // Any relative (+/-) values have already been 11270 // normalized at this point 11271 var matches = rcssNum.exec( value ); 11272 return matches ? 11273 11274 // Guard against undefined "subtract", e.g., when used as in cssHooks 11275 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 11276 value; 11277} 11278 11279function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 11280 var i = dimension === "width" ? 1 : 0, 11281 extra = 0, 11282 delta = 0; 11283 11284 // Adjustment may not be necessary 11285 if ( box === ( isBorderBox ? "border" : "content" ) ) { 11286 return 0; 11287 } 11288 11289 for ( ; i < 4; i += 2 ) { 11290 11291 // Both box models exclude margin 11292 if ( box === "margin" ) { 11293 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 11294 } 11295 11296 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 11297 if ( !isBorderBox ) { 11298 11299 // Add padding 11300 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11301 11302 // For "border" or "margin", add border 11303 if ( box !== "padding" ) { 11304 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11305 11306 // But still keep track of it otherwise 11307 } else { 11308 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11309 } 11310 11311 // If we get here with a border-box (content + padding + border), we're seeking "content" or 11312 // "padding" or "margin" 11313 } else { 11314 11315 // For "content", subtract padding 11316 if ( box === "content" ) { 11317 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 11318 } 11319 11320 // For "content" or "padding", subtract border 11321 if ( box !== "margin" ) { 11322 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 11323 } 11324 } 11325 } 11326 11327 // Account for positive content-box scroll gutter when requested by providing computedVal 11328 if ( !isBorderBox && computedVal >= 0 ) { 11329 11330 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 11331 // Assuming integer scroll gutter, subtract the rest and round down 11332 delta += Math.max( 0, Math.ceil( 11333 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11334 computedVal - 11335 delta - 11336 extra - 11337 0.5 11338 11339 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 11340 // Use an explicit zero to avoid NaN (gh-3964) 11341 ) ) || 0; 11342 } 11343 11344 return delta; 11345} 11346 11347function getWidthOrHeight( elem, dimension, extra ) { 11348 11349 // Start with computed style 11350 var styles = getStyles( elem ), 11351 11352 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 11353 // Fake content-box until we know it's needed to know the true value. 11354 boxSizingNeeded = !support.boxSizingReliable() || extra, 11355 isBorderBox = boxSizingNeeded && 11356 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11357 valueIsBorderBox = isBorderBox, 11358 11359 val = curCSS( elem, dimension, styles ), 11360 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 11361 11362 // Support: Firefox <=54 11363 // Return a confounding non-pixel value or feign ignorance, as appropriate. 11364 if ( rnumnonpx.test( val ) ) { 11365 if ( !extra ) { 11366 return val; 11367 } 11368 val = "auto"; 11369 } 11370 11371 11372 // Support: IE 9 - 11 only 11373 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 11374 // In those cases, the computed value can be trusted to be border-box. 11375 if ( ( !support.boxSizingReliable() && isBorderBox || 11376 11377 // Support: IE 10 - 11+, Edge 15 - 18+ 11378 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11379 // set in CSS while `offset*` properties report correct values. 11380 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 11381 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 11382 11383 // Fall back to offsetWidth/offsetHeight when value is "auto" 11384 // This happens for inline elements with no explicit setting (gh-3571) 11385 val === "auto" || 11386 11387 // Support: Android <=4.1 - 4.3 only 11388 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 11389 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 11390 11391 // Make sure the element is visible & connected 11392 elem.getClientRects().length ) { 11393 11394 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 11395 11396 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 11397 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 11398 // retrieved value as a content box dimension. 11399 valueIsBorderBox = offsetProp in elem; 11400 if ( valueIsBorderBox ) { 11401 val = elem[ offsetProp ]; 11402 } 11403 } 11404 11405 // Normalize "" and auto 11406 val = parseFloat( val ) || 0; 11407 11408 // Adjust for the element's box model 11409 return ( val + 11410 boxModelAdjustment( 11411 elem, 11412 dimension, 11413 extra || ( isBorderBox ? "border" : "content" ), 11414 valueIsBorderBox, 11415 styles, 11416 11417 // Provide the current computed size to request scroll gutter calculation (gh-3589) 11418 val 11419 ) 11420 ) + "px"; 11421} 11422 11423jQuery.extend( { 11424 11425 // Add in style property hooks for overriding the default 11426 // behavior of getting and setting a style property 11427 cssHooks: { 11428 opacity: { 11429 get: function( elem, computed ) { 11430 if ( computed ) { 11431 11432 // We should always get a number back from opacity 11433 var ret = curCSS( elem, "opacity" ); 11434 return ret === "" ? "1" : ret; 11435 } 11436 } 11437 } 11438 }, 11439 11440 // Don't automatically add "px" to these possibly-unitless properties 11441 cssNumber: { 11442 "animationIterationCount": true, 11443 "columnCount": true, 11444 "fillOpacity": true, 11445 "flexGrow": true, 11446 "flexShrink": true, 11447 "fontWeight": true, 11448 "gridArea": true, 11449 "gridColumn": true, 11450 "gridColumnEnd": true, 11451 "gridColumnStart": true, 11452 "gridRow": true, 11453 "gridRowEnd": true, 11454 "gridRowStart": true, 11455 "lineHeight": true, 11456 "opacity": true, 11457 "order": true, 11458 "orphans": true, 11459 "widows": true, 11460 "zIndex": true, 11461 "zoom": true 11462 }, 11463 11464 // Add in properties whose names you wish to fix before 11465 // setting or getting the value 11466 cssProps: {}, 11467 11468 // Get and set the style property on a DOM Node 11469 style: function( elem, name, value, extra ) { 11470 11471 // Don't set styles on text and comment nodes 11472 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 11473 return; 11474 } 11475 11476 // Make sure that we're working with the right name 11477 var ret, type, hooks, 11478 origName = camelCase( name ), 11479 isCustomProp = rcustomProp.test( name ), 11480 style = elem.style; 11481 11482 // Make sure that we're working with the right name. We don't 11483 // want to query the value if it is a CSS custom property 11484 // since they are user-defined. 11485 if ( !isCustomProp ) { 11486 name = finalPropName( origName ); 11487 } 11488 11489 // Gets hook for the prefixed version, then unprefixed version 11490 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11491 11492 // Check if we're setting a value 11493 if ( value !== undefined ) { 11494 type = typeof value; 11495 11496 // Convert "+=" or "-=" to relative numbers (#7345) 11497 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 11498 value = adjustCSS( elem, name, ret ); 11499 11500 // Fixes bug #9237 11501 type = "number"; 11502 } 11503 11504 // Make sure that null and NaN values aren't set (#7116) 11505 if ( value == null || value !== value ) { 11506 return; 11507 } 11508 11509 // If a number was passed in, add the unit (except for certain CSS properties) 11510 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 11511 // "px" to a few hardcoded values. 11512 if ( type === "number" && !isCustomProp ) { 11513 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 11514 } 11515 11516 // background-* props affect original clone's values 11517 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 11518 style[ name ] = "inherit"; 11519 } 11520 11521 // If a hook was provided, use that value, otherwise just set the specified value 11522 if ( !hooks || !( "set" in hooks ) || 11523 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 11524 11525 if ( isCustomProp ) { 11526 style.setProperty( name, value ); 11527 } else { 11528 style[ name ] = value; 11529 } 11530 } 11531 11532 } else { 11533 11534 // If a hook was provided get the non-computed value from there 11535 if ( hooks && "get" in hooks && 11536 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 11537 11538 return ret; 11539 } 11540 11541 // Otherwise just get the value from the style object 11542 return style[ name ]; 11543 } 11544 }, 11545 11546 css: function( elem, name, extra, styles ) { 11547 var val, num, hooks, 11548 origName = camelCase( name ), 11549 isCustomProp = rcustomProp.test( name ); 11550 11551 // Make sure that we're working with the right name. We don't 11552 // want to modify the value if it is a CSS custom property 11553 // since they are user-defined. 11554 if ( !isCustomProp ) { 11555 name = finalPropName( origName ); 11556 } 11557 11558 // Try prefixed name followed by the unprefixed name 11559 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 11560 11561 // If a hook was provided get the computed value from there 11562 if ( hooks && "get" in hooks ) { 11563 val = hooks.get( elem, true, extra ); 11564 } 11565 11566 // Otherwise, if a way to get the computed value exists, use that 11567 if ( val === undefined ) { 11568 val = curCSS( elem, name, styles ); 11569 } 11570 11571 // Convert "normal" to computed value 11572 if ( val === "normal" && name in cssNormalTransform ) { 11573 val = cssNormalTransform[ name ]; 11574 } 11575 11576 // Make numeric if forced or a qualifier was provided and val looks numeric 11577 if ( extra === "" || extra ) { 11578 num = parseFloat( val ); 11579 return extra === true || isFinite( num ) ? num || 0 : val; 11580 } 11581 11582 return val; 11583 } 11584} ); 11585 11586jQuery.each( [ "height", "width" ], function( _i, dimension ) { 11587 jQuery.cssHooks[ dimension ] = { 11588 get: function( elem, computed, extra ) { 11589 if ( computed ) { 11590 11591 // Certain elements can have dimension info if we invisibly show them 11592 // but it must have a current display style that would benefit 11593 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 11594 11595 // Support: Safari 8+ 11596 // Table columns in Safari have non-zero offsetWidth & zero 11597 // getBoundingClientRect().width unless display is changed. 11598 // Support: IE <=11 only 11599 // Running getBoundingClientRect on a disconnected node 11600 // in IE throws an error. 11601 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 11602 swap( elem, cssShow, function() { 11603 return getWidthOrHeight( elem, dimension, extra ); 11604 } ) : 11605 getWidthOrHeight( elem, dimension, extra ); 11606 } 11607 }, 11608 11609 set: function( elem, value, extra ) { 11610 var matches, 11611 styles = getStyles( elem ), 11612 11613 // Only read styles.position if the test has a chance to fail 11614 // to avoid forcing a reflow. 11615 scrollboxSizeBuggy = !support.scrollboxSize() && 11616 styles.position === "absolute", 11617 11618 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 11619 boxSizingNeeded = scrollboxSizeBuggy || extra, 11620 isBorderBox = boxSizingNeeded && 11621 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 11622 subtract = extra ? 11623 boxModelAdjustment( 11624 elem, 11625 dimension, 11626 extra, 11627 isBorderBox, 11628 styles 11629 ) : 11630 0; 11631 11632 // Account for unreliable border-box dimensions by comparing offset* to computed and 11633 // faking a content-box to get border and padding (gh-3699) 11634 if ( isBorderBox && scrollboxSizeBuggy ) { 11635 subtract -= Math.ceil( 11636 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 11637 parseFloat( styles[ dimension ] ) - 11638 boxModelAdjustment( elem, dimension, "border", false, styles ) - 11639 0.5 11640 ); 11641 } 11642 11643 // Convert to pixels if value adjustment is needed 11644 if ( subtract && ( matches = rcssNum.exec( value ) ) && 11645 ( matches[ 3 ] || "px" ) !== "px" ) { 11646 11647 elem.style[ dimension ] = value; 11648 value = jQuery.css( elem, dimension ); 11649 } 11650 11651 return setPositiveNumber( elem, value, subtract ); 11652 } 11653 }; 11654} ); 11655 11656jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 11657 function( elem, computed ) { 11658 if ( computed ) { 11659 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 11660 elem.getBoundingClientRect().left - 11661 swap( elem, { marginLeft: 0 }, function() { 11662 return elem.getBoundingClientRect().left; 11663 } ) 11664 ) + "px"; 11665 } 11666 } 11667); 11668 11669// These hooks are used by animate to expand properties 11670jQuery.each( { 11671 margin: "", 11672 padding: "", 11673 border: "Width" 11674}, function( prefix, suffix ) { 11675 jQuery.cssHooks[ prefix + suffix ] = { 11676 expand: function( value ) { 11677 var i = 0, 11678 expanded = {}, 11679 11680 // Assumes a single number if not a string 11681 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 11682 11683 for ( ; i < 4; i++ ) { 11684 expanded[ prefix + cssExpand[ i ] + suffix ] = 11685 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 11686 } 11687 11688 return expanded; 11689 } 11690 }; 11691 11692 if ( prefix !== "margin" ) { 11693 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 11694 } 11695} ); 11696 11697jQuery.fn.extend( { 11698 css: function( name, value ) { 11699 return access( this, function( elem, name, value ) { 11700 var styles, len, 11701 map = {}, 11702 i = 0; 11703 11704 if ( Array.isArray( name ) ) { 11705 styles = getStyles( elem ); 11706 len = name.length; 11707 11708 for ( ; i < len; i++ ) { 11709 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 11710 } 11711 11712 return map; 11713 } 11714 11715 return value !== undefined ? 11716 jQuery.style( elem, name, value ) : 11717 jQuery.css( elem, name ); 11718 }, name, value, arguments.length > 1 ); 11719 } 11720} ); 11721 11722 11723function Tween( elem, options, prop, end, easing ) { 11724 return new Tween.prototype.init( elem, options, prop, end, easing ); 11725} 11726jQuery.Tween = Tween; 11727 11728Tween.prototype = { 11729 constructor: Tween, 11730 init: function( elem, options, prop, end, easing, unit ) { 11731 this.elem = elem; 11732 this.prop = prop; 11733 this.easing = easing || jQuery.easing._default; 11734 this.options = options; 11735 this.start = this.now = this.cur(); 11736 this.end = end; 11737 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 11738 }, 11739 cur: function() { 11740 var hooks = Tween.propHooks[ this.prop ]; 11741 11742 return hooks && hooks.get ? 11743 hooks.get( this ) : 11744 Tween.propHooks._default.get( this ); 11745 }, 11746 run: function( percent ) { 11747 var eased, 11748 hooks = Tween.propHooks[ this.prop ]; 11749 11750 if ( this.options.duration ) { 11751 this.pos = eased = jQuery.easing[ this.easing ]( 11752 percent, this.options.duration * percent, 0, 1, this.options.duration 11753 ); 11754 } else { 11755 this.pos = eased = percent; 11756 } 11757 this.now = ( this.end - this.start ) * eased + this.start; 11758 11759 if ( this.options.step ) { 11760 this.options.step.call( this.elem, this.now, this ); 11761 } 11762 11763 if ( hooks && hooks.set ) { 11764 hooks.set( this ); 11765 } else { 11766 Tween.propHooks._default.set( this ); 11767 } 11768 return this; 11769 } 11770}; 11771 11772Tween.prototype.init.prototype = Tween.prototype; 11773 11774Tween.propHooks = { 11775 _default: { 11776 get: function( tween ) { 11777 var result; 11778 11779 // Use a property on the element directly when it is not a DOM element, 11780 // or when there is no matching style property that exists. 11781 if ( tween.elem.nodeType !== 1 || 11782 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 11783 return tween.elem[ tween.prop ]; 11784 } 11785 11786 // Passing an empty string as a 3rd parameter to .css will automatically 11787 // attempt a parseFloat and fallback to a string if the parse fails. 11788 // Simple values such as "10px" are parsed to Float; 11789 // complex values such as "rotate(1rad)" are returned as-is. 11790 result = jQuery.css( tween.elem, tween.prop, "" ); 11791 11792 // Empty strings, null, undefined and "auto" are converted to 0. 11793 return !result || result === "auto" ? 0 : result; 11794 }, 11795 set: function( tween ) { 11796 11797 // Use step hook for back compat. 11798 // Use cssHook if its there. 11799 // Use .style if available and use plain properties where available. 11800 if ( jQuery.fx.step[ tween.prop ] ) { 11801 jQuery.fx.step[ tween.prop ]( tween ); 11802 } else if ( tween.elem.nodeType === 1 && ( 11803 jQuery.cssHooks[ tween.prop ] || 11804 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 11805 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 11806 } else { 11807 tween.elem[ tween.prop ] = tween.now; 11808 } 11809 } 11810 } 11811}; 11812 11813// Support: IE <=9 only 11814// Panic based approach to setting things on disconnected nodes 11815Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 11816 set: function( tween ) { 11817 if ( tween.elem.nodeType && tween.elem.parentNode ) { 11818 tween.elem[ tween.prop ] = tween.now; 11819 } 11820 } 11821}; 11822 11823jQuery.easing = { 11824 linear: function( p ) { 11825 return p; 11826 }, 11827 swing: function( p ) { 11828 return 0.5 - Math.cos( p * Math.PI ) / 2; 11829 }, 11830 _default: "swing" 11831}; 11832 11833jQuery.fx = Tween.prototype.init; 11834 11835// Back compat <1.8 extension point 11836jQuery.fx.step = {}; 11837 11838 11839 11840 11841var 11842 fxNow, inProgress, 11843 rfxtypes = /^(?:toggle|show|hide)$/, 11844 rrun = /queueHooks$/; 11845 11846function schedule() { 11847 if ( inProgress ) { 11848 if ( document.hidden === false && window.requestAnimationFrame ) { 11849 window.requestAnimationFrame( schedule ); 11850 } else { 11851 window.setTimeout( schedule, jQuery.fx.interval ); 11852 } 11853 11854 jQuery.fx.tick(); 11855 } 11856} 11857 11858// Animations created synchronously will run synchronously 11859function createFxNow() { 11860 window.setTimeout( function() { 11861 fxNow = undefined; 11862 } ); 11863 return ( fxNow = Date.now() ); 11864} 11865 11866// Generate parameters to create a standard animation 11867function genFx( type, includeWidth ) { 11868 var which, 11869 i = 0, 11870 attrs = { height: type }; 11871 11872 // If we include width, step value is 1 to do all cssExpand values, 11873 // otherwise step value is 2 to skip over Left and Right 11874 includeWidth = includeWidth ? 1 : 0; 11875 for ( ; i < 4; i += 2 - includeWidth ) { 11876 which = cssExpand[ i ]; 11877 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 11878 } 11879 11880 if ( includeWidth ) { 11881 attrs.opacity = attrs.width = type; 11882 } 11883 11884 return attrs; 11885} 11886 11887function createTween( value, prop, animation ) { 11888 var tween, 11889 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 11890 index = 0, 11891 length = collection.length; 11892 for ( ; index < length; index++ ) { 11893 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 11894 11895 // We're done with this property 11896 return tween; 11897 } 11898 } 11899} 11900 11901function defaultPrefilter( elem, props, opts ) { 11902 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 11903 isBox = "width" in props || "height" in props, 11904 anim = this, 11905 orig = {}, 11906 style = elem.style, 11907 hidden = elem.nodeType && isHiddenWithinTree( elem ), 11908 dataShow = dataPriv.get( elem, "fxshow" ); 11909 11910 // Queue-skipping animations hijack the fx hooks 11911 if ( !opts.queue ) { 11912 hooks = jQuery._queueHooks( elem, "fx" ); 11913 if ( hooks.unqueued == null ) { 11914 hooks.unqueued = 0; 11915 oldfire = hooks.empty.fire; 11916 hooks.empty.fire = function() { 11917 if ( !hooks.unqueued ) { 11918 oldfire(); 11919 } 11920 }; 11921 } 11922 hooks.unqueued++; 11923 11924 anim.always( function() { 11925 11926 // Ensure the complete handler is called before this completes 11927 anim.always( function() { 11928 hooks.unqueued--; 11929 if ( !jQuery.queue( elem, "fx" ).length ) { 11930 hooks.empty.fire(); 11931 } 11932 } ); 11933 } ); 11934 } 11935 11936 // Detect show/hide animations 11937 for ( prop in props ) { 11938 value = props[ prop ]; 11939 if ( rfxtypes.test( value ) ) { 11940 delete props[ prop ]; 11941 toggle = toggle || value === "toggle"; 11942 if ( value === ( hidden ? "hide" : "show" ) ) { 11943 11944 // Pretend to be hidden if this is a "show" and 11945 // there is still data from a stopped show/hide 11946 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 11947 hidden = true; 11948 11949 // Ignore all other no-op show/hide data 11950 } else { 11951 continue; 11952 } 11953 } 11954 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 11955 } 11956 } 11957 11958 // Bail out if this is a no-op like .hide().hide() 11959 propTween = !jQuery.isEmptyObject( props ); 11960 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 11961 return; 11962 } 11963 11964 // Restrict "overflow" and "display" styles during box animations 11965 if ( isBox && elem.nodeType === 1 ) { 11966 11967 // Support: IE <=9 - 11, Edge 12 - 15 11968 // Record all 3 overflow attributes because IE does not infer the shorthand 11969 // from identically-valued overflowX and overflowY and Edge just mirrors 11970 // the overflowX value there. 11971 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 11972 11973 // Identify a display type, preferring old show/hide data over the CSS cascade 11974 restoreDisplay = dataShow && dataShow.display; 11975 if ( restoreDisplay == null ) { 11976 restoreDisplay = dataPriv.get( elem, "display" ); 11977 } 11978 display = jQuery.css( elem, "display" ); 11979 if ( display === "none" ) { 11980 if ( restoreDisplay ) { 11981 display = restoreDisplay; 11982 } else { 11983 11984 // Get nonempty value(s) by temporarily forcing visibility 11985 showHide( [ elem ], true ); 11986 restoreDisplay = elem.style.display || restoreDisplay; 11987 display = jQuery.css( elem, "display" ); 11988 showHide( [ elem ] ); 11989 } 11990 } 11991 11992 // Animate inline elements as inline-block 11993 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 11994 if ( jQuery.css( elem, "float" ) === "none" ) { 11995 11996 // Restore the original display value at the end of pure show/hide animations 11997 if ( !propTween ) { 11998 anim.done( function() { 11999 style.display = restoreDisplay; 12000 } ); 12001 if ( restoreDisplay == null ) { 12002 display = style.display; 12003 restoreDisplay = display === "none" ? "" : display; 12004 } 12005 } 12006 style.display = "inline-block"; 12007 } 12008 } 12009 } 12010 12011 if ( opts.overflow ) { 12012 style.overflow = "hidden"; 12013 anim.always( function() { 12014 style.overflow = opts.overflow[ 0 ]; 12015 style.overflowX = opts.overflow[ 1 ]; 12016 style.overflowY = opts.overflow[ 2 ]; 12017 } ); 12018 } 12019 12020 // Implement show/hide animations 12021 propTween = false; 12022 for ( prop in orig ) { 12023 12024 // General show/hide setup for this element animation 12025 if ( !propTween ) { 12026 if ( dataShow ) { 12027 if ( "hidden" in dataShow ) { 12028 hidden = dataShow.hidden; 12029 } 12030 } else { 12031 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 12032 } 12033 12034 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 12035 if ( toggle ) { 12036 dataShow.hidden = !hidden; 12037 } 12038 12039 // Show elements before animating them 12040 if ( hidden ) { 12041 showHide( [ elem ], true ); 12042 } 12043 12044 /* eslint-disable no-loop-func */ 12045 12046 anim.done( function() { 12047 12048 /* eslint-enable no-loop-func */ 12049 12050 // The final step of a "hide" animation is actually hiding the element 12051 if ( !hidden ) { 12052 showHide( [ elem ] ); 12053 } 12054 dataPriv.remove( elem, "fxshow" ); 12055 for ( prop in orig ) { 12056 jQuery.style( elem, prop, orig[ prop ] ); 12057 } 12058 } ); 12059 } 12060 12061 // Per-property setup 12062 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 12063 if ( !( prop in dataShow ) ) { 12064 dataShow[ prop ] = propTween.start; 12065 if ( hidden ) { 12066 propTween.end = propTween.start; 12067 propTween.start = 0; 12068 } 12069 } 12070 } 12071} 12072 12073function propFilter( props, specialEasing ) { 12074 var index, name, easing, value, hooks; 12075 12076 // camelCase, specialEasing and expand cssHook pass 12077 for ( index in props ) { 12078 name = camelCase( index ); 12079 easing = specialEasing[ name ]; 12080 value = props[ index ]; 12081 if ( Array.isArray( value ) ) { 12082 easing = value[ 1 ]; 12083 value = props[ index ] = value[ 0 ]; 12084 } 12085 12086 if ( index !== name ) { 12087 props[ name ] = value; 12088 delete props[ index ]; 12089 } 12090 12091 hooks = jQuery.cssHooks[ name ]; 12092 if ( hooks && "expand" in hooks ) { 12093 value = hooks.expand( value ); 12094 delete props[ name ]; 12095 12096 // Not quite $.extend, this won't overwrite existing keys. 12097 // Reusing 'index' because we have the correct "name" 12098 for ( index in value ) { 12099 if ( !( index in props ) ) { 12100 props[ index ] = value[ index ]; 12101 specialEasing[ index ] = easing; 12102 } 12103 } 12104 } else { 12105 specialEasing[ name ] = easing; 12106 } 12107 } 12108} 12109 12110function Animation( elem, properties, options ) { 12111 var result, 12112 stopped, 12113 index = 0, 12114 length = Animation.prefilters.length, 12115 deferred = jQuery.Deferred().always( function() { 12116 12117 // Don't match elem in the :animated selector 12118 delete tick.elem; 12119 } ), 12120 tick = function() { 12121 if ( stopped ) { 12122 return false; 12123 } 12124 var currentTime = fxNow || createFxNow(), 12125 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 12126 12127 // Support: Android 2.3 only 12128 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 12129 temp = remaining / animation.duration || 0, 12130 percent = 1 - temp, 12131 index = 0, 12132 length = animation.tweens.length; 12133 12134 for ( ; index < length; index++ ) { 12135 animation.tweens[ index ].run( percent ); 12136 } 12137 12138 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 12139 12140 // If there's more to do, yield 12141 if ( percent < 1 && length ) { 12142 return remaining; 12143 } 12144 12145 // If this was an empty animation, synthesize a final progress notification 12146 if ( !length ) { 12147 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12148 } 12149 12150 // Resolve the animation and report its conclusion 12151 deferred.resolveWith( elem, [ animation ] ); 12152 return false; 12153 }, 12154 animation = deferred.promise( { 12155 elem: elem, 12156 props: jQuery.extend( {}, properties ), 12157 opts: jQuery.extend( true, { 12158 specialEasing: {}, 12159 easing: jQuery.easing._default 12160 }, options ), 12161 originalProperties: properties, 12162 originalOptions: options, 12163 startTime: fxNow || createFxNow(), 12164 duration: options.duration, 12165 tweens: [], 12166 createTween: function( prop, end ) { 12167 var tween = jQuery.Tween( elem, animation.opts, prop, end, 12168 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 12169 animation.tweens.push( tween ); 12170 return tween; 12171 }, 12172 stop: function( gotoEnd ) { 12173 var index = 0, 12174 12175 // If we are going to the end, we want to run all the tweens 12176 // otherwise we skip this part 12177 length = gotoEnd ? animation.tweens.length : 0; 12178 if ( stopped ) { 12179 return this; 12180 } 12181 stopped = true; 12182 for ( ; index < length; index++ ) { 12183 animation.tweens[ index ].run( 1 ); 12184 } 12185 12186 // Resolve when we played the last frame; otherwise, reject 12187 if ( gotoEnd ) { 12188 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12189 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 12190 } else { 12191 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 12192 } 12193 return this; 12194 } 12195 } ), 12196 props = animation.props; 12197 12198 propFilter( props, animation.opts.specialEasing ); 12199 12200 for ( ; index < length; index++ ) { 12201 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 12202 if ( result ) { 12203 if ( isFunction( result.stop ) ) { 12204 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 12205 result.stop.bind( result ); 12206 } 12207 return result; 12208 } 12209 } 12210 12211 jQuery.map( props, createTween, animation ); 12212 12213 if ( isFunction( animation.opts.start ) ) { 12214 animation.opts.start.call( elem, animation ); 12215 } 12216 12217 // Attach callbacks from options 12218 animation 12219 .progress( animation.opts.progress ) 12220 .done( animation.opts.done, animation.opts.complete ) 12221 .fail( animation.opts.fail ) 12222 .always( animation.opts.always ); 12223 12224 jQuery.fx.timer( 12225 jQuery.extend( tick, { 12226 elem: elem, 12227 anim: animation, 12228 queue: animation.opts.queue 12229 } ) 12230 ); 12231 12232 return animation; 12233} 12234 12235jQuery.Animation = jQuery.extend( Animation, { 12236 12237 tweeners: { 12238 "*": [ function( prop, value ) { 12239 var tween = this.createTween( prop, value ); 12240 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 12241 return tween; 12242 } ] 12243 }, 12244 12245 tweener: function( props, callback ) { 12246 if ( isFunction( props ) ) { 12247 callback = props; 12248 props = [ "*" ]; 12249 } else { 12250 props = props.match( rnothtmlwhite ); 12251 } 12252 12253 var prop, 12254 index = 0, 12255 length = props.length; 12256 12257 for ( ; index < length; index++ ) { 12258 prop = props[ index ]; 12259 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 12260 Animation.tweeners[ prop ].unshift( callback ); 12261 } 12262 }, 12263 12264 prefilters: [ defaultPrefilter ], 12265 12266 prefilter: function( callback, prepend ) { 12267 if ( prepend ) { 12268 Animation.prefilters.unshift( callback ); 12269 } else { 12270 Animation.prefilters.push( callback ); 12271 } 12272 } 12273} ); 12274 12275jQuery.speed = function( speed, easing, fn ) { 12276 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 12277 complete: fn || !fn && easing || 12278 isFunction( speed ) && speed, 12279 duration: speed, 12280 easing: fn && easing || easing && !isFunction( easing ) && easing 12281 }; 12282 12283 // Go to the end state if fx are off 12284 if ( jQuery.fx.off ) { 12285 opt.duration = 0; 12286 12287 } else { 12288 if ( typeof opt.duration !== "number" ) { 12289 if ( opt.duration in jQuery.fx.speeds ) { 12290 opt.duration = jQuery.fx.speeds[ opt.duration ]; 12291 12292 } else { 12293 opt.duration = jQuery.fx.speeds._default; 12294 } 12295 } 12296 } 12297 12298 // Normalize opt.queue - true/undefined/null -> "fx" 12299 if ( opt.queue == null || opt.queue === true ) { 12300 opt.queue = "fx"; 12301 } 12302 12303 // Queueing 12304 opt.old = opt.complete; 12305 12306 opt.complete = function() { 12307 if ( isFunction( opt.old ) ) { 12308 opt.old.call( this ); 12309 } 12310 12311 if ( opt.queue ) { 12312 jQuery.dequeue( this, opt.queue ); 12313 } 12314 }; 12315 12316 return opt; 12317}; 12318 12319jQuery.fn.extend( { 12320 fadeTo: function( speed, to, easing, callback ) { 12321 12322 // Show any hidden elements after setting opacity to 0 12323 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 12324 12325 // Animate to the value specified 12326 .end().animate( { opacity: to }, speed, easing, callback ); 12327 }, 12328 animate: function( prop, speed, easing, callback ) { 12329 var empty = jQuery.isEmptyObject( prop ), 12330 optall = jQuery.speed( speed, easing, callback ), 12331 doAnimation = function() { 12332 12333 // Operate on a copy of prop so per-property easing won't be lost 12334 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 12335 12336 // Empty animations, or finishing resolves immediately 12337 if ( empty || dataPriv.get( this, "finish" ) ) { 12338 anim.stop( true ); 12339 } 12340 }; 12341 doAnimation.finish = doAnimation; 12342 12343 return empty || optall.queue === false ? 12344 this.each( doAnimation ) : 12345 this.queue( optall.queue, doAnimation ); 12346 }, 12347 stop: function( type, clearQueue, gotoEnd ) { 12348 var stopQueue = function( hooks ) { 12349 var stop = hooks.stop; 12350 delete hooks.stop; 12351 stop( gotoEnd ); 12352 }; 12353 12354 if ( typeof type !== "string" ) { 12355 gotoEnd = clearQueue; 12356 clearQueue = type; 12357 type = undefined; 12358 } 12359 if ( clearQueue ) { 12360 this.queue( type || "fx", [] ); 12361 } 12362 12363 return this.each( function() { 12364 var dequeue = true, 12365 index = type != null && type + "queueHooks", 12366 timers = jQuery.timers, 12367 data = dataPriv.get( this ); 12368 12369 if ( index ) { 12370 if ( data[ index ] && data[ index ].stop ) { 12371 stopQueue( data[ index ] ); 12372 } 12373 } else { 12374 for ( index in data ) { 12375 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 12376 stopQueue( data[ index ] ); 12377 } 12378 } 12379 } 12380 12381 for ( index = timers.length; index--; ) { 12382 if ( timers[ index ].elem === this && 12383 ( type == null || timers[ index ].queue === type ) ) { 12384 12385 timers[ index ].anim.stop( gotoEnd ); 12386 dequeue = false; 12387 timers.splice( index, 1 ); 12388 } 12389 } 12390 12391 // Start the next in the queue if the last step wasn't forced. 12392 // Timers currently will call their complete callbacks, which 12393 // will dequeue but only if they were gotoEnd. 12394 if ( dequeue || !gotoEnd ) { 12395 jQuery.dequeue( this, type ); 12396 } 12397 } ); 12398 }, 12399 finish: function( type ) { 12400 if ( type !== false ) { 12401 type = type || "fx"; 12402 } 12403 return this.each( function() { 12404 var index, 12405 data = dataPriv.get( this ), 12406 queue = data[ type + "queue" ], 12407 hooks = data[ type + "queueHooks" ], 12408 timers = jQuery.timers, 12409 length = queue ? queue.length : 0; 12410 12411 // Enable finishing flag on private data 12412 data.finish = true; 12413 12414 // Empty the queue first 12415 jQuery.queue( this, type, [] ); 12416 12417 if ( hooks && hooks.stop ) { 12418 hooks.stop.call( this, true ); 12419 } 12420 12421 // Look for any active animations, and finish them 12422 for ( index = timers.length; index--; ) { 12423 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 12424 timers[ index ].anim.stop( true ); 12425 timers.splice( index, 1 ); 12426 } 12427 } 12428 12429 // Look for any animations in the old queue and finish them 12430 for ( index = 0; index < length; index++ ) { 12431 if ( queue[ index ] && queue[ index ].finish ) { 12432 queue[ index ].finish.call( this ); 12433 } 12434 } 12435 12436 // Turn off finishing flag 12437 delete data.finish; 12438 } ); 12439 } 12440} ); 12441 12442jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 12443 var cssFn = jQuery.fn[ name ]; 12444 jQuery.fn[ name ] = function( speed, easing, callback ) { 12445 return speed == null || typeof speed === "boolean" ? 12446 cssFn.apply( this, arguments ) : 12447 this.animate( genFx( name, true ), speed, easing, callback ); 12448 }; 12449} ); 12450 12451// Generate shortcuts for custom animations 12452jQuery.each( { 12453 slideDown: genFx( "show" ), 12454 slideUp: genFx( "hide" ), 12455 slideToggle: genFx( "toggle" ), 12456 fadeIn: { opacity: "show" }, 12457 fadeOut: { opacity: "hide" }, 12458 fadeToggle: { opacity: "toggle" } 12459}, function( name, props ) { 12460 jQuery.fn[ name ] = function( speed, easing, callback ) { 12461 return this.animate( props, speed, easing, callback ); 12462 }; 12463} ); 12464 12465jQuery.timers = []; 12466jQuery.fx.tick = function() { 12467 var timer, 12468 i = 0, 12469 timers = jQuery.timers; 12470 12471 fxNow = Date.now(); 12472 12473 for ( ; i < timers.length; i++ ) { 12474 timer = timers[ i ]; 12475 12476 // Run the timer and safely remove it when done (allowing for external removal) 12477 if ( !timer() && timers[ i ] === timer ) { 12478 timers.splice( i--, 1 ); 12479 } 12480 } 12481 12482 if ( !timers.length ) { 12483 jQuery.fx.stop(); 12484 } 12485 fxNow = undefined; 12486}; 12487 12488jQuery.fx.timer = function( timer ) { 12489 jQuery.timers.push( timer ); 12490 jQuery.fx.start(); 12491}; 12492 12493jQuery.fx.interval = 13; 12494jQuery.fx.start = function() { 12495 if ( inProgress ) { 12496 return; 12497 } 12498 12499 inProgress = true; 12500 schedule(); 12501}; 12502 12503jQuery.fx.stop = function() { 12504 inProgress = null; 12505}; 12506 12507jQuery.fx.speeds = { 12508 slow: 600, 12509 fast: 200, 12510 12511 // Default speed 12512 _default: 400 12513}; 12514 12515 12516// Based off of the plugin by Clint Helfers, with permission. 12517// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 12518jQuery.fn.delay = function( time, type ) { 12519 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 12520 type = type || "fx"; 12521 12522 return this.queue( type, function( next, hooks ) { 12523 var timeout = window.setTimeout( next, time ); 12524 hooks.stop = function() { 12525 window.clearTimeout( timeout ); 12526 }; 12527 } ); 12528}; 12529 12530 12531( function() { 12532 var input = document.createElement( "input" ), 12533 select = document.createElement( "select" ), 12534 opt = select.appendChild( document.createElement( "option" ) ); 12535 12536 input.type = "checkbox"; 12537 12538 // Support: Android <=4.3 only 12539 // Default value for a checkbox should be "on" 12540 support.checkOn = input.value !== ""; 12541 12542 // Support: IE <=11 only 12543 // Must access selectedIndex to make default options select 12544 support.optSelected = opt.selected; 12545 12546 // Support: IE <=11 only 12547 // An input loses its value after becoming a radio 12548 input = document.createElement( "input" ); 12549 input.value = "t"; 12550 input.type = "radio"; 12551 support.radioValue = input.value === "t"; 12552} )(); 12553 12554 12555var boolHook, 12556 attrHandle = jQuery.expr.attrHandle; 12557 12558jQuery.fn.extend( { 12559 attr: function( name, value ) { 12560 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 12561 }, 12562 12563 removeAttr: function( name ) { 12564 return this.each( function() { 12565 jQuery.removeAttr( this, name ); 12566 } ); 12567 } 12568} ); 12569 12570jQuery.extend( { 12571 attr: function( elem, name, value ) { 12572 var ret, hooks, 12573 nType = elem.nodeType; 12574 12575 // Don't get/set attributes on text, comment and attribute nodes 12576 if ( nType === 3 || nType === 8 || nType === 2 ) { 12577 return; 12578 } 12579 12580 // Fallback to prop when attributes are not supported 12581 if ( typeof elem.getAttribute === "undefined" ) { 12582 return jQuery.prop( elem, name, value ); 12583 } 12584 12585 // Attribute hooks are determined by the lowercase version 12586 // Grab necessary hook if one is defined 12587 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12588 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 12589 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 12590 } 12591 12592 if ( value !== undefined ) { 12593 if ( value === null ) { 12594 jQuery.removeAttr( elem, name ); 12595 return; 12596 } 12597 12598 if ( hooks && "set" in hooks && 12599 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12600 return ret; 12601 } 12602 12603 elem.setAttribute( name, value + "" ); 12604 return value; 12605 } 12606 12607 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12608 return ret; 12609 } 12610 12611 ret = jQuery.find.attr( elem, name ); 12612 12613 // Non-existent attributes return null, we normalize to undefined 12614 return ret == null ? undefined : ret; 12615 }, 12616 12617 attrHooks: { 12618 type: { 12619 set: function( elem, value ) { 12620 if ( !support.radioValue && value === "radio" && 12621 nodeName( elem, "input" ) ) { 12622 var val = elem.value; 12623 elem.setAttribute( "type", value ); 12624 if ( val ) { 12625 elem.value = val; 12626 } 12627 return value; 12628 } 12629 } 12630 } 12631 }, 12632 12633 removeAttr: function( elem, value ) { 12634 var name, 12635 i = 0, 12636 12637 // Attribute names can contain non-HTML whitespace characters 12638 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 12639 attrNames = value && value.match( rnothtmlwhite ); 12640 12641 if ( attrNames && elem.nodeType === 1 ) { 12642 while ( ( name = attrNames[ i++ ] ) ) { 12643 elem.removeAttribute( name ); 12644 } 12645 } 12646 } 12647} ); 12648 12649// Hooks for boolean attributes 12650boolHook = { 12651 set: function( elem, value, name ) { 12652 if ( value === false ) { 12653 12654 // Remove boolean attributes when set to false 12655 jQuery.removeAttr( elem, name ); 12656 } else { 12657 elem.setAttribute( name, name ); 12658 } 12659 return name; 12660 } 12661}; 12662 12663jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 12664 var getter = attrHandle[ name ] || jQuery.find.attr; 12665 12666 attrHandle[ name ] = function( elem, name, isXML ) { 12667 var ret, handle, 12668 lowercaseName = name.toLowerCase(); 12669 12670 if ( !isXML ) { 12671 12672 // Avoid an infinite loop by temporarily removing this function from the getter 12673 handle = attrHandle[ lowercaseName ]; 12674 attrHandle[ lowercaseName ] = ret; 12675 ret = getter( elem, name, isXML ) != null ? 12676 lowercaseName : 12677 null; 12678 attrHandle[ lowercaseName ] = handle; 12679 } 12680 return ret; 12681 }; 12682} ); 12683 12684 12685 12686 12687var rfocusable = /^(?:input|select|textarea|button)$/i, 12688 rclickable = /^(?:a|area)$/i; 12689 12690jQuery.fn.extend( { 12691 prop: function( name, value ) { 12692 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 12693 }, 12694 12695 removeProp: function( name ) { 12696 return this.each( function() { 12697 delete this[ jQuery.propFix[ name ] || name ]; 12698 } ); 12699 } 12700} ); 12701 12702jQuery.extend( { 12703 prop: function( elem, name, value ) { 12704 var ret, hooks, 12705 nType = elem.nodeType; 12706 12707 // Don't get/set properties on text, comment and attribute nodes 12708 if ( nType === 3 || nType === 8 || nType === 2 ) { 12709 return; 12710 } 12711 12712 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 12713 12714 // Fix name and attach hooks 12715 name = jQuery.propFix[ name ] || name; 12716 hooks = jQuery.propHooks[ name ]; 12717 } 12718 12719 if ( value !== undefined ) { 12720 if ( hooks && "set" in hooks && 12721 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 12722 return ret; 12723 } 12724 12725 return ( elem[ name ] = value ); 12726 } 12727 12728 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 12729 return ret; 12730 } 12731 12732 return elem[ name ]; 12733 }, 12734 12735 propHooks: { 12736 tabIndex: { 12737 get: function( elem ) { 12738 12739 // Support: IE <=9 - 11 only 12740 // elem.tabIndex doesn't always return the 12741 // correct value when it hasn't been explicitly set 12742 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 12743 // Use proper attribute retrieval(#12072) 12744 var tabindex = jQuery.find.attr( elem, "tabindex" ); 12745 12746 if ( tabindex ) { 12747 return parseInt( tabindex, 10 ); 12748 } 12749 12750 if ( 12751 rfocusable.test( elem.nodeName ) || 12752 rclickable.test( elem.nodeName ) && 12753 elem.href 12754 ) { 12755 return 0; 12756 } 12757 12758 return -1; 12759 } 12760 } 12761 }, 12762 12763 propFix: { 12764 "for": "htmlFor", 12765 "class": "className" 12766 } 12767} ); 12768 12769// Support: IE <=11 only 12770// Accessing the selectedIndex property 12771// forces the browser to respect setting selected 12772// on the option 12773// The getter ensures a default option is selected 12774// when in an optgroup 12775// eslint rule "no-unused-expressions" is disabled for this code 12776// since it considers such accessions noop 12777if ( !support.optSelected ) { 12778 jQuery.propHooks.selected = { 12779 get: function( elem ) { 12780 12781 /* eslint no-unused-expressions: "off" */ 12782 12783 var parent = elem.parentNode; 12784 if ( parent && parent.parentNode ) { 12785 parent.parentNode.selectedIndex; 12786 } 12787 return null; 12788 }, 12789 set: function( elem ) { 12790 12791 /* eslint no-unused-expressions: "off" */ 12792 12793 var parent = elem.parentNode; 12794 if ( parent ) { 12795 parent.selectedIndex; 12796 12797 if ( parent.parentNode ) { 12798 parent.parentNode.selectedIndex; 12799 } 12800 } 12801 } 12802 }; 12803} 12804 12805jQuery.each( [ 12806 "tabIndex", 12807 "readOnly", 12808 "maxLength", 12809 "cellSpacing", 12810 "cellPadding", 12811 "rowSpan", 12812 "colSpan", 12813 "useMap", 12814 "frameBorder", 12815 "contentEditable" 12816], function() { 12817 jQuery.propFix[ this.toLowerCase() ] = this; 12818} ); 12819 12820 12821 12822 12823 // Strip and collapse whitespace according to HTML spec 12824 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 12825 function stripAndCollapse( value ) { 12826 var tokens = value.match( rnothtmlwhite ) || []; 12827 return tokens.join( " " ); 12828 } 12829 12830 12831function getClass( elem ) { 12832 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 12833} 12834 12835function classesToArray( value ) { 12836 if ( Array.isArray( value ) ) { 12837 return value; 12838 } 12839 if ( typeof value === "string" ) { 12840 return value.match( rnothtmlwhite ) || []; 12841 } 12842 return []; 12843} 12844 12845jQuery.fn.extend( { 12846 addClass: function( value ) { 12847 var classes, elem, cur, curValue, clazz, j, finalValue, 12848 i = 0; 12849 12850 if ( isFunction( value ) ) { 12851 return this.each( function( j ) { 12852 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 12853 } ); 12854 } 12855 12856 classes = classesToArray( value ); 12857 12858 if ( classes.length ) { 12859 while ( ( elem = this[ i++ ] ) ) { 12860 curValue = getClass( elem ); 12861 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 12862 12863 if ( cur ) { 12864 j = 0; 12865 while ( ( clazz = classes[ j++ ] ) ) { 12866 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 12867 cur += clazz + " "; 12868 } 12869 } 12870 12871 // Only assign if different to avoid unneeded rendering. 12872 finalValue = stripAndCollapse( cur ); 12873 if ( curValue !== finalValue ) { 12874 elem.setAttribute( "class", finalValue ); 12875 } 12876 } 12877 } 12878 } 12879 12880 return this; 12881 }, 12882 12883 removeClass: function( value ) { 12884 var classes, elem, cur, curValue, clazz, j, finalValue, 12885 i = 0; 12886 12887 if ( isFunction( value ) ) { 12888 return this.each( function( j ) { 12889 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 12890 } ); 12891 } 12892 12893 if ( !arguments.length ) { 12894 return this.attr( "class", "" ); 12895 } 12896 12897 classes = classesToArray( value ); 12898 12899 if ( classes.length ) { 12900 while ( ( elem = this[ i++ ] ) ) { 12901 curValue = getClass( elem ); 12902 12903 // This expression is here for better compressibility (see addClass) 12904 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 12905 12906 if ( cur ) { 12907 j = 0; 12908 while ( ( clazz = classes[ j++ ] ) ) { 12909 12910 // Remove *all* instances 12911 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 12912 cur = cur.replace( " " + clazz + " ", " " ); 12913 } 12914 } 12915 12916 // Only assign if different to avoid unneeded rendering. 12917 finalValue = stripAndCollapse( cur ); 12918 if ( curValue !== finalValue ) { 12919 elem.setAttribute( "class", finalValue ); 12920 } 12921 } 12922 } 12923 } 12924 12925 return this; 12926 }, 12927 12928 toggleClass: function( value, stateVal ) { 12929 var type = typeof value, 12930 isValidValue = type === "string" || Array.isArray( value ); 12931 12932 if ( typeof stateVal === "boolean" && isValidValue ) { 12933 return stateVal ? this.addClass( value ) : this.removeClass( value ); 12934 } 12935 12936 if ( isFunction( value ) ) { 12937 return this.each( function( i ) { 12938 jQuery( this ).toggleClass( 12939 value.call( this, i, getClass( this ), stateVal ), 12940 stateVal 12941 ); 12942 } ); 12943 } 12944 12945 return this.each( function() { 12946 var className, i, self, classNames; 12947 12948 if ( isValidValue ) { 12949 12950 // Toggle individual class names 12951 i = 0; 12952 self = jQuery( this ); 12953 classNames = classesToArray( value ); 12954 12955 while ( ( className = classNames[ i++ ] ) ) { 12956 12957 // Check each className given, space separated list 12958 if ( self.hasClass( className ) ) { 12959 self.removeClass( className ); 12960 } else { 12961 self.addClass( className ); 12962 } 12963 } 12964 12965 // Toggle whole class name 12966 } else if ( value === undefined || type === "boolean" ) { 12967 className = getClass( this ); 12968 if ( className ) { 12969 12970 // Store className if set 12971 dataPriv.set( this, "__className__", className ); 12972 } 12973 12974 // If the element has a class name or if we're passed `false`, 12975 // then remove the whole classname (if there was one, the above saved it). 12976 // Otherwise bring back whatever was previously saved (if anything), 12977 // falling back to the empty string if nothing was stored. 12978 if ( this.setAttribute ) { 12979 this.setAttribute( "class", 12980 className || value === false ? 12981 "" : 12982 dataPriv.get( this, "__className__" ) || "" 12983 ); 12984 } 12985 } 12986 } ); 12987 }, 12988 12989 hasClass: function( selector ) { 12990 var className, elem, 12991 i = 0; 12992 12993 className = " " + selector + " "; 12994 while ( ( elem = this[ i++ ] ) ) { 12995 if ( elem.nodeType === 1 && 12996 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 12997 return true; 12998 } 12999 } 13000 13001 return false; 13002 } 13003} ); 13004 13005 13006 13007 13008var rreturn = /\r/g; 13009 13010jQuery.fn.extend( { 13011 val: function( value ) { 13012 var hooks, ret, valueIsFunction, 13013 elem = this[ 0 ]; 13014 13015 if ( !arguments.length ) { 13016 if ( elem ) { 13017 hooks = jQuery.valHooks[ elem.type ] || 13018 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 13019 13020 if ( hooks && 13021 "get" in hooks && 13022 ( ret = hooks.get( elem, "value" ) ) !== undefined 13023 ) { 13024 return ret; 13025 } 13026 13027 ret = elem.value; 13028 13029 // Handle most common string cases 13030 if ( typeof ret === "string" ) { 13031 return ret.replace( rreturn, "" ); 13032 } 13033 13034 // Handle cases where value is null/undef or number 13035 return ret == null ? "" : ret; 13036 } 13037 13038 return; 13039 } 13040 13041 valueIsFunction = isFunction( value ); 13042 13043 return this.each( function( i ) { 13044 var val; 13045 13046 if ( this.nodeType !== 1 ) { 13047 return; 13048 } 13049 13050 if ( valueIsFunction ) { 13051 val = value.call( this, i, jQuery( this ).val() ); 13052 } else { 13053 val = value; 13054 } 13055 13056 // Treat null/undefined as ""; convert numbers to string 13057 if ( val == null ) { 13058 val = ""; 13059 13060 } else if ( typeof val === "number" ) { 13061 val += ""; 13062 13063 } else if ( Array.isArray( val ) ) { 13064 val = jQuery.map( val, function( value ) { 13065 return value == null ? "" : value + ""; 13066 } ); 13067 } 13068 13069 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 13070 13071 // If set returns undefined, fall back to normal setting 13072 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 13073 this.value = val; 13074 } 13075 } ); 13076 } 13077} ); 13078 13079jQuery.extend( { 13080 valHooks: { 13081 option: { 13082 get: function( elem ) { 13083 13084 var val = jQuery.find.attr( elem, "value" ); 13085 return val != null ? 13086 val : 13087 13088 // Support: IE <=10 - 11 only 13089 // option.text throws exceptions (#14686, #14858) 13090 // Strip and collapse whitespace 13091 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 13092 stripAndCollapse( jQuery.text( elem ) ); 13093 } 13094 }, 13095 select: { 13096 get: function( elem ) { 13097 var value, option, i, 13098 options = elem.options, 13099 index = elem.selectedIndex, 13100 one = elem.type === "select-one", 13101 values = one ? null : [], 13102 max = one ? index + 1 : options.length; 13103 13104 if ( index < 0 ) { 13105 i = max; 13106 13107 } else { 13108 i = one ? index : 0; 13109 } 13110 13111 // Loop through all the selected options 13112 for ( ; i < max; i++ ) { 13113 option = options[ i ]; 13114 13115 // Support: IE <=9 only 13116 // IE8-9 doesn't update selected after form reset (#2551) 13117 if ( ( option.selected || i === index ) && 13118 13119 // Don't return options that are disabled or in a disabled optgroup 13120 !option.disabled && 13121 ( !option.parentNode.disabled || 13122 !nodeName( option.parentNode, "optgroup" ) ) ) { 13123 13124 // Get the specific value for the option 13125 value = jQuery( option ).val(); 13126 13127 // We don't need an array for one selects 13128 if ( one ) { 13129 return value; 13130 } 13131 13132 // Multi-Selects return an array 13133 values.push( value ); 13134 } 13135 } 13136 13137 return values; 13138 }, 13139 13140 set: function( elem, value ) { 13141 var optionSet, option, 13142 options = elem.options, 13143 values = jQuery.makeArray( value ), 13144 i = options.length; 13145 13146 while ( i-- ) { 13147 option = options[ i ]; 13148 13149 /* eslint-disable no-cond-assign */ 13150 13151 if ( option.selected = 13152 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 13153 ) { 13154 optionSet = true; 13155 } 13156 13157 /* eslint-enable no-cond-assign */ 13158 } 13159 13160 // Force browsers to behave consistently when non-matching value is set 13161 if ( !optionSet ) { 13162 elem.selectedIndex = -1; 13163 } 13164 return values; 13165 } 13166 } 13167 } 13168} ); 13169 13170// Radios and checkboxes getter/setter 13171jQuery.each( [ "radio", "checkbox" ], function() { 13172 jQuery.valHooks[ this ] = { 13173 set: function( elem, value ) { 13174 if ( Array.isArray( value ) ) { 13175 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 13176 } 13177 } 13178 }; 13179 if ( !support.checkOn ) { 13180 jQuery.valHooks[ this ].get = function( elem ) { 13181 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 13182 }; 13183 } 13184} ); 13185 13186 13187 13188 13189// Return jQuery for attributes-only inclusion 13190 13191 13192support.focusin = "onfocusin" in window; 13193 13194 13195var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 13196 stopPropagationCallback = function( e ) { 13197 e.stopPropagation(); 13198 }; 13199 13200jQuery.extend( jQuery.event, { 13201 13202 trigger: function( event, data, elem, onlyHandlers ) { 13203 13204 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 13205 eventPath = [ elem || document ], 13206 type = hasOwn.call( event, "type" ) ? event.type : event, 13207 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 13208 13209 cur = lastElement = tmp = elem = elem || document; 13210 13211 // Don't do events on text and comment nodes 13212 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 13213 return; 13214 } 13215 13216 // focus/blur morphs to focusin/out; ensure we're not firing them right now 13217 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 13218 return; 13219 } 13220 13221 if ( type.indexOf( "." ) > -1 ) { 13222 13223 // Namespaced trigger; create a regexp to match event type in handle() 13224 namespaces = type.split( "." ); 13225 type = namespaces.shift(); 13226 namespaces.sort(); 13227 } 13228 ontype = type.indexOf( ":" ) < 0 && "on" + type; 13229 13230 // Caller can pass in a jQuery.Event object, Object, or just an event type string 13231 event = event[ jQuery.expando ] ? 13232 event : 13233 new jQuery.Event( type, typeof event === "object" && event ); 13234 13235 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 13236 event.isTrigger = onlyHandlers ? 2 : 3; 13237 event.namespace = namespaces.join( "." ); 13238 event.rnamespace = event.namespace ? 13239 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 13240 null; 13241 13242 // Clean up the event in case it is being reused 13243 event.result = undefined; 13244 if ( !event.target ) { 13245 event.target = elem; 13246 } 13247 13248 // Clone any incoming data and prepend the event, creating the handler arg list 13249 data = data == null ? 13250 [ event ] : 13251 jQuery.makeArray( data, [ event ] ); 13252 13253 // Allow special events to draw outside the lines 13254 special = jQuery.event.special[ type ] || {}; 13255 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 13256 return; 13257 } 13258 13259 // Determine event propagation path in advance, per W3C events spec (#9951) 13260 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 13261 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 13262 13263 bubbleType = special.delegateType || type; 13264 if ( !rfocusMorph.test( bubbleType + type ) ) { 13265 cur = cur.parentNode; 13266 } 13267 for ( ; cur; cur = cur.parentNode ) { 13268 eventPath.push( cur ); 13269 tmp = cur; 13270 } 13271 13272 // Only add window if we got to document (e.g., not plain obj or detached DOM) 13273 if ( tmp === ( elem.ownerDocument || document ) ) { 13274 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 13275 } 13276 } 13277 13278 // Fire handlers on the event path 13279 i = 0; 13280 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 13281 lastElement = cur; 13282 event.type = i > 1 ? 13283 bubbleType : 13284 special.bindType || type; 13285 13286 // jQuery handler 13287 handle = ( 13288 dataPriv.get( cur, "events" ) || Object.create( null ) 13289 )[ event.type ] && 13290 dataPriv.get( cur, "handle" ); 13291 if ( handle ) { 13292 handle.apply( cur, data ); 13293 } 13294 13295 // Native handler 13296 handle = ontype && cur[ ontype ]; 13297 if ( handle && handle.apply && acceptData( cur ) ) { 13298 event.result = handle.apply( cur, data ); 13299 if ( event.result === false ) { 13300 event.preventDefault(); 13301 } 13302 } 13303 } 13304 event.type = type; 13305 13306 // If nobody prevented the default action, do it now 13307 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 13308 13309 if ( ( !special._default || 13310 special._default.apply( eventPath.pop(), data ) === false ) && 13311 acceptData( elem ) ) { 13312 13313 // Call a native DOM method on the target with the same name as the event. 13314 // Don't do default actions on window, that's where global variables be (#6170) 13315 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 13316 13317 // Don't re-trigger an onFOO event when we call its FOO() method 13318 tmp = elem[ ontype ]; 13319 13320 if ( tmp ) { 13321 elem[ ontype ] = null; 13322 } 13323 13324 // Prevent re-triggering of the same event, since we already bubbled it above 13325 jQuery.event.triggered = type; 13326 13327 if ( event.isPropagationStopped() ) { 13328 lastElement.addEventListener( type, stopPropagationCallback ); 13329 } 13330 13331 elem[ type ](); 13332 13333 if ( event.isPropagationStopped() ) { 13334 lastElement.removeEventListener( type, stopPropagationCallback ); 13335 } 13336 13337 jQuery.event.triggered = undefined; 13338 13339 if ( tmp ) { 13340 elem[ ontype ] = tmp; 13341 } 13342 } 13343 } 13344 } 13345 13346 return event.result; 13347 }, 13348 13349 // Piggyback on a donor event to simulate a different one 13350 // Used only for `focus(in | out)` events 13351 simulate: function( type, elem, event ) { 13352 var e = jQuery.extend( 13353 new jQuery.Event(), 13354 event, 13355 { 13356 type: type, 13357 isSimulated: true 13358 } 13359 ); 13360 13361 jQuery.event.trigger( e, null, elem ); 13362 } 13363 13364} ); 13365 13366jQuery.fn.extend( { 13367 13368 trigger: function( type, data ) { 13369 return this.each( function() { 13370 jQuery.event.trigger( type, data, this ); 13371 } ); 13372 }, 13373 triggerHandler: function( type, data ) { 13374 var elem = this[ 0 ]; 13375 if ( elem ) { 13376 return jQuery.event.trigger( type, data, elem, true ); 13377 } 13378 } 13379} ); 13380 13381 13382// Support: Firefox <=44 13383// Firefox doesn't have focus(in | out) events 13384// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 13385// 13386// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 13387// focus(in | out) events fire after focus & blur events, 13388// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 13389// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 13390if ( !support.focusin ) { 13391 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 13392 13393 // Attach a single capturing handler on the document while someone wants focusin/focusout 13394 var handler = function( event ) { 13395 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 13396 }; 13397 13398 jQuery.event.special[ fix ] = { 13399 setup: function() { 13400 13401 // Handle: regular nodes (via `this.ownerDocument`), window 13402 // (via `this.document`) & document (via `this`). 13403 var doc = this.ownerDocument || this.document || this, 13404 attaches = dataPriv.access( doc, fix ); 13405 13406 if ( !attaches ) { 13407 doc.addEventListener( orig, handler, true ); 13408 } 13409 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 13410 }, 13411 teardown: function() { 13412 var doc = this.ownerDocument || this.document || this, 13413 attaches = dataPriv.access( doc, fix ) - 1; 13414 13415 if ( !attaches ) { 13416 doc.removeEventListener( orig, handler, true ); 13417 dataPriv.remove( doc, fix ); 13418 13419 } else { 13420 dataPriv.access( doc, fix, attaches ); 13421 } 13422 } 13423 }; 13424 } ); 13425} 13426var location = window.location; 13427 13428var nonce = { guid: Date.now() }; 13429 13430var rquery = ( /\?/ ); 13431 13432 13433 13434// Cross-browser xml parsing 13435jQuery.parseXML = function( data ) { 13436 var xml; 13437 if ( !data || typeof data !== "string" ) { 13438 return null; 13439 } 13440 13441 // Support: IE 9 - 11 only 13442 // IE throws on parseFromString with invalid input. 13443 try { 13444 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 13445 } catch ( e ) { 13446 xml = undefined; 13447 } 13448 13449 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 13450 jQuery.error( "Invalid XML: " + data ); 13451 } 13452 return xml; 13453}; 13454 13455 13456var 13457 rbracket = /\[\]$/, 13458 rCRLF = /\r?\n/g, 13459 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 13460 rsubmittable = /^(?:input|select|textarea|keygen)/i; 13461 13462function buildParams( prefix, obj, traditional, add ) { 13463 var name; 13464 13465 if ( Array.isArray( obj ) ) { 13466 13467 // Serialize array item. 13468 jQuery.each( obj, function( i, v ) { 13469 if ( traditional || rbracket.test( prefix ) ) { 13470 13471 // Treat each array item as a scalar. 13472 add( prefix, v ); 13473 13474 } else { 13475 13476 // Item is non-scalar (array or object), encode its numeric index. 13477 buildParams( 13478 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 13479 v, 13480 traditional, 13481 add 13482 ); 13483 } 13484 } ); 13485 13486 } else if ( !traditional && toType( obj ) === "object" ) { 13487 13488 // Serialize object item. 13489 for ( name in obj ) { 13490 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 13491 } 13492 13493 } else { 13494 13495 // Serialize scalar item. 13496 add( prefix, obj ); 13497 } 13498} 13499 13500// Serialize an array of form elements or a set of 13501// key/values into a query string 13502jQuery.param = function( a, traditional ) { 13503 var prefix, 13504 s = [], 13505 add = function( key, valueOrFunction ) { 13506 13507 // If value is a function, invoke it and use its return value 13508 var value = isFunction( valueOrFunction ) ? 13509 valueOrFunction() : 13510 valueOrFunction; 13511 13512 s[ s.length ] = encodeURIComponent( key ) + "=" + 13513 encodeURIComponent( value == null ? "" : value ); 13514 }; 13515 13516 if ( a == null ) { 13517 return ""; 13518 } 13519 13520 // If an array was passed in, assume that it is an array of form elements. 13521 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 13522 13523 // Serialize the form elements 13524 jQuery.each( a, function() { 13525 add( this.name, this.value ); 13526 } ); 13527 13528 } else { 13529 13530 // If traditional, encode the "old" way (the way 1.3.2 or older 13531 // did it), otherwise encode params recursively. 13532 for ( prefix in a ) { 13533 buildParams( prefix, a[ prefix ], traditional, add ); 13534 } 13535 } 13536 13537 // Return the resulting serialization 13538 return s.join( "&" ); 13539}; 13540 13541jQuery.fn.extend( { 13542 serialize: function() { 13543 return jQuery.param( this.serializeArray() ); 13544 }, 13545 serializeArray: function() { 13546 return this.map( function() { 13547 13548 // Can add propHook for "elements" to filter or add form elements 13549 var elements = jQuery.prop( this, "elements" ); 13550 return elements ? jQuery.makeArray( elements ) : this; 13551 } ) 13552 .filter( function() { 13553 var type = this.type; 13554 13555 // Use .is( ":disabled" ) so that fieldset[disabled] works 13556 return this.name && !jQuery( this ).is( ":disabled" ) && 13557 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 13558 ( this.checked || !rcheckableType.test( type ) ); 13559 } ) 13560 .map( function( _i, elem ) { 13561 var val = jQuery( this ).val(); 13562 13563 if ( val == null ) { 13564 return null; 13565 } 13566 13567 if ( Array.isArray( val ) ) { 13568 return jQuery.map( val, function( val ) { 13569 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13570 } ); 13571 } 13572 13573 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 13574 } ).get(); 13575 } 13576} ); 13577 13578 13579var 13580 r20 = /%20/g, 13581 rhash = /#.*$/, 13582 rantiCache = /([?&])_=[^&]*/, 13583 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 13584 13585 // #7653, #8125, #8152: local protocol detection 13586 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 13587 rnoContent = /^(?:GET|HEAD)$/, 13588 rprotocol = /^\/\//, 13589 13590 /* Prefilters 13591 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 13592 * 2) These are called: 13593 * - BEFORE asking for a transport 13594 * - AFTER param serialization (s.data is a string if s.processData is true) 13595 * 3) key is the dataType 13596 * 4) the catchall symbol "*" can be used 13597 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 13598 */ 13599 prefilters = {}, 13600 13601 /* Transports bindings 13602 * 1) key is the dataType 13603 * 2) the catchall symbol "*" can be used 13604 * 3) selection will start with transport dataType and THEN go to "*" if needed 13605 */ 13606 transports = {}, 13607 13608 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 13609 allTypes = "*/".concat( "*" ), 13610 13611 // Anchor tag for parsing the document origin 13612 originAnchor = document.createElement( "a" ); 13613 originAnchor.href = location.href; 13614 13615// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 13616function addToPrefiltersOrTransports( structure ) { 13617 13618 // dataTypeExpression is optional and defaults to "*" 13619 return function( dataTypeExpression, func ) { 13620 13621 if ( typeof dataTypeExpression !== "string" ) { 13622 func = dataTypeExpression; 13623 dataTypeExpression = "*"; 13624 } 13625 13626 var dataType, 13627 i = 0, 13628 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 13629 13630 if ( isFunction( func ) ) { 13631 13632 // For each dataType in the dataTypeExpression 13633 while ( ( dataType = dataTypes[ i++ ] ) ) { 13634 13635 // Prepend if requested 13636 if ( dataType[ 0 ] === "+" ) { 13637 dataType = dataType.slice( 1 ) || "*"; 13638 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 13639 13640 // Otherwise append 13641 } else { 13642 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 13643 } 13644 } 13645 } 13646 }; 13647} 13648 13649// Base inspection function for prefilters and transports 13650function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 13651 13652 var inspected = {}, 13653 seekingTransport = ( structure === transports ); 13654 13655 function inspect( dataType ) { 13656 var selected; 13657 inspected[ dataType ] = true; 13658 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 13659 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 13660 if ( typeof dataTypeOrTransport === "string" && 13661 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 13662 13663 options.dataTypes.unshift( dataTypeOrTransport ); 13664 inspect( dataTypeOrTransport ); 13665 return false; 13666 } else if ( seekingTransport ) { 13667 return !( selected = dataTypeOrTransport ); 13668 } 13669 } ); 13670 return selected; 13671 } 13672 13673 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 13674} 13675 13676// A special extend for ajax options 13677// that takes "flat" options (not to be deep extended) 13678// Fixes #9887 13679function ajaxExtend( target, src ) { 13680 var key, deep, 13681 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 13682 13683 for ( key in src ) { 13684 if ( src[ key ] !== undefined ) { 13685 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 13686 } 13687 } 13688 if ( deep ) { 13689 jQuery.extend( true, target, deep ); 13690 } 13691 13692 return target; 13693} 13694 13695/* Handles responses to an ajax request: 13696 * - finds the right dataType (mediates between content-type and expected dataType) 13697 * - returns the corresponding response 13698 */ 13699function ajaxHandleResponses( s, jqXHR, responses ) { 13700 13701 var ct, type, finalDataType, firstDataType, 13702 contents = s.contents, 13703 dataTypes = s.dataTypes; 13704 13705 // Remove auto dataType and get content-type in the process 13706 while ( dataTypes[ 0 ] === "*" ) { 13707 dataTypes.shift(); 13708 if ( ct === undefined ) { 13709 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 13710 } 13711 } 13712 13713 // Check if we're dealing with a known content-type 13714 if ( ct ) { 13715 for ( type in contents ) { 13716 if ( contents[ type ] && contents[ type ].test( ct ) ) { 13717 dataTypes.unshift( type ); 13718 break; 13719 } 13720 } 13721 } 13722 13723 // Check to see if we have a response for the expected dataType 13724 if ( dataTypes[ 0 ] in responses ) { 13725 finalDataType = dataTypes[ 0 ]; 13726 } else { 13727 13728 // Try convertible dataTypes 13729 for ( type in responses ) { 13730 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 13731 finalDataType = type; 13732 break; 13733 } 13734 if ( !firstDataType ) { 13735 firstDataType = type; 13736 } 13737 } 13738 13739 // Or just use first one 13740 finalDataType = finalDataType || firstDataType; 13741 } 13742 13743 // If we found a dataType 13744 // We add the dataType to the list if needed 13745 // and return the corresponding response 13746 if ( finalDataType ) { 13747 if ( finalDataType !== dataTypes[ 0 ] ) { 13748 dataTypes.unshift( finalDataType ); 13749 } 13750 return responses[ finalDataType ]; 13751 } 13752} 13753 13754/* Chain conversions given the request and the original response 13755 * Also sets the responseXXX fields on the jqXHR instance 13756 */ 13757function ajaxConvert( s, response, jqXHR, isSuccess ) { 13758 var conv2, current, conv, tmp, prev, 13759 converters = {}, 13760 13761 // Work with a copy of dataTypes in case we need to modify it for conversion 13762 dataTypes = s.dataTypes.slice(); 13763 13764 // Create converters map with lowercased keys 13765 if ( dataTypes[ 1 ] ) { 13766 for ( conv in s.converters ) { 13767 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 13768 } 13769 } 13770 13771 current = dataTypes.shift(); 13772 13773 // Convert to each sequential dataType 13774 while ( current ) { 13775 13776 if ( s.responseFields[ current ] ) { 13777 jqXHR[ s.responseFields[ current ] ] = response; 13778 } 13779 13780 // Apply the dataFilter if provided 13781 if ( !prev && isSuccess && s.dataFilter ) { 13782 response = s.dataFilter( response, s.dataType ); 13783 } 13784 13785 prev = current; 13786 current = dataTypes.shift(); 13787 13788 if ( current ) { 13789 13790 // There's only work to do if current dataType is non-auto 13791 if ( current === "*" ) { 13792 13793 current = prev; 13794 13795 // Convert response if prev dataType is non-auto and differs from current 13796 } else if ( prev !== "*" && prev !== current ) { 13797 13798 // Seek a direct converter 13799 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 13800 13801 // If none found, seek a pair 13802 if ( !conv ) { 13803 for ( conv2 in converters ) { 13804 13805 // If conv2 outputs current 13806 tmp = conv2.split( " " ); 13807 if ( tmp[ 1 ] === current ) { 13808 13809 // If prev can be converted to accepted input 13810 conv = converters[ prev + " " + tmp[ 0 ] ] || 13811 converters[ "* " + tmp[ 0 ] ]; 13812 if ( conv ) { 13813 13814 // Condense equivalence converters 13815 if ( conv === true ) { 13816 conv = converters[ conv2 ]; 13817 13818 // Otherwise, insert the intermediate dataType 13819 } else if ( converters[ conv2 ] !== true ) { 13820 current = tmp[ 0 ]; 13821 dataTypes.unshift( tmp[ 1 ] ); 13822 } 13823 break; 13824 } 13825 } 13826 } 13827 } 13828 13829 // Apply converter (if not an equivalence) 13830 if ( conv !== true ) { 13831 13832 // Unless errors are allowed to bubble, catch and return them 13833 if ( conv && s.throws ) { 13834 response = conv( response ); 13835 } else { 13836 try { 13837 response = conv( response ); 13838 } catch ( e ) { 13839 return { 13840 state: "parsererror", 13841 error: conv ? e : "No conversion from " + prev + " to " + current 13842 }; 13843 } 13844 } 13845 } 13846 } 13847 } 13848 } 13849 13850 return { state: "success", data: response }; 13851} 13852 13853jQuery.extend( { 13854 13855 // Counter for holding the number of active queries 13856 active: 0, 13857 13858 // Last-Modified header cache for next request 13859 lastModified: {}, 13860 etag: {}, 13861 13862 ajaxSettings: { 13863 url: location.href, 13864 type: "GET", 13865 isLocal: rlocalProtocol.test( location.protocol ), 13866 global: true, 13867 processData: true, 13868 async: true, 13869 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 13870 13871 /* 13872 timeout: 0, 13873 data: null, 13874 dataType: null, 13875 username: null, 13876 password: null, 13877 cache: null, 13878 throws: false, 13879 traditional: false, 13880 headers: {}, 13881 */ 13882 13883 accepts: { 13884 "*": allTypes, 13885 text: "text/plain", 13886 html: "text/html", 13887 xml: "application/xml, text/xml", 13888 json: "application/json, text/javascript" 13889 }, 13890 13891 contents: { 13892 xml: /\bxml\b/, 13893 html: /\bhtml/, 13894 json: /\bjson\b/ 13895 }, 13896 13897 responseFields: { 13898 xml: "responseXML", 13899 text: "responseText", 13900 json: "responseJSON" 13901 }, 13902 13903 // Data converters 13904 // Keys separate source (or catchall "*") and destination types with a single space 13905 converters: { 13906 13907 // Convert anything to text 13908 "* text": String, 13909 13910 // Text to html (true = no transformation) 13911 "text html": true, 13912 13913 // Evaluate text as a json expression 13914 "text json": JSON.parse, 13915 13916 // Parse text as xml 13917 "text xml": jQuery.parseXML 13918 }, 13919 13920 // For options that shouldn't be deep extended: 13921 // you can add your own custom options here if 13922 // and when you create one that shouldn't be 13923 // deep extended (see ajaxExtend) 13924 flatOptions: { 13925 url: true, 13926 context: true 13927 } 13928 }, 13929 13930 // Creates a full fledged settings object into target 13931 // with both ajaxSettings and settings fields. 13932 // If target is omitted, writes into ajaxSettings. 13933 ajaxSetup: function( target, settings ) { 13934 return settings ? 13935 13936 // Building a settings object 13937 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 13938 13939 // Extending ajaxSettings 13940 ajaxExtend( jQuery.ajaxSettings, target ); 13941 }, 13942 13943 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 13944 ajaxTransport: addToPrefiltersOrTransports( transports ), 13945 13946 // Main method 13947 ajax: function( url, options ) { 13948 13949 // If url is an object, simulate pre-1.5 signature 13950 if ( typeof url === "object" ) { 13951 options = url; 13952 url = undefined; 13953 } 13954 13955 // Force options to be an object 13956 options = options || {}; 13957 13958 var transport, 13959 13960 // URL without anti-cache param 13961 cacheURL, 13962 13963 // Response headers 13964 responseHeadersString, 13965 responseHeaders, 13966 13967 // timeout handle 13968 timeoutTimer, 13969 13970 // Url cleanup var 13971 urlAnchor, 13972 13973 // Request state (becomes false upon send and true upon completion) 13974 completed, 13975 13976 // To know if global events are to be dispatched 13977 fireGlobals, 13978 13979 // Loop variable 13980 i, 13981 13982 // uncached part of the url 13983 uncached, 13984 13985 // Create the final options object 13986 s = jQuery.ajaxSetup( {}, options ), 13987 13988 // Callbacks context 13989 callbackContext = s.context || s, 13990 13991 // Context for global events is callbackContext if it is a DOM node or jQuery collection 13992 globalEventContext = s.context && 13993 ( callbackContext.nodeType || callbackContext.jquery ) ? 13994 jQuery( callbackContext ) : 13995 jQuery.event, 13996 13997 // Deferreds 13998 deferred = jQuery.Deferred(), 13999 completeDeferred = jQuery.Callbacks( "once memory" ), 14000 14001 // Status-dependent callbacks 14002 statusCode = s.statusCode || {}, 14003 14004 // Headers (they are sent all at once) 14005 requestHeaders = {}, 14006 requestHeadersNames = {}, 14007 14008 // Default abort message 14009 strAbort = "canceled", 14010 14011 // Fake xhr 14012 jqXHR = { 14013 readyState: 0, 14014 14015 // Builds headers hashtable if needed 14016 getResponseHeader: function( key ) { 14017 var match; 14018 if ( completed ) { 14019 if ( !responseHeaders ) { 14020 responseHeaders = {}; 14021 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 14022 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 14023 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 14024 .concat( match[ 2 ] ); 14025 } 14026 } 14027 match = responseHeaders[ key.toLowerCase() + " " ]; 14028 } 14029 return match == null ? null : match.join( ", " ); 14030 }, 14031 14032 // Raw string 14033 getAllResponseHeaders: function() { 14034 return completed ? responseHeadersString : null; 14035 }, 14036 14037 // Caches the header 14038 setRequestHeader: function( name, value ) { 14039 if ( completed == null ) { 14040 name = requestHeadersNames[ name.toLowerCase() ] = 14041 requestHeadersNames[ name.toLowerCase() ] || name; 14042 requestHeaders[ name ] = value; 14043 } 14044 return this; 14045 }, 14046 14047 // Overrides response content-type header 14048 overrideMimeType: function( type ) { 14049 if ( completed == null ) { 14050 s.mimeType = type; 14051 } 14052 return this; 14053 }, 14054 14055 // Status-dependent callbacks 14056 statusCode: function( map ) { 14057 var code; 14058 if ( map ) { 14059 if ( completed ) { 14060 14061 // Execute the appropriate callbacks 14062 jqXHR.always( map[ jqXHR.status ] ); 14063 } else { 14064 14065 // Lazy-add the new callbacks in a way that preserves old ones 14066 for ( code in map ) { 14067 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 14068 } 14069 } 14070 } 14071 return this; 14072 }, 14073 14074 // Cancel the request 14075 abort: function( statusText ) { 14076 var finalText = statusText || strAbort; 14077 if ( transport ) { 14078 transport.abort( finalText ); 14079 } 14080 done( 0, finalText ); 14081 return this; 14082 } 14083 }; 14084 14085 // Attach deferreds 14086 deferred.promise( jqXHR ); 14087 14088 // Add protocol if not provided (prefilters might expect it) 14089 // Handle falsy url in the settings object (#10093: consistency with old signature) 14090 // We also use the url parameter if available 14091 s.url = ( ( url || s.url || location.href ) + "" ) 14092 .replace( rprotocol, location.protocol + "//" ); 14093 14094 // Alias method option to type as per ticket #12004 14095 s.type = options.method || options.type || s.method || s.type; 14096 14097 // Extract dataTypes list 14098 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 14099 14100 // A cross-domain request is in order when the origin doesn't match the current origin. 14101 if ( s.crossDomain == null ) { 14102 urlAnchor = document.createElement( "a" ); 14103 14104 // Support: IE <=8 - 11, Edge 12 - 15 14105 // IE throws exception on accessing the href property if url is malformed, 14106 // e.g. http://example.com:80x/ 14107 try { 14108 urlAnchor.href = s.url; 14109 14110 // Support: IE <=8 - 11 only 14111 // Anchor's host property isn't correctly set when s.url is relative 14112 urlAnchor.href = urlAnchor.href; 14113 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 14114 urlAnchor.protocol + "//" + urlAnchor.host; 14115 } catch ( e ) { 14116 14117 // If there is an error parsing the URL, assume it is crossDomain, 14118 // it can be rejected by the transport if it is invalid 14119 s.crossDomain = true; 14120 } 14121 } 14122 14123 // Convert data if not already a string 14124 if ( s.data && s.processData && typeof s.data !== "string" ) { 14125 s.data = jQuery.param( s.data, s.traditional ); 14126 } 14127 14128 // Apply prefilters 14129 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 14130 14131 // If request was aborted inside a prefilter, stop there 14132 if ( completed ) { 14133 return jqXHR; 14134 } 14135 14136 // We can fire global events as of now if asked to 14137 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 14138 fireGlobals = jQuery.event && s.global; 14139 14140 // Watch for a new set of requests 14141 if ( fireGlobals && jQuery.active++ === 0 ) { 14142 jQuery.event.trigger( "ajaxStart" ); 14143 } 14144 14145 // Uppercase the type 14146 s.type = s.type.toUpperCase(); 14147 14148 // Determine if request has content 14149 s.hasContent = !rnoContent.test( s.type ); 14150 14151 // Save the URL in case we're toying with the If-Modified-Since 14152 // and/or If-None-Match header later on 14153 // Remove hash to simplify url manipulation 14154 cacheURL = s.url.replace( rhash, "" ); 14155 14156 // More options handling for requests with no content 14157 if ( !s.hasContent ) { 14158 14159 // Remember the hash so we can put it back 14160 uncached = s.url.slice( cacheURL.length ); 14161 14162 // If data is available and should be processed, append data to url 14163 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 14164 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 14165 14166 // #9682: remove data so that it's not used in an eventual retry 14167 delete s.data; 14168 } 14169 14170 // Add or update anti-cache param if needed 14171 if ( s.cache === false ) { 14172 cacheURL = cacheURL.replace( rantiCache, "$1" ); 14173 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 14174 uncached; 14175 } 14176 14177 // Put hash and anti-cache on the URL that will be requested (gh-1732) 14178 s.url = cacheURL + uncached; 14179 14180 // Change '%20' to '+' if this is encoded form body content (gh-2658) 14181 } else if ( s.data && s.processData && 14182 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 14183 s.data = s.data.replace( r20, "+" ); 14184 } 14185 14186 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14187 if ( s.ifModified ) { 14188 if ( jQuery.lastModified[ cacheURL ] ) { 14189 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 14190 } 14191 if ( jQuery.etag[ cacheURL ] ) { 14192 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 14193 } 14194 } 14195 14196 // Set the correct header, if data is being sent 14197 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 14198 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 14199 } 14200 14201 // Set the Accepts header for the server, depending on the dataType 14202 jqXHR.setRequestHeader( 14203 "Accept", 14204 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 14205 s.accepts[ s.dataTypes[ 0 ] ] + 14206 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 14207 s.accepts[ "*" ] 14208 ); 14209 14210 // Check for headers option 14211 for ( i in s.headers ) { 14212 jqXHR.setRequestHeader( i, s.headers[ i ] ); 14213 } 14214 14215 // Allow custom headers/mimetypes and early abort 14216 if ( s.beforeSend && 14217 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 14218 14219 // Abort if not done already and return 14220 return jqXHR.abort(); 14221 } 14222 14223 // Aborting is no longer a cancellation 14224 strAbort = "abort"; 14225 14226 // Install callbacks on deferreds 14227 completeDeferred.add( s.complete ); 14228 jqXHR.done( s.success ); 14229 jqXHR.fail( s.error ); 14230 14231 // Get transport 14232 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 14233 14234 // If no transport, we auto-abort 14235 if ( !transport ) { 14236 done( -1, "No Transport" ); 14237 } else { 14238 jqXHR.readyState = 1; 14239 14240 // Send global event 14241 if ( fireGlobals ) { 14242 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 14243 } 14244 14245 // If request was aborted inside ajaxSend, stop there 14246 if ( completed ) { 14247 return jqXHR; 14248 } 14249 14250 // Timeout 14251 if ( s.async && s.timeout > 0 ) { 14252 timeoutTimer = window.setTimeout( function() { 14253 jqXHR.abort( "timeout" ); 14254 }, s.timeout ); 14255 } 14256 14257 try { 14258 completed = false; 14259 transport.send( requestHeaders, done ); 14260 } catch ( e ) { 14261 14262 // Rethrow post-completion exceptions 14263 if ( completed ) { 14264 throw e; 14265 } 14266 14267 // Propagate others as results 14268 done( -1, e ); 14269 } 14270 } 14271 14272 // Callback for when everything is done 14273 function done( status, nativeStatusText, responses, headers ) { 14274 var isSuccess, success, error, response, modified, 14275 statusText = nativeStatusText; 14276 14277 // Ignore repeat invocations 14278 if ( completed ) { 14279 return; 14280 } 14281 14282 completed = true; 14283 14284 // Clear timeout if it exists 14285 if ( timeoutTimer ) { 14286 window.clearTimeout( timeoutTimer ); 14287 } 14288 14289 // Dereference transport for early garbage collection 14290 // (no matter how long the jqXHR object will be used) 14291 transport = undefined; 14292 14293 // Cache response headers 14294 responseHeadersString = headers || ""; 14295 14296 // Set readyState 14297 jqXHR.readyState = status > 0 ? 4 : 0; 14298 14299 // Determine if successful 14300 isSuccess = status >= 200 && status < 300 || status === 304; 14301 14302 // Get response data 14303 if ( responses ) { 14304 response = ajaxHandleResponses( s, jqXHR, responses ); 14305 } 14306 14307 // Use a noop converter for missing script 14308 if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { 14309 s.converters[ "text script" ] = function() {}; 14310 } 14311 14312 // Convert no matter what (that way responseXXX fields are always set) 14313 response = ajaxConvert( s, response, jqXHR, isSuccess ); 14314 14315 // If successful, handle type chaining 14316 if ( isSuccess ) { 14317 14318 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14319 if ( s.ifModified ) { 14320 modified = jqXHR.getResponseHeader( "Last-Modified" ); 14321 if ( modified ) { 14322 jQuery.lastModified[ cacheURL ] = modified; 14323 } 14324 modified = jqXHR.getResponseHeader( "etag" ); 14325 if ( modified ) { 14326 jQuery.etag[ cacheURL ] = modified; 14327 } 14328 } 14329 14330 // if no content 14331 if ( status === 204 || s.type === "HEAD" ) { 14332 statusText = "nocontent"; 14333 14334 // if not modified 14335 } else if ( status === 304 ) { 14336 statusText = "notmodified"; 14337 14338 // If we have data, let's convert it 14339 } else { 14340 statusText = response.state; 14341 success = response.data; 14342 error = response.error; 14343 isSuccess = !error; 14344 } 14345 } else { 14346 14347 // Extract error from statusText and normalize for non-aborts 14348 error = statusText; 14349 if ( status || !statusText ) { 14350 statusText = "error"; 14351 if ( status < 0 ) { 14352 status = 0; 14353 } 14354 } 14355 } 14356 14357 // Set data for the fake xhr object 14358 jqXHR.status = status; 14359 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 14360 14361 // Success/Error 14362 if ( isSuccess ) { 14363 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 14364 } else { 14365 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 14366 } 14367 14368 // Status-dependent callbacks 14369 jqXHR.statusCode( statusCode ); 14370 statusCode = undefined; 14371 14372 if ( fireGlobals ) { 14373 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 14374 [ jqXHR, s, isSuccess ? success : error ] ); 14375 } 14376 14377 // Complete 14378 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 14379 14380 if ( fireGlobals ) { 14381 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 14382 14383 // Handle the global AJAX counter 14384 if ( !( --jQuery.active ) ) { 14385 jQuery.event.trigger( "ajaxStop" ); 14386 } 14387 } 14388 } 14389 14390 return jqXHR; 14391 }, 14392 14393 getJSON: function( url, data, callback ) { 14394 return jQuery.get( url, data, callback, "json" ); 14395 }, 14396 14397 getScript: function( url, callback ) { 14398 return jQuery.get( url, undefined, callback, "script" ); 14399 } 14400} ); 14401 14402jQuery.each( [ "get", "post" ], function( _i, method ) { 14403 jQuery[ method ] = function( url, data, callback, type ) { 14404 14405 // Shift arguments if data argument was omitted 14406 if ( isFunction( data ) ) { 14407 type = type || callback; 14408 callback = data; 14409 data = undefined; 14410 } 14411 14412 // The url can be an options object (which then must have .url) 14413 return jQuery.ajax( jQuery.extend( { 14414 url: url, 14415 type: method, 14416 dataType: type, 14417 data: data, 14418 success: callback 14419 }, jQuery.isPlainObject( url ) && url ) ); 14420 }; 14421} ); 14422 14423jQuery.ajaxPrefilter( function( s ) { 14424 var i; 14425 for ( i in s.headers ) { 14426 if ( i.toLowerCase() === "content-type" ) { 14427 s.contentType = s.headers[ i ] || ""; 14428 } 14429 } 14430} ); 14431 14432 14433jQuery._evalUrl = function( url, options, doc ) { 14434 return jQuery.ajax( { 14435 url: url, 14436 14437 // Make this explicit, since user can override this through ajaxSetup (#11264) 14438 type: "GET", 14439 dataType: "script", 14440 cache: true, 14441 async: false, 14442 global: false, 14443 14444 // Only evaluate the response if it is successful (gh-4126) 14445 // dataFilter is not invoked for failure responses, so using it instead 14446 // of the default converter is kludgy but it works. 14447 converters: { 14448 "text script": function() {} 14449 }, 14450 dataFilter: function( response ) { 14451 jQuery.globalEval( response, options, doc ); 14452 } 14453 } ); 14454}; 14455 14456 14457jQuery.fn.extend( { 14458 wrapAll: function( html ) { 14459 var wrap; 14460 14461 if ( this[ 0 ] ) { 14462 if ( isFunction( html ) ) { 14463 html = html.call( this[ 0 ] ); 14464 } 14465 14466 // The elements to wrap the target around 14467 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 14468 14469 if ( this[ 0 ].parentNode ) { 14470 wrap.insertBefore( this[ 0 ] ); 14471 } 14472 14473 wrap.map( function() { 14474 var elem = this; 14475 14476 while ( elem.firstElementChild ) { 14477 elem = elem.firstElementChild; 14478 } 14479 14480 return elem; 14481 } ).append( this ); 14482 } 14483 14484 return this; 14485 }, 14486 14487 wrapInner: function( html ) { 14488 if ( isFunction( html ) ) { 14489 return this.each( function( i ) { 14490 jQuery( this ).wrapInner( html.call( this, i ) ); 14491 } ); 14492 } 14493 14494 return this.each( function() { 14495 var self = jQuery( this ), 14496 contents = self.contents(); 14497 14498 if ( contents.length ) { 14499 contents.wrapAll( html ); 14500 14501 } else { 14502 self.append( html ); 14503 } 14504 } ); 14505 }, 14506 14507 wrap: function( html ) { 14508 var htmlIsFunction = isFunction( html ); 14509 14510 return this.each( function( i ) { 14511 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 14512 } ); 14513 }, 14514 14515 unwrap: function( selector ) { 14516 this.parent( selector ).not( "body" ).each( function() { 14517 jQuery( this ).replaceWith( this.childNodes ); 14518 } ); 14519 return this; 14520 } 14521} ); 14522 14523 14524jQuery.expr.pseudos.hidden = function( elem ) { 14525 return !jQuery.expr.pseudos.visible( elem ); 14526}; 14527jQuery.expr.pseudos.visible = function( elem ) { 14528 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 14529}; 14530 14531 14532 14533 14534jQuery.ajaxSettings.xhr = function() { 14535 try { 14536 return new window.XMLHttpRequest(); 14537 } catch ( e ) {} 14538}; 14539 14540var xhrSuccessStatus = { 14541 14542 // File protocol always yields status code 0, assume 200 14543 0: 200, 14544 14545 // Support: IE <=9 only 14546 // #1450: sometimes IE returns 1223 when it should be 204 14547 1223: 204 14548 }, 14549 xhrSupported = jQuery.ajaxSettings.xhr(); 14550 14551support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 14552support.ajax = xhrSupported = !!xhrSupported; 14553 14554jQuery.ajaxTransport( function( options ) { 14555 var callback, errorCallback; 14556 14557 // Cross domain only allowed if supported through XMLHttpRequest 14558 if ( support.cors || xhrSupported && !options.crossDomain ) { 14559 return { 14560 send: function( headers, complete ) { 14561 var i, 14562 xhr = options.xhr(); 14563 14564 xhr.open( 14565 options.type, 14566 options.url, 14567 options.async, 14568 options.username, 14569 options.password 14570 ); 14571 14572 // Apply custom fields if provided 14573 if ( options.xhrFields ) { 14574 for ( i in options.xhrFields ) { 14575 xhr[ i ] = options.xhrFields[ i ]; 14576 } 14577 } 14578 14579 // Override mime type if needed 14580 if ( options.mimeType && xhr.overrideMimeType ) { 14581 xhr.overrideMimeType( options.mimeType ); 14582 } 14583 14584 // X-Requested-With header 14585 // For cross-domain requests, seeing as conditions for a preflight are 14586 // akin to a jigsaw puzzle, we simply never set it to be sure. 14587 // (it can always be set on a per-request basis or even using ajaxSetup) 14588 // For same-domain requests, won't change header if already provided. 14589 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 14590 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 14591 } 14592 14593 // Set headers 14594 for ( i in headers ) { 14595 xhr.setRequestHeader( i, headers[ i ] ); 14596 } 14597 14598 // Callback 14599 callback = function( type ) { 14600 return function() { 14601 if ( callback ) { 14602 callback = errorCallback = xhr.onload = 14603 xhr.onerror = xhr.onabort = xhr.ontimeout = 14604 xhr.onreadystatechange = null; 14605 14606 if ( type === "abort" ) { 14607 xhr.abort(); 14608 } else if ( type === "error" ) { 14609 14610 // Support: IE <=9 only 14611 // On a manual native abort, IE9 throws 14612 // errors on any property access that is not readyState 14613 if ( typeof xhr.status !== "number" ) { 14614 complete( 0, "error" ); 14615 } else { 14616 complete( 14617 14618 // File: protocol always yields status 0; see #8605, #14207 14619 xhr.status, 14620 xhr.statusText 14621 ); 14622 } 14623 } else { 14624 complete( 14625 xhrSuccessStatus[ xhr.status ] || xhr.status, 14626 xhr.statusText, 14627 14628 // Support: IE <=9 only 14629 // IE9 has no XHR2 but throws on binary (trac-11426) 14630 // For XHR2 non-text, let the caller handle it (gh-2498) 14631 ( xhr.responseType || "text" ) !== "text" || 14632 typeof xhr.responseText !== "string" ? 14633 { binary: xhr.response } : 14634 { text: xhr.responseText }, 14635 xhr.getAllResponseHeaders() 14636 ); 14637 } 14638 } 14639 }; 14640 }; 14641 14642 // Listen to events 14643 xhr.onload = callback(); 14644 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 14645 14646 // Support: IE 9 only 14647 // Use onreadystatechange to replace onabort 14648 // to handle uncaught aborts 14649 if ( xhr.onabort !== undefined ) { 14650 xhr.onabort = errorCallback; 14651 } else { 14652 xhr.onreadystatechange = function() { 14653 14654 // Check readyState before timeout as it changes 14655 if ( xhr.readyState === 4 ) { 14656 14657 // Allow onerror to be called first, 14658 // but that will not handle a native abort 14659 // Also, save errorCallback to a variable 14660 // as xhr.onerror cannot be accessed 14661 window.setTimeout( function() { 14662 if ( callback ) { 14663 errorCallback(); 14664 } 14665 } ); 14666 } 14667 }; 14668 } 14669 14670 // Create the abort callback 14671 callback = callback( "abort" ); 14672 14673 try { 14674 14675 // Do send the request (this may raise an exception) 14676 xhr.send( options.hasContent && options.data || null ); 14677 } catch ( e ) { 14678 14679 // #14683: Only rethrow if this hasn't been notified as an error yet 14680 if ( callback ) { 14681 throw e; 14682 } 14683 } 14684 }, 14685 14686 abort: function() { 14687 if ( callback ) { 14688 callback(); 14689 } 14690 } 14691 }; 14692 } 14693} ); 14694 14695 14696 14697 14698// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 14699jQuery.ajaxPrefilter( function( s ) { 14700 if ( s.crossDomain ) { 14701 s.contents.script = false; 14702 } 14703} ); 14704 14705// Install script dataType 14706jQuery.ajaxSetup( { 14707 accepts: { 14708 script: "text/javascript, application/javascript, " + 14709 "application/ecmascript, application/x-ecmascript" 14710 }, 14711 contents: { 14712 script: /\b(?:java|ecma)script\b/ 14713 }, 14714 converters: { 14715 "text script": function( text ) { 14716 jQuery.globalEval( text ); 14717 return text; 14718 } 14719 } 14720} ); 14721 14722// Handle cache's special case and crossDomain 14723jQuery.ajaxPrefilter( "script", function( s ) { 14724 if ( s.cache === undefined ) { 14725 s.cache = false; 14726 } 14727 if ( s.crossDomain ) { 14728 s.type = "GET"; 14729 } 14730} ); 14731 14732// Bind script tag hack transport 14733jQuery.ajaxTransport( "script", function( s ) { 14734 14735 // This transport only deals with cross domain or forced-by-attrs requests 14736 if ( s.crossDomain || s.scriptAttrs ) { 14737 var script, callback; 14738 return { 14739 send: function( _, complete ) { 14740 script = jQuery( "<script>" ) 14741 .attr( s.scriptAttrs || {} ) 14742 .prop( { charset: s.scriptCharset, src: s.url } ) 14743 .on( "load error", callback = function( evt ) { 14744 script.remove(); 14745 callback = null; 14746 if ( evt ) { 14747 complete( evt.type === "error" ? 404 : 200, evt.type ); 14748 } 14749 } ); 14750 14751 // Use native DOM manipulation to avoid our domManip AJAX trickery 14752 document.head.appendChild( script[ 0 ] ); 14753 }, 14754 abort: function() { 14755 if ( callback ) { 14756 callback(); 14757 } 14758 } 14759 }; 14760 } 14761} ); 14762 14763 14764 14765 14766var oldCallbacks = [], 14767 rjsonp = /(=)\?(?=&|$)|\?\?/; 14768 14769// Default jsonp settings 14770jQuery.ajaxSetup( { 14771 jsonp: "callback", 14772 jsonpCallback: function() { 14773 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 14774 this[ callback ] = true; 14775 return callback; 14776 } 14777} ); 14778 14779// Detect, normalize options and install callbacks for jsonp requests 14780jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 14781 14782 var callbackName, overwritten, responseContainer, 14783 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 14784 "url" : 14785 typeof s.data === "string" && 14786 ( s.contentType || "" ) 14787 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 14788 rjsonp.test( s.data ) && "data" 14789 ); 14790 14791 // Handle iff the expected data type is "jsonp" or we have a parameter to set 14792 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 14793 14794 // Get callback name, remembering preexisting value associated with it 14795 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 14796 s.jsonpCallback() : 14797 s.jsonpCallback; 14798 14799 // Insert callback into url or form data 14800 if ( jsonProp ) { 14801 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 14802 } else if ( s.jsonp !== false ) { 14803 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 14804 } 14805 14806 // Use data converter to retrieve json after script execution 14807 s.converters[ "script json" ] = function() { 14808 if ( !responseContainer ) { 14809 jQuery.error( callbackName + " was not called" ); 14810 } 14811 return responseContainer[ 0 ]; 14812 }; 14813 14814 // Force json dataType 14815 s.dataTypes[ 0 ] = "json"; 14816 14817 // Install callback 14818 overwritten = window[ callbackName ]; 14819 window[ callbackName ] = function() { 14820 responseContainer = arguments; 14821 }; 14822 14823 // Clean-up function (fires after converters) 14824 jqXHR.always( function() { 14825 14826 // If previous value didn't exist - remove it 14827 if ( overwritten === undefined ) { 14828 jQuery( window ).removeProp( callbackName ); 14829 14830 // Otherwise restore preexisting value 14831 } else { 14832 window[ callbackName ] = overwritten; 14833 } 14834 14835 // Save back as free 14836 if ( s[ callbackName ] ) { 14837 14838 // Make sure that re-using the options doesn't screw things around 14839 s.jsonpCallback = originalSettings.jsonpCallback; 14840 14841 // Save the callback name for future use 14842 oldCallbacks.push( callbackName ); 14843 } 14844 14845 // Call if it was a function and we have a response 14846 if ( responseContainer && isFunction( overwritten ) ) { 14847 overwritten( responseContainer[ 0 ] ); 14848 } 14849 14850 responseContainer = overwritten = undefined; 14851 } ); 14852 14853 // Delegate to script 14854 return "script"; 14855 } 14856} ); 14857 14858 14859 14860 14861// Support: Safari 8 only 14862// In Safari 8 documents created via document.implementation.createHTMLDocument 14863// collapse sibling forms: the second one becomes a child of the first one. 14864// Because of that, this security measure has to be disabled in Safari 8. 14865// https://bugs.webkit.org/show_bug.cgi?id=137337 14866support.createHTMLDocument = ( function() { 14867 var body = document.implementation.createHTMLDocument( "" ).body; 14868 body.innerHTML = "<form></form><form></form>"; 14869 return body.childNodes.length === 2; 14870} )(); 14871 14872 14873// Argument "data" should be string of html 14874// context (optional): If specified, the fragment will be created in this context, 14875// defaults to document 14876// keepScripts (optional): If true, will include scripts passed in the html string 14877jQuery.parseHTML = function( data, context, keepScripts ) { 14878 if ( typeof data !== "string" ) { 14879 return []; 14880 } 14881 if ( typeof context === "boolean" ) { 14882 keepScripts = context; 14883 context = false; 14884 } 14885 14886 var base, parsed, scripts; 14887 14888 if ( !context ) { 14889 14890 // Stop scripts or inline event handlers from being executed immediately 14891 // by using document.implementation 14892 if ( support.createHTMLDocument ) { 14893 context = document.implementation.createHTMLDocument( "" ); 14894 14895 // Set the base href for the created document 14896 // so any parsed elements with URLs 14897 // are based on the document's URL (gh-2965) 14898 base = context.createElement( "base" ); 14899 base.href = document.location.href; 14900 context.head.appendChild( base ); 14901 } else { 14902 context = document; 14903 } 14904 } 14905 14906 parsed = rsingleTag.exec( data ); 14907 scripts = !keepScripts && []; 14908 14909 // Single tag 14910 if ( parsed ) { 14911 return [ context.createElement( parsed[ 1 ] ) ]; 14912 } 14913 14914 parsed = buildFragment( [ data ], context, scripts ); 14915 14916 if ( scripts && scripts.length ) { 14917 jQuery( scripts ).remove(); 14918 } 14919 14920 return jQuery.merge( [], parsed.childNodes ); 14921}; 14922 14923 14924/** 14925 * Load a url into a page 14926 */ 14927jQuery.fn.load = function( url, params, callback ) { 14928 var selector, type, response, 14929 self = this, 14930 off = url.indexOf( " " ); 14931 14932 if ( off > -1 ) { 14933 selector = stripAndCollapse( url.slice( off ) ); 14934 url = url.slice( 0, off ); 14935 } 14936 14937 // If it's a function 14938 if ( isFunction( params ) ) { 14939 14940 // We assume that it's the callback 14941 callback = params; 14942 params = undefined; 14943 14944 // Otherwise, build a param string 14945 } else if ( params && typeof params === "object" ) { 14946 type = "POST"; 14947 } 14948 14949 // If we have elements to modify, make the request 14950 if ( self.length > 0 ) { 14951 jQuery.ajax( { 14952 url: url, 14953 14954 // If "type" variable is undefined, then "GET" method will be used. 14955 // Make value of this field explicit since 14956 // user can override it through ajaxSetup method 14957 type: type || "GET", 14958 dataType: "html", 14959 data: params 14960 } ).done( function( responseText ) { 14961 14962 // Save response for use in complete callback 14963 response = arguments; 14964 14965 self.html( selector ? 14966 14967 // If a selector was specified, locate the right elements in a dummy div 14968 // Exclude scripts to avoid IE 'Permission Denied' errors 14969 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 14970 14971 // Otherwise use the full result 14972 responseText ); 14973 14974 // If the request succeeds, this function gets "data", "status", "jqXHR" 14975 // but they are ignored because response was set above. 14976 // If it fails, this function gets "jqXHR", "status", "error" 14977 } ).always( callback && function( jqXHR, status ) { 14978 self.each( function() { 14979 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 14980 } ); 14981 } ); 14982 } 14983 14984 return this; 14985}; 14986 14987 14988 14989 14990jQuery.expr.pseudos.animated = function( elem ) { 14991 return jQuery.grep( jQuery.timers, function( fn ) { 14992 return elem === fn.elem; 14993 } ).length; 14994}; 14995 14996 14997 14998 14999jQuery.offset = { 15000 setOffset: function( elem, options, i ) { 15001 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 15002 position = jQuery.css( elem, "position" ), 15003 curElem = jQuery( elem ), 15004 props = {}; 15005 15006 // Set position first, in-case top/left are set even on static elem 15007 if ( position === "static" ) { 15008 elem.style.position = "relative"; 15009 } 15010 15011 curOffset = curElem.offset(); 15012 curCSSTop = jQuery.css( elem, "top" ); 15013 curCSSLeft = jQuery.css( elem, "left" ); 15014 calculatePosition = ( position === "absolute" || position === "fixed" ) && 15015 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 15016 15017 // Need to be able to calculate position if either 15018 // top or left is auto and position is either absolute or fixed 15019 if ( calculatePosition ) { 15020 curPosition = curElem.position(); 15021 curTop = curPosition.top; 15022 curLeft = curPosition.left; 15023 15024 } else { 15025 curTop = parseFloat( curCSSTop ) || 0; 15026 curLeft = parseFloat( curCSSLeft ) || 0; 15027 } 15028 15029 if ( isFunction( options ) ) { 15030 15031 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 15032 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 15033 } 15034 15035 if ( options.top != null ) { 15036 props.top = ( options.top - curOffset.top ) + curTop; 15037 } 15038 if ( options.left != null ) { 15039 props.left = ( options.left - curOffset.left ) + curLeft; 15040 } 15041 15042 if ( "using" in options ) { 15043 options.using.call( elem, props ); 15044 15045 } else { 15046 if ( typeof props.top === "number" ) { 15047 props.top += "px"; 15048 } 15049 if ( typeof props.left === "number" ) { 15050 props.left += "px"; 15051 } 15052 curElem.css( props ); 15053 } 15054 } 15055}; 15056 15057jQuery.fn.extend( { 15058 15059 // offset() relates an element's border box to the document origin 15060 offset: function( options ) { 15061 15062 // Preserve chaining for setter 15063 if ( arguments.length ) { 15064 return options === undefined ? 15065 this : 15066 this.each( function( i ) { 15067 jQuery.offset.setOffset( this, options, i ); 15068 } ); 15069 } 15070 15071 var rect, win, 15072 elem = this[ 0 ]; 15073 15074 if ( !elem ) { 15075 return; 15076 } 15077 15078 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 15079 // Support: IE <=11 only 15080 // Running getBoundingClientRect on a 15081 // disconnected node in IE throws an error 15082 if ( !elem.getClientRects().length ) { 15083 return { top: 0, left: 0 }; 15084 } 15085 15086 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 15087 rect = elem.getBoundingClientRect(); 15088 win = elem.ownerDocument.defaultView; 15089 return { 15090 top: rect.top + win.pageYOffset, 15091 left: rect.left + win.pageXOffset 15092 }; 15093 }, 15094 15095 // position() relates an element's margin box to its offset parent's padding box 15096 // This corresponds to the behavior of CSS absolute positioning 15097 position: function() { 15098 if ( !this[ 0 ] ) { 15099 return; 15100 } 15101 15102 var offsetParent, offset, doc, 15103 elem = this[ 0 ], 15104 parentOffset = { top: 0, left: 0 }; 15105 15106 // position:fixed elements are offset from the viewport, which itself always has zero offset 15107 if ( jQuery.css( elem, "position" ) === "fixed" ) { 15108 15109 // Assume position:fixed implies availability of getBoundingClientRect 15110 offset = elem.getBoundingClientRect(); 15111 15112 } else { 15113 offset = this.offset(); 15114 15115 // Account for the *real* offset parent, which can be the document or its root element 15116 // when a statically positioned element is identified 15117 doc = elem.ownerDocument; 15118 offsetParent = elem.offsetParent || doc.documentElement; 15119 while ( offsetParent && 15120 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 15121 jQuery.css( offsetParent, "position" ) === "static" ) { 15122 15123 offsetParent = offsetParent.parentNode; 15124 } 15125 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 15126 15127 // Incorporate borders into its offset, since they are outside its content origin 15128 parentOffset = jQuery( offsetParent ).offset(); 15129 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 15130 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 15131 } 15132 } 15133 15134 // Subtract parent offsets and element margins 15135 return { 15136 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 15137 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 15138 }; 15139 }, 15140 15141 // This method will return documentElement in the following cases: 15142 // 1) For the element inside the iframe without offsetParent, this method will return 15143 // documentElement of the parent window 15144 // 2) For the hidden or detached element 15145 // 3) For body or html element, i.e. in case of the html node - it will return itself 15146 // 15147 // but those exceptions were never presented as a real life use-cases 15148 // and might be considered as more preferable results. 15149 // 15150 // This logic, however, is not guaranteed and can change at any point in the future 15151 offsetParent: function() { 15152 return this.map( function() { 15153 var offsetParent = this.offsetParent; 15154 15155 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 15156 offsetParent = offsetParent.offsetParent; 15157 } 15158 15159 return offsetParent || documentElement; 15160 } ); 15161 } 15162} ); 15163 15164// Create scrollLeft and scrollTop methods 15165jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 15166 var top = "pageYOffset" === prop; 15167 15168 jQuery.fn[ method ] = function( val ) { 15169 return access( this, function( elem, method, val ) { 15170 15171 // Coalesce documents and windows 15172 var win; 15173 if ( isWindow( elem ) ) { 15174 win = elem; 15175 } else if ( elem.nodeType === 9 ) { 15176 win = elem.defaultView; 15177 } 15178 15179 if ( val === undefined ) { 15180 return win ? win[ prop ] : elem[ method ]; 15181 } 15182 15183 if ( win ) { 15184 win.scrollTo( 15185 !top ? val : win.pageXOffset, 15186 top ? val : win.pageYOffset 15187 ); 15188 15189 } else { 15190 elem[ method ] = val; 15191 } 15192 }, method, val, arguments.length ); 15193 }; 15194} ); 15195 15196// Support: Safari <=7 - 9.1, Chrome <=37 - 49 15197// Add the top/left cssHooks using jQuery.fn.position 15198// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 15199// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 15200// getComputedStyle returns percent when specified for top/left/bottom/right; 15201// rather than make the css module depend on the offset module, just check for it here 15202jQuery.each( [ "top", "left" ], function( _i, prop ) { 15203 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 15204 function( elem, computed ) { 15205 if ( computed ) { 15206 computed = curCSS( elem, prop ); 15207 15208 // If curCSS returns percentage, fallback to offset 15209 return rnumnonpx.test( computed ) ? 15210 jQuery( elem ).position()[ prop ] + "px" : 15211 computed; 15212 } 15213 } 15214 ); 15215} ); 15216 15217 15218// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 15219jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 15220 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 15221 function( defaultExtra, funcName ) { 15222 15223 // Margin is only for outerHeight, outerWidth 15224 jQuery.fn[ funcName ] = function( margin, value ) { 15225 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 15226 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 15227 15228 return access( this, function( elem, type, value ) { 15229 var doc; 15230 15231 if ( isWindow( elem ) ) { 15232 15233 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 15234 return funcName.indexOf( "outer" ) === 0 ? 15235 elem[ "inner" + name ] : 15236 elem.document.documentElement[ "client" + name ]; 15237 } 15238 15239 // Get document width or height 15240 if ( elem.nodeType === 9 ) { 15241 doc = elem.documentElement; 15242 15243 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 15244 // whichever is greatest 15245 return Math.max( 15246 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 15247 elem.body[ "offset" + name ], doc[ "offset" + name ], 15248 doc[ "client" + name ] 15249 ); 15250 } 15251 15252 return value === undefined ? 15253 15254 // Get width or height on the element, requesting but not forcing parseFloat 15255 jQuery.css( elem, type, extra ) : 15256 15257 // Set width or height on the element 15258 jQuery.style( elem, type, value, extra ); 15259 }, type, chainable ? margin : undefined, chainable ); 15260 }; 15261 } ); 15262} ); 15263 15264 15265jQuery.each( [ 15266 "ajaxStart", 15267 "ajaxStop", 15268 "ajaxComplete", 15269 "ajaxError", 15270 "ajaxSuccess", 15271 "ajaxSend" 15272], function( _i, type ) { 15273 jQuery.fn[ type ] = function( fn ) { 15274 return this.on( type, fn ); 15275 }; 15276} ); 15277 15278 15279 15280 15281jQuery.fn.extend( { 15282 15283 bind: function( types, data, fn ) { 15284 return this.on( types, null, data, fn ); 15285 }, 15286 unbind: function( types, fn ) { 15287 return this.off( types, null, fn ); 15288 }, 15289 15290 delegate: function( selector, types, data, fn ) { 15291 return this.on( types, selector, data, fn ); 15292 }, 15293 undelegate: function( selector, types, fn ) { 15294 15295 // ( namespace ) or ( selector, types [, fn] ) 15296 return arguments.length === 1 ? 15297 this.off( selector, "**" ) : 15298 this.off( types, selector || "**", fn ); 15299 }, 15300 15301 hover: function( fnOver, fnOut ) { 15302 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 15303 } 15304} ); 15305 15306jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + 15307 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 15308 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 15309 function( _i, name ) { 15310 15311 // Handle event binding 15312 jQuery.fn[ name ] = function( data, fn ) { 15313 return arguments.length > 0 ? 15314 this.on( name, null, data, fn ) : 15315 this.trigger( name ); 15316 }; 15317 } ); 15318 15319 15320 15321 15322// Support: Android <=4.0 only 15323// Make sure we trim BOM and NBSP 15324var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 15325 15326// Bind a function to a context, optionally partially applying any 15327// arguments. 15328// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 15329// However, it is not slated for removal any time soon 15330jQuery.proxy = function( fn, context ) { 15331 var tmp, args, proxy; 15332 15333 if ( typeof context === "string" ) { 15334 tmp = fn[ context ]; 15335 context = fn; 15336 fn = tmp; 15337 } 15338 15339 // Quick check to determine if target is callable, in the spec 15340 // this throws a TypeError, but we will just return undefined. 15341 if ( !isFunction( fn ) ) { 15342 return undefined; 15343 } 15344 15345 // Simulated bind 15346 args = slice.call( arguments, 2 ); 15347 proxy = function() { 15348 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 15349 }; 15350 15351 // Set the guid of unique handler to the same of original handler, so it can be removed 15352 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 15353 15354 return proxy; 15355}; 15356 15357jQuery.holdReady = function( hold ) { 15358 if ( hold ) { 15359 jQuery.readyWait++; 15360 } else { 15361 jQuery.ready( true ); 15362 } 15363}; 15364jQuery.isArray = Array.isArray; 15365jQuery.parseJSON = JSON.parse; 15366jQuery.nodeName = nodeName; 15367jQuery.isFunction = isFunction; 15368jQuery.isWindow = isWindow; 15369jQuery.camelCase = camelCase; 15370jQuery.type = toType; 15371 15372jQuery.now = Date.now; 15373 15374jQuery.isNumeric = function( obj ) { 15375 15376 // As of jQuery 3.0, isNumeric is limited to 15377 // strings and numbers (primitives or objects) 15378 // that can be coerced to finite numbers (gh-2662) 15379 var type = jQuery.type( obj ); 15380 return ( type === "number" || type === "string" ) && 15381 15382 // parseFloat NaNs numeric-cast false positives ("") 15383 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 15384 // subtraction forces infinities to NaN 15385 !isNaN( obj - parseFloat( obj ) ); 15386}; 15387 15388jQuery.trim = function( text ) { 15389 return text == null ? 15390 "" : 15391 ( text + "" ).replace( rtrim, "" ); 15392}; 15393 15394 15395 15396// Register as a named AMD module, since jQuery can be concatenated with other 15397// files that may use define, but not via a proper concatenation script that 15398// understands anonymous AMD modules. A named AMD is safest and most robust 15399// way to register. Lowercase jquery is used because AMD module names are 15400// derived from file names, and jQuery is normally delivered in a lowercase 15401// file name. Do this after creating the global so that if an AMD module wants 15402// to call noConflict to hide this version of jQuery, it will work. 15403 15404// Note that for maximum portability, libraries that are not jQuery should 15405// declare themselves as anonymous modules, and avoid setting a global if an 15406// AMD loader is present. jQuery is a special case. For more information, see 15407// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 15408 15409if ( true ) { 15410 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 15411 return jQuery; 15412 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 15413 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 15414} 15415 15416 15417 15418 15419var 15420 15421 // Map over jQuery in case of overwrite 15422 _jQuery = window.jQuery, 15423 15424 // Map over the $ in case of overwrite 15425 _$ = window.$; 15426 15427jQuery.noConflict = function( deep ) { 15428 if ( window.$ === jQuery ) { 15429 window.$ = _$; 15430 } 15431 15432 if ( deep && window.jQuery === jQuery ) { 15433 window.jQuery = _jQuery; 15434 } 15435 15436 return jQuery; 15437}; 15438 15439// Expose jQuery and $ identifiers, even in AMD 15440// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 15441// and CommonJS for browser emulators (#13566) 15442if ( typeof noGlobal === "undefined" ) { 15443 window.jQuery = window.$ = jQuery; 15444} 15445 15446 15447 15448 15449return jQuery; 15450} ); 15451 15452 15453/***/ }), 15454
vendor: 89,123 bytes, lines 15455-18084
15455/***/ "./node_modules/popper.js/dist/esm/popper.js": 15456/*!***************************************************!*\ 15457 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 15458 \***************************************************/ 15459/*! exports provided: default */ 15460/***/ (function(module, __webpack_exports__, __webpack_require__) { 15461 15462"use strict"; 15463__webpack_require__.r(__webpack_exports__); 15464/* WEBPACK VAR INJECTION */(function(global) {/**! 15465 * @fileOverview Kickass library to create and place poppers near their reference elements. 15466 * @version 1.16.1 15467 * @license 15468 * Copyright (c) 2016 Federico Zivolo and contributors 15469 * 15470 * Permission is hereby granted, free of charge, to any person obtaining a copy 15471 * of this software and associated documentation files (the "Software"), to deal 15472 * in the Software without restriction, including without limitation the rights 15473 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15474 * copies of the Software, and to permit persons to whom the Software is 15475 * furnished to do so, subject to the following conditions: 15476 * 15477 * The above copyright notice and this permission notice shall be included in all 15478 * copies or substantial portions of the Software. 15479 * 15480 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15481 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15482 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15483 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 15484 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 15485 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 15486 * SOFTWARE. 15487 */ 15488var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 15489 15490var timeoutDuration = function () { 15491 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 15492 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 15493 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 15494 return 1; 15495 } 15496 } 15497 return 0; 15498}(); 15499 15500function microtaskDebounce(fn) { 15501 var called = false; 15502 return function () { 15503 if (called) { 15504 return; 15505 } 15506 called = true; 15507 window.Promise.resolve().then(function () { 15508 called = false; 15509 fn(); 15510 }); 15511 }; 15512} 15513 15514function taskDebounce(fn) { 15515 var scheduled = false; 15516 return function () { 15517 if (!scheduled) { 15518 scheduled = true; 15519 setTimeout(function () { 15520 scheduled = false; 15521 fn(); 15522 }, timeoutDuration); 15523 } 15524 }; 15525} 15526 15527var supportsMicroTasks = isBrowser && window.Promise; 15528 15529/** 15530* Create a debounced version of a method, that's asynchronously deferred 15531* but called in the minimum time possible. 15532* 15533* @method 15534* @memberof Popper.Utils 15535* @argument {Function} fn 15536* @returns {Function} 15537*/ 15538var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 15539 15540/** 15541 * Check if the given variable is a function 15542 * @method 15543 * @memberof Popper.Utils 15544 * @argument {Any} functionToCheck - variable to check 15545 * @returns {Boolean} answer to: is a function? 15546 */ 15547function isFunction(functionToCheck) { 15548 var getType = {}; 15549 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 15550} 15551 15552/** 15553 * Get CSS computed property of the given element 15554 * @method 15555 * @memberof Popper.Utils 15556 * @argument {Eement} element 15557 * @argument {String} property 15558 */ 15559function getStyleComputedProperty(element, property) { 15560 if (element.nodeType !== 1) { 15561 return []; 15562 } 15563 // NOTE: 1 DOM access here 15564 var window = element.ownerDocument.defaultView; 15565 var css = window.getComputedStyle(element, null); 15566 return property ? css[property] : css; 15567} 15568 15569/** 15570 * Returns the parentNode or the host of the element 15571 * @method 15572 * @memberof Popper.Utils 15573 * @argument {Element} element 15574 * @returns {Element} parent 15575 */ 15576function getParentNode(element) { 15577 if (element.nodeName === 'HTML') { 15578 return element; 15579 } 15580 return element.parentNode || element.host; 15581} 15582 15583/** 15584 * Returns the scrolling parent of the given element 15585 * @method 15586 * @memberof Popper.Utils 15587 * @argument {Element} element 15588 * @returns {Element} scroll parent 15589 */ 15590function getScrollParent(element) { 15591 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 15592 if (!element) { 15593 return document.body; 15594 } 15595 15596 switch (element.nodeName) { 15597 case 'HTML': 15598 case 'BODY': 15599 return element.ownerDocument.body; 15600 case '#document': 15601 return element.body; 15602 } 15603 15604 // Firefox want us to check `-x` and `-y` variations as well 15605 15606 var _getStyleComputedProp = getStyleComputedProperty(element), 15607 overflow = _getStyleComputedProp.overflow, 15608 overflowX = _getStyleComputedProp.overflowX, 15609 overflowY = _getStyleComputedProp.overflowY; 15610 15611 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 15612 return element; 15613 } 15614 15615 return getScrollParent(getParentNode(element)); 15616} 15617 15618/** 15619 * Returns the reference node of the reference object, or the reference object itself. 15620 * @method 15621 * @memberof Popper.Utils 15622 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 15623 * @returns {Element} parent 15624 */ 15625function getReferenceNode(reference) { 15626 return reference && reference.referenceNode ? reference.referenceNode : reference; 15627} 15628 15629var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 15630var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 15631 15632/** 15633 * Determines if the browser is Internet Explorer 15634 * @method 15635 * @memberof Popper.Utils 15636 * @param {Number} version to check 15637 * @returns {Boolean} isIE 15638 */ 15639function isIE(version) { 15640 if (version === 11) { 15641 return isIE11; 15642 } 15643 if (version === 10) { 15644 return isIE10; 15645 } 15646 return isIE11 || isIE10; 15647} 15648 15649/** 15650 * Returns the offset parent of the given element 15651 * @method 15652 * @memberof Popper.Utils 15653 * @argument {Element} element 15654 * @returns {Element} offset parent 15655 */ 15656function getOffsetParent(element) { 15657 if (!element) { 15658 return document.documentElement; 15659 } 15660 15661 var noOffsetParent = isIE(10) ? document.body : null; 15662 15663 // NOTE: 1 DOM access here 15664 var offsetParent = element.offsetParent || null; 15665 // Skip hidden elements which don't have an offsetParent 15666 while (offsetParent === noOffsetParent && element.nextElementSibling) { 15667 offsetParent = (element = element.nextElementSibling).offsetParent; 15668 } 15669 15670 var nodeName = offsetParent && offsetParent.nodeName; 15671 15672 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 15673 return element ? element.ownerDocument.documentElement : document.documentElement; 15674 } 15675 15676 // .offsetParent will return the closest TH, TD or TABLE in case 15677 // no offsetParent is present, I hate this job... 15678 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 15679 return getOffsetParent(offsetParent); 15680 } 15681 15682 return offsetParent; 15683} 15684 15685function isOffsetContainer(element) { 15686 var nodeName = element.nodeName; 15687 15688 if (nodeName === 'BODY') { 15689 return false; 15690 } 15691 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 15692} 15693 15694/** 15695 * Finds the root node (document, shadowDOM root) of the given element 15696 * @method 15697 * @memberof Popper.Utils 15698 * @argument {Element} node 15699 * @returns {Element} root node 15700 */ 15701function getRoot(node) { 15702 if (node.parentNode !== null) { 15703 return getRoot(node.parentNode); 15704 } 15705 15706 return node; 15707} 15708 15709/** 15710 * Finds the offset parent common to the two provided nodes 15711 * @method 15712 * @memberof Popper.Utils 15713 * @argument {Element} element1 15714 * @argument {Element} element2 15715 * @returns {Element} common offset parent 15716 */ 15717function findCommonOffsetParent(element1, element2) { 15718 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 15719 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 15720 return document.documentElement; 15721 } 15722 15723 // Here we make sure to give as "start" the element that comes first in the DOM 15724 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 15725 var start = order ? element1 : element2; 15726 var end = order ? element2 : element1; 15727 15728 // Get common ancestor container 15729 var range = document.createRange(); 15730 range.setStart(start, 0); 15731 range.setEnd(end, 0); 15732 var commonAncestorContainer = range.commonAncestorContainer; 15733 15734 // Both nodes are inside #document 15735 15736 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 15737 if (isOffsetContainer(commonAncestorContainer)) { 15738 return commonAncestorContainer; 15739 } 15740 15741 return getOffsetParent(commonAncestorContainer); 15742 } 15743 15744 // one of the nodes is inside shadowDOM, find which one 15745 var element1root = getRoot(element1); 15746 if (element1root.host) { 15747 return findCommonOffsetParent(element1root.host, element2); 15748 } else { 15749 return findCommonOffsetParent(element1, getRoot(element2).host); 15750 } 15751} 15752 15753/** 15754 * Gets the scroll value of the given element in the given side (top and left) 15755 * @method 15756 * @memberof Popper.Utils 15757 * @argument {Element} element 15758 * @argument {String} side `top` or `left` 15759 * @returns {number} amount of scrolled pixels 15760 */ 15761function getScroll(element) { 15762 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 15763 15764 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 15765 var nodeName = element.nodeName; 15766 15767 if (nodeName === 'BODY' || nodeName === 'HTML') { 15768 var html = element.ownerDocument.documentElement; 15769 var scrollingElement = element.ownerDocument.scrollingElement || html; 15770 return scrollingElement[upperSide]; 15771 } 15772 15773 return element[upperSide]; 15774} 15775 15776/* 15777 * Sum or subtract the element scroll values (left and top) from a given rect object 15778 * @method 15779 * @memberof Popper.Utils 15780 * @param {Object} rect - Rect object you want to change 15781 * @param {HTMLElement} element - The element from the function reads the scroll values 15782 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 15783 * @return {Object} rect - The modifier rect object 15784 */ 15785function includeScroll(rect, element) { 15786 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 15787 15788 var scrollTop = getScroll(element, 'top'); 15789 var scrollLeft = getScroll(element, 'left'); 15790 var modifier = subtract ? -1 : 1; 15791 rect.top += scrollTop * modifier; 15792 rect.bottom += scrollTop * modifier; 15793 rect.left += scrollLeft * modifier; 15794 rect.right += scrollLeft * modifier; 15795 return rect; 15796} 15797 15798/* 15799 * Helper to detect borders of a given element 15800 * @method 15801 * @memberof Popper.Utils 15802 * @param {CSSStyleDeclaration} styles 15803 * Result of `getStyleComputedProperty` on the given element 15804 * @param {String} axis - `x` or `y` 15805 * @return {number} borders - The borders size of the given axis 15806 */ 15807 15808function getBordersSize(styles, axis) { 15809 var sideA = axis === 'x' ? 'Left' : 'Top'; 15810 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 15811 15812 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 15813} 15814 15815function getSize(axis, body, html, computedStyle) { 15816 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); 15817} 15818 15819function getWindowSizes(document) { 15820 var body = document.body; 15821 var html = document.documentElement; 15822 var computedStyle = isIE(10) && getComputedStyle(html); 15823 15824 return { 15825 height: getSize('Height', body, html, computedStyle), 15826 width: getSize('Width', body, html, computedStyle) 15827 }; 15828} 15829 15830var classCallCheck = function (instance, Constructor) { 15831 if (!(instance instanceof Constructor)) { 15832 throw new TypeError("Cannot call a class as a function"); 15833 } 15834}; 15835 15836var createClass = function () { 15837 function defineProperties(target, props) { 15838 for (var i = 0; i < props.length; i++) { 15839 var descriptor = props[i]; 15840 descriptor.enumerable = descriptor.enumerable || false; 15841 descriptor.configurable = true; 15842 if ("value" in descriptor) descriptor.writable = true; 15843 Object.defineProperty(target, descriptor.key, descriptor); 15844 } 15845 } 15846 15847 return function (Constructor, protoProps, staticProps) { 15848 if (protoProps) defineProperties(Constructor.prototype, protoProps); 15849 if (staticProps) defineProperties(Constructor, staticProps); 15850 return Constructor; 15851 }; 15852}(); 15853 15854 15855 15856 15857 15858var defineProperty = function (obj, key, value) { 15859 if (key in obj) { 15860 Object.defineProperty(obj, key, { 15861 value: value, 15862 enumerable: true, 15863 configurable: true, 15864 writable: true 15865 }); 15866 } else { 15867 obj[key] = value; 15868 } 15869 15870 return obj; 15871}; 15872 15873var _extends = Object.assign || function (target) { 15874 for (var i = 1; i < arguments.length; i++) { 15875 var source = arguments[i]; 15876 15877 for (var key in source) { 15878 if (Object.prototype.hasOwnProperty.call(source, key)) { 15879 target[key] = source[key]; 15880 } 15881 } 15882 } 15883 15884 return target; 15885}; 15886 15887/** 15888 * Given element offsets, generate an output similar to getBoundingClientRect 15889 * @method 15890 * @memberof Popper.Utils 15891 * @argument {Object} offsets 15892 * @returns {Object} ClientRect like output 15893 */ 15894function getClientRect(offsets) { 15895 return _extends({}, offsets, { 15896 right: offsets.left + offsets.width, 15897 bottom: offsets.top + offsets.height 15898 }); 15899} 15900 15901/** 15902 * Get bounding client rect of given element 15903 * @method 15904 * @memberof Popper.Utils 15905 * @param {HTMLElement} element 15906 * @return {Object} client rect 15907 */ 15908function getBoundingClientRect(element) { 15909 var rect = {}; 15910 15911 // IE10 10 FIX: Please, don't ask, the element isn't 15912 // considered in DOM in some circumstances... 15913 // This isn't reproducible in IE10 compatibility mode of IE11 15914 try { 15915 if (isIE(10)) { 15916 rect = element.getBoundingClientRect(); 15917 var scrollTop = getScroll(element, 'top'); 15918 var scrollLeft = getScroll(element, 'left'); 15919 rect.top += scrollTop; 15920 rect.left += scrollLeft; 15921 rect.bottom += scrollTop; 15922 rect.right += scrollLeft; 15923 } else { 15924 rect = element.getBoundingClientRect(); 15925 } 15926 } catch (e) {} 15927 15928 var result = { 15929 left: rect.left, 15930 top: rect.top, 15931 width: rect.right - rect.left, 15932 height: rect.bottom - rect.top 15933 }; 15934 15935 // subtract scrollbar size from sizes 15936 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 15937 var width = sizes.width || element.clientWidth || result.width; 15938 var height = sizes.height || element.clientHeight || result.height; 15939 15940 var horizScrollbar = element.offsetWidth - width; 15941 var vertScrollbar = element.offsetHeight - height; 15942 15943 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 15944 // we make this check conditional for performance reasons 15945 if (horizScrollbar || vertScrollbar) { 15946 var styles = getStyleComputedProperty(element); 15947 horizScrollbar -= getBordersSize(styles, 'x'); 15948 vertScrollbar -= getBordersSize(styles, 'y'); 15949 15950 result.width -= horizScrollbar; 15951 result.height -= vertScrollbar; 15952 } 15953 15954 return getClientRect(result); 15955} 15956 15957function getOffsetRectRelativeToArbitraryNode(children, parent) { 15958 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 15959 15960 var isIE10 = isIE(10); 15961 var isHTML = parent.nodeName === 'HTML'; 15962 var childrenRect = getBoundingClientRect(children); 15963 var parentRect = getBoundingClientRect(parent); 15964 var scrollParent = getScrollParent(children); 15965 15966 var styles = getStyleComputedProperty(parent); 15967 var borderTopWidth = parseFloat(styles.borderTopWidth); 15968 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 15969 15970 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 15971 if (fixedPosition && isHTML) { 15972 parentRect.top = Math.max(parentRect.top, 0); 15973 parentRect.left = Math.max(parentRect.left, 0); 15974 } 15975 var offsets = getClientRect({ 15976 top: childrenRect.top - parentRect.top - borderTopWidth, 15977 left: childrenRect.left - parentRect.left - borderLeftWidth, 15978 width: childrenRect.width, 15979 height: childrenRect.height 15980 }); 15981 offsets.marginTop = 0; 15982 offsets.marginLeft = 0; 15983 15984 // Subtract margins of documentElement in case it's being used as parent 15985 // we do this only on HTML because it's the only element that behaves 15986 // differently when margins are applied to it. The margins are included in 15987 // the box of the documentElement, in the other cases not. 15988 if (!isIE10 && isHTML) { 15989 var marginTop = parseFloat(styles.marginTop); 15990 var marginLeft = parseFloat(styles.marginLeft); 15991 15992 offsets.top -= borderTopWidth - marginTop; 15993 offsets.bottom -= borderTopWidth - marginTop; 15994 offsets.left -= borderLeftWidth - marginLeft; 15995 offsets.right -= borderLeftWidth - marginLeft; 15996 15997 // Attach marginTop and marginLeft because in some circumstances we may need them 15998 offsets.marginTop = marginTop; 15999 offsets.marginLeft = marginLeft; 16000 } 16001 16002 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 16003 offsets = includeScroll(offsets, parent); 16004 } 16005 16006 return offsets; 16007} 16008 16009function getViewportOffsetRectRelativeToArtbitraryNode(element) { 16010 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16011 16012 var html = element.ownerDocument.documentElement; 16013 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 16014 var width = Math.max(html.clientWidth, window.innerWidth || 0); 16015 var height = Math.max(html.clientHeight, window.innerHeight || 0); 16016 16017 var scrollTop = !excludeScroll ? getScroll(html) : 0; 16018 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 16019 16020 var offset = { 16021 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 16022 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 16023 width: width, 16024 height: height 16025 }; 16026 16027 return getClientRect(offset); 16028} 16029 16030/** 16031 * Check if the given element is fixed or is inside a fixed parent 16032 * @method 16033 * @memberof Popper.Utils 16034 * @argument {Element} element 16035 * @argument {Element} customContainer 16036 * @returns {Boolean} answer to "isFixed?" 16037 */ 16038function isFixed(element) { 16039 var nodeName = element.nodeName; 16040 if (nodeName === 'BODY' || nodeName === 'HTML') { 16041 return false; 16042 } 16043 if (getStyleComputedProperty(element, 'position') === 'fixed') { 16044 return true; 16045 } 16046 var parentNode = getParentNode(element); 16047 if (!parentNode) { 16048 return false; 16049 } 16050 return isFixed(parentNode); 16051} 16052 16053/** 16054 * Finds the first parent of an element that has a transformed property defined 16055 * @method 16056 * @memberof Popper.Utils 16057 * @argument {Element} element 16058 * @returns {Element} first transformed parent or documentElement 16059 */ 16060 16061function getFixedPositionOffsetParent(element) { 16062 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16063 if (!element || !element.parentElement || isIE()) { 16064 return document.documentElement; 16065 } 16066 var el = element.parentElement; 16067 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 16068 el = el.parentElement; 16069 } 16070 return el || document.documentElement; 16071} 16072 16073/** 16074 * Computed the boundaries limits and return them 16075 * @method 16076 * @memberof Popper.Utils 16077 * @param {HTMLElement} popper 16078 * @param {HTMLElement} reference 16079 * @param {number} padding 16080 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 16081 * @param {Boolean} fixedPosition - Is in fixed position mode 16082 * @returns {Object} Coordinates of the boundaries 16083 */ 16084function getBoundaries(popper, reference, padding, boundariesElement) { 16085 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 16086 16087 // NOTE: 1 DOM access here 16088 16089 var boundaries = { top: 0, left: 0 }; 16090 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16091 16092 // Handle viewport case 16093 if (boundariesElement === 'viewport') { 16094 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 16095 } else { 16096 // Handle other cases based on DOM element used as boundaries 16097 var boundariesNode = void 0; 16098 if (boundariesElement === 'scrollParent') { 16099 boundariesNode = getScrollParent(getParentNode(reference)); 16100 if (boundariesNode.nodeName === 'BODY') { 16101 boundariesNode = popper.ownerDocument.documentElement; 16102 } 16103 } else if (boundariesElement === 'window') { 16104 boundariesNode = popper.ownerDocument.documentElement; 16105 } else { 16106 boundariesNode = boundariesElement; 16107 } 16108 16109 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 16110 16111 // In case of HTML, we need a different computation 16112 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 16113 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 16114 height = _getWindowSizes.height, 16115 width = _getWindowSizes.width; 16116 16117 boundaries.top += offsets.top - offsets.marginTop; 16118 boundaries.bottom = height + offsets.top; 16119 boundaries.left += offsets.left - offsets.marginLeft; 16120 boundaries.right = width + offsets.left; 16121 } else { 16122 // for all the other DOM elements, this one is good 16123 boundaries = offsets; 16124 } 16125 } 16126 16127 // Add paddings 16128 padding = padding || 0; 16129 var isPaddingNumber = typeof padding === 'number'; 16130 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 16131 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 16132 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 16133 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 16134 16135 return boundaries; 16136} 16137 16138function getArea(_ref) { 16139 var width = _ref.width, 16140 height = _ref.height; 16141 16142 return width * height; 16143} 16144 16145/** 16146 * Utility used to transform the `auto` placement to the placement with more 16147 * available space. 16148 * @method 16149 * @memberof Popper.Utils 16150 * @argument {Object} data - The data object generated by update method 16151 * @argument {Object} options - Modifiers configuration and options 16152 * @returns {Object} The data object, properly modified 16153 */ 16154function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 16155 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 16156 16157 if (placement.indexOf('auto') === -1) { 16158 return placement; 16159 } 16160 16161 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 16162 16163 var rects = { 16164 top: { 16165 width: boundaries.width, 16166 height: refRect.top - boundaries.top 16167 }, 16168 right: { 16169 width: boundaries.right - refRect.right, 16170 height: boundaries.height 16171 }, 16172 bottom: { 16173 width: boundaries.width, 16174 height: boundaries.bottom - refRect.bottom 16175 }, 16176 left: { 16177 width: refRect.left - boundaries.left, 16178 height: boundaries.height 16179 } 16180 }; 16181 16182 var sortedAreas = Object.keys(rects).map(function (key) { 16183 return _extends({ 16184 key: key 16185 }, rects[key], { 16186 area: getArea(rects[key]) 16187 }); 16188 }).sort(function (a, b) { 16189 return b.area - a.area; 16190 }); 16191 16192 var filteredAreas = sortedAreas.filter(function (_ref2) { 16193 var width = _ref2.width, 16194 height = _ref2.height; 16195 return width >= popper.clientWidth && height >= popper.clientHeight; 16196 }); 16197 16198 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 16199 16200 var variation = placement.split('-')[1]; 16201 16202 return computedPlacement + (variation ? '-' + variation : ''); 16203} 16204 16205/** 16206 * Get offsets to the reference element 16207 * @method 16208 * @memberof Popper.Utils 16209 * @param {Object} state 16210 * @param {Element} popper - the popper element 16211 * @param {Element} reference - the reference element (the popper will be relative to this) 16212 * @param {Element} fixedPosition - is in fixed position mode 16213 * @returns {Object} An object containing the offsets which will be applied to the popper 16214 */ 16215function getReferenceOffsets(state, popper, reference) { 16216 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 16217 16218 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16219 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 16220} 16221 16222/** 16223 * Get the outer sizes of the given element (offset size + margins) 16224 * @method 16225 * @memberof Popper.Utils 16226 * @argument {Element} element 16227 * @returns {Object} object containing width and height properties 16228 */ 16229function getOuterSizes(element) { 16230 var window = element.ownerDocument.defaultView; 16231 var styles = window.getComputedStyle(element); 16232 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 16233 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 16234 var result = { 16235 width: element.offsetWidth + y, 16236 height: element.offsetHeight + x 16237 }; 16238 return result; 16239} 16240 16241/** 16242 * Get the opposite placement of the given one 16243 * @method 16244 * @memberof Popper.Utils 16245 * @argument {String} placement 16246 * @returns {String} flipped placement 16247 */ 16248function getOppositePlacement(placement) { 16249 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 16250 return placement.replace(/left|right|bottom|top/g, function (matched) { 16251 return hash[matched]; 16252 }); 16253} 16254 16255/** 16256 * Get offsets to the popper 16257 * @method 16258 * @memberof Popper.Utils 16259 * @param {Object} position - CSS position the Popper will get applied 16260 * @param {HTMLElement} popper - the popper element 16261 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 16262 * @param {String} placement - one of the valid placement options 16263 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 16264 */ 16265function getPopperOffsets(popper, referenceOffsets, placement) { 16266 placement = placement.split('-')[0]; 16267 16268 // Get popper node sizes 16269 var popperRect = getOuterSizes(popper); 16270 16271 // Add position, width and height to our offsets object 16272 var popperOffsets = { 16273 width: popperRect.width, 16274 height: popperRect.height 16275 }; 16276 16277 // depending by the popper placement we have to compute its offsets slightly differently 16278 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 16279 var mainSide = isHoriz ? 'top' : 'left'; 16280 var secondarySide = isHoriz ? 'left' : 'top'; 16281 var measurement = isHoriz ? 'height' : 'width'; 16282 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 16283 16284 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 16285 if (placement === secondarySide) { 16286 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 16287 } else { 16288 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 16289 } 16290 16291 return popperOffsets; 16292} 16293 16294/** 16295 * Mimics the `find` method of Array 16296 * @method 16297 * @memberof Popper.Utils 16298 * @argument {Array} arr 16299 * @argument prop 16300 * @argument value 16301 * @returns index or -1 16302 */ 16303function find(arr, check) { 16304 // use native find if supported 16305 if (Array.prototype.find) { 16306 return arr.find(check); 16307 } 16308 16309 // use `filter` to obtain the same behavior of `find` 16310 return arr.filter(check)[0]; 16311} 16312 16313/** 16314 * Return the index of the matching object 16315 * @method 16316 * @memberof Popper.Utils 16317 * @argument {Array} arr 16318 * @argument prop 16319 * @argument value 16320 * @returns index or -1 16321 */ 16322function findIndex(arr, prop, value) { 16323 // use native findIndex if supported 16324 if (Array.prototype.findIndex) { 16325 return arr.findIndex(function (cur) { 16326 return cur[prop] === value; 16327 }); 16328 } 16329 16330 // use `find` + `indexOf` if `findIndex` isn't supported 16331 var match = find(arr, function (obj) { 16332 return obj[prop] === value; 16333 }); 16334 return arr.indexOf(match); 16335} 16336 16337/** 16338 * Loop trough the list of modifiers and run them in order, 16339 * each of them will then edit the data object. 16340 * @method 16341 * @memberof Popper.Utils 16342 * @param {dataObject} data 16343 * @param {Array} modifiers 16344 * @param {String} ends - Optional modifier name used as stopper 16345 * @returns {dataObject} 16346 */ 16347function runModifiers(modifiers, data, ends) { 16348 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 16349 16350 modifiersToRun.forEach(function (modifier) { 16351 if (modifier['function']) { 16352 // eslint-disable-line dot-notation 16353 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 16354 } 16355 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 16356 if (modifier.enabled && isFunction(fn)) { 16357 // Add properties to offsets to make them a complete clientRect object 16358 // we do this before each modifier to make sure the previous one doesn't 16359 // mess with these values 16360 data.offsets.popper = getClientRect(data.offsets.popper); 16361 data.offsets.reference = getClientRect(data.offsets.reference); 16362 16363 data = fn(data, modifier); 16364 } 16365 }); 16366 16367 return data; 16368} 16369 16370/** 16371 * Updates the position of the popper, computing the new offsets and applying 16372 * the new style.<br /> 16373 * Prefer `scheduleUpdate` over `update` because of performance reasons. 16374 * @method 16375 * @memberof Popper 16376 */ 16377function update() { 16378 // if popper is destroyed, don't perform any further update 16379 if (this.state.isDestroyed) { 16380 return; 16381 } 16382 16383 var data = { 16384 instance: this, 16385 styles: {}, 16386 arrowStyles: {}, 16387 attributes: {}, 16388 flipped: false, 16389 offsets: {} 16390 }; 16391 16392 // compute reference element offsets 16393 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 16394 16395 // compute auto placement, store placement inside the data object, 16396 // modifiers will be able to edit `placement` if needed 16397 // and refer to originalPlacement to know the original value 16398 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 16399 16400 // store the computed placement inside `originalPlacement` 16401 data.originalPlacement = data.placement; 16402 16403 data.positionFixed = this.options.positionFixed; 16404 16405 // compute the popper offsets 16406 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 16407 16408 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 16409 16410 // run the modifiers 16411 data = runModifiers(this.modifiers, data); 16412 16413 // the first `update` will call `onCreate` callback 16414 // the other ones will call `onUpdate` callback 16415 if (!this.state.isCreated) { 16416 this.state.isCreated = true; 16417 this.options.onCreate(data); 16418 } else { 16419 this.options.onUpdate(data); 16420 } 16421} 16422 16423/** 16424 * Helper used to know if the given modifier is enabled. 16425 * @method 16426 * @memberof Popper.Utils 16427 * @returns {Boolean} 16428 */ 16429function isModifierEnabled(modifiers, modifierName) { 16430 return modifiers.some(function (_ref) { 16431 var name = _ref.name, 16432 enabled = _ref.enabled; 16433 return enabled && name === modifierName; 16434 }); 16435} 16436 16437/** 16438 * Get the prefixed supported property name 16439 * @method 16440 * @memberof Popper.Utils 16441 * @argument {String} property (camelCase) 16442 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 16443 */ 16444function getSupportedPropertyName(property) { 16445 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 16446 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 16447 16448 for (var i = 0; i < prefixes.length; i++) { 16449 var prefix = prefixes[i]; 16450 var toCheck = prefix ? '' + prefix + upperProp : property; 16451 if (typeof document.body.style[toCheck] !== 'undefined') { 16452 return toCheck; 16453 } 16454 } 16455 return null; 16456} 16457 16458/** 16459 * Destroys the popper. 16460 * @method 16461 * @memberof Popper 16462 */ 16463function destroy() { 16464 this.state.isDestroyed = true; 16465 16466 // touch DOM only if `applyStyle` modifier is enabled 16467 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 16468 this.popper.removeAttribute('x-placement'); 16469 this.popper.style.position = ''; 16470 this.popper.style.top = ''; 16471 this.popper.style.left = ''; 16472 this.popper.style.right = ''; 16473 this.popper.style.bottom = ''; 16474 this.popper.style.willChange = ''; 16475 this.popper.style[getSupportedPropertyName('transform')] = ''; 16476 } 16477 16478 this.disableEventListeners(); 16479 16480 // remove the popper if user explicitly asked for the deletion on destroy 16481 // do not use `remove` because IE11 doesn't support it 16482 if (this.options.removeOnDestroy) { 16483 this.popper.parentNode.removeChild(this.popper); 16484 } 16485 return this; 16486} 16487 16488/** 16489 * Get the window associated with the element 16490 * @argument {Element} element 16491 * @returns {Window} 16492 */ 16493function getWindow(element) { 16494 var ownerDocument = element.ownerDocument; 16495 return ownerDocument ? ownerDocument.defaultView : window; 16496} 16497 16498function attachToScrollParents(scrollParent, event, callback, scrollParents) { 16499 var isBody = scrollParent.nodeName === 'BODY'; 16500 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 16501 target.addEventListener(event, callback, { passive: true }); 16502 16503 if (!isBody) { 16504 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 16505 } 16506 scrollParents.push(target); 16507} 16508 16509/** 16510 * Setup needed event listeners used to update the popper position 16511 * @method 16512 * @memberof Popper.Utils 16513 * @private 16514 */ 16515function setupEventListeners(reference, options, state, updateBound) { 16516 // Resize event listener on window 16517 state.updateBound = updateBound; 16518 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 16519 16520 // Scroll event listener on scroll parents 16521 var scrollElement = getScrollParent(reference); 16522 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 16523 state.scrollElement = scrollElement; 16524 state.eventsEnabled = true; 16525 16526 return state; 16527} 16528 16529/** 16530 * It will add resize/scroll events and start recalculating 16531 * position of the popper element when they are triggered. 16532 * @method 16533 * @memberof Popper 16534 */ 16535function enableEventListeners() { 16536 if (!this.state.eventsEnabled) { 16537 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 16538 } 16539} 16540 16541/** 16542 * Remove event listeners used to update the popper position 16543 * @method 16544 * @memberof Popper.Utils 16545 * @private 16546 */ 16547function removeEventListeners(reference, state) { 16548 // Remove resize event listener on window 16549 getWindow(reference).removeEventListener('resize', state.updateBound); 16550 16551 // Remove scroll event listener on scroll parents 16552 state.scrollParents.forEach(function (target) { 16553 target.removeEventListener('scroll', state.updateBound); 16554 }); 16555 16556 // Reset state 16557 state.updateBound = null; 16558 state.scrollParents = []; 16559 state.scrollElement = null; 16560 state.eventsEnabled = false; 16561 return state; 16562} 16563 16564/** 16565 * It will remove resize/scroll events and won't recalculate popper position 16566 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 16567 * unless you call `update` method manually. 16568 * @method 16569 * @memberof Popper 16570 */ 16571function disableEventListeners() { 16572 if (this.state.eventsEnabled) { 16573 cancelAnimationFrame(this.scheduleUpdate); 16574 this.state = removeEventListeners(this.reference, this.state); 16575 } 16576} 16577 16578/** 16579 * Tells if a given input is a number 16580 * @method 16581 * @memberof Popper.Utils 16582 * @param {*} input to check 16583 * @return {Boolean} 16584 */ 16585function isNumeric(n) { 16586 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 16587} 16588 16589/** 16590 * Set the style to the given popper 16591 * @method 16592 * @memberof Popper.Utils 16593 * @argument {Element} element - Element to apply the style to 16594 * @argument {Object} styles 16595 * Object with a list of properties and values which will be applied to the element 16596 */ 16597function setStyles(element, styles) { 16598 Object.keys(styles).forEach(function (prop) { 16599 var unit = ''; 16600 // add unit if the value is numeric and is one of the following 16601 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 16602 unit = 'px'; 16603 } 16604 element.style[prop] = styles[prop] + unit; 16605 }); 16606} 16607 16608/** 16609 * Set the attributes to the given popper 16610 * @method 16611 * @memberof Popper.Utils 16612 * @argument {Element} element - Element to apply the attributes to 16613 * @argument {Object} styles 16614 * Object with a list of properties and values which will be applied to the element 16615 */ 16616function setAttributes(element, attributes) { 16617 Object.keys(attributes).forEach(function (prop) { 16618 var value = attributes[prop]; 16619 if (value !== false) { 16620 element.setAttribute(prop, attributes[prop]); 16621 } else { 16622 element.removeAttribute(prop); 16623 } 16624 }); 16625} 16626 16627/** 16628 * @function 16629 * @memberof Modifiers 16630 * @argument {Object} data - The data object generated by `update` method 16631 * @argument {Object} data.styles - List of style properties - values to apply to popper element 16632 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 16633 * @argument {Object} options - Modifiers configuration and options 16634 * @returns {Object} The same data object 16635 */ 16636function applyStyle(data) { 16637 // any property present in `data.styles` will be applied to the popper, 16638 // in this way we can make the 3rd party modifiers add custom styles to it 16639 // Be aware, modifiers could override the properties defined in the previous 16640 // lines of this modifier! 16641 setStyles(data.instance.popper, data.styles); 16642 16643 // any property present in `data.attributes` will be applied to the popper, 16644 // they will be set as HTML attributes of the element 16645 setAttributes(data.instance.popper, data.attributes); 16646 16647 // if arrowElement is defined and arrowStyles has some properties 16648 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 16649 setStyles(data.arrowElement, data.arrowStyles); 16650 } 16651 16652 return data; 16653} 16654 16655/** 16656 * Set the x-placement attribute before everything else because it could be used 16657 * to add margins to the popper margins needs to be calculated to get the 16658 * correct popper offsets. 16659 * @method 16660 * @memberof Popper.modifiers 16661 * @param {HTMLElement} reference - The reference element used to position the popper 16662 * @param {HTMLElement} popper - The HTML element used as popper 16663 * @param {Object} options - Popper.js options 16664 */ 16665function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 16666 // compute reference element offsets 16667 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 16668 16669 // compute auto placement, store placement inside the data object, 16670 // modifiers will be able to edit `placement` if needed 16671 // and refer to originalPlacement to know the original value 16672 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 16673 16674 popper.setAttribute('x-placement', placement); 16675 16676 // Apply `position` to popper before anything else because 16677 // without the position applied we can't guarantee correct computations 16678 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 16679 16680 return options; 16681} 16682 16683/** 16684 * @function 16685 * @memberof Popper.Utils 16686 * @argument {Object} data - The data object generated by `update` method 16687 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 16688 * @returns {Object} The popper's position offsets rounded 16689 * 16690 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 16691 * good as it can be within reason. 16692 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 16693 * 16694 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 16695 * as well on High DPI screens). 16696 * 16697 * Firefox prefers no rounding for positioning and does not have blurriness on 16698 * high DPI screens. 16699 * 16700 * Only horizontal placement and left/right values need to be considered. 16701 */ 16702function getRoundedOffsets(data, shouldRound) { 16703 var _data$offsets = data.offsets, 16704 popper = _data$offsets.popper, 16705 reference = _data$offsets.reference; 16706 var round = Math.round, 16707 floor = Math.floor; 16708 16709 var noRound = function noRound(v) { 16710 return v; 16711 }; 16712 16713 var referenceWidth = round(reference.width); 16714 var popperWidth = round(popper.width); 16715 16716 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 16717 var isVariation = data.placement.indexOf('-') !== -1; 16718 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 16719 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 16720 16721 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 16722 var verticalToInteger = !shouldRound ? noRound : round; 16723 16724 return { 16725 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 16726 top: verticalToInteger(popper.top), 16727 bottom: verticalToInteger(popper.bottom), 16728 right: horizontalToInteger(popper.right) 16729 }; 16730} 16731 16732var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 16733 16734/** 16735 * @function 16736 * @memberof Modifiers 16737 * @argument {Object} data - The data object generated by `update` method 16738 * @argument {Object} options - Modifiers configuration and options 16739 * @returns {Object} The data object, properly modified 16740 */ 16741function computeStyle(data, options) { 16742 var x = options.x, 16743 y = options.y; 16744 var popper = data.offsets.popper; 16745 16746 // Remove this legacy support in Popper.js v2 16747 16748 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 16749 return modifier.name === 'applyStyle'; 16750 }).gpuAcceleration; 16751 if (legacyGpuAccelerationOption !== undefined) { 16752 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 16753 } 16754 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 16755 16756 var offsetParent = getOffsetParent(data.instance.popper); 16757 var offsetParentRect = getBoundingClientRect(offsetParent); 16758 16759 // Styles 16760 var styles = { 16761 position: popper.position 16762 }; 16763 16764 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 16765 16766 var sideA = x === 'bottom' ? 'top' : 'bottom'; 16767 var sideB = y === 'right' ? 'left' : 'right'; 16768 16769 // if gpuAcceleration is set to `true` and transform is supported, 16770 // we use `translate3d` to apply the position to the popper we 16771 // automatically use the supported prefixed version if needed 16772 var prefixedProperty = getSupportedPropertyName('transform'); 16773 16774 // now, let's make a step back and look at this code closely (wtf?) 16775 // If the content of the popper grows once it's been positioned, it 16776 // may happen that the popper gets misplaced because of the new content 16777 // overflowing its reference element 16778 // To avoid this problem, we provide two options (x and y), which allow 16779 // the consumer to define the offset origin. 16780 // If we position a popper on top of a reference element, we can set 16781 // `x` to `top` to make the popper grow towards its top instead of 16782 // its bottom. 16783 var left = void 0, 16784 top = void 0; 16785 if (sideA === 'bottom') { 16786 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 16787 // and not the bottom of the html element 16788 if (offsetParent.nodeName === 'HTML') { 16789 top = -offsetParent.clientHeight + offsets.bottom; 16790 } else { 16791 top = -offsetParentRect.height + offsets.bottom; 16792 } 16793 } else { 16794 top = offsets.top; 16795 } 16796 if (sideB === 'right') { 16797 if (offsetParent.nodeName === 'HTML') { 16798 left = -offsetParent.clientWidth + offsets.right; 16799 } else { 16800 left = -offsetParentRect.width + offsets.right; 16801 } 16802 } else { 16803 left = offsets.left; 16804 } 16805 if (gpuAcceleration && prefixedProperty) { 16806 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 16807 styles[sideA] = 0; 16808 styles[sideB] = 0; 16809 styles.willChange = 'transform'; 16810 } else { 16811 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 16812 var invertTop = sideA === 'bottom' ? -1 : 1; 16813 var invertLeft = sideB === 'right' ? -1 : 1; 16814 styles[sideA] = top * invertTop; 16815 styles[sideB] = left * invertLeft; 16816 styles.willChange = sideA + ', ' + sideB; 16817 } 16818 16819 // Attributes 16820 var attributes = { 16821 'x-placement': data.placement 16822 }; 16823 16824 // Update `data` attributes, styles and arrowStyles 16825 data.attributes = _extends({}, attributes, data.attributes); 16826 data.styles = _extends({}, styles, data.styles); 16827 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 16828 16829 return data; 16830} 16831 16832/** 16833 * Helper used to know if the given modifier depends from another one.<br /> 16834 * It checks if the needed modifier is listed and enabled. 16835 * @method 16836 * @memberof Popper.Utils 16837 * @param {Array} modifiers - list of modifiers 16838 * @param {String} requestingName - name of requesting modifier 16839 * @param {String} requestedName - name of requested modifier 16840 * @returns {Boolean} 16841 */ 16842function isModifierRequired(modifiers, requestingName, requestedName) { 16843 var requesting = find(modifiers, function (_ref) { 16844 var name = _ref.name; 16845 return name === requestingName; 16846 }); 16847 16848 var isRequired = !!requesting && modifiers.some(function (modifier) { 16849 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 16850 }); 16851 16852 if (!isRequired) { 16853 var _requesting = '`' + requestingName + '`'; 16854 var requested = '`' + requestedName + '`'; 16855 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 16856 } 16857 return isRequired; 16858} 16859 16860/** 16861 * @function 16862 * @memberof Modifiers 16863 * @argument {Object} data - The data object generated by update method 16864 * @argument {Object} options - Modifiers configuration and options 16865 * @returns {Object} The data object, properly modified 16866 */ 16867function arrow(data, options) { 16868 var _data$offsets$arrow; 16869 16870 // arrow depends on keepTogether in order to work 16871 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 16872 return data; 16873 } 16874 16875 var arrowElement = options.element; 16876 16877 // if arrowElement is a string, suppose it's a CSS selector 16878 if (typeof arrowElement === 'string') { 16879 arrowElement = data.instance.popper.querySelector(arrowElement); 16880 16881 // if arrowElement is not found, don't run the modifier 16882 if (!arrowElement) { 16883 return data; 16884 } 16885 } else { 16886 // if the arrowElement isn't a query selector we must check that the 16887 // provided DOM node is child of its popper node 16888 if (!data.instance.popper.contains(arrowElement)) { 16889 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 16890 return data; 16891 } 16892 } 16893 16894 var placement = data.placement.split('-')[0]; 16895 var _data$offsets = data.offsets, 16896 popper = _data$offsets.popper, 16897 reference = _data$offsets.reference; 16898 16899 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 16900 16901 var len = isVertical ? 'height' : 'width'; 16902 var sideCapitalized = isVertical ? 'Top' : 'Left'; 16903 var side = sideCapitalized.toLowerCase(); 16904 var altSide = isVertical ? 'left' : 'top'; 16905 var opSide = isVertical ? 'bottom' : 'right'; 16906 var arrowElementSize = getOuterSizes(arrowElement)[len]; 16907 16908 // 16909 // extends keepTogether behavior making sure the popper and its 16910 // reference have enough pixels in conjunction 16911 // 16912 16913 // top/left side 16914 if (reference[opSide] - arrowElementSize < popper[side]) { 16915 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 16916 } 16917 // bottom/right side 16918 if (reference[side] + arrowElementSize > popper[opSide]) { 16919 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 16920 } 16921 data.offsets.popper = getClientRect(data.offsets.popper); 16922 16923 // compute center of the popper 16924 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 16925 16926 // Compute the sideValue using the updated popper offsets 16927 // take popper margin in account because we don't have this info available 16928 var css = getStyleComputedProperty(data.instance.popper); 16929 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 16930 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 16931 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 16932 16933 // prevent arrowElement from being placed not contiguously to its popper 16934 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 16935 16936 data.arrowElement = arrowElement; 16937 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 16938 16939 return data; 16940} 16941 16942/** 16943 * Get the opposite placement variation of the given one 16944 * @method 16945 * @memberof Popper.Utils 16946 * @argument {String} placement variation 16947 * @returns {String} flipped placement variation 16948 */ 16949function getOppositeVariation(variation) { 16950 if (variation === 'end') { 16951 return 'start'; 16952 } else if (variation === 'start') { 16953 return 'end'; 16954 } 16955 return variation; 16956} 16957 16958/** 16959 * List of accepted placements to use as values of the `placement` option.<br /> 16960 * Valid placements are: 16961 * - `auto` 16962 * - `top` 16963 * - `right` 16964 * - `bottom` 16965 * - `left` 16966 * 16967 * Each placement can have a variation from this list: 16968 * - `-start` 16969 * - `-end` 16970 * 16971 * Variations are interpreted easily if you think of them as the left to right 16972 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 16973 * is right.<br /> 16974 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 16975 * 16976 * Some valid examples are: 16977 * - `top-end` (on top of reference, right aligned) 16978 * - `right-start` (on right of reference, top aligned) 16979 * - `bottom` (on bottom, centered) 16980 * - `auto-end` (on the side with more space available, alignment depends by placement) 16981 * 16982 * @static 16983 * @type {Array} 16984 * @enum {String} 16985 * @readonly 16986 * @method placements 16987 * @memberof Popper 16988 */ 16989var 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']; 16990 16991// Get rid of `auto` `auto-start` and `auto-end` 16992var validPlacements = placements.slice(3); 16993 16994/** 16995 * Given an initial placement, returns all the subsequent placements 16996 * clockwise (or counter-clockwise). 16997 * 16998 * @method 16999 * @memberof Popper.Utils 17000 * @argument {String} placement - A valid placement (it accepts variations) 17001 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 17002 * @returns {Array} placements including their variations 17003 */ 17004function clockwise(placement) { 17005 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17006 17007 var index = validPlacements.indexOf(placement); 17008 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 17009 return counter ? arr.reverse() : arr; 17010} 17011 17012var BEHAVIORS = { 17013 FLIP: 'flip', 17014 CLOCKWISE: 'clockwise', 17015 COUNTERCLOCKWISE: 'counterclockwise' 17016}; 17017 17018/** 17019 * @function 17020 * @memberof Modifiers 17021 * @argument {Object} data - The data object generated by update method 17022 * @argument {Object} options - Modifiers configuration and options 17023 * @returns {Object} The data object, properly modified 17024 */ 17025function flip(data, options) { 17026 // if `inner` modifier is enabled, we can't use the `flip` modifier 17027 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 17028 return data; 17029 } 17030 17031 if (data.flipped && data.placement === data.originalPlacement) { 17032 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 17033 return data; 17034 } 17035 17036 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 17037 17038 var placement = data.placement.split('-')[0]; 17039 var placementOpposite = getOppositePlacement(placement); 17040 var variation = data.placement.split('-')[1] || ''; 17041 17042 var flipOrder = []; 17043 17044 switch (options.behavior) { 17045 case BEHAVIORS.FLIP: 17046 flipOrder = [placement, placementOpposite]; 17047 break; 17048 case BEHAVIORS.CLOCKWISE: 17049 flipOrder = clockwise(placement); 17050 break; 17051 case BEHAVIORS.COUNTERCLOCKWISE: 17052 flipOrder = clockwise(placement, true); 17053 break; 17054 default: 17055 flipOrder = options.behavior; 17056 } 17057 17058 flipOrder.forEach(function (step, index) { 17059 if (placement !== step || flipOrder.length === index + 1) { 17060 return data; 17061 } 17062 17063 placement = data.placement.split('-')[0]; 17064 placementOpposite = getOppositePlacement(placement); 17065 17066 var popperOffsets = data.offsets.popper; 17067 var refOffsets = data.offsets.reference; 17068 17069 // using floor because the reference offsets may contain decimals we are not going to consider here 17070 var floor = Math.floor; 17071 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); 17072 17073 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 17074 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 17075 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 17076 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 17077 17078 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 17079 17080 // flip the variation if required 17081 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17082 17083 // flips variation if reference element overflows boundaries 17084 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 17085 17086 // flips variation if popper content overflows boundaries 17087 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 17088 17089 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 17090 17091 if (overlapsRef || overflowsBoundaries || flippedVariation) { 17092 // this boolean to detect any flip loop 17093 data.flipped = true; 17094 17095 if (overlapsRef || overflowsBoundaries) { 17096 placement = flipOrder[index + 1]; 17097 } 17098 17099 if (flippedVariation) { 17100 variation = getOppositeVariation(variation); 17101 } 17102 17103 data.placement = placement + (variation ? '-' + variation : ''); 17104 17105 // this object contains `position`, we want to preserve it along with 17106 // any additional property we may add in the future 17107 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 17108 17109 data = runModifiers(data.instance.modifiers, data, 'flip'); 17110 } 17111 }); 17112 return data; 17113} 17114 17115/** 17116 * @function 17117 * @memberof Modifiers 17118 * @argument {Object} data - The data object generated by update method 17119 * @argument {Object} options - Modifiers configuration and options 17120 * @returns {Object} The data object, properly modified 17121 */ 17122function keepTogether(data) { 17123 var _data$offsets = data.offsets, 17124 popper = _data$offsets.popper, 17125 reference = _data$offsets.reference; 17126 17127 var placement = data.placement.split('-')[0]; 17128 var floor = Math.floor; 17129 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17130 var side = isVertical ? 'right' : 'bottom'; 17131 var opSide = isVertical ? 'left' : 'top'; 17132 var measurement = isVertical ? 'width' : 'height'; 17133 17134 if (popper[side] < floor(reference[opSide])) { 17135 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 17136 } 17137 if (popper[opSide] > floor(reference[side])) { 17138 data.offsets.popper[opSide] = floor(reference[side]); 17139 } 17140 17141 return data; 17142} 17143 17144/** 17145 * Converts a string containing value + unit into a px value number 17146 * @function 17147 * @memberof {modifiers~offset} 17148 * @private 17149 * @argument {String} str - Value + unit string 17150 * @argument {String} measurement - `height` or `width` 17151 * @argument {Object} popperOffsets 17152 * @argument {Object} referenceOffsets 17153 * @returns {Number|String} 17154 * Value in pixels, or original string if no values were extracted 17155 */ 17156function toValue(str, measurement, popperOffsets, referenceOffsets) { 17157 // separate value from unit 17158 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 17159 var value = +split[1]; 17160 var unit = split[2]; 17161 17162 // If it's not a number it's an operator, I guess 17163 if (!value) { 17164 return str; 17165 } 17166 17167 if (unit.indexOf('%') === 0) { 17168 var element = void 0; 17169 switch (unit) { 17170 case '%p': 17171 element = popperOffsets; 17172 break; 17173 case '%': 17174 case '%r': 17175 default: 17176 element = referenceOffsets; 17177 } 17178 17179 var rect = getClientRect(element); 17180 return rect[measurement] / 100 * value; 17181 } else if (unit === 'vh' || unit === 'vw') { 17182 // if is a vh or vw, we calculate the size based on the viewport 17183 var size = void 0; 17184 if (unit === 'vh') { 17185 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 17186 } else { 17187 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 17188 } 17189 return size / 100 * value; 17190 } else { 17191 // if is an explicit pixel unit, we get rid of the unit and keep the value 17192 // if is an implicit unit, it's px, and we return just the value 17193 return value; 17194 } 17195} 17196 17197/** 17198 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 17199 * @function 17200 * @memberof {modifiers~offset} 17201 * @private 17202 * @argument {String} offset 17203 * @argument {Object} popperOffsets 17204 * @argument {Object} referenceOffsets 17205 * @argument {String} basePlacement 17206 * @returns {Array} a two cells array with x and y offsets in numbers 17207 */ 17208function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 17209 var offsets = [0, 0]; 17210 17211 // Use height if placement is left or right and index is 0 otherwise use width 17212 // in this way the first offset will use an axis and the second one 17213 // will use the other one 17214 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 17215 17216 // Split the offset string to obtain a list of values and operands 17217 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 17218 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 17219 return frag.trim(); 17220 }); 17221 17222 // Detect if the offset string contains a pair of values or a single one 17223 // they could be separated by comma or space 17224 var divider = fragments.indexOf(find(fragments, function (frag) { 17225 return frag.search(/,|\s/) !== -1; 17226 })); 17227 17228 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 17229 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 17230 } 17231 17232 // If divider is found, we divide the list of values and operands to divide 17233 // them by ofset X and Y. 17234 var splitRegex = /\s*,\s*|\s+/; 17235 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]; 17236 17237 // Convert the values with units to absolute pixels to allow our computations 17238 ops = ops.map(function (op, index) { 17239 // Most of the units rely on the orientation of the popper 17240 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 17241 var mergeWithPrevious = false; 17242 return op 17243 // This aggregates any `+` or `-` sign that aren't considered operators 17244 // e.g.: 10 + +5 => [10, +, +5] 17245 .reduce(function (a, b) { 17246 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 17247 a[a.length - 1] = b; 17248 mergeWithPrevious = true; 17249 return a; 17250 } else if (mergeWithPrevious) { 17251 a[a.length - 1] += b; 17252 mergeWithPrevious = false; 17253 return a; 17254 } else { 17255 return a.concat(b); 17256 } 17257 }, []) 17258 // Here we convert the string values into number values (in px) 17259 .map(function (str) { 17260 return toValue(str, measurement, popperOffsets, referenceOffsets); 17261 }); 17262 }); 17263 17264 // Loop trough the offsets arrays and execute the operations 17265 ops.forEach(function (op, index) { 17266 op.forEach(function (frag, index2) { 17267 if (isNumeric(frag)) { 17268 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 17269 } 17270 }); 17271 }); 17272 return offsets; 17273} 17274 17275/** 17276 * @function 17277 * @memberof Modifiers 17278 * @argument {Object} data - The data object generated by update method 17279 * @argument {Object} options - Modifiers configuration and options 17280 * @argument {Number|String} options.offset=0 17281 * The offset value as described in the modifier description 17282 * @returns {Object} The data object, properly modified 17283 */ 17284function offset(data, _ref) { 17285 var offset = _ref.offset; 17286 var placement = data.placement, 17287 _data$offsets = data.offsets, 17288 popper = _data$offsets.popper, 17289 reference = _data$offsets.reference; 17290 17291 var basePlacement = placement.split('-')[0]; 17292 17293 var offsets = void 0; 17294 if (isNumeric(+offset)) { 17295 offsets = [+offset, 0]; 17296 } else { 17297 offsets = parseOffset(offset, popper, reference, basePlacement); 17298 } 17299 17300 if (basePlacement === 'left') { 17301 popper.top += offsets[0]; 17302 popper.left -= offsets[1]; 17303 } else if (basePlacement === 'right') { 17304 popper.top += offsets[0]; 17305 popper.left += offsets[1]; 17306 } else if (basePlacement === 'top') { 17307 popper.left += offsets[0]; 17308 popper.top -= offsets[1]; 17309 } else if (basePlacement === 'bottom') { 17310 popper.left += offsets[0]; 17311 popper.top += offsets[1]; 17312 } 17313 17314 data.popper = popper; 17315 return data; 17316} 17317 17318/** 17319 * @function 17320 * @memberof Modifiers 17321 * @argument {Object} data - The data object generated by `update` method 17322 * @argument {Object} options - Modifiers configuration and options 17323 * @returns {Object} The data object, properly modified 17324 */ 17325function preventOverflow(data, options) { 17326 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 17327 17328 // If offsetParent is the reference element, we really want to 17329 // go one step up and use the next offsetParent as reference to 17330 // avoid to make this modifier completely useless and look like broken 17331 if (data.instance.reference === boundariesElement) { 17332 boundariesElement = getOffsetParent(boundariesElement); 17333 } 17334 17335 // NOTE: DOM access here 17336 // resets the popper's position so that the document size can be calculated excluding 17337 // the size of the popper element itself 17338 var transformProp = getSupportedPropertyName('transform'); 17339 var popperStyles = data.instance.popper.style; // assignment to help minification 17340 var top = popperStyles.top, 17341 left = popperStyles.left, 17342 transform = popperStyles[transformProp]; 17343 17344 popperStyles.top = ''; 17345 popperStyles.left = ''; 17346 popperStyles[transformProp] = ''; 17347 17348 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 17349 17350 // NOTE: DOM access here 17351 // restores the original style properties after the offsets have been computed 17352 popperStyles.top = top; 17353 popperStyles.left = left; 17354 popperStyles[transformProp] = transform; 17355 17356 options.boundaries = boundaries; 17357 17358 var order = options.priority; 17359 var popper = data.offsets.popper; 17360 17361 var check = { 17362 primary: function primary(placement) { 17363 var value = popper[placement]; 17364 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 17365 value = Math.max(popper[placement], boundaries[placement]); 17366 } 17367 return defineProperty({}, placement, value); 17368 }, 17369 secondary: function secondary(placement) { 17370 var mainSide = placement === 'right' ? 'left' : 'top'; 17371 var value = popper[mainSide]; 17372 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 17373 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 17374 } 17375 return defineProperty({}, mainSide, value); 17376 } 17377 }; 17378 17379 order.forEach(function (placement) { 17380 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 17381 popper = _extends({}, popper, check[side](placement)); 17382 }); 17383 17384 data.offsets.popper = popper; 17385 17386 return data; 17387} 17388 17389/** 17390 * @function 17391 * @memberof Modifiers 17392 * @argument {Object} data - The data object generated by `update` method 17393 * @argument {Object} options - Modifiers configuration and options 17394 * @returns {Object} The data object, properly modified 17395 */ 17396function shift(data) { 17397 var placement = data.placement; 17398 var basePlacement = placement.split('-')[0]; 17399 var shiftvariation = placement.split('-')[1]; 17400 17401 // if shift shiftvariation is specified, run the modifier 17402 if (shiftvariation) { 17403 var _data$offsets = data.offsets, 17404 reference = _data$offsets.reference, 17405 popper = _data$offsets.popper; 17406 17407 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 17408 var side = isVertical ? 'left' : 'top'; 17409 var measurement = isVertical ? 'width' : 'height'; 17410 17411 var shiftOffsets = { 17412 start: defineProperty({}, side, reference[side]), 17413 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 17414 }; 17415 17416 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 17417 } 17418 17419 return data; 17420} 17421 17422/** 17423 * @function 17424 * @memberof Modifiers 17425 * @argument {Object} data - The data object generated by update method 17426 * @argument {Object} options - Modifiers configuration and options 17427 * @returns {Object} The data object, properly modified 17428 */ 17429function hide(data) { 17430 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 17431 return data; 17432 } 17433 17434 var refRect = data.offsets.reference; 17435 var bound = find(data.instance.modifiers, function (modifier) { 17436 return modifier.name === 'preventOverflow'; 17437 }).boundaries; 17438 17439 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 17440 // Avoid unnecessary DOM access if visibility hasn't changed 17441 if (data.hide === true) { 17442 return data; 17443 } 17444 17445 data.hide = true; 17446 data.attributes['x-out-of-boundaries'] = ''; 17447 } else { 17448 // Avoid unnecessary DOM access if visibility hasn't changed 17449 if (data.hide === false) { 17450 return data; 17451 } 17452 17453 data.hide = false; 17454 data.attributes['x-out-of-boundaries'] = false; 17455 } 17456 17457 return data; 17458} 17459 17460/** 17461 * @function 17462 * @memberof Modifiers 17463 * @argument {Object} data - The data object generated by `update` method 17464 * @argument {Object} options - Modifiers configuration and options 17465 * @returns {Object} The data object, properly modified 17466 */ 17467function inner(data) { 17468 var placement = data.placement; 17469 var basePlacement = placement.split('-')[0]; 17470 var _data$offsets = data.offsets, 17471 popper = _data$offsets.popper, 17472 reference = _data$offsets.reference; 17473 17474 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 17475 17476 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 17477 17478 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 17479 17480 data.placement = getOppositePlacement(placement); 17481 data.offsets.popper = getClientRect(popper); 17482 17483 return data; 17484} 17485 17486/** 17487 * Modifier function, each modifier can have a function of this type assigned 17488 * to its `fn` property.<br /> 17489 * These functions will be called on each update, this means that you must 17490 * make sure they are performant enough to avoid performance bottlenecks. 17491 * 17492 * @function ModifierFn 17493 * @argument {dataObject} data - The data object generated by `update` method 17494 * @argument {Object} options - Modifiers configuration and options 17495 * @returns {dataObject} The data object, properly modified 17496 */ 17497 17498/** 17499 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 17500 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 17501 * needed by the library. 17502 * 17503 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 17504 * All the other properties are configurations that could be tweaked. 17505 * @namespace modifiers 17506 */ 17507var modifiers = { 17508 /** 17509 * Modifier used to shift the popper on the start or end of its reference 17510 * element.<br /> 17511 * It will read the variation of the `placement` property.<br /> 17512 * It can be one either `-end` or `-start`. 17513 * @memberof modifiers 17514 * @inner 17515 */ 17516 shift: { 17517 /** @prop {number} order=100 - Index used to define the order of execution */ 17518 order: 100, 17519 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17520 enabled: true, 17521 /** @prop {ModifierFn} */ 17522 fn: shift 17523 }, 17524 17525 /** 17526 * The `offset` modifier can shift your popper on both its axis. 17527 * 17528 * It accepts the following units: 17529 * - `px` or unit-less, interpreted as pixels 17530 * - `%` or `%r`, percentage relative to the length of the reference element 17531 * - `%p`, percentage relative to the length of the popper element 17532 * - `vw`, CSS viewport width unit 17533 * - `vh`, CSS viewport height unit 17534 * 17535 * For length is intended the main axis relative to the placement of the popper.<br /> 17536 * This means that if the placement is `top` or `bottom`, the length will be the 17537 * `width`. In case of `left` or `right`, it will be the `height`. 17538 * 17539 * You can provide a single value (as `Number` or `String`), or a pair of values 17540 * as `String` divided by a comma or one (or more) white spaces.<br /> 17541 * The latter is a deprecated method because it leads to confusion and will be 17542 * removed in v2.<br /> 17543 * Additionally, it accepts additions and subtractions between different units. 17544 * Note that multiplications and divisions aren't supported. 17545 * 17546 * Valid examples are: 17547 * ``` 17548 * 10 17549 * '10%' 17550 * '10, 10' 17551 * '10%, 10' 17552 * '10 + 10%' 17553 * '10 - 5vh + 3%' 17554 * '-10px + 5vh, 5px - 6%' 17555 * ``` 17556 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 17557 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 17558 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 17559 * 17560 * @memberof modifiers 17561 * @inner 17562 */ 17563 offset: { 17564 /** @prop {number} order=200 - Index used to define the order of execution */ 17565 order: 200, 17566 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17567 enabled: true, 17568 /** @prop {ModifierFn} */ 17569 fn: offset, 17570 /** @prop {Number|String} offset=0 17571 * The offset value as described in the modifier description 17572 */ 17573 offset: 0 17574 }, 17575 17576 /** 17577 * Modifier used to prevent the popper from being positioned outside the boundary. 17578 * 17579 * A scenario exists where the reference itself is not within the boundaries.<br /> 17580 * We can say it has "escaped the boundaries" — or just "escaped".<br /> 17581 * In this case we need to decide whether the popper should either: 17582 * 17583 * - detach from the reference and remain "trapped" in the boundaries, or 17584 * - if it should ignore the boundary and "escape with its reference" 17585 * 17586 * When `escapeWithReference` is set to`true` and reference is completely 17587 * outside its boundaries, the popper will overflow (or completely leave) 17588 * the boundaries in order to remain attached to the edge of the reference. 17589 * 17590 * @memberof modifiers 17591 * @inner 17592 */ 17593 preventOverflow: { 17594 /** @prop {number} order=300 - Index used to define the order of execution */ 17595 order: 300, 17596 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17597 enabled: true, 17598 /** @prop {ModifierFn} */ 17599 fn: preventOverflow, 17600 /** 17601 * @prop {Array} [priority=['left','right','top','bottom']] 17602 * Popper will try to prevent overflow following these priorities by default, 17603 * then, it could overflow on the left and on top of the `boundariesElement` 17604 */ 17605 priority: ['left', 'right', 'top', 'bottom'], 17606 /** 17607 * @prop {number} padding=5 17608 * Amount of pixel used to define a minimum distance between the boundaries 17609 * and the popper. This makes sure the popper always has a little padding 17610 * between the edges of its container 17611 */ 17612 padding: 5, 17613 /** 17614 * @prop {String|HTMLElement} boundariesElement='scrollParent' 17615 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 17616 * `viewport` or any DOM element. 17617 */ 17618 boundariesElement: 'scrollParent' 17619 }, 17620 17621 /** 17622 * Modifier used to make sure the reference and its popper stay near each other 17623 * without leaving any gap between the two. Especially useful when the arrow is 17624 * enabled and you want to ensure that it points to its reference element. 17625 * It cares only about the first axis. You can still have poppers with margin 17626 * between the popper and its reference element. 17627 * @memberof modifiers 17628 * @inner 17629 */ 17630 keepTogether: { 17631 /** @prop {number} order=400 - Index used to define the order of execution */ 17632 order: 400, 17633 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17634 enabled: true, 17635 /** @prop {ModifierFn} */ 17636 fn: keepTogether 17637 }, 17638 17639 /** 17640 * This modifier is used to move the `arrowElement` of the popper to make 17641 * sure it is positioned between the reference element and its popper element. 17642 * It will read the outer size of the `arrowElement` node to detect how many 17643 * pixels of conjunction are needed. 17644 * 17645 * It has no effect if no `arrowElement` is provided. 17646 * @memberof modifiers 17647 * @inner 17648 */ 17649 arrow: { 17650 /** @prop {number} order=500 - Index used to define the order of execution */ 17651 order: 500, 17652 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17653 enabled: true, 17654 /** @prop {ModifierFn} */ 17655 fn: arrow, 17656 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 17657 element: '[x-arrow]' 17658 }, 17659 17660 /** 17661 * Modifier used to flip the popper's placement when it starts to overlap its 17662 * reference element. 17663 * 17664 * Requires the `preventOverflow` modifier before it in order to work. 17665 * 17666 * **NOTE:** this modifier will interrupt the current update cycle and will 17667 * restart it if it detects the need to flip the placement. 17668 * @memberof modifiers 17669 * @inner 17670 */ 17671 flip: { 17672 /** @prop {number} order=600 - Index used to define the order of execution */ 17673 order: 600, 17674 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17675 enabled: true, 17676 /** @prop {ModifierFn} */ 17677 fn: flip, 17678 /** 17679 * @prop {String|Array} behavior='flip' 17680 * The behavior used to change the popper's placement. It can be one of 17681 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 17682 * placements (with optional variations) 17683 */ 17684 behavior: 'flip', 17685 /** 17686 * @prop {number} padding=5 17687 * The popper will flip if it hits the edges of the `boundariesElement` 17688 */ 17689 padding: 5, 17690 /** 17691 * @prop {String|HTMLElement} boundariesElement='viewport' 17692 * The element which will define the boundaries of the popper position. 17693 * The popper will never be placed outside of the defined boundaries 17694 * (except if `keepTogether` is enabled) 17695 */ 17696 boundariesElement: 'viewport', 17697 /** 17698 * @prop {Boolean} flipVariations=false 17699 * The popper will switch placement variation between `-start` and `-end` when 17700 * the reference element overlaps its boundaries. 17701 * 17702 * The original placement should have a set variation. 17703 */ 17704 flipVariations: false, 17705 /** 17706 * @prop {Boolean} flipVariationsByContent=false 17707 * The popper will switch placement variation between `-start` and `-end` when 17708 * the popper element overlaps its reference boundaries. 17709 * 17710 * The original placement should have a set variation. 17711 */ 17712 flipVariationsByContent: false 17713 }, 17714 17715 /** 17716 * Modifier used to make the popper flow toward the inner of the reference element. 17717 * By default, when this modifier is disabled, the popper will be placed outside 17718 * the reference element. 17719 * @memberof modifiers 17720 * @inner 17721 */ 17722 inner: { 17723 /** @prop {number} order=700 - Index used to define the order of execution */ 17724 order: 700, 17725 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 17726 enabled: false, 17727 /** @prop {ModifierFn} */ 17728 fn: inner 17729 }, 17730 17731 /** 17732 * Modifier used to hide the popper when its reference element is outside of the 17733 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 17734 * be used to hide with a CSS selector the popper when its reference is 17735 * out of boundaries. 17736 * 17737 * Requires the `preventOverflow` modifier before it in order to work. 17738 * @memberof modifiers 17739 * @inner 17740 */ 17741 hide: { 17742 /** @prop {number} order=800 - Index used to define the order of execution */ 17743 order: 800, 17744 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17745 enabled: true, 17746 /** @prop {ModifierFn} */ 17747 fn: hide 17748 }, 17749 17750 /** 17751 * Computes the style that will be applied to the popper element to gets 17752 * properly positioned. 17753 * 17754 * Note that this modifier will not touch the DOM, it just prepares the styles 17755 * so that `applyStyle` modifier can apply it. This separation is useful 17756 * in case you need to replace `applyStyle` with a custom implementation. 17757 * 17758 * This modifier has `850` as `order` value to maintain backward compatibility 17759 * with previous versions of Popper.js. Expect the modifiers ordering method 17760 * to change in future major versions of the library. 17761 * 17762 * @memberof modifiers 17763 * @inner 17764 */ 17765 computeStyle: { 17766 /** @prop {number} order=850 - Index used to define the order of execution */ 17767 order: 850, 17768 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17769 enabled: true, 17770 /** @prop {ModifierFn} */ 17771 fn: computeStyle, 17772 /** 17773 * @prop {Boolean} gpuAcceleration=true 17774 * If true, it uses the CSS 3D transformation to position the popper. 17775 * Otherwise, it will use the `top` and `left` properties 17776 */ 17777 gpuAcceleration: true, 17778 /** 17779 * @prop {string} [x='bottom'] 17780 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 17781 * Change this if your popper should grow in a direction different from `bottom` 17782 */ 17783 x: 'bottom', 17784 /** 17785 * @prop {string} [x='left'] 17786 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 17787 * Change this if your popper should grow in a direction different from `right` 17788 */ 17789 y: 'right' 17790 }, 17791 17792 /** 17793 * Applies the computed styles to the popper element. 17794 * 17795 * All the DOM manipulations are limited to this modifier. This is useful in case 17796 * you want to integrate Popper.js inside a framework or view library and you 17797 * want to delegate all the DOM manipulations to it. 17798 * 17799 * Note that if you disable this modifier, you must make sure the popper element 17800 * has its position set to `absolute` before Popper.js can do its work! 17801 * 17802 * Just disable this modifier and define your own to achieve the desired effect. 17803 * 17804 * @memberof modifiers 17805 * @inner 17806 */ 17807 applyStyle: { 17808 /** @prop {number} order=900 - Index used to define the order of execution */ 17809 order: 900, 17810 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 17811 enabled: true, 17812 /** @prop {ModifierFn} */ 17813 fn: applyStyle, 17814 /** @prop {Function} */ 17815 onLoad: applyStyleOnLoad, 17816 /** 17817 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 17818 * @prop {Boolean} gpuAcceleration=true 17819 * If true, it uses the CSS 3D transformation to position the popper. 17820 * Otherwise, it will use the `top` and `left` properties 17821 */ 17822 gpuAcceleration: undefined 17823 } 17824}; 17825 17826/** 17827 * The `dataObject` is an object containing all the information used by Popper.js. 17828 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 17829 * @name dataObject 17830 * @property {Object} data.instance The Popper.js instance 17831 * @property {String} data.placement Placement applied to popper 17832 * @property {String} data.originalPlacement Placement originally defined on init 17833 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 17834 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 17835 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 17836 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 17837 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 17838 * @property {Object} data.boundaries Offsets of the popper boundaries 17839 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 17840 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 17841 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 17842 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 17843 */ 17844 17845/** 17846 * Default options provided to Popper.js constructor.<br /> 17847 * These can be overridden using the `options` argument of Popper.js.<br /> 17848 * To override an option, simply pass an object with the same 17849 * structure of the `options` object, as the 3rd argument. For example: 17850 * ``` 17851 * new Popper(ref, pop, { 17852 * modifiers: { 17853 * preventOverflow: { enabled: false } 17854 * } 17855 * }) 17856 * ``` 17857 * @type {Object} 17858 * @static 17859 * @memberof Popper 17860 */ 17861var Defaults = { 17862 /** 17863 * Popper's placement. 17864 * @prop {Popper.placements} placement='bottom' 17865 */ 17866 placement: 'bottom', 17867 17868 /** 17869 * Set this to true if you want popper to position it self in 'fixed' mode 17870 * @prop {Boolean} positionFixed=false 17871 */ 17872 positionFixed: false, 17873 17874 /** 17875 * Whether events (resize, scroll) are initially enabled. 17876 * @prop {Boolean} eventsEnabled=true 17877 */ 17878 eventsEnabled: true, 17879 17880 /** 17881 * Set to true if you want to automatically remove the popper when 17882 * you call the `destroy` method. 17883 * @prop {Boolean} removeOnDestroy=false 17884 */ 17885 removeOnDestroy: false, 17886 17887 /** 17888 * Callback called when the popper is created.<br /> 17889 * By default, it is set to no-op.<br /> 17890 * Access Popper.js instance with `data.instance`. 17891 * @prop {onCreate} 17892 */ 17893 onCreate: function onCreate() {}, 17894 17895 /** 17896 * Callback called when the popper is updated. This callback is not called 17897 * on the initialization/creation of the popper, but only on subsequent 17898 * updates.<br /> 17899 * By default, it is set to no-op.<br /> 17900 * Access Popper.js instance with `data.instance`. 17901 * @prop {onUpdate} 17902 */ 17903 onUpdate: function onUpdate() {}, 17904 17905 /** 17906 * List of modifiers used to modify the offsets before they are applied to the popper. 17907 * They provide most of the functionalities of Popper.js. 17908 * @prop {modifiers} 17909 */ 17910 modifiers: modifiers 17911}; 17912 17913/** 17914 * @callback onCreate 17915 * @param {dataObject} data 17916 */ 17917 17918/** 17919 * @callback onUpdate 17920 * @param {dataObject} data 17921 */ 17922 17923// Utils 17924// Methods 17925var Popper = function () { 17926 /** 17927 * Creates a new Popper.js instance. 17928 * @class Popper 17929 * @param {Element|referenceObject} reference - The reference element used to position the popper 17930 * @param {Element} popper - The HTML / XML element used as the popper 17931 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 17932 * @return {Object} instance - The generated Popper.js instance 17933 */ 17934 function Popper(reference, popper) { 17935 var _this = this; 17936 17937 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 17938 classCallCheck(this, Popper); 17939 17940 this.scheduleUpdate = function () { 17941 return requestAnimationFrame(_this.update); 17942 }; 17943 17944 // make update() debounced, so that it only runs at most once-per-tick 17945 this.update = debounce(this.update.bind(this)); 17946 17947 // with {} we create a new object with the options inside it 17948 this.options = _extends({}, Popper.Defaults, options); 17949 17950 // init state 17951 this.state = { 17952 isDestroyed: false, 17953 isCreated: false, 17954 scrollParents: [] 17955 }; 17956 17957 // get reference and popper elements (allow jQuery wrappers) 17958 this.reference = reference && reference.jquery ? reference[0] : reference; 17959 this.popper = popper && popper.jquery ? popper[0] : popper; 17960 17961 // Deep merge modifiers options 17962 this.options.modifiers = {}; 17963 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 17964 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 17965 }); 17966 17967 // Refactoring modifiers' list (Object => Array) 17968 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 17969 return _extends({ 17970 name: name 17971 }, _this.options.modifiers[name]); 17972 }) 17973 // sort the modifiers by order 17974 .sort(function (a, b) { 17975 return a.order - b.order; 17976 }); 17977 17978 // modifiers have the ability to execute arbitrary code when Popper.js get inited 17979 // such code is executed in the same order of its modifier 17980 // they could add new properties to their options configuration 17981 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 17982 this.modifiers.forEach(function (modifierOptions) { 17983 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 17984 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 17985 } 17986 }); 17987 17988 // fire the first update to position the popper in the right place 17989 this.update(); 17990 17991 var eventsEnabled = this.options.eventsEnabled; 17992 if (eventsEnabled) { 17993 // setup event listeners, they will take care of update the position in specific situations 17994 this.enableEventListeners(); 17995 } 17996 17997 this.state.eventsEnabled = eventsEnabled; 17998 } 17999 18000 // We can't use class properties because they don't get listed in the 18001 // class prototype and break stuff like Sinon stubs 18002 18003 18004 createClass(Popper, [{ 18005 key: 'update', 18006 value: function update$$1() { 18007 return update.call(this); 18008 } 18009 }, { 18010 key: 'destroy', 18011 value: function destroy$$1() { 18012 return destroy.call(this); 18013 } 18014 }, { 18015 key: 'enableEventListeners', 18016 value: function enableEventListeners$$1() { 18017 return enableEventListeners.call(this); 18018 } 18019 }, { 18020 key: 'disableEventListeners', 18021 value: function disableEventListeners$$1() { 18022 return disableEventListeners.call(this); 18023 } 18024 18025 /** 18026 * Schedules an update. It will run on the next UI update available. 18027 * @method scheduleUpdate 18028 * @memberof Popper 18029 */ 18030 18031 18032 /** 18033 * Collection of utilities useful when writing custom modifiers. 18034 * Starting from version 1.7, this method is available only if you 18035 * include `popper-utils.js` before `popper.js`. 18036 * 18037 * **DEPRECATION**: This way to access PopperUtils is deprecated 18038 * and will be removed in v2! Use the PopperUtils module directly instead. 18039 * Due to the high instability of the methods contained in Utils, we can't 18040 * guarantee them to follow semver. Use them at your own risk! 18041 * @static 18042 * @private 18043 * @type {Object} 18044 * @deprecated since version 1.8 18045 * @member Utils 18046 * @memberof Popper 18047 */ 18048 18049 }]); 18050 return Popper; 18051}(); 18052 18053/** 18054 * The `referenceObject` is an object that provides an interface compatible with Popper.js 18055 * and lets you use it as replacement of a real DOM node.<br /> 18056 * You can use this method to position a popper relatively to a set of coordinates 18057 * in case you don't have a DOM node to use as reference. 18058 * 18059 * ``` 18060 * new Popper(referenceObject, popperNode); 18061 * ``` 18062 * 18063 * NB: This feature isn't supported in Internet Explorer 10. 18064 * @name referenceObject 18065 * @property {Function} data.getBoundingClientRect 18066 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 18067 * @property {number} data.clientWidth 18068 * An ES6 getter that will return the width of the virtual reference element. 18069 * @property {number} data.clientHeight 18070 * An ES6 getter that will return the height of the virtual reference element. 18071 */ 18072 18073 18074Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 18075Popper.placements = placements; 18076Popper.Defaults = Defaults; 18077 18078/* harmony default export */ __webpack_exports__["default"] = (Popper); 18079//# sourceMappingURL=popper.js.map 18080 18081/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 18082 18083/***/ }), 18084
vendor: 721 bytes, lines 18085-18114
18085/***/ "./node_modules/webpack/buildin/global.js": 18086/*!***********************************!*\ 18087 !*** (webpack)/buildin/global.js ***! 18088 \***********************************/ 18089/*! no static exports found */ 18090/***/ (function(module, exports) { 18091 18092var g; 18093 18094// This works in non-strict mode 18095g = (function() { 18096 return this; 18097})(); 18098 18099try { 18100 // This works if eval is allowed (see CSP) 18101 g = g || new Function("return this")(); 18102} catch (e) { 18103 // This works if the window reference is available 18104 if (typeof window === "object") g = window; 18105} 18106 18107// g can still be undefined, but nothing to do about it... 18108// We return undefined, instead of nothing here, so it's 18109// easier to handle this case. if(!global) { ...} 18110 18111module.exports = g; 18112 18113 18114/***/ })
18114, 18115 18116/***/ 1: 18117/*!**************************************************!*\ 18118 !*** multi ./Resources/assets/desktop/js/app.js ***! 18119 \**************************************************/ 18120/*! no static exports found */ 18121/***/ (function(module, exports, __webpack_require__) { 18122 18123module.exports = __webpack_require__(/*! C:\xampp\htdocs\ABase\gp-style\Modules\Idncash\Resources\assets\desktop\js\app.js */"./Resources/assets/desktop/js/app.js"); 18124 18125 18126/***/ }) 18127 18128/******/ });
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.