/*! * bootstrap v4.6.0 (https://getbootstrap.com/) * copyright 2011-2021 the bootstrap authors (https://github.com/twbs/bootstrap/graphs/contributors) * licensed under mit (https://github.com/twbs/bootstrap/blob/main/license) */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('jquery')) : typeof define === 'function' && define.amd ? define(['exports', 'jquery'], factory) : (global = typeof globalthis !== 'undefined' ? globalthis : global || self, factory(global.bootstrap = {}, global.jquery)); }(this, (function (exports, $) { 'use strict'; function _interopdefaultlegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var $__default = /*#__pure__*/_interopdefaultlegacy($); 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 _extends() { _extends = object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (object.prototype.hasownproperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function _inheritsloose(subclass, superclass) { subclass.prototype = object.create(superclass.prototype); subclass.prototype.constructor = subclass; subclass.__proto__ = superclass; } /** * -------------------------------------------------------------------------- * bootstrap (v4.6.0): util.js * licensed under mit (https://github.com/twbs/bootstrap/blob/main/license) * -------------------------------------------------------------------------- */ /** * ------------------------------------------------------------------------ * private transitionend helpers * ------------------------------------------------------------------------ */ var transition_end = 'transitionend'; var max_uid = 1000000; var milliseconds_multiplier = 1000; // shoutout anguscroll (https://goo.gl/pxwqgp) function totype(obj) { if (obj === null || typeof obj === 'undefined') { return "" + obj; } return {}.tostring.call(obj).match(/\s([a-z]+)/i)[1].tolowercase(); } function getspecialtransitionendevent() { return { bindtype: transition_end, delegatetype: transition_end, handle: function handle(event) { if ($__default['default'](event.target).is(this)) { return event.handleobj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params } return undefined; } }; } function transitionendemulator(duration) { var _this = this; var called = false; $__default['default'](this).one(util.transition_end, function () { called = true; }); settimeout(function () { if (!called) { util.triggertransitionend(_this); } }, duration); return this; } function settransitionendsupport() { $__default['default'].fn.emulatetransitionend = transitionendemulator; $__default['default'].event.special[util.transition_end] = getspecialtransitionendevent(); } /** * -------------------------------------------------------------------------- * public util api * -------------------------------------------------------------------------- */ var util = { transition_end: 'bstransitionend', getuid: function getuid(prefix) { do { prefix += ~~(math.random() * max_uid); // "~~" acts like a faster math.floor() here } while (document.getelementbyid(prefix)); return prefix; }, getselectorfromelement: function getselectorfromelement(element) { var selector = element.getattribute('data-target'); if (!selector || selector === '#') { var hrefattr = element.getattribute('href'); selector = hrefattr && hrefattr !== '#' ? hrefattr.trim() : ''; } try { return document.queryselector(selector) ? selector : null; } catch (_) { return null; } }, gettransitiondurationfromelement: function gettransitiondurationfromelement(element) { if (!element) { return 0; } // get transition-duration of the element var transitionduration = $__default['default'](element).css('transition-duration'); var transitiondelay = $__default['default'](element).css('transition-delay'); var floattransitionduration = parsefloat(transitionduration); var floattransitiondelay = parsefloat(transitiondelay); // return 0 if element or transition duration is not found 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; }, reflow: function reflow(element) { return element.offsetheight; }, triggertransitionend: function triggertransitionend(element) { $__default['default'](element).trigger(transition_end); }, supportstransitionend: function supportstransitionend() { return boolean(transition_end); }, iselement: function iselement(obj) { return (obj[0] || obj).nodetype; }, typecheckconfig: function typecheckconfig(componentname, config, configtypes) { for (var property in configtypes) { if (object.prototype.hasownproperty.call(configtypes, property)) { var expectedtypes = configtypes[property]; var value = config[property]; var valuetype = value && util.iselement(value) ? 'element' : totype(value); if (!new regexp(expectedtypes).test(valuetype)) { throw new error(componentname.touppercase() + ": " + ("option \"" + property + "\" provided type \"" + valuetype + "\" ") + ("but expected type \"" + expectedtypes + "\".")); } } } }, findshadowroot: function findshadowroot(element) { if (!document.documentelement.attachshadow) { return null; } // can find the shadow root otherwise it'll return the document if (typeof element.getrootnode === 'function') { var root = element.getrootnode(); 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 util.findshadowroot(element.parentnode); }, jquerydetection: function jquerydetection() { if (typeof $__default['default'] === 'undefined') { throw new typeerror('bootstrap\'s javascript requires jquery. jquery must be included before bootstrap\'s javascript.'); } var version = $__default['default'].fn.jquery.split(' ')[0].split('.'); var minmajor = 1; var ltmajor = 2; var minminor = 9; var minpatch = 1; var maxmajor = 4; if (version[0] < ltmajor && version[1] < minminor || version[0] === minmajor && version[1] === minminor && version[2] < minpatch || version[0] >= maxmajor) { throw new error('bootstrap\'s javascript requires at least jquery v1.9.1 but less than v4.0.0'); } } }; util.jquerydetection(); settransitionendsupport(); /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name = 'alert'; var version = '4.6.0'; var data_key = 'bs.alert'; var event_key = "." + data_key; var data_api_key = '.data-api'; var jquery_no_conflict = $__default['default'].fn[name]; 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 class_name_alert = 'alert'; var class_name_fade = 'fade'; var class_name_show = 'show'; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var alert = /*#__pure__*/function () { function alert(element) { this._element = element; } // getters var _proto = alert.prototype; // public _proto.close = function close(element) { var rootelement = this._element; if (element) { rootelement = this._getrootelement(element); } var customevent = this._triggercloseevent(rootelement); if (customevent.isdefaultprevented()) { return; } this._removeelement(rootelement); }; _proto.dispose = function dispose() { $__default['default'].removedata(this._element, data_key); this._element = null; } // private ; _proto._getrootelement = function _getrootelement(element) { var selector = util.getselectorfromelement(element); var parent = false; if (selector) { parent = document.queryselector(selector); } if (!parent) { parent = $__default['default'](element).closest("." + class_name_alert)[0]; } return parent; }; _proto._triggercloseevent = function _triggercloseevent(element) { var closeevent = $__default['default'].event(event_close); $__default['default'](element).trigger(closeevent); return closeevent; }; _proto._removeelement = function _removeelement(element) { var _this = this; $__default['default'](element).removeclass(class_name_show); if (!$__default['default'](element).hasclass(class_name_fade)) { this._destroyelement(element); return; } var transitionduration = util.gettransitiondurationfromelement(element); $__default['default'](element).one(util.transition_end, function (event) { return _this._destroyelement(element, event); }).emulatetransitionend(transitionduration); }; _proto._destroyelement = function _destroyelement(element) { $__default['default'](element).detach().trigger(event_closed).remove(); } // static ; alert._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var $element = $__default['default'](this); var data = $element.data(data_key); if (!data) { data = new alert(this); $element.data(data_key, data); } if (config === 'close') { data[config](this); } }); }; alert._handledismiss = function _handledismiss(alertinstance) { return function (event) { if (event) { event.preventdefault(); } alertinstance.close(this); }; }; _createclass(alert, null, [{ key: "version", get: function get() { return version; } }]); return alert; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_click_data_api, selector_dismiss, alert._handledismiss(new alert())); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name] = alert._jqueryinterface; $__default['default'].fn[name].constructor = alert; $__default['default'].fn[name].noconflict = function () { $__default['default'].fn[name] = jquery_no_conflict; return alert._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$1 = 'button'; var version$1 = '4.6.0'; var data_key$1 = 'bs.button'; var event_key$1 = "." + data_key$1; var data_api_key$1 = '.data-api'; var jquery_no_conflict$1 = $__default['default'].fn[name$1]; var class_name_active = 'active'; var class_name_button = 'btn'; var class_name_focus = 'focus'; var selector_data_toggle_carrot = '[data-toggle^="button"]'; var selector_data_toggles = '[data-toggle="buttons"]'; var selector_data_toggle = '[data-toggle="button"]'; var selector_data_toggles_buttons = '[data-toggle="buttons"] .btn'; 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_blur_data_api = "focus" + event_key$1 + data_api_key$1 + " " + ("blur" + event_key$1 + data_api_key$1); var event_load_data_api = "load" + event_key$1 + data_api_key$1; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var button = /*#__pure__*/function () { function button(element) { this._element = element; this.shouldavoidtriggerchange = false; } // getters var _proto = button.prototype; // public _proto.toggle = function toggle() { var triggerchangeevent = true; var addariapressed = true; var rootelement = $__default['default'](this._element).closest(selector_data_toggles)[0]; if (rootelement) { var input = this._element.queryselector(selector_input); if (input) { if (input.type === 'radio') { if (input.checked && this._element.classlist.contains(class_name_active)) { triggerchangeevent = false; } else { var activeelement = rootelement.queryselector(selector_active); if (activeelement) { $__default['default'](activeelement).removeclass(class_name_active); } } } if (triggerchangeevent) { // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input if (input.type === 'checkbox' || input.type === 'radio') { input.checked = !this._element.classlist.contains(class_name_active); } if (!this.shouldavoidtriggerchange) { $__default['default'](input).trigger('change'); } } input.focus(); addariapressed = false; } } if (!(this._element.hasattribute('disabled') || this._element.classlist.contains('disabled'))) { if (addariapressed) { this._element.setattribute('aria-pressed', !this._element.classlist.contains(class_name_active)); } if (triggerchangeevent) { $__default['default'](this._element).toggleclass(class_name_active); } } }; _proto.dispose = function dispose() { $__default['default'].removedata(this._element, data_key$1); this._element = null; } // static ; button._jqueryinterface = function _jqueryinterface(config, avoidtriggerchange) { return this.each(function () { var $element = $__default['default'](this); var data = $element.data(data_key$1); if (!data) { data = new button(this); $element.data(data_key$1, data); } data.shouldavoidtriggerchange = avoidtriggerchange; if (config === 'toggle') { data[config](); } }); }; _createclass(button, null, [{ key: "version", get: function get() { return version$1; } }]); return button; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_click_data_api$1, selector_data_toggle_carrot, function (event) { var button = event.target; var initialbutton = button; if (!$__default['default'](button).hasclass(class_name_button)) { button = $__default['default'](button).closest(selector_button)[0]; } if (!button || button.hasattribute('disabled') || button.classlist.contains('disabled')) { event.preventdefault(); // work around firefox bug #1540995 } else { var inputbtn = button.queryselector(selector_input); if (inputbtn && (inputbtn.hasattribute('disabled') || inputbtn.classlist.contains('disabled'))) { event.preventdefault(); // work around firefox bug #1540995 return; } if (initialbutton.tagname === 'input' || button.tagname !== 'label') { button._jqueryinterface.call($__default['default'](button), 'toggle', initialbutton.tagname === 'input'); } } }).on(event_focus_blur_data_api, selector_data_toggle_carrot, function (event) { var button = $__default['default'](event.target).closest(selector_button)[0]; $__default['default'](button).toggleclass(class_name_focus, /^focus(in)?$/.test(event.type)); }); $__default['default'](window).on(event_load_data_api, function () { // ensure correct active class is set to match the controls' actual values/states // find all checkboxes/readio buttons inside data-toggle groups var buttons = [].slice.call(document.queryselectorall(selector_data_toggles_buttons)); for (var i = 0, len = buttons.length; i < len; i++) { var button = buttons[i]; var input = button.queryselector(selector_input); if (input.checked || input.hasattribute('checked')) { button.classlist.add(class_name_active); } else { button.classlist.remove(class_name_active); } } // find all button toggles buttons = [].slice.call(document.queryselectorall(selector_data_toggle)); for (var _i = 0, _len = buttons.length; _i < _len; _i++) { var _button = buttons[_i]; if (_button.getattribute('aria-pressed') === 'true') { _button.classlist.add(class_name_active); } else { _button.classlist.remove(class_name_active); } } }); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$1] = button._jqueryinterface; $__default['default'].fn[name$1].constructor = button; $__default['default'].fn[name$1].noconflict = function () { $__default['default'].fn[name$1] = jquery_no_conflict$1; return button._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$2 = 'carousel'; var version$2 = '4.6.0'; var data_key$2 = 'bs.carousel'; var event_key$2 = "." + data_key$2; var data_api_key$2 = '.data-api'; var jquery_no_conflict$2 = $__default['default'].fn[name$2]; var arrow_left_keycode = 37; // keyboardevent.which value for left arrow key var arrow_right_keycode = 39; // keyboardevent.which value for right arrow key var touchevent_compat_wait = 500; // time for mouse compat events to fire after touch var swipe_threshold = 40; var default = { interval: 5000, keyboard: true, slide: false, pause: 'hover', wrap: true, touch: true }; var defaulttype = { interval: '(number|boolean)', keyboard: 'boolean', slide: '(boolean|string)', pause: '(string|boolean)', wrap: 'boolean', touch: 'boolean' }; var direction_next = 'next'; 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$1 = "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"]'; var pointertype = { touch: 'touch', pen: 'pen' }; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var carousel = /*#__pure__*/function () { function carousel(element, config) { this._items = null; this._interval = null; this._activeelement = null; this._ispaused = false; this._issliding = false; this.touchtimeout = null; this.touchstartx = 0; this.touchdeltax = 0; this._config = this._getconfig(config); this._element = element; this._indicatorselement = this._element.queryselector(selector_indicators); this._touchsupported = 'ontouchstart' in document.documentelement || navigator.maxtouchpoints > 0; this._pointerevent = boolean(window.pointerevent || window.mspointerevent); this._addeventlisteners(); } // getters var _proto = carousel.prototype; // public _proto.next = function next() { if (!this._issliding) { this._slide(direction_next); } }; _proto.nextwhenvisible = function nextwhenvisible() { var $element = $__default['default'](this._element); // don't call next when the page isn't visible // or the carousel or its parent isn't visible if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { this.next(); } }; _proto.prev = function prev() { if (!this._issliding) { this._slide(direction_prev); } }; _proto.pause = function pause(event) { if (!event) { this._ispaused = true; } if (this._element.queryselector(selector_next_prev)) { util.triggertransitionend(this._element); this.cycle(true); } clearinterval(this._interval); this._interval = null; }; _proto.cycle = function cycle(event) { if (!event) { this._ispaused = false; } if (this._interval) { clearinterval(this._interval); this._interval = null; } if (this._config.interval && !this._ispaused) { this._updateinterval(); this._interval = setinterval((document.visibilitystate ? this.nextwhenvisible : this.next).bind(this), this._config.interval); } }; _proto.to = function to(index) { var _this = this; this._activeelement = this._element.queryselector(selector_active_item); var activeindex = this._getitemindex(this._activeelement); if (index > this._items.length - 1 || index < 0) { return; } if (this._issliding) { $__default['default'](this._element).one(event_slid, function () { return _this.to(index); }); return; } if (activeindex === index) { this.pause(); this.cycle(); return; } var direction = index > activeindex ? direction_next : direction_prev; this._slide(direction, this._items[index]); }; _proto.dispose = function dispose() { $__default['default'](this._element).off(event_key$2); $__default['default'].removedata(this._element, data_key$2); this._items = null; this._config = null; this._element = null; this._interval = null; this._ispaused = null; this._issliding = null; this._activeelement = null; this._indicatorselement = null; } // private ; _proto._getconfig = function _getconfig(config) { config = _extends({}, default, config); util.typecheckconfig(name$2, config, defaulttype); return config; }; _proto._handleswipe = function _handleswipe() { var absdeltax = math.abs(this.touchdeltax); if (absdeltax <= swipe_threshold) { return; } var direction = absdeltax / this.touchdeltax; this.touchdeltax = 0; // swipe left if (direction > 0) { this.prev(); } // swipe right if (direction < 0) { this.next(); } }; _proto._addeventlisteners = function _addeventlisteners() { var _this2 = this; if (this._config.keyboard) { $__default['default'](this._element).on(event_keydown, function (event) { return _this2._keydown(event); }); } if (this._config.pause === 'hover') { $__default['default'](this._element).on(event_mouseenter, function (event) { return _this2.pause(event); }).on(event_mouseleave, function (event) { return _this2.cycle(event); }); } if (this._config.touch) { this._addtoucheventlisteners(); } }; _proto._addtoucheventlisteners = function _addtoucheventlisteners() { var _this3 = this; if (!this._touchsupported) { return; } var start = function start(event) { if (_this3._pointerevent && pointertype[event.originalevent.pointertype.touppercase()]) { _this3.touchstartx = event.originalevent.clientx; } else if (!_this3._pointerevent) { _this3.touchstartx = event.originalevent.touches[0].clientx; } }; var move = function move(event) { // ensure swiping with one touch and not pinching if (event.originalevent.touches && event.originalevent.touches.length > 1) { _this3.touchdeltax = 0; } else { _this3.touchdeltax = event.originalevent.touches[0].clientx - _this3.touchstartx; } }; var end = function end(event) { if (_this3._pointerevent && pointertype[event.originalevent.pointertype.touppercase()]) { _this3.touchdeltax = event.originalevent.clientx - _this3.touchstartx; } _this3._handleswipe(); if (_this3._config.pause === 'hover') { // if it's a touch-enabled device, mouseenter/leave are fired as // part of the mouse compatibility events on first tap - the carousel // would stop cycling until user tapped out of it; // here, we listen for touchend, explicitly pause the carousel // (as if it's the second time we tap on it, mouseenter compat event // is not fired) and after a timeout (to allow for mouse compatibility // events to fire) we explicitly restart cycling _this3.pause(); if (_this3.touchtimeout) { cleartimeout(_this3.touchtimeout); } _this3.touchtimeout = settimeout(function (event) { return _this3.cycle(event); }, touchevent_compat_wait + _this3._config.interval); } }; $__default['default'](this._element.queryselectorall(selector_item_img)).on(event_drag_start, function (e) { return e.preventdefault(); }); if (this._pointerevent) { $__default['default'](this._element).on(event_pointerdown, function (event) { return start(event); }); $__default['default'](this._element).on(event_pointerup, function (event) { return end(event); }); this._element.classlist.add(class_name_pointer_event); } else { $__default['default'](this._element).on(event_touchstart, function (event) { return start(event); }); $__default['default'](this._element).on(event_touchmove, function (event) { return move(event); }); $__default['default'](this._element).on(event_touchend, function (event) { return end(event); }); } }; _proto._keydown = function _keydown(event) { 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; } }; _proto._getitemindex = function _getitemindex(element) { this._items = element && element.parentnode ? [].slice.call(element.parentnode.queryselectorall(selector_item)) : []; return this._items.indexof(element); }; _proto._getitembydirection = function _getitembydirection(direction, activeelement) { var isnextdirection = direction === direction_next; var isprevdirection = direction === direction_prev; var activeindex = this._getitemindex(activeelement); var lastitemindex = this._items.length - 1; var isgoingtowrap = isprevdirection && activeindex === 0 || isnextdirection && activeindex === lastitemindex; if (isgoingtowrap && !this._config.wrap) { return activeelement; } var delta = direction === direction_prev ? -1 : 1; var itemindex = (activeindex + delta) % this._items.length; return itemindex === -1 ? this._items[this._items.length - 1] : this._items[itemindex]; }; _proto._triggerslideevent = function _triggerslideevent(relatedtarget, eventdirectionname) { var targetindex = this._getitemindex(relatedtarget); var fromindex = this._getitemindex(this._element.queryselector(selector_active_item)); var slideevent = $__default['default'].event(event_slide, { relatedtarget: relatedtarget, direction: eventdirectionname, from: fromindex, to: targetindex }); $__default['default'](this._element).trigger(slideevent); return slideevent; }; _proto._setactiveindicatorelement = function _setactiveindicatorelement(element) { if (this._indicatorselement) { var indicators = [].slice.call(this._indicatorselement.queryselectorall(selector_active$1)); $__default['default'](indicators).removeclass(class_name_active$1); var nextindicator = this._indicatorselement.children[this._getitemindex(element)]; if (nextindicator) { $__default['default'](nextindicator).addclass(class_name_active$1); } } }; _proto._updateinterval = function _updateinterval() { var element = this._activeelement || this._element.queryselector(selector_active_item); if (!element) { return; } var elementinterval = parseint(element.getattribute('data-interval'), 10); if (elementinterval) { this._config.defaultinterval = this._config.defaultinterval || this._config.interval; this._config.interval = elementinterval; } else { this._config.interval = this._config.defaultinterval || this._config.interval; } }; _proto._slide = function _slide(direction, element) { var _this4 = this; var activeelement = this._element.queryselector(selector_active_item); var activeelementindex = this._getitemindex(activeelement); var nextelement = element || activeelement && this._getitembydirection(direction, activeelement); var nextelementindex = this._getitemindex(nextelement); var iscycling = boolean(this._interval); var directionalclassname; var orderclassname; var eventdirectionname; if (direction === direction_next) { directionalclassname = class_name_left; orderclassname = class_name_next; eventdirectionname = direction_left; } else { directionalclassname = class_name_right; orderclassname = class_name_prev; eventdirectionname = direction_right; } if (nextelement && $__default['default'](nextelement).hasclass(class_name_active$1)) { this._issliding = false; return; } var slideevent = this._triggerslideevent(nextelement, eventdirectionname); if (slideevent.isdefaultprevented()) { return; } if (!activeelement || !nextelement) { // some weirdness is happening, so we bail return; } this._issliding = true; if (iscycling) { this.pause(); } this._setactiveindicatorelement(nextelement); this._activeelement = nextelement; var slidevent = $__default['default'].event(event_slid, { relatedtarget: nextelement, direction: eventdirectionname, from: activeelementindex, to: nextelementindex }); if ($__default['default'](this._element).hasclass(class_name_slide)) { $__default['default'](nextelement).addclass(orderclassname); util.reflow(nextelement); $__default['default'](activeelement).addclass(directionalclassname); $__default['default'](nextelement).addclass(directionalclassname); var transitionduration = util.gettransitiondurationfromelement(activeelement); $__default['default'](activeelement).one(util.transition_end, function () { $__default['default'](nextelement).removeclass(directionalclassname + " " + orderclassname).addclass(class_name_active$1); $__default['default'](activeelement).removeclass(class_name_active$1 + " " + orderclassname + " " + directionalclassname); _this4._issliding = false; settimeout(function () { return $__default['default'](_this4._element).trigger(slidevent); }, 0); }).emulatetransitionend(transitionduration); } else { $__default['default'](activeelement).removeclass(class_name_active$1); $__default['default'](nextelement).addclass(class_name_active$1); this._issliding = false; $__default['default'](this._element).trigger(slidevent); } if (iscycling) { this.cycle(); } } // static ; carousel._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var data = $__default['default'](this).data(data_key$2); var _config = _extends({}, default, $__default['default'](this).data()); if (typeof config === 'object') { _config = _extends({}, _config, config); } var action = typeof config === 'string' ? config : _config.slide; if (!data) { data = new carousel(this, _config); $__default['default'](this).data(data_key$2, data); } if (typeof config === 'number') { data.to(config); } else if (typeof action === 'string') { if (typeof data[action] === 'undefined') { throw new typeerror("no method named \"" + action + "\""); } data[action](); } else if (_config.interval && _config.ride) { data.pause(); data.cycle(); } }); }; carousel._dataapiclickhandler = function _dataapiclickhandler(event) { var selector = util.getselectorfromelement(this); if (!selector) { return; } var target = $__default['default'](selector)[0]; if (!target || !$__default['default'](target).hasclass(class_name_carousel)) { return; } var config = _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); var slideindex = this.getattribute('data-slide-to'); if (slideindex) { config.interval = false; } carousel._jqueryinterface.call($__default['default'](target), config); if (slideindex) { $__default['default'](target).data(data_key$2).to(slideindex); } event.preventdefault(); }; _createclass(carousel, null, [{ key: "version", get: function get() { return version$2; } }, { key: "default", get: function get() { return default; } }]); return carousel; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_click_data_api$2, selector_data_slide, carousel._dataapiclickhandler); $__default['default'](window).on(event_load_data_api$1, function () { var carousels = [].slice.call(document.queryselectorall(selector_data_ride)); for (var i = 0, len = carousels.length; i < len; i++) { var $carousel = $__default['default'](carousels[i]); carousel._jqueryinterface.call($carousel, $carousel.data()); } }); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$2] = carousel._jqueryinterface; $__default['default'].fn[name$2].constructor = carousel; $__default['default'].fn[name$2].noconflict = function () { $__default['default'].fn[name$2] = jquery_no_conflict$2; return carousel._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$3 = 'collapse'; var version$3 = '4.6.0'; var data_key$3 = 'bs.collapse'; var event_key$3 = "." + data_key$3; var data_api_key$3 = '.data-api'; var jquery_no_conflict$3 = $__default['default'].fn[name$3]; var default$1 = { toggle: true, parent: '' }; var defaulttype$1 = { toggle: 'boolean', parent: '(string|element)' }; 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$1 = 'show'; var class_name_collapse = 'collapse'; var class_name_collapsing = 'collapsing'; var class_name_collapsed = 'collapsed'; var dimension_width = 'width'; var dimension_height = 'height'; var selector_actives = '.show, .collapsing'; var selector_data_toggle$1 = '[data-toggle="collapse"]'; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var collapse = /*#__pure__*/function () { function collapse(element, config) { this._istransitioning = false; this._element = element; this._config = this._getconfig(config); this._triggerarray = [].slice.call(document.queryselectorall("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); var togglelist = [].slice.call(document.queryselectorall(selector_data_toggle$1)); for (var i = 0, len = togglelist.length; i < len; i++) { var elem = togglelist[i]; var selector = util.getselectorfromelement(elem); var filterelement = [].slice.call(document.queryselectorall(selector)).filter(function (foundelem) { return foundelem === element; }); if (selector !== null && filterelement.length > 0) { 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(); } } // getters var _proto = collapse.prototype; // public _proto.toggle = function toggle() { if ($__default['default'](this._element).hasclass(class_name_show$1)) { this.hide(); } else { this.show(); } }; _proto.show = function show() { var _this = this; if (this._istransitioning || $__default['default'](this._element).hasclass(class_name_show$1)) { return; } var actives; var activesdata; if (this._parent) { actives = [].slice.call(this._parent.queryselectorall(selector_actives)).filter(function (elem) { if (typeof _this._config.parent === 'string') { return elem.getattribute('data-parent') === _this._config.parent; } return elem.classlist.contains(class_name_collapse); }); if (actives.length === 0) { actives = null; } } if (actives) { activesdata = $__default['default'](actives).not(this._selector).data(data_key$3); if (activesdata && activesdata._istransitioning) { return; } } var startevent = $__default['default'].event(event_show); $__default['default'](this._element).trigger(startevent); if (startevent.isdefaultprevented()) { return; } if (actives) { collapse._jqueryinterface.call($__default['default'](actives).not(this._selector), 'hide'); if (!activesdata) { $__default['default'](actives).data(data_key$3, null); } } var dimension = this._getdimension(); $__default['default'](this._element).removeclass(class_name_collapse).addclass(class_name_collapsing); this._element.style[dimension] = 0; if (this._triggerarray.length) { $__default['default'](this._triggerarray).removeclass(class_name_collapsed).attr('aria-expanded', true); } this.settransitioning(true); var complete = function complete() { $__default['default'](_this._element).removeclass(class_name_collapsing).addclass(class_name_collapse + " " + class_name_show$1); _this._element.style[dimension] = ''; _this.settransitioning(false); $__default['default'](_this._element).trigger(event_shown); }; var capitalizeddimension = dimension[0].touppercase() + dimension.slice(1); var scrollsize = "scroll" + capitalizeddimension; var transitionduration = util.gettransitiondurationfromelement(this._element); $__default['default'](this._element).one(util.transition_end, complete).emulatetransitionend(transitionduration); this._element.style[dimension] = this._element[scrollsize] + "px"; }; _proto.hide = function hide() { var _this2 = this; if (this._istransitioning || !$__default['default'](this._element).hasclass(class_name_show$1)) { return; } var startevent = $__default['default'].event(event_hide); $__default['default'](this._element).trigger(startevent); if (startevent.isdefaultprevented()) { return; } var dimension = this._getdimension(); this._element.style[dimension] = this._element.getboundingclientrect()[dimension] + "px"; util.reflow(this._element); $__default['default'](this._element).addclass(class_name_collapsing).removeclass(class_name_collapse + " " + class_name_show$1); var triggerarraylength = this._triggerarray.length; if (triggerarraylength > 0) { for (var i = 0; i < triggerarraylength; i++) { var trigger = this._triggerarray[i]; var selector = util.getselectorfromelement(trigger); if (selector !== null) { var $elem = $__default['default']([].slice.call(document.queryselectorall(selector))); if (!$elem.hasclass(class_name_show$1)) { $__default['default'](trigger).addclass(class_name_collapsed).attr('aria-expanded', false); } } } } this.settransitioning(true); var complete = function complete() { _this2.settransitioning(false); $__default['default'](_this2._element).removeclass(class_name_collapsing).addclass(class_name_collapse).trigger(event_hidden); }; this._element.style[dimension] = ''; var transitionduration = util.gettransitiondurationfromelement(this._element); $__default['default'](this._element).one(util.transition_end, complete).emulatetransitionend(transitionduration); }; _proto.settransitioning = function settransitioning(istransitioning) { this._istransitioning = istransitioning; }; _proto.dispose = function dispose() { $__default['default'].removedata(this._element, data_key$3); this._config = null; this._parent = null; this._element = null; this._triggerarray = null; this._istransitioning = null; } // private ; _proto._getconfig = function _getconfig(config) { config = _extends({}, default$1, config); config.toggle = boolean(config.toggle); // coerce string values util.typecheckconfig(name$3, config, defaulttype$1); return config; }; _proto._getdimension = function _getdimension() { var haswidth = $__default['default'](this._element).hasclass(dimension_width); return haswidth ? dimension_width : dimension_height; }; _proto._getparent = function _getparent() { var _this3 = this; var parent; if (util.iselement(this._config.parent)) { parent = this._config.parent; // it's a jquery object if (typeof this._config.parent.jquery !== 'undefined') { parent = this._config.parent[0]; } } else { parent = document.queryselector(this._config.parent); } var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; var children = [].slice.call(parent.queryselectorall(selector)); $__default['default'](children).each(function (i, element) { _this3._addariaandcollapsedclass(collapse._gettargetfromelement(element), [element]); }); return parent; }; _proto._addariaandcollapsedclass = function _addariaandcollapsedclass(element, triggerarray) { var isopen = $__default['default'](element).hasclass(class_name_show$1); if (triggerarray.length) { $__default['default'](triggerarray).toggleclass(class_name_collapsed, !isopen).attr('aria-expanded', isopen); } } // static ; collapse._gettargetfromelement = function _gettargetfromelement(element) { var selector = util.getselectorfromelement(element); return selector ? document.queryselector(selector) : null; }; collapse._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var $element = $__default['default'](this); var data = $element.data(data_key$3); var _config = _extends({}, default$1, $element.data(), typeof config === 'object' && config ? config : {}); if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { _config.toggle = false; } if (!data) { data = new collapse(this, _config); $element.data(data_key$3, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new typeerror("no method named \"" + config + "\""); } data[config](); } }); }; _createclass(collapse, null, [{ key: "version", get: function get() { return version$3; } }, { key: "default", get: function get() { return default$1; } }]); return collapse; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_click_data_api$3, selector_data_toggle$1, function (event) { // preventdefault only for elements (which change the url) not inside the collapsible element if (event.currenttarget.tagname === 'a') { event.preventdefault(); } var $trigger = $__default['default'](this); var selector = util.getselectorfromelement(this); var selectors = [].slice.call(document.queryselectorall(selector)); $__default['default'](selectors).each(function () { var $target = $__default['default'](this); var data = $target.data(data_key$3); var config = data ? 'toggle' : $trigger.data(); collapse._jqueryinterface.call($target, config); }); }); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$3] = collapse._jqueryinterface; $__default['default'].fn[name$3].constructor = collapse; $__default['default'].fn[name$3].noconflict = function () { $__default['default'].fn[name$3] = jquery_no_conflict$3; return collapse._jqueryinterface; }; /**! * @fileoverview kickass library to create and place poppers near their reference elements. * @version 1.16.1 * @license * copyright (c) 2016 federico zivolo and contributors * * permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "software"), to deal * in the software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the software, and to permit persons to whom the software is * furnished to do so, subject to the following conditions: * * the above copyright notice and this permission notice shall be included in all * copies or substantial portions of the software. * * the software is provided "as is", without warranty of any kind, express or * implied, including but not limited to the warranties of merchantability, * fitness for a particular purpose and noninfringement. in no event shall the * authors or copyright holders be liable for any claim, damages or other * liability, whether in an action of contract, tort or otherwise, arising from, * out of or in connection with the software or the use or other dealings in the * software. */ var isbrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; var timeoutduration = function () { var longertimeoutbrowsers = ['edge', 'trident', 'firefox']; for (var i = 0; i < longertimeoutbrowsers.length; i += 1) { if (isbrowser && navigator.useragent.indexof(longertimeoutbrowsers[i]) >= 0) { return 1; } } return 0; }(); function microtaskdebounce(fn) { var called = false; return function () { if (called) { return; } called = true; window.promise.resolve().then(function () { called = false; fn(); }); }; } function taskdebounce(fn) { var scheduled = false; return function () { if (!scheduled) { scheduled = true; settimeout(function () { scheduled = false; fn(); }, timeoutduration); } }; } var supportsmicrotasks = isbrowser && window.promise; /** * create a debounced version of a method, that's asynchronously deferred * but called in the minimum time possible. * * @method * @memberof popper.utils * @argument {function} fn * @returns {function} */ var debounce = supportsmicrotasks ? microtaskdebounce : taskdebounce; /** * check if the given variable is a function * @method * @memberof popper.utils * @argument {any} functiontocheck - variable to check * @returns {boolean} answer to: is a function? */ function isfunction(functiontocheck) { var gettype = {}; return functiontocheck && gettype.tostring.call(functiontocheck) === '[object function]'; } /** * get css computed property of the given element * @method * @memberof popper.utils * @argument {eement} element * @argument {string} property */ function getstylecomputedproperty(element, property) { if (element.nodetype !== 1) { return []; } // note: 1 dom access here var window = element.ownerdocument.defaultview; var css = window.getcomputedstyle(element, null); return property ? css[property] : css; } /** * returns the parentnode or the host of the element * @method * @memberof popper.utils * @argument {element} element * @returns {element} parent */ function getparentnode(element) { if (element.nodename === 'html') { return element; } return element.parentnode || element.host; } /** * returns the scrolling parent of the given element * @method * @memberof popper.utils * @argument {element} element * @returns {element} scroll parent */ function getscrollparent(element) { // return body, `getscroll` will take care to get the correct `scrolltop` from it if (!element) { return document.body; } switch (element.nodename) { case 'html': case 'body': return element.ownerdocument.body; case '#document': return element.body; } // firefox want us to check `-x` and `-y` variations as well var _getstylecomputedprop = getstylecomputedproperty(element), overflow = _getstylecomputedprop.overflow, overflowx = _getstylecomputedprop.overflowx, overflowy = _getstylecomputedprop.overflowy; if (/(auto|scroll|overlay)/.test(overflow + overflowy + overflowx)) { return element; } return getscrollparent(getparentnode(element)); } /** * returns the reference node of the reference object, or the reference object itself. * @method * @memberof popper.utils * @param {element|object} reference - the reference element (the popper will be relative to this) * @returns {element} parent */ function getreferencenode(reference) { return reference && reference.referencenode ? reference.referencenode : reference; } var isie11 = isbrowser && !!(window.msinputmethodcontext && document.documentmode); var isie10 = isbrowser && /msie 10/.test(navigator.useragent); /** * determines if the browser is internet explorer * @method * @memberof popper.utils * @param {number} version to check * @returns {boolean} isie */ function isie(version) { if (version === 11) { return isie11; } if (version === 10) { return isie10; } return isie11 || isie10; } /** * returns the offset parent of the given element * @method * @memberof popper.utils * @argument {element} element * @returns {element} offset parent */ function getoffsetparent(element) { if (!element) { return document.documentelement; } var nooffsetparent = isie(10) ? document.body : null; // note: 1 dom access here var offsetparent = element.offsetparent || null; // skip hidden elements which don't have an offsetparent while (offsetparent === nooffsetparent && element.nextelementsibling) { offsetparent = (element = element.nextelementsibling).offsetparent; } var nodename = offsetparent && offsetparent.nodename; if (!nodename || nodename === 'body' || nodename === 'html') { return element ? element.ownerdocument.documentelement : document.documentelement; } // .offsetparent will return the closest th, td or table in case // no offsetparent is present, i hate this job... if (['th', 'td', 'table'].indexof(offsetparent.nodename) !== -1 && getstylecomputedproperty(offsetparent, 'position') === 'static') { return getoffsetparent(offsetparent); } return offsetparent; } function isoffsetcontainer(element) { var nodename = element.nodename; if (nodename === 'body') { return false; } return nodename === 'html' || getoffsetparent(element.firstelementchild) === element; } /** * finds the root node (document, shadowdom root) of the given element * @method * @memberof popper.utils * @argument {element} node * @returns {element} root node */ function getroot(node) { if (node.parentnode !== null) { return getroot(node.parentnode); } return node; } /** * finds the offset parent common to the two provided nodes * @method * @memberof popper.utils * @argument {element} element1 * @argument {element} element2 * @returns {element} common offset parent */ function findcommonoffsetparent(element1, element2) { // this check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element1 || !element1.nodetype || !element2 || !element2.nodetype) { return document.documentelement; } // here we make sure to give as "start" the element that comes first in the dom var order = element1.comparedocumentposition(element2) & node.document_position_following; var start = order ? element1 : element2; var end = order ? element2 : element1; // get common ancestor container var range = document.createrange(); range.setstart(start, 0); range.setend(end, 0); var commonancestorcontainer = range.commonancestorcontainer; // both nodes are inside #document if (element1 !== commonancestorcontainer && element2 !== commonancestorcontainer || start.contains(end)) { if (isoffsetcontainer(commonancestorcontainer)) { return commonancestorcontainer; } return getoffsetparent(commonancestorcontainer); } // one of the nodes is inside shadowdom, find which one var element1root = getroot(element1); if (element1root.host) { return findcommonoffsetparent(element1root.host, element2); } else { return findcommonoffsetparent(element1, getroot(element2).host); } } /** * gets the scroll value of the given element in the given side (top and left) * @method * @memberof popper.utils * @argument {element} element * @argument {string} side `top` or `left` * @returns {number} amount of scrolled pixels */ function getscroll(element) { var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; var upperside = side === 'top' ? 'scrolltop' : 'scrollleft'; var nodename = element.nodename; if (nodename === 'body' || nodename === 'html') { var html = element.ownerdocument.documentelement; var scrollingelement = element.ownerdocument.scrollingelement || html; return scrollingelement[upperside]; } return element[upperside]; } /* * sum or subtract the element scroll values (left and top) from a given rect object * @method * @memberof popper.utils * @param {object} rect - rect object you want to change * @param {htmlelement} element - the element from the function reads the scroll values * @param {boolean} subtract - set to true if you want to subtract the scroll values * @return {object} rect - the modifier rect object */ function includescroll(rect, element) { var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var scrolltop = getscroll(element, 'top'); var scrollleft = getscroll(element, 'left'); var modifier = subtract ? -1 : 1; rect.top += scrolltop * modifier; rect.bottom += scrolltop * modifier; rect.left += scrollleft * modifier; rect.right += scrollleft * modifier; return rect; } /* * helper to detect borders of a given element * @method * @memberof popper.utils * @param {cssstyledeclaration} styles * result of `getstylecomputedproperty` on the given element * @param {string} axis - `x` or `y` * @return {number} borders - the borders size of the given axis */ function getborderssize(styles, axis) { var sidea = axis === 'x' ? 'left' : 'top'; var sideb = sidea === 'left' ? 'right' : 'bottom'; return parsefloat(styles['border' + sidea + 'width']) + parsefloat(styles['border' + sideb + 'width']); } function getsize(axis, body, html, computedstyle) { return math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isie(10) ? parseint(html['offset' + axis]) + parseint(computedstyle['margin' + (axis === 'height' ? 'top' : 'left')]) + parseint(computedstyle['margin' + (axis === 'height' ? 'bottom' : 'right')]) : 0); } function getwindowsizes(document) { var body = document.body; var html = document.documentelement; var computedstyle = isie(10) && getcomputedstyle(html); return { height: getsize('height', body, html, computedstyle), width: getsize('width', body, html, computedstyle) }; } var classcallcheck = function (instance, constructor) { if (!(instance instanceof constructor)) { throw new typeerror("cannot call a class as a function"); } }; var createclass = function () { function defineproperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; object.defineproperty(target, descriptor.key, descriptor); } } return function (constructor, protoprops, staticprops) { if (protoprops) defineproperties(constructor.prototype, protoprops); if (staticprops) defineproperties(constructor, staticprops); return constructor; }; }(); var defineproperty = function (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; }; var _extends$1 = object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (object.prototype.hasownproperty.call(source, key)) { target[key] = source[key]; } } } return target; }; /** * given element offsets, generate an output similar to getboundingclientrect * @method * @memberof popper.utils * @argument {object} offsets * @returns {object} clientrect like output */ function getclientrect(offsets) { return _extends$1({}, offsets, { right: offsets.left + offsets.width, bottom: offsets.top + offsets.height }); } /** * get bounding client rect of given element * @method * @memberof popper.utils * @param {htmlelement} element * @return {object} client rect */ function getboundingclientrect(element) { var rect = {}; // ie10 10 fix: please, don't ask, the element isn't // considered in dom in some circumstances... // this isn't reproducible in ie10 compatibility mode of ie11 try { if (isie(10)) { rect = element.getboundingclientrect(); var scrolltop = getscroll(element, 'top'); var scrollleft = getscroll(element, 'left'); rect.top += scrolltop; rect.left += scrollleft; rect.bottom += scrolltop; rect.right += scrollleft; } else { rect = element.getboundingclientrect(); } } catch (e) {} var result = { left: rect.left, top: rect.top, width: rect.right - rect.left, height: rect.bottom - rect.top }; // subtract scrollbar size from sizes var sizes = element.nodename === 'html' ? getwindowsizes(element.ownerdocument) : {}; var width = sizes.width || element.clientwidth || result.width; var height = sizes.height || element.clientheight || result.height; var horizscrollbar = element.offsetwidth - width; var vertscrollbar = element.offsetheight - height; // if an hypothetical scrollbar is detected, we must be sure it's not a `border` // we make this check conditional for performance reasons if (horizscrollbar || vertscrollbar) { var styles = getstylecomputedproperty(element); horizscrollbar -= getborderssize(styles, 'x'); vertscrollbar -= getborderssize(styles, 'y'); result.width -= horizscrollbar; result.height -= vertscrollbar; } return getclientrect(result); } function getoffsetrectrelativetoarbitrarynode(children, parent) { var fixedposition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var isie10 = isie(10); var ishtml = parent.nodename === 'html'; var childrenrect = getboundingclientrect(children); var parentrect = getboundingclientrect(parent); var scrollparent = getscrollparent(children); var styles = getstylecomputedproperty(parent); var bordertopwidth = parsefloat(styles.bordertopwidth); var borderleftwidth = parsefloat(styles.borderleftwidth); // in cases where the parent is fixed, we must ignore negative scroll in offset calc if (fixedposition && ishtml) { parentrect.top = math.max(parentrect.top, 0); parentrect.left = math.max(parentrect.left, 0); } var offsets = getclientrect({ top: childrenrect.top - parentrect.top - bordertopwidth, left: childrenrect.left - parentrect.left - borderleftwidth, width: childrenrect.width, height: childrenrect.height }); offsets.margintop = 0; offsets.marginleft = 0; // subtract margins of documentelement in case it's being used as parent // we do this only on html because it's the only element that behaves // differently when margins are applied to it. the margins are included in // the box of the documentelement, in the other cases not. if (!isie10 && ishtml) { var margintop = parsefloat(styles.margintop); var marginleft = parsefloat(styles.marginleft); offsets.top -= bordertopwidth - margintop; offsets.bottom -= bordertopwidth - margintop; offsets.left -= borderleftwidth - marginleft; offsets.right -= borderleftwidth - marginleft; // attach margintop and marginleft because in some circumstances we may need them offsets.margintop = margintop; offsets.marginleft = marginleft; } if (isie10 && !fixedposition ? parent.contains(scrollparent) : parent === scrollparent && scrollparent.nodename !== 'body') { offsets = includescroll(offsets, parent); } return offsets; } function getviewportoffsetrectrelativetoartbitrarynode(element) { var excludescroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var html = element.ownerdocument.documentelement; var relativeoffset = getoffsetrectrelativetoarbitrarynode(element, html); var width = math.max(html.clientwidth, window.innerwidth || 0); var height = math.max(html.clientheight, window.innerheight || 0); var scrolltop = !excludescroll ? getscroll(html) : 0; var scrollleft = !excludescroll ? getscroll(html, 'left') : 0; var offset = { top: scrolltop - relativeoffset.top + relativeoffset.margintop, left: scrollleft - relativeoffset.left + relativeoffset.marginleft, width: width, height: height }; return getclientrect(offset); } /** * check if the given element is fixed or is inside a fixed parent * @method * @memberof popper.utils * @argument {element} element * @argument {element} customcontainer * @returns {boolean} answer to "isfixed?" */ function isfixed(element) { var nodename = element.nodename; if (nodename === 'body' || nodename === 'html') { return false; } if (getstylecomputedproperty(element, 'position') === 'fixed') { return true; } var parentnode = getparentnode(element); if (!parentnode) { return false; } return isfixed(parentnode); } /** * finds the first parent of an element that has a transformed property defined * @method * @memberof popper.utils * @argument {element} element * @returns {element} first transformed parent or documentelement */ function getfixedpositionoffsetparent(element) { // this check is needed to avoid errors in case one of the elements isn't defined for any reason if (!element || !element.parentelement || isie()) { return document.documentelement; } var el = element.parentelement; while (el && getstylecomputedproperty(el, 'transform') === 'none') { el = el.parentelement; } return el || document.documentelement; } /** * computed the boundaries limits and return them * @method * @memberof popper.utils * @param {htmlelement} popper * @param {htmlelement} reference * @param {number} padding * @param {htmlelement} boundarieselement - element used to define the boundaries * @param {boolean} fixedposition - is in fixed position mode * @returns {object} coordinates of the boundaries */ function getboundaries(popper, reference, padding, boundarieselement) { var fixedposition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; // note: 1 dom access here var boundaries = { top: 0, left: 0 }; var offsetparent = fixedposition ? getfixedpositionoffsetparent(popper) : findcommonoffsetparent(popper, getreferencenode(reference)); // handle viewport case if (boundarieselement === 'viewport') { boundaries = getviewportoffsetrectrelativetoartbitrarynode(offsetparent, fixedposition); } else { // handle other cases based on dom element used as boundaries var boundariesnode = void 0; if (boundarieselement === 'scrollparent') { boundariesnode = getscrollparent(getparentnode(reference)); if (boundariesnode.nodename === 'body') { boundariesnode = popper.ownerdocument.documentelement; } } else if (boundarieselement === 'window') { boundariesnode = popper.ownerdocument.documentelement; } else { boundariesnode = boundarieselement; } var offsets = getoffsetrectrelativetoarbitrarynode(boundariesnode, offsetparent, fixedposition); // in case of html, we need a different computation if (boundariesnode.nodename === 'html' && !isfixed(offsetparent)) { var _getwindowsizes = getwindowsizes(popper.ownerdocument), height = _getwindowsizes.height, width = _getwindowsizes.width; boundaries.top += offsets.top - offsets.margintop; boundaries.bottom = height + offsets.top; boundaries.left += offsets.left - offsets.marginleft; boundaries.right = width + offsets.left; } else { // for all the other dom elements, this one is good boundaries = offsets; } } // add paddings padding = padding || 0; var ispaddingnumber = typeof padding === 'number'; boundaries.left += ispaddingnumber ? padding : padding.left || 0; boundaries.top += ispaddingnumber ? padding : padding.top || 0; boundaries.right -= ispaddingnumber ? padding : padding.right || 0; boundaries.bottom -= ispaddingnumber ? padding : padding.bottom || 0; return boundaries; } function getarea(_ref) { var width = _ref.width, height = _ref.height; return width * height; } /** * utility used to transform the `auto` placement to the placement with more * available space. * @method * @memberof popper.utils * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function computeautoplacement(placement, refrect, popper, reference, boundarieselement) { var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; if (placement.indexof('auto') === -1) { return placement; } var boundaries = getboundaries(popper, reference, padding, boundarieselement); var rects = { top: { width: boundaries.width, height: refrect.top - boundaries.top }, right: { width: boundaries.right - refrect.right, height: boundaries.height }, bottom: { width: boundaries.width, height: boundaries.bottom - refrect.bottom }, left: { width: refrect.left - boundaries.left, height: boundaries.height } }; var sortedareas = object.keys(rects).map(function (key) { return _extends$1({ key: key }, rects[key], { area: getarea(rects[key]) }); }).sort(function (a, b) { return b.area - a.area; }); var filteredareas = sortedareas.filter(function (_ref2) { var width = _ref2.width, height = _ref2.height; return width >= popper.clientwidth && height >= popper.clientheight; }); var computedplacement = filteredareas.length > 0 ? filteredareas[0].key : sortedareas[0].key; var variation = placement.split('-')[1]; return computedplacement + (variation ? '-' + variation : ''); } /** * get offsets to the reference element * @method * @memberof popper.utils * @param {object} state * @param {element} popper - the popper element * @param {element} reference - the reference element (the popper will be relative to this) * @param {element} fixedposition - is in fixed position mode * @returns {object} an object containing the offsets which will be applied to the popper */ function getreferenceoffsets(state, popper, reference) { var fixedposition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; var commonoffsetparent = fixedposition ? getfixedpositionoffsetparent(popper) : findcommonoffsetparent(popper, getreferencenode(reference)); return getoffsetrectrelativetoarbitrarynode(reference, commonoffsetparent, fixedposition); } /** * get the outer sizes of the given element (offset size + margins) * @method * @memberof popper.utils * @argument {element} element * @returns {object} object containing width and height properties */ function getoutersizes(element) { var window = element.ownerdocument.defaultview; var styles = window.getcomputedstyle(element); var x = parsefloat(styles.margintop || 0) + parsefloat(styles.marginbottom || 0); var y = parsefloat(styles.marginleft || 0) + parsefloat(styles.marginright || 0); var result = { width: element.offsetwidth + y, height: element.offsetheight + x }; return result; } /** * get the opposite placement of the given one * @method * @memberof popper.utils * @argument {string} placement * @returns {string} flipped placement */ function getoppositeplacement(placement) { var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; return placement.replace(/left|right|bottom|top/g, function (matched) { return hash[matched]; }); } /** * get offsets to the popper * @method * @memberof popper.utils * @param {object} position - css position the popper will get applied * @param {htmlelement} popper - the popper element * @param {object} referenceoffsets - the reference offsets (the popper will be relative to this) * @param {string} placement - one of the valid placement options * @returns {object} popperoffsets - an object containing the offsets which will be applied to the popper */ function getpopperoffsets(popper, referenceoffsets, placement) { placement = placement.split('-')[0]; // get popper node sizes var popperrect = getoutersizes(popper); // add position, width and height to our offsets object var popperoffsets = { width: popperrect.width, height: popperrect.height }; // depending by the popper placement we have to compute its offsets slightly differently var ishoriz = ['right', 'left'].indexof(placement) !== -1; var mainside = ishoriz ? 'top' : 'left'; var secondaryside = ishoriz ? 'left' : 'top'; var measurement = ishoriz ? 'height' : 'width'; var secondarymeasurement = !ishoriz ? 'height' : 'width'; popperoffsets[mainside] = referenceoffsets[mainside] + referenceoffsets[measurement] / 2 - popperrect[measurement] / 2; if (placement === secondaryside) { popperoffsets[secondaryside] = referenceoffsets[secondaryside] - popperrect[secondarymeasurement]; } else { popperoffsets[secondaryside] = referenceoffsets[getoppositeplacement(secondaryside)]; } return popperoffsets; } /** * mimics the `find` method of array * @method * @memberof popper.utils * @argument {array} arr * @argument prop * @argument value * @returns index or -1 */ function find(arr, check) { // use native find if supported if (array.prototype.find) { return arr.find(check); } // use `filter` to obtain the same behavior of `find` return arr.filter(check)[0]; } /** * return the index of the matching object * @method * @memberof popper.utils * @argument {array} arr * @argument prop * @argument value * @returns index or -1 */ function findindex(arr, prop, value) { // use native findindex if supported if (array.prototype.findindex) { return arr.findindex(function (cur) { return cur[prop] === value; }); } // use `find` + `indexof` if `findindex` isn't supported var match = find(arr, function (obj) { return obj[prop] === value; }); return arr.indexof(match); } /** * loop trough the list of modifiers and run them in order, * each of them will then edit the data object. * @method * @memberof popper.utils * @param {dataobject} data * @param {array} modifiers * @param {string} ends - optional modifier name used as stopper * @returns {dataobject} */ function runmodifiers(modifiers, data, ends) { var modifierstorun = ends === undefined ? modifiers : modifiers.slice(0, findindex(modifiers, 'name', ends)); modifierstorun.foreach(function (modifier) { if (modifier['function']) { // eslint-disable-line dot-notation console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); } var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation if (modifier.enabled && isfunction(fn)) { // add properties to offsets to make them a complete clientrect object // we do this before each modifier to make sure the previous one doesn't // mess with these values data.offsets.popper = getclientrect(data.offsets.popper); data.offsets.reference = getclientrect(data.offsets.reference); data = fn(data, modifier); } }); return data; } /** * updates the position of the popper, computing the new offsets and applying * the new style.
* prefer `scheduleupdate` over `update` because of performance reasons. * @method * @memberof popper */ function update() { // if popper is destroyed, don't perform any further update if (this.state.isdestroyed) { return; } var data = { instance: this, styles: {}, arrowstyles: {}, attributes: {}, flipped: false, offsets: {} }; // compute reference element offsets data.offsets.reference = getreferenceoffsets(this.state, this.popper, this.reference, this.options.positionfixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalplacement to know the original value data.placement = computeautoplacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundarieselement, this.options.modifiers.flip.padding); // store the computed placement inside `originalplacement` data.originalplacement = data.placement; data.positionfixed = this.options.positionfixed; // compute the popper offsets data.offsets.popper = getpopperoffsets(this.popper, data.offsets.reference, data.placement); data.offsets.popper.position = this.options.positionfixed ? 'fixed' : 'absolute'; // run the modifiers data = runmodifiers(this.modifiers, data); // the first `update` will call `oncreate` callback // the other ones will call `onupdate` callback if (!this.state.iscreated) { this.state.iscreated = true; this.options.oncreate(data); } else { this.options.onupdate(data); } } /** * helper used to know if the given modifier is enabled. * @method * @memberof popper.utils * @returns {boolean} */ function ismodifierenabled(modifiers, modifiername) { return modifiers.some(function (_ref) { var name = _ref.name, enabled = _ref.enabled; return enabled && name === modifiername; }); } /** * get the prefixed supported property name * @method * @memberof popper.utils * @argument {string} property (camelcase) * @returns {string} prefixed property (camelcase or pascalcase, depending on the vendor prefix) */ function getsupportedpropertyname(property) { var prefixes = [false, 'ms', 'webkit', 'moz', 'o']; var upperprop = property.charat(0).touppercase() + property.slice(1); for (var i = 0; i < prefixes.length; i++) { var prefix = prefixes[i]; var tocheck = prefix ? '' + prefix + upperprop : property; if (typeof document.body.style[tocheck] !== 'undefined') { return tocheck; } } return null; } /** * destroys the popper. * @method * @memberof popper */ function destroy() { this.state.isdestroyed = true; // touch dom only if `applystyle` modifier is enabled if (ismodifierenabled(this.modifiers, 'applystyle')) { this.popper.removeattribute('x-placement'); this.popper.style.position = ''; this.popper.style.top = ''; this.popper.style.left = ''; this.popper.style.right = ''; this.popper.style.bottom = ''; this.popper.style.willchange = ''; this.popper.style[getsupportedpropertyname('transform')] = ''; } this.disableeventlisteners(); // remove the popper if user explicitly asked for the deletion on destroy // do not use `remove` because ie11 doesn't support it if (this.options.removeondestroy) { this.popper.parentnode.removechild(this.popper); } return this; } /** * get the window associated with the element * @argument {element} element * @returns {window} */ function getwindow(element) { var ownerdocument = element.ownerdocument; return ownerdocument ? ownerdocument.defaultview : window; } function attachtoscrollparents(scrollparent, event, callback, scrollparents) { var isbody = scrollparent.nodename === 'body'; var target = isbody ? scrollparent.ownerdocument.defaultview : scrollparent; target.addeventlistener(event, callback, { passive: true }); if (!isbody) { attachtoscrollparents(getscrollparent(target.parentnode), event, callback, scrollparents); } scrollparents.push(target); } /** * setup needed event listeners used to update the popper position * @method * @memberof popper.utils * @private */ function setupeventlisteners(reference, options, state, updatebound) { // resize event listener on window state.updatebound = updatebound; getwindow(reference).addeventlistener('resize', state.updatebound, { passive: true }); // scroll event listener on scroll parents var scrollelement = getscrollparent(reference); attachtoscrollparents(scrollelement, 'scroll', state.updatebound, state.scrollparents); state.scrollelement = scrollelement; state.eventsenabled = true; return state; } /** * it will add resize/scroll events and start recalculating * position of the popper element when they are triggered. * @method * @memberof popper */ function enableeventlisteners() { if (!this.state.eventsenabled) { this.state = setupeventlisteners(this.reference, this.options, this.state, this.scheduleupdate); } } /** * remove event listeners used to update the popper position * @method * @memberof popper.utils * @private */ function removeeventlisteners(reference, state) { // remove resize event listener on window getwindow(reference).removeeventlistener('resize', state.updatebound); // remove scroll event listener on scroll parents state.scrollparents.foreach(function (target) { target.removeeventlistener('scroll', state.updatebound); }); // reset state state.updatebound = null; state.scrollparents = []; state.scrollelement = null; state.eventsenabled = false; return state; } /** * it will remove resize/scroll events and won't recalculate popper position * when they are triggered. it also won't trigger `onupdate` callback anymore, * unless you call `update` method manually. * @method * @memberof popper */ function disableeventlisteners() { if (this.state.eventsenabled) { cancelanimationframe(this.scheduleupdate); this.state = removeeventlisteners(this.reference, this.state); } } /** * tells if a given input is a number * @method * @memberof popper.utils * @param {*} input to check * @return {boolean} */ function isnumeric(n) { return n !== '' && !isnan(parsefloat(n)) && isfinite(n); } /** * set the style to the given popper * @method * @memberof popper.utils * @argument {element} element - element to apply the style to * @argument {object} styles * object with a list of properties and values which will be applied to the element */ function setstyles(element, styles) { object.keys(styles).foreach(function (prop) { var unit = ''; // add unit if the value is numeric and is one of the following if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexof(prop) !== -1 && isnumeric(styles[prop])) { unit = 'px'; } element.style[prop] = styles[prop] + unit; }); } /** * set the attributes to the given popper * @method * @memberof popper.utils * @argument {element} element - element to apply the attributes to * @argument {object} styles * object with a list of properties and values which will be applied to the element */ function setattributes(element, attributes) { object.keys(attributes).foreach(function (prop) { var value = attributes[prop]; if (value !== false) { element.setattribute(prop, attributes[prop]); } else { element.removeattribute(prop); } }); } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by `update` method * @argument {object} data.styles - list of style properties - values to apply to popper element * @argument {object} data.attributes - list of attribute properties - values to apply to popper element * @argument {object} options - modifiers configuration and options * @returns {object} the same data object */ function applystyle(data) { // any property present in `data.styles` will be applied to the popper, // in this way we can make the 3rd party modifiers add custom styles to it // be aware, modifiers could override the properties defined in the previous // lines of this modifier! setstyles(data.instance.popper, data.styles); // any property present in `data.attributes` will be applied to the popper, // they will be set as html attributes of the element setattributes(data.instance.popper, data.attributes); // if arrowelement is defined and arrowstyles has some properties if (data.arrowelement && object.keys(data.arrowstyles).length) { setstyles(data.arrowelement, data.arrowstyles); } return data; } /** * set the x-placement attribute before everything else because it could be used * to add margins to the popper margins needs to be calculated to get the * correct popper offsets. * @method * @memberof popper.modifiers * @param {htmlelement} reference - the reference element used to position the popper * @param {htmlelement} popper - the html element used as popper * @param {object} options - popper.js options */ function applystyleonload(reference, popper, options, modifieroptions, state) { // compute reference element offsets var referenceoffsets = getreferenceoffsets(state, popper, reference, options.positionfixed); // compute auto placement, store placement inside the data object, // modifiers will be able to edit `placement` if needed // and refer to originalplacement to know the original value var placement = computeautoplacement(options.placement, referenceoffsets, popper, reference, options.modifiers.flip.boundarieselement, options.modifiers.flip.padding); popper.setattribute('x-placement', placement); // apply `position` to popper before anything else because // without the position applied we can't guarantee correct computations setstyles(popper, { position: options.positionfixed ? 'fixed' : 'absolute' }); return options; } /** * @function * @memberof popper.utils * @argument {object} data - the data object generated by `update` method * @argument {boolean} shouldround - if the offsets should be rounded at all * @returns {object} the popper's position offsets rounded * * the tale of pixel-perfect positioning. it's still not 100% perfect, but as * good as it can be within reason. * discussion here: https://github.com/fezvrasta/popper.js/pull/715 * * low dpi screens cause a popper to be blurry if not using full pixels (safari * as well on high dpi screens). * * firefox prefers no rounding for positioning and does not have blurriness on * high dpi screens. * * only horizontal placement and left/right values need to be considered. */ function getroundedoffsets(data, shouldround) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var round = math.round, floor = math.floor; var noround = function noround(v) { return v; }; var referencewidth = round(reference.width); var popperwidth = round(popper.width); var isvertical = ['left', 'right'].indexof(data.placement) !== -1; var isvariation = data.placement.indexof('-') !== -1; var samewidthparity = referencewidth % 2 === popperwidth % 2; var bothoddwidth = referencewidth % 2 === 1 && popperwidth % 2 === 1; var horizontaltointeger = !shouldround ? noround : isvertical || isvariation || samewidthparity ? round : floor; var verticaltointeger = !shouldround ? noround : round; return { left: horizontaltointeger(bothoddwidth && !isvariation && shouldround ? popper.left - 1 : popper.left), top: verticaltointeger(popper.top), bottom: verticaltointeger(popper.bottom), right: horizontaltointeger(popper.right) }; } var isfirefox = isbrowser && /firefox/i.test(navigator.useragent); /** * @function * @memberof modifiers * @argument {object} data - the data object generated by `update` method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function computestyle(data, options) { var x = options.x, y = options.y; var popper = data.offsets.popper; // remove this legacy support in popper.js v2 var legacygpuaccelerationoption = find(data.instance.modifiers, function (modifier) { return modifier.name === 'applystyle'; }).gpuacceleration; if (legacygpuaccelerationoption !== undefined) { console.warn('warning: `gpuacceleration` option moved to `computestyle` modifier and will not be supported in future versions of popper.js!'); } var gpuacceleration = legacygpuaccelerationoption !== undefined ? legacygpuaccelerationoption : options.gpuacceleration; var offsetparent = getoffsetparent(data.instance.popper); var offsetparentrect = getboundingclientrect(offsetparent); // styles var styles = { position: popper.position }; var offsets = getroundedoffsets(data, window.devicepixelratio < 2 || !isfirefox); var sidea = x === 'bottom' ? 'top' : 'bottom'; var sideb = y === 'right' ? 'left' : 'right'; // if gpuacceleration is set to `true` and transform is supported, // we use `translate3d` to apply the position to the popper we // automatically use the supported prefixed version if needed var prefixedproperty = getsupportedpropertyname('transform'); // now, let's make a step back and look at this code closely (wtf?) // if the content of the popper grows once it's been positioned, it // may happen that the popper gets misplaced because of the new content // overflowing its reference element // to avoid this problem, we provide two options (x and y), which allow // the consumer to define the offset origin. // if we position a popper on top of a reference element, we can set // `x` to `top` to make the popper grow towards its top instead of // its bottom. var left = void 0, top = void 0; if (sidea === 'bottom') { // when offsetparent is the positioning is relative to the bottom of the screen (excluding the scrollbar) // and not the bottom of the html element if (offsetparent.nodename === 'html') { top = -offsetparent.clientheight + offsets.bottom; } else { top = -offsetparentrect.height + offsets.bottom; } } else { top = offsets.top; } if (sideb === 'right') { if (offsetparent.nodename === 'html') { left = -offsetparent.clientwidth + offsets.right; } else { left = -offsetparentrect.width + offsets.right; } } else { left = offsets.left; } if (gpuacceleration && prefixedproperty) { styles[prefixedproperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; styles[sidea] = 0; styles[sideb] = 0; styles.willchange = 'transform'; } else { // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties var inverttop = sidea === 'bottom' ? -1 : 1; var invertleft = sideb === 'right' ? -1 : 1; styles[sidea] = top * inverttop; styles[sideb] = left * invertleft; styles.willchange = sidea + ', ' + sideb; } // attributes var attributes = { 'x-placement': data.placement }; // update `data` attributes, styles and arrowstyles data.attributes = _extends$1({}, attributes, data.attributes); data.styles = _extends$1({}, styles, data.styles); data.arrowstyles = _extends$1({}, data.offsets.arrow, data.arrowstyles); return data; } /** * helper used to know if the given modifier depends from another one.
* it checks if the needed modifier is listed and enabled. * @method * @memberof popper.utils * @param {array} modifiers - list of modifiers * @param {string} requestingname - name of requesting modifier * @param {string} requestedname - name of requested modifier * @returns {boolean} */ function ismodifierrequired(modifiers, requestingname, requestedname) { var requesting = find(modifiers, function (_ref) { var name = _ref.name; return name === requestingname; }); var isrequired = !!requesting && modifiers.some(function (modifier) { return modifier.name === requestedname && modifier.enabled && modifier.order < requesting.order; }); if (!isrequired) { var _requesting = '`' + requestingname + '`'; var requested = '`' + requestedname + '`'; console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); } return isrequired; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function arrow(data, options) { var _data$offsets$arrow; // arrow depends on keeptogether in order to work if (!ismodifierrequired(data.instance.modifiers, 'arrow', 'keeptogether')) { return data; } var arrowelement = options.element; // if arrowelement is a string, suppose it's a css selector if (typeof arrowelement === 'string') { arrowelement = data.instance.popper.queryselector(arrowelement); // if arrowelement is not found, don't run the modifier if (!arrowelement) { return data; } } else { // if the arrowelement isn't a query selector we must check that the // provided dom node is child of its popper node if (!data.instance.popper.contains(arrowelement)) { console.warn('warning: `arrow.element` must be child of its popper element!'); return data; } } var placement = data.placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var isvertical = ['left', 'right'].indexof(placement) !== -1; var len = isvertical ? 'height' : 'width'; var sidecapitalized = isvertical ? 'top' : 'left'; var side = sidecapitalized.tolowercase(); var altside = isvertical ? 'left' : 'top'; var opside = isvertical ? 'bottom' : 'right'; var arrowelementsize = getoutersizes(arrowelement)[len]; // // extends keeptogether behavior making sure the popper and its // reference have enough pixels in conjunction // // top/left side if (reference[opside] - arrowelementsize < popper[side]) { data.offsets.popper[side] -= popper[side] - (reference[opside] - arrowelementsize); } // bottom/right side if (reference[side] + arrowelementsize > popper[opside]) { data.offsets.popper[side] += reference[side] + arrowelementsize - popper[opside]; } data.offsets.popper = getclientrect(data.offsets.popper); // compute center of the popper var center = reference[side] + reference[len] / 2 - arrowelementsize / 2; // compute the sidevalue using the updated popper offsets // take popper margin in account because we don't have this info available var css = getstylecomputedproperty(data.instance.popper); var poppermarginside = parsefloat(css['margin' + sidecapitalized]); var popperborderside = parsefloat(css['border' + sidecapitalized + 'width']); var sidevalue = center - data.offsets.popper[side] - poppermarginside - popperborderside; // prevent arrowelement from being placed not contiguously to its popper sidevalue = math.max(math.min(popper[len] - arrowelementsize, sidevalue), 0); data.arrowelement = arrowelement; data.offsets.arrow = (_data$offsets$arrow = {}, defineproperty(_data$offsets$arrow, side, math.round(sidevalue)), defineproperty(_data$offsets$arrow, altside, ''), _data$offsets$arrow); return data; } /** * get the opposite placement variation of the given one * @method * @memberof popper.utils * @argument {string} placement variation * @returns {string} flipped placement variation */ function getoppositevariation(variation) { if (variation === 'end') { return 'start'; } else if (variation === 'start') { return 'end'; } return variation; } /** * list of accepted placements to use as values of the `placement` option.
* valid placements are: * - `auto` * - `top` * - `right` * - `bottom` * - `left` * * each placement can have a variation from this list: * - `-start` * - `-end` * * variations are interpreted easily if you think of them as the left to right * written languages. horizontally (`top` and `bottom`), `start` is left and `end` * is right.
* vertically (`left` and `right`), `start` is top and `end` is bottom. * * some valid examples are: * - `top-end` (on top of reference, right aligned) * - `right-start` (on right of reference, top aligned) * - `bottom` (on bottom, centered) * - `auto-end` (on the side with more space available, alignment depends by placement) * * @static * @type {array} * @enum {string} * @readonly * @method placements * @memberof popper */ var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; // get rid of `auto` `auto-start` and `auto-end` var validplacements = placements.slice(3); /** * given an initial placement, returns all the subsequent placements * clockwise (or counter-clockwise). * * @method * @memberof popper.utils * @argument {string} placement - a valid placement (it accepts variations) * @argument {boolean} counter - set to true to walk the placements counterclockwise * @returns {array} placements including their variations */ function clockwise(placement) { var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; var index = validplacements.indexof(placement); var arr = validplacements.slice(index + 1).concat(validplacements.slice(0, index)); return counter ? arr.reverse() : arr; } var behaviors = { flip: 'flip', clockwise: 'clockwise', counterclockwise: 'counterclockwise' }; /** * @function * @memberof modifiers * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function flip(data, options) { // if `inner` modifier is enabled, we can't use the `flip` modifier if (ismodifierenabled(data.instance.modifiers, 'inner')) { return data; } if (data.flipped && data.placement === data.originalplacement) { // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides return data; } var boundaries = getboundaries(data.instance.popper, data.instance.reference, options.padding, options.boundarieselement, data.positionfixed); var placement = data.placement.split('-')[0]; var placementopposite = getoppositeplacement(placement); var variation = data.placement.split('-')[1] || ''; var fliporder = []; switch (options.behavior) { case behaviors.flip: fliporder = [placement, placementopposite]; break; case behaviors.clockwise: fliporder = clockwise(placement); break; case behaviors.counterclockwise: fliporder = clockwise(placement, true); break; default: fliporder = options.behavior; } fliporder.foreach(function (step, index) { if (placement !== step || fliporder.length === index + 1) { return data; } placement = data.placement.split('-')[0]; placementopposite = getoppositeplacement(placement); var popperoffsets = data.offsets.popper; var refoffsets = data.offsets.reference; // using floor because the reference offsets may contain decimals we are not going to consider here var floor = math.floor; var overlapsref = placement === 'left' && floor(popperoffsets.right) > floor(refoffsets.left) || placement === 'right' && floor(popperoffsets.left) < floor(refoffsets.right) || placement === 'top' && floor(popperoffsets.bottom) > floor(refoffsets.top) || placement === 'bottom' && floor(popperoffsets.top) < floor(refoffsets.bottom); var overflowsleft = floor(popperoffsets.left) < floor(boundaries.left); var overflowsright = floor(popperoffsets.right) > floor(boundaries.right); var overflowstop = floor(popperoffsets.top) < floor(boundaries.top); var overflowsbottom = floor(popperoffsets.bottom) > floor(boundaries.bottom); var overflowsboundaries = placement === 'left' && overflowsleft || placement === 'right' && overflowsright || placement === 'top' && overflowstop || placement === 'bottom' && overflowsbottom; // flip the variation if required var isvertical = ['top', 'bottom'].indexof(placement) !== -1; // flips variation if reference element overflows boundaries var flippedvariationbyref = !!options.flipvariations && (isvertical && variation === 'start' && overflowsleft || isvertical && variation === 'end' && overflowsright || !isvertical && variation === 'start' && overflowstop || !isvertical && variation === 'end' && overflowsbottom); // flips variation if popper content overflows boundaries var flippedvariationbycontent = !!options.flipvariationsbycontent && (isvertical && variation === 'start' && overflowsright || isvertical && variation === 'end' && overflowsleft || !isvertical && variation === 'start' && overflowsbottom || !isvertical && variation === 'end' && overflowstop); var flippedvariation = flippedvariationbyref || flippedvariationbycontent; if (overlapsref || overflowsboundaries || flippedvariation) { // this boolean to detect any flip loop data.flipped = true; if (overlapsref || overflowsboundaries) { placement = fliporder[index + 1]; } if (flippedvariation) { variation = getoppositevariation(variation); } data.placement = placement + (variation ? '-' + variation : ''); // this object contains `position`, we want to preserve it along with // any additional property we may add in the future data.offsets.popper = _extends$1({}, data.offsets.popper, getpopperoffsets(data.instance.popper, data.offsets.reference, data.placement)); data = runmodifiers(data.instance.modifiers, data, 'flip'); } }); return data; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function keeptogether(data) { var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var placement = data.placement.split('-')[0]; var floor = math.floor; var isvertical = ['top', 'bottom'].indexof(placement) !== -1; var side = isvertical ? 'right' : 'bottom'; var opside = isvertical ? 'left' : 'top'; var measurement = isvertical ? 'width' : 'height'; if (popper[side] < floor(reference[opside])) { data.offsets.popper[opside] = floor(reference[opside]) - popper[measurement]; } if (popper[opside] > floor(reference[side])) { data.offsets.popper[opside] = floor(reference[side]); } return data; } /** * converts a string containing value + unit into a px value number * @function * @memberof {modifiers~offset} * @private * @argument {string} str - value + unit string * @argument {string} measurement - `height` or `width` * @argument {object} popperoffsets * @argument {object} referenceoffsets * @returns {number|string} * value in pixels, or original string if no values were extracted */ function tovalue(str, measurement, popperoffsets, referenceoffsets) { // separate value from unit var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); var value = +split[1]; var unit = split[2]; // if it's not a number it's an operator, i guess if (!value) { return str; } if (unit.indexof('%') === 0) { var element = void 0; switch (unit) { case '%p': element = popperoffsets; break; case '%': case '%r': default: element = referenceoffsets; } var rect = getclientrect(element); return rect[measurement] / 100 * value; } else if (unit === 'vh' || unit === 'vw') { // if is a vh or vw, we calculate the size based on the viewport var size = void 0; if (unit === 'vh') { size = math.max(document.documentelement.clientheight, window.innerheight || 0); } else { size = math.max(document.documentelement.clientwidth, window.innerwidth || 0); } return size / 100 * value; } else { // if is an explicit pixel unit, we get rid of the unit and keep the value // if is an implicit unit, it's px, and we return just the value return value; } } /** * parse an `offset` string to extrapolate `x` and `y` numeric offsets. * @function * @memberof {modifiers~offset} * @private * @argument {string} offset * @argument {object} popperoffsets * @argument {object} referenceoffsets * @argument {string} baseplacement * @returns {array} a two cells array with x and y offsets in numbers */ function parseoffset(offset, popperoffsets, referenceoffsets, baseplacement) { var offsets = [0, 0]; // use height if placement is left or right and index is 0 otherwise use width // in this way the first offset will use an axis and the second one // will use the other one var useheight = ['right', 'left'].indexof(baseplacement) !== -1; // split the offset string to obtain a list of values and operands // the regex addresses values with the plus or minus sign in front (+10, -20, etc) var fragments = offset.split(/(\+|\-)/).map(function (frag) { return frag.trim(); }); // detect if the offset string contains a pair of values or a single one // they could be separated by comma or space var divider = fragments.indexof(find(fragments, function (frag) { return frag.search(/,|\s/) !== -1; })); if (fragments[divider] && fragments[divider].indexof(',') === -1) { console.warn('offsets separated by white space(s) are deprecated, use a comma (,) instead.'); } // if divider is found, we divide the list of values and operands to divide // them by ofset x and y. var splitregex = /\s*,\s*|\s+/; var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitregex)[0]]), [fragments[divider].split(splitregex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; // convert the values with units to absolute pixels to allow our computations ops = ops.map(function (op, index) { // most of the units rely on the orientation of the popper var measurement = (index === 1 ? !useheight : useheight) ? 'height' : 'width'; var mergewithprevious = false; return op // this aggregates any `+` or `-` sign that aren't considered operators // e.g.: 10 + +5 => [10, +, +5] .reduce(function (a, b) { if (a[a.length - 1] === '' && ['+', '-'].indexof(b) !== -1) { a[a.length - 1] = b; mergewithprevious = true; return a; } else if (mergewithprevious) { a[a.length - 1] += b; mergewithprevious = false; return a; } else { return a.concat(b); } }, []) // here we convert the string values into number values (in px) .map(function (str) { return tovalue(str, measurement, popperoffsets, referenceoffsets); }); }); // loop trough the offsets arrays and execute the operations ops.foreach(function (op, index) { op.foreach(function (frag, index2) { if (isnumeric(frag)) { offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); } }); }); return offsets; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @argument {number|string} options.offset=0 * the offset value as described in the modifier description * @returns {object} the data object, properly modified */ function offset(data, _ref) { var offset = _ref.offset; var placement = data.placement, _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var baseplacement = placement.split('-')[0]; var offsets = void 0; if (isnumeric(+offset)) { offsets = [+offset, 0]; } else { offsets = parseoffset(offset, popper, reference, baseplacement); } if (baseplacement === 'left') { popper.top += offsets[0]; popper.left -= offsets[1]; } else if (baseplacement === 'right') { popper.top += offsets[0]; popper.left += offsets[1]; } else if (baseplacement === 'top') { popper.left += offsets[0]; popper.top -= offsets[1]; } else if (baseplacement === 'bottom') { popper.left += offsets[0]; popper.top += offsets[1]; } data.popper = popper; return data; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by `update` method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function preventoverflow(data, options) { var boundarieselement = options.boundarieselement || getoffsetparent(data.instance.popper); // if offsetparent is the reference element, we really want to // go one step up and use the next offsetparent as reference to // avoid to make this modifier completely useless and look like broken if (data.instance.reference === boundarieselement) { boundarieselement = getoffsetparent(boundarieselement); } // note: dom access here // resets the popper's position so that the document size can be calculated excluding // the size of the popper element itself var transformprop = getsupportedpropertyname('transform'); var popperstyles = data.instance.popper.style; // assignment to help minification var top = popperstyles.top, left = popperstyles.left, transform = popperstyles[transformprop]; popperstyles.top = ''; popperstyles.left = ''; popperstyles[transformprop] = ''; var boundaries = getboundaries(data.instance.popper, data.instance.reference, options.padding, boundarieselement, data.positionfixed); // note: dom access here // restores the original style properties after the offsets have been computed popperstyles.top = top; popperstyles.left = left; popperstyles[transformprop] = transform; options.boundaries = boundaries; var order = options.priority; var popper = data.offsets.popper; var check = { primary: function primary(placement) { var value = popper[placement]; if (popper[placement] < boundaries[placement] && !options.escapewithreference) { value = math.max(popper[placement], boundaries[placement]); } return defineproperty({}, placement, value); }, secondary: function secondary(placement) { var mainside = placement === 'right' ? 'left' : 'top'; var value = popper[mainside]; if (popper[placement] > boundaries[placement] && !options.escapewithreference) { value = math.min(popper[mainside], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); } return defineproperty({}, mainside, value); } }; order.foreach(function (placement) { var side = ['left', 'top'].indexof(placement) !== -1 ? 'primary' : 'secondary'; popper = _extends$1({}, popper, check[side](placement)); }); data.offsets.popper = popper; return data; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by `update` method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function shift(data) { var placement = data.placement; var baseplacement = placement.split('-')[0]; var shiftvariation = placement.split('-')[1]; // if shift shiftvariation is specified, run the modifier if (shiftvariation) { var _data$offsets = data.offsets, reference = _data$offsets.reference, popper = _data$offsets.popper; var isvertical = ['bottom', 'top'].indexof(baseplacement) !== -1; var side = isvertical ? 'left' : 'top'; var measurement = isvertical ? 'width' : 'height'; var shiftoffsets = { start: defineproperty({}, side, reference[side]), end: defineproperty({}, side, reference[side] + reference[measurement] - popper[measurement]) }; data.offsets.popper = _extends$1({}, popper, shiftoffsets[shiftvariation]); } return data; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by update method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function hide(data) { if (!ismodifierrequired(data.instance.modifiers, 'hide', 'preventoverflow')) { return data; } var refrect = data.offsets.reference; var bound = find(data.instance.modifiers, function (modifier) { return modifier.name === 'preventoverflow'; }).boundaries; if (refrect.bottom < bound.top || refrect.left > bound.right || refrect.top > bound.bottom || refrect.right < bound.left) { // avoid unnecessary dom access if visibility hasn't changed if (data.hide === true) { return data; } data.hide = true; data.attributes['x-out-of-boundaries'] = ''; } else { // avoid unnecessary dom access if visibility hasn't changed if (data.hide === false) { return data; } data.hide = false; data.attributes['x-out-of-boundaries'] = false; } return data; } /** * @function * @memberof modifiers * @argument {object} data - the data object generated by `update` method * @argument {object} options - modifiers configuration and options * @returns {object} the data object, properly modified */ function inner(data) { var placement = data.placement; var baseplacement = placement.split('-')[0]; var _data$offsets = data.offsets, popper = _data$offsets.popper, reference = _data$offsets.reference; var ishoriz = ['left', 'right'].indexof(baseplacement) !== -1; var subtractlength = ['top', 'left'].indexof(baseplacement) === -1; popper[ishoriz ? 'left' : 'top'] = reference[baseplacement] - (subtractlength ? popper[ishoriz ? 'width' : 'height'] : 0); data.placement = getoppositeplacement(placement); data.offsets.popper = getclientrect(popper); return data; } /** * modifier function, each modifier can have a function of this type assigned * to its `fn` property.
* these functions will be called on each update, this means that you must * make sure they are performant enough to avoid performance bottlenecks. * * @function modifierfn * @argument {dataobject} data - the data object generated by `update` method * @argument {object} options - modifiers configuration and options * @returns {dataobject} the data object, properly modified */ /** * modifiers are plugins used to alter the behavior of your poppers.
* popper.js uses a set of 9 modifiers to provide all the basic functionalities * needed by the library. * * usually you don't want to override the `order`, `fn` and `onload` props. * all the other properties are configurations that could be tweaked. * @namespace modifiers */ var modifiers = { /** * modifier used to shift the popper on the start or end of its reference * element.
* it will read the variation of the `placement` property.
* it can be one either `-end` or `-start`. * @memberof modifiers * @inner */ shift: { /** @prop {number} order=100 - index used to define the order of execution */ order: 100, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: shift }, /** * the `offset` modifier can shift your popper on both its axis. * * it accepts the following units: * - `px` or unit-less, interpreted as pixels * - `%` or `%r`, percentage relative to the length of the reference element * - `%p`, percentage relative to the length of the popper element * - `vw`, css viewport width unit * - `vh`, css viewport height unit * * for length is intended the main axis relative to the placement of the popper.
* this means that if the placement is `top` or `bottom`, the length will be the * `width`. in case of `left` or `right`, it will be the `height`. * * you can provide a single value (as `number` or `string`), or a pair of values * as `string` divided by a comma or one (or more) white spaces.
* the latter is a deprecated method because it leads to confusion and will be * removed in v2.
* additionally, it accepts additions and subtractions between different units. * note that multiplications and divisions aren't supported. * * valid examples are: * ``` * 10 * '10%' * '10, 10' * '10%, 10' * '10 + 10%' * '10 - 5vh + 3%' * '-10px + 5vh, 5px - 6%' * ``` * > **nb**: if you desire to apply offsets to your poppers in a way that may make them overlap * > with their reference element, unfortunately, you will have to disable the `flip` modifier. * > you can read more on this at this [issue](https://github.com/fezvrasta/popper.js/issues/373). * * @memberof modifiers * @inner */ offset: { /** @prop {number} order=200 - index used to define the order of execution */ order: 200, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: offset, /** @prop {number|string} offset=0 * the offset value as described in the modifier description */ offset: 0 }, /** * modifier used to prevent the popper from being positioned outside the boundary. * * a scenario exists where the reference itself is not within the boundaries.
* we can say it has "escaped the boundaries" — or just "escaped".
* in this case we need to decide whether the popper should either: * * - detach from the reference and remain "trapped" in the boundaries, or * - if it should ignore the boundary and "escape with its reference" * * when `escapewithreference` is set to`true` and reference is completely * outside its boundaries, the popper will overflow (or completely leave) * the boundaries in order to remain attached to the edge of the reference. * * @memberof modifiers * @inner */ preventoverflow: { /** @prop {number} order=300 - index used to define the order of execution */ order: 300, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: preventoverflow, /** * @prop {array} [priority=['left','right','top','bottom']] * popper will try to prevent overflow following these priorities by default, * then, it could overflow on the left and on top of the `boundarieselement` */ priority: ['left', 'right', 'top', 'bottom'], /** * @prop {number} padding=5 * amount of pixel used to define a minimum distance between the boundaries * and the popper. this makes sure the popper always has a little padding * between the edges of its container */ padding: 5, /** * @prop {string|htmlelement} boundarieselement='scrollparent' * boundaries used by the modifier. can be `scrollparent`, `window`, * `viewport` or any dom element. */ boundarieselement: 'scrollparent' }, /** * modifier used to make sure the reference and its popper stay near each other * without leaving any gap between the two. especially useful when the arrow is * enabled and you want to ensure that it points to its reference element. * it cares only about the first axis. you can still have poppers with margin * between the popper and its reference element. * @memberof modifiers * @inner */ keeptogether: { /** @prop {number} order=400 - index used to define the order of execution */ order: 400, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: keeptogether }, /** * this modifier is used to move the `arrowelement` of the popper to make * sure it is positioned between the reference element and its popper element. * it will read the outer size of the `arrowelement` node to detect how many * pixels of conjunction are needed. * * it has no effect if no `arrowelement` is provided. * @memberof modifiers * @inner */ arrow: { /** @prop {number} order=500 - index used to define the order of execution */ order: 500, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: arrow, /** @prop {string|htmlelement} element='[x-arrow]' - selector or node used as arrow */ element: '[x-arrow]' }, /** * modifier used to flip the popper's placement when it starts to overlap its * reference element. * * requires the `preventoverflow` modifier before it in order to work. * * **note:** this modifier will interrupt the current update cycle and will * restart it if it detects the need to flip the placement. * @memberof modifiers * @inner */ flip: { /** @prop {number} order=600 - index used to define the order of execution */ order: 600, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: flip, /** * @prop {string|array} behavior='flip' * the behavior used to change the popper's placement. it can be one of * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid * placements (with optional variations) */ behavior: 'flip', /** * @prop {number} padding=5 * the popper will flip if it hits the edges of the `boundarieselement` */ padding: 5, /** * @prop {string|htmlelement} boundarieselement='viewport' * the element which will define the boundaries of the popper position. * the popper will never be placed outside of the defined boundaries * (except if `keeptogether` is enabled) */ boundarieselement: 'viewport', /** * @prop {boolean} flipvariations=false * the popper will switch placement variation between `-start` and `-end` when * the reference element overlaps its boundaries. * * the original placement should have a set variation. */ flipvariations: false, /** * @prop {boolean} flipvariationsbycontent=false * the popper will switch placement variation between `-start` and `-end` when * the popper element overlaps its reference boundaries. * * the original placement should have a set variation. */ flipvariationsbycontent: false }, /** * modifier used to make the popper flow toward the inner of the reference element. * by default, when this modifier is disabled, the popper will be placed outside * the reference element. * @memberof modifiers * @inner */ inner: { /** @prop {number} order=700 - index used to define the order of execution */ order: 700, /** @prop {boolean} enabled=false - whether the modifier is enabled or not */ enabled: false, /** @prop {modifierfn} */ fn: inner }, /** * modifier used to hide the popper when its reference element is outside of the * popper boundaries. it will set a `x-out-of-boundaries` attribute which can * be used to hide with a css selector the popper when its reference is * out of boundaries. * * requires the `preventoverflow` modifier before it in order to work. * @memberof modifiers * @inner */ hide: { /** @prop {number} order=800 - index used to define the order of execution */ order: 800, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: hide }, /** * computes the style that will be applied to the popper element to gets * properly positioned. * * note that this modifier will not touch the dom, it just prepares the styles * so that `applystyle` modifier can apply it. this separation is useful * in case you need to replace `applystyle` with a custom implementation. * * this modifier has `850` as `order` value to maintain backward compatibility * with previous versions of popper.js. expect the modifiers ordering method * to change in future major versions of the library. * * @memberof modifiers * @inner */ computestyle: { /** @prop {number} order=850 - index used to define the order of execution */ order: 850, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: computestyle, /** * @prop {boolean} gpuacceleration=true * if true, it uses the css 3d transformation to position the popper. * otherwise, it will use the `top` and `left` properties */ gpuacceleration: true, /** * @prop {string} [x='bottom'] * where to anchor the x axis (`bottom` or `top`). aka x offset origin. * change this if your popper should grow in a direction different from `bottom` */ x: 'bottom', /** * @prop {string} [x='left'] * where to anchor the y axis (`left` or `right`). aka y offset origin. * change this if your popper should grow in a direction different from `right` */ y: 'right' }, /** * applies the computed styles to the popper element. * * all the dom manipulations are limited to this modifier. this is useful in case * you want to integrate popper.js inside a framework or view library and you * want to delegate all the dom manipulations to it. * * note that if you disable this modifier, you must make sure the popper element * has its position set to `absolute` before popper.js can do its work! * * just disable this modifier and define your own to achieve the desired effect. * * @memberof modifiers * @inner */ applystyle: { /** @prop {number} order=900 - index used to define the order of execution */ order: 900, /** @prop {boolean} enabled=true - whether the modifier is enabled or not */ enabled: true, /** @prop {modifierfn} */ fn: applystyle, /** @prop {function} */ onload: applystyleonload, /** * @deprecated since version 1.10.0, the property moved to `computestyle` modifier * @prop {boolean} gpuacceleration=true * if true, it uses the css 3d transformation to position the popper. * otherwise, it will use the `top` and `left` properties */ gpuacceleration: undefined } }; /** * the `dataobject` is an object containing all the information used by popper.js. * this object is passed to modifiers and to the `oncreate` and `onupdate` callbacks. * @name dataobject * @property {object} data.instance the popper.js instance * @property {string} data.placement placement applied to popper * @property {string} data.originalplacement placement originally defined on init * @property {boolean} data.flipped true if popper has been flipped by flip modifier * @property {boolean} data.hide true if the reference element is out of boundaries, useful to know when to hide the popper * @property {htmlelement} data.arrowelement node used as arrow by arrow modifier * @property {object} data.styles any css property defined here will be applied to the popper. it expects the javascript nomenclature (eg. `marginbottom`) * @property {object} data.arrowstyles any css property defined here will be applied to the popper arrow. it expects the javascript nomenclature (eg. `marginbottom`) * @property {object} data.boundaries offsets of the popper boundaries * @property {object} data.offsets the measurements of popper, reference and arrow elements * @property {object} data.offsets.popper `top`, `left`, `width`, `height` values * @property {object} data.offsets.reference `top`, `left`, `width`, `height` values * @property {object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 */ /** * default options provided to popper.js constructor.
* these can be overridden using the `options` argument of popper.js.
* to override an option, simply pass an object with the same * structure of the `options` object, as the 3rd argument. for example: * ``` * new popper(ref, pop, { * modifiers: { * preventoverflow: { enabled: false } * } * }) * ``` * @type {object} * @static * @memberof popper */ var defaults = { /** * popper's placement. * @prop {popper.placements} placement='bottom' */ placement: 'bottom', /** * set this to true if you want popper to position it self in 'fixed' mode * @prop {boolean} positionfixed=false */ positionfixed: false, /** * whether events (resize, scroll) are initially enabled. * @prop {boolean} eventsenabled=true */ eventsenabled: true, /** * set to true if you want to automatically remove the popper when * you call the `destroy` method. * @prop {boolean} removeondestroy=false */ removeondestroy: false, /** * callback called when the popper is created.
* by default, it is set to no-op.
* access popper.js instance with `data.instance`. * @prop {oncreate} */ oncreate: function oncreate() {}, /** * callback called when the popper is updated. this callback is not called * on the initialization/creation of the popper, but only on subsequent * updates.
* by default, it is set to no-op.
* access popper.js instance with `data.instance`. * @prop {onupdate} */ onupdate: function onupdate() {}, /** * list of modifiers used to modify the offsets before they are applied to the popper. * they provide most of the functionalities of popper.js. * @prop {modifiers} */ modifiers: modifiers }; /** * @callback oncreate * @param {dataobject} data */ /** * @callback onupdate * @param {dataobject} data */ // utils // methods var popper = function () { /** * creates a new popper.js instance. * @class popper * @param {element|referenceobject} reference - the reference element used to position the popper * @param {element} popper - the html / xml element used as the popper * @param {object} options - your custom options to override the ones defined in [defaults](#defaults) * @return {object} instance - the generated popper.js instance */ function popper(reference, popper) { var _this = this; var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; classcallcheck(this, popper); this.scheduleupdate = function () { return requestanimationframe(_this.update); }; // make update() debounced, so that it only runs at most once-per-tick this.update = debounce(this.update.bind(this)); // with {} we create a new object with the options inside it this.options = _extends$1({}, popper.defaults, options); // init state this.state = { isdestroyed: false, iscreated: false, scrollparents: [] }; // get reference and popper elements (allow jquery wrappers) this.reference = reference && reference.jquery ? reference[0] : reference; this.popper = popper && popper.jquery ? popper[0] : popper; // deep merge modifiers options this.options.modifiers = {}; object.keys(_extends$1({}, popper.defaults.modifiers, options.modifiers)).foreach(function (name) { _this.options.modifiers[name] = _extends$1({}, popper.defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); }); // refactoring modifiers' list (object => array) this.modifiers = object.keys(this.options.modifiers).map(function (name) { return _extends$1({ name: name }, _this.options.modifiers[name]); }) // sort the modifiers by order .sort(function (a, b) { return a.order - b.order; }); // modifiers have the ability to execute arbitrary code when popper.js get inited // such code is executed in the same order of its modifier // they could add new properties to their options configuration // be aware: don't add options to `options.modifiers.name` but to `modifieroptions`! this.modifiers.foreach(function (modifieroptions) { if (modifieroptions.enabled && isfunction(modifieroptions.onload)) { modifieroptions.onload(_this.reference, _this.popper, _this.options, modifieroptions, _this.state); } }); // fire the first update to position the popper in the right place this.update(); var eventsenabled = this.options.eventsenabled; if (eventsenabled) { // setup event listeners, they will take care of update the position in specific situations this.enableeventlisteners(); } this.state.eventsenabled = eventsenabled; } // we can't use class properties because they don't get listed in the // class prototype and break stuff like sinon stubs createclass(popper, [{ key: 'update', value: function update$$1() { return update.call(this); } }, { key: 'destroy', value: function destroy$$1() { return destroy.call(this); } }, { key: 'enableeventlisteners', value: function enableeventlisteners$$1() { return enableeventlisteners.call(this); } }, { key: 'disableeventlisteners', value: function disableeventlisteners$$1() { return disableeventlisteners.call(this); } /** * schedules an update. it will run on the next ui update available. * @method scheduleupdate * @memberof popper */ /** * collection of utilities useful when writing custom modifiers. * starting from version 1.7, this method is available only if you * include `popper-utils.js` before `popper.js`. * * **deprecation**: this way to access popperutils is deprecated * and will be removed in v2! use the popperutils module directly instead. * due to the high instability of the methods contained in utils, we can't * guarantee them to follow semver. use them at your own risk! * @static * @private * @type {object} * @deprecated since version 1.8 * @member utils * @memberof popper */ }]); return popper; }(); /** * the `referenceobject` is an object that provides an interface compatible with popper.js * and lets you use it as replacement of a real dom node.
* you can use this method to position a popper relatively to a set of coordinates * in case you don't have a dom node to use as reference. * * ``` * new popper(referenceobject, poppernode); * ``` * * nb: this feature isn't supported in internet explorer 10. * @name referenceobject * @property {function} data.getboundingclientrect * a function that returns a set of coordinates compatible with the native `getboundingclientrect` method. * @property {number} data.clientwidth * an es6 getter that will return the width of the virtual reference element. * @property {number} data.clientheight * an es6 getter that will return the height of the virtual reference element. */ popper.utils = (typeof window !== 'undefined' ? window : global).popperutils; popper.placements = placements; popper.defaults = defaults; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$4 = 'dropdown'; var version$4 = '4.6.0'; var data_key$4 = 'bs.dropdown'; var event_key$4 = "." + data_key$4; var data_api_key$4 = '.data-api'; var jquery_no_conflict$4 = $__default['default'].fn[name$4]; var escape_keycode = 27; // keyboardevent.which value for escape (esc) key var space_keycode = 32; // keyboardevent.which value for space key var tab_keycode = 9; // keyboardevent.which value for tab key var arrow_up_keycode = 38; // keyboardevent.which value for up arrow key var arrow_down_keycode = 40; // keyboardevent.which value for down arrow key var right_mouse_button_which = 3; // mouseevent.which value for the right button (assuming a right-handed mouse) var regexp_keydown = new regexp(arrow_up_keycode + "|" + arrow_down_keycode + "|" + escape_keycode); var event_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 = 'disabled'; var class_name_show$2 = '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_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'; var default$2 = { offset: 0, flip: true, boundary: 'scrollparent', reference: 'toggle', display: 'dynamic', popperconfig: null }; var defaulttype$2 = { offset: '(number|string|function)', flip: 'boolean', boundary: '(string|element)', reference: '(string|element)', display: 'string', popperconfig: '(null|object)' }; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var dropdown = /*#__pure__*/function () { function dropdown(element, config) { this._element = element; this._popper = null; this._config = this._getconfig(config); this._menu = this._getmenuelement(); this._innavbar = this._detectnavbar(); this._addeventlisteners(); } // getters var _proto = dropdown.prototype; // public _proto.toggle = function toggle() { if (this._element.disabled || $__default['default'](this._element).hasclass(class_name_disabled)) { return; } var isactive = $__default['default'](this._menu).hasclass(class_name_show$2); dropdown._clearmenus(); if (isactive) { return; } this.show(true); }; _proto.show = function show(usepopper) { if (usepopper === void 0) { usepopper = false; } if (this._element.disabled || $__default['default'](this._element).hasclass(class_name_disabled) || $__default['default'](this._menu).hasclass(class_name_show$2)) { return; } var relatedtarget = { relatedtarget: this._element }; var showevent = $__default['default'].event(event_show$1, relatedtarget); var parent = dropdown._getparentfromelement(this._element); $__default['default'](parent).trigger(showevent); if (showevent.isdefaultprevented()) { return; } // totally disable popper for dropdowns in navbar if (!this._innavbar && usepopper) { /** * check for popper dependency * popper - https://popper.js.org */ if (typeof popper === 'undefined') { throw new typeerror('bootstrap\'s dropdowns require popper (https://popper.js.org)'); } var referenceelement = this._element; if (this._config.reference === 'parent') { referenceelement = parent; } else if (util.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') { $__default['default'](parent).addclass(class_name_position_static); } 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 if ('ontouchstart' in document.documentelement && $__default['default'](parent).closest(selector_navbar_nav).length === 0) { $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); } this._element.focus(); this._element.setattribute('aria-expanded', true); $__default['default'](this._menu).toggleclass(class_name_show$2); $__default['default'](parent).toggleclass(class_name_show$2).trigger($__default['default'].event(event_shown$1, relatedtarget)); }; _proto.hide = function hide() { if (this._element.disabled || $__default['default'](this._element).hasclass(class_name_disabled) || !$__default['default'](this._menu).hasclass(class_name_show$2)) { return; } var relatedtarget = { relatedtarget: this._element }; var hideevent = $__default['default'].event(event_hide$1, relatedtarget); var parent = dropdown._getparentfromelement(this._element); $__default['default'](parent).trigger(hideevent); if (hideevent.isdefaultprevented()) { return; } if (this._popper) { this._popper.destroy(); } $__default['default'](this._menu).toggleclass(class_name_show$2); $__default['default'](parent).toggleclass(class_name_show$2).trigger($__default['default'].event(event_hidden$1, relatedtarget)); }; _proto.dispose = function dispose() { $__default['default'].removedata(this._element, data_key$4); $__default['default'](this._element).off(event_key$4); this._element = null; this._menu = null; if (this._popper !== null) { this._popper.destroy(); this._popper = null; } }; _proto.update = function update() { this._innavbar = this._detectnavbar(); if (this._popper !== null) { this._popper.scheduleupdate(); } } // private ; _proto._addeventlisteners = function _addeventlisteners() { var _this = this; $__default['default'](this._element).on(event_click, function (event) { event.preventdefault(); event.stoppropagation(); _this.toggle(); }); }; _proto._getconfig = function _getconfig(config) { config = _extends({}, this.constructor.default, $__default['default'](this._element).data(), config); util.typecheckconfig(name$4, config, this.constructor.defaulttype); return config; }; _proto._getmenuelement = function _getmenuelement() { if (!this._menu) { var parent = dropdown._getparentfromelement(this._element); if (parent) { this._menu = parent.queryselector(selector_menu); } } return this._menu; }; _proto._getplacement = function _getplacement() { var $parentdropdown = $__default['default'](this._element.parentnode); var placement = placement_bottom; // handle dropup if ($parentdropdown.hasclass(class_name_dropup)) { placement = $__default['default'](this._menu).hasclass(class_name_menuright) ? placement_topend : placement_top; } else if ($parentdropdown.hasclass(class_name_dropright)) { placement = placement_right; } else if ($parentdropdown.hasclass(class_name_dropleft)) { placement = placement_left; } else if ($__default['default'](this._menu).hasclass(class_name_menuright)) { placement = placement_bottomend; } return placement; }; _proto._detectnavbar = function _detectnavbar() { return $__default['default'](this._element).closest('.navbar').length > 0; }; _proto._getoffset = function _getoffset() { var _this2 = this; var offset = {}; if (typeof this._config.offset === 'function') { offset.fn = function (data) { data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); return data; }; } else { offset.offset = this._config.offset; } return offset; }; _proto._getpopperconfig = function _getpopperconfig() { var popperconfig = { placement: this._getplacement(), modifiers: { offset: this._getoffset(), flip: { enabled: this._config.flip }, preventoverflow: { boundarieselement: this._config.boundary } } }; // disable popper if we have a static display if (this._config.display === 'static') { popperconfig.modifiers.applystyle = { enabled: false }; } return _extends({}, popperconfig, this._config.popperconfig); } // static ; dropdown._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var data = $__default['default'](this).data(data_key$4); var _config = typeof config === 'object' ? config : null; if (!data) { data = new dropdown(this, _config); $__default['default'](this).data(data_key$4, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new typeerror("no method named \"" + config + "\""); } data[config](); } }); }; dropdown._clearmenus = function _clearmenus(event) { if (event && (event.which === right_mouse_button_which || event.type === 'keyup' && event.which !== tab_keycode)) { return; } var toggles = [].slice.call(document.queryselectorall(selector_data_toggle$2)); for (var i = 0, len = toggles.length; i < len; i++) { var parent = dropdown._getparentfromelement(toggles[i]); var context = $__default['default'](toggles[i]).data(data_key$4); var relatedtarget = { relatedtarget: toggles[i] }; if (event && event.type === 'click') { relatedtarget.clickevent = event; } if (!context) { continue; } var dropdownmenu = context._menu; if (!$__default['default'](parent).hasclass(class_name_show$2)) { continue; } if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagname) || event.type === 'keyup' && event.which === tab_keycode) && $__default['default'].contains(parent, event.target)) { continue; } var hideevent = $__default['default'].event(event_hide$1, relatedtarget); $__default['default'](parent).trigger(hideevent); if (hideevent.isdefaultprevented()) { 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) { $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); } toggles[i].setattribute('aria-expanded', 'false'); if (context._popper) { context._popper.destroy(); } $__default['default'](dropdownmenu).removeclass(class_name_show$2); $__default['default'](parent).removeclass(class_name_show$2).trigger($__default['default'].event(event_hidden$1, relatedtarget)); } }; dropdown._getparentfromelement = function _getparentfromelement(element) { var parent; var selector = util.getselectorfromelement(element); if (selector) { parent = document.queryselector(selector); } return parent || element.parentnode; } // eslint-disable-next-line complexity ; dropdown._dataapikeydownhandler = function _dataapikeydownhandler(event) { // if not input/textarea: // - and not a key in regexp_keydown => not a dropdown command // if input/textarea: // - if space key => not a dropdown command // - if key is other than escape // - if key is not up or down => not a dropdown command // - if trigger inside the menu => not a dropdown command if (/input|textarea/i.test(event.target.tagname) ? event.which === space_keycode || event.which !== escape_keycode && (event.which !== arrow_down_keycode && event.which !== arrow_up_keycode || $__default['default'](event.target).closest(selector_menu).length) : !regexp_keydown.test(event.which)) { return; } if (this.disabled || $__default['default'](this).hasclass(class_name_disabled)) { return; } var parent = dropdown._getparentfromelement(this); var isactive = $__default['default'](parent).hasclass(class_name_show$2); if (!isactive && event.which === escape_keycode) { return; } event.preventdefault(); event.stoppropagation(); if (!isactive || event.which === escape_keycode || event.which === space_keycode) { if (event.which === escape_keycode) { $__default['default'](parent.queryselector(selector_data_toggle$2)).trigger('focus'); } $__default['default'](this).trigger('click'); return; } var items = [].slice.call(parent.queryselectorall(selector_visible_items)).filter(function (item) { return $__default['default'](item).is(':visible'); }); if (items.length === 0) { return; } var index = items.indexof(event.target); if (event.which === arrow_up_keycode && index > 0) { // up index--; } if (event.which === arrow_down_keycode && index < items.length - 1) { // down index++; } if (index < 0) { index = 0; } items[index].focus(); }; _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; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_keydown_data_api, selector_data_toggle$2, dropdown._dataapikeydownhandler).on(event_keydown_data_api, selector_menu, dropdown._dataapikeydownhandler).on(event_click_data_api$4 + " " + event_keyup_data_api, dropdown._clearmenus).on(event_click_data_api$4, selector_data_toggle$2, function (event) { event.preventdefault(); event.stoppropagation(); dropdown._jqueryinterface.call($__default['default'](this), 'toggle'); }).on(event_click_data_api$4, selector_form_child, function (e) { e.stoppropagation(); }); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$4] = dropdown._jqueryinterface; $__default['default'].fn[name$4].constructor = dropdown; $__default['default'].fn[name$4].noconflict = function () { $__default['default'].fn[name$4] = jquery_no_conflict$4; return dropdown._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$5 = 'modal'; var version$5 = '4.6.0'; var data_key$5 = 'bs.modal'; var event_key$5 = "." + data_key$5; var data_api_key$5 = '.data-api'; var jquery_no_conflict$5 = $__default['default'].fn[name$5]; var escape_keycode$1 = 27; // keyboardevent.which value for escape (esc) key var default$3 = { backdrop: true, keyboard: true, focus: true, show: true }; var defaulttype$3 = { backdrop: '(boolean|string)', keyboard: 'boolean', focus: 'boolean', show: 'boolean' }; var event_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$1 = 'fade'; var class_name_show$3 = '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'; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var modal = /*#__pure__*/function () { function modal(element, config) { this._config = this._getconfig(config); this._element = element; this._dialog = element.queryselector(selector_dialog); this._backdrop = null; this._isshown = false; this._isbodyoverflowing = false; this._ignorebackdropclick = false; this._istransitioning = false; this._scrollbarwidth = 0; } // getters var _proto = modal.prototype; // public _proto.toggle = function toggle(relatedtarget) { return this._isshown ? this.hide() : this.show(relatedtarget); }; _proto.show = function show(relatedtarget) { var _this = this; if (this._isshown || this._istransitioning) { return; } if ($__default['default'](this._element).hasclass(class_name_fade$1)) { this._istransitioning = true; } var showevent = $__default['default'].event(event_show$2, { relatedtarget: relatedtarget }); $__default['default'](this._element).trigger(showevent); if (this._isshown || showevent.isdefaultprevented()) { return; } this._isshown = true; this._checkscrollbar(); this._setscrollbar(); this._adjustdialog(); this._setescapeevent(); this._setresizeevent(); $__default['default'](this._element).on(event_click_dismiss, selector_data_dismiss, function (event) { return _this.hide(event); }); $__default['default'](this._dialog).on(event_mousedown_dismiss, function () { $__default['default'](_this._element).one(event_mouseup_dismiss, function (event) { if ($__default['default'](event.target).is(_this._element)) { _this._ignorebackdropclick = true; } }); }); this._showbackdrop(function () { return _this._showelement(relatedtarget); }); }; _proto.hide = function hide(event) { var _this2 = this; if (event) { event.preventdefault(); } if (!this._isshown || this._istransitioning) { return; } var hideevent = $__default['default'].event(event_hide$2); $__default['default'](this._element).trigger(hideevent); if (!this._isshown || hideevent.isdefaultprevented()) { return; } this._isshown = false; var transition = $__default['default'](this._element).hasclass(class_name_fade$1); if (transition) { this._istransitioning = true; } this._setescapeevent(); this._setresizeevent(); $__default['default'](document).off(event_focusin); $__default['default'](this._element).removeclass(class_name_show$3); $__default['default'](this._element).off(event_click_dismiss); $__default['default'](this._dialog).off(event_mousedown_dismiss); if (transition) { var transitionduration = util.gettransitiondurationfromelement(this._element); $__default['default'](this._element).one(util.transition_end, function (event) { return _this2._hidemodal(event); }).emulatetransitionend(transitionduration); } else { this._hidemodal(); } }; _proto.dispose = function dispose() { [window, this._element, this._dialog].foreach(function (htmlelement) { return $__default['default'](htmlelement).off(event_key$5); }); /** * `document` has 2 events `event_focusin` and `event_click_data_api` * do not move `document` in `htmlelements` array * it will remove `event_click_data_api` event that should remain */ $__default['default'](document).off(event_focusin); $__default['default'].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; }; _proto.handleupdate = function handleupdate() { this._adjustdialog(); } // private ; _proto._getconfig = function _getconfig(config) { config = _extends({}, default$3, config); util.typecheckconfig(name$5, config, defaulttype$3); return config; }; _proto._triggerbackdroptransition = function _triggerbackdroptransition() { var _this3 = this; var hideeventprevented = $__default['default'].event(event_hide_prevented); $__default['default'](this._element).trigger(hideeventprevented); if (hideeventprevented.isdefaultprevented()) { return; } var ismodaloverflowing = this._element.scrollheight > document.documentelement.clientheight; if (!ismodaloverflowing) { this._element.style.overflowy = 'hidden'; } this._element.classlist.add(class_name_static); var modaltransitionduration = util.gettransitiondurationfromelement(this._dialog); $__default['default'](this._element).off(util.transition_end); $__default['default'](this._element).one(util.transition_end, function () { _this3._element.classlist.remove(class_name_static); if (!ismodaloverflowing) { $__default['default'](_this3._element).one(util.transition_end, function () { _this3._element.style.overflowy = ''; }).emulatetransitionend(_this3._element, modaltransitionduration); } }).emulatetransitionend(modaltransitionduration); this._element.focus(); }; _proto._showelement = function _showelement(relatedtarget) { var _this4 = this; var transition = $__default['default'](this._element).hasclass(class_name_fade$1); var modalbody = this._dialog ? this._dialog.queryselector(selector_modal_body) : null; 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); this._element.setattribute('role', 'dialog'); if ($__default['default'](this._dialog).hasclass(class_name_scrollable) && modalbody) { modalbody.scrolltop = 0; } else { this._element.scrolltop = 0; } if (transition) { util.reflow(this._element); } $__default['default'](this._element).addclass(class_name_show$3); if (this._config.focus) { this._enforcefocus(); } var shownevent = $__default['default'].event(event_shown$2, { relatedtarget: relatedtarget }); var transitioncomplete = function transitioncomplete() { if (_this4._config.focus) { _this4._element.focus(); } _this4._istransitioning = false; $__default['default'](_this4._element).trigger(shownevent); }; if (transition) { var transitionduration = util.gettransitiondurationfromelement(this._dialog); $__default['default'](this._dialog).one(util.transition_end, transitioncomplete).emulatetransitionend(transitionduration); } else { transitioncomplete(); } }; _proto._enforcefocus = function _enforcefocus() { var _this5 = this; $__default['default'](document).off(event_focusin) // guard against infinite focus loop .on(event_focusin, function (event) { if (document !== event.target && _this5._element !== event.target && $__default['default'](_this5._element).has(event.target).length === 0) { _this5._element.focus(); } }); }; _proto._setescapeevent = function _setescapeevent() { var _this6 = this; if (this._isshown) { $__default['default'](this._element).on(event_keydown_dismiss, function (event) { if (_this6._config.keyboard && event.which === escape_keycode$1) { event.preventdefault(); _this6.hide(); } else if (!_this6._config.keyboard && event.which === escape_keycode$1) { _this6._triggerbackdroptransition(); } }); } else if (!this._isshown) { $__default['default'](this._element).off(event_keydown_dismiss); } }; _proto._setresizeevent = function _setresizeevent() { var _this7 = this; if (this._isshown) { $__default['default'](window).on(event_resize, function (event) { return _this7.handleupdate(event); }); } else { $__default['default'](window).off(event_resize); } }; _proto._hidemodal = function _hidemodal() { var _this8 = this; this._element.style.display = 'none'; this._element.setattribute('aria-hidden', true); this._element.removeattribute('aria-modal'); this._element.removeattribute('role'); this._istransitioning = false; this._showbackdrop(function () { $__default['default'](document.body).removeclass(class_name_open); _this8._resetadjustments(); _this8._resetscrollbar(); $__default['default'](_this8._element).trigger(event_hidden$2); }); }; _proto._removebackdrop = function _removebackdrop() { if (this._backdrop) { $__default['default'](this._backdrop).remove(); this._backdrop = null; } }; _proto._showbackdrop = function _showbackdrop(callback) { var _this9 = this; var animate = $__default['default'](this._element).hasclass(class_name_fade$1) ? class_name_fade$1 : ''; if (this._isshown && this._config.backdrop) { this._backdrop = document.createelement('div'); this._backdrop.classname = class_name_backdrop; if (animate) { this._backdrop.classlist.add(animate); } $__default['default'](this._backdrop).appendto(document.body); $__default['default'](this._element).on(event_click_dismiss, function (event) { if (_this9._ignorebackdropclick) { _this9._ignorebackdropclick = false; return; } if (event.target !== event.currenttarget) { return; } if (_this9._config.backdrop === 'static') { _this9._triggerbackdroptransition(); } else { _this9.hide(); } }); if (animate) { util.reflow(this._backdrop); } $__default['default'](this._backdrop).addclass(class_name_show$3); if (!callback) { return; } if (!animate) { callback(); return; } var backdroptransitionduration = util.gettransitiondurationfromelement(this._backdrop); $__default['default'](this._backdrop).one(util.transition_end, callback).emulatetransitionend(backdroptransitionduration); } else if (!this._isshown && this._backdrop) { $__default['default'](this._backdrop).removeclass(class_name_show$3); var callbackremove = function callbackremove() { _this9._removebackdrop(); if (callback) { callback(); } }; if ($__default['default'](this._element).hasclass(class_name_fade$1)) { var _backdroptransitionduration = util.gettransitiondurationfromelement(this._backdrop); $__default['default'](this._backdrop).one(util.transition_end, callbackremove).emulatetransitionend(_backdroptransitionduration); } else { callbackremove(); } } else if (callback) { callback(); } } // ---------------------------------------------------------------------- // the following methods are used to handle overflowing modals // todo (fat): these should probably be refactored out of modal.js // ---------------------------------------------------------------------- ; _proto._adjustdialog = function _adjustdialog() { var ismodaloverflowing = this._element.scrollheight > document.documentelement.clientheight; if (!this._isbodyoverflowing && ismodaloverflowing) { this._element.style.paddingleft = this._scrollbarwidth + "px"; } if (this._isbodyoverflowing && !ismodaloverflowing) { this._element.style.paddingright = this._scrollbarwidth + "px"; } }; _proto._resetadjustments = function _resetadjustments() { this._element.style.paddingleft = ''; this._element.style.paddingright = ''; }; _proto._checkscrollbar = function _checkscrollbar() { var rect = document.body.getboundingclientrect(); this._isbodyoverflowing = math.round(rect.left + rect.right) < window.innerwidth; this._scrollbarwidth = this._getscrollbarwidth(); }; _proto._setscrollbar = function _setscrollbar() { var _this10 = this; if (this._isbodyoverflowing) { // note: domnode.style.paddingright returns the actual value or '' if not set // while $(domnode).css('padding-right') returns the calculated value or 0 if not set var fixedcontent = [].slice.call(document.queryselectorall(selector_fixed_content)); var stickycontent = [].slice.call(document.queryselectorall(selector_sticky_content)); // adjust fixed content padding $__default['default'](fixedcontent).each(function (index, element) { var actualpadding = element.style.paddingright; var calculatedpadding = $__default['default'](element).css('padding-right'); $__default['default'](element).data('padding-right', actualpadding).css('padding-right', parsefloat(calculatedpadding) + _this10._scrollbarwidth + "px"); }); // adjust sticky content margin $__default['default'](stickycontent).each(function (index, element) { var actualmargin = element.style.marginright; var calculatedmargin = $__default['default'](element).css('margin-right'); $__default['default'](element).data('margin-right', actualmargin).css('margin-right', parsefloat(calculatedmargin) - _this10._scrollbarwidth + "px"); }); // adjust body padding var actualpadding = document.body.style.paddingright; var calculatedpadding = $__default['default'](document.body).css('padding-right'); $__default['default'](document.body).data('padding-right', actualpadding).css('padding-right', parsefloat(calculatedpadding) + this._scrollbarwidth + "px"); } $__default['default'](document.body).addclass(class_name_open); }; _proto._resetscrollbar = function _resetscrollbar() { // restore fixed content padding var fixedcontent = [].slice.call(document.queryselectorall(selector_fixed_content)); $__default['default'](fixedcontent).each(function (index, element) { var padding = $__default['default'](element).data('padding-right'); $__default['default'](element).removedata('padding-right'); element.style.paddingright = padding ? padding : ''; }); // restore sticky content var elements = [].slice.call(document.queryselectorall("" + selector_sticky_content)); $__default['default'](elements).each(function (index, element) { var margin = $__default['default'](element).data('margin-right'); if (typeof margin !== 'undefined') { $__default['default'](element).css('margin-right', margin).removedata('margin-right'); } }); // restore body padding var padding = $__default['default'](document.body).data('padding-right'); $__default['default'](document.body).removedata('padding-right'); document.body.style.paddingright = padding ? padding : ''; }; _proto._getscrollbarwidth = function _getscrollbarwidth() { // thx d.walsh var scrolldiv = document.createelement('div'); scrolldiv.classname = class_name_scrollbar_measurer; document.body.appendchild(scrolldiv); var scrollbarwidth = scrolldiv.getboundingclientrect().width - scrolldiv.clientwidth; document.body.removechild(scrolldiv); return scrollbarwidth; } // static ; modal._jqueryinterface = function _jqueryinterface(config, relatedtarget) { return this.each(function () { var data = $__default['default'](this).data(data_key$5); var _config = _extends({}, default$3, $__default['default'](this).data(), typeof config === 'object' && config ? config : {}); if (!data) { data = new modal(this, _config); $__default['default'](this).data(data_key$5, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new typeerror("no method named \"" + config + "\""); } data[config](relatedtarget); } else if (_config.show) { data.show(relatedtarget); } }); }; _createclass(modal, null, [{ key: "version", get: function get() { return version$5; } }, { key: "default", get: function get() { return default$3; } }]); return modal; }(); /** * ------------------------------------------------------------------------ * data api implementation * ------------------------------------------------------------------------ */ $__default['default'](document).on(event_click_data_api$5, selector_data_toggle$3, function (event) { var _this11 = this; var target; var selector = util.getselectorfromelement(this); if (selector) { target = document.queryselector(selector); } var config = $__default['default'](target).data(data_key$5) ? 'toggle' : _extends({}, $__default['default'](target).data(), $__default['default'](this).data()); if (this.tagname === 'a' || this.tagname === 'area') { event.preventdefault(); } var $target = $__default['default'](target).one(event_show$2, function (showevent) { if (showevent.isdefaultprevented()) { // only register focus restorer if modal will actually get shown return; } $target.one(event_hidden$2, function () { if ($__default['default'](_this11).is(':visible')) { _this11.focus(); } }); }); modal._jqueryinterface.call($__default['default'](target), config, this); }); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$5] = modal._jqueryinterface; $__default['default'].fn[name$5].constructor = modal; $__default['default'].fn[name$5].noconflict = function () { $__default['default'].fn[name$5] = jquery_no_conflict$5; return modal._jqueryinterface; }; /** * -------------------------------------------------------------------------- * bootstrap (v4.6.0): tools/sanitizer.js * licensed under mit (https://github.com/twbs/bootstrap/blob/main/license) * -------------------------------------------------------------------------- */ var uriattrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; var aria_attribute_pattern = /^aria-[\w-]*$/i; var defaultwhitelist = { // 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: [], img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], li: [], ol: [], p: [], pre: [], s: [], small: [], span: [], sub: [], sup: [], strong: [], u: [], ul: [] }; /** * 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 */ var safe_url_pattern = /^(?:(?:https?|mailto|ftp|tel|file):|[^#&/:?]*(?:[#/?]|$))/gi; /** * 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 */ 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; function allowedattribute(attr, allowedattributelist) { var attrname = attr.nodename.tolowercase(); if (allowedattributelist.indexof(attrname) !== -1) { if (uriattrs.indexof(attrname) !== -1) { return boolean(attr.nodevalue.match(safe_url_pattern) || attr.nodevalue.match(data_url_pattern)); } return true; } var regexp = allowedattributelist.filter(function (attrregex) { return attrregex instanceof regexp; }); // check if a regular expression validates the attribute. for (var i = 0, len = regexp.length; i < len; i++) { if (attrname.match(regexp[i])) { return true; } } return false; } function sanitizehtml(unsafehtml, whitelist, sanitizefn) { if (unsafehtml.length === 0) { return unsafehtml; } if (sanitizefn && typeof sanitizefn === 'function') { return sanitizefn(unsafehtml); } var domparser = new window.domparser(); var createddocument = domparser.parsefromstring(unsafehtml, 'text/html'); var whitelistkeys = object.keys(whitelist); var elements = [].slice.call(createddocument.body.queryselectorall('*')); var _loop = function _loop(i, len) { var el = elements[i]; var elname = el.nodename.tolowercase(); if (whitelistkeys.indexof(el.nodename.tolowercase()) === -1) { el.parentnode.removechild(el); return "continue"; } var attributelist = [].slice.call(el.attributes); var whitelistedattributes = [].concat(whitelist['*'] || [], whitelist[elname] || []); attributelist.foreach(function (attr) { if (!allowedattribute(attr, whitelistedattributes)) { el.removeattribute(attr.nodename); } }); }; for (var i = 0, len = elements.length; i < len; i++) { var _ret = _loop(i); if (_ret === "continue") continue; } return createddocument.body.innerhtml; } /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$6 = 'tooltip'; var version$6 = '4.6.0'; var data_key$6 = 'bs.tooltip'; var event_key$6 = "." + data_key$6; var jquery_no_conflict$6 = $__default['default'].fn[name$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 = { 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)', customclass: '(string|function)', sanitize: 'boolean', sanitizefn: '(null|function)', whitelist: 'object', popperconfig: '(null|object)' }; var attachmentmap = { auto: 'auto', top: 'top', right: 'right', bottom: 'bottom', left: 'left' }; var default$4 = { animation: true, template: '', trigger: 'hover focus', title: '', delay: 0, html: false, selector: false, placement: 'top', offset: 0, container: false, fallbackplacement: 'flip', boundary: 'scrollparent', customclass: '', sanitize: true, sanitizefn: null, whitelist: defaultwhitelist, popperconfig: null }; var hover_state_show = 'show'; var hover_state_out = 'out'; var event = { hide: "hide" + event_key$6, hidden: "hidden" + event_key$6, show: "show" + event_key$6, shown: "shown" + event_key$6, inserted: "inserted" + event_key$6, click: "click" + event_key$6, focusin: "focusin" + event_key$6, focusout: "focusout" + event_key$6, mouseenter: "mouseenter" + event_key$6, mouseleave: "mouseleave" + event_key$6 }; var class_name_fade$2 = 'fade'; var class_name_show$4 = 'show'; var selector_tooltip_inner = '.tooltip-inner'; var selector_arrow = '.arrow'; var trigger_hover = 'hover'; var trigger_focus = 'focus'; var trigger_click = 'click'; var trigger_manual = 'manual'; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var tooltip = /*#__pure__*/function () { function tooltip(element, config) { if (typeof popper === 'undefined') { throw new typeerror('bootstrap\'s tooltips require popper (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(); } // getters var _proto = tooltip.prototype; // public _proto.enable = function enable() { this._isenabled = true; }; _proto.disable = function disable() { this._isenabled = false; }; _proto.toggleenabled = function toggleenabled() { this._isenabled = !this._isenabled; }; _proto.toggle = function toggle(event) { if (!this._isenabled) { return; } if (event) { var datakey = this.constructor.data_key; var context = $__default['default'](event.currenttarget).data(datakey); if (!context) { context = new this.constructor(event.currenttarget, this._getdelegateconfig()); $__default['default'](event.currenttarget).data(datakey, context); } context._activetrigger.click = !context._activetrigger.click; if (context._iswithactivetrigger()) { context._enter(null, context); } else { context._leave(null, context); } } else { if ($__default['default'](this.gettipelement()).hasclass(class_name_show$4)) { this._leave(null, this); return; } this._enter(null, this); } }; _proto.dispose = function dispose() { cleartimeout(this._timeout); $__default['default'].removedata(this.element, this.constructor.data_key); $__default['default'](this.element).off(this.constructor.event_key); $__default['default'](this.element).closest('.modal').off('hide.bs.modal', this._hidemodalhandler); if (this.tip) { $__default['default'](this.tip).remove(); } this._isenabled = null; this._timeout = null; this._hoverstate = null; this._activetrigger = null; if (this._popper) { this._popper.destroy(); } this._popper = null; this.element = null; this.config = null; this.tip = null; }; _proto.show = function show() { var _this = this; if ($__default['default'](this.element).css('display') === 'none') { throw new error('please use show on visible elements'); } var showevent = $__default['default'].event(this.constructor.event.show); if (this.iswithcontent() && this._isenabled) { $__default['default'](this.element).trigger(showevent); var shadowroot = util.findshadowroot(this.element); var isinthedom = $__default['default'].contains(shadowroot !== null ? shadowroot : this.element.ownerdocument.documentelement, this.element); if (showevent.isdefaultprevented() || !isinthedom) { return; } var tip = this.gettipelement(); var tipid = util.getuid(this.constructor.name); tip.setattribute('id', tipid); this.element.setattribute('aria-describedby', tipid); this.setcontent(); if (this.config.animation) { $__default['default'](tip).addclass(class_name_fade$2); } var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; var attachment = this._getattachment(placement); this.addattachmentclass(attachment); var container = this._getcontainer(); $__default['default'](tip).data(this.constructor.data_key, this); if (!$__default['default'].contains(this.element.ownerdocument.documentelement, this.tip)) { $__default['default'](tip).appendto(container); } $__default['default'](this.element).trigger(this.constructor.event.inserted); this._popper = new popper(this.element, tip, this._getpopperconfig(attachment)); $__default['default'](tip).addclass(class_name_show$4); $__default['default'](tip).addclass(this.config.customclass); // 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 if ('ontouchstart' in document.documentelement) { $__default['default'](document.body).children().on('mouseover', null, $__default['default'].noop); } var complete = function complete() { if (_this.config.animation) { _this._fixtransition(); } var prevhoverstate = _this._hoverstate; _this._hoverstate = null; $__default['default'](_this.element).trigger(_this.constructor.event.shown); if (prevhoverstate === hover_state_out) { _this._leave(null, _this); } }; if ($__default['default'](this.tip).hasclass(class_name_fade$2)) { var transitionduration = util.gettransitiondurationfromelement(this.tip); $__default['default'](this.tip).one(util.transition_end, complete).emulatetransitionend(transitionduration); } else { complete(); } } }; _proto.hide = function hide(callback) { var _this2 = this; var tip = this.gettipelement(); var hideevent = $__default['default'].event(this.constructor.event.hide); var complete = function complete() { if (_this2._hoverstate !== hover_state_show && tip.parentnode) { tip.parentnode.removechild(tip); } _this2._cleantipclass(); _this2.element.removeattribute('aria-describedby'); $__default['default'](_this2.element).trigger(_this2.constructor.event.hidden); if (_this2._popper !== null) { _this2._popper.destroy(); } if (callback) { callback(); } }; $__default['default'](this.element).trigger(hideevent); if (hideevent.isdefaultprevented()) { return; } $__default['default'](tip).removeclass(class_name_show$4); // if this is a touch-enabled device we remove the extra // empty mouseover listeners we added for ios support if ('ontouchstart' in document.documentelement) { $__default['default'](document.body).children().off('mouseover', null, $__default['default'].noop); } this._activetrigger[trigger_click] = false; this._activetrigger[trigger_focus] = false; this._activetrigger[trigger_hover] = false; if ($__default['default'](this.tip).hasclass(class_name_fade$2)) { var transitionduration = util.gettransitiondurationfromelement(tip); $__default['default'](tip).one(util.transition_end, complete).emulatetransitionend(transitionduration); } else { complete(); } this._hoverstate = ''; }; _proto.update = function update() { if (this._popper !== null) { this._popper.scheduleupdate(); } } // protected ; _proto.iswithcontent = function iswithcontent() { return boolean(this.gettitle()); }; _proto.addattachmentclass = function addattachmentclass(attachment) { $__default['default'](this.gettipelement()).addclass(class_prefix + "-" + attachment); }; _proto.gettipelement = function gettipelement() { this.tip = this.tip || $__default['default'](this.config.template)[0]; return this.tip; }; _proto.setcontent = function setcontent() { var tip = this.gettipelement(); this.setelementcontent($__default['default'](tip.queryselectorall(selector_tooltip_inner)), this.gettitle()); $__default['default'](tip).removeclass(class_name_fade$2 + " " + class_name_show$4); }; _proto.setelementcontent = function setelementcontent($element, content) { if (typeof content === 'object' && (content.nodetype || content.jquery)) { // content is a dom node or a jquery if (this.config.html) { if (!$__default['default'](content).parent().is($element)) { $element.empty().append(content); } } else { $element.text($__default['default'](content).text()); } return; } if (this.config.html) { if (this.config.sanitize) { content = sanitizehtml(content, this.config.whitelist, this.config.sanitizefn); } $element.html(content); } else { $element.text(content); } }; _proto.gettitle = function gettitle() { var title = this.element.getattribute('data-original-title'); if (!title) { title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; } return title; } // private ; _proto._getpopperconfig = function _getpopperconfig(attachment) { var _this3 = this; var defaultbsconfig = { placement: attachment, modifiers: { offset: this._getoffset(), flip: { behavior: this.config.fallbackplacement }, arrow: { element: selector_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 _extends({}, defaultbsconfig, this.config.popperconfig); }; _proto._getoffset = function _getoffset() { var _this4 = this; var offset = {}; if (typeof this.config.offset === 'function') { offset.fn = function (data) { data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element) || {}); return data; }; } else { offset.offset = this.config.offset; } return offset; }; _proto._getcontainer = function _getcontainer() { if (this.config.container === false) { return document.body; } if (util.iselement(this.config.container)) { return $__default['default'](this.config.container); } return $__default['default'](document).find(this.config.container); }; _proto._getattachment = function _getattachment(placement) { return attachmentmap[placement.touppercase()]; }; _proto._setlisteners = function _setlisteners() { var _this5 = this; var triggers = this.config.trigger.split(' '); triggers.foreach(function (trigger) { if (trigger === 'click') { $__default['default'](_this5.element).on(_this5.constructor.event.click, _this5.config.selector, function (event) { return _this5.toggle(event); }); } 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; $__default['default'](_this5.element).on(eventin, _this5.config.selector, function (event) { return _this5._enter(event); }).on(eventout, _this5.config.selector, function (event) { return _this5._leave(event); }); } }); this._hidemodalhandler = function () { if (_this5.element) { _this5.hide(); } }; $__default['default'](this.element).closest('.modal').on('hide.bs.modal', this._hidemodalhandler); if (this.config.selector) { this.config = _extends({}, this.config, { trigger: 'manual', selector: '' }); } else { this._fixtitle(); } }; _proto._fixtitle = function _fixtitle() { var titletype = typeof this.element.getattribute('data-original-title'); if (this.element.getattribute('title') || titletype !== 'string') { this.element.setattribute('data-original-title', this.element.getattribute('title') || ''); this.element.setattribute('title', ''); } }; _proto._enter = function _enter(event, context) { var datakey = this.constructor.data_key; context = context || $__default['default'](event.currenttarget).data(datakey); if (!context) { context = new this.constructor(event.currenttarget, this._getdelegateconfig()); $__default['default'](event.currenttarget).data(datakey, context); } if (event) { context._activetrigger[event.type === 'focusin' ? trigger_focus : trigger_hover] = true; } if ($__default['default'](context.gettipelement()).hasclass(class_name_show$4) || context._hoverstate === hover_state_show) { context._hoverstate = hover_state_show; return; } cleartimeout(context._timeout); context._hoverstate = hover_state_show; if (!context.config.delay || !context.config.delay.show) { context.show(); return; } context._timeout = settimeout(function () { if (context._hoverstate === hover_state_show) { context.show(); } }, context.config.delay.show); }; _proto._leave = function _leave(event, context) { var datakey = this.constructor.data_key; context = context || $__default['default'](event.currenttarget).data(datakey); if (!context) { context = new this.constructor(event.currenttarget, this._getdelegateconfig()); $__default['default'](event.currenttarget).data(datakey, context); } if (event) { context._activetrigger[event.type === 'focusout' ? trigger_focus : trigger_hover] = false; } if (context._iswithactivetrigger()) { return; } cleartimeout(context._timeout); context._hoverstate = hover_state_out; if (!context.config.delay || !context.config.delay.hide) { context.hide(); return; } context._timeout = settimeout(function () { if (context._hoverstate === hover_state_out) { context.hide(); } }, context.config.delay.hide); }; _proto._iswithactivetrigger = function _iswithactivetrigger() { for (var trigger in this._activetrigger) { if (this._activetrigger[trigger]) { return true; } } return false; }; _proto._getconfig = function _getconfig(config) { var dataattributes = $__default['default'](this.element).data(); object.keys(dataattributes).foreach(function (dataattr) { if (disallowed_attributes.indexof(dataattr) !== -1) { delete dataattributes[dataattr]; } }); config = _extends({}, this.constructor.default, dataattributes, typeof config === 'object' && config ? config : {}); 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(); } util.typecheckconfig(name$6, config, this.constructor.defaulttype); if (config.sanitize) { config.template = sanitizehtml(config.template, config.whitelist, config.sanitizefn); } return config; }; _proto._getdelegateconfig = function _getdelegateconfig() { var config = {}; if (this.config) { for (var key in this.config) { if (this.constructor.default[key] !== this.config[key]) { config[key] = this.config[key]; } } } return config; }; _proto._cleantipclass = function _cleantipclass() { var $tip = $__default['default'](this.gettipelement()); var tabclass = $tip.attr('class').match(bscls_prefix_regex); if (tabclass !== null && tabclass.length) { $tip.removeclass(tabclass.join('')); } }; _proto._handlepopperplacementchange = function _handlepopperplacementchange(popperdata) { this.tip = popperdata.instance.popper; this._cleantipclass(); this.addattachmentclass(this._getattachment(popperdata.placement)); }; _proto._fixtransition = function _fixtransition() { var tip = this.gettipelement(); var initconfiganimation = this.config.animation; if (tip.getattribute('x-placement') !== null) { return; } $__default['default'](tip).removeclass(class_name_fade$2); this.config.animation = false; this.hide(); this.show(); this.config.animation = initconfiganimation; } // static ; tooltip._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var $element = $__default['default'](this); var data = $element.data(data_key$6); var _config = typeof config === 'object' && config; if (!data && /dispose|hide/.test(config)) { return; } if (!data) { data = new tooltip(this, _config); $element.data(data_key$6, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new typeerror("no method named \"" + config + "\""); } data[config](); } }); }; _createclass(tooltip, null, [{ key: "version", get: function get() { return version$6; } }, { key: "default", get: function get() { return default$4; } }, { key: "name", get: function get() { return name$6; } }, { key: "data_key", get: function get() { return data_key$6; } }, { key: "event", get: function get() { return event; } }, { key: "event_key", get: function get() { return event_key$6; } }, { key: "defaulttype", get: function get() { return defaulttype$4; } }]); return tooltip; }(); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$6] = tooltip._jqueryinterface; $__default['default'].fn[name$6].constructor = tooltip; $__default['default'].fn[name$6].noconflict = function () { $__default['default'].fn[name$6] = jquery_no_conflict$6; return tooltip._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$7 = 'popover'; var version$7 = '4.6.0'; var data_key$7 = 'bs.popover'; var event_key$7 = "." + data_key$7; var jquery_no_conflict$7 = $__default['default'].fn[name$7]; var class_prefix$1 = 'bs-popover'; var bscls_prefix_regex$1 = new regexp("(^|\\s)" + class_prefix$1 + "\\s+", 'g'); var default$5 = _extends({}, tooltip.default, { placement: 'right', trigger: 'click', content: '', template: '' }); var defaulttype$5 = _extends({}, tooltip.defaulttype, { content: '(string|element|function)' }); var class_name_fade$3 = 'fade'; var class_name_show$5 = 'show'; var selector_title = '.popover-header'; var selector_content = '.popover-body'; var event$1 = { 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 }; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var popover = /*#__pure__*/function (_tooltip) { _inheritsloose(popover, _tooltip); function popover() { return _tooltip.apply(this, arguments) || this; } var _proto = popover.prototype; // overrides _proto.iswithcontent = function iswithcontent() { return this.gettitle() || this._getcontent(); }; _proto.addattachmentclass = function addattachmentclass(attachment) { $__default['default'](this.gettipelement()).addclass(class_prefix$1 + "-" + attachment); }; _proto.gettipelement = function gettipelement() { this.tip = this.tip || $__default['default'](this.config.template)[0]; return this.tip; }; _proto.setcontent = function setcontent() { var $tip = $__default['default'](this.gettipelement()); // we use append for html objects to maintain js events this.setelementcontent($tip.find(selector_title), this.gettitle()); var content = this._getcontent(); if (typeof content === 'function') { content = content.call(this.element); } this.setelementcontent($tip.find(selector_content), content); $tip.removeclass(class_name_fade$3 + " " + class_name_show$5); } // private ; _proto._getcontent = function _getcontent() { return this.element.getattribute('data-content') || this.config.content; }; _proto._cleantipclass = function _cleantipclass() { var $tip = $__default['default'](this.gettipelement()); var tabclass = $tip.attr('class').match(bscls_prefix_regex$1); if (tabclass !== null && tabclass.length > 0) { $tip.removeclass(tabclass.join('')); } } // static ; popover._jqueryinterface = function _jqueryinterface(config) { return this.each(function () { var data = $__default['default'](this).data(data_key$7); var _config = typeof config === 'object' ? config : null; if (!data && /dispose|hide/.test(config)) { return; } if (!data) { data = new popover(this, _config); $__default['default'](this).data(data_key$7, data); } if (typeof config === 'string') { if (typeof data[config] === 'undefined') { throw new typeerror("no method named \"" + config + "\""); } data[config](); } }); }; _createclass(popover, null, [{ key: "version", // getters get: function get() { return version$7; } }, { key: "default", get: function get() { return default$5; } }, { key: "name", get: function get() { return name$7; } }, { key: "data_key", get: function get() { return data_key$7; } }, { key: "event", get: function get() { return event$1; } }, { key: "event_key", get: function get() { return event_key$7; } }, { key: "defaulttype", get: function get() { return defaulttype$5; } }]); return popover; }(tooltip); /** * ------------------------------------------------------------------------ * jquery * ------------------------------------------------------------------------ */ $__default['default'].fn[name$7] = popover._jqueryinterface; $__default['default'].fn[name$7].constructor = popover; $__default['default'].fn[name$7].noconflict = function () { $__default['default'].fn[name$7] = jquery_no_conflict$7; return popover._jqueryinterface; }; /** * ------------------------------------------------------------------------ * constants * ------------------------------------------------------------------------ */ var name$8 = 'scrollspy'; var version$8 = '4.6.0'; var data_key$8 = 'bs.scrollspy'; var event_key$8 = "." + data_key$8; var data_api_key$6 = '.data-api'; var jquery_no_conflict$8 = $__default['default'].fn[name$8]; var default$6 = { offset: 10, method: 'auto', target: '' }; var defaulttype$6 = { offset: 'number', method: 'string', target: '(string|element)' }; var event_activate = "activate" + event_key$8; var event_scroll = "scroll" + event_key$8; var event_load_data_api$2 = "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_items = '.dropdown-item'; var selector_dropdown_toggle = '.dropdown-toggle'; var method_offset = 'offset'; var method_position = 'position'; /** * ------------------------------------------------------------------------ * class definition * ------------------------------------------------------------------------ */ var scrollspy = /*#__pure__*/function () { function scrollspy(element, config) { var _this = this; this._element = element; this._scrollelement = element.tagname === 'body' ? window : element; this._config = this._getconfig(config); this._selector = this._config.target + " " + selector_nav_links + "," + (this._config.target + " " + selector_list_items + ",") + (this._config.target + " " + selector_dropdown_items); this._offsets = []; this._targets = []; this._activetarget = null; this._scrollheight = 0; $__default['default'](this._scrollelement).on(event_scroll, function (event) { return _this._process(event); }); this.refresh(); this._process(); } // getters var _proto = scrollspy.prototype; // public _proto.refresh = function refresh() { var _this2 = this; var automethod = this._scrollelement === this._scrollelement.window ? method_offset : method_position; var offsetmethod = this._config.method === 'auto' ? automethod : this._config.method; var offsetbase = offsetmethod === method_position ? this._getscrolltop() : 0; this._offsets = []; this._targets = []; this._scrollheight = this._getscrollheight(); var targets = [].slice.call(document.queryselectorall(this._selector)); targets.map(function (element) { var target; var targetselector = util.getselectorfromelement(element); if (targetselector) { target = document.queryselector(targetselector); } if (target) { var targetbcr = target.getboundingclientrect(); if (targetbcr.width || targetbcr.height) { // todo (fat): remove sketch reliance on jquery position/offset return [$__default['default'](target)[offsetmethod]().top + offsetbase, targetselector]; } } return null; }).filter(function (item) { return item; }).sort(function (a, b) { return a[0] - b[0]; }).foreach(function (item) { _this2._offsets.push(item[0]); _this2._targets.push(item[1]); }); }; _proto.dispose = function dispose() { $__default['default'].removedata(this._element, data_key$8); $__default['default'](this._scrollelement).off(event_key$8); this._element = null; this._scrollelement = null; this._config = null; this._selector = null; this._offsets = null; this._targets = null; this._activetarget = null; this._scrollheight = null; } // private ; _proto._getconfig = function _getconfig(config) { config = _extends({}, default$6, typeof config === 'object' && config ? config : {}); if (typeof config.target !== 'string' && util.iselement(config.target)) { var id = $__default['default'](config.target).attr('id'); if (!id) { id = util.getuid(name$8); $__default['default'](config.target).attr('id', id); } config.target = "#" + id; } util.typecheckconfig(name$8, config, defaulttype$6); return config; }; _proto._getscrolltop = function _getscrolltop() { return this._scrollelement === window ? this._scrollelement.pageyoffset : this._scrollelement.scrolltop; }; _proto._getscrollheight = function _getscrollheight() { return this._scrollelement.scrollheight || math.max(document.body.scrollheight, document.documentelement.scrollheight); }; _proto._getoffsetheight = function _getoffsetheight() { return this._scrollelement === window ? window.innerheight : this._scrollelement.getboundingclientrect().height; }; _proto._process = function _process() { var scrolltop = this._getscrolltop() + this._config.offset; var scrollheight = this._getscrollheight(); var maxscroll = this._config.offset + scrollheight - this._getoffsetheight(); if (this._scrollheight !== scrollheight) { this.refresh(); } if (scrolltop >= maxscroll) { var target = this._targets[this._targets.length - 1]; if (this._activetarget !== target) { this._activate(target); } return; } if (this._activetarget && scrolltop < this._offsets[0] && this._offsets[0] > 0) { this._activetarget = null; this._clear(); return; } for (var i = this._offsets.length; i--;) { var isactivetarget = this._activetarget !== this._targets[i] && scrolltop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrolltop < this._offsets[i + 1]); if (isactivetarget) { this._activate(this._targets[i]); } } }; _proto._activate = function _activate(target) { this._activetarget = target; this._clear(); var queries = this._selector.split(',').map(function (selector) { return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; }); var $link = $__default['default']([].slice.call(document.queryselectorall(queries.join(',')))); if ($link.hasclass(class_name_dropdown_item)) { $link.closest(selector_dropdown).find(selector_dropdown_toggle).addclass(class_name_active$2); $link.addclass(class_name_active$2); } else { // set triggered link as active $link.addclass(class_name_active$2); // set triggered links parents as active // with both