You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

4522 lines
132 KiB

  1. /*!
  2. * Bootstrap v4.4.1 (https://getbootstrap.com/)
  3. * Copyright 2011-2019 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'), require('popper.js')) :
  8. typeof define === 'function' && define.amd ? define(['exports', 'jquery', 'popper.js'], factory) :
  9. (global = global || self, factory(global.bootstrap = {}, global.jQuery, global.Popper));
  10. }(this, (function (exports, $, Popper) { 'use strict';
  11. $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
  12. Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper;
  13. function _defineProperties(target, props) {
  14. for (var i = 0; i < props.length; i++) {
  15. var descriptor = props[i];
  16. descriptor.enumerable = descriptor.enumerable || false;
  17. descriptor.configurable = true;
  18. if ("value" in descriptor) descriptor.writable = true;
  19. Object.defineProperty(target, descriptor.key, descriptor);
  20. }
  21. }
  22. function _createClass(Constructor, protoProps, staticProps) {
  23. if (protoProps) _defineProperties(Constructor.prototype, protoProps);
  24. if (staticProps) _defineProperties(Constructor, staticProps);
  25. return Constructor;
  26. }
  27. function _defineProperty(obj, key, value) {
  28. if (key in obj) {
  29. Object.defineProperty(obj, key, {
  30. value: value,
  31. enumerable: true,
  32. configurable: true,
  33. writable: true
  34. });
  35. } else {
  36. obj[key] = value;
  37. }
  38. return obj;
  39. }
  40. function ownKeys(object, enumerableOnly) {
  41. var keys = Object.keys(object);
  42. if (Object.getOwnPropertySymbols) {
  43. var symbols = Object.getOwnPropertySymbols(object);
  44. if (enumerableOnly) symbols = symbols.filter(function (sym) {
  45. return Object.getOwnPropertyDescriptor(object, sym).enumerable;
  46. });
  47. keys.push.apply(keys, symbols);
  48. }
  49. return keys;
  50. }
  51. function _objectSpread2(target) {
  52. for (var i = 1; i < arguments.length; i++) {
  53. var source = arguments[i] != null ? arguments[i] : {};
  54. if (i % 2) {
  55. ownKeys(Object(source), true).forEach(function (key) {
  56. _defineProperty(target, key, source[key]);
  57. });
  58. } else if (Object.getOwnPropertyDescriptors) {
  59. Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
  60. } else {
  61. ownKeys(Object(source)).forEach(function (key) {
  62. Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
  63. });
  64. }
  65. }
  66. return target;
  67. }
  68. function _inheritsLoose(subClass, superClass) {
  69. subClass.prototype = Object.create(superClass.prototype);
  70. subClass.prototype.constructor = subClass;
  71. subClass.__proto__ = superClass;
  72. }
  73. /**
  74. * --------------------------------------------------------------------------
  75. * Bootstrap (v4.4.1): util.js
  76. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  77. * --------------------------------------------------------------------------
  78. */
  79. /**
  80. * ------------------------------------------------------------------------
  81. * Private TransitionEnd Helpers
  82. * ------------------------------------------------------------------------
  83. */
  84. var TRANSITION_END = 'transitionend';
  85. var MAX_UID = 1000000;
  86. var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
  87. function toType(obj) {
  88. return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  89. }
  90. function getSpecialTransitionEndEvent() {
  91. return {
  92. bindType: TRANSITION_END,
  93. delegateType: TRANSITION_END,
  94. handle: function handle(event) {
  95. if ($(event.target).is(this)) {
  96. return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
  97. }
  98. return undefined; // eslint-disable-line no-undefined
  99. }
  100. };
  101. }
  102. function transitionEndEmulator(duration) {
  103. var _this = this;
  104. var called = false;
  105. $(this).one(Util.TRANSITION_END, function () {
  106. called = true;
  107. });
  108. setTimeout(function () {
  109. if (!called) {
  110. Util.triggerTransitionEnd(_this);
  111. }
  112. }, duration);
  113. return this;
  114. }
  115. function setTransitionEndSupport() {
  116. $.fn.emulateTransitionEnd = transitionEndEmulator;
  117. $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  118. }
  119. /**
  120. * --------------------------------------------------------------------------
  121. * Public Util Api
  122. * --------------------------------------------------------------------------
  123. */
  124. var Util = {
  125. TRANSITION_END: 'bsTransitionEnd',
  126. getUID: function getUID(prefix) {
  127. do {
  128. // eslint-disable-next-line no-bitwise
  129. prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  130. } while (document.getElementById(prefix));
  131. return prefix;
  132. },
  133. getSelectorFromElement: function getSelectorFromElement(element) {
  134. var selector = element.getAttribute('data-target');
  135. if (!selector || selector === '#') {
  136. var hrefAttr = element.getAttribute('href');
  137. selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
  138. }
  139. try {
  140. return document.querySelector(selector) ? selector : null;
  141. } catch (err) {
  142. return null;
  143. }
  144. },
  145. getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
  146. if (!element) {
  147. return 0;
  148. } // Get transition-duration of the element
  149. var transitionDuration = $(element).css('transition-duration');
  150. var transitionDelay = $(element).css('transition-delay');
  151. var floatTransitionDuration = parseFloat(transitionDuration);
  152. var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
  153. if (!floatTransitionDuration && !floatTransitionDelay) {
  154. return 0;
  155. } // If multiple durations are defined, take the first
  156. transitionDuration = transitionDuration.split(',')[0];
  157. transitionDelay = transitionDelay.split(',')[0];
  158. return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
  159. },
  160. reflow: function reflow(element) {
  161. return element.offsetHeight;
  162. },
  163. triggerTransitionEnd: function triggerTransitionEnd(element) {
  164. $(element).trigger(TRANSITION_END);
  165. },
  166. // TODO: Remove in v5
  167. supportsTransitionEnd: function supportsTransitionEnd() {
  168. return Boolean(TRANSITION_END);
  169. },
  170. isElement: function isElement(obj) {
  171. return (obj[0] || obj).nodeType;
  172. },
  173. typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
  174. for (var property in configTypes) {
  175. if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
  176. var expectedTypes = configTypes[property];
  177. var value = config[property];
  178. var valueType = value && Util.isElement(value) ? 'element' : toType(value);
  179. if (!new RegExp(expectedTypes).test(valueType)) {
  180. throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
  181. }
  182. }
  183. }
  184. },
  185. findShadowRoot: function findShadowRoot(element) {
  186. if (!document.documentElement.attachShadow) {
  187. return null;
  188. } // Can find the shadow root otherwise it'll return the document
  189. if (typeof element.getRootNode === 'function') {
  190. var root = element.getRootNode();
  191. return root instanceof ShadowRoot ? root : null;
  192. }
  193. if (element instanceof ShadowRoot) {
  194. return element;
  195. } // when we don't find a shadow root
  196. if (!element.parentNode) {
  197. return null;
  198. }
  199. return Util.findShadowRoot(element.parentNode);
  200. },
  201. jQueryDetection: function jQueryDetection() {
  202. if (typeof $ === 'undefined') {
  203. throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
  204. }
  205. var version = $.fn.jquery.split(' ')[0].split('.');
  206. var minMajor = 1;
  207. var ltMajor = 2;
  208. var minMinor = 9;
  209. var minPatch = 1;
  210. var maxMajor = 4;
  211. if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
  212. throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
  213. }
  214. }
  215. };
  216. Util.jQueryDetection();
  217. setTransitionEndSupport();
  218. /**
  219. * ------------------------------------------------------------------------
  220. * Constants
  221. * ------------------------------------------------------------------------
  222. */
  223. var NAME = 'alert';
  224. var VERSION = '4.4.1';
  225. var DATA_KEY = 'bs.alert';
  226. var EVENT_KEY = "." + DATA_KEY;
  227. var DATA_API_KEY = '.data-api';
  228. var JQUERY_NO_CONFLICT = $.fn[NAME];
  229. var Selector = {
  230. DISMISS: '[data-dismiss="alert"]'
  231. };
  232. var Event = {
  233. CLOSE: "close" + EVENT_KEY,
  234. CLOSED: "closed" + EVENT_KEY,
  235. CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  236. };
  237. var ClassName = {
  238. ALERT: 'alert',
  239. FADE: 'fade',
  240. SHOW: 'show'
  241. };
  242. /**
  243. * ------------------------------------------------------------------------
  244. * Class Definition
  245. * ------------------------------------------------------------------------
  246. */
  247. var Alert =
  248. /*#__PURE__*/
  249. function () {
  250. function Alert(element) {
  251. this._element = element;
  252. } // Getters
  253. var _proto = Alert.prototype;
  254. // Public
  255. _proto.close = function close(element) {
  256. var rootElement = this._element;
  257. if (element) {
  258. rootElement = this._getRootElement(element);
  259. }
  260. var customEvent = this._triggerCloseEvent(rootElement);
  261. if (customEvent.isDefaultPrevented()) {
  262. return;
  263. }
  264. this._removeElement(rootElement);
  265. };
  266. _proto.dispose = function dispose() {
  267. $.removeData(this._element, DATA_KEY);
  268. this._element = null;
  269. } // Private
  270. ;
  271. _proto._getRootElement = function _getRootElement(element) {
  272. var selector = Util.getSelectorFromElement(element);
  273. var parent = false;
  274. if (selector) {
  275. parent = document.querySelector(selector);
  276. }
  277. if (!parent) {
  278. parent = $(element).closest("." + ClassName.ALERT)[0];
  279. }
  280. return parent;
  281. };
  282. _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
  283. var closeEvent = $.Event(Event.CLOSE);
  284. $(element).trigger(closeEvent);
  285. return closeEvent;
  286. };
  287. _proto._removeElement = function _removeElement(element) {
  288. var _this = this;
  289. $(element).removeClass(ClassName.SHOW);
  290. if (!$(element).hasClass(ClassName.FADE)) {
  291. this._destroyElement(element);
  292. return;
  293. }
  294. var transitionDuration = Util.getTransitionDurationFromElement(element);
  295. $(element).one(Util.TRANSITION_END, function (event) {
  296. return _this._destroyElement(element, event);
  297. }).emulateTransitionEnd(transitionDuration);
  298. };
  299. _proto._destroyElement = function _destroyElement(element) {
  300. $(element).detach().trigger(Event.CLOSED).remove();
  301. } // Static
  302. ;
  303. Alert._jQueryInterface = function _jQueryInterface(config) {
  304. return this.each(function () {
  305. var $element = $(this);
  306. var data = $element.data(DATA_KEY);
  307. if (!data) {
  308. data = new Alert(this);
  309. $element.data(DATA_KEY, data);
  310. }
  311. if (config === 'close') {
  312. data[config](this);
  313. }
  314. });
  315. };
  316. Alert._handleDismiss = function _handleDismiss(alertInstance) {
  317. return function (event) {
  318. if (event) {
  319. event.preventDefault();
  320. }
  321. alertInstance.close(this);
  322. };
  323. };
  324. _createClass(Alert, null, [{
  325. key: "VERSION",
  326. get: function get() {
  327. return VERSION;
  328. }
  329. }]);
  330. return Alert;
  331. }();
  332. /**
  333. * ------------------------------------------------------------------------
  334. * Data Api implementation
  335. * ------------------------------------------------------------------------
  336. */
  337. $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  338. /**
  339. * ------------------------------------------------------------------------
  340. * jQuery
  341. * ------------------------------------------------------------------------
  342. */
  343. $.fn[NAME] = Alert._jQueryInterface;
  344. $.fn[NAME].Constructor = Alert;
  345. $.fn[NAME].noConflict = function () {
  346. $.fn[NAME] = JQUERY_NO_CONFLICT;
  347. return Alert._jQueryInterface;
  348. };
  349. /**
  350. * ------------------------------------------------------------------------
  351. * Constants
  352. * ------------------------------------------------------------------------
  353. */
  354. var NAME$1 = 'button';
  355. var VERSION$1 = '4.4.1';
  356. var DATA_KEY$1 = 'bs.button';
  357. var EVENT_KEY$1 = "." + DATA_KEY$1;
  358. var DATA_API_KEY$1 = '.data-api';
  359. var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  360. var ClassName$1 = {
  361. ACTIVE: 'active',
  362. BUTTON: 'btn',
  363. FOCUS: 'focus'
  364. };
  365. var Selector$1 = {
  366. DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
  367. DATA_TOGGLES: '[data-toggle="buttons"]',
  368. DATA_TOGGLE: '[data-toggle="button"]',
  369. DATA_TOGGLES_BUTTONS: '[data-toggle="buttons"] .btn',
  370. INPUT: 'input:not([type="hidden"])',
  371. ACTIVE: '.active',
  372. BUTTON: '.btn'
  373. };
  374. var Event$1 = {
  375. CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
  376. FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1),
  377. LOAD_DATA_API: "load" + EVENT_KEY$1 + DATA_API_KEY$1
  378. };
  379. /**
  380. * ------------------------------------------------------------------------
  381. * Class Definition
  382. * ------------------------------------------------------------------------
  383. */
  384. var Button =
  385. /*#__PURE__*/
  386. function () {
  387. function Button(element) {
  388. this._element = element;
  389. } // Getters
  390. var _proto = Button.prototype;
  391. // Public
  392. _proto.toggle = function toggle() {
  393. var triggerChangeEvent = true;
  394. var addAriaPressed = true;
  395. var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLES)[0];
  396. if (rootElement) {
  397. var input = this._element.querySelector(Selector$1.INPUT);
  398. if (input) {
  399. if (input.type === 'radio') {
  400. if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
  401. triggerChangeEvent = false;
  402. } else {
  403. var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
  404. if (activeElement) {
  405. $(activeElement).removeClass(ClassName$1.ACTIVE);
  406. }
  407. }
  408. } else if (input.type === 'checkbox') {
  409. if (this._element.tagName === 'LABEL' && input.checked === this._element.classList.contains(ClassName$1.ACTIVE)) {
  410. triggerChangeEvent = false;
  411. }
  412. } else {
  413. // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input
  414. triggerChangeEvent = false;
  415. }
  416. if (triggerChangeEvent) {
  417. input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
  418. $(input).trigger('change');
  419. }
  420. input.focus();
  421. addAriaPressed = false;
  422. }
  423. }
  424. if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) {
  425. if (addAriaPressed) {
  426. this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
  427. }
  428. if (triggerChangeEvent) {
  429. $(this._element).toggleClass(ClassName$1.ACTIVE);
  430. }
  431. }
  432. };
  433. _proto.dispose = function dispose() {
  434. $.removeData(this._element, DATA_KEY$1);
  435. this._element = null;
  436. } // Static
  437. ;
  438. Button._jQueryInterface = function _jQueryInterface(config) {
  439. return this.each(function () {
  440. var data = $(this).data(DATA_KEY$1);
  441. if (!data) {
  442. data = new Button(this);
  443. $(this).data(DATA_KEY$1, data);
  444. }
  445. if (config === 'toggle') {
  446. data[config]();
  447. }
  448. });
  449. };
  450. _createClass(Button, null, [{
  451. key: "VERSION",
  452. get: function get() {
  453. return VERSION$1;
  454. }
  455. }]);
  456. return Button;
  457. }();
  458. /**
  459. * ------------------------------------------------------------------------
  460. * Data Api implementation
  461. * ------------------------------------------------------------------------
  462. */
  463. $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  464. var button = event.target;
  465. if (!$(button).hasClass(ClassName$1.BUTTON)) {
  466. button = $(button).closest(Selector$1.BUTTON)[0];
  467. }
  468. if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) {
  469. event.preventDefault(); // work around Firefox bug #1540995
  470. } else {
  471. var inputBtn = button.querySelector(Selector$1.INPUT);
  472. if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) {
  473. event.preventDefault(); // work around Firefox bug #1540995
  474. return;
  475. }
  476. Button._jQueryInterface.call($(button), 'toggle');
  477. }
  478. }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
  479. var button = $(event.target).closest(Selector$1.BUTTON)[0];
  480. $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  481. });
  482. $(window).on(Event$1.LOAD_DATA_API, function () {
  483. // ensure correct active class is set to match the controls' actual values/states
  484. // find all checkboxes/readio buttons inside data-toggle groups
  485. var buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLES_BUTTONS));
  486. for (var i = 0, len = buttons.length; i < len; i++) {
  487. var button = buttons[i];
  488. var input = button.querySelector(Selector$1.INPUT);
  489. if (input.checked || input.hasAttribute('checked')) {
  490. button.classList.add(ClassName$1.ACTIVE);
  491. } else {
  492. button.classList.remove(ClassName$1.ACTIVE);
  493. }
  494. } // find all button toggles
  495. buttons = [].slice.call(document.querySelectorAll(Selector$1.DATA_TOGGLE));
  496. for (var _i = 0, _len = buttons.length; _i < _len; _i++) {
  497. var _button = buttons[_i];
  498. if (_button.getAttribute('aria-pressed') === 'true') {
  499. _button.classList.add(ClassName$1.ACTIVE);
  500. } else {
  501. _button.classList.remove(ClassName$1.ACTIVE);
  502. }
  503. }
  504. });
  505. /**
  506. * ------------------------------------------------------------------------
  507. * jQuery
  508. * ------------------------------------------------------------------------
  509. */
  510. $.fn[NAME$1] = Button._jQueryInterface;
  511. $.fn[NAME$1].Constructor = Button;
  512. $.fn[NAME$1].noConflict = function () {
  513. $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
  514. return Button._jQueryInterface;
  515. };
  516. /**
  517. * ------------------------------------------------------------------------
  518. * Constants
  519. * ------------------------------------------------------------------------
  520. */
  521. var NAME$2 = 'carousel';
  522. var VERSION$2 = '4.4.1';
  523. var DATA_KEY$2 = 'bs.carousel';
  524. var EVENT_KEY$2 = "." + DATA_KEY$2;
  525. var DATA_API_KEY$2 = '.data-api';
  526. var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  527. var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
  528. var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
  529. var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
  530. var SWIPE_THRESHOLD = 40;
  531. var Default = {
  532. interval: 5000,
  533. keyboard: true,
  534. slide: false,
  535. pause: 'hover',
  536. wrap: true,
  537. touch: true
  538. };
  539. var DefaultType = {
  540. interval: '(number|boolean)',
  541. keyboard: 'boolean',
  542. slide: '(boolean|string)',
  543. pause: '(string|boolean)',
  544. wrap: 'boolean',
  545. touch: 'boolean'
  546. };
  547. var Direction = {
  548. NEXT: 'next',
  549. PREV: 'prev',
  550. LEFT: 'left',
  551. RIGHT: 'right'
  552. };
  553. var Event$2 = {
  554. SLIDE: "slide" + EVENT_KEY$2,
  555. SLID: "slid" + EVENT_KEY$2,
  556. KEYDOWN: "keydown" + EVENT_KEY$2,
  557. MOUSEENTER: "mouseenter" + EVENT_KEY$2,
  558. MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
  559. TOUCHSTART: "touchstart" + EVENT_KEY$2,
  560. TOUCHMOVE: "touchmove" + EVENT_KEY$2,
  561. TOUCHEND: "touchend" + EVENT_KEY$2,
  562. POINTERDOWN: "pointerdown" + EVENT_KEY$2,
  563. POINTERUP: "pointerup" + EVENT_KEY$2,
  564. DRAG_START: "dragstart" + EVENT_KEY$2,
  565. LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
  566. CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  567. };
  568. var ClassName$2 = {
  569. CAROUSEL: 'carousel',
  570. ACTIVE: 'active',
  571. SLIDE: 'slide',
  572. RIGHT: 'carousel-item-right',
  573. LEFT: 'carousel-item-left',
  574. NEXT: 'carousel-item-next',
  575. PREV: 'carousel-item-prev',
  576. ITEM: 'carousel-item',
  577. POINTER_EVENT: 'pointer-event'
  578. };
  579. var Selector$2 = {
  580. ACTIVE: '.active',
  581. ACTIVE_ITEM: '.active.carousel-item',
  582. ITEM: '.carousel-item',
  583. ITEM_IMG: '.carousel-item img',
  584. NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
  585. INDICATORS: '.carousel-indicators',
  586. DATA_SLIDE: '[data-slide], [data-slide-to]',
  587. DATA_RIDE: '[data-ride="carousel"]'
  588. };
  589. var PointerType = {
  590. TOUCH: 'touch',
  591. PEN: 'pen'
  592. };
  593. /**
  594. * ------------------------------------------------------------------------
  595. * Class Definition
  596. * ------------------------------------------------------------------------
  597. */
  598. var Carousel =
  599. /*#__PURE__*/
  600. function () {
  601. function Carousel(element, config) {
  602. this._items = null;
  603. this._interval = null;
  604. this._activeElement = null;
  605. this._isPaused = false;
  606. this._isSliding = false;
  607. this.touchTimeout = null;
  608. this.touchStartX = 0;
  609. this.touchDeltaX = 0;
  610. this._config = this._getConfig(config);
  611. this._element = element;
  612. this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
  613. this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
  614. this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);
  615. this._addEventListeners();
  616. } // Getters
  617. var _proto = Carousel.prototype;
  618. // Public
  619. _proto.next = function next() {
  620. if (!this._isSliding) {
  621. this._slide(Direction.NEXT);
  622. }
  623. };
  624. _proto.nextWhenVisible = function nextWhenVisible() {
  625. // Don't call next when the page isn't visible
  626. // or the carousel or its parent isn't visible
  627. if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
  628. this.next();
  629. }
  630. };
  631. _proto.prev = function prev() {
  632. if (!this._isSliding) {
  633. this._slide(Direction.PREV);
  634. }
  635. };
  636. _proto.pause = function pause(event) {
  637. if (!event) {
  638. this._isPaused = true;
  639. }
  640. if (this._element.querySelector(Selector$2.NEXT_PREV)) {
  641. Util.triggerTransitionEnd(this._element);
  642. this.cycle(true);
  643. }
  644. clearInterval(this._interval);
  645. this._interval = null;
  646. };
  647. _proto.cycle = function cycle(event) {
  648. if (!event) {
  649. this._isPaused = false;
  650. }
  651. if (this._interval) {
  652. clearInterval(this._interval);
  653. this._interval = null;
  654. }
  655. if (this._config.interval && !this._isPaused) {
  656. this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
  657. }
  658. };
  659. _proto.to = function to(index) {
  660. var _this = this;
  661. this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  662. var activeIndex = this._getItemIndex(this._activeElement);
  663. if (index > this._items.length - 1 || index < 0) {
  664. return;
  665. }
  666. if (this._isSliding) {
  667. $(this._element).one(Event$2.SLID, function () {
  668. return _this.to(index);
  669. });
  670. return;
  671. }
  672. if (activeIndex === index) {
  673. this.pause();
  674. this.cycle();
  675. return;
  676. }
  677. var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
  678. this._slide(direction, this._items[index]);
  679. };
  680. _proto.dispose = function dispose() {
  681. $(this._element).off(EVENT_KEY$2);
  682. $.removeData(this._element, DATA_KEY$2);
  683. this._items = null;
  684. this._config = null;
  685. this._element = null;
  686. this._interval = null;
  687. this._isPaused = null;
  688. this._isSliding = null;
  689. this._activeElement = null;
  690. this._indicatorsElement = null;
  691. } // Private
  692. ;
  693. _proto._getConfig = function _getConfig(config) {
  694. config = _objectSpread2({}, Default, {}, config);
  695. Util.typeCheckConfig(NAME$2, config, DefaultType);
  696. return config;
  697. };
  698. _proto._handleSwipe = function _handleSwipe() {
  699. var absDeltax = Math.abs(this.touchDeltaX);
  700. if (absDeltax <= SWIPE_THRESHOLD) {
  701. return;
  702. }
  703. var direction = absDeltax / this.touchDeltaX;
  704. this.touchDeltaX = 0; // swipe left
  705. if (direction > 0) {
  706. this.prev();
  707. } // swipe right
  708. if (direction < 0) {
  709. this.next();
  710. }
  711. };
  712. _proto._addEventListeners = function _addEventListeners() {
  713. var _this2 = this;
  714. if (this._config.keyboard) {
  715. $(this._element).on(Event$2.KEYDOWN, function (event) {
  716. return _this2._keydown(event);
  717. });
  718. }
  719. if (this._config.pause === 'hover') {
  720. $(this._element).on(Event$2.MOUSEENTER, function (event) {
  721. return _this2.pause(event);
  722. }).on(Event$2.MOUSELEAVE, function (event) {
  723. return _this2.cycle(event);
  724. });
  725. }
  726. if (this._config.touch) {
  727. this._addTouchEventListeners();
  728. }
  729. };
  730. _proto._addTouchEventListeners = function _addTouchEventListeners() {
  731. var _this3 = this;
  732. if (!this._touchSupported) {
  733. return;
  734. }
  735. var start = function start(event) {
  736. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  737. _this3.touchStartX = event.originalEvent.clientX;
  738. } else if (!_this3._pointerEvent) {
  739. _this3.touchStartX = event.originalEvent.touches[0].clientX;
  740. }
  741. };
  742. var move = function move(event) {
  743. // ensure swiping with one touch and not pinching
  744. if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
  745. _this3.touchDeltaX = 0;
  746. } else {
  747. _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
  748. }
  749. };
  750. var end = function end(event) {
  751. if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) {
  752. _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
  753. }
  754. _this3._handleSwipe();
  755. if (_this3._config.pause === 'hover') {
  756. // If it's a touch-enabled device, mouseenter/leave are fired as
  757. // part of the mouse compatibility events on first tap - the carousel
  758. // would stop cycling until user tapped out of it;
  759. // here, we listen for touchend, explicitly pause the carousel
  760. // (as if it's the second time we tap on it, mouseenter compat event
  761. // is NOT fired) and after a timeout (to allow for mouse compatibility
  762. // events to fire) we explicitly restart cycling
  763. _this3.pause();
  764. if (_this3.touchTimeout) {
  765. clearTimeout(_this3.touchTimeout);
  766. }
  767. _this3.touchTimeout = setTimeout(function (event) {
  768. return _this3.cycle(event);
  769. }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
  770. }
  771. };
  772. $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
  773. return e.preventDefault();
  774. });
  775. if (this._pointerEvent) {
  776. $(this._element).on(Event$2.POINTERDOWN, function (event) {
  777. return start(event);
  778. });
  779. $(this._element).on(Event$2.POINTERUP, function (event) {
  780. return end(event);
  781. });
  782. this._element.classList.add(ClassName$2.POINTER_EVENT);
  783. } else {
  784. $(this._element).on(Event$2.TOUCHSTART, function (event) {
  785. return start(event);
  786. });
  787. $(this._element).on(Event$2.TOUCHMOVE, function (event) {
  788. return move(event);
  789. });
  790. $(this._element).on(Event$2.TOUCHEND, function (event) {
  791. return end(event);
  792. });
  793. }
  794. };
  795. _proto._keydown = function _keydown(event) {
  796. if (/input|textarea/i.test(event.target.tagName)) {
  797. return;
  798. }
  799. switch (event.which) {
  800. case ARROW_LEFT_KEYCODE:
  801. event.preventDefault();
  802. this.prev();
  803. break;
  804. case ARROW_RIGHT_KEYCODE:
  805. event.preventDefault();
  806. this.next();
  807. break;
  808. }
  809. };
  810. _proto._getItemIndex = function _getItemIndex(element) {
  811. this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
  812. return this._items.indexOf(element);
  813. };
  814. _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
  815. var isNextDirection = direction === Direction.NEXT;
  816. var isPrevDirection = direction === Direction.PREV;
  817. var activeIndex = this._getItemIndex(activeElement);
  818. var lastItemIndex = this._items.length - 1;
  819. var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
  820. if (isGoingToWrap && !this._config.wrap) {
  821. return activeElement;
  822. }
  823. var delta = direction === Direction.PREV ? -1 : 1;
  824. var itemIndex = (activeIndex + delta) % this._items.length;
  825. return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
  826. };
  827. _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
  828. var targetIndex = this._getItemIndex(relatedTarget);
  829. var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
  830. var slideEvent = $.Event(Event$2.SLIDE, {
  831. relatedTarget: relatedTarget,
  832. direction: eventDirectionName,
  833. from: fromIndex,
  834. to: targetIndex
  835. });
  836. $(this._element).trigger(slideEvent);
  837. return slideEvent;
  838. };
  839. _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
  840. if (this._indicatorsElement) {
  841. var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
  842. $(indicators).removeClass(ClassName$2.ACTIVE);
  843. var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
  844. if (nextIndicator) {
  845. $(nextIndicator).addClass(ClassName$2.ACTIVE);
  846. }
  847. }
  848. };
  849. _proto._slide = function _slide(direction, element) {
  850. var _this4 = this;
  851. var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
  852. var activeElementIndex = this._getItemIndex(activeElement);
  853. var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
  854. var nextElementIndex = this._getItemIndex(nextElement);
  855. var isCycling = Boolean(this._interval);
  856. var directionalClassName;
  857. var orderClassName;
  858. var eventDirectionName;
  859. if (direction === Direction.NEXT) {
  860. directionalClassName = ClassName$2.LEFT;
  861. orderClassName = ClassName$2.NEXT;
  862. eventDirectionName = Direction.LEFT;
  863. } else {
  864. directionalClassName = ClassName$2.RIGHT;
  865. orderClassName = ClassName$2.PREV;
  866. eventDirectionName = Direction.RIGHT;
  867. }
  868. if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
  869. this._isSliding = false;
  870. return;
  871. }
  872. var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
  873. if (slideEvent.isDefaultPrevented()) {
  874. return;
  875. }
  876. if (!activeElement || !nextElement) {
  877. // Some weirdness is happening, so we bail
  878. return;
  879. }
  880. this._isSliding = true;
  881. if (isCycling) {
  882. this.pause();
  883. }
  884. this._setActiveIndicatorElement(nextElement);
  885. var slidEvent = $.Event(Event$2.SLID, {
  886. relatedTarget: nextElement,
  887. direction: eventDirectionName,
  888. from: activeElementIndex,
  889. to: nextElementIndex
  890. });
  891. if ($(this._element).hasClass(ClassName$2.SLIDE)) {
  892. $(nextElement).addClass(orderClassName);
  893. Util.reflow(nextElement);
  894. $(activeElement).addClass(directionalClassName);
  895. $(nextElement).addClass(directionalClassName);
  896. var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
  897. if (nextElementInterval) {
  898. this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
  899. this._config.interval = nextElementInterval;
  900. } else {
  901. this._config.interval = this._config.defaultInterval || this._config.interval;
  902. }
  903. var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
  904. $(activeElement).one(Util.TRANSITION_END, function () {
  905. $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
  906. $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
  907. _this4._isSliding = false;
  908. setTimeout(function () {
  909. return $(_this4._element).trigger(slidEvent);
  910. }, 0);
  911. }).emulateTransitionEnd(transitionDuration);
  912. } else {
  913. $(activeElement).removeClass(ClassName$2.ACTIVE);
  914. $(nextElement).addClass(ClassName$2.ACTIVE);
  915. this._isSliding = false;
  916. $(this._element).trigger(slidEvent);
  917. }
  918. if (isCycling) {
  919. this.cycle();
  920. }
  921. } // Static
  922. ;
  923. Carousel._jQueryInterface = function _jQueryInterface(config) {
  924. return this.each(function () {
  925. var data = $(this).data(DATA_KEY$2);
  926. var _config = _objectSpread2({}, Default, {}, $(this).data());
  927. if (typeof config === 'object') {
  928. _config = _objectSpread2({}, _config, {}, config);
  929. }
  930. var action = typeof config === 'string' ? config : _config.slide;
  931. if (!data) {
  932. data = new Carousel(this, _config);
  933. $(this).data(DATA_KEY$2, data);
  934. }
  935. if (typeof config === 'number') {
  936. data.to(config);
  937. } else if (typeof action === 'string') {
  938. if (typeof data[action] === 'undefined') {
  939. throw new TypeError("No method named \"" + action + "\"");
  940. }
  941. data[action]();
  942. } else if (_config.interval && _config.ride) {
  943. data.pause();
  944. data.cycle();
  945. }
  946. });
  947. };
  948. Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
  949. var selector = Util.getSelectorFromElement(this);
  950. if (!selector) {
  951. return;
  952. }
  953. var target = $(selector)[0];
  954. if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
  955. return;
  956. }
  957. var config = _objectSpread2({}, $(target).data(), {}, $(this).data());
  958. var slideIndex = this.getAttribute('data-slide-to');
  959. if (slideIndex) {
  960. config.interval = false;
  961. }
  962. Carousel._jQueryInterface.call($(target), config);
  963. if (slideIndex) {
  964. $(target).data(DATA_KEY$2).to(slideIndex);
  965. }
  966. event.preventDefault();
  967. };
  968. _createClass(Carousel, null, [{
  969. key: "VERSION",
  970. get: function get() {
  971. return VERSION$2;
  972. }
  973. }, {
  974. key: "Default",
  975. get: function get() {
  976. return Default;
  977. }
  978. }]);
  979. return Carousel;
  980. }();
  981. /**
  982. * ------------------------------------------------------------------------
  983. * Data Api implementation
  984. * ------------------------------------------------------------------------
  985. */
  986. $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  987. $(window).on(Event$2.LOAD_DATA_API, function () {
  988. var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));
  989. for (var i = 0, len = carousels.length; i < len; i++) {
  990. var $carousel = $(carousels[i]);
  991. Carousel._jQueryInterface.call($carousel, $carousel.data());
  992. }
  993. });
  994. /**
  995. * ------------------------------------------------------------------------
  996. * jQuery
  997. * ------------------------------------------------------------------------
  998. */
  999. $.fn[NAME$2] = Carousel._jQueryInterface;
  1000. $.fn[NAME$2].Constructor = Carousel;
  1001. $.fn[NAME$2].noConflict = function () {
  1002. $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
  1003. return Carousel._jQueryInterface;
  1004. };
  1005. /**
  1006. * ------------------------------------------------------------------------
  1007. * Constants
  1008. * ------------------------------------------------------------------------
  1009. */
  1010. var NAME$3 = 'collapse';
  1011. var VERSION$3 = '4.4.1';
  1012. var DATA_KEY$3 = 'bs.collapse';
  1013. var EVENT_KEY$3 = "." + DATA_KEY$3;
  1014. var DATA_API_KEY$3 = '.data-api';
  1015. var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  1016. var Default$1 = {
  1017. toggle: true,
  1018. parent: ''
  1019. };
  1020. var DefaultType$1 = {
  1021. toggle: 'boolean',
  1022. parent: '(string|element)'
  1023. };
  1024. var Event$3 = {
  1025. SHOW: "show" + EVENT_KEY$3,
  1026. SHOWN: "shown" + EVENT_KEY$3,
  1027. HIDE: "hide" + EVENT_KEY$3,
  1028. HIDDEN: "hidden" + EVENT_KEY$3,
  1029. CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  1030. };
  1031. var ClassName$3 = {
  1032. SHOW: 'show',
  1033. COLLAPSE: 'collapse',
  1034. COLLAPSING: 'collapsing',
  1035. COLLAPSED: 'collapsed'
  1036. };
  1037. var Dimension = {
  1038. WIDTH: 'width',
  1039. HEIGHT: 'height'
  1040. };
  1041. var Selector$3 = {
  1042. ACTIVES: '.show, .collapsing',
  1043. DATA_TOGGLE: '[data-toggle="collapse"]'
  1044. };
  1045. /**
  1046. * ------------------------------------------------------------------------
  1047. * Class Definition
  1048. * ------------------------------------------------------------------------
  1049. */
  1050. var Collapse =
  1051. /*#__PURE__*/
  1052. function () {
  1053. function Collapse(element, config) {
  1054. this._isTransitioning = false;
  1055. this._element = element;
  1056. this._config = this._getConfig(config);
  1057. this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
  1058. var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));
  1059. for (var i = 0, len = toggleList.length; i < len; i++) {
  1060. var elem = toggleList[i];
  1061. var selector = Util.getSelectorFromElement(elem);
  1062. var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
  1063. return foundElem === element;
  1064. });
  1065. if (selector !== null && filterElement.length > 0) {
  1066. this._selector = selector;
  1067. this._triggerArray.push(elem);
  1068. }
  1069. }
  1070. this._parent = this._config.parent ? this._getParent() : null;
  1071. if (!this._config.parent) {
  1072. this._addAriaAndCollapsedClass(this._element, this._triggerArray);
  1073. }
  1074. if (this._config.toggle) {
  1075. this.toggle();
  1076. }
  1077. } // Getters
  1078. var _proto = Collapse.prototype;
  1079. // Public
  1080. _proto.toggle = function toggle() {
  1081. if ($(this._element).hasClass(ClassName$3.SHOW)) {
  1082. this.hide();
  1083. } else {
  1084. this.show();
  1085. }
  1086. };
  1087. _proto.show = function show() {
  1088. var _this = this;
  1089. if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
  1090. return;
  1091. }
  1092. var actives;
  1093. var activesData;
  1094. if (this._parent) {
  1095. actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
  1096. if (typeof _this._config.parent === 'string') {
  1097. return elem.getAttribute('data-parent') === _this._config.parent;
  1098. }
  1099. return elem.classList.contains(ClassName$3.COLLAPSE);
  1100. });
  1101. if (actives.length === 0) {
  1102. actives = null;
  1103. }
  1104. }
  1105. if (actives) {
  1106. activesData = $(actives).not(this._selector).data(DATA_KEY$3);
  1107. if (activesData && activesData._isTransitioning) {
  1108. return;
  1109. }
  1110. }
  1111. var startEvent = $.Event(Event$3.SHOW);
  1112. $(this._element).trigger(startEvent);
  1113. if (startEvent.isDefaultPrevented()) {
  1114. return;
  1115. }
  1116. if (actives) {
  1117. Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
  1118. if (!activesData) {
  1119. $(actives).data(DATA_KEY$3, null);
  1120. }
  1121. }
  1122. var dimension = this._getDimension();
  1123. $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
  1124. this._element.style[dimension] = 0;
  1125. if (this._triggerArray.length) {
  1126. $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
  1127. }
  1128. this.setTransitioning(true);
  1129. var complete = function complete() {
  1130. $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
  1131. _this._element.style[dimension] = '';
  1132. _this.setTransitioning(false);
  1133. $(_this._element).trigger(Event$3.SHOWN);
  1134. };
  1135. var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
  1136. var scrollSize = "scroll" + capitalizedDimension;
  1137. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1138. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1139. this._element.style[dimension] = this._element[scrollSize] + "px";
  1140. };
  1141. _proto.hide = function hide() {
  1142. var _this2 = this;
  1143. if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
  1144. return;
  1145. }
  1146. var startEvent = $.Event(Event$3.HIDE);
  1147. $(this._element).trigger(startEvent);
  1148. if (startEvent.isDefaultPrevented()) {
  1149. return;
  1150. }
  1151. var dimension = this._getDimension();
  1152. this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
  1153. Util.reflow(this._element);
  1154. $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
  1155. var triggerArrayLength = this._triggerArray.length;
  1156. if (triggerArrayLength > 0) {
  1157. for (var i = 0; i < triggerArrayLength; i++) {
  1158. var trigger = this._triggerArray[i];
  1159. var selector = Util.getSelectorFromElement(trigger);
  1160. if (selector !== null) {
  1161. var $elem = $([].slice.call(document.querySelectorAll(selector)));
  1162. if (!$elem.hasClass(ClassName$3.SHOW)) {
  1163. $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
  1164. }
  1165. }
  1166. }
  1167. }
  1168. this.setTransitioning(true);
  1169. var complete = function complete() {
  1170. _this2.setTransitioning(false);
  1171. $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
  1172. };
  1173. this._element.style[dimension] = '';
  1174. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1175. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  1176. };
  1177. _proto.setTransitioning = function setTransitioning(isTransitioning) {
  1178. this._isTransitioning = isTransitioning;
  1179. };
  1180. _proto.dispose = function dispose() {
  1181. $.removeData(this._element, DATA_KEY$3);
  1182. this._config = null;
  1183. this._parent = null;
  1184. this._element = null;
  1185. this._triggerArray = null;
  1186. this._isTransitioning = null;
  1187. } // Private
  1188. ;
  1189. _proto._getConfig = function _getConfig(config) {
  1190. config = _objectSpread2({}, Default$1, {}, config);
  1191. config.toggle = Boolean(config.toggle); // Coerce string values
  1192. Util.typeCheckConfig(NAME$3, config, DefaultType$1);
  1193. return config;
  1194. };
  1195. _proto._getDimension = function _getDimension() {
  1196. var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
  1197. return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
  1198. };
  1199. _proto._getParent = function _getParent() {
  1200. var _this3 = this;
  1201. var parent;
  1202. if (Util.isElement(this._config.parent)) {
  1203. parent = this._config.parent; // It's a jQuery object
  1204. if (typeof this._config.parent.jquery !== 'undefined') {
  1205. parent = this._config.parent[0];
  1206. }
  1207. } else {
  1208. parent = document.querySelector(this._config.parent);
  1209. }
  1210. var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
  1211. var children = [].slice.call(parent.querySelectorAll(selector));
  1212. $(children).each(function (i, element) {
  1213. _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
  1214. });
  1215. return parent;
  1216. };
  1217. _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
  1218. var isOpen = $(element).hasClass(ClassName$3.SHOW);
  1219. if (triggerArray.length) {
  1220. $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
  1221. }
  1222. } // Static
  1223. ;
  1224. Collapse._getTargetFromElement = function _getTargetFromElement(element) {
  1225. var selector = Util.getSelectorFromElement(element);
  1226. return selector ? document.querySelector(selector) : null;
  1227. };
  1228. Collapse._jQueryInterface = function _jQueryInterface(config) {
  1229. return this.each(function () {
  1230. var $this = $(this);
  1231. var data = $this.data(DATA_KEY$3);
  1232. var _config = _objectSpread2({}, Default$1, {}, $this.data(), {}, typeof config === 'object' && config ? config : {});
  1233. if (!data && _config.toggle && /show|hide/.test(config)) {
  1234. _config.toggle = false;
  1235. }
  1236. if (!data) {
  1237. data = new Collapse(this, _config);
  1238. $this.data(DATA_KEY$3, data);
  1239. }
  1240. if (typeof config === 'string') {
  1241. if (typeof data[config] === 'undefined') {
  1242. throw new TypeError("No method named \"" + config + "\"");
  1243. }
  1244. data[config]();
  1245. }
  1246. });
  1247. };
  1248. _createClass(Collapse, null, [{
  1249. key: "VERSION",
  1250. get: function get() {
  1251. return VERSION$3;
  1252. }
  1253. }, {
  1254. key: "Default",
  1255. get: function get() {
  1256. return Default$1;
  1257. }
  1258. }]);
  1259. return Collapse;
  1260. }();
  1261. /**
  1262. * ------------------------------------------------------------------------
  1263. * Data Api implementation
  1264. * ------------------------------------------------------------------------
  1265. */
  1266. $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
  1267. // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  1268. if (event.currentTarget.tagName === 'A') {
  1269. event.preventDefault();
  1270. }
  1271. var $trigger = $(this);
  1272. var selector = Util.getSelectorFromElement(this);
  1273. var selectors = [].slice.call(document.querySelectorAll(selector));
  1274. $(selectors).each(function () {
  1275. var $target = $(this);
  1276. var data = $target.data(DATA_KEY$3);
  1277. var config = data ? 'toggle' : $trigger.data();
  1278. Collapse._jQueryInterface.call($target, config);
  1279. });
  1280. });
  1281. /**
  1282. * ------------------------------------------------------------------------
  1283. * jQuery
  1284. * ------------------------------------------------------------------------
  1285. */
  1286. $.fn[NAME$3] = Collapse._jQueryInterface;
  1287. $.fn[NAME$3].Constructor = Collapse;
  1288. $.fn[NAME$3].noConflict = function () {
  1289. $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
  1290. return Collapse._jQueryInterface;
  1291. };
  1292. /**
  1293. * ------------------------------------------------------------------------
  1294. * Constants
  1295. * ------------------------------------------------------------------------
  1296. */
  1297. var NAME$4 = 'dropdown';
  1298. var VERSION$4 = '4.4.1';
  1299. var DATA_KEY$4 = 'bs.dropdown';
  1300. var EVENT_KEY$4 = "." + DATA_KEY$4;
  1301. var DATA_API_KEY$4 = '.data-api';
  1302. var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  1303. var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
  1304. var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
  1305. var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
  1306. var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
  1307. var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
  1308. var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
  1309. var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  1310. var Event$4 = {
  1311. HIDE: "hide" + EVENT_KEY$4,
  1312. HIDDEN: "hidden" + EVENT_KEY$4,
  1313. SHOW: "show" + EVENT_KEY$4,
  1314. SHOWN: "shown" + EVENT_KEY$4,
  1315. CLICK: "click" + EVENT_KEY$4,
  1316. CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
  1317. KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
  1318. KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  1319. };
  1320. var ClassName$4 = {
  1321. DISABLED: 'disabled',
  1322. SHOW: 'show',
  1323. DROPUP: 'dropup',
  1324. DROPRIGHT: 'dropright',
  1325. DROPLEFT: 'dropleft',
  1326. MENURIGHT: 'dropdown-menu-right',
  1327. MENULEFT: 'dropdown-menu-left',
  1328. POSITION_STATIC: 'position-static'
  1329. };
  1330. var Selector$4 = {
  1331. DATA_TOGGLE: '[data-toggle="dropdown"]',
  1332. FORM_CHILD: '.dropdown form',
  1333. MENU: '.dropdown-menu',
  1334. NAVBAR_NAV: '.navbar-nav',
  1335. VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  1336. };
  1337. var AttachmentMap = {
  1338. TOP: 'top-start',
  1339. TOPEND: 'top-end',
  1340. BOTTOM: 'bottom-start',
  1341. BOTTOMEND: 'bottom-end',
  1342. RIGHT: 'right-start',
  1343. RIGHTEND: 'right-end',
  1344. LEFT: 'left-start',
  1345. LEFTEND: 'left-end'
  1346. };
  1347. var Default$2 = {
  1348. offset: 0,
  1349. flip: true,
  1350. boundary: 'scrollParent',
  1351. reference: 'toggle',
  1352. display: 'dynamic',
  1353. popperConfig: null
  1354. };
  1355. var DefaultType$2 = {
  1356. offset: '(number|string|function)',
  1357. flip: 'boolean',
  1358. boundary: '(string|element)',
  1359. reference: '(string|element)',
  1360. display: 'string',
  1361. popperConfig: '(null|object)'
  1362. };
  1363. /**
  1364. * ------------------------------------------------------------------------
  1365. * Class Definition
  1366. * ------------------------------------------------------------------------
  1367. */
  1368. var Dropdown =
  1369. /*#__PURE__*/
  1370. function () {
  1371. function Dropdown(element, config) {
  1372. this._element = element;
  1373. this._popper = null;
  1374. this._config = this._getConfig(config);
  1375. this._menu = this._getMenuElement();
  1376. this._inNavbar = this._detectNavbar();
  1377. this._addEventListeners();
  1378. } // Getters
  1379. var _proto = Dropdown.prototype;
  1380. // Public
  1381. _proto.toggle = function toggle() {
  1382. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
  1383. return;
  1384. }
  1385. var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
  1386. Dropdown._clearMenus();
  1387. if (isActive) {
  1388. return;
  1389. }
  1390. this.show(true);
  1391. };
  1392. _proto.show = function show(usePopper) {
  1393. if (usePopper === void 0) {
  1394. usePopper = false;
  1395. }
  1396. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
  1397. return;
  1398. }
  1399. var relatedTarget = {
  1400. relatedTarget: this._element
  1401. };
  1402. var showEvent = $.Event(Event$4.SHOW, relatedTarget);
  1403. var parent = Dropdown._getParentFromElement(this._element);
  1404. $(parent).trigger(showEvent);
  1405. if (showEvent.isDefaultPrevented()) {
  1406. return;
  1407. } // Disable totally Popper.js for Dropdown in Navbar
  1408. if (!this._inNavbar && usePopper) {
  1409. /**
  1410. * Check for Popper dependency
  1411. * Popper - https://popper.js.org
  1412. */
  1413. if (typeof Popper === 'undefined') {
  1414. throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
  1415. }
  1416. var referenceElement = this._element;
  1417. if (this._config.reference === 'parent') {
  1418. referenceElement = parent;
  1419. } else if (Util.isElement(this._config.reference)) {
  1420. referenceElement = this._config.reference; // Check if it's jQuery element
  1421. if (typeof this._config.reference.jquery !== 'undefined') {
  1422. referenceElement = this._config.reference[0];
  1423. }
  1424. } // If boundary is not `scrollParent`, then set position to `static`
  1425. // to allow the menu to "escape" the scroll parent's boundaries
  1426. // https://github.com/twbs/bootstrap/issues/24251
  1427. if (this._config.boundary !== 'scrollParent') {
  1428. $(parent).addClass(ClassName$4.POSITION_STATIC);
  1429. }
  1430. this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
  1431. } // If this is a touch-enabled device we add extra
  1432. // empty mouseover listeners to the body's immediate children;
  1433. // only needed because of broken event delegation on iOS
  1434. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  1435. if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
  1436. $(document.body).children().on('mouseover', null, $.noop);
  1437. }
  1438. this._element.focus();
  1439. this._element.setAttribute('aria-expanded', true);
  1440. $(this._menu).toggleClass(ClassName$4.SHOW);
  1441. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
  1442. };
  1443. _proto.hide = function hide() {
  1444. if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
  1445. return;
  1446. }
  1447. var relatedTarget = {
  1448. relatedTarget: this._element
  1449. };
  1450. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  1451. var parent = Dropdown._getParentFromElement(this._element);
  1452. $(parent).trigger(hideEvent);
  1453. if (hideEvent.isDefaultPrevented()) {
  1454. return;
  1455. }
  1456. if (this._popper) {
  1457. this._popper.destroy();
  1458. }
  1459. $(this._menu).toggleClass(ClassName$4.SHOW);
  1460. $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  1461. };
  1462. _proto.dispose = function dispose() {
  1463. $.removeData(this._element, DATA_KEY$4);
  1464. $(this._element).off(EVENT_KEY$4);
  1465. this._element = null;
  1466. this._menu = null;
  1467. if (this._popper !== null) {
  1468. this._popper.destroy();
  1469. this._popper = null;
  1470. }
  1471. };
  1472. _proto.update = function update() {
  1473. this._inNavbar = this._detectNavbar();
  1474. if (this._popper !== null) {
  1475. this._popper.scheduleUpdate();
  1476. }
  1477. } // Private
  1478. ;
  1479. _proto._addEventListeners = function _addEventListeners() {
  1480. var _this = this;
  1481. $(this._element).on(Event$4.CLICK, function (event) {
  1482. event.preventDefault();
  1483. event.stopPropagation();
  1484. _this.toggle();
  1485. });
  1486. };
  1487. _proto._getConfig = function _getConfig(config) {
  1488. config = _objectSpread2({}, this.constructor.Default, {}, $(this._element).data(), {}, config);
  1489. Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
  1490. return config;
  1491. };
  1492. _proto._getMenuElement = function _getMenuElement() {
  1493. if (!this._menu) {
  1494. var parent = Dropdown._getParentFromElement(this._element);
  1495. if (parent) {
  1496. this._menu = parent.querySelector(Selector$4.MENU);
  1497. }
  1498. }
  1499. return this._menu;
  1500. };
  1501. _proto._getPlacement = function _getPlacement() {
  1502. var $parentDropdown = $(this._element.parentNode);
  1503. var placement = AttachmentMap.BOTTOM; // Handle dropup
  1504. if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
  1505. placement = AttachmentMap.TOP;
  1506. if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  1507. placement = AttachmentMap.TOPEND;
  1508. }
  1509. } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
  1510. placement = AttachmentMap.RIGHT;
  1511. } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
  1512. placement = AttachmentMap.LEFT;
  1513. } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
  1514. placement = AttachmentMap.BOTTOMEND;
  1515. }
  1516. return placement;
  1517. };
  1518. _proto._detectNavbar = function _detectNavbar() {
  1519. return $(this._element).closest('.navbar').length > 0;
  1520. };
  1521. _proto._getOffset = function _getOffset() {
  1522. var _this2 = this;
  1523. var offset = {};
  1524. if (typeof this._config.offset === 'function') {
  1525. offset.fn = function (data) {
  1526. data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
  1527. return data;
  1528. };
  1529. } else {
  1530. offset.offset = this._config.offset;
  1531. }
  1532. return offset;
  1533. };
  1534. _proto._getPopperConfig = function _getPopperConfig() {
  1535. var popperConfig = {
  1536. placement: this._getPlacement(),
  1537. modifiers: {
  1538. offset: this._getOffset(),
  1539. flip: {
  1540. enabled: this._config.flip
  1541. },
  1542. preventOverflow: {
  1543. boundariesElement: this._config.boundary
  1544. }
  1545. }
  1546. }; // Disable Popper.js if we have a static display
  1547. if (this._config.display === 'static') {
  1548. popperConfig.modifiers.applyStyle = {
  1549. enabled: false
  1550. };
  1551. }
  1552. return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
  1553. } // Static
  1554. ;
  1555. Dropdown._jQueryInterface = function _jQueryInterface(config) {
  1556. return this.each(function () {
  1557. var data = $(this).data(DATA_KEY$4);
  1558. var _config = typeof config === 'object' ? config : null;
  1559. if (!data) {
  1560. data = new Dropdown(this, _config);
  1561. $(this).data(DATA_KEY$4, data);
  1562. }
  1563. if (typeof config === 'string') {
  1564. if (typeof data[config] === 'undefined') {
  1565. throw new TypeError("No method named \"" + config + "\"");
  1566. }
  1567. data[config]();
  1568. }
  1569. });
  1570. };
  1571. Dropdown._clearMenus = function _clearMenus(event) {
  1572. if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
  1573. return;
  1574. }
  1575. var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
  1576. for (var i = 0, len = toggles.length; i < len; i++) {
  1577. var parent = Dropdown._getParentFromElement(toggles[i]);
  1578. var context = $(toggles[i]).data(DATA_KEY$4);
  1579. var relatedTarget = {
  1580. relatedTarget: toggles[i]
  1581. };
  1582. if (event && event.type === 'click') {
  1583. relatedTarget.clickEvent = event;
  1584. }
  1585. if (!context) {
  1586. continue;
  1587. }
  1588. var dropdownMenu = context._menu;
  1589. if (!$(parent).hasClass(ClassName$4.SHOW)) {
  1590. continue;
  1591. }
  1592. if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
  1593. continue;
  1594. }
  1595. var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
  1596. $(parent).trigger(hideEvent);
  1597. if (hideEvent.isDefaultPrevented()) {
  1598. continue;
  1599. } // If this is a touch-enabled device we remove the extra
  1600. // empty mouseover listeners we added for iOS support
  1601. if ('ontouchstart' in document.documentElement) {
  1602. $(document.body).children().off('mouseover', null, $.noop);
  1603. }
  1604. toggles[i].setAttribute('aria-expanded', 'false');
  1605. if (context._popper) {
  1606. context._popper.destroy();
  1607. }
  1608. $(dropdownMenu).removeClass(ClassName$4.SHOW);
  1609. $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
  1610. }
  1611. };
  1612. Dropdown._getParentFromElement = function _getParentFromElement(element) {
  1613. var parent;
  1614. var selector = Util.getSelectorFromElement(element);
  1615. if (selector) {
  1616. parent = document.querySelector(selector);
  1617. }
  1618. return parent || element.parentNode;
  1619. } // eslint-disable-next-line complexity
  1620. ;
  1621. Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
  1622. // If not input/textarea:
  1623. // - And not a key in REGEXP_KEYDOWN => not a dropdown command
  1624. // If input/textarea:
  1625. // - If space key => not a dropdown command
  1626. // - If key is other than escape
  1627. // - If key is not up or down => not a dropdown command
  1628. // - If trigger inside the menu => not a dropdown command
  1629. 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 || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) {
  1630. return;
  1631. }
  1632. event.preventDefault();
  1633. event.stopPropagation();
  1634. if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
  1635. return;
  1636. }
  1637. var parent = Dropdown._getParentFromElement(this);
  1638. var isActive = $(parent).hasClass(ClassName$4.SHOW);
  1639. if (!isActive && event.which === ESCAPE_KEYCODE) {
  1640. return;
  1641. }
  1642. if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
  1643. if (event.which === ESCAPE_KEYCODE) {
  1644. var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
  1645. $(toggle).trigger('focus');
  1646. }
  1647. $(this).trigger('click');
  1648. return;
  1649. }
  1650. var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)).filter(function (item) {
  1651. return $(item).is(':visible');
  1652. });
  1653. if (items.length === 0) {
  1654. return;
  1655. }
  1656. var index = items.indexOf(event.target);
  1657. if (event.which === ARROW_UP_KEYCODE && index > 0) {
  1658. // Up
  1659. index--;
  1660. }
  1661. if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
  1662. // Down
  1663. index++;
  1664. }
  1665. if (index < 0) {
  1666. index = 0;
  1667. }
  1668. items[index].focus();
  1669. };
  1670. _createClass(Dropdown, null, [{
  1671. key: "VERSION",
  1672. get: function get() {
  1673. return VERSION$4;
  1674. }
  1675. }, {
  1676. key: "Default",
  1677. get: function get() {
  1678. return Default$2;
  1679. }
  1680. }, {
  1681. key: "DefaultType",
  1682. get: function get() {
  1683. return DefaultType$2;
  1684. }
  1685. }]);
  1686. return Dropdown;
  1687. }();
  1688. /**
  1689. * ------------------------------------------------------------------------
  1690. * Data Api implementation
  1691. * ------------------------------------------------------------------------
  1692. */
  1693. $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) {
  1694. event.preventDefault();
  1695. event.stopPropagation();
  1696. Dropdown._jQueryInterface.call($(this), 'toggle');
  1697. }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
  1698. e.stopPropagation();
  1699. });
  1700. /**
  1701. * ------------------------------------------------------------------------
  1702. * jQuery
  1703. * ------------------------------------------------------------------------
  1704. */
  1705. $.fn[NAME$4] = Dropdown._jQueryInterface;
  1706. $.fn[NAME$4].Constructor = Dropdown;
  1707. $.fn[NAME$4].noConflict = function () {
  1708. $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
  1709. return Dropdown._jQueryInterface;
  1710. };
  1711. /**
  1712. * ------------------------------------------------------------------------
  1713. * Constants
  1714. * ------------------------------------------------------------------------
  1715. */
  1716. var NAME$5 = 'modal';
  1717. var VERSION$5 = '4.4.1';
  1718. var DATA_KEY$5 = 'bs.modal';
  1719. var EVENT_KEY$5 = "." + DATA_KEY$5;
  1720. var DATA_API_KEY$5 = '.data-api';
  1721. var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  1722. var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
  1723. var Default$3 = {
  1724. backdrop: true,
  1725. keyboard: true,
  1726. focus: true,
  1727. show: true
  1728. };
  1729. var DefaultType$3 = {
  1730. backdrop: '(boolean|string)',
  1731. keyboard: 'boolean',
  1732. focus: 'boolean',
  1733. show: 'boolean'
  1734. };
  1735. var Event$5 = {
  1736. HIDE: "hide" + EVENT_KEY$5,
  1737. HIDE_PREVENTED: "hidePrevented" + EVENT_KEY$5,
  1738. HIDDEN: "hidden" + EVENT_KEY$5,
  1739. SHOW: "show" + EVENT_KEY$5,
  1740. SHOWN: "shown" + EVENT_KEY$5,
  1741. FOCUSIN: "focusin" + EVENT_KEY$5,
  1742. RESIZE: "resize" + EVENT_KEY$5,
  1743. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
  1744. KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
  1745. MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
  1746. MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
  1747. CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  1748. };
  1749. var ClassName$5 = {
  1750. SCROLLABLE: 'modal-dialog-scrollable',
  1751. SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
  1752. BACKDROP: 'modal-backdrop',
  1753. OPEN: 'modal-open',
  1754. FADE: 'fade',
  1755. SHOW: 'show',
  1756. STATIC: 'modal-static'
  1757. };
  1758. var Selector$5 = {
  1759. DIALOG: '.modal-dialog',
  1760. MODAL_BODY: '.modal-body',
  1761. DATA_TOGGLE: '[data-toggle="modal"]',
  1762. DATA_DISMISS: '[data-dismiss="modal"]',
  1763. FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
  1764. STICKY_CONTENT: '.sticky-top'
  1765. };
  1766. /**
  1767. * ------------------------------------------------------------------------
  1768. * Class Definition
  1769. * ------------------------------------------------------------------------
  1770. */
  1771. var Modal =
  1772. /*#__PURE__*/
  1773. function () {
  1774. function Modal(element, config) {
  1775. this._config = this._getConfig(config);
  1776. this._element = element;
  1777. this._dialog = element.querySelector(Selector$5.DIALOG);
  1778. this._backdrop = null;
  1779. this._isShown = false;
  1780. this._isBodyOverflowing = false;
  1781. this._ignoreBackdropClick = false;
  1782. this._isTransitioning = false;
  1783. this._scrollbarWidth = 0;
  1784. } // Getters
  1785. var _proto = Modal.prototype;
  1786. // Public
  1787. _proto.toggle = function toggle(relatedTarget) {
  1788. return this._isShown ? this.hide() : this.show(relatedTarget);
  1789. };
  1790. _proto.show = function show(relatedTarget) {
  1791. var _this = this;
  1792. if (this._isShown || this._isTransitioning) {
  1793. return;
  1794. }
  1795. if ($(this._element).hasClass(ClassName$5.FADE)) {
  1796. this._isTransitioning = true;
  1797. }
  1798. var showEvent = $.Event(Event$5.SHOW, {
  1799. relatedTarget: relatedTarget
  1800. });
  1801. $(this._element).trigger(showEvent);
  1802. if (this._isShown || showEvent.isDefaultPrevented()) {
  1803. return;
  1804. }
  1805. this._isShown = true;
  1806. this._checkScrollbar();
  1807. this._setScrollbar();
  1808. this._adjustDialog();
  1809. this._setEscapeEvent();
  1810. this._setResizeEvent();
  1811. $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
  1812. return _this.hide(event);
  1813. });
  1814. $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
  1815. $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
  1816. if ($(event.target).is(_this._element)) {
  1817. _this._ignoreBackdropClick = true;
  1818. }
  1819. });
  1820. });
  1821. this._showBackdrop(function () {
  1822. return _this._showElement(relatedTarget);
  1823. });
  1824. };
  1825. _proto.hide = function hide(event) {
  1826. var _this2 = this;
  1827. if (event) {
  1828. event.preventDefault();
  1829. }
  1830. if (!this._isShown || this._isTransitioning) {
  1831. return;
  1832. }
  1833. var hideEvent = $.Event(Event$5.HIDE);
  1834. $(this._element).trigger(hideEvent);
  1835. if (!this._isShown || hideEvent.isDefaultPrevented()) {
  1836. return;
  1837. }
  1838. this._isShown = false;
  1839. var transition = $(this._element).hasClass(ClassName$5.FADE);
  1840. if (transition) {
  1841. this._isTransitioning = true;
  1842. }
  1843. this._setEscapeEvent();
  1844. this._setResizeEvent();
  1845. $(document).off(Event$5.FOCUSIN);
  1846. $(this._element).removeClass(ClassName$5.SHOW);
  1847. $(this._element).off(Event$5.CLICK_DISMISS);
  1848. $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
  1849. if (transition) {
  1850. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  1851. $(this._element).one(Util.TRANSITION_END, function (event) {
  1852. return _this2._hideModal(event);
  1853. }).emulateTransitionEnd(transitionDuration);
  1854. } else {
  1855. this._hideModal();
  1856. }
  1857. };
  1858. _proto.dispose = function dispose() {
  1859. [window, this._element, this._dialog].forEach(function (htmlElement) {
  1860. return $(htmlElement).off(EVENT_KEY$5);
  1861. });
  1862. /**
  1863. * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
  1864. * Do not move `document` in `htmlElements` array
  1865. * It will remove `Event.CLICK_DATA_API` event that should remain
  1866. */
  1867. $(document).off(Event$5.FOCUSIN);
  1868. $.removeData(this._element, DATA_KEY$5);
  1869. this._config = null;
  1870. this._element = null;
  1871. this._dialog = null;
  1872. this._backdrop = null;
  1873. this._isShown = null;
  1874. this._isBodyOverflowing = null;
  1875. this._ignoreBackdropClick = null;
  1876. this._isTransitioning = null;
  1877. this._scrollbarWidth = null;
  1878. };
  1879. _proto.handleUpdate = function handleUpdate() {
  1880. this._adjustDialog();
  1881. } // Private
  1882. ;
  1883. _proto._getConfig = function _getConfig(config) {
  1884. config = _objectSpread2({}, Default$3, {}, config);
  1885. Util.typeCheckConfig(NAME$5, config, DefaultType$3);
  1886. return config;
  1887. };
  1888. _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
  1889. var _this3 = this;
  1890. if (this._config.backdrop === 'static') {
  1891. var hideEventPrevented = $.Event(Event$5.HIDE_PREVENTED);
  1892. $(this._element).trigger(hideEventPrevented);
  1893. if (hideEventPrevented.defaultPrevented) {
  1894. return;
  1895. }
  1896. this._element.classList.add(ClassName$5.STATIC);
  1897. var modalTransitionDuration = Util.getTransitionDurationFromElement(this._element);
  1898. $(this._element).one(Util.TRANSITION_END, function () {
  1899. _this3._element.classList.remove(ClassName$5.STATIC);
  1900. }).emulateTransitionEnd(modalTransitionDuration);
  1901. this._element.focus();
  1902. } else {
  1903. this.hide();
  1904. }
  1905. };
  1906. _proto._showElement = function _showElement(relatedTarget) {
  1907. var _this4 = this;
  1908. var transition = $(this._element).hasClass(ClassName$5.FADE);
  1909. var modalBody = this._dialog ? this._dialog.querySelector(Selector$5.MODAL_BODY) : null;
  1910. if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
  1911. // Don't move modal's DOM position
  1912. document.body.appendChild(this._element);
  1913. }
  1914. this._element.style.display = 'block';
  1915. this._element.removeAttribute('aria-hidden');
  1916. this._element.setAttribute('aria-modal', true);
  1917. if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE) && modalBody) {
  1918. modalBody.scrollTop = 0;
  1919. } else {
  1920. this._element.scrollTop = 0;
  1921. }
  1922. if (transition) {
  1923. Util.reflow(this._element);
  1924. }
  1925. $(this._element).addClass(ClassName$5.SHOW);
  1926. if (this._config.focus) {
  1927. this._enforceFocus();
  1928. }
  1929. var shownEvent = $.Event(Event$5.SHOWN, {
  1930. relatedTarget: relatedTarget
  1931. });
  1932. var transitionComplete = function transitionComplete() {
  1933. if (_this4._config.focus) {
  1934. _this4._element.focus();
  1935. }
  1936. _this4._isTransitioning = false;
  1937. $(_this4._element).trigger(shownEvent);
  1938. };
  1939. if (transition) {
  1940. var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
  1941. $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
  1942. } else {
  1943. transitionComplete();
  1944. }
  1945. };
  1946. _proto._enforceFocus = function _enforceFocus() {
  1947. var _this5 = this;
  1948. $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
  1949. .on(Event$5.FOCUSIN, function (event) {
  1950. if (document !== event.target && _this5._element !== event.target && $(_this5._element).has(event.target).length === 0) {
  1951. _this5._element.focus();
  1952. }
  1953. });
  1954. };
  1955. _proto._setEscapeEvent = function _setEscapeEvent() {
  1956. var _this6 = this;
  1957. if (this._isShown && this._config.keyboard) {
  1958. $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
  1959. if (event.which === ESCAPE_KEYCODE$1) {
  1960. _this6._triggerBackdropTransition();
  1961. }
  1962. });
  1963. } else if (!this._isShown) {
  1964. $(this._element).off(Event$5.KEYDOWN_DISMISS);
  1965. }
  1966. };
  1967. _proto._setResizeEvent = function _setResizeEvent() {
  1968. var _this7 = this;
  1969. if (this._isShown) {
  1970. $(window).on(Event$5.RESIZE, function (event) {
  1971. return _this7.handleUpdate(event);
  1972. });
  1973. } else {
  1974. $(window).off(Event$5.RESIZE);
  1975. }
  1976. };
  1977. _proto._hideModal = function _hideModal() {
  1978. var _this8 = this;
  1979. this._element.style.display = 'none';
  1980. this._element.setAttribute('aria-hidden', true);
  1981. this._element.removeAttribute('aria-modal');
  1982. this._isTransitioning = false;
  1983. this._showBackdrop(function () {
  1984. $(document.body).removeClass(ClassName$5.OPEN);
  1985. _this8._resetAdjustments();
  1986. _this8._resetScrollbar();
  1987. $(_this8._element).trigger(Event$5.HIDDEN);
  1988. });
  1989. };
  1990. _proto._removeBackdrop = function _removeBackdrop() {
  1991. if (this._backdrop) {
  1992. $(this._backdrop).remove();
  1993. this._backdrop = null;
  1994. }
  1995. };
  1996. _proto._showBackdrop = function _showBackdrop(callback) {
  1997. var _this9 = this;
  1998. var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
  1999. if (this._isShown && this._config.backdrop) {
  2000. this._backdrop = document.createElement('div');
  2001. this._backdrop.className = ClassName$5.BACKDROP;
  2002. if (animate) {
  2003. this._backdrop.classList.add(animate);
  2004. }
  2005. $(this._backdrop).appendTo(document.body);
  2006. $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
  2007. if (_this9._ignoreBackdropClick) {
  2008. _this9._ignoreBackdropClick = false;
  2009. return;
  2010. }
  2011. if (event.target !== event.currentTarget) {
  2012. return;
  2013. }
  2014. _this9._triggerBackdropTransition();
  2015. });
  2016. if (animate) {
  2017. Util.reflow(this._backdrop);
  2018. }
  2019. $(this._backdrop).addClass(ClassName$5.SHOW);
  2020. if (!callback) {
  2021. return;
  2022. }
  2023. if (!animate) {
  2024. callback();
  2025. return;
  2026. }
  2027. var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  2028. $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
  2029. } else if (!this._isShown && this._backdrop) {
  2030. $(this._backdrop).removeClass(ClassName$5.SHOW);
  2031. var callbackRemove = function callbackRemove() {
  2032. _this9._removeBackdrop();
  2033. if (callback) {
  2034. callback();
  2035. }
  2036. };
  2037. if ($(this._element).hasClass(ClassName$5.FADE)) {
  2038. var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
  2039. $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
  2040. } else {
  2041. callbackRemove();
  2042. }
  2043. } else if (callback) {
  2044. callback();
  2045. }
  2046. } // ----------------------------------------------------------------------
  2047. // the following methods are used to handle overflowing modals
  2048. // todo (fat): these should probably be refactored out of modal.js
  2049. // ----------------------------------------------------------------------
  2050. ;
  2051. _proto._adjustDialog = function _adjustDialog() {
  2052. var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
  2053. if (!this._isBodyOverflowing && isModalOverflowing) {
  2054. this._element.style.paddingLeft = this._scrollbarWidth + "px";
  2055. }
  2056. if (this._isBodyOverflowing && !isModalOverflowing) {
  2057. this._element.style.paddingRight = this._scrollbarWidth + "px";
  2058. }
  2059. };
  2060. _proto._resetAdjustments = function _resetAdjustments() {
  2061. this._element.style.paddingLeft = '';
  2062. this._element.style.paddingRight = '';
  2063. };
  2064. _proto._checkScrollbar = function _checkScrollbar() {
  2065. var rect = document.body.getBoundingClientRect();
  2066. this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
  2067. this._scrollbarWidth = this._getScrollbarWidth();
  2068. };
  2069. _proto._setScrollbar = function _setScrollbar() {
  2070. var _this10 = this;
  2071. if (this._isBodyOverflowing) {
  2072. // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
  2073. // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
  2074. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  2075. var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding
  2076. $(fixedContent).each(function (index, element) {
  2077. var actualPadding = element.style.paddingRight;
  2078. var calculatedPadding = $(element).css('padding-right');
  2079. $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px");
  2080. }); // Adjust sticky content margin
  2081. $(stickyContent).each(function (index, element) {
  2082. var actualMargin = element.style.marginRight;
  2083. var calculatedMargin = $(element).css('margin-right');
  2084. $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px");
  2085. }); // Adjust body padding
  2086. var actualPadding = document.body.style.paddingRight;
  2087. var calculatedPadding = $(document.body).css('padding-right');
  2088. $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
  2089. }
  2090. $(document.body).addClass(ClassName$5.OPEN);
  2091. };
  2092. _proto._resetScrollbar = function _resetScrollbar() {
  2093. // Restore fixed content padding
  2094. var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
  2095. $(fixedContent).each(function (index, element) {
  2096. var padding = $(element).data('padding-right');
  2097. $(element).removeData('padding-right');
  2098. element.style.paddingRight = padding ? padding : '';
  2099. }); // Restore sticky content
  2100. var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
  2101. $(elements).each(function (index, element) {
  2102. var margin = $(element).data('margin-right');
  2103. if (typeof margin !== 'undefined') {
  2104. $(element).css('margin-right', margin).removeData('margin-right');
  2105. }
  2106. }); // Restore body padding
  2107. var padding = $(document.body).data('padding-right');
  2108. $(document.body).removeData('padding-right');
  2109. document.body.style.paddingRight = padding ? padding : '';
  2110. };
  2111. _proto._getScrollbarWidth = function _getScrollbarWidth() {
  2112. // thx d.walsh
  2113. var scrollDiv = document.createElement('div');
  2114. scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
  2115. document.body.appendChild(scrollDiv);
  2116. var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
  2117. document.body.removeChild(scrollDiv);
  2118. return scrollbarWidth;
  2119. } // Static
  2120. ;
  2121. Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
  2122. return this.each(function () {
  2123. var data = $(this).data(DATA_KEY$5);
  2124. var _config = _objectSpread2({}, Default$3, {}, $(this).data(), {}, typeof config === 'object' && config ? config : {});
  2125. if (!data) {
  2126. data = new Modal(this, _config);
  2127. $(this).data(DATA_KEY$5, data);
  2128. }
  2129. if (typeof config === 'string') {
  2130. if (typeof data[config] === 'undefined') {
  2131. throw new TypeError("No method named \"" + config + "\"");
  2132. }
  2133. data[config](relatedTarget);
  2134. } else if (_config.show) {
  2135. data.show(relatedTarget);
  2136. }
  2137. });
  2138. };
  2139. _createClass(Modal, null, [{
  2140. key: "VERSION",
  2141. get: function get() {
  2142. return VERSION$5;
  2143. }
  2144. }, {
  2145. key: "Default",
  2146. get: function get() {
  2147. return Default$3;
  2148. }
  2149. }]);
  2150. return Modal;
  2151. }();
  2152. /**
  2153. * ------------------------------------------------------------------------
  2154. * Data Api implementation
  2155. * ------------------------------------------------------------------------
  2156. */
  2157. $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
  2158. var _this11 = this;
  2159. var target;
  2160. var selector = Util.getSelectorFromElement(this);
  2161. if (selector) {
  2162. target = document.querySelector(selector);
  2163. }
  2164. var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread2({}, $(target).data(), {}, $(this).data());
  2165. if (this.tagName === 'A' || this.tagName === 'AREA') {
  2166. event.preventDefault();
  2167. }
  2168. var $target = $(target).one(Event$5.SHOW, function (showEvent) {
  2169. if (showEvent.isDefaultPrevented()) {
  2170. // Only register focus restorer if modal will actually get shown
  2171. return;
  2172. }
  2173. $target.one(Event$5.HIDDEN, function () {
  2174. if ($(_this11).is(':visible')) {
  2175. _this11.focus();
  2176. }
  2177. });
  2178. });
  2179. Modal._jQueryInterface.call($(target), config, this);
  2180. });
  2181. /**
  2182. * ------------------------------------------------------------------------
  2183. * jQuery
  2184. * ------------------------------------------------------------------------
  2185. */
  2186. $.fn[NAME$5] = Modal._jQueryInterface;
  2187. $.fn[NAME$5].Constructor = Modal;
  2188. $.fn[NAME$5].noConflict = function () {
  2189. $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
  2190. return Modal._jQueryInterface;
  2191. };
  2192. /**
  2193. * --------------------------------------------------------------------------
  2194. * Bootstrap (v4.4.1): tools/sanitizer.js
  2195. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  2196. * --------------------------------------------------------------------------
  2197. */
  2198. var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
  2199. var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
  2200. var DefaultWhitelist = {
  2201. // Global attributes allowed on any supplied element below.
  2202. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  2203. a: ['target', 'href', 'title', 'rel'],
  2204. area: [],
  2205. b: [],
  2206. br: [],
  2207. col: [],
  2208. code: [],
  2209. div: [],
  2210. em: [],
  2211. hr: [],
  2212. h1: [],
  2213. h2: [],
  2214. h3: [],
  2215. h4: [],
  2216. h5: [],
  2217. h6: [],
  2218. i: [],
  2219. img: ['src', 'alt', 'title', 'width', 'height'],
  2220. li: [],
  2221. ol: [],
  2222. p: [],
  2223. pre: [],
  2224. s: [],
  2225. small: [],
  2226. span: [],
  2227. sub: [],
  2228. sup: [],
  2229. strong: [],
  2230. u: [],
  2231. ul: []
  2232. };
  2233. /**
  2234. * A pattern that recognizes a commonly useful subset of URLs that are safe.
  2235. *
  2236. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2237. */
  2238. var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;
  2239. /**
  2240. * A pattern that matches safe data URLs. Only matches image, video and audio types.
  2241. *
  2242. * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
  2243. */
  2244. var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
  2245. function allowedAttribute(attr, allowedAttributeList) {
  2246. var attrName = attr.nodeName.toLowerCase();
  2247. if (allowedAttributeList.indexOf(attrName) !== -1) {
  2248. if (uriAttrs.indexOf(attrName) !== -1) {
  2249. return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN));
  2250. }
  2251. return true;
  2252. }
  2253. var regExp = allowedAttributeList.filter(function (attrRegex) {
  2254. return attrRegex instanceof RegExp;
  2255. }); // Check if a regular expression validates the attribute.
  2256. for (var i = 0, l = regExp.length; i < l; i++) {
  2257. if (attrName.match(regExp[i])) {
  2258. return true;
  2259. }
  2260. }
  2261. return false;
  2262. }
  2263. function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
  2264. if (unsafeHtml.length === 0) {
  2265. return unsafeHtml;
  2266. }
  2267. if (sanitizeFn && typeof sanitizeFn === 'function') {
  2268. return sanitizeFn(unsafeHtml);
  2269. }
  2270. var domParser = new window.DOMParser();
  2271. var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  2272. var whitelistKeys = Object.keys(whiteList);
  2273. var elements = [].slice.call(createdDocument.body.querySelectorAll('*'));
  2274. var _loop = function _loop(i, len) {
  2275. var el = elements[i];
  2276. var elName = el.nodeName.toLowerCase();
  2277. if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) {
  2278. el.parentNode.removeChild(el);
  2279. return "continue";
  2280. }
  2281. var attributeList = [].slice.call(el.attributes);
  2282. var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
  2283. attributeList.forEach(function (attr) {
  2284. if (!allowedAttribute(attr, whitelistedAttributes)) {
  2285. el.removeAttribute(attr.nodeName);
  2286. }
  2287. });
  2288. };
  2289. for (var i = 0, len = elements.length; i < len; i++) {
  2290. var _ret = _loop(i);
  2291. if (_ret === "continue") continue;
  2292. }
  2293. return createdDocument.body.innerHTML;
  2294. }
  2295. /**
  2296. * ------------------------------------------------------------------------
  2297. * Constants
  2298. * ------------------------------------------------------------------------
  2299. */
  2300. var NAME$6 = 'tooltip';
  2301. var VERSION$6 = '4.4.1';
  2302. var DATA_KEY$6 = 'bs.tooltip';
  2303. var EVENT_KEY$6 = "." + DATA_KEY$6;
  2304. var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  2305. var CLASS_PREFIX = 'bs-tooltip';
  2306. var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  2307. var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
  2308. var DefaultType$4 = {
  2309. animation: 'boolean',
  2310. template: 'string',
  2311. title: '(string|element|function)',
  2312. trigger: 'string',
  2313. delay: '(number|object)',
  2314. html: 'boolean',
  2315. selector: '(string|boolean)',
  2316. placement: '(string|function)',
  2317. offset: '(number|string|function)',
  2318. container: '(string|element|boolean)',
  2319. fallbackPlacement: '(string|array)',
  2320. boundary: '(string|element)',
  2321. sanitize: 'boolean',
  2322. sanitizeFn: '(null|function)',
  2323. whiteList: 'object',
  2324. popperConfig: '(null|object)'
  2325. };
  2326. var AttachmentMap$1 = {
  2327. AUTO: 'auto',
  2328. TOP: 'top',
  2329. RIGHT: 'right',
  2330. BOTTOM: 'bottom',
  2331. LEFT: 'left'
  2332. };
  2333. var Default$4 = {
  2334. animation: true,
  2335. template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
  2336. trigger: 'hover focus',
  2337. title: '',
  2338. delay: 0,
  2339. html: false,
  2340. selector: false,
  2341. placement: 'top',
  2342. offset: 0,
  2343. container: false,
  2344. fallbackPlacement: 'flip',
  2345. boundary: 'scrollParent',
  2346. sanitize: true,
  2347. sanitizeFn: null,
  2348. whiteList: DefaultWhitelist,
  2349. popperConfig: null
  2350. };
  2351. var HoverState = {
  2352. SHOW: 'show',
  2353. OUT: 'out'
  2354. };
  2355. var Event$6 = {
  2356. HIDE: "hide" + EVENT_KEY$6,
  2357. HIDDEN: "hidden" + EVENT_KEY$6,
  2358. SHOW: "show" + EVENT_KEY$6,
  2359. SHOWN: "shown" + EVENT_KEY$6,
  2360. INSERTED: "inserted" + EVENT_KEY$6,
  2361. CLICK: "click" + EVENT_KEY$6,
  2362. FOCUSIN: "focusin" + EVENT_KEY$6,
  2363. FOCUSOUT: "focusout" + EVENT_KEY$6,
  2364. MOUSEENTER: "mouseenter" + EVENT_KEY$6,
  2365. MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  2366. };
  2367. var ClassName$6 = {
  2368. FADE: 'fade',
  2369. SHOW: 'show'
  2370. };
  2371. var Selector$6 = {
  2372. TOOLTIP: '.tooltip',
  2373. TOOLTIP_INNER: '.tooltip-inner',
  2374. ARROW: '.arrow'
  2375. };
  2376. var Trigger = {
  2377. HOVER: 'hover',
  2378. FOCUS: 'focus',
  2379. CLICK: 'click',
  2380. MANUAL: 'manual'
  2381. };
  2382. /**
  2383. * ------------------------------------------------------------------------
  2384. * Class Definition
  2385. * ------------------------------------------------------------------------
  2386. */
  2387. var Tooltip =
  2388. /*#__PURE__*/
  2389. function () {
  2390. function Tooltip(element, config) {
  2391. if (typeof Popper === 'undefined') {
  2392. throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
  2393. } // private
  2394. this._isEnabled = true;
  2395. this._timeout = 0;
  2396. this._hoverState = '';
  2397. this._activeTrigger = {};
  2398. this._popper = null; // Protected
  2399. this.element = element;
  2400. this.config = this._getConfig(config);
  2401. this.tip = null;
  2402. this._setListeners();
  2403. } // Getters
  2404. var _proto = Tooltip.prototype;
  2405. // Public
  2406. _proto.enable = function enable() {
  2407. this._isEnabled = true;
  2408. };
  2409. _proto.disable = function disable() {
  2410. this._isEnabled = false;
  2411. };
  2412. _proto.toggleEnabled = function toggleEnabled() {
  2413. this._isEnabled = !this._isEnabled;
  2414. };
  2415. _proto.toggle = function toggle(event) {
  2416. if (!this._isEnabled) {
  2417. return;
  2418. }
  2419. if (event) {
  2420. var dataKey = this.constructor.DATA_KEY;
  2421. var context = $(event.currentTarget).data(dataKey);
  2422. if (!context) {
  2423. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2424. $(event.currentTarget).data(dataKey, context);
  2425. }
  2426. context._activeTrigger.click = !context._activeTrigger.click;
  2427. if (context._isWithActiveTrigger()) {
  2428. context._enter(null, context);
  2429. } else {
  2430. context._leave(null, context);
  2431. }
  2432. } else {
  2433. if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
  2434. this._leave(null, this);
  2435. return;
  2436. }
  2437. this._enter(null, this);
  2438. }
  2439. };
  2440. _proto.dispose = function dispose() {
  2441. clearTimeout(this._timeout);
  2442. $.removeData(this.element, this.constructor.DATA_KEY);
  2443. $(this.element).off(this.constructor.EVENT_KEY);
  2444. $(this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler);
  2445. if (this.tip) {
  2446. $(this.tip).remove();
  2447. }
  2448. this._isEnabled = null;
  2449. this._timeout = null;
  2450. this._hoverState = null;
  2451. this._activeTrigger = null;
  2452. if (this._popper) {
  2453. this._popper.destroy();
  2454. }
  2455. this._popper = null;
  2456. this.element = null;
  2457. this.config = null;
  2458. this.tip = null;
  2459. };
  2460. _proto.show = function show() {
  2461. var _this = this;
  2462. if ($(this.element).css('display') === 'none') {
  2463. throw new Error('Please use show on visible elements');
  2464. }
  2465. var showEvent = $.Event(this.constructor.Event.SHOW);
  2466. if (this.isWithContent() && this._isEnabled) {
  2467. $(this.element).trigger(showEvent);
  2468. var shadowRoot = Util.findShadowRoot(this.element);
  2469. var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element);
  2470. if (showEvent.isDefaultPrevented() || !isInTheDom) {
  2471. return;
  2472. }
  2473. var tip = this.getTipElement();
  2474. var tipId = Util.getUID(this.constructor.NAME);
  2475. tip.setAttribute('id', tipId);
  2476. this.element.setAttribute('aria-describedby', tipId);
  2477. this.setContent();
  2478. if (this.config.animation) {
  2479. $(tip).addClass(ClassName$6.FADE);
  2480. }
  2481. var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
  2482. var attachment = this._getAttachment(placement);
  2483. this.addAttachmentClass(attachment);
  2484. var container = this._getContainer();
  2485. $(tip).data(this.constructor.DATA_KEY, this);
  2486. if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
  2487. $(tip).appendTo(container);
  2488. }
  2489. $(this.element).trigger(this.constructor.Event.INSERTED);
  2490. this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
  2491. $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
  2492. // empty mouseover listeners to the body's immediate children;
  2493. // only needed because of broken event delegation on iOS
  2494. // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
  2495. if ('ontouchstart' in document.documentElement) {
  2496. $(document.body).children().on('mouseover', null, $.noop);
  2497. }
  2498. var complete = function complete() {
  2499. if (_this.config.animation) {
  2500. _this._fixTransition();
  2501. }
  2502. var prevHoverState = _this._hoverState;
  2503. _this._hoverState = null;
  2504. $(_this.element).trigger(_this.constructor.Event.SHOWN);
  2505. if (prevHoverState === HoverState.OUT) {
  2506. _this._leave(null, _this);
  2507. }
  2508. };
  2509. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  2510. var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
  2511. $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2512. } else {
  2513. complete();
  2514. }
  2515. }
  2516. };
  2517. _proto.hide = function hide(callback) {
  2518. var _this2 = this;
  2519. var tip = this.getTipElement();
  2520. var hideEvent = $.Event(this.constructor.Event.HIDE);
  2521. var complete = function complete() {
  2522. if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
  2523. tip.parentNode.removeChild(tip);
  2524. }
  2525. _this2._cleanTipClass();
  2526. _this2.element.removeAttribute('aria-describedby');
  2527. $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
  2528. if (_this2._popper !== null) {
  2529. _this2._popper.destroy();
  2530. }
  2531. if (callback) {
  2532. callback();
  2533. }
  2534. };
  2535. $(this.element).trigger(hideEvent);
  2536. if (hideEvent.isDefaultPrevented()) {
  2537. return;
  2538. }
  2539. $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
  2540. // empty mouseover listeners we added for iOS support
  2541. if ('ontouchstart' in document.documentElement) {
  2542. $(document.body).children().off('mouseover', null, $.noop);
  2543. }
  2544. this._activeTrigger[Trigger.CLICK] = false;
  2545. this._activeTrigger[Trigger.FOCUS] = false;
  2546. this._activeTrigger[Trigger.HOVER] = false;
  2547. if ($(this.tip).hasClass(ClassName$6.FADE)) {
  2548. var transitionDuration = Util.getTransitionDurationFromElement(tip);
  2549. $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  2550. } else {
  2551. complete();
  2552. }
  2553. this._hoverState = '';
  2554. };
  2555. _proto.update = function update() {
  2556. if (this._popper !== null) {
  2557. this._popper.scheduleUpdate();
  2558. }
  2559. } // Protected
  2560. ;
  2561. _proto.isWithContent = function isWithContent() {
  2562. return Boolean(this.getTitle());
  2563. };
  2564. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2565. $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
  2566. };
  2567. _proto.getTipElement = function getTipElement() {
  2568. this.tip = this.tip || $(this.config.template)[0];
  2569. return this.tip;
  2570. };
  2571. _proto.setContent = function setContent() {
  2572. var tip = this.getTipElement();
  2573. this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
  2574. $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
  2575. };
  2576. _proto.setElementContent = function setElementContent($element, content) {
  2577. if (typeof content === 'object' && (content.nodeType || content.jquery)) {
  2578. // Content is a DOM node or a jQuery
  2579. if (this.config.html) {
  2580. if (!$(content).parent().is($element)) {
  2581. $element.empty().append(content);
  2582. }
  2583. } else {
  2584. $element.text($(content).text());
  2585. }
  2586. return;
  2587. }
  2588. if (this.config.html) {
  2589. if (this.config.sanitize) {
  2590. content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
  2591. }
  2592. $element.html(content);
  2593. } else {
  2594. $element.text(content);
  2595. }
  2596. };
  2597. _proto.getTitle = function getTitle() {
  2598. var title = this.element.getAttribute('data-original-title');
  2599. if (!title) {
  2600. title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
  2601. }
  2602. return title;
  2603. } // Private
  2604. ;
  2605. _proto._getPopperConfig = function _getPopperConfig(attachment) {
  2606. var _this3 = this;
  2607. var defaultBsConfig = {
  2608. placement: attachment,
  2609. modifiers: {
  2610. offset: this._getOffset(),
  2611. flip: {
  2612. behavior: this.config.fallbackPlacement
  2613. },
  2614. arrow: {
  2615. element: Selector$6.ARROW
  2616. },
  2617. preventOverflow: {
  2618. boundariesElement: this.config.boundary
  2619. }
  2620. },
  2621. onCreate: function onCreate(data) {
  2622. if (data.originalPlacement !== data.placement) {
  2623. _this3._handlePopperPlacementChange(data);
  2624. }
  2625. },
  2626. onUpdate: function onUpdate(data) {
  2627. return _this3._handlePopperPlacementChange(data);
  2628. }
  2629. };
  2630. return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  2631. };
  2632. _proto._getOffset = function _getOffset() {
  2633. var _this4 = this;
  2634. var offset = {};
  2635. if (typeof this.config.offset === 'function') {
  2636. offset.fn = function (data) {
  2637. data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
  2638. return data;
  2639. };
  2640. } else {
  2641. offset.offset = this.config.offset;
  2642. }
  2643. return offset;
  2644. };
  2645. _proto._getContainer = function _getContainer() {
  2646. if (this.config.container === false) {
  2647. return document.body;
  2648. }
  2649. if (Util.isElement(this.config.container)) {
  2650. return $(this.config.container);
  2651. }
  2652. return $(document).find(this.config.container);
  2653. };
  2654. _proto._getAttachment = function _getAttachment(placement) {
  2655. return AttachmentMap$1[placement.toUpperCase()];
  2656. };
  2657. _proto._setListeners = function _setListeners() {
  2658. var _this5 = this;
  2659. var triggers = this.config.trigger.split(' ');
  2660. triggers.forEach(function (trigger) {
  2661. if (trigger === 'click') {
  2662. $(_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
  2663. return _this5.toggle(event);
  2664. });
  2665. } else if (trigger !== Trigger.MANUAL) {
  2666. var eventIn = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
  2667. var eventOut = trigger === Trigger.HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
  2668. $(_this5.element).on(eventIn, _this5.config.selector, function (event) {
  2669. return _this5._enter(event);
  2670. }).on(eventOut, _this5.config.selector, function (event) {
  2671. return _this5._leave(event);
  2672. });
  2673. }
  2674. });
  2675. this._hideModalHandler = function () {
  2676. if (_this5.element) {
  2677. _this5.hide();
  2678. }
  2679. };
  2680. $(this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler);
  2681. if (this.config.selector) {
  2682. this.config = _objectSpread2({}, this.config, {
  2683. trigger: 'manual',
  2684. selector: ''
  2685. });
  2686. } else {
  2687. this._fixTitle();
  2688. }
  2689. };
  2690. _proto._fixTitle = function _fixTitle() {
  2691. var titleType = typeof this.element.getAttribute('data-original-title');
  2692. if (this.element.getAttribute('title') || titleType !== 'string') {
  2693. this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
  2694. this.element.setAttribute('title', '');
  2695. }
  2696. };
  2697. _proto._enter = function _enter(event, context) {
  2698. var dataKey = this.constructor.DATA_KEY;
  2699. context = context || $(event.currentTarget).data(dataKey);
  2700. if (!context) {
  2701. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2702. $(event.currentTarget).data(dataKey, context);
  2703. }
  2704. if (event) {
  2705. context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
  2706. }
  2707. if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
  2708. context._hoverState = HoverState.SHOW;
  2709. return;
  2710. }
  2711. clearTimeout(context._timeout);
  2712. context._hoverState = HoverState.SHOW;
  2713. if (!context.config.delay || !context.config.delay.show) {
  2714. context.show();
  2715. return;
  2716. }
  2717. context._timeout = setTimeout(function () {
  2718. if (context._hoverState === HoverState.SHOW) {
  2719. context.show();
  2720. }
  2721. }, context.config.delay.show);
  2722. };
  2723. _proto._leave = function _leave(event, context) {
  2724. var dataKey = this.constructor.DATA_KEY;
  2725. context = context || $(event.currentTarget).data(dataKey);
  2726. if (!context) {
  2727. context = new this.constructor(event.currentTarget, this._getDelegateConfig());
  2728. $(event.currentTarget).data(dataKey, context);
  2729. }
  2730. if (event) {
  2731. context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
  2732. }
  2733. if (context._isWithActiveTrigger()) {
  2734. return;
  2735. }
  2736. clearTimeout(context._timeout);
  2737. context._hoverState = HoverState.OUT;
  2738. if (!context.config.delay || !context.config.delay.hide) {
  2739. context.hide();
  2740. return;
  2741. }
  2742. context._timeout = setTimeout(function () {
  2743. if (context._hoverState === HoverState.OUT) {
  2744. context.hide();
  2745. }
  2746. }, context.config.delay.hide);
  2747. };
  2748. _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
  2749. for (var trigger in this._activeTrigger) {
  2750. if (this._activeTrigger[trigger]) {
  2751. return true;
  2752. }
  2753. }
  2754. return false;
  2755. };
  2756. _proto._getConfig = function _getConfig(config) {
  2757. var dataAttributes = $(this.element).data();
  2758. Object.keys(dataAttributes).forEach(function (dataAttr) {
  2759. if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
  2760. delete dataAttributes[dataAttr];
  2761. }
  2762. });
  2763. config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
  2764. if (typeof config.delay === 'number') {
  2765. config.delay = {
  2766. show: config.delay,
  2767. hide: config.delay
  2768. };
  2769. }
  2770. if (typeof config.title === 'number') {
  2771. config.title = config.title.toString();
  2772. }
  2773. if (typeof config.content === 'number') {
  2774. config.content = config.content.toString();
  2775. }
  2776. Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
  2777. if (config.sanitize) {
  2778. config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
  2779. }
  2780. return config;
  2781. };
  2782. _proto._getDelegateConfig = function _getDelegateConfig() {
  2783. var config = {};
  2784. if (this.config) {
  2785. for (var key in this.config) {
  2786. if (this.constructor.Default[key] !== this.config[key]) {
  2787. config[key] = this.config[key];
  2788. }
  2789. }
  2790. }
  2791. return config;
  2792. };
  2793. _proto._cleanTipClass = function _cleanTipClass() {
  2794. var $tip = $(this.getTipElement());
  2795. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
  2796. if (tabClass !== null && tabClass.length) {
  2797. $tip.removeClass(tabClass.join(''));
  2798. }
  2799. };
  2800. _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
  2801. var popperInstance = popperData.instance;
  2802. this.tip = popperInstance.popper;
  2803. this._cleanTipClass();
  2804. this.addAttachmentClass(this._getAttachment(popperData.placement));
  2805. };
  2806. _proto._fixTransition = function _fixTransition() {
  2807. var tip = this.getTipElement();
  2808. var initConfigAnimation = this.config.animation;
  2809. if (tip.getAttribute('x-placement') !== null) {
  2810. return;
  2811. }
  2812. $(tip).removeClass(ClassName$6.FADE);
  2813. this.config.animation = false;
  2814. this.hide();
  2815. this.show();
  2816. this.config.animation = initConfigAnimation;
  2817. } // Static
  2818. ;
  2819. Tooltip._jQueryInterface = function _jQueryInterface(config) {
  2820. return this.each(function () {
  2821. var data = $(this).data(DATA_KEY$6);
  2822. var _config = typeof config === 'object' && config;
  2823. if (!data && /dispose|hide/.test(config)) {
  2824. return;
  2825. }
  2826. if (!data) {
  2827. data = new Tooltip(this, _config);
  2828. $(this).data(DATA_KEY$6, data);
  2829. }
  2830. if (typeof config === 'string') {
  2831. if (typeof data[config] === 'undefined') {
  2832. throw new TypeError("No method named \"" + config + "\"");
  2833. }
  2834. data[config]();
  2835. }
  2836. });
  2837. };
  2838. _createClass(Tooltip, null, [{
  2839. key: "VERSION",
  2840. get: function get() {
  2841. return VERSION$6;
  2842. }
  2843. }, {
  2844. key: "Default",
  2845. get: function get() {
  2846. return Default$4;
  2847. }
  2848. }, {
  2849. key: "NAME",
  2850. get: function get() {
  2851. return NAME$6;
  2852. }
  2853. }, {
  2854. key: "DATA_KEY",
  2855. get: function get() {
  2856. return DATA_KEY$6;
  2857. }
  2858. }, {
  2859. key: "Event",
  2860. get: function get() {
  2861. return Event$6;
  2862. }
  2863. }, {
  2864. key: "EVENT_KEY",
  2865. get: function get() {
  2866. return EVENT_KEY$6;
  2867. }
  2868. }, {
  2869. key: "DefaultType",
  2870. get: function get() {
  2871. return DefaultType$4;
  2872. }
  2873. }]);
  2874. return Tooltip;
  2875. }();
  2876. /**
  2877. * ------------------------------------------------------------------------
  2878. * jQuery
  2879. * ------------------------------------------------------------------------
  2880. */
  2881. $.fn[NAME$6] = Tooltip._jQueryInterface;
  2882. $.fn[NAME$6].Constructor = Tooltip;
  2883. $.fn[NAME$6].noConflict = function () {
  2884. $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
  2885. return Tooltip._jQueryInterface;
  2886. };
  2887. /**
  2888. * ------------------------------------------------------------------------
  2889. * Constants
  2890. * ------------------------------------------------------------------------
  2891. */
  2892. var NAME$7 = 'popover';
  2893. var VERSION$7 = '4.4.1';
  2894. var DATA_KEY$7 = 'bs.popover';
  2895. var EVENT_KEY$7 = "." + DATA_KEY$7;
  2896. var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  2897. var CLASS_PREFIX$1 = 'bs-popover';
  2898. var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
  2899. var Default$5 = _objectSpread2({}, Tooltip.Default, {
  2900. placement: 'right',
  2901. trigger: 'click',
  2902. content: '',
  2903. template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  2904. });
  2905. var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
  2906. content: '(string|element|function)'
  2907. });
  2908. var ClassName$7 = {
  2909. FADE: 'fade',
  2910. SHOW: 'show'
  2911. };
  2912. var Selector$7 = {
  2913. TITLE: '.popover-header',
  2914. CONTENT: '.popover-body'
  2915. };
  2916. var Event$7 = {
  2917. HIDE: "hide" + EVENT_KEY$7,
  2918. HIDDEN: "hidden" + EVENT_KEY$7,
  2919. SHOW: "show" + EVENT_KEY$7,
  2920. SHOWN: "shown" + EVENT_KEY$7,
  2921. INSERTED: "inserted" + EVENT_KEY$7,
  2922. CLICK: "click" + EVENT_KEY$7,
  2923. FOCUSIN: "focusin" + EVENT_KEY$7,
  2924. FOCUSOUT: "focusout" + EVENT_KEY$7,
  2925. MOUSEENTER: "mouseenter" + EVENT_KEY$7,
  2926. MOUSELEAVE: "mouseleave" + EVENT_KEY$7
  2927. };
  2928. /**
  2929. * ------------------------------------------------------------------------
  2930. * Class Definition
  2931. * ------------------------------------------------------------------------
  2932. */
  2933. var Popover =
  2934. /*#__PURE__*/
  2935. function (_Tooltip) {
  2936. _inheritsLoose(Popover, _Tooltip);
  2937. function Popover() {
  2938. return _Tooltip.apply(this, arguments) || this;
  2939. }
  2940. var _proto = Popover.prototype;
  2941. // Overrides
  2942. _proto.isWithContent = function isWithContent() {
  2943. return this.getTitle() || this._getContent();
  2944. };
  2945. _proto.addAttachmentClass = function addAttachmentClass(attachment) {
  2946. $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
  2947. };
  2948. _proto.getTipElement = function getTipElement() {
  2949. this.tip = this.tip || $(this.config.template)[0];
  2950. return this.tip;
  2951. };
  2952. _proto.setContent = function setContent() {
  2953. var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
  2954. this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
  2955. var content = this._getContent();
  2956. if (typeof content === 'function') {
  2957. content = content.call(this.element);
  2958. }
  2959. this.setElementContent($tip.find(Selector$7.CONTENT), content);
  2960. $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
  2961. } // Private
  2962. ;
  2963. _proto._getContent = function _getContent() {
  2964. return this.element.getAttribute('data-content') || this.config.content;
  2965. };
  2966. _proto._cleanTipClass = function _cleanTipClass() {
  2967. var $tip = $(this.getTipElement());
  2968. var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
  2969. if (tabClass !== null && tabClass.length > 0) {
  2970. $tip.removeClass(tabClass.join(''));
  2971. }
  2972. } // Static
  2973. ;
  2974. Popover._jQueryInterface = function _jQueryInterface(config) {
  2975. return this.each(function () {
  2976. var data = $(this).data(DATA_KEY$7);
  2977. var _config = typeof config === 'object' ? config : null;
  2978. if (!data && /dispose|hide/.test(config)) {
  2979. return;
  2980. }
  2981. if (!data) {
  2982. data = new Popover(this, _config);
  2983. $(this).data(DATA_KEY$7, data);
  2984. }
  2985. if (typeof config === 'string') {
  2986. if (typeof data[config] === 'undefined') {
  2987. throw new TypeError("No method named \"" + config + "\"");
  2988. }
  2989. data[config]();
  2990. }
  2991. });
  2992. };
  2993. _createClass(Popover, null, [{
  2994. key: "VERSION",
  2995. // Getters
  2996. get: function get() {
  2997. return VERSION$7;
  2998. }
  2999. }, {
  3000. key: "Default",
  3001. get: function get() {
  3002. return Default$5;
  3003. }
  3004. }, {
  3005. key: "NAME",
  3006. get: function get() {
  3007. return NAME$7;
  3008. }
  3009. }, {
  3010. key: "DATA_KEY",
  3011. get: function get() {
  3012. return DATA_KEY$7;
  3013. }
  3014. }, {
  3015. key: "Event",
  3016. get: function get() {
  3017. return Event$7;
  3018. }
  3019. }, {
  3020. key: "EVENT_KEY",
  3021. get: function get() {
  3022. return EVENT_KEY$7;
  3023. }
  3024. }, {
  3025. key: "DefaultType",
  3026. get: function get() {
  3027. return DefaultType$5;
  3028. }
  3029. }]);
  3030. return Popover;
  3031. }(Tooltip);
  3032. /**
  3033. * ------------------------------------------------------------------------
  3034. * jQuery
  3035. * ------------------------------------------------------------------------
  3036. */
  3037. $.fn[NAME$7] = Popover._jQueryInterface;
  3038. $.fn[NAME$7].Constructor = Popover;
  3039. $.fn[NAME$7].noConflict = function () {
  3040. $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
  3041. return Popover._jQueryInterface;
  3042. };
  3043. /**
  3044. * ------------------------------------------------------------------------
  3045. * Constants
  3046. * ------------------------------------------------------------------------
  3047. */
  3048. var NAME$8 = 'scrollspy';
  3049. var VERSION$8 = '4.4.1';
  3050. var DATA_KEY$8 = 'bs.scrollspy';
  3051. var EVENT_KEY$8 = "." + DATA_KEY$8;
  3052. var DATA_API_KEY$6 = '.data-api';
  3053. var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  3054. var Default$6 = {
  3055. offset: 10,
  3056. method: 'auto',
  3057. target: ''
  3058. };
  3059. var DefaultType$6 = {
  3060. offset: 'number',
  3061. method: 'string',
  3062. target: '(string|element)'
  3063. };
  3064. var Event$8 = {
  3065. ACTIVATE: "activate" + EVENT_KEY$8,
  3066. SCROLL: "scroll" + EVENT_KEY$8,
  3067. LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  3068. };
  3069. var ClassName$8 = {
  3070. DROPDOWN_ITEM: 'dropdown-item',
  3071. DROPDOWN_MENU: 'dropdown-menu',
  3072. ACTIVE: 'active'
  3073. };
  3074. var Selector$8 = {
  3075. DATA_SPY: '[data-spy="scroll"]',
  3076. ACTIVE: '.active',
  3077. NAV_LIST_GROUP: '.nav, .list-group',
  3078. NAV_LINKS: '.nav-link',
  3079. NAV_ITEMS: '.nav-item',
  3080. LIST_ITEMS: '.list-group-item',
  3081. DROPDOWN: '.dropdown',
  3082. DROPDOWN_ITEMS: '.dropdown-item',
  3083. DROPDOWN_TOGGLE: '.dropdown-toggle'
  3084. };
  3085. var OffsetMethod = {
  3086. OFFSET: 'offset',
  3087. POSITION: 'position'
  3088. };
  3089. /**
  3090. * ------------------------------------------------------------------------
  3091. * Class Definition
  3092. * ------------------------------------------------------------------------
  3093. */
  3094. var ScrollSpy =
  3095. /*#__PURE__*/
  3096. function () {
  3097. function ScrollSpy(element, config) {
  3098. var _this = this;
  3099. this._element = element;
  3100. this._scrollElement = element.tagName === 'BODY' ? window : element;
  3101. this._config = this._getConfig(config);
  3102. this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
  3103. this._offsets = [];
  3104. this._targets = [];
  3105. this._activeTarget = null;
  3106. this._scrollHeight = 0;
  3107. $(this._scrollElement).on(Event$8.SCROLL, function (event) {
  3108. return _this._process(event);
  3109. });
  3110. this.refresh();
  3111. this._process();
  3112. } // Getters
  3113. var _proto = ScrollSpy.prototype;
  3114. // Public
  3115. _proto.refresh = function refresh() {
  3116. var _this2 = this;
  3117. var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
  3118. var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
  3119. var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
  3120. this._offsets = [];
  3121. this._targets = [];
  3122. this._scrollHeight = this._getScrollHeight();
  3123. var targets = [].slice.call(document.querySelectorAll(this._selector));
  3124. targets.map(function (element) {
  3125. var target;
  3126. var targetSelector = Util.getSelectorFromElement(element);
  3127. if (targetSelector) {
  3128. target = document.querySelector(targetSelector);
  3129. }
  3130. if (target) {
  3131. var targetBCR = target.getBoundingClientRect();
  3132. if (targetBCR.width || targetBCR.height) {
  3133. // TODO (fat): remove sketch reliance on jQuery position/offset
  3134. return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
  3135. }
  3136. }
  3137. return null;
  3138. }).filter(function (item) {
  3139. return item;
  3140. }).sort(function (a, b) {
  3141. return a[0] - b[0];
  3142. }).forEach(function (item) {
  3143. _this2._offsets.push(item[0]);
  3144. _this2._targets.push(item[1]);
  3145. });
  3146. };
  3147. _proto.dispose = function dispose() {
  3148. $.removeData(this._element, DATA_KEY$8);
  3149. $(this._scrollElement).off(EVENT_KEY$8);
  3150. this._element = null;
  3151. this._scrollElement = null;
  3152. this._config = null;
  3153. this._selector = null;
  3154. this._offsets = null;
  3155. this._targets = null;
  3156. this._activeTarget = null;
  3157. this._scrollHeight = null;
  3158. } // Private
  3159. ;
  3160. _proto._getConfig = function _getConfig(config) {
  3161. config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
  3162. if (typeof config.target !== 'string') {
  3163. var id = $(config.target).attr('id');
  3164. if (!id) {
  3165. id = Util.getUID(NAME$8);
  3166. $(config.target).attr('id', id);
  3167. }
  3168. config.target = "#" + id;
  3169. }
  3170. Util.typeCheckConfig(NAME$8, config, DefaultType$6);
  3171. return config;
  3172. };
  3173. _proto._getScrollTop = function _getScrollTop() {
  3174. return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
  3175. };
  3176. _proto._getScrollHeight = function _getScrollHeight() {
  3177. return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
  3178. };
  3179. _proto._getOffsetHeight = function _getOffsetHeight() {
  3180. return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
  3181. };
  3182. _proto._process = function _process() {
  3183. var scrollTop = this._getScrollTop() + this._config.offset;
  3184. var scrollHeight = this._getScrollHeight();
  3185. var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
  3186. if (this._scrollHeight !== scrollHeight) {
  3187. this.refresh();
  3188. }
  3189. if (scrollTop >= maxScroll) {
  3190. var target = this._targets[this._targets.length - 1];
  3191. if (this._activeTarget !== target) {
  3192. this._activate(target);
  3193. }
  3194. return;
  3195. }
  3196. if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
  3197. this._activeTarget = null;
  3198. this._clear();
  3199. return;
  3200. }
  3201. var offsetLength = this._offsets.length;
  3202. for (var i = offsetLength; i--;) {
  3203. var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);
  3204. if (isActiveTarget) {
  3205. this._activate(this._targets[i]);
  3206. }
  3207. }
  3208. };
  3209. _proto._activate = function _activate(target) {
  3210. this._activeTarget = target;
  3211. this._clear();
  3212. var queries = this._selector.split(',').map(function (selector) {
  3213. return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
  3214. });
  3215. var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
  3216. if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
  3217. $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
  3218. $link.addClass(ClassName$8.ACTIVE);
  3219. } else {
  3220. // Set triggered link as active
  3221. $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
  3222. // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
  3223. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item
  3224. $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
  3225. }
  3226. $(this._scrollElement).trigger(Event$8.ACTIVATE, {
  3227. relatedTarget: target
  3228. });
  3229. };
  3230. _proto._clear = function _clear() {
  3231. [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) {
  3232. return node.classList.contains(ClassName$8.ACTIVE);
  3233. }).forEach(function (node) {
  3234. return node.classList.remove(ClassName$8.ACTIVE);
  3235. });
  3236. } // Static
  3237. ;
  3238. ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
  3239. return this.each(function () {
  3240. var data = $(this).data(DATA_KEY$8);
  3241. var _config = typeof config === 'object' && config;
  3242. if (!data) {
  3243. data = new ScrollSpy(this, _config);
  3244. $(this).data(DATA_KEY$8, data);
  3245. }
  3246. if (typeof config === 'string') {
  3247. if (typeof data[config] === 'undefined') {
  3248. throw new TypeError("No method named \"" + config + "\"");
  3249. }
  3250. data[config]();
  3251. }
  3252. });
  3253. };
  3254. _createClass(ScrollSpy, null, [{
  3255. key: "VERSION",
  3256. get: function get() {
  3257. return VERSION$8;
  3258. }
  3259. }, {
  3260. key: "Default",
  3261. get: function get() {
  3262. return Default$6;
  3263. }
  3264. }]);
  3265. return ScrollSpy;
  3266. }();
  3267. /**
  3268. * ------------------------------------------------------------------------
  3269. * Data Api implementation
  3270. * ------------------------------------------------------------------------
  3271. */
  3272. $(window).on(Event$8.LOAD_DATA_API, function () {
  3273. var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
  3274. var scrollSpysLength = scrollSpys.length;
  3275. for (var i = scrollSpysLength; i--;) {
  3276. var $spy = $(scrollSpys[i]);
  3277. ScrollSpy._jQueryInterface.call($spy, $spy.data());
  3278. }
  3279. });
  3280. /**
  3281. * ------------------------------------------------------------------------
  3282. * jQuery
  3283. * ------------------------------------------------------------------------
  3284. */
  3285. $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  3286. $.fn[NAME$8].Constructor = ScrollSpy;
  3287. $.fn[NAME$8].noConflict = function () {
  3288. $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
  3289. return ScrollSpy._jQueryInterface;
  3290. };
  3291. /**
  3292. * ------------------------------------------------------------------------
  3293. * Constants
  3294. * ------------------------------------------------------------------------
  3295. */
  3296. var NAME$9 = 'tab';
  3297. var VERSION$9 = '4.4.1';
  3298. var DATA_KEY$9 = 'bs.tab';
  3299. var EVENT_KEY$9 = "." + DATA_KEY$9;
  3300. var DATA_API_KEY$7 = '.data-api';
  3301. var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  3302. var Event$9 = {
  3303. HIDE: "hide" + EVENT_KEY$9,
  3304. HIDDEN: "hidden" + EVENT_KEY$9,
  3305. SHOW: "show" + EVENT_KEY$9,
  3306. SHOWN: "shown" + EVENT_KEY$9,
  3307. CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  3308. };
  3309. var ClassName$9 = {
  3310. DROPDOWN_MENU: 'dropdown-menu',
  3311. ACTIVE: 'active',
  3312. DISABLED: 'disabled',
  3313. FADE: 'fade',
  3314. SHOW: 'show'
  3315. };
  3316. var Selector$9 = {
  3317. DROPDOWN: '.dropdown',
  3318. NAV_LIST_GROUP: '.nav, .list-group',
  3319. ACTIVE: '.active',
  3320. ACTIVE_UL: '> li > .active',
  3321. DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
  3322. DROPDOWN_TOGGLE: '.dropdown-toggle',
  3323. DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
  3324. };
  3325. /**
  3326. * ------------------------------------------------------------------------
  3327. * Class Definition
  3328. * ------------------------------------------------------------------------
  3329. */
  3330. var Tab =
  3331. /*#__PURE__*/
  3332. function () {
  3333. function Tab(element) {
  3334. this._element = element;
  3335. } // Getters
  3336. var _proto = Tab.prototype;
  3337. // Public
  3338. _proto.show = function show() {
  3339. var _this = this;
  3340. if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
  3341. return;
  3342. }
  3343. var target;
  3344. var previous;
  3345. var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
  3346. var selector = Util.getSelectorFromElement(this._element);
  3347. if (listElement) {
  3348. var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
  3349. previous = $.makeArray($(listElement).find(itemSelector));
  3350. previous = previous[previous.length - 1];
  3351. }
  3352. var hideEvent = $.Event(Event$9.HIDE, {
  3353. relatedTarget: this._element
  3354. });
  3355. var showEvent = $.Event(Event$9.SHOW, {
  3356. relatedTarget: previous
  3357. });
  3358. if (previous) {
  3359. $(previous).trigger(hideEvent);
  3360. }
  3361. $(this._element).trigger(showEvent);
  3362. if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
  3363. return;
  3364. }
  3365. if (selector) {
  3366. target = document.querySelector(selector);
  3367. }
  3368. this._activate(this._element, listElement);
  3369. var complete = function complete() {
  3370. var hiddenEvent = $.Event(Event$9.HIDDEN, {
  3371. relatedTarget: _this._element
  3372. });
  3373. var shownEvent = $.Event(Event$9.SHOWN, {
  3374. relatedTarget: previous
  3375. });
  3376. $(previous).trigger(hiddenEvent);
  3377. $(_this._element).trigger(shownEvent);
  3378. };
  3379. if (target) {
  3380. this._activate(target, target.parentNode, complete);
  3381. } else {
  3382. complete();
  3383. }
  3384. };
  3385. _proto.dispose = function dispose() {
  3386. $.removeData(this._element, DATA_KEY$9);
  3387. this._element = null;
  3388. } // Private
  3389. ;
  3390. _proto._activate = function _activate(element, container, callback) {
  3391. var _this2 = this;
  3392. var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE);
  3393. var active = activeElements[0];
  3394. var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);
  3395. var complete = function complete() {
  3396. return _this2._transitionComplete(element, active, callback);
  3397. };
  3398. if (active && isTransitioning) {
  3399. var transitionDuration = Util.getTransitionDurationFromElement(active);
  3400. $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3401. } else {
  3402. complete();
  3403. }
  3404. };
  3405. _proto._transitionComplete = function _transitionComplete(element, active, callback) {
  3406. if (active) {
  3407. $(active).removeClass(ClassName$9.ACTIVE);
  3408. var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];
  3409. if (dropdownChild) {
  3410. $(dropdownChild).removeClass(ClassName$9.ACTIVE);
  3411. }
  3412. if (active.getAttribute('role') === 'tab') {
  3413. active.setAttribute('aria-selected', false);
  3414. }
  3415. }
  3416. $(element).addClass(ClassName$9.ACTIVE);
  3417. if (element.getAttribute('role') === 'tab') {
  3418. element.setAttribute('aria-selected', true);
  3419. }
  3420. Util.reflow(element);
  3421. if (element.classList.contains(ClassName$9.FADE)) {
  3422. element.classList.add(ClassName$9.SHOW);
  3423. }
  3424. if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
  3425. var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
  3426. if (dropdownElement) {
  3427. var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
  3428. $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
  3429. }
  3430. element.setAttribute('aria-expanded', true);
  3431. }
  3432. if (callback) {
  3433. callback();
  3434. }
  3435. } // Static
  3436. ;
  3437. Tab._jQueryInterface = function _jQueryInterface(config) {
  3438. return this.each(function () {
  3439. var $this = $(this);
  3440. var data = $this.data(DATA_KEY$9);
  3441. if (!data) {
  3442. data = new Tab(this);
  3443. $this.data(DATA_KEY$9, data);
  3444. }
  3445. if (typeof config === 'string') {
  3446. if (typeof data[config] === 'undefined') {
  3447. throw new TypeError("No method named \"" + config + "\"");
  3448. }
  3449. data[config]();
  3450. }
  3451. });
  3452. };
  3453. _createClass(Tab, null, [{
  3454. key: "VERSION",
  3455. get: function get() {
  3456. return VERSION$9;
  3457. }
  3458. }]);
  3459. return Tab;
  3460. }();
  3461. /**
  3462. * ------------------------------------------------------------------------
  3463. * Data Api implementation
  3464. * ------------------------------------------------------------------------
  3465. */
  3466. $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
  3467. event.preventDefault();
  3468. Tab._jQueryInterface.call($(this), 'show');
  3469. });
  3470. /**
  3471. * ------------------------------------------------------------------------
  3472. * jQuery
  3473. * ------------------------------------------------------------------------
  3474. */
  3475. $.fn[NAME$9] = Tab._jQueryInterface;
  3476. $.fn[NAME$9].Constructor = Tab;
  3477. $.fn[NAME$9].noConflict = function () {
  3478. $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
  3479. return Tab._jQueryInterface;
  3480. };
  3481. /**
  3482. * ------------------------------------------------------------------------
  3483. * Constants
  3484. * ------------------------------------------------------------------------
  3485. */
  3486. var NAME$a = 'toast';
  3487. var VERSION$a = '4.4.1';
  3488. var DATA_KEY$a = 'bs.toast';
  3489. var EVENT_KEY$a = "." + DATA_KEY$a;
  3490. var JQUERY_NO_CONFLICT$a = $.fn[NAME$a];
  3491. var Event$a = {
  3492. CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a,
  3493. HIDE: "hide" + EVENT_KEY$a,
  3494. HIDDEN: "hidden" + EVENT_KEY$a,
  3495. SHOW: "show" + EVENT_KEY$a,
  3496. SHOWN: "shown" + EVENT_KEY$a
  3497. };
  3498. var ClassName$a = {
  3499. FADE: 'fade',
  3500. HIDE: 'hide',
  3501. SHOW: 'show',
  3502. SHOWING: 'showing'
  3503. };
  3504. var DefaultType$7 = {
  3505. animation: 'boolean',
  3506. autohide: 'boolean',
  3507. delay: 'number'
  3508. };
  3509. var Default$7 = {
  3510. animation: true,
  3511. autohide: true,
  3512. delay: 500
  3513. };
  3514. var Selector$a = {
  3515. DATA_DISMISS: '[data-dismiss="toast"]'
  3516. };
  3517. /**
  3518. * ------------------------------------------------------------------------
  3519. * Class Definition
  3520. * ------------------------------------------------------------------------
  3521. */
  3522. var Toast =
  3523. /*#__PURE__*/
  3524. function () {
  3525. function Toast(element, config) {
  3526. this._element = element;
  3527. this._config = this._getConfig(config);
  3528. this._timeout = null;
  3529. this._setListeners();
  3530. } // Getters
  3531. var _proto = Toast.prototype;
  3532. // Public
  3533. _proto.show = function show() {
  3534. var _this = this;
  3535. var showEvent = $.Event(Event$a.SHOW);
  3536. $(this._element).trigger(showEvent);
  3537. if (showEvent.isDefaultPrevented()) {
  3538. return;
  3539. }
  3540. if (this._config.animation) {
  3541. this._element.classList.add(ClassName$a.FADE);
  3542. }
  3543. var complete = function complete() {
  3544. _this._element.classList.remove(ClassName$a.SHOWING);
  3545. _this._element.classList.add(ClassName$a.SHOW);
  3546. $(_this._element).trigger(Event$a.SHOWN);
  3547. if (_this._config.autohide) {
  3548. _this._timeout = setTimeout(function () {
  3549. _this.hide();
  3550. }, _this._config.delay);
  3551. }
  3552. };
  3553. this._element.classList.remove(ClassName$a.HIDE);
  3554. Util.reflow(this._element);
  3555. this._element.classList.add(ClassName$a.SHOWING);
  3556. if (this._config.animation) {
  3557. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3558. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3559. } else {
  3560. complete();
  3561. }
  3562. };
  3563. _proto.hide = function hide() {
  3564. if (!this._element.classList.contains(ClassName$a.SHOW)) {
  3565. return;
  3566. }
  3567. var hideEvent = $.Event(Event$a.HIDE);
  3568. $(this._element).trigger(hideEvent);
  3569. if (hideEvent.isDefaultPrevented()) {
  3570. return;
  3571. }
  3572. this._close();
  3573. };
  3574. _proto.dispose = function dispose() {
  3575. clearTimeout(this._timeout);
  3576. this._timeout = null;
  3577. if (this._element.classList.contains(ClassName$a.SHOW)) {
  3578. this._element.classList.remove(ClassName$a.SHOW);
  3579. }
  3580. $(this._element).off(Event$a.CLICK_DISMISS);
  3581. $.removeData(this._element, DATA_KEY$a);
  3582. this._element = null;
  3583. this._config = null;
  3584. } // Private
  3585. ;
  3586. _proto._getConfig = function _getConfig(config) {
  3587. config = _objectSpread2({}, Default$7, {}, $(this._element).data(), {}, typeof config === 'object' && config ? config : {});
  3588. Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
  3589. return config;
  3590. };
  3591. _proto._setListeners = function _setListeners() {
  3592. var _this2 = this;
  3593. $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () {
  3594. return _this2.hide();
  3595. });
  3596. };
  3597. _proto._close = function _close() {
  3598. var _this3 = this;
  3599. var complete = function complete() {
  3600. _this3._element.classList.add(ClassName$a.HIDE);
  3601. $(_this3._element).trigger(Event$a.HIDDEN);
  3602. };
  3603. this._element.classList.remove(ClassName$a.SHOW);
  3604. if (this._config.animation) {
  3605. var transitionDuration = Util.getTransitionDurationFromElement(this._element);
  3606. $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
  3607. } else {
  3608. complete();
  3609. }
  3610. } // Static
  3611. ;
  3612. Toast._jQueryInterface = function _jQueryInterface(config) {
  3613. return this.each(function () {
  3614. var $element = $(this);
  3615. var data = $element.data(DATA_KEY$a);
  3616. var _config = typeof config === 'object' && config;
  3617. if (!data) {
  3618. data = new Toast(this, _config);
  3619. $element.data(DATA_KEY$a, data);
  3620. }
  3621. if (typeof config === 'string') {
  3622. if (typeof data[config] === 'undefined') {
  3623. throw new TypeError("No method named \"" + config + "\"");
  3624. }
  3625. data[config](this);
  3626. }
  3627. });
  3628. };
  3629. _createClass(Toast, null, [{
  3630. key: "VERSION",
  3631. get: function get() {
  3632. return VERSION$a;
  3633. }
  3634. }, {
  3635. key: "DefaultType",
  3636. get: function get() {
  3637. return DefaultType$7;
  3638. }
  3639. }, {
  3640. key: "Default",
  3641. get: function get() {
  3642. return Default$7;
  3643. }
  3644. }]);
  3645. return Toast;
  3646. }();
  3647. /**
  3648. * ------------------------------------------------------------------------
  3649. * jQuery
  3650. * ------------------------------------------------------------------------
  3651. */
  3652. $.fn[NAME$a] = Toast._jQueryInterface;
  3653. $.fn[NAME$a].Constructor = Toast;
  3654. $.fn[NAME$a].noConflict = function () {
  3655. $.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
  3656. return Toast._jQueryInterface;
  3657. };
  3658. exports.Alert = Alert;
  3659. exports.Button = Button;
  3660. exports.Carousel = Carousel;
  3661. exports.Collapse = Collapse;
  3662. exports.Dropdown = Dropdown;
  3663. exports.Modal = Modal;
  3664. exports.Popover = Popover;
  3665. exports.Scrollspy = ScrollSpy;
  3666. exports.Tab = Tab;
  3667. exports.Toast = Toast;
  3668. exports.Tooltip = Tooltip;
  3669. exports.Util = Util;
  3670. Object.defineProperty(exports, '__esModule', { value: true });
  3671. })));
  3672. //# sourceMappingURL=bootstrap.js.map