bootstrap.esm.js 145 KB
Newer Older
XhmikosR's avatar
Dist.  
XhmikosR committed
1
2
/*!
  * Bootstrap v4.3.1 (https://getbootstrap.com/)
XhmikosR's avatar
XhmikosR committed
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
XhmikosR's avatar
Dist.  
XhmikosR committed
4
5
6
7
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
  */
import Popper from 'popper.js';

XhmikosR's avatar
XhmikosR committed
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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;
}

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;
}

39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function ownKeys(object, enumerableOnly) {
  var keys = Object.keys(object);

  if (Object.getOwnPropertySymbols) {
    var symbols = Object.getOwnPropertySymbols(object);
    if (enumerableOnly) symbols = symbols.filter(function (sym) {
      return Object.getOwnPropertyDescriptor(object, sym).enumerable;
    });
    keys.push.apply(keys, symbols);
  }

  return keys;
}

function _objectSpread2(target) {
XhmikosR's avatar
XhmikosR committed
54
55
56
  for (var i = 1; i < arguments.length; i++) {
    var source = arguments[i] != null ? arguments[i] : {};

57
    if (i % 2) {
XhmikosR's avatar
XhmikosR committed
58
      ownKeys(Object(source), true).forEach(function (key) {
59
60
61
62
63
        _defineProperty(target, key, source[key]);
      });
    } else if (Object.getOwnPropertyDescriptors) {
      Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
XhmikosR's avatar
XhmikosR committed
64
      ownKeys(Object(source)).forEach(function (key) {
65
66
        Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
      });
XhmikosR's avatar
XhmikosR committed
67
68
69
70
71
72
73
74
75
76
77
78
    }
  }

  return target;
}

function _inheritsLoose(subClass, superClass) {
  subClass.prototype = Object.create(superClass.prototype);
  subClass.prototype.constructor = subClass;
  subClass.__proto__ = superClass;
}

XhmikosR's avatar
Dist.  
XhmikosR committed
79
80
81
82
83
84
/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/index.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
85
86
var MAX_UID = 1000000;
var MILLISECONDS_MULTIPLIER = 1000;
XhmikosR's avatar
XhmikosR committed
87
var TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp)
XhmikosR's avatar
XhmikosR committed
88
89

var toType = function toType(obj) {
XhmikosR's avatar
XhmikosR committed
90
91
92
93
  if (obj === null || obj === undefined) {
    return "" + obj;
  }

XhmikosR's avatar
XhmikosR committed
94
95
  return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase();
};
XhmikosR's avatar
Dist.  
XhmikosR committed
96
97
98
99
100
101
102
/**
 * --------------------------------------------------------------------------
 * Public Util Api
 * --------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
103
var getUID = function getUID(prefix) {
XhmikosR's avatar
Dist.  
XhmikosR committed
104
105
106
107
108
109
110
  do {
    prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here
  } while (document.getElementById(prefix));

  return prefix;
};

XhmikosR's avatar
XhmikosR committed
111
var getSelector = function getSelector(element) {
XhmikosR's avatar
XhmikosR committed
112
  var selector = element.getAttribute('data-target');
XhmikosR's avatar
Dist.  
XhmikosR committed
113
114

  if (!selector || selector === '#') {
XhmikosR's avatar
XhmikosR committed
115
    var hrefAttr = element.getAttribute('href');
XhmikosR's avatar
XhmikosR committed
116
    selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
117
118
  }

XhmikosR's avatar
XhmikosR committed
119
120
121
122
123
124
125
  return selector;
};

var getSelectorFromElement = function getSelectorFromElement(element) {
  var selector = getSelector(element);

  if (selector) {
XhmikosR's avatar
Dist.  
XhmikosR committed
126
127
    return document.querySelector(selector) ? selector : null;
  }
XhmikosR's avatar
XhmikosR committed
128
129
130
131
132
133
134

  return null;
};

var getElementFromSelector = function getElementFromSelector(element) {
  var selector = getSelector(element);
  return selector ? document.querySelector(selector) : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
135
136
};

XhmikosR's avatar
XhmikosR committed
137
var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
138
139
140
141
142
  if (!element) {
    return 0;
  } // Get transition-duration of the element


XhmikosR's avatar
XhmikosR committed
143
  var _window$getComputedSt = window.getComputedStyle(element),
XhmikosR's avatar
Dist.  
XhmikosR committed
144
145
146
      transitionDuration = _window$getComputedSt.transitionDuration,
      transitionDelay = _window$getComputedSt.transitionDelay;

XhmikosR's avatar
XhmikosR committed
147
148
  var floatTransitionDuration = parseFloat(transitionDuration);
  var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found
XhmikosR's avatar
Dist.  
XhmikosR committed
149
150
151
152
153
154
155
156
157
158
159

  if (!floatTransitionDuration && !floatTransitionDelay) {
    return 0;
  } // If multiple durations are defined, take the first


  transitionDuration = transitionDuration.split(',')[0];
  transitionDelay = transitionDelay.split(',')[0];
  return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
};

XhmikosR's avatar
XhmikosR committed
160
var triggerTransitionEnd = function triggerTransitionEnd(element) {
XhmikosR's avatar
XhmikosR committed
161
  element.dispatchEvent(new Event(TRANSITION_END));
XhmikosR's avatar
Dist.  
XhmikosR committed
162
163
};

XhmikosR's avatar
XhmikosR committed
164
165
166
var isElement = function isElement(obj) {
  return (obj[0] || obj).nodeType;
};
XhmikosR's avatar
Dist.  
XhmikosR committed
167

XhmikosR's avatar
XhmikosR committed
168
169
170
171
var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
  var called = false;
  var durationPadding = 5;
  var emulatedDuration = duration + durationPadding;
XhmikosR's avatar
Dist.  
XhmikosR committed
172
173
174
175
176
177
178

  function listener() {
    called = true;
    element.removeEventListener(TRANSITION_END, listener);
  }

  element.addEventListener(TRANSITION_END, listener);
XhmikosR's avatar
XhmikosR committed
179
  setTimeout(function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
180
181
182
183
184
185
    if (!called) {
      triggerTransitionEnd(element);
    }
  }, emulatedDuration);
};

XhmikosR's avatar
XhmikosR committed
186
187
188
189
190
var typeCheckConfig = function typeCheckConfig(componentName, config, configTypes) {
  Object.keys(configTypes).forEach(function (property) {
    var expectedTypes = configTypes[property];
    var value = config[property];
    var valueType = value && isElement(value) ? 'element' : toType(value);
XhmikosR's avatar
Dist.  
XhmikosR committed
191
192

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

XhmikosR's avatar
XhmikosR committed
198
var isVisible = function isVisible(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
199
200
201
202
203
  if (!element) {
    return false;
  }

  if (element.style && element.parentNode && element.parentNode.style) {
XhmikosR's avatar
XhmikosR committed
204
205
206
    var elementStyle = getComputedStyle(element);
    var parentNodeStyle = getComputedStyle(element.parentNode);
    return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden';
XhmikosR's avatar
Dist.  
XhmikosR committed
207
208
209
210
211
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
212
var findShadowRoot = function findShadowRoot(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
213
214
215
216
217
218
  if (!document.documentElement.attachShadow) {
    return null;
  } // Can find the shadow root otherwise it'll return the document


  if (typeof element.getRootNode === 'function') {
XhmikosR's avatar
XhmikosR committed
219
    var root = element.getRootNode();
XhmikosR's avatar
Dist.  
XhmikosR committed
220
221
222
223
224
225
226
227
228
229
230
231
232
    return root instanceof ShadowRoot ? root : null;
  }

  if (element instanceof ShadowRoot) {
    return element;
  } // when we don't find a shadow root


  if (!element.parentNode) {
    return null;
  }

  return findShadowRoot(element.parentNode);
XhmikosR's avatar
XhmikosR committed
233
};
XhmikosR's avatar
Dist.  
XhmikosR committed
234

XhmikosR's avatar
XhmikosR committed
235
236
237
var noop = function noop() {
  return function () {};
};
XhmikosR's avatar
Dist.  
XhmikosR committed
238

XhmikosR's avatar
XhmikosR committed
239
240
241
var reflow = function reflow(element) {
  return element.offsetHeight;
};
XhmikosR's avatar
Dist.  
XhmikosR committed
242

XhmikosR's avatar
XhmikosR committed
243
244
245
246
247
248
249
250
251
252
253
var getjQuery = function getjQuery() {
  var _window = window,
      jQuery = _window.jQuery;

  if (jQuery && !document.body.hasAttribute('data-no-jquery')) {
    return jQuery;
  }

  return null;
};

XhmikosR's avatar
Dist.  
XhmikosR committed
254
255
256
257
258
259
260
261
262
263
264
265
/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): dom/data.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
266
267
268
var mapData = function () {
  var storeData = {};
  var id = 1;
XhmikosR's avatar
Dist.  
XhmikosR committed
269
  return {
XhmikosR's avatar
XhmikosR committed
270
    set: function set(element, key, data) {
XhmikosR's avatar
Dist.  
XhmikosR committed
271
272
      if (typeof element.key === 'undefined') {
        element.key = {
XhmikosR's avatar
XhmikosR committed
273
274
          key: key,
          id: id
XhmikosR's avatar
Dist.  
XhmikosR committed
275
276
277
278
279
280
        };
        id++;
      }

      storeData[element.key.id] = data;
    },
XhmikosR's avatar
XhmikosR committed
281
    get: function get(element, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
282
283
284
285
      if (!element || typeof element.key === 'undefined') {
        return null;
      }

XhmikosR's avatar
XhmikosR committed
286
      var keyProperties = element.key;
XhmikosR's avatar
Dist.  
XhmikosR committed
287
288
289
290
291
292
293

      if (keyProperties.key === key) {
        return storeData[keyProperties.id];
      }

      return null;
    },
XhmikosR's avatar
XhmikosR committed
294
    delete: function _delete(element, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
295
296
297
298
      if (typeof element.key === 'undefined') {
        return;
      }

XhmikosR's avatar
XhmikosR committed
299
      var keyProperties = element.key;
XhmikosR's avatar
Dist.  
XhmikosR committed
300
301
302
303
304
305
306

      if (keyProperties.key === key) {
        delete storeData[keyProperties.id];
        delete element.key;
      }
    }
  };
XhmikosR's avatar
XhmikosR committed
307
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
308

XhmikosR's avatar
XhmikosR committed
309
310
var Data = {
  setData: function setData(instance, key, data) {
XhmikosR's avatar
Dist.  
XhmikosR committed
311
312
    mapData.set(instance, key, data);
  },
XhmikosR's avatar
XhmikosR committed
313
  getData: function getData(instance, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
314
315
    return mapData.get(instance, key);
  },
XhmikosR's avatar
XhmikosR committed
316
  removeData: function removeData(instance, key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
317
318
    mapData.delete(instance, key);
  }
XhmikosR's avatar
XhmikosR committed
319
};
XhmikosR's avatar
Dist.  
XhmikosR committed
320

XhmikosR's avatar
XhmikosR committed
321
322
/* istanbul ignore file */
var find = Element.prototype.querySelectorAll;
XhmikosR's avatar
XhmikosR committed
323
var findOne = Element.prototype.querySelector; // MSEdge resets defaultPrevented flag upon dispatchEvent call if at least one listener is attached
XhmikosR's avatar
Dist.  
XhmikosR committed
324

XhmikosR's avatar
XhmikosR committed
325
var defaultPreventedPreservedOnDispatch = function () {
XhmikosR's avatar
XhmikosR committed
326
  var e = new CustomEvent('Bootstrap', {
XhmikosR's avatar
XhmikosR committed
327
328
329
330
331
332
333
334
335
336
    cancelable: true
  });
  var element = document.createElement('div');
  element.addEventListener('Bootstrap', function () {
    return null;
  });
  e.preventDefault();
  element.dispatchEvent(e);
  return e.defaultPrevented;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
337

XhmikosR's avatar
XhmikosR committed
338
var scopeSelectorRegex = /:scope\b/;
XhmikosR's avatar
Dist.  
XhmikosR committed
339

XhmikosR's avatar
XhmikosR committed
340
341
var supportScopeQuery = function () {
  var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
342

XhmikosR's avatar
XhmikosR committed
343
344
  try {
    element.querySelectorAll(':scope *');
XhmikosR's avatar
XhmikosR committed
345
  } catch (_) {
XhmikosR's avatar
XhmikosR committed
346
347
    return false;
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
348

XhmikosR's avatar
XhmikosR committed
349
350
351
352
353
354
355
356
357
358
  return true;
}();

if (!supportScopeQuery) {
  find = function find(selector) {
    if (!scopeSelectorRegex.test(selector)) {
      return this.querySelectorAll(selector);
    }

    var hasId = Boolean(this.id);
XhmikosR's avatar
Dist.  
XhmikosR committed
359

XhmikosR's avatar
XhmikosR committed
360
361
362
363
364
    if (!hasId) {
      this.id = getUID('scope');
    }

    var nodeList = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
365

XhmikosR's avatar
XhmikosR committed
366
367
368
369
370
371
    try {
      selector = selector.replace(scopeSelectorRegex, "#" + this.id);
      nodeList = this.querySelectorAll(selector);
    } finally {
      if (!hasId) {
        this.removeAttribute('id');
XhmikosR's avatar
Dist.  
XhmikosR committed
372
      }
XhmikosR's avatar
XhmikosR committed
373
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
374

XhmikosR's avatar
XhmikosR committed
375
376
    return nodeList;
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
377

XhmikosR's avatar
XhmikosR committed
378
379
380
381
382
383
384
385
386
387
388
389
  findOne = function findOne(selector) {
    if (!scopeSelectorRegex.test(selector)) {
      return this.querySelector(selector);
    }

    var matches = find.call(this, selector);

    if (typeof matches[0] !== 'undefined') {
      return matches[0];
    }

    return null;
XhmikosR's avatar
Dist.  
XhmikosR committed
390
  };
XhmikosR's avatar
XhmikosR committed
391
}
XhmikosR's avatar
Dist.  
XhmikosR committed
392
393
394

/**
 * --------------------------------------------------------------------------
395
 * Bootstrap (v4.3.1): dom/event-handler.js
XhmikosR's avatar
Dist.  
XhmikosR committed
396
397
398
399
400
401
402
403
404
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
405
var $ = getjQuery();
XhmikosR's avatar
XhmikosR committed
406
407
408
409
410
var namespaceRegex = /[^.]*(?=\..*)\.|.*/;
var stripNameRegex = /\..*/;
var keyEventRegex = /^key/;
var stripUidRegex = /::\d+$/;
var eventRegistry = {}; // Events storage
XhmikosR's avatar
Dist.  
XhmikosR committed
411

XhmikosR's avatar
XhmikosR committed
412
413
var uidEvent = 1;
var customEvents = {
XhmikosR's avatar
Dist.  
XhmikosR committed
414
415
416
  mouseenter: 'mouseover',
  mouseleave: 'mouseout'
};
XhmikosR's avatar
XhmikosR committed
417
var nativeEvents = ['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll'];
XhmikosR's avatar
Dist.  
XhmikosR committed
418
419
420
421
422
423
424
/**
 * ------------------------------------------------------------------------
 * Private methods
 * ------------------------------------------------------------------------
 */

function getUidEvent(element, uid) {
XhmikosR's avatar
XhmikosR committed
425
  return uid && uid + "::" + uidEvent++ || element.uidEvent || uidEvent++;
XhmikosR's avatar
Dist.  
XhmikosR committed
426
427
428
}

function getEvent(element) {
XhmikosR's avatar
XhmikosR committed
429
  var uid = getUidEvent(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
  element.uidEvent = uid;
  eventRegistry[uid] = eventRegistry[uid] || {};
  return eventRegistry[uid];
}

function fixEvent(event, element) {
  // Add which for key events
  if (event.which === null && keyEventRegex.test(event.type)) {
    event.which = event.charCode === null ? event.keyCode : event.charCode;
  }

  event.delegateTarget = element;
}

function bootstrapHandler(element, fn) {
  return function handler(event) {
    fixEvent(event, element);

    if (handler.oneOff) {
      EventHandler.off(element, event.type, fn);
    }

    return fn.apply(element, [event]);
  };
}

function bootstrapDelegationHandler(element, selector, fn) {
  return function handler(event) {
XhmikosR's avatar
XhmikosR committed
458
    var domElements = element.querySelectorAll(selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
459

XhmikosR's avatar
XhmikosR committed
460
461
    for (var target = event.target; target && target !== this; target = target.parentNode) {
      for (var i = domElements.length; i--;) {
XhmikosR's avatar
Dist.  
XhmikosR committed
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
        if (domElements[i] === target) {
          fixEvent(event, target);

          if (handler.oneOff) {
            EventHandler.off(element, event.type, fn);
          }

          return fn.apply(target, [event]);
        }
      }
    } // To please ESLint


    return null;
  };
}

function findHandler(events, handler, delegationSelector) {
  if (delegationSelector === void 0) {
    delegationSelector = null;
  }

Mark Otto's avatar
dist v5    
Mark Otto committed
484
485
486
487
  var uidEventList = Object.keys(events);

  for (var i = 0, len = uidEventList.length; i < len; i++) {
    var event = events[uidEventList[i]];
XhmikosR's avatar
Dist.  
XhmikosR committed
488
489

    if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {
Mark Otto's avatar
dist v5    
Mark Otto committed
490
      return event;
XhmikosR's avatar
Dist.  
XhmikosR committed
491
492
493
494
495
496
497
    }
  }

  return null;
}

function normalizeParams(originalTypeEvent, handler, delegationFn) {
XhmikosR's avatar
XhmikosR committed
498
499
  var delegation = typeof handler === 'string';
  var originalHandler = delegation ? delegationFn : handler; // allow to get the native events from namespaced events ('click.bs.button' --> 'click')
XhmikosR's avatar
Dist.  
XhmikosR committed
500

XhmikosR's avatar
XhmikosR committed
501
502
  var typeEvent = originalTypeEvent.replace(stripNameRegex, '');
  var custom = customEvents[typeEvent];
XhmikosR's avatar
Dist.  
XhmikosR committed
503
504
505
506
507

  if (custom) {
    typeEvent = custom;
  }

XhmikosR's avatar
XhmikosR committed
508
  var isNative = nativeEvents.indexOf(typeEvent) > -1;
XhmikosR's avatar
Dist.  
XhmikosR committed
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526

  if (!isNative) {
    typeEvent = originalTypeEvent;
  }

  return [delegation, originalHandler, typeEvent];
}

function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {
  if (typeof originalTypeEvent !== 'string' || !element) {
    return;
  }

  if (!handler) {
    handler = delegationFn;
    delegationFn = null;
  }

XhmikosR's avatar
XhmikosR committed
527
528
529
530
  var _normalizeParams = normalizeParams(originalTypeEvent, handler, delegationFn),
      delegation = _normalizeParams[0],
      originalHandler = _normalizeParams[1],
      typeEvent = _normalizeParams[2];
XhmikosR's avatar
Dist.  
XhmikosR committed
531

XhmikosR's avatar
XhmikosR committed
532
533
534
  var events = getEvent(element);
  var handlers = events[typeEvent] || (events[typeEvent] = {});
  var previousFn = findHandler(handlers, originalHandler, delegation ? handler : null);
XhmikosR's avatar
Dist.  
XhmikosR committed
535
536
537
538
539
540

  if (previousFn) {
    previousFn.oneOff = previousFn.oneOff && oneOff;
    return;
  }

XhmikosR's avatar
XhmikosR committed
541
542
  var uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''));
  var fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler);
XhmikosR's avatar
Dist.  
XhmikosR committed
543
544
545
546
547
548
549
550
551
  fn.delegationSelector = delegation ? handler : null;
  fn.originalHandler = originalHandler;
  fn.oneOff = oneOff;
  fn.uidEvent = uid;
  handlers[uid] = fn;
  element.addEventListener(typeEvent, fn, delegation);
}

function removeHandler(element, events, typeEvent, handler, delegationSelector) {
XhmikosR's avatar
XhmikosR committed
552
  var fn = findHandler(events[typeEvent], handler, delegationSelector);
XhmikosR's avatar
Dist.  
XhmikosR committed
553

Mark Otto's avatar
dist v5    
Mark Otto committed
554
  if (!fn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
555
556
557
558
559
560
561
562
    return;
  }

  element.removeEventListener(typeEvent, fn, Boolean(delegationSelector));
  delete events[typeEvent][fn.uidEvent];
}

function removeNamespacedHandlers(element, events, typeEvent, namespace) {
XhmikosR's avatar
XhmikosR committed
563
564
  var storeElementEvent = events[typeEvent] || {};
  Object.keys(storeElementEvent).forEach(function (handlerKey) {
XhmikosR's avatar
Dist.  
XhmikosR committed
565
    if (handlerKey.indexOf(namespace) > -1) {
XhmikosR's avatar
XhmikosR committed
566
      var event = storeElementEvent[handlerKey];
XhmikosR's avatar
Dist.  
XhmikosR committed
567
568
569
570
571
      removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
    }
  });
}

XhmikosR's avatar
XhmikosR committed
572
573
var EventHandler = {
  on: function on(element, event, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
574
575
    addHandler(element, event, handler, delegationFn, false);
  },
XhmikosR's avatar
XhmikosR committed
576
  one: function one(element, event, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
577
578
    addHandler(element, event, handler, delegationFn, true);
  },
XhmikosR's avatar
XhmikosR committed
579
  off: function off(element, originalTypeEvent, handler, delegationFn) {
XhmikosR's avatar
Dist.  
XhmikosR committed
580
581
582
583
    if (typeof originalTypeEvent !== 'string' || !element) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
584
585
586
587
    var _normalizeParams2 = normalizeParams(originalTypeEvent, handler, delegationFn),
        delegation = _normalizeParams2[0],
        originalHandler = _normalizeParams2[1],
        typeEvent = _normalizeParams2[2];
XhmikosR's avatar
Dist.  
XhmikosR committed
588

XhmikosR's avatar
XhmikosR committed
589
590
591
    var inNamespace = typeEvent !== originalTypeEvent;
    var events = getEvent(element);
    var isNamespace = originalTypeEvent.charAt(0) === '.';
XhmikosR's avatar
Dist.  
XhmikosR committed
592
593
594
595
596
597
598
599
600
601
602
603

    if (typeof originalHandler !== 'undefined') {
      // Simplest case: handler is passed, remove that listener ONLY.
      if (!events || !events[typeEvent]) {
        return;
      }

      removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null);
      return;
    }

    if (isNamespace) {
XhmikosR's avatar
XhmikosR committed
604
      Object.keys(events).forEach(function (elementEvent) {
XhmikosR's avatar
XhmikosR committed
605
        removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1));
XhmikosR's avatar
Dist.  
XhmikosR committed
606
607
608
      });
    }

XhmikosR's avatar
XhmikosR committed
609
610
611
    var storeElementEvent = events[typeEvent] || {};
    Object.keys(storeElementEvent).forEach(function (keyHandlers) {
      var handlerKey = keyHandlers.replace(stripUidRegex, '');
XhmikosR's avatar
Dist.  
XhmikosR committed
612
613

      if (!inNamespace || originalTypeEvent.indexOf(handlerKey) > -1) {
XhmikosR's avatar
XhmikosR committed
614
        var event = storeElementEvent[keyHandlers];
XhmikosR's avatar
Dist.  
XhmikosR committed
615
616
617
618
        removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector);
      }
    });
  },
XhmikosR's avatar
XhmikosR committed
619
  trigger: function trigger(element, event, args) {
XhmikosR's avatar
Dist.  
XhmikosR committed
620
621
622
623
    if (typeof event !== 'string' || !element) {
      return null;
    }

XhmikosR's avatar
XhmikosR committed
624
625
626
627
628
629
630
631
    var typeEvent = event.replace(stripNameRegex, '');
    var inNamespace = event !== typeEvent;
    var isNative = nativeEvents.indexOf(typeEvent) > -1;
    var jQueryEvent;
    var bubbles = true;
    var nativeDispatch = true;
    var defaultPrevented = false;
    var evt = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
632

XhmikosR's avatar
XhmikosR committed
633
634
635
    if (inNamespace && $) {
      jQueryEvent = $.Event(event, args);
      $(element).trigger(jQueryEvent);
XhmikosR's avatar
Dist.  
XhmikosR committed
636
637
638
639
640
641
642
643
644
      bubbles = !jQueryEvent.isPropagationStopped();
      nativeDispatch = !jQueryEvent.isImmediatePropagationStopped();
      defaultPrevented = jQueryEvent.isDefaultPrevented();
    }

    if (isNative) {
      evt = document.createEvent('HTMLEvents');
      evt.initEvent(typeEvent, bubbles, true);
    } else {
XhmikosR's avatar
XhmikosR committed
645
      evt = new CustomEvent(event, {
XhmikosR's avatar
XhmikosR committed
646
        bubbles: bubbles,
XhmikosR's avatar
Dist.  
XhmikosR committed
647
648
649
650
651
652
        cancelable: true
      });
    } // merge custom informations in our event


    if (typeof args !== 'undefined') {
XhmikosR's avatar
XhmikosR committed
653
      Object.keys(args).forEach(function (key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
654
        Object.defineProperty(evt, key, {
XhmikosR's avatar
XhmikosR committed
655
          get: function get() {
XhmikosR's avatar
Dist.  
XhmikosR committed
656
657
658
659
660
661
662
663
664
            return args[key];
          }
        });
      });
    }

    if (defaultPrevented) {
      evt.preventDefault();

XhmikosR's avatar
XhmikosR committed
665
      if (!defaultPreventedPreservedOnDispatch) {
XhmikosR's avatar
Dist.  
XhmikosR committed
666
        Object.defineProperty(evt, 'defaultPrevented', {
XhmikosR's avatar
XhmikosR committed
667
668
669
          get: function get() {
            return true;
          }
XhmikosR's avatar
Dist.  
XhmikosR committed
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
        });
      }
    }

    if (nativeDispatch) {
      element.dispatchEvent(evt);
    }

    if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {
      jQueryEvent.preventDefault();
    }

    return evt;
  }
};

/**
 * --------------------------------------------------------------------------
688
 * Bootstrap (v4.3.1): dom/selector-engine.js
XhmikosR's avatar
Dist.  
XhmikosR committed
689
690
691
692
693
694
695
696
697
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
698
699
var NODE_TEXT = 3;
var SelectorEngine = {
XhmikosR's avatar
XhmikosR committed
700
701
  matches: function matches(element, selector) {
    return element.matches(selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
702
  },
XhmikosR's avatar
XhmikosR committed
703
  find: function find$1(selector, element) {
XhmikosR's avatar
XhmikosR committed
704
705
    var _ref;

XhmikosR's avatar
Dist.  
XhmikosR committed
706
707
708
709
    if (element === void 0) {
      element = document.documentElement;
    }

XhmikosR's avatar
XhmikosR committed
710
    return (_ref = []).concat.apply(_ref, find.call(element, selector));
XhmikosR's avatar
Dist.  
XhmikosR committed
711
  },
XhmikosR's avatar
XhmikosR committed
712
  findOne: function findOne$1(selector, element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
713
714
715
716
717
718
    if (element === void 0) {
      element = document.documentElement;
    }

    return findOne.call(element, selector);
  },
XhmikosR's avatar
XhmikosR committed
719
  children: function children(element, selector) {
XhmikosR's avatar
XhmikosR committed
720
721
722
    var _ref2;

    var children = (_ref2 = []).concat.apply(_ref2, element.children);
XhmikosR's avatar
Dist.  
XhmikosR committed
723

XhmikosR's avatar
XhmikosR committed
724
    return children.filter(function (child) {
XhmikosR's avatar
XhmikosR committed
725
      return child.matches(selector);
XhmikosR's avatar
XhmikosR committed
726
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
727
  },
XhmikosR's avatar
XhmikosR committed
728
729
730
  parents: function parents(element, selector) {
    var parents = [];
    var ancestor = element.parentNode;
XhmikosR's avatar
Dist.  
XhmikosR committed
731
732
733
734
735
736
737
738
739
740
741

    while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {
      if (this.matches(ancestor, selector)) {
        parents.push(ancestor);
      }

      ancestor = ancestor.parentNode;
    }

    return parents;
  },
XhmikosR's avatar
XhmikosR committed
742
743
  closest: function closest(element, selector) {
    return element.closest(selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
744
  },
XhmikosR's avatar
XhmikosR committed
745
  prev: function prev(element, selector) {
XhmikosR's avatar
XhmikosR committed
746
    var previous = element.previousElementSibling;
XhmikosR's avatar
Dist.  
XhmikosR committed
747

XhmikosR's avatar
XhmikosR committed
748
749
750
    while (previous) {
      if (previous.matches(selector)) {
        return [previous];
XhmikosR's avatar
Dist.  
XhmikosR committed
751
752
      }

XhmikosR's avatar
XhmikosR committed
753
      previous = previous.previousElementSibling;
XhmikosR's avatar
Dist.  
XhmikosR committed
754
755
    }

XhmikosR's avatar
XhmikosR committed
756
757
758
759
760
761
762
763
764
765
766
767
768
769
    return [];
  },
  next: function next(element, selector) {
    var next = element.nextElementSibling;

    while (next) {
      if (this.matches(next, selector)) {
        return [next];
      }

      next = next.nextElementSibling;
    }

    return [];
XhmikosR's avatar
Dist.  
XhmikosR committed
770
771
772
773
774
775
776
777
778
  }
};

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
779
780
781
782
783
var NAME = 'alert';
var VERSION = '4.3.1';
var DATA_KEY = 'bs.alert';
var EVENT_KEY = "." + DATA_KEY;
var DATA_API_KEY = '.data-api';
XhmikosR's avatar
XhmikosR committed
784
785
786
787
788
789
790
var SELECTOR_DISMISS = '[data-dismiss="alert"]';
var EVENT_CLOSE = "close" + EVENT_KEY;
var EVENT_CLOSED = "closed" + EVENT_KEY;
var EVENT_CLICK_DATA_API = "click" + EVENT_KEY + DATA_API_KEY;
var CLASSNAME_ALERT = 'alert';
var CLASSNAME_FADE = 'fade';
var CLASSNAME_SHOW = 'show';
XhmikosR's avatar
XhmikosR committed
791
792
793
794
795
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
796

XhmikosR's avatar
XhmikosR committed
797
var Alert = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
798
  function Alert(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
799
800
801
802
803
804
805
806
    this._element = element;

    if (this._element) {
      Data.setData(element, DATA_KEY, this);
    }
  } // Getters


XhmikosR's avatar
XhmikosR committed
807
  var _proto = Alert.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
808

XhmikosR's avatar
XhmikosR committed
809
810
811
  // Public
  _proto.close = function close(element) {
    var rootElement = this._element;
XhmikosR's avatar
Dist.  
XhmikosR committed
812
813
814
815
816

    if (element) {
      rootElement = this._getRootElement(element);
    }

XhmikosR's avatar
XhmikosR committed
817
    var customEvent = this._triggerCloseEvent(rootElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
818
819
820
821
822
823

    if (customEvent === null || customEvent.defaultPrevented) {
      return;
    }

    this._removeElement(rootElement);
XhmikosR's avatar
XhmikosR committed
824
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
825

XhmikosR's avatar
XhmikosR committed
826
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
827
828
829
    Data.removeData(this._element, DATA_KEY);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
830
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
831

XhmikosR's avatar
XhmikosR committed
832
  _proto._getRootElement = function _getRootElement(element) {
XhmikosR's avatar
XhmikosR committed
833
    var parent = getElementFromSelector(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
834
835

    if (!parent) {
XhmikosR's avatar
XhmikosR committed
836
      parent = SelectorEngine.closest(element, "." + CLASSNAME_ALERT);
XhmikosR's avatar
Dist.  
XhmikosR committed
837
838
839
    }

    return parent;
XhmikosR's avatar
XhmikosR committed
840
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
841

XhmikosR's avatar
XhmikosR committed
842
  _proto._triggerCloseEvent = function _triggerCloseEvent(element) {
XhmikosR's avatar
XhmikosR committed
843
    return EventHandler.trigger(element, EVENT_CLOSE);
XhmikosR's avatar
XhmikosR committed
844
845
846
847
  };

  _proto._removeElement = function _removeElement(element) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
848

XhmikosR's avatar
XhmikosR committed
849
    element.classList.remove(CLASSNAME_SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
850

XhmikosR's avatar
XhmikosR committed
851
    if (!element.classList.contains(CLASSNAME_FADE)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
852
853
854
855
856
      this._destroyElement(element);

      return;
    }

XhmikosR's avatar
XhmikosR committed
857
    var transitionDuration = getTransitionDurationFromElement(element);
858
859
    EventHandler.one(element, TRANSITION_END, function () {
      return _this._destroyElement(element);
XhmikosR's avatar
XhmikosR committed
860
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
861
    emulateTransitionEnd(element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
862
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
863

XhmikosR's avatar
XhmikosR committed
864
  _proto._destroyElement = function _destroyElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
865
866
867
868
    if (element.parentNode) {
      element.parentNode.removeChild(element);
    }

XhmikosR's avatar
XhmikosR committed
869
    EventHandler.trigger(element, EVENT_CLOSED);
XhmikosR's avatar
Dist.  
XhmikosR committed
870
  } // Static
XhmikosR's avatar
XhmikosR committed
871
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
872

XhmikosR's avatar
XhmikosR committed
873
  Alert.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
874
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
875
      var data = Data.getData(this, DATA_KEY);
XhmikosR's avatar
Dist.  
XhmikosR committed
876
877
878
879
880
881
882
883
884

      if (!data) {
        data = new Alert(this);
      }

      if (config === 'close') {
        data[config](this);
      }
    });
XhmikosR's avatar
XhmikosR committed
885
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
886

XhmikosR's avatar
XhmikosR committed
887
  Alert.handleDismiss = function handleDismiss(alertInstance) {
XhmikosR's avatar
Dist.  
XhmikosR committed
888
889
890
891
892
893
894
    return function (event) {
      if (event) {
        event.preventDefault();
      }

      alertInstance.close(this);
    };
XhmikosR's avatar
XhmikosR committed
895
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
896

XhmikosR's avatar
XhmikosR committed
897
  Alert.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
898
    return Data.getData(element, DATA_KEY);
XhmikosR's avatar
XhmikosR committed
899
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
900

XhmikosR's avatar
XhmikosR committed
901
902
903
904
905
906
907
908
909
  _createClass(Alert, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION;
    }
  }]);

  return Alert;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
910
911
912
913
914
915
916
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
917
EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DISMISS, Alert.handleDismiss(new Alert()));
XhmikosR's avatar
XhmikosR committed
918
var $$1 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
919
920
921
922
923
924
925
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .alert to jQuery only if jQuery is present
 */

926
927
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
928
929
930
931
if ($$1) {
  var JQUERY_NO_CONFLICT = $$1.fn[NAME];
  $$1.fn[NAME] = Alert.jQueryInterface;
  $$1.fn[NAME].Constructor = Alert;
XhmikosR's avatar
Dist.  
XhmikosR committed
932

XhmikosR's avatar
XhmikosR committed
933
934
935
  $$1.fn[NAME].noConflict = function () {
    $$1.fn[NAME] = JQUERY_NO_CONFLICT;
    return Alert.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
936
937
938
939
940
941
942
943
944
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
945
946
947
948
949
var NAME$1 = 'button';
var VERSION$1 = '4.3.1';
var DATA_KEY$1 = 'bs.button';
var EVENT_KEY$1 = "." + DATA_KEY$1;
var DATA_API_KEY$1 = '.data-api';
XhmikosR's avatar
XhmikosR committed
950
951
952
953
954
955
956
957
958
959
960
961
var CLASS_NAME_ACTIVE = 'active';
var CLASS_NAME_BUTTON = 'btn';
var CLASS_NAME_DISABLED = 'disabled';
var CLASS_NAME_FOCUS = 'focus';
var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]';
var SELECTOR_DATA_TOGGLE = '[data-toggle="buttons"]';
var SELECTOR_INPUT = 'input:not([type="hidden"])';
var SELECTOR_ACTIVE = '.active';
var SELECTOR_BUTTON = '.btn';
var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$1 + DATA_API_KEY$1;
var EVENT_FOCUS_DATA_API = "focus" + EVENT_KEY$1 + DATA_API_KEY$1;
var EVENT_BLUR_DATA_API = "blur" + EVENT_KEY$1 + DATA_API_KEY$1;
XhmikosR's avatar
XhmikosR committed
962
963
964
965
966
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
967

XhmikosR's avatar
XhmikosR committed
968
var Button = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
969
  function Button(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
970
971
972
973
974
    this._element = element;
    Data.setData(element, DATA_KEY$1, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
975
  var _proto = Button.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
976

XhmikosR's avatar
XhmikosR committed
977
978
979
980
  // Public
  _proto.toggle = function toggle() {
    var triggerChangeEvent = true;
    var addAriaPressed = true;
XhmikosR's avatar
XhmikosR committed
981
    var rootElement = SelectorEngine.closest(this._element, SELECTOR_DATA_TOGGLE);
XhmikosR's avatar
Dist.  
XhmikosR committed
982
983

    if (rootElement) {
XhmikosR's avatar
XhmikosR committed
984
      var input = SelectorEngine.findOne(SELECTOR_INPUT, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
985

XhmikosR's avatar
XhmikosR committed
986
      if (input && input.type === 'radio') {
XhmikosR's avatar
XhmikosR committed
987
        if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE)) {
XhmikosR's avatar
XhmikosR committed
988
989
          triggerChangeEvent = false;
        } else {
XhmikosR's avatar
XhmikosR committed
990
          var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE, rootElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
991

XhmikosR's avatar
XhmikosR committed
992
          if (activeElement) {
XhmikosR's avatar
XhmikosR committed
993
            activeElement.classList.remove(CLASS_NAME_ACTIVE);
XhmikosR's avatar
Dist.  
XhmikosR committed
994
995
996
997
          }
        }

        if (triggerChangeEvent) {
XhmikosR's avatar
XhmikosR committed
998
          if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains(CLASS_NAME_DISABLED) || rootElement.classList.contains(CLASS_NAME_DISABLED)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
999
1000
1001
            return;
          }

XhmikosR's avatar
XhmikosR committed
1002
          input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1003
1004
1005
1006
1007
1008
1009
1010
1011
          EventHandler.trigger(input, 'change');
        }

        input.focus();
        addAriaPressed = false;
      }
    }

    if (addAriaPressed) {
XhmikosR's avatar
XhmikosR committed
1012
      this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE));
XhmikosR's avatar
Dist.  
XhmikosR committed
1013
1014
1015
    }

    if (triggerChangeEvent) {
XhmikosR's avatar
XhmikosR committed
1016
      this._element.classList.toggle(CLASS_NAME_ACTIVE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1017
    }
XhmikosR's avatar
XhmikosR committed
1018
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1019

XhmikosR's avatar
XhmikosR committed
1020
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1021
1022
1023
    Data.removeData(this._element, DATA_KEY$1);
    this._element = null;
  } // Static
XhmikosR's avatar
XhmikosR committed
1024
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1025

XhmikosR's avatar
XhmikosR committed
1026
  Button.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1027
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1028
      var data = Data.getData(this, DATA_KEY$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1029
1030
1031
1032
1033
1034
1035
1036
1037

      if (!data) {
        data = new Button(this);
      }

      if (config === 'toggle') {
        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
1038
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1039

XhmikosR's avatar
XhmikosR committed
1040
  Button.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1041
    return Data.getData(element, DATA_KEY$1);
XhmikosR's avatar
XhmikosR committed
1042
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1043

XhmikosR's avatar
XhmikosR committed
1044
1045
1046
1047
1048
1049
1050
1051
1052
  _createClass(Button, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$1;
    }
  }]);

  return Button;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
1053
1054
1055
1056
1057
1058
1059
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
1060
EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1061
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
1062
  var button = event.target;
XhmikosR's avatar
Dist.  
XhmikosR committed
1063

XhmikosR's avatar
XhmikosR committed
1064
1065
  if (!button.classList.contains(CLASS_NAME_BUTTON)) {
    button = SelectorEngine.closest(button, SELECTOR_BUTTON);
XhmikosR's avatar
Dist.  
XhmikosR committed
1066
1067
  }

XhmikosR's avatar
XhmikosR committed
1068
  var data = Data.getData(button, DATA_KEY$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1069
1070
1071
1072
1073
1074
1075

  if (!data) {
    data = new Button(button);
  }

  data.toggle();
});
XhmikosR's avatar
XhmikosR committed
1076
1077
EventHandler.on(document, EVENT_FOCUS_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  var button = SelectorEngine.closest(event.target, SELECTOR_BUTTON);
XhmikosR's avatar
XhmikosR committed
1078
1079

  if (button) {
XhmikosR's avatar
XhmikosR committed
1080
    button.classList.add(CLASS_NAME_FOCUS);
XhmikosR's avatar
XhmikosR committed
1081
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
1082
});
XhmikosR's avatar
XhmikosR committed
1083
1084
EventHandler.on(document, EVENT_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) {
  var button = SelectorEngine.closest(event.target, SELECTOR_BUTTON);
XhmikosR's avatar
XhmikosR committed
1085
1086

  if (button) {
XhmikosR's avatar
XhmikosR committed
1087
    button.classList.remove(CLASS_NAME_FOCUS);
XhmikosR's avatar
XhmikosR committed
1088
  }
XhmikosR's avatar
Dist.  
XhmikosR committed
1089
});
XhmikosR's avatar
XhmikosR committed
1090
var $$2 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
1091
1092
1093
1094
1095
1096
1097
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .button to jQuery only if jQuery is present
 */

1098
1099
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1100
1101
1102
1103
if ($$2) {
  var JQUERY_NO_CONFLICT$1 = $$2.fn[NAME$1];
  $$2.fn[NAME$1] = Button.jQueryInterface;
  $$2.fn[NAME$1].Constructor = Button;
XhmikosR's avatar
Dist.  
XhmikosR committed
1104

XhmikosR's avatar
XhmikosR committed
1105
1106
1107
  $$2.fn[NAME$1].noConflict = function () {
    $$2.fn[NAME$1] = JQUERY_NO_CONFLICT$1;
    return Button.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
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
1133
1134
1135
1136
1137
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): dom/manipulator.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
function normalizeData(val) {
  if (val === 'true') {
    return true;
  }

  if (val === 'false') {
    return false;
  }

  if (val === Number(val).toString()) {
    return Number(val);
  }

  if (val === '' || val === 'null') {
    return null;
  }

  return val;
}

function normalizeDataKey(key) {
XhmikosR's avatar
XhmikosR committed
1138
  return key.replace(/[A-Z]/g, function (chr) {
XhmikosR's avatar
XhmikosR committed
1139
    return "-" + chr.toLowerCase();
XhmikosR's avatar
XhmikosR committed
1140
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
1141
1142
}

XhmikosR's avatar
XhmikosR committed
1143
1144
1145
var Manipulator = {
  setDataAttribute: function setDataAttribute(element, key, value) {
    element.setAttribute("data-" + normalizeDataKey(key), value);
XhmikosR's avatar
Dist.  
XhmikosR committed
1146
  },
XhmikosR's avatar
XhmikosR committed
1147
1148
  removeDataAttribute: function removeDataAttribute(element, key) {
    element.removeAttribute("data-" + normalizeDataKey(key));
XhmikosR's avatar
Dist.  
XhmikosR committed
1149
  },
XhmikosR's avatar
XhmikosR committed
1150
  getDataAttributes: function getDataAttributes(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1151
1152
1153
1154
    if (!element) {
      return {};
    }

1155
    var attributes = _objectSpread2({}, element.dataset);
XhmikosR's avatar
Dist.  
XhmikosR committed
1156

XhmikosR's avatar
XhmikosR committed
1157
    Object.keys(attributes).forEach(function (key) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1158
1159
1160
1161
      attributes[key] = normalizeData(attributes[key]);
    });
    return attributes;
  },
XhmikosR's avatar
XhmikosR committed
1162
1163
  getDataAttribute: function getDataAttribute(element, key) {
    return normalizeData(element.getAttribute("data-" + normalizeDataKey(key)));
XhmikosR's avatar
Dist.  
XhmikosR committed
1164
  },
XhmikosR's avatar
XhmikosR committed
1165
1166
  offset: function offset(element) {
    var rect = element.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
1167
1168
1169
1170
1171
    return {
      top: rect.top + document.body.scrollTop,
      left: rect.left + document.body.scrollLeft
    };
  },
XhmikosR's avatar
XhmikosR committed
1172
  position: function position(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1173
1174
1175
1176
1177
    return {
      top: element.offsetTop,
      left: element.offsetLeft
    };
  },
XhmikosR's avatar
XhmikosR committed
1178
  toggleClass: function toggleClass(element, className) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
    if (!element) {
      return;
    }

    if (element.classList.contains(className)) {
      element.classList.remove(className);
    } else {
      element.classList.add(className);
    }
  }
};

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
1197
1198
1199
1200
1201
1202
var NAME$2 = 'carousel';
var VERSION$2 = '4.3.1';
var DATA_KEY$2 = 'bs.carousel';
var EVENT_KEY$2 = "." + DATA_KEY$2;
var DATA_API_KEY$2 = '.data-api';
var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
1203

XhmikosR's avatar
XhmikosR committed
1204
var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
1205

XhmikosR's avatar
XhmikosR committed
1206
var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch
XhmikosR's avatar
Dist.  
XhmikosR committed
1207

XhmikosR's avatar
XhmikosR committed
1208
1209
var SWIPE_THRESHOLD = 40;
var Default = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1210
1211
1212
1213
1214
1215
1216
  interval: 5000,
  keyboard: true,
  slide: false,
  pause: 'hover',
  wrap: true,
  touch: true
};
XhmikosR's avatar
XhmikosR committed
1217
var DefaultType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1218
1219
1220
1221
1222
1223
1224
  interval: '(number|boolean)',
  keyboard: 'boolean',
  slide: '(boolean|string)',
  pause: '(string|boolean)',
  wrap: 'boolean',
  touch: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
var DIRECTION_NEXT = 'next';
var DIRECTION_PREV = 'prev';
var DIRECTION_LEFT = 'left';
var DIRECTION_RIGHT = 'right';
var EVENT_SLIDE = "slide" + EVENT_KEY$2;
var EVENT_SLID = "slid" + EVENT_KEY$2;
var EVENT_KEYDOWN = "keydown" + EVENT_KEY$2;
var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$2;
var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$2;
var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$2;
var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$2;
var EVENT_TOUCHEND = "touchend" + EVENT_KEY$2;
var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$2;
var EVENT_POINTERUP = "pointerup" + EVENT_KEY$2;
var EVENT_DRAG_START = "dragstart" + EVENT_KEY$2;
var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$2;
var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$2 + DATA_API_KEY$2;
var CLASS_NAME_CAROUSEL = 'carousel';
var CLASS_NAME_ACTIVE$1 = 'active';
var CLASS_NAME_SLIDE = 'slide';
var CLASS_NAME_RIGHT = 'carousel-item-right';
var CLASS_NAME_LEFT = 'carousel-item-left';
var CLASS_NAME_NEXT = 'carousel-item-next';
var CLASS_NAME_PREV = 'carousel-item-prev';
var CLASS_NAME_POINTER_EVENT = 'pointer-event';
var SELECTOR_ACTIVE$1 = '.active';
var SELECTOR_ACTIVE_ITEM = '.active.carousel-item';
var SELECTOR_ITEM = '.carousel-item';
var SELECTOR_ITEM_IMG = '.carousel-item img';
var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev';
var SELECTOR_INDICATORS = '.carousel-indicators';
var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]';
var SELECTOR_DATA_RIDE = '[data-ride="carousel"]';
XhmikosR's avatar
XhmikosR committed
1258
var PointerType = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1259
1260
1261
  TOUCH: 'touch',
  PEN: 'pen'
};
XhmikosR's avatar
XhmikosR committed
1262
1263
1264
1265
1266
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
1267

XhmikosR's avatar
XhmikosR committed
1268
var Carousel = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
1269
  function Carousel(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
    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;
XhmikosR's avatar
XhmikosR committed
1280
    this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1281
1282
1283
1284
1285
1286
1287
1288
1289
    this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0;
    this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent);

    this._addEventListeners();

    Data.setData(element, DATA_KEY$2, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
1290
  var _proto = Carousel.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1291

XhmikosR's avatar
XhmikosR committed
1292
1293
  // Public
  _proto.next = function next() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1294
    if (!this._isSliding) {
XhmikosR's avatar
XhmikosR committed
1295
      this._slide(DIRECTION_NEXT);
XhmikosR's avatar
Dist.  
XhmikosR committed
1296
    }
XhmikosR's avatar
XhmikosR committed
1297
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1298

XhmikosR's avatar
XhmikosR committed
1299
  _proto.nextWhenVisible = function nextWhenVisible() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1300
1301
1302
1303
1304
    // Don't call next when the page isn't visible
    // or the carousel or its parent isn't visible
    if (!document.hidden && isVisible(this._element)) {
      this.next();
    }
XhmikosR's avatar
XhmikosR committed
1305
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1306

XhmikosR's avatar
XhmikosR committed
1307
  _proto.prev = function prev() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1308
    if (!this._isSliding) {
XhmikosR's avatar
XhmikosR committed
1309
      this._slide(DIRECTION_PREV);
XhmikosR's avatar
Dist.  
XhmikosR committed
1310
    }
XhmikosR's avatar
XhmikosR committed
1311
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1312

XhmikosR's avatar
XhmikosR committed
1313
  _proto.pause = function pause(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1314
1315
1316
1317
    if (!event) {
      this._isPaused = true;
    }

XhmikosR's avatar
XhmikosR committed
1318
    if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1319
1320
1321
1322
1323
1324
      triggerTransitionEnd(this._element);
      this.cycle(true);
    }

    clearInterval(this._interval);
    this._interval = null;
XhmikosR's avatar
XhmikosR committed
1325
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1326

XhmikosR's avatar
XhmikosR committed
1327
  _proto.cycle = function cycle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
    if (!event) {
      this._isPaused = false;
    }

    if (this._interval) {
      clearInterval(this._interval);
      this._interval = null;
    }

    if (this._config && this._config.interval && !this._isPaused) {
      this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval);
    }
XhmikosR's avatar
XhmikosR committed
1340
1341
1342
1343
  };

  _proto.to = function to(index) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1344

XhmikosR's avatar
XhmikosR committed
1345
    this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1346

XhmikosR's avatar
XhmikosR committed
1347
    var activeIndex = this._getItemIndex(this._activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1348
1349
1350
1351
1352
1353

    if (index > this._items.length - 1 || index < 0) {
      return;
    }

    if (this._isSliding) {
XhmikosR's avatar
XhmikosR committed
1354
      EventHandler.one(this._element, EVENT_SLID, function () {
XhmikosR's avatar
XhmikosR committed
1355
1356
        return _this.to(index);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1357
1358
1359
1360
1361
1362
1363
1364
1365
      return;
    }

    if (activeIndex === index) {
      this.pause();
      this.cycle();
      return;
    }

XhmikosR's avatar
XhmikosR committed
1366
    var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1367
1368

    this._slide(direction, this._items[index]);
XhmikosR's avatar
XhmikosR committed
1369
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1370

XhmikosR's avatar
XhmikosR committed
1371
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
    EventHandler.off(this._element, EVENT_KEY$2);
    Data.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
XhmikosR's avatar
XhmikosR committed
1383
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1384

XhmikosR's avatar
XhmikosR committed
1385
  _proto._getConfig = function _getConfig(config) {
1386
    config = _objectSpread2({}, Default, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1387
1388
    typeCheckConfig(NAME$2, config, DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
1389
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1390

XhmikosR's avatar
XhmikosR committed
1391
1392
  _proto._handleSwipe = function _handleSwipe() {
    var absDeltax = Math.abs(this.touchDeltaX);
XhmikosR's avatar
Dist.  
XhmikosR committed
1393
1394
1395
1396
1397

    if (absDeltax <= SWIPE_THRESHOLD) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
1398
1399
    var direction = absDeltax / this.touchDeltaX;
    this.touchDeltaX = 0; // swipe left
XhmikosR's avatar
Dist.  
XhmikosR committed
1400
1401
1402
1403
1404
1405
1406
1407
1408

    if (direction > 0) {
      this.prev();
    } // swipe right


    if (direction < 0) {
      this.next();
    }
XhmikosR's avatar
XhmikosR committed
1409
1410
1411
1412
  };

  _proto._addEventListeners = function _addEventListeners() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1413
1414

    if (this._config.keyboard) {
XhmikosR's avatar
XhmikosR committed
1415
      EventHandler.on(this._element, EVENT_KEYDOWN, function (event) {
XhmikosR's avatar
XhmikosR committed
1416
1417
        return _this2._keydown(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1418
1419
1420
    }

    if (this._config.pause === 'hover') {
XhmikosR's avatar
XhmikosR committed
1421
      EventHandler.on(this._element, EVENT_MOUSEENTER, function (event) {
XhmikosR's avatar
XhmikosR committed
1422
1423
        return _this2.pause(event);
      });
XhmikosR's avatar
XhmikosR committed
1424
      EventHandler.on(this._element, EVENT_MOUSELEAVE, function (event) {
XhmikosR's avatar
XhmikosR committed
1425
1426
        return _this2.cycle(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1427
1428
    }

1429
    if (this._config.touch && this._touchSupported) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1430
1431
      this._addTouchEventListeners();
    }
XhmikosR's avatar
XhmikosR committed
1432
1433
1434
1435
  };

  _proto._addTouchEventListeners = function _addTouchEventListeners() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1436

XhmikosR's avatar
XhmikosR committed
1437
1438
1439
1440
1441
    var start = function start(event) {
      if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
        _this3.touchStartX = event.clientX;
      } else if (!_this3._pointerEvent) {
        _this3.touchStartX = event.touches[0].clientX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1442
1443
1444
      }
    };

XhmikosR's avatar
XhmikosR committed
1445
    var move = function move(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1446
1447
      // ensure swiping with one touch and not pinching
      if (event.touches && event.touches.length > 1) {
XhmikosR's avatar
XhmikosR committed
1448
        _this3.touchDeltaX = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
1449
      } else {
XhmikosR's avatar
XhmikosR committed
1450
        _this3.touchDeltaX = event.touches[0].clientX - _this3.touchStartX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1451
1452
1453
      }
    };

XhmikosR's avatar
XhmikosR committed
1454
1455
1456
    var end = function end(event) {
      if (_this3._pointerEvent && PointerType[event.pointerType.toUpperCase()]) {
        _this3.touchDeltaX = event.clientX - _this3.touchStartX;
XhmikosR's avatar
Dist.  
XhmikosR committed
1457
1458
      }

XhmikosR's avatar
XhmikosR committed
1459
      _this3._handleSwipe();
XhmikosR's avatar
Dist.  
XhmikosR committed
1460

XhmikosR's avatar
XhmikosR committed
1461
      if (_this3._config.pause === 'hover') {
XhmikosR's avatar
Dist.  
XhmikosR committed
1462
1463
1464
1465
1466
1467
1468
        // 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
XhmikosR's avatar
XhmikosR committed
1469
        _this3.pause();
XhmikosR's avatar
Dist.  
XhmikosR committed
1470

XhmikosR's avatar
XhmikosR committed
1471
1472
        if (_this3.touchTimeout) {
          clearTimeout(_this3.touchTimeout);
XhmikosR's avatar
Dist.  
XhmikosR committed
1473
1474
        }

XhmikosR's avatar
XhmikosR committed
1475
1476
1477
        _this3.touchTimeout = setTimeout(function (event) {
          return _this3.cycle(event);
        }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval);
XhmikosR's avatar
Dist.  
XhmikosR committed
1478
1479
1480
      }
    };

XhmikosR's avatar
XhmikosR committed
1481
1482
    SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(function (itemImg) {
      EventHandler.on(itemImg, EVENT_DRAG_START, function (e) {
XhmikosR's avatar
XhmikosR committed
1483
1484
        return e.preventDefault();
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1485
1486
1487
    });

    if (this._pointerEvent) {
XhmikosR's avatar
XhmikosR committed
1488
      EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) {
XhmikosR's avatar
XhmikosR committed
1489
1490
        return start(event);
      });
XhmikosR's avatar
XhmikosR committed
1491
      EventHandler.on(this._element, EVENT_POINTERUP, function (event) {
XhmikosR's avatar
XhmikosR committed
1492
1493
        return end(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1494

XhmikosR's avatar
XhmikosR committed
1495
      this._element.classList.add(CLASS_NAME_POINTER_EVENT);
XhmikosR's avatar
Dist.  
XhmikosR committed
1496
    } else {
XhmikosR's avatar
XhmikosR committed
1497
      EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) {
XhmikosR's avatar
XhmikosR committed
1498
1499
        return start(event);
      });
XhmikosR's avatar
XhmikosR committed
1500
      EventHandler.on(this._element, EVENT_TOUCHMOVE, function (event) {
XhmikosR's avatar
XhmikosR committed
1501
1502
        return move(event);
      });
XhmikosR's avatar
XhmikosR committed
1503
      EventHandler.on(this._element, EVENT_TOUCHEND, function (event) {
XhmikosR's avatar
XhmikosR committed
1504
1505
        return end(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1506
    }
XhmikosR's avatar
XhmikosR committed
1507
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1508

XhmikosR's avatar
XhmikosR committed
1509
  _proto._keydown = function _keydown(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
    if (/input|textarea/i.test(event.target.tagName)) {
      return;
    }

    switch (event.which) {
      case ARROW_LEFT_KEYCODE:
        event.preventDefault();
        this.prev();
        break;

      case ARROW_RIGHT_KEYCODE:
        event.preventDefault();
        this.next();
        break;
    }
XhmikosR's avatar
XhmikosR committed
1525
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1526

XhmikosR's avatar
XhmikosR committed
1527
  _proto._getItemIndex = function _getItemIndex(element) {
XhmikosR's avatar
XhmikosR committed
1528
    this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : [];
XhmikosR's avatar
Dist.  
XhmikosR committed
1529
    return this._items.indexOf(element);
XhmikosR's avatar
XhmikosR committed
1530
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1531

XhmikosR's avatar
XhmikosR committed
1532
  _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) {
XhmikosR's avatar
XhmikosR committed
1533
1534
    var isNextDirection = direction === DIRECTION_NEXT;
    var isPrevDirection = direction === DIRECTION_PREV;
XhmikosR's avatar
Dist.  
XhmikosR committed
1535

XhmikosR's avatar
XhmikosR committed
1536
    var activeIndex = this._getItemIndex(activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1537

XhmikosR's avatar
XhmikosR committed
1538
1539
    var lastItemIndex = this._items.length - 1;
    var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex;
XhmikosR's avatar
Dist.  
XhmikosR committed
1540
1541
1542
1543
1544

    if (isGoingToWrap && !this._config.wrap) {
      return activeElement;
    }

XhmikosR's avatar
XhmikosR committed
1545
    var delta = direction === DIRECTION_PREV ? -1 : 1;
XhmikosR's avatar
XhmikosR committed
1546
    var itemIndex = (activeIndex + delta) % this._items.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
1547
    return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex];
XhmikosR's avatar
XhmikosR committed
1548
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1549

XhmikosR's avatar
XhmikosR committed
1550
1551
  _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) {
    var targetIndex = this._getItemIndex(relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
1552

XhmikosR's avatar
XhmikosR committed
1553
    var fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1554

XhmikosR's avatar
XhmikosR committed
1555
    return EventHandler.trigger(this._element, EVENT_SLIDE, {
XhmikosR's avatar
XhmikosR committed
1556
      relatedTarget: relatedTarget,
XhmikosR's avatar
Dist.  
XhmikosR committed
1557
1558
1559
1560
      direction: eventDirectionName,
      from: fromIndex,
      to: targetIndex
    });
XhmikosR's avatar
XhmikosR committed
1561
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1562

XhmikosR's avatar
XhmikosR committed
1563
  _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1564
    if (this._indicatorsElement) {
XhmikosR's avatar
XhmikosR committed
1565
      var indicators = SelectorEngine.find(SELECTOR_ACTIVE$1, this._indicatorsElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1566

XhmikosR's avatar
XhmikosR committed
1567
      for (var i = 0; i < indicators.length; i++) {
XhmikosR's avatar
XhmikosR committed
1568
        indicators[i].classList.remove(CLASS_NAME_ACTIVE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1569
1570
      }

XhmikosR's avatar
XhmikosR committed
1571
      var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)];
XhmikosR's avatar
Dist.  
XhmikosR committed
1572
1573

      if (nextIndicator) {
XhmikosR's avatar
XhmikosR committed
1574
        nextIndicator.classList.add(CLASS_NAME_ACTIVE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1575
1576
      }
    }
XhmikosR's avatar
XhmikosR committed
1577
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1578

XhmikosR's avatar
XhmikosR committed
1579
1580
  _proto._slide = function _slide(direction, element) {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1581

XhmikosR's avatar
XhmikosR committed
1582
    var activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1583

XhmikosR's avatar
XhmikosR committed
1584
    var activeElementIndex = this._getItemIndex(activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1585

XhmikosR's avatar
XhmikosR committed
1586
    var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
1587

XhmikosR's avatar
XhmikosR committed
1588
1589
1590
1591
1592
1593
    var nextElementIndex = this._getItemIndex(nextElement);

    var isCycling = Boolean(this._interval);
    var directionalClassName;
    var orderClassName;
    var eventDirectionName;
XhmikosR's avatar
Dist.  
XhmikosR committed
1594

XhmikosR's avatar
XhmikosR committed
1595
1596
1597
1598
    if (direction === DIRECTION_NEXT) {
      directionalClassName = CLASS_NAME_LEFT;
      orderClassName = CLASS_NAME_NEXT;
      eventDirectionName = DIRECTION_LEFT;
XhmikosR's avatar
Dist.  
XhmikosR committed
1599
    } else {
XhmikosR's avatar
XhmikosR committed
1600
1601
1602
      directionalClassName = CLASS_NAME_RIGHT;
      orderClassName = CLASS_NAME_PREV;
      eventDirectionName = DIRECTION_RIGHT;
XhmikosR's avatar
Dist.  
XhmikosR committed
1603
1604
    }

XhmikosR's avatar
XhmikosR committed
1605
    if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE$1)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1606
1607
1608
1609
      this._isSliding = false;
      return;
    }

XhmikosR's avatar
XhmikosR committed
1610
    var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName);
XhmikosR's avatar
Dist.  
XhmikosR committed
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628

    if (slideEvent.defaultPrevented) {
      return;
    }

    if (!activeElement || !nextElement) {
      // Some weirdness is happening, so we bail
      return;
    }

    this._isSliding = true;

    if (isCycling) {
      this.pause();
    }

    this._setActiveIndicatorElement(nextElement);

XhmikosR's avatar
XhmikosR committed
1629
    if (this._element.classList.contains(CLASS_NAME_SLIDE)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1630
1631
1632
1633
      nextElement.classList.add(orderClassName);
      reflow(nextElement);
      activeElement.classList.add(directionalClassName);
      nextElement.classList.add(directionalClassName);
XhmikosR's avatar
XhmikosR committed
1634
      var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10);
XhmikosR's avatar
Dist.  
XhmikosR committed
1635
1636
1637
1638
1639
1640
1641
1642

      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;
      }

XhmikosR's avatar
XhmikosR committed
1643
1644
      var transitionDuration = getTransitionDurationFromElement(activeElement);
      EventHandler.one(activeElement, TRANSITION_END, function () {
XhmikosR's avatar
Dist.  
XhmikosR committed
1645
1646
        nextElement.classList.remove(directionalClassName);
        nextElement.classList.remove(orderClassName);
XhmikosR's avatar
XhmikosR committed
1647
1648
        nextElement.classList.add(CLASS_NAME_ACTIVE$1);
        activeElement.classList.remove(CLASS_NAME_ACTIVE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1649
1650
        activeElement.classList.remove(orderClassName);
        activeElement.classList.remove(directionalClassName);
XhmikosR's avatar
XhmikosR committed
1651
1652
        _this4._isSliding = false;
        setTimeout(function () {
XhmikosR's avatar
XhmikosR committed
1653
          EventHandler.trigger(_this4._element, EVENT_SLID, {
XhmikosR's avatar
Dist.  
XhmikosR committed
1654
1655
1656
1657
1658
1659
1660
1661
1662
            relatedTarget: nextElement,
            direction: eventDirectionName,
            from: activeElementIndex,
            to: nextElementIndex
          });
        }, 0);
      });
      emulateTransitionEnd(activeElement, transitionDuration);
    } else {
XhmikosR's avatar
XhmikosR committed
1663
1664
      activeElement.classList.remove(CLASS_NAME_ACTIVE$1);
      nextElement.classList.add(CLASS_NAME_ACTIVE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
1665
      this._isSliding = false;
XhmikosR's avatar
XhmikosR committed
1666
      EventHandler.trigger(this._element, EVENT_SLID, {
XhmikosR's avatar
Dist.  
XhmikosR committed
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
        relatedTarget: nextElement,
        direction: eventDirectionName,
        from: activeElementIndex,
        to: nextElementIndex
      });
    }

    if (isCycling) {
      this.cycle();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
1678
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
1679

XhmikosR's avatar
XhmikosR committed
1680
  Carousel.carouselInterface = function carouselInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
1681
    var data = Data.getData(element, DATA_KEY$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
1682

1683
    var _config = _objectSpread2({}, Default, {}, Manipulator.getDataAttributes(element));
XhmikosR's avatar
Dist.  
XhmikosR committed
1684
1685

    if (typeof config === 'object') {
1686
      _config = _objectSpread2({}, _config, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1687
1688
    }

XhmikosR's avatar
XhmikosR committed
1689
    var action = typeof config === 'string' ? config : _config.slide;
XhmikosR's avatar
Dist.  
XhmikosR committed
1690
1691
1692
1693
1694
1695
1696
1697
1698

    if (!data) {
      data = new Carousel(element, _config);
    }

    if (typeof config === 'number') {
      data.to(config);
    } else if (typeof action === 'string') {
      if (typeof data[action] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
1699
        throw new TypeError("No method named \"" + action + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
1700
1701
1702
1703
1704
1705
1706
      }

      data[action]();
    } else if (_config.interval && _config.ride) {
      data.pause();
      data.cycle();
    }
XhmikosR's avatar
XhmikosR committed
1707
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1708

XhmikosR's avatar
XhmikosR committed
1709
  Carousel.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1710
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
1711
      Carousel.carouselInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1712
    });
XhmikosR's avatar
XhmikosR committed
1713
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1714

XhmikosR's avatar
XhmikosR committed
1715
1716
  Carousel.dataApiClickHandler = function dataApiClickHandler(event) {
    var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
1717

XhmikosR's avatar
XhmikosR committed
1718
    if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1719
1720
1721
      return;
    }

1722
    var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));
XhmikosR's avatar
Dist.  
XhmikosR committed
1723

XhmikosR's avatar
XhmikosR committed
1724
    var slideIndex = this.getAttribute('data-slide-to');
XhmikosR's avatar
Dist.  
XhmikosR committed
1725
1726
1727
1728
1729

    if (slideIndex) {
      config.interval = false;
    }

XhmikosR's avatar
XhmikosR committed
1730
    Carousel.carouselInterface(target, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
1731
1732
1733
1734
1735
1736

    if (slideIndex) {
      Data.getData(target, DATA_KEY$2).to(slideIndex);
    }

    event.preventDefault();
XhmikosR's avatar
XhmikosR committed
1737
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1738

XhmikosR's avatar
XhmikosR committed
1739
  Carousel.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1740
    return Data.getData(element, DATA_KEY$2);
XhmikosR's avatar
XhmikosR committed
1741
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
1742

XhmikosR's avatar
XhmikosR committed
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
  _createClass(Carousel, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$2;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default;
    }
  }]);

  return Carousel;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
1757
1758
1759
1760
1761
1762
1763
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
1764
1765
1766
EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler);
EventHandler.on(window, EVENT_LOAD_DATA_API, function () {
  var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1767

XhmikosR's avatar
XhmikosR committed
1768
  for (var i = 0, len = carousels.length; i < len; i++) {
XhmikosR's avatar
XhmikosR committed
1769
    Carousel.carouselInterface(carousels[i], Data.getData(carousels[i], DATA_KEY$2));
XhmikosR's avatar
Dist.  
XhmikosR committed
1770
1771
  }
});
XhmikosR's avatar
XhmikosR committed
1772
var $$3 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
1773
1774
1775
1776
1777
1778
1779
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .carousel to jQuery only if jQuery is present
 */

1780
1781
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
1782
1783
1784
1785
if ($$3) {
  var JQUERY_NO_CONFLICT$2 = $$3.fn[NAME$2];
  $$3.fn[NAME$2] = Carousel.jQueryInterface;
  $$3.fn[NAME$2].Constructor = Carousel;
XhmikosR's avatar
Dist.  
XhmikosR committed
1786

XhmikosR's avatar
XhmikosR committed
1787
1788
1789
  $$3.fn[NAME$2].noConflict = function () {
    $$3.fn[NAME$2] = JQUERY_NO_CONFLICT$2;
    return Carousel.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
1790
1791
1792
1793
1794
1795
1796
1797
1798
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
1799
1800
1801
1802
1803
1804
var NAME$3 = 'collapse';
var VERSION$3 = '4.3.1';
var DATA_KEY$3 = 'bs.collapse';
var EVENT_KEY$3 = "." + DATA_KEY$3;
var DATA_API_KEY$3 = '.data-api';
var Default$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1805
1806
1807
  toggle: true,
  parent: ''
};
XhmikosR's avatar
XhmikosR committed
1808
var DefaultType$1 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
1809
1810
1811
  toggle: 'boolean',
  parent: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
var EVENT_SHOW = "show" + EVENT_KEY$3;
var EVENT_SHOWN = "shown" + EVENT_KEY$3;
var EVENT_HIDE = "hide" + EVENT_KEY$3;
var EVENT_HIDDEN = "hidden" + EVENT_KEY$3;
var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$3 + DATA_API_KEY$3;
var CLASS_NAME_SHOW = 'show';
var CLASS_NAME_COLLAPSE = 'collapse';
var CLASS_NAME_COLLAPSING = 'collapsing';
var CLASS_NAME_COLLAPSED = 'collapsed';
var WIDTH = 'width';
var HEIGHT = 'height';
var SELECTOR_ACTIVES = '.show, .collapsing';
var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="collapse"]';
XhmikosR's avatar
XhmikosR committed
1825
1826
1827
1828
1829
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
1830

XhmikosR's avatar
XhmikosR committed
1831
var Collapse = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
1832
  function Collapse(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1833
1834
1835
    this._isTransitioning = false;
    this._element = element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
1836
1837
    this._triggerArray = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1 + "[href=\"#" + element.id + "\"]," + (SELECTOR_DATA_TOGGLE$1 + "[data-target=\"#" + element.id + "\"]"));
    var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$1);
XhmikosR's avatar
XhmikosR committed
1838
1839
1840
1841

    for (var i = 0, len = toggleList.length; i < len; i++) {
      var elem = toggleList[i];
      var selector = getSelectorFromElement(elem);
XhmikosR's avatar
XhmikosR committed
1842
      var filterElement = SelectorEngine.find(selector).filter(function (foundElem) {
XhmikosR's avatar
XhmikosR committed
1843
1844
        return foundElem === element;
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866

      if (selector !== null && filterElement.length) {
        this._selector = selector;

        this._triggerArray.push(elem);
      }
    }

    this._parent = this._config.parent ? this._getParent() : null;

    if (!this._config.parent) {
      this._addAriaAndCollapsedClass(this._element, this._triggerArray);
    }

    if (this._config.toggle) {
      this.toggle();
    }

    Data.setData(element, DATA_KEY$3, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
1867
  var _proto = Collapse.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
1868

XhmikosR's avatar
XhmikosR committed
1869
1870
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
XhmikosR committed
1871
    if (this._element.classList.contains(CLASS_NAME_SHOW)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1872
1873
1874
1875
      this.hide();
    } else {
      this.show();
    }
XhmikosR's avatar
XhmikosR committed
1876
1877
1878
1879
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1880

XhmikosR's avatar
XhmikosR committed
1881
    if (this._isTransitioning || this._element.classList.contains(CLASS_NAME_SHOW)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1882
1883
1884
      return;
    }

XhmikosR's avatar
XhmikosR committed
1885
1886
    var actives;
    var activesData;
XhmikosR's avatar
Dist.  
XhmikosR committed
1887
1888

    if (this._parent) {
XhmikosR's avatar
XhmikosR committed
1889
      actives = SelectorEngine.find(SELECTOR_ACTIVES, this._parent).filter(function (elem) {
XhmikosR's avatar
XhmikosR committed
1890
1891
        if (typeof _this._config.parent === 'string') {
          return elem.getAttribute('data-parent') === _this._config.parent;
XhmikosR's avatar
Dist.  
XhmikosR committed
1892
1893
        }

XhmikosR's avatar
XhmikosR committed
1894
        return elem.classList.contains(CLASS_NAME_COLLAPSE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1895
1896
1897
1898
1899
1900
1901
      });

      if (actives.length === 0) {
        actives = null;
      }
    }

XhmikosR's avatar
XhmikosR committed
1902
    var container = SelectorEngine.findOne(this._selector);
XhmikosR's avatar
Dist.  
XhmikosR committed
1903
1904

    if (actives) {
XhmikosR's avatar
XhmikosR committed
1905
1906
1907
      var tempActiveData = actives.filter(function (elem) {
        return container !== elem;
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
1908
1909
1910
1911
1912
1913
1914
      activesData = tempActiveData[0] ? Data.getData(tempActiveData[0], DATA_KEY$3) : null;

      if (activesData && activesData._isTransitioning) {
        return;
      }
    }

XhmikosR's avatar
XhmikosR committed
1915
    var startEvent = EventHandler.trigger(this._element, EVENT_SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
1916
1917
1918
1919
1920
1921

    if (startEvent.defaultPrevented) {
      return;
    }

    if (actives) {
XhmikosR's avatar
XhmikosR committed
1922
      actives.forEach(function (elemActive) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1923
        if (container !== elemActive) {
XhmikosR's avatar
XhmikosR committed
1924
          Collapse.collapseInterface(elemActive, 'hide');
XhmikosR's avatar
Dist.  
XhmikosR committed
1925
1926
1927
1928
1929
1930
1931
1932
        }

        if (!activesData) {
          Data.setData(elemActive, DATA_KEY$3, null);
        }
      });
    }

XhmikosR's avatar
XhmikosR committed
1933
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
1934

XhmikosR's avatar
XhmikosR committed
1935
    this._element.classList.remove(CLASS_NAME_COLLAPSE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1936

XhmikosR's avatar
XhmikosR committed
1937
    this._element.classList.add(CLASS_NAME_COLLAPSING);
XhmikosR's avatar
Dist.  
XhmikosR committed
1938
1939
1940
1941

    this._element.style[dimension] = 0;

    if (this._triggerArray.length) {
XhmikosR's avatar
XhmikosR committed
1942
      this._triggerArray.forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
1943
        element.classList.remove(CLASS_NAME_COLLAPSED);
XhmikosR's avatar
Dist.  
XhmikosR committed
1944
1945
1946
1947
1948
1949
        element.setAttribute('aria-expanded', true);
      });
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
1950
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
1951
      _this._element.classList.remove(CLASS_NAME_COLLAPSING);
XhmikosR's avatar
XhmikosR committed
1952

XhmikosR's avatar
XhmikosR committed
1953
      _this._element.classList.add(CLASS_NAME_COLLAPSE);
XhmikosR's avatar
XhmikosR committed
1954

XhmikosR's avatar
XhmikosR committed
1955
      _this._element.classList.add(CLASS_NAME_SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
1956

XhmikosR's avatar
XhmikosR committed
1957
      _this._element.style[dimension] = '';
XhmikosR's avatar
Dist.  
XhmikosR committed
1958

XhmikosR's avatar
XhmikosR committed
1959
      _this.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
1960

XhmikosR's avatar
XhmikosR committed
1961
      EventHandler.trigger(_this._element, EVENT_SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
1962
1963
    };

XhmikosR's avatar
XhmikosR committed
1964
1965
1966
    var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1);
    var scrollSize = "scroll" + capitalizedDimension;
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
1967
1968
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
1969
1970
1971
1972
1973
    this._element.style[dimension] = this._element[scrollSize] + "px";
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
1974

XhmikosR's avatar
XhmikosR committed
1975
    if (this._isTransitioning || !this._element.classList.contains(CLASS_NAME_SHOW)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
1976
1977
1978
      return;
    }

XhmikosR's avatar
XhmikosR committed
1979
    var startEvent = EventHandler.trigger(this._element, EVENT_HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1980
1981
1982
1983
1984

    if (startEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
1985
    var dimension = this._getDimension();
XhmikosR's avatar
Dist.  
XhmikosR committed
1986

XhmikosR's avatar
XhmikosR committed
1987
    this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
1988
1989
    reflow(this._element);

XhmikosR's avatar
XhmikosR committed
1990
    this._element.classList.add(CLASS_NAME_COLLAPSING);
XhmikosR's avatar
Dist.  
XhmikosR committed
1991

XhmikosR's avatar
XhmikosR committed
1992
    this._element.classList.remove(CLASS_NAME_COLLAPSE);
XhmikosR's avatar
Dist.  
XhmikosR committed
1993

XhmikosR's avatar
XhmikosR committed
1994
    this._element.classList.remove(CLASS_NAME_SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
1995

XhmikosR's avatar
XhmikosR committed
1996
    var triggerArrayLength = this._triggerArray.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
1997
1998

    if (triggerArrayLength > 0) {
XhmikosR's avatar
XhmikosR committed
1999
2000
      for (var i = 0; i < triggerArrayLength; i++) {
        var trigger = this._triggerArray[i];
XhmikosR's avatar
XhmikosR committed
2001
        var elem = getElementFromSelector(trigger);
XhmikosR's avatar
Dist.  
XhmikosR committed
2002

XhmikosR's avatar
XhmikosR committed
2003
2004
        if (elem && !elem.classList.contains(CLASS_NAME_SHOW)) {
          trigger.classList.add(CLASS_NAME_COLLAPSED);
XhmikosR's avatar
XhmikosR committed
2005
          trigger.setAttribute('aria-expanded', false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2006
2007
2008
2009
2010
2011
        }
      }
    }

    this.setTransitioning(true);

XhmikosR's avatar
XhmikosR committed
2012
2013
    var complete = function complete() {
      _this2.setTransitioning(false);
XhmikosR's avatar
Dist.  
XhmikosR committed
2014

XhmikosR's avatar
XhmikosR committed
2015
      _this2._element.classList.remove(CLASS_NAME_COLLAPSING);
XhmikosR's avatar
Dist.  
XhmikosR committed
2016

XhmikosR's avatar
XhmikosR committed
2017
      _this2._element.classList.add(CLASS_NAME_COLLAPSE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2018

XhmikosR's avatar
XhmikosR committed
2019
      EventHandler.trigger(_this2._element, EVENT_HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2020
2021
2022
    };

    this._element.style[dimension] = '';
XhmikosR's avatar
XhmikosR committed
2023
    var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2024
2025
    EventHandler.one(this._element, TRANSITION_END, complete);
    emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
XhmikosR committed
2026
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2027

XhmikosR's avatar
XhmikosR committed
2028
  _proto.setTransitioning = function setTransitioning(isTransitioning) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2029
    this._isTransitioning = isTransitioning;
XhmikosR's avatar
XhmikosR committed
2030
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2031

XhmikosR's avatar
XhmikosR committed
2032
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2033
2034
2035
2036
2037
2038
2039
    Data.removeData(this._element, DATA_KEY$3);
    this._config = null;
    this._parent = null;
    this._element = null;
    this._triggerArray = null;
    this._isTransitioning = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
2040
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2041

XhmikosR's avatar
XhmikosR committed
2042
  _proto._getConfig = function _getConfig(config) {
2043
    config = _objectSpread2({}, Default$1, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2044
2045
2046
2047
    config.toggle = Boolean(config.toggle); // Coerce string values

    typeCheckConfig(NAME$3, config, DefaultType$1);
    return config;
XhmikosR's avatar
XhmikosR committed
2048
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2049

XhmikosR's avatar
XhmikosR committed
2050
  _proto._getDimension = function _getDimension() {
XhmikosR's avatar
XhmikosR committed
2051
    var hasWidth = this._element.classList.contains(WIDTH);
XhmikosR's avatar
Dist.  
XhmikosR committed
2052

XhmikosR's avatar
XhmikosR committed
2053
    return hasWidth ? WIDTH : HEIGHT;
XhmikosR's avatar
XhmikosR committed
2054
2055
2056
2057
  };

  _proto._getParent = function _getParent() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2058

XhmikosR's avatar
XhmikosR committed
2059
    var parent = this._config.parent;
XhmikosR's avatar
Dist.  
XhmikosR committed
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069

    if (isElement(parent)) {
      // it's a jQuery object
      if (typeof parent.jquery !== 'undefined' || typeof parent[0] !== 'undefined') {
        parent = parent[0];
      }
    } else {
      parent = SelectorEngine.findOne(parent);
    }

XhmikosR's avatar
XhmikosR committed
2070
2071
    var selector = SELECTOR_DATA_TOGGLE$1 + "[data-parent=\"" + parent + "\"]";
    SelectorEngine.find(selector, parent).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
2072
      var selected = getElementFromSelector(element);
2073
2074

      _this3._addAriaAndCollapsedClass(selected, [element]);
XhmikosR's avatar
Dist.  
XhmikosR committed
2075
2076
    });
    return parent;
XhmikosR's avatar
XhmikosR committed
2077
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2078

XhmikosR's avatar
XhmikosR committed
2079
  _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2080
    if (element) {
XhmikosR's avatar
XhmikosR committed
2081
      var isOpen = element.classList.contains(CLASS_NAME_SHOW);
XhmikosR's avatar
Dist.  
XhmikosR committed
2082
2083

      if (triggerArray.length) {
XhmikosR's avatar
XhmikosR committed
2084
        triggerArray.forEach(function (elem) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2085
          if (isOpen) {
XhmikosR's avatar
XhmikosR committed
2086
            elem.classList.remove(CLASS_NAME_COLLAPSED);
XhmikosR's avatar
Dist.  
XhmikosR committed
2087
          } else {
XhmikosR's avatar
XhmikosR committed
2088
            elem.classList.add(CLASS_NAME_COLLAPSED);
XhmikosR's avatar
Dist.  
XhmikosR committed
2089
2090
2091
2092
2093
2094
2095
          }

          elem.setAttribute('aria-expanded', isOpen);
        });
      }
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
2096
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2097

XhmikosR's avatar
XhmikosR committed
2098
  Collapse.collapseInterface = function collapseInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
2099
    var data = Data.getData(element, DATA_KEY$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
2100

2101
    var _config = _objectSpread2({}, Default$1, {}, Manipulator.getDataAttributes(element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112

    if (!data && _config.toggle && /show|hide/.test(config)) {
      _config.toggle = false;
    }

    if (!data) {
      data = new Collapse(element, _config);
    }

    if (typeof config === 'string') {
      if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
2113
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2114
2115
2116
2117
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2118
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2119

XhmikosR's avatar
XhmikosR committed
2120
  Collapse.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2121
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2122
      Collapse.collapseInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2123
    });
XhmikosR's avatar
XhmikosR committed
2124
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2125

XhmikosR's avatar
XhmikosR committed
2126
  Collapse.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2127
    return Data.getData(element, DATA_KEY$3);
XhmikosR's avatar
XhmikosR committed
2128
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2129

XhmikosR's avatar
XhmikosR committed
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
  _createClass(Collapse, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$3;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$1;
    }
  }]);

  return Collapse;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
2144
2145
2146
2147
2148
2149
2150
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
2151
EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$1, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2152
2153
2154
2155
2156
  // preventDefault only for <a> elements (which change the URL) not inside the collapsible element
  if (event.target.tagName === 'A') {
    event.preventDefault();
  }

XhmikosR's avatar
XhmikosR committed
2157
2158
  var triggerData = Manipulator.getDataAttributes(this);
  var selector = getSelectorFromElement(this);
XhmikosR's avatar
XhmikosR committed
2159
  var selectorElements = SelectorEngine.find(selector);
XhmikosR's avatar
XhmikosR committed
2160
2161
2162
  selectorElements.forEach(function (element) {
    var data = Data.getData(element, DATA_KEY$3);
    var config;
XhmikosR's avatar
Dist.  
XhmikosR committed
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175

    if (data) {
      // update parent attribute
      if (data._parent === null && typeof triggerData.parent === 'string') {
        data._config.parent = triggerData.parent;
        data._parent = data._getParent();
      }

      config = 'toggle';
    } else {
      config = triggerData;
    }

XhmikosR's avatar
XhmikosR committed
2176
    Collapse.collapseInterface(element, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2177
2178
  });
});
XhmikosR's avatar
XhmikosR committed
2179
var $$4 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2180
2181
2182
2183
2184
2185
2186
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .collapse to jQuery only if jQuery is present
 */

2187
2188
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2189
2190
2191
2192
if ($$4) {
  var JQUERY_NO_CONFLICT$3 = $$4.fn[NAME$3];
  $$4.fn[NAME$3] = Collapse.jQueryInterface;
  $$4.fn[NAME$3].Constructor = Collapse;
XhmikosR's avatar
Dist.  
XhmikosR committed
2193

XhmikosR's avatar
XhmikosR committed
2194
2195
2196
  $$4.fn[NAME$3].noConflict = function () {
    $$4.fn[NAME$3] = JQUERY_NO_CONFLICT$3;
    return Collapse.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2197
2198
2199
2200
2201
2202
2203
2204
2205
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
2206
2207
2208
2209
2210
2211
var NAME$4 = 'dropdown';
var VERSION$4 = '4.3.1';
var DATA_KEY$4 = 'bs.dropdown';
var EVENT_KEY$4 = "." + DATA_KEY$4;
var DATA_API_KEY$4 = '.data-api';
var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key
XhmikosR's avatar
Dist.  
XhmikosR committed
2212

XhmikosR's avatar
XhmikosR committed
2213
var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key
XhmikosR's avatar
Dist.  
XhmikosR committed
2214

XhmikosR's avatar
XhmikosR committed
2215
var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key
XhmikosR's avatar
Dist.  
XhmikosR committed
2216

XhmikosR's avatar
XhmikosR committed
2217
var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
2218

XhmikosR's avatar
XhmikosR committed
2219
var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key
XhmikosR's avatar
Dist.  
XhmikosR committed
2220

XhmikosR's avatar
XhmikosR committed
2221
var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse)
XhmikosR's avatar
Dist.  
XhmikosR committed
2222

XhmikosR's avatar
XhmikosR committed
2223
var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE);
XhmikosR's avatar
XhmikosR committed
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
var EVENT_HIDE$1 = "hide" + EVENT_KEY$4;
var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$4;
var EVENT_SHOW$1 = "show" + EVENT_KEY$4;
var EVENT_SHOWN$1 = "shown" + EVENT_KEY$4;
var EVENT_CLICK = "click" + EVENT_KEY$4;
var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$4 + DATA_API_KEY$4;
var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$4 + DATA_API_KEY$4;
var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$4 + DATA_API_KEY$4;
var CLASS_NAME_DISABLED$1 = 'disabled';
var CLASS_NAME_SHOW$1 = 'show';
var CLASS_NAME_DROPUP = 'dropup';
var CLASS_NAME_DROPRIGHT = 'dropright';
var CLASS_NAME_DROPLEFT = 'dropleft';
var CLASS_NAME_MENURIGHT = 'dropdown-menu-right';
var CLASS_NAME_NAVBAR = 'navbar';
var CLASS_NAME_POSITION_STATIC = 'position-static';
var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]';
var SELECTOR_FORM_CHILD = '.dropdown form';
var SELECTOR_MENU = '.dropdown-menu';
var SELECTOR_NAVBAR_NAV = '.navbar-nav';
var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)';
var PLACEMENT_TOP = 'top-start';
var PLACEMENT_TOPEND = 'top-end';
var PLACEMENT_BOTTOM = 'bottom-start';
var PLACEMENT_BOTTOMEND = 'bottom-end';
var PLACEMENT_RIGHT = 'right-start';
var PLACEMENT_LEFT = 'left-start';
XhmikosR's avatar
XhmikosR committed
2251
var Default$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2252
2253
2254
2255
  offset: 0,
  flip: true,
  boundary: 'scrollParent',
  reference: 'toggle',
XhmikosR's avatar
XhmikosR committed
2256
2257
  display: 'dynamic',
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
2258
};
XhmikosR's avatar
XhmikosR committed
2259
var DefaultType$2 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2260
2261
2262
2263
  offset: '(number|string|function)',
  flip: 'boolean',
  boundary: '(string|element)',
  reference: '(string|element)',
XhmikosR's avatar
XhmikosR committed
2264
2265
  display: 'string',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
2266
};
XhmikosR's avatar
XhmikosR committed
2267
2268
2269
2270
2271
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
2272

XhmikosR's avatar
XhmikosR committed
2273
var Dropdown = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
2274
  function Dropdown(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
    this._element = element;
    this._popper = null;
    this._config = this._getConfig(config);
    this._menu = this._getMenuElement();
    this._inNavbar = this._detectNavbar();

    this._addEventListeners();

    Data.setData(element, DATA_KEY$4, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
2287
  var _proto = Dropdown.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2288

XhmikosR's avatar
XhmikosR committed
2289
2290
  // Public
  _proto.toggle = function toggle() {
XhmikosR's avatar
XhmikosR committed
2291
    if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED$1)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2292
2293
2294
      return;
    }

XhmikosR's avatar
XhmikosR committed
2295
    var isActive = this._element.classList.contains(CLASS_NAME_SHOW$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
2296

XhmikosR's avatar
XhmikosR committed
2297
    Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2298
2299
2300
2301
2302

    if (isActive) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2303
2304
2305
2306
    this.show();
  };

  _proto.show = function show() {
XhmikosR's avatar
XhmikosR committed
2307
    if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED$1) || this._menu.classList.contains(CLASS_NAME_SHOW$1)) {
XhmikosR's avatar
XhmikosR committed
2308
2309
2310
2311
      return;
    }

    var parent = Dropdown.getParentFromElement(this._element);
XhmikosR's avatar
XhmikosR committed
2312
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2313
2314
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2315
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$1, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326

    if (showEvent.defaultPrevented) {
      return;
    } // Disable totally Popper.js for Dropdown in Navbar


    if (!this._inNavbar) {
      if (typeof Popper === 'undefined') {
        throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)');
      }

XhmikosR's avatar
XhmikosR committed
2327
      var referenceElement = this._element;
XhmikosR's avatar
Dist.  
XhmikosR committed
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342

      if (this._config.reference === 'parent') {
        referenceElement = parent;
      } else if (isElement(this._config.reference)) {
        referenceElement = this._config.reference; // Check if it's jQuery element

        if (typeof this._config.reference.jquery !== 'undefined') {
          referenceElement = this._config.reference[0];
        }
      } // 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


      if (this._config.boundary !== 'scrollParent') {
XhmikosR's avatar
XhmikosR committed
2343
        parent.classList.add(CLASS_NAME_POSITION_STATIC);
XhmikosR's avatar
Dist.  
XhmikosR committed
2344
2345
2346
2347
2348
2349
2350
2351
2352
      }

      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


XhmikosR's avatar
XhmikosR committed
2353
2354
2355
2356
    if ('ontouchstart' in document.documentElement && !SelectorEngine.closest(parent, SELECTOR_NAVBAR_NAV)) {
      var _ref;

      (_ref = []).concat.apply(_ref, document.body.children).forEach(function (elem) {
XhmikosR's avatar
XhmikosR committed
2357
2358
        return EventHandler.on(elem, 'mouseover', null, noop());
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2359
2360
2361
2362
2363
2364
    }

    this._element.focus();

    this._element.setAttribute('aria-expanded', true);

XhmikosR's avatar
XhmikosR committed
2365
2366
2367
    Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW$1);
    Manipulator.toggleClass(this._element, CLASS_NAME_SHOW$1);
    EventHandler.trigger(parent, EVENT_SHOWN$1, relatedTarget);
XhmikosR's avatar
XhmikosR committed
2368
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2369

XhmikosR's avatar
XhmikosR committed
2370
  _proto.hide = function hide() {
XhmikosR's avatar
XhmikosR committed
2371
    if (this._element.disabled || this._element.classList.contains(CLASS_NAME_DISABLED$1) || !this._menu.classList.contains(CLASS_NAME_SHOW$1)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2372
2373
2374
      return;
    }

XhmikosR's avatar
XhmikosR committed
2375
    var parent = Dropdown.getParentFromElement(this._element);
XhmikosR's avatar
XhmikosR committed
2376
    var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2377
2378
      relatedTarget: this._element
    };
XhmikosR's avatar
XhmikosR committed
2379
    var hideEvent = EventHandler.trigger(parent, EVENT_HIDE$1, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2380
2381
2382
2383
2384

    if (hideEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2385
2386
2387
2388
    if (this._popper) {
      this._popper.destroy();
    }

XhmikosR's avatar
XhmikosR committed
2389
2390
2391
    Manipulator.toggleClass(this._menu, CLASS_NAME_SHOW$1);
    Manipulator.toggleClass(this._element, CLASS_NAME_SHOW$1);
    EventHandler.trigger(parent, EVENT_HIDDEN$1, relatedTarget);
XhmikosR's avatar
XhmikosR committed
2392
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2393

XhmikosR's avatar
XhmikosR committed
2394
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2395
2396
2397
2398
2399
    Data.removeData(this._element, DATA_KEY$4);
    EventHandler.off(this._element, EVENT_KEY$4);
    this._element = null;
    this._menu = null;

XhmikosR's avatar
XhmikosR committed
2400
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2401
2402
2403
2404
      this._popper.destroy();

      this._popper = null;
    }
XhmikosR's avatar
XhmikosR committed
2405
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2406

XhmikosR's avatar
XhmikosR committed
2407
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2408
2409
    this._inNavbar = this._detectNavbar();

XhmikosR's avatar
XhmikosR committed
2410
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2411
2412
2413
      this._popper.scheduleUpdate();
    }
  } // Private
XhmikosR's avatar
XhmikosR committed
2414
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2415

XhmikosR's avatar
XhmikosR committed
2416
2417
  _proto._addEventListeners = function _addEventListeners() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2418

XhmikosR's avatar
XhmikosR committed
2419
    EventHandler.on(this._element, EVENT_CLICK, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2420
2421
      event.preventDefault();
      event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2422
2423

      _this.toggle();
XhmikosR's avatar
Dist.  
XhmikosR committed
2424
    });
XhmikosR's avatar
XhmikosR committed
2425
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2426

XhmikosR's avatar
XhmikosR committed
2427
  _proto._getConfig = function _getConfig(config) {
2428
    config = _objectSpread2({}, this.constructor.Default, {}, Manipulator.getDataAttributes(this._element), {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2429
2430
    typeCheckConfig(NAME$4, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
2431
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2432

XhmikosR's avatar
XhmikosR committed
2433
  _proto._getMenuElement = function _getMenuElement() {
XhmikosR's avatar
XhmikosR committed
2434
    return SelectorEngine.next(this._element, SELECTOR_MENU)[0];
XhmikosR's avatar
XhmikosR committed
2435
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2436

XhmikosR's avatar
XhmikosR committed
2437
2438
  _proto._getPlacement = function _getPlacement() {
    var parentDropdown = this._element.parentNode;
XhmikosR's avatar
XhmikosR committed
2439
    var placement = PLACEMENT_BOTTOM; // Handle dropup
XhmikosR's avatar
Dist.  
XhmikosR committed
2440

XhmikosR's avatar
XhmikosR committed
2441
2442
    if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {
      placement = PLACEMENT_TOP;
XhmikosR's avatar
Dist.  
XhmikosR committed
2443

XhmikosR's avatar
XhmikosR committed
2444
2445
      if (this._menu.classList.contains(CLASS_NAME_MENURIGHT)) {
        placement = PLACEMENT_TOPEND;
XhmikosR's avatar
Dist.  
XhmikosR committed
2446
      }
XhmikosR's avatar
XhmikosR committed
2447
2448
2449
2450
2451
2452
    } else if (parentDropdown.classList.contains(CLASS_NAME_DROPRIGHT)) {
      placement = PLACEMENT_RIGHT;
    } else if (parentDropdown.classList.contains(CLASS_NAME_DROPLEFT)) {
      placement = PLACEMENT_LEFT;
    } else if (this._menu.classList.contains(CLASS_NAME_MENURIGHT)) {
      placement = PLACEMENT_BOTTOMEND;
XhmikosR's avatar
Dist.  
XhmikosR committed
2453
2454
2455
    }

    return placement;
XhmikosR's avatar
XhmikosR committed
2456
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2457

XhmikosR's avatar
XhmikosR committed
2458
  _proto._detectNavbar = function _detectNavbar() {
XhmikosR's avatar
XhmikosR committed
2459
    return Boolean(SelectorEngine.closest(this._element, "." + CLASS_NAME_NAVBAR));
XhmikosR's avatar
XhmikosR committed
2460
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2461

XhmikosR's avatar
XhmikosR committed
2462
2463
2464
2465
  _proto._getOffset = function _getOffset() {
    var _this2 = this;

    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
2466
2467

    if (typeof this._config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
2468
      offset.fn = function (data) {
2469
        data.offsets = _objectSpread2({}, data.offsets, {}, _this2._config.offset(data.offsets, _this2._element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
2470
2471
2472
2473
2474
2475
2476
        return data;
      };
    } else {
      offset.offset = this._config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
2477
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2478

XhmikosR's avatar
XhmikosR committed
2479
2480
  _proto._getPopperConfig = function _getPopperConfig() {
    var popperConfig = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2481
2482
2483
2484
2485
2486
2487
2488
2489
      placement: this._getPlacement(),
      modifiers: {
        offset: this._getOffset(),
        flip: {
          enabled: this._config.flip
        },
        preventOverflow: {
          boundariesElement: this._config.boundary
        }
XhmikosR's avatar
XhmikosR committed
2490
2491
      }
    }; // Disable Popper.js if we have a static display
XhmikosR's avatar
Dist.  
XhmikosR committed
2492
2493
2494
2495
2496
2497
2498

    if (this._config.display === 'static') {
      popperConfig.modifiers.applyStyle = {
        enabled: false
      };
    }

XhmikosR's avatar
XhmikosR committed
2499
    return _objectSpread2({}, popperConfig, {}, this._config.popperConfig);
XhmikosR's avatar
Dist.  
XhmikosR committed
2500
  } // Static
XhmikosR's avatar
XhmikosR committed
2501
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2502

XhmikosR's avatar
XhmikosR committed
2503
  Dropdown.dropdownInterface = function dropdownInterface(element, config) {
XhmikosR's avatar
XhmikosR committed
2504
    var data = Data.getData(element, DATA_KEY$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
2505

XhmikosR's avatar
XhmikosR committed
2506
    var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
2507
2508
2509
2510
2511
2512
2513

    if (!data) {
      data = new Dropdown(element, _config);
    }

    if (typeof config === 'string') {
      if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
2514
        throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
2515
2516
2517
2518
      }

      data[config]();
    }
XhmikosR's avatar
XhmikosR committed
2519
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2520

XhmikosR's avatar
XhmikosR committed
2521
  Dropdown.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2522
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
2523
      Dropdown.dropdownInterface(this, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2524
    });
XhmikosR's avatar
XhmikosR committed
2525
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2526

XhmikosR's avatar
XhmikosR committed
2527
  Dropdown.clearMenus = function clearMenus(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2528
2529
2530
2531
    if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2532
    var toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
2533

XhmikosR's avatar
XhmikosR committed
2534
    for (var i = 0, len = toggles.length; i < len; i++) {
XhmikosR's avatar
XhmikosR committed
2535
      var parent = Dropdown.getParentFromElement(toggles[i]);
XhmikosR's avatar
XhmikosR committed
2536
2537
      var context = Data.getData(toggles[i], DATA_KEY$4);
      var relatedTarget = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
        relatedTarget: toggles[i]
      };

      if (event && event.type === 'click') {
        relatedTarget.clickEvent = event;
      }

      if (!context) {
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2549
      var dropdownMenu = context._menu;
XhmikosR's avatar
Dist.  
XhmikosR committed
2550

XhmikosR's avatar
XhmikosR committed
2551
      if (!toggles[i].classList.contains(CLASS_NAME_SHOW$1)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2552
2553
2554
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2555
      if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && dropdownMenu.contains(event.target)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2556
2557
2558
        continue;
      }

XhmikosR's avatar
XhmikosR committed
2559
      var hideEvent = EventHandler.trigger(parent, EVENT_HIDE$1, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2560
2561
2562
2563
2564
2565
2566
2567

      if (hideEvent.defaultPrevented) {
        continue;
      } // If this is a touch-enabled device we remove the extra
      // empty mouseover listeners we added for iOS support


      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
2568
2569
2570
        var _ref2;

        (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (elem) {
XhmikosR's avatar
XhmikosR committed
2571
2572
          return EventHandler.off(elem, 'mouseover', null, noop());
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
2573
2574
2575
      }

      toggles[i].setAttribute('aria-expanded', 'false');
XhmikosR's avatar
XhmikosR committed
2576
2577
2578
2579
2580

      if (context._popper) {
        context._popper.destroy();
      }

XhmikosR's avatar
XhmikosR committed
2581
2582
2583
      dropdownMenu.classList.remove(CLASS_NAME_SHOW$1);
      toggles[i].classList.remove(CLASS_NAME_SHOW$1);
      EventHandler.trigger(parent, EVENT_HIDDEN$1, relatedTarget);
XhmikosR's avatar
Dist.  
XhmikosR committed
2584
    }
XhmikosR's avatar
XhmikosR committed
2585
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2586

XhmikosR's avatar
XhmikosR committed
2587
2588
  Dropdown.getParentFromElement = function getParentFromElement(element) {
    return getElementFromSelector(element) || element.parentNode;
XhmikosR's avatar
XhmikosR committed
2589
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2590

XhmikosR's avatar
XhmikosR committed
2591
  Dropdown.dataApiKeydownHandler = function dataApiKeydownHandler(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2592
2593
2594
2595
2596
2597
2598
    // 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
XhmikosR's avatar
XhmikosR committed
2599
    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 || SelectorEngine.closest(event.target, SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.which)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2600
2601
2602
2603
2604
2605
      return;
    }

    event.preventDefault();
    event.stopPropagation();

XhmikosR's avatar
XhmikosR committed
2606
    if (this.disabled || this.classList.contains(CLASS_NAME_DISABLED$1)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2607
2608
2609
      return;
    }

XhmikosR's avatar
XhmikosR committed
2610
    var parent = Dropdown.getParentFromElement(this);
XhmikosR's avatar
XhmikosR committed
2611
    var isActive = this.classList.contains(CLASS_NAME_SHOW$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
2612

XhmikosR's avatar
XhmikosR committed
2613
2614
2615
2616
2617
2618
    if (event.which === ESCAPE_KEYCODE) {
      var button = this.matches(SELECTOR_DATA_TOGGLE$2) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$2)[0];
      button.focus();
      Dropdown.clearMenus();
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
2619

XhmikosR's avatar
XhmikosR committed
2620
    if (!isActive || event.which === SPACE_KEYCODE) {
XhmikosR's avatar
XhmikosR committed
2621
      Dropdown.clearMenus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2622
2623
2624
      return;
    }

XhmikosR's avatar
XhmikosR committed
2625
    var items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, parent).filter(isVisible);
XhmikosR's avatar
Dist.  
XhmikosR committed
2626
2627
2628
2629
2630

    if (!items.length) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2631
    var index = items.indexOf(event.target) || 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643

    if (event.which === ARROW_UP_KEYCODE && index > 0) {
      // Up
      index--;
    }

    if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) {
      // Down
      index++;
    }

    items[index].focus();
XhmikosR's avatar
XhmikosR committed
2644
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2645

XhmikosR's avatar
XhmikosR committed
2646
  Dropdown.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2647
    return Data.getData(element, DATA_KEY$4);
XhmikosR's avatar
XhmikosR committed
2648
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2649

XhmikosR's avatar
XhmikosR committed
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
  _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;
    }
  }]);

  return Dropdown;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
2669
2670
2671
2672
2673
2674
2675
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
2676
2677
2678
2679
2680
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown.dataApiKeydownHandler);
EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler);
EventHandler.on(document, EVENT_CLICK_DATA_API$4, Dropdown.clearMenus);
EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus);
EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$2, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2681
2682
  event.preventDefault();
  event.stopPropagation();
XhmikosR's avatar
XhmikosR committed
2683
  Dropdown.dropdownInterface(this, 'toggle');
XhmikosR's avatar
Dist.  
XhmikosR committed
2684
});
XhmikosR's avatar
XhmikosR committed
2685
EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_FORM_CHILD, function (e) {
XhmikosR's avatar
XhmikosR committed
2686
2687
  return e.stopPropagation();
});
XhmikosR's avatar
XhmikosR committed
2688
var $$5 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
2689
2690
2691
2692
2693
2694
2695
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .dropdown to jQuery only if jQuery is present
 */

2696
2697
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
2698
2699
2700
2701
if ($$5) {
  var JQUERY_NO_CONFLICT$4 = $$5.fn[NAME$4];
  $$5.fn[NAME$4] = Dropdown.jQueryInterface;
  $$5.fn[NAME$4].Constructor = Dropdown;
XhmikosR's avatar
Dist.  
XhmikosR committed
2702

XhmikosR's avatar
XhmikosR committed
2703
2704
2705
  $$5.fn[NAME$4].noConflict = function () {
    $$5.fn[NAME$4] = JQUERY_NO_CONFLICT$4;
    return Dropdown.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
2706
2707
2708
2709
2710
2711
2712
2713
2714
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
2715
2716
2717
2718
2719
2720
var NAME$5 = 'modal';
var VERSION$5 = '4.3.1';
var DATA_KEY$5 = 'bs.modal';
var EVENT_KEY$5 = "." + DATA_KEY$5;
var DATA_API_KEY$5 = '.data-api';
var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key
XhmikosR's avatar
Dist.  
XhmikosR committed
2721

XhmikosR's avatar
XhmikosR committed
2722
var Default$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2723
2724
2725
2726
2727
  backdrop: true,
  keyboard: true,
  focus: true,
  show: true
};
XhmikosR's avatar
XhmikosR committed
2728
var DefaultType$3 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
2729
2730
2731
2732
2733
  backdrop: '(boolean|string)',
  keyboard: 'boolean',
  focus: 'boolean',
  show: 'boolean'
};
XhmikosR's avatar
XhmikosR committed
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
var EVENT_HIDE$2 = "hide" + EVENT_KEY$5;
var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5;
var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5;
var EVENT_SHOW$2 = "show" + EVENT_KEY$5;
var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5;
var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5;
var EVENT_RESIZE = "resize" + EVENT_KEY$5;
var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY$5;
var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5;
var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5;
var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5;
var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$5 + DATA_API_KEY$5;
var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable';
var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure';
var CLASS_NAME_BACKDROP = 'modal-backdrop';
var CLASS_NAME_OPEN = 'modal-open';
var CLASS_NAME_FADE = 'fade';
var CLASS_NAME_SHOW$2 = 'show';
var CLASS_NAME_STATIC = 'modal-static';
var SELECTOR_DIALOG = '.modal-dialog';
var SELECTOR_MODAL_BODY = '.modal-body';
var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="modal"]';
var SELECTOR_DATA_DISMISS = '[data-dismiss="modal"]';
var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top';
var SELECTOR_STICKY_CONTENT = '.sticky-top';
XhmikosR's avatar
XhmikosR committed
2759
2760
2761
2762
2763
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
2764

XhmikosR's avatar
XhmikosR committed
2765
var Modal = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
2766
  function Modal(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2767
2768
    this._config = this._getConfig(config);
    this._element = element;
XhmikosR's avatar
XhmikosR committed
2769
    this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, element);
XhmikosR's avatar
Dist.  
XhmikosR committed
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
    this._backdrop = null;
    this._isShown = false;
    this._isBodyOverflowing = false;
    this._ignoreBackdropClick = false;
    this._isTransitioning = false;
    this._scrollbarWidth = 0;
    Data.setData(element, DATA_KEY$5, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
2780
  var _proto = Modal.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
2781

XhmikosR's avatar
XhmikosR committed
2782
2783
  // Public
  _proto.toggle = function toggle(relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2784
    return this._isShown ? this.hide() : this.show(relatedTarget);
XhmikosR's avatar
XhmikosR committed
2785
2786
2787
2788
  };

  _proto.show = function show(relatedTarget) {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2789
2790
2791
2792
2793

    if (this._isShown || this._isTransitioning) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2794
    if (this._element.classList.contains(CLASS_NAME_FADE)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2795
2796
2797
      this._isTransitioning = true;
    }

XhmikosR's avatar
XhmikosR committed
2798
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, {
XhmikosR's avatar
XhmikosR committed
2799
      relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
    });

    if (this._isShown || showEvent.defaultPrevented) {
      return;
    }

    this._isShown = true;

    this._checkScrollbar();

    this._setScrollbar();

    this._adjustDialog();

    this._setEscapeEvent();

    this._setResizeEvent();

XhmikosR's avatar
XhmikosR committed
2818
    EventHandler.on(this._element, EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function (event) {
XhmikosR's avatar
XhmikosR committed
2819
2820
      return _this.hide(event);
    });
XhmikosR's avatar
XhmikosR committed
2821
2822
    EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, function () {
      EventHandler.one(_this._element, EVENT_MOUSEUP_DISMISS, function (event) {
XhmikosR's avatar
XhmikosR committed
2823
2824
        if (event.target === _this._element) {
          _this._ignoreBackdropClick = true;
XhmikosR's avatar
Dist.  
XhmikosR committed
2825
2826
2827
2828
        }
      });
    });

XhmikosR's avatar
XhmikosR committed
2829
2830
2831
2832
2833
2834
2835
    this._showBackdrop(function () {
      return _this._showElement(relatedTarget);
    });
  };

  _proto.hide = function hide(event) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2836
2837
2838
2839
2840
2841
2842
2843
2844

    if (event) {
      event.preventDefault();
    }

    if (!this._isShown || this._isTransitioning) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
2845
    var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
2846

2847
    if (hideEvent.defaultPrevented) {
XhmikosR's avatar
Dist.  
XhmikosR committed
2848
2849
2850
2851
2852
      return;
    }

    this._isShown = false;

XhmikosR's avatar
XhmikosR committed
2853
    var transition = this._element.classList.contains(CLASS_NAME_FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2854
2855
2856
2857
2858
2859
2860
2861
2862

    if (transition) {
      this._isTransitioning = true;
    }

    this._setEscapeEvent();

    this._setResizeEvent();

XhmikosR's avatar
XhmikosR committed
2863
    EventHandler.off(document, EVENT_FOCUSIN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2864

XhmikosR's avatar
XhmikosR committed
2865
    this._element.classList.remove(CLASS_NAME_SHOW$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
2866

XhmikosR's avatar
XhmikosR committed
2867
2868
    EventHandler.off(this._element, EVENT_CLICK_DISMISS);
    EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS);
XhmikosR's avatar
Dist.  
XhmikosR committed
2869
2870

    if (transition) {
XhmikosR's avatar
XhmikosR committed
2871
2872
2873
2874
      var transitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, function (event) {
        return _this2._hideModal(event);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
2875
2876
2877
2878
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      this._hideModal();
    }
XhmikosR's avatar
XhmikosR committed
2879
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2880

XhmikosR's avatar
XhmikosR committed
2881
2882
2883
2884
  _proto.dispose = function dispose() {
    [window, this._element, this._dialog].forEach(function (htmlElement) {
      return EventHandler.off(htmlElement, EVENT_KEY$5);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
2885
    /**
XhmikosR's avatar
XhmikosR committed
2886
     * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API`
XhmikosR's avatar
Dist.  
XhmikosR committed
2887
     * Do not move `document` in `htmlElements` array
XhmikosR's avatar
XhmikosR committed
2888
     * It will remove `EVENT_CLICK_DATA_API` event that should remain
XhmikosR's avatar
Dist.  
XhmikosR committed
2889
2890
     */

XhmikosR's avatar
XhmikosR committed
2891
    EventHandler.off(document, EVENT_FOCUSIN);
XhmikosR's avatar
Dist.  
XhmikosR committed
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
    Data.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;
XhmikosR's avatar
XhmikosR committed
2902
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
2903

XhmikosR's avatar
XhmikosR committed
2904
  _proto.handleUpdate = function handleUpdate() {
XhmikosR's avatar
Dist.  
XhmikosR committed
2905
2906
    this._adjustDialog();
  } // Private
XhmikosR's avatar
XhmikosR committed
2907
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
2908

XhmikosR's avatar
XhmikosR committed
2909
  _proto._getConfig = function _getConfig(config) {
2910
    config = _objectSpread2({}, Default$3, {}, config);
XhmikosR's avatar
Dist.  
XhmikosR committed
2911
2912
    typeCheckConfig(NAME$5, config, DefaultType$3);
    return config;
XhmikosR's avatar
XhmikosR committed
2913
2914
2915
2916
  };

  _proto._showElement = function _showElement(relatedTarget) {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2917

XhmikosR's avatar
XhmikosR committed
2918
    var transition = this._element.classList.contains(CLASS_NAME_FADE);
XhmikosR's avatar
Dist.  
XhmikosR committed
2919

XhmikosR's avatar
XhmikosR committed
2920
    var modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog);
XhmikosR's avatar
XhmikosR committed
2921

XhmikosR's avatar
Dist.  
XhmikosR committed
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
    if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {
      // Don't move modal's DOM position
      document.body.appendChild(this._element);
    }

    this._element.style.display = 'block';

    this._element.removeAttribute('aria-hidden');

    this._element.setAttribute('aria-modal', true);

XhmikosR's avatar
XhmikosR committed
2933
    if (this._dialog.classList.contains(CLASS_NAME_SCROLLABLE) && modalBody) {
XhmikosR's avatar
XhmikosR committed
2934
      modalBody.scrollTop = 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
2935
2936
2937
2938
2939
2940
2941
2942
    } else {
      this._element.scrollTop = 0;
    }

    if (transition) {
      reflow(this._element);
    }

XhmikosR's avatar
XhmikosR committed
2943
    this._element.classList.add(CLASS_NAME_SHOW$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
2944
2945
2946
2947
2948

    if (this._config.focus) {
      this._enforceFocus();
    }

XhmikosR's avatar
XhmikosR committed
2949
2950
2951
    var transitionComplete = function transitionComplete() {
      if (_this3._config.focus) {
        _this3._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2952
2953
      }

XhmikosR's avatar
XhmikosR committed
2954
      _this3._isTransitioning = false;
XhmikosR's avatar
XhmikosR committed
2955
      EventHandler.trigger(_this3._element, EVENT_SHOWN$2, {
XhmikosR's avatar
XhmikosR committed
2956
        relatedTarget: relatedTarget
XhmikosR's avatar
Dist.  
XhmikosR committed
2957
2958
2959
2960
      });
    };

    if (transition) {
XhmikosR's avatar
XhmikosR committed
2961
      var transitionDuration = getTransitionDurationFromElement(this._dialog);
XhmikosR's avatar
Dist.  
XhmikosR committed
2962
2963
2964
2965
2966
      EventHandler.one(this._dialog, TRANSITION_END, transitionComplete);
      emulateTransitionEnd(this._dialog, transitionDuration);
    } else {
      transitionComplete();
    }
XhmikosR's avatar
XhmikosR committed
2967
2968
2969
2970
  };

  _proto._enforceFocus = function _enforceFocus() {
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2971

XhmikosR's avatar
XhmikosR committed
2972
    EventHandler.off(document, EVENT_FOCUSIN); // guard against infinite focus loop
XhmikosR's avatar
Dist.  
XhmikosR committed
2973

XhmikosR's avatar
XhmikosR committed
2974
    EventHandler.on(document, EVENT_FOCUSIN, function (event) {
XhmikosR's avatar
XhmikosR committed
2975
2976
      if (document !== event.target && _this4._element !== event.target && !_this4._element.contains(event.target)) {
        _this4._element.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
2977
2978
      }
    });
XhmikosR's avatar
XhmikosR committed
2979
2980
2981
2982
  };

  _proto._setEscapeEvent = function _setEscapeEvent() {
    var _this5 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
2983

XhmikosR's avatar
XhmikosR committed
2984
2985
2986
2987
2988
2989
2990
    if (this._isShown) {
      EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) {
        if (_this5._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
          event.preventDefault();

          _this5.hide();
        } else if (!_this5._config.keyboard && event.which === ESCAPE_KEYCODE$1) {
XhmikosR's avatar
XhmikosR committed
2991
          _this5._triggerBackdropTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
2992
2993
        }
      });
2994
    } else {
XhmikosR's avatar
XhmikosR committed
2995
      EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS);
XhmikosR's avatar
Dist.  
XhmikosR committed
2996
    }
XhmikosR's avatar
XhmikosR committed
2997
2998
2999
3000
  };

  _proto._setResizeEvent = function _setResizeEvent() {
    var _this6 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3001
3002

    if (this._isShown) {
XhmikosR's avatar
XhmikosR committed
3003
      EventHandler.on(window, EVENT_RESIZE, function () {
3004
        return _this6._adjustDialog();
XhmikosR's avatar
XhmikosR committed
3005
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3006
    } else {
XhmikosR's avatar
XhmikosR committed
3007
      EventHandler.off(window, EVENT_RESIZE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3008
    }
XhmikosR's avatar
XhmikosR committed
3009
3010
3011
3012
  };

  _proto._hideModal = function _hideModal() {
    var _this7 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3013
3014
3015
3016
3017
3018
3019
3020
3021

    this._element.style.display = 'none';

    this._element.setAttribute('aria-hidden', true);

    this._element.removeAttribute('aria-modal');

    this._isTransitioning = false;

XhmikosR's avatar
XhmikosR committed
3022
    this._showBackdrop(function () {
XhmikosR's avatar
XhmikosR committed
3023
      document.body.classList.remove(CLASS_NAME_OPEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3024

XhmikosR's avatar
XhmikosR committed
3025
      _this7._resetAdjustments();
XhmikosR's avatar
Dist.  
XhmikosR committed
3026

XhmikosR's avatar
XhmikosR committed
3027
      _this7._resetScrollbar();
XhmikosR's avatar
Dist.  
XhmikosR committed
3028

XhmikosR's avatar
XhmikosR committed
3029
      EventHandler.trigger(_this7._element, EVENT_HIDDEN$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
3030
    });
XhmikosR's avatar
XhmikosR committed
3031
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3032

XhmikosR's avatar
XhmikosR committed
3033
  _proto._removeBackdrop = function _removeBackdrop() {
3034
    this._backdrop.parentNode.removeChild(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3035

3036
    this._backdrop = null;
XhmikosR's avatar
XhmikosR committed
3037
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3038

XhmikosR's avatar
XhmikosR committed
3039
3040
3041
  _proto._showBackdrop = function _showBackdrop(callback) {
    var _this8 = this;

XhmikosR's avatar
XhmikosR committed
3042
    var animate = this._element.classList.contains(CLASS_NAME_FADE) ? CLASS_NAME_FADE : '';
XhmikosR's avatar
Dist.  
XhmikosR committed
3043
3044
3045

    if (this._isShown && this._config.backdrop) {
      this._backdrop = document.createElement('div');
XhmikosR's avatar
XhmikosR committed
3046
      this._backdrop.className = CLASS_NAME_BACKDROP;
XhmikosR's avatar
Dist.  
XhmikosR committed
3047
3048
3049
3050
3051
3052

      if (animate) {
        this._backdrop.classList.add(animate);
      }

      document.body.appendChild(this._backdrop);
XhmikosR's avatar
XhmikosR committed
3053
      EventHandler.on(this._element, EVENT_CLICK_DISMISS, function (event) {
XhmikosR's avatar
XhmikosR committed
3054
3055
        if (_this8._ignoreBackdropClick) {
          _this8._ignoreBackdropClick = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3056
3057
3058
3059
3060
3061
3062
          return;
        }

        if (event.target !== event.currentTarget) {
          return;
        }

XhmikosR's avatar
XhmikosR committed
3063
        _this8._triggerBackdropTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3064
3065
3066
3067
3068
3069
      });

      if (animate) {
        reflow(this._backdrop);
      }

XhmikosR's avatar
XhmikosR committed
3070
      this._backdrop.classList.add(CLASS_NAME_SHOW$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
3071
3072
3073
3074
3075
3076

      if (!animate) {
        callback();
        return;
      }

XhmikosR's avatar
XhmikosR committed
3077
      var backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);
XhmikosR's avatar
Dist.  
XhmikosR committed
3078
3079
3080
      EventHandler.one(this._backdrop, TRANSITION_END, callback);
      emulateTransitionEnd(this._backdrop, backdropTransitionDuration);
    } else if (!this._isShown && this._backdrop) {
XhmikosR's avatar
XhmikosR committed
3081
      this._backdrop.classList.remove(CLASS_NAME_SHOW$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
3082

XhmikosR's avatar
XhmikosR committed
3083
3084
      var callbackRemove = function callbackRemove() {
        _this8._removeBackdrop();
XhmikosR's avatar
Dist.  
XhmikosR committed
3085

3086
        callback();
XhmikosR's avatar
Dist.  
XhmikosR committed
3087
3088
      };

XhmikosR's avatar
XhmikosR committed
3089
      if (this._element.classList.contains(CLASS_NAME_FADE)) {
XhmikosR's avatar
XhmikosR committed
3090
3091
        var _backdropTransitionDuration = getTransitionDurationFromElement(this._backdrop);

XhmikosR's avatar
Dist.  
XhmikosR committed
3092
        EventHandler.one(this._backdrop, TRANSITION_END, callbackRemove);
XhmikosR's avatar
XhmikosR committed
3093
        emulateTransitionEnd(this._backdrop, _backdropTransitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
3094
3095
3096
      } else {
        callbackRemove();
      }
3097
    } else {
XhmikosR's avatar
Dist.  
XhmikosR committed
3098
3099
      callback();
    }
XhmikosR's avatar
XhmikosR committed
3100
3101
3102
3103
3104
3105
  };

  _proto._triggerBackdropTransition = function _triggerBackdropTransition() {
    var _this9 = this;

    if (this._config.backdrop === 'static') {
XhmikosR's avatar
XhmikosR committed
3106
      var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED);
XhmikosR's avatar
XhmikosR committed
3107
3108
3109
3110
3111

      if (hideEvent.defaultPrevented) {
        return;
      }

XhmikosR's avatar
XhmikosR committed
3112
      this._element.classList.add(CLASS_NAME_STATIC);
XhmikosR's avatar
XhmikosR committed
3113
3114
3115

      var modalTransitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, function () {
XhmikosR's avatar
XhmikosR committed
3116
        _this9._element.classList.remove(CLASS_NAME_STATIC);
XhmikosR's avatar
XhmikosR committed
3117
3118
3119
3120
3121
3122
3123
      });
      emulateTransitionEnd(this._element, modalTransitionDuration);

      this._element.focus();
    } else {
      this.hide();
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
3124
3125
3126
  } // ----------------------------------------------------------------------
  // the following methods are used to handle overflowing modals
  // ----------------------------------------------------------------------
XhmikosR's avatar
XhmikosR committed
3127
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3128

XhmikosR's avatar
XhmikosR committed
3129
3130
  _proto._adjustDialog = function _adjustDialog() {
    var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight;
XhmikosR's avatar
Dist.  
XhmikosR committed
3131
3132

    if (!this._isBodyOverflowing && isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3133
      this._element.style.paddingLeft = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3134
3135
3136
    }

    if (this._isBodyOverflowing && !isModalOverflowing) {
XhmikosR's avatar
XhmikosR committed
3137
      this._element.style.paddingRight = this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3138
    }
XhmikosR's avatar
XhmikosR committed
3139
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3140

XhmikosR's avatar
XhmikosR committed
3141
  _proto._resetAdjustments = function _resetAdjustments() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3142
3143
    this._element.style.paddingLeft = '';
    this._element.style.paddingRight = '';
XhmikosR's avatar
XhmikosR committed
3144
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3145

XhmikosR's avatar
XhmikosR committed
3146
3147
  _proto._checkScrollbar = function _checkScrollbar() {
    var rect = document.body.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
3148
3149
    this._isBodyOverflowing = rect.left + rect.right < window.innerWidth;
    this._scrollbarWidth = this._getScrollbarWidth();
XhmikosR's avatar
XhmikosR committed
3150
3151
3152
  };

  _proto._setScrollbar = function _setScrollbar() {
XhmikosR's avatar
XhmikosR committed
3153
    var _this10 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3154
3155
3156
3157
3158

    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
      // Adjust fixed content padding
XhmikosR's avatar
XhmikosR committed
3159
      SelectorEngine.find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
3160
3161
        var actualPadding = element.style.paddingRight;
        var calculatedPadding = window.getComputedStyle(element)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3162
        Manipulator.setDataAttribute(element, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3163
        element.style.paddingRight = parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3164
3165
      }); // Adjust sticky content margin

XhmikosR's avatar
XhmikosR committed
3166
      SelectorEngine.find(SELECTOR_STICKY_CONTENT).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
3167
3168
        var actualMargin = element.style.marginRight;
        var calculatedMargin = window.getComputedStyle(element)['margin-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3169
        Manipulator.setDataAttribute(element, 'margin-right', actualMargin);
XhmikosR's avatar
XhmikosR committed
3170
        element.style.marginRight = parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3171
3172
      }); // Adjust body padding

XhmikosR's avatar
XhmikosR committed
3173
3174
      var actualPadding = document.body.style.paddingRight;
      var calculatedPadding = window.getComputedStyle(document.body)['padding-right'];
XhmikosR's avatar
Dist.  
XhmikosR committed
3175
      Manipulator.setDataAttribute(document.body, 'padding-right', actualPadding);
XhmikosR's avatar
XhmikosR committed
3176
      document.body.style.paddingRight = parseFloat(calculatedPadding) + this._scrollbarWidth + "px";
XhmikosR's avatar
Dist.  
XhmikosR committed
3177
3178
    }

XhmikosR's avatar
XhmikosR committed
3179
    document.body.classList.add(CLASS_NAME_OPEN);
XhmikosR's avatar
XhmikosR committed
3180
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3181

XhmikosR's avatar
XhmikosR committed
3182
  _proto._resetScrollbar = function _resetScrollbar() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3183
    // Restore fixed content padding
XhmikosR's avatar
XhmikosR committed
3184
    SelectorEngine.find(SELECTOR_FIXED_CONTENT).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
3185
      var padding = Manipulator.getDataAttribute(element, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3186
3187
3188
3189
3190
3191
3192

      if (typeof padding !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'padding-right');
        element.style.paddingRight = padding;
      }
    }); // Restore sticky content and navbar-toggler margin

XhmikosR's avatar
XhmikosR committed
3193
    SelectorEngine.find("" + SELECTOR_STICKY_CONTENT).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
3194
      var margin = Manipulator.getDataAttribute(element, 'margin-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3195
3196
3197
3198
3199
3200
3201

      if (typeof margin !== 'undefined') {
        Manipulator.removeDataAttribute(element, 'margin-right');
        element.style.marginRight = margin;
      }
    }); // Restore body padding

XhmikosR's avatar
XhmikosR committed
3202
    var padding = Manipulator.getDataAttribute(document.body, 'padding-right');
XhmikosR's avatar
Dist.  
XhmikosR committed
3203
3204
3205
3206
3207
3208
3209

    if (typeof padding === 'undefined') {
      document.body.style.paddingRight = '';
    } else {
      Manipulator.removeDataAttribute(document.body, 'padding-right');
      document.body.style.paddingRight = padding;
    }
XhmikosR's avatar
XhmikosR committed
3210
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3211

XhmikosR's avatar
XhmikosR committed
3212
  _proto._getScrollbarWidth = function _getScrollbarWidth() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3213
    // thx d.walsh
XhmikosR's avatar
XhmikosR committed
3214
    var scrollDiv = document.createElement('div');
XhmikosR's avatar
XhmikosR committed
3215
    scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER;
XhmikosR's avatar
Dist.  
XhmikosR committed
3216
    document.body.appendChild(scrollDiv);
XhmikosR's avatar
XhmikosR committed
3217
    var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth;
XhmikosR's avatar
Dist.  
XhmikosR committed
3218
3219
3220
    document.body.removeChild(scrollDiv);
    return scrollbarWidth;
  } // Static
XhmikosR's avatar
XhmikosR committed
3221
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3222

XhmikosR's avatar
XhmikosR committed
3223
  Modal.jQueryInterface = function jQueryInterface(config, relatedTarget) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3224
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
3225
      var data = Data.getData(this, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3226

3227
      var _config = _objectSpread2({}, Default$3, {}, Manipulator.getDataAttributes(this), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3228
3229
3230
3231
3232
3233
3234

      if (!data) {
        data = new Modal(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
3235
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
3236
3237
3238
3239
3240
3241
3242
        }

        data[config](relatedTarget);
      } else if (_config.show) {
        data.show(relatedTarget);
      }
    });
XhmikosR's avatar
XhmikosR committed
3243
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3244

XhmikosR's avatar
XhmikosR committed
3245
  Modal.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3246
    return Data.getData(element, DATA_KEY$5);
XhmikosR's avatar
XhmikosR committed
3247
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3248

XhmikosR's avatar
XhmikosR committed
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
  _createClass(Modal, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$5;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$3;
    }
  }]);

  return Modal;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
3263
3264
3265
3266
3267
3268
3269
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
3270
EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE$3, function (event) {
XhmikosR's avatar
XhmikosR committed
3271
  var _this11 = this;
XhmikosR's avatar
XhmikosR committed
3272

XhmikosR's avatar
XhmikosR committed
3273
  var target = getElementFromSelector(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3274
3275
3276
3277
3278

  if (this.tagName === 'A' || this.tagName === 'AREA') {
    event.preventDefault();
  }

XhmikosR's avatar
XhmikosR committed
3279
  EventHandler.one(target, EVENT_SHOW$2, function (showEvent) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3280
3281
3282
3283
3284
    if (showEvent.defaultPrevented) {
      // only register focus restorer if modal will actually get shown
      return;
    }

XhmikosR's avatar
XhmikosR committed
3285
    EventHandler.one(target, EVENT_HIDDEN$2, function () {
XhmikosR's avatar
XhmikosR committed
3286
3287
      if (isVisible(_this11)) {
        _this11.focus();
XhmikosR's avatar
Dist.  
XhmikosR committed
3288
3289
3290
      }
    });
  });
XhmikosR's avatar
XhmikosR committed
3291
  var data = Data.getData(target, DATA_KEY$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
3292
3293

  if (!data) {
3294
3295
    var config = _objectSpread2({}, Manipulator.getDataAttributes(target), {}, Manipulator.getDataAttributes(this));

XhmikosR's avatar
Dist.  
XhmikosR committed
3296
3297
3298
3299
3300
    data = new Modal(target, config);
  }

  data.show(this);
});
XhmikosR's avatar
XhmikosR committed
3301
var $$6 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
3302
3303
3304
3305
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
3306
 * add .modal to jQuery only if jQuery is present
XhmikosR's avatar
Dist.  
XhmikosR committed
3307
3308
 */

3309
3310
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
3311
3312
3313
3314
if ($$6) {
  var JQUERY_NO_CONFLICT$5 = $$6.fn[NAME$5];
  $$6.fn[NAME$5] = Modal.jQueryInterface;
  $$6.fn[NAME$5].Constructor = Modal;
XhmikosR's avatar
Dist.  
XhmikosR committed
3315

XhmikosR's avatar
XhmikosR committed
3316
3317
3318
  $$6.fn[NAME$5].noConflict = function () {
    $$6.fn[NAME$5] = JQUERY_NO_CONFLICT$5;
    return Modal.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
3319
3320
3321
3322
3323
3324
3325
3326
3327
  };
}

/**
 * --------------------------------------------------------------------------
 * Bootstrap (v4.3.1): util/sanitizer.js
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 * --------------------------------------------------------------------------
 */
XhmikosR's avatar
XhmikosR committed
3328
3329
var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href'];
var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3330
3331
3332
3333
3334
3335
/**
 * A pattern that recognizes a commonly useful subset of URLs that are safe.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3336
var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi;
XhmikosR's avatar
Dist.  
XhmikosR committed
3337
3338
3339
3340
3341
3342
/**
 * A pattern that matches safe data URLs. Only matches image, video and audio types.
 *
 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts
 */

XhmikosR's avatar
XhmikosR committed
3343
var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i;
XhmikosR's avatar
Dist.  
XhmikosR committed
3344

XhmikosR's avatar
XhmikosR committed
3345
3346
var allowedAttribute = function allowedAttribute(attr, allowedAttributeList) {
  var attrName = attr.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3347
3348
3349

  if (allowedAttributeList.indexOf(attrName) !== -1) {
    if (uriAttrs.indexOf(attrName) !== -1) {
XhmikosR's avatar
XhmikosR committed
3350
      return SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue);
XhmikosR's avatar
Dist.  
XhmikosR committed
3351
3352
3353
3354
3355
    }

    return true;
  }

XhmikosR's avatar
XhmikosR committed
3356
3357
3358
  var regExp = allowedAttributeList.filter(function (attrRegex) {
    return attrRegex instanceof RegExp;
  }); // Check if a regular expression validates the attribute.
XhmikosR's avatar
Dist.  
XhmikosR committed
3359

XhmikosR's avatar
XhmikosR committed
3360
3361
  for (var i = 0, len = regExp.length; i < len; i++) {
    if (regExp[i].test(attrName)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3362
3363
3364
3365
3366
3367
3368
      return true;
    }
  }

  return false;
};

XhmikosR's avatar
XhmikosR committed
3369
var DefaultWhitelist = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
  // Global attributes allowed on any supplied element below.
  '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN],
  a: ['target', 'href', 'title', 'rel'],
  area: [],
  b: [],
  br: [],
  col: [],
  code: [],
  div: [],
  em: [],
  hr: [],
  h1: [],
  h2: [],
  h3: [],
  h4: [],
  h5: [],
  h6: [],
  i: [],
XhmikosR's avatar
XhmikosR committed
3388
  img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],
XhmikosR's avatar
Dist.  
XhmikosR committed
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
  li: [],
  ol: [],
  p: [],
  pre: [],
  s: [],
  small: [],
  span: [],
  sub: [],
  sup: [],
  strong: [],
  u: [],
  ul: []
};
function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
XhmikosR's avatar
XhmikosR committed
3403
3404
  var _ref;

XhmikosR's avatar
Dist.  
XhmikosR committed
3405
3406
3407
3408
3409
3410
3411
3412
  if (!unsafeHtml.length) {
    return unsafeHtml;
  }

  if (sanitizeFn && typeof sanitizeFn === 'function') {
    return sanitizeFn(unsafeHtml);
  }

XhmikosR's avatar
XhmikosR committed
3413
3414
3415
  var domParser = new window.DOMParser();
  var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html');
  var whitelistKeys = Object.keys(whiteList);
XhmikosR's avatar
XhmikosR committed
3416
3417

  var elements = (_ref = []).concat.apply(_ref, createdDocument.body.querySelectorAll('*'));
XhmikosR's avatar
Dist.  
XhmikosR committed
3418

XhmikosR's avatar
XhmikosR committed
3419
  var _loop = function _loop(i, len) {
XhmikosR's avatar
XhmikosR committed
3420
3421
    var _ref2;

XhmikosR's avatar
XhmikosR committed
3422
3423
    var el = elements[i];
    var elName = el.nodeName.toLowerCase();
XhmikosR's avatar
Dist.  
XhmikosR committed
3424
3425
3426

    if (whitelistKeys.indexOf(elName) === -1) {
      el.parentNode.removeChild(el);
XhmikosR's avatar
XhmikosR committed
3427
      return "continue";
XhmikosR's avatar
Dist.  
XhmikosR committed
3428
3429
    }

XhmikosR's avatar
XhmikosR committed
3430
3431
    var attributeList = (_ref2 = []).concat.apply(_ref2, el.attributes);

XhmikosR's avatar
XhmikosR committed
3432
3433
    var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []);
    attributeList.forEach(function (attr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3434
3435
3436
3437
      if (!allowedAttribute(attr, whitelistedAttributes)) {
        el.removeAttribute(attr.nodeName);
      }
    });
XhmikosR's avatar
XhmikosR committed
3438
3439
3440
  };

  for (var i = 0, len = elements.length; i < len; i++) {
3441
    var _ret = _loop(i);
XhmikosR's avatar
XhmikosR committed
3442
3443

    if (_ret === "continue") continue;
XhmikosR's avatar
Dist.  
XhmikosR committed
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
  }

  return createdDocument.body.innerHTML;
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
3455
3456
3457
3458
3459
3460
3461
3462
var NAME$6 = 'tooltip';
var VERSION$6 = '4.3.1';
var DATA_KEY$6 = 'bs.tooltip';
var EVENT_KEY$6 = "." + DATA_KEY$6;
var CLASS_PREFIX = 'bs-tooltip';
var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g');
var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn'];
var DefaultType$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
  animation: 'boolean',
  template: 'string',
  title: '(string|element|function)',
  trigger: 'string',
  delay: '(number|object)',
  html: 'boolean',
  selector: '(string|boolean)',
  placement: '(string|function)',
  offset: '(number|string|function)',
  container: '(string|element|boolean)',
  fallbackPlacement: '(string|array)',
  boundary: '(string|element)',
  sanitize: 'boolean',
  sanitizeFn: '(null|function)',
XhmikosR's avatar
XhmikosR committed
3477
3478
  whiteList: 'object',
  popperConfig: '(null|object)'
XhmikosR's avatar
Dist.  
XhmikosR committed
3479
};
XhmikosR's avatar
XhmikosR committed
3480
var AttachmentMap = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3481
3482
3483
3484
3485
3486
  AUTO: 'auto',
  TOP: 'top',
  RIGHT: 'right',
  BOTTOM: 'bottom',
  LEFT: 'left'
};
XhmikosR's avatar
XhmikosR committed
3487
var Default$4 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
  animation: true,
  template: '<div class="tooltip" role="tooltip">' + '<div class="tooltip-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',
  sanitize: true,
  sanitizeFn: null,
XhmikosR's avatar
XhmikosR committed
3502
3503
  whiteList: DefaultWhitelist,
  popperConfig: null
XhmikosR's avatar
Dist.  
XhmikosR committed
3504
};
XhmikosR's avatar
XhmikosR committed
3505
var Event$1 = {
XhmikosR's avatar
XhmikosR committed
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
  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
XhmikosR's avatar
Dist.  
XhmikosR committed
3516
};
XhmikosR's avatar
XhmikosR committed
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
var CLASS_NAME_FADE$1 = 'fade';
var CLASS_NAME_MODAL = 'modal';
var CLASS_NAME_SHOW$3 = 'show';
var HOVER_STATE_SHOW = 'show';
var HOVER_STATE_OUT = 'out';
var SELECTOR_TOOLTIP_INNER = '.tooltip-inner';
var TRIGGER_HOVER = 'hover';
var TRIGGER_FOCUS = 'focus';
var TRIGGER_CLICK = 'click';
var TRIGGER_MANUAL = 'manual';
XhmikosR's avatar
XhmikosR committed
3527
3528
3529
3530
3531
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
3532

XhmikosR's avatar
XhmikosR committed
3533
var Tooltip = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
3534
  function Tooltip(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
    if (typeof Popper === 'undefined') {
      throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)');
    } // private


    this._isEnabled = true;
    this._timeout = 0;
    this._hoverState = '';
    this._activeTrigger = {};
    this._popper = null; // Protected

    this.element = element;
    this.config = this._getConfig(config);
    this.tip = null;

    this._setListeners();

    Data.setData(element, this.constructor.DATA_KEY, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
3556
  var _proto = Tooltip.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
3557

XhmikosR's avatar
XhmikosR committed
3558
3559
  // Public
  _proto.enable = function enable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3560
    this._isEnabled = true;
XhmikosR's avatar
XhmikosR committed
3561
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3562

XhmikosR's avatar
XhmikosR committed
3563
  _proto.disable = function disable() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3564
    this._isEnabled = false;
XhmikosR's avatar
XhmikosR committed
3565
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3566

XhmikosR's avatar
XhmikosR committed
3567
  _proto.toggleEnabled = function toggleEnabled() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3568
    this._isEnabled = !this._isEnabled;
XhmikosR's avatar
XhmikosR committed
3569
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3570

XhmikosR's avatar
XhmikosR committed
3571
  _proto.toggle = function toggle(event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3572
3573
3574
3575
3576
    if (!this._isEnabled) {
      return;
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3577
3578
      var dataKey = this.constructor.DATA_KEY;
      var context = Data.getData(event.delegateTarget, dataKey);
XhmikosR's avatar
Dist.  
XhmikosR committed
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592

      if (!context) {
        context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
        Data.setData(event.delegateTarget, dataKey, context);
      }

      context._activeTrigger.click = !context._activeTrigger.click;

      if (context._isWithActiveTrigger()) {
        context._enter(null, context);
      } else {
        context._leave(null, context);
      }
    } else {
XhmikosR's avatar
XhmikosR committed
3593
      if (this.getTipElement().classList.contains(CLASS_NAME_SHOW$3)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3594
3595
3596
3597
3598
3599
3600
        this._leave(null, this);

        return;
      }

      this._enter(null, this);
    }
XhmikosR's avatar
XhmikosR committed
3601
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3602

XhmikosR's avatar
XhmikosR committed
3603
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3604
3605
3606
    clearTimeout(this._timeout);
    Data.removeData(this.element, this.constructor.DATA_KEY);
    EventHandler.off(this.element, this.constructor.EVENT_KEY);
XhmikosR's avatar
XhmikosR committed
3607
    EventHandler.off(SelectorEngine.closest(this.element, "." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617

    if (this.tip) {
      this.tip.parentNode.removeChild(this.tip);
    }

    this._isEnabled = null;
    this._timeout = null;
    this._hoverState = null;
    this._activeTrigger = null;

XhmikosR's avatar
XhmikosR committed
3618
    if (this._popper) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3619
3620
3621
3622
3623
3624
3625
      this._popper.destroy();
    }

    this._popper = null;
    this.element = null;
    this.config = null;
    this.tip = null;
XhmikosR's avatar
XhmikosR committed
3626
3627
3628
3629
  };

  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3630
3631
3632
3633
3634
3635

    if (this.element.style.display === 'none') {
      throw new Error('Please use show on visible elements');
    }

    if (this.isWithContent() && this._isEnabled) {
XhmikosR's avatar
XhmikosR committed
3636
3637
3638
      var showEvent = EventHandler.trigger(this.element, this.constructor.Event.SHOW);
      var shadowRoot = findShadowRoot(this.element);
      var isInTheDom = shadowRoot === null ? this.element.ownerDocument.documentElement.contains(this.element) : shadowRoot.contains(this.element);
XhmikosR's avatar
Dist.  
XhmikosR committed
3639
3640
3641
3642
3643

      if (showEvent.defaultPrevented || !isInTheDom) {
        return;
      }

XhmikosR's avatar
XhmikosR committed
3644
3645
      var tip = this.getTipElement();
      var tipId = getUID(this.constructor.NAME);
XhmikosR's avatar
Dist.  
XhmikosR committed
3646
3647
3648
3649
3650
      tip.setAttribute('id', tipId);
      this.element.setAttribute('aria-describedby', tipId);
      this.setContent();

      if (this.config.animation) {
XhmikosR's avatar
XhmikosR committed
3651
        tip.classList.add(CLASS_NAME_FADE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
3652
3653
      }

XhmikosR's avatar
XhmikosR committed
3654
      var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement;
XhmikosR's avatar
Dist.  
XhmikosR committed
3655

XhmikosR's avatar
XhmikosR committed
3656
      var attachment = this._getAttachment(placement);
XhmikosR's avatar
Dist.  
XhmikosR committed
3657

3658
      this._addAttachmentClass(attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
3659

XhmikosR's avatar
XhmikosR committed
3660
      var container = this._getContainer();
XhmikosR's avatar
Dist.  
XhmikosR committed
3661
3662
3663
3664
3665
3666
3667
3668

      Data.setData(tip, this.constructor.DATA_KEY, this);

      if (!this.element.ownerDocument.documentElement.contains(this.tip)) {
        container.appendChild(tip);
      }

      EventHandler.trigger(this.element, this.constructor.Event.INSERTED);
XhmikosR's avatar
XhmikosR committed
3669
      this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment));
XhmikosR's avatar
XhmikosR committed
3670
      tip.classList.add(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we add extra
XhmikosR's avatar
Dist.  
XhmikosR committed
3671
3672
3673
3674
3675
      // 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

      if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3676
3677
3678
        var _ref;

        (_ref = []).concat.apply(_ref, document.body.children).forEach(function (element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3679
3680
3681
3682
          EventHandler.on(element, 'mouseover', noop());
        });
      }

XhmikosR's avatar
XhmikosR committed
3683
3684
3685
      var complete = function complete() {
        if (_this.config.animation) {
          _this._fixTransition();
XhmikosR's avatar
Dist.  
XhmikosR committed
3686
3687
        }

XhmikosR's avatar
XhmikosR committed
3688
3689
3690
        var prevHoverState = _this._hoverState;
        _this._hoverState = null;
        EventHandler.trigger(_this.element, _this.constructor.Event.SHOWN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3691

XhmikosR's avatar
XhmikosR committed
3692
        if (prevHoverState === HOVER_STATE_OUT) {
XhmikosR's avatar
XhmikosR committed
3693
          _this._leave(null, _this);
XhmikosR's avatar
Dist.  
XhmikosR committed
3694
3695
3696
        }
      };

XhmikosR's avatar
XhmikosR committed
3697
      if (this.tip.classList.contains(CLASS_NAME_FADE$1)) {
XhmikosR's avatar
XhmikosR committed
3698
        var transitionDuration = getTransitionDurationFromElement(this.tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3699
3700
3701
3702
3703
3704
        EventHandler.one(this.tip, TRANSITION_END, complete);
        emulateTransitionEnd(this.tip, transitionDuration);
      } else {
        complete();
      }
    }
XhmikosR's avatar
XhmikosR committed
3705
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3706

3707
  _proto.hide = function hide() {
XhmikosR's avatar
XhmikosR committed
3708
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3709

XhmikosR's avatar
XhmikosR committed
3710
3711
3712
    var tip = this.getTipElement();

    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
3713
      if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3714
3715
3716
        tip.parentNode.removeChild(tip);
      }

XhmikosR's avatar
XhmikosR committed
3717
3718
3719
      _this2._cleanTipClass();

      _this2.element.removeAttribute('aria-describedby');
XhmikosR's avatar
Dist.  
XhmikosR committed
3720

XhmikosR's avatar
XhmikosR committed
3721
      EventHandler.trigger(_this2.element, _this2.constructor.Event.HIDDEN);
XhmikosR's avatar
Dist.  
XhmikosR committed
3722

3723
      _this2._popper.destroy();
XhmikosR's avatar
Dist.  
XhmikosR committed
3724
3725
    };

XhmikosR's avatar
XhmikosR committed
3726
    var hideEvent = EventHandler.trigger(this.element, this.constructor.Event.HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
3727
3728
3729
3730
3731

    if (hideEvent.defaultPrevented) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
3732
    tip.classList.remove(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra
XhmikosR's avatar
Dist.  
XhmikosR committed
3733
3734
3735
    // empty mouseover listeners we added for iOS support

    if ('ontouchstart' in document.documentElement) {
XhmikosR's avatar
XhmikosR committed
3736
3737
3738
      var _ref2;

      (_ref2 = []).concat.apply(_ref2, document.body.children).forEach(function (element) {
XhmikosR's avatar
XhmikosR committed
3739
3740
        return EventHandler.off(element, 'mouseover', noop);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
3741
3742
    }

XhmikosR's avatar
XhmikosR committed
3743
3744
3745
    this._activeTrigger[TRIGGER_CLICK] = false;
    this._activeTrigger[TRIGGER_FOCUS] = false;
    this._activeTrigger[TRIGGER_HOVER] = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3746

XhmikosR's avatar
XhmikosR committed
3747
    if (this.tip.classList.contains(CLASS_NAME_FADE$1)) {
XhmikosR's avatar
XhmikosR committed
3748
      var transitionDuration = getTransitionDurationFromElement(tip);
XhmikosR's avatar
Dist.  
XhmikosR committed
3749
3750
3751
3752
3753
3754
3755
      EventHandler.one(tip, TRANSITION_END, complete);
      emulateTransitionEnd(tip, transitionDuration);
    } else {
      complete();
    }

    this._hoverState = '';
XhmikosR's avatar
XhmikosR committed
3756
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3757

XhmikosR's avatar
XhmikosR committed
3758
  _proto.update = function update() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3759
3760
3761
3762
    if (this._popper !== null) {
      this._popper.scheduleUpdate();
    }
  } // Protected
XhmikosR's avatar
XhmikosR committed
3763
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3764

XhmikosR's avatar
XhmikosR committed
3765
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3766
    return Boolean(this.getTitle());
XhmikosR's avatar
XhmikosR committed
3767
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3768

XhmikosR's avatar
XhmikosR committed
3769
  _proto.getTipElement = function getTipElement() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3770
3771
3772
3773
    if (this.tip) {
      return this.tip;
    }

XhmikosR's avatar
XhmikosR committed
3774
    var element = document.createElement('div');
XhmikosR's avatar
Dist.  
XhmikosR committed
3775
3776
3777
    element.innerHTML = this.config.template;
    this.tip = element.children[0];
    return this.tip;
XhmikosR's avatar
XhmikosR committed
3778
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3779

XhmikosR's avatar
XhmikosR committed
3780
3781
  _proto.setContent = function setContent() {
    var tip = this.getTipElement();
XhmikosR's avatar
XhmikosR committed
3782
3783
3784
    this.setElementContent(SelectorEngine.findOne(SELECTOR_TOOLTIP_INNER, tip), this.getTitle());
    tip.classList.remove(CLASS_NAME_FADE$1);
    tip.classList.remove(CLASS_NAME_SHOW$3);
XhmikosR's avatar
XhmikosR committed
3785
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3786

XhmikosR's avatar
XhmikosR committed
3787
  _proto.setElementContent = function setElementContent(element, content) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3788
3789
3790
3791
    if (element === null) {
      return;
    }

3792
    if (typeof content === 'object' && isElement(content)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
      if (content.jquery) {
        content = content[0];
      } // content is a DOM node or a jQuery


      if (this.config.html) {
        if (content.parentNode !== element) {
          element.innerHTML = '';
          element.appendChild(content);
        }
      } else {
        element.innerText = content.textContent;
      }

      return;
    }

    if (this.config.html) {
      if (this.config.sanitize) {
        content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn);
      }

      element.innerHTML = content;
    } else {
      element.innerText = content;
    }
XhmikosR's avatar
XhmikosR committed
3819
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3820

XhmikosR's avatar
XhmikosR committed
3821
3822
  _proto.getTitle = function getTitle() {
    var title = this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
3823
3824
3825
3826
3827
3828
3829

    if (!title) {
      title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title;
    }

    return title;
  } // Private
XhmikosR's avatar
XhmikosR committed
3830
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
3831

XhmikosR's avatar
XhmikosR committed
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
  _proto._getPopperConfig = function _getPopperConfig(attachment) {
    var _this3 = this;

    var defaultBsConfig = {
      placement: attachment,
      modifiers: {
        offset: this._getOffset(),
        flip: {
          behavior: this.config.fallbackPlacement
        },
        arrow: {
          element: "." + this.constructor.NAME + "-arrow"
        },
        preventOverflow: {
          boundariesElement: this.config.boundary
        }
      },
      onCreate: function onCreate(data) {
        if (data.originalPlacement !== data.placement) {
          _this3._handlePopperPlacementChange(data);
        }
      },
      onUpdate: function onUpdate(data) {
        return _this3._handlePopperPlacementChange(data);
      }
    };
    return _objectSpread2({}, defaultBsConfig, {}, this.config.popperConfig);
  };

3861
3862
3863
3864
  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX + "-" + attachment);
  };

XhmikosR's avatar
XhmikosR committed
3865
  _proto._getOffset = function _getOffset() {
XhmikosR's avatar
XhmikosR committed
3866
    var _this4 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
3867

XhmikosR's avatar
XhmikosR committed
3868
    var offset = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
3869
3870

    if (typeof this.config.offset === 'function') {
XhmikosR's avatar
XhmikosR committed
3871
      offset.fn = function (data) {
XhmikosR's avatar
XhmikosR committed
3872
        data.offsets = _objectSpread2({}, data.offsets, {}, _this4.config.offset(data.offsets, _this4.element) || {});
XhmikosR's avatar
Dist.  
XhmikosR committed
3873
3874
3875
3876
3877
3878
3879
        return data;
      };
    } else {
      offset.offset = this.config.offset;
    }

    return offset;
XhmikosR's avatar
XhmikosR committed
3880
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3881

XhmikosR's avatar
XhmikosR committed
3882
  _proto._getContainer = function _getContainer() {
XhmikosR's avatar
Dist.  
XhmikosR committed
3883
3884
3885
3886
3887
3888
3889
3890
3891
    if (this.config.container === false) {
      return document.body;
    }

    if (isElement(this.config.container)) {
      return this.config.container;
    }

    return SelectorEngine.findOne(this.config.container);
XhmikosR's avatar
XhmikosR committed
3892
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3893

XhmikosR's avatar
XhmikosR committed
3894
  _proto._getAttachment = function _getAttachment(placement) {
XhmikosR's avatar
XhmikosR committed
3895
    return AttachmentMap[placement.toUpperCase()];
XhmikosR's avatar
XhmikosR committed
3896
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3897

XhmikosR's avatar
XhmikosR committed
3898
  _proto._setListeners = function _setListeners() {
XhmikosR's avatar
XhmikosR committed
3899
    var _this5 = this;
XhmikosR's avatar
XhmikosR committed
3900
3901
3902

    var triggers = this.config.trigger.split(' ');
    triggers.forEach(function (trigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3903
      if (trigger === 'click') {
XhmikosR's avatar
XhmikosR committed
3904
3905
        EventHandler.on(_this5.element, _this5.constructor.Event.CLICK, _this5.config.selector, function (event) {
          return _this5.toggle(event);
XhmikosR's avatar
XhmikosR committed
3906
        });
XhmikosR's avatar
XhmikosR committed
3907
3908
3909
      } else if (trigger !== TRIGGER_MANUAL) {
        var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN;
        var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT;
XhmikosR's avatar
XhmikosR committed
3910
3911
        EventHandler.on(_this5.element, eventIn, _this5.config.selector, function (event) {
          return _this5._enter(event);
XhmikosR's avatar
XhmikosR committed
3912
        });
XhmikosR's avatar
XhmikosR committed
3913
3914
        EventHandler.on(_this5.element, eventOut, _this5.config.selector, function (event) {
          return _this5._leave(event);
XhmikosR's avatar
XhmikosR committed
3915
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
3916
3917
      }
    });
Mark Otto's avatar
dist v5    
Mark Otto committed
3918
3919

    this._hideModalHandler = function () {
XhmikosR's avatar
XhmikosR committed
3920
3921
      if (_this5.element) {
        _this5.hide();
XhmikosR's avatar
Dist.  
XhmikosR committed
3922
      }
Mark Otto's avatar
dist v5    
Mark Otto committed
3923
3924
    };

XhmikosR's avatar
XhmikosR committed
3925
    EventHandler.on(SelectorEngine.closest(this.element, "." + CLASS_NAME_MODAL), 'hide.bs.modal', this._hideModalHandler);
XhmikosR's avatar
Dist.  
XhmikosR committed
3926
3927

    if (this.config.selector) {
3928
      this.config = _objectSpread2({}, this.config, {
XhmikosR's avatar
Dist.  
XhmikosR committed
3929
3930
3931
3932
3933
3934
        trigger: 'manual',
        selector: ''
      });
    } else {
      this._fixTitle();
    }
XhmikosR's avatar
XhmikosR committed
3935
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3936

XhmikosR's avatar
XhmikosR committed
3937
3938
  _proto._fixTitle = function _fixTitle() {
    var titleType = typeof this.element.getAttribute('data-original-title');
XhmikosR's avatar
Dist.  
XhmikosR committed
3939
3940
3941
3942
3943

    if (this.element.getAttribute('title') || titleType !== 'string') {
      this.element.setAttribute('data-original-title', this.element.getAttribute('title') || '');
      this.element.setAttribute('title', '');
    }
XhmikosR's avatar
XhmikosR committed
3944
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3945

XhmikosR's avatar
XhmikosR committed
3946
3947
  _proto._enter = function _enter(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
3948
3949
3950
3951
3952
3953
3954
3955
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3956
      context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true;
XhmikosR's avatar
Dist.  
XhmikosR committed
3957
3958
    }

XhmikosR's avatar
XhmikosR committed
3959
3960
    if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) {
      context._hoverState = HOVER_STATE_SHOW;
XhmikosR's avatar
Dist.  
XhmikosR committed
3961
3962
3963
3964
      return;
    }

    clearTimeout(context._timeout);
XhmikosR's avatar
XhmikosR committed
3965
    context._hoverState = HOVER_STATE_SHOW;
XhmikosR's avatar
Dist.  
XhmikosR committed
3966
3967
3968
3969
3970
3971

    if (!context.config.delay || !context.config.delay.show) {
      context.show();
      return;
    }

XhmikosR's avatar
XhmikosR committed
3972
    context._timeout = setTimeout(function () {
XhmikosR's avatar
XhmikosR committed
3973
      if (context._hoverState === HOVER_STATE_SHOW) {
XhmikosR's avatar
Dist.  
XhmikosR committed
3974
3975
3976
        context.show();
      }
    }, context.config.delay.show);
XhmikosR's avatar
XhmikosR committed
3977
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
3978

XhmikosR's avatar
XhmikosR committed
3979
3980
  _proto._leave = function _leave(event, context) {
    var dataKey = this.constructor.DATA_KEY;
XhmikosR's avatar
Dist.  
XhmikosR committed
3981
3982
3983
3984
3985
3986
3987
3988
    context = context || Data.getData(event.delegateTarget, dataKey);

    if (!context) {
      context = new this.constructor(event.delegateTarget, this._getDelegateConfig());
      Data.setData(event.delegateTarget, dataKey, context);
    }

    if (event) {
XhmikosR's avatar
XhmikosR committed
3989
      context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false;
XhmikosR's avatar
Dist.  
XhmikosR committed
3990
3991
3992
3993
3994
3995
3996
    }

    if (context._isWithActiveTrigger()) {
      return;
    }

    clearTimeout(context._timeout);
XhmikosR's avatar
XhmikosR committed
3997
    context._hoverState = HOVER_STATE_OUT;
XhmikosR's avatar
Dist.  
XhmikosR committed
3998
3999
4000
4001
4002
4003

    if (!context.config.delay || !context.config.delay.hide) {
      context.hide();
      return;
    }

XhmikosR's avatar
XhmikosR committed
4004
    context._timeout = setTimeout(function () {
XhmikosR's avatar
XhmikosR committed
4005
      if (context._hoverState === HOVER_STATE_OUT) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4006
4007
4008
        context.hide();
      }
    }, context.config.delay.hide);
XhmikosR's avatar
XhmikosR committed
4009
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4010

XhmikosR's avatar
XhmikosR committed
4011
4012
  _proto._isWithActiveTrigger = function _isWithActiveTrigger() {
    for (var trigger in this._activeTrigger) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4013
4014
4015
4016
4017
4018
      if (this._activeTrigger[trigger]) {
        return true;
      }
    }

    return false;
XhmikosR's avatar
XhmikosR committed
4019
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4020

XhmikosR's avatar
XhmikosR committed
4021
4022
4023
  _proto._getConfig = function _getConfig(config) {
    var dataAttributes = Manipulator.getDataAttributes(this.element);
    Object.keys(dataAttributes).forEach(function (dataAttr) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4024
4025
4026
4027
4028
4029
4030
4031
4032
      if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) {
        delete dataAttributes[dataAttr];
      }
    });

    if (config && typeof config.container === 'object' && config.container.jquery) {
      config.container = config.container[0];
    }

4033
    config = _objectSpread2({}, this.constructor.Default, {}, dataAttributes, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056

    if (typeof config.delay === 'number') {
      config.delay = {
        show: config.delay,
        hide: config.delay
      };
    }

    if (typeof config.title === 'number') {
      config.title = config.title.toString();
    }

    if (typeof config.content === 'number') {
      config.content = config.content.toString();
    }

    typeCheckConfig(NAME$6, config, this.constructor.DefaultType);

    if (config.sanitize) {
      config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn);
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4057
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4058

XhmikosR's avatar
XhmikosR committed
4059
4060
  _proto._getDelegateConfig = function _getDelegateConfig() {
    var config = {};
XhmikosR's avatar
Dist.  
XhmikosR committed
4061
4062

    if (this.config) {
XhmikosR's avatar
XhmikosR committed
4063
      for (var key in this.config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4064
4065
4066
4067
4068
4069
4070
        if (this.constructor.Default[key] !== this.config[key]) {
          config[key] = this.config[key];
        }
      }
    }

    return config;
XhmikosR's avatar
XhmikosR committed
4071
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4072

XhmikosR's avatar
XhmikosR committed
4073
4074
4075
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX);
XhmikosR's avatar
Dist.  
XhmikosR committed
4076

XhmikosR's avatar
XhmikosR committed
4077
    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4078
4079
4080
4081
4082
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4083
    }
XhmikosR's avatar
XhmikosR committed
4084
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4085

XhmikosR's avatar
XhmikosR committed
4086
4087
  _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) {
    var popperInstance = popperData.instance;
XhmikosR's avatar
Dist.  
XhmikosR committed
4088
4089
4090
4091
    this.tip = popperInstance.popper;

    this._cleanTipClass();

4092
    this._addAttachmentClass(this._getAttachment(popperData.placement));
XhmikosR's avatar
XhmikosR committed
4093
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4094

XhmikosR's avatar
XhmikosR committed
4095
4096
4097
  _proto._fixTransition = function _fixTransition() {
    var tip = this.getTipElement();
    var initConfigAnimation = this.config.animation;
XhmikosR's avatar
Dist.  
XhmikosR committed
4098
4099
4100
4101
4102

    if (tip.getAttribute('x-placement') !== null) {
      return;
    }

XhmikosR's avatar
XhmikosR committed
4103
    tip.classList.remove(CLASS_NAME_FADE$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4104
4105
4106
4107
4108
    this.config.animation = false;
    this.hide();
    this.show();
    this.config.animation = initConfigAnimation;
  } // Static
XhmikosR's avatar
XhmikosR committed
4109
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4110

XhmikosR's avatar
XhmikosR committed
4111
  Tooltip.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4112
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4113
      var data = Data.getData(this, DATA_KEY$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4114

XhmikosR's avatar
XhmikosR committed
4115
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Tooltip(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4127
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4128
4129
4130
4131
4132
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4133
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4134

XhmikosR's avatar
XhmikosR committed
4135
  Tooltip.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4136
    return Data.getData(element, DATA_KEY$6);
XhmikosR's avatar
XhmikosR committed
4137
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4138

XhmikosR's avatar
XhmikosR committed
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
  _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() {
XhmikosR's avatar
XhmikosR committed
4162
      return Event$1;
XhmikosR's avatar
XhmikosR committed
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$6;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$4;
    }
  }]);

  return Tooltip;
}();
XhmikosR's avatar
XhmikosR committed
4178
4179

var $$7 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4180
4181
4182
4183
4184
4185
4186
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tooltip to jQuery only if jQuery is present
 */

4187
4188
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4189
4190
4191
4192
if ($$7) {
  var JQUERY_NO_CONFLICT$6 = $$7.fn[NAME$6];
  $$7.fn[NAME$6] = Tooltip.jQueryInterface;
  $$7.fn[NAME$6].Constructor = Tooltip;
XhmikosR's avatar
Dist.  
XhmikosR committed
4193

XhmikosR's avatar
XhmikosR committed
4194
4195
4196
  $$7.fn[NAME$6].noConflict = function () {
    $$7.fn[NAME$6] = JQUERY_NO_CONFLICT$6;
    return Tooltip.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4197
4198
4199
4200
4201
4202
4203
4204
4205
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4206
4207
4208
4209
4210
4211
var NAME$7 = 'popover';
var VERSION$7 = '4.3.1';
var DATA_KEY$7 = 'bs.popover';
var EVENT_KEY$7 = "." + DATA_KEY$7;
var CLASS_PREFIX$1 = 'bs-popover';
var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g');
XhmikosR's avatar
Dist.  
XhmikosR committed
4212

4213
var Default$5 = _objectSpread2({}, Tooltip.Default, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4214
4215
4216
4217
4218
4219
  placement: 'right',
  trigger: 'click',
  content: '',
  template: '<div class="popover" role="tooltip">' + '<div class="popover-arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>'
});

4220
var DefaultType$5 = _objectSpread2({}, Tooltip.DefaultType, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4221
4222
4223
  content: '(string|element|function)'
});

XhmikosR's avatar
XhmikosR committed
4224
var Event$2 = {
XhmikosR's avatar
XhmikosR committed
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
  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
XhmikosR's avatar
Dist.  
XhmikosR committed
4235
};
XhmikosR's avatar
XhmikosR committed
4236
4237
4238
4239
var CLASS_NAME_FADE$2 = 'fade';
var CLASS_NAME_SHOW$4 = 'show';
var SELECTOR_TITLE = '.popover-header';
var SELECTOR_CONTENT = '.popover-body';
XhmikosR's avatar
XhmikosR committed
4240
4241
4242
4243
4244
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4245

XhmikosR's avatar
XhmikosR committed
4246
var Popover = /*#__PURE__*/function (_Tooltip) {
XhmikosR's avatar
XhmikosR committed
4247
  _inheritsLoose(Popover, _Tooltip);
XhmikosR's avatar
Dist.  
XhmikosR committed
4248

XhmikosR's avatar
XhmikosR committed
4249
4250
  function Popover() {
    return _Tooltip.apply(this, arguments) || this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4251
4252
  }

XhmikosR's avatar
XhmikosR committed
4253
  var _proto = Popover.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4254

XhmikosR's avatar
XhmikosR committed
4255
4256
  // Overrides
  _proto.isWithContent = function isWithContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4257
    return this.getTitle() || this._getContent();
XhmikosR's avatar
XhmikosR committed
4258
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4259

XhmikosR's avatar
XhmikosR committed
4260
4261
  _proto.setContent = function setContent() {
    var tip = this.getTipElement(); // we use append for html objects to maintain js events
XhmikosR's avatar
Dist.  
XhmikosR committed
4262

XhmikosR's avatar
XhmikosR committed
4263
    this.setElementContent(SelectorEngine.findOne(SELECTOR_TITLE, tip), this.getTitle());
XhmikosR's avatar
Dist.  
XhmikosR committed
4264

XhmikosR's avatar
XhmikosR committed
4265
    var content = this._getContent();
XhmikosR's avatar
Dist.  
XhmikosR committed
4266
4267
4268
4269
4270

    if (typeof content === 'function') {
      content = content.call(this.element);
    }

XhmikosR's avatar
XhmikosR committed
4271
4272
4273
    this.setElementContent(SelectorEngine.findOne(SELECTOR_CONTENT, tip), content);
    tip.classList.remove(CLASS_NAME_FADE$2);
    tip.classList.remove(CLASS_NAME_SHOW$4);
XhmikosR's avatar
XhmikosR committed
4274
4275
4276
4277
  };

  _proto._addAttachmentClass = function _addAttachmentClass(attachment) {
    this.getTipElement().classList.add(CLASS_PREFIX$1 + "-" + attachment);
XhmikosR's avatar
Dist.  
XhmikosR committed
4278
  } // Private
XhmikosR's avatar
XhmikosR committed
4279
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4280

XhmikosR's avatar
XhmikosR committed
4281
  _proto._getContent = function _getContent() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4282
    return this.element.getAttribute('data-content') || this.config.content;
XhmikosR's avatar
XhmikosR committed
4283
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4284

XhmikosR's avatar
XhmikosR committed
4285
4286
4287
  _proto._cleanTipClass = function _cleanTipClass() {
    var tip = this.getTipElement();
    var tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4288
4289

    if (tabClass !== null && tabClass.length > 0) {
XhmikosR's avatar
XhmikosR committed
4290
4291
4292
4293
4294
      tabClass.map(function (token) {
        return token.trim();
      }).forEach(function (tClass) {
        return tip.classList.remove(tClass);
      });
XhmikosR's avatar
Dist.  
XhmikosR committed
4295
4296
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4297
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4298

XhmikosR's avatar
XhmikosR committed
4299
  Popover.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4300
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4301
      var data = Data.getData(this, DATA_KEY$7);
XhmikosR's avatar
Dist.  
XhmikosR committed
4302

XhmikosR's avatar
XhmikosR committed
4303
      var _config = typeof config === 'object' ? config : null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315

      if (!data && /dispose|hide/.test(config)) {
        return;
      }

      if (!data) {
        data = new Popover(this, _config);
        Data.setData(this, DATA_KEY$7, data);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4316
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4317
4318
4319
4320
4321
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4322
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4323

XhmikosR's avatar
XhmikosR committed
4324
  Popover.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4325
    return Data.getData(element, DATA_KEY$7);
XhmikosR's avatar
XhmikosR committed
4326
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4327

XhmikosR's avatar
XhmikosR committed
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
  _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() {
XhmikosR's avatar
XhmikosR committed
4352
      return Event$2;
XhmikosR's avatar
XhmikosR committed
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
    }
  }, {
    key: "EVENT_KEY",
    get: function get() {
      return EVENT_KEY$7;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$5;
    }
  }]);

  return Popover;
}(Tooltip);
XhmikosR's avatar
XhmikosR committed
4368
4369

var $$8 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4370
4371
4372
4373
4374
4375
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4376
4377
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4378
4379
4380
4381
if ($$8) {
  var JQUERY_NO_CONFLICT$7 = $$8.fn[NAME$7];
  $$8.fn[NAME$7] = Popover.jQueryInterface;
  $$8.fn[NAME$7].Constructor = Popover;
XhmikosR's avatar
Dist.  
XhmikosR committed
4382

XhmikosR's avatar
XhmikosR committed
4383
4384
4385
  $$8.fn[NAME$7].noConflict = function () {
    $$8.fn[NAME$7] = JQUERY_NO_CONFLICT$7;
    return Popover.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4386
4387
4388
4389
4390
4391
4392
4393
4394
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4395
4396
4397
4398
4399
4400
var NAME$8 = 'scrollspy';
var VERSION$8 = '4.3.1';
var DATA_KEY$8 = 'bs.scrollspy';
var EVENT_KEY$8 = "." + DATA_KEY$8;
var DATA_API_KEY$6 = '.data-api';
var Default$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4401
4402
4403
4404
  offset: 10,
  method: 'auto',
  target: ''
};
XhmikosR's avatar
XhmikosR committed
4405
var DefaultType$6 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4406
4407
4408
4409
  offset: 'number',
  method: 'string',
  target: '(string|element)'
};
XhmikosR's avatar
XhmikosR committed
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
var EVENT_ACTIVATE = "activate" + EVENT_KEY$8;
var EVENT_SCROLL = "scroll" + EVENT_KEY$8;
var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$6;
var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';
var CLASS_NAME_ACTIVE$2 = 'active';
var SELECTOR_DATA_SPY = '[data-spy="scroll"]';
var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';
var SELECTOR_NAV_LINKS = '.nav-link';
var SELECTOR_NAV_ITEMS = '.nav-item';
var SELECTOR_LIST_ITEMS = '.list-group-item';
var SELECTOR_DROPDOWN = '.dropdown';
var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';
var METHOD_OFFSET = 'offset';
var METHOD_POSITION = 'position';
XhmikosR's avatar
XhmikosR committed
4424
4425
4426
4427
4428
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4429

XhmikosR's avatar
XhmikosR committed
4430
var ScrollSpy = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4431
4432
4433
  function ScrollSpy(element, config) {
    var _this = this;

XhmikosR's avatar
Dist.  
XhmikosR committed
4434
4435
4436
    this._element = element;
    this._scrollElement = element.tagName === 'BODY' ? window : element;
    this._config = this._getConfig(config);
XhmikosR's avatar
XhmikosR committed
4437
    this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " ." + CLASS_NAME_DROPDOWN_ITEM);
XhmikosR's avatar
Dist.  
XhmikosR committed
4438
4439
4440
4441
    this._offsets = [];
    this._targets = [];
    this._activeTarget = null;
    this._scrollHeight = 0;
XhmikosR's avatar
XhmikosR committed
4442
    EventHandler.on(this._scrollElement, EVENT_SCROLL, function (event) {
XhmikosR's avatar
XhmikosR committed
4443
4444
      return _this._process(event);
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4445
4446
4447
4448
4449
4450
4451
4452
    this.refresh();

    this._process();

    Data.setData(element, DATA_KEY$8, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4453
  var _proto = ScrollSpy.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4454

XhmikosR's avatar
XhmikosR committed
4455
4456
4457
  // Public
  _proto.refresh = function refresh() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4458

XhmikosR's avatar
XhmikosR committed
4459
    var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION;
XhmikosR's avatar
XhmikosR committed
4460
    var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method;
XhmikosR's avatar
XhmikosR committed
4461
    var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0;
XhmikosR's avatar
Dist.  
XhmikosR committed
4462
4463
4464
    this._offsets = [];
    this._targets = [];
    this._scrollHeight = this._getScrollHeight();
XhmikosR's avatar
XhmikosR committed
4465
    var targets = SelectorEngine.find(this._selector);
XhmikosR's avatar
XhmikosR committed
4466
4467
4468
    targets.map(function (element) {
      var target;
      var targetSelector = getSelectorFromElement(element);
XhmikosR's avatar
Dist.  
XhmikosR committed
4469
4470
4471
4472
4473
4474

      if (targetSelector) {
        target = SelectorEngine.findOne(targetSelector);
      }

      if (target) {
XhmikosR's avatar
XhmikosR committed
4475
        var targetBCR = target.getBoundingClientRect();
XhmikosR's avatar
Dist.  
XhmikosR committed
4476
4477
4478
4479
4480
4481
4482

        if (targetBCR.width || targetBCR.height) {
          return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector];
        }
      }

      return null;
XhmikosR's avatar
XhmikosR committed
4483
4484
4485
4486
4487
4488
4489
4490
    }).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]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4491
    });
XhmikosR's avatar
XhmikosR committed
4492
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4493

XhmikosR's avatar
XhmikosR committed
4494
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
    Data.removeData(this._element, DATA_KEY$8);
    EventHandler.off(this._scrollElement, 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
XhmikosR's avatar
XhmikosR committed
4506
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4507

XhmikosR's avatar
XhmikosR committed
4508
  _proto._getConfig = function _getConfig(config) {
4509
    config = _objectSpread2({}, Default$6, {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
4510
4511

    if (typeof config.target !== 'string') {
XhmikosR's avatar
XhmikosR committed
4512
      var id = config.target.id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4513
4514
4515
4516
4517
4518

      if (!id) {
        id = getUID(NAME$8);
        config.target.id = id;
      }

XhmikosR's avatar
XhmikosR committed
4519
      config.target = "#" + id;
XhmikosR's avatar
Dist.  
XhmikosR committed
4520
4521
4522
4523
    }

    typeCheckConfig(NAME$8, config, DefaultType$6);
    return config;
XhmikosR's avatar
XhmikosR committed
4524
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4525

XhmikosR's avatar
XhmikosR committed
4526
  _proto._getScrollTop = function _getScrollTop() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4527
    return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop;
XhmikosR's avatar
XhmikosR committed
4528
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4529

XhmikosR's avatar
XhmikosR committed
4530
  _proto._getScrollHeight = function _getScrollHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4531
    return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight);
XhmikosR's avatar
XhmikosR committed
4532
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4533

XhmikosR's avatar
XhmikosR committed
4534
  _proto._getOffsetHeight = function _getOffsetHeight() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4535
    return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height;
XhmikosR's avatar
XhmikosR committed
4536
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4537

XhmikosR's avatar
XhmikosR committed
4538
4539
  _proto._process = function _process() {
    var scrollTop = this._getScrollTop() + this._config.offset;
XhmikosR's avatar
Dist.  
XhmikosR committed
4540

XhmikosR's avatar
XhmikosR committed
4541
    var scrollHeight = this._getScrollHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4542

XhmikosR's avatar
XhmikosR committed
4543
    var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight();
XhmikosR's avatar
Dist.  
XhmikosR committed
4544
4545
4546
4547
4548
4549

    if (this._scrollHeight !== scrollHeight) {
      this.refresh();
    }

    if (scrollTop >= maxScroll) {
XhmikosR's avatar
XhmikosR committed
4550
      var target = this._targets[this._targets.length - 1];
XhmikosR's avatar
Dist.  
XhmikosR committed
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566

      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;
    }

XhmikosR's avatar
XhmikosR committed
4567
    var offsetLength = this._offsets.length;
XhmikosR's avatar
Dist.  
XhmikosR committed
4568

XhmikosR's avatar
XhmikosR committed
4569
4570
    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]);
XhmikosR's avatar
Dist.  
XhmikosR committed
4571
4572
4573
4574
4575

      if (isActiveTarget) {
        this._activate(this._targets[i]);
      }
    }
XhmikosR's avatar
XhmikosR committed
4576
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4577

XhmikosR's avatar
XhmikosR committed
4578
  _proto._activate = function _activate(target) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4579
4580
4581
4582
    this._activeTarget = target;

    this._clear();

XhmikosR's avatar
XhmikosR committed
4583
4584
4585
    var queries = this._selector.split(',').map(function (selector) {
      return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]";
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4586

XhmikosR's avatar
XhmikosR committed
4587
    var link = SelectorEngine.findOne(queries.join(','));
XhmikosR's avatar
Dist.  
XhmikosR committed
4588

XhmikosR's avatar
XhmikosR committed
4589
4590
4591
    if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {
      SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, SelectorEngine.closest(link, SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$2);
      link.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
Dist.  
XhmikosR committed
4592
4593
    } else {
      // Set triggered link as active
XhmikosR's avatar
XhmikosR committed
4594
4595
      link.classList.add(CLASS_NAME_ACTIVE$2);
      SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP).forEach(function (listGroup) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4596
4597
        // Set triggered links parents as active
        // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor
XhmikosR's avatar
XhmikosR committed
4598
4599
        SelectorEngine.prev(listGroup, SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).forEach(function (item) {
          return item.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4600
        }); // Handle special case when .nav-link is inside .nav-item
XhmikosR's avatar
Dist.  
XhmikosR committed
4601

XhmikosR's avatar
XhmikosR committed
4602
4603
4604
        SelectorEngine.prev(listGroup, SELECTOR_NAV_ITEMS).forEach(function (navItem) {
          SelectorEngine.children(navItem, SELECTOR_NAV_LINKS).forEach(function (item) {
            return item.classList.add(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4605
          });
XhmikosR's avatar
Dist.  
XhmikosR committed
4606
4607
4608
4609
        });
      });
    }

XhmikosR's avatar
XhmikosR committed
4610
    EventHandler.trigger(this._scrollElement, EVENT_ACTIVATE, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4611
4612
      relatedTarget: target
    });
XhmikosR's avatar
XhmikosR committed
4613
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4614

XhmikosR's avatar
XhmikosR committed
4615
  _proto._clear = function _clear() {
XhmikosR's avatar
XhmikosR committed
4616
4617
    SelectorEngine.find(this._selector).filter(function (node) {
      return node.classList.contains(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4618
    }).forEach(function (node) {
XhmikosR's avatar
XhmikosR committed
4619
      return node.classList.remove(CLASS_NAME_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4620
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
4621
  } // Static
XhmikosR's avatar
XhmikosR committed
4622
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4623

XhmikosR's avatar
XhmikosR committed
4624
  ScrollSpy.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4625
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4626
      var data = Data.getData(this, DATA_KEY$8);
XhmikosR's avatar
Dist.  
XhmikosR committed
4627

XhmikosR's avatar
XhmikosR committed
4628
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
4629
4630
4631
4632
4633
4634
4635

      if (!data) {
        data = new ScrollSpy(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4636
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4637
4638
4639
4640
4641
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4642
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4643

XhmikosR's avatar
XhmikosR committed
4644
  ScrollSpy.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4645
    return Data.getData(element, DATA_KEY$8);
XhmikosR's avatar
XhmikosR committed
4646
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4647

XhmikosR's avatar
XhmikosR committed
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
  _createClass(ScrollSpy, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$8;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$6;
    }
  }]);

  return ScrollSpy;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4662
4663
4664
4665
4666
4667
4668
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4669
4670
EventHandler.on(window, EVENT_LOAD_DATA_API$1, function () {
  SelectorEngine.find(SELECTOR_DATA_SPY).forEach(function (spy) {
XhmikosR's avatar
XhmikosR committed
4671
4672
    return new ScrollSpy(spy, Manipulator.getDataAttributes(spy));
  });
XhmikosR's avatar
Dist.  
XhmikosR committed
4673
});
XhmikosR's avatar
XhmikosR committed
4674
var $$9 = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4675
4676
4677
4678
4679
4680
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 */

4681
4682
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4683
4684
4685
4686
if ($$9) {
  var JQUERY_NO_CONFLICT$8 = $$9.fn[NAME$8];
  $$9.fn[NAME$8] = ScrollSpy.jQueryInterface;
  $$9.fn[NAME$8].Constructor = ScrollSpy;
XhmikosR's avatar
Dist.  
XhmikosR committed
4687

XhmikosR's avatar
XhmikosR committed
4688
4689
4690
  $$9.fn[NAME$8].noConflict = function () {
    $$9.fn[NAME$8] = JQUERY_NO_CONFLICT$8;
    return ScrollSpy.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4691
4692
4693
4694
4695
4696
4697
4698
4699
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4700
4701
4702
4703
4704
var NAME$9 = 'tab';
var VERSION$9 = '4.3.1';
var DATA_KEY$9 = 'bs.tab';
var EVENT_KEY$9 = "." + DATA_KEY$9;
var DATA_API_KEY$7 = '.data-api';
XhmikosR's avatar
XhmikosR committed
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
var EVENT_HIDE$3 = "hide" + EVENT_KEY$9;
var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$9;
var EVENT_SHOW$3 = "show" + EVENT_KEY$9;
var EVENT_SHOWN$3 = "shown" + EVENT_KEY$9;
var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$9 + DATA_API_KEY$7;
var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu';
var CLASS_NAME_ACTIVE$3 = 'active';
var CLASS_NAME_DISABLED$2 = 'disabled';
var CLASS_NAME_FADE$3 = 'fade';
var CLASS_NAME_SHOW$5 = 'show';
var SELECTOR_DROPDOWN$1 = '.dropdown';
var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group';
var SELECTOR_ACTIVE$2 = '.active';
var SELECTOR_ACTIVE_UL = ':scope > li > .active';
var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]';
var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle';
var SELECTOR_DROPDOWN_ACTIVE_CHILD = ':scope > .dropdown-menu .active';
XhmikosR's avatar
XhmikosR committed
4722
4723
4724
4725
4726
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4727

XhmikosR's avatar
XhmikosR committed
4728
var Tab = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4729
  function Tab(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4730
4731
4732
4733
4734
    this._element = element;
    Data.setData(this._element, DATA_KEY$9, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4735
  var _proto = Tab.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4736

XhmikosR's avatar
XhmikosR committed
4737
4738
4739
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4740

XhmikosR's avatar
XhmikosR committed
4741
    if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && this._element.classList.contains(CLASS_NAME_ACTIVE$3) || this._element.classList.contains(CLASS_NAME_DISABLED$2)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4742
4743
4744
      return;
    }

XhmikosR's avatar
XhmikosR committed
4745
    var previous;
XhmikosR's avatar
XhmikosR committed
4746
    var target = getElementFromSelector(this._element);
XhmikosR's avatar
XhmikosR committed
4747
    var listElement = SelectorEngine.closest(this._element, SELECTOR_NAV_LIST_GROUP$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4748
4749

    if (listElement) {
XhmikosR's avatar
XhmikosR committed
4750
4751
      var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE$2;
      previous = SelectorEngine.find(itemSelector, listElement);
XhmikosR's avatar
Dist.  
XhmikosR committed
4752
4753
4754
      previous = previous[previous.length - 1];
    }

XhmikosR's avatar
XhmikosR committed
4755
    var hideEvent = null;
XhmikosR's avatar
Dist.  
XhmikosR committed
4756
4757

    if (previous) {
XhmikosR's avatar
XhmikosR committed
4758
      hideEvent = EventHandler.trigger(previous, EVENT_HIDE$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4759
4760
4761
4762
        relatedTarget: this._element
      });
    }

XhmikosR's avatar
XhmikosR committed
4763
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4764
4765
4766
4767
4768
4769
4770
4771
4772
      relatedTarget: previous
    });

    if (showEvent.defaultPrevented || hideEvent !== null && hideEvent.defaultPrevented) {
      return;
    }

    this._activate(this._element, listElement);

XhmikosR's avatar
XhmikosR committed
4773
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4774
      EventHandler.trigger(previous, EVENT_HIDDEN$3, {
XhmikosR's avatar
XhmikosR committed
4775
        relatedTarget: _this._element
XhmikosR's avatar
Dist.  
XhmikosR committed
4776
      });
XhmikosR's avatar
XhmikosR committed
4777
      EventHandler.trigger(_this._element, EVENT_SHOWN$3, {
XhmikosR's avatar
Dist.  
XhmikosR committed
4778
4779
4780
4781
4782
4783
4784
4785
4786
        relatedTarget: previous
      });
    };

    if (target) {
      this._activate(target, target.parentNode, complete);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4787
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4788

XhmikosR's avatar
XhmikosR committed
4789
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
4790
4791
4792
    Data.removeData(this._element, DATA_KEY$9);
    this._element = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
4793
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4794

XhmikosR's avatar
XhmikosR committed
4795
4796
  _proto._activate = function _activate(element, container, callback) {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4797

XhmikosR's avatar
XhmikosR committed
4798
    var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? SelectorEngine.find(SELECTOR_ACTIVE_UL, container) : SelectorEngine.children(container, SELECTOR_ACTIVE$2);
XhmikosR's avatar
XhmikosR committed
4799
    var active = activeElements[0];
XhmikosR's avatar
XhmikosR committed
4800
    var isTransitioning = callback && active && active.classList.contains(CLASS_NAME_FADE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4801

XhmikosR's avatar
XhmikosR committed
4802
4803
4804
    var complete = function complete() {
      return _this2._transitionComplete(element, active, callback);
    };
XhmikosR's avatar
Dist.  
XhmikosR committed
4805
4806

    if (active && isTransitioning) {
XhmikosR's avatar
XhmikosR committed
4807
      var transitionDuration = getTransitionDurationFromElement(active);
XhmikosR's avatar
XhmikosR committed
4808
      active.classList.remove(CLASS_NAME_SHOW$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
4809
4810
4811
4812
4813
      EventHandler.one(active, TRANSITION_END, complete);
      emulateTransitionEnd(active, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
4814
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4815

XhmikosR's avatar
XhmikosR committed
4816
  _proto._transitionComplete = function _transitionComplete(element, active, callback) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4817
    if (active) {
XhmikosR's avatar
XhmikosR committed
4818
4819
      active.classList.remove(CLASS_NAME_ACTIVE$3);
      var dropdownChild = SelectorEngine.findOne(SELECTOR_DROPDOWN_ACTIVE_CHILD, active.parentNode);
XhmikosR's avatar
Dist.  
XhmikosR committed
4820
4821

      if (dropdownChild) {
XhmikosR's avatar
XhmikosR committed
4822
        dropdownChild.classList.remove(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4823
4824
4825
4826
4827
4828
4829
      }

      if (active.getAttribute('role') === 'tab') {
        active.setAttribute('aria-selected', false);
      }
    }

XhmikosR's avatar
XhmikosR committed
4830
    element.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
Dist.  
XhmikosR committed
4831
4832
4833
4834
4835
4836
4837

    if (element.getAttribute('role') === 'tab') {
      element.setAttribute('aria-selected', true);
    }

    reflow(element);

XhmikosR's avatar
XhmikosR committed
4838
4839
    if (element.classList.contains(CLASS_NAME_FADE$3)) {
      element.classList.add(CLASS_NAME_SHOW$5);
XhmikosR's avatar
Dist.  
XhmikosR committed
4840
4841
    }

XhmikosR's avatar
XhmikosR committed
4842
4843
    if (element.parentNode && element.parentNode.classList.contains(CLASS_NAME_DROPDOWN_MENU)) {
      var dropdownElement = SelectorEngine.closest(element, SELECTOR_DROPDOWN$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
4844
4845

      if (dropdownElement) {
XhmikosR's avatar
XhmikosR committed
4846
4847
        SelectorEngine.find(SELECTOR_DROPDOWN_TOGGLE$1).forEach(function (dropdown) {
          return dropdown.classList.add(CLASS_NAME_ACTIVE$3);
XhmikosR's avatar
XhmikosR committed
4848
        });
XhmikosR's avatar
Dist.  
XhmikosR committed
4849
4850
4851
4852
4853
4854
4855
4856
4857
      }

      element.setAttribute('aria-expanded', true);
    }

    if (callback) {
      callback();
    }
  } // Static
XhmikosR's avatar
XhmikosR committed
4858
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
4859

XhmikosR's avatar
XhmikosR committed
4860
  Tab.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4861
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
4862
      var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4863
4864
4865

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
4866
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
4867
4868
4869
4870
4871
        }

        data[config]();
      }
    });
XhmikosR's avatar
XhmikosR committed
4872
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4873

XhmikosR's avatar
XhmikosR committed
4874
  Tab.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4875
    return Data.getData(element, DATA_KEY$9);
XhmikosR's avatar
XhmikosR committed
4876
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
4877

XhmikosR's avatar
XhmikosR committed
4878
4879
4880
4881
4882
4883
4884
4885
4886
  _createClass(Tab, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$9;
    }
  }]);

  return Tab;
}();
XhmikosR's avatar
Dist.  
XhmikosR committed
4887
4888
4889
4890
4891
4892
4893
/**
 * ------------------------------------------------------------------------
 * Data Api implementation
 * ------------------------------------------------------------------------
 */


XhmikosR's avatar
XhmikosR committed
4894
EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$4, function (event) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4895
  event.preventDefault();
XhmikosR's avatar
XhmikosR committed
4896
  var data = Data.getData(this, DATA_KEY$9) || new Tab(this);
XhmikosR's avatar
Dist.  
XhmikosR committed
4897
4898
  data.show();
});
XhmikosR's avatar
XhmikosR committed
4899
var $$a = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
4900
4901
4902
4903
4904
4905
4906
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 * add .tab to jQuery only if jQuery is present
 */

4907
4908
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
4909
4910
4911
4912
if ($$a) {
  var JQUERY_NO_CONFLICT$9 = $$a.fn[NAME$9];
  $$a.fn[NAME$9] = Tab.jQueryInterface;
  $$a.fn[NAME$9].Constructor = Tab;
XhmikosR's avatar
Dist.  
XhmikosR committed
4913

XhmikosR's avatar
XhmikosR committed
4914
4915
4916
  $$a.fn[NAME$9].noConflict = function () {
    $$a.fn[NAME$9] = JQUERY_NO_CONFLICT$9;
    return Tab.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
4917
4918
4919
4920
4921
4922
4923
4924
4925
  };
}

/**
 * ------------------------------------------------------------------------
 * Constants
 * ------------------------------------------------------------------------
 */

XhmikosR's avatar
XhmikosR committed
4926
4927
4928
4929
var NAME$a = 'toast';
var VERSION$a = '4.3.1';
var DATA_KEY$a = 'bs.toast';
var EVENT_KEY$a = "." + DATA_KEY$a;
XhmikosR's avatar
XhmikosR committed
4930
4931
4932
4933
4934
4935
4936
4937
4938
var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$a;
var EVENT_HIDE$4 = "hide" + EVENT_KEY$a;
var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$a;
var EVENT_SHOW$4 = "show" + EVENT_KEY$a;
var EVENT_SHOWN$4 = "shown" + EVENT_KEY$a;
var CLASS_NAME_FADE$4 = 'fade';
var CLASS_NAME_HIDE = 'hide';
var CLASS_NAME_SHOW$6 = 'show';
var CLASS_NAME_SHOWING = 'showing';
XhmikosR's avatar
XhmikosR committed
4939
var DefaultType$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4940
4941
4942
4943
  animation: 'boolean',
  autohide: 'boolean',
  delay: 'number'
};
XhmikosR's avatar
XhmikosR committed
4944
var Default$7 = {
XhmikosR's avatar
Dist.  
XhmikosR committed
4945
4946
4947
4948
  animation: true,
  autohide: true,
  delay: 500
};
XhmikosR's avatar
XhmikosR committed
4949
var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="toast"]';
XhmikosR's avatar
XhmikosR committed
4950
4951
4952
4953
4954
/**
 * ------------------------------------------------------------------------
 * Class Definition
 * ------------------------------------------------------------------------
 */
XhmikosR's avatar
Dist.  
XhmikosR committed
4955

XhmikosR's avatar
XhmikosR committed
4956
var Toast = /*#__PURE__*/function () {
XhmikosR's avatar
XhmikosR committed
4957
  function Toast(element, config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
    this._element = element;
    this._config = this._getConfig(config);
    this._timeout = null;

    this._setListeners();

    Data.setData(element, DATA_KEY$a, this);
  } // Getters


XhmikosR's avatar
XhmikosR committed
4968
  var _proto = Toast.prototype;
XhmikosR's avatar
Dist.  
XhmikosR committed
4969

XhmikosR's avatar
XhmikosR committed
4970
4971
4972
  // Public
  _proto.show = function show() {
    var _this = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
4973

XhmikosR's avatar
XhmikosR committed
4974
    var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
4975
4976
4977
4978

    if (showEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
4979
4980

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
4981
      this._element.classList.add(CLASS_NAME_FADE$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
4982
4983
    }

XhmikosR's avatar
XhmikosR committed
4984
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
4985
      _this._element.classList.remove(CLASS_NAME_SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
4986

XhmikosR's avatar
XhmikosR committed
4987
      _this._element.classList.add(CLASS_NAME_SHOW$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
4988

XhmikosR's avatar
XhmikosR committed
4989
      EventHandler.trigger(_this._element, EVENT_SHOWN$4);
XhmikosR's avatar
Dist.  
XhmikosR committed
4990

XhmikosR's avatar
XhmikosR committed
4991
4992
4993
4994
      if (_this._config.autohide) {
        _this._timeout = setTimeout(function () {
          _this.hide();
        }, _this._config.delay);
XhmikosR's avatar
Dist.  
XhmikosR committed
4995
4996
4997
      }
    };

XhmikosR's avatar
XhmikosR committed
4998
    this._element.classList.remove(CLASS_NAME_HIDE);
XhmikosR's avatar
Dist.  
XhmikosR committed
4999

5000
5001
    reflow(this._element);

XhmikosR's avatar
XhmikosR committed
5002
    this._element.classList.add(CLASS_NAME_SHOWING);
XhmikosR's avatar
Dist.  
XhmikosR committed
5003
5004

    if (this._config.animation) {
XhmikosR's avatar
XhmikosR committed
5005
      var transitionDuration = getTransitionDurationFromElement(this._element);
XhmikosR's avatar
Dist.  
XhmikosR committed
5006
5007
5008
5009
5010
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
    } else {
      complete();
    }
XhmikosR's avatar
XhmikosR committed
5011
5012
5013
5014
  };

  _proto.hide = function hide() {
    var _this2 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5015

XhmikosR's avatar
XhmikosR committed
5016
    if (!this._element.classList.contains(CLASS_NAME_SHOW$6)) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5017
5018
5019
      return;
    }

XhmikosR's avatar
XhmikosR committed
5020
    var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4);
Mark Otto's avatar
dist v5    
Mark Otto committed
5021
5022
5023
5024

    if (hideEvent.defaultPrevented) {
      return;
    }
XhmikosR's avatar
Dist.  
XhmikosR committed
5025

XhmikosR's avatar
XhmikosR committed
5026
    var complete = function complete() {
XhmikosR's avatar
XhmikosR committed
5027
      _this2._element.classList.add(CLASS_NAME_HIDE);
XhmikosR's avatar
XhmikosR committed
5028

XhmikosR's avatar
XhmikosR committed
5029
      EventHandler.trigger(_this2._element, EVENT_HIDDEN$4);
XhmikosR's avatar
XhmikosR committed
5030
5031
    };

XhmikosR's avatar
XhmikosR committed
5032
    this._element.classList.remove(CLASS_NAME_SHOW$6);
XhmikosR's avatar
XhmikosR committed
5033
5034
5035
5036
5037

    if (this._config.animation) {
      var transitionDuration = getTransitionDurationFromElement(this._element);
      EventHandler.one(this._element, TRANSITION_END, complete);
      emulateTransitionEnd(this._element, transitionDuration);
XhmikosR's avatar
Dist.  
XhmikosR committed
5038
    } else {
XhmikosR's avatar
XhmikosR committed
5039
      complete();
XhmikosR's avatar
Dist.  
XhmikosR committed
5040
    }
XhmikosR's avatar
XhmikosR committed
5041
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5042

XhmikosR's avatar
XhmikosR committed
5043
  _proto.dispose = function dispose() {
XhmikosR's avatar
Dist.  
XhmikosR committed
5044
5045
5046
    clearTimeout(this._timeout);
    this._timeout = null;

XhmikosR's avatar
XhmikosR committed
5047
5048
    if (this._element.classList.contains(CLASS_NAME_SHOW$6)) {
      this._element.classList.remove(CLASS_NAME_SHOW$6);
XhmikosR's avatar
Dist.  
XhmikosR committed
5049
5050
    }

XhmikosR's avatar
XhmikosR committed
5051
    EventHandler.off(this._element, EVENT_CLICK_DISMISS$1);
XhmikosR's avatar
Dist.  
XhmikosR committed
5052
5053
5054
5055
    Data.removeData(this._element, DATA_KEY$a);
    this._element = null;
    this._config = null;
  } // Private
XhmikosR's avatar
XhmikosR committed
5056
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5057

XhmikosR's avatar
XhmikosR committed
5058
  _proto._getConfig = function _getConfig(config) {
5059
    config = _objectSpread2({}, Default$7, {}, Manipulator.getDataAttributes(this._element), {}, typeof config === 'object' && config ? config : {});
XhmikosR's avatar
Dist.  
XhmikosR committed
5060
5061
    typeCheckConfig(NAME$a, config, this.constructor.DefaultType);
    return config;
XhmikosR's avatar
XhmikosR committed
5062
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5063

XhmikosR's avatar
XhmikosR committed
5064
5065
  _proto._setListeners = function _setListeners() {
    var _this3 = this;
XhmikosR's avatar
Dist.  
XhmikosR committed
5066

XhmikosR's avatar
XhmikosR committed
5067
    EventHandler.on(this._element, EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function () {
XhmikosR's avatar
XhmikosR committed
5068
5069
      return _this3.hide();
    });
XhmikosR's avatar
Dist.  
XhmikosR committed
5070
  } // Static
XhmikosR's avatar
XhmikosR committed
5071
  ;
XhmikosR's avatar
Dist.  
XhmikosR committed
5072

XhmikosR's avatar
XhmikosR committed
5073
  Toast.jQueryInterface = function jQueryInterface(config) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5074
    return this.each(function () {
XhmikosR's avatar
XhmikosR committed
5075
      var data = Data.getData(this, DATA_KEY$a);
XhmikosR's avatar
Dist.  
XhmikosR committed
5076

XhmikosR's avatar
XhmikosR committed
5077
      var _config = typeof config === 'object' && config;
XhmikosR's avatar
Dist.  
XhmikosR committed
5078
5079
5080
5081
5082
5083
5084

      if (!data) {
        data = new Toast(this, _config);
      }

      if (typeof config === 'string') {
        if (typeof data[config] === 'undefined') {
XhmikosR's avatar
XhmikosR committed
5085
          throw new TypeError("No method named \"" + config + "\"");
XhmikosR's avatar
Dist.  
XhmikosR committed
5086
5087
5088
5089
5090
        }

        data[config](this);
      }
    });
XhmikosR's avatar
XhmikosR committed
5091
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5092

XhmikosR's avatar
XhmikosR committed
5093
  Toast.getInstance = function getInstance(element) {
XhmikosR's avatar
Dist.  
XhmikosR committed
5094
    return Data.getData(element, DATA_KEY$a);
XhmikosR's avatar
XhmikosR committed
5095
  };
XhmikosR's avatar
Dist.  
XhmikosR committed
5096

XhmikosR's avatar
XhmikosR committed
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
  _createClass(Toast, null, [{
    key: "VERSION",
    get: function get() {
      return VERSION$a;
    }
  }, {
    key: "DefaultType",
    get: function get() {
      return DefaultType$7;
    }
  }, {
    key: "Default",
    get: function get() {
      return Default$7;
    }
  }]);

  return Toast;
}();
XhmikosR's avatar
XhmikosR committed
5116
5117

var $$b = getjQuery();
XhmikosR's avatar
Dist.  
XhmikosR committed
5118
5119
5120
5121
5122
5123
5124
/**
 * ------------------------------------------------------------------------
 * jQuery
 * ------------------------------------------------------------------------
 *  add .toast to jQuery only if jQuery is present
 */

5125
5126
/* istanbul ignore if */

XhmikosR's avatar
XhmikosR committed
5127
5128
5129
5130
if ($$b) {
  var JQUERY_NO_CONFLICT$a = $$b.fn[NAME$a];
  $$b.fn[NAME$a] = Toast.jQueryInterface;
  $$b.fn[NAME$a].Constructor = Toast;
XhmikosR's avatar
Dist.  
XhmikosR committed
5131

XhmikosR's avatar
XhmikosR committed
5132
5133
5134
  $$b.fn[NAME$a].noConflict = function () {
    $$b.fn[NAME$a] = JQUERY_NO_CONFLICT$a;
    return Toast.jQueryInterface;
XhmikosR's avatar
Dist.  
XhmikosR committed
5135
5136
5137
5138
5139
  };
}

export { Alert, Button, Carousel, Collapse, Dropdown, Modal, Popover, ScrollSpy, Tab, Toast, Tooltip };
//# sourceMappingURL=bootstrap.esm.js.map