2 * Bootstrap v4.0.0 (https://getbootstrap.com)
3 * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6 (function (global, factory) {
7 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
8 typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
9 (factory((global.bootstrap = {}),global.jQuery));
10 }(this, (function (exports,$) { 'use strict';
12 $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
14 function _defineProperties(target, props) {
15 for (var i = 0; i < props.length; i++) {
16 var descriptor = props[i];
17 descriptor.enumerable = descriptor.enumerable || false;
18 descriptor.configurable = true;
19 if ("value" in descriptor) descriptor.writable = true;
20 Object.defineProperty(target, descriptor.key, descriptor);
24 function _createClass(Constructor, protoProps, staticProps) {
25 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
26 if (staticProps) _defineProperties(Constructor, staticProps);
31 _extends = Object.assign || function (target) {
32 for (var i = 1; i < arguments.length; i++) {
33 var source = arguments[i];
35 for (var key in source) {
36 if (Object.prototype.hasOwnProperty.call(source, key)) {
37 target[key] = source[key];
45 return _extends.apply(this, arguments);
48 function _inheritsLoose(subClass, superClass) {
49 subClass.prototype = Object.create(superClass.prototype);
50 subClass.prototype.constructor = subClass;
51 subClass.__proto__ = superClass;
55 * --------------------------------------------------------------------------
56 * Bootstrap (v4.0.0): util.js
57 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
58 * --------------------------------------------------------------------------
61 var Util = function ($$$1) {
63 * ------------------------------------------------------------------------
64 * Private TransitionEnd Helpers
65 * ------------------------------------------------------------------------
67 var transition = false;
68 var MAX_UID = 1000000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
70 function toType(obj) {
71 return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
74 function getSpecialTransitionEndEvent() {
76 bindType: transition.end,
77 delegateType: transition.end,
78 handle: function handle(event) {
79 if ($$$1(event.target).is(this)) {
80 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
83 return undefined; // eslint-disable-line no-undefined
88 function transitionEndTest() {
89 if (typeof window !== 'undefined' && window.QUnit) {
98 function transitionEndEmulator(duration) {
102 $$$1(this).one(Util.TRANSITION_END, function () {
105 setTimeout(function () {
107 Util.triggerTransitionEnd(_this);
113 function setTransitionEndSupport() {
114 transition = transitionEndTest();
115 $$$1.fn.emulateTransitionEnd = transitionEndEmulator;
117 if (Util.supportsTransitionEnd()) {
118 $$$1.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
122 function escapeId(selector) {
123 // We escape IDs in case of special selectors (selector = '#myId:something')
124 // $.escapeSelector does not exist in jQuery < 3
125 selector = typeof $$$1.escapeSelector === 'function' ? $$$1.escapeSelector(selector).substr(1) : selector.replace(/(:|\.|\[|\]|,|=|@)/g, '\\$1');
129 * --------------------------------------------------------------------------
131 * --------------------------------------------------------------------------
136 TRANSITION_END: 'bsTransitionEnd',
137 getUID: function getUID(prefix) {
139 // eslint-disable-next-line no-bitwise
140 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
141 } while (document.getElementById(prefix));
145 getSelectorFromElement: function getSelectorFromElement(element) {
146 var selector = element.getAttribute('data-target');
148 if (!selector || selector === '#') {
149 selector = element.getAttribute('href') || '';
153 if (selector.charAt(0) === '#') {
154 selector = escapeId(selector);
158 var $selector = $$$1(document).find(selector);
159 return $selector.length > 0 ? selector : null;
164 reflow: function reflow(element) {
165 return element.offsetHeight;
167 triggerTransitionEnd: function triggerTransitionEnd(element) {
168 $$$1(element).trigger(transition.end);
170 supportsTransitionEnd: function supportsTransitionEnd() {
171 return Boolean(transition);
173 isElement: function isElement(obj) {
174 return (obj[0] || obj).nodeType;
176 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
177 for (var property in configTypes) {
178 if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
179 var expectedTypes = configTypes[property];
180 var value = config[property];
181 var valueType = value && Util.isElement(value) ? 'element' : toType(value);
183 if (!new RegExp(expectedTypes).test(valueType)) {
184 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
190 setTransitionEndSupport();
195 * --------------------------------------------------------------------------
196 * Bootstrap (v4.0.0): alert.js
197 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
198 * --------------------------------------------------------------------------
201 var Alert = function ($$$1) {
203 * ------------------------------------------------------------------------
205 * ------------------------------------------------------------------------
208 var VERSION = '4.0.0';
209 var DATA_KEY = 'bs.alert';
210 var EVENT_KEY = "." + DATA_KEY;
211 var DATA_API_KEY = '.data-api';
212 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
213 var TRANSITION_DURATION = 150;
215 DISMISS: '[data-dismiss="alert"]'
218 CLOSE: "close" + EVENT_KEY,
219 CLOSED: "closed" + EVENT_KEY,
220 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
227 * ------------------------------------------------------------------------
229 * ------------------------------------------------------------------------
237 function Alert(element) {
238 this._element = element;
242 var _proto = Alert.prototype;
245 _proto.close = function close(element) {
246 element = element || this._element;
248 var rootElement = this._getRootElement(element);
250 var customEvent = this._triggerCloseEvent(rootElement);
252 if (customEvent.isDefaultPrevented()) {
256 this._removeElement(rootElement);
259 _proto.dispose = function dispose() {
260 $$$1.removeData(this._element, DATA_KEY);
261 this._element = null;
265 _proto._getRootElement = function _getRootElement(element) {
266 var selector = Util.getSelectorFromElement(element);
270 parent = $$$1(selector)[0];
274 parent = $$$1(element).closest("." + ClassName.ALERT)[0];
280 _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
281 var closeEvent = $$$1.Event(Event.CLOSE);
282 $$$1(element).trigger(closeEvent);
286 _proto._removeElement = function _removeElement(element) {
289 $$$1(element).removeClass(ClassName.SHOW);
291 if (!Util.supportsTransitionEnd() || !$$$1(element).hasClass(ClassName.FADE)) {
292 this._destroyElement(element);
297 $$$1(element).one(Util.TRANSITION_END, function (event) {
298 return _this._destroyElement(element, event);
299 }).emulateTransitionEnd(TRANSITION_DURATION);
302 _proto._destroyElement = function _destroyElement(element) {
303 $$$1(element).detach().trigger(Event.CLOSED).remove();
307 Alert._jQueryInterface = function _jQueryInterface(config) {
308 return this.each(function () {
309 var $element = $$$1(this);
310 var data = $element.data(DATA_KEY);
313 data = new Alert(this);
314 $element.data(DATA_KEY, data);
317 if (config === 'close') {
323 Alert._handleDismiss = function _handleDismiss(alertInstance) {
324 return function (event) {
326 event.preventDefault();
329 alertInstance.close(this);
333 _createClass(Alert, null, [{
335 get: function get() {
342 * ------------------------------------------------------------------------
343 * Data Api implementation
344 * ------------------------------------------------------------------------
348 $$$1(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
350 * ------------------------------------------------------------------------
352 * ------------------------------------------------------------------------
355 $$$1.fn[NAME] = Alert._jQueryInterface;
356 $$$1.fn[NAME].Constructor = Alert;
358 $$$1.fn[NAME].noConflict = function () {
359 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
360 return Alert._jQueryInterface;
367 * --------------------------------------------------------------------------
368 * Bootstrap (v4.0.0): button.js
369 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
370 * --------------------------------------------------------------------------
373 var Button = function ($$$1) {
375 * ------------------------------------------------------------------------
377 * ------------------------------------------------------------------------
380 var VERSION = '4.0.0';
381 var DATA_KEY = 'bs.button';
382 var EVENT_KEY = "." + DATA_KEY;
383 var DATA_API_KEY = '.data-api';
384 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
391 DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
392 DATA_TOGGLE: '[data-toggle="buttons"]',
398 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
399 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY + DATA_API_KEY + " " + ("blur" + EVENT_KEY + DATA_API_KEY)
401 * ------------------------------------------------------------------------
403 * ------------------------------------------------------------------------
411 function Button(element) {
412 this._element = element;
416 var _proto = Button.prototype;
419 _proto.toggle = function toggle() {
420 var triggerChangeEvent = true;
421 var addAriaPressed = true;
422 var rootElement = $$$1(this._element).closest(Selector.DATA_TOGGLE)[0];
425 var input = $$$1(this._element).find(Selector.INPUT)[0];
428 if (input.type === 'radio') {
429 if (input.checked && $$$1(this._element).hasClass(ClassName.ACTIVE)) {
430 triggerChangeEvent = false;
432 var activeElement = $$$1(rootElement).find(Selector.ACTIVE)[0];
435 $$$1(activeElement).removeClass(ClassName.ACTIVE);
440 if (triggerChangeEvent) {
441 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
445 input.checked = !$$$1(this._element).hasClass(ClassName.ACTIVE);
446 $$$1(input).trigger('change');
450 addAriaPressed = false;
454 if (addAriaPressed) {
455 this._element.setAttribute('aria-pressed', !$$$1(this._element).hasClass(ClassName.ACTIVE));
458 if (triggerChangeEvent) {
459 $$$1(this._element).toggleClass(ClassName.ACTIVE);
463 _proto.dispose = function dispose() {
464 $$$1.removeData(this._element, DATA_KEY);
465 this._element = null;
469 Button._jQueryInterface = function _jQueryInterface(config) {
470 return this.each(function () {
471 var data = $$$1(this).data(DATA_KEY);
474 data = new Button(this);
475 $$$1(this).data(DATA_KEY, data);
478 if (config === 'toggle') {
484 _createClass(Button, null, [{
486 get: function get() {
493 * ------------------------------------------------------------------------
494 * Data Api implementation
495 * ------------------------------------------------------------------------
499 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
500 event.preventDefault();
501 var button = event.target;
503 if (!$$$1(button).hasClass(ClassName.BUTTON)) {
504 button = $$$1(button).closest(Selector.BUTTON);
507 Button._jQueryInterface.call($$$1(button), 'toggle');
508 }).on(Event.FOCUS_BLUR_DATA_API, Selector.DATA_TOGGLE_CARROT, function (event) {
509 var button = $$$1(event.target).closest(Selector.BUTTON)[0];
510 $$$1(button).toggleClass(ClassName.FOCUS, /^focus(in)?$/.test(event.type));
513 * ------------------------------------------------------------------------
515 * ------------------------------------------------------------------------
518 $$$1.fn[NAME] = Button._jQueryInterface;
519 $$$1.fn[NAME].Constructor = Button;
521 $$$1.fn[NAME].noConflict = function () {
522 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
523 return Button._jQueryInterface;
530 * --------------------------------------------------------------------------
531 * Bootstrap (v4.0.0): carousel.js
532 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
533 * --------------------------------------------------------------------------
536 var Carousel = function ($$$1) {
538 * ------------------------------------------------------------------------
540 * ------------------------------------------------------------------------
542 var NAME = 'carousel';
543 var VERSION = '4.0.0';
544 var DATA_KEY = 'bs.carousel';
545 var EVENT_KEY = "." + DATA_KEY;
546 var DATA_API_KEY = '.data-api';
547 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
548 var TRANSITION_DURATION = 600;
549 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
551 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
553 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
563 interval: '(number|boolean)',
565 slide: '(boolean|string)',
566 pause: '(string|boolean)',
576 SLIDE: "slide" + EVENT_KEY,
577 SLID: "slid" + EVENT_KEY,
578 KEYDOWN: "keydown" + EVENT_KEY,
579 MOUSEENTER: "mouseenter" + EVENT_KEY,
580 MOUSELEAVE: "mouseleave" + EVENT_KEY,
581 TOUCHEND: "touchend" + EVENT_KEY,
582 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY,
583 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
586 CAROUSEL: 'carousel',
589 RIGHT: 'carousel-item-right',
590 LEFT: 'carousel-item-left',
591 NEXT: 'carousel-item-next',
592 PREV: 'carousel-item-prev',
593 ITEM: 'carousel-item'
597 ACTIVE_ITEM: '.active.carousel-item',
598 ITEM: '.carousel-item',
599 NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
600 INDICATORS: '.carousel-indicators',
601 DATA_SLIDE: '[data-slide], [data-slide-to]',
602 DATA_RIDE: '[data-ride="carousel"]'
604 * ------------------------------------------------------------------------
606 * ------------------------------------------------------------------------
614 function Carousel(element, config) {
616 this._interval = null;
617 this._activeElement = null;
618 this._isPaused = false;
619 this._isSliding = false;
620 this.touchTimeout = null;
621 this._config = this._getConfig(config);
622 this._element = $$$1(element)[0];
623 this._indicatorsElement = $$$1(this._element).find(Selector.INDICATORS)[0];
625 this._addEventListeners();
629 var _proto = Carousel.prototype;
632 _proto.next = function next() {
633 if (!this._isSliding) {
634 this._slide(Direction.NEXT);
638 _proto.nextWhenVisible = function nextWhenVisible() {
639 // Don't call next when the page isn't visible
640 // or the carousel or its parent isn't visible
641 if (!document.hidden && $$$1(this._element).is(':visible') && $$$1(this._element).css('visibility') !== 'hidden') {
646 _proto.prev = function prev() {
647 if (!this._isSliding) {
648 this._slide(Direction.PREV);
652 _proto.pause = function pause(event) {
654 this._isPaused = true;
657 if ($$$1(this._element).find(Selector.NEXT_PREV)[0] && Util.supportsTransitionEnd()) {
658 Util.triggerTransitionEnd(this._element);
662 clearInterval(this._interval);
663 this._interval = null;
666 _proto.cycle = function cycle(event) {
668 this._isPaused = false;
671 if (this._interval) {
672 clearInterval(this._interval);
673 this._interval = null;
676 if (this._config.interval && !this._isPaused) {
677 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
681 _proto.to = function to(index) {
684 this._activeElement = $$$1(this._element).find(Selector.ACTIVE_ITEM)[0];
686 var activeIndex = this._getItemIndex(this._activeElement);
688 if (index > this._items.length - 1 || index < 0) {
692 if (this._isSliding) {
693 $$$1(this._element).one(Event.SLID, function () {
694 return _this.to(index);
699 if (activeIndex === index) {
705 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
707 this._slide(direction, this._items[index]);
710 _proto.dispose = function dispose() {
711 $$$1(this._element).off(EVENT_KEY);
712 $$$1.removeData(this._element, DATA_KEY);
715 this._element = null;
716 this._interval = null;
717 this._isPaused = null;
718 this._isSliding = null;
719 this._activeElement = null;
720 this._indicatorsElement = null;
724 _proto._getConfig = function _getConfig(config) {
725 config = _extends({}, Default, config);
726 Util.typeCheckConfig(NAME, config, DefaultType);
730 _proto._addEventListeners = function _addEventListeners() {
733 if (this._config.keyboard) {
734 $$$1(this._element).on(Event.KEYDOWN, function (event) {
735 return _this2._keydown(event);
739 if (this._config.pause === 'hover') {
740 $$$1(this._element).on(Event.MOUSEENTER, function (event) {
741 return _this2.pause(event);
742 }).on(Event.MOUSELEAVE, function (event) {
743 return _this2.cycle(event);
746 if ('ontouchstart' in document.documentElement) {
747 // If it's a touch-enabled device, mouseenter/leave are fired as
748 // part of the mouse compatibility events on first tap - the carousel
749 // would stop cycling until user tapped out of it;
750 // here, we listen for touchend, explicitly pause the carousel
751 // (as if it's the second time we tap on it, mouseenter compat event
752 // is NOT fired) and after a timeout (to allow for mouse compatibility
753 // events to fire) we explicitly restart cycling
754 $$$1(this._element).on(Event.TOUCHEND, function () {
757 if (_this2.touchTimeout) {
758 clearTimeout(_this2.touchTimeout);
761 _this2.touchTimeout = setTimeout(function (event) {
762 return _this2.cycle(event);
763 }, TOUCHEVENT_COMPAT_WAIT + _this2._config.interval);
769 _proto._keydown = function _keydown(event) {
770 if (/input|textarea/i.test(event.target.tagName)) {
774 switch (event.which) {
775 case ARROW_LEFT_KEYCODE:
776 event.preventDefault();
780 case ARROW_RIGHT_KEYCODE:
781 event.preventDefault();
789 _proto._getItemIndex = function _getItemIndex(element) {
790 this._items = $$$1.makeArray($$$1(element).parent().find(Selector.ITEM));
791 return this._items.indexOf(element);
794 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
795 var isNextDirection = direction === Direction.NEXT;
796 var isPrevDirection = direction === Direction.PREV;
798 var activeIndex = this._getItemIndex(activeElement);
800 var lastItemIndex = this._items.length - 1;
801 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
803 if (isGoingToWrap && !this._config.wrap) {
804 return activeElement;
807 var delta = direction === Direction.PREV ? -1 : 1;
808 var itemIndex = (activeIndex + delta) % this._items.length;
809 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
812 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
813 var targetIndex = this._getItemIndex(relatedTarget);
815 var fromIndex = this._getItemIndex($$$1(this._element).find(Selector.ACTIVE_ITEM)[0]);
817 var slideEvent = $$$1.Event(Event.SLIDE, {
818 relatedTarget: relatedTarget,
819 direction: eventDirectionName,
823 $$$1(this._element).trigger(slideEvent);
827 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
828 if (this._indicatorsElement) {
829 $$$1(this._indicatorsElement).find(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
831 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
834 $$$1(nextIndicator).addClass(ClassName.ACTIVE);
839 _proto._slide = function _slide(direction, element) {
842 var activeElement = $$$1(this._element).find(Selector.ACTIVE_ITEM)[0];
844 var activeElementIndex = this._getItemIndex(activeElement);
846 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
848 var nextElementIndex = this._getItemIndex(nextElement);
850 var isCycling = Boolean(this._interval);
851 var directionalClassName;
853 var eventDirectionName;
855 if (direction === Direction.NEXT) {
856 directionalClassName = ClassName.LEFT;
857 orderClassName = ClassName.NEXT;
858 eventDirectionName = Direction.LEFT;
860 directionalClassName = ClassName.RIGHT;
861 orderClassName = ClassName.PREV;
862 eventDirectionName = Direction.RIGHT;
865 if (nextElement && $$$1(nextElement).hasClass(ClassName.ACTIVE)) {
866 this._isSliding = false;
870 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
872 if (slideEvent.isDefaultPrevented()) {
876 if (!activeElement || !nextElement) {
877 // Some weirdness is happening, so we bail
881 this._isSliding = true;
887 this._setActiveIndicatorElement(nextElement);
889 var slidEvent = $$$1.Event(Event.SLID, {
890 relatedTarget: nextElement,
891 direction: eventDirectionName,
892 from: activeElementIndex,
896 if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.SLIDE)) {
897 $$$1(nextElement).addClass(orderClassName);
898 Util.reflow(nextElement);
899 $$$1(activeElement).addClass(directionalClassName);
900 $$$1(nextElement).addClass(directionalClassName);
901 $$$1(activeElement).one(Util.TRANSITION_END, function () {
902 $$$1(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName.ACTIVE);
903 $$$1(activeElement).removeClass(ClassName.ACTIVE + " " + orderClassName + " " + directionalClassName);
904 _this3._isSliding = false;
905 setTimeout(function () {
906 return $$$1(_this3._element).trigger(slidEvent);
908 }).emulateTransitionEnd(TRANSITION_DURATION);
910 $$$1(activeElement).removeClass(ClassName.ACTIVE);
911 $$$1(nextElement).addClass(ClassName.ACTIVE);
912 this._isSliding = false;
913 $$$1(this._element).trigger(slidEvent);
922 Carousel._jQueryInterface = function _jQueryInterface(config) {
923 return this.each(function () {
924 var data = $$$1(this).data(DATA_KEY);
926 var _config = _extends({}, Default, $$$1(this).data());
928 if (typeof config === 'object') {
929 _config = _extends({}, _config, config);
932 var action = typeof config === 'string' ? config : _config.slide;
935 data = new Carousel(this, _config);
936 $$$1(this).data(DATA_KEY, data);
939 if (typeof config === 'number') {
941 } else if (typeof action === 'string') {
942 if (typeof data[action] === 'undefined') {
943 throw new TypeError("No method named \"" + action + "\"");
947 } else if (_config.interval) {
954 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
955 var selector = Util.getSelectorFromElement(this);
961 var target = $$$1(selector)[0];
963 if (!target || !$$$1(target).hasClass(ClassName.CAROUSEL)) {
967 var config = _extends({}, $$$1(target).data(), $$$1(this).data());
968 var slideIndex = this.getAttribute('data-slide-to');
971 config.interval = false;
974 Carousel._jQueryInterface.call($$$1(target), config);
977 $$$1(target).data(DATA_KEY).to(slideIndex);
980 event.preventDefault();
983 _createClass(Carousel, null, [{
985 get: function get() {
990 get: function get() {
997 * ------------------------------------------------------------------------
998 * Data Api implementation
999 * ------------------------------------------------------------------------
1003 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_SLIDE, Carousel._dataApiClickHandler);
1004 $$$1(window).on(Event.LOAD_DATA_API, function () {
1005 $$$1(Selector.DATA_RIDE).each(function () {
1006 var $carousel = $$$1(this);
1008 Carousel._jQueryInterface.call($carousel, $carousel.data());
1012 * ------------------------------------------------------------------------
1014 * ------------------------------------------------------------------------
1017 $$$1.fn[NAME] = Carousel._jQueryInterface;
1018 $$$1.fn[NAME].Constructor = Carousel;
1020 $$$1.fn[NAME].noConflict = function () {
1021 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
1022 return Carousel._jQueryInterface;
1029 * --------------------------------------------------------------------------
1030 * Bootstrap (v4.0.0): collapse.js
1031 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1032 * --------------------------------------------------------------------------
1035 var Collapse = function ($$$1) {
1037 * ------------------------------------------------------------------------
1039 * ------------------------------------------------------------------------
1041 var NAME = 'collapse';
1042 var VERSION = '4.0.0';
1043 var DATA_KEY = 'bs.collapse';
1044 var EVENT_KEY = "." + DATA_KEY;
1045 var DATA_API_KEY = '.data-api';
1046 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
1047 var TRANSITION_DURATION = 600;
1054 parent: '(string|element)'
1057 SHOW: "show" + EVENT_KEY,
1058 SHOWN: "shown" + EVENT_KEY,
1059 HIDE: "hide" + EVENT_KEY,
1060 HIDDEN: "hidden" + EVENT_KEY,
1061 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
1065 COLLAPSE: 'collapse',
1066 COLLAPSING: 'collapsing',
1067 COLLAPSED: 'collapsed'
1074 ACTIVES: '.show, .collapsing',
1075 DATA_TOGGLE: '[data-toggle="collapse"]'
1077 * ------------------------------------------------------------------------
1079 * ------------------------------------------------------------------------
1087 function Collapse(element, config) {
1088 this._isTransitioning = false;
1089 this._element = element;
1090 this._config = this._getConfig(config);
1091 this._triggerArray = $$$1.makeArray($$$1("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
1092 var tabToggles = $$$1(Selector.DATA_TOGGLE);
1094 for (var i = 0; i < tabToggles.length; i++) {
1095 var elem = tabToggles[i];
1096 var selector = Util.getSelectorFromElement(elem);
1098 if (selector !== null && $$$1(selector).filter(element).length > 0) {
1099 this._selector = selector;
1101 this._triggerArray.push(elem);
1105 this._parent = this._config.parent ? this._getParent() : null;
1107 if (!this._config.parent) {
1108 this._addAriaAndCollapsedClass(this._element, this._triggerArray);
1111 if (this._config.toggle) {
1117 var _proto = Collapse.prototype;
1120 _proto.toggle = function toggle() {
1121 if ($$$1(this._element).hasClass(ClassName.SHOW)) {
1128 _proto.show = function show() {
1131 if (this._isTransitioning || $$$1(this._element).hasClass(ClassName.SHOW)) {
1139 actives = $$$1.makeArray($$$1(this._parent).find(Selector.ACTIVES).filter("[data-parent=\"" + this._config.parent + "\"]"));
1141 if (actives.length === 0) {
1147 activesData = $$$1(actives).not(this._selector).data(DATA_KEY);
1149 if (activesData && activesData._isTransitioning) {
1154 var startEvent = $$$1.Event(Event.SHOW);
1155 $$$1(this._element).trigger(startEvent);
1157 if (startEvent.isDefaultPrevented()) {
1162 Collapse._jQueryInterface.call($$$1(actives).not(this._selector), 'hide');
1165 $$$1(actives).data(DATA_KEY, null);
1169 var dimension = this._getDimension();
1171 $$$1(this._element).removeClass(ClassName.COLLAPSE).addClass(ClassName.COLLAPSING);
1172 this._element.style[dimension] = 0;
1174 if (this._triggerArray.length > 0) {
1175 $$$1(this._triggerArray).removeClass(ClassName.COLLAPSED).attr('aria-expanded', true);
1178 this.setTransitioning(true);
1180 var complete = function complete() {
1181 $$$1(_this._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).addClass(ClassName.SHOW);
1182 _this._element.style[dimension] = '';
1184 _this.setTransitioning(false);
1186 $$$1(_this._element).trigger(Event.SHOWN);
1189 if (!Util.supportsTransitionEnd()) {
1194 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
1195 var scrollSize = "scroll" + capitalizedDimension;
1196 $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1197 this._element.style[dimension] = this._element[scrollSize] + "px";
1200 _proto.hide = function hide() {
1203 if (this._isTransitioning || !$$$1(this._element).hasClass(ClassName.SHOW)) {
1207 var startEvent = $$$1.Event(Event.HIDE);
1208 $$$1(this._element).trigger(startEvent);
1210 if (startEvent.isDefaultPrevented()) {
1214 var dimension = this._getDimension();
1216 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
1217 Util.reflow(this._element);
1218 $$$1(this._element).addClass(ClassName.COLLAPSING).removeClass(ClassName.COLLAPSE).removeClass(ClassName.SHOW);
1220 if (this._triggerArray.length > 0) {
1221 for (var i = 0; i < this._triggerArray.length; i++) {
1222 var trigger = this._triggerArray[i];
1223 var selector = Util.getSelectorFromElement(trigger);
1225 if (selector !== null) {
1226 var $elem = $$$1(selector);
1228 if (!$elem.hasClass(ClassName.SHOW)) {
1229 $$$1(trigger).addClass(ClassName.COLLAPSED).attr('aria-expanded', false);
1235 this.setTransitioning(true);
1237 var complete = function complete() {
1238 _this2.setTransitioning(false);
1240 $$$1(_this2._element).removeClass(ClassName.COLLAPSING).addClass(ClassName.COLLAPSE).trigger(Event.HIDDEN);
1243 this._element.style[dimension] = '';
1245 if (!Util.supportsTransitionEnd()) {
1250 $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
1253 _proto.setTransitioning = function setTransitioning(isTransitioning) {
1254 this._isTransitioning = isTransitioning;
1257 _proto.dispose = function dispose() {
1258 $$$1.removeData(this._element, DATA_KEY);
1259 this._config = null;
1260 this._parent = null;
1261 this._element = null;
1262 this._triggerArray = null;
1263 this._isTransitioning = null;
1267 _proto._getConfig = function _getConfig(config) {
1268 config = _extends({}, Default, config);
1269 config.toggle = Boolean(config.toggle); // Coerce string values
1271 Util.typeCheckConfig(NAME, config, DefaultType);
1275 _proto._getDimension = function _getDimension() {
1276 var hasWidth = $$$1(this._element).hasClass(Dimension.WIDTH);
1277 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
1280 _proto._getParent = function _getParent() {
1285 if (Util.isElement(this._config.parent)) {
1286 parent = this._config.parent; // It's a jQuery object
1288 if (typeof this._config.parent.jquery !== 'undefined') {
1289 parent = this._config.parent[0];
1292 parent = $$$1(this._config.parent)[0];
1295 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
1296 $$$1(parent).find(selector).each(function (i, element) {
1297 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
1302 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
1304 var isOpen = $$$1(element).hasClass(ClassName.SHOW);
1306 if (triggerArray.length > 0) {
1307 $$$1(triggerArray).toggleClass(ClassName.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
1313 Collapse._getTargetFromElement = function _getTargetFromElement(element) {
1314 var selector = Util.getSelectorFromElement(element);
1315 return selector ? $$$1(selector)[0] : null;
1318 Collapse._jQueryInterface = function _jQueryInterface(config) {
1319 return this.each(function () {
1320 var $this = $$$1(this);
1321 var data = $this.data(DATA_KEY);
1323 var _config = _extends({}, Default, $this.data(), typeof config === 'object' && config);
1325 if (!data && _config.toggle && /show|hide/.test(config)) {
1326 _config.toggle = false;
1330 data = new Collapse(this, _config);
1331 $this.data(DATA_KEY, data);
1334 if (typeof config === 'string') {
1335 if (typeof data[config] === 'undefined') {
1336 throw new TypeError("No method named \"" + config + "\"");
1344 _createClass(Collapse, null, [{
1346 get: function get() {
1351 get: function get() {
1358 * ------------------------------------------------------------------------
1359 * Data Api implementation
1360 * ------------------------------------------------------------------------
1364 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
1365 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
1366 if (event.currentTarget.tagName === 'A') {
1367 event.preventDefault();
1370 var $trigger = $$$1(this);
1371 var selector = Util.getSelectorFromElement(this);
1372 $$$1(selector).each(function () {
1373 var $target = $$$1(this);
1374 var data = $target.data(DATA_KEY);
1375 var config = data ? 'toggle' : $trigger.data();
1377 Collapse._jQueryInterface.call($target, config);
1381 * ------------------------------------------------------------------------
1383 * ------------------------------------------------------------------------
1386 $$$1.fn[NAME] = Collapse._jQueryInterface;
1387 $$$1.fn[NAME].Constructor = Collapse;
1389 $$$1.fn[NAME].noConflict = function () {
1390 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
1391 return Collapse._jQueryInterface;
1398 * @fileOverview Kickass library to create and place poppers near their reference elements.
1401 * Copyright (c) 2016 Federico Zivolo and contributors
1403 * Permission is hereby granted, free of charge, to any person obtaining a copy
1404 * of this software and associated documentation files (the "Software"), to deal
1405 * in the Software without restriction, including without limitation the rights
1406 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1407 * copies of the Software, and to permit persons to whom the Software is
1408 * furnished to do so, subject to the following conditions:
1410 * The above copyright notice and this permission notice shall be included in all
1411 * copies or substantial portions of the Software.
1413 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1414 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1415 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1416 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1417 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1418 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1421 var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
1422 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
1423 var timeoutDuration = 0;
1424 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
1425 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
1426 timeoutDuration = 1;
1431 function microtaskDebounce(fn) {
1433 return function () {
1438 window.Promise.resolve().then(function () {
1445 function taskDebounce(fn) {
1446 var scheduled = false;
1447 return function () {
1450 setTimeout(function () {
1453 }, timeoutDuration);
1458 var supportsMicroTasks = isBrowser && window.Promise;
1461 * Create a debounced version of a method, that's asynchronously deferred
1462 * but called in the minimum time possible.
1465 * @memberof Popper.Utils
1466 * @argument {Function} fn
1467 * @returns {Function}
1469 var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
1472 * Check if the given variable is a function
1474 * @memberof Popper.Utils
1475 * @argument {Any} functionToCheck - variable to check
1476 * @returns {Boolean} answer to: is a function?
1478 function isFunction(functionToCheck) {
1480 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
1484 * Get CSS computed property of the given element
1486 * @memberof Popper.Utils
1487 * @argument {Eement} element
1488 * @argument {String} property
1490 function getStyleComputedProperty(element, property) {
1491 if (element.nodeType !== 1) {
1494 // NOTE: 1 DOM access here
1495 var css = getComputedStyle(element, null);
1496 return property ? css[property] : css;
1500 * Returns the parentNode or the host of the element
1502 * @memberof Popper.Utils
1503 * @argument {Element} element
1504 * @returns {Element} parent
1506 function getParentNode(element) {
1507 if (element.nodeName === 'HTML') {
1510 return element.parentNode || element.host;
1514 * Returns the scrolling parent of the given element
1516 * @memberof Popper.Utils
1517 * @argument {Element} element
1518 * @returns {Element} scroll parent
1520 function getScrollParent(element) {
1521 // Return body, `getScroll` will take care to get the correct `scrollTop` from it
1523 return document.body;
1526 switch (element.nodeName) {
1529 return element.ownerDocument.body;
1531 return element.body;
1534 // Firefox want us to check `-x` and `-y` variations as well
1536 var _getStyleComputedProp = getStyleComputedProperty(element),
1537 overflow = _getStyleComputedProp.overflow,
1538 overflowX = _getStyleComputedProp.overflowX,
1539 overflowY = _getStyleComputedProp.overflowY;
1541 if (/(auto|scroll)/.test(overflow + overflowY + overflowX)) {
1545 return getScrollParent(getParentNode(element));
1549 * Returns the offset parent of the given element
1551 * @memberof Popper.Utils
1552 * @argument {Element} element
1553 * @returns {Element} offset parent
1555 function getOffsetParent(element) {
1556 // NOTE: 1 DOM access here
1557 var offsetParent = element && element.offsetParent;
1558 var nodeName = offsetParent && offsetParent.nodeName;
1560 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
1562 return element.ownerDocument.documentElement;
1565 return document.documentElement;
1568 // .offsetParent will return the closest TD or TABLE in case
1569 // no offsetParent is present, I hate this job...
1570 if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
1571 return getOffsetParent(offsetParent);
1574 return offsetParent;
1577 function isOffsetContainer(element) {
1578 var nodeName = element.nodeName;
1580 if (nodeName === 'BODY') {
1583 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
1587 * Finds the root node (document, shadowDOM root) of the given element
1589 * @memberof Popper.Utils
1590 * @argument {Element} node
1591 * @returns {Element} root node
1593 function getRoot(node) {
1594 if (node.parentNode !== null) {
1595 return getRoot(node.parentNode);
1602 * Finds the offset parent common to the two provided nodes
1604 * @memberof Popper.Utils
1605 * @argument {Element} element1
1606 * @argument {Element} element2
1607 * @returns {Element} common offset parent
1609 function findCommonOffsetParent(element1, element2) {
1610 // This check is needed to avoid errors in case one of the elements isn't defined for any reason
1611 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
1612 return document.documentElement;
1615 // Here we make sure to give as "start" the element that comes first in the DOM
1616 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
1617 var start = order ? element1 : element2;
1618 var end = order ? element2 : element1;
1620 // Get common ancestor container
1621 var range = document.createRange();
1622 range.setStart(start, 0);
1623 range.setEnd(end, 0);
1624 var commonAncestorContainer = range.commonAncestorContainer;
1626 // Both nodes are inside #document
1628 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
1629 if (isOffsetContainer(commonAncestorContainer)) {
1630 return commonAncestorContainer;
1633 return getOffsetParent(commonAncestorContainer);
1636 // one of the nodes is inside shadowDOM, find which one
1637 var element1root = getRoot(element1);
1638 if (element1root.host) {
1639 return findCommonOffsetParent(element1root.host, element2);
1641 return findCommonOffsetParent(element1, getRoot(element2).host);
1646 * Gets the scroll value of the given element in the given side (top and left)
1648 * @memberof Popper.Utils
1649 * @argument {Element} element
1650 * @argument {String} side `top` or `left`
1651 * @returns {number} amount of scrolled pixels
1653 function getScroll(element) {
1654 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
1656 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
1657 var nodeName = element.nodeName;
1659 if (nodeName === 'BODY' || nodeName === 'HTML') {
1660 var html = element.ownerDocument.documentElement;
1661 var scrollingElement = element.ownerDocument.scrollingElement || html;
1662 return scrollingElement[upperSide];
1665 return element[upperSide];
1669 * Sum or subtract the element scroll values (left and top) from a given rect object
1671 * @memberof Popper.Utils
1672 * @param {Object} rect - Rect object you want to change
1673 * @param {HTMLElement} element - The element from the function reads the scroll values
1674 * @param {Boolean} subtract - set to true if you want to subtract the scroll values
1675 * @return {Object} rect - The modifier rect object
1677 function includeScroll(rect, element) {
1678 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1680 var scrollTop = getScroll(element, 'top');
1681 var scrollLeft = getScroll(element, 'left');
1682 var modifier = subtract ? -1 : 1;
1683 rect.top += scrollTop * modifier;
1684 rect.bottom += scrollTop * modifier;
1685 rect.left += scrollLeft * modifier;
1686 rect.right += scrollLeft * modifier;
1691 * Helper to detect borders of a given element
1693 * @memberof Popper.Utils
1694 * @param {CSSStyleDeclaration} styles
1695 * Result of `getStyleComputedProperty` on the given element
1696 * @param {String} axis - `x` or `y`
1697 * @return {number} borders - The borders size of the given axis
1700 function getBordersSize(styles, axis) {
1701 var sideA = axis === 'x' ? 'Left' : 'Top';
1702 var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
1704 return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
1708 * Tells if you are running Internet Explorer 10
1710 * @memberof Popper.Utils
1711 * @returns {Boolean} isIE10
1713 var isIE10 = undefined;
1715 var isIE10$1 = function () {
1716 if (isIE10 === undefined) {
1717 isIE10 = navigator.appVersion.indexOf('MSIE 10') !== -1;
1722 function getSize(axis, body, html, computedStyle) {
1723 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE10$1() ? html['offset' + axis] + computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')] + computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')] : 0);
1726 function getWindowSizes() {
1727 var body = document.body;
1728 var html = document.documentElement;
1729 var computedStyle = isIE10$1() && getComputedStyle(html);
1732 height: getSize('Height', body, html, computedStyle),
1733 width: getSize('Width', body, html, computedStyle)
1737 var classCallCheck = function (instance, Constructor) {
1738 if (!(instance instanceof Constructor)) {
1739 throw new TypeError("Cannot call a class as a function");
1743 var createClass = function () {
1744 function defineProperties(target, props) {
1745 for (var i = 0; i < props.length; i++) {
1746 var descriptor = props[i];
1747 descriptor.enumerable = descriptor.enumerable || false;
1748 descriptor.configurable = true;
1749 if ("value" in descriptor) descriptor.writable = true;
1750 Object.defineProperty(target, descriptor.key, descriptor);
1754 return function (Constructor, protoProps, staticProps) {
1755 if (protoProps) defineProperties(Constructor.prototype, protoProps);
1756 if (staticProps) defineProperties(Constructor, staticProps);
1765 var defineProperty = function (obj, key, value) {
1767 Object.defineProperty(obj, key, {
1780 var _extends$1 = Object.assign || function (target) {
1781 for (var i = 1; i < arguments.length; i++) {
1782 var source = arguments[i];
1784 for (var key in source) {
1785 if (Object.prototype.hasOwnProperty.call(source, key)) {
1786 target[key] = source[key];
1795 * Given element offsets, generate an output similar to getBoundingClientRect
1797 * @memberof Popper.Utils
1798 * @argument {Object} offsets
1799 * @returns {Object} ClientRect like output
1801 function getClientRect(offsets) {
1802 return _extends$1({}, offsets, {
1803 right: offsets.left + offsets.width,
1804 bottom: offsets.top + offsets.height
1809 * Get bounding client rect of given element
1811 * @memberof Popper.Utils
1812 * @param {HTMLElement} element
1813 * @return {Object} client rect
1815 function getBoundingClientRect(element) {
1818 // IE10 10 FIX: Please, don't ask, the element isn't
1819 // considered in DOM in some circumstances...
1820 // This isn't reproducible in IE10 compatibility mode of IE11
1823 rect = element.getBoundingClientRect();
1824 var scrollTop = getScroll(element, 'top');
1825 var scrollLeft = getScroll(element, 'left');
1826 rect.top += scrollTop;
1827 rect.left += scrollLeft;
1828 rect.bottom += scrollTop;
1829 rect.right += scrollLeft;
1832 rect = element.getBoundingClientRect();
1838 width: rect.right - rect.left,
1839 height: rect.bottom - rect.top
1842 // subtract scrollbar size from sizes
1843 var sizes = element.nodeName === 'HTML' ? getWindowSizes() : {};
1844 var width = sizes.width || element.clientWidth || result.right - result.left;
1845 var height = sizes.height || element.clientHeight || result.bottom - result.top;
1847 var horizScrollbar = element.offsetWidth - width;
1848 var vertScrollbar = element.offsetHeight - height;
1850 // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
1851 // we make this check conditional for performance reasons
1852 if (horizScrollbar || vertScrollbar) {
1853 var styles = getStyleComputedProperty(element);
1854 horizScrollbar -= getBordersSize(styles, 'x');
1855 vertScrollbar -= getBordersSize(styles, 'y');
1857 result.width -= horizScrollbar;
1858 result.height -= vertScrollbar;
1861 return getClientRect(result);
1864 function getOffsetRectRelativeToArbitraryNode(children, parent) {
1865 var isIE10 = isIE10$1();
1866 var isHTML = parent.nodeName === 'HTML';
1867 var childrenRect = getBoundingClientRect(children);
1868 var parentRect = getBoundingClientRect(parent);
1869 var scrollParent = getScrollParent(children);
1871 var styles = getStyleComputedProperty(parent);
1872 var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
1873 var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
1875 var offsets = getClientRect({
1876 top: childrenRect.top - parentRect.top - borderTopWidth,
1877 left: childrenRect.left - parentRect.left - borderLeftWidth,
1878 width: childrenRect.width,
1879 height: childrenRect.height
1881 offsets.marginTop = 0;
1882 offsets.marginLeft = 0;
1884 // Subtract margins of documentElement in case it's being used as parent
1885 // we do this only on HTML because it's the only element that behaves
1886 // differently when margins are applied to it. The margins are included in
1887 // the box of the documentElement, in the other cases not.
1888 if (!isIE10 && isHTML) {
1889 var marginTop = parseFloat(styles.marginTop, 10);
1890 var marginLeft = parseFloat(styles.marginLeft, 10);
1892 offsets.top -= borderTopWidth - marginTop;
1893 offsets.bottom -= borderTopWidth - marginTop;
1894 offsets.left -= borderLeftWidth - marginLeft;
1895 offsets.right -= borderLeftWidth - marginLeft;
1897 // Attach marginTop and marginLeft because in some circumstances we may need them
1898 offsets.marginTop = marginTop;
1899 offsets.marginLeft = marginLeft;
1902 if (isIE10 ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
1903 offsets = includeScroll(offsets, parent);
1909 function getViewportOffsetRectRelativeToArtbitraryNode(element) {
1910 var html = element.ownerDocument.documentElement;
1911 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
1912 var width = Math.max(html.clientWidth, window.innerWidth || 0);
1913 var height = Math.max(html.clientHeight, window.innerHeight || 0);
1915 var scrollTop = getScroll(html);
1916 var scrollLeft = getScroll(html, 'left');
1919 top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
1920 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
1925 return getClientRect(offset);
1929 * Check if the given element is fixed or is inside a fixed parent
1931 * @memberof Popper.Utils
1932 * @argument {Element} element
1933 * @argument {Element} customContainer
1934 * @returns {Boolean} answer to "isFixed?"
1936 function isFixed(element) {
1937 var nodeName = element.nodeName;
1938 if (nodeName === 'BODY' || nodeName === 'HTML') {
1941 if (getStyleComputedProperty(element, 'position') === 'fixed') {
1944 return isFixed(getParentNode(element));
1948 * Computed the boundaries limits and return them
1950 * @memberof Popper.Utils
1951 * @param {HTMLElement} popper
1952 * @param {HTMLElement} reference
1953 * @param {number} padding
1954 * @param {HTMLElement} boundariesElement - Element used to define the boundaries
1955 * @returns {Object} Coordinates of the boundaries
1957 function getBoundaries(popper, reference, padding, boundariesElement) {
1958 // NOTE: 1 DOM access here
1959 var boundaries = { top: 0, left: 0 };
1960 var offsetParent = findCommonOffsetParent(popper, reference);
1962 // Handle viewport case
1963 if (boundariesElement === 'viewport') {
1964 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent);
1966 // Handle other cases based on DOM element used as boundaries
1967 var boundariesNode = void 0;
1968 if (boundariesElement === 'scrollParent') {
1969 boundariesNode = getScrollParent(getParentNode(reference));
1970 if (boundariesNode.nodeName === 'BODY') {
1971 boundariesNode = popper.ownerDocument.documentElement;
1973 } else if (boundariesElement === 'window') {
1974 boundariesNode = popper.ownerDocument.documentElement;
1976 boundariesNode = boundariesElement;
1979 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent);
1981 // In case of HTML, we need a different computation
1982 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
1983 var _getWindowSizes = getWindowSizes(),
1984 height = _getWindowSizes.height,
1985 width = _getWindowSizes.width;
1987 boundaries.top += offsets.top - offsets.marginTop;
1988 boundaries.bottom = height + offsets.top;
1989 boundaries.left += offsets.left - offsets.marginLeft;
1990 boundaries.right = width + offsets.left;
1992 // for all the other DOM elements, this one is good
1993 boundaries = offsets;
1998 boundaries.left += padding;
1999 boundaries.top += padding;
2000 boundaries.right -= padding;
2001 boundaries.bottom -= padding;
2006 function getArea(_ref) {
2007 var width = _ref.width,
2008 height = _ref.height;
2010 return width * height;
2014 * Utility used to transform the `auto` placement to the placement with more
2017 * @memberof Popper.Utils
2018 * @argument {Object} data - The data object generated by update method
2019 * @argument {Object} options - Modifiers configuration and options
2020 * @returns {Object} The data object, properly modified
2022 function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
2023 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
2025 if (placement.indexOf('auto') === -1) {
2029 var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
2033 width: boundaries.width,
2034 height: refRect.top - boundaries.top
2037 width: boundaries.right - refRect.right,
2038 height: boundaries.height
2041 width: boundaries.width,
2042 height: boundaries.bottom - refRect.bottom
2045 width: refRect.left - boundaries.left,
2046 height: boundaries.height
2050 var sortedAreas = Object.keys(rects).map(function (key) {
2054 area: getArea(rects[key])
2056 }).sort(function (a, b) {
2057 return b.area - a.area;
2060 var filteredAreas = sortedAreas.filter(function (_ref2) {
2061 var width = _ref2.width,
2062 height = _ref2.height;
2063 return width >= popper.clientWidth && height >= popper.clientHeight;
2066 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
2068 var variation = placement.split('-')[1];
2070 return computedPlacement + (variation ? '-' + variation : '');
2074 * Get offsets to the reference element
2076 * @memberof Popper.Utils
2077 * @param {Object} state
2078 * @param {Element} popper - the popper element
2079 * @param {Element} reference - the reference element (the popper will be relative to this)
2080 * @returns {Object} An object containing the offsets which will be applied to the popper
2082 function getReferenceOffsets(state, popper, reference) {
2083 var commonOffsetParent = findCommonOffsetParent(popper, reference);
2084 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent);
2088 * Get the outer sizes of the given element (offset size + margins)
2090 * @memberof Popper.Utils
2091 * @argument {Element} element
2092 * @returns {Object} object containing width and height properties
2094 function getOuterSizes(element) {
2095 var styles = getComputedStyle(element);
2096 var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
2097 var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
2099 width: element.offsetWidth + y,
2100 height: element.offsetHeight + x
2106 * Get the opposite placement of the given one
2108 * @memberof Popper.Utils
2109 * @argument {String} placement
2110 * @returns {String} flipped placement
2112 function getOppositePlacement(placement) {
2113 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
2114 return placement.replace(/left|right|bottom|top/g, function (matched) {
2115 return hash[matched];
2120 * Get offsets to the popper
2122 * @memberof Popper.Utils
2123 * @param {Object} position - CSS position the Popper will get applied
2124 * @param {HTMLElement} popper - the popper element
2125 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
2126 * @param {String} placement - one of the valid placement options
2127 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
2129 function getPopperOffsets(popper, referenceOffsets, placement) {
2130 placement = placement.split('-')[0];
2132 // Get popper node sizes
2133 var popperRect = getOuterSizes(popper);
2135 // Add position, width and height to our offsets object
2136 var popperOffsets = {
2137 width: popperRect.width,
2138 height: popperRect.height
2141 // depending by the popper placement we have to compute its offsets slightly differently
2142 var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
2143 var mainSide = isHoriz ? 'top' : 'left';
2144 var secondarySide = isHoriz ? 'left' : 'top';
2145 var measurement = isHoriz ? 'height' : 'width';
2146 var secondaryMeasurement = !isHoriz ? 'height' : 'width';
2148 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
2149 if (placement === secondarySide) {
2150 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
2152 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
2155 return popperOffsets;
2159 * Mimics the `find` method of Array
2161 * @memberof Popper.Utils
2162 * @argument {Array} arr
2165 * @returns index or -1
2167 function find(arr, check) {
2168 // use native find if supported
2169 if (Array.prototype.find) {
2170 return arr.find(check);
2173 // use `filter` to obtain the same behavior of `find`
2174 return arr.filter(check)[0];
2178 * Return the index of the matching object
2180 * @memberof Popper.Utils
2181 * @argument {Array} arr
2184 * @returns index or -1
2186 function findIndex(arr, prop, value) {
2187 // use native findIndex if supported
2188 if (Array.prototype.findIndex) {
2189 return arr.findIndex(function (cur) {
2190 return cur[prop] === value;
2194 // use `find` + `indexOf` if `findIndex` isn't supported
2195 var match = find(arr, function (obj) {
2196 return obj[prop] === value;
2198 return arr.indexOf(match);
2202 * Loop trough the list of modifiers and run them in order,
2203 * each of them will then edit the data object.
2205 * @memberof Popper.Utils
2206 * @param {dataObject} data
2207 * @param {Array} modifiers
2208 * @param {String} ends - Optional modifier name used as stopper
2209 * @returns {dataObject}
2211 function runModifiers(modifiers, data, ends) {
2212 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));
2214 modifiersToRun.forEach(function (modifier) {
2215 if (modifier['function']) {
2216 // eslint-disable-line dot-notation
2217 console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
2219 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
2220 if (modifier.enabled && isFunction(fn)) {
2221 // Add properties to offsets to make them a complete clientRect object
2222 // we do this before each modifier to make sure the previous one doesn't
2223 // mess with these values
2224 data.offsets.popper = getClientRect(data.offsets.popper);
2225 data.offsets.reference = getClientRect(data.offsets.reference);
2227 data = fn(data, modifier);
2235 * Updates the position of the popper, computing the new offsets and applying
2236 * the new style.<br />
2237 * Prefer `scheduleUpdate` over `update` because of performance reasons.
2242 // if popper is destroyed, don't perform any further update
2243 if (this.state.isDestroyed) {
2256 // compute reference element offsets
2257 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference);
2259 // compute auto placement, store placement inside the data object,
2260 // modifiers will be able to edit `placement` if needed
2261 // and refer to originalPlacement to know the original value
2262 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
2264 // store the computed placement inside `originalPlacement`
2265 data.originalPlacement = data.placement;
2267 // compute the popper offsets
2268 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
2269 data.offsets.popper.position = 'absolute';
2271 // run the modifiers
2272 data = runModifiers(this.modifiers, data);
2274 // the first `update` will call `onCreate` callback
2275 // the other ones will call `onUpdate` callback
2276 if (!this.state.isCreated) {
2277 this.state.isCreated = true;
2278 this.options.onCreate(data);
2280 this.options.onUpdate(data);
2285 * Helper used to know if the given modifier is enabled.
2287 * @memberof Popper.Utils
2288 * @returns {Boolean}
2290 function isModifierEnabled(modifiers, modifierName) {
2291 return modifiers.some(function (_ref) {
2292 var name = _ref.name,
2293 enabled = _ref.enabled;
2294 return enabled && name === modifierName;
2299 * Get the prefixed supported property name
2301 * @memberof Popper.Utils
2302 * @argument {String} property (camelCase)
2303 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
2305 function getSupportedPropertyName(property) {
2306 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
2307 var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
2309 for (var i = 0; i < prefixes.length - 1; i++) {
2310 var prefix = prefixes[i];
2311 var toCheck = prefix ? '' + prefix + upperProp : property;
2312 if (typeof document.body.style[toCheck] !== 'undefined') {
2320 * Destroy the popper
2324 function destroy() {
2325 this.state.isDestroyed = true;
2327 // touch DOM only if `applyStyle` modifier is enabled
2328 if (isModifierEnabled(this.modifiers, 'applyStyle')) {
2329 this.popper.removeAttribute('x-placement');
2330 this.popper.style.left = '';
2331 this.popper.style.position = '';
2332 this.popper.style.top = '';
2333 this.popper.style[getSupportedPropertyName('transform')] = '';
2336 this.disableEventListeners();
2338 // remove the popper if user explicity asked for the deletion on destroy
2339 // do not use `remove` because IE11 doesn't support it
2340 if (this.options.removeOnDestroy) {
2341 this.popper.parentNode.removeChild(this.popper);
2347 * Get the window associated with the element
2348 * @argument {Element} element
2351 function getWindow(element) {
2352 var ownerDocument = element.ownerDocument;
2353 return ownerDocument ? ownerDocument.defaultView : window;
2356 function attachToScrollParents(scrollParent, event, callback, scrollParents) {
2357 var isBody = scrollParent.nodeName === 'BODY';
2358 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
2359 target.addEventListener(event, callback, { passive: true });
2362 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
2364 scrollParents.push(target);
2368 * Setup needed event listeners used to update the popper position
2370 * @memberof Popper.Utils
2373 function setupEventListeners(reference, options, state, updateBound) {
2374 // Resize event listener on window
2375 state.updateBound = updateBound;
2376 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
2378 // Scroll event listener on scroll parents
2379 var scrollElement = getScrollParent(reference);
2380 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
2381 state.scrollElement = scrollElement;
2382 state.eventsEnabled = true;
2388 * It will add resize/scroll events and start recalculating
2389 * position of the popper element when they are triggered.
2393 function enableEventListeners() {
2394 if (!this.state.eventsEnabled) {
2395 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
2400 * Remove event listeners used to update the popper position
2402 * @memberof Popper.Utils
2405 function removeEventListeners(reference, state) {
2406 // Remove resize event listener on window
2407 getWindow(reference).removeEventListener('resize', state.updateBound);
2409 // Remove scroll event listener on scroll parents
2410 state.scrollParents.forEach(function (target) {
2411 target.removeEventListener('scroll', state.updateBound);
2415 state.updateBound = null;
2416 state.scrollParents = [];
2417 state.scrollElement = null;
2418 state.eventsEnabled = false;
2423 * It will remove resize/scroll events and won't recalculate popper position
2424 * when they are triggered. It also won't trigger onUpdate callback anymore,
2425 * unless you call `update` method manually.
2429 function disableEventListeners() {
2430 if (this.state.eventsEnabled) {
2431 cancelAnimationFrame(this.scheduleUpdate);
2432 this.state = removeEventListeners(this.reference, this.state);
2437 * Tells if a given input is a number
2439 * @memberof Popper.Utils
2440 * @param {*} input to check
2443 function isNumeric(n) {
2444 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
2448 * Set the style to the given popper
2450 * @memberof Popper.Utils
2451 * @argument {Element} element - Element to apply the style to
2452 * @argument {Object} styles
2453 * Object with a list of properties and values which will be applied to the element
2455 function setStyles(element, styles) {
2456 Object.keys(styles).forEach(function (prop) {
2458 // add unit if the value is numeric and is one of the following
2459 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
2462 element.style[prop] = styles[prop] + unit;
2467 * Set the attributes to the given popper
2469 * @memberof Popper.Utils
2470 * @argument {Element} element - Element to apply the attributes to
2471 * @argument {Object} styles
2472 * Object with a list of properties and values which will be applied to the element
2474 function setAttributes(element, attributes) {
2475 Object.keys(attributes).forEach(function (prop) {
2476 var value = attributes[prop];
2477 if (value !== false) {
2478 element.setAttribute(prop, attributes[prop]);
2480 element.removeAttribute(prop);
2487 * @memberof Modifiers
2488 * @argument {Object} data - The data object generated by `update` method
2489 * @argument {Object} data.styles - List of style properties - values to apply to popper element
2490 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
2491 * @argument {Object} options - Modifiers configuration and options
2492 * @returns {Object} The same data object
2494 function applyStyle(data) {
2495 // any property present in `data.styles` will be applied to the popper,
2496 // in this way we can make the 3rd party modifiers add custom styles to it
2497 // Be aware, modifiers could override the properties defined in the previous
2498 // lines of this modifier!
2499 setStyles(data.instance.popper, data.styles);
2501 // any property present in `data.attributes` will be applied to the popper,
2502 // they will be set as HTML attributes of the element
2503 setAttributes(data.instance.popper, data.attributes);
2505 // if arrowElement is defined and arrowStyles has some properties
2506 if (data.arrowElement && Object.keys(data.arrowStyles).length) {
2507 setStyles(data.arrowElement, data.arrowStyles);
2514 * Set the x-placement attribute before everything else because it could be used
2515 * to add margins to the popper margins needs to be calculated to get the
2516 * correct popper offsets.
2518 * @memberof Popper.modifiers
2519 * @param {HTMLElement} reference - The reference element used to position the popper
2520 * @param {HTMLElement} popper - The HTML element used as popper.
2521 * @param {Object} options - Popper.js options
2523 function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
2524 // compute reference element offsets
2525 var referenceOffsets = getReferenceOffsets(state, popper, reference);
2527 // compute auto placement, store placement inside the data object,
2528 // modifiers will be able to edit `placement` if needed
2529 // and refer to originalPlacement to know the original value
2530 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
2532 popper.setAttribute('x-placement', placement);
2534 // Apply `position` to popper before anything else because
2535 // without the position applied we can't guarantee correct computations
2536 setStyles(popper, { position: 'absolute' });
2543 * @memberof Modifiers
2544 * @argument {Object} data - The data object generated by `update` method
2545 * @argument {Object} options - Modifiers configuration and options
2546 * @returns {Object} The data object, properly modified
2548 function computeStyle(data, options) {
2551 var popper = data.offsets.popper;
2553 // Remove this legacy support in Popper.js v2
2555 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
2556 return modifier.name === 'applyStyle';
2558 if (legacyGpuAccelerationOption !== undefined) {
2559 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
2561 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
2563 var offsetParent = getOffsetParent(data.instance.popper);
2564 var offsetParentRect = getBoundingClientRect(offsetParent);
2568 position: popper.position
2571 // floor sides to avoid blurry text
2573 left: Math.floor(popper.left),
2574 top: Math.floor(popper.top),
2575 bottom: Math.floor(popper.bottom),
2576 right: Math.floor(popper.right)
2579 var sideA = x === 'bottom' ? 'top' : 'bottom';
2580 var sideB = y === 'right' ? 'left' : 'right';
2582 // if gpuAcceleration is set to `true` and transform is supported,
2583 // we use `translate3d` to apply the position to the popper we
2584 // automatically use the supported prefixed version if needed
2585 var prefixedProperty = getSupportedPropertyName('transform');
2587 // now, let's make a step back and look at this code closely (wtf?)
2588 // If the content of the popper grows once it's been positioned, it
2589 // may happen that the popper gets misplaced because of the new content
2590 // overflowing its reference element
2591 // To avoid this problem, we provide two options (x and y), which allow
2592 // the consumer to define the offset origin.
2593 // If we position a popper on top of a reference element, we can set
2594 // `x` to `top` to make the popper grow towards its top instead of
2598 if (sideA === 'bottom') {
2599 top = -offsetParentRect.height + offsets.bottom;
2603 if (sideB === 'right') {
2604 left = -offsetParentRect.width + offsets.right;
2606 left = offsets.left;
2608 if (gpuAcceleration && prefixedProperty) {
2609 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
2612 styles.willChange = 'transform';
2614 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
2615 var invertTop = sideA === 'bottom' ? -1 : 1;
2616 var invertLeft = sideB === 'right' ? -1 : 1;
2617 styles[sideA] = top * invertTop;
2618 styles[sideB] = left * invertLeft;
2619 styles.willChange = sideA + ', ' + sideB;
2624 'x-placement': data.placement
2627 // Update `data` attributes, styles and arrowStyles
2628 data.attributes = _extends$1({}, attributes, data.attributes);
2629 data.styles = _extends$1({}, styles, data.styles);
2630 data.arrowStyles = _extends$1({}, data.offsets.arrow, data.arrowStyles);
2636 * Helper used to know if the given modifier depends from another one.<br />
2637 * It checks if the needed modifier is listed and enabled.
2639 * @memberof Popper.Utils
2640 * @param {Array} modifiers - list of modifiers
2641 * @param {String} requestingName - name of requesting modifier
2642 * @param {String} requestedName - name of requested modifier
2643 * @returns {Boolean}
2645 function isModifierRequired(modifiers, requestingName, requestedName) {
2646 var requesting = find(modifiers, function (_ref) {
2647 var name = _ref.name;
2648 return name === requestingName;
2651 var isRequired = !!requesting && modifiers.some(function (modifier) {
2652 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
2656 var _requesting = '`' + requestingName + '`';
2657 var requested = '`' + requestedName + '`';
2658 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
2665 * @memberof Modifiers
2666 * @argument {Object} data - The data object generated by update method
2667 * @argument {Object} options - Modifiers configuration and options
2668 * @returns {Object} The data object, properly modified
2670 function arrow(data, options) {
2671 var _data$offsets$arrow;
2673 // arrow depends on keepTogether in order to work
2674 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
2678 var arrowElement = options.element;
2680 // if arrowElement is a string, suppose it's a CSS selector
2681 if (typeof arrowElement === 'string') {
2682 arrowElement = data.instance.popper.querySelector(arrowElement);
2684 // if arrowElement is not found, don't run the modifier
2685 if (!arrowElement) {
2689 // if the arrowElement isn't a query selector we must check that the
2690 // provided DOM node is child of its popper node
2691 if (!data.instance.popper.contains(arrowElement)) {
2692 console.warn('WARNING: `arrow.element` must be child of its popper element!');
2697 var placement = data.placement.split('-')[0];
2698 var _data$offsets = data.offsets,
2699 popper = _data$offsets.popper,
2700 reference = _data$offsets.reference;
2702 var isVertical = ['left', 'right'].indexOf(placement) !== -1;
2704 var len = isVertical ? 'height' : 'width';
2705 var sideCapitalized = isVertical ? 'Top' : 'Left';
2706 var side = sideCapitalized.toLowerCase();
2707 var altSide = isVertical ? 'left' : 'top';
2708 var opSide = isVertical ? 'bottom' : 'right';
2709 var arrowElementSize = getOuterSizes(arrowElement)[len];
2712 // extends keepTogether behavior making sure the popper and its
2713 // reference have enough pixels in conjuction
2717 if (reference[opSide] - arrowElementSize < popper[side]) {
2718 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
2720 // bottom/right side
2721 if (reference[side] + arrowElementSize > popper[opSide]) {
2722 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
2724 data.offsets.popper = getClientRect(data.offsets.popper);
2726 // compute center of the popper
2727 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
2729 // Compute the sideValue using the updated popper offsets
2730 // take popper margin in account because we don't have this info available
2731 var css = getStyleComputedProperty(data.instance.popper);
2732 var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
2733 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
2734 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
2736 // prevent arrowElement from being placed not contiguously to its popper
2737 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
2739 data.arrowElement = arrowElement;
2740 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
2746 * Get the opposite placement variation of the given one
2748 * @memberof Popper.Utils
2749 * @argument {String} placement variation
2750 * @returns {String} flipped placement variation
2752 function getOppositeVariation(variation) {
2753 if (variation === 'end') {
2755 } else if (variation === 'start') {
2762 * List of accepted placements to use as values of the `placement` option.<br />
2763 * Valid placements are:
2770 * Each placement can have a variation from this list:
2774 * Variations are interpreted easily if you think of them as the left to right
2775 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
2777 * Vertically (`left` and `right`), `start` is top and `end` is bottom.
2779 * Some valid examples are:
2780 * - `top-end` (on top of reference, right aligned)
2781 * - `right-start` (on right of reference, top aligned)
2782 * - `bottom` (on bottom, centered)
2783 * - `auto-right` (on the side with more space available, alignment depends by placement)
2789 * @method placements
2792 var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
2794 // Get rid of `auto` `auto-start` and `auto-end`
2795 var validPlacements = placements.slice(3);
2798 * Given an initial placement, returns all the subsequent placements
2799 * clockwise (or counter-clockwise).
2802 * @memberof Popper.Utils
2803 * @argument {String} placement - A valid placement (it accepts variations)
2804 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
2805 * @returns {Array} placements including their variations
2807 function clockwise(placement) {
2808 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2810 var index = validPlacements.indexOf(placement);
2811 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
2812 return counter ? arr.reverse() : arr;
2817 CLOCKWISE: 'clockwise',
2818 COUNTERCLOCKWISE: 'counterclockwise'
2823 * @memberof Modifiers
2824 * @argument {Object} data - The data object generated by update method
2825 * @argument {Object} options - Modifiers configuration and options
2826 * @returns {Object} The data object, properly modified
2828 function flip(data, options) {
2829 // if `inner` modifier is enabled, we can't use the `flip` modifier
2830 if (isModifierEnabled(data.instance.modifiers, 'inner')) {
2834 if (data.flipped && data.placement === data.originalPlacement) {
2835 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
2839 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement);
2841 var placement = data.placement.split('-')[0];
2842 var placementOpposite = getOppositePlacement(placement);
2843 var variation = data.placement.split('-')[1] || '';
2847 switch (options.behavior) {
2848 case BEHAVIORS.FLIP:
2849 flipOrder = [placement, placementOpposite];
2851 case BEHAVIORS.CLOCKWISE:
2852 flipOrder = clockwise(placement);
2854 case BEHAVIORS.COUNTERCLOCKWISE:
2855 flipOrder = clockwise(placement, true);
2858 flipOrder = options.behavior;
2861 flipOrder.forEach(function (step, index) {
2862 if (placement !== step || flipOrder.length === index + 1) {
2866 placement = data.placement.split('-')[0];
2867 placementOpposite = getOppositePlacement(placement);
2869 var popperOffsets = data.offsets.popper;
2870 var refOffsets = data.offsets.reference;
2872 // using floor because the reference offsets may contain decimals we are not going to consider here
2873 var floor = Math.floor;
2874 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
2876 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
2877 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
2878 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
2879 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
2881 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
2883 // flip the variation if required
2884 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
2885 var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
2887 if (overlapsRef || overflowsBoundaries || flippedVariation) {
2888 // this boolean to detect any flip loop
2889 data.flipped = true;
2891 if (overlapsRef || overflowsBoundaries) {
2892 placement = flipOrder[index + 1];
2895 if (flippedVariation) {
2896 variation = getOppositeVariation(variation);
2899 data.placement = placement + (variation ? '-' + variation : '');
2901 // this object contains `position`, we want to preserve it along with
2902 // any additional property we may add in the future
2903 data.offsets.popper = _extends$1({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
2905 data = runModifiers(data.instance.modifiers, data, 'flip');
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
2918 function keepTogether(data) {
2919 var _data$offsets = data.offsets,
2920 popper = _data$offsets.popper,
2921 reference = _data$offsets.reference;
2923 var placement = data.placement.split('-')[0];
2924 var floor = Math.floor;
2925 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
2926 var side = isVertical ? 'right' : 'bottom';
2927 var opSide = isVertical ? 'left' : 'top';
2928 var measurement = isVertical ? 'width' : 'height';
2930 if (popper[side] < floor(reference[opSide])) {
2931 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
2933 if (popper[opSide] > floor(reference[side])) {
2934 data.offsets.popper[opSide] = floor(reference[side]);
2941 * Converts a string containing value + unit into a px value number
2943 * @memberof {modifiers~offset}
2945 * @argument {String} str - Value + unit string
2946 * @argument {String} measurement - `height` or `width`
2947 * @argument {Object} popperOffsets
2948 * @argument {Object} referenceOffsets
2949 * @returns {Number|String}
2950 * Value in pixels, or original string if no values were extracted
2952 function toValue(str, measurement, popperOffsets, referenceOffsets) {
2953 // separate value from unit
2954 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
2955 var value = +split[1];
2956 var unit = split[2];
2958 // If it's not a number it's an operator, I guess
2963 if (unit.indexOf('%') === 0) {
2964 var element = void 0;
2967 element = popperOffsets;
2972 element = referenceOffsets;
2975 var rect = getClientRect(element);
2976 return rect[measurement] / 100 * value;
2977 } else if (unit === 'vh' || unit === 'vw') {
2978 // if is a vh or vw, we calculate the size based on the viewport
2980 if (unit === 'vh') {
2981 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
2983 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
2985 return size / 100 * value;
2987 // if is an explicit pixel unit, we get rid of the unit and keep the value
2988 // if is an implicit unit, it's px, and we return just the value
2994 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
2996 * @memberof {modifiers~offset}
2998 * @argument {String} offset
2999 * @argument {Object} popperOffsets
3000 * @argument {Object} referenceOffsets
3001 * @argument {String} basePlacement
3002 * @returns {Array} a two cells array with x and y offsets in numbers
3004 function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
3005 var offsets = [0, 0];
3007 // Use height if placement is left or right and index is 0 otherwise use width
3008 // in this way the first offset will use an axis and the second one
3009 // will use the other one
3010 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
3012 // Split the offset string to obtain a list of values and operands
3013 // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
3014 var fragments = offset.split(/(\+|\-)/).map(function (frag) {
3018 // Detect if the offset string contains a pair of values or a single one
3019 // they could be separated by comma or space
3020 var divider = fragments.indexOf(find(fragments, function (frag) {
3021 return frag.search(/,|\s/) !== -1;
3024 if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
3025 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
3028 // If divider is found, we divide the list of values and operands to divide
3029 // them by ofset X and Y.
3030 var splitRegex = /\s*,\s*|\s+/;
3031 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
3033 // Convert the values with units to absolute pixels to allow our computations
3034 ops = ops.map(function (op, index) {
3035 // Most of the units rely on the orientation of the popper
3036 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
3037 var mergeWithPrevious = false;
3039 // This aggregates any `+` or `-` sign that aren't considered operators
3040 // e.g.: 10 + +5 => [10, +, +5]
3041 .reduce(function (a, b) {
3042 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
3043 a[a.length - 1] = b;
3044 mergeWithPrevious = true;
3046 } else if (mergeWithPrevious) {
3047 a[a.length - 1] += b;
3048 mergeWithPrevious = false;
3054 // Here we convert the string values into number values (in px)
3055 .map(function (str) {
3056 return toValue(str, measurement, popperOffsets, referenceOffsets);
3060 // Loop trough the offsets arrays and execute the operations
3061 ops.forEach(function (op, index) {
3062 op.forEach(function (frag, index2) {
3063 if (isNumeric(frag)) {
3064 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
3073 * @memberof Modifiers
3074 * @argument {Object} data - The data object generated by update method
3075 * @argument {Object} options - Modifiers configuration and options
3076 * @argument {Number|String} options.offset=0
3077 * The offset value as described in the modifier description
3078 * @returns {Object} The data object, properly modified
3080 function offset(data, _ref) {
3081 var offset = _ref.offset;
3082 var placement = data.placement,
3083 _data$offsets = data.offsets,
3084 popper = _data$offsets.popper,
3085 reference = _data$offsets.reference;
3087 var basePlacement = placement.split('-')[0];
3089 var offsets = void 0;
3090 if (isNumeric(+offset)) {
3091 offsets = [+offset, 0];
3093 offsets = parseOffset(offset, popper, reference, basePlacement);
3096 if (basePlacement === 'left') {
3097 popper.top += offsets[0];
3098 popper.left -= offsets[1];
3099 } else if (basePlacement === 'right') {
3100 popper.top += offsets[0];
3101 popper.left += offsets[1];
3102 } else if (basePlacement === 'top') {
3103 popper.left += offsets[0];
3104 popper.top -= offsets[1];
3105 } else if (basePlacement === 'bottom') {
3106 popper.left += offsets[0];
3107 popper.top += offsets[1];
3110 data.popper = popper;
3116 * @memberof Modifiers
3117 * @argument {Object} data - The data object generated by `update` method
3118 * @argument {Object} options - Modifiers configuration and options
3119 * @returns {Object} The data object, properly modified
3121 function preventOverflow(data, options) {
3122 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);
3124 // If offsetParent is the reference element, we really want to
3125 // go one step up and use the next offsetParent as reference to
3126 // avoid to make this modifier completely useless and look like broken
3127 if (data.instance.reference === boundariesElement) {
3128 boundariesElement = getOffsetParent(boundariesElement);
3131 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement);
3132 options.boundaries = boundaries;
3134 var order = options.priority;
3135 var popper = data.offsets.popper;
3138 primary: function primary(placement) {
3139 var value = popper[placement];
3140 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
3141 value = Math.max(popper[placement], boundaries[placement]);
3143 return defineProperty({}, placement, value);
3145 secondary: function secondary(placement) {
3146 var mainSide = placement === 'right' ? 'left' : 'top';
3147 var value = popper[mainSide];
3148 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
3149 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
3151 return defineProperty({}, mainSide, value);
3155 order.forEach(function (placement) {
3156 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
3157 popper = _extends$1({}, popper, check[side](placement));
3160 data.offsets.popper = popper;
3167 * @memberof Modifiers
3168 * @argument {Object} data - The data object generated by `update` method
3169 * @argument {Object} options - Modifiers configuration and options
3170 * @returns {Object} The data object, properly modified
3172 function shift(data) {
3173 var placement = data.placement;
3174 var basePlacement = placement.split('-')[0];
3175 var shiftvariation = placement.split('-')[1];
3177 // if shift shiftvariation is specified, run the modifier
3178 if (shiftvariation) {
3179 var _data$offsets = data.offsets,
3180 reference = _data$offsets.reference,
3181 popper = _data$offsets.popper;
3183 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
3184 var side = isVertical ? 'left' : 'top';
3185 var measurement = isVertical ? 'width' : 'height';
3187 var shiftOffsets = {
3188 start: defineProperty({}, side, reference[side]),
3189 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
3192 data.offsets.popper = _extends$1({}, popper, shiftOffsets[shiftvariation]);
3200 * @memberof Modifiers
3201 * @argument {Object} data - The data object generated by update method
3202 * @argument {Object} options - Modifiers configuration and options
3203 * @returns {Object} The data object, properly modified
3205 function hide(data) {
3206 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
3210 var refRect = data.offsets.reference;
3211 var bound = find(data.instance.modifiers, function (modifier) {
3212 return modifier.name === 'preventOverflow';
3215 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
3216 // Avoid unnecessary DOM access if visibility hasn't changed
3217 if (data.hide === true) {
3222 data.attributes['x-out-of-boundaries'] = '';
3224 // Avoid unnecessary DOM access if visibility hasn't changed
3225 if (data.hide === false) {
3230 data.attributes['x-out-of-boundaries'] = false;
3238 * @memberof Modifiers
3239 * @argument {Object} data - The data object generated by `update` method
3240 * @argument {Object} options - Modifiers configuration and options
3241 * @returns {Object} The data object, properly modified
3243 function inner(data) {
3244 var placement = data.placement;
3245 var basePlacement = placement.split('-')[0];
3246 var _data$offsets = data.offsets,
3247 popper = _data$offsets.popper,
3248 reference = _data$offsets.reference;
3250 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
3252 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
3254 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
3256 data.placement = getOppositePlacement(placement);
3257 data.offsets.popper = getClientRect(popper);
3263 * Modifier function, each modifier can have a function of this type assigned
3264 * to its `fn` property.<br />
3265 * These functions will be called on each update, this means that you must
3266 * make sure they are performant enough to avoid performance bottlenecks.
3268 * @function ModifierFn
3269 * @argument {dataObject} data - The data object generated by `update` method
3270 * @argument {Object} options - Modifiers configuration and options
3271 * @returns {dataObject} The data object, properly modified
3275 * Modifiers are plugins used to alter the behavior of your poppers.<br />
3276 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
3277 * needed by the library.
3279 * Usually you don't want to override the `order`, `fn` and `onLoad` props.
3280 * All the other properties are configurations that could be tweaked.
3281 * @namespace modifiers
3285 * Modifier used to shift the popper on the start or end of its reference
3287 * It will read the variation of the `placement` property.<br />
3288 * It can be one either `-end` or `-start`.
3289 * @memberof modifiers
3293 /** @prop {number} order=100 - Index used to define the order of execution */
3295 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3297 /** @prop {ModifierFn} */
3302 * The `offset` modifier can shift your popper on both its axis.
3304 * It accepts the following units:
3305 * - `px` or unitless, interpreted as pixels
3306 * - `%` or `%r`, percentage relative to the length of the reference element
3307 * - `%p`, percentage relative to the length of the popper element
3308 * - `vw`, CSS viewport width unit
3309 * - `vh`, CSS viewport height unit
3311 * For length is intended the main axis relative to the placement of the popper.<br />
3312 * This means that if the placement is `top` or `bottom`, the length will be the
3313 * `width`. In case of `left` or `right`, it will be the height.
3315 * You can provide a single value (as `Number` or `String`), or a pair of values
3316 * as `String` divided by a comma or one (or more) white spaces.<br />
3317 * The latter is a deprecated method because it leads to confusion and will be
3318 * removed in v2.<br />
3319 * Additionally, it accepts additions and subtractions between different units.
3320 * Note that multiplications and divisions aren't supported.
3322 * Valid examples are:
3330 * '-10px + 5vh, 5px - 6%'
3332 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
3333 * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
3334 * > More on this [reading this issue](https://github.com/FezVrasta/popper.js/issues/373)
3336 * @memberof modifiers
3340 /** @prop {number} order=200 - Index used to define the order of execution */
3342 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3344 /** @prop {ModifierFn} */
3346 /** @prop {Number|String} offset=0
3347 * The offset value as described in the modifier description
3353 * Modifier used to prevent the popper from being positioned outside the boundary.
3355 * An scenario exists where the reference itself is not within the boundaries.<br />
3356 * We can say it has "escaped the boundaries" — or just "escaped".<br />
3357 * In this case we need to decide whether the popper should either:
3359 * - detach from the reference and remain "trapped" in the boundaries, or
3360 * - if it should ignore the boundary and "escape with its reference"
3362 * When `escapeWithReference` is set to`true` and reference is completely
3363 * outside its boundaries, the popper will overflow (or completely leave)
3364 * the boundaries in order to remain attached to the edge of the reference.
3366 * @memberof modifiers
3370 /** @prop {number} order=300 - Index used to define the order of execution */
3372 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3374 /** @prop {ModifierFn} */
3375 fn: preventOverflow,
3377 * @prop {Array} [priority=['left','right','top','bottom']]
3378 * Popper will try to prevent overflow following these priorities by default,
3379 * then, it could overflow on the left and on top of the `boundariesElement`
3381 priority: ['left', 'right', 'top', 'bottom'],
3383 * @prop {number} padding=5
3384 * Amount of pixel used to define a minimum distance between the boundaries
3385 * and the popper this makes sure the popper has always a little padding
3386 * between the edges of its container
3390 * @prop {String|HTMLElement} boundariesElement='scrollParent'
3391 * Boundaries used by the modifier, can be `scrollParent`, `window`,
3392 * `viewport` or any DOM element.
3394 boundariesElement: 'scrollParent'
3398 * Modifier used to make sure the reference and its popper stay near eachothers
3399 * without leaving any gap between the two. Expecially useful when the arrow is
3400 * enabled and you want to assure it to point to its reference element.
3401 * It cares only about the first axis, you can still have poppers with margin
3402 * between the popper and its reference element.
3403 * @memberof modifiers
3407 /** @prop {number} order=400 - Index used to define the order of execution */
3409 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3411 /** @prop {ModifierFn} */
3416 * This modifier is used to move the `arrowElement` of the popper to make
3417 * sure it is positioned between the reference element and its popper element.
3418 * It will read the outer size of the `arrowElement` node to detect how many
3419 * pixels of conjuction are needed.
3421 * It has no effect if no `arrowElement` is provided.
3422 * @memberof modifiers
3426 /** @prop {number} order=500 - Index used to define the order of execution */
3428 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3430 /** @prop {ModifierFn} */
3432 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
3433 element: '[x-arrow]'
3437 * Modifier used to flip the popper's placement when it starts to overlap its
3438 * reference element.
3440 * Requires the `preventOverflow` modifier before it in order to work.
3442 * **NOTE:** this modifier will interrupt the current update cycle and will
3443 * restart it if it detects the need to flip the placement.
3444 * @memberof modifiers
3448 /** @prop {number} order=600 - Index used to define the order of execution */
3450 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3452 /** @prop {ModifierFn} */
3455 * @prop {String|Array} behavior='flip'
3456 * The behavior used to change the popper's placement. It can be one of
3457 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
3458 * placements (with optional variations).
3462 * @prop {number} padding=5
3463 * The popper will flip if it hits the edges of the `boundariesElement`
3467 * @prop {String|HTMLElement} boundariesElement='viewport'
3468 * The element which will define the boundaries of the popper position,
3469 * the popper will never be placed outside of the defined boundaries
3470 * (except if keepTogether is enabled)
3472 boundariesElement: 'viewport'
3476 * Modifier used to make the popper flow toward the inner of the reference element.
3477 * By default, when this modifier is disabled, the popper will be placed outside
3478 * the reference element.
3479 * @memberof modifiers
3483 /** @prop {number} order=700 - Index used to define the order of execution */
3485 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
3487 /** @prop {ModifierFn} */
3492 * Modifier used to hide the popper when its reference element is outside of the
3493 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
3494 * be used to hide with a CSS selector the popper when its reference is
3495 * out of boundaries.
3497 * Requires the `preventOverflow` modifier before it in order to work.
3498 * @memberof modifiers
3502 /** @prop {number} order=800 - Index used to define the order of execution */
3504 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3506 /** @prop {ModifierFn} */
3511 * Computes the style that will be applied to the popper element to gets
3512 * properly positioned.
3514 * Note that this modifier will not touch the DOM, it just prepares the styles
3515 * so that `applyStyle` modifier can apply it. This separation is useful
3516 * in case you need to replace `applyStyle` with a custom implementation.
3518 * This modifier has `850` as `order` value to maintain backward compatibility
3519 * with previous versions of Popper.js. Expect the modifiers ordering method
3520 * to change in future major versions of the library.
3522 * @memberof modifiers
3526 /** @prop {number} order=850 - Index used to define the order of execution */
3528 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3530 /** @prop {ModifierFn} */
3533 * @prop {Boolean} gpuAcceleration=true
3534 * If true, it uses the CSS 3d transformation to position the popper.
3535 * Otherwise, it will use the `top` and `left` properties.
3537 gpuAcceleration: true,
3539 * @prop {string} [x='bottom']
3540 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
3541 * Change this if your popper should grow in a direction different from `bottom`
3545 * @prop {string} [x='left']
3546 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
3547 * Change this if your popper should grow in a direction different from `right`
3553 * Applies the computed styles to the popper element.
3555 * All the DOM manipulations are limited to this modifier. This is useful in case
3556 * you want to integrate Popper.js inside a framework or view library and you
3557 * want to delegate all the DOM manipulations to it.
3559 * Note that if you disable this modifier, you must make sure the popper element
3560 * has its position set to `absolute` before Popper.js can do its work!
3562 * Just disable this modifier and define you own to achieve the desired effect.
3564 * @memberof modifiers
3568 /** @prop {number} order=900 - Index used to define the order of execution */
3570 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
3572 /** @prop {ModifierFn} */
3574 /** @prop {Function} */
3575 onLoad: applyStyleOnLoad,
3577 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
3578 * @prop {Boolean} gpuAcceleration=true
3579 * If true, it uses the CSS 3d transformation to position the popper.
3580 * Otherwise, it will use the `top` and `left` properties.
3582 gpuAcceleration: undefined
3587 * The `dataObject` is an object containing all the informations used by Popper.js
3588 * this object get passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
3590 * @property {Object} data.instance The Popper.js instance
3591 * @property {String} data.placement Placement applied to popper
3592 * @property {String} data.originalPlacement Placement originally defined on init
3593 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
3594 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper.
3595 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
3596 * @property {Object} data.styles Any CSS property defined here will be applied to the popper, it expects the JavaScript nomenclature (eg. `marginBottom`)
3597 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow, it expects the JavaScript nomenclature (eg. `marginBottom`)
3598 * @property {Object} data.boundaries Offsets of the popper boundaries
3599 * @property {Object} data.offsets The measurements of popper, reference and arrow elements.
3600 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
3601 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
3602 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
3606 * Default options provided to Popper.js constructor.<br />
3607 * These can be overriden using the `options` argument of Popper.js.<br />
3608 * To override an option, simply pass as 3rd argument an object with the same
3609 * structure of this object, example:
3611 * new Popper(ref, pop, {
3613 * preventOverflow: { enabled: false }
3623 * Popper's placement
3624 * @prop {Popper.placements} placement='bottom'
3626 placement: 'bottom',
3629 * Whether events (resize, scroll) are initially enabled
3630 * @prop {Boolean} eventsEnabled=true
3632 eventsEnabled: true,
3635 * Set to true if you want to automatically remove the popper when
3636 * you call the `destroy` method.
3637 * @prop {Boolean} removeOnDestroy=false
3639 removeOnDestroy: false,
3642 * Callback called when the popper is created.<br />
3643 * By default, is set to no-op.<br />
3644 * Access Popper.js instance with `data.instance`.
3647 onCreate: function onCreate() {},
3650 * Callback called when the popper is updated, this callback is not called
3651 * on the initialization/creation of the popper, but only on subsequent
3653 * By default, is set to no-op.<br />
3654 * Access Popper.js instance with `data.instance`.
3657 onUpdate: function onUpdate() {},
3660 * List of modifiers used to modify the offsets before they are applied to the popper.
3661 * They provide most of the functionalities of Popper.js
3664 modifiers: modifiers
3668 * @callback onCreate
3669 * @param {dataObject} data
3673 * @callback onUpdate
3674 * @param {dataObject} data
3679 var Popper = function () {
3681 * Create a new Popper.js instance
3683 * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
3684 * @param {HTMLElement} popper - The HTML element used as popper.
3685 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
3686 * @return {Object} instance - The generated Popper.js instance
3688 function Popper(reference, popper) {
3691 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3692 classCallCheck(this, Popper);
3694 this.scheduleUpdate = function () {
3695 return requestAnimationFrame(_this.update);
3698 // make update() debounced, so that it only runs at most once-per-tick
3699 this.update = debounce(this.update.bind(this));
3701 // with {} we create a new object with the options inside it
3702 this.options = _extends$1({}, Popper.Defaults, options);
3711 // get reference and popper elements (allow jQuery wrappers)
3712 this.reference = reference && reference.jquery ? reference[0] : reference;
3713 this.popper = popper && popper.jquery ? popper[0] : popper;
3715 // Deep merge modifiers options
3716 this.options.modifiers = {};
3717 Object.keys(_extends$1({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
3718 _this.options.modifiers[name] = _extends$1({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
3721 // Refactoring modifiers' list (Object => Array)
3722 this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
3725 }, _this.options.modifiers[name]);
3727 // sort the modifiers by order
3728 .sort(function (a, b) {
3729 return a.order - b.order;
3732 // modifiers have the ability to execute arbitrary code when Popper.js get inited
3733 // such code is executed in the same order of its modifier
3734 // they could add new properties to their options configuration
3735 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
3736 this.modifiers.forEach(function (modifierOptions) {
3737 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
3738 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
3742 // fire the first update to position the popper in the right place
3745 var eventsEnabled = this.options.eventsEnabled;
3746 if (eventsEnabled) {
3747 // setup event listeners, they will take care of update the position in specific situations
3748 this.enableEventListeners();
3751 this.state.eventsEnabled = eventsEnabled;
3754 // We can't use class properties because they don't get listed in the
3755 // class prototype and break stuff like Sinon stubs
3758 createClass(Popper, [{
3760 value: function update$$1() {
3761 return update.call(this);
3765 value: function destroy$$1() {
3766 return destroy.call(this);
3769 key: 'enableEventListeners',
3770 value: function enableEventListeners$$1() {
3771 return enableEventListeners.call(this);
3774 key: 'disableEventListeners',
3775 value: function disableEventListeners$$1() {
3776 return disableEventListeners.call(this);
3780 * Schedule an update, it will run on the next UI update available
3781 * @method scheduleUpdate
3787 * Collection of utilities useful when writing custom modifiers.
3788 * Starting from version 1.7, this method is available only if you
3789 * include `popper-utils.js` before `popper.js`.
3791 * **DEPRECATION**: This way to access PopperUtils is deprecated
3792 * and will be removed in v2! Use the PopperUtils module directly instead.
3793 * Due to the high instability of the methods contained in Utils, we can't
3794 * guarantee them to follow semver. Use them at your own risk!
3798 * @deprecated since version 1.8
3808 * The `referenceObject` is an object that provides an interface compatible with Popper.js
3809 * and lets you use it as replacement of a real DOM node.<br />
3810 * You can use this method to position a popper relatively to a set of coordinates
3811 * in case you don't have a DOM node to use as reference.
3814 * new Popper(referenceObject, popperNode);
3817 * NB: This feature isn't supported in Internet Explorer 10
3818 * @name referenceObject
3819 * @property {Function} data.getBoundingClientRect
3820 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
3821 * @property {number} data.clientWidth
3822 * An ES6 getter that will return the width of the virtual reference element.
3823 * @property {number} data.clientHeight
3824 * An ES6 getter that will return the height of the virtual reference element.
3828 Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
3829 Popper.placements = placements;
3830 Popper.Defaults = Defaults;
3833 * --------------------------------------------------------------------------
3834 * Bootstrap (v4.0.0): dropdown.js
3835 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
3836 * --------------------------------------------------------------------------
3839 var Dropdown = function ($$$1) {
3841 * ------------------------------------------------------------------------
3843 * ------------------------------------------------------------------------
3845 var NAME = 'dropdown';
3846 var VERSION = '4.0.0';
3847 var DATA_KEY = 'bs.dropdown';
3848 var EVENT_KEY = "." + DATA_KEY;
3849 var DATA_API_KEY = '.data-api';
3850 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
3851 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
3853 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
3855 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
3857 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
3859 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
3861 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
3863 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
3865 HIDE: "hide" + EVENT_KEY,
3866 HIDDEN: "hidden" + EVENT_KEY,
3867 SHOW: "show" + EVENT_KEY,
3868 SHOWN: "shown" + EVENT_KEY,
3869 CLICK: "click" + EVENT_KEY,
3870 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY,
3871 KEYDOWN_DATA_API: "keydown" + EVENT_KEY + DATA_API_KEY,
3872 KEYUP_DATA_API: "keyup" + EVENT_KEY + DATA_API_KEY
3875 DISABLED: 'disabled',
3878 DROPRIGHT: 'dropright',
3879 DROPLEFT: 'dropleft',
3880 MENURIGHT: 'dropdown-menu-right',
3881 MENULEFT: 'dropdown-menu-left',
3882 POSITION_STATIC: 'position-static'
3885 DATA_TOGGLE: '[data-toggle="dropdown"]',
3886 FORM_CHILD: '.dropdown form',
3887 MENU: '.dropdown-menu',
3888 NAVBAR_NAV: '.navbar-nav',
3889 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled)'
3891 var AttachmentMap = {
3894 BOTTOM: 'bottom-start',
3895 BOTTOMEND: 'bottom-end',
3896 RIGHT: 'right-start',
3897 RIGHTEND: 'right-end',
3904 boundary: 'scrollParent'
3907 offset: '(number|string|function)',
3909 boundary: '(string|element)'
3911 * ------------------------------------------------------------------------
3913 * ------------------------------------------------------------------------
3921 function Dropdown(element, config) {
3922 this._element = element;
3923 this._popper = null;
3924 this._config = this._getConfig(config);
3925 this._menu = this._getMenuElement();
3926 this._inNavbar = this._detectNavbar();
3928 this._addEventListeners();
3932 var _proto = Dropdown.prototype;
3935 _proto.toggle = function toggle() {
3936 if (this._element.disabled || $$$1(this._element).hasClass(ClassName.DISABLED)) {
3940 var parent = Dropdown._getParentFromElement(this._element);
3942 var isActive = $$$1(this._menu).hasClass(ClassName.SHOW);
3944 Dropdown._clearMenus();
3950 var relatedTarget = {
3951 relatedTarget: this._element
3953 var showEvent = $$$1.Event(Event.SHOW, relatedTarget);
3954 $$$1(parent).trigger(showEvent);
3956 if (showEvent.isDefaultPrevented()) {
3958 } // Disable totally Popper.js for Dropdown in Navbar
3961 if (!this._inNavbar) {
3963 * Check for Popper dependency
3964 * Popper - https://popper.js.org
3966 if (typeof Popper === 'undefined') {
3967 throw new TypeError('Bootstrap dropdown require Popper.js (https://popper.js.org)');
3970 var element = this._element; // For dropup with alignment we use the parent as popper container
3972 if ($$$1(parent).hasClass(ClassName.DROPUP)) {
3973 if ($$$1(this._menu).hasClass(ClassName.MENULEFT) || $$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
3976 } // If boundary is not `scrollParent`, then set position to `static`
3977 // to allow the menu to "escape" the scroll parent's boundaries
3978 // https://github.com/twbs/bootstrap/issues/24251
3981 if (this._config.boundary !== 'scrollParent') {
3982 $$$1(parent).addClass(ClassName.POSITION_STATIC);
3985 this._popper = new Popper(element, this._menu, this._getPopperConfig());
3986 } // If this is a touch-enabled device we add extra
3987 // empty mouseover listeners to the body's immediate children;
3988 // only needed because of broken event delegation on iOS
3989 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
3992 if ('ontouchstart' in document.documentElement && $$$1(parent).closest(Selector.NAVBAR_NAV).length === 0) {
3993 $$$1('body').children().on('mouseover', null, $$$1.noop);
3996 this._element.focus();
3998 this._element.setAttribute('aria-expanded', true);
4000 $$$1(this._menu).toggleClass(ClassName.SHOW);
4001 $$$1(parent).toggleClass(ClassName.SHOW).trigger($$$1.Event(Event.SHOWN, relatedTarget));
4004 _proto.dispose = function dispose() {
4005 $$$1.removeData(this._element, DATA_KEY);
4006 $$$1(this._element).off(EVENT_KEY);
4007 this._element = null;
4010 if (this._popper !== null) {
4011 this._popper.destroy();
4013 this._popper = null;
4017 _proto.update = function update() {
4018 this._inNavbar = this._detectNavbar();
4020 if (this._popper !== null) {
4021 this._popper.scheduleUpdate();
4026 _proto._addEventListeners = function _addEventListeners() {
4029 $$$1(this._element).on(Event.CLICK, function (event) {
4030 event.preventDefault();
4031 event.stopPropagation();
4037 _proto._getConfig = function _getConfig(config) {
4038 config = _extends({}, this.constructor.Default, $$$1(this._element).data(), config);
4039 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
4043 _proto._getMenuElement = function _getMenuElement() {
4045 var parent = Dropdown._getParentFromElement(this._element);
4047 this._menu = $$$1(parent).find(Selector.MENU)[0];
4053 _proto._getPlacement = function _getPlacement() {
4054 var $parentDropdown = $$$1(this._element).parent();
4055 var placement = AttachmentMap.BOTTOM; // Handle dropup
4057 if ($parentDropdown.hasClass(ClassName.DROPUP)) {
4058 placement = AttachmentMap.TOP;
4060 if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
4061 placement = AttachmentMap.TOPEND;
4063 } else if ($parentDropdown.hasClass(ClassName.DROPRIGHT)) {
4064 placement = AttachmentMap.RIGHT;
4065 } else if ($parentDropdown.hasClass(ClassName.DROPLEFT)) {
4066 placement = AttachmentMap.LEFT;
4067 } else if ($$$1(this._menu).hasClass(ClassName.MENURIGHT)) {
4068 placement = AttachmentMap.BOTTOMEND;
4074 _proto._detectNavbar = function _detectNavbar() {
4075 return $$$1(this._element).closest('.navbar').length > 0;
4078 _proto._getPopperConfig = function _getPopperConfig() {
4081 var offsetConf = {};
4083 if (typeof this._config.offset === 'function') {
4084 offsetConf.fn = function (data) {
4085 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets) || {});
4089 offsetConf.offset = this._config.offset;
4092 var popperConfig = {
4093 placement: this._getPlacement(),
4097 enabled: this._config.flip
4100 boundariesElement: this._config.boundary
4104 return popperConfig;
4108 Dropdown._jQueryInterface = function _jQueryInterface(config) {
4109 return this.each(function () {
4110 var data = $$$1(this).data(DATA_KEY);
4112 var _config = typeof config === 'object' ? config : null;
4115 data = new Dropdown(this, _config);
4116 $$$1(this).data(DATA_KEY, data);
4119 if (typeof config === 'string') {
4120 if (typeof data[config] === 'undefined') {
4121 throw new TypeError("No method named \"" + config + "\"");
4129 Dropdown._clearMenus = function _clearMenus(event) {
4130 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
4134 var toggles = $$$1.makeArray($$$1(Selector.DATA_TOGGLE));
4136 for (var i = 0; i < toggles.length; i++) {
4137 var parent = Dropdown._getParentFromElement(toggles[i]);
4139 var context = $$$1(toggles[i]).data(DATA_KEY);
4140 var relatedTarget = {
4141 relatedTarget: toggles[i]
4148 var dropdownMenu = context._menu;
4150 if (!$$$1(parent).hasClass(ClassName.SHOW)) {
4154 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $$$1.contains(parent, event.target)) {
4158 var hideEvent = $$$1.Event(Event.HIDE, relatedTarget);
4159 $$$1(parent).trigger(hideEvent);
4161 if (hideEvent.isDefaultPrevented()) {
4163 } // If this is a touch-enabled device we remove the extra
4164 // empty mouseover listeners we added for iOS support
4167 if ('ontouchstart' in document.documentElement) {
4168 $$$1('body').children().off('mouseover', null, $$$1.noop);
4171 toggles[i].setAttribute('aria-expanded', 'false');
4172 $$$1(dropdownMenu).removeClass(ClassName.SHOW);
4173 $$$1(parent).removeClass(ClassName.SHOW).trigger($$$1.Event(Event.HIDDEN, relatedTarget));
4177 Dropdown._getParentFromElement = function _getParentFromElement(element) {
4179 var selector = Util.getSelectorFromElement(element);
4182 parent = $$$1(selector)[0];
4185 return parent || element.parentNode;
4186 }; // eslint-disable-next-line complexity
4189 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
4190 // If not input/textarea:
4191 // - And not a key in REGEXP_KEYDOWN => not a dropdown command
4192 // If input/textarea:
4193 // - If space key => not a dropdown command
4194 // - If key is other than escape
4195 // - If key is not up or down => not a dropdown command
4196 // - If trigger inside the menu => not a dropdown command
4197 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $$$1(event.target).closest(Selector.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
4201 event.preventDefault();
4202 event.stopPropagation();
4204 if (this.disabled || $$$1(this).hasClass(ClassName.DISABLED)) {
4208 var parent = Dropdown._getParentFromElement(this);
4210 var isActive = $$$1(parent).hasClass(ClassName.SHOW);
4212 if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
4213 if (event.which === ESCAPE_KEYCODE) {
4214 var toggle = $$$1(parent).find(Selector.DATA_TOGGLE)[0];
4215 $$$1(toggle).trigger('focus');
4218 $$$1(this).trigger('click');
4222 var items = $$$1(parent).find(Selector.VISIBLE_ITEMS).get();
4224 if (items.length === 0) {
4228 var index = items.indexOf(event.target);
4230 if (event.which === ARROW_UP_KEYCODE && index > 0) {
4235 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
4244 items[index].focus();
4247 _createClass(Dropdown, null, [{
4249 get: function get() {
4254 get: function get() {
4259 get: function get() {
4266 * ------------------------------------------------------------------------
4267 * Data Api implementation
4268 * ------------------------------------------------------------------------
4272 $$$1(document).on(Event.KEYDOWN_DATA_API, Selector.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event.KEYDOWN_DATA_API, Selector.MENU, Dropdown._dataApiKeydownHandler).on(Event.CLICK_DATA_API + " " + Event.KEYUP_DATA_API, Dropdown._clearMenus).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
4273 event.preventDefault();
4274 event.stopPropagation();
4276 Dropdown._jQueryInterface.call($$$1(this), 'toggle');
4277 }).on(Event.CLICK_DATA_API, Selector.FORM_CHILD, function (e) {
4278 e.stopPropagation();
4281 * ------------------------------------------------------------------------
4283 * ------------------------------------------------------------------------
4286 $$$1.fn[NAME] = Dropdown._jQueryInterface;
4287 $$$1.fn[NAME].Constructor = Dropdown;
4289 $$$1.fn[NAME].noConflict = function () {
4290 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
4291 return Dropdown._jQueryInterface;
4298 * --------------------------------------------------------------------------
4299 * Bootstrap (v4.0.0): modal.js
4300 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4301 * --------------------------------------------------------------------------
4304 var Modal = function ($$$1) {
4306 * ------------------------------------------------------------------------
4308 * ------------------------------------------------------------------------
4311 var VERSION = '4.0.0';
4312 var DATA_KEY = 'bs.modal';
4313 var EVENT_KEY = "." + DATA_KEY;
4314 var DATA_API_KEY = '.data-api';
4315 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
4316 var TRANSITION_DURATION = 300;
4317 var BACKDROP_TRANSITION_DURATION = 150;
4318 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
4327 backdrop: '(boolean|string)',
4328 keyboard: 'boolean',
4333 HIDE: "hide" + EVENT_KEY,
4334 HIDDEN: "hidden" + EVENT_KEY,
4335 SHOW: "show" + EVENT_KEY,
4336 SHOWN: "shown" + EVENT_KEY,
4337 FOCUSIN: "focusin" + EVENT_KEY,
4338 RESIZE: "resize" + EVENT_KEY,
4339 CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
4340 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY,
4341 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY,
4342 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY,
4343 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
4346 SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
4347 BACKDROP: 'modal-backdrop',
4353 DIALOG: '.modal-dialog',
4354 DATA_TOGGLE: '[data-toggle="modal"]',
4355 DATA_DISMISS: '[data-dismiss="modal"]',
4356 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
4357 STICKY_CONTENT: '.sticky-top',
4358 NAVBAR_TOGGLER: '.navbar-toggler'
4360 * ------------------------------------------------------------------------
4362 * ------------------------------------------------------------------------
4370 function Modal(element, config) {
4371 this._config = this._getConfig(config);
4372 this._element = element;
4373 this._dialog = $$$1(element).find(Selector.DIALOG)[0];
4374 this._backdrop = null;
4375 this._isShown = false;
4376 this._isBodyOverflowing = false;
4377 this._ignoreBackdropClick = false;
4378 this._originalBodyPadding = 0;
4379 this._scrollbarWidth = 0;
4383 var _proto = Modal.prototype;
4386 _proto.toggle = function toggle(relatedTarget) {
4387 return this._isShown ? this.hide() : this.show(relatedTarget);
4390 _proto.show = function show(relatedTarget) {
4393 if (this._isTransitioning || this._isShown) {
4397 if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
4398 this._isTransitioning = true;
4401 var showEvent = $$$1.Event(Event.SHOW, {
4402 relatedTarget: relatedTarget
4404 $$$1(this._element).trigger(showEvent);
4406 if (this._isShown || showEvent.isDefaultPrevented()) {
4410 this._isShown = true;
4412 this._checkScrollbar();
4414 this._setScrollbar();
4416 this._adjustDialog();
4418 $$$1(document.body).addClass(ClassName.OPEN);
4420 this._setEscapeEvent();
4422 this._setResizeEvent();
4424 $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function (event) {
4425 return _this.hide(event);
4427 $$$1(this._dialog).on(Event.MOUSEDOWN_DISMISS, function () {
4428 $$$1(_this._element).one(Event.MOUSEUP_DISMISS, function (event) {
4429 if ($$$1(event.target).is(_this._element)) {
4430 _this._ignoreBackdropClick = true;
4435 this._showBackdrop(function () {
4436 return _this._showElement(relatedTarget);
4440 _proto.hide = function hide(event) {
4444 event.preventDefault();
4447 if (this._isTransitioning || !this._isShown) {
4451 var hideEvent = $$$1.Event(Event.HIDE);
4452 $$$1(this._element).trigger(hideEvent);
4454 if (!this._isShown || hideEvent.isDefaultPrevented()) {
4458 this._isShown = false;
4459 var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
4462 this._isTransitioning = true;
4465 this._setEscapeEvent();
4467 this._setResizeEvent();
4469 $$$1(document).off(Event.FOCUSIN);
4470 $$$1(this._element).removeClass(ClassName.SHOW);
4471 $$$1(this._element).off(Event.CLICK_DISMISS);
4472 $$$1(this._dialog).off(Event.MOUSEDOWN_DISMISS);
4475 $$$1(this._element).one(Util.TRANSITION_END, function (event) {
4476 return _this2._hideModal(event);
4477 }).emulateTransitionEnd(TRANSITION_DURATION);
4483 _proto.dispose = function dispose() {
4484 $$$1.removeData(this._element, DATA_KEY);
4485 $$$1(window, document, this._element, this._backdrop).off(EVENT_KEY);
4486 this._config = null;
4487 this._element = null;
4488 this._dialog = null;
4489 this._backdrop = null;
4490 this._isShown = null;
4491 this._isBodyOverflowing = null;
4492 this._ignoreBackdropClick = null;
4493 this._scrollbarWidth = null;
4496 _proto.handleUpdate = function handleUpdate() {
4497 this._adjustDialog();
4501 _proto._getConfig = function _getConfig(config) {
4502 config = _extends({}, Default, config);
4503 Util.typeCheckConfig(NAME, config, DefaultType);
4507 _proto._showElement = function _showElement(relatedTarget) {
4510 var transition = Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE);
4512 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
4513 // Don't move modal's DOM position
4514 document.body.appendChild(this._element);
4517 this._element.style.display = 'block';
4519 this._element.removeAttribute('aria-hidden');
4521 this._element.scrollTop = 0;
4524 Util.reflow(this._element);
4527 $$$1(this._element).addClass(ClassName.SHOW);
4529 if (this._config.focus) {
4530 this._enforceFocus();
4533 var shownEvent = $$$1.Event(Event.SHOWN, {
4534 relatedTarget: relatedTarget
4537 var transitionComplete = function transitionComplete() {
4538 if (_this3._config.focus) {
4539 _this3._element.focus();
4542 _this3._isTransitioning = false;
4543 $$$1(_this3._element).trigger(shownEvent);
4547 $$$1(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(TRANSITION_DURATION);
4549 transitionComplete();
4553 _proto._enforceFocus = function _enforceFocus() {
4556 $$$1(document).off(Event.FOCUSIN) // Guard against infinite focus loop
4557 .on(Event.FOCUSIN, function (event) {
4558 if (document !== event.target && _this4._element !== event.target && $$$1(_this4._element).has(event.target).length === 0) {
4559 _this4._element.focus();
4564 _proto._setEscapeEvent = function _setEscapeEvent() {
4567 if (this._isShown && this._config.keyboard) {
4568 $$$1(this._element).on(Event.KEYDOWN_DISMISS, function (event) {
4569 if (event.which === ESCAPE_KEYCODE) {
4570 event.preventDefault();
4575 } else if (!this._isShown) {
4576 $$$1(this._element).off(Event.KEYDOWN_DISMISS);
4580 _proto._setResizeEvent = function _setResizeEvent() {
4583 if (this._isShown) {
4584 $$$1(window).on(Event.RESIZE, function (event) {
4585 return _this6.handleUpdate(event);
4588 $$$1(window).off(Event.RESIZE);
4592 _proto._hideModal = function _hideModal() {
4595 this._element.style.display = 'none';
4597 this._element.setAttribute('aria-hidden', true);
4599 this._isTransitioning = false;
4601 this._showBackdrop(function () {
4602 $$$1(document.body).removeClass(ClassName.OPEN);
4604 _this7._resetAdjustments();
4606 _this7._resetScrollbar();
4608 $$$1(_this7._element).trigger(Event.HIDDEN);
4612 _proto._removeBackdrop = function _removeBackdrop() {
4613 if (this._backdrop) {
4614 $$$1(this._backdrop).remove();
4615 this._backdrop = null;
4619 _proto._showBackdrop = function _showBackdrop(callback) {
4622 var animate = $$$1(this._element).hasClass(ClassName.FADE) ? ClassName.FADE : '';
4624 if (this._isShown && this._config.backdrop) {
4625 var doAnimate = Util.supportsTransitionEnd() && animate;
4626 this._backdrop = document.createElement('div');
4627 this._backdrop.className = ClassName.BACKDROP;
4630 $$$1(this._backdrop).addClass(animate);
4633 $$$1(this._backdrop).appendTo(document.body);
4634 $$$1(this._element).on(Event.CLICK_DISMISS, function (event) {
4635 if (_this8._ignoreBackdropClick) {
4636 _this8._ignoreBackdropClick = false;
4640 if (event.target !== event.currentTarget) {
4644 if (_this8._config.backdrop === 'static') {
4645 _this8._element.focus();
4652 Util.reflow(this._backdrop);
4655 $$$1(this._backdrop).addClass(ClassName.SHOW);
4666 $$$1(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
4667 } else if (!this._isShown && this._backdrop) {
4668 $$$1(this._backdrop).removeClass(ClassName.SHOW);
4670 var callbackRemove = function callbackRemove() {
4671 _this8._removeBackdrop();
4678 if (Util.supportsTransitionEnd() && $$$1(this._element).hasClass(ClassName.FADE)) {
4679 $$$1(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(BACKDROP_TRANSITION_DURATION);
4683 } else if (callback) {
4686 }; // ----------------------------------------------------------------------
4687 // the following methods are used to handle overflowing modals
4688 // todo (fat): these should probably be refactored out of modal.js
4689 // ----------------------------------------------------------------------
4692 _proto._adjustDialog = function _adjustDialog() {
4693 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
4695 if (!this._isBodyOverflowing && isModalOverflowing) {
4696 this._element.style.paddingLeft = this._scrollbarWidth + "px";
4699 if (this._isBodyOverflowing && !isModalOverflowing) {
4700 this._element.style.paddingRight = this._scrollbarWidth + "px";
4704 _proto._resetAdjustments = function _resetAdjustments() {
4705 this._element.style.paddingLeft = '';
4706 this._element.style.paddingRight = '';
4709 _proto._checkScrollbar = function _checkScrollbar() {
4710 var rect = document.body.getBoundingClientRect();
4711 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
4712 this._scrollbarWidth = this._getScrollbarWidth();
4715 _proto._setScrollbar = function _setScrollbar() {
4718 if (this._isBodyOverflowing) {
4719 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
4720 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
4721 // Adjust fixed content padding
4722 $$$1(Selector.FIXED_CONTENT).each(function (index, element) {
4723 var actualPadding = $$$1(element)[0].style.paddingRight;
4724 var calculatedPadding = $$$1(element).css('padding-right');
4725 $$$1(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
4726 }); // Adjust sticky content margin
4728 $$$1(Selector.STICKY_CONTENT).each(function (index, element) {
4729 var actualMargin = $$$1(element)[0].style.marginRight;
4730 var calculatedMargin = $$$1(element).css('margin-right');
4731 $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
4732 }); // Adjust navbar-toggler margin
4734 $$$1(Selector.NAVBAR_TOGGLER).each(function (index, element) {
4735 var actualMargin = $$$1(element)[0].style.marginRight;
4736 var calculatedMargin = $$$1(element).css('margin-right');
4737 $$$1(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) + _this9._scrollbarWidth + "px");
4738 }); // Adjust body padding
4740 var actualPadding = document.body.style.paddingRight;
4741 var calculatedPadding = $$$1('body').css('padding-right');
4742 $$$1('body').data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
4746 _proto._resetScrollbar = function _resetScrollbar() {
4747 // Restore fixed content padding
4748 $$$1(Selector.FIXED_CONTENT).each(function (index, element) {
4749 var padding = $$$1(element).data('padding-right');
4751 if (typeof padding !== 'undefined') {
4752 $$$1(element).css('padding-right', padding).removeData('padding-right');
4754 }); // Restore sticky content and navbar-toggler margin
4756 $$$1(Selector.STICKY_CONTENT + ", " + Selector.NAVBAR_TOGGLER).each(function (index, element) {
4757 var margin = $$$1(element).data('margin-right');
4759 if (typeof margin !== 'undefined') {
4760 $$$1(element).css('margin-right', margin).removeData('margin-right');
4762 }); // Restore body padding
4764 var padding = $$$1('body').data('padding-right');
4766 if (typeof padding !== 'undefined') {
4767 $$$1('body').css('padding-right', padding).removeData('padding-right');
4771 _proto._getScrollbarWidth = function _getScrollbarWidth() {
4773 var scrollDiv = document.createElement('div');
4774 scrollDiv.className = ClassName.SCROLLBAR_MEASURER;
4775 document.body.appendChild(scrollDiv);
4776 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
4777 document.body.removeChild(scrollDiv);
4778 return scrollbarWidth;
4782 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
4783 return this.each(function () {
4784 var data = $$$1(this).data(DATA_KEY);
4786 var _config = _extends({}, Modal.Default, $$$1(this).data(), typeof config === 'object' && config);
4789 data = new Modal(this, _config);
4790 $$$1(this).data(DATA_KEY, data);
4793 if (typeof config === 'string') {
4794 if (typeof data[config] === 'undefined') {
4795 throw new TypeError("No method named \"" + config + "\"");
4798 data[config](relatedTarget);
4799 } else if (_config.show) {
4800 data.show(relatedTarget);
4805 _createClass(Modal, null, [{
4807 get: function get() {
4812 get: function get() {
4819 * ------------------------------------------------------------------------
4820 * Data Api implementation
4821 * ------------------------------------------------------------------------
4825 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
4829 var selector = Util.getSelectorFromElement(this);
4832 target = $$$1(selector)[0];
4835 var config = $$$1(target).data(DATA_KEY) ? 'toggle' : _extends({}, $$$1(target).data(), $$$1(this).data());
4837 if (this.tagName === 'A' || this.tagName === 'AREA') {
4838 event.preventDefault();
4841 var $target = $$$1(target).one(Event.SHOW, function (showEvent) {
4842 if (showEvent.isDefaultPrevented()) {
4843 // Only register focus restorer if modal will actually get shown
4847 $target.one(Event.HIDDEN, function () {
4848 if ($$$1(_this10).is(':visible')) {
4854 Modal._jQueryInterface.call($$$1(target), config, this);
4857 * ------------------------------------------------------------------------
4859 * ------------------------------------------------------------------------
4862 $$$1.fn[NAME] = Modal._jQueryInterface;
4863 $$$1.fn[NAME].Constructor = Modal;
4865 $$$1.fn[NAME].noConflict = function () {
4866 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
4867 return Modal._jQueryInterface;
4874 * --------------------------------------------------------------------------
4875 * Bootstrap (v4.0.0): tooltip.js
4876 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
4877 * --------------------------------------------------------------------------
4880 var Tooltip = function ($$$1) {
4882 * ------------------------------------------------------------------------
4884 * ------------------------------------------------------------------------
4886 var NAME = 'tooltip';
4887 var VERSION = '4.0.0';
4888 var DATA_KEY = 'bs.tooltip';
4889 var EVENT_KEY = "." + DATA_KEY;
4890 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
4891 var TRANSITION_DURATION = 150;
4892 var CLASS_PREFIX = 'bs-tooltip';
4893 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
4895 animation: 'boolean',
4897 title: '(string|element|function)',
4899 delay: '(number|object)',
4901 selector: '(string|boolean)',
4902 placement: '(string|function)',
4903 offset: '(number|string)',
4904 container: '(string|element|boolean)',
4905 fallbackPlacement: '(string|array)',
4906 boundary: '(string|element)'
4908 var AttachmentMap = {
4917 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
4918 trigger: 'hover focus',
4926 fallbackPlacement: 'flip',
4927 boundary: 'scrollParent'
4934 HIDE: "hide" + EVENT_KEY,
4935 HIDDEN: "hidden" + EVENT_KEY,
4936 SHOW: "show" + EVENT_KEY,
4937 SHOWN: "shown" + EVENT_KEY,
4938 INSERTED: "inserted" + EVENT_KEY,
4939 CLICK: "click" + EVENT_KEY,
4940 FOCUSIN: "focusin" + EVENT_KEY,
4941 FOCUSOUT: "focusout" + EVENT_KEY,
4942 MOUSEENTER: "mouseenter" + EVENT_KEY,
4943 MOUSELEAVE: "mouseleave" + EVENT_KEY
4950 TOOLTIP: '.tooltip',
4951 TOOLTIP_INNER: '.tooltip-inner',
4960 * ------------------------------------------------------------------------
4962 * ------------------------------------------------------------------------
4970 function Tooltip(element, config) {
4972 * Check for Popper dependency
4973 * Popper - https://popper.js.org
4975 if (typeof Popper === 'undefined') {
4976 throw new TypeError('Bootstrap tooltips require Popper.js (https://popper.js.org)');
4980 this._isEnabled = true;
4982 this._hoverState = '';
4983 this._activeTrigger = {};
4984 this._popper = null; // Protected
4986 this.element = element;
4987 this.config = this._getConfig(config);
4990 this._setListeners();
4994 var _proto = Tooltip.prototype;
4997 _proto.enable = function enable() {
4998 this._isEnabled = true;
5001 _proto.disable = function disable() {
5002 this._isEnabled = false;
5005 _proto.toggleEnabled = function toggleEnabled() {
5006 this._isEnabled = !this._isEnabled;
5009 _proto.toggle = function toggle(event) {
5010 if (!this._isEnabled) {
5015 var dataKey = this.constructor.DATA_KEY;
5016 var context = $$$1(event.currentTarget).data(dataKey);
5019 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5020 $$$1(event.currentTarget).data(dataKey, context);
5023 context._activeTrigger.click = !context._activeTrigger.click;
5025 if (context._isWithActiveTrigger()) {
5026 context._enter(null, context);
5028 context._leave(null, context);
5031 if ($$$1(this.getTipElement()).hasClass(ClassName.SHOW)) {
5032 this._leave(null, this);
5037 this._enter(null, this);
5041 _proto.dispose = function dispose() {
5042 clearTimeout(this._timeout);
5043 $$$1.removeData(this.element, this.constructor.DATA_KEY);
5044 $$$1(this.element).off(this.constructor.EVENT_KEY);
5045 $$$1(this.element).closest('.modal').off('hide.bs.modal');
5048 $$$1(this.tip).remove();
5051 this._isEnabled = null;
5052 this._timeout = null;
5053 this._hoverState = null;
5054 this._activeTrigger = null;
5056 if (this._popper !== null) {
5057 this._popper.destroy();
5060 this._popper = null;
5061 this.element = null;
5066 _proto.show = function show() {
5069 if ($$$1(this.element).css('display') === 'none') {
5070 throw new Error('Please use show on visible elements');
5073 var showEvent = $$$1.Event(this.constructor.Event.SHOW);
5075 if (this.isWithContent() && this._isEnabled) {
5076 $$$1(this.element).trigger(showEvent);
5077 var isInTheDom = $$$1.contains(this.element.ownerDocument.documentElement, this.element);
5079 if (showEvent.isDefaultPrevented() || !isInTheDom) {
5083 var tip = this.getTipElement();
5084 var tipId = Util.getUID(this.constructor.NAME);
5085 tip.setAttribute('id', tipId);
5086 this.element.setAttribute('aria-describedby', tipId);
5089 if (this.config.animation) {
5090 $$$1(tip).addClass(ClassName.FADE);
5093 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
5095 var attachment = this._getAttachment(placement);
5097 this.addAttachmentClass(attachment);
5098 var container = this.config.container === false ? document.body : $$$1(this.config.container);
5099 $$$1(tip).data(this.constructor.DATA_KEY, this);
5101 if (!$$$1.contains(this.element.ownerDocument.documentElement, this.tip)) {
5102 $$$1(tip).appendTo(container);
5105 $$$1(this.element).trigger(this.constructor.Event.INSERTED);
5106 this._popper = new Popper(this.element, tip, {
5107 placement: attachment,
5110 offset: this.config.offset
5113 behavior: this.config.fallbackPlacement
5116 element: Selector.ARROW
5119 boundariesElement: this.config.boundary
5122 onCreate: function onCreate(data) {
5123 if (data.originalPlacement !== data.placement) {
5124 _this._handlePopperPlacementChange(data);
5127 onUpdate: function onUpdate(data) {
5128 _this._handlePopperPlacementChange(data);
5131 $$$1(tip).addClass(ClassName.SHOW); // If this is a touch-enabled device we add extra
5132 // empty mouseover listeners to the body's immediate children;
5133 // only needed because of broken event delegation on iOS
5134 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
5136 if ('ontouchstart' in document.documentElement) {
5137 $$$1('body').children().on('mouseover', null, $$$1.noop);
5140 var complete = function complete() {
5141 if (_this.config.animation) {
5142 _this._fixTransition();
5145 var prevHoverState = _this._hoverState;
5146 _this._hoverState = null;
5147 $$$1(_this.element).trigger(_this.constructor.Event.SHOWN);
5149 if (prevHoverState === HoverState.OUT) {
5150 _this._leave(null, _this);
5154 if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
5155 $$$1(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(Tooltip._TRANSITION_DURATION);
5162 _proto.hide = function hide(callback) {
5165 var tip = this.getTipElement();
5166 var hideEvent = $$$1.Event(this.constructor.Event.HIDE);
5168 var complete = function complete() {
5169 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
5170 tip.parentNode.removeChild(tip);
5173 _this2._cleanTipClass();
5175 _this2.element.removeAttribute('aria-describedby');
5177 $$$1(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
5179 if (_this2._popper !== null) {
5180 _this2._popper.destroy();
5188 $$$1(this.element).trigger(hideEvent);
5190 if (hideEvent.isDefaultPrevented()) {
5194 $$$1(tip).removeClass(ClassName.SHOW); // If this is a touch-enabled device we remove the extra
5195 // empty mouseover listeners we added for iOS support
5197 if ('ontouchstart' in document.documentElement) {
5198 $$$1('body').children().off('mouseover', null, $$$1.noop);
5201 this._activeTrigger[Trigger.CLICK] = false;
5202 this._activeTrigger[Trigger.FOCUS] = false;
5203 this._activeTrigger[Trigger.HOVER] = false;
5205 if (Util.supportsTransitionEnd() && $$$1(this.tip).hasClass(ClassName.FADE)) {
5206 $$$1(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
5211 this._hoverState = '';
5214 _proto.update = function update() {
5215 if (this._popper !== null) {
5216 this._popper.scheduleUpdate();
5221 _proto.isWithContent = function isWithContent() {
5222 return Boolean(this.getTitle());
5225 _proto.addAttachmentClass = function addAttachmentClass(attachment) {
5226 $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
5229 _proto.getTipElement = function getTipElement() {
5230 this.tip = this.tip || $$$1(this.config.template)[0];
5234 _proto.setContent = function setContent() {
5235 var $tip = $$$1(this.getTipElement());
5236 this.setElementContent($tip.find(Selector.TOOLTIP_INNER), this.getTitle());
5237 $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
5240 _proto.setElementContent = function setElementContent($element, content) {
5241 var html = this.config.html;
5243 if (typeof content === 'object' && (content.nodeType || content.jquery)) {
5244 // Content is a DOM node or a jQuery
5246 if (!$$$1(content).parent().is($element)) {
5247 $element.empty().append(content);
5250 $element.text($$$1(content).text());
5253 $element[html ? 'html' : 'text'](content);
5257 _proto.getTitle = function getTitle() {
5258 var title = this.element.getAttribute('data-original-title');
5261 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
5268 _proto._getAttachment = function _getAttachment(placement) {
5269 return AttachmentMap[placement.toUpperCase()];
5272 _proto._setListeners = function _setListeners() {
5275 var triggers = this.config.trigger.split(' ');
5276 triggers.forEach(function (trigger) {
5277 if (trigger === 'click') {
5278 $$$1(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
5279 return _this3.toggle(event);
5281 } else if (trigger !== Trigger.MANUAL) {
5282 var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
5283 var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
5284 $$$1(_this3.element).on(eventIn, _this3.config.selector, function (event) {
5285 return _this3._enter(event);
5286 }).on(eventOut, _this3.config.selector, function (event) {
5287 return _this3._leave(event);
5291 $$$1(_this3.element).closest('.modal').on('hide.bs.modal', function () {
5292 return _this3.hide();
5296 if (this.config.selector) {
5297 this.config = _extends({}, this.config, {
5306 _proto._fixTitle = function _fixTitle() {
5307 var titleType = typeof this.element.getAttribute('data-original-title');
5309 if (this.element.getAttribute('title') || titleType !== 'string') {
5310 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
5311 this.element.setAttribute('title', '');
5315 _proto._enter = function _enter(event, context) {
5316 var dataKey = this.constructor.DATA_KEY;
5317 context = context || $$$1(event.currentTarget).data(dataKey);
5320 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5321 $$$1(event.currentTarget).data(dataKey, context);
5325 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
5328 if ($$$1(context.getTipElement()).hasClass(ClassName.SHOW) || context._hoverState === HoverState.SHOW) {
5329 context._hoverState = HoverState.SHOW;
5333 clearTimeout(context._timeout);
5334 context._hoverState = HoverState.SHOW;
5336 if (!context.config.delay || !context.config.delay.show) {
5341 context._timeout = setTimeout(function () {
5342 if (context._hoverState === HoverState.SHOW) {
5345 }, context.config.delay.show);
5348 _proto._leave = function _leave(event, context) {
5349 var dataKey = this.constructor.DATA_KEY;
5350 context = context || $$$1(event.currentTarget).data(dataKey);
5353 context = new this.constructor(event.currentTarget, this._getDelegateConfig());
5354 $$$1(event.currentTarget).data(dataKey, context);
5358 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
5361 if (context._isWithActiveTrigger()) {
5365 clearTimeout(context._timeout);
5366 context._hoverState = HoverState.OUT;
5368 if (!context.config.delay || !context.config.delay.hide) {
5373 context._timeout = setTimeout(function () {
5374 if (context._hoverState === HoverState.OUT) {
5377 }, context.config.delay.hide);
5380 _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
5381 for (var trigger in this._activeTrigger) {
5382 if (this._activeTrigger[trigger]) {
5390 _proto._getConfig = function _getConfig(config) {
5391 config = _extends({}, this.constructor.Default, $$$1(this.element).data(), config);
5393 if (typeof config.delay === 'number') {
5400 if (typeof config.title === 'number') {
5401 config.title = config.title.toString();
5404 if (typeof config.content === 'number') {
5405 config.content = config.content.toString();
5408 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
5412 _proto._getDelegateConfig = function _getDelegateConfig() {
5416 for (var key in this.config) {
5417 if (this.constructor.Default[key] !== this.config[key]) {
5418 config[key] = this.config[key];
5426 _proto._cleanTipClass = function _cleanTipClass() {
5427 var $tip = $$$1(this.getTipElement());
5428 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
5430 if (tabClass !== null && tabClass.length > 0) {
5431 $tip.removeClass(tabClass.join(''));
5435 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(data) {
5436 this._cleanTipClass();
5438 this.addAttachmentClass(this._getAttachment(data.placement));
5441 _proto._fixTransition = function _fixTransition() {
5442 var tip = this.getTipElement();
5443 var initConfigAnimation = this.config.animation;
5445 if (tip.getAttribute('x-placement') !== null) {
5449 $$$1(tip).removeClass(ClassName.FADE);
5450 this.config.animation = false;
5453 this.config.animation = initConfigAnimation;
5457 Tooltip._jQueryInterface = function _jQueryInterface(config) {
5458 return this.each(function () {
5459 var data = $$$1(this).data(DATA_KEY);
5461 var _config = typeof config === 'object' && config;
5463 if (!data && /dispose|hide/.test(config)) {
5468 data = new Tooltip(this, _config);
5469 $$$1(this).data(DATA_KEY, data);
5472 if (typeof config === 'string') {
5473 if (typeof data[config] === 'undefined') {
5474 throw new TypeError("No method named \"" + config + "\"");
5482 _createClass(Tooltip, null, [{
5484 get: function get() {
5489 get: function get() {
5494 get: function get() {
5499 get: function get() {
5504 get: function get() {
5509 get: function get() {
5514 get: function get() {
5521 * ------------------------------------------------------------------------
5523 * ------------------------------------------------------------------------
5527 $$$1.fn[NAME] = Tooltip._jQueryInterface;
5528 $$$1.fn[NAME].Constructor = Tooltip;
5530 $$$1.fn[NAME].noConflict = function () {
5531 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
5532 return Tooltip._jQueryInterface;
5539 * --------------------------------------------------------------------------
5540 * Bootstrap (v4.0.0): popover.js
5541 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5542 * --------------------------------------------------------------------------
5545 var Popover = function ($$$1) {
5547 * ------------------------------------------------------------------------
5549 * ------------------------------------------------------------------------
5551 var NAME = 'popover';
5552 var VERSION = '4.0.0';
5553 var DATA_KEY = 'bs.popover';
5554 var EVENT_KEY = "." + DATA_KEY;
5555 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
5556 var CLASS_PREFIX = 'bs-popover';
5557 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
5558 var Default = _extends({}, Tooltip.Default, {
5562 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
5564 var DefaultType = _extends({}, Tooltip.DefaultType, {
5565 content: '(string|element|function)'
5572 TITLE: '.popover-header',
5573 CONTENT: '.popover-body'
5576 HIDE: "hide" + EVENT_KEY,
5577 HIDDEN: "hidden" + EVENT_KEY,
5578 SHOW: "show" + EVENT_KEY,
5579 SHOWN: "shown" + EVENT_KEY,
5580 INSERTED: "inserted" + EVENT_KEY,
5581 CLICK: "click" + EVENT_KEY,
5582 FOCUSIN: "focusin" + EVENT_KEY,
5583 FOCUSOUT: "focusout" + EVENT_KEY,
5584 MOUSEENTER: "mouseenter" + EVENT_KEY,
5585 MOUSELEAVE: "mouseleave" + EVENT_KEY
5587 * ------------------------------------------------------------------------
5589 * ------------------------------------------------------------------------
5596 function (_Tooltip) {
5597 _inheritsLoose(Popover, _Tooltip);
5599 function Popover() {
5600 return _Tooltip.apply(this, arguments) || this;
5603 var _proto = Popover.prototype;
5606 _proto.isWithContent = function isWithContent() {
5607 return this.getTitle() || this._getContent();
5610 _proto.addAttachmentClass = function addAttachmentClass(attachment) {
5611 $$$1(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
5614 _proto.getTipElement = function getTipElement() {
5615 this.tip = this.tip || $$$1(this.config.template)[0];
5619 _proto.setContent = function setContent() {
5620 var $tip = $$$1(this.getTipElement()); // We use append for html objects to maintain js events
5622 this.setElementContent($tip.find(Selector.TITLE), this.getTitle());
5624 var content = this._getContent();
5626 if (typeof content === 'function') {
5627 content = content.call(this.element);
5630 this.setElementContent($tip.find(Selector.CONTENT), content);
5631 $tip.removeClass(ClassName.FADE + " " + ClassName.SHOW);
5635 _proto._getContent = function _getContent() {
5636 return this.element.getAttribute('data-content') || this.config.content;
5639 _proto._cleanTipClass = function _cleanTipClass() {
5640 var $tip = $$$1(this.getTipElement());
5641 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
5643 if (tabClass !== null && tabClass.length > 0) {
5644 $tip.removeClass(tabClass.join(''));
5649 Popover._jQueryInterface = function _jQueryInterface(config) {
5650 return this.each(function () {
5651 var data = $$$1(this).data(DATA_KEY);
5653 var _config = typeof config === 'object' ? config : null;
5655 if (!data && /destroy|hide/.test(config)) {
5660 data = new Popover(this, _config);
5661 $$$1(this).data(DATA_KEY, data);
5664 if (typeof config === 'string') {
5665 if (typeof data[config] === 'undefined') {
5666 throw new TypeError("No method named \"" + config + "\"");
5674 _createClass(Popover, null, [{
5677 get: function get() {
5682 get: function get() {
5687 get: function get() {
5692 get: function get() {
5697 get: function get() {
5702 get: function get() {
5707 get: function get() {
5714 * ------------------------------------------------------------------------
5716 * ------------------------------------------------------------------------
5720 $$$1.fn[NAME] = Popover._jQueryInterface;
5721 $$$1.fn[NAME].Constructor = Popover;
5723 $$$1.fn[NAME].noConflict = function () {
5724 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
5725 return Popover._jQueryInterface;
5732 * --------------------------------------------------------------------------
5733 * Bootstrap (v4.0.0): scrollspy.js
5734 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
5735 * --------------------------------------------------------------------------
5738 var ScrollSpy = function ($$$1) {
5740 * ------------------------------------------------------------------------
5742 * ------------------------------------------------------------------------
5744 var NAME = 'scrollspy';
5745 var VERSION = '4.0.0';
5746 var DATA_KEY = 'bs.scrollspy';
5747 var EVENT_KEY = "." + DATA_KEY;
5748 var DATA_API_KEY = '.data-api';
5749 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
5758 target: '(string|element)'
5761 ACTIVATE: "activate" + EVENT_KEY,
5762 SCROLL: "scroll" + EVENT_KEY,
5763 LOAD_DATA_API: "load" + EVENT_KEY + DATA_API_KEY
5766 DROPDOWN_ITEM: 'dropdown-item',
5767 DROPDOWN_MENU: 'dropdown-menu',
5771 DATA_SPY: '[data-spy="scroll"]',
5773 NAV_LIST_GROUP: '.nav, .list-group',
5774 NAV_LINKS: '.nav-link',
5775 NAV_ITEMS: '.nav-item',
5776 LIST_ITEMS: '.list-group-item',
5777 DROPDOWN: '.dropdown',
5778 DROPDOWN_ITEMS: '.dropdown-item',
5779 DROPDOWN_TOGGLE: '.dropdown-toggle'
5781 var OffsetMethod = {
5783 POSITION: 'position'
5785 * ------------------------------------------------------------------------
5787 * ------------------------------------------------------------------------
5795 function ScrollSpy(element, config) {
5798 this._element = element;
5799 this._scrollElement = element.tagName === 'BODY' ? window : element;
5800 this._config = this._getConfig(config);
5801 this._selector = this._config.target + " " + Selector.NAV_LINKS + "," + (this._config.target + " " + Selector.LIST_ITEMS + ",") + (this._config.target + " " + Selector.DROPDOWN_ITEMS);
5804 this._activeTarget = null;
5805 this._scrollHeight = 0;
5806 $$$1(this._scrollElement).on(Event.SCROLL, function (event) {
5807 return _this._process(event);
5815 var _proto = ScrollSpy.prototype;
5818 _proto.refresh = function refresh() {
5821 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
5822 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
5823 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
5826 this._scrollHeight = this._getScrollHeight();
5827 var targets = $$$1.makeArray($$$1(this._selector));
5828 targets.map(function (element) {
5830 var targetSelector = Util.getSelectorFromElement(element);
5832 if (targetSelector) {
5833 target = $$$1(targetSelector)[0];
5837 var targetBCR = target.getBoundingClientRect();
5839 if (targetBCR.width || targetBCR.height) {
5840 // TODO (fat): remove sketch reliance on jQuery position/offset
5841 return [$$$1(target)[offsetMethod]().top + offsetBase, targetSelector];
5846 }).filter(function (item) {
5848 }).sort(function (a, b) {
5850 }).forEach(function (item) {
5851 _this2._offsets.push(item[0]);
5853 _this2._targets.push(item[1]);
5857 _proto.dispose = function dispose() {
5858 $$$1.removeData(this._element, DATA_KEY);
5859 $$$1(this._scrollElement).off(EVENT_KEY);
5860 this._element = null;
5861 this._scrollElement = null;
5862 this._config = null;
5863 this._selector = null;
5864 this._offsets = null;
5865 this._targets = null;
5866 this._activeTarget = null;
5867 this._scrollHeight = null;
5871 _proto._getConfig = function _getConfig(config) {
5872 config = _extends({}, Default, config);
5874 if (typeof config.target !== 'string') {
5875 var id = $$$1(config.target).attr('id');
5878 id = Util.getUID(NAME);
5879 $$$1(config.target).attr('id', id);
5882 config.target = "#" + id;
5885 Util.typeCheckConfig(NAME, config, DefaultType);
5889 _proto._getScrollTop = function _getScrollTop() {
5890 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
5893 _proto._getScrollHeight = function _getScrollHeight() {
5894 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
5897 _proto._getOffsetHeight = function _getOffsetHeight() {
5898 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
5901 _proto._process = function _process() {
5902 var scrollTop = this._getScrollTop() + this._config.offset;
5904 var scrollHeight = this._getScrollHeight();
5906 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
5908 if (this._scrollHeight !== scrollHeight) {
5912 if (scrollTop >= maxScroll) {
5913 var target = this._targets[this._targets.length - 1];
5915 if (this._activeTarget !== target) {
5916 this._activate(target);
5922 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
5923 this._activeTarget = null;
5930 for (var i = this._offsets.length; i--;) {
5931 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
5933 if (isActiveTarget) {
5934 this._activate(this._targets[i]);
5939 _proto._activate = function _activate(target) {
5940 this._activeTarget = target;
5944 var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
5947 queries = queries.map(function (selector) {
5948 return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
5950 var $link = $$$1(queries.join(','));
5952 if ($link.hasClass(ClassName.DROPDOWN_ITEM)) {
5953 $link.closest(Selector.DROPDOWN).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
5954 $link.addClass(ClassName.ACTIVE);
5956 // Set triggered link as active
5957 $link.addClass(ClassName.ACTIVE); // Set triggered links parents as active
5958 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
5960 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_LINKS + ", " + Selector.LIST_ITEMS).addClass(ClassName.ACTIVE); // Handle special case when .nav-link is inside .nav-item
5962 $link.parents(Selector.NAV_LIST_GROUP).prev(Selector.NAV_ITEMS).children(Selector.NAV_LINKS).addClass(ClassName.ACTIVE);
5965 $$$1(this._scrollElement).trigger(Event.ACTIVATE, {
5966 relatedTarget: target
5970 _proto._clear = function _clear() {
5971 $$$1(this._selector).filter(Selector.ACTIVE).removeClass(ClassName.ACTIVE);
5975 ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
5976 return this.each(function () {
5977 var data = $$$1(this).data(DATA_KEY);
5979 var _config = typeof config === 'object' && config;
5982 data = new ScrollSpy(this, _config);
5983 $$$1(this).data(DATA_KEY, data);
5986 if (typeof config === 'string') {
5987 if (typeof data[config] === 'undefined') {
5988 throw new TypeError("No method named \"" + config + "\"");
5996 _createClass(ScrollSpy, null, [{
5998 get: function get() {
6003 get: function get() {
6010 * ------------------------------------------------------------------------
6011 * Data Api implementation
6012 * ------------------------------------------------------------------------
6016 $$$1(window).on(Event.LOAD_DATA_API, function () {
6017 var scrollSpys = $$$1.makeArray($$$1(Selector.DATA_SPY));
6019 for (var i = scrollSpys.length; i--;) {
6020 var $spy = $$$1(scrollSpys[i]);
6022 ScrollSpy._jQueryInterface.call($spy, $spy.data());
6026 * ------------------------------------------------------------------------
6028 * ------------------------------------------------------------------------
6031 $$$1.fn[NAME] = ScrollSpy._jQueryInterface;
6032 $$$1.fn[NAME].Constructor = ScrollSpy;
6034 $$$1.fn[NAME].noConflict = function () {
6035 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
6036 return ScrollSpy._jQueryInterface;
6043 * --------------------------------------------------------------------------
6044 * Bootstrap (v4.0.0): tab.js
6045 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6046 * --------------------------------------------------------------------------
6049 var Tab = function ($$$1) {
6051 * ------------------------------------------------------------------------
6053 * ------------------------------------------------------------------------
6056 var VERSION = '4.0.0';
6057 var DATA_KEY = 'bs.tab';
6058 var EVENT_KEY = "." + DATA_KEY;
6059 var DATA_API_KEY = '.data-api';
6060 var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
6061 var TRANSITION_DURATION = 150;
6063 HIDE: "hide" + EVENT_KEY,
6064 HIDDEN: "hidden" + EVENT_KEY,
6065 SHOW: "show" + EVENT_KEY,
6066 SHOWN: "shown" + EVENT_KEY,
6067 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
6070 DROPDOWN_MENU: 'dropdown-menu',
6072 DISABLED: 'disabled',
6077 DROPDOWN: '.dropdown',
6078 NAV_LIST_GROUP: '.nav, .list-group',
6080 ACTIVE_UL: '> li > .active',
6081 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
6082 DROPDOWN_TOGGLE: '.dropdown-toggle',
6083 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
6085 * ------------------------------------------------------------------------
6087 * ------------------------------------------------------------------------
6095 function Tab(element) {
6096 this._element = element;
6100 var _proto = Tab.prototype;
6103 _proto.show = function show() {
6106 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $$$1(this._element).hasClass(ClassName.ACTIVE) || $$$1(this._element).hasClass(ClassName.DISABLED)) {
6112 var listElement = $$$1(this._element).closest(Selector.NAV_LIST_GROUP)[0];
6113 var selector = Util.getSelectorFromElement(this._element);
6116 var itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE;
6117 previous = $$$1.makeArray($$$1(listElement).find(itemSelector));
6118 previous = previous[previous.length - 1];
6121 var hideEvent = $$$1.Event(Event.HIDE, {
6122 relatedTarget: this._element
6124 var showEvent = $$$1.Event(Event.SHOW, {
6125 relatedTarget: previous
6129 $$$1(previous).trigger(hideEvent);
6132 $$$1(this._element).trigger(showEvent);
6134 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
6139 target = $$$1(selector)[0];
6142 this._activate(this._element, listElement);
6144 var complete = function complete() {
6145 var hiddenEvent = $$$1.Event(Event.HIDDEN, {
6146 relatedTarget: _this._element
6148 var shownEvent = $$$1.Event(Event.SHOWN, {
6149 relatedTarget: previous
6151 $$$1(previous).trigger(hiddenEvent);
6152 $$$1(_this._element).trigger(shownEvent);
6156 this._activate(target, target.parentNode, complete);
6162 _proto.dispose = function dispose() {
6163 $$$1.removeData(this._element, DATA_KEY);
6164 this._element = null;
6168 _proto._activate = function _activate(element, container, callback) {
6173 if (container.nodeName === 'UL') {
6174 activeElements = $$$1(container).find(Selector.ACTIVE_UL);
6176 activeElements = $$$1(container).children(Selector.ACTIVE);
6179 var active = activeElements[0];
6180 var isTransitioning = callback && Util.supportsTransitionEnd() && active && $$$1(active).hasClass(ClassName.FADE);
6182 var complete = function complete() {
6183 return _this2._transitionComplete(element, active, callback);
6186 if (active && isTransitioning) {
6187 $$$1(active).one(Util.TRANSITION_END, complete).emulateTransitionEnd(TRANSITION_DURATION);
6193 _proto._transitionComplete = function _transitionComplete(element, active, callback) {
6195 $$$1(active).removeClass(ClassName.SHOW + " " + ClassName.ACTIVE);
6196 var dropdownChild = $$$1(active.parentNode).find(Selector.DROPDOWN_ACTIVE_CHILD)[0];
6198 if (dropdownChild) {
6199 $$$1(dropdownChild).removeClass(ClassName.ACTIVE);
6202 if (active.getAttribute('role') === 'tab') {
6203 active.setAttribute('aria-selected', false);
6207 $$$1(element).addClass(ClassName.ACTIVE);
6209 if (element.getAttribute('role') === 'tab') {
6210 element.setAttribute('aria-selected', true);
6213 Util.reflow(element);
6214 $$$1(element).addClass(ClassName.SHOW);
6216 if (element.parentNode && $$$1(element.parentNode).hasClass(ClassName.DROPDOWN_MENU)) {
6217 var dropdownElement = $$$1(element).closest(Selector.DROPDOWN)[0];
6219 if (dropdownElement) {
6220 $$$1(dropdownElement).find(Selector.DROPDOWN_TOGGLE).addClass(ClassName.ACTIVE);
6223 element.setAttribute('aria-expanded', true);
6232 Tab._jQueryInterface = function _jQueryInterface(config) {
6233 return this.each(function () {
6234 var $this = $$$1(this);
6235 var data = $this.data(DATA_KEY);
6238 data = new Tab(this);
6239 $this.data(DATA_KEY, data);
6242 if (typeof config === 'string') {
6243 if (typeof data[config] === 'undefined') {
6244 throw new TypeError("No method named \"" + config + "\"");
6252 _createClass(Tab, null, [{
6254 get: function get() {
6261 * ------------------------------------------------------------------------
6262 * Data Api implementation
6263 * ------------------------------------------------------------------------
6267 $$$1(document).on(Event.CLICK_DATA_API, Selector.DATA_TOGGLE, function (event) {
6268 event.preventDefault();
6270 Tab._jQueryInterface.call($$$1(this), 'show');
6273 * ------------------------------------------------------------------------
6275 * ------------------------------------------------------------------------
6278 $$$1.fn[NAME] = Tab._jQueryInterface;
6279 $$$1.fn[NAME].Constructor = Tab;
6281 $$$1.fn[NAME].noConflict = function () {
6282 $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
6283 return Tab._jQueryInterface;
6290 * --------------------------------------------------------------------------
6291 * Bootstrap (v4.0.0-alpha.6): index.js
6292 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
6293 * --------------------------------------------------------------------------
6297 if (typeof $$$1 === 'undefined') {
6298 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
6301 var version = $$$1.fn.jquery.split(' ')[0].split('.');
6308 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
6309 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
6313 exports.Util = Util;
6314 exports.Alert = Alert;
6315 exports.Button = Button;
6316 exports.Carousel = Carousel;
6317 exports.Collapse = Collapse;
6318 exports.Dropdown = Dropdown;
6319 exports.Modal = Modal;
6320 exports.Popover = Popover;
6321 exports.Scrollspy = ScrollSpy;
6323 exports.Tooltip = Tooltip;
6325 Object.defineProperty(exports, '__esModule', { value: true });
6328 //# sourceMappingURL=bootstrap.bundle.js.map