vendor: 4,567 bytes, lines 1-142
1/*! 2 * Bootstrap v4.6.0 (https://getbootstrap.com/) 3 * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 47200 5 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 6 */ 7(function (global, factory) { 8 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.bootstrap = {}, global.jQuery)); 9})(this, function (exports, $) { 10 'use strict'; 11 12 function _interopDefaultLegacy(e) { 13 return e && typeof e === 'object' && 'default' in e ? e : { 14 'default': e 15 }; 16 } 17 18 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 19 20 function _defineProperties(target, props) { 21 for (var i = 0; i < props.length; i++) { 22 var descriptor = props[i]; 23 descriptor.enumerable = descriptor.enumerable || false; 24 descriptor.configurable = true; 25 if ("value" in descriptor) descriptor.writable = true; 26 Object.defineProperty(target, descriptor.key, descriptor); 27 } 28 } 29 30 function _createClass(Constructor, protoProps, staticProps) { 31 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 32 if (staticProps) _defineProperties(Constructor, staticProps); 33 return Constructor; 34 } 35 36 function _extends() { 37 _extends = Object.assign || function (target) { 38 for (var i = 1; i < arguments.length; i++) { 39 var source = arguments[i]; 40 41 for (var key in source) { 42 if (Object.prototype.hasOwnProperty.call(source, key)) { 43 target[key] = source[key]; 44 } 45 } 46 } 47 48 return target; 49 }; 50 51 return _extends.apply(this, arguments); 52 } 53 54 function _inheritsLoose(subClass, superClass) { 55 subClass.prototype = Object.create(superClass.prototype); 56 subClass.prototype.constructor = subClass; 57 subClass.__proto__ = superClass; 58 } 59 60 /** 61 * -------------------------------------------------------------------------- 62 * Bootstrap (v4.6.0): util.js 63 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 64 * -------------------------------------------------------------------------- 65 */ 66 67 /** 68 * ------------------------------------------------------------------------ 69 * Private TransitionEnd Helpers 70 * ------------------------------------------------------------------------ 71 */ 72 73 74 var TRANSITION_END = 'transitionend'; 75 var MAX_UID = 1000000; 76 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 77 78 function toType(obj) { 79 if (obj === null || typeof obj === 'undefined') { 80 return "" + obj; 81 } 82 83 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 84 } 85 86 function getSpecialTransitionEndEvent() { 87 return { 88 bindType: TRANSITION_END, 89 delegateType: TRANSITION_END, 90 handle: function handle(event) { 91 if ($__default['default'](event.target).is(this)) { 92 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 93 } 94 95 return undefined; 96 } 97 }; 98 } 99 100 function transitionEndEmulator(duration) { 101 var _this = this; 102 103 var called = false; 104 $__default['default'](this).one(Util.TRANSITION_END, function () { 105 called = true; 106 }); 107 setTimeout(function () { 108 if (!called) { 109 Util.triggerTransitionEnd(_this); 110 } 111 }, duration); 112 return this; 113 } 114 115 function setTransitionEndSupport() { 116 $__default['default'].fn.emulateTransitionEnd = transitionEndEmulator; 117 $__default['default'].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 118 } 119 /** 120 * -------------------------------------------------------------------------- 121 * Public Util Api 122 * -------------------------------------------------------------------------- 123 */ 124 125 126 var Util = { 127 TRANSITION_END: 'bsTransitionEnd', 128 getUID: function getUID(prefix) { 129 do { 130 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 131 } while (document.getElementById(prefix)); 132 133 return prefix; 134 }, 135 getSelectorFromElement: function getSelectorFromElement(element) { 136 var selector = element.getAttribute('data-target'); 137 138 if (!selector || selector === '#') { 139 var hrefAttr = element.getAttribute('href'); 140 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 141 } 142
vendor: 5,218 bytes, lines 143-292
143 try { 144 return document.querySelector(selector) ? selector : null; 145 } catch (_) { 146 return null; 147 } 148 }, 149 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 150 if (!element) { 151 return 0; 152 } // Get transition-duration of the element 153 154 155 var transitionDuration = $__default['default'](element).css('transition-duration'); 156 var transitionDelay = $__default['default'](element).css('transition-delay'); 157 var floatTransitionDuration = parseFloat(transitionDuration); 158 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 159 160 if (!floatTransitionDuration && !floatTransitionDelay) { 161 return 0; 162 } // If multiple durations are defined, take the first 163 164 165 transitionDuration = transitionDuration.split(',')[0]; 166 transitionDelay = transitionDelay.split(',')[0]; 167 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 168 }, 169 reflow: function reflow(element) { 170 return element.offsetHeight; 171 }, 172 triggerTransitionEnd: function triggerTransitionEnd(element) { 173 $__default['default'](element).trigger(TRANSITION_END); 174 }, 175 supportsTransitionEnd: function supportsTransitionEnd() { 176 return Boolean(TRANSITION_END); 177 }, 178 isElement: function isElement(obj) { 179 return (obj[0] || obj).nodeType; 180 }, 181 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 182 for (var property in configTypes) { 183 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 184 var expectedTypes = configTypes[property]; 185 var value = config[property]; 186 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 187 188 if (!new RegExp(expectedTypes).test(valueType)) { 189 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 190 } 191 } 192 } 193 }, 194 findShadowRoot: function findShadowRoot(element) { 195 if (!document.documentElement.attachShadow) { 196 return null; 197 } // Can find the shadow root otherwise it'll return the document 198 199 200 if (typeof element.getRootNode === 'function') { 201 var root = element.getRootNode(); 202 return root instanceof ShadowRoot ? root : null; 203 } 204 205 if (element instanceof ShadowRoot) { 206 return element; 207 } // when we don't find a shadow root 208 209 210 if (!element.parentNode) { 211 return null; 212 } 213 214 return Util.findShadowRoot(element.parentNode); 215 }, 216 jQueryDetection: function jQueryDetection() { 217 if (typeof $__default['default'] === 'undefined') { 218 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 219 } 220 221 var version = $__default['default'].fn.jquery.split(' ')[0].split('.'); 222 var minMajor = 1; 223 var ltMajor = 2; 224 var minMinor = 9; 225 var minPatch = 1; 226 var maxMajor = 4; 227 228 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 229 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 230 } 231 } 232 }; 233 Util.jQueryDetection(); 234 setTransitionEndSupport(); 235 /** 236 * ------------------------------------------------------------------------ 237 * Constants 238 * ------------------------------------------------------------------------ 239 */ 240 241 var NAME = 'alert'; 242 var VERSION = '4.6.0'; 243 var DATA_KEY = 'bs.alert'; 244 var EVENT_KEY = "." + DATA_KEY; 245 var DATA_API_KEY = '.data-api'; 246 var JQUERY_NO_CONFLICT = $__default['default'].fn[NAME]; 247 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 248 var EVENT_CLOSE = "close" + EVENT_KEY; 249 var EVENT_CLOSED = "closed" + EVENT_KEY; 250 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY; 251 var CLASS_NAME_ALERT = 'alert'; 252 var CLASS_NAME_FADE = 'fade'; 253 var CLASS_NAME_SHOW = 'show'; 254 /** 255 * ------------------------------------------------------------------------ 256 * Class Definition 257 * ------------------------------------------------------------------------ 258 */ 259 260 var Alert = /*#__PURE__*/function () { 261 function Alert(element) { 262 this._element = element; 263 } // Getters 264 265 266 var _proto = Alert.prototype; // Public 267 268 _proto.close = function close(element) { 269 var rootElement = this._element; 270 271 if (element) { 272 rootElement = this._getRootElement(element); 273 } 274 275 var customEvent = this._triggerCloseEvent(rootElement); 276 277 if (customEvent.isDefaultPrevented()) { 278 return; 279 } 280 281 this._removeElement(rootElement); 282 }; 283 284 _proto.dispose = function dispose() { 285 $__default['default'].removeData(this._element, DATA_KEY); 286 this._element = null; 287 } // Private 288 ; 289 290 _proto._getRootElement = function _getRootElement(element) { 291 var selector = Util.getSelectorFromElement(element); 292 var parent = false;
vendor: 11,944 bytes, lines 293-649
293 294 if (selector) { 295 parent = document.querySelector(selector); 296 } 297 298 if (!parent) { 299 parent = $__default['default'](element).closest("." + CLASS_NAME_ALERT)[0]; 300 } 301 302 return parent; 303 }; 304 305 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 306 var closeEvent = $__default['default'].Event(EVENT_CLOSE); 307 $__default['default'](element).trigger(closeEvent); 308 return closeEvent; 309 }; 310 311 _proto._removeElement = function _removeElement(element) { 312 var _this = this; 313 314 $__default['default'](element).removeClass(CLASS_NAME_SHOW); 315 316 if (!$__default['default'](element).hasClass(CLASS_NAME_FADE)) { 317 this._destroyElement(element); 318 319 return; 320 } 321 322 var transitionDuration = Util.getTransitionDurationFromElement(element); 323 $__default['default'](element).one(Util.TRANSITION_END, function (event) { 324 return _this._destroyElement(element, event); 325 }).emulateTransitionEnd(transitionDuration); 326 }; 327 328 _proto._destroyElement = function _destroyElement(element) { 329 $__default['default'](element).detach().trigger(EVENT_CLOSED).remove(); 330 } // Static 331 ; 332 333 Alert._jQueryInterface = function _jQueryInterface(config) { 334 return this.each(function () { 335 var $element = $__default['default'](this); 336 var data = $element.data(DATA_KEY); 337 338 if (!data) { 339 data = new Alert(this); 340 $element.data(DATA_KEY, data); 341 } 342 343 if (config === 'close') { 344 data[config](this); 345 } 346 }); 347 }; 348 349 Alert._handleDismiss = function _handleDismiss(alertInstance) { 350 return function (event) { 351 if (event) { 352 event.preventDefault(); 353 } 354 355 alertInstance.close(this); 356 }; 357 }; 358 359 _createClass(Alert, null, [{ 360 key: "VERSION", 361 get: function get() { 362 return VERSION; 363 } 364 }]); 365 366 return Alert; 367 }(); 368 /** 369 * ------------------------------------------------------------------------ 370 * Data Api implementation 371 * ------------------------------------------------------------------------ 372 */ 373 374 375 $__default['default'](document).on(EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 376 /** 377 * ------------------------------------------------------------------------ 378 * jQuery 379 * ------------------------------------------------------------------------ 380 */ 381 382 $__default['default'].fn[NAME] = Alert._jQueryInterface; 383 $__default['default'].fn[NAME].Constructor = Alert; 384 385 $__default['default'].fn[NAME].noConflict = function () { 386 $__default['default'].fn[NAME] = JQUERY_NO_CONFLICT; 387 return Alert._jQueryInterface; 388 }; 389 /** 390 * ------------------------------------------------------------------------ 391 * Constants 392 * ------------------------------------------------------------------------ 393 */ 394 395 396 var NAME$1 = 'button'; 397 var VERSION$1 = '4.6.0'; 398 var DATA_KEY$1 = 'bs.button'; 399 var EVENT_KEY$1 = "." + DATA_KEY$1; 400 var DATA_API_KEY$1 = '.data-api'; 401 var JQUERY_NO_CONFLICT$1 = $__default['default'].fn[NAME$1]; 402 var CLASS_NAME_ACTIVE = 'active'; 403 var CLASS_NAME_BUTTON = 'btn'; 404 var CLASS_NAME_FOCUS = 'focus'; 405 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 406 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 407 var SELECTOR_DATA_TOGGLE = '[data-toggle="button"]'; 408 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 409 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 410 var SELECTOR_ACTIVE = '.active'; 411 var SELECTOR_BUTTON = '.btn'; 412 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1; 413 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1); 414 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$1 + DATA_API_KEY$1; 415 /** 416 * ------------------------------------------------------------------------ 417 * Class Definition 418 * ------------------------------------------------------------------------ 419 */ 420 421 var Button = /*#__PURE__*/function () { 422 function Button(element) { 423 this._element = element; 424 this.shouldAvoidTriggerChange = false; 425 } // Getters 426 427 428 var _proto = Button.prototype; // Public 429 430 _proto.toggle = function toggle() { 431 var triggerChangeEvent = true; 432 var addAriaPressed = true; 433 var rootElement = $__default['default'](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 434 435 if (rootElement) { 436 var input = this._element.querySelector(SELECTOR_INPUT); 437 438 if (input) { 439 if (input.type === 'radio') { 440 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) { 441 triggerChangeEvent = false; 442 } else { 443 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE); 444 445 if (activeElement) { 446 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE); 447 } 448 } 449 } 450 451 if (triggerChangeEvent) { 452 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 453 if (input.type === 'checkbox' || input.type === 'radio') { 454 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE); 455 } 456 457 if (!this.shouldAvoidTriggerChange) { 458 $__default['default'](input).trigger('change'); 459 } 460 } 461 462 input.focus(); 463 addAriaPressed = false; 464 } 465 } 466 467 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 468 if (addAriaPressed) { 469 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE)); 470 } 471 472 if (triggerChangeEvent) { 473 $__default['default'](this._element).toggleClass(CLASS_NAME_ACTIVE); 474 } 475 } 476 }; 477 478 _proto.dispose = function dispose() { 479 $__default['default'].removeData(this._element, DATA_KEY$1); 480 this._element = null; 481 } // Static 482 ; 483 484 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 485 return this.each(function () { 486 var $element = $__default['default'](this); 487 var data = $element.data(DATA_KEY$1); 488 489 if (!data) { 490 data = new Button(this); 491 $element.data(DATA_KEY$1, data); 492 } 493 494 data.shouldAvoidTriggerChange = avoidTriggerChange; 495 496 if (config === 'toggle') { 497 data[config](); 498 } 499 }); 500 }; 501 502 _createClass(Button, null, [{ 503 key: "VERSION", 504 get: function get() { 505 return VERSION$1; 506 } 507 }]); 508 509 return Button; 510 }(); 511 /** 512 * ------------------------------------------------------------------------ 513 * Data Api implementation 514 * ------------------------------------------------------------------------ 515 */ 516 517 518 $__default['default'](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 519 var button = event.target; 520 var initialButton = button; 521 522 if (!$__default['default'](button).hasClass(CLASS_NAME_BUTTON)) { 523 button = $__default['default'](button).closest(SELECTOR_BUTTON)[0]; 524 } 525 526 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 527 event.preventDefault(); // work around Firefox bug #1540995 528 } else { 529 var inputBtn = button.querySelector(SELECTOR_INPUT); 530 531 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 532 event.preventDefault(); // work around Firefox bug #1540995 533 534 return; 535 } 536 537 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 538 Button._jQueryInterface.call($__default['default'](button), 'toggle', initialButton.tagName === 'INPUT'); 539 } 540 } 541 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 542 var button = $__default['default'](event.target).closest(SELECTOR_BUTTON)[0]; 543 $__default['default'](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 544 }); 545 $__default['default'](window).on(EVENT_LOAD_DATA_API, function () { 546 // ensure correct active class is set to match the controls' actual values/states 547 // find all checkboxes/readio buttons inside data-toggle groups 548 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 549 550 for (var i = 0, len = buttons.length; i < len; i++) { 551 var button = buttons[i]; 552 var input = button.querySelector(SELECTOR_INPUT); 553 554 if (input.checked || input.hasAttribute('checked')) { 555 button.classList.add(CLASS_NAME_ACTIVE); 556 } else { 557 button.classList.remove(CLASS_NAME_ACTIVE); 558 } 559 } // find all button toggles 560 561 562 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE)); 563 564 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 565 var _button = buttons[_i]; 566 567 if (_button.getAttribute('aria-pressed') === 'true') { 568 _button.classList.add(CLASS_NAME_ACTIVE); 569 } else { 570 _button.classList.remove(CLASS_NAME_ACTIVE); 571 } 572 } 573 }); 574 /** 575 * ------------------------------------------------------------------------ 576 * jQuery 577 * ------------------------------------------------------------------------ 578 */ 579 580 $__default['default'].fn[NAME$1] = Button._jQueryInterface; 581 $__default['default'].fn[NAME$1].Constructor = Button; 582 583 $__default['default'].fn[NAME$1].noConflict = function () { 584 $__default['default'].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 585 return Button._jQueryInterface; 586 }; 587 /** 588 * ------------------------------------------------------------------------ 589 * Constants 590 * ------------------------------------------------------------------------ 591 */ 592 593 594 var NAME$2 = 'carousel'; 595 var VERSION$2 = '4.6.0'; 596 var DATA_KEY$2 = 'bs.carousel'; 597 var EVENT_KEY$2 = "." + DATA_KEY$2; 598 var DATA_API_KEY$2 = '.data-api'; 599 var JQUERY_NO_CONFLICT$2 = $__default['default'].fn[NAME$2]; 600 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 601 602 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 603 604 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 605 606 var SWIPE_THRESHOLD = 40; 607 var Default = { 608 interval: 5000, 609 keyboard: true, 610 slide: false, 611 pause: 'hover', 612 wrap: true, 613 touch: true 614 }; 615 var DefaultType = { 616 interval: '(number|boolean)', 617 keyboard: 'boolean', 618 slide: '(boolean|string)', 619 pause: '(string|boolean)', 620 wrap: 'boolean', 621 touch: 'boolean' 622 }; 623 var DIRECTION_NEXT = 'next'; 624 var DIRECTION_PREV = 'prev'; 625 var DIRECTION_LEFT = 'left'; 626 var DIRECTION_RIGHT = 'right'; 627 var EVENT_SLIDE = "slide" + EVENT_KEY$2; 628 var EVENT_SLID = "slid" + EVENT_KEY$2; 629 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2; 630 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2; 631 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2; 632 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2; 633 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2; 634 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2; 635 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2; 636 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2; 637 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2; 638 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$2 + DATA_API_KEY$2; 639 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2; 640 var CLASS_NAME_CAROUSEL = 'carousel'; 641 var CLASS_NAME_ACTIVE$1 = 'active'; 642 var CLASS_NAME_SLIDE = 'slide'; 643 var CLASS_NAME_RIGHT = 'carousel-item-right'; 644 var CLASS_NAME_LEFT = 'carousel-item-left'; 645 var CLASS_NAME_NEXT = 'carousel-item-next'; 646 var CLASS_NAME_PREV = 'carousel-item-prev'; 647 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 648 var SELECTOR_ACTIVE$1 = '.active'; 649 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
vendor: 11,984 bytes, lines 650-1021
650 var SELECTOR_ITEM = '.carousel-item'; 651 var SELECTOR_ITEM_IMG = '.carousel-item img'; 652 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 653 var SELECTOR_INDICATORS = '.carousel-indicators'; 654 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 655 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 656 var PointerType = { 657 TOUCH: 'touch', 658 PEN: 'pen' 659 }; 660 /** 661 * ------------------------------------------------------------------------ 662 * Class Definition 663 * ------------------------------------------------------------------------ 664 */ 665 666 var Carousel = /*#__PURE__*/function () { 667 function Carousel(element, config) { 668 this._items = null; 669 this._interval = null; 670 this._activeElement = null; 671 this._isPaused = false; 672 this._isSliding = false; 673 this.touchTimeout = null; 674 this.touchStartX = 0; 675 this.touchDeltaX = 0; 676 this._config = this._getConfig(config); 677 this._element = element; 678 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 679 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 680 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 681 682 this._addEventListeners(); 683 } // Getters 684 685 686 var _proto = Carousel.prototype; // Public 687 688 _proto.next = function next() { 689 if (!this._isSliding) { 690 this._slide(DIRECTION_NEXT); 691 } 692 }; 693 694 _proto.nextWhenVisible = function nextWhenVisible() { 695 var $element = $__default['default'](this._element); // Don't call next when the page isn't visible 696 // or the carousel or its parent isn't visible 697 698 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 699 this.next(); 700 } 701 }; 702 703 _proto.prev = function prev() { 704 if (!this._isSliding) { 705 this._slide(DIRECTION_PREV); 706 } 707 }; 708 709 _proto.pause = function pause(event) { 710 if (!event) { 711 this._isPaused = true; 712 } 713 714 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 715 Util.triggerTransitionEnd(this._element); 716 this.cycle(true); 717 } 718 719 clearInterval(this._interval); 720 this._interval = null; 721 }; 722 723 _proto.cycle = function cycle(event) { 724 if (!event) { 725 this._isPaused = false; 726 } 727 728 if (this._interval) { 729 clearInterval(this._interval); 730 this._interval = null; 731 } 732 733 if (this._config.interval && !this._isPaused) { 734 this._updateInterval(); 735 736 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 737 } 738 }; 739 740 _proto.to = function to(index) { 741 var _this = this; 742 743 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 744 745 var activeIndex = this._getItemIndex(this._activeElement); 746 747 if (index > this._items.length - 1 || index < 0) { 748 return; 749 } 750 751 if (this._isSliding) { 752 $__default['default'](this._element).one(EVENT_SLID, function () { 753 return _this.to(index); 754 }); 755 return; 756 } 757 758 if (activeIndex === index) { 759 this.pause(); 760 this.cycle(); 761 return; 762 } 763 764 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 765 766 this._slide(direction, this._items[index]); 767 }; 768 769 _proto.dispose = function dispose() { 770 $__default['default'](this._element).off(EVENT_KEY$2); 771 $__default['default'].removeData(this._element, DATA_KEY$2); 772 this._items = null; 773 this._config = null; 774 this._element = null; 775 this._interval = null; 776 this._isPaused = null; 777 this._isSliding = null; 778 this._activeElement = null; 779 this._indicatorsElement = null; 780 } // Private 781 ; 782 783 _proto._getConfig = function _getConfig(config) { 784 config = _extends({}, Default, config); 785 Util.typeCheckConfig(NAME$2, config, DefaultType); 786 return config; 787 }; 788 789 _proto._handleSwipe = function _handleSwipe() { 790 var absDeltax = Math.abs(this.touchDeltaX); 791 792 if (absDeltax <= SWIPE_THRESHOLD) { 793 return; 794 } 795 796 var direction = absDeltax / this.touchDeltaX; 797 this.touchDeltaX = 0; // swipe left 798 799 if (direction > 0) { 800 this.prev(); 801 } // swipe right 802 803 804 if (direction < 0) { 805 this.next(); 806 } 807 }; 808 809 _proto._addEventListeners = function _addEventListeners() { 810 var _this2 = this; 811 812 if (this._config.keyboard) { 813 $__default['default'](this._element).on(EVENT_KEYDOWN, function (event) { 814 return _this2._keydown(event); 815 }); 816 } 817 818 if (this._config.pause === 'hover') { 819 $__default['default'](this._element).on(EVENT_MOUSEENTER, function (event) { 820 return _this2.pause(event); 821 }).on(EVENT_MOUSELEAVE, function (event) { 822 return _this2.cycle(event); 823 }); 824 } 825 826 if (this._config.touch) { 827 this._addTouchEventListeners(); 828 } 829 }; 830 831 _proto._addTouchEventListeners = function _addTouchEventListeners() { 832 var _this3 = this; 833 834 if (!this._touchSupported) { 835 return; 836 } 837 838 var start = function start(event) { 839 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 840 _this3.touchStartX = event.originalEvent.clientX; 841 } else if (!_this3._pointerEvent) { 842 _this3.touchStartX = event.originalEvent.touches[0].clientX; 843 } 844 }; 845 846 var move = function move(event) { 847 // ensure swiping with one touch and not pinching 848 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 849 _this3.touchDeltaX = 0; 850 } else { 851 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 852 } 853 }; 854 855 var end = function end(event) { 856 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 857 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 858 } 859 860 _this3._handleSwipe(); 861 862 if (_this3._config.pause === 'hover') { 863 // If it's a touch-enabled device, mouseenter/leave are fired as 864 // part of the mouse compatibility events on first tap - the carousel 865 // would stop cycling until user tapped out of it; 866 // here, we listen for touchend, explicitly pause the carousel 867 // (as if it's the second time we tap on it, mouseenter compat event 868 // is NOT fired) and after a timeout (to allow for mouse compatibility 869 // events to fire) we explicitly restart cycling 870 _this3.pause(); 871 872 if (_this3.touchTimeout) { 873 clearTimeout(_this3.touchTimeout); 874 } 875 876 _this3.touchTimeout = setTimeout(function (event) { 877 return _this3.cycle(event); 878 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 879 } 880 }; 881 882 $__default['default'](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 883 return e.preventDefault(); 884 }); 885 886 if (this._pointerEvent) { 887 $__default['default'](this._element).on(EVENT_POINTERDOWN, function (event) { 888 return start(event); 889 }); 890 $__default['default'](this._element).on(EVENT_POINTERUP, function (event) { 891 return end(event); 892 }); 893 894 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 895 } else { 896 $__default['default'](this._element).on(EVENT_TOUCHSTART, function (event) { 897 return start(event); 898 }); 899 $__default['default'](this._element).on(EVENT_TOUCHMOVE, function (event) { 900 return move(event); 901 }); 902 $__default['default'](this._element).on(EVENT_TOUCHEND, function (event) { 903 return end(event); 904 }); 905 } 906 }; 907 908 _proto._keydown = function _keydown(event) { 909 if (/input|textarea/i.test(event.target.tagName)) { 910 return; 911 } 912 913 switch (event.which) { 914 case ARROW_LEFT_KEYCODE: 915 event.preventDefault(); 916 this.prev(); 917 break; 918 919 case ARROW_RIGHT_KEYCODE: 920 event.preventDefault(); 921 this.next(); 922 break; 923 } 924 }; 925 926 _proto._getItemIndex = function _getItemIndex(element) { 927 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 928 return this._items.indexOf(element); 929 }; 930 931 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 932 var isNextDirection = direction === DIRECTION_NEXT; 933 var isPrevDirection = direction === DIRECTION_PREV; 934 935 var activeIndex = this._getItemIndex(activeElement); 936 937 var lastItemIndex = this._items.length - 1; 938 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 939 940 if (isGoingToWrap && !this._config.wrap) { 941 return activeElement; 942 } 943 944 var delta = direction === DIRECTION_PREV ? -1 : 1; 945 var itemIndex = (activeIndex + delta) % this._items.length; 946 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 947 }; 948 949 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 950 var targetIndex = this._getItemIndex(relatedTarget); 951 952 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 953 954 var slideEvent = $__default['default'].Event(EVENT_SLIDE, { 955 relatedTarget: relatedTarget, 956 direction: eventDirectionName, 957 from: fromIndex, 958 to: targetIndex 959 }); 960 $__default['default'](this._element).trigger(slideEvent); 961 return slideEvent; 962 }; 963 964 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 965 if (this._indicatorsElement) { 966 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 967 $__default['default'](indicators).removeClass(CLASS_NAME_ACTIVE$1); 968 969 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 970 971 if (nextIndicator) { 972 $__default['default'](nextIndicator).addClass(CLASS_NAME_ACTIVE$1); 973 } 974 } 975 }; 976 977 _proto._updateInterval = function _updateInterval() { 978 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 979 980 if (!element) { 981 return; 982 } 983 984 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 985 986 if (elementInterval) { 987 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 988 this._config.interval = elementInterval; 989 } else { 990 this._config.interval = this._config.defaultInterval || this._config.interval; 991 } 992 }; 993 994 _proto._slide = function _slide(direction, element) { 995 var _this4 = this; 996 997 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 998 999 var activeElementIndex = this._getItemIndex(activeElement); 1000 1001 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1002 1003 var nextElementIndex = this._getItemIndex(nextElement); 1004 1005 var isCycling = Boolean(this._interval); 1006 var directionalClassName; 1007 var orderClassName; 1008 var eventDirectionName; 1009 1010 if (direction === DIRECTION_NEXT) { 1011 directionalClassName = CLASS_NAME_LEFT; 1012 orderClassName = CLASS_NAME_NEXT; 1013 eventDirectionName = DIRECTION_LEFT; 1014 } else { 1015 directionalClassName = CLASS_NAME_RIGHT; 1016 orderClassName = CLASS_NAME_PREV; 1017 eventDirectionName = DIRECTION_RIGHT; 1018 } 1019 1020 if (nextElement && $__default['default'](nextElement).hasClass(CLASS_NAME_ACTIVE$1)) { 1021 this._isSliding = false;
vendor: 4,650 bytes, lines 1022-1168
1022 return; 1023 } 1024 1025 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1026 1027 if (slideEvent.isDefaultPrevented()) { 1028 return; 1029 } 1030 1031 if (!activeElement || !nextElement) { 1032 // Some weirdness is happening, so we bail 1033 return; 1034 } 1035 1036 this._isSliding = true; 1037 1038 if (isCycling) { 1039 this.pause(); 1040 } 1041 1042 this._setActiveIndicatorElement(nextElement); 1043 1044 this._activeElement = nextElement; 1045 var slidEvent = $__default['default'].Event(EVENT_SLID, { 1046 relatedTarget: nextElement, 1047 direction: eventDirectionName, 1048 from: activeElementIndex, 1049 to: nextElementIndex 1050 }); 1051 1052 if ($__default['default'](this._element).hasClass(CLASS_NAME_SLIDE)) { 1053 $__default['default'](nextElement).addClass(orderClassName); 1054 Util.reflow(nextElement); 1055 $__default['default'](activeElement).addClass(directionalClassName); 1056 $__default['default'](nextElement).addClass(directionalClassName); 1057 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1058 $__default['default'](activeElement).one(Util.TRANSITION_END, function () { 1059 $__default['default'](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$1); 1060 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1 + " " + orderClassName + " " + directionalClassName); 1061 _this4._isSliding = false; 1062 setTimeout(function () { 1063 return $__default['default'](_this4._element).trigger(slidEvent); 1064 }, 0); 1065 }).emulateTransitionEnd(transitionDuration); 1066 } else { 1067 $__default['default'](activeElement).removeClass(CLASS_NAME_ACTIVE$1); 1068 $__default['default'](nextElement).addClass(CLASS_NAME_ACTIVE$1); 1069 this._isSliding = false; 1070 $__default['default'](this._element).trigger(slidEvent); 1071 } 1072 1073 if (isCycling) { 1074 this.cycle(); 1075 } 1076 } // Static 1077 ; 1078 1079 Carousel._jQueryInterface = function _jQueryInterface(config) { 1080 return this.each(function () { 1081 var data = $__default['default'](this).data(DATA_KEY$2); 1082 1083 var _config = _extends({}, Default, $__default['default'](this).data()); 1084 1085 if (typeof config === 'object') { 1086 _config = _extends({}, _config, config); 1087 } 1088 1089 var action = typeof config === 'string' ? config : _config.slide; 1090 1091 if (!data) { 1092 data = new Carousel(this, _config); 1093 $__default['default'](this).data(DATA_KEY$2, data); 1094 } 1095 1096 if (typeof config === 'number') { 1097 data.to(config); 1098 } else if (typeof action === 'string') { 1099 if (typeof data[action] === 'undefined') { 1100 throw new TypeError("No method named \"" + action + "\""); 1101 } 1102 1103 data[action](); 1104 } else if (_config.interval && _config.ride) { 1105 data.pause(); 1106 data.cycle(); 1107 } 1108 }); 1109 }; 1110 1111 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 1112 var selector = Util.getSelectorFromElement(this); 1113 1114 if (!selector) { 1115 return; 1116 } 1117 1118 var target = $__default['default'](selector)[0]; 1119 1120 if (!target || !$__default['default'](target).hasClass(CLASS_NAME_CAROUSEL)) { 1121 return; 1122 } 1123 1124 var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); 1125 1126 var slideIndex = this.getAttribute('data-slide-to'); 1127 1128 if (slideIndex) { 1129 config.interval = false; 1130 } 1131 1132 Carousel._jQueryInterface.call($__default['default'](target), config); 1133 1134 if (slideIndex) { 1135 $__default['default'](target).data(DATA_KEY$2).to(slideIndex); 1136 } 1137 1138 event.preventDefault(); 1139 }; 1140 1141 _createClass(Carousel, null, [{ 1142 key: "VERSION", 1143 get: function get() { 1144 return VERSION$2; 1145 } 1146 }, { 1147 key: "Default", 1148 get: function get() { 1149 return Default; 1150 } 1151 }]); 1152 1153 return Carousel; 1154 }(); 1155 /** 1156 * ------------------------------------------------------------------------ 1157 * Data Api implementation 1158 * ------------------------------------------------------------------------ 1159 */ 1160 1161 1162 $__default['default'](document).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 1163 $__default['default'](window).on(EVENT_LOAD_DATA_API$1, function () { 1164 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 1165 1166 for (var i = 0, len = carousels.length; i < len; i++) { 1167 var $carousel = $__default['default'](carousels[i]); 1168
vendor: 10,322 bytes, lines 1169-1464
1169 Carousel._jQueryInterface.call($carousel, $carousel.data()); 1170 } 1171 }); 1172 /** 1173 * ------------------------------------------------------------------------ 1174 * jQuery 1175 * ------------------------------------------------------------------------ 1176 */ 1177 1178 $__default['default'].fn[NAME$2] = Carousel._jQueryInterface; 1179 $__default['default'].fn[NAME$2].Constructor = Carousel; 1180 1181 $__default['default'].fn[NAME$2].noConflict = function () { 1182 $__default['default'].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 1183 return Carousel._jQueryInterface; 1184 }; 1185 /** 1186 * ------------------------------------------------------------------------ 1187 * Constants 1188 * ------------------------------------------------------------------------ 1189 */ 1190 1191 1192 var NAME$3 = 'collapse'; 1193 var VERSION$3 = '4.6.0'; 1194 var DATA_KEY$3 = 'bs.collapse'; 1195 var EVENT_KEY$3 = "." + DATA_KEY$3; 1196 var DATA_API_KEY$3 = '.data-api'; 1197 var JQUERY_NO_CONFLICT$3 = $__default['default'].fn[NAME$3]; 1198 var Default$1 = { 1199 toggle: true, 1200 parent: '' 1201 }; 1202 var DefaultType$1 = { 1203 toggle: 'boolean', 1204 parent: '(string|element)' 1205 }; 1206 var EVENT_SHOW = "show" + EVENT_KEY$3; 1207 var EVENT_SHOWN = "shown" + EVENT_KEY$3; 1208 var EVENT_HIDE = "hide" + EVENT_KEY$3; 1209 var EVENT_HIDDEN = "hidden" + EVENT_KEY$3; 1210 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3; 1211 var CLASS_NAME_SHOW$1 = 'show'; 1212 var CLASS_NAME_COLLAPSE = 'collapse'; 1213 var CLASS_NAME_COLLAPSING = 'collapsing'; 1214 var CLASS_NAME_COLLAPSED = 'collapsed'; 1215 var DIMENSION_WIDTH = 'width'; 1216 var DIMENSION_HEIGHT = 'height'; 1217 var SELECTOR_ACTIVES = '.show, .collapsing'; 1218 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]'; 1219 /** 1220 * ------------------------------------------------------------------------ 1221 * Class Definition 1222 * ------------------------------------------------------------------------ 1223 */ 1224 1225 var Collapse = /*#__PURE__*/function () { 1226 function Collapse(element, config) { 1227 this._isTransitioning = false; 1228 this._element = element; 1229 this._config = this._getConfig(config); 1230 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 1231 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$1)); 1232 1233 for (var i = 0, len = toggleList.length; i < len; i++) { 1234 var elem = toggleList[i]; 1235 var selector = Util.getSelectorFromElement(elem); 1236 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 1237 return foundElem === element; 1238 }); 1239 1240 if (selector !== null && filterElement.length > 0) { 1241 this._selector = selector; 1242 1243 this._triggerArray.push(elem); 1244 } 1245 } 1246 1247 this._parent = this._config.parent ? this._getParent() : null; 1248 1249 if (!this._config.parent) { 1250 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 1251 } 1252 1253 if (this._config.toggle) { 1254 this.toggle(); 1255 } 1256 } // Getters 1257 1258 1259 var _proto = Collapse.prototype; // Public 1260 1261 _proto.toggle = function toggle() { 1262 if ($__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1263 this.hide(); 1264 } else { 1265 this.show(); 1266 } 1267 }; 1268 1269 _proto.show = function show() { 1270 var _this = this; 1271 1272 if (this._isTransitioning || $__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1273 return; 1274 } 1275 1276 var actives; 1277 var activesData; 1278 1279 if (this._parent) { 1280 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 1281 if (typeof _this._config.parent === 'string') { 1282 return elem.getAttribute('data-parent') === _this._config.parent; 1283 } 1284 1285 return elem.classList.contains(CLASS_NAME_COLLAPSE); 1286 }); 1287 1288 if (actives.length === 0) { 1289 actives = null; 1290 } 1291 } 1292 1293 if (actives) { 1294 activesData = $__default['default'](actives).not(this._selector).data(DATA_KEY$3); 1295 1296 if (activesData && activesData._isTransitioning) { 1297 return; 1298 } 1299 } 1300 1301 var startEvent = $__default['default'].Event(EVENT_SHOW); 1302 $__default['default'](this._element).trigger(startEvent); 1303 1304 if (startEvent.isDefaultPrevented()) { 1305 return; 1306 } 1307 1308 if (actives) { 1309 Collapse._jQueryInterface.call($__default['default'](actives).not(this._selector), 'hide'); 1310 1311 if (!activesData) { 1312 $__default['default'](actives).data(DATA_KEY$3, null); 1313 } 1314 } 1315 1316 var dimension = this._getDimension(); 1317 1318 $__default['default'](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 1319 this._element.style[dimension] = 0; 1320 1321 if (this._triggerArray.length) { 1322 $__default['default'](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 1323 } 1324 1325 this.setTransitioning(true); 1326 1327 var complete = function complete() { 1328 $__default['default'](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 1329 _this._element.style[dimension] = ''; 1330 1331 _this.setTransitioning(false); 1332 1333 $__default['default'](_this._element).trigger(EVENT_SHOWN); 1334 }; 1335 1336 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 1337 var scrollSize = "scroll" + capitalizedDimension; 1338 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1339 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1340 this._element.style[dimension] = this._element[scrollSize] + "px"; 1341 }; 1342 1343 _proto.hide = function hide() { 1344 var _this2 = this; 1345 1346 if (this._isTransitioning || !$__default['default'](this._element).hasClass(CLASS_NAME_SHOW$1)) { 1347 return; 1348 } 1349 1350 var startEvent = $__default['default'].Event(EVENT_HIDE); 1351 $__default['default'](this._element).trigger(startEvent); 1352 1353 if (startEvent.isDefaultPrevented()) { 1354 return; 1355 } 1356 1357 var dimension = this._getDimension(); 1358 1359 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 1360 Util.reflow(this._element); 1361 $__default['default'](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$1); 1362 var triggerArrayLength = this._triggerArray.length; 1363 1364 if (triggerArrayLength > 0) { 1365 for (var i = 0; i < triggerArrayLength; i++) { 1366 var trigger = this._triggerArray[i]; 1367 var selector = Util.getSelectorFromElement(trigger); 1368 1369 if (selector !== null) { 1370 var $elem = $__default['default']([].slice.call(document.querySelectorAll(selector))); 1371 1372 if (!$elem.hasClass(CLASS_NAME_SHOW$1)) { 1373 $__default['default'](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 1374 } 1375 } 1376 } 1377 } 1378 1379 this.setTransitioning(true); 1380 1381 var complete = function complete() { 1382 _this2.setTransitioning(false); 1383 1384 $__default['default'](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN); 1385 }; 1386 1387 this._element.style[dimension] = ''; 1388 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 1389 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 1390 }; 1391 1392 _proto.setTransitioning = function setTransitioning(isTransitioning) { 1393 this._isTransitioning = isTransitioning; 1394 }; 1395 1396 _proto.dispose = function dispose() { 1397 $__default['default'].removeData(this._element, DATA_KEY$3); 1398 this._config = null; 1399 this._parent = null; 1400 this._element = null; 1401 this._triggerArray = null; 1402 this._isTransitioning = null; 1403 } // Private 1404 ; 1405 1406 _proto._getConfig = function _getConfig(config) { 1407 config = _extends({}, Default$1, config); 1408 config.toggle = Boolean(config.toggle); // Coerce string values 1409 1410 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 1411 return config; 1412 }; 1413 1414 _proto._getDimension = function _getDimension() { 1415 var hasWidth = $__default['default'](this._element).hasClass(DIMENSION_WIDTH); 1416 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 1417 }; 1418 1419 _proto._getParent = function _getParent() { 1420 var _this3 = this; 1421 1422 var parent; 1423 1424 if (Util.isElement(this._config.parent)) { 1425 parent = this._config.parent; // It's a jQuery object 1426 1427 if (typeof this._config.parent.jquery !== 'undefined') { 1428 parent = this._config.parent[0]; 1429 } 1430 } else { 1431 parent = document.querySelector(this._config.parent); 1432 } 1433 1434 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 1435 var children = [].slice.call(parent.querySelectorAll(selector)); 1436 $__default['default'](children).each(function (i, element) { 1437 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 1438 }); 1439 return parent; 1440 }; 1441 1442 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 1443 var isOpen = $__default['default'](element).hasClass(CLASS_NAME_SHOW$1); 1444 1445 if (triggerArray.length) { 1446 $__default['default'](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 1447 } 1448 } // Static 1449 ; 1450 1451 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 1452 var selector = Util.getSelectorFromElement(element); 1453 return selector ? document.querySelector(selector) : null; 1454 }; 1455 1456 Collapse._jQueryInterface = function _jQueryInterface(config) { 1457 return this.each(function () { 1458 var $element = $__default['default'](this); 1459 var data = $element.data(DATA_KEY$3); 1460 1461 var _config = _extends({}, Default$1, $element.data(), typeof config === 'object' && config ? config : {}); 1462 1463 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 1464 _config.toggle = false;
vendor: 4,216 bytes, lines 1465-1594
1465 } 1466 1467 if (!data) { 1468 data = new Collapse(this, _config); 1469 $element.data(DATA_KEY$3, data); 1470 } 1471 1472 if (typeof config === 'string') { 1473 if (typeof data[config] === 'undefined') { 1474 throw new TypeError("No method named \"" + config + "\""); 1475 } 1476 1477 data[config](); 1478 } 1479 }); 1480 }; 1481 1482 _createClass(Collapse, null, [{ 1483 key: "VERSION", 1484 get: function get() { 1485 return VERSION$3; 1486 } 1487 }, { 1488 key: "Default", 1489 get: function get() { 1490 return Default$1; 1491 } 1492 }]); 1493 1494 return Collapse; 1495 }(); 1496 /** 1497 * ------------------------------------------------------------------------ 1498 * Data Api implementation 1499 * ------------------------------------------------------------------------ 1500 */ 1501 1502 1503 $__default['default'](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) { 1504 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 1505 if (event.currentTarget.tagName === 'A') { 1506 event.preventDefault(); 1507 } 1508 1509 var $trigger = $__default['default'](this); 1510 var selector = Util.getSelectorFromElement(this); 1511 var selectors = [].slice.call(document.querySelectorAll(selector)); 1512 $__default['default'](selectors).each(function () { 1513 var $target = $__default['default'](this); 1514 var data = $target.data(DATA_KEY$3); 1515 var config = data ? 'toggle' : $trigger.data(); 1516 1517 Collapse._jQueryInterface.call($target, config); 1518 }); 1519 }); 1520 /** 1521 * ------------------------------------------------------------------------ 1522 * jQuery 1523 * ------------------------------------------------------------------------ 1524 */ 1525 1526 $__default['default'].fn[NAME$3] = Collapse._jQueryInterface; 1527 $__default['default'].fn[NAME$3].Constructor = Collapse; 1528 1529 $__default['default'].fn[NAME$3].noConflict = function () { 1530 $__default['default'].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 1531 return Collapse._jQueryInterface; 1532 }; 1533 /**! 1534 * @fileOverview Kickass library to create and place poppers near their reference elements. 1535 * @version 1.16.1 1536 * @license 1537 * Copyright (c) 2016 Federico Zivolo and contributors 1538 * 1539 * Permission is hereby granted, free of charge, to any person obtaining a copy 1540 * of this software and associated documentation files (the "Software"), to deal 1541 * in the Software without restriction, including without limitation the rights 1542 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1543 * copies of the Software, and to permit persons to whom the Software is 1544 * furnished to do so, subject to the following conditions: 1545 * 1546 * The above copyright notice and this permission notice shall be included in all 1547 * copies or substantial portions of the Software. 1548 * 1549 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1550 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1551 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1552 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1553 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1554 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 1555 * SOFTWARE. 1556 */ 1557 1558 1559 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 1560 1561 var timeoutDuration = function () { 1562 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 1563 1564 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 1565 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 1566 return 1; 1567 } 1568 } 1569 1570 return 0; 1571 }(); 1572 1573 function microtaskDebounce(fn) { 1574 var called = false; 1575 return function () { 1576 if (called) { 1577 return; 1578 } 1579 1580 called = true; 1581 window.Promise.resolve().then(function () { 1582 called = false; 1583 fn(); 1584 }); 1585 }; 1586 } 1587 1588 function taskDebounce(fn) { 1589 var scheduled = false; 1590 return function () { 1591 if (!scheduled) { 1592 scheduled = true; 1593 setTimeout(function () { 1594 scheduled = false;
vendor: 11,825 bytes, lines 1595-1988
1595 fn(); 1596 }, timeoutDuration); 1597 } 1598 }; 1599 } 1600 1601 var supportsMicroTasks = isBrowser && window.Promise; 1602 /** 1603 * Create a debounced version of a method, that's asynchronously deferred 1604 * but called in the minimum time possible. 1605 * 1606 * @method 1607 * @memberof Popper.Utils 1608 * @argument {Function} fn 1609 * @returns {Function} 1610 */ 1611 1612 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 1613 /** 1614 * Check if the given variable is a function 1615 * @method 1616 * @memberof Popper.Utils 1617 * @argument {Any} functionToCheck - variable to check 1618 * @returns {Boolean} answer to: is a function? 1619 */ 1620 1621 function isFunction(functionToCheck) { 1622 var getType = {}; 1623 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 1624 } 1625 /** 1626 * Get CSS computed property of the given element 1627 * @method 1628 * @memberof Popper.Utils 1629 * @argument {Eement} element 1630 * @argument {String} property 1631 */ 1632 1633 1634 function getStyleComputedProperty(element, property) { 1635 if (element.nodeType !== 1) { 1636 return []; 1637 } // NOTE: 1 DOM access here 1638 1639 1640 var window = element.ownerDocument.defaultView; 1641 var css = window.getComputedStyle(element, null); 1642 return property ? css[property] : css; 1643 } 1644 /** 1645 * Returns the parentNode or the host of the element 1646 * @method 1647 * @memberof Popper.Utils 1648 * @argument {Element} element 1649 * @returns {Element} parent 1650 */ 1651 1652 1653 function getParentNode(element) { 1654 if (element.nodeName === 'HTML') { 1655 return element; 1656 } 1657 1658 return element.parentNode || element.host; 1659 } 1660 /** 1661 * Returns the scrolling parent of the given element 1662 * @method 1663 * @memberof Popper.Utils 1664 * @argument {Element} element 1665 * @returns {Element} scroll parent 1666 */ 1667 1668 1669 function getScrollParent(element) { 1670 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 1671 if (!element) { 1672 return document.body; 1673 } 1674 1675 switch (element.nodeName) { 1676 case 'HTML': 1677 case 'BODY': 1678 return element.ownerDocument.body; 1679 1680 case '#document': 1681 return element.body; 1682 } // Firefox want us to check `-x` and `-y` variations as well 1683 1684 1685 var _getStyleComputedProp = getStyleComputedProperty(element), 1686 overflow = _getStyleComputedProp.overflow, 1687 overflowX = _getStyleComputedProp.overflowX, 1688 overflowY = _getStyleComputedProp.overflowY; 1689 1690 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 1691 return element; 1692 } 1693 1694 return getScrollParent(getParentNode(element)); 1695 } 1696 /** 1697 * Returns the reference node of the reference object, or the reference object itself. 1698 * @method 1699 * @memberof Popper.Utils 1700 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 1701 * @returns {Element} parent 1702 */ 1703 1704 1705 function getReferenceNode(reference) { 1706 return reference && reference.referenceNode ? reference.referenceNode : reference; 1707 } 1708 1709 var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 1710 var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 1711 /** 1712 * Determines if the browser is Internet Explorer 1713 * @method 1714 * @memberof Popper.Utils 1715 * @param {Number} version to check 1716 * @returns {Boolean} isIE 1717 */ 1718 1719 function isIE(version) { 1720 if (version === 11) { 1721 return isIE11; 1722 } 1723 1724 if (version === 10) { 1725 return isIE10; 1726 } 1727 1728 return isIE11 || isIE10; 1729 } 1730 /** 1731 * Returns the offset parent of the given element 1732 * @method 1733 * @memberof Popper.Utils 1734 * @argument {Element} element 1735 * @returns {Element} offset parent 1736 */ 1737 1738 1739 function getOffsetParent(element) { 1740 if (!element) { 1741 return document.documentElement; 1742 } 1743 1744 var noOffsetParent = isIE(10) ? document.body : null; // NOTE: 1 DOM access here 1745 1746 var offsetParent = element.offsetParent || null; // Skip hidden elements which don't have an offsetParent 1747 1748 while (offsetParent === noOffsetParent && element.nextElementSibling) { 1749 offsetParent = (element = element.nextElementSibling).offsetParent; 1750 } 1751 1752 var nodeName = offsetParent && offsetParent.nodeName; 1753 1754 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 1755 return element ? element.ownerDocument.documentElement : document.documentElement; 1756 } // .offsetParent will return the closest TH, TD or TABLE in case 1757 // no offsetParent is present, I hate this job... 1758 1759 1760 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 1761 return getOffsetParent(offsetParent); 1762 } 1763 1764 return offsetParent; 1765 } 1766 1767 function isOffsetContainer(element) { 1768 var nodeName = element.nodeName; 1769 1770 if (nodeName === 'BODY') { 1771 return false; 1772 } 1773 1774 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 1775 } 1776 /** 1777 * Finds the root node (document, shadowDOM root) of the given element 1778 * @method 1779 * @memberof Popper.Utils 1780 * @argument {Element} node 1781 * @returns {Element} root node 1782 */ 1783 1784 1785 function getRoot(node) { 1786 if (node.parentNode !== null) { 1787 return getRoot(node.parentNode); 1788 } 1789 1790 return node; 1791 } 1792 /** 1793 * Finds the offset parent common to the two provided nodes 1794 * @method 1795 * @memberof Popper.Utils 1796 * @argument {Element} element1 1797 * @argument {Element} element2 1798 * @returns {Element} common offset parent 1799 */ 1800 1801 1802 function findCommonOffsetParent(element1, element2) { 1803 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 1804 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 1805 return document.documentElement; 1806 } // Here we make sure to give as "start" the element that comes first in the DOM 1807 1808 1809 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 1810 var start = order ? element1 : element2; 1811 var end = order ? element2 : element1; // Get common ancestor container 1812 1813 var range = document.createRange(); 1814 range.setStart(start, 0); 1815 range.setEnd(end, 0); 1816 var commonAncestorContainer = range.commonAncestorContainer; // Both nodes are inside #document 1817 1818 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 1819 if (isOffsetContainer(commonAncestorContainer)) { 1820 return commonAncestorContainer; 1821 } 1822 1823 return getOffsetParent(commonAncestorContainer); 1824 } // one of the nodes is inside shadowDOM, find which one 1825 1826 1827 var element1root = getRoot(element1); 1828 1829 if (element1root.host) { 1830 return findCommonOffsetParent(element1root.host, element2); 1831 } else { 1832 return findCommonOffsetParent(element1, getRoot(element2).host); 1833 } 1834 } 1835 /** 1836 * Gets the scroll value of the given element in the given side (top and left) 1837 * @method 1838 * @memberof Popper.Utils 1839 * @argument {Element} element 1840 * @argument {String} side `top` or `left` 1841 * @returns {number} amount of scrolled pixels 1842 */ 1843 1844 1845 function getScroll(element) { 1846 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 1847 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 1848 var nodeName = element.nodeName; 1849 1850 if (nodeName === 'BODY' || nodeName === 'HTML') { 1851 var html = element.ownerDocument.documentElement; 1852 var scrollingElement = element.ownerDocument.scrollingElement || html; 1853 return scrollingElement[upperSide]; 1854 } 1855 1856 return element[upperSide]; 1857 } 1858 /* 1859 * Sum or subtract the element scroll values (left and top) from a given rect object 1860 * @method 1861 * @memberof Popper.Utils 1862 * @param {Object} rect - Rect object you want to change 1863 * @param {HTMLElement} element - The element from the function reads the scroll values 1864 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 1865 * @return {Object} rect - The modifier rect object 1866 */ 1867 1868 1869 function includeScroll(rect, element) { 1870 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 1871 var scrollTop = getScroll(element, 'top'); 1872 var scrollLeft = getScroll(element, 'left'); 1873 var modifier = subtract ? -1 : 1; 1874 rect.top += scrollTop * modifier; 1875 rect.bottom += scrollTop * modifier; 1876 rect.left += scrollLeft * modifier; 1877 rect.right += scrollLeft * modifier; 1878 return rect; 1879 } 1880 /* 1881 * Helper to detect borders of a given element 1882 * @method 1883 * @memberof Popper.Utils 1884 * @param {CSSStyleDeclaration} styles 1885 * Result of `getStyleComputedProperty` on the given element 1886 * @param {String} axis - `x` or `y` 1887 * @return {number} borders - The borders size of the given axis 1888 */ 1889 1890 1891 function getBordersSize(styles, axis) { 1892 var sideA = axis === 'x' ? 'Left' : 'Top'; 1893 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 1894 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 1895 } 1896 1897 function getSize(axis, body, html, computedStyle) { 1898 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); 1899 } 1900 1901 function getWindowSizes(document) { 1902 var body = document.body; 1903 var html = document.documentElement; 1904 var computedStyle = isIE(10) && getComputedStyle(html); 1905 return { 1906 height: getSize('Height', body, html, computedStyle), 1907 width: getSize('Width', body, html, computedStyle) 1908 }; 1909 } 1910 1911 var classCallCheck = function (instance, Constructor) { 1912 if (!(instance instanceof Constructor)) { 1913 throw new TypeError("Cannot call a class as a function"); 1914 } 1915 }; 1916 1917 var createClass = function () { 1918 function defineProperties(target, props) { 1919 for (var i = 0; i < props.length; i++) { 1920 var descriptor = props[i]; 1921 descriptor.enumerable = descriptor.enumerable || false; 1922 descriptor.configurable = true; 1923 if ("value" in descriptor) descriptor.writable = true; 1924 Object.defineProperty(target, descriptor.key, descriptor); 1925 } 1926 } 1927 1928 return function (Constructor, protoProps, staticProps) { 1929 if (protoProps) defineProperties(Constructor.prototype, protoProps); 1930 if (staticProps) defineProperties(Constructor, staticProps); 1931 return Constructor; 1932 }; 1933 }(); 1934 1935 var defineProperty = function (obj, key, value) { 1936 if (key in obj) { 1937 Object.defineProperty(obj, key, { 1938 value: value, 1939 enumerable: true, 1940 configurable: true, 1941 writable: true 1942 }); 1943 } else { 1944 obj[key] = value; 1945 } 1946 1947 return obj; 1948 }; 1949 1950 var _extends$1 = Object.assign || function (target) { 1951 for (var i = 1; i < arguments.length; i++) { 1952 var source = arguments[i]; 1953 1954 for (var key in source) { 1955 if (Object.prototype.hasOwnProperty.call(source, key)) { 1956 target[key] = source[key]; 1957 } 1958 } 1959 } 1960 1961 return target; 1962 }; 1963 /** 1964 * Given element offsets, generate an output similar to getBoundingClientRect 1965 * @method 1966 * @memberof Popper.Utils 1967 * @argument {Object} offsets 1968 * @returns {Object} ClientRect like output 1969 */ 1970 1971 1972 function getClientRect(offsets) { 1973 return _extends$1({}, offsets, { 1974 right: offsets.left + offsets.width, 1975 bottom: offsets.top + offsets.height 1976 }); 1977 } 1978 /** 1979 * Get bounding client rect of given element 1980 * @method 1981 * @memberof Popper.Utils 1982 * @param {HTMLElement} element 1983 * @return {Object} client rect 1984 */ 1985 1986 1987 function getBoundingClientRect(element) { 1988 var rect = {}; // IE10 10 FIX: Please, don't ask, the element isn't
vendor: 15,322 bytes, lines 1989-2425
1989 // considered in DOM in some circumstances... 1990 // This isn't reproducible in IE10 compatibility mode of IE11 1991 1992 try { 1993 if (isIE(10)) { 1994 rect = element.getBoundingClientRect(); 1995 var scrollTop = getScroll(element, 'top'); 1996 var scrollLeft = getScroll(element, 'left'); 1997 rect.top += scrollTop; 1998 rect.left += scrollLeft; 1999 rect.bottom += scrollTop; 2000 rect.right += scrollLeft; 2001 } else { 2002 rect = element.getBoundingClientRect(); 2003 } 2004 } catch (e) {} 2005 2006 var result = { 2007 left: rect.left, 2008 top: rect.top, 2009 width: rect.right - rect.left, 2010 height: rect.bottom - rect.top 2011 }; // subtract scrollbar size from sizes 2012 2013 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 2014 var width = sizes.width || element.clientWidth || result.width; 2015 var height = sizes.height || element.clientHeight || result.height; 2016 var horizScrollbar = element.offsetWidth - width; 2017 var vertScrollbar = element.offsetHeight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 2018 // we make this check conditional for performance reasons 2019 2020 if (horizScrollbar || vertScrollbar) { 2021 var styles = getStyleComputedProperty(element); 2022 horizScrollbar -= getBordersSize(styles, 'x'); 2023 vertScrollbar -= getBordersSize(styles, 'y'); 2024 result.width -= horizScrollbar; 2025 result.height -= vertScrollbar; 2026 } 2027 2028 return getClientRect(result); 2029 } 2030 2031 function getOffsetRectRelativeToArbitraryNode(children, parent) { 2032 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 2033 var isIE10 = isIE(10); 2034 var isHTML = parent.nodeName === 'HTML'; 2035 var childrenRect = getBoundingClientRect(children); 2036 var parentRect = getBoundingClientRect(parent); 2037 var scrollParent = getScrollParent(children); 2038 var styles = getStyleComputedProperty(parent); 2039 var borderTopWidth = parseFloat(styles.borderTopWidth); 2040 var borderLeftWidth = parseFloat(styles.borderLeftWidth); // In cases where the parent is fixed, we must ignore negative scroll in offset calc 2041 2042 if (fixedPosition && isHTML) { 2043 parentRect.top = Math.max(parentRect.top, 0); 2044 parentRect.left = Math.max(parentRect.left, 0); 2045 } 2046 2047 var offsets = getClientRect({ 2048 top: childrenRect.top - parentRect.top - borderTopWidth, 2049 left: childrenRect.left - parentRect.left - borderLeftWidth, 2050 width: childrenRect.width, 2051 height: childrenRect.height 2052 }); 2053 offsets.marginTop = 0; 2054 offsets.marginLeft = 0; // Subtract margins of documentElement in case it's being used as parent 2055 // we do this only on HTML because it's the only element that behaves 2056 // differently when margins are applied to it. The margins are included in 2057 // the box of the documentElement, in the other cases not. 2058 2059 if (!isIE10 && isHTML) { 2060 var marginTop = parseFloat(styles.marginTop); 2061 var marginLeft = parseFloat(styles.marginLeft); 2062 offsets.top -= borderTopWidth - marginTop; 2063 offsets.bottom -= borderTopWidth - marginTop; 2064 offsets.left -= borderLeftWidth - marginLeft; 2065 offsets.right -= borderLeftWidth - marginLeft; // Attach marginTop and marginLeft because in some circumstances we may need them 2066 2067 offsets.marginTop = marginTop; 2068 offsets.marginLeft = marginLeft; 2069 } 2070 2071 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 2072 offsets = includeScroll(offsets, parent); 2073 } 2074 2075 return offsets; 2076 } 2077 2078 function getViewportOffsetRectRelativeToArtbitraryNode(element) { 2079 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 2080 var html = element.ownerDocument.documentElement; 2081 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 2082 var width = Math.max(html.clientWidth, window.innerWidth || 0); 2083 var height = Math.max(html.clientHeight, window.innerHeight || 0); 2084 var scrollTop = !excludeScroll ? getScroll(html) : 0; 2085 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 2086 var offset = { 2087 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 2088 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 2089 width: width, 2090 height: height 2091 }; 2092 return getClientRect(offset); 2093 } 2094 /** 2095 * Check if the given element is fixed or is inside a fixed parent 2096 * @method 2097 * @memberof Popper.Utils 2098 * @argument {Element} element 2099 * @argument {Element} customContainer 2100 * @returns {Boolean} answer to "isFixed?" 2101 */ 2102 2103 2104 function isFixed(element) { 2105 var nodeName = element.nodeName; 2106 2107 if (nodeName === 'BODY' || nodeName === 'HTML') { 2108 return false; 2109 } 2110 2111 if (getStyleComputedProperty(element, 'position') === 'fixed') { 2112 return true; 2113 } 2114 2115 var parentNode = getParentNode(element); 2116 2117 if (!parentNode) { 2118 return false; 2119 } 2120 2121 return isFixed(parentNode); 2122 } 2123 /** 2124 * Finds the first parent of an element that has a transformed property defined 2125 * @method 2126 * @memberof Popper.Utils 2127 * @argument {Element} element 2128 * @returns {Element} first transformed parent or documentElement 2129 */ 2130 2131 2132 function getFixedPositionOffsetParent(element) { 2133 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 2134 if (!element || !element.parentElement || isIE()) { 2135 return document.documentElement; 2136 } 2137 2138 var el = element.parentElement; 2139 2140 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 2141 el = el.parentElement; 2142 } 2143 2144 return el || document.documentElement; 2145 } 2146 /** 2147 * Computed the boundaries limits and return them 2148 * @method 2149 * @memberof Popper.Utils 2150 * @param {HTMLElement} popper 2151 * @param {HTMLElement} reference 2152 * @param {number} padding 2153 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 2154 * @param {Boolean} fixedPosition - Is in fixed position mode 2155 * @returns {Object} Coordinates of the boundaries 2156 */ 2157 2158 2159 function getBoundaries(popper, reference, padding, boundariesElement) { 2160 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // NOTE: 1 DOM access here 2161 2162 var boundaries = { 2163 top: 0, 2164 left: 0 2165 }; 2166 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); // Handle viewport case 2167 2168 if (boundariesElement === 'viewport') { 2169 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 2170 } else { 2171 // Handle other cases based on DOM element used as boundaries 2172 var boundariesNode = void 0; 2173 2174 if (boundariesElement === 'scrollParent') { 2175 boundariesNode = getScrollParent(getParentNode(reference)); 2176 2177 if (boundariesNode.nodeName === 'BODY') { 2178 boundariesNode = popper.ownerDocument.documentElement; 2179 } 2180 } else if (boundariesElement === 'window') { 2181 boundariesNode = popper.ownerDocument.documentElement; 2182 } else { 2183 boundariesNode = boundariesElement; 2184 } 2185 2186 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); // In case of HTML, we need a different computation 2187 2188 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 2189 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 2190 height = _getWindowSizes.height, 2191 width = _getWindowSizes.width; 2192 2193 boundaries.top += offsets.top - offsets.marginTop; 2194 boundaries.bottom = height + offsets.top; 2195 boundaries.left += offsets.left - offsets.marginLeft; 2196 boundaries.right = width + offsets.left; 2197 } else { 2198 // for all the other DOM elements, this one is good 2199 boundaries = offsets; 2200 } 2201 } // Add paddings 2202 2203 2204 padding = padding || 0; 2205 var isPaddingNumber = typeof padding === 'number'; 2206 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 2207 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 2208 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 2209 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 2210 return boundaries; 2211 } 2212 2213 function getArea(_ref) { 2214 var width = _ref.width, 2215 height = _ref.height; 2216 return width * height; 2217 } 2218 /** 2219 * Utility used to transform the `auto` placement to the placement with more 2220 * available space. 2221 * @method 2222 * @memberof Popper.Utils 2223 * @argument {Object} data - The data object generated by update method 2224 * @argument {Object} options - Modifiers configuration and options 2225 * @returns {Object} The data object, properly modified 2226 */ 2227 2228 2229 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 2230 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 2231 2232 if (placement.indexOf('auto') === -1) { 2233 return placement; 2234 } 2235 2236 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 2237 var rects = { 2238 top: { 2239 width: boundaries.width, 2240 height: refRect.top - boundaries.top 2241 }, 2242 right: { 2243 width: boundaries.right - refRect.right, 2244 height: boundaries.height 2245 }, 2246 bottom: { 2247 width: boundaries.width, 2248 height: boundaries.bottom - refRect.bottom 2249 }, 2250 left: { 2251 width: refRect.left - boundaries.left, 2252 height: boundaries.height 2253 } 2254 }; 2255 var sortedAreas = Object.keys(rects).map(function (key) { 2256 return _extends$1({ 2257 key: key 2258 }, rects[key], { 2259 area: getArea(rects[key]) 2260 }); 2261 }).sort(function (a, b) { 2262 return b.area - a.area; 2263 }); 2264 var filteredAreas = sortedAreas.filter(function (_ref2) { 2265 var width = _ref2.width, 2266 height = _ref2.height; 2267 return width >= popper.clientWidth && height >= popper.clientHeight; 2268 }); 2269 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 2270 var variation = placement.split('-')[1]; 2271 return computedPlacement + (variation ? '-' + variation : ''); 2272 } 2273 /** 2274 * Get offsets to the reference element 2275 * @method 2276 * @memberof Popper.Utils 2277 * @param {Object} state 2278 * @param {Element} popper - the popper element 2279 * @param {Element} reference - the reference element (the popper will be relative to this) 2280 * @param {Element} fixedPosition - is in fixed position mode 2281 * @returns {Object} An object containing the offsets which will be applied to the popper 2282 */ 2283 2284 2285 function getReferenceOffsets(state, popper, reference) { 2286 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 2287 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 2288 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 2289 } 2290 /** 2291 * Get the outer sizes of the given element (offset size + margins) 2292 * @method 2293 * @memberof Popper.Utils 2294 * @argument {Element} element 2295 * @returns {Object} object containing width and height properties 2296 */ 2297 2298 2299 function getOuterSizes(element) { 2300 var window = element.ownerDocument.defaultView; 2301 var styles = window.getComputedStyle(element); 2302 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 2303 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 2304 var result = { 2305 width: element.offsetWidth + y, 2306 height: element.offsetHeight + x 2307 }; 2308 return result; 2309 } 2310 /** 2311 * Get the opposite placement of the given one 2312 * @method 2313 * @memberof Popper.Utils 2314 * @argument {String} placement 2315 * @returns {String} flipped placement 2316 */ 2317 2318 2319 function getOppositePlacement(placement) { 2320 var hash = { 2321 left: 'right', 2322 right: 'left', 2323 bottom: 'top', 2324 top: 'bottom' 2325 }; 2326 return placement.replace(/left|right|bottom|top/g, function (matched) { 2327 return hash[matched]; 2328 }); 2329 } 2330 /** 2331 * Get offsets to the popper 2332 * @method 2333 * @memberof Popper.Utils 2334 * @param {Object} position - CSS position the Popper will get applied 2335 * @param {HTMLElement} popper - the popper element 2336 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 2337 * @param {String} placement - one of the valid placement options 2338 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 2339 */ 2340 2341 2342 function getPopperOffsets(popper, referenceOffsets, placement) { 2343 placement = placement.split('-')[0]; // Get popper node sizes 2344 2345 var popperRect = getOuterSizes(popper); // Add position, width and height to our offsets object 2346 2347 var popperOffsets = { 2348 width: popperRect.width, 2349 height: popperRect.height 2350 }; // depending by the popper placement we have to compute its offsets slightly differently 2351 2352 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 2353 var mainSide = isHoriz ? 'top' : 'left'; 2354 var secondarySide = isHoriz ? 'left' : 'top'; 2355 var measurement = isHoriz ? 'height' : 'width'; 2356 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 2357 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 2358 2359 if (placement === secondarySide) { 2360 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 2361 } else { 2362 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 2363 } 2364 2365 return popperOffsets; 2366 } 2367 /** 2368 * Mimics the `find` method of Array 2369 * @method 2370 * @memberof Popper.Utils 2371 * @argument {Array} arr 2372 * @argument prop 2373 * @argument value 2374 * @returns index or -1 2375 */ 2376 2377 2378 function find(arr, check) { 2379 // use native find if supported 2380 if (Array.prototype.find) { 2381 return arr.find(check); 2382 } // use `filter` to obtain the same behavior of `find` 2383 2384 2385 return arr.filter(check)[0]; 2386 } 2387 /** 2388 * Return the index of the matching object 2389 * @method 2390 * @memberof Popper.Utils 2391 * @argument {Array} arr 2392 * @argument prop 2393 * @argument value 2394 * @returns index or -1 2395 */ 2396 2397 2398 function findIndex(arr, prop, value) { 2399 // use native findIndex if supported 2400 if (Array.prototype.findIndex) { 2401 return arr.findIndex(function (cur) { 2402 return cur[prop] === value; 2403 }); 2404 } // use `find` + `indexOf` if `findIndex` isn't supported 2405 2406 2407 var match = find(arr, function (obj) { 2408 return obj[prop] === value; 2409 }); 2410 return arr.indexOf(match); 2411 } 2412 /** 2413 * Loop trough the list of modifiers and run them in order, 2414 * each of them will then edit the data object. 2415 * @method 2416 * @memberof Popper.Utils 2417 * @param {dataObject} data 2418 * @param {Array} modifiers 2419 * @param {String} ends - Optional modifier name used as stopper 2420 * @returns {dataObject} 2421 */ 2422 2423 2424 function runModifiers(modifiers, data, ends) { 2425 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
vendor: 8,550 bytes, lines 2426-2699
2426 modifiersToRun.forEach(function (modifier) { 2427 if (modifier['function']) { 2428 // eslint-disable-line dot-notation 2429 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 2430 } 2431 2432 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 2433 2434 if (modifier.enabled && isFunction(fn)) { 2435 // Add properties to offsets to make them a complete clientRect object 2436 // we do this before each modifier to make sure the previous one doesn't 2437 // mess with these values 2438 data.offsets.popper = getClientRect(data.offsets.popper); 2439 data.offsets.reference = getClientRect(data.offsets.reference); 2440 data = fn(data, modifier); 2441 } 2442 }); 2443 return data; 2444 } 2445 /** 2446 * Updates the position of the popper, computing the new offsets and applying 2447 * the new style.<br /> 2448 * Prefer `scheduleUpdate` over `update` because of performance reasons. 2449 * @method 2450 * @memberof Popper 2451 */ 2452 2453 2454 function update() { 2455 // if popper is destroyed, don't perform any further update 2456 if (this.state.isDestroyed) { 2457 return; 2458 } 2459 2460 var data = { 2461 instance: this, 2462 styles: {}, 2463 arrowStyles: {}, 2464 attributes: {}, 2465 flipped: false, 2466 offsets: {} 2467 }; // compute reference element offsets 2468 2469 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); // compute auto placement, store placement inside the data object, 2470 // modifiers will be able to edit `placement` if needed 2471 // and refer to originalPlacement to know the original value 2472 2473 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); // store the computed placement inside `originalPlacement` 2474 2475 data.originalPlacement = data.placement; 2476 data.positionFixed = this.options.positionFixed; // compute the popper offsets 2477 2478 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 2479 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; // run the modifiers 2480 2481 data = runModifiers(this.modifiers, data); // the first `update` will call `onCreate` callback 2482 // the other ones will call `onUpdate` callback 2483 2484 if (!this.state.isCreated) { 2485 this.state.isCreated = true; 2486 this.options.onCreate(data); 2487 } else { 2488 this.options.onUpdate(data); 2489 } 2490 } 2491 /** 2492 * Helper used to know if the given modifier is enabled. 2493 * @method 2494 * @memberof Popper.Utils 2495 * @returns {Boolean} 2496 */ 2497 2498 2499 function isModifierEnabled(modifiers, modifierName) { 2500 return modifiers.some(function (_ref) { 2501 var name = _ref.name, 2502 enabled = _ref.enabled; 2503 return enabled && name === modifierName; 2504 }); 2505 } 2506 /** 2507 * Get the prefixed supported property name 2508 * @method 2509 * @memberof Popper.Utils 2510 * @argument {String} property (camelCase) 2511 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 2512 */ 2513 2514 2515 function getSupportedPropertyName(property) { 2516 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 2517 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 2518 2519 for (var i = 0; i < prefixes.length; i++) { 2520 var prefix = prefixes[i]; 2521 var toCheck = prefix ? '' + prefix + upperProp : property; 2522 2523 if (typeof document.body.style[toCheck] !== 'undefined') { 2524 return toCheck; 2525 } 2526 } 2527 2528 return null; 2529 } 2530 /** 2531 * Destroys the popper. 2532 * @method 2533 * @memberof Popper 2534 */ 2535 2536 2537 function destroy() { 2538 this.state.isDestroyed = true; // touch DOM only if `applyStyle` modifier is enabled 2539 2540 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 2541 this.popper.removeAttribute('x-placement'); 2542 this.popper.style.position = ''; 2543 this.popper.style.top = ''; 2544 this.popper.style.left = ''; 2545 this.popper.style.right = ''; 2546 this.popper.style.bottom = ''; 2547 this.popper.style.willChange = ''; 2548 this.popper.style[getSupportedPropertyName('transform')] = ''; 2549 } 2550 2551 this.disableEventListeners(); // remove the popper if user explicitly asked for the deletion on destroy 2552 // do not use `remove` because IE11 doesn't support it 2553 2554 if (this.options.removeOnDestroy) { 2555 this.popper.parentNode.removeChild(this.popper); 2556 } 2557 2558 return this; 2559 } 2560 /** 2561 * Get the window associated with the element 2562 * @argument {Element} element 2563 * @returns {Window} 2564 */ 2565 2566 2567 function getWindow(element) { 2568 var ownerDocument = element.ownerDocument; 2569 return ownerDocument ? ownerDocument.defaultView : window; 2570 } 2571 2572 function attachToScrollParents(scrollParent, event, callback, scrollParents) { 2573 var isBody = scrollParent.nodeName === 'BODY'; 2574 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 2575 target.addEventListener(event, callback, { 2576 passive: true 2577 }); 2578 2579 if (!isBody) { 2580 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 2581 } 2582 2583 scrollParents.push(target); 2584 } 2585 /** 2586 * Setup needed event listeners used to update the popper position 2587 * @method 2588 * @memberof Popper.Utils 2589 * @private 2590 */ 2591 2592 2593 function setupEventListeners(reference, options, state, updateBound) { 2594 // Resize event listener on window 2595 state.updateBound = updateBound; 2596 getWindow(reference).addEventListener('resize', state.updateBound, { 2597 passive: true 2598 }); // Scroll event listener on scroll parents 2599 2600 var scrollElement = getScrollParent(reference); 2601 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 2602 state.scrollElement = scrollElement; 2603 state.eventsEnabled = true; 2604 return state; 2605 } 2606 /** 2607 * It will add resize/scroll events and start recalculating 2608 * position of the popper element when they are triggered. 2609 * @method 2610 * @memberof Popper 2611 */ 2612 2613 2614 function enableEventListeners() { 2615 if (!this.state.eventsEnabled) { 2616 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 2617 } 2618 } 2619 /** 2620 * Remove event listeners used to update the popper position 2621 * @method 2622 * @memberof Popper.Utils 2623 * @private 2624 */ 2625 2626 2627 function removeEventListeners(reference, state) { 2628 // Remove resize event listener on window 2629 getWindow(reference).removeEventListener('resize', state.updateBound); // Remove scroll event listener on scroll parents 2630 2631 state.scrollParents.forEach(function (target) { 2632 target.removeEventListener('scroll', state.updateBound); 2633 }); // Reset state 2634 2635 state.updateBound = null; 2636 state.scrollParents = []; 2637 state.scrollElement = null; 2638 state.eventsEnabled = false; 2639 return state; 2640 } 2641 /** 2642 * It will remove resize/scroll events and won't recalculate popper position 2643 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 2644 * unless you call `update` method manually. 2645 * @method 2646 * @memberof Popper 2647 */ 2648 2649 2650 function disableEventListeners() { 2651 if (this.state.eventsEnabled) { 2652 cancelAnimationFrame(this.scheduleUpdate); 2653 this.state = removeEventListeners(this.reference, this.state); 2654 } 2655 } 2656 /** 2657 * Tells if a given input is a number 2658 * @method 2659 * @memberof Popper.Utils 2660 * @param {*} input to check 2661 * @return {Boolean} 2662 */ 2663 2664 2665 function isNumeric(n) { 2666 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 2667 } 2668 /** 2669 * Set the style to the given popper 2670 * @method 2671 * @memberof Popper.Utils 2672 * @argument {Element} element - Element to apply the style to 2673 * @argument {Object} styles 2674 * Object with a list of properties and values which will be applied to the element 2675 */ 2676 2677 2678 function setStyles(element, styles) { 2679 Object.keys(styles).forEach(function (prop) { 2680 var unit = ''; // add unit if the value is numeric and is one of the following 2681 2682 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 2683 unit = 'px'; 2684 } 2685 2686 element.style[prop] = styles[prop] + unit; 2687 }); 2688 } 2689 /** 2690 * Set the attributes to the given popper 2691 * @method 2692 * @memberof Popper.Utils 2693 * @argument {Element} element - Element to apply the attributes to 2694 * @argument {Object} styles 2695 * Object with a list of properties and values which will be applied to the element 2696 */ 2697 2698 2699 function setAttributes(element, attributes) {
2700 Object.keys(attributes).forEach(function (prop) { 2701 var value = attributes[prop]; 2702 2703 if (value !== false) { 2704 element.setAttribute(prop, attributes[prop]); 2705 } else { 2706 element.removeAttribute(prop); 2707 } 2708 }); 2709 } 2710 /** 2711 * @function 2712 * @memberof Modifiers 2713 * @argument {Object} data - The data object generated by `update` method 2714 * @argument {Object} data.styles - List of style properties - values to apply to popper element 2715 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 2716 * @argument {Object} options - Modifiers configuration and options 2717 * @returns {Object} The same data object 2718 */ 2719 2720 2721 function applyStyle(data) { 2722 // any property present in `data.styles` will be applied to the popper, 2723 // in this way we can make the 3rd party modifiers add custom styles to it 2724 // Be aware, modifiers could override the properties defined in the previous 2725 // lines of this modifier! 2726 setStyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper, 2727 // they will be set as HTML attributes of the element 2728 2729 setAttributes(data.instance.popper, data.attributes); // if arrowElement is defined and arrowStyles has some properties 2730
vendor: 33,555 bytes, lines 2731-3593
2731 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 2732 setStyles(data.arrowElement, data.arrowStyles); 2733 } 2734 2735 return data; 2736 } 2737 /** 2738 * Set the x-placement attribute before everything else because it could be used 2739 * to add margins to the popper margins needs to be calculated to get the 2740 * correct popper offsets. 2741 * @method 2742 * @memberof Popper.modifiers 2743 * @param {HTMLElement} reference - The reference element used to position the popper 2744 * @param {HTMLElement} popper - The HTML element used as popper 2745 * @param {Object} options - Popper.js options 2746 */ 2747 2748 2749 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 2750 // compute reference element offsets 2751 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); // compute auto placement, store placement inside the data object, 2752 // modifiers will be able to edit `placement` if needed 2753 // and refer to originalPlacement to know the original value 2754 2755 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 2756 popper.setAttribute('x-placement', placement); // Apply `position` to popper before anything else because 2757 // without the position applied we can't guarantee correct computations 2758 2759 setStyles(popper, { 2760 position: options.positionFixed ? 'fixed' : 'absolute' 2761 }); 2762 return options; 2763 } 2764 /** 2765 * @function 2766 * @memberof Popper.Utils 2767 * @argument {Object} data - The data object generated by `update` method 2768 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 2769 * @returns {Object} The popper's position offsets rounded 2770 * 2771 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 2772 * good as it can be within reason. 2773 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 2774 * 2775 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 2776 * as well on High DPI screens). 2777 * 2778 * Firefox prefers no rounding for positioning and does not have blurriness on 2779 * high DPI screens. 2780 * 2781 * Only horizontal placement and left/right values need to be considered. 2782 */ 2783 2784 2785 function getRoundedOffsets(data, shouldRound) { 2786 var _data$offsets = data.offsets, 2787 popper = _data$offsets.popper, 2788 reference = _data$offsets.reference; 2789 var round = Math.round, 2790 floor = Math.floor; 2791 2792 var noRound = function noRound(v) { 2793 return v; 2794 }; 2795 2796 var referenceWidth = round(reference.width); 2797 var popperWidth = round(popper.width); 2798 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 2799 var isVariation = data.placement.indexOf('-') !== -1; 2800 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 2801 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 2802 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 2803 var verticalToInteger = !shouldRound ? noRound : round; 2804 return { 2805 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 2806 top: verticalToInteger(popper.top), 2807 bottom: verticalToInteger(popper.bottom), 2808 right: horizontalToInteger(popper.right) 2809 }; 2810 } 2811 2812 var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 2813 /** 2814 * @function 2815 * @memberof Modifiers 2816 * @argument {Object} data - The data object generated by `update` method 2817 * @argument {Object} options - Modifiers configuration and options 2818 * @returns {Object} The data object, properly modified 2819 */ 2820 2821 function computeStyle(data, options) { 2822 var x = options.x, 2823 y = options.y; 2824 var popper = data.offsets.popper; // Remove this legacy support in Popper.js v2 2825 2826 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 2827 return modifier.name === 'applyStyle'; 2828 }).gpuAcceleration; 2829 2830 if (legacyGpuAccelerationOption !== undefined) { 2831 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 2832 } 2833 2834 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 2835 var offsetParent = getOffsetParent(data.instance.popper); 2836 var offsetParentRect = getBoundingClientRect(offsetParent); // Styles 2837 2838 var styles = { 2839 position: popper.position 2840 }; 2841 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 2842 var sideA = x === 'bottom' ? 'top' : 'bottom'; 2843 var sideB = y === 'right' ? 'left' : 'right'; // if gpuAcceleration is set to `true` and transform is supported, 2844 // we use `translate3d` to apply the position to the popper we 2845 // automatically use the supported prefixed version if needed 2846 2847 var prefixedProperty = getSupportedPropertyName('transform'); // now, let's make a step back and look at this code closely (wtf?) 2848 // If the content of the popper grows once it's been positioned, it 2849 // may happen that the popper gets misplaced because of the new content 2850 // overflowing its reference element 2851 // To avoid this problem, we provide two options (x and y), which allow 2852 // the consumer to define the offset origin. 2853 // If we position a popper on top of a reference element, we can set 2854 // `x` to `top` to make the popper grow towards its top instead of 2855 // its bottom. 2856 2857 var left = void 0, 2858 top = void 0; 2859 2860 if (sideA === 'bottom') { 2861 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 2862 // and not the bottom of the html element 2863 if (offsetParent.nodeName === 'HTML') { 2864 top = -offsetParent.clientHeight + offsets.bottom; 2865 } else { 2866 top = -offsetParentRect.height + offsets.bottom; 2867 } 2868 } else { 2869 top = offsets.top; 2870 } 2871 2872 if (sideB === 'right') { 2873 if (offsetParent.nodeName === 'HTML') { 2874 left = -offsetParent.clientWidth + offsets.right; 2875 } else { 2876 left = -offsetParentRect.width + offsets.right; 2877 } 2878 } else { 2879 left = offsets.left; 2880 } 2881 2882 if (gpuAcceleration && prefixedProperty) { 2883 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 2884 styles[sideA] = 0; 2885 styles[sideB] = 0; 2886 styles.willChange = 'transform'; 2887 } else { 2888 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 2889 var invertTop = sideA === 'bottom' ? -1 : 1; 2890 var invertLeft = sideB === 'right' ? -1 : 1; 2891 styles[sideA] = top * invertTop; 2892 styles[sideB] = left * invertLeft; 2893 styles.willChange = sideA + ', ' + sideB; 2894 } // Attributes 2895 2896 2897 var attributes = { 2898 'x-placement': data.placement 2899 }; // Update `data` attributes, styles and arrowStyles 2900 2901 data.attributes = _extends$1({}, attributes, data.attributes); 2902 data.styles = _extends$1({}, styles, data.styles); 2903 data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles); 2904 return data; 2905 } 2906 /** 2907 * Helper used to know if the given modifier depends from another one.<br /> 2908 * It checks if the needed modifier is listed and enabled. 2909 * @method 2910 * @memberof Popper.Utils 2911 * @param {Array} modifiers - list of modifiers 2912 * @param {String} requestingName - name of requesting modifier 2913 * @param {String} requestedName - name of requested modifier 2914 * @returns {Boolean} 2915 */ 2916 2917 2918 function isModifierRequired(modifiers, requestingName, requestedName) { 2919 var requesting = find(modifiers, function (_ref) { 2920 var name = _ref.name; 2921 return name === requestingName; 2922 }); 2923 var isRequired = !!requesting && modifiers.some(function (modifier) { 2924 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 2925 }); 2926 2927 if (!isRequired) { 2928 var _requesting = '`' + requestingName + '`'; 2929 2930 var requested = '`' + requestedName + '`'; 2931 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 2932 } 2933 2934 return isRequired; 2935 } 2936 /** 2937 * @function 2938 * @memberof Modifiers 2939 * @argument {Object} data - The data object generated by update method 2940 * @argument {Object} options - Modifiers configuration and options 2941 * @returns {Object} The data object, properly modified 2942 */ 2943 2944 2945 function arrow(data, options) { 2946 var _data$offsets$arrow; // arrow depends on keepTogether in order to work 2947 2948 2949 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 2950 return data; 2951 } 2952 2953 var arrowElement = options.element; // if arrowElement is a string, suppose it's a CSS selector 2954 2955 if (typeof arrowElement === 'string') { 2956 arrowElement = data.instance.popper.querySelector(arrowElement); // if arrowElement is not found, don't run the modifier 2957 2958 if (!arrowElement) { 2959 return data; 2960 } 2961 } else { 2962 // if the arrowElement isn't a query selector we must check that the 2963 // provided DOM node is child of its popper node 2964 if (!data.instance.popper.contains(arrowElement)) { 2965 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 2966 return data; 2967 } 2968 } 2969 2970 var placement = data.placement.split('-')[0]; 2971 var _data$offsets = data.offsets, 2972 popper = _data$offsets.popper, 2973 reference = _data$offsets.reference; 2974 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 2975 var len = isVertical ? 'height' : 'width'; 2976 var sideCapitalized = isVertical ? 'Top' : 'Left'; 2977 var side = sideCapitalized.toLowerCase(); 2978 var altSide = isVertical ? 'left' : 'top'; 2979 var opSide = isVertical ? 'bottom' : 'right'; 2980 var arrowElementSize = getOuterSizes(arrowElement)[len]; // 2981 // extends keepTogether behavior making sure the popper and its 2982 // reference have enough pixels in conjunction 2983 // 2984 // top/left side 2985 2986 if (reference[opSide] - arrowElementSize < popper[side]) { 2987 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 2988 } // bottom/right side 2989 2990 2991 if (reference[side] + arrowElementSize > popper[opSide]) { 2992 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 2993 } 2994 2995 data.offsets.popper = getClientRect(data.offsets.popper); // compute center of the popper 2996 2997 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; // Compute the sideValue using the updated popper offsets 2998 // take popper margin in account because we don't have this info available 2999 3000 var css = getStyleComputedProperty(data.instance.popper); 3001 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 3002 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 3003 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; // prevent arrowElement from being placed not contiguously to its popper 3004 3005 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 3006 data.arrowElement = arrowElement; 3007 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 3008 return data; 3009 } 3010 /** 3011 * Get the opposite placement variation of the given one 3012 * @method 3013 * @memberof Popper.Utils 3014 * @argument {String} placement variation 3015 * @returns {String} flipped placement variation 3016 */ 3017 3018 3019 function getOppositeVariation(variation) { 3020 if (variation === 'end') { 3021 return 'start'; 3022 } else if (variation === 'start') { 3023 return 'end'; 3024 } 3025 3026 return variation; 3027 } 3028 /** 3029 * List of accepted placements to use as values of the `placement` option.<br /> 3030 * Valid placements are: 3031 * - `auto` 3032 * - `top` 3033 * - `right` 3034 * - `bottom` 3035 * - `left` 3036 * 3037 * Each placement can have a variation from this list: 3038 * - `-start` 3039 * - `-end` 3040 * 3041 * Variations are interpreted easily if you think of them as the left to right 3042 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 3043 * is right.<br /> 3044 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 3045 * 3046 * Some valid examples are: 3047 * - `top-end` (on top of reference, right aligned) 3048 * - `right-start` (on right of reference, top aligned) 3049 * - `bottom` (on bottom, centered) 3050 * - `auto-end` (on the side with more space available, alignment depends by placement) 3051 * 3052 * @static 3053 * @type {Array} 3054 * @enum {String} 3055 * @readonly 3056 * @method placements 3057 * @memberof Popper 3058 */ 3059 3060 3061 var 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']; // Get rid of `auto` `auto-start` and `auto-end` 3062 3063 var validPlacements = placements.slice(3); 3064 /** 3065 * Given an initial placement, returns all the subsequent placements 3066 * clockwise (or counter-clockwise). 3067 * 3068 * @method 3069 * @memberof Popper.Utils 3070 * @argument {String} placement - A valid placement (it accepts variations) 3071 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 3072 * @returns {Array} placements including their variations 3073 */ 3074 3075 function clockwise(placement) { 3076 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 3077 var index = validPlacements.indexOf(placement); 3078 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 3079 return counter ? arr.reverse() : arr; 3080 } 3081 3082 var BEHAVIORS = { 3083 FLIP: 'flip', 3084 CLOCKWISE: 'clockwise', 3085 COUNTERCLOCKWISE: 'counterclockwise' 3086 }; 3087 /** 3088 * @function 3089 * @memberof Modifiers 3090 * @argument {Object} data - The data object generated by update method 3091 * @argument {Object} options - Modifiers configuration and options 3092 * @returns {Object} The data object, properly modified 3093 */ 3094 3095 function flip(data, options) { 3096 // if `inner` modifier is enabled, we can't use the `flip` modifier 3097 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 3098 return data; 3099 } 3100 3101 if (data.flipped && data.placement === data.originalPlacement) { 3102 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 3103 return data; 3104 } 3105 3106 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 3107 var placement = data.placement.split('-')[0]; 3108 var placementOpposite = getOppositePlacement(placement); 3109 var variation = data.placement.split('-')[1] || ''; 3110 var flipOrder = []; 3111 3112 switch (options.behavior) { 3113 case BEHAVIORS.FLIP: 3114 flipOrder = [placement, placementOpposite]; 3115 break; 3116 3117 case BEHAVIORS.CLOCKWISE: 3118 flipOrder = clockwise(placement); 3119 break; 3120 3121 case BEHAVIORS.COUNTERCLOCKWISE: 3122 flipOrder = clockwise(placement, true); 3123 break; 3124 3125 default: 3126 flipOrder = options.behavior; 3127 } 3128 3129 flipOrder.forEach(function (step, index) { 3130 if (placement !== step || flipOrder.length === index + 1) { 3131 return data; 3132 } 3133 3134 placement = data.placement.split('-')[0]; 3135 placementOpposite = getOppositePlacement(placement); 3136 var popperOffsets = data.offsets.popper; 3137 var refOffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here 3138 3139 var floor = Math.floor; 3140 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); 3141 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 3142 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 3143 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 3144 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 3145 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; // flip the variation if required 3146 3147 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; // flips variation if reference element overflows boundaries 3148 3149 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); // flips variation if popper content overflows boundaries 3150 3151 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 3152 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 3153 3154 if (overlapsRef || overflowsBoundaries || flippedVariation) { 3155 // this boolean to detect any flip loop 3156 data.flipped = true; 3157 3158 if (overlapsRef || overflowsBoundaries) { 3159 placement = flipOrder[index + 1]; 3160 } 3161 3162 if (flippedVariation) { 3163 variation = getOppositeVariation(variation); 3164 } 3165 3166 data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with 3167 // any additional property we may add in the future 3168 3169 data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 3170 data = runModifiers(data.instance.modifiers, data, 'flip'); 3171 } 3172 }); 3173 return data; 3174 } 3175 /** 3176 * @function 3177 * @memberof Modifiers 3178 * @argument {Object} data - The data object generated by update method 3179 * @argument {Object} options - Modifiers configuration and options 3180 * @returns {Object} The data object, properly modified 3181 */ 3182 3183 3184 function keepTogether(data) { 3185 var _data$offsets = data.offsets, 3186 popper = _data$offsets.popper, 3187 reference = _data$offsets.reference; 3188 var placement = data.placement.split('-')[0]; 3189 var floor = Math.floor; 3190 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 3191 var side = isVertical ? 'right' : 'bottom'; 3192 var opSide = isVertical ? 'left' : 'top'; 3193 var measurement = isVertical ? 'width' : 'height'; 3194 3195 if (popper[side] < floor(reference[opSide])) { 3196 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 3197 } 3198 3199 if (popper[opSide] > floor(reference[side])) { 3200 data.offsets.popper[opSide] = floor(reference[side]); 3201 } 3202 3203 return data; 3204 } 3205 /** 3206 * Converts a string containing value + unit into a px value number 3207 * @function 3208 * @memberof {modifiers~offset} 3209 * @private 3210 * @argument {String} str - Value + unit string 3211 * @argument {String} measurement - `height` or `width` 3212 * @argument {Object} popperOffsets 3213 * @argument {Object} referenceOffsets 3214 * @returns {Number|String} 3215 * Value in pixels, or original string if no values were extracted 3216 */ 3217 3218 3219 function toValue(str, measurement, popperOffsets, referenceOffsets) { 3220 // separate value from unit 3221 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 3222 var value = +split[1]; 3223 var unit = split[2]; // If it's not a number it's an operator, I guess 3224 3225 if (!value) { 3226 return str; 3227 } 3228 3229 if (unit.indexOf('%') === 0) { 3230 var element = void 0; 3231 3232 switch (unit) { 3233 case '%p': 3234 element = popperOffsets; 3235 break; 3236 3237 case '%': 3238 case '%r': 3239 default: 3240 element = referenceOffsets; 3241 } 3242 3243 var rect = getClientRect(element); 3244 return rect[measurement] / 100 * value; 3245 } else if (unit === 'vh' || unit === 'vw') { 3246 // if is a vh or vw, we calculate the size based on the viewport 3247 var size = void 0; 3248 3249 if (unit === 'vh') { 3250 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 3251 } else { 3252 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 3253 } 3254 3255 return size / 100 * value; 3256 } else { 3257 // if is an explicit pixel unit, we get rid of the unit and keep the value 3258 // if is an implicit unit, it's px, and we return just the value 3259 return value; 3260 } 3261 } 3262 /** 3263 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 3264 * @function 3265 * @memberof {modifiers~offset} 3266 * @private 3267 * @argument {String} offset 3268 * @argument {Object} popperOffsets 3269 * @argument {Object} referenceOffsets 3270 * @argument {String} basePlacement 3271 * @returns {Array} a two cells array with x and y offsets in numbers 3272 */ 3273 3274 3275 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 3276 var offsets = [0, 0]; // Use height if placement is left or right and index is 0 otherwise use width 3277 // in this way the first offset will use an axis and the second one 3278 // will use the other one 3279 3280 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; // Split the offset string to obtain a list of values and operands 3281 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 3282 3283 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 3284 return frag.trim(); 3285 }); // Detect if the offset string contains a pair of values or a single one 3286 // they could be separated by comma or space 3287 3288 var divider = fragments.indexOf(find(fragments, function (frag) { 3289 return frag.search(/,|\s/) !== -1; 3290 })); 3291 3292 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 3293 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 3294 } // If divider is found, we divide the list of values and operands to divide 3295 // them by ofset X and Y. 3296 3297 3298 var splitRegex = /\s*,\s*|\s+/; 3299 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]; // Convert the values with units to absolute pixels to allow our computations 3300 3301 ops = ops.map(function (op, index) { 3302 // Most of the units rely on the orientation of the popper 3303 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 3304 var mergeWithPrevious = false; 3305 return op // This aggregates any `+` or `-` sign that aren't considered operators 3306 // e.g.: 10 + +5 => [10, +, +5] 3307 .reduce(function (a, b) { 3308 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 3309 a[a.length - 1] = b; 3310 mergeWithPrevious = true; 3311 return a; 3312 } else if (mergeWithPrevious) { 3313 a[a.length - 1] += b; 3314 mergeWithPrevious = false; 3315 return a; 3316 } else { 3317 return a.concat(b); 3318 } 3319 }, []) // Here we convert the string values into number values (in px) 3320 .map(function (str) { 3321 return toValue(str, measurement, popperOffsets, referenceOffsets); 3322 }); 3323 }); // Loop trough the offsets arrays and execute the operations 3324 3325 ops.forEach(function (op, index) { 3326 op.forEach(function (frag, index2) { 3327 if (isNumeric(frag)) { 3328 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 3329 } 3330 }); 3331 }); 3332 return offsets; 3333 } 3334 /** 3335 * @function 3336 * @memberof Modifiers 3337 * @argument {Object} data - The data object generated by update method 3338 * @argument {Object} options - Modifiers configuration and options 3339 * @argument {Number|String} options.offset=0 3340 * The offset value as described in the modifier description 3341 * @returns {Object} The data object, properly modified 3342 */ 3343 3344 3345 function offset(data, _ref) { 3346 var offset = _ref.offset; 3347 var placement = data.placement, 3348 _data$offsets = data.offsets, 3349 popper = _data$offsets.popper, 3350 reference = _data$offsets.reference; 3351 var basePlacement = placement.split('-')[0]; 3352 var offsets = void 0; 3353 3354 if (isNumeric(+offset)) { 3355 offsets = [+offset, 0]; 3356 } else { 3357 offsets = parseOffset(offset, popper, reference, basePlacement); 3358 } 3359 3360 if (basePlacement === 'left') { 3361 popper.top += offsets[0]; 3362 popper.left -= offsets[1]; 3363 } else if (basePlacement === 'right') { 3364 popper.top += offsets[0]; 3365 popper.left += offsets[1]; 3366 } else if (basePlacement === 'top') { 3367 popper.left += offsets[0]; 3368 popper.top -= offsets[1]; 3369 } else if (basePlacement === 'bottom') { 3370 popper.left += offsets[0]; 3371 popper.top += offsets[1]; 3372 } 3373 3374 data.popper = popper; 3375 return data; 3376 } 3377 /** 3378 * @function 3379 * @memberof Modifiers 3380 * @argument {Object} data - The data object generated by `update` method 3381 * @argument {Object} options - Modifiers configuration and options 3382 * @returns {Object} The data object, properly modified 3383 */ 3384 3385 3386 function preventOverflow(data, options) { 3387 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); // If offsetParent is the reference element, we really want to 3388 // go one step up and use the next offsetParent as reference to 3389 // avoid to make this modifier completely useless and look like broken 3390 3391 if (data.instance.reference === boundariesElement) { 3392 boundariesElement = getOffsetParent(boundariesElement); 3393 } // NOTE: DOM access here 3394 // resets the popper's position so that the document size can be calculated excluding 3395 // the size of the popper element itself 3396 3397 3398 var transformProp = getSupportedPropertyName('transform'); 3399 var popperStyles = data.instance.popper.style; // assignment to help minification 3400 3401 var top = popperStyles.top, 3402 left = popperStyles.left, 3403 transform = popperStyles[transformProp]; 3404 popperStyles.top = ''; 3405 popperStyles.left = ''; 3406 popperStyles[transformProp] = ''; 3407 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); // NOTE: DOM access here 3408 // restores the original style properties after the offsets have been computed 3409 3410 popperStyles.top = top; 3411 popperStyles.left = left; 3412 popperStyles[transformProp] = transform; 3413 options.boundaries = boundaries; 3414 var order = options.priority; 3415 var popper = data.offsets.popper; 3416 var check = { 3417 primary: function primary(placement) { 3418 var value = popper[placement]; 3419 3420 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 3421 value = Math.max(popper[placement], boundaries[placement]); 3422 } 3423 3424 return defineProperty({}, placement, value); 3425 }, 3426 secondary: function secondary(placement) { 3427 var mainSide = placement === 'right' ? 'left' : 'top'; 3428 var value = popper[mainSide]; 3429 3430 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 3431 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 3432 } 3433 3434 return defineProperty({}, mainSide, value); 3435 } 3436 }; 3437 order.forEach(function (placement) { 3438 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 3439 popper = _extends$1({}, popper, check[side](placement)); 3440 }); 3441 data.offsets.popper = popper; 3442 return data; 3443 } 3444 /** 3445 * @function 3446 * @memberof Modifiers 3447 * @argument {Object} data - The data object generated by `update` method 3448 * @argument {Object} options - Modifiers configuration and options 3449 * @returns {Object} The data object, properly modified 3450 */ 3451 3452 3453 function shift(data) { 3454 var placement = data.placement; 3455 var basePlacement = placement.split('-')[0]; 3456 var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier 3457 3458 if (shiftvariation) { 3459 var _data$offsets = data.offsets, 3460 reference = _data$offsets.reference, 3461 popper = _data$offsets.popper; 3462 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 3463 var side = isVertical ? 'left' : 'top'; 3464 var measurement = isVertical ? 'width' : 'height'; 3465 var shiftOffsets = { 3466 start: defineProperty({}, side, reference[side]), 3467 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 3468 }; 3469 data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]); 3470 } 3471 3472 return data; 3473 } 3474 /** 3475 * @function 3476 * @memberof Modifiers 3477 * @argument {Object} data - The data object generated by update method 3478 * @argument {Object} options - Modifiers configuration and options 3479 * @returns {Object} The data object, properly modified 3480 */ 3481 3482 3483 function hide(data) { 3484 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 3485 return data; 3486 } 3487 3488 var refRect = data.offsets.reference; 3489 var bound = find(data.instance.modifiers, function (modifier) { 3490 return modifier.name === 'preventOverflow'; 3491 }).boundaries; 3492 3493 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 3494 // Avoid unnecessary DOM access if visibility hasn't changed 3495 if (data.hide === true) { 3496 return data; 3497 } 3498 3499 data.hide = true; 3500 data.attributes['x-out-of-boundaries'] = ''; 3501 } else { 3502 // Avoid unnecessary DOM access if visibility hasn't changed 3503 if (data.hide === false) { 3504 return data; 3505 } 3506 3507 data.hide = false; 3508 data.attributes['x-out-of-boundaries'] = false; 3509 } 3510 3511 return data; 3512 } 3513 /** 3514 * @function 3515 * @memberof Modifiers 3516 * @argument {Object} data - The data object generated by `update` method 3517 * @argument {Object} options - Modifiers configuration and options 3518 * @returns {Object} The data object, properly modified 3519 */ 3520 3521 3522 function inner(data) { 3523 var placement = data.placement; 3524 var basePlacement = placement.split('-')[0]; 3525 var _data$offsets = data.offsets, 3526 popper = _data$offsets.popper, 3527 reference = _data$offsets.reference; 3528 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 3529 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 3530 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 3531 data.placement = getOppositePlacement(placement); 3532 data.offsets.popper = getClientRect(popper); 3533 return data; 3534 } 3535 /** 3536 * Modifier function, each modifier can have a function of this type assigned 3537 * to its `fn` property.<br /> 3538 * These functions will be called on each update, this means that you must 3539 * make sure they are performant enough to avoid performance bottlenecks. 3540 * 3541 * @function ModifierFn 3542 * @argument {dataObject} data - The data object generated by `update` method 3543 * @argument {Object} options - Modifiers configuration and options 3544 * @returns {dataObject} The data object, properly modified 3545 */ 3546 3547 /** 3548 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 3549 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 3550 * needed by the library. 3551 * 3552 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 3553 * All the other properties are configurations that could be tweaked. 3554 * @namespace modifiers 3555 */ 3556 3557 3558 var modifiers = { 3559 /** 3560 * Modifier used to shift the popper on the start or end of its reference 3561 * element.<br /> 3562 * It will read the variation of the `placement` property.<br /> 3563 * It can be one either `-end` or `-start`. 3564 * @memberof modifiers 3565 * @inner 3566 */ 3567 shift: { 3568 /** @prop {number} order=100 - Index used to define the order of execution */ 3569 order: 100, 3570 3571 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3572 enabled: true, 3573 3574 /** @prop {ModifierFn} */ 3575 fn: shift 3576 }, 3577 3578 /** 3579 * The `offset` modifier can shift your popper on both its axis. 3580 * 3581 * It accepts the following units: 3582 * - `px` or unit-less, interpreted as pixels 3583 * - `%` or `%r`, percentage relative to the length of the reference element 3584 * - `%p`, percentage relative to the length of the popper element 3585 * - `vw`, CSS viewport width unit 3586 * - `vh`, CSS viewport height unit 3587 * 3588 * For length is intended the main axis relative to the placement of the popper.<br /> 3589 * This means that if the placement is `top` or `bottom`, the length will be the 3590 * `width`. In case of `left` or `right`, it will be the `height`. 3591 * 3592 * You can provide a single value (as `Number` or `String`), or a pair of values 3593 * as `String` divided by a comma or one (or more) white space
3593s.<br /> 3594 * The latter is a deprecated method because it leads to confusion and will be 3595 * removed in v2.<br /> 3596 * Additionally, it accepts additions and subtractions between different units. 3597 * Note that multiplications and divisions aren't supported. 3598 * 3599 * Valid examples are: 3600 * ``` 3601 * 10 3602 * '10%' 3603 * '10, 10' 3604 * '10%, 10' 3605 * '10 + 10%' 3606 * '10 - 5vh + 3%' 3607 * '-10px + 5vh, 5px - 6%' 3608 * ``` 3609 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 3610 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 3611 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 3612 * 3613 * @memberof modifiers 3614 * @inner 3615 */ 3616 offset: { 3617 /** @prop {number} order=200 - Index used to define the order of execution */ 3618 order: 200, 3619 3620 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3621 enabled: true, 3622 3623 /** @prop {ModifierFn} */ 3624 fn: offset, 3625 3626 /** @prop {Number|String} offset=0 3627 * The offset value as described in the modifier description 3628 */ 3629 offset: 0 3630 }, 3631 3632 /** 3633 * Modifier used to prevent the popper from being positioned outside the boundary. 3634 * 3635 * A scenario exists where the reference itself is not within the boundaries.<br /> 3636 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 3637 * In this case we need to decide whether the popper should either: 3638 * 3639 * - detach from the reference and remain "trapped" in the boundaries, or 3640 * - if it should ignore the boundary and "escape with its reference" 3641 * 3642 * When `escapeWithReference` is set to`true` and reference is completely 3643 * outside its boundaries, the popper will overflow (or completely leave) 3644 * the boundaries in order to remain attached to the edge of the reference. 3645 * 3646 * @memberof modifiers 3647 * @inner 3648 */ 3649 preventOverflow: { 3650 /** @prop {number} order=300 - Index used to define the order of execution */ 3651 order: 300, 3652 3653 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3654 enabled: true, 3655 3656 /** @prop {ModifierFn} */ 3657 fn: preventOverflow, 3658 3659 /** 3660 * @prop {Array} [priority=['left','right','top','bottom']] 3661 * Popper will try to prevent overflow following these priorities by default, 3662 * then, it could overflow on the left and on top of the `boundariesElement` 3663 */ 3664 priority: ['left', 'right', 'top', 'bottom'], 3665 3666 /** 3667 * @prop {number} padding=5 3668 * Amount of pixel used to define a minimum distance between the boundaries 3669 * and the popper. This makes sure the popper always has a little padding 3670 * between the edges of its container 3671 */ 3672 padding: 5, 3673 3674 /** 3675 * @prop {String|HTMLElement} boundariesElement='scrollParent' 3676 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 3677 * `viewport` or any DOM element. 3678 */ 3679 boundariesElement: 'scrollParent' 3680 }, 3681 3682 /** 3683 * Modifier used to make sure the reference and its popper stay near each other 3684 * without leaving any gap between the two. Especially useful when the arrow is 3685 * enabled and you want to ensure that it points to its reference element. 3686 * It cares only about the first axis. You can still have poppers with margin 3687 * between the popper and its reference element. 3688 * @memberof modifiers 3689 * @inner 3690 */ 3691 keepTogether: { 3692 /** @prop {number} order=400 - Index used to define the order of execution */ 3693 order: 400, 3694 3695 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3696 enabled: true, 3697 3698 /** @prop {ModifierFn} */ 3699 fn: keepTogether 3700 }, 3701 3702 /** 3703 * This modifier is used to move the `arrowElement` of the popper to make 3704 * sure it is positioned between the reference element and its popper element. 3705 * It will read the outer size of the `arrowElement` node to detect how many 3706 * pixels of conjunction are needed. 3707 * 3708 * It has no effect if no `arrowElement` is provided. 3709 * @memberof modifiers 3710 * @inner 3711 */ 3712 arrow: { 3713 /** @prop {number} order=500 - Index used to define the order of execution */ 3714 order: 500, 3715 3716 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3717 enabled: true, 3718 3719 /** @prop {ModifierFn} */ 3720 fn: arrow, 3721 3722 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 3723 element: '[x-arrow]' 3724 }, 3725 3726 /** 3727 * Modifier used to flip the popper's placement when it starts to overlap its 3728 * reference element. 3729 * 3730 * Requires the `preventOverflow` modifier before it in order to work. 3731 * 3732 * **NOTE:** this modifier will interrupt the current update cycle and will 3733 * restart it if it detects the need to flip the placement. 3734 * @memberof modifiers 3735 * @inner 3736 */ 3737 flip: { 3738 /** @prop {number} order=600 - Index used to define the order of execution */ 3739 order: 600, 3740 3741 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3742 enabled: true, 3743 3744 /** @prop {ModifierFn} */ 3745 fn: flip, 3746 3747 /** 3748 * @prop {String|Array} behavior='flip' 3749 * The behavior used to change the popper's placement. It can be one of 3750 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 3751 * placements (with optional variations) 3752 */ 3753 behavior: 'flip', 3754 3755 /** 3756 * @prop {number} padding=5 3757 * The popper will flip if it hits the edges of the `boundariesElement` 3758 */ 3759 padding: 5, 3760 3761 /** 3762 * @prop {String|HTMLElement} boundariesElement='viewport' 3763 * The element which will define the boundaries of the popper position. 3764 * The popper will never be placed outside of the defined boundaries 3765 * (except if `keepTogether` is enabled) 3766 */ 3767 boundariesElement: 'viewport', 3768 3769 /** 3770 * @prop {Boolean} flipVariations=false 3771 * The popper will switch placement variation between `-start` and `-end` when 3772 * the reference element overlaps its boundaries. 3773 * 3774 * The original placement should have a set variation. 3775 */ 3776 flipVariations: false, 3777 3778 /** 3779 * @prop {Boolean} flipVariationsByContent=false 3780 * The popper will switch placement variation between `-start` and `-end` when 3781 * the popper element overlaps its reference boundaries. 3782 * 3783 * The original placement should have a set variation. 3784 */ 3785 flipVariationsByContent: false 3786 }, 3787 3788 /** 3789 * Modifier used to make the popper flow toward the inner of the reference element. 3790 * By default, when this modifier is disabled, the popper will be placed outside 3791 * the reference element. 3792 * @memberof modifiers 3793 * @inner 3794 */ 3795 inner: { 3796 /** @prop {number} order=700 - Index used to define the order of execution */ 3797 order: 700, 3798 3799 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 3800 enabled: false, 3801 3802 /** @prop {ModifierFn} */ 3803 fn: inner 3804 }, 3805 3806 /** 3807 * Modifier used to hide the popper when its reference element is outside of the 3808 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 3809 * be used to hide with a CSS selector the popper when its reference is 3810 * out of boundaries. 3811 * 3812 * Requires the `preventOverflow` modifier before it in order to work. 3813 * @memberof modifiers 3814 * @inner 3815 */ 3816 hide: { 3817 /** @prop {number} order=800 - Index used to define the order of execution */ 3818 order: 800, 3819 3820 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3821 enabled: true, 3822 3823 /** @prop {ModifierFn} */ 3824 fn: hide 3825 }, 3826 3827 /** 3828 * Computes the style that will be applied to the popper element to gets 3829 * properly positioned. 3830 * 3831 * Note that this modifier will not touch the DOM, it just prepares the styles 3832 * so that `applyStyle` modifier can apply it. This separation is useful 3833 * in case you need to replace `applyStyle` with a custom implementation. 3834 * 3835 * This modifier has `850` as `order` value to maintain backward compatibility 3836 * with previous versions of Popper.js. Expect the modifiers ordering method 3837 * to change in future major versions of the library. 3838 * 3839 * @memberof modifiers 3840 * @inner 3841 */ 3842 computeStyle: { 3843 /** @prop {number} order=850 - Index used to define the order of execution */ 3844 order: 850, 3845 3846 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3847 enabled: true, 3848 3849 /** @prop {ModifierFn} */ 3850 fn: computeStyle, 3851 3852 /** 3853 * @prop {Boolean} gpuAcceleration=true 3854 * If true, it uses the CSS 3D transformation to position the popper. 3855 * Otherwise, it will use the `top` and `left` properties 3856 */ 3857 gpuAcceleration: true, 3858 3859 /** 3860 * @prop {string} [x='bottom'] 3861 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 3862 * Change this if your popper should grow in a direction different from `bottom` 3863 */ 3864 x: 'bottom', 3865 3866 /** 3867 * @prop {string} [x='left'] 3868 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 3869 * Change this if your popper should grow in a direction different from `right` 3870 */ 3871 y: 'right' 3872 }, 3873 3874 /** 3875 * Applies the computed styles to the popper element. 3876 * 3877 * All the DOM manipulations are limited to this modifier. This is useful in case 3878 * you want to integrate Popper.js inside a framework or view library and you 3879 * want to delegate all the DOM manipulations to it. 3880 * 3881 * Note that if you disable this modifier, you must make sure the popper element 3882 * has its position set to `absolute` before Popper.js can do its work! 3883 * 3884 * Just disable this modifier and define your own to achieve the desired effect. 3885 * 3886 * @memberof modifiers 3887 * @inner 3888 */ 3889 applyStyle: { 3890 /** @prop {number} order=900 - Index used to define the order of execution */ 3891 order: 900, 3892 3893 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 3894 enabled: true, 3895 3896 /** @prop {ModifierFn} */
vendor: 5,060 bytes, lines 3897-4034
3897 fn: applyStyle, 3898 3899 /** @prop {Function} */ 3900 onLoad: applyStyleOnLoad, 3901 3902 /** 3903 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 3904 * @prop {Boolean} gpuAcceleration=true 3905 * If true, it uses the CSS 3D transformation to position the popper. 3906 * Otherwise, it will use the `top` and `left` properties 3907 */ 3908 gpuAcceleration: undefined 3909 } 3910 }; 3911 /** 3912 * The `dataObject` is an object containing all the information used by Popper.js. 3913 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 3914 * @name dataObject 3915 * @property {Object} data.instance The Popper.js instance 3916 * @property {String} data.placement Placement applied to popper 3917 * @property {String} data.originalPlacement Placement originally defined on init 3918 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 3919 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 3920 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 3921 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 3922 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 3923 * @property {Object} data.boundaries Offsets of the popper boundaries 3924 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 3925 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 3926 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 3927 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 3928 */ 3929 3930 /** 3931 * Default options provided to Popper.js constructor.<br /> 3932 * These can be overridden using the `options` argument of Popper.js.<br /> 3933 * To override an option, simply pass an object with the same 3934 * structure of the `options` object, as the 3rd argument. For example: 3935 * ``` 3936 * new Popper(ref, pop, { 3937 * modifiers: { 3938 * preventOverflow: { enabled: false } 3939 * } 3940 * }) 3941 * ``` 3942 * @type {Object} 3943 * @static 3944 * @memberof Popper 3945 */ 3946 3947 var Defaults = { 3948 /** 3949 * Popper's placement. 3950 * @prop {Popper.placements} placement='bottom' 3951 */ 3952 placement: 'bottom', 3953 3954 /** 3955 * Set this to true if you want popper to position it self in 'fixed' mode 3956 * @prop {Boolean} positionFixed=false 3957 */ 3958 positionFixed: false, 3959 3960 /** 3961 * Whether events (resize, scroll) are initially enabled. 3962 * @prop {Boolean} eventsEnabled=true 3963 */ 3964 eventsEnabled: true, 3965 3966 /** 3967 * Set to true if you want to automatically remove the popper when 3968 * you call the `destroy` method. 3969 * @prop {Boolean} removeOnDestroy=false 3970 */ 3971 removeOnDestroy: false, 3972 3973 /** 3974 * Callback called when the popper is created.<br /> 3975 * By default, it is set to no-op.<br /> 3976 * Access Popper.js instance with `data.instance`. 3977 * @prop {onCreate} 3978 */ 3979 onCreate: function onCreate() {}, 3980 3981 /** 3982 * Callback called when the popper is updated. This callback is not called 3983 * on the initialization/creation of the popper, but only on subsequent 3984 * updates.<br /> 3985 * By default, it is set to no-op.<br /> 3986 * Access Popper.js instance with `data.instance`. 3987 * @prop {onUpdate} 3988 */ 3989 onUpdate: function onUpdate() {}, 3990 3991 /** 3992 * List of modifiers used to modify the offsets before they are applied to the popper. 3993 * They provide most of the functionalities of Popper.js. 3994 * @prop {modifiers} 3995 */ 3996 modifiers: modifiers 3997 }; 3998 /** 3999 * @callback onCreate 4000 * @param {dataObject} data 4001 */ 4002 4003 /** 4004 * @callback onUpdate 4005 * @param {dataObject} data 4006 */ 4007 // Utils 4008 // Methods 4009 4010 var Popper = function () { 4011 /** 4012 * Creates a new Popper.js instance. 4013 * @class Popper 4014 * @param {Element|referenceObject} reference - The reference element used to position the popper 4015 * @param {Element} popper - The HTML / XML element used as the popper 4016 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 4017 * @return {Object} instance - The generated Popper.js instance 4018 */ 4019 function Popper(reference, popper) { 4020 var _this = this; 4021 4022 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 4023 classCallCheck(this, Popper); 4024 4025 this.scheduleUpdate = function () { 4026 return requestAnimationFrame(_this.update); 4027 }; // make update() debounced, so that it only runs at most once-per-tick 4028 4029 4030 this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it 4031 4032 this.options = _extends$1({}, Popper.Defaults, options); // init state 4033 4034 this.state = {
vendor: 18,259 bytes, lines 4035-4558
4035 isDestroyed: false, 4036 isCreated: false, 4037 scrollParents: [] 4038 }; // get reference and popper elements (allow jQuery wrappers) 4039 4040 this.reference = reference && reference.jquery ? reference[0] : reference; 4041 this.popper = popper && popper.jquery ? popper[0] : popper; // Deep merge modifiers options 4042 4043 this.options.modifiers = {}; 4044 Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 4045 _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 4046 }); // Refactoring modifiers' list (Object => Array) 4047 4048 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 4049 return _extends$1({ 4050 name: name 4051 }, _this.options.modifiers[name]); 4052 }) // sort the modifiers by order 4053 .sort(function (a, b) { 4054 return a.order - b.order; 4055 }); // modifiers have the ability to execute arbitrary code when Popper.js get inited 4056 // such code is executed in the same order of its modifier 4057 // they could add new properties to their options configuration 4058 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 4059 4060 this.modifiers.forEach(function (modifierOptions) { 4061 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 4062 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 4063 } 4064 }); // fire the first update to position the popper in the right place 4065 4066 this.update(); 4067 var eventsEnabled = this.options.eventsEnabled; 4068 4069 if (eventsEnabled) { 4070 // setup event listeners, they will take care of update the position in specific situations 4071 this.enableEventListeners(); 4072 } 4073 4074 this.state.eventsEnabled = eventsEnabled; 4075 } // We can't use class properties because they don't get listed in the 4076 // class prototype and break stuff like Sinon stubs 4077 4078 4079 createClass(Popper, [{ 4080 key: 'update', 4081 value: function update$$1() { 4082 return update.call(this); 4083 } 4084 }, { 4085 key: 'destroy', 4086 value: function destroy$$1() { 4087 return destroy.call(this); 4088 } 4089 }, { 4090 key: 'enableEventListeners', 4091 value: function enableEventListeners$$1() { 4092 return enableEventListeners.call(this); 4093 } 4094 }, { 4095 key: 'disableEventListeners', 4096 value: function disableEventListeners$$1() { 4097 return disableEventListeners.call(this); 4098 } 4099 /** 4100 * Schedules an update. It will run on the next UI update available. 4101 * @method scheduleUpdate 4102 * @memberof Popper 4103 */ 4104 4105 /** 4106 * Collection of utilities useful when writing custom modifiers. 4107 * Starting from version 1.7, this method is available only if you 4108 * include `popper-utils.js` before `popper.js`. 4109 * 4110 * **DEPRECATION**: This way to access PopperUtils is deprecated 4111 * and will be removed in v2! Use the PopperUtils module directly instead. 4112 * Due to the high instability of the methods contained in Utils, we can't 4113 * guarantee them to follow semver. Use them at your own risk! 4114 * @static 4115 * @private 4116 * @type {Object} 4117 * @deprecated since version 1.8 4118 * @member Utils 4119 * @memberof Popper 4120 */ 4121 4122 }]); 4123 return Popper; 4124 }(); 4125 /** 4126 * The `referenceObject` is an object that provides an interface compatible with Popper.js 4127 * and lets you use it as replacement of a real DOM node.<br /> 4128 * You can use this method to position a popper relatively to a set of coordinates 4129 * in case you don't have a DOM node to use as reference. 4130 * 4131 * ``` 4132 * new Popper(referenceObject, popperNode); 4133 * ``` 4134 * 4135 * NB: This feature isn't supported in Internet Explorer 10. 4136 * @name referenceObject 4137 * @property {Function} data.getBoundingClientRect 4138 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 4139 * @property {number} data.clientWidth 4140 * An ES6 getter that will return the width of the virtual reference element. 4141 * @property {number} data.clientHeight 4142 * An ES6 getter that will return the height of the virtual reference element. 4143 */ 4144 4145 4146 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 4147 Popper.placements = placements; 4148 Popper.Defaults = Defaults; 4149 /** 4150 * ------------------------------------------------------------------------ 4151 * Constants 4152 * ------------------------------------------------------------------------ 4153 */ 4154 4155 var NAME$4 = 'dropdown'; 4156 var VERSION$4 = '4.6.0'; 4157 var DATA_KEY$4 = 'bs.dropdown'; 4158 var EVENT_KEY$4 = "." + DATA_KEY$4; 4159 var DATA_API_KEY$4 = '.data-api'; 4160 var JQUERY_NO_CONFLICT$4 = $__default['default'].fn[NAME$4]; 4161 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 4162 4163 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 4164 4165 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 4166 4167 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 4168 4169 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 4170 4171 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 4172 4173 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 4174 var EVENT_HIDE$1 = "hide" + EVENT_KEY$4; 4175 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4; 4176 var EVENT_SHOW$1 = "show" + EVENT_KEY$4; 4177 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4; 4178 var EVENT_CLICK = "click" + EVENT_KEY$4; 4179 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4; 4180 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4; 4181 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4; 4182 var CLASS_NAME_DISABLED = 'disabled'; 4183 var CLASS_NAME_SHOW$2 = 'show'; 4184 var CLASS_NAME_DROPUP = 'dropup'; 4185 var CLASS_NAME_DROPRIGHT = 'dropright'; 4186 var CLASS_NAME_DROPLEFT = 'dropleft'; 4187 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 4188 var CLASS_NAME_POSITION_STATIC = 'position-static'; 4189 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 4190 var SELECTOR_FORM_CHILD = '.dropdown form'; 4191 var SELECTOR_MENU = '.dropdown-menu'; 4192 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 4193 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 4194 var PLACEMENT_TOP = 'top-start'; 4195 var PLACEMENT_TOPEND = 'top-end'; 4196 var PLACEMENT_BOTTOM = 'bottom-start'; 4197 var PLACEMENT_BOTTOMEND = 'bottom-end'; 4198 var PLACEMENT_RIGHT = 'right-start'; 4199 var PLACEMENT_LEFT = 'left-start'; 4200 var Default$2 = { 4201 offset: 0, 4202 flip: true, 4203 boundary: 'scrollParent', 4204 reference: 'toggle', 4205 display: 'dynamic', 4206 popperConfig: null 4207 }; 4208 var DefaultType$2 = { 4209 offset: '(number|string|function)', 4210 flip: 'boolean', 4211 boundary: '(string|element)', 4212 reference: '(string|element)', 4213 display: 'string', 4214 popperConfig: '(null|object)' 4215 }; 4216 /** 4217 * ------------------------------------------------------------------------ 4218 * Class Definition 4219 * ------------------------------------------------------------------------ 4220 */ 4221 4222 var Dropdown = /*#__PURE__*/function () { 4223 function Dropdown(element, config) { 4224 this._element = element; 4225 this._popper = null; 4226 this._config = this._getConfig(config); 4227 this._menu = this._getMenuElement(); 4228 this._inNavbar = this._detectNavbar(); 4229 4230 this._addEventListeners(); 4231 } // Getters 4232 4233 4234 var _proto = Dropdown.prototype; // Public 4235 4236 _proto.toggle = function toggle() { 4237 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED)) { 4238 return; 4239 } 4240 4241 var isActive = $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2); 4242 4243 Dropdown._clearMenus(); 4244 4245 if (isActive) { 4246 return; 4247 } 4248 4249 this.show(true); 4250 }; 4251 4252 _proto.show = function show(usePopper) { 4253 if (usePopper === void 0) { 4254 usePopper = false; 4255 } 4256 4257 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || $__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) { 4258 return; 4259 } 4260 4261 var relatedTarget = { 4262 relatedTarget: this._element 4263 }; 4264 var showEvent = $__default['default'].Event(EVENT_SHOW$1, relatedTarget); 4265 4266 var parent = Dropdown._getParentFromElement(this._element); 4267 4268 $__default['default'](parent).trigger(showEvent); 4269 4270 if (showEvent.isDefaultPrevented()) { 4271 return; 4272 } // Totally disable Popper for Dropdowns in Navbar 4273 4274 4275 if (!this._inNavbar && usePopper) { 4276 /** 4277 * Check for Popper dependency 4278 * Popper - https://popper.js.org 4279 */ 4280 if (typeof Popper === 'undefined') { 4281 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 4282 } 4283 4284 var referenceElement = this._element; 4285 4286 if (this._config.reference === 'parent') { 4287 referenceElement = parent; 4288 } else if (Util.isElement(this._config.reference)) { 4289 referenceElement = this._config.reference; // Check if it's jQuery element 4290 4291 if (typeof this._config.reference.jquery !== 'undefined') { 4292 referenceElement = this._config.reference[0]; 4293 } 4294 } // If boundary is not `scrollParent`, then set position to `static` 4295 // to allow the menu to "escape" the scroll parent's boundaries 4296 // https://github.com/twbs/bootstrap/issues/24251 4297 4298 4299 if (this._config.boundary !== 'scrollParent') { 4300 $__default['default'](parent).addClass(CLASS_NAME_POSITION_STATIC); 4301 } 4302 4303 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 4304 } // If this is a touch-enabled device we add extra 4305 // empty mouseover listeners to the body's immediate children; 4306 // only needed because of broken event delegation on iOS 4307 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 4308 4309 4310 if ('ontouchstart' in document.documentElement && $__default['default'](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 4311 $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); 4312 } 4313 4314 this._element.focus(); 4315 4316 this._element.setAttribute('aria-expanded', true); 4317 4318 $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2); 4319 $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_SHOWN$1, relatedTarget)); 4320 }; 4321 4322 _proto.hide = function hide() { 4323 if (this._element.disabled || $__default['default'](this._element).hasClass(CLASS_NAME_DISABLED) || !$__default['default'](this._menu).hasClass(CLASS_NAME_SHOW$2)) { 4324 return; 4325 } 4326 4327 var relatedTarget = { 4328 relatedTarget: this._element 4329 }; 4330 var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget); 4331 4332 var parent = Dropdown._getParentFromElement(this._element); 4333 4334 $__default['default'](parent).trigger(hideEvent); 4335 4336 if (hideEvent.isDefaultPrevented()) { 4337 return; 4338 } 4339 4340 if (this._popper) { 4341 this._popper.destroy(); 4342 } 4343 4344 $__default['default'](this._menu).toggleClass(CLASS_NAME_SHOW$2); 4345 $__default['default'](parent).toggleClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget)); 4346 }; 4347 4348 _proto.dispose = function dispose() { 4349 $__default['default'].removeData(this._element, DATA_KEY$4); 4350 $__default['default'](this._element).off(EVENT_KEY$4); 4351 this._element = null; 4352 this._menu = null; 4353 4354 if (this._popper !== null) { 4355 this._popper.destroy(); 4356 4357 this._popper = null; 4358 } 4359 }; 4360 4361 _proto.update = function update() { 4362 this._inNavbar = this._detectNavbar(); 4363 4364 if (this._popper !== null) { 4365 this._popper.scheduleUpdate(); 4366 } 4367 } // Private 4368 ; 4369 4370 _proto._addEventListeners = function _addEventListeners() { 4371 var _this = this; 4372 4373 $__default['default'](this._element).on(EVENT_CLICK, function (event) { 4374 event.preventDefault(); 4375 event.stopPropagation(); 4376 4377 _this.toggle(); 4378 }); 4379 }; 4380 4381 _proto._getConfig = function _getConfig(config) { 4382 config = _extends({}, this.constructor.Default, $__default['default'](this._element).data(), config); 4383 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 4384 return config; 4385 }; 4386 4387 _proto._getMenuElement = function _getMenuElement() { 4388 if (!this._menu) { 4389 var parent = Dropdown._getParentFromElement(this._element); 4390 4391 if (parent) { 4392 this._menu = parent.querySelector(SELECTOR_MENU); 4393 } 4394 } 4395 4396 return this._menu; 4397 }; 4398 4399 _proto._getPlacement = function _getPlacement() { 4400 var $parentDropdown = $__default['default'](this._element.parentNode); 4401 var placement = PLACEMENT_BOTTOM; // Handle dropup 4402 4403 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 4404 placement = $__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 4405 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 4406 placement = PLACEMENT_RIGHT; 4407 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 4408 placement = PLACEMENT_LEFT; 4409 } else if ($__default['default'](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 4410 placement = PLACEMENT_BOTTOMEND; 4411 } 4412 4413 return placement; 4414 }; 4415 4416 _proto._detectNavbar = function _detectNavbar() { 4417 return $__default['default'](this._element).closest('.navbar').length > 0; 4418 }; 4419 4420 _proto._getOffset = function _getOffset() { 4421 var _this2 = this; 4422 4423 var offset = {}; 4424 4425 if (typeof this._config.offset === 'function') { 4426 offset.fn = function (data) { 4427 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 4428 return data; 4429 }; 4430 } else { 4431 offset.offset = this._config.offset; 4432 } 4433 4434 return offset; 4435 }; 4436 4437 _proto._getPopperConfig = function _getPopperConfig() { 4438 var popperConfig = { 4439 placement: this._getPlacement(), 4440 modifiers: { 4441 offset: this._getOffset(), 4442 flip: { 4443 enabled: this._config.flip 4444 }, 4445 preventOverflow: { 4446 boundariesElement: this._config.boundary 4447 } 4448 } 4449 }; // Disable Popper if we have a static display 4450 4451 if (this._config.display === 'static') { 4452 popperConfig.modifiers.applyStyle = { 4453 enabled: false 4454 }; 4455 } 4456 4457 return _extends({}, popperConfig, this._config.popperConfig); 4458 } // Static 4459 ; 4460 4461 Dropdown._jQueryInterface = function _jQueryInterface(config) { 4462 return this.each(function () { 4463 var data = $__default['default'](this).data(DATA_KEY$4); 4464 4465 var _config = typeof config === 'object' ? config : null; 4466 4467 if (!data) { 4468 data = new Dropdown(this, _config); 4469 $__default['default'](this).data(DATA_KEY$4, data); 4470 } 4471 4472 if (typeof config === 'string') { 4473 if (typeof data[config] === 'undefined') { 4474 throw new TypeError("No method named \"" + config + "\""); 4475 } 4476 4477 data[config](); 4478 } 4479 }); 4480 }; 4481 4482 Dropdown._clearMenus = function _clearMenus(event) { 4483 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 4484 return; 4485 } 4486 4487 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 4488 4489 for (var i = 0, len = toggles.length; i < len; i++) { 4490 var parent = Dropdown._getParentFromElement(toggles[i]); 4491 4492 var context = $__default['default'](toggles[i]).data(DATA_KEY$4); 4493 var relatedTarget = { 4494 relatedTarget: toggles[i] 4495 }; 4496 4497 if (event && event.type === 'click') { 4498 relatedTarget.clickEvent = event; 4499 } 4500 4501 if (!context) { 4502 continue; 4503 } 4504 4505 var dropdownMenu = context._menu; 4506 4507 if (!$__default['default'](parent).hasClass(CLASS_NAME_SHOW$2)) { 4508 continue; 4509 } 4510 4511 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)) { 4512 continue; 4513 } 4514 4515 var hideEvent = $__default['default'].Event(EVENT_HIDE$1, relatedTarget); 4516 $__default['default'](parent).trigger(hideEvent); 4517 4518 if (hideEvent.isDefaultPrevented()) { 4519 continue; 4520 } // If this is a touch-enabled device we remove the extra 4521 // empty mouseover listeners we added for iOS support 4522 4523 4524 if ('ontouchstart' in document.documentElement) { 4525 $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); 4526 } 4527 4528 toggles[i].setAttribute('aria-expanded', 'false'); 4529 4530 if (context._popper) { 4531 context._popper.destroy(); 4532 } 4533 4534 $__default['default'](dropdownMenu).removeClass(CLASS_NAME_SHOW$2); 4535 $__default['default'](parent).removeClass(CLASS_NAME_SHOW$2).trigger($__default['default'].Event(EVENT_HIDDEN$1, relatedTarget)); 4536 } 4537 }; 4538 4539 Dropdown._getParentFromElement = function _getParentFromElement(element) { 4540 var parent; 4541 var selector = Util.getSelectorFromElement(element); 4542 4543 if (selector) { 4544 parent = document.querySelector(selector); 4545 } 4546 4547 return parent || element.parentNode; 4548 } // eslint-disable-next-line complexity 4549 ; 4550 4551 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 4552 // If not input/textarea: 4553 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 4554 // If input/textarea: 4555 // - If space key => not a dropdown command 4556 // - If key is other than escape 4557 // - If key is not up or down => not a dropdown command 4558 // - If trigger inside the menu =>
vendor: 5,725 bytes, lines 4558-4725
4558 not a dropdown command 4559 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)) { 4560 return; 4561 } 4562 4563 if (this.disabled || $__default['default'](this).hasClass(CLASS_NAME_DISABLED)) { 4564 return; 4565 } 4566 4567 var parent = Dropdown._getParentFromElement(this); 4568 4569 var isActive = $__default['default'](parent).hasClass(CLASS_NAME_SHOW$2); 4570 4571 if (!isActive && event.which === ESCAPE_KEYCODE) { 4572 return; 4573 } 4574 4575 event.preventDefault(); 4576 event.stopPropagation(); 4577 4578 if (!isActive || event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE) { 4579 if (event.which === ESCAPE_KEYCODE) { 4580 $__default['default'](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 4581 } 4582 4583 $__default['default'](this).trigger('click'); 4584 return; 4585 } 4586 4587 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 4588 return $__default['default'](item).is(':visible'); 4589 }); 4590 4591 if (items.length === 0) { 4592 return; 4593 } 4594 4595 var index = items.indexOf(event.target); 4596 4597 if (event.which === ARROW_UP_KEYCODE && index > 0) { 4598 // Up 4599 index--; 4600 } 4601 4602 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 4603 // Down 4604 index++; 4605 } 4606 4607 if (index < 0) { 4608 index = 0; 4609 } 4610 4611 items[index].focus(); 4612 }; 4613 4614 _createClass(Dropdown, null, [{ 4615 key: "VERSION", 4616 get: function get() { 4617 return VERSION$4; 4618 } 4619 }, { 4620 key: "Default", 4621 get: function get() { 4622 return Default$2; 4623 } 4624 }, { 4625 key: "DefaultType", 4626 get: function get() { 4627 return DefaultType$2; 4628 } 4629 }]); 4630 4631 return Dropdown; 4632 }(); 4633 /** 4634 * ------------------------------------------------------------------------ 4635 * Data Api implementation 4636 * ------------------------------------------------------------------------ 4637 */ 4638 4639 4640 $__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) { 4641 event.preventDefault(); 4642 event.stopPropagation(); 4643 4644 Dropdown._jQueryInterface.call($__default['default'](this), 'toggle'); 4645 }).on(EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) { 4646 e.stopPropagation(); 4647 }); 4648 /** 4649 * ------------------------------------------------------------------------ 4650 * jQuery 4651 * ------------------------------------------------------------------------ 4652 */ 4653 4654 $__default['default'].fn[NAME$4] = Dropdown._jQueryInterface; 4655 $__default['default'].fn[NAME$4].Constructor = Dropdown; 4656 4657 $__default['default'].fn[NAME$4].noConflict = function () { 4658 $__default['default'].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 4659 return Dropdown._jQueryInterface; 4660 }; 4661 /** 4662 * ------------------------------------------------------------------------ 4663 * Constants 4664 * ------------------------------------------------------------------------ 4665 */ 4666 4667 4668 var NAME$5 = 'modal'; 4669 var VERSION$5 = '4.6.0'; 4670 var DATA_KEY$5 = 'bs.modal'; 4671 var EVENT_KEY$5 = "." + DATA_KEY$5; 4672 var DATA_API_KEY$5 = '.data-api'; 4673 var JQUERY_NO_CONFLICT$5 = $__default['default'].fn[NAME$5]; 4674 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 4675 4676 var Default$3 = { 4677 backdrop: true, 4678 keyboard: true, 4679 focus: true, 4680 show: true 4681 }; 4682 var DefaultType$3 = { 4683 backdrop: '(boolean|string)', 4684 keyboard: 'boolean', 4685 focus: 'boolean', 4686 show: 'boolean' 4687 }; 4688 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 4689 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 4690 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 4691 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 4692 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 4693 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 4694 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 4695 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5; 4696 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 4697 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 4698 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 4699 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5; 4700 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 4701 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 4702 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 4703 var CLASS_NAME_OPEN = 'modal-open'; 4704 var CLASS_NAME_FADE$1 = 'fade'; 4705 var CLASS_NAME_SHOW$3 = 'show'; 4706 var CLASS_NAME_STATIC = 'modal-static'; 4707 var SELECTOR_DIALOG = '.modal-dialog'; 4708 var SELECTOR_MODAL_BODY = '.modal-body'; 4709 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]'; 4710 var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]'; 4711 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 4712 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 4713 /** 4714 * ------------------------------------------------------------------------ 4715 * Class Definition 4716 * ------------------------------------------------------------------------ 4717 */ 4718 4719 var Modal = /*#__PURE__*/function () { 4720 function Modal(element, config) { 4721 this._config = this._getConfig(config); 4722 this._element = element; 4723 this._dialog = element.querySelector(SELECTOR_DIALOG); 4724 this._backdrop = null; 4725 this._isShown = false;
vendor: 16,569 bytes, lines 4726-5199
4726 this._isBodyOverflowing = false; 4727 this._ignoreBackdropClick = false; 4728 this._isTransitioning = false; 4729 this._scrollbarWidth = 0; 4730 } // Getters 4731 4732 4733 var _proto = Modal.prototype; // Public 4734 4735 _proto.toggle = function toggle(relatedTarget) { 4736 return this._isShown ? this.hide() : this.show(relatedTarget); 4737 }; 4738 4739 _proto.show = function show(relatedTarget) { 4740 var _this = this; 4741 4742 if (this._isShown || this._isTransitioning) { 4743 return; 4744 } 4745 4746 if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) { 4747 this._isTransitioning = true; 4748 } 4749 4750 var showEvent = $__default['default'].Event(EVENT_SHOW$2, { 4751 relatedTarget: relatedTarget 4752 }); 4753 $__default['default'](this._element).trigger(showEvent); 4754 4755 if (this._isShown || showEvent.isDefaultPrevented()) { 4756 return; 4757 } 4758 4759 this._isShown = true; 4760 4761 this._checkScrollbar(); 4762 4763 this._setScrollbar(); 4764 4765 this._adjustDialog(); 4766 4767 this._setEscapeEvent(); 4768 4769 this._setResizeEvent(); 4770 4771 $__default['default'](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) { 4772 return _this.hide(event); 4773 }); 4774 $__default['default'](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 4775 $__default['default'](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 4776 if ($__default['default'](event.target).is(_this._element)) { 4777 _this._ignoreBackdropClick = true; 4778 } 4779 }); 4780 }); 4781 4782 this._showBackdrop(function () { 4783 return _this._showElement(relatedTarget); 4784 }); 4785 }; 4786 4787 _proto.hide = function hide(event) { 4788 var _this2 = this; 4789 4790 if (event) { 4791 event.preventDefault(); 4792 } 4793 4794 if (!this._isShown || this._isTransitioning) { 4795 return; 4796 } 4797 4798 var hideEvent = $__default['default'].Event(EVENT_HIDE$2); 4799 $__default['default'](this._element).trigger(hideEvent); 4800 4801 if (!this._isShown || hideEvent.isDefaultPrevented()) { 4802 return; 4803 } 4804 4805 this._isShown = false; 4806 var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1); 4807 4808 if (transition) { 4809 this._isTransitioning = true; 4810 } 4811 4812 this._setEscapeEvent(); 4813 4814 this._setResizeEvent(); 4815 4816 $__default['default'](document).off(EVENT_FOCUSIN); 4817 $__default['default'](this._element).removeClass(CLASS_NAME_SHOW$3); 4818 $__default['default'](this._element).off(EVENT_CLICK_DISMISS); 4819 $__default['default'](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 4820 4821 if (transition) { 4822 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 4823 $__default['default'](this._element).one(Util.TRANSITION_END, function (event) { 4824 return _this2._hideModal(event); 4825 }).emulateTransitionEnd(transitionDuration); 4826 } else { 4827 this._hideModal(); 4828 } 4829 }; 4830 4831 _proto.dispose = function dispose() { 4832 [window, this._element, this._dialog].forEach(function (htmlElement) { 4833 return $__default['default'](htmlElement).off(EVENT_KEY$5); 4834 }); 4835 /** 4836 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 4837 * Do not move `document` in `htmlElements` array 4838 * It will remove `EVENT_CLICK_DATA_API` event that should remain 4839 */ 4840 4841 $__default['default'](document).off(EVENT_FOCUSIN); 4842 $__default['default'].removeData(this._element, DATA_KEY$5); 4843 this._config = null; 4844 this._element = null; 4845 this._dialog = null; 4846 this._backdrop = null; 4847 this._isShown = null; 4848 this._isBodyOverflowing = null; 4849 this._ignoreBackdropClick = null; 4850 this._isTransitioning = null; 4851 this._scrollbarWidth = null; 4852 }; 4853 4854 _proto.handleUpdate = function handleUpdate() { 4855 this._adjustDialog(); 4856 } // Private 4857 ; 4858 4859 _proto._getConfig = function _getConfig(config) { 4860 config = _extends({}, Default$3, config); 4861 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 4862 return config; 4863 }; 4864 4865 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 4866 var _this3 = this; 4867 4868 var hideEventPrevented = $__default['default'].Event(EVENT_HIDE_PREVENTED); 4869 $__default['default'](this._element).trigger(hideEventPrevented); 4870 4871 if (hideEventPrevented.isDefaultPrevented()) { 4872 return; 4873 } 4874 4875 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 4876 4877 if (!isModalOverflowing) { 4878 this._element.style.overflowY = 'hidden'; 4879 } 4880 4881 this._element.classList.add(CLASS_NAME_STATIC); 4882 4883 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4884 $__default['default'](this._element).off(Util.TRANSITION_END); 4885 $__default['default'](this._element).one(Util.TRANSITION_END, function () { 4886 _this3._element.classList.remove(CLASS_NAME_STATIC); 4887 4888 if (!isModalOverflowing) { 4889 $__default['default'](_this3._element).one(Util.TRANSITION_END, function () { 4890 _this3._element.style.overflowY = ''; 4891 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 4892 } 4893 }).emulateTransitionEnd(modalTransitionDuration); 4894 4895 this._element.focus(); 4896 }; 4897 4898 _proto._showElement = function _showElement(relatedTarget) { 4899 var _this4 = this; 4900 4901 var transition = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1); 4902 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 4903 4904 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 4905 // Don't move modal's DOM position 4906 document.body.appendChild(this._element); 4907 } 4908 4909 this._element.style.display = 'block'; 4910 4911 this._element.removeAttribute('aria-hidden'); 4912 4913 this._element.setAttribute('aria-modal', true); 4914 4915 this._element.setAttribute('role', 'dialog'); 4916 4917 if ($__default['default'](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 4918 modalBody.scrollTop = 0; 4919 } else { 4920 this._element.scrollTop = 0; 4921 } 4922 4923 if (transition) { 4924 Util.reflow(this._element); 4925 } 4926 4927 $__default['default'](this._element).addClass(CLASS_NAME_SHOW$3); 4928 4929 if (this._config.focus) { 4930 this._enforceFocus(); 4931 } 4932 4933 var shownEvent = $__default['default'].Event(EVENT_SHOWN$2, { 4934 relatedTarget: relatedTarget 4935 }); 4936 4937 var transitionComplete = function transitionComplete() { 4938 if (_this4._config.focus) { 4939 _this4._element.focus(); 4940 } 4941 4942 _this4._isTransitioning = false; 4943 $__default['default'](_this4._element).trigger(shownEvent); 4944 }; 4945 4946 if (transition) { 4947 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 4948 $__default['default'](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 4949 } else { 4950 transitionComplete(); 4951 } 4952 }; 4953 4954 _proto._enforceFocus = function _enforceFocus() { 4955 var _this5 = this; 4956 4957 $__default['default'](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 4958 .on(EVENT_FOCUSIN, function (event) { 4959 if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) { 4960 _this5._element.focus(); 4961 } 4962 }); 4963 }; 4964 4965 _proto._setEscapeEvent = function _setEscapeEvent() { 4966 var _this6 = this; 4967 4968 if (this._isShown) { 4969 $__default['default'](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 4970 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 4971 event.preventDefault(); 4972 4973 _this6.hide(); 4974 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE$1) { 4975 _this6._triggerBackdropTransition(); 4976 } 4977 }); 4978 } else if (!this._isShown) { 4979 $__default['default'](this._element).off(EVENT_KEYDOWN_DISMISS); 4980 } 4981 }; 4982 4983 _proto._setResizeEvent = function _setResizeEvent() { 4984 var _this7 = this; 4985 4986 if (this._isShown) { 4987 $__default['default'](window).on(EVENT_RESIZE, function (event) { 4988 return _this7.handleUpdate(event); 4989 }); 4990 } else { 4991 $__default['default'](window).off(EVENT_RESIZE); 4992 } 4993 }; 4994 4995 _proto._hideModal = function _hideModal() { 4996 var _this8 = this; 4997 4998 this._element.style.display = 'none'; 4999 5000 this._element.setAttribute('aria-hidden', true); 5001 5002 this._element.removeAttribute('aria-modal'); 5003 5004 this._element.removeAttribute('role'); 5005 5006 this._isTransitioning = false; 5007 5008 this._showBackdrop(function () { 5009 $__default['default'](document.body).removeClass(CLASS_NAME_OPEN); 5010 5011 _this8._resetAdjustments(); 5012 5013 _this8._resetScrollbar(); 5014 5015 $__default['default'](_this8._element).trigger(EVENT_HIDDEN$2); 5016 }); 5017 }; 5018 5019 _proto._removeBackdrop = function _removeBackdrop() { 5020 if (this._backdrop) { 5021 $__default['default'](this._backdrop).remove(); 5022 this._backdrop = null; 5023 } 5024 }; 5025 5026 _proto._showBackdrop = function _showBackdrop(callback) { 5027 var _this9 = this; 5028 5029 var animate = $__default['default'](this._element).hasClass(CLASS_NAME_FADE$1) ? CLASS_NAME_FADE$1 : ''; 5030 5031 if (this._isShown && this._config.backdrop) { 5032 this._backdrop = document.createElement('div'); 5033 this._backdrop.className = CLASS_NAME_BACKDROP; 5034 5035 if (animate) { 5036 this._backdrop.classList.add(animate); 5037 } 5038 5039 $__default['default'](this._backdrop).appendTo(document.body); 5040 $__default['default'](this._element).on(EVENT_CLICK_DISMISS, function (event) { 5041 if (_this9._ignoreBackdropClick) { 5042 _this9._ignoreBackdropClick = false; 5043 return; 5044 } 5045 5046 if (event.target !== event.currentTarget) { 5047 return; 5048 } 5049 5050 if (_this9._config.backdrop === 'static') { 5051 _this9._triggerBackdropTransition(); 5052 } else { 5053 _this9.hide(); 5054 } 5055 }); 5056 5057 if (animate) { 5058 Util.reflow(this._backdrop); 5059 } 5060 5061 $__default['default'](this._backdrop).addClass(CLASS_NAME_SHOW$3); 5062 5063 if (!callback) { 5064 return; 5065 } 5066 5067 if (!animate) { 5068 callback(); 5069 return; 5070 } 5071 5072 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 5073 $__default['default'](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 5074 } else if (!this._isShown && this._backdrop) { 5075 $__default['default'](this._backdrop).removeClass(CLASS_NAME_SHOW$3); 5076 5077 var callbackRemove = function callbackRemove() { 5078 _this9._removeBackdrop(); 5079 5080 if (callback) { 5081 callback(); 5082 } 5083 }; 5084 5085 if ($__default['default'](this._element).hasClass(CLASS_NAME_FADE$1)) { 5086 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 5087 5088 $__default['default'](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 5089 } else { 5090 callbackRemove(); 5091 } 5092 } else if (callback) { 5093 callback(); 5094 } 5095 } // ---------------------------------------------------------------------- 5096 // the following methods are used to handle overflowing modals 5097 // todo (fat): these should probably be refactored out of modal.js 5098 // ---------------------------------------------------------------------- 5099 ; 5100 5101 _proto._adjustDialog = function _adjustDialog() { 5102 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 5103 5104 if (!this._isBodyOverflowing && isModalOverflowing) { 5105 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 5106 } 5107 5108 if (this._isBodyOverflowing && !isModalOverflowing) { 5109 this._element.style.paddingRight = this._scrollbarWidth + "px"; 5110 } 5111 }; 5112 5113 _proto._resetAdjustments = function _resetAdjustments() { 5114 this._element.style.paddingLeft = ''; 5115 this._element.style.paddingRight = ''; 5116 }; 5117 5118 _proto._checkScrollbar = function _checkScrollbar() { 5119 var rect = document.body.getBoundingClientRect(); 5120 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 5121 this._scrollbarWidth = this._getScrollbarWidth(); 5122 }; 5123 5124 _proto._setScrollbar = function _setScrollbar() { 5125 var _this10 = this; 5126 5127 if (this._isBodyOverflowing) { 5128 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 5129 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 5130 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 5131 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 5132 5133 $__default['default'](fixedContent).each(function (index, element) { 5134 var actualPadding = element.style.paddingRight; 5135 var calculatedPadding = $__default['default'](element).css('padding-right'); 5136 $__default['default'](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 5137 }); // Adjust sticky content margin 5138 5139 $__default['default'](stickyContent).each(function (index, element) { 5140 var actualMargin = element.style.marginRight; 5141 var calculatedMargin = $__default['default'](element).css('margin-right'); 5142 $__default['default'](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 5143 }); // Adjust body padding 5144 5145 var actualPadding = document.body.style.paddingRight; 5146 var calculatedPadding = $__default['default'](document.body).css('padding-right'); 5147 $__default['default'](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 5148 } 5149 5150 $__default['default'](document.body).addClass(CLASS_NAME_OPEN); 5151 }; 5152 5153 _proto._resetScrollbar = function _resetScrollbar() { 5154 // Restore fixed content padding 5155 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 5156 $__default['default'](fixedContent).each(function (index, element) { 5157 var padding = $__default['default'](element).data('padding-right'); 5158 $__default['default'](element).removeData('padding-right'); 5159 element.style.paddingRight = padding ? padding : ''; 5160 }); // Restore sticky content 5161 5162 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 5163 $__default['default'](elements).each(function (index, element) { 5164 var margin = $__default['default'](element).data('margin-right'); 5165 5166 if (typeof margin !== 'undefined') { 5167 $__default['default'](element).css('margin-right', margin).removeData('margin-right'); 5168 } 5169 }); // Restore body padding 5170 5171 var padding = $__default['default'](document.body).data('padding-right'); 5172 $__default['default'](document.body).removeData('padding-right'); 5173 document.body.style.paddingRight = padding ? padding : ''; 5174 }; 5175 5176 _proto._getScrollbarWidth = function _getScrollbarWidth() { 5177 // thx d.walsh 5178 var scrollDiv = document.createElement('div'); 5179 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 5180 document.body.appendChild(scrollDiv); 5181 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 5182 document.body.removeChild(scrollDiv); 5183 return scrollbarWidth; 5184 } // Static 5185 ; 5186 5187 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 5188 return this.each(function () { 5189 var data = $__default['default'](this).data(DATA_KEY$5); 5190 5191 var _config = _extends({}, Default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {}); 5192 5193 if (!data) { 5194 data = new Modal(this, _config); 5195 $__default['default'](this).data(DATA_KEY$5, data); 5196 } 5197 5198 if (typeof config === 'string') { 5199 if (typeof data[config] === 'undefined') {
vendor: 9,263 bytes, lines 5200-5513
5200 throw new TypeError("No method named \"" + config + "\""); 5201 } 5202 5203 data[config](relatedTarget); 5204 } else if (_config.show) { 5205 data.show(relatedTarget); 5206 } 5207 }); 5208 }; 5209 5210 _createClass(Modal, null, [{ 5211 key: "VERSION", 5212 get: function get() { 5213 return VERSION$5; 5214 } 5215 }, { 5216 key: "Default", 5217 get: function get() { 5218 return Default$3; 5219 } 5220 }]); 5221 5222 return Modal; 5223 }(); 5224 /** 5225 * ------------------------------------------------------------------------ 5226 * Data Api implementation 5227 * ------------------------------------------------------------------------ 5228 */ 5229 5230 5231 $__default['default'](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) { 5232 var _this11 = this; 5233 5234 var target; 5235 var selector = Util.getSelectorFromElement(this); 5236 5237 if (selector) { 5238 target = document.querySelector(selector); 5239 } 5240 5241 var config = $__default['default'](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); 5242 5243 if (this.tagName === 'A' || this.tagName === 'AREA') { 5244 event.preventDefault(); 5245 } 5246 5247 var $target = $__default['default'](target).one(EVENT_SHOW$2, function (showEvent) { 5248 if (showEvent.isDefaultPrevented()) { 5249 // Only register focus restorer if modal will actually get shown 5250 return; 5251 } 5252 5253 $target.one(EVENT_HIDDEN$2, function () { 5254 if ($__default['default'](_this11).is(':visible')) { 5255 _this11.focus(); 5256 } 5257 }); 5258 }); 5259 5260 Modal._jQueryInterface.call($__default['default'](target), config, this); 5261 }); 5262 /** 5263 * ------------------------------------------------------------------------ 5264 * jQuery 5265 * ------------------------------------------------------------------------ 5266 */ 5267 5268 $__default['default'].fn[NAME$5] = Modal._jQueryInterface; 5269 $__default['default'].fn[NAME$5].Constructor = Modal; 5270 5271 $__default['default'].fn[NAME$5].noConflict = function () { 5272 $__default['default'].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 5273 return Modal._jQueryInterface; 5274 }; 5275 /** 5276 * -------------------------------------------------------------------------- 5277 * Bootstrap (v4.6.0): tools/sanitizer.js 5278 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 5279 * -------------------------------------------------------------------------- 5280 */ 5281 5282 5283 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 5284 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 5285 var DefaultWhitelist = { 5286 // Global attributes allowed on any supplied element below. 5287 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 5288 a: ['target', 'href', 'title', 'rel'], 5289 area: [], 5290 b: [], 5291 br: [], 5292 col: [], 5293 code: [], 5294 div: [], 5295 em: [], 5296 hr: [], 5297 h1: [], 5298 h2: [], 5299 h3: [], 5300 h4: [], 5301 h5: [], 5302 h6: [], 5303 i: [], 5304 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 5305 li: [], 5306 ol: [], 5307 p: [], 5308 pre: [], 5309 s: [], 5310 small: [], 5311 span: [], 5312 sub: [], 5313 sup: [], 5314 strong: [], 5315 u: [], 5316 ul: [] 5317 }; 5318 /** 5319 * A pattern that recognizes a commonly useful subset of URLs that are safe. 5320 * 5321 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5322 */ 5323 5324 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi; 5325 /** 5326 * A pattern that matches safe data URLs. Only matches image, video and audio types. 5327 * 5328 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 5329 */ 5330 5331 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; 5332 5333 function allowedAttribute(attr, allowedAttributeList) { 5334 var attrName = attr.nodeName.toLowerCase(); 5335 5336 if (allowedAttributeList.indexOf(attrName) !== -1) { 5337 if (uriAttrs.indexOf(attrName) !== -1) { 5338 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 5339 } 5340 5341 return true; 5342 } 5343 5344 var regExp = allowedAttributeList.filter(function (attrRegex) { 5345 return attrRegex instanceof RegExp; 5346 }); // Check if a regular expression validates the attribute. 5347 5348 for (var i = 0, len = regExp.length; i < len; i++) { 5349 if (attrName.match(regExp[i])) { 5350 return true; 5351 } 5352 } 5353 5354 return false; 5355 } 5356 5357 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 5358 if (unsafeHtml.length === 0) { 5359 return unsafeHtml; 5360 } 5361 5362 if (sanitizeFn && typeof sanitizeFn === 'function') { 5363 return sanitizeFn(unsafeHtml); 5364 } 5365 5366 var domParser = new window.DOMParser(); 5367 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 5368 var whitelistKeys = Object.keys(whiteList); 5369 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 5370 5371 var _loop = function _loop(i, len) { 5372 var el = elements[i]; 5373 var elName = el.nodeName.toLowerCase(); 5374 5375 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 5376 el.parentNode.removeChild(el); 5377 return "continue"; 5378 } 5379 5380 var attributeList = [].slice.call(el.attributes); 5381 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 5382 attributeList.forEach(function (attr) { 5383 if (!allowedAttribute(attr, whitelistedAttributes)) { 5384 el.removeAttribute(attr.nodeName); 5385 } 5386 }); 5387 }; 5388 5389 for (var i = 0, len = elements.length; i < len; i++) { 5390 var _ret = _loop(i); 5391 5392 if (_ret === "continue") continue; 5393 } 5394 5395 return createdDocument.body.innerHTML; 5396 } 5397 /** 5398 * ------------------------------------------------------------------------ 5399 * Constants 5400 * ------------------------------------------------------------------------ 5401 */ 5402 5403 5404 var NAME$6 = 'tooltip'; 5405 var VERSION$6 = '4.6.0'; 5406 var DATA_KEY$6 = 'bs.tooltip'; 5407 var EVENT_KEY$6 = "." + DATA_KEY$6; 5408 var JQUERY_NO_CONFLICT$6 = $__default['default'].fn[NAME$6]; 5409 var CLASS_PREFIX = 'bs-tooltip'; 5410 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 5411 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 5412 var DefaultType$4 = { 5413 animation: 'boolean', 5414 template: 'string', 5415 title: '(string|element|function)', 5416 trigger: 'string', 5417 delay: '(number|object)', 5418 html: 'boolean', 5419 selector: '(string|boolean)', 5420 placement: '(string|function)', 5421 offset: '(number|string|function)', 5422 container: '(string|element|boolean)', 5423 fallbackPlacement: '(string|array)', 5424 boundary: '(string|element)', 5425 customClass: '(string|function)', 5426 sanitize: 'boolean', 5427 sanitizeFn: '(null|function)', 5428 whiteList: 'object', 5429 popperConfig: '(null|object)' 5430 }; 5431 var AttachmentMap = { 5432 AUTO: 'auto', 5433 TOP: 'top', 5434 RIGHT: 'right', 5435 BOTTOM: 'bottom', 5436 LEFT: 'left' 5437 }; 5438 var Default$4 = { 5439 animation: true, 5440 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 5441 trigger: 'hover focus', 5442 title: '', 5443 delay: 0, 5444 html: false, 5445 selector: false, 5446 placement: 'top', 5447 offset: 0, 5448 container: false, 5449 fallbackPlacement: 'flip', 5450 boundary: 'scrollParent', 5451 customClass: '', 5452 sanitize: true, 5453 sanitizeFn: null, 5454 whiteList: DefaultWhitelist, 5455 popperConfig: null 5456 }; 5457 var HOVER_STATE_SHOW = 'show'; 5458 var HOVER_STATE_OUT = 'out'; 5459 var Event = { 5460 HIDE: "hide" + EVENT_KEY$6, 5461 HIDDEN: "hidden" + EVENT_KEY$6, 5462 SHOW: "show" + EVENT_KEY$6, 5463 SHOWN: "shown" + EVENT_KEY$6, 5464 INSERTED: "inserted" + EVENT_KEY$6, 5465 CLICK: "click" + EVENT_KEY$6, 5466 FOCUSIN: "focusin" + EVENT_KEY$6, 5467 FOCUSOUT: "focusout" + EVENT_KEY$6, 5468 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 5469 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 5470 }; 5471 var CLASS_NAME_FADE$2 = 'fade'; 5472 var CLASS_NAME_SHOW$4 = 'show'; 5473 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 5474 var SELECTOR_ARROW = '.arrow'; 5475 var TRIGGER_HOVER = 'hover'; 5476 var TRIGGER_FOCUS = 'focus'; 5477 var TRIGGER_CLICK = 'click'; 5478 var TRIGGER_MANUAL = 'manual'; 5479 /** 5480 * ------------------------------------------------------------------------ 5481 * Class Definition 5482 * ------------------------------------------------------------------------ 5483 */ 5484 5485 var Tooltip = /*#__PURE__*/function () { 5486 function Tooltip(element, config) { 5487 if (typeof Popper === 'undefined') { 5488 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 5489 } // private 5490 5491 5492 this._isEnabled = true; 5493 this._timeout = 0; 5494 this._hoverState = ''; 5495 this._activeTrigger = {}; 5496 this._popper = null; // Protected 5497 5498 this.element = element; 5499 this.config = this._getConfig(config); 5500 this.tip = null; 5501 5502 this._setListeners(); 5503 } // Getters 5504 5505 5506 var _proto = Tooltip.prototype; // Public 5507 5508 _proto.enable = function enable() { 5509 this._isEnabled = true; 5510 }; 5511 5512 _proto.disable = function disable() { 5513 this._isEnabled = false;
vendor: 13,574 bytes, lines 5514-5921
5514 }; 5515 5516 _proto.toggleEnabled = function toggleEnabled() { 5517 this._isEnabled = !this._isEnabled; 5518 }; 5519 5520 _proto.toggle = function toggle(event) { 5521 if (!this._isEnabled) { 5522 return; 5523 } 5524 5525 if (event) { 5526 var dataKey = this.constructor.DATA_KEY; 5527 var context = $__default['default'](event.currentTarget).data(dataKey); 5528 5529 if (!context) { 5530 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5531 $__default['default'](event.currentTarget).data(dataKey, context); 5532 } 5533 5534 context._activeTrigger.click = !context._activeTrigger.click; 5535 5536 if (context._isWithActiveTrigger()) { 5537 context._enter(null, context); 5538 } else { 5539 context._leave(null, context); 5540 } 5541 } else { 5542 if ($__default['default'](this.getTipElement()).hasClass(CLASS_NAME_SHOW$4)) { 5543 this._leave(null, this); 5544 5545 return; 5546 } 5547 5548 this._enter(null, this); 5549 } 5550 }; 5551 5552 _proto.dispose = function dispose() { 5553 clearTimeout(this._timeout); 5554 $__default['default'].removeData(this.element, this.constructor.DATA_KEY); 5555 $__default['default'](this.element).off(this.constructor.EVENT_KEY); 5556 $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 5557 5558 if (this.tip) { 5559 $__default['default'](this.tip).remove(); 5560 } 5561 5562 this._isEnabled = null; 5563 this._timeout = null; 5564 this._hoverState = null; 5565 this._activeTrigger = null; 5566 5567 if (this._popper) { 5568 this._popper.destroy(); 5569 } 5570 5571 this._popper = null; 5572 this.element = null; 5573 this.config = null; 5574 this.tip = null; 5575 }; 5576 5577 _proto.show = function show() { 5578 var _this = this; 5579 5580 if ($__default['default'](this.element).css('display') === 'none') { 5581 throw new Error('Please use show on visible elements'); 5582 } 5583 5584 var showEvent = $__default['default'].Event(this.constructor.Event.SHOW); 5585 5586 if (this.isWithContent() && this._isEnabled) { 5587 $__default['default'](this.element).trigger(showEvent); 5588 var shadowRoot = Util.findShadowRoot(this.element); 5589 var isInTheDom = $__default['default'].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 5590 5591 if (showEvent.isDefaultPrevented() || !isInTheDom) { 5592 return; 5593 } 5594 5595 var tip = this.getTipElement(); 5596 var tipId = Util.getUID(this.constructor.NAME); 5597 tip.setAttribute('id', tipId); 5598 this.element.setAttribute('aria-describedby', tipId); 5599 this.setContent(); 5600 5601 if (this.config.animation) { 5602 $__default['default'](tip).addClass(CLASS_NAME_FADE$2); 5603 } 5604 5605 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 5606 5607 var attachment = this._getAttachment(placement); 5608 5609 this.addAttachmentClass(attachment); 5610 5611 var container = this._getContainer(); 5612 5613 $__default['default'](tip).data(this.constructor.DATA_KEY, this); 5614 5615 if (!$__default['default'].contains(this.element.ownerDocument.documentElement, this.tip)) { 5616 $__default['default'](tip).appendTo(container); 5617 } 5618 5619 $__default['default'](this.element).trigger(this.constructor.Event.INSERTED); 5620 this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment)); 5621 $__default['default'](tip).addClass(CLASS_NAME_SHOW$4); 5622 $__default['default'](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 5623 // empty mouseover listeners to the body's immediate children; 5624 // only needed because of broken event delegation on iOS 5625 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 5626 5627 if ('ontouchstart' in document.documentElement) { 5628 $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); 5629 } 5630 5631 var complete = function complete() { 5632 if (_this.config.animation) { 5633 _this._fixTransition(); 5634 } 5635 5636 var prevHoverState = _this._hoverState; 5637 _this._hoverState = null; 5638 $__default['default'](_this.element).trigger(_this.constructor.Event.SHOWN); 5639 5640 if (prevHoverState === HOVER_STATE_OUT) { 5641 _this._leave(null, _this); 5642 } 5643 }; 5644 5645 if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) { 5646 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 5647 $__default['default'](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5648 } else { 5649 complete(); 5650 } 5651 } 5652 }; 5653 5654 _proto.hide = function hide(callback) { 5655 var _this2 = this; 5656 5657 var tip = this.getTipElement(); 5658 var hideEvent = $__default['default'].Event(this.constructor.Event.HIDE); 5659 5660 var complete = function complete() { 5661 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 5662 tip.parentNode.removeChild(tip); 5663 } 5664 5665 _this2._cleanTipClass(); 5666 5667 _this2.element.removeAttribute('aria-describedby'); 5668 5669 $__default['default'](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 5670 5671 if (_this2._popper !== null) { 5672 _this2._popper.destroy(); 5673 } 5674 5675 if (callback) { 5676 callback(); 5677 } 5678 }; 5679 5680 $__default['default'](this.element).trigger(hideEvent); 5681 5682 if (hideEvent.isDefaultPrevented()) { 5683 return; 5684 } 5685 5686 $__default['default'](tip).removeClass(CLASS_NAME_SHOW$4); // If this is a touch-enabled device we remove the extra 5687 // empty mouseover listeners we added for iOS support 5688 5689 if ('ontouchstart' in document.documentElement) { 5690 $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); 5691 } 5692 5693 this._activeTrigger[TRIGGER_CLICK] = false; 5694 this._activeTrigger[TRIGGER_FOCUS] = false; 5695 this._activeTrigger[TRIGGER_HOVER] = false; 5696 5697 if ($__default['default'](this.tip).hasClass(CLASS_NAME_FADE$2)) { 5698 var transitionDuration = Util.getTransitionDurationFromElement(tip); 5699 $__default['default'](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5700 } else { 5701 complete(); 5702 } 5703 5704 this._hoverState = ''; 5705 }; 5706 5707 _proto.update = function update() { 5708 if (this._popper !== null) { 5709 this._popper.scheduleUpdate(); 5710 } 5711 } // Protected 5712 ; 5713 5714 _proto.isWithContent = function isWithContent() { 5715 return Boolean(this.getTitle()); 5716 }; 5717 5718 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 5719 $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 5720 }; 5721 5722 _proto.getTipElement = function getTipElement() { 5723 this.tip = this.tip || $__default['default'](this.config.template)[0]; 5724 return this.tip; 5725 }; 5726 5727 _proto.setContent = function setContent() { 5728 var tip = this.getTipElement(); 5729 this.setElementContent($__default['default'](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 5730 $__default['default'](tip).removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$4); 5731 }; 5732 5733 _proto.setElementContent = function setElementContent($element, content) { 5734 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 5735 // Content is a DOM node or a jQuery 5736 if (this.config.html) { 5737 if (!$__default['default'](content).parent().is($element)) { 5738 $element.empty().append(content); 5739 } 5740 } else { 5741 $element.text($__default['default'](content).text()); 5742 } 5743 5744 return; 5745 } 5746 5747 if (this.config.html) { 5748 if (this.config.sanitize) { 5749 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 5750 } 5751 5752 $element.html(content); 5753 } else { 5754 $element.text(content); 5755 } 5756 }; 5757 5758 _proto.getTitle = function getTitle() { 5759 var title = this.element.getAttribute('data-original-title'); 5760 5761 if (!title) { 5762 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 5763 } 5764 5765 return title; 5766 } // Private 5767 ; 5768 5769 _proto._getPopperConfig = function _getPopperConfig(attachment) { 5770 var _this3 = this; 5771 5772 var defaultBsConfig = { 5773 placement: attachment, 5774 modifiers: { 5775 offset: this._getOffset(), 5776 flip: { 5777 behavior: this.config.fallbackPlacement 5778 }, 5779 arrow: { 5780 element: SELECTOR_ARROW 5781 }, 5782 preventOverflow: { 5783 boundariesElement: this.config.boundary 5784 } 5785 }, 5786 onCreate: function onCreate(data) { 5787 if (data.originalPlacement !== data.placement) { 5788 _this3._handlePopperPlacementChange(data); 5789 } 5790 }, 5791 onUpdate: function onUpdate(data) { 5792 return _this3._handlePopperPlacementChange(data); 5793 } 5794 }; 5795 return _extends({}, defaultBsConfig, this.config.popperConfig); 5796 }; 5797 5798 _proto._getOffset = function _getOffset() { 5799 var _this4 = this; 5800 5801 var offset = {}; 5802 5803 if (typeof this.config.offset === 'function') { 5804 offset.fn = function (data) { 5805 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {}); 5806 return data; 5807 }; 5808 } else { 5809 offset.offset = this.config.offset; 5810 } 5811 5812 return offset; 5813 }; 5814 5815 _proto._getContainer = function _getContainer() { 5816 if (this.config.container === false) { 5817 return document.body; 5818 } 5819 5820 if (Util.isElement(this.config.container)) { 5821 return $__default['default'](this.config.container); 5822 } 5823 5824 return $__default['default'](document).find(this.config.container); 5825 }; 5826 5827 _proto._getAttachment = function _getAttachment(placement) { 5828 return AttachmentMap[placement.toUpperCase()]; 5829 }; 5830 5831 _proto._setListeners = function _setListeners() { 5832 var _this5 = this; 5833 5834 var triggers = this.config.trigger.split(' '); 5835 triggers.forEach(function (trigger) { 5836 if (trigger === 'click') { 5837 $__default['default'](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 5838 return _this5.toggle(event); 5839 }); 5840 } else if (trigger !== TRIGGER_MANUAL) { 5841 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 5842 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 5843 $__default['default'](_this5.element).on(eventIn, _this5.config.selector, function (event) { 5844 return _this5._enter(event); 5845 }).on(eventOut, _this5.config.selector, function (event) { 5846 return _this5._leave(event); 5847 }); 5848 } 5849 }); 5850 5851 this._hideModalHandler = function () { 5852 if (_this5.element) { 5853 _this5.hide(); 5854 } 5855 }; 5856 5857 $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 5858 5859 if (this.config.selector) { 5860 this.config = _extends({}, this.config, { 5861 trigger: 'manual', 5862 selector: '' 5863 }); 5864 } else { 5865 this._fixTitle(); 5866 } 5867 }; 5868 5869 _proto._fixTitle = function _fixTitle() { 5870 var titleType = typeof this.element.getAttribute('data-original-title'); 5871 5872 if (this.element.getAttribute('title') || titleType !== 'string') { 5873 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 5874 this.element.setAttribute('title', ''); 5875 } 5876 }; 5877 5878 _proto._enter = function _enter(event, context) { 5879 var dataKey = this.constructor.DATA_KEY; 5880 context = context || $__default['default'](event.currentTarget).data(dataKey); 5881 5882 if (!context) { 5883 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5884 $__default['default'](event.currentTarget).data(dataKey, context); 5885 } 5886 5887 if (event) { 5888 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 5889 } 5890 5891 if ($__default['default'](context.getTipElement()).hasClass(CLASS_NAME_SHOW$4) || context._hoverState === HOVER_STATE_SHOW) { 5892 context._hoverState = HOVER_STATE_SHOW; 5893 return; 5894 } 5895 5896 clearTimeout(context._timeout); 5897 context._hoverState = HOVER_STATE_SHOW; 5898 5899 if (!context.config.delay || !context.config.delay.show) { 5900 context.show(); 5901 return; 5902 } 5903 5904 context._timeout = setTimeout(function () { 5905 if (context._hoverState === HOVER_STATE_SHOW) { 5906 context.show(); 5907 } 5908 }, context.config.delay.show); 5909 }; 5910 5911 _proto._leave = function _leave(event, context) { 5912 var dataKey = this.constructor.DATA_KEY; 5913 context = context || $__default['default'](event.currentTarget).data(dataKey); 5914 5915 if (!context) { 5916 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 5917 $__default['default'](event.currentTarget).data(dataKey, context); 5918 } 5919 5920 if (event) { 5921 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
vendor: 13,080 bytes, lines 5922-6371
5922 } 5923 5924 if (context._isWithActiveTrigger()) { 5925 return; 5926 } 5927 5928 clearTimeout(context._timeout); 5929 context._hoverState = HOVER_STATE_OUT; 5930 5931 if (!context.config.delay || !context.config.delay.hide) { 5932 context.hide(); 5933 return; 5934 } 5935 5936 context._timeout = setTimeout(function () { 5937 if (context._hoverState === HOVER_STATE_OUT) { 5938 context.hide(); 5939 } 5940 }, context.config.delay.hide); 5941 }; 5942 5943 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 5944 for (var trigger in this._activeTrigger) { 5945 if (this._activeTrigger[trigger]) { 5946 return true; 5947 } 5948 } 5949 5950 return false; 5951 }; 5952 5953 _proto._getConfig = function _getConfig(config) { 5954 var dataAttributes = $__default['default'](this.element).data(); 5955 Object.keys(dataAttributes).forEach(function (dataAttr) { 5956 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 5957 delete dataAttributes[dataAttr]; 5958 } 5959 }); 5960 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 5961 5962 if (typeof config.delay === 'number') { 5963 config.delay = { 5964 show: config.delay, 5965 hide: config.delay 5966 }; 5967 } 5968 5969 if (typeof config.title === 'number') { 5970 config.title = config.title.toString(); 5971 } 5972 5973 if (typeof config.content === 'number') { 5974 config.content = config.content.toString(); 5975 } 5976 5977 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 5978 5979 if (config.sanitize) { 5980 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 5981 } 5982 5983 return config; 5984 }; 5985 5986 _proto._getDelegateConfig = function _getDelegateConfig() { 5987 var config = {}; 5988 5989 if (this.config) { 5990 for (var key in this.config) { 5991 if (this.constructor.Default[key] !== this.config[key]) { 5992 config[key] = this.config[key]; 5993 } 5994 } 5995 } 5996 5997 return config; 5998 }; 5999 6000 _proto._cleanTipClass = function _cleanTipClass() { 6001 var $tip = $__default['default'](this.getTipElement()); 6002 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 6003 6004 if (tabClass !== null && tabClass.length) { 6005 $tip.removeClass(tabClass.join('')); 6006 } 6007 }; 6008 6009 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 6010 this.tip = popperData.instance.popper; 6011 6012 this._cleanTipClass(); 6013 6014 this.addAttachmentClass(this._getAttachment(popperData.placement)); 6015 }; 6016 6017 _proto._fixTransition = function _fixTransition() { 6018 var tip = this.getTipElement(); 6019 var initConfigAnimation = this.config.animation; 6020 6021 if (tip.getAttribute('x-placement') !== null) { 6022 return; 6023 } 6024 6025 $__default['default'](tip).removeClass(CLASS_NAME_FADE$2); 6026 this.config.animation = false; 6027 this.hide(); 6028 this.show(); 6029 this.config.animation = initConfigAnimation; 6030 } // Static 6031 ; 6032 6033 Tooltip._jQueryInterface = function _jQueryInterface(config) { 6034 return this.each(function () { 6035 var $element = $__default['default'](this); 6036 var data = $element.data(DATA_KEY$6); 6037 6038 var _config = typeof config === 'object' && config; 6039 6040 if (!data && /dispose|hide/.test(config)) { 6041 return; 6042 } 6043 6044 if (!data) { 6045 data = new Tooltip(this, _config); 6046 $element.data(DATA_KEY$6, data); 6047 } 6048 6049 if (typeof config === 'string') { 6050 if (typeof data[config] === 'undefined') { 6051 throw new TypeError("No method named \"" + config + "\""); 6052 } 6053 6054 data[config](); 6055 } 6056 }); 6057 }; 6058 6059 _createClass(Tooltip, null, [{ 6060 key: "VERSION", 6061 get: function get() { 6062 return VERSION$6; 6063 } 6064 }, { 6065 key: "Default", 6066 get: function get() { 6067 return Default$4; 6068 } 6069 }, { 6070 key: "NAME", 6071 get: function get() { 6072 return NAME$6; 6073 } 6074 }, { 6075 key: "DATA_KEY", 6076 get: function get() { 6077 return DATA_KEY$6; 6078 } 6079 }, { 6080 key: "Event", 6081 get: function get() { 6082 return Event; 6083 } 6084 }, { 6085 key: "EVENT_KEY", 6086 get: function get() { 6087 return EVENT_KEY$6; 6088 } 6089 }, { 6090 key: "DefaultType", 6091 get: function get() { 6092 return DefaultType$4; 6093 } 6094 }]); 6095 6096 return Tooltip; 6097 }(); 6098 /** 6099 * ------------------------------------------------------------------------ 6100 * jQuery 6101 * ------------------------------------------------------------------------ 6102 */ 6103 6104 6105 $__default['default'].fn[NAME$6] = Tooltip._jQueryInterface; 6106 $__default['default'].fn[NAME$6].Constructor = Tooltip; 6107 6108 $__default['default'].fn[NAME$6].noConflict = function () { 6109 $__default['default'].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 6110 return Tooltip._jQueryInterface; 6111 }; 6112 /** 6113 * ------------------------------------------------------------------------ 6114 * Constants 6115 * ------------------------------------------------------------------------ 6116 */ 6117 6118 6119 var NAME$7 = 'popover'; 6120 var VERSION$7 = '4.6.0'; 6121 var DATA_KEY$7 = 'bs.popover'; 6122 var EVENT_KEY$7 = "." + DATA_KEY$7; 6123 var JQUERY_NO_CONFLICT$7 = $__default['default'].fn[NAME$7]; 6124 var CLASS_PREFIX$1 = 'bs-popover'; 6125 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 6126 6127 var Default$5 = _extends({}, Tooltip.Default, { 6128 placement: 'right', 6129 trigger: 'click', 6130 content: '', 6131 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 6132 }); 6133 6134 var DefaultType$5 = _extends({}, Tooltip.DefaultType, { 6135 content: '(string|element|function)' 6136 }); 6137 6138 var CLASS_NAME_FADE$3 = 'fade'; 6139 var CLASS_NAME_SHOW$5 = 'show'; 6140 var SELECTOR_TITLE = '.popover-header'; 6141 var SELECTOR_CONTENT = '.popover-body'; 6142 var Event$1 = { 6143 HIDE: "hide" + EVENT_KEY$7, 6144 HIDDEN: "hidden" + EVENT_KEY$7, 6145 SHOW: "show" + EVENT_KEY$7, 6146 SHOWN: "shown" + EVENT_KEY$7, 6147 INSERTED: "inserted" + EVENT_KEY$7, 6148 CLICK: "click" + EVENT_KEY$7, 6149 FOCUSIN: "focusin" + EVENT_KEY$7, 6150 FOCUSOUT: "focusout" + EVENT_KEY$7, 6151 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 6152 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 6153 }; 6154 /** 6155 * ------------------------------------------------------------------------ 6156 * Class Definition 6157 * ------------------------------------------------------------------------ 6158 */ 6159 6160 var Popover = /*#__PURE__*/function (_Tooltip) { 6161 _inheritsLoose(Popover, _Tooltip); 6162 6163 function Popover() { 6164 return _Tooltip.apply(this, arguments) || this; 6165 } 6166 6167 var _proto = Popover.prototype; // Overrides 6168 6169 _proto.isWithContent = function isWithContent() { 6170 return this.getTitle() || this._getContent(); 6171 }; 6172 6173 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 6174 $__default['default'](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 6175 }; 6176 6177 _proto.getTipElement = function getTipElement() { 6178 this.tip = this.tip || $__default['default'](this.config.template)[0]; 6179 return this.tip; 6180 }; 6181 6182 _proto.setContent = function setContent() { 6183 var $tip = $__default['default'](this.getTipElement()); // We use append for html objects to maintain js events 6184 6185 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 6186 6187 var content = this._getContent(); 6188 6189 if (typeof content === 'function') { 6190 content = content.call(this.element); 6191 } 6192 6193 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 6194 $tip.removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$5); 6195 } // Private 6196 ; 6197 6198 _proto._getContent = function _getContent() { 6199 return this.element.getAttribute('data-content') || this.config.content; 6200 }; 6201 6202 _proto._cleanTipClass = function _cleanTipClass() { 6203 var $tip = $__default['default'](this.getTipElement()); 6204 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 6205 6206 if (tabClass !== null && tabClass.length > 0) { 6207 $tip.removeClass(tabClass.join('')); 6208 } 6209 } // Static 6210 ; 6211 6212 Popover._jQueryInterface = function _jQueryInterface(config) { 6213 return this.each(function () { 6214 var data = $__default['default'](this).data(DATA_KEY$7); 6215 6216 var _config = typeof config === 'object' ? config : null; 6217 6218 if (!data && /dispose|hide/.test(config)) { 6219 return; 6220 } 6221 6222 if (!data) { 6223 data = new Popover(this, _config); 6224 $__default['default'](this).data(DATA_KEY$7, data); 6225 } 6226 6227 if (typeof config === 'string') { 6228 if (typeof data[config] === 'undefined') { 6229 throw new TypeError("No method named \"" + config + "\""); 6230 } 6231 6232 data[config](); 6233 } 6234 }); 6235 }; 6236 6237 _createClass(Popover, null, [{ 6238 key: "VERSION", 6239 // Getters 6240 get: function get() { 6241 return VERSION$7; 6242 } 6243 }, { 6244 key: "Default", 6245 get: function get() { 6246 return Default$5; 6247 } 6248 }, { 6249 key: "NAME", 6250 get: function get() { 6251 return NAME$7; 6252 } 6253 }, { 6254 key: "DATA_KEY", 6255 get: function get() { 6256 return DATA_KEY$7; 6257 } 6258 }, { 6259 key: "Event", 6260 get: function get() { 6261 return Event$1; 6262 } 6263 }, { 6264 key: "EVENT_KEY", 6265 get: function get() { 6266 return EVENT_KEY$7; 6267 } 6268 }, { 6269 key: "DefaultType", 6270 get: function get() { 6271 return DefaultType$5; 6272 } 6273 }]); 6274 6275 return Popover; 6276 }(Tooltip); 6277 /** 6278 * ------------------------------------------------------------------------ 6279 * jQuery 6280 * ------------------------------------------------------------------------ 6281 */ 6282 6283 6284 $__default['default'].fn[NAME$7] = Popover._jQueryInterface; 6285 $__default['default'].fn[NAME$7].Constructor = Popover; 6286 6287 $__default['default'].fn[NAME$7].noConflict = function () { 6288 $__default['default'].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 6289 return Popover._jQueryInterface; 6290 }; 6291 /** 6292 * ------------------------------------------------------------------------ 6293 * Constants 6294 * ------------------------------------------------------------------------ 6295 */ 6296 6297 6298 var NAME$8 = 'scrollspy'; 6299 var VERSION$8 = '4.6.0'; 6300 var DATA_KEY$8 = 'bs.scrollspy'; 6301 var EVENT_KEY$8 = "." + DATA_KEY$8; 6302 var DATA_API_KEY$6 = '.data-api'; 6303 var JQUERY_NO_CONFLICT$8 = $__default['default'].fn[NAME$8]; 6304 var Default$6 = { 6305 offset: 10, 6306 method: 'auto', 6307 target: '' 6308 }; 6309 var DefaultType$6 = { 6310 offset: 'number', 6311 method: 'string', 6312 target: '(string|element)' 6313 }; 6314 var EVENT_ACTIVATE = "activate" + EVENT_KEY$8; 6315 var EVENT_SCROLL = "scroll" + EVENT_KEY$8; 6316 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$8 + DATA_API_KEY$6; 6317 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 6318 var CLASS_NAME_ACTIVE$2 = 'active'; 6319 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 6320 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 6321 var SELECTOR_NAV_LINKS = '.nav-link'; 6322 var SELECTOR_NAV_ITEMS = '.nav-item'; 6323 var SELECTOR_LIST_ITEMS = '.list-group-item'; 6324 var SELECTOR_DROPDOWN = '.dropdown'; 6325 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 6326 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 6327 var METHOD_OFFSET = 'offset'; 6328 var METHOD_POSITION = 'position'; 6329 /** 6330 * ------------------------------------------------------------------------ 6331 * Class Definition 6332 * ------------------------------------------------------------------------ 6333 */ 6334 6335 var ScrollSpy = /*#__PURE__*/function () { 6336 function ScrollSpy(element, config) { 6337 var _this = this; 6338 6339 this._element = element; 6340 this._scrollElement = element.tagName === 'BODY' ? window : element; 6341 this._config = this._getConfig(config); 6342 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 6343 this._offsets = []; 6344 this._targets = []; 6345 this._activeTarget = null; 6346 this._scrollHeight = 0; 6347 $__default['default'](this._scrollElement).on(EVENT_SCROLL, function (event) { 6348 return _this._process(event); 6349 }); 6350 this.refresh(); 6351 6352 this._process(); 6353 } // Getters 6354 6355 6356 var _proto = ScrollSpy.prototype; // Public 6357 6358 _proto.refresh = function refresh() { 6359 var _this2 = this; 6360 6361 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 6362 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 6363 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 6364 this._offsets = []; 6365 this._targets = []; 6366 this._scrollHeight = this._getScrollHeight(); 6367 var targets = [].slice.call(document.querySelectorAll(this._selector)); 6368 targets.map(function (element) { 6369 var target; 6370 var targetSelector = Util.getSelectorFromElement(element); 6371
vendor: 4,795 bytes, lines 6372-6511
6372 if (targetSelector) { 6373 target = document.querySelector(targetSelector); 6374 } 6375 6376 if (target) { 6377 var targetBCR = target.getBoundingClientRect(); 6378 6379 if (targetBCR.width || targetBCR.height) { 6380 // TODO (fat): remove sketch reliance on jQuery position/offset 6381 return [$__default['default'](target)[offsetMethod]().top + offsetBase, targetSelector]; 6382 } 6383 } 6384 6385 return null; 6386 }).filter(function (item) { 6387 return item; 6388 }).sort(function (a, b) { 6389 return a[0] - b[0]; 6390 }).forEach(function (item) { 6391 _this2._offsets.push(item[0]); 6392 6393 _this2._targets.push(item[1]); 6394 }); 6395 }; 6396 6397 _proto.dispose = function dispose() { 6398 $__default['default'].removeData(this._element, DATA_KEY$8); 6399 $__default['default'](this._scrollElement).off(EVENT_KEY$8); 6400 this._element = null; 6401 this._scrollElement = null; 6402 this._config = null; 6403 this._selector = null; 6404 this._offsets = null; 6405 this._targets = null; 6406 this._activeTarget = null; 6407 this._scrollHeight = null; 6408 } // Private 6409 ; 6410 6411 _proto._getConfig = function _getConfig(config) { 6412 config = _extends({}, Default$6, typeof config === 'object' && config ? config : {}); 6413 6414 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 6415 var id = $__default['default'](config.target).attr('id'); 6416 6417 if (!id) { 6418 id = Util.getUID(NAME$8); 6419 $__default['default'](config.target).attr('id', id); 6420 } 6421 6422 config.target = "#" + id; 6423 } 6424 6425 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 6426 return config; 6427 }; 6428 6429 _proto._getScrollTop = function _getScrollTop() { 6430 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 6431 }; 6432 6433 _proto._getScrollHeight = function _getScrollHeight() { 6434 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 6435 }; 6436 6437 _proto._getOffsetHeight = function _getOffsetHeight() { 6438 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 6439 }; 6440 6441 _proto._process = function _process() { 6442 var scrollTop = this._getScrollTop() + this._config.offset; 6443 6444 var scrollHeight = this._getScrollHeight(); 6445 6446 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 6447 6448 if (this._scrollHeight !== scrollHeight) { 6449 this.refresh(); 6450 } 6451 6452 if (scrollTop >= maxScroll) { 6453 var target = this._targets[this._targets.length - 1]; 6454 6455 if (this._activeTarget !== target) { 6456 this._activate(target); 6457 } 6458 6459 return; 6460 } 6461 6462 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 6463 this._activeTarget = null; 6464 6465 this._clear(); 6466 6467 return; 6468 } 6469 6470 for (var i = this._offsets.length; i--;) { 6471 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 6472 6473 if (isActiveTarget) { 6474 this._activate(this._targets[i]); 6475 } 6476 } 6477 }; 6478 6479 _proto._activate = function _activate(target) { 6480 this._activeTarget = target; 6481 6482 this._clear(); 6483 6484 var queries = this._selector.split(',').map(function (selector) { 6485 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 6486 }); 6487 6488 var $link = $__default['default']([].slice.call(document.querySelectorAll(queries.join(',')))); 6489 6490 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 6491 $link.closest(SELECTOR_DROPDOWN).find(SELECTOR_DROPDOWN_TOGGLE).addClass(CLASS_NAME_ACTIVE$2); 6492 $link.addClass(CLASS_NAME_ACTIVE$2); 6493 } else { 6494 // Set triggered link as active 6495 $link.addClass(CLASS_NAME_ACTIVE$2); // Set triggered links parents as active 6496 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 6497 6498 $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 6499 6500 $link.parents(SELECTOR_NAV_LIST_GROUP).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$2); 6501 } 6502 6503 $__default['default'](this._scrollElement).trigger(EVENT_ACTIVATE, { 6504 relatedTarget: target 6505 }); 6506 }; 6507 6508 _proto._clear = function _clear() { 6509 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 6510 return node.classList.contains(CLASS_NAME_ACTIVE$2); 6511 }
vendor: 4,305 bytes, lines 6511-6639
6511).forEach(function (node) { 6512 return node.classList.remove(CLASS_NAME_ACTIVE$2); 6513 }); 6514 } // Static 6515 ; 6516 6517 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 6518 return this.each(function () { 6519 var data = $__default['default'](this).data(DATA_KEY$8); 6520 6521 var _config = typeof config === 'object' && config; 6522 6523 if (!data) { 6524 data = new ScrollSpy(this, _config); 6525 $__default['default'](this).data(DATA_KEY$8, data); 6526 } 6527 6528 if (typeof config === 'string') { 6529 if (typeof data[config] === 'undefined') { 6530 throw new TypeError("No method named \"" + config + "\""); 6531 } 6532 6533 data[config](); 6534 } 6535 }); 6536 }; 6537 6538 _createClass(ScrollSpy, null, [{ 6539 key: "VERSION", 6540 get: function get() { 6541 return VERSION$8; 6542 } 6543 }, { 6544 key: "Default", 6545 get: function get() { 6546 return Default$6; 6547 } 6548 }]); 6549 6550 return ScrollSpy; 6551 }(); 6552 /** 6553 * ------------------------------------------------------------------------ 6554 * Data Api implementation 6555 * ------------------------------------------------------------------------ 6556 */ 6557 6558 6559 $__default['default'](window).on(EVENT_LOAD_DATA_API$2, function () { 6560 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 6561 var scrollSpysLength = scrollSpys.length; 6562 6563 for (var i = scrollSpysLength; i--;) { 6564 var $spy = $__default['default'](scrollSpys[i]); 6565 6566 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 6567 } 6568 }); 6569 /** 6570 * ------------------------------------------------------------------------ 6571 * jQuery 6572 * ------------------------------------------------------------------------ 6573 */ 6574 6575 $__default['default'].fn[NAME$8] = ScrollSpy._jQueryInterface; 6576 $__default['default'].fn[NAME$8].Constructor = ScrollSpy; 6577 6578 $__default['default'].fn[NAME$8].noConflict = function () { 6579 $__default['default'].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 6580 return ScrollSpy._jQueryInterface; 6581 }; 6582 /** 6583 * ------------------------------------------------------------------------ 6584 * Constants 6585 * ------------------------------------------------------------------------ 6586 */ 6587 6588 6589 var NAME$9 = 'tab'; 6590 var VERSION$9 = '4.6.0'; 6591 var DATA_KEY$9 = 'bs.tab'; 6592 var EVENT_KEY$9 = "." + DATA_KEY$9; 6593 var DATA_API_KEY$7 = '.data-api'; 6594 var JQUERY_NO_CONFLICT$9 = $__default['default'].fn[NAME$9]; 6595 var EVENT_HIDE$3 = "hide" + EVENT_KEY$9; 6596 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9; 6597 var EVENT_SHOW$3 = "show" + EVENT_KEY$9; 6598 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9; 6599 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7; 6600 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 6601 var CLASS_NAME_ACTIVE$3 = 'active'; 6602 var CLASS_NAME_DISABLED$1 = 'disabled'; 6603 var CLASS_NAME_FADE$4 = 'fade'; 6604 var CLASS_NAME_SHOW$6 = 'show'; 6605 var SELECTOR_DROPDOWN$1 = '.dropdown'; 6606 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 6607 var SELECTOR_ACTIVE$2 = '.active'; 6608 var SELECTOR_ACTIVE_UL = '> li > .active'; 6609 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 6610 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 6611 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 6612 /** 6613 * ------------------------------------------------------------------------ 6614 * Class Definition 6615 * ------------------------------------------------------------------------ 6616 */ 6617 6618 var Tab = /*#__PURE__*/function () { 6619 function Tab(element) { 6620 this._element = element; 6621 } // Getters 6622 6623 6624 var _proto = Tab.prototype; // Public 6625 6626 _proto.show = function show() { 6627 var _this = this; 6628 6629 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)) { 6630 return; 6631 } 6632 6633 var target; 6634 var previous; 6635 var listElement = $__default['default'](this._element).closest(SELECTOR_NAV_LIST_GROUP$1)[0]; 6636 var selector = Util.getSelectorFromElement(this._element); 6637 6638 if (listElement) { 6639 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
vendor: 2,589 bytes, lines 6640-6712
6640 previous = $__default['default'].makeArray($__default['default'](listElement).find(itemSelector)); 6641 previous = previous[previous.length - 1]; 6642 } 6643 6644 var hideEvent = $__default['default'].Event(EVENT_HIDE$3, { 6645 relatedTarget: this._element 6646 }); 6647 var showEvent = $__default['default'].Event(EVENT_SHOW$3, { 6648 relatedTarget: previous 6649 }); 6650 6651 if (previous) { 6652 $__default['default'](previous).trigger(hideEvent); 6653 } 6654 6655 $__default['default'](this._element).trigger(showEvent); 6656 6657 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 6658 return; 6659 } 6660 6661 if (selector) { 6662 target = document.querySelector(selector); 6663 } 6664 6665 this._activate(this._element, listElement); 6666 6667 var complete = function complete() { 6668 var hiddenEvent = $__default['default'].Event(EVENT_HIDDEN$3, { 6669 relatedTarget: _this._element 6670 }); 6671 var shownEvent = $__default['default'].Event(EVENT_SHOWN$3, { 6672 relatedTarget: previous 6673 }); 6674 $__default['default'](previous).trigger(hiddenEvent); 6675 $__default['default'](_this._element).trigger(shownEvent); 6676 }; 6677 6678 if (target) { 6679 this._activate(target, target.parentNode, complete); 6680 } else { 6681 complete(); 6682 } 6683 }; 6684 6685 _proto.dispose = function dispose() { 6686 $__default['default'].removeData(this._element, DATA_KEY$9); 6687 this._element = null; 6688 } // Private 6689 ; 6690 6691 _proto._activate = function _activate(element, container, callback) { 6692 var _this2 = this; 6693 6694 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default['default'](container).find(SELECTOR_ACTIVE_UL) : $__default['default'](container).children(SELECTOR_ACTIVE$2); 6695 var active = activeElements[0]; 6696 var isTransitioning = callback && active && $__default['default'](active).hasClass(CLASS_NAME_FADE$4); 6697 6698 var complete = function complete() { 6699 return _this2._transitionComplete(element, active, callback); 6700 }; 6701 6702 if (active && isTransitioning) { 6703 var transitionDuration = Util.getTransitionDurationFromElement(active); 6704 $__default['default'](active).removeClass(CLASS_NAME_SHOW$6).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6705 } else { 6706 complete(); 6707 } 6708 }; 6709 6710 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 6711 if (active) { 6712 $__default['default'](active).removeClass(CLASS_NAME_ACTIVE$3);
vendor: 8,019 bytes, lines 6713-6982
6713 var dropdownChild = $__default['default'](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 6714 6715 if (dropdownChild) { 6716 $__default['default'](dropdownChild).removeClass(CLASS_NAME_ACTIVE$3); 6717 } 6718 6719 if (active.getAttribute('role') === 'tab') { 6720 active.setAttribute('aria-selected', false); 6721 } 6722 } 6723 6724 $__default['default'](element).addClass(CLASS_NAME_ACTIVE$3); 6725 6726 if (element.getAttribute('role') === 'tab') { 6727 element.setAttribute('aria-selected', true); 6728 } 6729 6730 Util.reflow(element); 6731 6732 if (element.classList.contains(CLASS_NAME_FADE$4)) { 6733 element.classList.add(CLASS_NAME_SHOW$6); 6734 } 6735 6736 if (element.parentNode && $__default['default'](element.parentNode).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 6737 var dropdownElement = $__default['default'](element).closest(SELECTOR_DROPDOWN$1)[0]; 6738 6739 if (dropdownElement) { 6740 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE$1)); 6741 $__default['default'](dropdownToggleList).addClass(CLASS_NAME_ACTIVE$3); 6742 } 6743 6744 element.setAttribute('aria-expanded', true); 6745 } 6746 6747 if (callback) { 6748 callback(); 6749 } 6750 } // Static 6751 ; 6752 6753 Tab._jQueryInterface = function _jQueryInterface(config) { 6754 return this.each(function () { 6755 var $this = $__default['default'](this); 6756 var data = $this.data(DATA_KEY$9); 6757 6758 if (!data) { 6759 data = new Tab(this); 6760 $this.data(DATA_KEY$9, data); 6761 } 6762 6763 if (typeof config === 'string') { 6764 if (typeof data[config] === 'undefined') { 6765 throw new TypeError("No method named \"" + config + "\""); 6766 } 6767 6768 data[config](); 6769 } 6770 }); 6771 }; 6772 6773 _createClass(Tab, null, [{ 6774 key: "VERSION", 6775 get: function get() { 6776 return VERSION$9; 6777 } 6778 }]); 6779 6780 return Tab; 6781 }(); 6782 /** 6783 * ------------------------------------------------------------------------ 6784 * Data Api implementation 6785 * ------------------------------------------------------------------------ 6786 */ 6787 6788 6789 $__default['default'](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) { 6790 event.preventDefault(); 6791 6792 Tab._jQueryInterface.call($__default['default'](this), 'show'); 6793 }); 6794 /** 6795 * ------------------------------------------------------------------------ 6796 * jQuery 6797 * ------------------------------------------------------------------------ 6798 */ 6799 6800 $__default['default'].fn[NAME$9] = Tab._jQueryInterface; 6801 $__default['default'].fn[NAME$9].Constructor = Tab; 6802 6803 $__default['default'].fn[NAME$9].noConflict = function () { 6804 $__default['default'].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 6805 return Tab._jQueryInterface; 6806 }; 6807 /** 6808 * ------------------------------------------------------------------------ 6809 * Constants 6810 * ------------------------------------------------------------------------ 6811 */ 6812 6813 6814 var NAME$a = 'toast'; 6815 var VERSION$a = '4.6.0'; 6816 var DATA_KEY$a = 'bs.toast'; 6817 var EVENT_KEY$a = "." + DATA_KEY$a; 6818 var JQUERY_NO_CONFLICT$a = $__default['default'].fn[NAME$a]; 6819 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a; 6820 var EVENT_HIDE$4 = "hide" + EVENT_KEY$a; 6821 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a; 6822 var EVENT_SHOW$4 = "show" + EVENT_KEY$a; 6823 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a; 6824 var CLASS_NAME_FADE$5 = 'fade'; 6825 var CLASS_NAME_HIDE = 'hide'; 6826 var CLASS_NAME_SHOW$7 = 'show'; 6827 var CLASS_NAME_SHOWING = 'showing'; 6828 var DefaultType$7 = { 6829 animation: 'boolean', 6830 autohide: 'boolean', 6831 delay: 'number' 6832 }; 6833 var Default$7 = { 6834 animation: true, 6835 autohide: true, 6836 delay: 500 6837 }; 6838 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]'; 6839 /** 6840 * ------------------------------------------------------------------------ 6841 * Class Definition 6842 * ------------------------------------------------------------------------ 6843 */ 6844 6845 var Toast = /*#__PURE__*/function () { 6846 function Toast(element, config) { 6847 this._element = element; 6848 this._config = this._getConfig(config); 6849 this._timeout = null; 6850 6851 this._setListeners(); 6852 } // Getters 6853 6854 6855 var _proto = Toast.prototype; // Public 6856 6857 _proto.show = function show() { 6858 var _this = this; 6859 6860 var showEvent = $__default['default'].Event(EVENT_SHOW$4); 6861 $__default['default'](this._element).trigger(showEvent); 6862 6863 if (showEvent.isDefaultPrevented()) { 6864 return; 6865 } 6866 6867 this._clearTimeout(); 6868 6869 if (this._config.animation) { 6870 this._element.classList.add(CLASS_NAME_FADE$5); 6871 } 6872 6873 var complete = function complete() { 6874 _this._element.classList.remove(CLASS_NAME_SHOWING); 6875 6876 _this._element.classList.add(CLASS_NAME_SHOW$7); 6877 6878 $__default['default'](_this._element).trigger(EVENT_SHOWN$4); 6879 6880 if (_this._config.autohide) { 6881 _this._timeout = setTimeout(function () { 6882 _this.hide(); 6883 }, _this._config.delay); 6884 } 6885 }; 6886 6887 this._element.classList.remove(CLASS_NAME_HIDE); 6888 6889 Util.reflow(this._element); 6890 6891 this._element.classList.add(CLASS_NAME_SHOWING); 6892 6893 if (this._config.animation) { 6894 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6895 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6896 } else { 6897 complete(); 6898 } 6899 }; 6900 6901 _proto.hide = function hide() { 6902 if (!this._element.classList.contains(CLASS_NAME_SHOW$7)) { 6903 return; 6904 } 6905 6906 var hideEvent = $__default['default'].Event(EVENT_HIDE$4); 6907 $__default['default'](this._element).trigger(hideEvent); 6908 6909 if (hideEvent.isDefaultPrevented()) { 6910 return; 6911 } 6912 6913 this._close(); 6914 }; 6915 6916 _proto.dispose = function dispose() { 6917 this._clearTimeout(); 6918 6919 if (this._element.classList.contains(CLASS_NAME_SHOW$7)) { 6920 this._element.classList.remove(CLASS_NAME_SHOW$7); 6921 } 6922 6923 $__default['default'](this._element).off(EVENT_CLICK_DISMISS$1); 6924 $__default['default'].removeData(this._element, DATA_KEY$a); 6925 this._element = null; 6926 this._config = null; 6927 } // Private 6928 ; 6929 6930 _proto._getConfig = function _getConfig(config) { 6931 config = _extends({}, Default$7, $__default['default'](this._element).data(), typeof config === 'object' && config ? config : {}); 6932 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 6933 return config; 6934 }; 6935 6936 _proto._setListeners = function _setListeners() { 6937 var _this2 = this; 6938 6939 $__default['default'](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () { 6940 return _this2.hide(); 6941 }); 6942 }; 6943 6944 _proto._close = function _close() { 6945 var _this3 = this; 6946 6947 var complete = function complete() { 6948 _this3._element.classList.add(CLASS_NAME_HIDE); 6949 6950 $__default['default'](_this3._element).trigger(EVENT_HIDDEN$4); 6951 }; 6952 6953 this._element.classList.remove(CLASS_NAME_SHOW$7); 6954 6955 if (this._config.animation) { 6956 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 6957 $__default['default'](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 6958 } else { 6959 complete(); 6960 } 6961 }; 6962 6963 _proto._clearTimeout = function _clearTimeout() { 6964 clearTimeout(this._timeout); 6965 this._timeout = null; 6966 } // Static 6967 ; 6968 6969 Toast._jQueryInterface = function _jQueryInterface(config) { 6970 return this.each(function () { 6971 var $element = $__default['default'](this); 6972 var data = $element.data(DATA_KEY$a); 6973 6974 var _config = typeof config === 'object' && config; 6975 6976 if (!data) { 6977 data = new Toast(this, _config); 6978 $element.data(DATA_KEY$a, data); 6979 } 6980 6981 if (typeof config === 'string') { 6982 if (typeof data[config] === 'undefined') {
6983 throw new TypeError("No method named \"" + config + "\""); 6984 } 6985 6986 data[config](this); 6987 } 6988 }); 6989 }; 6990 6991 _createClass(Toast, null, [{ 6992 key: "VERSION", 6993 get: function get() { 6994 return VERSION$a; 6995 } 6996 }, { 6997 key: "DefaultType", 6998 get: function get() { 6999 return DefaultType$7; 7000 } 7001 }, { 7002 key: "Default", 7003 get: function get() { 7004 return Default$7; 7005 } 7006 }]); 7007 7008 return Toast; 7009 }(); 7010 /** 7011 * ------------------------------------------------------------------------ 7012 * jQuery 7013 * ------------------------------------------------------------------------ 7014 */ 7015 7016 7017 $__default['default'].fn[NAME$a] = Toast._jQueryInterface; 7018 $__default['default'].fn[NAME$a].Constructor = Toast; 7019 7020 $__default['default'].fn[NAME$a].noConflict = function () { 7021 $__default['default'].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 7022 return Toast._jQueryInterface; 7023 }; 7024 7025 exports.Alert = Alert; 7026 exports.Button = Button; 7027 exports.Carousel = Carousel; 7028 exports.Collapse = Collapse; 7029 exports.Dropdown = Dropdown; 7030 exports.Modal = Modal; 7031 exports.Popover = Popover; 7032 exports.Scrollspy = ScrollSpy; 7033 exports.Tab = Tab; 7034 exports.Toast = Toast; 7035 exports.Tooltip = Tooltip; 7036 exports.Util = Util; 7037 Object.defineProperty(exports, '__esModule', { 7038 value: true 7039 }); 7040}); 7041/** 7042 * File skip-link-focus-fix.js. 7043 * 7044 * Helps with accessibility for keyboard only users. 7045 * 7046 * Learn more: https://git.io/vWdr2 7047 */ 7048(function () { 7049 var isWebkit = navigator.userAgent.toLowerCase().indexOf('webkit') > -1, 7050 isOpera = navigator.userAgent.toLowerCase().indexOf('opera') > -1, 7051 isIe = navigator.userAgent.toLowerCase().indexOf('msie') > -1; 7052 7053 if ((isWebkit || isOpera || isIe) && document.getElementById && window.addEventListener) { 7054 window.addEventListener('hashchange', function () { 7055 var id = location.hash.substring(1), 7056 element; 7057 7058 if (!/^[A-z0-9_-]+$/.test(id)) { 7059 return; 7060 } 7061 7062 element = document.getElementById(id); 7063 7064 if (element) { 7065 if (!/^(?:a|select|input|button|textarea)$/i.test(element.tagName)) { 7066 element.tabIndex = -1; 7067 } 7068 7069 element.focus(); 7070 } 7071 }, false); 7072 } 7073})(); 7074 7075/* (function ($) { 7076 $(document).ready(function () { 7077 $('.form-control').blur(function () { 7078 // check if the input has any value (if we've typed into it) 7079 if ($(this).val()) { 7080 $(this).addClass('used'); 7081 } else { 7082 $(this).removeClass('used'); 7083 } 7084 }); 7085 }); // create references to the 3 dropdown fields for later use. 7086 7087 var $carreras_dd = $('[name="cbx_carrera"]'); 7088 var $provincia_dd = $('[name="cbx_provincia"]'); 7089 var $sedes_dd = $('[name="cbx_sede"]'); 7090 7091 if ($carreras_dd.length > 1) { 7092 $.each($carreras_dd, function () { 7093 if ($(this).closest('form').find('[name="cbx_provincia"]').length > 0) { 7094 $carreras_dd = $(this); 7095 } 7096 }); 7097 } // run the populate_fields function, and additionally run it every time a value change 7098 7099 7100 if ($provincia_dd.length > 0) { 7101 populate_fields(); 7102 $.each([$carreras_dd, $sedes_dd, $provincia_dd], function () { 7103 $(this).change(function () { 7104 populate_fields(); 7105 }); 7106 }); 7107 } 7108 7109 ; 7110 7111 function populate_fields() { 7112 const provincia_name = $provincia_dd.attr("name"); 7113 const carrera_name = $carreras_dd.attr("name"); 7114 const sede_name = $sedes_dd.attr("name"); 7115 var data = { 7116 // action needs to match the action hook part after wp_ajax_nopriv_ and wp_ajax_ in the server side script. 7117 'action': 'cf7_populate_sedes_values', 7118 // pass all the currently selected values to the server side script. 7119 [provincia_name]: $provincia_dd.val(), 7120 [carrera_name]: $carreras_dd.val(), 7121 [sede_name]: $sedes_dd.val() 7122 }; // call the server side script, and on completion, update all dropdown lists with the received values. 7123 7124 7125 $.post('/wp-admin/admin-ajax.php', data, function (response) { 7126 let all_values = response || {}; 7127 7128 if (!all_values || typeof all_values !== 'object') { 7129 // Si la respuesta no es válida, evitar romper el script 7130 console.warn('Respuesta AJAX inválida o vacÃa para cf7_populate_sedes_values'); 7131 return; 7132 } 7133 7134 $carreras_dd.html('').append($('<option>').val('').text(' -- Elegir Carrera -- ')); 7135 $.each(all_values[carrera_name] || {}, function (k, v) { 7136 let $option = $("<option>").text(v).val(k); 7137 if (all_values.current_carrera == k) { 7138 $option.attr('selected', 'selected'); 7139 $provincia_dd.html('').append($('<option>').val('').text(' -- Elegir provincia -- ')); 7140 } 7141 $carreras_dd.append($option); 7142 }); 7143 7144 $.each(all_values[provincia_name] || {}, function (k, v) { 7145 let $option = $("<option>").text(v).val(k); 7146 if (all_values.current_provincia == k) { 7147 $option.attr('selected', 'selected'); 7148 $sedes_dd.html('').append($('<option>').val('').text(' -- Elegir Sede -- ')); 7149 } 7150 $provincia_dd.append($option); 7151 }); 7152 7153 $.each(all_values[sede_name] || {}, function (k, v) { 7154 let $option = $("<option>").text(v).val(k); 7155 if (all_values.current_sede == k) { 7156 $option.attr('selected', 'selected'); 7157 } 7158 $sedes_dd.append($option); 7159 }); 7160 7161 }, 'json').fail(function() { 7162 // Si falla la petición AJAX, evitar error en consola y notificar 7163 console.warn('Error en AJAX cf7_populate_sedes_values'); 7164 }); 7165 */ 7166 /* $.post('/wp-admin/admin-ajax.php', data, function (response) { 7167 let all_values = response; 7168 $carreras_dd.html('').append($('<option>').val('').text(' -- Elegir Carrera -- ')); 7169 $.each(all_values[carrera_name], function (k, v) { 7170 let $option = $("<option>").text(v).val(k); 7171 7172 if (all_values.current_carrera == k) { 7173 $option.attr('selected', 'selected'); 7174 $provincia_dd.html('').append($('<option>').val('').text(' -- Elegir provincia -- ')); 7175 } 7176 7177 $carreras_dd.append($option); 7178 }); 7179 $.each(all_values[provincia_name], function (k, v) { 7180 let $option = $("<option>").text(v).val(k); 7181 7182 if (all_values.current_provincia == k) { 7183 $option.attr('selected', 'selected'); 7184 $sedes_dd.html('').append($('<option>').val('').text(' -- Elegir Sede -- ')); 7185 } 7186 7187 $provincia_dd.append($option); 7188 }); 7189 $.each(all_values[sede_name], function (k, v) { 7190 let $option = $("<option>").text(v).val(k); 7191 7192 if (all_values.current_sede == k) { 7193 $option.attr('selected', 'selected'); 7194 } 7195 7196 $sedes_dd.append($option); 7197 }); 7198 }, 'json');*/ 7199 // } 7200//})(jQuery);
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.