UNPKG

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