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