bootstrap.bundle.js 213 KB
Newer Older
Mark Otto's avatar
dist  
Mark Otto committed
1
/*!
Mark Otto's avatar
Mark Otto committed
2
  * Bootstrap v4.1.3 (https://getbootstrap.com/)
Mark Otto's avatar
dist    
Mark Otto committed
3
  * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
Mark Otto's avatar
dist  
Mark Otto committed
4
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
Mark Otto's avatar
dist    
Mark Otto committed
6
(function (global, factory) {
Mark Otto's avatar
dist    
Mark Otto committed
7
8
9
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) :
  typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) :
  (factory((global.bootstrap = {}),global.jQuery));
Mark Otto's avatar
dist    
Mark Otto committed
10
}(this, (function (exports,$) { 'use strict';
Mark Otto's avatar
dist  
Mark Otto committed
11

Mark Otto's avatar
dist    
Mark Otto committed
12
  $ = $ && $.hasOwnProperty('default') ? $['default'] : $;
Mark Otto's avatar
dist  
Mark Otto committed
13

Mark Otto's avatar
dist    
Mark Otto committed
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  function _defineProperties(target, props) {
    for (var i = 0; i < props.length; i++) {
      var descriptor = props[i];
      descriptor.enumerable = descriptor.enumerable || false;
      descriptor.configurable = true;
      if ("value" in descriptor) descriptor.writable = true;
      Object.defineProperty(target, descriptor.key, descriptor);
    }
  }

  function _createClass(Constructor, protoProps, staticProps) {
    if (protoProps) _defineProperties(Constructor.prototype, protoProps);
    if (staticProps) _defineProperties(Constructor, staticProps);
    return Constructor;
Mark Otto's avatar
Mark Otto committed
28
29
  }

Mark Otto's avatar
dist    
Mark Otto committed
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  function _defineProperty(obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
    } else {
      obj[key] = value;
    }

    return obj;
  }
Mark Otto's avatar
Mark Otto committed
44

Mark Otto's avatar
dist    
Mark Otto committed
45
  function _objectSpread(target) {
Mark Otto's avatar
dist    
Mark Otto committed
46
    for (var i = 1; i < arguments.length; i++) {
Mark Otto's avatar
dist    
Mark Otto committed
47
48
      var source = arguments[i] != null ? arguments[i] : {};
      var ownKeys = Object.keys(source);
Mark Otto's avatar
dist    
Mark Otto committed
49

Mark Otto's avatar
dist    
Mark Otto committed
50
51
52
53
      if (typeof Object.getOwnPropertySymbols === 'function') {
        ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
          return Object.getOwnPropertyDescriptor(source, sym).enumerable;
        }));
Mark Otto's avatar
dist    
Mark Otto committed
54
      }
Mark Otto's avatar
dist    
Mark Otto committed
55
56
57
58

      ownKeys.forEach(function (key) {
        _defineProperty(target, key, source[key]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
59
60
61
    }

    return target;
Mark Otto's avatar
dist    
Mark Otto committed
62
  }
Mark Otto's avatar
Mark Otto committed
63

Mark Otto's avatar
dist    
Mark Otto committed
64
65
66
67
68
  function _inheritsLoose(subClass, superClass) {
    subClass.prototype = Object.create(superClass.prototype);
    subClass.prototype.constructor = subClass;
    subClass.__proto__ = superClass;
  }
Mark Otto's avatar
dist  
Mark Otto committed
69
70

  /**
Mark Otto's avatar
dist    
Mark Otto committed
71
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
72
   * Bootstrap (v4.1.3): util.js
Mark Otto's avatar
dist    
Mark Otto committed
73
74
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
75
   */
Mark Otto's avatar
dist    
Mark Otto committed
76

XhmikosR's avatar
Dist    
XhmikosR committed
77
78
79
80
81
  /**
   * ------------------------------------------------------------------------
   * Private TransitionEnd Helpers
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
82

XhmikosR's avatar
Dist    
XhmikosR committed
83
84
85
  var TRANSITION_END = 'transitionend';
  var MAX_UID = 1000000;
  var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
Mark Otto's avatar
dist  
Mark Otto committed
86

XhmikosR's avatar
Dist    
XhmikosR committed
87
88
89
  function toType(obj) {
    return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
  }
Mark Otto's avatar
dist  
Mark Otto committed
90

XhmikosR's avatar
Dist    
XhmikosR committed
91
92
93
94
95
96
97
  function getSpecialTransitionEndEvent() {
    return {
      bindType: TRANSITION_END,
      delegateType: TRANSITION_END,
      handle: function handle(event) {
        if ($(event.target).is(this)) {
          return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params
Mark Otto's avatar
dist    
Mark Otto committed
98
        }
Mark Otto's avatar
dist  
Mark Otto committed
99

XhmikosR's avatar
Dist    
XhmikosR committed
100
101
102
103
        return undefined; // eslint-disable-line no-undefined
      }
    };
  }
Mark Otto's avatar
dist  
Mark Otto committed
104

XhmikosR's avatar
Dist    
XhmikosR committed
105
106
  function transitionEndEmulator(duration) {
    var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
107

XhmikosR's avatar
Dist    
XhmikosR committed
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
    var called = false;
    $(this).one(Util.TRANSITION_END, function () {
      called = true;
    });
    setTimeout(function () {
      if (!called) {
        Util.triggerTransitionEnd(_this);
      }
    }, duration);
    return this;
  }

  function setTransitionEndSupport() {
    $.fn.emulateTransitionEnd = transitionEndEmulator;
    $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent();
  }
  /**
   * --------------------------------------------------------------------------
   * Public Util Api
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
129
130


XhmikosR's avatar
Dist    
XhmikosR committed
131
132
133
134
135
136
137
  var Util = {
    TRANSITION_END: 'bsTransitionEnd',
    getUID: function getUID(prefix) {
      do {
        // eslint-disable-next-line no-bitwise
        prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
      } while (document.getElementById(prefix));
Mark Otto's avatar
dist    
Mark Otto committed
138

XhmikosR's avatar
Dist    
XhmikosR committed
139
140
141
142
      return prefix;
    },
    getSelectorFromElement: function getSelectorFromElement(element) {
      var selector = element.getAttribute('data-target');
Mark Otto's avatar
dist    
Mark Otto committed
143

XhmikosR's avatar
Dist    
XhmikosR committed
144
145
146
147
      if (!selector || selector === '#') {
        var hrefAttr = element.getAttribute('href');
        selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
      }
Mark Otto's avatar
dist    
Mark Otto committed
148

XhmikosR's avatar
Dist    
XhmikosR committed
149
150
151
152
153
154
      return selector && document.querySelector(selector) ? selector : null;
    },
    getTransitionDurationFromElement: function getTransitionDurationFromElement(element) {
      if (!element) {
        return 0;
      } // Get transition-duration of the element
Mark Otto's avatar
dist    
Mark Otto committed
155
156


XhmikosR's avatar
Dist    
XhmikosR committed
157
158
159
160
      var transitionDuration = $(element).css('transition-duration');
      var transitionDelay = $(element).css('transition-delay');
      var floatTransitionDuration = parseFloat(transitionDuration);
      var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
Mark Otto's avatar
dist    
Mark Otto committed
161

XhmikosR's avatar
Dist    
XhmikosR committed
162
163
164
      if (!floatTransitionDuration && !floatTransitionDelay) {
        return 0;
      } // If multiple durations are defined, take the first
Mark Otto's avatar
dist    
Mark Otto committed
165
166


XhmikosR's avatar
Dist    
XhmikosR committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
      transitionDuration = transitionDuration.split(',')[0];
      transitionDelay = transitionDelay.split(',')[0];
      return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
    },
    reflow: function reflow(element) {
      return element.offsetHeight;
    },
    triggerTransitionEnd: function triggerTransitionEnd(element) {
      $(element).trigger(TRANSITION_END);
    },
    // TODO: Remove in v5
    supportsTransitionEnd: function supportsTransitionEnd() {
      return Boolean(TRANSITION_END);
    },
    isElement: function isElement(obj) {
      return (obj[0] || obj).nodeType;
    },
    typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) {
      for (var property in configTypes) {
        if (Object.prototype.hasOwnProperty.call(configTypes, property)) {
          var expectedTypes = configTypes[property];
          var value = config[property];
          var valueType = value && Util.isElement(value) ? 'element' : toType(value);

          if (!new RegExp(expectedTypes).test(valueType)) {
            throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\"."));
Mark Otto's avatar
dist  
Mark Otto committed
193
194
195
          }
        }
      }
XhmikosR's avatar
Dist    
XhmikosR committed
196
197
198
    }
  };
  setTransitionEndSupport();
Mark Otto's avatar
dist    
Mark Otto committed
199

Mark Otto's avatar
dist  
Mark Otto committed
200
  /**
Mark Otto's avatar
dist    
Mark Otto committed
201
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
202
   * Bootstrap (v4.1.3): alert.js
Mark Otto's avatar
dist    
Mark Otto committed
203
204
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
205
   */
Mark Otto's avatar
dist    
Mark Otto committed
206

XhmikosR's avatar
Dist    
XhmikosR committed
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME = 'alert';
  var VERSION = '4.1.3';
  var DATA_KEY = 'bs.alert';
  var EVENT_KEY = "." + DATA_KEY;
  var DATA_API_KEY = '.data-api';
  var JQUERY_NO_CONFLICT = $.fn[NAME];
  var Selector = {
    DISMISS: '[data-dismiss="alert"]'
  };
  var Event = {
    CLOSE: "close" + EVENT_KEY,
    CLOSED: "closed" + EVENT_KEY,
    CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY
  };
  var ClassName = {
    ALERT: 'alert',
    FADE: 'fade',
    SHOW: 'show'
Mark Otto's avatar
dist    
Mark Otto committed
231
232
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
233
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
234
235
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
236

XhmikosR's avatar
Dist    
XhmikosR committed
237
  };
Mark Otto's avatar
dist  
Mark Otto committed
238

XhmikosR's avatar
Dist    
XhmikosR committed
239
240
241
242
243
244
  var Alert =
  /*#__PURE__*/
  function () {
    function Alert(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
245
246


XhmikosR's avatar
Dist    
XhmikosR committed
247
    var _proto = Alert.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
248

XhmikosR's avatar
Dist    
XhmikosR committed
249
250
251
    // Public
    _proto.close = function close(element) {
      var rootElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
252

XhmikosR's avatar
Dist    
XhmikosR committed
253
254
255
      if (element) {
        rootElement = this._getRootElement(element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
256

XhmikosR's avatar
Dist    
XhmikosR committed
257
      var customEvent = this._triggerCloseEvent(rootElement);
Mark Otto's avatar
dist  
Mark Otto committed
258

XhmikosR's avatar
Dist    
XhmikosR committed
259
260
261
      if (customEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
262

XhmikosR's avatar
Dist    
XhmikosR committed
263
264
      this._removeElement(rootElement);
    };
Mark Otto's avatar
dist  
Mark Otto committed
265

XhmikosR's avatar
Dist    
XhmikosR committed
266
267
268
269
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
270
271


XhmikosR's avatar
Dist    
XhmikosR committed
272
273
274
    _proto._getRootElement = function _getRootElement(element) {
      var selector = Util.getSelectorFromElement(element);
      var parent = false;
Mark Otto's avatar
dist  
Mark Otto committed
275

XhmikosR's avatar
Dist    
XhmikosR committed
276
277
278
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist  
Mark Otto committed
279

XhmikosR's avatar
Dist    
XhmikosR committed
280
281
282
      if (!parent) {
        parent = $(element).closest("." + ClassName.ALERT)[0];
      }
Mark Otto's avatar
dist  
Mark Otto committed
283

XhmikosR's avatar
Dist    
XhmikosR committed
284
285
      return parent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
286

XhmikosR's avatar
Dist    
XhmikosR committed
287
288
289
290
291
    _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
      var closeEvent = $.Event(Event.CLOSE);
      $(element).trigger(closeEvent);
      return closeEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
292

XhmikosR's avatar
Dist    
XhmikosR committed
293
294
    _proto._removeElement = function _removeElement(element) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
295

XhmikosR's avatar
Dist    
XhmikosR committed
296
      $(element).removeClass(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
297

XhmikosR's avatar
Dist    
XhmikosR committed
298
299
      if (!$(element).hasClass(ClassName.FADE)) {
        this._destroyElement(element);
Mark Otto's avatar
dist    
Mark Otto committed
300

XhmikosR's avatar
Dist    
XhmikosR committed
301
302
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
303

XhmikosR's avatar
Dist    
XhmikosR committed
304
305
306
307
308
      var transitionDuration = Util.getTransitionDurationFromElement(element);
      $(element).one(Util.TRANSITION_END, function (event) {
        return _this._destroyElement(element, event);
      }).emulateTransitionEnd(transitionDuration);
    };
Mark Otto's avatar
dist  
Mark Otto committed
309

XhmikosR's avatar
Dist    
XhmikosR committed
310
311
312
    _proto._destroyElement = function _destroyElement(element) {
      $(element).detach().trigger(Event.CLOSED).remove();
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
313
314


XhmikosR's avatar
Dist    
XhmikosR committed
315
316
317
318
    Alert._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $element = $(this);
        var data = $element.data(DATA_KEY);
Mark Otto's avatar
dist  
Mark Otto committed
319

XhmikosR's avatar
Dist    
XhmikosR committed
320
321
322
323
        if (!data) {
          data = new Alert(this);
          $element.data(DATA_KEY, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
324

XhmikosR's avatar
Dist    
XhmikosR committed
325
326
327
328
329
        if (config === 'close') {
          data[config](this);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
330

XhmikosR's avatar
Dist    
XhmikosR committed
331
332
333
334
335
    Alert._handleDismiss = function _handleDismiss(alertInstance) {
      return function (event) {
        if (event) {
          event.preventDefault();
        }
Mark Otto's avatar
dist  
Mark Otto committed
336

XhmikosR's avatar
Dist    
XhmikosR committed
337
        alertInstance.close(this);
Mark Otto's avatar
dist  
Mark Otto committed
338
      };
XhmikosR's avatar
Dist    
XhmikosR committed
339
    };
Mark Otto's avatar
dist  
Mark Otto committed
340

XhmikosR's avatar
Dist    
XhmikosR committed
341
342
343
344
345
346
    _createClass(Alert, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
347

XhmikosR's avatar
Dist    
XhmikosR committed
348
349
350
351
352
353
354
    return Alert;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
355

Mark Otto's avatar
dist    
Mark Otto committed
356

XhmikosR's avatar
Dist    
XhmikosR committed
357
358
359
360
361
362
  $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
363

XhmikosR's avatar
Dist    
XhmikosR committed
364
365
  $.fn[NAME] = Alert._jQueryInterface;
  $.fn[NAME].Constructor = Alert;
Mark Otto's avatar
dist  
Mark Otto committed
366

XhmikosR's avatar
Dist    
XhmikosR committed
367
368
369
370
  $.fn[NAME].noConflict = function () {
    $.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
371
372

  /**
Mark Otto's avatar
dist    
Mark Otto committed
373
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
374
   * Bootstrap (v4.1.3): button.js
Mark Otto's avatar
dist    
Mark Otto committed
375
376
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
377
   */
Mark Otto's avatar
dist    
Mark Otto committed
378

XhmikosR's avatar
Dist    
XhmikosR committed
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$1 = 'button';
  var VERSION$1 = '4.1.3';
  var DATA_KEY$1 = 'bs.button';
  var EVENT_KEY$1 = "." + DATA_KEY$1;
  var DATA_API_KEY$1 = '.data-api';
  var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1];
  var ClassName$1 = {
    ACTIVE: 'active',
    BUTTON: 'btn',
    FOCUS: 'focus'
  };
  var Selector$1 = {
    DATA_TOGGLE_CARROT: '[data-toggle^="button"]',
    DATA_TOGGLE: '[data-toggle="buttons"]',
    INPUT: 'input',
    ACTIVE: '.active',
    BUTTON: '.btn'
  };
  var Event$1 = {
    CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1,
    FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1)
Mark Otto's avatar
dist    
Mark Otto committed
406
407
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
408
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
409
410
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
411

XhmikosR's avatar
Dist    
XhmikosR committed
412
  };
Mark Otto's avatar
dist  
Mark Otto committed
413

XhmikosR's avatar
Dist    
XhmikosR committed
414
415
416
417
418
419
  var Button =
  /*#__PURE__*/
  function () {
    function Button(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
420
421


XhmikosR's avatar
Dist    
XhmikosR committed
422
    var _proto = Button.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
423

XhmikosR's avatar
Dist    
XhmikosR committed
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
    // Public
    _proto.toggle = function toggle() {
      var triggerChangeEvent = true;
      var addAriaPressed = true;
      var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0];

      if (rootElement) {
        var input = this._element.querySelector(Selector$1.INPUT);

        if (input) {
          if (input.type === 'radio') {
            if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) {
              triggerChangeEvent = false;
            } else {
              var activeElement = rootElement.querySelector(Selector$1.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
439

XhmikosR's avatar
Dist    
XhmikosR committed
440
441
              if (activeElement) {
                $(activeElement).removeClass(ClassName$1.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
442
              }
XhmikosR's avatar
Dist    
XhmikosR committed
443
444
            }
          }
Mark Otto's avatar
dist    
Mark Otto committed
445

XhmikosR's avatar
Dist    
XhmikosR committed
446
447
448
          if (triggerChangeEvent) {
            if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) {
              return;
Mark Otto's avatar
dist  
Mark Otto committed
449
            }
Mark Otto's avatar
dist    
Mark Otto committed
450

XhmikosR's avatar
Dist    
XhmikosR committed
451
452
            input.checked = !this._element.classList.contains(ClassName$1.ACTIVE);
            $(input).trigger('change');
Mark Otto's avatar
dist  
Mark Otto committed
453
454
          }

XhmikosR's avatar
Dist    
XhmikosR committed
455
456
          input.focus();
          addAriaPressed = false;
Mark Otto's avatar
dist  
Mark Otto committed
457
        }
XhmikosR's avatar
Dist    
XhmikosR committed
458
      }
Mark Otto's avatar
dist  
Mark Otto committed
459

XhmikosR's avatar
Dist    
XhmikosR committed
460
461
462
      if (addAriaPressed) {
        this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE));
      }
Mark Otto's avatar
dist  
Mark Otto committed
463

XhmikosR's avatar
Dist    
XhmikosR committed
464
465
466
467
      if (triggerChangeEvent) {
        $(this._element).toggleClass(ClassName$1.ACTIVE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
468

XhmikosR's avatar
Dist    
XhmikosR committed
469
470
471
472
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$1);
      this._element = null;
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
473
474


XhmikosR's avatar
Dist    
XhmikosR committed
475
476
477
    Button._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$1);
Mark Otto's avatar
dist  
Mark Otto committed
478

XhmikosR's avatar
Dist    
XhmikosR committed
479
480
481
482
        if (!data) {
          data = new Button(this);
          $(this).data(DATA_KEY$1, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
483

XhmikosR's avatar
Dist    
XhmikosR committed
484
485
        if (config === 'toggle') {
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
486
        }
XhmikosR's avatar
Dist    
XhmikosR committed
487
488
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
489

XhmikosR's avatar
Dist    
XhmikosR committed
490
491
492
493
494
495
    _createClass(Button, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$1;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
496

XhmikosR's avatar
Dist    
XhmikosR committed
497
498
499
500
501
502
503
    return Button;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
504
505


XhmikosR's avatar
Dist    
XhmikosR committed
506
507
508
  $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
    event.preventDefault();
    var button = event.target;
Mark Otto's avatar
dist  
Mark Otto committed
509

XhmikosR's avatar
Dist    
XhmikosR committed
510
511
512
    if (!$(button).hasClass(ClassName$1.BUTTON)) {
      button = $(button).closest(Selector$1.BUTTON);
    }
Mark Otto's avatar
dist    
Mark Otto committed
513

XhmikosR's avatar
Dist    
XhmikosR committed
514
515
516
517
518
519
520
521
522
523
    Button._jQueryInterface.call($(button), 'toggle');
  }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) {
    var button = $(event.target).closest(Selector$1.BUTTON)[0];
    $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type));
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
524

XhmikosR's avatar
Dist    
XhmikosR committed
525
526
  $.fn[NAME$1] = Button._jQueryInterface;
  $.fn[NAME$1].Constructor = Button;
Mark Otto's avatar
dist  
Mark Otto committed
527

XhmikosR's avatar
Dist    
XhmikosR committed
528
529
530
531
  $.fn[NAME$1].noConflict = function () {
    $.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
532
533

  /**
XhmikosR's avatar
Dist    
XhmikosR committed
534
535
536
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
537
   */
Mark Otto's avatar
dist    
Mark Otto committed
538

XhmikosR's avatar
Dist    
XhmikosR committed
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
  var NAME$2 = 'carousel';
  var VERSION$2 = '4.1.3';
  var DATA_KEY$2 = 'bs.carousel';
  var EVENT_KEY$2 = "." + DATA_KEY$2;
  var DATA_API_KEY$2 = '.data-api';
  var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2];
  var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key

  var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key

  var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch

  var SWIPE_THRESHOLD = 40;
  var Default = {
    interval: 5000,
    keyboard: true,
    slide: false,
    pause: 'hover',
    wrap: true,
    touch: true
  };
  var DefaultType = {
    interval: '(number|boolean)',
    keyboard: 'boolean',
    slide: '(boolean|string)',
    pause: '(string|boolean)',
    wrap: 'boolean',
    touch: 'boolean'
  };
  var Direction = {
    NEXT: 'next',
    PREV: 'prev',
    LEFT: 'left',
    RIGHT: 'right'
  };
  var Event$2 = {
    SLIDE: "slide" + EVENT_KEY$2,
    SLID: "slid" + EVENT_KEY$2,
    KEYDOWN: "keydown" + EVENT_KEY$2,
    MOUSEENTER: "mouseenter" + EVENT_KEY$2,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$2,
    TOUCHSTART: "touchstart" + EVENT_KEY$2,
    TOUCHMOVE: "touchmove" + EVENT_KEY$2,
    TOUCHEND: "touchend" + EVENT_KEY$2,
    POINTERDOWN: "pointerdown" + EVENT_KEY$2,
    POINTERMOVE: "pointermove" + EVENT_KEY$2,
    POINTERUP: "pointerup" + EVENT_KEY$2,
    POINTERLEAVE: "pointerleave" + EVENT_KEY$2,
    POINTERCANCEL: "pointercancel" + EVENT_KEY$2,
    DRAG_START: "dragstart" + EVENT_KEY$2,
    LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2,
    CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2
  };
  var ClassName$2 = {
    CAROUSEL: 'carousel',
    ACTIVE: 'active',
    SLIDE: 'slide',
    RIGHT: 'carousel-item-right',
    LEFT: 'carousel-item-left',
    NEXT: 'carousel-item-next',
    PREV: 'carousel-item-prev',
    ITEM: 'carousel-item',
    POINTER_EVENT: 'pointer-event'
  };
  var Selector$2 = {
    ACTIVE: '.active',
    ACTIVE_ITEM: '.active.carousel-item',
    ITEM: '.carousel-item',
    ITEM_IMG: '.carousel-item img',
    NEXT_PREV: '.carousel-item-next, .carousel-item-prev',
    INDICATORS: '.carousel-indicators',
    DATA_SLIDE: '[data-slide], [data-slide-to]',
    DATA_RIDE: '[data-ride="carousel"]'
  };
  var PointerType = {
    TOUCH: 'touch',
    PEN: 'pen'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
619
620
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
621

XhmikosR's avatar
Dist    
XhmikosR committed
622
  };
Mark Otto's avatar
dist    
Mark Otto committed
623

XhmikosR's avatar
Dist    
XhmikosR committed
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
  var Carousel =
  /*#__PURE__*/
  function () {
    function Carousel(element, config) {
      this._items = null;
      this._interval = null;
      this._activeElement = null;
      this._isPaused = false;
      this._isSliding = false;
      this.touchTimeout = null;
      this.touchStartX = 0;
      this.touchDeltaX = 0;
      this._config = this._getConfig(config);
      this._element = element;
      this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS);
      this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
      this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);

      this._addEventListeners();
    } // Getters


    var _proto = Carousel.prototype;

    // Public
    _proto.next = function next() {
      if (!this._isSliding) {
        this._slide(Direction.NEXT);
      }
Mark Otto's avatar
dist    
Mark Otto committed
653
    };
Mark Otto's avatar
dist  
Mark Otto committed
654

XhmikosR's avatar
Dist    
XhmikosR committed
655
656
657
658
659
660
    _proto.nextWhenVisible = function nextWhenVisible() {
      // Don't call next when the page isn't visible
      // or the carousel or its parent isn't visible
      if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') {
        this.next();
      }
Mark Otto's avatar
dist  
Mark Otto committed
661
662
    };

XhmikosR's avatar
Dist    
XhmikosR committed
663
664
665
666
667
    _proto.prev = function prev() {
      if (!this._isSliding) {
        this._slide(Direction.PREV);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
668

XhmikosR's avatar
Dist    
XhmikosR committed
669
670
671
672
    _proto.pause = function pause(event) {
      if (!event) {
        this._isPaused = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
673

XhmikosR's avatar
Dist    
XhmikosR committed
674
675
676
677
      if (this._element.querySelector(Selector$2.NEXT_PREV)) {
        Util.triggerTransitionEnd(this._element);
        this.cycle(true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
678

XhmikosR's avatar
Dist    
XhmikosR committed
679
680
681
      clearInterval(this._interval);
      this._interval = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
682

XhmikosR's avatar
Dist    
XhmikosR committed
683
684
685
686
    _proto.cycle = function cycle(event) {
      if (!event) {
        this._isPaused = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
687

XhmikosR's avatar
Dist    
XhmikosR committed
688
      if (this._interval) {
Mark Otto's avatar
dist    
Mark Otto committed
689
690
        clearInterval(this._interval);
        this._interval = null;
XhmikosR's avatar
Dist    
XhmikosR committed
691
      }
Mark Otto's avatar
dist  
Mark Otto committed
692

XhmikosR's avatar
Dist    
XhmikosR committed
693
694
695
696
      if (this._config.interval && !this._isPaused) {
        this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
697

XhmikosR's avatar
Dist    
XhmikosR committed
698
699
    _proto.to = function to(index) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
700

XhmikosR's avatar
Dist    
XhmikosR committed
701
      this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist    
Mark Otto committed
702

XhmikosR's avatar
Dist    
XhmikosR committed
703
      var activeIndex = this._getItemIndex(this._activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
704

XhmikosR's avatar
Dist    
XhmikosR committed
705
706
707
      if (index > this._items.length - 1 || index < 0) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
708

XhmikosR's avatar
Dist    
XhmikosR committed
709
710
711
712
713
714
      if (this._isSliding) {
        $(this._element).one(Event$2.SLID, function () {
          return _this.to(index);
        });
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
715

XhmikosR's avatar
Dist    
XhmikosR committed
716
717
718
719
720
      if (activeIndex === index) {
        this.pause();
        this.cycle();
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
721

XhmikosR's avatar
Dist    
XhmikosR committed
722
      var direction = index > activeIndex ? Direction.NEXT : Direction.PREV;
Mark Otto's avatar
dist  
Mark Otto committed
723

XhmikosR's avatar
Dist    
XhmikosR committed
724
725
      this._slide(direction, this._items[index]);
    };
Mark Otto's avatar
dist  
Mark Otto committed
726

XhmikosR's avatar
Dist    
XhmikosR committed
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
    _proto.dispose = function dispose() {
      $(this._element).off(EVENT_KEY$2);
      $.removeData(this._element, DATA_KEY$2);
      this._items = null;
      this._config = null;
      this._element = null;
      this._interval = null;
      this._isPaused = null;
      this._isSliding = null;
      this._activeElement = null;
      this._indicatorsElement = null;
    }; // Private


    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default, config);
      Util.typeCheckConfig(NAME$2, config, DefaultType);
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
746

XhmikosR's avatar
Dist    
XhmikosR committed
747
748
    _proto._handleSwipe = function _handleSwipe() {
      var absDeltax = Math.abs(this.touchDeltaX);
Mark Otto's avatar
dist    
Mark Otto committed
749

XhmikosR's avatar
Dist    
XhmikosR committed
750
751
752
      if (absDeltax <= SWIPE_THRESHOLD) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
753

XhmikosR's avatar
Dist    
XhmikosR committed
754
      var direction = absDeltax / this.touchDeltaX; // swipe left
Mark Otto's avatar
dist    
Mark Otto committed
755

XhmikosR's avatar
Dist    
XhmikosR committed
756
757
758
      if (direction > 0) {
        this.prev();
      } // swipe right
Mark Otto's avatar
dist    
Mark Otto committed
759

Mark Otto's avatar
dist    
Mark Otto committed
760

XhmikosR's avatar
Dist    
XhmikosR committed
761
762
763
764
      if (direction < 0) {
        this.next();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
765

XhmikosR's avatar
Dist    
XhmikosR committed
766
767
    _proto._addEventListeners = function _addEventListeners() {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
768

XhmikosR's avatar
Dist    
XhmikosR committed
769
770
771
772
773
      if (this._config.keyboard) {
        $(this._element).on(Event$2.KEYDOWN, function (event) {
          return _this2._keydown(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
774

XhmikosR's avatar
Dist    
XhmikosR committed
775
776
777
778
779
780
781
      if (this._config.pause === 'hover') {
        $(this._element).on(Event$2.MOUSEENTER, function (event) {
          return _this2.pause(event);
        }).on(Event$2.MOUSELEAVE, function (event) {
          return _this2.cycle(event);
        });
      }
Mark Otto's avatar
dist    
Mark Otto committed
782

XhmikosR's avatar
Dist    
XhmikosR committed
783
784
      this._addTouchEventListeners();
    };
Mark Otto's avatar
dist  
Mark Otto committed
785

XhmikosR's avatar
Dist    
XhmikosR committed
786
787
    _proto._addTouchEventListeners = function _addTouchEventListeners() {
      var _this3 = this;
Mark Otto's avatar
dist    
Mark Otto committed
788

XhmikosR's avatar
Dist    
XhmikosR committed
789
790
791
      if (!this._touchSupported) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
792

XhmikosR's avatar
Dist    
XhmikosR committed
793
794
795
796
797
      var start = function start(event) {
        if (_this3._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
          _this3.touchStartX = event.originalEvent.clientX;
        } else if (!_this3._pointerEvent) {
          _this3.touchStartX = event.originalEvent.touches[0].clientX;
Mark Otto's avatar
dist    
Mark Otto committed
798
799
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
800

XhmikosR's avatar
Dist    
XhmikosR committed
801
802
803
804
805
806
807
      var move = function move(event) {
        // ensure swiping with one touch and not pinching
        if (event.originalEvent.touches && event.originalEvent.touches.length > 1) {
          _this3.touchDeltaX = 0;
        } else {
          _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX;
        }
Mark Otto's avatar
dist    
Mark Otto committed
808
      };
Mark Otto's avatar
dist    
Mark Otto committed
809

XhmikosR's avatar
Dist    
XhmikosR committed
810
811
812
813
814
815
      var end = function end(event) {
        if (_this3._pointerEvent && (event.originalEvent.pointerType === PointerType.TOUCH || event.originalEvent.pointerType === PointerType.PEN)) {
          _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX;
        }

        _this3._handleSwipe();
Mark Otto's avatar
dist    
Mark Otto committed
816

XhmikosR's avatar
Dist    
XhmikosR committed
817
818
819
820
821
822
823
824
825
        if (_this3._config.pause === 'hover') {
          // If it's a touch-enabled device, mouseenter/leave are fired as
          // part of the mouse compatibility events on first tap - the carousel
          // would stop cycling until user tapped out of it;
          // here, we listen for touchend, explicitly pause the carousel
          // (as if it's the second time we tap on it, mouseenter compat event
          // is NOT fired) and after a timeout (to allow for mouse compatibility
          // events to fire) we explicitly restart cycling
          _this3.pause();
Mark Otto's avatar
dist  
Mark Otto committed
826

XhmikosR's avatar
Dist    
XhmikosR committed
827
828
829
          if (_this3.touchTimeout) {
            clearTimeout(_this3.touchTimeout);
          }
Mark Otto's avatar
dist  
Mark Otto committed
830

XhmikosR's avatar
Dist    
XhmikosR committed
831
832
833
          _this3.touchTimeout = setTimeout(function (event) {
            return _this3.cycle(event);
          }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
Mark Otto's avatar
dist    
Mark Otto committed
834
835
        }
      };
Mark Otto's avatar
dist    
Mark Otto committed
836

XhmikosR's avatar
Dist    
XhmikosR committed
837
838
839
      $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) {
        return e.preventDefault();
      });
Mark Otto's avatar
dist    
Mark Otto committed
840

XhmikosR's avatar
Dist    
XhmikosR committed
841
842
843
844
845
846
847
      if (this._pointerEvent) {
        $(this._element).on(Event$2.POINTERDOWN, function (event) {
          return start(event);
        });
        $(this._element).on(Event$2.POINTERUP, function (event) {
          return end(event);
        });
Mark Otto's avatar
dist    
Mark Otto committed
848

XhmikosR's avatar
Dist    
XhmikosR committed
849
850
851
852
        this._element.classList.add(ClassName$2.POINTER_EVENT);
      } else {
        $(this._element).on(Event$2.TOUCHSTART, function (event) {
          return start(event);
Mark Otto's avatar
dist    
Mark Otto committed
853
        });
XhmikosR's avatar
Dist    
XhmikosR committed
854
855
856
857
858
859
860
861
        $(this._element).on(Event$2.TOUCHMOVE, function (event) {
          return move(event);
        });
        $(this._element).on(Event$2.TOUCHEND, function (event) {
          return end(event);
        });
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
862

XhmikosR's avatar
Dist    
XhmikosR committed
863
864
865
866
    _proto._keydown = function _keydown(event) {
      if (/input|textarea/i.test(event.target.tagName)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
867

XhmikosR's avatar
Dist    
XhmikosR committed
868
869
870
871
872
      switch (event.which) {
        case ARROW_LEFT_KEYCODE:
          event.preventDefault();
          this.prev();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
873

XhmikosR's avatar
Dist    
XhmikosR committed
874
875
876
877
        case ARROW_RIGHT_KEYCODE:
          event.preventDefault();
          this.next();
          break;
Mark Otto's avatar
dist  
Mark Otto committed
878

XhmikosR's avatar
Dist    
XhmikosR committed
879
880
881
        default:
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
882

XhmikosR's avatar
Dist    
XhmikosR committed
883
884
885
886
    _proto._getItemIndex = function _getItemIndex(element) {
      this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : [];
      return this._items.indexOf(element);
    };
Mark Otto's avatar
dist    
Mark Otto committed
887

XhmikosR's avatar
Dist    
XhmikosR committed
888
889
890
    _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
      var isNextDirection = direction === Direction.NEXT;
      var isPrevDirection = direction === Direction.PREV;
Mark Otto's avatar
dist    
Mark Otto committed
891

XhmikosR's avatar
Dist    
XhmikosR committed
892
      var activeIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
893

XhmikosR's avatar
Dist    
XhmikosR committed
894
895
      var lastItemIndex = this._items.length - 1;
      var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
Mark Otto's avatar
dist  
Mark Otto committed
896

XhmikosR's avatar
Dist    
XhmikosR committed
897
898
899
      if (isGoingToWrap && !this._config.wrap) {
        return activeElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
900

XhmikosR's avatar
Dist    
XhmikosR committed
901
902
903
904
      var delta = direction === Direction.PREV ? -1 : 1;
      var itemIndex = (activeIndex + delta) % this._items.length;
      return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
    };
Mark Otto's avatar
dist  
Mark Otto committed
905

XhmikosR's avatar
Dist    
XhmikosR committed
906
907
    _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
      var targetIndex = this._getItemIndex(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
908

XhmikosR's avatar
Dist    
XhmikosR committed
909
      var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM));
Mark Otto's avatar
dist    
Mark Otto committed
910

XhmikosR's avatar
Dist    
XhmikosR committed
911
912
913
914
915
916
917
918
919
      var slideEvent = $.Event(Event$2.SLIDE, {
        relatedTarget: relatedTarget,
        direction: eventDirectionName,
        from: fromIndex,
        to: targetIndex
      });
      $(this._element).trigger(slideEvent);
      return slideEvent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
920

XhmikosR's avatar
Dist    
XhmikosR committed
921
922
923
924
    _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
      if (this._indicatorsElement) {
        var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE));
        $(indicators).removeClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
925

XhmikosR's avatar
Dist    
XhmikosR committed
926
        var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
Mark Otto's avatar
dist  
Mark Otto committed
927

XhmikosR's avatar
Dist    
XhmikosR committed
928
929
        if (nextIndicator) {
          $(nextIndicator).addClass(ClassName$2.ACTIVE);
Mark Otto's avatar
dist    
Mark Otto committed
930
        }
XhmikosR's avatar
Dist    
XhmikosR committed
931
932
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
933

XhmikosR's avatar
Dist    
XhmikosR committed
934
935
    _proto._slide = function _slide(direction, element) {
      var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
936

XhmikosR's avatar
Dist    
XhmikosR committed
937
      var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM);
Mark Otto's avatar
dist  
Mark Otto committed
938

XhmikosR's avatar
Dist    
XhmikosR committed
939
      var activeElementIndex = this._getItemIndex(activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
940

XhmikosR's avatar
Dist    
XhmikosR committed
941
      var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
Mark Otto's avatar
dist    
Mark Otto committed
942

XhmikosR's avatar
Dist    
XhmikosR committed
943
      var nextElementIndex = this._getItemIndex(nextElement);
Mark Otto's avatar
dist  
Mark Otto committed
944

XhmikosR's avatar
Dist    
XhmikosR committed
945
946
947
948
      var isCycling = Boolean(this._interval);
      var directionalClassName;
      var orderClassName;
      var eventDirectionName;
Mark Otto's avatar
dist  
Mark Otto committed
949

XhmikosR's avatar
Dist    
XhmikosR committed
950
951
952
953
954
955
956
957
958
      if (direction === Direction.NEXT) {
        directionalClassName = ClassName$2.LEFT;
        orderClassName = ClassName$2.NEXT;
        eventDirectionName = Direction.LEFT;
      } else {
        directionalClassName = ClassName$2.RIGHT;
        orderClassName = ClassName$2.PREV;
        eventDirectionName = Direction.RIGHT;
      }
Mark Otto's avatar
dist  
Mark Otto committed
959

XhmikosR's avatar
Dist    
XhmikosR committed
960
961
962
963
      if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) {
        this._isSliding = false;
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
964

XhmikosR's avatar
Dist    
XhmikosR committed
965
      var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
Mark Otto's avatar
dist  
Mark Otto committed
966

XhmikosR's avatar
Dist    
XhmikosR committed
967
968
969
      if (slideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
970

XhmikosR's avatar
Dist    
XhmikosR committed
971
972
973
974
      if (!activeElement || !nextElement) {
        // Some weirdness is happening, so we bail
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
975

XhmikosR's avatar
Dist    
XhmikosR committed
976
      this._isSliding = true;
Mark Otto's avatar
dist    
Mark Otto committed
977

XhmikosR's avatar
Dist    
XhmikosR committed
978
979
980
      if (isCycling) {
        this.pause();
      }
Mark Otto's avatar
dist  
Mark Otto committed
981

XhmikosR's avatar
Dist    
XhmikosR committed
982
      this._setActiveIndicatorElement(nextElement);
Mark Otto's avatar
dist    
Mark Otto committed
983

XhmikosR's avatar
Dist    
XhmikosR committed
984
985
986
987
988
989
      var slidEvent = $.Event(Event$2.SLID, {
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
Mark Otto's avatar
dist    
Mark Otto committed
990

XhmikosR's avatar
Dist    
XhmikosR committed
991
992
993
994
995
996
997
998
999
1000
1001
1002
      if ($(this._element).hasClass(ClassName$2.SLIDE)) {
        $(nextElement).addClass(orderClassName);
        Util.reflow(nextElement);
        $(activeElement).addClass(directionalClassName);
        $(nextElement).addClass(directionalClassName);
        var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);

        if (nextElementInterval) {
          this._config.defaultInterval = this._config.defaultInterval || this._config.interval;
          this._config.interval = nextElementInterval;
        } else {
          this._config.interval = this._config.defaultInterval || this._config.interval;
Mark Otto's avatar
dist  
Mark Otto committed
1003
1004
        }

XhmikosR's avatar
Dist    
XhmikosR committed
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
        var transitionDuration = Util.getTransitionDurationFromElement(activeElement);
        $(activeElement).one(Util.TRANSITION_END, function () {
          $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE);
          $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName);
          _this4._isSliding = false;
          setTimeout(function () {
            return $(_this4._element).trigger(slidEvent);
          }, 0);
        }).emulateTransitionEnd(transitionDuration);
      } else {
        $(activeElement).removeClass(ClassName$2.ACTIVE);
        $(nextElement).addClass(ClassName$2.ACTIVE);
        this._isSliding = false;
        $(this._element).trigger(slidEvent);
      }

      if (isCycling) {
        this.cycle();
      }
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
1025
1026


XhmikosR's avatar
Dist    
XhmikosR committed
1027
1028
1029
    Carousel._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$2);
Mark Otto's avatar
dist  
Mark Otto committed
1030

XhmikosR's avatar
Dist    
XhmikosR committed
1031
        var _config = _objectSpread({}, Default, $(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
1032

XhmikosR's avatar
Dist    
XhmikosR committed
1033
1034
        if (typeof config === 'object') {
          _config = _objectSpread({}, _config, config);
Mark Otto's avatar
dist    
Mark Otto committed
1035
        }
Mark Otto's avatar
dist  
Mark Otto committed
1036

XhmikosR's avatar
Dist    
XhmikosR committed
1037
        var action = typeof config === 'string' ? config : _config.slide;
Mark Otto's avatar
dist  
Mark Otto committed
1038

XhmikosR's avatar
Dist    
XhmikosR committed
1039
1040
1041
        if (!data) {
          data = new Carousel(this, _config);
          $(this).data(DATA_KEY$2, data);
Mark Otto's avatar
dist    
Mark Otto committed
1042
        }
Mark Otto's avatar
dist  
Mark Otto committed
1043

XhmikosR's avatar
Dist    
XhmikosR committed
1044
1045
1046
1047
1048
1049
        if (typeof config === 'number') {
          data.to(config);
        } else if (typeof action === 'string') {
          if (typeof data[action] === 'undefined') {
            throw new TypeError("No method named \"" + action + "\"");
          }
Mark Otto's avatar
dist  
Mark Otto committed
1050

XhmikosR's avatar
Dist    
XhmikosR committed
1051
1052
1053
1054
          data[action]();
        } else if (_config.interval) {
          data.pause();
          data.cycle();
Mark Otto's avatar
dist    
Mark Otto committed
1055
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1056
1057
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
1058

XhmikosR's avatar
Dist    
XhmikosR committed
1059
1060
    Carousel._dataApiClickHandler = function _dataApiClickHandler(event) {
      var selector = Util.getSelectorFromElement(this);
Mark Otto's avatar
dist  
Mark Otto committed
1061

XhmikosR's avatar
Dist    
XhmikosR committed
1062
1063
1064
1065
1066
1067
1068
1069
1070
      if (!selector) {
        return;
      }

      var target = $(selector)[0];

      if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1071

XhmikosR's avatar
Dist    
XhmikosR committed
1072
      var config = _objectSpread({}, $(target).data(), $(this).data());
Mark Otto's avatar
dist    
Mark Otto committed
1073

XhmikosR's avatar
Dist    
XhmikosR committed
1074
      var slideIndex = this.getAttribute('data-slide-to');
Mark Otto's avatar
dist    
Mark Otto committed
1075

XhmikosR's avatar
Dist    
XhmikosR committed
1076
1077
      if (slideIndex) {
        config.interval = false;
Mark Otto's avatar
dist    
Mark Otto committed
1078
      }
Mark Otto's avatar
dist    
Mark Otto committed
1079

XhmikosR's avatar
Dist    
XhmikosR committed
1080
      Carousel._jQueryInterface.call($(target), config);
Mark Otto's avatar
dist  
Mark Otto committed
1081

XhmikosR's avatar
Dist    
XhmikosR committed
1082
1083
1084
1085
1086
      if (slideIndex) {
        $(target).data(DATA_KEY$2).to(slideIndex);
      }

      event.preventDefault();
Mark Otto's avatar
dist    
Mark Otto committed
1087
    };
Mark Otto's avatar
dist  
Mark Otto committed
1088

XhmikosR's avatar
Dist    
XhmikosR committed
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
    _createClass(Carousel, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$2;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default;
      }
    }]);

Mark Otto's avatar
dist    
Mark Otto committed
1101
    return Carousel;
XhmikosR's avatar
Dist    
XhmikosR committed
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


  $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler);
  $(window).on(Event$2.LOAD_DATA_API, function () {
    var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE));

    for (var i = 0, len = carousels.length; i < len; i++) {
      var $carousel = $(carousels[i]);

      Carousel._jQueryInterface.call($carousel, $carousel.data());
    }
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

  $.fn[NAME$2] = Carousel._jQueryInterface;
  $.fn[NAME$2].Constructor = Carousel;

  $.fn[NAME$2].noConflict = function () {
    $.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
    return Carousel._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
1133
1134

  /**
Mark Otto's avatar
dist    
Mark Otto committed
1135
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
1136
   * Bootstrap (v4.1.3): collapse.js
Mark Otto's avatar
dist    
Mark Otto committed
1137
1138
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
1139
   */
Mark Otto's avatar
dist    
Mark Otto committed
1140

XhmikosR's avatar
Dist    
XhmikosR committed
1141
1142
1143
1144
1145
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
1146

XhmikosR's avatar
Dist    
XhmikosR committed
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
  var NAME$3 = 'collapse';
  var VERSION$3 = '4.1.3';
  var DATA_KEY$3 = 'bs.collapse';
  var EVENT_KEY$3 = "." + DATA_KEY$3;
  var DATA_API_KEY$3 = '.data-api';
  var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3];
  var Default$1 = {
    toggle: true,
    parent: ''
  };
  var DefaultType$1 = {
    toggle: 'boolean',
    parent: '(string|element)'
  };
  var Event$3 = {
    SHOW: "show" + EVENT_KEY$3,
    SHOWN: "shown" + EVENT_KEY$3,
    HIDE: "hide" + EVENT_KEY$3,
    HIDDEN: "hidden" + EVENT_KEY$3,
    CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3
  };
  var ClassName$3 = {
    SHOW: 'show',
    COLLAPSE: 'collapse',
    COLLAPSING: 'collapsing',
    COLLAPSED: 'collapsed'
  };
  var Dimension = {
    WIDTH: 'width',
    HEIGHT: 'height'
  };
  var Selector$3 = {
    ACTIVES: '.show, .collapsing',
    DATA_TOGGLE: '[data-toggle="collapse"]'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
1186

XhmikosR's avatar
Dist    
XhmikosR committed
1187
  };
Mark Otto's avatar
dist    
Mark Otto committed
1188

XhmikosR's avatar
Dist    
XhmikosR committed
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
  var Collapse =
  /*#__PURE__*/
  function () {
    function Collapse(element, config) {
      this._isTransitioning = false;
      this._element = element;
      this._config = this._getConfig(config);
      this._triggerArray = $.makeArray(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]")));
      var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE));

      for (var i = 0, len = toggleList.length; i < len; i++) {
        var elem = toggleList[i];
        var selector = Util.getSelectorFromElement(elem);
        var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) {
          return foundElem === element;
        });
Mark Otto's avatar
dist  
Mark Otto committed
1205

XhmikosR's avatar
Dist    
XhmikosR committed
1206
1207
        if (selector !== null && filterElement.length > 0) {
          this._selector = selector;
Mark Otto's avatar
dist  
Mark Otto committed
1208

XhmikosR's avatar
Dist    
XhmikosR committed
1209
          this._triggerArray.push(elem);
Mark Otto's avatar
dist    
Mark Otto committed
1210
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1211
      }
Mark Otto's avatar
dist  
Mark Otto committed
1212

XhmikosR's avatar
Dist    
XhmikosR committed
1213
      this._parent = this._config.parent ? this._getParent() : null;
Mark Otto's avatar
dist  
Mark Otto committed
1214

XhmikosR's avatar
Dist    
XhmikosR committed
1215
1216
1217
      if (!this._config.parent) {
        this._addAriaAndCollapsedClass(this._element, this._triggerArray);
      }
Mark Otto's avatar
dist  
Mark Otto committed
1218

XhmikosR's avatar
Dist    
XhmikosR committed
1219
1220
1221
1222
      if (this._config.toggle) {
        this.toggle();
      }
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
1223
1224


XhmikosR's avatar
Dist    
XhmikosR committed
1225
    var _proto = Collapse.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
1226

XhmikosR's avatar
Dist    
XhmikosR committed
1227
1228
1229
1230
1231
1232
1233
1234
    // Public
    _proto.toggle = function toggle() {
      if ($(this._element).hasClass(ClassName$3.SHOW)) {
        this.hide();
      } else {
        this.show();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
1235

XhmikosR's avatar
Dist    
XhmikosR committed
1236
1237
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
1238

XhmikosR's avatar
Dist    
XhmikosR committed
1239
1240
1241
      if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
1242

XhmikosR's avatar
Dist    
XhmikosR committed
1243
1244
      var actives;
      var activesData;
Mark Otto's avatar
dist    
Mark Otto committed
1245

XhmikosR's avatar
Dist    
XhmikosR committed
1246
1247
1248
1249
      if (this._parent) {
        actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) {
          if (typeof _this._config.parent === 'string') {
            return elem.getAttribute('data-parent') === _this._config.parent;
Mark Otto's avatar
dist    
Mark Otto committed
1250
          }
Mark Otto's avatar
dist  
Mark Otto committed
1251

XhmikosR's avatar
Dist    
XhmikosR committed
1252
1253
          return elem.classList.contains(ClassName$3.COLLAPSE);
        });
Mark Otto's avatar
dist    
Mark Otto committed
1254

XhmikosR's avatar
Dist    
XhmikosR committed
1255
1256
        if (actives.length === 0) {
          actives = null;
Mark Otto's avatar
dist  
Mark Otto committed
1257
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1258
      }
Mark Otto's avatar
dist  
Mark Otto committed
1259

XhmikosR's avatar
Dist    
XhmikosR committed
1260
1261
      if (actives) {
        activesData = $(actives).not(this._selector).data(DATA_KEY$3);
Mark Otto's avatar
dist    
Mark Otto committed
1262

XhmikosR's avatar
Dist    
XhmikosR committed
1263
        if (activesData && activesData._isTransitioning) {
Mark Otto's avatar
dist    
Mark Otto committed
1264
1265
          return;
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1266
      }
Mark Otto's avatar
dist  
Mark Otto committed
1267

XhmikosR's avatar
Dist    
XhmikosR committed
1268
1269
      var startEvent = $.Event(Event$3.SHOW);
      $(this._element).trigger(startEvent);
Mark Otto's avatar
dist  
Mark Otto committed
1270

XhmikosR's avatar
Dist    
XhmikosR committed
1271
1272
1273
      if (startEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1274

XhmikosR's avatar
Dist    
XhmikosR committed
1275
1276
      if (actives) {
        Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide');
Mark Otto's avatar
dist  
Mark Otto committed
1277

XhmikosR's avatar
Dist    
XhmikosR committed
1278
1279
        if (!activesData) {
          $(actives).data(DATA_KEY$3, null);
Mark Otto's avatar
dist    
Mark Otto committed
1280
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1281
      }
Mark Otto's avatar
dist  
Mark Otto committed
1282

XhmikosR's avatar
Dist    
XhmikosR committed
1283
      var dimension = this._getDimension();
Mark Otto's avatar
dist  
Mark Otto committed
1284

XhmikosR's avatar
Dist    
XhmikosR committed
1285
1286
      $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING);
      this._element.style[dimension] = 0;
Mark Otto's avatar
dist  
Mark Otto committed
1287

XhmikosR's avatar
Dist    
XhmikosR committed
1288
1289
1290
      if (this._triggerArray.length) {
        $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true);
      }
Mark Otto's avatar
dist  
Mark Otto committed
1291

XhmikosR's avatar
Dist    
XhmikosR committed
1292
      this.setTransitioning(true);
Mark Otto's avatar
dist  
Mark Otto committed
1293

XhmikosR's avatar
Dist    
XhmikosR committed
1294
1295
1296
1297
1298
1299
1300
      var complete = function complete() {
        $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW);
        _this._element.style[dimension] = '';

        _this.setTransitioning(false);

        $(_this._element).trigger(Event$3.SHOWN);
Mark Otto's avatar
dist    
Mark Otto committed
1301
      };
Mark Otto's avatar
dist  
Mark Otto committed
1302

XhmikosR's avatar
Dist    
XhmikosR committed
1303
1304
1305
1306
1307
1308
      var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
      var scrollSize = "scroll" + capitalizedDimension;
      var transitionDuration = Util.getTransitionDurationFromElement(this._element);
      $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      this._element.style[dimension] = this._element[scrollSize] + "px";
    };
Mark Otto's avatar
dist  
Mark Otto committed
1309

XhmikosR's avatar
Dist    
XhmikosR committed
1310
1311
1312
1313
1314
1315
    _proto.hide = function hide() {
      var _this2 = this;

      if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1316

XhmikosR's avatar
Dist    
XhmikosR committed
1317
1318
      var startEvent = $.Event(Event$3.HIDE);
      $(this._element).trigger(startEvent);
Mark Otto's avatar
dist    
Mark Otto committed
1319

XhmikosR's avatar
Dist    
XhmikosR committed
1320
1321
1322
      if (startEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1323

XhmikosR's avatar
Dist    
XhmikosR committed
1324
      var dimension = this._getDimension();
Mark Otto's avatar
dist  
Mark Otto committed
1325

XhmikosR's avatar
Dist    
XhmikosR committed
1326
1327
1328
1329
      this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
      Util.reflow(this._element);
      $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW);
      var triggerArrayLength = this._triggerArray.length;
Mark Otto's avatar
dist  
Mark Otto committed
1330

XhmikosR's avatar
Dist    
XhmikosR committed
1331
1332
1333
1334
      if (triggerArrayLength > 0) {
        for (var i = 0; i < triggerArrayLength; i++) {
          var trigger = this._triggerArray[i];
          var selector = Util.getSelectorFromElement(trigger);
Mark Otto's avatar
dist    
Mark Otto committed
1335

XhmikosR's avatar
Dist    
XhmikosR committed
1336
1337
          if (selector !== null) {
            var $elem = $([].slice.call(document.querySelectorAll(selector)));
Mark Otto's avatar
dist    
Mark Otto committed
1338

XhmikosR's avatar
Dist    
XhmikosR committed
1339
1340
            if (!$elem.hasClass(ClassName$3.SHOW)) {
              $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false);
Mark Otto's avatar
dist  
Mark Otto committed
1341
1342
1343
            }
          }
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1344
      }
Mark Otto's avatar
dist  
Mark Otto committed
1345

XhmikosR's avatar
Dist    
XhmikosR committed
1346
      this.setTransitioning(true);
Mark Otto's avatar
dist  
Mark Otto committed
1347

XhmikosR's avatar
Dist    
XhmikosR committed
1348
1349
      var complete = function complete() {
        _this2.setTransitioning(false);
Mark Otto's avatar
dist  
Mark Otto committed
1350

XhmikosR's avatar
Dist    
XhmikosR committed
1351
        $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
1352
      };
Mark Otto's avatar
dist  
Mark Otto committed
1353

XhmikosR's avatar
Dist    
XhmikosR committed
1354
1355
1356
1357
      this._element.style[dimension] = '';
      var transitionDuration = Util.getTransitionDurationFromElement(this._element);
      $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
    };
Mark Otto's avatar
dist  
Mark Otto committed
1358

XhmikosR's avatar
Dist    
XhmikosR committed
1359
1360
1361
    _proto.setTransitioning = function setTransitioning(isTransitioning) {
      this._isTransitioning = isTransitioning;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1362

XhmikosR's avatar
Dist    
XhmikosR committed
1363
1364
1365
1366
1367
1368
1369
1370
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$3);
      this._config = null;
      this._parent = null;
      this._element = null;
      this._triggerArray = null;
      this._isTransitioning = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
1371

Mark Otto's avatar
dist    
Mark Otto committed
1372

XhmikosR's avatar
Dist    
XhmikosR committed
1373
1374
1375
    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default$1, config);
      config.toggle = Boolean(config.toggle); // Coerce string values
Mark Otto's avatar
dist  
Mark Otto committed
1376

XhmikosR's avatar
Dist    
XhmikosR committed
1377
1378
1379
      Util.typeCheckConfig(NAME$3, config, DefaultType$1);
      return config;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1380

XhmikosR's avatar
Dist    
XhmikosR committed
1381
1382
1383
1384
    _proto._getDimension = function _getDimension() {
      var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
      return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1385

XhmikosR's avatar
Dist    
XhmikosR committed
1386
1387
    _proto._getParent = function _getParent() {
      var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
1388

XhmikosR's avatar
Dist    
XhmikosR committed
1389
      var parent;
Mark Otto's avatar
dist    
Mark Otto committed
1390

XhmikosR's avatar
Dist    
XhmikosR committed
1391
1392
      if (Util.isElement(this._config.parent)) {
        parent = this._config.parent; // It's a jQuery object
Mark Otto's avatar
dist    
Mark Otto committed
1393

XhmikosR's avatar
Dist    
XhmikosR committed
1394
1395
1396
1397
1398
1399
        if (typeof this._config.parent.jquery !== 'undefined') {
          parent = this._config.parent[0];
        }
      } else {
        parent = document.querySelector(this._config.parent);
      }
Mark Otto's avatar
dist  
Mark Otto committed
1400

XhmikosR's avatar
Dist    
XhmikosR committed
1401
1402
1403
1404
1405
1406
1407
      var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]";
      var children = [].slice.call(parent.querySelectorAll(selector));
      $(children).each(function (i, element) {
        _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]);
      });
      return parent;
    };
Mark Otto's avatar
dist  
Mark Otto committed
1408

XhmikosR's avatar
Dist    
XhmikosR committed
1409
1410
    _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
      var isOpen = $(element).hasClass(ClassName$3.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
1411

XhmikosR's avatar
Dist    
XhmikosR committed
1412
1413
1414
1415
      if (triggerArray.length) {
        $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen);
      }
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
1416
1417


XhmikosR's avatar
Dist    
XhmikosR committed
1418
1419
1420
1421
    Collapse._getTargetFromElement = function _getTargetFromElement(element) {
      var selector = Util.getSelectorFromElement(element);
      return selector ? document.querySelector(selector) : null;
    };
Mark Otto's avatar
dist    
Mark Otto committed
1422

XhmikosR's avatar
Dist    
XhmikosR committed
1423
1424
1425
1426
    Collapse._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $this = $(this);
        var data = $this.data(DATA_KEY$3);
Mark Otto's avatar
dist  
Mark Otto committed
1427

XhmikosR's avatar
Dist    
XhmikosR committed
1428
        var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
1429

XhmikosR's avatar
Dist    
XhmikosR committed
1430
1431
1432
        if (!data && _config.toggle && /show|hide/.test(config)) {
          _config.toggle = false;
        }
Mark Otto's avatar
dist    
Mark Otto committed
1433

XhmikosR's avatar
Dist    
XhmikosR committed
1434
1435
1436
1437
        if (!data) {
          data = new Collapse(this, _config);
          $this.data(DATA_KEY$3, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
1438

XhmikosR's avatar
Dist    
XhmikosR committed
1439
1440
1441
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
1442
          }
Mark Otto's avatar
dist    
Mark Otto committed
1443

XhmikosR's avatar
Dist    
XhmikosR committed
1444
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
1445
        }
XhmikosR's avatar
Dist    
XhmikosR committed
1446
1447
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
1448

XhmikosR's avatar
Dist    
XhmikosR committed
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
    _createClass(Collapse, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$3;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$1;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
1460

XhmikosR's avatar
Dist    
XhmikosR committed
1461
1462
1463
1464
1465
1466
1467
    return Collapse;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
1468

Mark Otto's avatar
dist  
Mark Otto committed
1469

XhmikosR's avatar
Dist    
XhmikosR committed
1470
1471
1472
1473
1474
  $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) {
    // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
    if (event.currentTarget.tagName === 'A') {
      event.preventDefault();
    }
Mark Otto's avatar
dist    
Mark Otto committed
1475

XhmikosR's avatar
Dist    
XhmikosR committed
1476
1477
1478
1479
1480
1481
1482
    var $trigger = $(this);
    var selector = Util.getSelectorFromElement(this);
    var selectors = [].slice.call(document.querySelectorAll(selector));
    $(selectors).each(function () {
      var $target = $(this);
      var data = $target.data(DATA_KEY$3);
      var config = data ? 'toggle' : $trigger.data();
Mark Otto's avatar
dist  
Mark Otto committed
1483

XhmikosR's avatar
Dist    
XhmikosR committed
1484
1485
1486
1487
1488
1489
1490
1491
      Collapse._jQueryInterface.call($target, config);
    });
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
1492

XhmikosR's avatar
Dist    
XhmikosR committed
1493
1494
  $.fn[NAME$3] = Collapse._jQueryInterface;
  $.fn[NAME$3].Constructor = Collapse;
Mark Otto's avatar
dist  
Mark Otto committed
1495

XhmikosR's avatar
Dist    
XhmikosR committed
1496
1497
1498
1499
  $.fn[NAME$3].noConflict = function () {
    $.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
    return Collapse._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
1500

Mark Otto's avatar
dist    
Mark Otto committed
1501
1502
  /**!
   * @fileOverview Kickass library to create and place poppers near their reference elements.
Mark Otto's avatar
dist    
Mark Otto committed
1503
   * @version 1.14.4
Mark Otto's avatar
dist    
Mark Otto committed
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
   * @license
   * Copyright (c) 2016 Federico Zivolo and contributors
   *
   * Permission is hereby granted, free of charge, to any person obtaining a copy
   * of this software and associated documentation files (the "Software"), to deal
   * in the Software without restriction, including without limitation the rights
   * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
   * copies of the Software, and to permit persons to whom the Software is
   * furnished to do so, subject to the following conditions:
   *
   * The above copyright notice and this permission notice shall be included in all
   * copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
   * SOFTWARE.
   */
  var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
Mark Otto's avatar
dist    
Mark Otto committed
1526

Mark Otto's avatar
dist    
Mark Otto committed
1527
1528
1529
1530
1531
1532
  var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
  var timeoutDuration = 0;
  for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
    if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
      timeoutDuration = 1;
      break;
Mark Otto's avatar
dist  
Mark Otto committed
1533
    }
Mark Otto's avatar
dist    
Mark Otto committed
1534
  }
Mark Otto's avatar
dist  
Mark Otto committed
1535

Mark Otto's avatar
dist    
Mark Otto committed
1536
1537
1538
1539
1540
1541
1542
1543
1544
  function microtaskDebounce(fn) {
    var called = false;
    return function () {
      if (called) {
        return;
      }
      called = true;
      window.Promise.resolve().then(function () {
        called = false;
Mark Otto's avatar
dist  
Mark Otto committed
1545
        fn();
Mark Otto's avatar
dist    
Mark Otto committed
1546
1547
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
1548
1549
  }

Mark Otto's avatar
dist    
Mark Otto committed
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
  function taskDebounce(fn) {
    var scheduled = false;
    return function () {
      if (!scheduled) {
        scheduled = true;
        setTimeout(function () {
          scheduled = false;
          fn();
        }, timeoutDuration);
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
1561
1562
  }

Mark Otto's avatar
dist    
Mark Otto committed
1563
  var supportsMicroTasks = isBrowser && window.Promise;
Mark Otto's avatar
dist  
Mark Otto committed
1564

Mark Otto's avatar
dist    
Mark Otto committed
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
  /**
  * Create a debounced version of a method, that's asynchronously deferred
  * but called in the minimum time possible.
  *
  * @method
  * @memberof Popper.Utils
  * @argument {Function} fn
  * @returns {Function}
  */
  var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
Mark Otto's avatar
dist  
Mark Otto committed
1575

Mark Otto's avatar
dist    
Mark Otto committed
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
  /**
   * Check if the given variable is a function
   * @method
   * @memberof Popper.Utils
   * @argument {Any} functionToCheck - variable to check
   * @returns {Boolean} answer to: is a function?
   */
  function isFunction(functionToCheck) {
    var getType = {};
    return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
Mark Otto's avatar
dist  
Mark Otto committed
1586
1587
  }

Mark Otto's avatar
dist    
Mark Otto committed
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
  /**
   * Get CSS computed property of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Eement} element
   * @argument {String} property
   */
  function getStyleComputedProperty(element, property) {
    if (element.nodeType !== 1) {
      return [];
Mark Otto's avatar
dist    
Mark Otto committed
1598
    }
Mark Otto's avatar
dist    
Mark Otto committed
1599
1600
1601
    // NOTE: 1 DOM access here
    var css = getComputedStyle(element, null);
    return property ? css[property] : css;
Mark Otto's avatar
dist  
Mark Otto committed
1602
1603
  }

Mark Otto's avatar
dist    
Mark Otto committed
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
  /**
   * Returns the parentNode or the host of the element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} parent
   */
  function getParentNode(element) {
    if (element.nodeName === 'HTML') {
      return element;
    }
    return element.parentNode || element.host;
Mark Otto's avatar
dist  
Mark Otto committed
1616
1617
  }

Mark Otto's avatar
dist    
Mark Otto committed
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
  /**
   * Returns the scrolling parent of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} scroll parent
   */
  function getScrollParent(element) {
    // Return body, `getScroll` will take care to get the correct `scrollTop` from it
    if (!element) {
      return document.body;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1630

Mark Otto's avatar
dist    
Mark Otto committed
1631
1632
1633
1634
1635
1636
1637
    switch (element.nodeName) {
      case 'HTML':
      case 'BODY':
        return element.ownerDocument.body;
      case '#document':
        return element.body;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1638

Mark Otto's avatar
dist    
Mark Otto committed
1639
    // Firefox want us to check `-x` and `-y` variations as well
Mark Otto's avatar
dist  
Mark Otto committed
1640

Mark Otto's avatar
dist    
Mark Otto committed
1641
1642
1643
1644
    var _getStyleComputedProp = getStyleComputedProperty(element),
        overflow = _getStyleComputedProp.overflow,
        overflowX = _getStyleComputedProp.overflowX,
        overflowY = _getStyleComputedProp.overflowY;
Mark Otto's avatar
dist  
Mark Otto committed
1645

Mark Otto's avatar
dist    
Mark Otto committed
1646
1647
    if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
      return element;
Mark Otto's avatar
dist  
Mark Otto committed
1648
1649
    }

Mark Otto's avatar
dist    
Mark Otto committed
1650
    return getScrollParent(getParentNode(element));
Mark Otto's avatar
dist  
Mark Otto committed
1651
1652
  }

Mark Otto's avatar
dist    
Mark Otto committed
1653
1654
1655
  var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode);
  var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent);

Mark Otto's avatar
dist    
Mark Otto committed
1656
  /**
Mark Otto's avatar
dist    
Mark Otto committed
1657
   * Determines if the browser is Internet Explorer
Mark Otto's avatar
dist    
Mark Otto committed
1658
1659
   * @method
   * @memberof Popper.Utils
Mark Otto's avatar
dist    
Mark Otto committed
1660
   * @param {Number} version to check
Mark Otto's avatar
dist    
Mark Otto committed
1661
1662
   * @returns {Boolean} isIE
   */
Mark Otto's avatar
dist    
Mark Otto committed
1663
1664
1665
  function isIE(version) {
    if (version === 11) {
      return isIE11;
Mark Otto's avatar
dist    
Mark Otto committed
1666
    }
Mark Otto's avatar
dist    
Mark Otto committed
1667
1668
    if (version === 10) {
      return isIE10;
Mark Otto's avatar
dist    
Mark Otto committed
1669
    }
Mark Otto's avatar
dist    
Mark Otto committed
1670
1671
    return isIE11 || isIE10;
  }
Mark Otto's avatar
dist  
Mark Otto committed
1672

Mark Otto's avatar
dist    
Mark Otto committed
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
  /**
   * Returns the offset parent of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} offset parent
   */
  function getOffsetParent(element) {
    if (!element) {
      return document.documentElement;
Mark Otto's avatar
dist  
Mark Otto committed
1683
1684
    }

Mark Otto's avatar
dist    
Mark Otto committed
1685
    var noOffsetParent = isIE(10) ? document.body : null;
Mark Otto's avatar
dist  
Mark Otto committed
1686

Mark Otto's avatar
dist    
Mark Otto committed
1687
1688
1689
1690
1691
1692
    // NOTE: 1 DOM access here
    var offsetParent = element.offsetParent;
    // Skip hidden elements which don't have an offsetParent
    while (offsetParent === noOffsetParent && element.nextElementSibling) {
      offsetParent = (element = element.nextElementSibling).offsetParent;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1693

Mark Otto's avatar
dist    
Mark Otto committed
1694
    var nodeName = offsetParent && offsetParent.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1695

Mark Otto's avatar
dist    
Mark Otto committed
1696
1697
1698
    if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
      return element ? element.ownerDocument.documentElement : document.documentElement;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1699

Mark Otto's avatar
dist    
Mark Otto committed
1700
1701
1702
1703
1704
    // .offsetParent will return the closest TD or TABLE in case
    // no offsetParent is present, I hate this job...
    if (['TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
      return getOffsetParent(offsetParent);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1705

Mark Otto's avatar
dist    
Mark Otto committed
1706
    return offsetParent;
Mark Otto's avatar
dist  
Mark Otto committed
1707
1708
  }

Mark Otto's avatar
dist    
Mark Otto committed
1709
1710
  function isOffsetContainer(element) {
    var nodeName = element.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1711

Mark Otto's avatar
dist    
Mark Otto committed
1712
1713
    if (nodeName === 'BODY') {
      return false;
Mark Otto's avatar
dist  
Mark Otto committed
1714
    }
Mark Otto's avatar
dist    
Mark Otto committed
1715
    return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element;
Mark Otto's avatar
dist  
Mark Otto committed
1716
1717
  }

Mark Otto's avatar
dist    
Mark Otto committed
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
  /**
   * Finds the root node (document, shadowDOM root) of the given element
   * @method
   * @memberof Popper.Utils
   * @argument {Element} node
   * @returns {Element} root node
   */
  function getRoot(node) {
    if (node.parentNode !== null) {
      return getRoot(node.parentNode);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1729

Mark Otto's avatar
dist    
Mark Otto committed
1730
    return node;
Mark Otto's avatar
dist  
Mark Otto committed
1731
1732
  }

Mark Otto's avatar
dist    
Mark Otto committed
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
  /**
   * Finds the offset parent common to the two provided nodes
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element1
   * @argument {Element} element2
   * @returns {Element} common offset parent
   */
  function findCommonOffsetParent(element1, element2) {
    // This check is needed to avoid errors in case one of the elements isn't defined for any reason
    if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
      return document.documentElement;
    }
Mark Otto's avatar
dist  
Mark Otto committed
1746

Mark Otto's avatar
dist    
Mark Otto committed
1747
1748
1749
1750
    // Here we make sure to give as "start" the element that comes first in the DOM
    var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
    var start = order ? element1 : element2;
    var end = order ? element2 : element1;
Mark Otto's avatar
dist  
Mark Otto committed
1751

Mark Otto's avatar
dist    
Mark Otto committed
1752
1753
1754
1755
1756
    // Get common ancestor container
    var range = document.createRange();
    range.setStart(start, 0);
    range.setEnd(end, 0);
    var commonAncestorContainer = range.commonAncestorContainer;
Mark Otto's avatar
dist  
Mark Otto committed
1757

Mark Otto's avatar
dist    
Mark Otto committed
1758
    // Both nodes are inside #document
Mark Otto's avatar
dist  
Mark Otto committed
1759

Mark Otto's avatar
dist    
Mark Otto committed
1760
1761
1762
1763
    if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
      if (isOffsetContainer(commonAncestorContainer)) {
        return commonAncestorContainer;
      }
Mark Otto's avatar
dist  
Mark Otto committed
1764

Mark Otto's avatar
dist    
Mark Otto committed
1765
1766
      return getOffsetParent(commonAncestorContainer);
    }
Mark Otto's avatar
dist  
Mark Otto committed
1767

Mark Otto's avatar
dist    
Mark Otto committed
1768
1769
1770
1771
    // one of the nodes is inside shadowDOM, find which one
    var element1root = getRoot(element1);
    if (element1root.host) {
      return findCommonOffsetParent(element1root.host, element2);
Mark Otto's avatar
dist  
Mark Otto committed
1772
    } else {
Mark Otto's avatar
dist    
Mark Otto committed
1773
      return findCommonOffsetParent(element1, getRoot(element2).host);
Mark Otto's avatar
dist  
Mark Otto committed
1774
    }
Mark Otto's avatar
dist    
Mark Otto committed
1775
  }
Mark Otto's avatar
dist  
Mark Otto committed
1776

Mark Otto's avatar
dist    
Mark Otto committed
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
  /**
   * Gets the scroll value of the given element in the given side (top and left)
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @argument {String} side `top` or `left`
   * @returns {number} amount of scrolled pixels
   */
  function getScroll(element) {
    var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
Mark Otto's avatar
dist  
Mark Otto committed
1787

Mark Otto's avatar
dist    
Mark Otto committed
1788
1789
    var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
    var nodeName = element.nodeName;
Mark Otto's avatar
dist  
Mark Otto committed
1790

Mark Otto's avatar
dist    
Mark Otto committed
1791
1792
1793
1794
    if (nodeName === 'BODY' || nodeName === 'HTML') {
      var html = element.ownerDocument.documentElement;
      var scrollingElement = element.ownerDocument.scrollingElement || html;
      return scrollingElement[upperSide];
Mark Otto's avatar
dist  
Mark Otto committed
1795
1796
    }

Mark Otto's avatar
dist    
Mark Otto committed
1797
    return element[upperSide];
Mark Otto's avatar
dist  
Mark Otto committed
1798
1799
  }

Mark Otto's avatar
dist    
Mark Otto committed
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
  /*
   * Sum or subtract the element scroll values (left and top) from a given rect object
   * @method
   * @memberof Popper.Utils
   * @param {Object} rect - Rect object you want to change
   * @param {HTMLElement} element - The element from the function reads the scroll values
   * @param {Boolean} subtract - set to true if you want to subtract the scroll values
   * @return {Object} rect - The modifier rect object
   */
  function includeScroll(rect, element) {
    var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;

    var scrollTop = getScroll(element, 'top');
    var scrollLeft = getScroll(element, 'left');
    var modifier = subtract ? -1 : 1;
    rect.top += scrollTop * modifier;
    rect.bottom += scrollTop * modifier;
    rect.left += scrollLeft * modifier;
    rect.right += scrollLeft * modifier;
    return rect;
  }
Mark Otto's avatar
dist  
Mark Otto committed
1821

Mark Otto's avatar
dist    
Mark Otto committed
1822
1823
1824
1825
1826
1827
1828
1829
1830
  /*
   * Helper to detect borders of a given element
   * @method
   * @memberof Popper.Utils
   * @param {CSSStyleDeclaration} styles
   * Result of `getStyleComputedProperty` on the given element
   * @param {String} axis - `x` or `y`
   * @return {number} borders - The borders size of the given axis
   */
Mark Otto's avatar
dist  
Mark Otto committed
1831

Mark Otto's avatar
dist    
Mark Otto committed
1832
1833
1834
  function getBordersSize(styles, axis) {
    var sideA = axis === 'x' ? 'Left' : 'Top';
    var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
Mark Otto's avatar
dist  
Mark Otto committed
1835

Mark Otto's avatar
dist    
Mark Otto committed
1836
    return parseFloat(styles['border' + sideA + 'Width'], 10) + parseFloat(styles['border' + sideB + 'Width'], 10);
Mark Otto's avatar
dist  
Mark Otto committed
1837
1838
  }

Mark Otto's avatar
dist    
Mark Otto committed
1839
  function getSize(axis, body, html, computedStyle) {
Mark Otto's avatar
dist    
Mark Otto committed
1840
    return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
Mark Otto's avatar
dist  
Mark Otto committed
1841
1842
  }

Mark Otto's avatar
dist    
Mark Otto committed
1843
  function getWindowSizes(document) {
Mark Otto's avatar
dist    
Mark Otto committed
1844
1845
1846
    var body = document.body;
    var html = document.documentElement;
    var computedStyle = isIE(10) && getComputedStyle(html);
Mark Otto's avatar
dist  
Mark Otto committed
1847

Mark Otto's avatar
dist    
Mark Otto committed
1848
1849
1850
1851
    return {
      height: getSize('Height', body, html, computedStyle),
      width: getSize('Width', body, html, computedStyle)
    };
Mark Otto's avatar
dist  
Mark Otto committed
1852
1853
  }

Mark Otto's avatar
dist    
Mark Otto committed
1854
1855
1856
1857
  var classCallCheck = function (instance, Constructor) {
    if (!(instance instanceof Constructor)) {
      throw new TypeError("Cannot call a class as a function");
    }
Mark Otto's avatar
dist  
Mark Otto committed
1858
1859
  };

Mark Otto's avatar
dist    
Mark Otto committed
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
  var createClass = function () {
    function defineProperties(target, props) {
      for (var i = 0; i < props.length; i++) {
        var descriptor = props[i];
        descriptor.enumerable = descriptor.enumerable || false;
        descriptor.configurable = true;
        if ("value" in descriptor) descriptor.writable = true;
        Object.defineProperty(target, descriptor.key, descriptor);
      }
    }
Mark Otto's avatar
dist  
Mark Otto committed
1870

Mark Otto's avatar
dist    
Mark Otto committed
1871
1872
1873
1874
1875
1876
    return function (Constructor, protoProps, staticProps) {
      if (protoProps) defineProperties(Constructor.prototype, protoProps);
      if (staticProps) defineProperties(Constructor, staticProps);
      return Constructor;
    };
  }();
Mark Otto's avatar
dist  
Mark Otto committed
1877
1878
1879
1880
1881





Mark Otto's avatar
dist    
Mark Otto committed
1882
1883
1884
1885
1886
1887
1888
1889
  var defineProperty = function (obj, key, value) {
    if (key in obj) {
      Object.defineProperty(obj, key, {
        value: value,
        enumerable: true,
        configurable: true,
        writable: true
      });
Mark Otto's avatar
dist  
Mark Otto committed
1890
    } else {
Mark Otto's avatar
dist    
Mark Otto committed
1891
      obj[key] = value;
Mark Otto's avatar
dist  
Mark Otto committed
1892
1893
    }

Mark Otto's avatar
dist    
Mark Otto committed
1894
1895
    return obj;
  };
Mark Otto's avatar
dist  
Mark Otto committed
1896

Mark Otto's avatar
dist    
Mark Otto committed
1897
1898
1899
  var _extends = Object.assign || function (target) {
    for (var i = 1; i < arguments.length; i++) {
      var source = arguments[i];
Mark Otto's avatar
dist  
Mark Otto committed
1900

Mark Otto's avatar
dist    
Mark Otto committed
1901
1902
1903
1904
1905
1906
      for (var key in source) {
        if (Object.prototype.hasOwnProperty.call(source, key)) {
          target[key] = source[key];
        }
      }
    }
Mark Otto's avatar
dist  
Mark Otto committed
1907

Mark Otto's avatar
dist    
Mark Otto committed
1908
    return target;
Mark Otto's avatar
dist  
Mark Otto committed
1909
1910
  };

Mark Otto's avatar
dist    
Mark Otto committed
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
  /**
   * Given element offsets, generate an output similar to getBoundingClientRect
   * @method
   * @memberof Popper.Utils
   * @argument {Object} offsets
   * @returns {Object} ClientRect like output
   */
  function getClientRect(offsets) {
    return _extends({}, offsets, {
      right: offsets.left + offsets.width,
      bottom: offsets.top + offsets.height
    });
Mark Otto's avatar
dist  
Mark Otto committed
1923
1924
  }

Mark Otto's avatar
dist    
Mark Otto committed
1925
1926
1927
1928
1929
1930
1931
1932
1933
  /**
   * Get bounding client rect of given element
   * @method
   * @memberof Popper.Utils
   * @param {HTMLElement} element
   * @return {Object} client rect
   */
  function getBoundingClientRect(element) {
    var rect = {};
Mark Otto's avatar
dist  
Mark Otto committed
1934

Mark Otto's avatar
dist    
Mark Otto committed
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
    // IE10 10 FIX: Please, don't ask, the element isn't
    // considered in DOM in some circumstances...
    // This isn't reproducible in IE10 compatibility mode of IE11
    try {
      if (isIE(10)) {
        rect = element.getBoundingClientRect();
        var scrollTop = getScroll(element, 'top');
        var scrollLeft = getScroll(element, 'left');
        rect.top += scrollTop;
        rect.left += scrollLeft;
        rect.bottom += scrollTop;
        rect.right += scrollLeft;
      } else {
        rect = element.getBoundingClientRect();
      }
    } catch (e) {}

    var result = {
      left: rect.left,
      top: rect.top,
      width: rect.right - rect.left,
      height: rect.bottom - rect.top
    };
Mark Otto's avatar
dist  
Mark Otto committed
1958

Mark Otto's avatar
dist    
Mark Otto committed
1959
    // subtract scrollbar size from sizes
Mark Otto's avatar
dist    
Mark Otto committed
1960
    var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
Mark Otto's avatar
dist    
Mark Otto committed
1961
1962
    var width = sizes.width || element.clientWidth || result.right - result.left;
    var height = sizes.height || element.clientHeight || result.bottom - result.top;
Mark Otto's avatar
dist  
Mark Otto committed
1963

Mark Otto's avatar
dist    
Mark Otto committed
1964
1965
    var horizScrollbar = element.offsetWidth - width;
    var vertScrollbar = element.offsetHeight - height;
Mark Otto's avatar
dist  
Mark Otto committed
1966

Mark Otto's avatar
dist    
Mark Otto committed
1967
1968
1969
1970
1971
1972
1973
1974
1975
    // if an hypothetical scrollbar is detected, we must be sure it's not a `border`
    // we make this check conditional for performance reasons
    if (horizScrollbar || vertScrollbar) {
      var styles = getStyleComputedProperty(element);
      horizScrollbar -= getBordersSize(styles, 'x');
      vertScrollbar -= getBordersSize(styles, 'y');

      result.width -= horizScrollbar;
      result.height -= vertScrollbar;
Mark Otto's avatar
dist  
Mark Otto committed
1976
    }
Mark Otto's avatar
dist    
Mark Otto committed
1977
1978

    return getClientRect(result);
Mark Otto's avatar
dist  
Mark Otto committed
1979
1980
  }

Mark Otto's avatar
dist    
Mark Otto committed
1981
1982
  function getOffsetRectRelativeToArbitraryNode(children, parent) {
    var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
Mark Otto's avatar
dist  
Mark Otto committed
1983

Mark Otto's avatar
dist    
Mark Otto committed
1984
1985
1986
1987
1988
    var isIE10 = isIE(10);
    var isHTML = parent.nodeName === 'HTML';
    var childrenRect = getBoundingClientRect(children);
    var parentRect = getBoundingClientRect(parent);
    var scrollParent = getScrollParent(children);
Mark Otto's avatar
dist  
Mark Otto committed
1989

Mark Otto's avatar
dist    
Mark Otto committed
1990
1991
1992
    var styles = getStyleComputedProperty(parent);
    var borderTopWidth = parseFloat(styles.borderTopWidth, 10);
    var borderLeftWidth = parseFloat(styles.borderLeftWidth, 10);
Mark Otto's avatar
dist  
Mark Otto committed
1993

Mark Otto's avatar
dist    
Mark Otto committed
1994
    // In cases where the parent is fixed, we must ignore negative scroll in offset calc
Mark Otto's avatar
dist    
Mark Otto committed
1995
    if (fixedPosition && isHTML) {
Mark Otto's avatar
dist    
Mark Otto committed
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
      parentRect.top = Math.max(parentRect.top, 0);
      parentRect.left = Math.max(parentRect.left, 0);
    }
    var offsets = getClientRect({
      top: childrenRect.top - parentRect.top - borderTopWidth,
      left: childrenRect.left - parentRect.left - borderLeftWidth,
      width: childrenRect.width,
      height: childrenRect.height
    });
    offsets.marginTop = 0;
    offsets.marginLeft = 0;

    // Subtract margins of documentElement in case it's being used as parent
    // we do this only on HTML because it's the only element that behaves
    // differently when margins are applied to it. The margins are included in
    // the box of the documentElement, in the other cases not.
    if (!isIE10 && isHTML) {
      var marginTop = parseFloat(styles.marginTop, 10);
      var marginLeft = parseFloat(styles.marginLeft, 10);

      offsets.top -= borderTopWidth - marginTop;
      offsets.bottom -= borderTopWidth - marginTop;
      offsets.left -= borderLeftWidth - marginLeft;
      offsets.right -= borderLeftWidth - marginLeft;

      // Attach marginTop and marginLeft because in some circumstances we may need them
      offsets.marginTop = marginTop;
      offsets.marginLeft = marginLeft;
    }
Mark Otto's avatar
dist  
Mark Otto committed
2025

Mark Otto's avatar
dist    
Mark Otto committed
2026
2027
2028
    if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
      offsets = includeScroll(offsets, parent);
    }
Mark Otto's avatar
dist  
Mark Otto committed
2029

Mark Otto's avatar
dist    
Mark Otto committed
2030
    return offsets;
Mark Otto's avatar
dist  
Mark Otto committed
2031
2032
  }

Mark Otto's avatar
dist    
Mark Otto committed
2033
2034
  function getViewportOffsetRectRelativeToArtbitraryNode(element) {
    var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
Mark Otto's avatar
dist  
Mark Otto committed
2035

Mark Otto's avatar
dist    
Mark Otto committed
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
    var html = element.ownerDocument.documentElement;
    var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
    var width = Math.max(html.clientWidth, window.innerWidth || 0);
    var height = Math.max(html.clientHeight, window.innerHeight || 0);

    var scrollTop = !excludeScroll ? getScroll(html) : 0;
    var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0;

    var offset = {
      top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
      left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
      width: width,
      height: height
    };
Mark Otto's avatar
dist  
Mark Otto committed
2050

Mark Otto's avatar
dist    
Mark Otto committed
2051
    return getClientRect(offset);
Mark Otto's avatar
dist  
Mark Otto committed
2052
2053
  }

Mark Otto's avatar
dist    
Mark Otto committed
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
  /**
   * Check if the given element is fixed or is inside a fixed parent
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @argument {Element} customContainer
   * @returns {Boolean} answer to "isFixed?"
   */
  function isFixed(element) {
    var nodeName = element.nodeName;
    if (nodeName === 'BODY' || nodeName === 'HTML') {
      return false;
Mark Otto's avatar
dist  
Mark Otto committed
2066
    }
Mark Otto's avatar
dist    
Mark Otto committed
2067
2068
2069
2070
2071
    if (getStyleComputedProperty(element, 'position') === 'fixed') {
      return true;
    }
    return isFixed(getParentNode(element));
  }
Mark Otto's avatar
dist  
Mark Otto committed
2072

Mark Otto's avatar
dist    
Mark Otto committed
2073
2074
2075
2076
2077
2078
2079
  /**
   * Finds the first parent of an element that has a transformed property defined
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Element} first transformed parent or documentElement
   */
Mark Otto's avatar
dist  
Mark Otto committed
2080

Mark Otto's avatar
dist    
Mark Otto committed
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
  function getFixedPositionOffsetParent(element) {
    // This check is needed to avoid errors in case one of the elements isn't defined for any reason
    if (!element || !element.parentElement || isIE()) {
      return document.documentElement;
    }
    var el = element.parentElement;
    while (el && getStyleComputedProperty(el, 'transform') === 'none') {
      el = el.parentElement;
    }
    return el || document.documentElement;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2092

Mark Otto's avatar
dist    
Mark Otto committed
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
  /**
   * Computed the boundaries limits and return them
   * @method
   * @memberof Popper.Utils
   * @param {HTMLElement} popper
   * @param {HTMLElement} reference
   * @param {number} padding
   * @param {HTMLElement} boundariesElement - Element used to define the boundaries
   * @param {Boolean} fixedPosition - Is in fixed position mode
   * @returns {Object} Coordinates of the boundaries
   */
  function getBoundaries(popper, reference, padding, boundariesElement) {
    var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
Mark Otto's avatar
dist  
Mark Otto committed
2106

Mark Otto's avatar
dist    
Mark Otto committed
2107
    // NOTE: 1 DOM access here
Mark Otto's avatar
dist  
Mark Otto committed
2108

Mark Otto's avatar
dist    
Mark Otto committed
2109
2110
    var boundaries = { top: 0, left: 0 };
    var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
Mark Otto's avatar
dist  
Mark Otto committed
2111

Mark Otto's avatar
dist    
Mark Otto committed
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
    // Handle viewport case
    if (boundariesElement === 'viewport') {
      boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
    } else {
      // Handle other cases based on DOM element used as boundaries
      var boundariesNode = void 0;
      if (boundariesElement === 'scrollParent') {
        boundariesNode = getScrollParent(getParentNode(reference));
        if (boundariesNode.nodeName === 'BODY') {
          boundariesNode = popper.ownerDocument.documentElement;
        }
      } else if (boundariesElement === 'window') {
        boundariesNode = popper.ownerDocument.documentElement;
      } else {
        boundariesNode = boundariesElement;
      }
Mark Otto's avatar
dist  
Mark Otto committed
2128

Mark Otto's avatar
dist    
Mark Otto committed
2129
      var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
Mark Otto's avatar
dist  
Mark Otto committed
2130

Mark Otto's avatar
dist    
Mark Otto committed
2131
2132
      // In case of HTML, we need a different computation
      if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
Mark Otto's avatar
dist    
Mark Otto committed
2133
        var _getWindowSizes = getWindowSizes(popper.ownerDocument),
Mark Otto's avatar
dist    
Mark Otto committed
2134
2135
            height = _getWindowSizes.height,
            width = _getWindowSizes.width;
Mark Otto's avatar
dist  
Mark Otto committed
2136

Mark Otto's avatar
dist    
Mark Otto committed
2137
2138
2139
2140
2141
2142
2143
        boundaries.top += offsets.top - offsets.marginTop;
        boundaries.bottom = height + offsets.top;
        boundaries.left += offsets.left - offsets.marginLeft;
        boundaries.right = width + offsets.left;
      } else {
        // for all the other DOM elements, this one is good
        boundaries = offsets;
Mark Otto's avatar
dist  
Mark Otto committed
2144
      }
Mark Otto's avatar
dist    
Mark Otto committed
2145
    }
Mark Otto's avatar
dist  
Mark Otto committed
2146

Mark Otto's avatar
dist    
Mark Otto committed
2147
    // Add paddings
Mark Otto's avatar
dist    
Mark Otto committed
2148
2149
2150
2151
2152
2153
    padding = padding || 0;
    var isPaddingNumber = typeof padding === 'number';
    boundaries.left += isPaddingNumber ? padding : padding.left || 0;
    boundaries.top += isPaddingNumber ? padding : padding.top || 0;
    boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
    boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
Mark Otto's avatar
dist  
Mark Otto committed
2154

Mark Otto's avatar
dist    
Mark Otto committed
2155
    return boundaries;
Mark Otto's avatar
dist  
Mark Otto committed
2156
2157
  }

Mark Otto's avatar
dist    
Mark Otto committed
2158
2159
2160
2161
2162
  function getArea(_ref) {
    var width = _ref.width,
        height = _ref.height;

    return width * height;
Mark Otto's avatar
dist  
Mark Otto committed
2163
2164
  }

Mark Otto's avatar
dist    
Mark Otto committed
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
  /**
   * Utility used to transform the `auto` placement to the placement with more
   * available space.
   * @method
   * @memberof Popper.Utils
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
    var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
Mark Otto's avatar
dist  
Mark Otto committed
2176

Mark Otto's avatar
dist    
Mark Otto committed
2177
2178
    if (placement.indexOf('auto') === -1) {
      return placement;
Mark Otto's avatar
dist  
Mark Otto committed
2179
2180
    }

Mark Otto's avatar
dist    
Mark Otto committed
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
    var boundaries = getBoundaries(popper, reference, padding, boundariesElement);

    var rects = {
      top: {
        width: boundaries.width,
        height: refRect.top - boundaries.top
      },
      right: {
        width: boundaries.right - refRect.right,
        height: boundaries.height
      },
      bottom: {
        width: boundaries.width,
        height: boundaries.bottom - refRect.bottom
      },
      left: {
        width: refRect.left - boundaries.left,
        height: boundaries.height
Mark Otto's avatar
dist  
Mark Otto committed
2199
      }
Mark Otto's avatar
dist    
Mark Otto committed
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
    };

    var sortedAreas = Object.keys(rects).map(function (key) {
      return _extends({
        key: key
      }, rects[key], {
        area: getArea(rects[key])
      });
    }).sort(function (a, b) {
      return b.area - a.area;
Mark Otto's avatar
dist  
Mark Otto committed
2210
2211
    });

Mark Otto's avatar
dist    
Mark Otto committed
2212
2213
2214
2215
    var filteredAreas = sortedAreas.filter(function (_ref2) {
      var width = _ref2.width,
          height = _ref2.height;
      return width >= popper.clientWidth && height >= popper.clientHeight;
Mark Otto's avatar
dist  
Mark Otto committed
2216
2217
    });

Mark Otto's avatar
dist    
Mark Otto committed
2218
2219
2220
    var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;

    var variation = placement.split('-')[1];
Mark Otto's avatar
dist  
Mark Otto committed
2221

Mark Otto's avatar
dist    
Mark Otto committed
2222
    return computedPlacement + (variation ? '-' + variation : '');
Mark Otto's avatar
dist  
Mark Otto committed
2223
2224
  }

Mark Otto's avatar
dist    
Mark Otto committed
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
  /**
   * Get offsets to the reference element
   * @method
   * @memberof Popper.Utils
   * @param {Object} state
   * @param {Element} popper - the popper element
   * @param {Element} reference - the reference element (the popper will be relative to this)
   * @param {Element} fixedPosition - is in fixed position mode
   * @returns {Object} An object containing the offsets which will be applied to the popper
   */
  function getReferenceOffsets(state, popper, reference) {
    var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
Mark Otto's avatar
dist  
Mark Otto committed
2237

Mark Otto's avatar
dist    
Mark Otto committed
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
    var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, reference);
    return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
  }

  /**
   * Get the outer sizes of the given element (offset size + margins)
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element
   * @returns {Object} object containing width and height properties
   */
  function getOuterSizes(element) {
    var styles = getComputedStyle(element);
    var x = parseFloat(styles.marginTop) + parseFloat(styles.marginBottom);
    var y = parseFloat(styles.marginLeft) + parseFloat(styles.marginRight);
    var result = {
      width: element.offsetWidth + y,
      height: element.offsetHeight + x
    };
    return result;
  }

  /**
   * Get the opposite placement of the given one
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement
   * @returns {String} flipped placement
   */
  function getOppositePlacement(placement) {
    var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
    return placement.replace(/left|right|bottom|top/g, function (matched) {
      return hash[matched];
    });
  }

  /**
   * Get offsets to the popper
   * @method
   * @memberof Popper.Utils
   * @param {Object} position - CSS position the Popper will get applied
   * @param {HTMLElement} popper - the popper element
   * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
   * @param {String} placement - one of the valid placement options
   * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
   */
  function getPopperOffsets(popper, referenceOffsets, placement) {
    placement = placement.split('-')[0];

    // Get popper node sizes
    var popperRect = getOuterSizes(popper);
Mark Otto's avatar
dist  
Mark Otto committed
2289

Mark Otto's avatar
dist    
Mark Otto committed
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
    // Add position, width and height to our offsets object
    var popperOffsets = {
      width: popperRect.width,
      height: popperRect.height
    };

    // depending by the popper placement we have to compute its offsets slightly differently
    var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
    var mainSide = isHoriz ? 'top' : 'left';
    var secondarySide = isHoriz ? 'left' : 'top';
    var measurement = isHoriz ? 'height' : 'width';
    var secondaryMeasurement = !isHoriz ? 'height' : 'width';

    popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
    if (placement === secondarySide) {
      popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
    } else {
      popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)];
    }

    return popperOffsets;
  }

  /**
   * Mimics the `find` method of Array
   * @method
   * @memberof Popper.Utils
   * @argument {Array} arr
   * @argument prop
   * @argument value
   * @returns index or -1
   */
  function find(arr, check) {
    // use native find if supported
    if (Array.prototype.find) {
      return arr.find(check);
    }

    // use `filter` to obtain the same behavior of `find`
    return arr.filter(check)[0];
  }

  /**
   * Return the index of the matching object
   * @method
   * @memberof Popper.Utils
   * @argument {Array} arr
   * @argument prop
   * @argument value
   * @returns index or -1
   */
  function findIndex(arr, prop, value) {
    // use native findIndex if supported
    if (Array.prototype.findIndex) {
      return arr.findIndex(function (cur) {
        return cur[prop] === value;
      });
    }

    // use `find` + `indexOf` if `findIndex` isn't supported
    var match = find(arr, function (obj) {
      return obj[prop] === value;
    });
    return arr.indexOf(match);
  }

  /**
   * Loop trough the list of modifiers and run them in order,
   * each of them will then edit the data object.
   * @method
   * @memberof Popper.Utils
   * @param {dataObject} data
   * @param {Array} modifiers
   * @param {String} ends - Optional modifier name used as stopper
   * @returns {dataObject}
   */
  function runModifiers(modifiers, data, ends) {
    var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends));

    modifiersToRun.forEach(function (modifier) {
      if (modifier['function']) {
        // eslint-disable-line dot-notation
        console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
Mark Otto's avatar
dist  
Mark Otto committed
2373
      }
Mark Otto's avatar
dist    
Mark Otto committed
2374
2375
2376
2377
2378
2379
2380
2381
2382
      var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
      if (modifier.enabled && isFunction(fn)) {
        // Add properties to offsets to make them a complete clientRect object
        // we do this before each modifier to make sure the previous one doesn't
        // mess with these values
        data.offsets.popper = getClientRect(data.offsets.popper);
        data.offsets.reference = getClientRect(data.offsets.reference);

        data = fn(data, modifier);
Mark Otto's avatar
dist  
Mark Otto committed
2383
      }
Mark Otto's avatar
dist    
Mark Otto committed
2384
    });
Mark Otto's avatar
dist  
Mark Otto committed
2385

Mark Otto's avatar
dist    
Mark Otto committed
2386
2387
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2388

Mark Otto's avatar
dist    
Mark Otto committed
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
  /**
   * Updates the position of the popper, computing the new offsets and applying
   * the new style.<br />
   * Prefer `scheduleUpdate` over `update` because of performance reasons.
   * @method
   * @memberof Popper
   */
  function update() {
    // if popper is destroyed, don't perform any further update
    if (this.state.isDestroyed) {
      return;
    }
Mark Otto's avatar
dist  
Mark Otto committed
2401

Mark Otto's avatar
dist    
Mark Otto committed
2402
2403
2404
2405
2406
2407
2408
    var data = {
      instance: this,
      styles: {},
      arrowStyles: {},
      attributes: {},
      flipped: false,
      offsets: {}
Mark Otto's avatar
dist  
Mark Otto committed
2409
2410
    };

Mark Otto's avatar
dist    
Mark Otto committed
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
    // compute reference element offsets
    data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);

    // compute auto placement, store placement inside the data object,
    // modifiers will be able to edit `placement` if needed
    // and refer to originalPlacement to know the original value
    data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);

    // store the computed placement inside `originalPlacement`
    data.originalPlacement = data.placement;

    data.positionFixed = this.options.positionFixed;

    // compute the popper offsets
    data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
Mark Otto's avatar
dist    
Mark Otto committed
2426

Mark Otto's avatar
dist    
Mark Otto committed
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
    data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';

    // run the modifiers
    data = runModifiers(this.modifiers, data);

    // the first `update` will call `onCreate` callback
    // the other ones will call `onUpdate` callback
    if (!this.state.isCreated) {
      this.state.isCreated = true;
      this.options.onCreate(data);
    } else {
      this.options.onUpdate(data);
    }
  }

  /**
   * Helper used to know if the given modifier is enabled.
   * @method
   * @memberof Popper.Utils
   * @returns {Boolean}
   */
  function isModifierEnabled(modifiers, modifierName) {
    return modifiers.some(function (_ref) {
      var name = _ref.name,
          enabled = _ref.enabled;
      return enabled && name === modifierName;
    });
  }

  /**
   * Get the prefixed supported property name
   * @method
   * @memberof Popper.Utils
   * @argument {String} property (camelCase)
   * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
   */
  function getSupportedPropertyName(property) {
    var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
    var upperProp = property.charAt(0).toUpperCase() + property.slice(1);

    for (var i = 0; i < prefixes.length; i++) {
      var prefix = prefixes[i];
      var toCheck = prefix ? '' + prefix + upperProp : property;
      if (typeof document.body.style[toCheck] !== 'undefined') {
        return toCheck;
      }
    }
    return null;
  }

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2478
   * Destroys the popper.
Mark Otto's avatar
dist    
Mark Otto committed
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
   * @method
   * @memberof Popper
   */
  function destroy() {
    this.state.isDestroyed = true;

    // touch DOM only if `applyStyle` modifier is enabled
    if (isModifierEnabled(this.modifiers, 'applyStyle')) {
      this.popper.removeAttribute('x-placement');
      this.popper.style.position = '';
      this.popper.style.top = '';
      this.popper.style.left = '';
      this.popper.style.right = '';
      this.popper.style.bottom = '';
      this.popper.style.willChange = '';
      this.popper.style[getSupportedPropertyName('transform')] = '';
    }

    this.disableEventListeners();

    // remove the popper if user explicity asked for the deletion on destroy
    // do not use `remove` because IE11 doesn't support it
    if (this.options.removeOnDestroy) {
      this.popper.parentNode.removeChild(this.popper);
    }
    return this;
  }

  /**
   * Get the window associated with the element
   * @argument {Element} element
   * @returns {Window}
   */
  function getWindow(element) {
    var ownerDocument = element.ownerDocument;
    return ownerDocument ? ownerDocument.defaultView : window;
  }

  function attachToScrollParents(scrollParent, event, callback, scrollParents) {
    var isBody = scrollParent.nodeName === 'BODY';
    var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
    target.addEventListener(event, callback, { passive: true });

    if (!isBody) {
      attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents);
    }
    scrollParents.push(target);
  }

  /**
   * Setup needed event listeners used to update the popper position
   * @method
   * @memberof Popper.Utils
   * @private
   */
  function setupEventListeners(reference, options, state, updateBound) {
    // Resize event listener on window
    state.updateBound = updateBound;
    getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });

    // Scroll event listener on scroll parents
    var scrollElement = getScrollParent(reference);
    attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
    state.scrollElement = scrollElement;
    state.eventsEnabled = true;

    return state;
  }

  /**
   * It will add resize/scroll events and start recalculating
   * position of the popper element when they are triggered.
   * @method
   * @memberof Popper
   */
  function enableEventListeners() {
    if (!this.state.eventsEnabled) {
      this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
    }
  }

  /**
   * Remove event listeners used to update the popper position
   * @method
   * @memberof Popper.Utils
   * @private
   */
  function removeEventListeners(reference, state) {
    // Remove resize event listener on window
    getWindow(reference).removeEventListener('resize', state.updateBound);

    // Remove scroll event listener on scroll parents
    state.scrollParents.forEach(function (target) {
      target.removeEventListener('scroll', state.updateBound);
    });

    // Reset state
    state.updateBound = null;
    state.scrollParents = [];
    state.scrollElement = null;
    state.eventsEnabled = false;
    return state;
  }

  /**
   * It will remove resize/scroll events and won't recalculate popper position
Mark Otto's avatar
dist    
Mark Otto committed
2585
   * when they are triggered. It also won't trigger `onUpdate` callback anymore,
Mark Otto's avatar
dist    
Mark Otto committed
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
   * unless you call `update` method manually.
   * @method
   * @memberof Popper
   */
  function disableEventListeners() {
    if (this.state.eventsEnabled) {
      cancelAnimationFrame(this.scheduleUpdate);
      this.state = removeEventListeners(this.reference, this.state);
    }
  }

  /**
   * Tells if a given input is a number
   * @method
   * @memberof Popper.Utils
   * @param {*} input to check
   * @return {Boolean}
   */
  function isNumeric(n) {
    return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
  }

  /**
   * Set the style to the given popper
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element - Element to apply the style to
   * @argument {Object} styles
   * Object with a list of properties and values which will be applied to the element
   */
  function setStyles(element, styles) {
    Object.keys(styles).forEach(function (prop) {
      var unit = '';
      // add unit if the value is numeric and is one of the following
      if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
        unit = 'px';
      }
      element.style[prop] = styles[prop] + unit;
    });
Mark Otto's avatar
dist  
Mark Otto committed
2625
2626
  }

Mark Otto's avatar
dist    
Mark Otto committed
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
  /**
   * Set the attributes to the given popper
   * @method
   * @memberof Popper.Utils
   * @argument {Element} element - Element to apply the attributes to
   * @argument {Object} styles
   * Object with a list of properties and values which will be applied to the element
   */
  function setAttributes(element, attributes) {
    Object.keys(attributes).forEach(function (prop) {
      var value = attributes[prop];
      if (value !== false) {
        element.setAttribute(prop, attributes[prop]);
      } else {
        element.removeAttribute(prop);
      }
    });
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} data.styles - List of style properties - values to apply to popper element
   * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The same data object
   */
  function applyStyle(data) {
    // any property present in `data.styles` will be applied to the popper,
    // in this way we can make the 3rd party modifiers add custom styles to it
    // Be aware, modifiers could override the properties defined in the previous
    // lines of this modifier!
    setStyles(data.instance.popper, data.styles);

    // any property present in `data.attributes` will be applied to the popper,
    // they will be set as HTML attributes of the element
    setAttributes(data.instance.popper, data.attributes);

    // if arrowElement is defined and arrowStyles has some properties
    if (data.arrowElement && Object.keys(data.arrowStyles).length) {
      setStyles(data.arrowElement, data.arrowStyles);
    }

Mark Otto's avatar
dist  
Mark Otto committed
2671
2672
2673
    return data;
  }

Mark Otto's avatar
dist    
Mark Otto committed
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
  /**
   * Set the x-placement attribute before everything else because it could be used
   * to add margins to the popper margins needs to be calculated to get the
   * correct popper offsets.
   * @method
   * @memberof Popper.modifiers
   * @param {HTMLElement} reference - The reference element used to position the popper
   * @param {HTMLElement} popper - The HTML element used as popper
   * @param {Object} options - Popper.js options
   */
  function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
    // compute reference element offsets
    var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);

    // compute auto placement, store placement inside the data object,
    // modifiers will be able to edit `placement` if needed
    // and refer to originalPlacement to know the original value
    var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
Mark Otto's avatar
dist  
Mark Otto committed
2692

Mark Otto's avatar
dist    
Mark Otto committed
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
    popper.setAttribute('x-placement', placement);

    // Apply `position` to popper before anything else because
    // without the position applied we can't guarantee correct computations
    setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });

    return options;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function computeStyle(data, options) {
    var x = options.x,
        y = options.y;
    var popper = data.offsets.popper;

    // Remove this legacy support in Popper.js v2

    var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) {
      return modifier.name === 'applyStyle';
    }).gpuAcceleration;
    if (legacyGpuAccelerationOption !== undefined) {
      console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
Mark Otto's avatar
dist  
Mark Otto committed
2721
    }
Mark Otto's avatar
dist    
Mark Otto committed
2722
2723
2724
2725
2726
2727
2728
2729
2730
    var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;

    var offsetParent = getOffsetParent(data.instance.popper);
    var offsetParentRect = getBoundingClientRect(offsetParent);

    // Styles
    var styles = {
      position: popper.position
    };
Mark Otto's avatar
dist  
Mark Otto committed
2731

Mark Otto's avatar
dist    
Mark Otto committed
2732
2733
2734
    // Avoid blurry text by using full pixel integers.
    // For pixel-perfect positioning, top/bottom prefers rounded
    // values, while left/right prefers floored values.
Mark Otto's avatar
dist    
Mark Otto committed
2735
2736
    var offsets = {
      left: Math.floor(popper.left),
Mark Otto's avatar
dist    
Mark Otto committed
2737
2738
      top: Math.round(popper.top),
      bottom: Math.round(popper.bottom),
Mark Otto's avatar
dist    
Mark Otto committed
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
      right: Math.floor(popper.right)
    };

    var sideA = x === 'bottom' ? 'top' : 'bottom';
    var sideB = y === 'right' ? 'left' : 'right';

    // if gpuAcceleration is set to `true` and transform is supported,
    //  we use `translate3d` to apply the position to the popper we
    // automatically use the supported prefixed version if needed
    var prefixedProperty = getSupportedPropertyName('transform');

    // now, let's make a step back and look at this code closely (wtf?)
    // If the content of the popper grows once it's been positioned, it
    // may happen that the popper gets misplaced because of the new content
    // overflowing its reference element
    // To avoid this problem, we provide two options (x and y), which allow
    // the consumer to define the offset origin.
    // If we position a popper on top of a reference element, we can set
    // `x` to `top` to make the popper grow towards its top instead of
    // its bottom.
    var left = void 0,
        top = void 0;
    if (sideA === 'bottom') {
Mark Otto's avatar
dist    
Mark Otto committed
2762
2763
2764
2765
2766
2767
2768
      // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
      // and not the bottom of the html element
      if (offsetParent.nodeName === 'HTML') {
        top = -offsetParent.clientHeight + offsets.bottom;
      } else {
        top = -offsetParentRect.height + offsets.bottom;
      }
Mark Otto's avatar
dist    
Mark Otto committed
2769
2770
2771
2772
    } else {
      top = offsets.top;
    }
    if (sideB === 'right') {
Mark Otto's avatar
dist    
Mark Otto committed
2773
2774
2775
2776
2777
      if (offsetParent.nodeName === 'HTML') {
        left = -offsetParent.clientWidth + offsets.right;
      } else {
        left = -offsetParentRect.width + offsets.right;
      }
Mark Otto's avatar
dist    
Mark Otto committed
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
    } else {
      left = offsets.left;
    }
    if (gpuAcceleration && prefixedProperty) {
      styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
      styles[sideA] = 0;
      styles[sideB] = 0;
      styles.willChange = 'transform';
    } else {
      // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
      var invertTop = sideA === 'bottom' ? -1 : 1;
      var invertLeft = sideB === 'right' ? -1 : 1;
      styles[sideA] = top * invertTop;
      styles[sideB] = left * invertLeft;
      styles.willChange = sideA + ', ' + sideB;
    }

    // Attributes
    var attributes = {
      'x-placement': data.placement
    };

    // Update `data` attributes, styles and arrowStyles
    data.attributes = _extends({}, attributes, data.attributes);
    data.styles = _extends({}, styles, data.styles);
    data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles);

    return data;
  }

  /**
   * Helper used to know if the given modifier depends from another one.<br />
   * It checks if the needed modifier is listed and enabled.
   * @method
   * @memberof Popper.Utils
   * @param {Array} modifiers - list of modifiers
   * @param {String} requestingName - name of requesting modifier
   * @param {String} requestedName - name of requested modifier
   * @returns {Boolean}
   */
  function isModifierRequired(modifiers, requestingName, requestedName) {
    var requesting = find(modifiers, function (_ref) {
      var name = _ref.name;
      return name === requestingName;
    });

    var isRequired = !!requesting && modifiers.some(function (modifier) {
      return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
    });

    if (!isRequired) {
      var _requesting = '`' + requestingName + '`';
      var requested = '`' + requestedName + '`';
      console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
    }
    return isRequired;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function arrow(data, options) {
    var _data$offsets$arrow;

    // arrow depends on keepTogether in order to work
    if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
Mark Otto's avatar
dist  
Mark Otto committed
2848
2849
2850
      return data;
    }

Mark Otto's avatar
dist    
Mark Otto committed
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
    var arrowElement = options.element;

    // if arrowElement is a string, suppose it's a CSS selector
    if (typeof arrowElement === 'string') {
      arrowElement = data.instance.popper.querySelector(arrowElement);

      // if arrowElement is not found, don't run the modifier
      if (!arrowElement) {
        return data;
      }
    } else {
      // if the arrowElement isn't a query selector we must check that the
      // provided DOM node is child of its popper node
      if (!data.instance.popper.contains(arrowElement)) {
        console.warn('WARNING: `arrow.element` must be child of its popper element!');
        return data;
      }
    }

    var placement = data.placement.split('-')[0];
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var isVertical = ['left', 'right'].indexOf(placement) !== -1;

    var len = isVertical ? 'height' : 'width';
    var sideCapitalized = isVertical ? 'Top' : 'Left';
    var side = sideCapitalized.toLowerCase();
    var altSide = isVertical ? 'left' : 'top';
    var opSide = isVertical ? 'bottom' : 'right';
    var arrowElementSize = getOuterSizes(arrowElement)[len];

    //
    // extends keepTogether behavior making sure the popper and its
Mark Otto's avatar
dist    
Mark Otto committed
2886
    // reference have enough pixels in conjunction
Mark Otto's avatar
dist    
Mark Otto committed
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
    //

    // top/left side
    if (reference[opSide] - arrowElementSize < popper[side]) {
      data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
    }
    // bottom/right side
    if (reference[side] + arrowElementSize > popper[opSide]) {
      data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
    }
    data.offsets.popper = getClientRect(data.offsets.popper);

    // compute center of the popper
    var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;

    // Compute the sideValue using the updated popper offsets
    // take popper margin in account because we don't have this info available
    var css = getStyleComputedProperty(data.instance.popper);
    var popperMarginSide = parseFloat(css['margin' + sideCapitalized], 10);
    var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width'], 10);
    var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;

    // prevent arrowElement from being placed not contiguously to its popper
    sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);

    data.arrowElement = arrowElement;
    data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);

    return data;
Mark Otto's avatar
dist  
Mark Otto committed
2916
2917
2918
  }

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2919
2920
2921
2922
2923
   * Get the opposite placement variation of the given one
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement variation
   * @returns {String} flipped placement variation
Mark Otto's avatar
dist  
Mark Otto committed
2924
   */
Mark Otto's avatar
dist    
Mark Otto committed
2925
2926
2927
2928
2929
2930
2931
2932
  function getOppositeVariation(variation) {
    if (variation === 'end') {
      return 'start';
    } else if (variation === 'start') {
      return 'end';
    }
    return variation;
  }
Mark Otto's avatar
dist  
Mark Otto committed
2933
2934

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2935
2936
2937
2938
2939
2940
2941
   * List of accepted placements to use as values of the `placement` option.<br />
   * Valid placements are:
   * - `auto`
   * - `top`
   * - `right`
   * - `bottom`
   * - `left`
Mark Otto's avatar
dist  
Mark Otto committed
2942
   *
Mark Otto's avatar
dist    
Mark Otto committed
2943
2944
2945
   * Each placement can have a variation from this list:
   * - `-start`
   * - `-end`
Mark Otto's avatar
dist  
Mark Otto committed
2946
   *
Mark Otto's avatar
dist    
Mark Otto committed
2947
2948
2949
2950
   * Variations are interpreted easily if you think of them as the left to right
   * written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
   * is right.<br />
   * Vertically (`left` and `right`), `start` is top and `end` is bottom.
Mark Otto's avatar
dist  
Mark Otto committed
2951
   *
Mark Otto's avatar
dist    
Mark Otto committed
2952
2953
2954
2955
   * Some valid examples are:
   * - `top-end` (on top of reference, right aligned)
   * - `right-start` (on right of reference, top aligned)
   * - `bottom` (on bottom, centered)
Mark Otto's avatar
dist    
Mark Otto committed
2956
   * - `auto-end` (on the side with more space available, alignment depends by placement)
Mark Otto's avatar
dist  
Mark Otto committed
2957
   *
Mark Otto's avatar
dist    
Mark Otto committed
2958
2959
2960
2961
2962
2963
   * @static
   * @type {Array}
   * @enum {String}
   * @readonly
   * @method placements
   * @memberof Popper
Mark Otto's avatar
dist  
Mark Otto committed
2964
   */
Mark Otto's avatar
dist    
Mark Otto committed
2965
2966
2967
2968
  var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];

  // Get rid of `auto` `auto-start` and `auto-end`
  var validPlacements = placements.slice(3);
Mark Otto's avatar
dist  
Mark Otto committed
2969
2970

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2971
2972
   * Given an initial placement, returns all the subsequent placements
   * clockwise (or counter-clockwise).
Mark Otto's avatar
dist  
Mark Otto committed
2973
   *
Mark Otto's avatar
dist    
Mark Otto committed
2974
2975
2976
2977
2978
   * @method
   * @memberof Popper.Utils
   * @argument {String} placement - A valid placement (it accepts variations)
   * @argument {Boolean} counter - Set to true to walk the placements counterclockwise
   * @returns {Array} placements including their variations
Mark Otto's avatar
dist  
Mark Otto committed
2979
   */
Mark Otto's avatar
dist    
Mark Otto committed
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
  function clockwise(placement) {
    var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    var index = validPlacements.indexOf(placement);
    var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
    return counter ? arr.reverse() : arr;
  }

  var BEHAVIORS = {
    FLIP: 'flip',
    CLOCKWISE: 'clockwise',
    COUNTERCLOCKWISE: 'counterclockwise'
  };
Mark Otto's avatar
dist  
Mark Otto committed
2993
2994

  /**
Mark Otto's avatar
dist    
Mark Otto committed
2995
2996
2997
2998
2999
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
3000
   */
Mark Otto's avatar
dist    
Mark Otto committed
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
  function flip(data, options) {
    // if `inner` modifier is enabled, we can't use the `flip` modifier
    if (isModifierEnabled(data.instance.modifiers, 'inner')) {
      return data;
    }

    if (data.flipped && data.placement === data.originalPlacement) {
      // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
      return data;
    }

    var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);

    var placement = data.placement.split('-')[0];
    var placementOpposite = getOppositePlacement(placement);
    var variation = data.placement.split('-')[1] || '';

    var flipOrder = [];

    switch (options.behavior) {
      case BEHAVIORS.FLIP:
        flipOrder = [placement, placementOpposite];
        break;
      case BEHAVIORS.CLOCKWISE:
        flipOrder = clockwise(placement);
        break;
      case BEHAVIORS.COUNTERCLOCKWISE:
        flipOrder = clockwise(placement, true);
        break;
      default:
        flipOrder = options.behavior;
    }

    flipOrder.forEach(function (step, index) {
      if (placement !== step || flipOrder.length === index + 1) {
        return data;
      }

      placement = data.placement.split('-')[0];
      placementOpposite = getOppositePlacement(placement);

      var popperOffsets = data.offsets.popper;
      var refOffsets = data.offsets.reference;

      // using floor because the reference offsets may contain decimals we are not going to consider here
      var floor = Math.floor;
      var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);

      var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
      var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
      var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
      var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);

      var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;

      // flip the variation if required
      var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
      var flippedVariation = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);

      if (overlapsRef || overflowsBoundaries || flippedVariation) {
        // this boolean to detect any flip loop
        data.flipped = true;

        if (overlapsRef || overflowsBoundaries) {
          placement = flipOrder[index + 1];
        }

        if (flippedVariation) {
          variation = getOppositeVariation(variation);
        }

        data.placement = placement + (variation ? '-' + variation : '');

        // this object contains `position`, we want to preserve it along with
        // any additional property we may add in the future
        data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));

        data = runModifiers(data.instance.modifiers, data, 'flip');
      }
    });
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3083
3084

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3085
3086
3087
3088
3089
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
3090
   */
Mark Otto's avatar
dist    
Mark Otto committed
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
  function keepTogether(data) {
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var placement = data.placement.split('-')[0];
    var floor = Math.floor;
    var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
    var side = isVertical ? 'right' : 'bottom';
    var opSide = isVertical ? 'left' : 'top';
    var measurement = isVertical ? 'width' : 'height';

    if (popper[side] < floor(reference[opSide])) {
      data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
    }
    if (popper[opSide] > floor(reference[side])) {
      data.offsets.popper[opSide] = floor(reference[side]);
    }

    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3112
3113

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
   * Converts a string containing value + unit into a px value number
   * @function
   * @memberof {modifiers~offset}
   * @private
   * @argument {String} str - Value + unit string
   * @argument {String} measurement - `height` or `width`
   * @argument {Object} popperOffsets
   * @argument {Object} referenceOffsets
   * @returns {Number|String}
   * Value in pixels, or original string if no values were extracted
Mark Otto's avatar
dist  
Mark Otto committed
3124
   */
Mark Otto's avatar
dist    
Mark Otto committed
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
  function toValue(str, measurement, popperOffsets, referenceOffsets) {
    // separate value from unit
    var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
    var value = +split[1];
    var unit = split[2];

    // If it's not a number it's an operator, I guess
    if (!value) {
      return str;
    }

    if (unit.indexOf('%') === 0) {
      var element = void 0;
      switch (unit) {
        case '%p':
          element = popperOffsets;
          break;
        case '%':
        case '%r':
        default:
          element = referenceOffsets;
      }

      var rect = getClientRect(element);
      return rect[measurement] / 100 * value;
    } else if (unit === 'vh' || unit === 'vw') {
      // if is a vh or vw, we calculate the size based on the viewport
      var size = void 0;
      if (unit === 'vh') {
        size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
      } else {
        size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
      }
      return size / 100 * value;
    } else {
      // if is an explicit pixel unit, we get rid of the unit and keep the value
      // if is an implicit unit, it's px, and we return just the value
      return value;
    }
  }
Mark Otto's avatar
dist  
Mark Otto committed
3165
3166

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3167
3168
3169
3170
3171
3172
3173
3174
3175
   * Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
   * @function
   * @memberof {modifiers~offset}
   * @private
   * @argument {String} offset
   * @argument {Object} popperOffsets
   * @argument {Object} referenceOffsets
   * @argument {String} basePlacement
   * @returns {Array} a two cells array with x and y offsets in numbers
Mark Otto's avatar
dist  
Mark Otto committed
3176
   */
Mark Otto's avatar
dist    
Mark Otto committed
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
  function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
    var offsets = [0, 0];

    // Use height if placement is left or right and index is 0 otherwise use width
    // in this way the first offset will use an axis and the second one
    // will use the other one
    var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;

    // Split the offset string to obtain a list of values and operands
    // The regex addresses values with the plus or minus sign in front (+10, -20, etc)
    var fragments = offset.split(/(\+|\-)/).map(function (frag) {
      return frag.trim();
    });

    // Detect if the offset string contains a pair of values or a single one
    // they could be separated by comma or space
    var divider = fragments.indexOf(find(fragments, function (frag) {
      return frag.search(/,|\s/) !== -1;
    }));

    if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
      console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
    }

    // If divider is found, we divide the list of values and operands to divide
    // them by ofset X and Y.
    var splitRegex = /\s*,\s*|\s+/;
    var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];

    // Convert the values with units to absolute pixels to allow our computations
    ops = ops.map(function (op, index) {
      // Most of the units rely on the orientation of the popper
      var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
      var mergeWithPrevious = false;
      return op
      // This aggregates any `+` or `-` sign that aren't considered operators
      // e.g.: 10 + +5 => [10, +, +5]
      .reduce(function (a, b) {
        if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
          a[a.length - 1] = b;
          mergeWithPrevious = true;
          return a;
        } else if (mergeWithPrevious) {
          a[a.length - 1] += b;
          mergeWithPrevious = false;
          return a;
        } else {
          return a.concat(b);
        }
      }, [])
      // Here we convert the string values into number values (in px)
      .map(function (str) {
        return toValue(str, measurement, popperOffsets, referenceOffsets);
      });
    });

    // Loop trough the offsets arrays and execute the operations
    ops.forEach(function (op, index) {
      op.forEach(function (frag, index2) {
        if (isNumeric(frag)) {
          offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
        }
      });
    });
    return offsets;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3243
3244

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3245
3246
3247
3248
3249
3250
3251
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @argument {Number|String} options.offset=0
   * The offset value as described in the modifier description
   * @returns {Object} The data object, properly modified
Mark Otto's avatar
dist  
Mark Otto committed
3252
   */
Mark Otto's avatar
dist    
Mark Otto committed
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
  function offset(data, _ref) {
    var offset = _ref.offset;
    var placement = data.placement,
        _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var basePlacement = placement.split('-')[0];

    var offsets = void 0;
    if (isNumeric(+offset)) {
      offsets = [+offset, 0];
    } else {
      offsets = parseOffset(offset, popper, reference, basePlacement);
    }

    if (basePlacement === 'left') {
      popper.top += offsets[0];
      popper.left -= offsets[1];
    } else if (basePlacement === 'right') {
      popper.top += offsets[0];
      popper.left += offsets[1];
    } else if (basePlacement === 'top') {
      popper.left += offsets[0];
      popper.top -= offsets[1];
    } else if (basePlacement === 'bottom') {
      popper.left += offsets[0];
      popper.top += offsets[1];
    }

    data.popper = popper;
    return data;
  }
Mark Otto's avatar
dist  
Mark Otto committed
3286
3287

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function preventOverflow(data, options) {
    var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper);

    // If offsetParent is the reference element, we really want to
    // go one step up and use the next offsetParent as reference to
    // avoid to make this modifier completely useless and look like broken
    if (data.instance.reference === boundariesElement) {
      boundariesElement = getOffsetParent(boundariesElement);
    }

Mark Otto's avatar
dist    
Mark Otto committed
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
    // NOTE: DOM access here
    // resets the popper's position so that the document size can be calculated excluding
    // the size of the popper element itself
    var transformProp = getSupportedPropertyName('transform');
    var popperStyles = data.instance.popper.style; // assignment to help minification
    var top = popperStyles.top,
        left = popperStyles.left,
        transform = popperStyles[transformProp];

    popperStyles.top = '';
    popperStyles.left = '';
    popperStyles[transformProp] = '';

Mark Otto's avatar
dist    
Mark Otto committed
3317
    var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
Mark Otto's avatar
dist    
Mark Otto committed
3318
3319
3320
3321
3322
3323
3324

    // NOTE: DOM access here
    // restores the original style properties after the offsets have been computed
    popperStyles.top = top;
    popperStyles.left = left;
    popperStyles[transformProp] = transform;

Mark Otto's avatar
dist    
Mark Otto committed
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
    options.boundaries = boundaries;

    var order = options.priority;
    var popper = data.offsets.popper;

    var check = {
      primary: function primary(placement) {
        var value = popper[placement];
        if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
          value = Math.max(popper[placement], boundaries[placement]);
        }
        return defineProperty({}, placement, value);
      },
      secondary: function secondary(placement) {
        var mainSide = placement === 'right' ? 'left' : 'top';
        var value = popper[mainSide];
        if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
          value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
        }
        return defineProperty({}, mainSide, value);
      }
    };

    order.forEach(function (placement) {
      var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
      popper = _extends({}, popper, check[side](placement));
    });

    data.offsets.popper = popper;

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function shift(data) {
    var placement = data.placement;
    var basePlacement = placement.split('-')[0];
    var shiftvariation = placement.split('-')[1];

    // if shift shiftvariation is specified, run the modifier
    if (shiftvariation) {
      var _data$offsets = data.offsets,
          reference = _data$offsets.reference,
          popper = _data$offsets.popper;

      var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
      var side = isVertical ? 'left' : 'top';
      var measurement = isVertical ? 'width' : 'height';

      var shiftOffsets = {
        start: defineProperty({}, side, reference[side]),
        end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
      };

      data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]);
    }

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by update method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function hide(data) {
    if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
      return data;
    }

    var refRect = data.offsets.reference;
    var bound = find(data.instance.modifiers, function (modifier) {
      return modifier.name === 'preventOverflow';
    }).boundaries;

    if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
      // Avoid unnecessary DOM access if visibility hasn't changed
      if (data.hide === true) {
        return data;
      }

      data.hide = true;
      data.attributes['x-out-of-boundaries'] = '';
    } else {
      // Avoid unnecessary DOM access if visibility hasn't changed
      if (data.hide === false) {
        return data;
      }

      data.hide = false;
      data.attributes['x-out-of-boundaries'] = false;
    }

    return data;
  }

  /**
   * @function
   * @memberof Modifiers
   * @argument {Object} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {Object} The data object, properly modified
   */
  function inner(data) {
    var placement = data.placement;
    var basePlacement = placement.split('-')[0];
    var _data$offsets = data.offsets,
        popper = _data$offsets.popper,
        reference = _data$offsets.reference;

    var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;

    var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;

    popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);

    data.placement = getOppositePlacement(placement);
    data.offsets.popper = getClientRect(popper);

    return data;
  }

  /**
   * Modifier function, each modifier can have a function of this type assigned
   * to its `fn` property.<br />
   * These functions will be called on each update, this means that you must
   * make sure they are performant enough to avoid performance bottlenecks.
Mark Otto's avatar
dist  
Mark Otto committed
3460
   *
Mark Otto's avatar
dist    
Mark Otto committed
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
   * @function ModifierFn
   * @argument {dataObject} data - The data object generated by `update` method
   * @argument {Object} options - Modifiers configuration and options
   * @returns {dataObject} The data object, properly modified
   */

  /**
   * Modifiers are plugins used to alter the behavior of your poppers.<br />
   * Popper.js uses a set of 9 modifiers to provide all the basic functionalities
   * needed by the library.
Mark Otto's avatar
dist  
Mark Otto committed
3471
   *
Mark Otto's avatar
dist    
Mark Otto committed
3472
3473
3474
   * Usually you don't want to override the `order`, `fn` and `onLoad` props.
   * All the other properties are configurations that could be tweaked.
   * @namespace modifiers
Mark Otto's avatar
dist  
Mark Otto committed
3475
   */
Mark Otto's avatar
dist    
Mark Otto committed
3476
  var modifiers = {
Mark Otto's avatar
dist  
Mark Otto committed
3477
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3478
3479
3480
3481
3482
3483
     * Modifier used to shift the popper on the start or end of its reference
     * element.<br />
     * It will read the variation of the `placement` property.<br />
     * It can be one either `-end` or `-start`.
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3484
     */
Mark Otto's avatar
dist    
Mark Otto committed
3485
3486
3487
3488
3489
3490
3491
3492
3493
    shift: {
      /** @prop {number} order=100 - Index used to define the order of execution */
      order: 100,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: shift
    },

Mark Otto's avatar
dist  
Mark Otto committed
3494
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3495
3496
3497
     * The `offset` modifier can shift your popper on both its axis.
     *
     * It accepts the following units:
Mark Otto's avatar
dist    
Mark Otto committed
3498
     * - `px` or unit-less, interpreted as pixels
Mark Otto's avatar
dist    
Mark Otto committed
3499
3500
3501
3502
3503
3504
3505
     * - `%` or `%r`, percentage relative to the length of the reference element
     * - `%p`, percentage relative to the length of the popper element
     * - `vw`, CSS viewport width unit
     * - `vh`, CSS viewport height unit
     *
     * For length is intended the main axis relative to the placement of the popper.<br />
     * This means that if the placement is `top` or `bottom`, the length will be the
Mark Otto's avatar
dist    
Mark Otto committed
3506
     * `width`. In case of `left` or `right`, it will be the `height`.
Mark Otto's avatar
dist    
Mark Otto committed
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
     *
     * You can provide a single value (as `Number` or `String`), or a pair of values
     * as `String` divided by a comma or one (or more) white spaces.<br />
     * The latter is a deprecated method because it leads to confusion and will be
     * removed in v2.<br />
     * Additionally, it accepts additions and subtractions between different units.
     * Note that multiplications and divisions aren't supported.
     *
     * Valid examples are:
     * ```
     * 10
     * '10%'
     * '10, 10'
     * '10%, 10'
     * '10 + 10%'
     * '10 - 5vh + 3%'
     * '-10px + 5vh, 5px - 6%'
     * ```
     * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
     * > with their reference element, unfortunately, you will have to disable the `flip` modifier.
Mark Otto's avatar
dist    
Mark Otto committed
3527
     * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
Mark Otto's avatar
dist    
Mark Otto committed
3528
3529
3530
     *
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3531
     */
Mark Otto's avatar
dist    
Mark Otto committed
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
    offset: {
      /** @prop {number} order=200 - Index used to define the order of execution */
      order: 200,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: offset,
      /** @prop {Number|String} offset=0
       * The offset value as described in the modifier description
       */
      offset: 0
    },

Mark Otto's avatar
dist  
Mark Otto committed
3545
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3546
3547
     * Modifier used to prevent the popper from being positioned outside the boundary.
     *
Mark Otto's avatar
dist    
Mark Otto committed
3548
     * A scenario exists where the reference itself is not within the boundaries.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
     * We can say it has "escaped the boundaries" — or just "escaped".<br />
     * In this case we need to decide whether the popper should either:
     *
     * - detach from the reference and remain "trapped" in the boundaries, or
     * - if it should ignore the boundary and "escape with its reference"
     *
     * When `escapeWithReference` is set to`true` and reference is completely
     * outside its boundaries, the popper will overflow (or completely leave)
     * the boundaries in order to remain attached to the edge of the reference.
     *
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3561
     */
Mark Otto's avatar
dist    
Mark Otto committed
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
    preventOverflow: {
      /** @prop {number} order=300 - Index used to define the order of execution */
      order: 300,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: preventOverflow,
      /**
       * @prop {Array} [priority=['left','right','top','bottom']]
       * Popper will try to prevent overflow following these priorities by default,
       * then, it could overflow on the left and on top of the `boundariesElement`
       */
      priority: ['left', 'right', 'top', 'bottom'],
      /**
       * @prop {number} padding=5
       * Amount of pixel used to define a minimum distance between the boundaries
Mark Otto's avatar
dist    
Mark Otto committed
3578
       * and the popper. This makes sure the popper always has a little padding
Mark Otto's avatar
dist    
Mark Otto committed
3579
3580
3581
3582
3583
       * between the edges of its container
       */
      padding: 5,
      /**
       * @prop {String|HTMLElement} boundariesElement='scrollParent'
Mark Otto's avatar
dist    
Mark Otto committed
3584
       * Boundaries used by the modifier. Can be `scrollParent`, `window`,
Mark Otto's avatar
dist    
Mark Otto committed
3585
3586
3587
3588
       * `viewport` or any DOM element.
       */
      boundariesElement: 'scrollParent'
    },
Mark Otto's avatar
dist  
Mark Otto committed
3589
3590

    /**
Mark Otto's avatar
dist    
Mark Otto committed
3591
3592
3593
3594
     * Modifier used to make sure the reference and its popper stay near each other
     * without leaving any gap between the two. Especially useful when the arrow is
     * enabled and you want to ensure that it points to its reference element.
     * It cares only about the first axis. You can still have poppers with margin
Mark Otto's avatar
dist    
Mark Otto committed
3595
3596
3597
     * between the popper and its reference element.
     * @memberof modifiers
     * @inner
Mark Otto's avatar
dist  
Mark Otto committed
3598
     */
Mark Otto's avatar
dist    
Mark Otto committed
3599
3600
3601
3602
3603
3604
3605
3606
    keepTogether: {
      /** @prop {number} order=400 - Index used to define the order of execution */
      order: 400,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: keepTogether
    },
Mark Otto's avatar
dist  
Mark Otto committed
3607

Mark Otto's avatar
dist    
Mark Otto committed
3608
3609
3610
3611
    /**
     * This modifier is used to move the `arrowElement` of the popper to make
     * sure it is positioned between the reference element and its popper element.
     * It will read the outer size of the `arrowElement` node to detect how many
Mark Otto's avatar
dist    
Mark Otto committed
3612
     * pixels of conjunction are needed.
Mark Otto's avatar
dist    
Mark Otto committed
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
     *
     * It has no effect if no `arrowElement` is provided.
     * @memberof modifiers
     * @inner
     */
    arrow: {
      /** @prop {number} order=500 - Index used to define the order of execution */
      order: 500,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: arrow,
      /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
      element: '[x-arrow]'
    },
Mark Otto's avatar
dist  
Mark Otto committed
3628

Mark Otto's avatar
dist    
Mark Otto committed
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
    /**
     * Modifier used to flip the popper's placement when it starts to overlap its
     * reference element.
     *
     * Requires the `preventOverflow` modifier before it in order to work.
     *
     * **NOTE:** this modifier will interrupt the current update cycle and will
     * restart it if it detects the need to flip the placement.
     * @memberof modifiers
     * @inner
     */
    flip: {
      /** @prop {number} order=600 - Index used to define the order of execution */
      order: 600,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: flip,
      /**
       * @prop {String|Array} behavior='flip'
       * The behavior used to change the popper's placement. It can be one of
       * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
Mark Otto's avatar
dist    
Mark Otto committed
3651
       * placements (with optional variations)
Mark Otto's avatar
dist    
Mark Otto committed
3652
3653
3654
3655
3656
3657
3658
3659
3660
       */
      behavior: 'flip',
      /**
       * @prop {number} padding=5
       * The popper will flip if it hits the edges of the `boundariesElement`
       */
      padding: 5,
      /**
       * @prop {String|HTMLElement} boundariesElement='viewport'
Mark Otto's avatar
dist    
Mark Otto committed
3661
3662
3663
       * The element which will define the boundaries of the popper position.
       * The popper will never be placed outside of the defined boundaries
       * (except if `keepTogether` is enabled)
Mark Otto's avatar
dist    
Mark Otto committed
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
       */
      boundariesElement: 'viewport'
    },

    /**
     * Modifier used to make the popper flow toward the inner of the reference element.
     * By default, when this modifier is disabled, the popper will be placed outside
     * the reference element.
     * @memberof modifiers
     * @inner
     */
    inner: {
      /** @prop {number} order=700 - Index used to define the order of execution */
      order: 700,
      /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
      enabled: false,
      /** @prop {ModifierFn} */
      fn: inner
    },

    /**
     * Modifier used to hide the popper when its reference element is outside of the
     * popper boundaries. It will set a `x-out-of-boundaries` attribute which can
     * be used to hide with a CSS selector the popper when its reference is
     * out of boundaries.
     *
     * Requires the `preventOverflow` modifier before it in order to work.
     * @memberof modifiers
     * @inner
     */
    hide: {
      /** @prop {number} order=800 - Index used to define the order of execution */
      order: 800,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: hide
    },

    /**
     * Computes the style that will be applied to the popper element to gets
     * properly positioned.
     *
     * Note that this modifier will not touch the DOM, it just prepares the styles
     * so that `applyStyle` modifier can apply it. This separation is useful
     * in case you need to replace `applyStyle` with a custom implementation.
     *
     * This modifier has `850` as `order` value to maintain backward compatibility
     * with previous versions of Popper.js. Expect the modifiers ordering method
     * to change in future major versions of the library.
     *
     * @memberof modifiers
     * @inner
     */
    computeStyle: {
      /** @prop {number} order=850 - Index used to define the order of execution */
      order: 850,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: computeStyle,
      /**
       * @prop {Boolean} gpuAcceleration=true
Mark Otto's avatar
dist    
Mark Otto committed
3727
3728
       * If true, it uses the CSS 3D transformation to position the popper.
       * Otherwise, it will use the `top` and `left` properties
Mark Otto's avatar
dist    
Mark Otto committed
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
       */
      gpuAcceleration: true,
      /**
       * @prop {string} [x='bottom']
       * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
       * Change this if your popper should grow in a direction different from `bottom`
       */
      x: 'bottom',
      /**
       * @prop {string} [x='left']
       * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
       * Change this if your popper should grow in a direction different from `right`
       */
      y: 'right'
    },

    /**
     * Applies the computed styles to the popper element.
     *
     * All the DOM manipulations are limited to this modifier. This is useful in case
     * you want to integrate Popper.js inside a framework or view library and you
     * want to delegate all the DOM manipulations to it.
     *
     * Note that if you disable this modifier, you must make sure the popper element
     * has its position set to `absolute` before Popper.js can do its work!
     *
Mark Otto's avatar
dist    
Mark Otto committed
3755
     * Just disable this modifier and define your own to achieve the desired effect.
Mark Otto's avatar
dist    
Mark Otto committed
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
     *
     * @memberof modifiers
     * @inner
     */
    applyStyle: {
      /** @prop {number} order=900 - Index used to define the order of execution */
      order: 900,
      /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
      enabled: true,
      /** @prop {ModifierFn} */
      fn: applyStyle,
      /** @prop {Function} */
      onLoad: applyStyleOnLoad,
      /**
       * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
       * @prop {Boolean} gpuAcceleration=true
Mark Otto's avatar
dist    
Mark Otto committed
3772
3773
       * If true, it uses the CSS 3D transformation to position the popper.
       * Otherwise, it will use the `top` and `left` properties
Mark Otto's avatar
dist    
Mark Otto committed
3774
3775
3776
3777
       */
      gpuAcceleration: undefined
    }
  };
Mark Otto's avatar
dist  
Mark Otto committed
3778
3779

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3780
3781
   * The `dataObject` is an object containing all the information used by Popper.js.
   * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
Mark Otto's avatar
dist    
Mark Otto committed
3782
3783
3784
3785
3786
   * @name dataObject
   * @property {Object} data.instance The Popper.js instance
   * @property {String} data.placement Placement applied to popper
   * @property {String} data.originalPlacement Placement originally defined on init
   * @property {Boolean} data.flipped True if popper has been flipped by flip modifier
Mark Otto's avatar
dist    
Mark Otto committed
3787
   * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
Mark Otto's avatar
dist    
Mark Otto committed
3788
   * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
Mark Otto's avatar
dist    
Mark Otto committed
3789
3790
   * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
   * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
Mark Otto's avatar
dist    
Mark Otto committed
3791
   * @property {Object} data.boundaries Offsets of the popper boundaries
Mark Otto's avatar
dist    
Mark Otto committed
3792
   * @property {Object} data.offsets The measurements of popper, reference and arrow elements
Mark Otto's avatar
dist    
Mark Otto committed
3793
3794
3795
   * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
   * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
   * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
Mark Otto's avatar
dist  
Mark Otto committed
3796
3797
3798
   */

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3799
   * Default options provided to Popper.js constructor.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3800
3801
3802
   * These can be overridden using the `options` argument of Popper.js.<br />
   * To override an option, simply pass an object with the same
   * structure of the `options` object, as the 3rd argument. For example:
Mark Otto's avatar
dist    
Mark Otto committed
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
   * ```
   * new Popper(ref, pop, {
   *   modifiers: {
   *     preventOverflow: { enabled: false }
   *   }
   * })
   * ```
   * @type {Object}
   * @static
   * @memberof Popper
Mark Otto's avatar
dist  
Mark Otto committed
3813
   */
Mark Otto's avatar
dist    
Mark Otto committed
3814
3815
  var Defaults = {
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3816
     * Popper's placement.
Mark Otto's avatar
dist    
Mark Otto committed
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
     * @prop {Popper.placements} placement='bottom'
     */
    placement: 'bottom',

    /**
     * Set this to true if you want popper to position it self in 'fixed' mode
     * @prop {Boolean} positionFixed=false
     */
    positionFixed: false,

    /**
Mark Otto's avatar
dist    
Mark Otto committed
3828
     * Whether events (resize, scroll) are initially enabled.
Mark Otto's avatar
dist    
Mark Otto committed
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
     * @prop {Boolean} eventsEnabled=true
     */
    eventsEnabled: true,

    /**
     * Set to true if you want to automatically remove the popper when
     * you call the `destroy` method.
     * @prop {Boolean} removeOnDestroy=false
     */
    removeOnDestroy: false,

    /**
     * Callback called when the popper is created.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3842
     * By default, it is set to no-op.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3843
3844
3845
3846
3847
3848
     * Access Popper.js instance with `data.instance`.
     * @prop {onCreate}
     */
    onCreate: function onCreate() {},

    /**
Mark Otto's avatar
dist    
Mark Otto committed
3849
     * Callback called when the popper is updated. This callback is not called
Mark Otto's avatar
dist    
Mark Otto committed
3850
3851
     * on the initialization/creation of the popper, but only on subsequent
     * updates.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3852
     * By default, it is set to no-op.<br />
Mark Otto's avatar
dist    
Mark Otto committed
3853
3854
3855
3856
3857
3858
3859
     * Access Popper.js instance with `data.instance`.
     * @prop {onUpdate}
     */
    onUpdate: function onUpdate() {},

    /**
     * List of modifiers used to modify the offsets before they are applied to the popper.
Mark Otto's avatar
dist    
Mark Otto committed
3860
     * They provide most of the functionalities of Popper.js.
Mark Otto's avatar
dist    
Mark Otto committed
3861
3862
3863
3864
     * @prop {modifiers}
     */
    modifiers: modifiers
  };
Mark Otto's avatar
dist  
Mark Otto committed
3865
3866

  /**
Mark Otto's avatar
dist    
Mark Otto committed
3867
3868
   * @callback onCreate
   * @param {dataObject} data
Mark Otto's avatar
dist  
Mark Otto committed
3869
   */
Mark Otto's avatar
dist    
Mark Otto committed
3870

Mark Otto's avatar
dist  
Mark Otto committed
3871
  /**
Mark Otto's avatar
dist    
Mark Otto committed
3872
3873
   * @callback onUpdate
   * @param {dataObject} data
Mark Otto's avatar
dist  
Mark Otto committed
3874
3875
   */

Mark Otto's avatar
dist    
Mark Otto committed
3876
3877
3878
3879
  // Utils
  // Methods
  var Popper = function () {
    /**
Mark Otto's avatar
dist    
Mark Otto committed
3880
     * Creates a new Popper.js instance.
Mark Otto's avatar
dist    
Mark Otto committed
3881
3882
     * @class Popper
     * @param {HTMLElement|referenceObject} reference - The reference element used to position the popper
Mark Otto's avatar
dist    
Mark Otto committed
3883
     * @param {HTMLElement} popper - The HTML element used as the popper
Mark Otto's avatar
dist    
Mark Otto committed
3884
3885
3886
3887
3888
3889
3890
3891
     * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
     * @return {Object} instance - The generated Popper.js instance
     */
    function Popper(reference, popper) {
      var _this = this;

      var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
      classCallCheck(this, Popper);
Mark Otto's avatar
dist  
Mark Otto committed
3892

Mark Otto's avatar
dist    
Mark Otto committed
3893
3894
3895
      this.scheduleUpdate = function () {
        return requestAnimationFrame(_this.update);
      };
Mark Otto's avatar
dist  
Mark Otto committed
3896

Mark Otto's avatar
dist    
Mark Otto committed
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
      // make update() debounced, so that it only runs at most once-per-tick
      this.update = debounce(this.update.bind(this));

      // with {} we create a new object with the options inside it
      this.options = _extends({}, Popper.Defaults, options);

      // init state
      this.state = {
        isDestroyed: false,
        isCreated: false,
        scrollParents: []
      };
Mark Otto's avatar
dist  
Mark Otto committed
3909

Mark Otto's avatar
dist    
Mark Otto committed
3910
3911
3912
      // get reference and popper elements (allow jQuery wrappers)
      this.reference = reference && reference.jquery ? reference[0] : reference;
      this.popper = popper && popper.jquery ? popper[0] : popper;
Mark Otto's avatar
dist  
Mark Otto committed
3913

Mark Otto's avatar
dist    
Mark Otto committed
3914
3915
3916
3917
3918
      // Deep merge modifiers options
      this.options.modifiers = {};
      Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
        _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
      });
Mark Otto's avatar
dist  
Mark Otto committed
3919

Mark Otto's avatar
dist    
Mark Otto committed
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
      // Refactoring modifiers' list (Object => Array)
      this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
        return _extends({
          name: name
        }, _this.options.modifiers[name]);
      })
      // sort the modifiers by order
      .sort(function (a, b) {
        return a.order - b.order;
      });
Mark Otto's avatar
dist  
Mark Otto committed
3930

Mark Otto's avatar
dist    
Mark Otto committed
3931
3932
3933
3934
3935
3936
3937
3938
3939
      // modifiers have the ability to execute arbitrary code when Popper.js get inited
      // such code is executed in the same order of its modifier
      // they could add new properties to their options configuration
      // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
      this.modifiers.forEach(function (modifierOptions) {
        if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
          modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
        }
      });
Mark Otto's avatar
dist  
Mark Otto committed
3940

Mark Otto's avatar
dist    
Mark Otto committed
3941
3942
      // fire the first update to position the popper in the right place
      this.update();
Mark Otto's avatar
dist  
Mark Otto committed
3943

Mark Otto's avatar
dist    
Mark Otto committed
3944
3945
3946
3947
      var eventsEnabled = this.options.eventsEnabled;
      if (eventsEnabled) {
        // setup event listeners, they will take care of update the position in specific situations
        this.enableEventListeners();
Mark Otto's avatar
dist  
Mark Otto committed
3948
3949
      }

Mark Otto's avatar
dist    
Mark Otto committed
3950
      this.state.eventsEnabled = eventsEnabled;
Mark Otto's avatar
dist  
Mark Otto committed
3951
3952
    }

Mark Otto's avatar
dist    
Mark Otto committed
3953
3954
    // We can't use class properties because they don't get listed in the
    // class prototype and break stuff like Sinon stubs
Mark Otto's avatar
dist  
Mark Otto committed
3955
3956


Mark Otto's avatar
dist    
Mark Otto committed
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
    createClass(Popper, [{
      key: 'update',
      value: function update$$1() {
        return update.call(this);
      }
    }, {
      key: 'destroy',
      value: function destroy$$1() {
        return destroy.call(this);
      }
    }, {
      key: 'enableEventListeners',
      value: function enableEventListeners$$1() {
        return enableEventListeners.call(this);
      }
    }, {
      key: 'disableEventListeners',
      value: function disableEventListeners$$1() {
        return disableEventListeners.call(this);
      }
Mark Otto's avatar
dist  
Mark Otto committed
3977

Mark Otto's avatar
dist    
Mark Otto committed
3978
      /**
Mark Otto's avatar
dist    
Mark Otto committed
3979
       * Schedules an update. It will run on the next UI update available.
Mark Otto's avatar
dist    
Mark Otto committed
3980
3981
3982
       * @method scheduleUpdate
       * @memberof Popper
       */
Mark Otto's avatar
dist  
Mark Otto committed
3983
3984


Mark Otto's avatar
dist    
Mark Otto committed
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
      /**
       * Collection of utilities useful when writing custom modifiers.
       * Starting from version 1.7, this method is available only if you
       * include `popper-utils.js` before `popper.js`.
       *
       * **DEPRECATION**: This way to access PopperUtils is deprecated
       * and will be removed in v2! Use the PopperUtils module directly instead.
       * Due to the high instability of the methods contained in Utils, we can't
       * guarantee them to follow semver. Use them at your own risk!
       * @static
       * @private
       * @type {Object}
       * @deprecated since version 1.8
       * @member Utils
       * @memberof Popper
       */
Mark Otto's avatar
dist  
Mark Otto committed
4001

Mark Otto's avatar
dist    
Mark Otto committed
4002
4003
4004
    }]);
    return Popper;
  }();
Mark Otto's avatar
dist  
Mark Otto committed
4005
4006

  /**
Mark Otto's avatar
dist    
Mark Otto committed
4007
4008
4009
4010
4011
4012
4013
4014
4015
   * The `referenceObject` is an object that provides an interface compatible with Popper.js
   * and lets you use it as replacement of a real DOM node.<br />
   * You can use this method to position a popper relatively to a set of coordinates
   * in case you don't have a DOM node to use as reference.
   *
   * ```
   * new Popper(referenceObject, popperNode);
   * ```
   *
Mark Otto's avatar
dist    
Mark Otto committed
4016
   * NB: This feature isn't supported in Internet Explorer 10.
Mark Otto's avatar
dist    
Mark Otto committed
4017
4018
4019
4020
4021
4022
4023
   * @name referenceObject
   * @property {Function} data.getBoundingClientRect
   * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
   * @property {number} data.clientWidth
   * An ES6 getter that will return the width of the virtual reference element.
   * @property {number} data.clientHeight
   * An ES6 getter that will return the height of the virtual reference element.
Mark Otto's avatar
dist  
Mark Otto committed
4024
   */
Mark Otto's avatar
dist    
Mark Otto committed
4025
4026
4027
4028
4029
4030
4031
4032


  Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils;
  Popper.placements = placements;
  Popper.Defaults = Defaults;

  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4033
   * Bootstrap (v4.1.3): dropdown.js
Mark Otto's avatar
dist    
Mark Otto committed
4034
4035
4036
4037
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */

XhmikosR's avatar
Dist    
XhmikosR committed
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$4 = 'dropdown';
  var VERSION$4 = '4.1.3';
  var DATA_KEY$4 = 'bs.dropdown';
  var EVENT_KEY$4 = "." + DATA_KEY$4;
  var DATA_API_KEY$4 = '.data-api';
  var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4];
  var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key

  var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key

  var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key

  var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key

  var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key

  var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)

  var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
  var Event$4 = {
    HIDE: "hide" + EVENT_KEY$4,
    HIDDEN: "hidden" + EVENT_KEY$4,
    SHOW: "show" + EVENT_KEY$4,
    SHOWN: "shown" + EVENT_KEY$4,
    CLICK: "click" + EVENT_KEY$4,
    CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4,
    KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4,
    KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4
  };
  var ClassName$4 = {
    DISABLED: 'disabled',
    SHOW: 'show',
    DROPUP: 'dropup',
    DROPRIGHT: 'dropright',
    DROPLEFT: 'dropleft',
    MENURIGHT: 'dropdown-menu-right',
    MENULEFT: 'dropdown-menu-left',
    POSITION_STATIC: 'position-static'
  };
  var Selector$4 = {
    DATA_TOGGLE: '[data-toggle="dropdown"]',
    FORM_CHILD: '.dropdown form',
    MENU: '.dropdown-menu',
    NAVBAR_NAV: '.navbar-nav',
    VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'
  };
  var AttachmentMap = {
    TOP: 'top-start',
    TOPEND: 'top-end',
    BOTTOM: 'bottom-start',
    BOTTOMEND: 'bottom-end',
    RIGHT: 'right-start',
    RIGHTEND: 'right-end',
    LEFT: 'left-start',
    LEFTEND: 'left-end'
  };
  var Default$2 = {
    offset: 0,
    flip: true,
    boundary: 'scrollParent',
    reference: 'toggle',
    display: 'dynamic'
  };
  var DefaultType$2 = {
    offset: '(number|string|function)',
    flip: 'boolean',
    boundary: '(string|element)',
    reference: '(string|element)',
    display: 'string'
Mark Otto's avatar
dist    
Mark Otto committed
4113
4114
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
4115
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
4116
4117
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
4118

XhmikosR's avatar
Dist    
XhmikosR committed
4119
  };
Mark Otto's avatar
dist    
Mark Otto committed
4120

XhmikosR's avatar
Dist    
XhmikosR committed
4121
4122
4123
4124
4125
4126
4127
4128
4129
  var Dropdown =
  /*#__PURE__*/
  function () {
    function Dropdown(element, config) {
      this._element = element;
      this._popper = null;
      this._config = this._getConfig(config);
      this._menu = this._getMenuElement();
      this._inNavbar = this._detectNavbar();
Mark Otto's avatar
dist    
Mark Otto committed
4130

XhmikosR's avatar
Dist    
XhmikosR committed
4131
4132
      this._addEventListeners();
    } // Getters
Mark Otto's avatar
dist    
Mark Otto committed
4133

Mark Otto's avatar
dist  
Mark Otto committed
4134

XhmikosR's avatar
Dist    
XhmikosR committed
4135
    var _proto = Dropdown.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
4136

XhmikosR's avatar
Dist    
XhmikosR committed
4137
4138
4139
4140
4141
    // Public
    _proto.toggle = function toggle() {
      if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4142

XhmikosR's avatar
Dist    
XhmikosR committed
4143
      var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist  
Mark Otto committed
4144

XhmikosR's avatar
Dist    
XhmikosR committed
4145
      var isActive = $(this._menu).hasClass(ClassName$4.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4146

XhmikosR's avatar
Dist    
XhmikosR committed
4147
      Dropdown._clearMenus();
Mark Otto's avatar
dist  
Mark Otto committed
4148

XhmikosR's avatar
Dist    
XhmikosR committed
4149
4150
4151
      if (isActive) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4152

XhmikosR's avatar
Dist    
XhmikosR committed
4153
4154
4155
4156
4157
      var relatedTarget = {
        relatedTarget: this._element
      };
      var showEvent = $.Event(Event$4.SHOW, relatedTarget);
      $(parent).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4158

XhmikosR's avatar
Dist    
XhmikosR committed
4159
4160
4161
      if (showEvent.isDefaultPrevented()) {
        return;
      } // Disable totally Popper.js for Dropdown in Navbar
Mark Otto's avatar
dist    
Mark Otto committed
4162

Mark Otto's avatar
dist  
Mark Otto committed
4163

XhmikosR's avatar
Dist    
XhmikosR committed
4164
4165
4166
4167
4168
4169
4170
      if (!this._inNavbar) {
        /**
         * Check for Popper dependency
         * Popper - https://popper.js.org
         */
        if (typeof Popper === 'undefined') {
          throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)');
Mark Otto's avatar
dist    
Mark Otto committed
4171
        }
Mark Otto's avatar
dist  
Mark Otto committed
4172

XhmikosR's avatar
Dist    
XhmikosR committed
4173
        var referenceElement = this._element;
Mark Otto's avatar
dist  
Mark Otto committed
4174

XhmikosR's avatar
Dist    
XhmikosR committed
4175
4176
4177
4178
        if (this._config.reference === 'parent') {
          referenceElement = parent;
        } else if (Util.isElement(this._config.reference)) {
          referenceElement = this._config.reference; // Check if it's jQuery element
Mark Otto's avatar
dist    
Mark Otto committed
4179

XhmikosR's avatar
Dist    
XhmikosR committed
4180
4181
          if (typeof this._config.reference.jquery !== 'undefined') {
            referenceElement = this._config.reference[0];
Mark Otto's avatar
dist    
Mark Otto committed
4182
          }
XhmikosR's avatar
Dist    
XhmikosR committed
4183
4184
4185
        } // If boundary is not `scrollParent`, then set position to `static`
        // to allow the menu to "escape" the scroll parent's boundaries
        // https://github.com/twbs/bootstrap/issues/24251
Mark Otto's avatar
dist    
Mark Otto committed
4186

Mark Otto's avatar
dist    
Mark Otto committed
4187

XhmikosR's avatar
Dist    
XhmikosR committed
4188
4189
4190
        if (this._config.boundary !== 'scrollParent') {
          $(parent).addClass(ClassName$4.POSITION_STATIC);
        }
Mark Otto's avatar
dist    
Mark Otto committed
4191

XhmikosR's avatar
Dist    
XhmikosR committed
4192
4193
4194
4195
4196
        this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig());
      } // If this is a touch-enabled device we add extra
      // empty mouseover listeners to the body's immediate children;
      // only needed because of broken event delegation on iOS
      // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
Mark Otto's avatar
dist    
Mark Otto committed
4197

Mark Otto's avatar
dist    
Mark Otto committed
4198

XhmikosR's avatar
Dist    
XhmikosR committed
4199
4200
4201
      if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) {
        $(document.body).children().on('mouseover', null, $.noop);
      }
Mark Otto's avatar
dist    
Mark Otto committed
4202

XhmikosR's avatar
Dist    
XhmikosR committed
4203
      this._element.focus();
Mark Otto's avatar
dist    
Mark Otto committed
4204

XhmikosR's avatar
Dist    
XhmikosR committed
4205
      this._element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist  
Mark Otto committed
4206

XhmikosR's avatar
Dist    
XhmikosR committed
4207
4208
4209
      $(this._menu).toggleClass(ClassName$4.SHOW);
      $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
    };
Mark Otto's avatar
dist    
Mark Otto committed
4210

XhmikosR's avatar
Dist    
XhmikosR committed
4211
4212
4213
4214
    _proto.show = function show() {
      if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4215

XhmikosR's avatar
Dist    
XhmikosR committed
4216
4217
      var relatedTarget = {
        relatedTarget: this._element
Mark Otto's avatar
dist    
Mark Otto committed
4218
      };
XhmikosR's avatar
Dist    
XhmikosR committed
4219
      var showEvent = $.Event(Event$4.SHOW, relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
4220

XhmikosR's avatar
Dist    
XhmikosR committed
4221
      var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist    
Mark Otto committed
4222

XhmikosR's avatar
Dist    
XhmikosR committed
4223
      $(parent).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4224

XhmikosR's avatar
Dist    
XhmikosR committed
4225
4226
4227
      if (showEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4228

XhmikosR's avatar
Dist    
XhmikosR committed
4229
4230
4231
      $(this._menu).toggleClass(ClassName$4.SHOW);
      $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget));
    };
Mark Otto's avatar
dist    
Mark Otto committed
4232

XhmikosR's avatar
Dist    
XhmikosR committed
4233
4234
4235
4236
    _proto.hide = function hide() {
      if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4237

XhmikosR's avatar
Dist    
XhmikosR committed
4238
4239
4240
4241
      var relatedTarget = {
        relatedTarget: this._element
      };
      var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
4242

XhmikosR's avatar
Dist    
XhmikosR committed
4243
      var parent = Dropdown._getParentFromElement(this._element);
Mark Otto's avatar
dist    
Mark Otto committed
4244

XhmikosR's avatar
Dist    
XhmikosR committed
4245
      $(parent).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4246

XhmikosR's avatar
Dist    
XhmikosR committed
4247
4248
4249
      if (hideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4250

XhmikosR's avatar
Dist    
XhmikosR committed
4251
4252
4253
      $(this._menu).toggleClass(ClassName$4.SHOW);
      $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
    };
Mark Otto's avatar
dist  
Mark Otto committed
4254

XhmikosR's avatar
Dist    
XhmikosR committed
4255
4256
4257
4258
4259
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$4);
      $(this._element).off(EVENT_KEY$4);
      this._element = null;
      this._menu = null;
Mark Otto's avatar
dist    
Mark Otto committed
4260

XhmikosR's avatar
Dist    
XhmikosR committed
4261
4262
      if (this._popper !== null) {
        this._popper.destroy();
Mark Otto's avatar
dist  
Mark Otto committed
4263

XhmikosR's avatar
Dist    
XhmikosR committed
4264
4265
4266
        this._popper = null;
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
4267

XhmikosR's avatar
Dist    
XhmikosR committed
4268
4269
    _proto.update = function update() {
      this._inNavbar = this._detectNavbar();
Mark Otto's avatar
dist    
Mark Otto committed
4270

XhmikosR's avatar
Dist    
XhmikosR committed
4271
4272
4273
4274
      if (this._popper !== null) {
        this._popper.scheduleUpdate();
      }
    }; // Private
Mark Otto's avatar
dist    
Mark Otto committed
4275

Mark Otto's avatar
dist    
Mark Otto committed
4276

XhmikosR's avatar
Dist    
XhmikosR committed
4277
4278
    _proto._addEventListeners = function _addEventListeners() {
      var _this = this;
Mark Otto's avatar
dist    
Mark Otto committed
4279

XhmikosR's avatar
Dist    
XhmikosR committed
4280
4281
4282
      $(this._element).on(Event$4.CLICK, function (event) {
        event.preventDefault();
        event.stopPropagation();
Mark Otto's avatar
dist  
Mark Otto committed
4283

XhmikosR's avatar
Dist    
XhmikosR committed
4284
4285
4286
        _this.toggle();
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
4287

XhmikosR's avatar
Dist    
XhmikosR committed
4288
4289
4290
4291
4292
    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config);
      Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
4293

XhmikosR's avatar
Dist    
XhmikosR committed
4294
4295
4296
4297
4298
4299
    _proto._getMenuElement = function _getMenuElement() {
      if (!this._menu) {
        var parent = Dropdown._getParentFromElement(this._element);

        if (parent) {
          this._menu = parent.querySelector(Selector$4.MENU);
Mark Otto's avatar
dist  
Mark Otto committed
4300
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4301
      }
Mark Otto's avatar
dist    
Mark Otto committed
4302

XhmikosR's avatar
Dist    
XhmikosR committed
4303
4304
      return this._menu;
    };
Mark Otto's avatar
dist  
Mark Otto committed
4305

XhmikosR's avatar
Dist    
XhmikosR committed
4306
4307
4308
    _proto._getPlacement = function _getPlacement() {
      var $parentDropdown = $(this._element.parentNode);
      var placement = AttachmentMap.BOTTOM; // Handle dropup
Mark Otto's avatar
dist  
Mark Otto committed
4309

XhmikosR's avatar
Dist    
XhmikosR committed
4310
4311
      if ($parentDropdown.hasClass(ClassName$4.DROPUP)) {
        placement = AttachmentMap.TOP;
Mark Otto's avatar
dist    
Mark Otto committed
4312

XhmikosR's avatar
Dist    
XhmikosR committed
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
        if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
          placement = AttachmentMap.TOPEND;
        }
      } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) {
        placement = AttachmentMap.RIGHT;
      } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) {
        placement = AttachmentMap.LEFT;
      } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) {
        placement = AttachmentMap.BOTTOMEND;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4323

XhmikosR's avatar
Dist    
XhmikosR committed
4324
4325
      return placement;
    };
Mark Otto's avatar
dist    
Mark Otto committed
4326

XhmikosR's avatar
Dist    
XhmikosR committed
4327
4328
4329
    _proto._detectNavbar = function _detectNavbar() {
      return $(this._element).closest('.navbar').length > 0;
    };
Mark Otto's avatar
dist    
Mark Otto committed
4330

XhmikosR's avatar
Dist    
XhmikosR committed
4331
4332
    _proto._getPopperConfig = function _getPopperConfig() {
      var _this2 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4333

XhmikosR's avatar
Dist    
XhmikosR committed
4334
      var offsetConf = {};
Mark Otto's avatar
dist    
Mark Otto committed
4335

XhmikosR's avatar
Dist    
XhmikosR committed
4336
4337
4338
4339
4340
4341
4342
4343
      if (typeof this._config.offset === 'function') {
        offsetConf.fn = function (data) {
          data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets) || {});
          return data;
        };
      } else {
        offsetConf.offset = this._config.offset;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4344

XhmikosR's avatar
Dist    
XhmikosR committed
4345
4346
4347
4348
4349
4350
4351
4352
4353
      var popperConfig = {
        placement: this._getPlacement(),
        modifiers: {
          offset: offsetConf,
          flip: {
            enabled: this._config.flip
          },
          preventOverflow: {
            boundariesElement: this._config.boundary
Mark Otto's avatar
dist    
Mark Otto committed
4354
          }
XhmikosR's avatar
Dist    
XhmikosR committed
4355
        } // Disable Popper.js if we have a static display
Mark Otto's avatar
dist    
Mark Otto committed
4356

XhmikosR's avatar
Dist    
XhmikosR committed
4357
      };
Mark Otto's avatar
dist    
Mark Otto committed
4358

XhmikosR's avatar
Dist    
XhmikosR committed
4359
4360
4361
4362
4363
      if (this._config.display === 'static') {
        popperConfig.modifiers.applyStyle = {
          enabled: false
        };
      }
Mark Otto's avatar
dist  
Mark Otto committed
4364

XhmikosR's avatar
Dist    
XhmikosR committed
4365
4366
      return popperConfig;
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
4367

Mark Otto's avatar
dist    
Mark Otto committed
4368

XhmikosR's avatar
Dist    
XhmikosR committed
4369
4370
4371
    Dropdown._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$4);
Mark Otto's avatar
dist    
Mark Otto committed
4372

XhmikosR's avatar
Dist    
XhmikosR committed
4373
        var _config = typeof config === 'object' ? config : null;
Mark Otto's avatar
dist  
Mark Otto committed
4374

XhmikosR's avatar
Dist    
XhmikosR committed
4375
4376
4377
4378
        if (!data) {
          data = new Dropdown(this, _config);
          $(this).data(DATA_KEY$4, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
4379

XhmikosR's avatar
Dist    
XhmikosR committed
4380
4381
4382
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
4383
          }
Mark Otto's avatar
dist    
Mark Otto committed
4384

XhmikosR's avatar
Dist    
XhmikosR committed
4385
4386
4387
4388
4389
4390
4391
4392
4393
          data[config]();
        }
      });
    };

    Dropdown._clearMenus = function _clearMenus(event) {
      if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4394

XhmikosR's avatar
Dist    
XhmikosR committed
4395
      var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE));
Mark Otto's avatar
dist  
Mark Otto committed
4396

XhmikosR's avatar
Dist    
XhmikosR committed
4397
4398
      for (var i = 0, len = toggles.length; i < len; i++) {
        var parent = Dropdown._getParentFromElement(toggles[i]);
Mark Otto's avatar
dist    
Mark Otto committed
4399

XhmikosR's avatar
Dist    
XhmikosR committed
4400
4401
4402
4403
        var context = $(toggles[i]).data(DATA_KEY$4);
        var relatedTarget = {
          relatedTarget: toggles[i]
        };
Mark Otto's avatar
dist    
Mark Otto committed
4404

XhmikosR's avatar
Dist    
XhmikosR committed
4405
4406
4407
        if (event && event.type === 'click') {
          relatedTarget.clickEvent = event;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4408

XhmikosR's avatar
Dist    
XhmikosR committed
4409
4410
        if (!context) {
          continue;
Mark Otto's avatar
dist  
Mark Otto committed
4411
4412
        }

XhmikosR's avatar
Dist    
XhmikosR committed
4413
        var dropdownMenu = context._menu;
Mark Otto's avatar
dist    
Mark Otto committed
4414

XhmikosR's avatar
Dist    
XhmikosR committed
4415
4416
        if (!$(parent).hasClass(ClassName$4.SHOW)) {
          continue;
Mark Otto's avatar
dist  
Mark Otto committed
4417
4418
        }

XhmikosR's avatar
Dist    
XhmikosR committed
4419
4420
4421
        if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) {
          continue;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4422

XhmikosR's avatar
Dist    
XhmikosR committed
4423
4424
        var hideEvent = $.Event(Event$4.HIDE, relatedTarget);
        $(parent).trigger(hideEvent);
Mark Otto's avatar
dist    
Mark Otto committed
4425

XhmikosR's avatar
Dist    
XhmikosR committed
4426
4427
4428
4429
        if (hideEvent.isDefaultPrevented()) {
          continue;
        } // If this is a touch-enabled device we remove the extra
        // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
4430
4431


XhmikosR's avatar
Dist    
XhmikosR committed
4432
4433
        if ('ontouchstart' in document.documentElement) {
          $(document.body).children().off('mouseover', null, $.noop);
Mark Otto's avatar
dist  
Mark Otto committed
4434
4435
        }

XhmikosR's avatar
Dist    
XhmikosR committed
4436
4437
4438
4439
4440
        toggles[i].setAttribute('aria-expanded', 'false');
        $(dropdownMenu).removeClass(ClassName$4.SHOW);
        $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget));
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
4441

XhmikosR's avatar
Dist    
XhmikosR committed
4442
4443
4444
    Dropdown._getParentFromElement = function _getParentFromElement(element) {
      var parent;
      var selector = Util.getSelectorFromElement(element);
Mark Otto's avatar
dist  
Mark Otto committed
4445

XhmikosR's avatar
Dist    
XhmikosR committed
4446
4447
4448
      if (selector) {
        parent = document.querySelector(selector);
      }
Mark Otto's avatar
dist    
Mark Otto committed
4449

XhmikosR's avatar
Dist    
XhmikosR committed
4450
4451
      return parent || element.parentNode;
    }; // eslint-disable-next-line complexity
Mark Otto's avatar
dist  
Mark Otto committed
4452
4453


XhmikosR's avatar
Dist    
XhmikosR committed
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
    Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) {
      // If not input/textarea:
      //  - And not a key in REGEXP_KEYDOWN => not a dropdown command
      // If input/textarea:
      //  - If space key => not a dropdown command
      //  - If key is other than escape
      //    - If key is not up or down => not a dropdown command
      //    - If trigger inside the menu => not a dropdown command
      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)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4465

XhmikosR's avatar
Dist    
XhmikosR committed
4466
4467
      event.preventDefault();
      event.stopPropagation();
Mark Otto's avatar
dist  
Mark Otto committed
4468

XhmikosR's avatar
Dist    
XhmikosR committed
4469
4470
4471
      if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4472

XhmikosR's avatar
Dist    
XhmikosR committed
4473
      var parent = Dropdown._getParentFromElement(this);
Mark Otto's avatar
dist  
Mark Otto committed
4474

XhmikosR's avatar
Dist    
XhmikosR committed
4475
4476
4477
4478
4479
4480
      var isActive = $(parent).hasClass(ClassName$4.SHOW);

      if (!isActive && (event.which !== ESCAPE_KEYCODE || event.which !== SPACE_KEYCODE) || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) {
        if (event.which === ESCAPE_KEYCODE) {
          var toggle = parent.querySelector(Selector$4.DATA_TOGGLE);
          $(toggle).trigger('focus');
Mark Otto's avatar
dist  
Mark Otto committed
4481
4482
        }

XhmikosR's avatar
Dist    
XhmikosR committed
4483
4484
4485
        $(this).trigger('click');
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4486

XhmikosR's avatar
Dist    
XhmikosR committed
4487
      var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS));
Mark Otto's avatar
dist  
Mark Otto committed
4488

XhmikosR's avatar
Dist    
XhmikosR committed
4489
4490
4491
      if (items.length === 0) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4492

XhmikosR's avatar
Dist    
XhmikosR committed
4493
      var index = items.indexOf(event.target);
Mark Otto's avatar
dist  
Mark Otto committed
4494

XhmikosR's avatar
Dist    
XhmikosR committed
4495
4496
4497
4498
      if (event.which === ARROW_UP_KEYCODE && index > 0) {
        // Up
        index--;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4499

XhmikosR's avatar
Dist    
XhmikosR committed
4500
4501
4502
4503
      if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
        // Down
        index++;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4504

XhmikosR's avatar
Dist    
XhmikosR committed
4505
4506
4507
      if (index < 0) {
        index = 0;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4508

XhmikosR's avatar
Dist    
XhmikosR committed
4509
      items[index].focus();
Mark Otto's avatar
dist  
Mark Otto committed
4510
4511
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
    _createClass(Dropdown, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$4;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$2;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$2;
      }
    }]);

Mark Otto's avatar
dist  
Mark Otto committed
4529
    return Dropdown;
XhmikosR's avatar
Dist    
XhmikosR committed
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


  $(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) {
    event.preventDefault();
    event.stopPropagation();

    Dropdown._jQueryInterface.call($(this), 'toggle');
  }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) {
    e.stopPropagation();
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

  $.fn[NAME$4] = Dropdown._jQueryInterface;
  $.fn[NAME$4].Constructor = Dropdown;

  $.fn[NAME$4].noConflict = function () {
    $.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
    return Dropdown._jQueryInterface;
  };
Mark Otto's avatar
dist    
Mark Otto committed
4559

Mark Otto's avatar
dist  
Mark Otto committed
4560
  /**
Mark Otto's avatar
dist    
Mark Otto committed
4561
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
4562
   * Bootstrap (v4.1.3): modal.js
Mark Otto's avatar
dist    
Mark Otto committed
4563
4564
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4565
4566
   */

XhmikosR's avatar
Dist    
XhmikosR committed
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$5 = 'modal';
  var VERSION$5 = '4.1.3';
  var DATA_KEY$5 = 'bs.modal';
  var EVENT_KEY$5 = "." + DATA_KEY$5;
  var DATA_API_KEY$5 = '.data-api';
  var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5];
  var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key

  var Default$3 = {
    backdrop: true,
    keyboard: true,
    focus: true,
    show: true
  };
  var DefaultType$3 = {
    backdrop: '(boolean|string)',
    keyboard: 'boolean',
    focus: 'boolean',
    show: 'boolean'
  };
  var Event$5 = {
    HIDE: "hide" + EVENT_KEY$5,
    HIDDEN: "hidden" + EVENT_KEY$5,
    SHOW: "show" + EVENT_KEY$5,
    SHOWN: "shown" + EVENT_KEY$5,
    FOCUSIN: "focusin" + EVENT_KEY$5,
    RESIZE: "resize" + EVENT_KEY$5,
    CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5,
    KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5,
    MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5,
    MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5,
    CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5
  };
  var ClassName$5 = {
    SCROLLBAR_MEASURER: 'modal-scrollbar-measure',
    BACKDROP: 'modal-backdrop',
    OPEN: 'modal-open',
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$5 = {
    DIALOG: '.modal-dialog',
    DATA_TOGGLE: '[data-toggle="modal"]',
    DATA_DISMISS: '[data-dismiss="modal"]',
    FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top',
    STICKY_CONTENT: '.sticky-top'
Mark Otto's avatar
dist    
Mark Otto committed
4619
4620
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
4621
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
4622
4623
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
4624

XhmikosR's avatar
Dist    
XhmikosR committed
4625
  };
Mark Otto's avatar
dist  
Mark Otto committed
4626

XhmikosR's avatar
Dist    
XhmikosR committed
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
  var Modal =
  /*#__PURE__*/
  function () {
    function Modal(element, config) {
      this._config = this._getConfig(config);
      this._element = element;
      this._dialog = element.querySelector(Selector$5.DIALOG);
      this._backdrop = null;
      this._isShown = false;
      this._isBodyOverflowing = false;
      this._ignoreBackdropClick = false;
      this._isTransitioning = false;
      this._scrollbarWidth = 0;
    } // Getters


    var _proto = Modal.prototype;

    // Public
    _proto.toggle = function toggle(relatedTarget) {
      return this._isShown ? this.hide() : this.show(relatedTarget);
Mark Otto's avatar
dist  
Mark Otto committed
4648
4649
    };

XhmikosR's avatar
Dist    
XhmikosR committed
4650
4651
    _proto.show = function show(relatedTarget) {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
4652

XhmikosR's avatar
Dist    
XhmikosR committed
4653
4654
4655
      if (this._isShown || this._isTransitioning) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4656

XhmikosR's avatar
Dist    
XhmikosR committed
4657
4658
4659
      if ($(this._element).hasClass(ClassName$5.FADE)) {
        this._isTransitioning = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4660

XhmikosR's avatar
Dist    
XhmikosR committed
4661
4662
4663
4664
      var showEvent = $.Event(Event$5.SHOW, {
        relatedTarget: relatedTarget
      });
      $(this._element).trigger(showEvent);
Mark Otto's avatar
dist    
Mark Otto committed
4665

XhmikosR's avatar
Dist    
XhmikosR committed
4666
4667
4668
      if (this._isShown || showEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
4669

XhmikosR's avatar
Dist    
XhmikosR committed
4670
      this._isShown = true;
Mark Otto's avatar
dist    
Mark Otto committed
4671

XhmikosR's avatar
Dist    
XhmikosR committed
4672
      this._checkScrollbar();
Mark Otto's avatar
dist    
Mark Otto committed
4673

XhmikosR's avatar
Dist    
XhmikosR committed
4674
      this._setScrollbar();
Mark Otto's avatar
dist    
Mark Otto committed
4675

XhmikosR's avatar
Dist    
XhmikosR committed
4676
      this._adjustDialog();
Mark Otto's avatar
dist  
Mark Otto committed
4677

XhmikosR's avatar
Dist    
XhmikosR committed
4678
      $(document.body).addClass(ClassName$5.OPEN);
Mark Otto's avatar
dist  
Mark Otto committed
4679

XhmikosR's avatar
Dist    
XhmikosR committed
4680
      this._setEscapeEvent();
Mark Otto's avatar
dist  
Mark Otto committed
4681

XhmikosR's avatar
Dist    
XhmikosR committed
4682
      this._setResizeEvent();
Mark Otto's avatar
dist    
Mark Otto committed
4683

XhmikosR's avatar
Dist    
XhmikosR committed
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
      $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) {
        return _this.hide(event);
      });
      $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () {
        $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) {
          if ($(event.target).is(_this._element)) {
            _this._ignoreBackdropClick = true;
          }
        });
      });
Mark Otto's avatar
dist  
Mark Otto committed
4694

XhmikosR's avatar
Dist    
XhmikosR committed
4695
4696
4697
4698
      this._showBackdrop(function () {
        return _this._showElement(relatedTarget);
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
4699

XhmikosR's avatar
Dist    
XhmikosR committed
4700
4701
    _proto.hide = function hide(event) {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4702

XhmikosR's avatar
Dist    
XhmikosR committed
4703
4704
4705
      if (event) {
        event.preventDefault();
      }
Mark Otto's avatar
dist    
Mark Otto committed
4706

XhmikosR's avatar
Dist    
XhmikosR committed
4707
4708
4709
      if (!this._isShown || this._isTransitioning) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4710

XhmikosR's avatar
Dist    
XhmikosR committed
4711
4712
      var hideEvent = $.Event(Event$5.HIDE);
      $(this._element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
4713

XhmikosR's avatar
Dist    
XhmikosR committed
4714
4715
4716
      if (!this._isShown || hideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4717

XhmikosR's avatar
Dist    
XhmikosR committed
4718
4719
      this._isShown = false;
      var transition = $(this._element).hasClass(ClassName$5.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
4720

XhmikosR's avatar
Dist    
XhmikosR committed
4721
4722
4723
      if (transition) {
        this._isTransitioning = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
4724

XhmikosR's avatar
Dist    
XhmikosR committed
4725
      this._setEscapeEvent();
Mark Otto's avatar
dist  
Mark Otto committed
4726

XhmikosR's avatar
Dist    
XhmikosR committed
4727
      this._setResizeEvent();
Mark Otto's avatar
dist  
Mark Otto committed
4728

XhmikosR's avatar
Dist    
XhmikosR committed
4729
4730
4731
4732
      $(document).off(Event$5.FOCUSIN);
      $(this._element).removeClass(ClassName$5.SHOW);
      $(this._element).off(Event$5.CLICK_DISMISS);
      $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS);
Mark Otto's avatar
dist  
Mark Otto committed
4733

XhmikosR's avatar
Dist    
XhmikosR committed
4734
4735
4736
4737
4738
4739
4740
4741
4742
      if (transition) {
        var transitionDuration = Util.getTransitionDurationFromElement(this._element);
        $(this._element).one(Util.TRANSITION_END, function (event) {
          return _this2._hideModal(event);
        }).emulateTransitionEnd(transitionDuration);
      } else {
        this._hideModal();
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
4743

XhmikosR's avatar
Dist    
XhmikosR committed
4744
4745
4746
4747
4748
4749
4750
4751
4752
    _proto.dispose = function dispose() {
      [window, this._element, this._dialog].forEach(function (htmlElement) {
        return $(htmlElement).off(EVENT_KEY$5);
      });
      /**
       * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API`
       * Do not move `document` in `htmlElements` array
       * It will remove `Event.CLICK_DATA_API` event that should remain
       */
Mark Otto's avatar
dist  
Mark Otto committed
4753

XhmikosR's avatar
Dist    
XhmikosR committed
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
      $(document).off(Event$5.FOCUSIN);
      $.removeData(this._element, DATA_KEY$5);
      this._config = null;
      this._element = null;
      this._dialog = null;
      this._backdrop = null;
      this._isShown = null;
      this._isBodyOverflowing = null;
      this._ignoreBackdropClick = null;
      this._isTransitioning = null;
      this._scrollbarWidth = null;
    };
Mark Otto's avatar
dist    
Mark Otto committed
4766

XhmikosR's avatar
Dist    
XhmikosR committed
4767
4768
4769
    _proto.handleUpdate = function handleUpdate() {
      this._adjustDialog();
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
4770
4771


XhmikosR's avatar
Dist    
XhmikosR committed
4772
4773
4774
4775
4776
    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default$3, config);
      Util.typeCheckConfig(NAME$5, config, DefaultType$3);
      return config;
    };
Mark Otto's avatar
dist  
Mark Otto committed
4777

XhmikosR's avatar
Dist    
XhmikosR committed
4778
4779
    _proto._showElement = function _showElement(relatedTarget) {
      var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4780

XhmikosR's avatar
Dist    
XhmikosR committed
4781
      var transition = $(this._element).hasClass(ClassName$5.FADE);
Mark Otto's avatar
dist  
Mark Otto committed
4782

XhmikosR's avatar
Dist    
XhmikosR committed
4783
4784
4785
4786
      if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
        // Don't move modal's DOM position
        document.body.appendChild(this._element);
      }
Mark Otto's avatar
dist  
Mark Otto committed
4787

XhmikosR's avatar
Dist    
XhmikosR committed
4788
      this._element.style.display = 'block';
Mark Otto's avatar
dist  
Mark Otto committed
4789

XhmikosR's avatar
Dist    
XhmikosR committed
4790
      this._element.removeAttribute('aria-hidden');
Mark Otto's avatar
dist  
Mark Otto committed
4791

XhmikosR's avatar
Dist    
XhmikosR committed
4792
      this._element.scrollTop = 0;
Mark Otto's avatar
dist  
Mark Otto committed
4793

XhmikosR's avatar
Dist    
XhmikosR committed
4794
4795
4796
      if (transition) {
        Util.reflow(this._element);
      }
Mark Otto's avatar
dist  
Mark Otto committed
4797

XhmikosR's avatar
Dist    
XhmikosR committed
4798
      $(this._element).addClass(ClassName$5.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
4799

XhmikosR's avatar
Dist    
XhmikosR committed
4800
4801
4802
      if (this._config.focus) {
        this._enforceFocus();
      }
Mark Otto's avatar
dist    
Mark Otto committed
4803

XhmikosR's avatar
Dist    
XhmikosR committed
4804
4805
4806
      var shownEvent = $.Event(Event$5.SHOWN, {
        relatedTarget: relatedTarget
      });
Mark Otto's avatar
dist  
Mark Otto committed
4807

XhmikosR's avatar
Dist    
XhmikosR committed
4808
4809
4810
      var transitionComplete = function transitionComplete() {
        if (_this3._config.focus) {
          _this3._element.focus();
Mark Otto's avatar
dist    
Mark Otto committed
4811
        }
Mark Otto's avatar
dist  
Mark Otto committed
4812

XhmikosR's avatar
Dist    
XhmikosR committed
4813
4814
4815
        _this3._isTransitioning = false;
        $(_this3._element).trigger(shownEvent);
      };
Mark Otto's avatar
dist  
Mark Otto committed
4816

XhmikosR's avatar
Dist    
XhmikosR committed
4817
4818
4819
4820
4821
4822
4823
      if (transition) {
        var transitionDuration = Util.getTransitionDurationFromElement(this._dialog);
        $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration);
      } else {
        transitionComplete();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
4824

XhmikosR's avatar
Dist    
XhmikosR committed
4825
4826
    _proto._enforceFocus = function _enforceFocus() {
      var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4827

XhmikosR's avatar
Dist    
XhmikosR committed
4828
4829
4830
4831
      $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop
      .on(Event$5.FOCUSIN, function (event) {
        if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) {
          _this4._element.focus();
Mark Otto's avatar
dist  
Mark Otto committed
4832
        }
XhmikosR's avatar
Dist    
XhmikosR committed
4833
4834
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
4835

XhmikosR's avatar
Dist    
XhmikosR committed
4836
4837
4838
4839
4840
4841
4842
    _proto._setEscapeEvent = function _setEscapeEvent() {
      var _this5 = this;

      if (this._isShown && this._config.keyboard) {
        $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) {
          if (event.which === ESCAPE_KEYCODE$1) {
            event.preventDefault();
Mark Otto's avatar
dist    
Mark Otto committed
4843

XhmikosR's avatar
Dist    
XhmikosR committed
4844
            _this5.hide();
Mark Otto's avatar
dist    
Mark Otto committed
4845
4846
          }
        });
XhmikosR's avatar
Dist    
XhmikosR committed
4847
4848
4849
4850
4851
4852
4853
      } else if (!this._isShown) {
        $(this._element).off(Event$5.KEYDOWN_DISMISS);
      }
    };

    _proto._setResizeEvent = function _setResizeEvent() {
      var _this6 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4854

XhmikosR's avatar
Dist    
XhmikosR committed
4855
4856
4857
4858
4859
4860
4861
4862
      if (this._isShown) {
        $(window).on(Event$5.RESIZE, function (event) {
          return _this6.handleUpdate(event);
        });
      } else {
        $(window).off(Event$5.RESIZE);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
4863

XhmikosR's avatar
Dist    
XhmikosR committed
4864
4865
    _proto._hideModal = function _hideModal() {
      var _this7 = this;
Mark Otto's avatar
dist  
Mark Otto committed
4866

XhmikosR's avatar
Dist    
XhmikosR committed
4867
      this._element.style.display = 'none';
Mark Otto's avatar
dist  
Mark Otto committed
4868

XhmikosR's avatar
Dist    
XhmikosR committed
4869
      this._element.setAttribute('aria-hidden', true);
Mark Otto's avatar
dist  
Mark Otto committed
4870

XhmikosR's avatar
Dist    
XhmikosR committed
4871
      this._isTransitioning = false;
Mark Otto's avatar
dist    
Mark Otto committed
4872

XhmikosR's avatar
Dist    
XhmikosR committed
4873
4874
      this._showBackdrop(function () {
        $(document.body).removeClass(ClassName$5.OPEN);
Mark Otto's avatar
dist  
Mark Otto committed
4875

XhmikosR's avatar
Dist    
XhmikosR committed
4876
        _this7._resetAdjustments();
Mark Otto's avatar
dist  
Mark Otto committed
4877

XhmikosR's avatar
Dist    
XhmikosR committed
4878
        _this7._resetScrollbar();
Mark Otto's avatar
dist  
Mark Otto committed
4879

XhmikosR's avatar
Dist    
XhmikosR committed
4880
4881
4882
        $(_this7._element).trigger(Event$5.HIDDEN);
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
4883

XhmikosR's avatar
Dist    
XhmikosR committed
4884
4885
4886
4887
4888
4889
    _proto._removeBackdrop = function _removeBackdrop() {
      if (this._backdrop) {
        $(this._backdrop).remove();
        this._backdrop = null;
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
4890

XhmikosR's avatar
Dist    
XhmikosR committed
4891
4892
    _proto._showBackdrop = function _showBackdrop(callback) {
      var _this8 = this;
Mark Otto's avatar
dist    
Mark Otto committed
4893

XhmikosR's avatar
Dist    
XhmikosR committed
4894
      var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : '';
Mark Otto's avatar
dist    
Mark Otto committed
4895

XhmikosR's avatar
Dist    
XhmikosR committed
4896
4897
4898
      if (this._isShown && this._config.backdrop) {
        this._backdrop = document.createElement('div');
        this._backdrop.className = ClassName$5.BACKDROP;
Mark Otto's avatar
dist    
Mark Otto committed
4899

XhmikosR's avatar
Dist    
XhmikosR committed
4900
4901
        if (animate) {
          this._backdrop.classList.add(animate);
Mark Otto's avatar
dist    
Mark Otto committed
4902
        }
Mark Otto's avatar
dist    
Mark Otto committed
4903

XhmikosR's avatar
Dist    
XhmikosR committed
4904
4905
4906
4907
4908
4909
        $(this._backdrop).appendTo(document.body);
        $(this._element).on(Event$5.CLICK_DISMISS, function (event) {
          if (_this8._ignoreBackdropClick) {
            _this8._ignoreBackdropClick = false;
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
4910

XhmikosR's avatar
Dist    
XhmikosR committed
4911
4912
4913
          if (event.target !== event.currentTarget) {
            return;
          }
Mark Otto's avatar
dist  
Mark Otto committed
4914

XhmikosR's avatar
Dist    
XhmikosR committed
4915
4916
4917
4918
          if (_this8._config.backdrop === 'static') {
            _this8._element.focus();
          } else {
            _this8.hide();
Mark Otto's avatar
dist    
Mark Otto committed
4919
          }
XhmikosR's avatar
Dist    
XhmikosR committed
4920
        });
Mark Otto's avatar
dist  
Mark Otto committed
4921

XhmikosR's avatar
Dist    
XhmikosR committed
4922
4923
4924
        if (animate) {
          Util.reflow(this._backdrop);
        }
Mark Otto's avatar
dist  
Mark Otto committed
4925

XhmikosR's avatar
Dist    
XhmikosR committed
4926
        $(this._backdrop).addClass(ClassName$5.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
4927

XhmikosR's avatar
Dist    
XhmikosR committed
4928
4929
4930
        if (!callback) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
4931

XhmikosR's avatar
Dist    
XhmikosR committed
4932
4933
4934
4935
        if (!animate) {
          callback();
          return;
        }
Mark Otto's avatar
dist    
Mark Otto committed
4936

XhmikosR's avatar
Dist    
XhmikosR committed
4937
4938
4939
4940
        var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
        $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration);
      } else if (!this._isShown && this._backdrop) {
        $(this._backdrop).removeClass(ClassName$5.SHOW);
Mark Otto's avatar
dist    
Mark Otto committed
4941

XhmikosR's avatar
Dist    
XhmikosR committed
4942
4943
        var callbackRemove = function callbackRemove() {
          _this8._removeBackdrop();
Mark Otto's avatar
dist    
Mark Otto committed
4944

XhmikosR's avatar
Dist    
XhmikosR committed
4945
          if (callback) {
Mark Otto's avatar
dist    
Mark Otto committed
4946
            callback();
Mark Otto's avatar
dist  
Mark Otto committed
4947
          }
XhmikosR's avatar
Dist    
XhmikosR committed
4948
        };
Mark Otto's avatar
dist  
Mark Otto committed
4949

XhmikosR's avatar
Dist    
XhmikosR committed
4950
4951
        if ($(this._element).hasClass(ClassName$5.FADE)) {
          var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop);
Mark Otto's avatar
dist  
Mark Otto committed
4952

XhmikosR's avatar
Dist    
XhmikosR committed
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
          $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration);
        } else {
          callbackRemove();
        }
      } else if (callback) {
        callback();
      }
    }; // ----------------------------------------------------------------------
    // the following methods are used to handle overflowing modals
    // todo (fat): these should probably be refactored out of modal.js
    // ----------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
4964
4965


XhmikosR's avatar
Dist    
XhmikosR committed
4966
4967
    _proto._adjustDialog = function _adjustDialog() {
      var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
Mark Otto's avatar
dist    
Mark Otto committed
4968

XhmikosR's avatar
Dist    
XhmikosR committed
4969
4970
4971
      if (!this._isBodyOverflowing && isModalOverflowing) {
        this._element.style.paddingLeft = this._scrollbarWidth + "px";
      }
Mark Otto's avatar
dist  
Mark Otto committed
4972

XhmikosR's avatar
Dist    
XhmikosR committed
4973
4974
4975
4976
      if (this._isBodyOverflowing && !isModalOverflowing) {
        this._element.style.paddingRight = this._scrollbarWidth + "px";
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
4977

XhmikosR's avatar
Dist    
XhmikosR committed
4978
4979
4980
4981
    _proto._resetAdjustments = function _resetAdjustments() {
      this._element.style.paddingLeft = '';
      this._element.style.paddingRight = '';
    };
Mark Otto's avatar
dist    
Mark Otto committed
4982

XhmikosR's avatar
Dist    
XhmikosR committed
4983
4984
4985
4986
4987
    _proto._checkScrollbar = function _checkScrollbar() {
      var rect = document.body.getBoundingClientRect();
      this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
      this._scrollbarWidth = this._getScrollbarWidth();
    };
Mark Otto's avatar
dist  
Mark Otto committed
4988

XhmikosR's avatar
Dist    
XhmikosR committed
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
    _proto._setScrollbar = function _setScrollbar() {
      var _this9 = this;

      if (this._isBodyOverflowing) {
        // Note: DOMNode.style.paddingRight returns the actual value or '' if not set
        //   while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set
        var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
        var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding

        $(fixedContent).each(function (index, element) {
          var actualPadding = element.style.paddingRight;
          var calculatedPadding = $(element).css('padding-right');
          $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px");
        }); // Adjust sticky content margin

        $(stickyContent).each(function (index, element) {
          var actualMargin = element.style.marginRight;
          var calculatedMargin = $(element).css('margin-right');
          $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px");
        }); // Adjust body padding

        var actualPadding = document.body.style.paddingRight;
        var calculatedPadding = $(document.body).css('padding-right');
        $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px");
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
5015

XhmikosR's avatar
Dist    
XhmikosR committed
5016
5017
5018
5019
5020
5021
5022
5023
    _proto._resetScrollbar = function _resetScrollbar() {
      // Restore fixed content padding
      var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT));
      $(fixedContent).each(function (index, element) {
        var padding = $(element).data('padding-right');
        $(element).removeData('padding-right');
        element.style.paddingRight = padding ? padding : '';
      }); // Restore sticky content
Mark Otto's avatar
dist  
Mark Otto committed
5024

XhmikosR's avatar
Dist    
XhmikosR committed
5025
5026
5027
      var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT));
      $(elements).each(function (index, element) {
        var margin = $(element).data('margin-right');
Mark Otto's avatar
dist  
Mark Otto committed
5028

XhmikosR's avatar
Dist    
XhmikosR committed
5029
5030
        if (typeof margin !== 'undefined') {
          $(element).css('margin-right', margin).removeData('margin-right');
Mark Otto's avatar
dist    
Mark Otto committed
5031
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5032
      }); // Restore body padding
Mark Otto's avatar
dist  
Mark Otto committed
5033

XhmikosR's avatar
Dist    
XhmikosR committed
5034
5035
5036
5037
      var padding = $(document.body).data('padding-right');
      $(document.body).removeData('padding-right');
      document.body.style.paddingRight = padding ? padding : '';
    };
Mark Otto's avatar
dist  
Mark Otto committed
5038

XhmikosR's avatar
Dist    
XhmikosR committed
5039
5040
5041
5042
5043
5044
5045
5046
5047
    _proto._getScrollbarWidth = function _getScrollbarWidth() {
      // thx d.walsh
      var scrollDiv = document.createElement('div');
      scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER;
      document.body.appendChild(scrollDiv);
      var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
      document.body.removeChild(scrollDiv);
      return scrollbarWidth;
    }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
5048

Mark Otto's avatar
dist  
Mark Otto committed
5049

XhmikosR's avatar
Dist    
XhmikosR committed
5050
5051
5052
    Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$5);
Mark Otto's avatar
dist  
Mark Otto committed
5053

XhmikosR's avatar
Dist    
XhmikosR committed
5054
        var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
5055

XhmikosR's avatar
Dist    
XhmikosR committed
5056
5057
5058
5059
        if (!data) {
          data = new Modal(this, _config);
          $(this).data(DATA_KEY$5, data);
        }
Mark Otto's avatar
dist    
Mark Otto committed
5060

XhmikosR's avatar
Dist    
XhmikosR committed
5061
5062
5063
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist    
Mark Otto committed
5064
          }
Mark Otto's avatar
dist  
Mark Otto committed
5065

XhmikosR's avatar
Dist    
XhmikosR committed
5066
5067
5068
5069
5070
5071
          data[config](relatedTarget);
        } else if (_config.show) {
          data.show(relatedTarget);
        }
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
5072

XhmikosR's avatar
Dist    
XhmikosR committed
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
    _createClass(Modal, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$5;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$3;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
5084

XhmikosR's avatar
Dist    
XhmikosR committed
5085
5086
5087
5088
5089
5090
5091
    return Modal;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
5092

Mark Otto's avatar
dist    
Mark Otto committed
5093

XhmikosR's avatar
Dist    
XhmikosR committed
5094
5095
  $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) {
    var _this10 = this;
Mark Otto's avatar
dist  
Mark Otto committed
5096

XhmikosR's avatar
Dist    
XhmikosR committed
5097
5098
    var target;
    var selector = Util.getSelectorFromElement(this);
Mark Otto's avatar
dist  
Mark Otto committed
5099

XhmikosR's avatar
Dist    
XhmikosR committed
5100
5101
5102
    if (selector) {
      target = document.querySelector(selector);
    }
Mark Otto's avatar
dist  
Mark Otto committed
5103

XhmikosR's avatar
Dist    
XhmikosR committed
5104
    var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data());
Mark Otto's avatar
dist  
Mark Otto committed
5105

XhmikosR's avatar
Dist    
XhmikosR committed
5106
5107
5108
    if (this.tagName === 'A' || this.tagName === 'AREA') {
      event.preventDefault();
    }
Mark Otto's avatar
dist  
Mark Otto committed
5109

XhmikosR's avatar
Dist    
XhmikosR committed
5110
5111
5112
5113
    var $target = $(target).one(Event$5.SHOW, function (showEvent) {
      if (showEvent.isDefaultPrevented()) {
        // Only register focus restorer if modal will actually get shown
        return;
Mark Otto's avatar
dist  
Mark Otto committed
5114
5115
      }

XhmikosR's avatar
Dist    
XhmikosR committed
5116
5117
5118
      $target.one(Event$5.HIDDEN, function () {
        if ($(_this10).is(':visible')) {
          _this10.focus();
Mark Otto's avatar
dist  
Mark Otto committed
5119
        }
Mark Otto's avatar
dist    
Mark Otto committed
5120
5121
      });
    });
Mark Otto's avatar
dist    
Mark Otto committed
5122

XhmikosR's avatar
Dist    
XhmikosR committed
5123
5124
5125
5126
5127
5128
5129
    Modal._jQueryInterface.call($(target), config, this);
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
5130

XhmikosR's avatar
Dist    
XhmikosR committed
5131
5132
  $.fn[NAME$5] = Modal._jQueryInterface;
  $.fn[NAME$5].Constructor = Modal;
Mark Otto's avatar
dist  
Mark Otto committed
5133

XhmikosR's avatar
Dist    
XhmikosR committed
5134
5135
5136
5137
  $.fn[NAME$5].noConflict = function () {
    $.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
    return Modal._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
5138
5139

  /**
Mark Otto's avatar
dist    
Mark Otto committed
5140
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5141
   * Bootstrap (v4.1.3): tooltip.js
Mark Otto's avatar
dist    
Mark Otto committed
5142
5143
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
5144
   */
Mark Otto's avatar
dist    
Mark Otto committed
5145

XhmikosR's avatar
Dist    
XhmikosR committed
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$6 = 'tooltip';
  var VERSION$6 = '4.1.3';
  var DATA_KEY$6 = 'bs.tooltip';
  var EVENT_KEY$6 = "." + DATA_KEY$6;
  var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6];
  var CLASS_PREFIX = 'bs-tooltip';
  var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
  var DefaultType$4 = {
    animation: 'boolean',
    template: 'string',
    title: '(string|element|function)',
    trigger: 'string',
    delay: '(number|object)',
    html: 'boolean',
    selector: '(string|boolean)',
    placement: '(string|function)',
    offset: '(number|string)',
    container: '(string|element|boolean)',
    fallbackPlacement: '(string|array)',
    boundary: '(string|element)'
  };
  var AttachmentMap$1 = {
    AUTO: 'auto',
    TOP: 'top',
    RIGHT: 'right',
    BOTTOM: 'bottom',
    LEFT: 'left'
  };
  var Default$4 = {
    animation: true,
    template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>',
    trigger: 'hover focus',
    title: '',
    delay: 0,
    html: false,
    selector: false,
    placement: 'top',
    offset: 0,
    container: false,
    fallbackPlacement: 'flip',
    boundary: 'scrollParent'
  };
  var HoverState = {
    SHOW: 'show',
    OUT: 'out'
  };
  var Event$6 = {
    HIDE: "hide" + EVENT_KEY$6,
    HIDDEN: "hidden" + EVENT_KEY$6,
    SHOW: "show" + EVENT_KEY$6,
    SHOWN: "shown" + EVENT_KEY$6,
    INSERTED: "inserted" + EVENT_KEY$6,
    CLICK: "click" + EVENT_KEY$6,
    FOCUSIN: "focusin" + EVENT_KEY$6,
    FOCUSOUT: "focusout" + EVENT_KEY$6,
    MOUSEENTER: "mouseenter" + EVENT_KEY$6,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$6
  };
  var ClassName$6 = {
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$6 = {
    TOOLTIP: '.tooltip',
    TOOLTIP_INNER: '.tooltip-inner',
    ARROW: '.arrow'
  };
  var Trigger = {
    HOVER: 'hover',
    FOCUS: 'focus',
    CLICK: 'click',
    MANUAL: 'manual'
Mark Otto's avatar
dist    
Mark Otto committed
5224
5225
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
5226
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
5227
5228
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
5229
5230
5231
5232
5233
5234
5235

  };

  var Tooltip =
  /*#__PURE__*/
  function () {
    function Tooltip(element, config) {
Mark Otto's avatar
dist    
Mark Otto committed
5236
      /**
XhmikosR's avatar
Dist    
XhmikosR committed
5237
5238
       * Check for Popper dependency
       * Popper - https://popper.js.org
Mark Otto's avatar
dist    
Mark Otto committed
5239
       */
XhmikosR's avatar
Dist    
XhmikosR committed
5240
5241
5242
      if (typeof Popper === 'undefined') {
        throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)');
      } // private
Mark Otto's avatar
dist    
Mark Otto committed
5243
5244


XhmikosR's avatar
Dist    
XhmikosR committed
5245
5246
5247
5248
5249
      this._isEnabled = true;
      this._timeout = 0;
      this._hoverState = '';
      this._activeTrigger = {};
      this._popper = null; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
5250

XhmikosR's avatar
Dist    
XhmikosR committed
5251
5252
5253
      this.element = element;
      this.config = this._getConfig(config);
      this.tip = null;
Mark Otto's avatar
dist  
Mark Otto committed
5254

XhmikosR's avatar
Dist    
XhmikosR committed
5255
5256
      this._setListeners();
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
5257
5258


XhmikosR's avatar
Dist    
XhmikosR committed
5259
    var _proto = Tooltip.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
5260

XhmikosR's avatar
Dist    
XhmikosR committed
5261
5262
5263
5264
    // Public
    _proto.enable = function enable() {
      this._isEnabled = true;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5265

XhmikosR's avatar
Dist    
XhmikosR committed
5266
5267
5268
    _proto.disable = function disable() {
      this._isEnabled = false;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5269

XhmikosR's avatar
Dist    
XhmikosR committed
5270
5271
5272
    _proto.toggleEnabled = function toggleEnabled() {
      this._isEnabled = !this._isEnabled;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5273

XhmikosR's avatar
Dist    
XhmikosR committed
5274
5275
5276
5277
    _proto.toggle = function toggle(event) {
      if (!this._isEnabled) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5278

XhmikosR's avatar
Dist    
XhmikosR committed
5279
5280
5281
      if (event) {
        var dataKey = this.constructor.DATA_KEY;
        var context = $(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5282

XhmikosR's avatar
Dist    
XhmikosR committed
5283
5284
5285
        if (!context) {
          context = new this.constructor(event.currentTarget, this._getDelegateConfig());
          $(event.currentTarget).data(dataKey, context);
Mark Otto's avatar
dist  
Mark Otto committed
5286
5287
        }

XhmikosR's avatar
Dist    
XhmikosR committed
5288
        context._activeTrigger.click = !context._activeTrigger.click;
Mark Otto's avatar
dist    
Mark Otto committed
5289

XhmikosR's avatar
Dist    
XhmikosR committed
5290
5291
        if (context._isWithActiveTrigger()) {
          context._enter(null, context);
Mark Otto's avatar
dist  
Mark Otto committed
5292
        } else {
XhmikosR's avatar
Dist    
XhmikosR committed
5293
5294
5295
5296
5297
          context._leave(null, context);
        }
      } else {
        if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) {
          this._leave(null, this);
Mark Otto's avatar
dist  
Mark Otto committed
5298

XhmikosR's avatar
Dist    
XhmikosR committed
5299
          return;
Mark Otto's avatar
dist    
Mark Otto committed
5300
        }
Mark Otto's avatar
dist  
Mark Otto committed
5301

XhmikosR's avatar
Dist    
XhmikosR committed
5302
5303
5304
        this._enter(null, this);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
5305

XhmikosR's avatar
Dist    
XhmikosR committed
5306
5307
5308
5309
5310
    _proto.dispose = function dispose() {
      clearTimeout(this._timeout);
      $.removeData(this.element, this.constructor.DATA_KEY);
      $(this.element).off(this.constructor.EVENT_KEY);
      $(this.element).closest('.modal').off('hide.bs.modal');
Mark Otto's avatar
dist  
Mark Otto committed
5311

XhmikosR's avatar
Dist    
XhmikosR committed
5312
5313
5314
      if (this.tip) {
        $(this.tip).remove();
      }
Mark Otto's avatar
dist    
Mark Otto committed
5315

XhmikosR's avatar
Dist    
XhmikosR committed
5316
5317
5318
5319
      this._isEnabled = null;
      this._timeout = null;
      this._hoverState = null;
      this._activeTrigger = null;
Mark Otto's avatar
dist  
Mark Otto committed
5320

XhmikosR's avatar
Dist    
XhmikosR committed
5321
5322
5323
      if (this._popper !== null) {
        this._popper.destroy();
      }
Mark Otto's avatar
dist  
Mark Otto committed
5324

XhmikosR's avatar
Dist    
XhmikosR committed
5325
5326
5327
5328
5329
      this._popper = null;
      this.element = null;
      this.config = null;
      this.tip = null;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5330

XhmikosR's avatar
Dist    
XhmikosR committed
5331
5332
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
5333

XhmikosR's avatar
Dist    
XhmikosR committed
5334
5335
5336
      if ($(this.element).css('display') === 'none') {
        throw new Error('Please use show on visible elements');
      }
Mark Otto's avatar
dist    
Mark Otto committed
5337

XhmikosR's avatar
Dist    
XhmikosR committed
5338
      var showEvent = $.Event(this.constructor.Event.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
5339

XhmikosR's avatar
Dist    
XhmikosR committed
5340
5341
5342
      if (this.isWithContent() && this._isEnabled) {
        $(this.element).trigger(showEvent);
        var isInTheDom = $.contains(this.element.ownerDocument.documentElement, this.element);
Mark Otto's avatar
dist  
Mark Otto committed
5343

XhmikosR's avatar
Dist    
XhmikosR committed
5344
5345
5346
        if (showEvent.isDefaultPrevented() || !isInTheDom) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5347

XhmikosR's avatar
Dist    
XhmikosR committed
5348
5349
5350
5351
5352
        var tip = this.getTipElement();
        var tipId = Util.getUID(this.constructor.NAME);
        tip.setAttribute('id', tipId);
        this.element.setAttribute('aria-describedby', tipId);
        this.setContent();
Mark Otto's avatar
dist  
Mark Otto committed
5353

XhmikosR's avatar
Dist    
XhmikosR committed
5354
5355
5356
        if (this.config.animation) {
          $(tip).addClass(ClassName$6.FADE);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5357

XhmikosR's avatar
Dist    
XhmikosR committed
5358
        var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
Mark Otto's avatar
dist  
Mark Otto committed
5359

XhmikosR's avatar
Dist    
XhmikosR committed
5360
        var attachment = this._getAttachment(placement);
Mark Otto's avatar
dist  
Mark Otto committed
5361

XhmikosR's avatar
Dist    
XhmikosR committed
5362
5363
5364
        this.addAttachmentClass(attachment);
        var container = this.config.container === false ? document.body : $(document).find(this.config.container);
        $(tip).data(this.constructor.DATA_KEY, this);
Mark Otto's avatar
dist  
Mark Otto committed
5365

XhmikosR's avatar
Dist    
XhmikosR committed
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
        if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) {
          $(tip).appendTo(container);
        }

        $(this.element).trigger(this.constructor.Event.INSERTED);
        this._popper = new Popper(this.element, tip, {
          placement: attachment,
          modifiers: {
            offset: {
              offset: this.config.offset
Mark Otto's avatar
dist  
Mark Otto committed
5376
            },
XhmikosR's avatar
Dist    
XhmikosR committed
5377
5378
5379
5380
5381
            flip: {
              behavior: this.config.fallbackPlacement
            },
            arrow: {
              element: Selector$6.ARROW
Mark Otto's avatar
dist    
Mark Otto committed
5382
            },
XhmikosR's avatar
Dist    
XhmikosR committed
5383
5384
5385
5386
5387
5388
            preventOverflow: {
              boundariesElement: this.config.boundary
            }
          },
          onCreate: function onCreate(data) {
            if (data.originalPlacement !== data.placement) {
Mark Otto's avatar
dist  
Mark Otto committed
5389
5390
              _this._handlePopperPlacementChange(data);
            }
XhmikosR's avatar
Dist    
XhmikosR committed
5391
5392
5393
          },
          onUpdate: function onUpdate(data) {
            _this._handlePopperPlacementChange(data);
Mark Otto's avatar
dist  
Mark Otto committed
5394
          }
XhmikosR's avatar
Dist    
XhmikosR committed
5395
5396
5397
5398
5399
        });
        $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra
        // empty mouseover listeners to the body's immediate children;
        // only needed because of broken event delegation on iOS
        // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html
Mark Otto's avatar
dist    
Mark Otto committed
5400

XhmikosR's avatar
Dist    
XhmikosR committed
5401
5402
5403
        if ('ontouchstart' in document.documentElement) {
          $(document.body).children().on('mouseover', null, $.noop);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5404

XhmikosR's avatar
Dist    
XhmikosR committed
5405
5406
5407
5408
        var complete = function complete() {
          if (_this.config.animation) {
            _this._fixTransition();
          }
Mark Otto's avatar
dist    
Mark Otto committed
5409

XhmikosR's avatar
Dist    
XhmikosR committed
5410
5411
5412
          var prevHoverState = _this._hoverState;
          _this._hoverState = null;
          $(_this.element).trigger(_this.constructor.Event.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
5413

XhmikosR's avatar
Dist    
XhmikosR committed
5414
5415
          if (prevHoverState === HoverState.OUT) {
            _this._leave(null, _this);
Mark Otto's avatar
dist  
Mark Otto committed
5416
          }
XhmikosR's avatar
Dist    
XhmikosR committed
5417
5418
5419
5420
5421
5422
5423
        };

        if ($(this.tip).hasClass(ClassName$6.FADE)) {
          var transitionDuration = Util.getTransitionDurationFromElement(this.tip);
          $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        } else {
          complete();
Mark Otto's avatar
dist  
Mark Otto committed
5424
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5425
5426
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
5427

XhmikosR's avatar
Dist    
XhmikosR committed
5428
5429
    _proto.hide = function hide(callback) {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
5430

XhmikosR's avatar
Dist    
XhmikosR committed
5431
5432
      var tip = this.getTipElement();
      var hideEvent = $.Event(this.constructor.Event.HIDE);
Mark Otto's avatar
dist    
Mark Otto committed
5433

XhmikosR's avatar
Dist    
XhmikosR committed
5434
5435
5436
5437
      var complete = function complete() {
        if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) {
          tip.parentNode.removeChild(tip);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5438

XhmikosR's avatar
Dist    
XhmikosR committed
5439
        _this2._cleanTipClass();
Mark Otto's avatar
dist    
Mark Otto committed
5440

XhmikosR's avatar
Dist    
XhmikosR committed
5441
        _this2.element.removeAttribute('aria-describedby');
Mark Otto's avatar
dist    
Mark Otto committed
5442

XhmikosR's avatar
Dist    
XhmikosR committed
5443
        $(_this2.element).trigger(_this2.constructor.Event.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
5444

XhmikosR's avatar
Dist    
XhmikosR committed
5445
5446
5447
        if (_this2._popper !== null) {
          _this2._popper.destroy();
        }
Mark Otto's avatar
dist  
Mark Otto committed
5448

XhmikosR's avatar
Dist    
XhmikosR committed
5449
5450
5451
5452
        if (callback) {
          callback();
        }
      };
Mark Otto's avatar
dist  
Mark Otto committed
5453

XhmikosR's avatar
Dist    
XhmikosR committed
5454
      $(this.element).trigger(hideEvent);
Mark Otto's avatar
dist  
Mark Otto committed
5455

XhmikosR's avatar
Dist    
XhmikosR committed
5456
5457
5458
      if (hideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5459

XhmikosR's avatar
Dist    
XhmikosR committed
5460
5461
      $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra
      // empty mouseover listeners we added for iOS support
Mark Otto's avatar
dist    
Mark Otto committed
5462

XhmikosR's avatar
Dist    
XhmikosR committed
5463
5464
5465
      if ('ontouchstart' in document.documentElement) {
        $(document.body).children().off('mouseover', null, $.noop);
      }
Mark Otto's avatar
dist  
Mark Otto committed
5466

XhmikosR's avatar
Dist    
XhmikosR committed
5467
5468
5469
      this._activeTrigger[Trigger.CLICK] = false;
      this._activeTrigger[Trigger.FOCUS] = false;
      this._activeTrigger[Trigger.HOVER] = false;
Mark Otto's avatar
dist  
Mark Otto committed
5470

XhmikosR's avatar
Dist    
XhmikosR committed
5471
5472
5473
5474
5475
5476
      if ($(this.tip).hasClass(ClassName$6.FADE)) {
        var transitionDuration = Util.getTransitionDurationFromElement(tip);
        $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      } else {
        complete();
      }
Mark Otto's avatar
dist  
Mark Otto committed
5477

XhmikosR's avatar
Dist    
XhmikosR committed
5478
5479
      this._hoverState = '';
    };
Mark Otto's avatar
dist  
Mark Otto committed
5480

XhmikosR's avatar
Dist    
XhmikosR committed
5481
5482
5483
5484
5485
    _proto.update = function update() {
      if (this._popper !== null) {
        this._popper.scheduleUpdate();
      }
    }; // Protected
Mark Otto's avatar
dist  
Mark Otto committed
5486
5487


XhmikosR's avatar
Dist    
XhmikosR committed
5488
5489
5490
    _proto.isWithContent = function isWithContent() {
      return Boolean(this.getTitle());
    };
Mark Otto's avatar
dist  
Mark Otto committed
5491

XhmikosR's avatar
Dist    
XhmikosR committed
5492
5493
5494
    _proto.addAttachmentClass = function addAttachmentClass(attachment) {
      $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment);
    };
Mark Otto's avatar
dist  
Mark Otto committed
5495

XhmikosR's avatar
Dist    
XhmikosR committed
5496
5497
5498
5499
    _proto.getTipElement = function getTipElement() {
      this.tip = this.tip || $(this.config.template)[0];
      return this.tip;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5500

XhmikosR's avatar
Dist    
XhmikosR committed
5501
5502
5503
5504
5505
    _proto.setContent = function setContent() {
      var tip = this.getTipElement();
      this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle());
      $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW);
    };
Mark Otto's avatar
dist  
Mark Otto committed
5506

XhmikosR's avatar
Dist    
XhmikosR committed
5507
5508
    _proto.setElementContent = function setElementContent($element, content) {
      var html = this.config.html;
Mark Otto's avatar
dist    
Mark Otto committed
5509

XhmikosR's avatar
Dist    
XhmikosR committed
5510
5511
5512
5513
5514
      if (typeof content === 'object' && (content.nodeType || content.jquery)) {
        // Content is a DOM node or a jQuery
        if (html) {
          if (!$(content).parent().is($element)) {
            $element.empty().append(content);
Mark Otto's avatar
dist  
Mark Otto committed
5515
5516
          }
        } else {
XhmikosR's avatar
Dist    
XhmikosR committed
5517
          $element.text($(content).text());
Mark Otto's avatar
dist  
Mark Otto committed
5518
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5519
5520
5521
5522
      } else {
        $element[html ? 'html' : 'text'](content);
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
5523

XhmikosR's avatar
Dist    
XhmikosR committed
5524
5525
    _proto.getTitle = function getTitle() {
      var title = this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist  
Mark Otto committed
5526

XhmikosR's avatar
Dist    
XhmikosR committed
5527
5528
5529
      if (!title) {
        title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5530

XhmikosR's avatar
Dist    
XhmikosR committed
5531
5532
      return title;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5533
5534


XhmikosR's avatar
Dist    
XhmikosR committed
5535
5536
5537
    _proto._getAttachment = function _getAttachment(placement) {
      return AttachmentMap$1[placement.toUpperCase()];
    };
Mark Otto's avatar
dist    
Mark Otto committed
5538

XhmikosR's avatar
Dist    
XhmikosR committed
5539
5540
    _proto._setListeners = function _setListeners() {
      var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
5541

XhmikosR's avatar
Dist    
XhmikosR committed
5542
5543
5544
5545
5546
      var triggers = this.config.trigger.split(' ');
      triggers.forEach(function (trigger) {
        if (trigger === 'click') {
          $(_this3.element).on(_this3.constructor.Event.CLICK, _this3.config.selector, function (event) {
            return _this3.toggle(event);
Mark Otto's avatar
dist  
Mark Otto committed
5547
          });
XhmikosR's avatar
Dist    
XhmikosR committed
5548
5549
5550
5551
5552
5553
5554
        } else if (trigger !== Trigger.MANUAL) {
          var eventIn = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSEENTER : _this3.constructor.Event.FOCUSIN;
          var eventOut = trigger === Trigger.HOVER ? _this3.constructor.Event.MOUSELEAVE : _this3.constructor.Event.FOCUSOUT;
          $(_this3.element).on(eventIn, _this3.config.selector, function (event) {
            return _this3._enter(event);
          }).on(eventOut, _this3.config.selector, function (event) {
            return _this3._leave(event);
Mark Otto's avatar
dist  
Mark Otto committed
5555
5556
          });
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5557
5558
5559
5560
5561
5562
      });
      $(this.element).closest('.modal').on('hide.bs.modal', function () {
        if (_this3.element) {
          _this3.hide();
        }
      });
Mark Otto's avatar
dist  
Mark Otto committed
5563

XhmikosR's avatar
Dist    
XhmikosR committed
5564
5565
5566
5567
5568
5569
5570
5571
5572
      if (this.config.selector) {
        this.config = _objectSpread({}, this.config, {
          trigger: 'manual',
          selector: ''
        });
      } else {
        this._fixTitle();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
5573

XhmikosR's avatar
Dist    
XhmikosR committed
5574
5575
    _proto._fixTitle = function _fixTitle() {
      var titleType = typeof this.element.getAttribute('data-original-title');
Mark Otto's avatar
dist    
Mark Otto committed
5576

XhmikosR's avatar
Dist    
XhmikosR committed
5577
5578
5579
5580
5581
      if (this.element.getAttribute('title') || titleType !== 'string') {
        this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
        this.element.setAttribute('title', '');
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
5582

XhmikosR's avatar
Dist    
XhmikosR committed
5583
5584
5585
    _proto._enter = function _enter(event, context) {
      var dataKey = this.constructor.DATA_KEY;
      context = context || $(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5586

XhmikosR's avatar
Dist    
XhmikosR committed
5587
5588
5589
5590
      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
        $(event.currentTarget).data(dataKey, context);
      }
Mark Otto's avatar
dist  
Mark Otto committed
5591

XhmikosR's avatar
Dist    
XhmikosR committed
5592
5593
5594
      if (event) {
        context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5595

XhmikosR's avatar
Dist    
XhmikosR committed
5596
      if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) {
Mark Otto's avatar
dist  
Mark Otto committed
5597
        context._hoverState = HoverState.SHOW;
XhmikosR's avatar
Dist    
XhmikosR committed
5598
5599
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5600

XhmikosR's avatar
Dist    
XhmikosR committed
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
      clearTimeout(context._timeout);
      context._hoverState = HoverState.SHOW;

      if (!context.config.delay || !context.config.delay.show) {
        context.show();
        return;
      }

      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.SHOW) {
Mark Otto's avatar
dist  
Mark Otto committed
5611
5612
          context.show();
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5613
5614
      }, context.config.delay.show);
    };
Mark Otto's avatar
dist  
Mark Otto committed
5615

XhmikosR's avatar
Dist    
XhmikosR committed
5616
5617
5618
    _proto._leave = function _leave(event, context) {
      var dataKey = this.constructor.DATA_KEY;
      context = context || $(event.currentTarget).data(dataKey);
Mark Otto's avatar
dist  
Mark Otto committed
5619

XhmikosR's avatar
Dist    
XhmikosR committed
5620
5621
5622
5623
      if (!context) {
        context = new this.constructor(event.currentTarget, this._getDelegateConfig());
        $(event.currentTarget).data(dataKey, context);
      }
Mark Otto's avatar
dist  
Mark Otto committed
5624

XhmikosR's avatar
Dist    
XhmikosR committed
5625
5626
5627
      if (event) {
        context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5628

XhmikosR's avatar
Dist    
XhmikosR committed
5629
5630
5631
      if (context._isWithActiveTrigger()) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5632

XhmikosR's avatar
Dist    
XhmikosR committed
5633
5634
      clearTimeout(context._timeout);
      context._hoverState = HoverState.OUT;
Mark Otto's avatar
dist  
Mark Otto committed
5635

XhmikosR's avatar
Dist    
XhmikosR committed
5636
5637
5638
5639
      if (!context.config.delay || !context.config.delay.hide) {
        context.hide();
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
5640

XhmikosR's avatar
Dist    
XhmikosR committed
5641
5642
      context._timeout = setTimeout(function () {
        if (context._hoverState === HoverState.OUT) {
Mark Otto's avatar
dist  
Mark Otto committed
5643
5644
          context.hide();
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5645
5646
      }, context.config.delay.hide);
    };
Mark Otto's avatar
dist  
Mark Otto committed
5647

XhmikosR's avatar
Dist    
XhmikosR committed
5648
5649
5650
5651
    _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
      for (var trigger in this._activeTrigger) {
        if (this._activeTrigger[trigger]) {
          return true;
Mark Otto's avatar
dist  
Mark Otto committed
5652
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5653
      }
Mark Otto's avatar
dist  
Mark Otto committed
5654

XhmikosR's avatar
Dist    
XhmikosR committed
5655
5656
      return false;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5657

XhmikosR's avatar
Dist    
XhmikosR committed
5658
5659
    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, this.constructor.Default, $(this.element).data(), typeof config === 'object' && config ? config : {});
Mark Otto's avatar
dist  
Mark Otto committed
5660

XhmikosR's avatar
Dist    
XhmikosR committed
5661
5662
5663
5664
5665
5666
      if (typeof config.delay === 'number') {
        config.delay = {
          show: config.delay,
          hide: config.delay
        };
      }
Mark Otto's avatar
dist  
Mark Otto committed
5667

XhmikosR's avatar
Dist    
XhmikosR committed
5668
5669
5670
      if (typeof config.title === 'number') {
        config.title = config.title.toString();
      }
Mark Otto's avatar
dist  
Mark Otto committed
5671

XhmikosR's avatar
Dist    
XhmikosR committed
5672
5673
5674
      if (typeof config.content === 'number') {
        config.content = config.content.toString();
      }
Mark Otto's avatar
dist  
Mark Otto committed
5675

XhmikosR's avatar
Dist    
XhmikosR committed
5676
5677
5678
      Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType);
      return config;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5679

XhmikosR's avatar
Dist    
XhmikosR committed
5680
5681
    _proto._getDelegateConfig = function _getDelegateConfig() {
      var config = {};
Mark Otto's avatar
dist  
Mark Otto committed
5682

XhmikosR's avatar
Dist    
XhmikosR committed
5683
5684
5685
5686
      if (this.config) {
        for (var key in this.config) {
          if (this.constructor.Default[key] !== this.config[key]) {
            config[key] = this.config[key];
Mark Otto's avatar
dist  
Mark Otto committed
5687
5688
          }
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5689
      }
Mark Otto's avatar
dist  
Mark Otto committed
5690

XhmikosR's avatar
Dist    
XhmikosR committed
5691
5692
      return config;
    };
Mark Otto's avatar
dist    
Mark Otto committed
5693

XhmikosR's avatar
Dist    
XhmikosR committed
5694
5695
5696
    _proto._cleanTipClass = function _cleanTipClass() {
      var $tip = $(this.getTipElement());
      var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX);
Mark Otto's avatar
dist  
Mark Otto committed
5697

XhmikosR's avatar
Dist    
XhmikosR committed
5698
5699
5700
5701
      if (tabClass !== null && tabClass.length) {
        $tip.removeClass(tabClass.join(''));
      }
    };
Mark Otto's avatar
dist    
Mark Otto committed
5702

XhmikosR's avatar
Dist    
XhmikosR committed
5703
5704
5705
    _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
      var popperInstance = popperData.instance;
      this.tip = popperInstance.popper;
Mark Otto's avatar
dist    
Mark Otto committed
5706

XhmikosR's avatar
Dist    
XhmikosR committed
5707
      this._cleanTipClass();
Mark Otto's avatar
dist  
Mark Otto committed
5708

XhmikosR's avatar
Dist    
XhmikosR committed
5709
5710
      this.addAttachmentClass(this._getAttachment(popperData.placement));
    };
Mark Otto's avatar
dist    
Mark Otto committed
5711

XhmikosR's avatar
Dist    
XhmikosR committed
5712
5713
5714
    _proto._fixTransition = function _fixTransition() {
      var tip = this.getTipElement();
      var initConfigAnimation = this.config.animation;
Mark Otto's avatar
dist    
Mark Otto committed
5715

XhmikosR's avatar
Dist    
XhmikosR committed
5716
5717
5718
      if (tip.getAttribute('x-placement') !== null) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
5719

XhmikosR's avatar
Dist    
XhmikosR committed
5720
5721
5722
5723
5724
5725
      $(tip).removeClass(ClassName$6.FADE);
      this.config.animation = false;
      this.hide();
      this.show();
      this.config.animation = initConfigAnimation;
    }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
5726
5727


XhmikosR's avatar
Dist    
XhmikosR committed
5728
5729
5730
    Tooltip._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$6);
Mark Otto's avatar
dist    
Mark Otto committed
5731

XhmikosR's avatar
Dist    
XhmikosR committed
5732
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
5733

XhmikosR's avatar
Dist    
XhmikosR committed
5734
5735
5736
        if (!data && /dispose|hide/.test(config)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5737

XhmikosR's avatar
Dist    
XhmikosR committed
5738
5739
5740
5741
        if (!data) {
          data = new Tooltip(this, _config);
          $(this).data(DATA_KEY$6, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5742

XhmikosR's avatar
Dist    
XhmikosR committed
5743
5744
5745
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
5746
          }
Mark Otto's avatar
dist    
Mark Otto committed
5747

XhmikosR's avatar
Dist    
XhmikosR committed
5748
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
5749
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5750
5751
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
5752

XhmikosR's avatar
Dist    
XhmikosR committed
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
    _createClass(Tooltip, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$6;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$4;
      }
    }, {
      key: "NAME",
      get: function get() {
        return NAME$6;
      }
    }, {
      key: "DATA_KEY",
      get: function get() {
        return DATA_KEY$6;
      }
    }, {
      key: "Event",
      get: function get() {
        return Event$6;
      }
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY$6;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$4;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
5789

XhmikosR's avatar
Dist    
XhmikosR committed
5790
5791
5792
5793
5794
5795
5796
    return Tooltip;
  }();
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
5797

Mark Otto's avatar
dist  
Mark Otto committed
5798

XhmikosR's avatar
Dist    
XhmikosR committed
5799
5800
  $.fn[NAME$6] = Tooltip._jQueryInterface;
  $.fn[NAME$6].Constructor = Tooltip;
Mark Otto's avatar
dist  
Mark Otto committed
5801

XhmikosR's avatar
Dist    
XhmikosR committed
5802
5803
5804
5805
  $.fn[NAME$6].noConflict = function () {
    $.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
5806
5807

  /**
Mark Otto's avatar
dist    
Mark Otto committed
5808
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
5809
   * Bootstrap (v4.1.3): popover.js
Mark Otto's avatar
dist    
Mark Otto committed
5810
5811
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
5812
   */
Mark Otto's avatar
dist    
Mark Otto committed
5813

XhmikosR's avatar
Dist    
XhmikosR committed
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$7 = 'popover';
  var VERSION$7 = '4.1.3';
  var DATA_KEY$7 = 'bs.popover';
  var EVENT_KEY$7 = "." + DATA_KEY$7;
  var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7];
  var CLASS_PREFIX$1 = 'bs-popover';
  var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');

  var Default$5 = _objectSpread({}, Tooltip.Default, {
    placement: 'right',
    trigger: 'click',
    content: '',
    template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
  });

  var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, {
    content: '(string|element|function)'
  });

  var ClassName$7 = {
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$7 = {
    TITLE: '.popover-header',
    CONTENT: '.popover-body'
  };
  var Event$7 = {
    HIDE: "hide" + EVENT_KEY$7,
    HIDDEN: "hidden" + EVENT_KEY$7,
    SHOW: "show" + EVENT_KEY$7,
    SHOWN: "shown" + EVENT_KEY$7,
    INSERTED: "inserted" + EVENT_KEY$7,
    CLICK: "click" + EVENT_KEY$7,
    FOCUSIN: "focusin" + EVENT_KEY$7,
    FOCUSOUT: "focusout" + EVENT_KEY$7,
    MOUSEENTER: "mouseenter" + EVENT_KEY$7,
    MOUSELEAVE: "mouseleave" + EVENT_KEY$7
Mark Otto's avatar
dist    
Mark Otto committed
5858
5859
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
5860
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
5861
5862
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
5863

XhmikosR's avatar
Dist    
XhmikosR committed
5864
  };
Mark Otto's avatar
dist  
Mark Otto committed
5865

XhmikosR's avatar
Dist    
XhmikosR committed
5866
5867
5868
5869
  var Popover =
  /*#__PURE__*/
  function (_Tooltip) {
    _inheritsLoose(Popover, _Tooltip);
Mark Otto's avatar
dist  
Mark Otto committed
5870

XhmikosR's avatar
Dist    
XhmikosR committed
5871
5872
5873
    function Popover() {
      return _Tooltip.apply(this, arguments) || this;
    }
Mark Otto's avatar
Mark Otto committed
5874

XhmikosR's avatar
Dist    
XhmikosR committed
5875
    var _proto = Popover.prototype;
Mark Otto's avatar
Mark Otto committed
5876

XhmikosR's avatar
Dist    
XhmikosR committed
5877
5878
5879
5880
    // Overrides
    _proto.isWithContent = function isWithContent() {
      return this.getTitle() || this._getContent();
    };
Mark Otto's avatar
dist    
Mark Otto committed
5881

XhmikosR's avatar
Dist    
XhmikosR committed
5882
5883
5884
    _proto.addAttachmentClass = function addAttachmentClass(attachment) {
      $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment);
    };
Mark Otto's avatar
Mark Otto committed
5885

XhmikosR's avatar
Dist    
XhmikosR committed
5886
5887
5888
5889
    _proto.getTipElement = function getTipElement() {
      this.tip = this.tip || $(this.config.template)[0];
      return this.tip;
    };
Mark Otto's avatar
dist  
Mark Otto committed
5890

XhmikosR's avatar
Dist    
XhmikosR committed
5891
5892
    _proto.setContent = function setContent() {
      var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events
Mark Otto's avatar
dist  
Mark Otto committed
5893

XhmikosR's avatar
Dist    
XhmikosR committed
5894
      this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle());
Mark Otto's avatar
dist  
Mark Otto committed
5895

XhmikosR's avatar
Dist    
XhmikosR committed
5896
      var content = this._getContent();
Mark Otto's avatar
dist    
Mark Otto committed
5897

XhmikosR's avatar
Dist    
XhmikosR committed
5898
5899
5900
      if (typeof content === 'function') {
        content = content.call(this.element);
      }
Mark Otto's avatar
dist    
Mark Otto committed
5901

XhmikosR's avatar
Dist    
XhmikosR committed
5902
5903
5904
      this.setElementContent($tip.find(Selector$7.CONTENT), content);
      $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW);
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
5905
5906


XhmikosR's avatar
Dist    
XhmikosR committed
5907
5908
5909
    _proto._getContent = function _getContent() {
      return this.element.getAttribute('data-content') || this.config.content;
    };
Mark Otto's avatar
dist    
Mark Otto committed
5910

XhmikosR's avatar
Dist    
XhmikosR committed
5911
5912
5913
    _proto._cleanTipClass = function _cleanTipClass() {
      var $tip = $(this.getTipElement());
      var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1);
Mark Otto's avatar
dist  
Mark Otto committed
5914

XhmikosR's avatar
Dist    
XhmikosR committed
5915
5916
5917
5918
      if (tabClass !== null && tabClass.length > 0) {
        $tip.removeClass(tabClass.join(''));
      }
    }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
5919
5920


XhmikosR's avatar
Dist    
XhmikosR committed
5921
5922
5923
    Popover._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$7);
Mark Otto's avatar
dist    
Mark Otto committed
5924

XhmikosR's avatar
Dist    
XhmikosR committed
5925
        var _config = typeof config === 'object' ? config : null;
Mark Otto's avatar
dist    
Mark Otto committed
5926

XhmikosR's avatar
Dist    
XhmikosR committed
5927
5928
5929
        if (!data && /dispose|hide/.test(config)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
5930

XhmikosR's avatar
Dist    
XhmikosR committed
5931
5932
5933
5934
        if (!data) {
          data = new Popover(this, _config);
          $(this).data(DATA_KEY$7, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
5935

XhmikosR's avatar
Dist    
XhmikosR committed
5936
5937
5938
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist  
Mark Otto committed
5939
          }
Mark Otto's avatar
dist    
Mark Otto committed
5940

XhmikosR's avatar
Dist    
XhmikosR committed
5941
          data[config]();
Mark Otto's avatar
dist    
Mark Otto committed
5942
        }
XhmikosR's avatar
Dist    
XhmikosR committed
5943
5944
      });
    };
Mark Otto's avatar
dist  
Mark Otto committed
5945

XhmikosR's avatar
Dist    
XhmikosR committed
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
    _createClass(Popover, null, [{
      key: "VERSION",
      // Getters
      get: function get() {
        return VERSION$7;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$5;
      }
    }, {
      key: "NAME",
      get: function get() {
        return NAME$7;
      }
    }, {
      key: "DATA_KEY",
      get: function get() {
        return DATA_KEY$7;
      }
    }, {
      key: "Event",
      get: function get() {
        return Event$7;
      }
    }, {
      key: "EVENT_KEY",
      get: function get() {
        return EVENT_KEY$7;
      }
    }, {
      key: "DefaultType",
      get: function get() {
        return DefaultType$5;
      }
    }]);
Mark Otto's avatar
dist    
Mark Otto committed
5983

XhmikosR's avatar
Dist    
XhmikosR committed
5984
5985
5986
5987
5988
5989
5990
    return Popover;
  }(Tooltip);
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
5991

Mark Otto's avatar
dist  
Mark Otto committed
5992

XhmikosR's avatar
Dist    
XhmikosR committed
5993
5994
  $.fn[NAME$7] = Popover._jQueryInterface;
  $.fn[NAME$7].Constructor = Popover;
Mark Otto's avatar
dist  
Mark Otto committed
5995

XhmikosR's avatar
Dist    
XhmikosR committed
5996
5997
5998
5999
  $.fn[NAME$7].noConflict = function () {
    $.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6000
6001

  /**
Mark Otto's avatar
dist    
Mark Otto committed
6002
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6003
   * Bootstrap (v4.1.3): scrollspy.js
Mark Otto's avatar
dist    
Mark Otto committed
6004
6005
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
6006
   */
Mark Otto's avatar
dist    
Mark Otto committed
6007

XhmikosR's avatar
Dist    
XhmikosR committed
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */

  var NAME$8 = 'scrollspy';
  var VERSION$8 = '4.1.3';
  var DATA_KEY$8 = 'bs.scrollspy';
  var EVENT_KEY$8 = "." + DATA_KEY$8;
  var DATA_API_KEY$6 = '.data-api';
  var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8];
  var Default$6 = {
    offset: 10,
    method: 'auto',
    target: ''
  };
  var DefaultType$6 = {
    offset: 'number',
    method: 'string',
    target: '(string|element)'
  };
  var Event$8 = {
    ACTIVATE: "activate" + EVENT_KEY$8,
    SCROLL: "scroll" + EVENT_KEY$8,
    LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6
  };
  var ClassName$8 = {
    DROPDOWN_ITEM: 'dropdown-item',
    DROPDOWN_MENU: 'dropdown-menu',
    ACTIVE: 'active'
  };
  var Selector$8 = {
    DATA_SPY: '[data-spy="scroll"]',
    ACTIVE: '.active',
    NAV_LIST_GROUP: '.nav, .list-group',
    NAV_LINKS: '.nav-link',
    NAV_ITEMS: '.nav-item',
    LIST_ITEMS: '.list-group-item',
    DROPDOWN: '.dropdown',
    DROPDOWN_ITEMS: '.dropdown-item',
    DROPDOWN_TOGGLE: '.dropdown-toggle'
  };
  var OffsetMethod = {
    OFFSET: 'offset',
    POSITION: 'position'
Mark Otto's avatar
dist    
Mark Otto committed
6054
6055
    /**
     * ------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
6056
     * Class Definition
Mark Otto's avatar
dist    
Mark Otto committed
6057
6058
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124

  };

  var ScrollSpy =
  /*#__PURE__*/
  function () {
    function ScrollSpy(element, config) {
      var _this = this;

      this._element = element;
      this._scrollElement = element.tagName === 'BODY' ? window : element;
      this._config = this._getConfig(config);
      this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS);
      this._offsets = [];
      this._targets = [];
      this._activeTarget = null;
      this._scrollHeight = 0;
      $(this._scrollElement).on(Event$8.SCROLL, function (event) {
        return _this._process(event);
      });
      this.refresh();

      this._process();
    } // Getters


    var _proto = ScrollSpy.prototype;

    // Public
    _proto.refresh = function refresh() {
      var _this2 = this;

      var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION;
      var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
      var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0;
      this._offsets = [];
      this._targets = [];
      this._scrollHeight = this._getScrollHeight();
      var targets = [].slice.call(document.querySelectorAll(this._selector));
      targets.map(function (element) {
        var target;
        var targetSelector = Util.getSelectorFromElement(element);

        if (targetSelector) {
          target = document.querySelector(targetSelector);
        }

        if (target) {
          var targetBCR = target.getBoundingClientRect();

          if (targetBCR.width || targetBCR.height) {
            // TODO (fat): remove sketch reliance on jQuery position/offset
            return [$(target)[offsetMethod]().top + offsetBase, targetSelector];
          }
        }

        return null;
      }).filter(function (item) {
        return item;
      }).sort(function (a, b) {
        return a[0] - b[0];
      }).forEach(function (item) {
        _this2._offsets.push(item[0]);

        _this2._targets.push(item[1]);
      });
Mark Otto's avatar
dist    
Mark Otto committed
6125
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156

    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$8);
      $(this._scrollElement).off(EVENT_KEY$8);
      this._element = null;
      this._scrollElement = null;
      this._config = null;
      this._selector = null;
      this._offsets = null;
      this._targets = null;
      this._activeTarget = null;
      this._scrollHeight = null;
    }; // Private


    _proto._getConfig = function _getConfig(config) {
      config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {});

      if (typeof config.target !== 'string') {
        var id = $(config.target).attr('id');

        if (!id) {
          id = Util.getUID(NAME$8);
          $(config.target).attr('id', id);
        }

        config.target = "#" + id;
      }

      Util.typeCheckConfig(NAME$8, config, DefaultType$6);
      return config;
Mark Otto's avatar
dist    
Mark Otto committed
6157
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6158
6159
6160

    _proto._getScrollTop = function _getScrollTop() {
      return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
Mark Otto's avatar
dist    
Mark Otto committed
6161
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6162
6163
6164

    _proto._getScrollHeight = function _getScrollHeight() {
      return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
Mark Otto's avatar
dist    
Mark Otto committed
6165
    };
Mark Otto's avatar
dist  
Mark Otto committed
6166

XhmikosR's avatar
Dist    
XhmikosR committed
6167
6168
    _proto._getOffsetHeight = function _getOffsetHeight() {
      return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
Mark Otto's avatar
dist    
Mark Otto committed
6169
    };
Mark Otto's avatar
dist  
Mark Otto committed
6170

XhmikosR's avatar
Dist    
XhmikosR committed
6171
6172
    _proto._process = function _process() {
      var scrollTop = this._getScrollTop() + this._config.offset;
Mark Otto's avatar
dist    
Mark Otto committed
6173

XhmikosR's avatar
Dist    
XhmikosR committed
6174
6175
6176
6177
6178
      var scrollHeight = this._getScrollHeight();

      var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();

      if (this._scrollHeight !== scrollHeight) {
Mark Otto's avatar
dist    
Mark Otto committed
6179
        this.refresh();
XhmikosR's avatar
Dist    
XhmikosR committed
6180
      }
Mark Otto's avatar
dist    
Mark Otto committed
6181

XhmikosR's avatar
Dist    
XhmikosR committed
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
      if (scrollTop >= maxScroll) {
        var target = this._targets[this._targets.length - 1];

        if (this._activeTarget !== target) {
          this._activate(target);
        }

        return;
      }

      if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {
        this._activeTarget = null;

        this._clear();

        return;
      }

      var offsetLength = this._offsets.length;

      for (var i = offsetLength; i--;) {
        var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]);

        if (isActiveTarget) {
          this._activate(this._targets[i]);
        }
      }
    };

    _proto._activate = function _activate(target) {
      this._activeTarget = target;

      this._clear();
Mark Otto's avatar
dist  
Mark Otto committed
6215

XhmikosR's avatar
Dist    
XhmikosR committed
6216
      var queries = this._selector.split(','); // eslint-disable-next-line arrow-body-style
Mark Otto's avatar
dist  
Mark Otto committed
6217
6218


XhmikosR's avatar
Dist    
XhmikosR committed
6219
6220
6221
6222
      queries = queries.map(function (selector) {
        return selector + "[data-target=\"" + target + "\"]," + (selector + "[href=\"" + target + "\"]");
      });
      var $link = $([].slice.call(document.querySelectorAll(queries.join(','))));
Mark Otto's avatar
dist  
Mark Otto committed
6223

XhmikosR's avatar
Dist    
XhmikosR committed
6224
6225
6226
6227
6228
6229
6230
      if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) {
        $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE);
        $link.addClass(ClassName$8.ACTIVE);
      } else {
        // Set triggered link as active
        $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
Mark Otto's avatar
dist  
Mark Otto committed
6231

XhmikosR's avatar
Dist    
XhmikosR committed
6232
        $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
Mark Otto's avatar
dist    
Mark Otto committed
6233

XhmikosR's avatar
Dist    
XhmikosR committed
6234
6235
        $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6236

XhmikosR's avatar
Dist    
XhmikosR committed
6237
6238
6239
6240
      $(this._scrollElement).trigger(Event$8.ACTIVATE, {
        relatedTarget: target
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
6241

XhmikosR's avatar
Dist    
XhmikosR committed
6242
6243
6244
6245
    _proto._clear = function _clear() {
      var nodes = [].slice.call(document.querySelectorAll(this._selector));
      $(nodes).filter(Selector$8.ACTIVE).removeClass(ClassName$8.ACTIVE);
    }; // Static
Mark Otto's avatar
dist    
Mark Otto committed
6246

Mark Otto's avatar
dist  
Mark Otto committed
6247

XhmikosR's avatar
Dist    
XhmikosR committed
6248
6249
6250
    ScrollSpy._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var data = $(this).data(DATA_KEY$8);
Mark Otto's avatar
dist  
Mark Otto committed
6251

XhmikosR's avatar
Dist    
XhmikosR committed
6252
        var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6253

XhmikosR's avatar
Dist    
XhmikosR committed
6254
6255
6256
6257
        if (!data) {
          data = new ScrollSpy(this, _config);
          $(this).data(DATA_KEY$8, data);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6258

XhmikosR's avatar
Dist    
XhmikosR committed
6259
6260
6261
        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
Mark Otto's avatar
dist    
Mark Otto committed
6262
          }
Mark Otto's avatar
dist    
Mark Otto committed
6263

XhmikosR's avatar
Dist    
XhmikosR committed
6264
          data[config]();
Mark Otto's avatar
dist  
Mark Otto committed
6265
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6266
6267
      });
    };
Mark Otto's avatar
dist    
Mark Otto committed
6268

XhmikosR's avatar
Dist    
XhmikosR committed
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
    _createClass(ScrollSpy, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$8;
      }
    }, {
      key: "Default",
      get: function get() {
        return Default$6;
      }
    }]);
Mark Otto's avatar
dist  
Mark Otto committed
6280

XhmikosR's avatar
Dist    
XhmikosR committed
6281
6282
6283
6284
6285
6286
6287
    return ScrollSpy;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6288
6289


XhmikosR's avatar
Dist    
XhmikosR committed
6290
6291
6292
  $(window).on(Event$8.LOAD_DATA_API, function () {
    var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY));
    var scrollSpysLength = scrollSpys.length;
Mark Otto's avatar
dist  
Mark Otto committed
6293

XhmikosR's avatar
Dist    
XhmikosR committed
6294
6295
    for (var i = scrollSpysLength; i--;) {
      var $spy = $(scrollSpys[i]);
Mark Otto's avatar
dist    
Mark Otto committed
6296

XhmikosR's avatar
Dist    
XhmikosR committed
6297
6298
6299
6300
6301
6302
6303
6304
      ScrollSpy._jQueryInterface.call($spy, $spy.data());
    }
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
6305

XhmikosR's avatar
Dist    
XhmikosR committed
6306
6307
  $.fn[NAME$8] = ScrollSpy._jQueryInterface;
  $.fn[NAME$8].Constructor = ScrollSpy;
Mark Otto's avatar
dist  
Mark Otto committed
6308

XhmikosR's avatar
Dist    
XhmikosR committed
6309
6310
6311
6312
  $.fn[NAME$8].noConflict = function () {
    $.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6313

XhmikosR's avatar
Dist    
XhmikosR committed
6314
6315
6316
6317
6318
6319
  /**
   * --------------------------------------------------------------------------
   * Bootstrap (v4.1.3): tab.js
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6320

XhmikosR's avatar
Dist    
XhmikosR committed
6321
6322
6323
6324
6325
  /**
   * ------------------------------------------------------------------------
   * Constants
   * ------------------------------------------------------------------------
   */
Mark Otto's avatar
dist    
Mark Otto committed
6326

XhmikosR's avatar
Dist    
XhmikosR committed
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
  var NAME$9 = 'tab';
  var VERSION$9 = '4.1.3';
  var DATA_KEY$9 = 'bs.tab';
  var EVENT_KEY$9 = "." + DATA_KEY$9;
  var DATA_API_KEY$7 = '.data-api';
  var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9];
  var Event$9 = {
    HIDE: "hide" + EVENT_KEY$9,
    HIDDEN: "hidden" + EVENT_KEY$9,
    SHOW: "show" + EVENT_KEY$9,
    SHOWN: "shown" + EVENT_KEY$9,
    CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7
  };
  var ClassName$9 = {
    DROPDOWN_MENU: 'dropdown-menu',
    ACTIVE: 'active',
    DISABLED: 'disabled',
    FADE: 'fade',
    SHOW: 'show'
  };
  var Selector$9 = {
    DROPDOWN: '.dropdown',
    NAV_LIST_GROUP: '.nav, .list-group',
    ACTIVE: '.active',
    ACTIVE_UL: '> li > .active',
    DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',
    DROPDOWN_TOGGLE: '.dropdown-toggle',
    DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active'
    /**
     * ------------------------------------------------------------------------
     * Class Definition
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist    
Mark Otto committed
6360

XhmikosR's avatar
Dist    
XhmikosR committed
6361
  };
Mark Otto's avatar
dist    
Mark Otto committed
6362

XhmikosR's avatar
Dist    
XhmikosR committed
6363
6364
6365
6366
6367
6368
  var Tab =
  /*#__PURE__*/
  function () {
    function Tab(element) {
      this._element = element;
    } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6369

Mark Otto's avatar
dist    
Mark Otto committed
6370

XhmikosR's avatar
Dist    
XhmikosR committed
6371
    var _proto = Tab.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6372

XhmikosR's avatar
Dist    
XhmikosR committed
6373
6374
6375
    // Public
    _proto.show = function show() {
      var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6376

XhmikosR's avatar
Dist    
XhmikosR committed
6377
6378
6379
      if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) {
        return;
      }
Mark Otto's avatar
dist  
Mark Otto committed
6380

XhmikosR's avatar
Dist    
XhmikosR committed
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
      var target;
      var previous;
      var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0];
      var selector = Util.getSelectorFromElement(this._element);

      if (listElement) {
        var itemSelector = listElement.nodeName === 'UL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE;
        previous = $.makeArray($(listElement).find(itemSelector));
        previous = previous[previous.length - 1];
      }
Mark Otto's avatar
dist  
Mark Otto committed
6391

XhmikosR's avatar
Dist    
XhmikosR committed
6392
6393
6394
6395
6396
6397
      var hideEvent = $.Event(Event$9.HIDE, {
        relatedTarget: this._element
      });
      var showEvent = $.Event(Event$9.SHOW, {
        relatedTarget: previous
      });
Mark Otto's avatar
dist    
Mark Otto committed
6398

XhmikosR's avatar
Dist    
XhmikosR committed
6399
6400
6401
      if (previous) {
        $(previous).trigger(hideEvent);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6402

XhmikosR's avatar
Dist    
XhmikosR committed
6403
      $(this._element).trigger(showEvent);
Mark Otto's avatar
dist  
Mark Otto committed
6404

XhmikosR's avatar
Dist    
XhmikosR committed
6405
6406
6407
      if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) {
        return;
      }
Mark Otto's avatar
dist    
Mark Otto committed
6408

XhmikosR's avatar
Dist    
XhmikosR committed
6409
6410
6411
      if (selector) {
        target = document.querySelector(selector);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6412

XhmikosR's avatar
Dist    
XhmikosR committed
6413
      this._activate(this._element, listElement);
Mark Otto's avatar
dist  
Mark Otto committed
6414

XhmikosR's avatar
Dist    
XhmikosR committed
6415
6416
6417
6418
6419
6420
      var complete = function complete() {
        var hiddenEvent = $.Event(Event$9.HIDDEN, {
          relatedTarget: _this._element
        });
        var shownEvent = $.Event(Event$9.SHOWN, {
          relatedTarget: previous
Mark Otto's avatar
dist    
Mark Otto committed
6421
        });
XhmikosR's avatar
Dist    
XhmikosR committed
6422
6423
        $(previous).trigger(hiddenEvent);
        $(_this._element).trigger(shownEvent);
Mark Otto's avatar
dist    
Mark Otto committed
6424
      };
Mark Otto's avatar
dist  
Mark Otto committed
6425

XhmikosR's avatar
Dist    
XhmikosR committed
6426
6427
6428
6429
6430
6431
      if (target) {
        this._activate(target, target.parentNode, complete);
      } else {
        complete();
      }
    };
Mark Otto's avatar
dist  
Mark Otto committed
6432

XhmikosR's avatar
Dist    
XhmikosR committed
6433
6434
6435
6436
    _proto.dispose = function dispose() {
      $.removeData(this._element, DATA_KEY$9);
      this._element = null;
    }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6437

Mark Otto's avatar
dist    
Mark Otto committed
6438

XhmikosR's avatar
Dist    
XhmikosR committed
6439
6440
    _proto._activate = function _activate(element, container, callback) {
      var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6441

XhmikosR's avatar
Dist    
XhmikosR committed
6442
      var activeElements;
Mark Otto's avatar
dist    
Mark Otto committed
6443

XhmikosR's avatar
Dist    
XhmikosR committed
6444
6445
6446
6447
6448
      if (container && container.nodeName === 'UL') {
        activeElements = $(container).find(Selector$9.ACTIVE_UL);
      } else {
        activeElements = $(container).children(Selector$9.ACTIVE);
      }
Mark Otto's avatar
dist  
Mark Otto committed
6449

XhmikosR's avatar
Dist    
XhmikosR committed
6450
6451
6452
6453
6454
      var active = activeElements[0];
      var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE);

      var complete = function complete() {
        return _this2._transitionComplete(element, active, callback);
Mark Otto's avatar
dist    
Mark Otto committed
6455
      };
Mark Otto's avatar
dist    
Mark Otto committed
6456

XhmikosR's avatar
Dist    
XhmikosR committed
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
      if (active && isTransitioning) {
        var transitionDuration = Util.getTransitionDurationFromElement(active);
        $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
      } else {
        complete();
      }
    };

    _proto._transitionComplete = function _transitionComplete(element, active, callback) {
      if (active) {
        $(active).removeClass(ClassName$9.ACTIVE);
        var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0];

        if (dropdownChild) {
          $(dropdownChild).removeClass(ClassName$9.ACTIVE);
Mark Otto's avatar
dist  
Mark Otto committed
6472
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6473
6474
6475

        if (active.getAttribute('role') === 'tab') {
          active.setAttribute('aria-selected', false);
Mark Otto's avatar
dist    
Mark Otto committed
6476
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6477
      }
Mark Otto's avatar
dist  
Mark Otto committed
6478

XhmikosR's avatar
Dist    
XhmikosR committed
6479
6480
6481
6482
6483
      $(element).addClass(ClassName$9.ACTIVE);

      if (element.getAttribute('role') === 'tab') {
        element.setAttribute('aria-selected', true);
      }
Mark Otto's avatar
dist    
Mark Otto committed
6484

XhmikosR's avatar
Dist    
XhmikosR committed
6485
6486
      Util.reflow(element);
      $(element).addClass(ClassName$9.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6487

XhmikosR's avatar
Dist    
XhmikosR committed
6488
6489
      if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) {
        var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0];
Mark Otto's avatar
dist    
Mark Otto committed
6490

XhmikosR's avatar
Dist    
XhmikosR committed
6491
6492
6493
6494
        if (dropdownElement) {
          var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE));
          $(dropdownToggleList).addClass(ClassName$9.ACTIVE);
        }
Mark Otto's avatar
dist  
Mark Otto committed
6495

XhmikosR's avatar
Dist    
XhmikosR committed
6496
        element.setAttribute('aria-expanded', true);
Mark Otto's avatar
dist    
Mark Otto committed
6497
      }
Mark Otto's avatar
dist    
Mark Otto committed
6498

XhmikosR's avatar
Dist    
XhmikosR committed
6499
6500
6501
6502
6503
      if (callback) {
        callback();
      }
    }; // Static

Mark Otto's avatar
dist  
Mark Otto committed
6504

XhmikosR's avatar
Dist    
XhmikosR committed
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
    Tab._jQueryInterface = function _jQueryInterface(config) {
      return this.each(function () {
        var $this = $(this);
        var data = $this.data(DATA_KEY$9);

        if (!data) {
          data = new Tab(this);
          $this.data(DATA_KEY$9, data);
        }

        if (typeof config === 'string') {
          if (typeof data[config] === 'undefined') {
            throw new TypeError("No method named \"" + config + "\"");
          }

          data[config]();
        }
      });
Mark Otto's avatar
dist    
Mark Otto committed
6523
    };
Mark Otto's avatar
dist  
Mark Otto committed
6524

XhmikosR's avatar
Dist    
XhmikosR committed
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
    _createClass(Tab, null, [{
      key: "VERSION",
      get: function get() {
        return VERSION$9;
      }
    }]);

    return Tab;
  }();
  /**
   * ------------------------------------------------------------------------
   * Data Api implementation
   * ------------------------------------------------------------------------
   */


  $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) {
    event.preventDefault();

    Tab._jQueryInterface.call($(this), 'show');
  });
  /**
   * ------------------------------------------------------------------------
   * jQuery
   * ------------------------------------------------------------------------
   */

  $.fn[NAME$9] = Tab._jQueryInterface;
  $.fn[NAME$9].Constructor = Tab;

  $.fn[NAME$9].noConflict = function () {
    $.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab._jQueryInterface;
  };
Mark Otto's avatar
dist  
Mark Otto committed
6559
6560

  /**
Mark Otto's avatar
dist    
Mark Otto committed
6561
   * --------------------------------------------------------------------------
XhmikosR's avatar
Dist    
XhmikosR committed
6562
   * Bootstrap (v4.1.3): toast.js
Mark Otto's avatar
dist    
Mark Otto committed
6563
6564
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
Mark Otto's avatar
dist  
Mark Otto committed
6565
   */
Mark Otto's avatar
dist    
Mark Otto committed
6566

XhmikosR's avatar
Dist    
XhmikosR committed
6567
  var Toast = function ($$$1) {
Mark Otto's avatar
dist    
Mark Otto committed
6568
6569
    /**
     * ------------------------------------------------------------------------
Mark Otto's avatar
dist    
Mark Otto committed
6570
     * Constants
Mark Otto's avatar
dist    
Mark Otto committed
6571
6572
     * ------------------------------------------------------------------------
     */
XhmikosR's avatar
Dist    
XhmikosR committed
6573
    var NAME = 'toast';
Mark Otto's avatar
Mark Otto committed
6574
    var VERSION = '4.1.3';
XhmikosR's avatar
Dist    
XhmikosR committed
6575
    var DATA_KEY = 'bs.toast';
Mark Otto's avatar
dist    
Mark Otto committed
6576
6577
6578
    var EVENT_KEY = "." + DATA_KEY;
    var JQUERY_NO_CONFLICT = $$$1.fn[NAME];
    var Event = {
XhmikosR's avatar
Dist    
XhmikosR committed
6579
      CLICK_DISMISS: "click.dismiss" + EVENT_KEY,
Mark Otto's avatar
dist    
Mark Otto committed
6580
6581
6582
      HIDE: "hide" + EVENT_KEY,
      HIDDEN: "hidden" + EVENT_KEY,
      SHOW: "show" + EVENT_KEY,
XhmikosR's avatar
Dist    
XhmikosR committed
6583
      SHOWN: "shown" + EVENT_KEY
Mark Otto's avatar
dist    
Mark Otto committed
6584
6585
6586
    };
    var ClassName = {
      FADE: 'fade',
XhmikosR's avatar
Dist    
XhmikosR committed
6587
      HIDE: 'hide',
Mark Otto's avatar
dist    
Mark Otto committed
6588
6589
      SHOW: 'show'
    };
XhmikosR's avatar
Dist    
XhmikosR committed
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
    var DefaultType = {
      animation: 'boolean',
      autohide: 'boolean',
      delay: 'number'
    };
    var Default = {
      animation: true,
      autohide: true,
      delay: 500
    };
Mark Otto's avatar
dist    
Mark Otto committed
6600
    var Selector = {
XhmikosR's avatar
Dist    
XhmikosR committed
6601
      DATA_DISMISS: '[data-dismiss="toast"]'
Mark Otto's avatar
dist    
Mark Otto committed
6602
6603
6604
6605
6606
      /**
       * ------------------------------------------------------------------------
       * Class Definition
       * ------------------------------------------------------------------------
       */
Mark Otto's avatar
dist  
Mark Otto committed
6607

Mark Otto's avatar
dist    
Mark Otto committed
6608
    };
Mark Otto's avatar
dist  
Mark Otto committed
6609

XhmikosR's avatar
Dist    
XhmikosR committed
6610
    var Toast =
Mark Otto's avatar
dist    
Mark Otto committed
6611
6612
    /*#__PURE__*/
    function () {
XhmikosR's avatar
Dist    
XhmikosR committed
6613
      function Toast(element, config) {
Mark Otto's avatar
dist    
Mark Otto committed
6614
        this._element = element;
XhmikosR's avatar
Dist    
XhmikosR committed
6615
6616
6617
6618
        this._config = this._getConfig(config);
        this._timeout = null;

        this._setListeners();
Mark Otto's avatar
dist    
Mark Otto committed
6619
      } // Getters
Mark Otto's avatar
dist  
Mark Otto committed
6620
6621


XhmikosR's avatar
Dist    
XhmikosR committed
6622
      var _proto = Toast.prototype;
Mark Otto's avatar
dist  
Mark Otto committed
6623

Mark Otto's avatar
dist    
Mark Otto committed
6624
6625
6626
      // Public
      _proto.show = function show() {
        var _this = this;
Mark Otto's avatar
dist  
Mark Otto committed
6627

XhmikosR's avatar
Dist    
XhmikosR committed
6628
        $$$1(this._element).trigger(Event.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6629

XhmikosR's avatar
Dist    
XhmikosR committed
6630
6631
        if (this._config.animation) {
          this._element.classList.add(ClassName.FADE);
Mark Otto's avatar
dist    
Mark Otto committed
6632
        }
Mark Otto's avatar
dist  
Mark Otto committed
6633

XhmikosR's avatar
Dist    
XhmikosR committed
6634
6635
        var complete = function complete() {
          $$$1(_this._element).trigger(Event.SHOWN);
Mark Otto's avatar
dist  
Mark Otto committed
6636

XhmikosR's avatar
Dist    
XhmikosR committed
6637
6638
6639
6640
          if (_this._config.autohide) {
            _this.hide();
          }
        };
Mark Otto's avatar
dist  
Mark Otto committed
6641

XhmikosR's avatar
Dist    
XhmikosR committed
6642
        this._element.classList.add(ClassName.SHOW);
Mark Otto's avatar
dist  
Mark Otto committed
6643

XhmikosR's avatar
Dist    
XhmikosR committed
6644
6645
6646
6647
6648
        if (this._config.animation) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
        } else {
          complete();
Mark Otto's avatar
dist    
Mark Otto committed
6649
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6650
      };
Mark Otto's avatar
dist  
Mark Otto committed
6651

XhmikosR's avatar
Dist    
XhmikosR committed
6652
6653
      _proto.hide = function hide(withoutTimeout) {
        var _this2 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6654

XhmikosR's avatar
Dist    
XhmikosR committed
6655
6656
6657
        if (!this._element.classList.contains(ClassName.SHOW)) {
          return;
        }
Mark Otto's avatar
dist  
Mark Otto committed
6658

XhmikosR's avatar
Dist    
XhmikosR committed
6659
        $$$1(this._element).trigger(Event.HIDE);
Mark Otto's avatar
dist    
Mark Otto committed
6660

XhmikosR's avatar
Dist    
XhmikosR committed
6661
6662
        if (withoutTimeout) {
          this._close();
Mark Otto's avatar
dist    
Mark Otto committed
6663
        } else {
XhmikosR's avatar
Dist    
XhmikosR committed
6664
6665
6666
          this._timeout = setTimeout(function () {
            _this2._close();
          }, this._config.delay);
Mark Otto's avatar
dist    
Mark Otto committed
6667
        }
Mark Otto's avatar
dist  
Mark Otto committed
6668
6669
      };

Mark Otto's avatar
dist    
Mark Otto committed
6670
      _proto.dispose = function dispose() {
XhmikosR's avatar
Dist    
XhmikosR committed
6671
6672
6673
6674
6675
6676
6677
6678
        clearTimeout(this._timeout);
        this._timeout = null;

        if (this._element.classList.contains(ClassName.SHOW)) {
          this._element.classList.remove(ClassName.SHOW);
        }

        $$$1(this._element).off(Event.CLICK_DISMISS);
Mark Otto's avatar
dist    
Mark Otto committed
6679
6680
        $$$1.removeData(this._element, DATA_KEY);
        this._element = null;
XhmikosR's avatar
Dist    
XhmikosR committed
6681
        this._config = null;
Mark Otto's avatar
dist    
Mark Otto committed
6682
      }; // Private
Mark Otto's avatar
dist  
Mark Otto committed
6683
6684


XhmikosR's avatar
Dist    
XhmikosR committed
6685
6686
6687
6688
6689
      _proto._getConfig = function _getConfig(config) {
        config = _objectSpread({}, Default, $$$1(this._element).data(), typeof config === 'object' && config ? config : {});
        Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
        return config;
      };
Mark Otto's avatar
dist  
Mark Otto committed
6690

XhmikosR's avatar
Dist    
XhmikosR committed
6691
6692
      _proto._setListeners = function _setListeners() {
        var _this3 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6693

XhmikosR's avatar
Dist    
XhmikosR committed
6694
6695
6696
6697
        $$$1(this._element).on(Event.CLICK_DISMISS, Selector.DATA_DISMISS, function () {
          return _this3.hide(true);
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
6698

XhmikosR's avatar
Dist    
XhmikosR committed
6699
6700
      _proto._close = function _close() {
        var _this4 = this;
Mark Otto's avatar
dist  
Mark Otto committed
6701

Mark Otto's avatar
dist    
Mark Otto committed
6702
        var complete = function complete() {
XhmikosR's avatar
Dist    
XhmikosR committed
6703
          $$$1(_this4._element).trigger(Event.HIDDEN);
Mark Otto's avatar
dist    
Mark Otto committed
6704
        };
Mark Otto's avatar
dist  
Mark Otto committed
6705

XhmikosR's avatar
Dist    
XhmikosR committed
6706
6707
6708
6709
6710
        this._element.classList.remove(ClassName.SHOW);

        if (this._config.animation) {
          var transitionDuration = Util.getTransitionDurationFromElement(this._element);
          $$$1(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration);
Mark Otto's avatar
dist    
Mark Otto committed
6711
6712
6713
6714
        } else {
          complete();
        }
      }; // Static
Mark Otto's avatar
dist  
Mark Otto committed
6715
6716


XhmikosR's avatar
Dist    
XhmikosR committed
6717
      Toast._jQueryInterface = function _jQueryInterface(config) {
Mark Otto's avatar
dist    
Mark Otto committed
6718
        return this.each(function () {
XhmikosR's avatar
Dist    
XhmikosR committed
6719
6720
6721
6722
          var $element = $$$1(this);
          var data = $element.data(DATA_KEY);

          var _config = typeof config === 'object' && config;
Mark Otto's avatar
dist  
Mark Otto committed
6723

Mark Otto's avatar
dist    
Mark Otto committed
6724
          if (!data) {
XhmikosR's avatar
Dist    
XhmikosR committed
6725
6726
            data = new Toast(this, _config);
            $element.data(DATA_KEY, data);
Mark Otto's avatar
dist    
Mark Otto committed
6727
          }
Mark Otto's avatar
dist  
Mark Otto committed
6728

Mark Otto's avatar
dist    
Mark Otto committed
6729
6730
6731
6732
          if (typeof config === 'string') {
            if (typeof data[config] === 'undefined') {
              throw new TypeError("No method named \"" + config + "\"");
            }
Mark Otto's avatar
dist  
Mark Otto committed
6733

XhmikosR's avatar
Dist    
XhmikosR committed
6734
            data[config](this);
Mark Otto's avatar
dist  
Mark Otto committed
6735
          }
Mark Otto's avatar
dist    
Mark Otto committed
6736
6737
        });
      };
Mark Otto's avatar
dist    
Mark Otto committed
6738

XhmikosR's avatar
Dist    
XhmikosR committed
6739
      _createClass(Toast, null, [{
Mark Otto's avatar
dist    
Mark Otto committed
6740
6741
6742
        key: "VERSION",
        get: function get() {
          return VERSION;
Mark Otto's avatar
dist  
Mark Otto committed
6743
        }
XhmikosR's avatar
Dist    
XhmikosR committed
6744
6745
6746
6747
6748
      }, {
        key: "DefaultType",
        get: function get() {
          return DefaultType;
        }
Mark Otto's avatar
dist    
Mark Otto committed
6749
      }]);
Mark Otto's avatar
dist  
Mark Otto committed
6750

XhmikosR's avatar
Dist    
XhmikosR committed
6751
      return Toast;
Mark Otto's avatar
dist    
Mark Otto committed
6752
6753
6754
6755
6756
6757
    }();
    /**
     * ------------------------------------------------------------------------
     * jQuery
     * ------------------------------------------------------------------------
     */
Mark Otto's avatar
dist  
Mark Otto committed
6758

XhmikosR's avatar
Dist    
XhmikosR committed
6759
6760
6761

    $$$1.fn[NAME] = Toast._jQueryInterface;
    $$$1.fn[NAME].Constructor = Toast;
Mark Otto's avatar
dist    
Mark Otto committed
6762

Mark Otto's avatar
dist    
Mark Otto committed
6763
6764
    $$$1.fn[NAME].noConflict = function () {
      $$$1.fn[NAME] = JQUERY_NO_CONFLICT;
XhmikosR's avatar
Dist    
XhmikosR committed
6765
      return Toast._jQueryInterface;
Mark Otto's avatar
dist    
Mark Otto committed
6766
    };
Mark Otto's avatar
dist  
Mark Otto committed
6767

XhmikosR's avatar
Dist    
XhmikosR committed
6768
    return Toast;
Mark Otto's avatar
dist    
Mark Otto committed
6769
  }($);
Mark Otto's avatar
dist  
Mark Otto committed
6770

Mark Otto's avatar
dist    
Mark Otto committed
6771
6772
  /**
   * --------------------------------------------------------------------------
Mark Otto's avatar
Mark Otto committed
6773
   * Bootstrap (v4.1.3): index.js
Mark Otto's avatar
dist    
Mark Otto committed
6774
6775
6776
   * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
   * --------------------------------------------------------------------------
   */
Mark Otto's avatar
dist  
Mark Otto committed
6777

XhmikosR's avatar
Dist    
XhmikosR committed
6778
6779
  (function () {
    if (typeof $ === 'undefined') {
Mark Otto's avatar
dist    
Mark Otto committed
6780
6781
      throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.');
    }
Mark Otto's avatar
dist  
Mark Otto committed
6782

XhmikosR's avatar
Dist    
XhmikosR committed
6783
    var version = $.fn.jquery.split(' ')[0].split('.');
Mark Otto's avatar
dist    
Mark Otto committed
6784
6785
6786
6787
6788
    var minMajor = 1;
    var ltMajor = 2;
    var minMinor = 9;
    var minPatch = 1;
    var maxMajor = 4;
Mark Otto's avatar
dist    
Mark Otto committed
6789

Mark Otto's avatar
dist    
Mark Otto committed
6790
6791
6792
    if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) {
      throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0');
    }
XhmikosR's avatar
Dist    
XhmikosR committed
6793
  })();
Mark Otto's avatar
dist    
Mark Otto committed
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804

  exports.Util = Util;
  exports.Alert = Alert;
  exports.Button = Button;
  exports.Carousel = Carousel;
  exports.Collapse = Collapse;
  exports.Dropdown = Dropdown;
  exports.Modal = Modal;
  exports.Popover = Popover;
  exports.Scrollspy = ScrollSpy;
  exports.Tab = Tab;
XhmikosR's avatar
Dist    
XhmikosR committed
6805
  exports.Toast = Toast;
Mark Otto's avatar
dist    
Mark Otto committed
6806
6807
6808
  exports.Tooltip = Tooltip;

  Object.defineProperty(exports, '__esModule', { value: true });
Mark Otto's avatar
dist  
Mark Otto committed
6809

Mark Otto's avatar
dist    
Mark Otto committed
6810
})));
Mark Otto's avatar
dist    
Mark Otto committed
6811
//# sourceMappingURL=bootstrap.bundle.js.map