diff --git a/.scripts/assets-build-tool/build.mjs b/.scripts/assets-build-tool/build.mjs index f728574ed85..7f2be5c61af 100644 --- a/.scripts/assets-build-tool/build.mjs +++ b/.scripts/assets-build-tool/build.mjs @@ -237,8 +237,8 @@ let gulpStr = parsedArgs.g; if (gulpStr != undefined) { buildProcesses.push({ order: 0, - name: "starting gulp build", - command: `gulp build`, + name: "gulp build", + command: `gulp rebuild`, }); } diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js index 051d5a67aba..b895f6aca8a 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js @@ -1,58 +1,5426 @@ -// a wrapper around https://github.com/farbelous/fontawesome-iconpicker -// It makes easier to use a single picker instance with several input fields. -// How to use it: Call show() from outside , passing it the id's of the input fields you want the icon classes applied to. +/* +** NOTE: This file is generated by Gulp and should not be edited directly! +** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. +*/ -var iconPickerVue = new Vue({ - el: '#iconPickerVue', - data: { - targetInputField: '', - targetIconTag: '', - iconPickerModal: null, - }, - mounted: function () { - var self = this; +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +/*! + * Font Awesome Icon Picker + * https://farbelous.github.io/fontawesome-iconpicker/ + * + * @author Javi Aguilar, itsjavi.com + * @license MIT License + * @see https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE + */ - $('.icp-auto').iconpicker({ - title: false, - templates: { - search: '' // just to leave empty the placeholder because it is not localized - } +(function (e) { + if (typeof define === "function" && define.amd) { + define(["jquery"], e); + } else { + e(jQuery); + } +})(function (j) { + j.ui = j.ui || {}; + var e = j.ui.version = "1.12.1"; + (function () { + var r, + y = Math.max, + x = Math.abs, + s = /left|center|right/, + i = /top|center|bottom/, + f = /[\+\-]\d+(\.[\d]+)?%?/, + l = /^\w+/, + c = /%$/, + a = j.fn.pos; + function q(e, a, t) { + return [parseFloat(e[0]) * (c.test(e[0]) ? a / 100 : 1), parseFloat(e[1]) * (c.test(e[1]) ? t / 100 : 1)]; + } + function C(e, a) { + return parseInt(j.css(e, a), 10) || 0; + } + function t(e) { + var a = e[0]; + if (a.nodeType === 9) { + return { + width: e.width(), + height: e.height(), + offset: { + top: 0, + left: 0 + } + }; + } + if (j.isWindow(a)) { + return { + width: e.width(), + height: e.height(), + offset: { + top: e.scrollTop(), + left: e.scrollLeft() + } + }; + } + if (a.preventDefault) { + return { + width: 0, + height: 0, + offset: { + top: a.pageY, + left: a.pageX + } + }; + } + return { + width: e.outerWidth(), + height: e.outerHeight(), + offset: e.offset() + }; + } + j.pos = { + scrollbarWidth: function scrollbarWidth() { + if (r !== undefined) { + return r; + } + var e, + a, + t = j("
" + "
"), + s = t.children()[0]; + j("body").append(t); + e = s.offsetWidth; + t.css("overflow", "scroll"); + a = s.offsetWidth; + if (e === a) { + a = t[0].clientWidth; + } + t.remove(); + return r = e - a; + }, + getScrollInfo: function getScrollInfo(e) { + var a = e.isWindow || e.isDocument ? "" : e.element.css("overflow-x"), + t = e.isWindow || e.isDocument ? "" : e.element.css("overflow-y"), + s = a === "scroll" || a === "auto" && e.width < e.element[0].scrollWidth, + r = t === "scroll" || t === "auto" && e.height < e.element[0].scrollHeight; + return { + width: r ? j.pos.scrollbarWidth() : 0, + height: s ? j.pos.scrollbarWidth() : 0 + }; + }, + getWithinInfo: function getWithinInfo(e) { + var a = j(e || window), + t = j.isWindow(a[0]), + s = !!a[0] && a[0].nodeType === 9, + r = !t && !s; + return { + element: a, + isWindow: t, + isDocument: s, + offset: r ? j(e).offset() : { + left: 0, + top: 0 + }, + scrollLeft: a.scrollLeft(), + scrollTop: a.scrollTop(), + width: a.outerWidth(), + height: a.outerHeight() + }; + } + }; + j.fn.pos = function (h) { + if (!h || !h.of) { + return a.apply(this, arguments); + } + h = j.extend({}, h); + var m, + p, + d, + u, + T, + e, + g = j(h.of), + b = j.pos.getWithinInfo(h.within), + k = j.pos.getScrollInfo(b), + w = (h.collision || "flip").split(" "), + v = {}; + e = t(g); + if (g[0].preventDefault) { + h.at = "left top"; + } + p = e.width; + d = e.height; + u = e.offset; + T = j.extend({}, u); + j.each(["my", "at"], function () { + var e = (h[this] || "").split(" "), + a, + t; + if (e.length === 1) { + e = s.test(e[0]) ? e.concat(["center"]) : i.test(e[0]) ? ["center"].concat(e) : ["center", "center"]; + } + e[0] = s.test(e[0]) ? e[0] : "center"; + e[1] = i.test(e[1]) ? e[1] : "center"; + a = f.exec(e[0]); + t = f.exec(e[1]); + v[this] = [a ? a[0] : 0, t ? t[0] : 0]; + h[this] = [l.exec(e[0])[0], l.exec(e[1])[0]]; + }); + if (w.length === 1) { + w[1] = w[0]; + } + if (h.at[0] === "right") { + T.left += p; + } else if (h.at[0] === "center") { + T.left += p / 2; + } + if (h.at[1] === "bottom") { + T.top += d; + } else if (h.at[1] === "center") { + T.top += d / 2; + } + m = q(v.at, p, d); + T.left += m[0]; + T.top += m[1]; + return this.each(function () { + var t, + e, + f = j(this), + l = f.outerWidth(), + c = f.outerHeight(), + a = C(this, "marginLeft"), + s = C(this, "marginTop"), + r = l + a + C(this, "marginRight") + k.width, + i = c + s + C(this, "marginBottom") + k.height, + o = j.extend({}, T), + n = q(v.my, f.outerWidth(), f.outerHeight()); + if (h.my[0] === "right") { + o.left -= l; + } else if (h.my[0] === "center") { + o.left -= l / 2; + } + if (h.my[1] === "bottom") { + o.top -= c; + } else if (h.my[1] === "center") { + o.top -= c / 2; + } + o.left += n[0]; + o.top += n[1]; + t = { + marginLeft: a, + marginTop: s + }; + j.each(["left", "top"], function (e, a) { + if (j.ui.pos[w[e]]) { + j.ui.pos[w[e]][a](o, { + targetWidth: p, + targetHeight: d, + elemWidth: l, + elemHeight: c, + collisionPosition: t, + collisionWidth: r, + collisionHeight: i, + offset: [m[0] + n[0], m[1] + n[1]], + my: h.my, + at: h.at, + within: b, + elem: f + }); + } }); - - $('#inline-picker').on('iconpickerSelected', function (e) { - var selected = e.iconpickerInstance.options.fullClassFormatter(e.iconpickerValue); - - if (self.targetInputField) { - $('#' + self.targetInputField).val(selected); + if (h.using) { + e = function e(_e) { + var a = u.left - o.left, + t = a + p - l, + s = u.top - o.top, + r = s + d - c, + i = { + target: { + element: g, + left: u.left, + top: u.top, + width: p, + height: d + }, + element: { + element: f, + left: o.left, + top: o.top, + width: l, + height: c + }, + horizontal: t < 0 ? "left" : a > 0 ? "right" : "center", + vertical: r < 0 ? "top" : s > 0 ? "bottom" : "middle" + }; + if (p < l && x(a + t) < p) { + i.horizontal = "center"; } - - if (self.targetIconTag) { - // We need to replace the full tag with the new class. - // We could simply apply the new selected class to the i element. - // But there is an issue: when the previous class is not a valid fa icon the icon does not refresh. - $('#' + self.targetIconTag).replaceWith('') + if (d < c && x(s + r) < d) { + i.vertical = "middle"; } - - if (self.iconPickerModal != null) - { - self.iconPickerModal.hide(); + if (y(x(a), x(t)) > y(x(s), x(r))) { + i.important = "horizontal"; + } else { + i.important = "vertical"; + } + h.using.call(this, _e, i); + }; + } + f.offset(j.extend(o, { + using: e + })); + }); + }; + j.ui.pos = { + _trigger: function _trigger(e, a, t, s) { + if (a.elem) { + a.elem.trigger({ + type: t, + position: e, + positionData: a, + triggered: s + }); + } + }, + fit: { + left: function left(e, a) { + j.ui.pos._trigger(e, a, "posCollide", "fitLeft"); + var t = a.within, + s = t.isWindow ? t.scrollLeft : t.offset.left, + r = t.width, + i = e.left - a.collisionPosition.marginLeft, + f = s - i, + l = i + a.collisionWidth - r - s, + c; + if (a.collisionWidth > r) { + if (f > 0 && l <= 0) { + c = e.left + f + a.collisionWidth - r - s; + e.left += f - c; + } else if (l > 0 && f <= 0) { + e.left = s; + } else { + if (f > l) { + e.left = s + r - a.collisionWidth; + } else { + e.left = s; + } + } + } else if (f > 0) { + e.left += f; + } else if (l > 0) { + e.left -= l; + } else { + e.left = y(e.left - i, e.left); + } + j.ui.pos._trigger(e, a, "posCollided", "fitLeft"); + }, + top: function top(e, a) { + j.ui.pos._trigger(e, a, "posCollide", "fitTop"); + var t = a.within, + s = t.isWindow ? t.scrollTop : t.offset.top, + r = a.within.height, + i = e.top - a.collisionPosition.marginTop, + f = s - i, + l = i + a.collisionHeight - r - s, + c; + if (a.collisionHeight > r) { + if (f > 0 && l <= 0) { + c = e.top + f + a.collisionHeight - r - s; + e.top += f - c; + } else if (l > 0 && f <= 0) { + e.top = s; + } else { + if (f > l) { + e.top = s + r - a.collisionHeight; + } else { + e.top = s; + } + } + } else if (f > 0) { + e.top += f; + } else if (l > 0) { + e.top -= l; + } else { + e.top = y(e.top - i, e.top); + } + j.ui.pos._trigger(e, a, "posCollided", "fitTop"); + } + }, + flip: { + left: function left(e, a) { + j.ui.pos._trigger(e, a, "posCollide", "flipLeft"); + var t = a.within, + s = t.offset.left + t.scrollLeft, + r = t.width, + i = t.isWindow ? t.scrollLeft : t.offset.left, + f = e.left - a.collisionPosition.marginLeft, + l = f - i, + c = f + a.collisionWidth - r - i, + o = a.my[0] === "left" ? -a.elemWidth : a.my[0] === "right" ? a.elemWidth : 0, + n = a.at[0] === "left" ? a.targetWidth : a.at[0] === "right" ? -a.targetWidth : 0, + h = -2 * a.offset[0], + m, + p; + if (l < 0) { + m = e.left + o + n + h + a.collisionWidth - r - s; + if (m < 0 || m < x(l)) { + e.left += o + n + h; + } + } else if (c > 0) { + p = e.left - a.collisionPosition.marginLeft + o + n + h - i; + if (p > 0 || x(p) < c) { + e.left += o + n + h; + } + } + j.ui.pos._trigger(e, a, "posCollided", "flipLeft"); + }, + top: function top(e, a) { + j.ui.pos._trigger(e, a, "posCollide", "flipTop"); + var t = a.within, + s = t.offset.top + t.scrollTop, + r = t.height, + i = t.isWindow ? t.scrollTop : t.offset.top, + f = e.top - a.collisionPosition.marginTop, + l = f - i, + c = f + a.collisionHeight - r - i, + o = a.my[1] === "top", + n = o ? -a.elemHeight : a.my[1] === "bottom" ? a.elemHeight : 0, + h = a.at[1] === "top" ? a.targetHeight : a.at[1] === "bottom" ? -a.targetHeight : 0, + m = -2 * a.offset[1], + p, + d; + if (l < 0) { + d = e.top + n + h + m + a.collisionHeight - r - s; + if (d < 0 || d < x(l)) { + e.top += n + h + m; + } + } else if (c > 0) { + p = e.top - a.collisionPosition.marginTop + n + h + m - i; + if (p > 0 || x(p) < c) { + e.top += n + h + m; } + } + j.ui.pos._trigger(e, a, "posCollided", "flipTop"); + } + }, + flipfit: { + left: function left() { + j.ui.pos.flip.left.apply(this, arguments); + j.ui.pos.fit.left.apply(this, arguments); + }, + top: function top() { + j.ui.pos.flip.top.apply(this, arguments); + j.ui.pos.fit.top.apply(this, arguments); + } + } + }; + (function () { + var e, + a, + t, + s, + r, + i = document.getElementsByTagName("body")[0], + f = document.createElement("div"); + e = document.createElement(i ? "div" : "body"); + t = { + visibility: "hidden", + width: 0, + height: 0, + border: 0, + margin: 0, + background: "none" + }; + if (i) { + j.extend(t, { + position: "absolute", + left: "-1000px", + top: "-1000px" }); + } + for (r in t) { + e.style[r] = t[r]; + } + e.appendChild(f); + a = i || document.documentElement; + a.insertBefore(e, a.firstChild); + f.style.cssText = "position: absolute; left: 10.7432222px;"; + s = j(f).offset().left; + j.support.offsetFractions = s > 10 && s < 11; + e.innerHTML = ""; + a.removeChild(e); + })(); + })(); + var a = j.ui.position; +}); +(function (e) { + "use strict"; - }, - methods: { - show: function (targetInputField, targetIconTag) { - this.targetInputField = targetInputField; - this.targetIconTag = targetIconTag; + if (typeof define === "function" && define.amd) { + define(["jquery"], e); + } else if (window.jQuery && !window.jQuery.fn.iconpicker) { + e(window.jQuery); + } +})(function (c) { + "use strict"; - if (this.iconPickerModal == null) - { - this.iconPickerModal = new bootstrap.Modal($("#iconPickerModal"), { - keyboard: false - }); + var f = { + isEmpty: function isEmpty(e) { + return e === false || e === "" || e === null || e === undefined; + }, + isEmptyObject: function isEmptyObject(e) { + return this.isEmpty(e) === true || e.length === 0; + }, + isElement: function isElement(e) { + return c(e).length > 0; + }, + isString: function isString(e) { + return typeof e === "string" || e instanceof String; + }, + isArray: function isArray(e) { + return c.isArray(e); + }, + inArray: function inArray(e, a) { + return c.inArray(e, a) !== -1; + }, + throwError: function throwError(e) { + throw "Font Awesome Icon Picker Exception: " + e; + } + }; + var _t = function t(e, a) { + this._id = _t._idCounter++; + this.element = c(e).addClass("iconpicker-element"); + this._trigger("iconpickerCreate", { + iconpickerValue: this.iconpickerValue + }); + this.options = c.extend({}, _t.defaultOptions, this.element.data(), a); + this.options.templates = c.extend({}, _t.defaultOptions.templates, this.options.templates); + this.options.originalPlacement = this.options.placement; + this.container = f.isElement(this.options.container) ? c(this.options.container) : false; + if (this.container === false) { + if (this.element.is(".dropdown-toggle")) { + this.container = c("~ .dropdown-menu:first", this.element); + } else { + this.container = this.element.is("input,textarea,button,.btn") ? this.element.parent() : this.element; + } + } + this.container.addClass("iconpicker-container"); + if (this.isDropdownMenu()) { + this.options.placement = "inline"; + } + this.input = this.element.is("input,textarea") ? this.element.addClass("iconpicker-input") : false; + if (this.input === false) { + this.input = this.container.find(this.options.input); + if (!this.input.is("input,textarea")) { + this.input = false; + } + } + this.component = this.isDropdownMenu() ? this.container.parent().find(this.options.component) : this.container.find(this.options.component); + if (this.component.length === 0) { + this.component = false; + } else { + this.component.find("i").addClass("iconpicker-component"); + } + this._createPopover(); + this._createIconpicker(); + if (this.getAcceptButton().length === 0) { + this.options.mustAccept = false; + } + if (this.isInputGroup()) { + this.container.parent().append(this.popover); + } else { + this.container.append(this.popover); + } + this._bindElementEvents(); + this._bindWindowEvents(); + this.update(this.options.selected); + if (this.isInline()) { + this.show(); + } + this._trigger("iconpickerCreated", { + iconpickerValue: this.iconpickerValue + }); + }; + _t._idCounter = 0; + _t.defaultOptions = { + title: false, + selected: false, + defaultValue: false, + placement: "bottom", + collision: "none", + animation: true, + hideOnSelect: false, + showFooter: false, + searchInFooter: false, + mustAccept: false, + selectedCustomClass: "bg-primary", + icons: [], + fullClassFormatter: function fullClassFormatter(e) { + return e; + }, + input: "input,.iconpicker-input", + inputSearch: false, + container: false, + component: ".input-group-addon,.iconpicker-component", + templates: { + popover: '
' + '
', + footer: '', + buttons: '' + ' ', + search: '', + iconpicker: '
', + iconpickerItem: '' + } + }; + _t.batch = function (e, a) { + var t = Array.prototype.slice.call(arguments, 2); + return c(e).each(function () { + var e = c(this).data("iconpicker"); + if (!!e) { + e[a].apply(e, t); + } + }); + }; + _t.prototype = { + constructor: _t, + options: {}, + _id: 0, + _trigger: function _trigger(e, a) { + a = a || {}; + this.element.trigger(c.extend({ + type: e, + iconpickerInstance: this + }, a)); + }, + _createPopover: function _createPopover() { + this.popover = c(this.options.templates.popover); + var e = this.popover.find(".popover-title"); + if (!!this.options.title) { + e.append(c('
' + this.options.title + "
")); + } + if (this.hasSeparatedSearchInput() && !this.options.searchInFooter) { + e.append(this.options.templates.search); + } else if (!this.options.title) { + e.remove(); + } + if (this.options.showFooter && !f.isEmpty(this.options.templates.footer)) { + var a = c(this.options.templates.footer); + if (this.hasSeparatedSearchInput() && this.options.searchInFooter) { + a.append(c(this.options.templates.search)); + } + if (!f.isEmpty(this.options.templates.buttons)) { + a.append(c(this.options.templates.buttons)); + } + this.popover.append(a); + } + if (this.options.animation === true) { + this.popover.addClass("fade"); + } + return this.popover; + }, + _createIconpicker: function _createIconpicker() { + var t = this; + this.iconpicker = c(this.options.templates.iconpicker); + var e = function e(_e2) { + var a = c(this); + if (a.is("i")) { + a = a.parent(); + } + t._trigger("iconpickerSelect", { + iconpickerItem: a, + iconpickerValue: t.iconpickerValue + }); + if (t.options.mustAccept === false) { + t.update(a.data("iconpickerValue")); + t._trigger("iconpickerSelected", { + iconpickerItem: this, + iconpickerValue: t.iconpickerValue + }); + } else { + t.update(a.data("iconpickerValue"), true); + } + if (t.options.hideOnSelect && t.options.mustAccept === false) { + t.hide(); + } + }; + var a = c(this.options.templates.iconpickerItem); + var s = []; + for (var r in this.options.icons) { + if (typeof this.options.icons[r].title === "string") { + var i = a.clone(); + i.find("i").addClass(this.options.fullClassFormatter(this.options.icons[r].title)); + i.data("iconpickerValue", this.options.icons[r].title).on("click.iconpicker", e); + i.attr("title", "." + this.options.icons[r].title); + if (this.options.icons[r].searchTerms.length > 0) { + var f = ""; + for (var l = 0; l < this.options.icons[r].searchTerms.length; l++) { + f = f + this.options.icons[r].searchTerms[l] + " "; } - - this.iconPickerModal.show(); + i.attr("data-search-terms", f); + } + s.push(i); } + } + this.iconpicker.find(".iconpicker-items").append(s); + this.popover.find(".popover-content").append(this.iconpicker); + return this.iconpicker; + }, + _isEventInsideIconpicker: function _isEventInsideIconpicker(e) { + var a = c(e.target); + if ((!a.hasClass("iconpicker-element") || a.hasClass("iconpicker-element") && !a.is(this.element)) && a.parents(".iconpicker-popover").length === 0) { + return false; + } + return true; + }, + _bindElementEvents: function _bindElementEvents() { + var a = this; + this.getSearchInput().on("keyup.iconpicker", function () { + a.filter(c(this).val().toLowerCase()); + }); + this.getAcceptButton().on("click.iconpicker", function () { + var e = a.iconpicker.find(".iconpicker-selected").get(0); + a.update(a.iconpickerValue); + a._trigger("iconpickerSelected", { + iconpickerItem: e, + iconpickerValue: a.iconpickerValue + }); + if (!a.isInline()) { + a.hide(); + } + }); + this.getCancelButton().on("click.iconpicker", function () { + if (!a.isInline()) { + a.hide(); + } + }); + this.element.on("focus.iconpicker", function (e) { + a.show(); + e.stopPropagation(); + }); + if (this.hasComponent()) { + this.component.on("click.iconpicker", function () { + a.toggle(); + }); + } + if (this.hasInput()) { + this.input.on("keyup.iconpicker", function (e) { + if (!f.inArray(e.keyCode, [38, 40, 37, 39, 16, 17, 18, 9, 8, 91, 93, 20, 46, 186, 190, 46, 78, 188, 44, 86])) { + a.update(); + } else { + a._updateFormGroupStatus(a.getValid(this.value) !== false); + } + if (a.options.inputSearch === true) { + a.filter(c(this).val().toLowerCase()); + } + }); + } + }, + _bindWindowEvents: function _bindWindowEvents() { + var e = c(window.document); + var a = this; + var t = ".iconpicker.inst" + this._id; + c(window).on("resize.iconpicker" + t + " orientationchange.iconpicker" + t, function (e) { + if (a.popover.hasClass("in")) { + a.updatePlacement(); + } + }); + if (!a.isInline()) { + e.on("mouseup" + t, function (e) { + if (!a._isEventInsideIconpicker(e) && !a.isInline()) { + a.hide(); + } + }); + } + }, + _unbindElementEvents: function _unbindElementEvents() { + this.popover.off(".iconpicker"); + this.element.off(".iconpicker"); + if (this.hasInput()) { + this.input.off(".iconpicker"); + } + if (this.hasComponent()) { + this.component.off(".iconpicker"); + } + if (this.hasContainer()) { + this.container.off(".iconpicker"); + } + }, + _unbindWindowEvents: function _unbindWindowEvents() { + c(window).off(".iconpicker.inst" + this._id); + c(window.document).off(".iconpicker.inst" + this._id); + }, + updatePlacement: function updatePlacement(e, a) { + e = e || this.options.placement; + this.options.placement = e; + a = a || this.options.collision; + a = a === true ? "flip" : a; + var t = { + at: "right bottom", + my: "right top", + of: this.hasInput() && !this.isInputGroup() ? this.input : this.container, + collision: a === true ? "flip" : a, + within: window + }; + this.popover.removeClass("inline topLeftCorner topLeft top topRight topRightCorner " + "rightTop right rightBottom bottomRight bottomRightCorner " + "bottom bottomLeft bottomLeftCorner leftBottom left leftTop"); + if (_typeof(e) === "object") { + return this.popover.pos(c.extend({}, t, e)); + } + switch (e) { + case "inline": + { + t = false; + } + break; + case "topLeftCorner": + { + t.my = "right bottom"; + t.at = "left top"; + } + break; + case "topLeft": + { + t.my = "left bottom"; + t.at = "left top"; + } + break; + case "top": + { + t.my = "center bottom"; + t.at = "center top"; + } + break; + case "topRight": + { + t.my = "right bottom"; + t.at = "right top"; + } + break; + case "topRightCorner": + { + t.my = "left bottom"; + t.at = "right top"; + } + break; + case "rightTop": + { + t.my = "left bottom"; + t.at = "right center"; + } + break; + case "right": + { + t.my = "left center"; + t.at = "right center"; + } + break; + case "rightBottom": + { + t.my = "left top"; + t.at = "right center"; + } + break; + case "bottomRightCorner": + { + t.my = "left top"; + t.at = "right bottom"; + } + break; + case "bottomRight": + { + t.my = "right top"; + t.at = "right bottom"; + } + break; + case "bottom": + { + t.my = "center top"; + t.at = "center bottom"; + } + break; + case "bottomLeft": + { + t.my = "left top"; + t.at = "left bottom"; + } + break; + case "bottomLeftCorner": + { + t.my = "right top"; + t.at = "left bottom"; + } + break; + case "leftBottom": + { + t.my = "right top"; + t.at = "left center"; + } + break; + case "left": + { + t.my = "right center"; + t.at = "left center"; + } + break; + case "leftTop": + { + t.my = "right bottom"; + t.at = "left center"; + } + break; + default: + { + return false; + } + break; + } + this.popover.css({ + display: this.options.placement === "inline" ? "" : "block" + }); + if (t !== false) { + this.popover.pos(t).css("maxWidth", c(window).width() - this.container.offset().left - 5); + } else { + this.popover.css({ + top: "auto", + right: "auto", + bottom: "auto", + left: "auto", + maxWidth: "none" + }); + } + this.popover.addClass(this.options.placement); + return true; + }, + _updateComponents: function _updateComponents() { + this.iconpicker.find(".iconpicker-item.iconpicker-selected").removeClass("iconpicker-selected " + this.options.selectedCustomClass); + if (this.iconpickerValue) { + this.iconpicker.find("." + this.options.fullClassFormatter(this.iconpickerValue).replace(/ /g, ".")).parent().addClass("iconpicker-selected " + this.options.selectedCustomClass); + } + if (this.hasComponent()) { + var e = this.component.find("i"); + if (e.length > 0) { + e.attr("class", this.options.fullClassFormatter(this.iconpickerValue)); + } else { + this.component.html(this.getHtml()); + } + } + }, + _updateFormGroupStatus: function _updateFormGroupStatus(e) { + if (this.hasInput()) { + if (e !== false) { + this.input.parents(".form-group:first").removeClass("has-error"); + } else { + this.input.parents(".form-group:first").addClass("has-error"); + } + return true; + } + return false; + }, + getValid: function getValid(e) { + if (!f.isString(e)) { + e = ""; + } + var a = e === ""; + e = c.trim(e); + var t = false; + for (var s = 0; s < this.options.icons.length; s++) { + if (this.options.icons[s].title === e) { + t = true; + break; + } + } + if (t || a) { + return e; + } + return false; + }, + setValue: function setValue(e) { + var a = this.getValid(e); + if (a !== false) { + this.iconpickerValue = a; + this._trigger("iconpickerSetValue", { + iconpickerValue: a + }); + return this.iconpickerValue; + } else { + this._trigger("iconpickerInvalid", { + iconpickerValue: e + }); + return false; + } + }, + getHtml: function getHtml() { + return ''; + }, + setSourceValue: function setSourceValue(e) { + e = this.setValue(e); + if (e !== false && e !== "") { + if (this.hasInput()) { + this.input.val(this.iconpickerValue); + } else { + this.element.data("iconpickerValue", this.iconpickerValue); + } + this._trigger("iconpickerSetSourceValue", { + iconpickerValue: e + }); + } + return e; + }, + getSourceValue: function getSourceValue(e) { + e = e || this.options.defaultValue; + var a = e; + if (this.hasInput()) { + a = this.input.val(); + } else { + a = this.element.data("iconpickerValue"); + } + if (a === undefined || a === "" || a === null || a === false) { + a = e; + } + return a; + }, + hasInput: function hasInput() { + return this.input !== false; + }, + isInputSearch: function isInputSearch() { + return this.hasInput() && this.options.inputSearch === true; + }, + isInputGroup: function isInputGroup() { + return this.container.is(".input-group"); + }, + isDropdownMenu: function isDropdownMenu() { + return this.container.is(".dropdown-menu"); + }, + hasSeparatedSearchInput: function hasSeparatedSearchInput() { + return this.options.templates.search !== false && !this.isInputSearch(); + }, + hasComponent: function hasComponent() { + return this.component !== false; + }, + hasContainer: function hasContainer() { + return this.container !== false; + }, + getAcceptButton: function getAcceptButton() { + return this.popover.find(".iconpicker-btn-accept"); + }, + getCancelButton: function getCancelButton() { + return this.popover.find(".iconpicker-btn-cancel"); + }, + getSearchInput: function getSearchInput() { + return this.popover.find(".iconpicker-search"); + }, + filter: function filter(r) { + if (f.isEmpty(r)) { + this.iconpicker.find(".iconpicker-item").show(); + return c(false); + } else { + var i = []; + this.iconpicker.find(".iconpicker-item").each(function () { + var e = c(this); + var a = e.attr("title").toLowerCase(); + var t = e.attr("data-search-terms") ? e.attr("data-search-terms").toLowerCase() : ""; + a = a + " " + t; + var s = false; + try { + s = new RegExp("(^|\\W)" + r, "g"); + } catch (e) { + s = false; + } + if (s !== false && a.match(s)) { + i.push(e); + e.show(); + } else { + e.hide(); + } + }); + return i; + } + }, + show: function show() { + if (this.popover.hasClass("in")) { + return false; + } + c.iconpicker.batch(c(".iconpicker-popover.in:not(.inline)").not(this.popover), "hide"); + this._trigger("iconpickerShow", { + iconpickerValue: this.iconpickerValue + }); + this.updatePlacement(); + this.popover.addClass("in"); + setTimeout(c.proxy(function () { + this.popover.css("display", this.isInline() ? "" : "block"); + this._trigger("iconpickerShown", { + iconpickerValue: this.iconpickerValue + }); + }, this), this.options.animation ? 300 : 1); + }, + hide: function hide() { + if (!this.popover.hasClass("in")) { + return false; + } + this._trigger("iconpickerHide", { + iconpickerValue: this.iconpickerValue + }); + this.popover.removeClass("in"); + setTimeout(c.proxy(function () { + this.popover.css("display", "none"); + this.getSearchInput().val(""); + this.filter(""); + this._trigger("iconpickerHidden", { + iconpickerValue: this.iconpickerValue + }); + }, this), this.options.animation ? 300 : 1); + }, + toggle: function toggle() { + if (this.popover.is(":visible")) { + this.hide(); + } else { + this.show(true); + } + }, + update: function update(e, a) { + e = e ? e : this.getSourceValue(this.iconpickerValue); + this._trigger("iconpickerUpdate", { + iconpickerValue: this.iconpickerValue + }); + if (a === true) { + e = this.setValue(e); + } else { + e = this.setSourceValue(e); + this._updateFormGroupStatus(e !== false); + } + if (e !== false) { + this._updateComponents(); + } + this._trigger("iconpickerUpdated", { + iconpickerValue: this.iconpickerValue + }); + return e; + }, + destroy: function destroy() { + this._trigger("iconpickerDestroy", { + iconpickerValue: this.iconpickerValue + }); + this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element"); + this._unbindElementEvents(); + this._unbindWindowEvents(); + c(this.popover).remove(); + this._trigger("iconpickerDestroyed", { + iconpickerValue: this.iconpickerValue + }); + }, + disable: function disable() { + if (this.hasInput()) { + this.input.prop("disabled", true); + return true; + } + return false; + }, + enable: function enable() { + if (this.hasInput()) { + this.input.prop("disabled", false); + return true; + } + return false; + }, + isDisabled: function isDisabled() { + if (this.hasInput()) { + return this.input.prop("disabled") === true; + } + return false; + }, + isInline: function isInline() { + return this.options.placement === "inline" || this.popover.hasClass("inline"); + } + }; + c.iconpicker = _t; + c.fn.iconpicker = function (a) { + return this.each(function () { + var e = c(this); + if (!e.data("iconpicker")) { + e.data("iconpicker", new _t(this, _typeof(a) === "object" ? a : {})); + } + }); + }; + _t.defaultOptions = c.extend(_t.defaultOptions, { + icons: [{ + title: "fab fa-500px", + searchTerms: [] + }, { + title: "fab fa-accessible-icon", + searchTerms: ["accessibility", "handicap", "person", "wheelchair", "wheelchair-alt"] + }, { + title: "fab fa-accusoft", + searchTerms: [] + }, { + title: "fab fa-acquisitions-incorporated", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "game", "gaming", "tabletop"] + }, { + title: "fas fa-ad", + searchTerms: [] + }, { + title: "fas fa-address-book", + searchTerms: [] + }, { + title: "far fa-address-book", + searchTerms: [] + }, { + title: "fas fa-address-card", + searchTerms: [] + }, { + title: "far fa-address-card", + searchTerms: [] + }, { + title: "fas fa-adjust", + searchTerms: ["contrast"] + }, { + title: "fab fa-adn", + searchTerms: [] + }, { + title: "fab fa-adversal", + searchTerms: [] + }, { + title: "fab fa-affiliatetheme", + searchTerms: [] + }, { + title: "fas fa-air-freshener", + searchTerms: [] + }, { + title: "fab fa-algolia", + searchTerms: [] + }, { + title: "fas fa-align-center", + searchTerms: ["middle", "text"] + }, { + title: "fas fa-align-justify", + searchTerms: ["text"] + }, { + title: "fas fa-align-left", + searchTerms: ["text"] + }, { + title: "fas fa-align-right", + searchTerms: ["text"] + }, { + title: "fab fa-alipay", + searchTerms: [] + }, { + title: "fas fa-allergies", + searchTerms: ["freckles", "hand", "intolerances", "pox", "spots"] + }, { + title: "fab fa-amazon", + searchTerms: [] + }, { + title: "fab fa-amazon-pay", + searchTerms: [] + }, { + title: "fas fa-ambulance", + searchTerms: ["help", "machine", "support", "vehicle"] + }, { + title: "fas fa-american-sign-language-interpreting", + searchTerms: [] + }, { + title: "fab fa-amilia", + searchTerms: [] + }, { + title: "fas fa-anchor", + searchTerms: ["link"] + }, { + title: "fab fa-android", + searchTerms: ["robot"] + }, { + title: "fab fa-angellist", + searchTerms: [] + }, { + title: "fas fa-angle-double-down", + searchTerms: ["arrows"] + }, { + title: "fas fa-angle-double-left", + searchTerms: ["arrows", "back", "laquo", "previous", "quote"] + }, { + title: "fas fa-angle-double-right", + searchTerms: ["arrows", "forward", "next", "quote", "raquo"] + }, { + title: "fas fa-angle-double-up", + searchTerms: ["arrows"] + }, { + title: "fas fa-angle-down", + searchTerms: ["arrow"] + }, { + title: "fas fa-angle-left", + searchTerms: ["arrow", "back", "previous"] + }, { + title: "fas fa-angle-right", + searchTerms: ["arrow", "forward", "next"] + }, { + title: "fas fa-angle-up", + searchTerms: ["arrow"] + }, { + title: "fas fa-angry", + searchTerms: ["disapprove", "emoticon", "face", "mad", "upset"] + }, { + title: "far fa-angry", + searchTerms: ["disapprove", "emoticon", "face", "mad", "upset"] + }, { + title: "fab fa-angrycreative", + searchTerms: [] + }, { + title: "fab fa-angular", + searchTerms: [] + }, { + title: "fas fa-ankh", + searchTerms: ["amulet", "copper", "coptic christianity", "copts", "crux ansata", "egyptian", "venus"] + }, { + title: "fab fa-app-store", + searchTerms: [] + }, { + title: "fab fa-app-store-ios", + searchTerms: [] + }, { + title: "fab fa-apper", + searchTerms: [] + }, { + title: "fab fa-apple", + searchTerms: ["food", "fruit", "mac", "osx"] + }, { + title: "fas fa-apple-alt", + searchTerms: ["fall", "food", "fruit", "fuji", "macintosh", "seasonal"] + }, { + title: "fab fa-apple-pay", + searchTerms: [] + }, { + title: "fas fa-archive", + searchTerms: ["box", "package", "storage"] + }, { + title: "fas fa-archway", + searchTerms: ["arc", "monument", "road", "street"] + }, { + title: "fas fa-arrow-alt-circle-down", + searchTerms: ["arrow-circle-o-down", "download"] + }, { + title: "far fa-arrow-alt-circle-down", + searchTerms: ["arrow-circle-o-down", "download"] + }, { + title: "fas fa-arrow-alt-circle-left", + searchTerms: ["arrow-circle-o-left", "back", "previous"] + }, { + title: "far fa-arrow-alt-circle-left", + searchTerms: ["arrow-circle-o-left", "back", "previous"] + }, { + title: "fas fa-arrow-alt-circle-right", + searchTerms: ["arrow-circle-o-right", "forward", "next"] + }, { + title: "far fa-arrow-alt-circle-right", + searchTerms: ["arrow-circle-o-right", "forward", "next"] + }, { + title: "fas fa-arrow-alt-circle-up", + searchTerms: ["arrow-circle-o-up"] + }, { + title: "far fa-arrow-alt-circle-up", + searchTerms: ["arrow-circle-o-up"] + }, { + title: "fas fa-arrow-circle-down", + searchTerms: ["download"] + }, { + title: "fas fa-arrow-circle-left", + searchTerms: ["back", "previous"] + }, { + title: "fas fa-arrow-circle-right", + searchTerms: ["forward", "next"] + }, { + title: "fas fa-arrow-circle-up", + searchTerms: [] + }, { + title: "fas fa-arrow-down", + searchTerms: ["download"] + }, { + title: "fas fa-arrow-left", + searchTerms: ["back", "previous"] + }, { + title: "fas fa-arrow-right", + searchTerms: ["forward", "next"] + }, { + title: "fas fa-arrow-up", + searchTerms: [] + }, { + title: "fas fa-arrows-alt", + searchTerms: ["arrow", "arrows", "bigger", "enlarge", "expand", "fullscreen", "move", "position", "reorder", "resize"] + }, { + title: "fas fa-arrows-alt-h", + searchTerms: ["arrows-h", "resize"] + }, { + title: "fas fa-arrows-alt-v", + searchTerms: ["arrows-v", "resize"] + }, { + title: "fas fa-assistive-listening-systems", + searchTerms: [] + }, { + title: "fas fa-asterisk", + searchTerms: ["details"] + }, { + title: "fab fa-asymmetrik", + searchTerms: [] + }, { + title: "fas fa-at", + searchTerms: ["e-mail", "email"] + }, { + title: "fas fa-atlas", + searchTerms: ["book", "directions", "geography", "map", "wayfinding"] + }, { + title: "fas fa-atom", + searchTerms: ["atheism", "chemistry", "science"] + }, { + title: "fab fa-audible", + searchTerms: [] + }, { + title: "fas fa-audio-description", + searchTerms: [] + }, { + title: "fab fa-autoprefixer", + searchTerms: [] + }, { + title: "fab fa-avianex", + searchTerms: [] + }, { + title: "fab fa-aviato", + searchTerms: [] + }, { + title: "fas fa-award", + searchTerms: ["honor", "praise", "prize", "recognition", "ribbon"] + }, { + title: "fab fa-aws", + searchTerms: [] + }, { + title: "fas fa-backspace", + searchTerms: ["command", "delete", "keyboard", "undo"] + }, { + title: "fas fa-backward", + searchTerms: ["previous", "rewind"] + }, { + title: "fas fa-balance-scale", + searchTerms: ["balanced", "justice", "legal", "measure", "weight"] + }, { + title: "fas fa-ban", + searchTerms: ["abort", "ban", "block", "cancel", "delete", "hide", "prohibit", "remove", "stop", "trash"] + }, { + title: "fas fa-band-aid", + searchTerms: ["bandage", "boo boo", "ouch"] + }, { + title: "fab fa-bandcamp", + searchTerms: [] + }, { + title: "fas fa-barcode", + searchTerms: ["scan"] + }, { + title: "fas fa-bars", + searchTerms: ["checklist", "drag", "hamburger", "list", "menu", "nav", "navigation", "ol", "reorder", "settings", "todo", "ul"] + }, { + title: "fas fa-baseball-ball", + searchTerms: [] + }, { + title: "fas fa-basketball-ball", + searchTerms: [] + }, { + title: "fas fa-bath", + searchTerms: [] + }, { + title: "fas fa-battery-empty", + searchTerms: ["power", "status"] + }, { + title: "fas fa-battery-full", + searchTerms: ["power", "status"] + }, { + title: "fas fa-battery-half", + searchTerms: ["power", "status"] + }, { + title: "fas fa-battery-quarter", + searchTerms: ["power", "status"] + }, { + title: "fas fa-battery-three-quarters", + searchTerms: ["power", "status"] + }, { + title: "fas fa-bed", + searchTerms: ["lodging", "sleep", "travel"] + }, { + title: "fas fa-beer", + searchTerms: ["alcohol", "bar", "beverage", "drink", "liquor", "mug", "stein"] + }, { + title: "fab fa-behance", + searchTerms: [] + }, { + title: "fab fa-behance-square", + searchTerms: [] + }, { + title: "fas fa-bell", + searchTerms: ["alert", "notification", "reminder"] + }, { + title: "far fa-bell", + searchTerms: ["alert", "notification", "reminder"] + }, { + title: "fas fa-bell-slash", + searchTerms: [] + }, { + title: "far fa-bell-slash", + searchTerms: [] + }, { + title: "fas fa-bezier-curve", + searchTerms: ["curves", "illustrator", "lines", "path", "vector"] + }, { + title: "fas fa-bible", + searchTerms: ["book", "catholicism", "christianity"] + }, { + title: "fas fa-bicycle", + searchTerms: ["bike", "gears", "transportation", "vehicle"] + }, { + title: "fab fa-bimobject", + searchTerms: [] + }, { + title: "fas fa-binoculars", + searchTerms: [] + }, { + title: "fas fa-birthday-cake", + searchTerms: [] + }, { + title: "fab fa-bitbucket", + searchTerms: ["bitbucket-square", "git"] + }, { + title: "fab fa-bitcoin", + searchTerms: [] + }, { + title: "fab fa-bity", + searchTerms: [] + }, { + title: "fab fa-black-tie", + searchTerms: [] + }, { + title: "fab fa-blackberry", + searchTerms: [] + }, { + title: "fas fa-blender", + searchTerms: [] + }, { + title: "fas fa-blender-phone", + searchTerms: ["appliance", "fantasy", "silly"] + }, { + title: "fas fa-blind", + searchTerms: [] + }, { + title: "fab fa-blogger", + searchTerms: [] + }, { + title: "fab fa-blogger-b", + searchTerms: [] + }, { + title: "fab fa-bluetooth", + searchTerms: [] + }, { + title: "fab fa-bluetooth-b", + searchTerms: [] + }, { + title: "fas fa-bold", + searchTerms: [] + }, { + title: "fas fa-bolt", + searchTerms: ["electricity", "lightning", "weather", "zap"] + }, { + title: "fas fa-bomb", + searchTerms: [] + }, { + title: "fas fa-bone", + searchTerms: [] + }, { + title: "fas fa-bong", + searchTerms: ["aparatus", "cannabis", "marijuana", "pipe", "smoke", "smoking"] + }, { + title: "fas fa-book", + searchTerms: ["documentation", "read"] + }, { + title: "fas fa-book-dead", + searchTerms: ["Dungeons & Dragons", "crossbones", "d&d", "dark arts", "death", "dnd", "documentation", "evil", "fantasy", "halloween", "holiday", "read", "skull", "spell"] + }, { + title: "fas fa-book-open", + searchTerms: ["flyer", "notebook", "open book", "pamphlet", "reading"] + }, { + title: "fas fa-book-reader", + searchTerms: ["library"] + }, { + title: "fas fa-bookmark", + searchTerms: ["save"] + }, { + title: "far fa-bookmark", + searchTerms: ["save"] + }, { + title: "fas fa-bowling-ball", + searchTerms: [] + }, { + title: "fas fa-box", + searchTerms: ["package"] + }, { + title: "fas fa-box-open", + searchTerms: [] + }, { + title: "fas fa-boxes", + searchTerms: [] + }, { + title: "fas fa-braille", + searchTerms: [] + }, { + title: "fas fa-brain", + searchTerms: ["cerebellum", "gray matter", "intellect", "medulla oblongata", "mind", "noodle", "wit"] + }, { + title: "fas fa-briefcase", + searchTerms: ["bag", "business", "luggage", "office", "work"] + }, { + title: "fas fa-briefcase-medical", + searchTerms: ["health briefcase"] + }, { + title: "fas fa-broadcast-tower", + searchTerms: ["airwaves", "radio", "waves"] + }, { + title: "fas fa-broom", + searchTerms: ["clean", "firebolt", "fly", "halloween", "holiday", "nimbus 2000", "quidditch", "sweep", "witch"] + }, { + title: "fas fa-brush", + searchTerms: ["bristles", "color", "handle", "painting"] + }, { + title: "fab fa-btc", + searchTerms: [] + }, { + title: "fas fa-bug", + searchTerms: ["insect", "report"] + }, { + title: "fas fa-building", + searchTerms: ["apartment", "business", "company", "office", "work"] + }, { + title: "far fa-building", + searchTerms: ["apartment", "business", "company", "office", "work"] + }, { + title: "fas fa-bullhorn", + searchTerms: ["announcement", "broadcast", "louder", "megaphone", "share"] + }, { + title: "fas fa-bullseye", + searchTerms: ["target"] + }, { + title: "fas fa-burn", + searchTerms: ["energy"] + }, { + title: "fab fa-buromobelexperte", + searchTerms: [] + }, { + title: "fas fa-bus", + searchTerms: ["machine", "public transportation", "transportation", "vehicle"] + }, { + title: "fas fa-bus-alt", + searchTerms: ["machine", "public transportation", "transportation", "vehicle"] + }, { + title: "fas fa-business-time", + searchTerms: ["briefcase", "business socks", "clock", "flight of the conchords", "wednesday"] + }, { + title: "fab fa-buysellads", + searchTerms: [] + }, { + title: "fas fa-calculator", + searchTerms: [] + }, { + title: "fas fa-calendar", + searchTerms: ["calendar-o", "date", "event", "schedule", "time", "when"] + }, { + title: "far fa-calendar", + searchTerms: ["calendar-o", "date", "event", "schedule", "time", "when"] + }, { + title: "fas fa-calendar-alt", + searchTerms: ["calendar", "date", "event", "schedule", "time", "when"] + }, { + title: "far fa-calendar-alt", + searchTerms: ["calendar", "date", "event", "schedule", "time", "when"] + }, { + title: "fas fa-calendar-check", + searchTerms: ["accept", "agree", "appointment", "confirm", "correct", "done", "ok", "select", "success", "todo"] + }, { + title: "far fa-calendar-check", + searchTerms: ["accept", "agree", "appointment", "confirm", "correct", "done", "ok", "select", "success", "todo"] + }, { + title: "fas fa-calendar-minus", + searchTerms: ["delete", "negative", "remove"] + }, { + title: "far fa-calendar-minus", + searchTerms: ["delete", "negative", "remove"] + }, { + title: "fas fa-calendar-plus", + searchTerms: ["add", "create", "new", "positive"] + }, { + title: "far fa-calendar-plus", + searchTerms: ["add", "create", "new", "positive"] + }, { + title: "fas fa-calendar-times", + searchTerms: ["archive", "delete", "remove", "x"] + }, { + title: "far fa-calendar-times", + searchTerms: ["archive", "delete", "remove", "x"] + }, { + title: "fas fa-camera", + searchTerms: ["photo", "picture", "record"] + }, { + title: "fas fa-camera-retro", + searchTerms: ["photo", "picture", "record"] + }, { + title: "fas fa-campground", + searchTerms: ["camping", "fall", "outdoors", "seasonal", "tent"] + }, { + title: "fas fa-cannabis", + searchTerms: ["bud", "chronic", "drugs", "endica", "endo", "ganja", "marijuana", "mary jane", "pot", "reefer", "sativa", "spliff", "weed", "whacky-tabacky"] + }, { + title: "fas fa-capsules", + searchTerms: ["drugs", "medicine"] + }, { + title: "fas fa-car", + searchTerms: ["machine", "transportation", "vehicle"] + }, { + title: "fas fa-car-alt", + searchTerms: [] + }, { + title: "fas fa-car-battery", + searchTerms: [] + }, { + title: "fas fa-car-crash", + searchTerms: [] + }, { + title: "fas fa-car-side", + searchTerms: [] + }, { + title: "fas fa-caret-down", + searchTerms: ["arrow", "dropdown", "menu", "more", "triangle down"] + }, { + title: "fas fa-caret-left", + searchTerms: ["arrow", "back", "previous", "triangle left"] + }, { + title: "fas fa-caret-right", + searchTerms: ["arrow", "forward", "next", "triangle right"] + }, { + title: "fas fa-caret-square-down", + searchTerms: ["caret-square-o-down", "dropdown", "menu", "more"] + }, { + title: "far fa-caret-square-down", + searchTerms: ["caret-square-o-down", "dropdown", "menu", "more"] + }, { + title: "fas fa-caret-square-left", + searchTerms: ["back", "caret-square-o-left", "previous"] + }, { + title: "far fa-caret-square-left", + searchTerms: ["back", "caret-square-o-left", "previous"] + }, { + title: "fas fa-caret-square-right", + searchTerms: ["caret-square-o-right", "forward", "next"] + }, { + title: "far fa-caret-square-right", + searchTerms: ["caret-square-o-right", "forward", "next"] + }, { + title: "fas fa-caret-square-up", + searchTerms: ["caret-square-o-up"] + }, { + title: "far fa-caret-square-up", + searchTerms: ["caret-square-o-up"] + }, { + title: "fas fa-caret-up", + searchTerms: ["arrow", "triangle up"] + }, { + title: "fas fa-cart-arrow-down", + searchTerms: ["shopping"] + }, { + title: "fas fa-cart-plus", + searchTerms: ["add", "create", "new", "positive", "shopping"] + }, { + title: "fas fa-cat", + searchTerms: ["feline", "halloween", "holiday", "kitten", "kitty", "meow", "pet"] + }, { + title: "fab fa-cc-amazon-pay", + searchTerms: [] + }, { + title: "fab fa-cc-amex", + searchTerms: ["amex"] + }, { + title: "fab fa-cc-apple-pay", + searchTerms: [] + }, { + title: "fab fa-cc-diners-club", + searchTerms: [] + }, { + title: "fab fa-cc-discover", + searchTerms: [] + }, { + title: "fab fa-cc-jcb", + searchTerms: [] + }, { + title: "fab fa-cc-mastercard", + searchTerms: [] + }, { + title: "fab fa-cc-paypal", + searchTerms: [] + }, { + title: "fab fa-cc-stripe", + searchTerms: [] + }, { + title: "fab fa-cc-visa", + searchTerms: [] + }, { + title: "fab fa-centercode", + searchTerms: [] + }, { + title: "fas fa-certificate", + searchTerms: ["badge", "star"] + }, { + title: "fas fa-chair", + searchTerms: ["furniture", "seat"] + }, { + title: "fas fa-chalkboard", + searchTerms: ["blackboard", "learning", "school", "teaching", "whiteboard", "writing"] + }, { + title: "fas fa-chalkboard-teacher", + searchTerms: ["blackboard", "instructor", "learning", "professor", "school", "whiteboard", "writing"] + }, { + title: "fas fa-charging-station", + searchTerms: [] + }, { + title: "fas fa-chart-area", + searchTerms: ["analytics", "area-chart", "graph"] + }, { + title: "fas fa-chart-bar", + searchTerms: ["analytics", "bar-chart", "graph"] + }, { + title: "far fa-chart-bar", + searchTerms: ["analytics", "bar-chart", "graph"] + }, { + title: "fas fa-chart-line", + searchTerms: ["activity", "analytics", "dashboard", "graph", "line-chart"] + }, { + title: "fas fa-chart-pie", + searchTerms: ["analytics", "graph", "pie-chart"] + }, { + title: "fas fa-check", + searchTerms: ["accept", "agree", "checkmark", "confirm", "correct", "done", "notice", "notification", "notify", "ok", "select", "success", "tick", "todo", "yes"] + }, { + title: "fas fa-check-circle", + searchTerms: ["accept", "agree", "confirm", "correct", "done", "ok", "select", "success", "todo", "yes"] + }, { + title: "far fa-check-circle", + searchTerms: ["accept", "agree", "confirm", "correct", "done", "ok", "select", "success", "todo", "yes"] + }, { + title: "fas fa-check-double", + searchTerms: ["accept", "agree", "checkmark", "confirm", "correct", "done", "notice", "notification", "notify", "ok", "select", "success", "tick", "todo"] + }, { + title: "fas fa-check-square", + searchTerms: ["accept", "agree", "checkmark", "confirm", "correct", "done", "ok", "select", "success", "todo", "yes"] + }, { + title: "far fa-check-square", + searchTerms: ["accept", "agree", "checkmark", "confirm", "correct", "done", "ok", "select", "success", "todo", "yes"] + }, { + title: "fas fa-chess", + searchTerms: [] + }, { + title: "fas fa-chess-bishop", + searchTerms: [] + }, { + title: "fas fa-chess-board", + searchTerms: [] + }, { + title: "fas fa-chess-king", + searchTerms: [] + }, { + title: "fas fa-chess-knight", + searchTerms: [] + }, { + title: "fas fa-chess-pawn", + searchTerms: [] + }, { + title: "fas fa-chess-queen", + searchTerms: [] + }, { + title: "fas fa-chess-rook", + searchTerms: [] + }, { + title: "fas fa-chevron-circle-down", + searchTerms: ["arrow", "dropdown", "menu", "more"] + }, { + title: "fas fa-chevron-circle-left", + searchTerms: ["arrow", "back", "previous"] + }, { + title: "fas fa-chevron-circle-right", + searchTerms: ["arrow", "forward", "next"] + }, { + title: "fas fa-chevron-circle-up", + searchTerms: ["arrow"] + }, { + title: "fas fa-chevron-down", + searchTerms: [] + }, { + title: "fas fa-chevron-left", + searchTerms: ["back", "bracket", "previous"] + }, { + title: "fas fa-chevron-right", + searchTerms: ["bracket", "forward", "next"] + }, { + title: "fas fa-chevron-up", + searchTerms: [] + }, { + title: "fas fa-child", + searchTerms: [] + }, { + title: "fab fa-chrome", + searchTerms: ["browser"] + }, { + title: "fas fa-church", + searchTerms: ["building", "community", "religion"] + }, { + title: "fas fa-circle", + searchTerms: ["circle-thin", "dot", "notification"] + }, { + title: "far fa-circle", + searchTerms: ["circle-thin", "dot", "notification"] + }, { + title: "fas fa-circle-notch", + searchTerms: ["circle-o-notch"] + }, { + title: "fas fa-city", + searchTerms: ["buildings", "busy", "skyscrapers", "urban", "windows"] + }, { + title: "fas fa-clipboard", + searchTerms: ["paste"] + }, { + title: "far fa-clipboard", + searchTerms: ["paste"] + }, { + title: "fas fa-clipboard-check", + searchTerms: ["accept", "agree", "confirm", "done", "ok", "select", "success", "todo", "yes"] + }, { + title: "fas fa-clipboard-list", + searchTerms: ["checklist", "completed", "done", "finished", "intinerary", "ol", "schedule", "todo", "ul"] + }, { + title: "fas fa-clock", + searchTerms: ["date", "late", "schedule", "timer", "timestamp", "watch"] + }, { + title: "far fa-clock", + searchTerms: ["date", "late", "schedule", "timer", "timestamp", "watch"] + }, { + title: "fas fa-clone", + searchTerms: ["copy", "duplicate"] + }, { + title: "far fa-clone", + searchTerms: ["copy", "duplicate"] + }, { + title: "fas fa-closed-captioning", + searchTerms: ["cc"] + }, { + title: "far fa-closed-captioning", + searchTerms: ["cc"] + }, { + title: "fas fa-cloud", + searchTerms: ["save"] + }, { + title: "fas fa-cloud-download-alt", + searchTerms: ["import"] + }, { + title: "fas fa-cloud-meatball", + searchTerms: [] + }, { + title: "fas fa-cloud-moon", + searchTerms: ["crescent", "evening", "halloween", "holiday", "lunar", "night", "sky"] + }, { + title: "fas fa-cloud-moon-rain", + searchTerms: [] + }, { + title: "fas fa-cloud-rain", + searchTerms: ["precipitation"] + }, { + title: "fas fa-cloud-showers-heavy", + searchTerms: ["precipitation", "rain", "storm"] + }, { + title: "fas fa-cloud-sun", + searchTerms: ["day", "daytime", "fall", "outdoors", "seasonal"] + }, { + title: "fas fa-cloud-sun-rain", + searchTerms: [] + }, { + title: "fas fa-cloud-upload-alt", + searchTerms: ["cloud-upload"] + }, { + title: "fab fa-cloudscale", + searchTerms: [] + }, { + title: "fab fa-cloudsmith", + searchTerms: [] + }, { + title: "fab fa-cloudversify", + searchTerms: [] + }, { + title: "fas fa-cocktail", + searchTerms: ["alcohol", "beverage", "drink"] + }, { + title: "fas fa-code", + searchTerms: ["brackets", "html"] + }, { + title: "fas fa-code-branch", + searchTerms: ["branch", "code-fork", "fork", "git", "github", "rebase", "svn", "vcs", "version"] + }, { + title: "fab fa-codepen", + searchTerms: [] + }, { + title: "fab fa-codiepie", + searchTerms: [] + }, { + title: "fas fa-coffee", + searchTerms: ["beverage", "breakfast", "cafe", "drink", "fall", "morning", "mug", "seasonal", "tea"] + }, { + title: "fas fa-cog", + searchTerms: ["settings"] + }, { + title: "fas fa-cogs", + searchTerms: ["gears", "settings"] + }, { + title: "fas fa-coins", + searchTerms: [] + }, { + title: "fas fa-columns", + searchTerms: ["dashboard", "panes", "split"] + }, { + title: "fas fa-comment", + searchTerms: ["bubble", "chat", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "far fa-comment", + searchTerms: ["bubble", "chat", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "fas fa-comment-alt", + searchTerms: ["bubble", "chat", "commenting", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "far fa-comment-alt", + searchTerms: ["bubble", "chat", "commenting", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "fas fa-comment-dollar", + searchTerms: [] + }, { + title: "fas fa-comment-dots", + searchTerms: [] + }, { + title: "far fa-comment-dots", + searchTerms: [] + }, { + title: "fas fa-comment-slash", + searchTerms: [] + }, { + title: "fas fa-comments", + searchTerms: ["bubble", "chat", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "far fa-comments", + searchTerms: ["bubble", "chat", "conversation", "feedback", "message", "note", "notification", "sms", "speech", "texting"] + }, { + title: "fas fa-comments-dollar", + searchTerms: [] + }, { + title: "fas fa-compact-disc", + searchTerms: ["bluray", "cd", "disc", "media"] + }, { + title: "fas fa-compass", + searchTerms: ["directory", "location", "menu", "safari"] + }, { + title: "far fa-compass", + searchTerms: ["directory", "location", "menu", "safari"] + }, { + title: "fas fa-compress", + searchTerms: ["collapse", "combine", "contract", "merge", "smaller"] + }, { + title: "fas fa-concierge-bell", + searchTerms: ["attention", "hotel", "service", "support"] + }, { + title: "fab fa-connectdevelop", + searchTerms: [] + }, { + title: "fab fa-contao", + searchTerms: [] + }, { + title: "fas fa-cookie", + searchTerms: ["baked good", "chips", "food", "snack", "sweet", "treat"] + }, { + title: "fas fa-cookie-bite", + searchTerms: ["baked good", "bitten", "chips", "eating", "food", "snack", "sweet", "treat"] + }, { + title: "fas fa-copy", + searchTerms: ["clone", "duplicate", "file", "files-o"] + }, { + title: "far fa-copy", + searchTerms: ["clone", "duplicate", "file", "files-o"] + }, { + title: "fas fa-copyright", + searchTerms: [] + }, { + title: "far fa-copyright", + searchTerms: [] + }, { + title: "fas fa-couch", + searchTerms: ["furniture", "sofa"] + }, { + title: "fab fa-cpanel", + searchTerms: [] + }, { + title: "fab fa-creative-commons", + searchTerms: [] + }, { + title: "fab fa-creative-commons-by", + searchTerms: [] + }, { + title: "fab fa-creative-commons-nc", + searchTerms: [] + }, { + title: "fab fa-creative-commons-nc-eu", + searchTerms: [] + }, { + title: "fab fa-creative-commons-nc-jp", + searchTerms: [] + }, { + title: "fab fa-creative-commons-nd", + searchTerms: [] + }, { + title: "fab fa-creative-commons-pd", + searchTerms: [] + }, { + title: "fab fa-creative-commons-pd-alt", + searchTerms: [] + }, { + title: "fab fa-creative-commons-remix", + searchTerms: [] + }, { + title: "fab fa-creative-commons-sa", + searchTerms: [] + }, { + title: "fab fa-creative-commons-sampling", + searchTerms: [] + }, { + title: "fab fa-creative-commons-sampling-plus", + searchTerms: [] + }, { + title: "fab fa-creative-commons-share", + searchTerms: [] + }, { + title: "fab fa-creative-commons-zero", + searchTerms: [] + }, { + title: "fas fa-credit-card", + searchTerms: ["buy", "checkout", "credit-card-alt", "debit", "money", "payment", "purchase"] + }, { + title: "far fa-credit-card", + searchTerms: ["buy", "checkout", "credit-card-alt", "debit", "money", "payment", "purchase"] + }, { + title: "fab fa-critical-role", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "game", "gaming", "tabletop"] + }, { + title: "fas fa-crop", + searchTerms: ["design"] + }, { + title: "fas fa-crop-alt", + searchTerms: [] + }, { + title: "fas fa-cross", + searchTerms: ["catholicism", "christianity"] + }, { + title: "fas fa-crosshairs", + searchTerms: ["gpd", "picker", "position"] + }, { + title: "fas fa-crow", + searchTerms: ["bird", "bullfrog", "fauna", "halloween", "holiday", "toad"] + }, { + title: "fas fa-crown", + searchTerms: [] + }, { + title: "fab fa-css3", + searchTerms: ["code"] + }, { + title: "fab fa-css3-alt", + searchTerms: [] + }, { + title: "fas fa-cube", + searchTerms: ["package"] + }, { + title: "fas fa-cubes", + searchTerms: ["packages"] + }, { + title: "fas fa-cut", + searchTerms: ["scissors"] + }, { + title: "fab fa-cuttlefish", + searchTerms: [] + }, { + title: "fab fa-d-and-d", + searchTerms: [] + }, { + title: "fab fa-d-and-d-beyond", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "gaming", "tabletop"] + }, { + title: "fab fa-dashcube", + searchTerms: [] + }, { + title: "fas fa-database", + searchTerms: [] + }, { + title: "fas fa-deaf", + searchTerms: [] + }, { + title: "fab fa-delicious", + searchTerms: [] + }, { + title: "fas fa-democrat", + searchTerms: ["american", "democratic party", "donkey", "election", "left", "left-wing", "liberal", "politics", "usa"] + }, { + title: "fab fa-deploydog", + searchTerms: [] + }, { + title: "fab fa-deskpro", + searchTerms: [] + }, { + title: "fas fa-desktop", + searchTerms: ["computer", "cpu", "demo", "desktop", "device", "machine", "monitor", "pc", "screen"] + }, { + title: "fab fa-dev", + searchTerms: [] + }, { + title: "fab fa-deviantart", + searchTerms: [] + }, { + title: "fas fa-dharmachakra", + searchTerms: ["buddhism", "buddhist", "wheel of dharma"] + }, { + title: "fas fa-diagnoses", + searchTerms: [] + }, { + title: "fas fa-dice", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-d20", + searchTerms: ["Dungeons & Dragons", "chance", "d&d", "dnd", "fantasy", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-d6", + searchTerms: ["Dungeons & Dragons", "chance", "d&d", "dnd", "fantasy", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-five", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-four", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-one", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-six", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-three", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fas fa-dice-two", + searchTerms: ["chance", "gambling", "game", "roll"] + }, { + title: "fab fa-digg", + searchTerms: [] + }, { + title: "fab fa-digital-ocean", + searchTerms: [] + }, { + title: "fas fa-digital-tachograph", + searchTerms: [] + }, { + title: "fas fa-directions", + searchTerms: [] + }, { + title: "fab fa-discord", + searchTerms: [] + }, { + title: "fab fa-discourse", + searchTerms: [] + }, { + title: "fas fa-divide", + searchTerms: [] + }, { + title: "fas fa-dizzy", + searchTerms: ["dazed", "disapprove", "emoticon", "face"] + }, { + title: "far fa-dizzy", + searchTerms: ["dazed", "disapprove", "emoticon", "face"] + }, { + title: "fas fa-dna", + searchTerms: ["double helix", "helix"] + }, { + title: "fab fa-dochub", + searchTerms: [] + }, { + title: "fab fa-docker", + searchTerms: [] + }, { + title: "fas fa-dog", + searchTerms: ["canine", "fauna", "mammmal", "pet", "pooch", "puppy", "woof"] + }, { + title: "fas fa-dollar-sign", + searchTerms: ["$", "dollar-sign", "money", "price", "usd"] + }, { + title: "fas fa-dolly", + searchTerms: [] + }, { + title: "fas fa-dolly-flatbed", + searchTerms: [] + }, { + title: "fas fa-donate", + searchTerms: ["generosity", "give"] + }, { + title: "fas fa-door-closed", + searchTerms: [] + }, { + title: "fas fa-door-open", + searchTerms: [] + }, { + title: "fas fa-dot-circle", + searchTerms: ["bullseye", "notification", "target"] + }, { + title: "far fa-dot-circle", + searchTerms: ["bullseye", "notification", "target"] + }, { + title: "fas fa-dove", + searchTerms: ["bird", "fauna", "flying", "peace"] + }, { + title: "fas fa-download", + searchTerms: ["import"] + }, { + title: "fab fa-draft2digital", + searchTerms: [] + }, { + title: "fas fa-drafting-compass", + searchTerms: ["mechanical drawing", "plot", "plotting"] + }, { + title: "fas fa-dragon", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy"] + }, { + title: "fas fa-draw-polygon", + searchTerms: [] + }, { + title: "fab fa-dribbble", + searchTerms: [] + }, { + title: "fab fa-dribbble-square", + searchTerms: [] + }, { + title: "fab fa-dropbox", + searchTerms: [] + }, { + title: "fas fa-drum", + searchTerms: ["instrument", "music", "percussion", "snare", "sound"] + }, { + title: "fas fa-drum-steelpan", + searchTerms: ["calypso", "instrument", "music", "percussion", "reggae", "snare", "sound", "steel", "tropical"] + }, { + title: "fas fa-drumstick-bite", + searchTerms: [] + }, { + title: "fab fa-drupal", + searchTerms: [] + }, { + title: "fas fa-dumbbell", + searchTerms: ["exercise", "gym", "strength", "weight", "weight-lifting"] + }, { + title: "fas fa-dungeon", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "door", "entrance", "fantasy", "gate"] + }, { + title: "fab fa-dyalog", + searchTerms: [] + }, { + title: "fab fa-earlybirds", + searchTerms: [] + }, { + title: "fab fa-ebay", + searchTerms: [] + }, { + title: "fab fa-edge", + searchTerms: ["browser", "ie"] + }, { + title: "fas fa-edit", + searchTerms: ["edit", "pen", "pencil", "update", "write"] + }, { + title: "far fa-edit", + searchTerms: ["edit", "pen", "pencil", "update", "write"] + }, { + title: "fas fa-eject", + searchTerms: [] + }, { + title: "fab fa-elementor", + searchTerms: [] + }, { + title: "fas fa-ellipsis-h", + searchTerms: ["dots", "drag", "kebab", "list", "menu", "nav", "navigation", "ol", "reorder", "settings", "ul"] + }, { + title: "fas fa-ellipsis-v", + searchTerms: ["dots", "drag", "kebab", "list", "menu", "nav", "navigation", "ol", "reorder", "settings", "ul"] + }, { + title: "fab fa-ello", + searchTerms: [] + }, { + title: "fab fa-ember", + searchTerms: [] + }, { + title: "fab fa-empire", + searchTerms: [] + }, { + title: "fas fa-envelope", + searchTerms: ["e-mail", "email", "letter", "mail", "message", "notification", "support"] + }, { + title: "far fa-envelope", + searchTerms: ["e-mail", "email", "letter", "mail", "message", "notification", "support"] + }, { + title: "fas fa-envelope-open", + searchTerms: ["e-mail", "email", "letter", "mail", "message", "notification", "support"] + }, { + title: "far fa-envelope-open", + searchTerms: ["e-mail", "email", "letter", "mail", "message", "notification", "support"] + }, { + title: "fas fa-envelope-open-text", + searchTerms: [] + }, { + title: "fas fa-envelope-square", + searchTerms: ["e-mail", "email", "letter", "mail", "message", "notification", "support"] + }, { + title: "fab fa-envira", + searchTerms: ["leaf"] + }, { + title: "fas fa-equals", + searchTerms: [] + }, { + title: "fas fa-eraser", + searchTerms: ["delete", "remove"] + }, { + title: "fab fa-erlang", + searchTerms: [] + }, { + title: "fab fa-ethereum", + searchTerms: [] + }, { + title: "fab fa-etsy", + searchTerms: [] + }, { + title: "fas fa-euro-sign", + searchTerms: ["eur"] + }, { + title: "fas fa-exchange-alt", + searchTerms: ["arrow", "arrows", "exchange", "reciprocate", "return", "swap", "transfer"] + }, { + title: "fas fa-exclamation", + searchTerms: ["alert", "danger", "error", "important", "notice", "notification", "notify", "problem", "warning"] + }, { + title: "fas fa-exclamation-circle", + searchTerms: ["alert", "danger", "error", "important", "notice", "notification", "notify", "problem", "warning"] + }, { + title: "fas fa-exclamation-triangle", + searchTerms: ["alert", "danger", "error", "important", "notice", "notification", "notify", "problem", "warning"] + }, { + title: "fas fa-expand", + searchTerms: ["bigger", "enlarge", "resize"] + }, { + title: "fas fa-expand-arrows-alt", + searchTerms: ["arrows-alt", "bigger", "enlarge", "move", "resize"] + }, { + title: "fab fa-expeditedssl", + searchTerms: [] + }, { + title: "fas fa-external-link-alt", + searchTerms: ["external-link", "new", "open"] + }, { + title: "fas fa-external-link-square-alt", + searchTerms: ["external-link-square", "new", "open"] + }, { + title: "fas fa-eye", + searchTerms: ["optic", "see", "seen", "show", "sight", "views", "visible"] + }, { + title: "far fa-eye", + searchTerms: ["optic", "see", "seen", "show", "sight", "views", "visible"] + }, { + title: "fas fa-eye-dropper", + searchTerms: ["eyedropper"] + }, { + title: "fas fa-eye-slash", + searchTerms: ["blind", "hide", "show", "toggle", "unseen", "views", "visible", "visiblity"] + }, { + title: "far fa-eye-slash", + searchTerms: ["blind", "hide", "show", "toggle", "unseen", "views", "visible", "visiblity"] + }, { + title: "fab fa-facebook", + searchTerms: ["facebook-official", "social network"] + }, { + title: "fab fa-facebook-f", + searchTerms: ["facebook"] + }, { + title: "fab fa-facebook-messenger", + searchTerms: [] + }, { + title: "fab fa-facebook-square", + searchTerms: ["social network"] + }, { + title: "fab fa-fantasy-flight-games", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "game", "gaming", "tabletop"] + }, { + title: "fas fa-fast-backward", + searchTerms: ["beginning", "first", "previous", "rewind", "start"] + }, { + title: "fas fa-fast-forward", + searchTerms: ["end", "last", "next"] + }, { + title: "fas fa-fax", + searchTerms: [] + }, { + title: "fas fa-feather", + searchTerms: ["bird", "light", "plucked", "quill"] + }, { + title: "fas fa-feather-alt", + searchTerms: ["bird", "light", "plucked", "quill"] + }, { + title: "fas fa-female", + searchTerms: ["human", "person", "profile", "user", "woman"] + }, { + title: "fas fa-fighter-jet", + searchTerms: ["airplane", "fast", "fly", "goose", "maverick", "plane", "quick", "top gun", "transportation", "travel"] + }, { + title: "fas fa-file", + searchTerms: ["document", "new", "page", "pdf", "resume"] + }, { + title: "far fa-file", + searchTerms: ["document", "new", "page", "pdf", "resume"] + }, { + title: "fas fa-file-alt", + searchTerms: ["document", "file-text", "invoice", "new", "page", "pdf"] + }, { + title: "far fa-file-alt", + searchTerms: ["document", "file-text", "invoice", "new", "page", "pdf"] + }, { + title: "fas fa-file-archive", + searchTerms: [".zip", "bundle", "compress", "compression", "download", "zip"] + }, { + title: "far fa-file-archive", + searchTerms: [".zip", "bundle", "compress", "compression", "download", "zip"] + }, { + title: "fas fa-file-audio", + searchTerms: [] + }, { + title: "far fa-file-audio", + searchTerms: [] + }, { + title: "fas fa-file-code", + searchTerms: [] + }, { + title: "far fa-file-code", + searchTerms: [] + }, { + title: "fas fa-file-contract", + searchTerms: ["agreement", "binding", "document", "legal", "signature"] + }, { + title: "fas fa-file-csv", + searchTerms: ["spreadsheets"] + }, { + title: "fas fa-file-download", + searchTerms: [] + }, { + title: "fas fa-file-excel", + searchTerms: [] + }, { + title: "far fa-file-excel", + searchTerms: [] + }, { + title: "fas fa-file-export", + searchTerms: [] + }, { + title: "fas fa-file-image", + searchTerms: [] + }, { + title: "far fa-file-image", + searchTerms: [] + }, { + title: "fas fa-file-import", + searchTerms: [] + }, { + title: "fas fa-file-invoice", + searchTerms: ["bill", "document", "receipt"] + }, { + title: "fas fa-file-invoice-dollar", + searchTerms: ["$", "bill", "document", "dollar-sign", "money", "receipt", "usd"] + }, { + title: "fas fa-file-medical", + searchTerms: [] + }, { + title: "fas fa-file-medical-alt", + searchTerms: [] + }, { + title: "fas fa-file-pdf", + searchTerms: [] + }, { + title: "far fa-file-pdf", + searchTerms: [] + }, { + title: "fas fa-file-powerpoint", + searchTerms: [] + }, { + title: "far fa-file-powerpoint", + searchTerms: [] + }, { + title: "fas fa-file-prescription", + searchTerms: ["drugs", "medical", "medicine", "rx"] + }, { + title: "fas fa-file-signature", + searchTerms: ["John Hancock", "contract", "document", "name"] + }, { + title: "fas fa-file-upload", + searchTerms: [] + }, { + title: "fas fa-file-video", + searchTerms: [] + }, { + title: "far fa-file-video", + searchTerms: [] + }, { + title: "fas fa-file-word", + searchTerms: [] + }, { + title: "far fa-file-word", + searchTerms: [] + }, { + title: "fas fa-fill", + searchTerms: ["bucket", "color", "paint", "paint bucket"] + }, { + title: "fas fa-fill-drip", + searchTerms: ["bucket", "color", "drop", "paint", "paint bucket", "spill"] + }, { + title: "fas fa-film", + searchTerms: ["movie"] + }, { + title: "fas fa-filter", + searchTerms: ["funnel", "options"] + }, { + title: "fas fa-fingerprint", + searchTerms: ["human", "id", "identification", "lock", "smudge", "touch", "unique", "unlock"] + }, { + title: "fas fa-fire", + searchTerms: ["caliente", "flame", "heat", "hot", "popular"] + }, { + title: "fas fa-fire-extinguisher", + searchTerms: [] + }, { + title: "fab fa-firefox", + searchTerms: ["browser"] + }, { + title: "fas fa-first-aid", + searchTerms: [] + }, { + title: "fab fa-first-order", + searchTerms: [] + }, { + title: "fab fa-first-order-alt", + searchTerms: [] + }, { + title: "fab fa-firstdraft", + searchTerms: [] + }, { + title: "fas fa-fish", + searchTerms: ["fauna", "gold", "swimming"] + }, { + title: "fas fa-fist-raised", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "hand", "ki", "monk", "resist", "strength", "unarmed combat"] + }, { + title: "fas fa-flag", + searchTerms: ["country", "notice", "notification", "notify", "pole", "report", "symbol"] + }, { + title: "far fa-flag", + searchTerms: ["country", "notice", "notification", "notify", "pole", "report", "symbol"] + }, { + title: "fas fa-flag-checkered", + searchTerms: ["notice", "notification", "notify", "pole", "racing", "report", "symbol"] + }, { + title: "fas fa-flag-usa", + searchTerms: ["betsy ross", "country", "old glory", "stars", "stripes", "symbol"] + }, { + title: "fas fa-flask", + searchTerms: ["beaker", "experimental", "labs", "science"] + }, { + title: "fab fa-flickr", + searchTerms: [] + }, { + title: "fab fa-flipboard", + searchTerms: [] + }, { + title: "fas fa-flushed", + searchTerms: ["embarrassed", "emoticon", "face"] + }, { + title: "far fa-flushed", + searchTerms: ["embarrassed", "emoticon", "face"] + }, { + title: "fab fa-fly", + searchTerms: [] + }, { + title: "fas fa-folder", + searchTerms: [] + }, { + title: "far fa-folder", + searchTerms: [] + }, { + title: "fas fa-folder-minus", + searchTerms: ["archive", "delete", "negative", "remove"] + }, { + title: "fas fa-folder-open", + searchTerms: [] + }, { + title: "far fa-folder-open", + searchTerms: [] + }, { + title: "fas fa-folder-plus", + searchTerms: ["add", "create", "new", "positive"] + }, { + title: "fas fa-font", + searchTerms: ["text"] + }, { + title: "fab fa-font-awesome", + searchTerms: ["meanpath"] + }, { + title: "fab fa-font-awesome-alt", + searchTerms: [] + }, { + title: "fab fa-font-awesome-flag", + searchTerms: [] + }, { + title: "far fa-font-awesome-logo-full", + searchTerms: [] + }, { + title: "fas fa-font-awesome-logo-full", + searchTerms: [] + }, { + title: "fab fa-font-awesome-logo-full", + searchTerms: [] + }, { + title: "fab fa-fonticons", + searchTerms: [] + }, { + title: "fab fa-fonticons-fi", + searchTerms: [] + }, { + title: "fas fa-football-ball", + searchTerms: ["fall", "pigskin", "seasonal"] + }, { + title: "fab fa-fort-awesome", + searchTerms: ["castle"] + }, { + title: "fab fa-fort-awesome-alt", + searchTerms: ["castle"] + }, { + title: "fab fa-forumbee", + searchTerms: [] + }, { + title: "fas fa-forward", + searchTerms: ["forward", "next"] + }, { + title: "fab fa-foursquare", + searchTerms: [] + }, { + title: "fab fa-free-code-camp", + searchTerms: [] + }, { + title: "fab fa-freebsd", + searchTerms: [] + }, { + title: "fas fa-frog", + searchTerms: ["amphibian", "bullfrog", "fauna", "hop", "kermit", "kiss", "prince", "ribbit", "toad", "wart"] + }, { + title: "fas fa-frown", + searchTerms: ["disapprove", "emoticon", "face", "rating", "sad"] + }, { + title: "far fa-frown", + searchTerms: ["disapprove", "emoticon", "face", "rating", "sad"] + }, { + title: "fas fa-frown-open", + searchTerms: ["disapprove", "emoticon", "face", "rating", "sad"] + }, { + title: "far fa-frown-open", + searchTerms: ["disapprove", "emoticon", "face", "rating", "sad"] + }, { + title: "fab fa-fulcrum", + searchTerms: [] + }, { + title: "fas fa-funnel-dollar", + searchTerms: [] + }, { + title: "fas fa-futbol", + searchTerms: ["ball", "football", "soccer"] + }, { + title: "far fa-futbol", + searchTerms: ["ball", "football", "soccer"] + }, { + title: "fab fa-galactic-republic", + searchTerms: ["politics", "star wars"] + }, { + title: "fab fa-galactic-senate", + searchTerms: ["star wars"] + }, { + title: "fas fa-gamepad", + searchTerms: ["controller"] + }, { + title: "fas fa-gas-pump", + searchTerms: [] + }, { + title: "fas fa-gavel", + searchTerms: ["hammer", "judge", "lawyer", "opinion"] + }, { + title: "fas fa-gem", + searchTerms: ["diamond"] + }, { + title: "far fa-gem", + searchTerms: ["diamond"] + }, { + title: "fas fa-genderless", + searchTerms: [] + }, { + title: "fab fa-get-pocket", + searchTerms: [] + }, { + title: "fab fa-gg", + searchTerms: [] + }, { + title: "fab fa-gg-circle", + searchTerms: [] + }, { + title: "fas fa-ghost", + searchTerms: ["apparition", "blinky", "clyde", "floating", "halloween", "holiday", "inky", "pinky", "spirit"] + }, { + title: "fas fa-gift", + searchTerms: ["generosity", "giving", "party", "present", "wrapped"] + }, { + title: "fab fa-git", + searchTerms: [] + }, { + title: "fab fa-git-square", + searchTerms: [] + }, { + title: "fab fa-github", + searchTerms: ["octocat"] + }, { + title: "fab fa-github-alt", + searchTerms: ["octocat"] + }, { + title: "fab fa-github-square", + searchTerms: ["octocat"] + }, { + title: "fab fa-gitkraken", + searchTerms: [] + }, { + title: "fab fa-gitlab", + searchTerms: ["Axosoft"] + }, { + title: "fab fa-gitter", + searchTerms: [] + }, { + title: "fas fa-glass-martini", + searchTerms: ["alcohol", "bar", "beverage", "drink", "glass", "liquor", "martini"] + }, { + title: "fas fa-glass-martini-alt", + searchTerms: [] + }, { + title: "fas fa-glasses", + searchTerms: ["foureyes", "hipster", "nerd", "reading", "sight", "spectacles"] + }, { + title: "fab fa-glide", + searchTerms: [] + }, { + title: "fab fa-glide-g", + searchTerms: [] + }, { + title: "fas fa-globe", + searchTerms: ["all", "coordinates", "country", "earth", "global", "gps", "language", "localize", "location", "map", "online", "place", "planet", "translate", "travel", "world"] + }, { + title: "fas fa-globe-africa", + searchTerms: ["all", "country", "earth", "global", "gps", "language", "localize", "location", "map", "online", "place", "planet", "translate", "travel", "world"] + }, { + title: "fas fa-globe-americas", + searchTerms: ["all", "country", "earth", "global", "gps", "language", "localize", "location", "map", "online", "place", "planet", "translate", "travel", "world"] + }, { + title: "fas fa-globe-asia", + searchTerms: ["all", "country", "earth", "global", "gps", "language", "localize", "location", "map", "online", "place", "planet", "translate", "travel", "world"] + }, { + title: "fab fa-gofore", + searchTerms: [] + }, { + title: "fas fa-golf-ball", + searchTerms: [] + }, { + title: "fab fa-goodreads", + searchTerms: [] + }, { + title: "fab fa-goodreads-g", + searchTerms: [] + }, { + title: "fab fa-google", + searchTerms: [] + }, { + title: "fab fa-google-drive", + searchTerms: [] + }, { + title: "fab fa-google-play", + searchTerms: [] + }, { + title: "fab fa-google-plus", + searchTerms: ["google-plus-circle", "google-plus-official"] + }, { + title: "fab fa-google-plus-g", + searchTerms: ["google-plus", "social network"] + }, { + title: "fab fa-google-plus-square", + searchTerms: ["social network"] + }, { + title: "fab fa-google-wallet", + searchTerms: [] + }, { + title: "fas fa-gopuram", + searchTerms: ["building", "entrance", "hinduism", "temple", "tower"] + }, { + title: "fas fa-graduation-cap", + searchTerms: ["learning", "school", "student"] + }, { + title: "fab fa-gratipay", + searchTerms: ["favorite", "heart", "like", "love"] + }, { + title: "fab fa-grav", + searchTerms: [] + }, { + title: "fas fa-greater-than", + searchTerms: [] + }, { + title: "fas fa-greater-than-equal", + searchTerms: [] + }, { + title: "fas fa-grimace", + searchTerms: ["cringe", "emoticon", "face"] + }, { + title: "far fa-grimace", + searchTerms: ["cringe", "emoticon", "face"] + }, { + title: "fas fa-grin", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "far fa-grin", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "fas fa-grin-alt", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "far fa-grin-alt", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "fas fa-grin-beam", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "far fa-grin-beam", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "fas fa-grin-beam-sweat", + searchTerms: ["emoticon", "face", "smile"] + }, { + title: "far fa-grin-beam-sweat", + searchTerms: ["emoticon", "face", "smile"] + }, { + title: "fas fa-grin-hearts", + searchTerms: ["emoticon", "face", "love", "smile"] + }, { + title: "far fa-grin-hearts", + searchTerms: ["emoticon", "face", "love", "smile"] + }, { + title: "fas fa-grin-squint", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "far fa-grin-squint", + searchTerms: ["emoticon", "face", "laugh", "smile"] + }, { + title: "fas fa-grin-squint-tears", + searchTerms: ["emoticon", "face", "happy", "smile"] + }, { + title: "far fa-grin-squint-tears", + searchTerms: ["emoticon", "face", "happy", "smile"] + }, { + title: "fas fa-grin-stars", + searchTerms: ["emoticon", "face", "star-struck"] + }, { + title: "far fa-grin-stars", + searchTerms: ["emoticon", "face", "star-struck"] + }, { + title: "fas fa-grin-tears", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-grin-tears", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-grin-tongue", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-grin-tongue", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-grin-tongue-squint", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-grin-tongue-squint", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-grin-tongue-wink", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-grin-tongue-wink", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-grin-wink", + searchTerms: ["emoticon", "face", "flirt", "laugh", "smile"] + }, { + title: "far fa-grin-wink", + searchTerms: ["emoticon", "face", "flirt", "laugh", "smile"] + }, { + title: "fas fa-grip-horizontal", + searchTerms: ["affordance", "drag", "drop", "grab", "handle"] + }, { + title: "fas fa-grip-vertical", + searchTerms: ["affordance", "drag", "drop", "grab", "handle"] + }, { + title: "fab fa-gripfire", + searchTerms: [] + }, { + title: "fab fa-grunt", + searchTerms: [] + }, { + title: "fab fa-gulp", + searchTerms: [] + }, { + title: "fas fa-h-square", + searchTerms: ["hospital", "hotel"] + }, { + title: "fab fa-hacker-news", + searchTerms: [] + }, { + title: "fab fa-hacker-news-square", + searchTerms: [] + }, { + title: "fab fa-hackerrank", + searchTerms: [] + }, { + title: "fas fa-hammer", + searchTerms: ["admin", "fix", "repair", "settings", "tool"] + }, { + title: "fas fa-hamsa", + searchTerms: ["amulet", "christianity", "islam", "jewish", "judaism", "muslim", "protection"] + }, { + title: "fas fa-hand-holding", + searchTerms: [] + }, { + title: "fas fa-hand-holding-heart", + searchTerms: [] + }, { + title: "fas fa-hand-holding-usd", + searchTerms: ["$", "dollar sign", "donation", "giving", "money", "price"] + }, { + title: "fas fa-hand-lizard", + searchTerms: [] + }, { + title: "far fa-hand-lizard", + searchTerms: [] + }, { + title: "fas fa-hand-paper", + searchTerms: ["stop"] + }, { + title: "far fa-hand-paper", + searchTerms: ["stop"] + }, { + title: "fas fa-hand-peace", + searchTerms: [] + }, { + title: "far fa-hand-peace", + searchTerms: [] + }, { + title: "fas fa-hand-point-down", + searchTerms: ["finger", "hand-o-down", "point"] + }, { + title: "far fa-hand-point-down", + searchTerms: ["finger", "hand-o-down", "point"] + }, { + title: "fas fa-hand-point-left", + searchTerms: ["back", "finger", "hand-o-left", "left", "point", "previous"] + }, { + title: "far fa-hand-point-left", + searchTerms: ["back", "finger", "hand-o-left", "left", "point", "previous"] + }, { + title: "fas fa-hand-point-right", + searchTerms: ["finger", "forward", "hand-o-right", "next", "point", "right"] + }, { + title: "far fa-hand-point-right", + searchTerms: ["finger", "forward", "hand-o-right", "next", "point", "right"] + }, { + title: "fas fa-hand-point-up", + searchTerms: ["finger", "hand-o-up", "point"] + }, { + title: "far fa-hand-point-up", + searchTerms: ["finger", "hand-o-up", "point"] + }, { + title: "fas fa-hand-pointer", + searchTerms: ["select"] + }, { + title: "far fa-hand-pointer", + searchTerms: ["select"] + }, { + title: "fas fa-hand-rock", + searchTerms: [] + }, { + title: "far fa-hand-rock", + searchTerms: [] + }, { + title: "fas fa-hand-scissors", + searchTerms: [] + }, { + title: "far fa-hand-scissors", + searchTerms: [] + }, { + title: "fas fa-hand-spock", + searchTerms: [] + }, { + title: "far fa-hand-spock", + searchTerms: [] + }, { + title: "fas fa-hands", + searchTerms: [] + }, { + title: "fas fa-hands-helping", + searchTerms: ["aid", "assistance", "partnership", "volunteering"] + }, { + title: "fas fa-handshake", + searchTerms: ["greeting", "partnership"] + }, { + title: "far fa-handshake", + searchTerms: ["greeting", "partnership"] + }, { + title: "fas fa-hanukiah", + searchTerms: ["candle", "hanukkah", "jewish", "judaism", "light"] + }, { + title: "fas fa-hashtag", + searchTerms: [] + }, { + title: "fas fa-hat-wizard", + searchTerms: ["Dungeons & Dragons", "buckle", "cloth", "clothing", "d&d", "dnd", "fantasy", "halloween", "holiday", "mage", "magic", "pointy", "witch"] + }, { + title: "fas fa-haykal", + searchTerms: ["bahai", "bahá'í", "star"] + }, { + title: "fas fa-hdd", + searchTerms: ["cpu", "hard drive", "harddrive", "machine", "save", "storage"] + }, { + title: "far fa-hdd", + searchTerms: ["cpu", "hard drive", "harddrive", "machine", "save", "storage"] + }, { + title: "fas fa-heading", + searchTerms: ["header"] + }, { + title: "fas fa-headphones", + searchTerms: ["audio", "listen", "music", "sound", "speaker"] + }, { + title: "fas fa-headphones-alt", + searchTerms: ["audio", "listen", "music", "sound", "speaker"] + }, { + title: "fas fa-headset", + searchTerms: ["audio", "gamer", "gaming", "listen", "live chat", "microphone", "shot caller", "sound", "support", "telemarketer"] + }, { + title: "fas fa-heart", + searchTerms: ["favorite", "like", "love"] + }, { + title: "far fa-heart", + searchTerms: ["favorite", "like", "love"] + }, { + title: "fas fa-heartbeat", + searchTerms: ["ekg", "lifeline", "vital signs"] + }, { + title: "fas fa-helicopter", + searchTerms: ["airwolf", "apache", "chopper", "flight", "fly"] + }, { + title: "fas fa-highlighter", + searchTerms: ["edit", "marker", "sharpie", "update", "write"] + }, { + title: "fas fa-hiking", + searchTerms: ["activity", "backpack", "fall", "fitness", "outdoors", "seasonal", "walking"] + }, { + title: "fas fa-hippo", + searchTerms: ["fauna", "hungry", "mammmal"] + }, { + title: "fab fa-hips", + searchTerms: [] + }, { + title: "fab fa-hire-a-helper", + searchTerms: [] + }, { + title: "fas fa-history", + searchTerms: [] + }, { + title: "fas fa-hockey-puck", + searchTerms: [] + }, { + title: "fas fa-home", + searchTerms: ["house", "main"] + }, { + title: "fab fa-hooli", + searchTerms: [] + }, { + title: "fab fa-hornbill", + searchTerms: [] + }, { + title: "fas fa-horse", + searchTerms: ["equus", "fauna", "mammmal", "neigh"] + }, { + title: "fas fa-hospital", + searchTerms: ["building", "emergency room", "medical center"] + }, { + title: "far fa-hospital", + searchTerms: ["building", "emergency room", "medical center"] + }, { + title: "fas fa-hospital-alt", + searchTerms: ["building", "emergency room", "medical center"] + }, { + title: "fas fa-hospital-symbol", + searchTerms: [] + }, { + title: "fas fa-hot-tub", + searchTerms: [] + }, { + title: "fas fa-hotel", + searchTerms: ["building", "lodging"] + }, { + title: "fab fa-hotjar", + searchTerms: [] + }, { + title: "fas fa-hourglass", + searchTerms: [] + }, { + title: "far fa-hourglass", + searchTerms: [] + }, { + title: "fas fa-hourglass-end", + searchTerms: [] + }, { + title: "fas fa-hourglass-half", + searchTerms: [] + }, { + title: "fas fa-hourglass-start", + searchTerms: [] + }, { + title: "fas fa-house-damage", + searchTerms: ["devastation", "home"] + }, { + title: "fab fa-houzz", + searchTerms: [] + }, { + title: "fas fa-hryvnia", + searchTerms: ["money"] + }, { + title: "fab fa-html5", + searchTerms: [] + }, { + title: "fab fa-hubspot", + searchTerms: [] + }, { + title: "fas fa-i-cursor", + searchTerms: [] + }, { + title: "fas fa-id-badge", + searchTerms: [] + }, { + title: "far fa-id-badge", + searchTerms: [] + }, { + title: "fas fa-id-card", + searchTerms: ["document", "identification", "issued"] + }, { + title: "far fa-id-card", + searchTerms: ["document", "identification", "issued"] + }, { + title: "fas fa-id-card-alt", + searchTerms: ["demographics"] + }, { + title: "fas fa-image", + searchTerms: ["album", "photo", "picture"] + }, { + title: "far fa-image", + searchTerms: ["album", "photo", "picture"] + }, { + title: "fas fa-images", + searchTerms: ["album", "photo", "picture"] + }, { + title: "far fa-images", + searchTerms: ["album", "photo", "picture"] + }, { + title: "fab fa-imdb", + searchTerms: [] + }, { + title: "fas fa-inbox", + searchTerms: [] + }, { + title: "fas fa-indent", + searchTerms: [] + }, { + title: "fas fa-industry", + searchTerms: ["factory", "manufacturing"] + }, { + title: "fas fa-infinity", + searchTerms: [] + }, { + title: "fas fa-info", + searchTerms: ["details", "help", "information", "more"] + }, { + title: "fas fa-info-circle", + searchTerms: ["details", "help", "information", "more"] + }, { + title: "fab fa-instagram", + searchTerms: [] + }, { + title: "fab fa-internet-explorer", + searchTerms: ["browser", "ie"] + }, { + title: "fab fa-ioxhost", + searchTerms: [] + }, { + title: "fas fa-italic", + searchTerms: ["italics"] + }, { + title: "fab fa-itunes", + searchTerms: [] + }, { + title: "fab fa-itunes-note", + searchTerms: [] + }, { + title: "fab fa-java", + searchTerms: [] + }, { + title: "fas fa-jedi", + searchTerms: ["star wars"] + }, { + title: "fab fa-jedi-order", + searchTerms: ["star wars"] + }, { + title: "fab fa-jenkins", + searchTerms: [] + }, { + title: "fab fa-joget", + searchTerms: [] + }, { + title: "fas fa-joint", + searchTerms: ["blunt", "cannabis", "doobie", "drugs", "marijuana", "roach", "smoke", "smoking", "spliff"] + }, { + title: "fab fa-joomla", + searchTerms: [] + }, { + title: "fas fa-journal-whills", + searchTerms: ["book", "jedi", "star wars", "the force"] + }, { + title: "fab fa-js", + searchTerms: [] + }, { + title: "fab fa-js-square", + searchTerms: [] + }, { + title: "fab fa-jsfiddle", + searchTerms: [] + }, { + title: "fas fa-kaaba", + searchTerms: ["building", "cube", "islam", "muslim"] + }, { + title: "fab fa-kaggle", + searchTerms: [] + }, { + title: "fas fa-key", + searchTerms: ["password", "unlock"] + }, { + title: "fab fa-keybase", + searchTerms: [] + }, { + title: "fas fa-keyboard", + searchTerms: ["input", "type"] + }, { + title: "far fa-keyboard", + searchTerms: ["input", "type"] + }, { + title: "fab fa-keycdn", + searchTerms: [] + }, { + title: "fas fa-khanda", + searchTerms: ["chakkar", "sikh", "sikhism", "sword"] + }, { + title: "fab fa-kickstarter", + searchTerms: [] + }, { + title: "fab fa-kickstarter-k", + searchTerms: [] + }, { + title: "fas fa-kiss", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "far fa-kiss", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "fas fa-kiss-beam", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "far fa-kiss-beam", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "fas fa-kiss-wink-heart", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "far fa-kiss-wink-heart", + searchTerms: ["beso", "emoticon", "face", "love", "smooch"] + }, { + title: "fas fa-kiwi-bird", + searchTerms: ["bird", "fauna"] + }, { + title: "fab fa-korvue", + searchTerms: [] + }, { + title: "fas fa-landmark", + searchTerms: ["building", "historic", "memoroable", "politics"] + }, { + title: "fas fa-language", + searchTerms: ["dialect", "idiom", "localize", "speech", "translate", "vernacular"] + }, { + title: "fas fa-laptop", + searchTerms: ["computer", "cpu", "dell", "demo", "device", "dude you're getting", "mac", "macbook", "machine", "pc"] + }, { + title: "fas fa-laptop-code", + searchTerms: [] + }, { + title: "fab fa-laravel", + searchTerms: [] + }, { + title: "fab fa-lastfm", + searchTerms: [] + }, { + title: "fab fa-lastfm-square", + searchTerms: [] + }, { + title: "fas fa-laugh", + searchTerms: ["LOL", "emoticon", "face", "laugh"] + }, { + title: "far fa-laugh", + searchTerms: ["LOL", "emoticon", "face", "laugh"] + }, { + title: "fas fa-laugh-beam", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-laugh-beam", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-laugh-squint", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-laugh-squint", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-laugh-wink", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "far fa-laugh-wink", + searchTerms: ["LOL", "emoticon", "face"] + }, { + title: "fas fa-layer-group", + searchTerms: ["layers"] + }, { + title: "fas fa-leaf", + searchTerms: ["eco", "flora", "nature", "plant"] + }, { + title: "fab fa-leanpub", + searchTerms: [] + }, { + title: "fas fa-lemon", + searchTerms: ["food"] + }, { + title: "far fa-lemon", + searchTerms: ["food"] + }, { + title: "fab fa-less", + searchTerms: [] + }, { + title: "fas fa-less-than", + searchTerms: [] + }, { + title: "fas fa-less-than-equal", + searchTerms: [] + }, { + title: "fas fa-level-down-alt", + searchTerms: ["level-down"] + }, { + title: "fas fa-level-up-alt", + searchTerms: ["level-up"] + }, { + title: "fas fa-life-ring", + searchTerms: ["support"] + }, { + title: "far fa-life-ring", + searchTerms: ["support"] + }, { + title: "fas fa-lightbulb", + searchTerms: ["idea", "inspiration"] + }, { + title: "far fa-lightbulb", + searchTerms: ["idea", "inspiration"] + }, { + title: "fab fa-line", + searchTerms: [] + }, { + title: "fas fa-link", + searchTerms: ["chain"] + }, { + title: "fab fa-linkedin", + searchTerms: ["linkedin-square"] + }, { + title: "fab fa-linkedin-in", + searchTerms: ["linkedin"] + }, { + title: "fab fa-linode", + searchTerms: [] + }, { + title: "fab fa-linux", + searchTerms: ["tux"] + }, { + title: "fas fa-lira-sign", + searchTerms: ["try", "turkish"] + }, { + title: "fas fa-list", + searchTerms: ["checklist", "completed", "done", "finished", "ol", "todo", "ul"] + }, { + title: "fas fa-list-alt", + searchTerms: ["checklist", "completed", "done", "finished", "ol", "todo", "ul"] + }, { + title: "far fa-list-alt", + searchTerms: ["checklist", "completed", "done", "finished", "ol", "todo", "ul"] + }, { + title: "fas fa-list-ol", + searchTerms: ["checklist", "list", "numbers", "ol", "todo", "ul"] + }, { + title: "fas fa-list-ul", + searchTerms: ["checklist", "list", "ol", "todo", "ul"] + }, { + title: "fas fa-location-arrow", + searchTerms: ["address", "coordinates", "gps", "location", "map", "place", "where"] + }, { + title: "fas fa-lock", + searchTerms: ["admin", "protect", "security"] + }, { + title: "fas fa-lock-open", + searchTerms: ["admin", "lock", "open", "password", "protect"] + }, { + title: "fas fa-long-arrow-alt-down", + searchTerms: ["long-arrow-down"] + }, { + title: "fas fa-long-arrow-alt-left", + searchTerms: ["back", "long-arrow-left", "previous"] + }, { + title: "fas fa-long-arrow-alt-right", + searchTerms: ["long-arrow-right"] + }, { + title: "fas fa-long-arrow-alt-up", + searchTerms: ["long-arrow-up"] + }, { + title: "fas fa-low-vision", + searchTerms: [] + }, { + title: "fas fa-luggage-cart", + searchTerms: [] + }, { + title: "fab fa-lyft", + searchTerms: [] + }, { + title: "fab fa-magento", + searchTerms: [] + }, { + title: "fas fa-magic", + searchTerms: ["autocomplete", "automatic", "mage", "magic", "spell", "witch", "wizard"] + }, { + title: "fas fa-magnet", + searchTerms: [] + }, { + title: "fas fa-mail-bulk", + searchTerms: [] + }, { + title: "fab fa-mailchimp", + searchTerms: [] + }, { + title: "fas fa-male", + searchTerms: ["human", "man", "person", "profile", "user"] + }, { + title: "fab fa-mandalorian", + searchTerms: [] + }, { + title: "fas fa-map", + searchTerms: ["coordinates", "location", "paper", "place", "travel"] + }, { + title: "far fa-map", + searchTerms: ["coordinates", "location", "paper", "place", "travel"] + }, { + title: "fas fa-map-marked", + searchTerms: ["address", "coordinates", "destination", "gps", "localize", "location", "map", "paper", "pin", "place", "point of interest", "position", "route", "travel", "where"] + }, { + title: "fas fa-map-marked-alt", + searchTerms: ["address", "coordinates", "destination", "gps", "localize", "location", "map", "paper", "pin", "place", "point of interest", "position", "route", "travel", "where"] + }, { + title: "fas fa-map-marker", + searchTerms: ["address", "coordinates", "gps", "localize", "location", "map", "pin", "place", "position", "travel", "where"] + }, { + title: "fas fa-map-marker-alt", + searchTerms: ["address", "coordinates", "gps", "localize", "location", "map", "pin", "place", "position", "travel", "where"] + }, { + title: "fas fa-map-pin", + searchTerms: ["address", "coordinates", "gps", "localize", "location", "map", "marker", "place", "position", "travel", "where"] + }, { + title: "fas fa-map-signs", + searchTerms: [] + }, { + title: "fab fa-markdown", + searchTerms: [] + }, { + title: "fas fa-marker", + searchTerms: ["edit", "sharpie", "update", "write"] + }, { + title: "fas fa-mars", + searchTerms: ["male"] + }, { + title: "fas fa-mars-double", + searchTerms: [] + }, { + title: "fas fa-mars-stroke", + searchTerms: [] + }, { + title: "fas fa-mars-stroke-h", + searchTerms: [] + }, { + title: "fas fa-mars-stroke-v", + searchTerms: [] + }, { + title: "fas fa-mask", + searchTerms: ["costume", "disguise", "halloween", "holiday", "secret", "super hero"] + }, { + title: "fab fa-mastodon", + searchTerms: [] + }, { + title: "fab fa-maxcdn", + searchTerms: [] + }, { + title: "fas fa-medal", + searchTerms: [] + }, { + title: "fab fa-medapps", + searchTerms: [] + }, { + title: "fab fa-medium", + searchTerms: [] + }, { + title: "fab fa-medium-m", + searchTerms: [] + }, { + title: "fas fa-medkit", + searchTerms: ["first aid", "firstaid", "health", "help", "support"] + }, { + title: "fab fa-medrt", + searchTerms: [] + }, { + title: "fab fa-meetup", + searchTerms: [] + }, { + title: "fab fa-megaport", + searchTerms: [] + }, { + title: "fas fa-meh", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "far fa-meh", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "fas fa-meh-blank", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "far fa-meh-blank", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "fas fa-meh-rolling-eyes", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "far fa-meh-rolling-eyes", + searchTerms: ["emoticon", "face", "neutral", "rating"] + }, { + title: "fas fa-memory", + searchTerms: ["DIMM", "RAM"] + }, { + title: "fas fa-menorah", + searchTerms: ["candle", "hanukkah", "jewish", "judaism", "light"] + }, { + title: "fas fa-mercury", + searchTerms: ["transgender"] + }, { + title: "fas fa-meteor", + searchTerms: [] + }, { + title: "fas fa-microchip", + searchTerms: ["cpu", "processor"] + }, { + title: "fas fa-microphone", + searchTerms: ["record", "sound", "voice"] + }, { + title: "fas fa-microphone-alt", + searchTerms: ["record", "sound", "voice"] + }, { + title: "fas fa-microphone-alt-slash", + searchTerms: ["disable", "mute", "record", "sound", "voice"] + }, { + title: "fas fa-microphone-slash", + searchTerms: ["disable", "mute", "record", "sound", "voice"] + }, { + title: "fas fa-microscope", + searchTerms: [] + }, { + title: "fab fa-microsoft", + searchTerms: [] + }, { + title: "fas fa-minus", + searchTerms: ["collapse", "delete", "hide", "minify", "negative", "remove", "trash"] + }, { + title: "fas fa-minus-circle", + searchTerms: ["delete", "hide", "negative", "remove", "trash"] + }, { + title: "fas fa-minus-square", + searchTerms: ["collapse", "delete", "hide", "minify", "negative", "remove", "trash"] + }, { + title: "far fa-minus-square", + searchTerms: ["collapse", "delete", "hide", "minify", "negative", "remove", "trash"] + }, { + title: "fab fa-mix", + searchTerms: [] + }, { + title: "fab fa-mixcloud", + searchTerms: [] + }, { + title: "fab fa-mizuni", + searchTerms: [] + }, { + title: "fas fa-mobile", + searchTerms: ["apple", "call", "cell phone", "cellphone", "device", "iphone", "number", "screen", "telephone", "text"] + }, { + title: "fas fa-mobile-alt", + searchTerms: ["apple", "call", "cell phone", "cellphone", "device", "iphone", "number", "screen", "telephone", "text"] + }, { + title: "fab fa-modx", + searchTerms: [] + }, { + title: "fab fa-monero", + searchTerms: [] + }, { + title: "fas fa-money-bill", + searchTerms: ["buy", "cash", "checkout", "money", "payment", "price", "purchase"] + }, { + title: "fas fa-money-bill-alt", + searchTerms: ["buy", "cash", "checkout", "money", "payment", "price", "purchase"] + }, { + title: "far fa-money-bill-alt", + searchTerms: ["buy", "cash", "checkout", "money", "payment", "price", "purchase"] + }, { + title: "fas fa-money-bill-wave", + searchTerms: [] + }, { + title: "fas fa-money-bill-wave-alt", + searchTerms: [] + }, { + title: "fas fa-money-check", + searchTerms: ["bank check", "cheque"] + }, { + title: "fas fa-money-check-alt", + searchTerms: ["bank check", "cheque"] + }, { + title: "fas fa-monument", + searchTerms: ["building", "historic", "memoroable"] + }, { + title: "fas fa-moon", + searchTerms: ["contrast", "crescent", "darker", "lunar", "night"] + }, { + title: "far fa-moon", + searchTerms: ["contrast", "crescent", "darker", "lunar", "night"] + }, { + title: "fas fa-mortar-pestle", + searchTerms: ["crush", "culinary", "grind", "medical", "mix", "spices"] + }, { + title: "fas fa-mosque", + searchTerms: ["building", "islam", "muslim"] + }, { + title: "fas fa-motorcycle", + searchTerms: ["bike", "machine", "transportation", "vehicle"] + }, { + title: "fas fa-mountain", + searchTerms: [] + }, { + title: "fas fa-mouse-pointer", + searchTerms: ["select"] + }, { + title: "fas fa-music", + searchTerms: ["note", "sound"] + }, { + title: "fab fa-napster", + searchTerms: [] + }, { + title: "fab fa-neos", + searchTerms: [] + }, { + title: "fas fa-network-wired", + searchTerms: [] + }, { + title: "fas fa-neuter", + searchTerms: [] + }, { + title: "fas fa-newspaper", + searchTerms: ["article", "press"] + }, { + title: "far fa-newspaper", + searchTerms: ["article", "press"] + }, { + title: "fab fa-nimblr", + searchTerms: [] + }, { + title: "fab fa-nintendo-switch", + searchTerms: [] + }, { + title: "fab fa-node", + searchTerms: [] + }, { + title: "fab fa-node-js", + searchTerms: [] + }, { + title: "fas fa-not-equal", + searchTerms: [] + }, { + title: "fas fa-notes-medical", + searchTerms: [] + }, { + title: "fab fa-npm", + searchTerms: [] + }, { + title: "fab fa-ns8", + searchTerms: [] + }, { + title: "fab fa-nutritionix", + searchTerms: [] + }, { + title: "fas fa-object-group", + searchTerms: ["design"] + }, { + title: "far fa-object-group", + searchTerms: ["design"] + }, { + title: "fas fa-object-ungroup", + searchTerms: ["design"] + }, { + title: "far fa-object-ungroup", + searchTerms: ["design"] + }, { + title: "fab fa-odnoklassniki", + searchTerms: [] + }, { + title: "fab fa-odnoklassniki-square", + searchTerms: [] + }, { + title: "fas fa-oil-can", + searchTerms: [] + }, { + title: "fab fa-old-republic", + searchTerms: ["politics", "star wars"] + }, { + title: "fas fa-om", + searchTerms: ["buddhism", "hinduism", "jainism", "mantra"] + }, { + title: "fab fa-opencart", + searchTerms: [] + }, { + title: "fab fa-openid", + searchTerms: [] + }, { + title: "fab fa-opera", + searchTerms: [] + }, { + title: "fab fa-optin-monster", + searchTerms: [] + }, { + title: "fab fa-osi", + searchTerms: [] + }, { + title: "fas fa-otter", + searchTerms: ["fauna", "mammmal"] + }, { + title: "fas fa-outdent", + searchTerms: [] + }, { + title: "fab fa-page4", + searchTerms: [] + }, { + title: "fab fa-pagelines", + searchTerms: ["eco", "flora", "leaf", "leaves", "nature", "plant", "tree"] + }, { + title: "fas fa-paint-brush", + searchTerms: [] + }, { + title: "fas fa-paint-roller", + searchTerms: ["brush", "painting", "tool"] + }, { + title: "fas fa-palette", + searchTerms: ["colors", "painting"] + }, { + title: "fab fa-palfed", + searchTerms: [] + }, { + title: "fas fa-pallet", + searchTerms: [] + }, { + title: "fas fa-paper-plane", + searchTerms: [] + }, { + title: "far fa-paper-plane", + searchTerms: [] + }, { + title: "fas fa-paperclip", + searchTerms: ["attachment"] + }, { + title: "fas fa-parachute-box", + searchTerms: ["aid", "assistance", "rescue", "supplies"] + }, { + title: "fas fa-paragraph", + searchTerms: [] + }, { + title: "fas fa-parking", + searchTerms: [] + }, { + title: "fas fa-passport", + searchTerms: ["document", "identification", "issued"] + }, { + title: "fas fa-pastafarianism", + searchTerms: ["agnosticism", "atheism", "flying spaghetti monster", "fsm"] + }, { + title: "fas fa-paste", + searchTerms: ["clipboard", "copy"] + }, { + title: "fab fa-patreon", + searchTerms: [] + }, { + title: "fas fa-pause", + searchTerms: ["wait"] + }, { + title: "fas fa-pause-circle", + searchTerms: [] + }, { + title: "far fa-pause-circle", + searchTerms: [] + }, { + title: "fas fa-paw", + searchTerms: ["animal", "pet"] + }, { + title: "fab fa-paypal", + searchTerms: [] + }, { + title: "fas fa-peace", + searchTerms: [] + }, { + title: "fas fa-pen", + searchTerms: ["design", "edit", "update", "write"] + }, { + title: "fas fa-pen-alt", + searchTerms: ["design", "edit", "update", "write"] + }, { + title: "fas fa-pen-fancy", + searchTerms: ["design", "edit", "fountain pen", "update", "write"] + }, { + title: "fas fa-pen-nib", + searchTerms: ["design", "edit", "fountain pen", "update", "write"] + }, { + title: "fas fa-pen-square", + searchTerms: ["edit", "pencil-square", "update", "write"] + }, { + title: "fas fa-pencil-alt", + searchTerms: ["design", "edit", "pencil", "update", "write"] + }, { + title: "fas fa-pencil-ruler", + searchTerms: [] + }, { + title: "fab fa-penny-arcade", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "game", "gaming", "pax", "tabletop"] + }, { + title: "fas fa-people-carry", + searchTerms: ["movers"] + }, { + title: "fas fa-percent", + searchTerms: [] + }, { + title: "fas fa-percentage", + searchTerms: [] + }, { + title: "fab fa-periscope", + searchTerms: [] + }, { + title: "fas fa-person-booth", + searchTerms: ["changing", "changing room", "election", "human", "person", "vote", "voting"] + }, { + title: "fab fa-phabricator", + searchTerms: [] + }, { + title: "fab fa-phoenix-framework", + searchTerms: [] + }, { + title: "fab fa-phoenix-squadron", + searchTerms: [] + }, { + title: "fas fa-phone", + searchTerms: ["call", "earphone", "number", "support", "telephone", "voice"] + }, { + title: "fas fa-phone-slash", + searchTerms: [] + }, { + title: "fas fa-phone-square", + searchTerms: ["call", "number", "support", "telephone", "voice"] + }, { + title: "fas fa-phone-volume", + searchTerms: ["telephone", "volume-control-phone"] + }, { + title: "fab fa-php", + searchTerms: [] + }, { + title: "fab fa-pied-piper", + searchTerms: [] + }, { + title: "fab fa-pied-piper-alt", + searchTerms: [] + }, { + title: "fab fa-pied-piper-hat", + searchTerms: ["clothing"] + }, { + title: "fab fa-pied-piper-pp", + searchTerms: [] + }, { + title: "fas fa-piggy-bank", + searchTerms: ["save", "savings"] + }, { + title: "fas fa-pills", + searchTerms: ["drugs", "medicine"] + }, { + title: "fab fa-pinterest", + searchTerms: [] + }, { + title: "fab fa-pinterest-p", + searchTerms: [] + }, { + title: "fab fa-pinterest-square", + searchTerms: [] + }, { + title: "fas fa-place-of-worship", + searchTerms: [] + }, { + title: "fas fa-plane", + searchTerms: ["airplane", "destination", "fly", "location", "mode", "travel", "trip"] + }, { + title: "fas fa-plane-arrival", + searchTerms: ["airplane", "arriving", "destination", "fly", "land", "landing", "location", "mode", "travel", "trip"] + }, { + title: "fas fa-plane-departure", + searchTerms: ["airplane", "departing", "destination", "fly", "location", "mode", "take off", "taking off", "travel", "trip"] + }, { + title: "fas fa-play", + searchTerms: ["music", "playing", "sound", "start"] + }, { + title: "fas fa-play-circle", + searchTerms: ["playing", "start"] + }, { + title: "far fa-play-circle", + searchTerms: ["playing", "start"] + }, { + title: "fab fa-playstation", + searchTerms: [] + }, { + title: "fas fa-plug", + searchTerms: ["connect", "online", "power"] + }, { + title: "fas fa-plus", + searchTerms: ["add", "create", "expand", "new", "positive"] + }, { + title: "fas fa-plus-circle", + searchTerms: ["add", "create", "expand", "new", "positive"] + }, { + title: "fas fa-plus-square", + searchTerms: ["add", "create", "expand", "new", "positive"] + }, { + title: "far fa-plus-square", + searchTerms: ["add", "create", "expand", "new", "positive"] + }, { + title: "fas fa-podcast", + searchTerms: [] + }, { + title: "fas fa-poll", + searchTerms: ["results", "survey", "vote", "voting"] + }, { + title: "fas fa-poll-h", + searchTerms: ["results", "survey", "vote", "voting"] + }, { + title: "fas fa-poo", + searchTerms: [] + }, { + title: "fas fa-poo-storm", + searchTerms: ["mess", "poop", "shit"] + }, { + title: "fas fa-poop", + searchTerms: [] + }, { + title: "fas fa-portrait", + searchTerms: [] + }, { + title: "fas fa-pound-sign", + searchTerms: ["gbp"] + }, { + title: "fas fa-power-off", + searchTerms: ["on", "reboot", "restart"] + }, { + title: "fas fa-pray", + searchTerms: [] + }, { + title: "fas fa-praying-hands", + searchTerms: [] + }, { + title: "fas fa-prescription", + searchTerms: ["drugs", "medical", "medicine", "rx"] + }, { + title: "fas fa-prescription-bottle", + searchTerms: ["drugs", "medical", "medicine", "rx"] + }, { + title: "fas fa-prescription-bottle-alt", + searchTerms: ["drugs", "medical", "medicine", "rx"] + }, { + title: "fas fa-print", + searchTerms: [] + }, { + title: "fas fa-procedures", + searchTerms: [] + }, { + title: "fab fa-product-hunt", + searchTerms: [] + }, { + title: "fas fa-project-diagram", + searchTerms: [] + }, { + title: "fab fa-pushed", + searchTerms: [] + }, { + title: "fas fa-puzzle-piece", + searchTerms: ["add-on", "addon", "section"] + }, { + title: "fab fa-python", + searchTerms: [] + }, { + title: "fab fa-qq", + searchTerms: [] + }, { + title: "fas fa-qrcode", + searchTerms: ["scan"] + }, { + title: "fas fa-question", + searchTerms: ["help", "information", "support", "unknown"] + }, { + title: "fas fa-question-circle", + searchTerms: ["help", "information", "support", "unknown"] + }, { + title: "far fa-question-circle", + searchTerms: ["help", "information", "support", "unknown"] + }, { + title: "fas fa-quidditch", + searchTerms: [] + }, { + title: "fab fa-quinscape", + searchTerms: [] + }, { + title: "fab fa-quora", + searchTerms: [] + }, { + title: "fas fa-quote-left", + searchTerms: [] + }, { + title: "fas fa-quote-right", + searchTerms: [] + }, { + title: "fas fa-quran", + searchTerms: ["book", "islam", "muslim"] + }, { + title: "fab fa-r-project", + searchTerms: [] + }, { + title: "fas fa-rainbow", + searchTerms: [] + }, { + title: "fas fa-random", + searchTerms: ["shuffle", "sort"] + }, { + title: "fab fa-ravelry", + searchTerms: [] + }, { + title: "fab fa-react", + searchTerms: [] + }, { + title: "fab fa-reacteurope", + searchTerms: [] + }, { + title: "fab fa-readme", + searchTerms: [] + }, { + title: "fab fa-rebel", + searchTerms: [] + }, { + title: "fas fa-receipt", + searchTerms: ["check", "invoice", "table"] + }, { + title: "fas fa-recycle", + searchTerms: [] + }, { + title: "fab fa-red-river", + searchTerms: [] + }, { + title: "fab fa-reddit", + searchTerms: [] + }, { + title: "fab fa-reddit-alien", + searchTerms: [] + }, { + title: "fab fa-reddit-square", + searchTerms: [] + }, { + title: "fas fa-redo", + searchTerms: ["forward", "refresh", "reload", "repeat"] + }, { + title: "fas fa-redo-alt", + searchTerms: ["forward", "refresh", "reload", "repeat"] + }, { + title: "fas fa-registered", + searchTerms: [] + }, { + title: "far fa-registered", + searchTerms: [] + }, { + title: "fab fa-renren", + searchTerms: [] + }, { + title: "fas fa-reply", + searchTerms: [] + }, { + title: "fas fa-reply-all", + searchTerms: [] + }, { + title: "fab fa-replyd", + searchTerms: [] + }, { + title: "fas fa-republican", + searchTerms: ["american", "conservative", "election", "elephant", "politics", "republican party", "right", "right-wing", "usa"] + }, { + title: "fab fa-researchgate", + searchTerms: [] + }, { + title: "fab fa-resolving", + searchTerms: [] + }, { + title: "fas fa-retweet", + searchTerms: ["refresh", "reload", "share", "swap"] + }, { + title: "fab fa-rev", + searchTerms: [] + }, { + title: "fas fa-ribbon", + searchTerms: ["badge", "cause", "lapel", "pin"] + }, { + title: "fas fa-ring", + searchTerms: ["Dungeons & Dragons", "Gollum", "band", "binding", "d&d", "dnd", "fantasy", "jewelry", "precious"] + }, { + title: "fas fa-road", + searchTerms: ["street"] + }, { + title: "fas fa-robot", + searchTerms: [] + }, { + title: "fas fa-rocket", + searchTerms: ["app"] + }, { + title: "fab fa-rocketchat", + searchTerms: [] + }, { + title: "fab fa-rockrms", + searchTerms: [] + }, { + title: "fas fa-route", + searchTerms: [] + }, { + title: "fas fa-rss", + searchTerms: ["blog"] + }, { + title: "fas fa-rss-square", + searchTerms: ["blog", "feed"] + }, { + title: "fas fa-ruble-sign", + searchTerms: ["rub"] + }, { + title: "fas fa-ruler", + searchTerms: [] + }, { + title: "fas fa-ruler-combined", + searchTerms: [] + }, { + title: "fas fa-ruler-horizontal", + searchTerms: [] + }, { + title: "fas fa-ruler-vertical", + searchTerms: [] + }, { + title: "fas fa-running", + searchTerms: ["jog", "sprint"] + }, { + title: "fas fa-rupee-sign", + searchTerms: ["indian", "inr"] + }, { + title: "fas fa-sad-cry", + searchTerms: ["emoticon", "face", "tear", "tears"] + }, { + title: "far fa-sad-cry", + searchTerms: ["emoticon", "face", "tear", "tears"] + }, { + title: "fas fa-sad-tear", + searchTerms: ["emoticon", "face", "tear", "tears"] + }, { + title: "far fa-sad-tear", + searchTerms: ["emoticon", "face", "tear", "tears"] + }, { + title: "fab fa-safari", + searchTerms: ["browser"] + }, { + title: "fab fa-sass", + searchTerms: [] + }, { + title: "fas fa-save", + searchTerms: ["floppy", "floppy-o"] + }, { + title: "far fa-save", + searchTerms: ["floppy", "floppy-o"] + }, { + title: "fab fa-schlix", + searchTerms: [] + }, { + title: "fas fa-school", + searchTerms: [] + }, { + title: "fas fa-screwdriver", + searchTerms: ["admin", "fix", "repair", "settings", "tool"] + }, { + title: "fab fa-scribd", + searchTerms: [] + }, { + title: "fas fa-scroll", + searchTerms: ["Dungeons & Dragons", "announcement", "d&d", "dnd", "fantasy", "paper"] + }, { + title: "fas fa-search", + searchTerms: ["bigger", "enlarge", "magnify", "preview", "zoom"] + }, { + title: "fas fa-search-dollar", + searchTerms: [] + }, { + title: "fas fa-search-location", + searchTerms: [] + }, { + title: "fas fa-search-minus", + searchTerms: ["minify", "negative", "smaller", "zoom", "zoom out"] + }, { + title: "fas fa-search-plus", + searchTerms: ["bigger", "enlarge", "magnify", "positive", "zoom", "zoom in"] + }, { + title: "fab fa-searchengin", + searchTerms: [] + }, { + title: "fas fa-seedling", + searchTerms: [] + }, { + title: "fab fa-sellcast", + searchTerms: ["eercast"] + }, { + title: "fab fa-sellsy", + searchTerms: [] + }, { + title: "fas fa-server", + searchTerms: ["cpu"] + }, { + title: "fab fa-servicestack", + searchTerms: [] + }, { + title: "fas fa-shapes", + searchTerms: ["circle", "square", "triangle"] + }, { + title: "fas fa-share", + searchTerms: [] + }, { + title: "fas fa-share-alt", + searchTerms: [] + }, { + title: "fas fa-share-alt-square", + searchTerms: [] + }, { + title: "fas fa-share-square", + searchTerms: ["send", "social"] + }, { + title: "far fa-share-square", + searchTerms: ["send", "social"] + }, { + title: "fas fa-shekel-sign", + searchTerms: ["ils"] + }, { + title: "fas fa-shield-alt", + searchTerms: ["achievement", "award", "block", "defend", "security", "winner"] + }, { + title: "fas fa-ship", + searchTerms: ["boat", "sea"] + }, { + title: "fas fa-shipping-fast", + searchTerms: [] + }, { + title: "fab fa-shirtsinbulk", + searchTerms: [] + }, { + title: "fas fa-shoe-prints", + searchTerms: ["feet", "footprints", "steps"] + }, { + title: "fas fa-shopping-bag", + searchTerms: [] + }, { + title: "fas fa-shopping-basket", + searchTerms: [] + }, { + title: "fas fa-shopping-cart", + searchTerms: ["buy", "checkout", "payment", "purchase"] + }, { + title: "fab fa-shopware", + searchTerms: [] + }, { + title: "fas fa-shower", + searchTerms: [] + }, { + title: "fas fa-shuttle-van", + searchTerms: ["machine", "public-transportation", "transportation", "vehicle"] + }, { + title: "fas fa-sign", + searchTerms: [] + }, { + title: "fas fa-sign-in-alt", + searchTerms: ["arrow", "enter", "join", "log in", "login", "sign in", "sign up", "sign-in", "signin", "signup"] + }, { + title: "fas fa-sign-language", + searchTerms: [] + }, { + title: "fas fa-sign-out-alt", + searchTerms: ["arrow", "exit", "leave", "log out", "logout", "sign-out"] + }, { + title: "fas fa-signal", + searchTerms: ["bars", "graph", "online", "status"] + }, { + title: "fas fa-signature", + searchTerms: ["John Hancock", "cursive", "name", "writing"] + }, { + title: "fab fa-simplybuilt", + searchTerms: [] + }, { + title: "fab fa-sistrix", + searchTerms: [] + }, { + title: "fas fa-sitemap", + searchTerms: ["directory", "hierarchy", "ia", "information architecture", "organization"] + }, { + title: "fab fa-sith", + searchTerms: [] + }, { + title: "fas fa-skull", + searchTerms: ["bones", "skeleton", "yorick"] + }, { + title: "fas fa-skull-crossbones", + searchTerms: ["Dungeons & Dragons", "alert", "bones", "d&d", "danger", "dead", "deadly", "death", "dnd", "fantasy", "halloween", "holiday", "jolly-roger", "pirate", "poison", "skeleton", "warning"] + }, { + title: "fab fa-skyatlas", + searchTerms: [] + }, { + title: "fab fa-skype", + searchTerms: [] + }, { + title: "fab fa-slack", + searchTerms: ["anchor", "hash", "hashtag"] + }, { + title: "fab fa-slack-hash", + searchTerms: ["anchor", "hash", "hashtag"] + }, { + title: "fas fa-slash", + searchTerms: [] + }, { + title: "fas fa-sliders-h", + searchTerms: ["settings", "sliders"] + }, { + title: "fab fa-slideshare", + searchTerms: [] + }, { + title: "fas fa-smile", + searchTerms: ["approve", "emoticon", "face", "happy", "rating", "satisfied"] + }, { + title: "far fa-smile", + searchTerms: ["approve", "emoticon", "face", "happy", "rating", "satisfied"] + }, { + title: "fas fa-smile-beam", + searchTerms: ["emoticon", "face", "happy", "positive"] + }, { + title: "far fa-smile-beam", + searchTerms: ["emoticon", "face", "happy", "positive"] + }, { + title: "fas fa-smile-wink", + searchTerms: ["emoticon", "face", "happy"] + }, { + title: "far fa-smile-wink", + searchTerms: ["emoticon", "face", "happy"] + }, { + title: "fas fa-smog", + searchTerms: ["dragon"] + }, { + title: "fas fa-smoking", + searchTerms: ["cigarette", "nicotine", "smoking status"] + }, { + title: "fas fa-smoking-ban", + searchTerms: ["no smoking", "non-smoking"] + }, { + title: "fab fa-snapchat", + searchTerms: [] + }, { + title: "fab fa-snapchat-ghost", + searchTerms: [] + }, { + title: "fab fa-snapchat-square", + searchTerms: [] + }, { + title: "fas fa-snowflake", + searchTerms: ["precipitation", "seasonal", "winter"] + }, { + title: "far fa-snowflake", + searchTerms: ["precipitation", "seasonal", "winter"] + }, { + title: "fas fa-socks", + searchTerms: ["business socks", "business time", "flight of the conchords", "wednesday"] + }, { + title: "fas fa-solar-panel", + searchTerms: ["clean", "eco-friendly", "energy", "green", "sun"] + }, { + title: "fas fa-sort", + searchTerms: ["order"] + }, { + title: "fas fa-sort-alpha-down", + searchTerms: ["sort-alpha-asc"] + }, { + title: "fas fa-sort-alpha-up", + searchTerms: ["sort-alpha-desc"] + }, { + title: "fas fa-sort-amount-down", + searchTerms: ["sort-amount-asc"] + }, { + title: "fas fa-sort-amount-up", + searchTerms: ["sort-amount-desc"] + }, { + title: "fas fa-sort-down", + searchTerms: ["arrow", "descending", "sort-desc"] + }, { + title: "fas fa-sort-numeric-down", + searchTerms: ["numbers", "sort-numeric-asc"] + }, { + title: "fas fa-sort-numeric-up", + searchTerms: ["numbers", "sort-numeric-desc"] + }, { + title: "fas fa-sort-up", + searchTerms: ["arrow", "ascending", "sort-asc"] + }, { + title: "fab fa-soundcloud", + searchTerms: [] + }, { + title: "fas fa-spa", + searchTerms: ["flora", "mindfullness", "plant", "wellness"] + }, { + title: "fas fa-space-shuttle", + searchTerms: ["astronaut", "machine", "nasa", "rocket", "transportation"] + }, { + title: "fab fa-speakap", + searchTerms: [] + }, { + title: "fas fa-spider", + searchTerms: ["arachnid", "bug", "charlotte", "crawl", "eight", "halloween", "holiday"] + }, { + title: "fas fa-spinner", + searchTerms: ["loading", "progress"] + }, { + title: "fas fa-splotch", + searchTerms: [] + }, { + title: "fab fa-spotify", + searchTerms: [] + }, { + title: "fas fa-spray-can", + searchTerms: [] + }, { + title: "fas fa-square", + searchTerms: ["block", "box"] + }, { + title: "far fa-square", + searchTerms: ["block", "box"] + }, { + title: "fas fa-square-full", + searchTerms: [] + }, { + title: "fas fa-square-root-alt", + searchTerms: [] + }, { + title: "fab fa-squarespace", + searchTerms: [] + }, { + title: "fab fa-stack-exchange", + searchTerms: [] + }, { + title: "fab fa-stack-overflow", + searchTerms: [] + }, { + title: "fas fa-stamp", + searchTerms: [] + }, { + title: "fas fa-star", + searchTerms: ["achievement", "award", "favorite", "important", "night", "rating", "score"] + }, { + title: "far fa-star", + searchTerms: ["achievement", "award", "favorite", "important", "night", "rating", "score"] + }, { + title: "fas fa-star-and-crescent", + searchTerms: ["islam", "muslim"] + }, { + title: "fas fa-star-half", + searchTerms: ["achievement", "award", "rating", "score", "star-half-empty", "star-half-full"] + }, { + title: "far fa-star-half", + searchTerms: ["achievement", "award", "rating", "score", "star-half-empty", "star-half-full"] + }, { + title: "fas fa-star-half-alt", + searchTerms: ["achievement", "award", "rating", "score", "star-half-empty", "star-half-full"] + }, { + title: "fas fa-star-of-david", + searchTerms: ["jewish", "judaism"] + }, { + title: "fas fa-star-of-life", + searchTerms: [] + }, { + title: "fab fa-staylinked", + searchTerms: [] + }, { + title: "fab fa-steam", + searchTerms: [] + }, { + title: "fab fa-steam-square", + searchTerms: [] + }, { + title: "fab fa-steam-symbol", + searchTerms: [] + }, { + title: "fas fa-step-backward", + searchTerms: ["beginning", "first", "previous", "rewind", "start"] + }, { + title: "fas fa-step-forward", + searchTerms: ["end", "last", "next"] + }, { + title: "fas fa-stethoscope", + searchTerms: [] + }, { + title: "fab fa-sticker-mule", + searchTerms: [] + }, { + title: "fas fa-sticky-note", + searchTerms: [] + }, { + title: "far fa-sticky-note", + searchTerms: [] + }, { + title: "fas fa-stop", + searchTerms: ["block", "box", "square"] + }, { + title: "fas fa-stop-circle", + searchTerms: [] + }, { + title: "far fa-stop-circle", + searchTerms: [] + }, { + title: "fas fa-stopwatch", + searchTerms: ["time"] + }, { + title: "fas fa-store", + searchTerms: [] + }, { + title: "fas fa-store-alt", + searchTerms: [] + }, { + title: "fab fa-strava", + searchTerms: [] + }, { + title: "fas fa-stream", + searchTerms: [] + }, { + title: "fas fa-street-view", + searchTerms: ["map"] + }, { + title: "fas fa-strikethrough", + searchTerms: [] + }, { + title: "fab fa-stripe", + searchTerms: [] + }, { + title: "fab fa-stripe-s", + searchTerms: [] + }, { + title: "fas fa-stroopwafel", + searchTerms: ["dessert", "food", "sweets", "waffle"] + }, { + title: "fab fa-studiovinari", + searchTerms: [] + }, { + title: "fab fa-stumbleupon", + searchTerms: [] + }, { + title: "fab fa-stumbleupon-circle", + searchTerms: [] + }, { + title: "fas fa-subscript", + searchTerms: [] + }, { + title: "fas fa-subway", + searchTerms: ["machine", "railway", "train", "transportation", "vehicle"] + }, { + title: "fas fa-suitcase", + searchTerms: ["baggage", "luggage", "move", "suitcase", "travel", "trip"] + }, { + title: "fas fa-suitcase-rolling", + searchTerms: [] + }, { + title: "fas fa-sun", + searchTerms: ["brighten", "contrast", "day", "lighter", "sol", "solar", "star", "weather"] + }, { + title: "far fa-sun", + searchTerms: ["brighten", "contrast", "day", "lighter", "sol", "solar", "star", "weather"] + }, { + title: "fab fa-superpowers", + searchTerms: [] + }, { + title: "fas fa-superscript", + searchTerms: ["exponential"] + }, { + title: "fab fa-supple", + searchTerms: [] + }, { + title: "fas fa-surprise", + searchTerms: ["emoticon", "face", "shocked"] + }, { + title: "far fa-surprise", + searchTerms: ["emoticon", "face", "shocked"] + }, { + title: "fas fa-swatchbook", + searchTerms: [] + }, { + title: "fas fa-swimmer", + searchTerms: ["athlete", "head", "man", "person", "water"] + }, { + title: "fas fa-swimming-pool", + searchTerms: ["ladder", "recreation", "water"] + }, { + title: "fas fa-synagogue", + searchTerms: ["building", "jewish", "judaism", "star of david", "temple"] + }, { + title: "fas fa-sync", + searchTerms: ["exchange", "refresh", "reload", "rotate", "swap"] + }, { + title: "fas fa-sync-alt", + searchTerms: ["refresh", "reload", "rotate"] + }, { + title: "fas fa-syringe", + searchTerms: ["immunizations", "needle"] + }, { + title: "fas fa-table", + searchTerms: ["data", "excel", "spreadsheet"] + }, { + title: "fas fa-table-tennis", + searchTerms: [] + }, { + title: "fas fa-tablet", + searchTerms: ["apple", "device", "ipad", "kindle", "screen"] + }, { + title: "fas fa-tablet-alt", + searchTerms: ["apple", "device", "ipad", "kindle", "screen"] + }, { + title: "fas fa-tablets", + searchTerms: ["drugs", "medicine"] + }, { + title: "fas fa-tachometer-alt", + searchTerms: ["dashboard", "tachometer"] + }, { + title: "fas fa-tag", + searchTerms: ["label"] + }, { + title: "fas fa-tags", + searchTerms: ["labels"] + }, { + title: "fas fa-tape", + searchTerms: [] + }, { + title: "fas fa-tasks", + searchTerms: ["downloading", "downloads", "loading", "progress", "settings"] + }, { + title: "fas fa-taxi", + searchTerms: ["cab", "cabbie", "car", "car service", "lyft", "machine", "transportation", "uber", "vehicle"] + }, { + title: "fab fa-teamspeak", + searchTerms: [] + }, { + title: "fas fa-teeth", + searchTerms: [] + }, { + title: "fas fa-teeth-open", + searchTerms: [] + }, { + title: "fab fa-telegram", + searchTerms: [] + }, { + title: "fab fa-telegram-plane", + searchTerms: [] + }, { + title: "fas fa-temperature-high", + searchTerms: ["mercury", "thermometer", "warm"] + }, { + title: "fas fa-temperature-low", + searchTerms: ["cool", "mercury", "thermometer"] + }, { + title: "fab fa-tencent-weibo", + searchTerms: [] + }, { + title: "fas fa-terminal", + searchTerms: ["code", "command", "console", "prompt"] + }, { + title: "fas fa-text-height", + searchTerms: [] + }, { + title: "fas fa-text-width", + searchTerms: [] + }, { + title: "fas fa-th", + searchTerms: ["blocks", "boxes", "grid", "squares"] + }, { + title: "fas fa-th-large", + searchTerms: ["blocks", "boxes", "grid", "squares"] + }, { + title: "fas fa-th-list", + searchTerms: ["checklist", "completed", "done", "finished", "ol", "todo", "ul"] + }, { + title: "fab fa-the-red-yeti", + searchTerms: [] + }, { + title: "fas fa-theater-masks", + searchTerms: [] + }, { + title: "fab fa-themeco", + searchTerms: [] + }, { + title: "fab fa-themeisle", + searchTerms: [] + }, { + title: "fas fa-thermometer", + searchTerms: ["mercury", "status", "temperature"] + }, { + title: "fas fa-thermometer-empty", + searchTerms: ["mercury", "status", "temperature"] + }, { + title: "fas fa-thermometer-full", + searchTerms: ["fever", "mercury", "status", "temperature"] + }, { + title: "fas fa-thermometer-half", + searchTerms: ["mercury", "status", "temperature"] + }, { + title: "fas fa-thermometer-quarter", + searchTerms: ["mercury", "status", "temperature"] + }, { + title: "fas fa-thermometer-three-quarters", + searchTerms: ["mercury", "status", "temperature"] + }, { + title: "fab fa-think-peaks", + searchTerms: [] + }, { + title: "fas fa-thumbs-down", + searchTerms: ["disagree", "disapprove", "dislike", "hand", "thumbs-o-down"] + }, { + title: "far fa-thumbs-down", + searchTerms: ["disagree", "disapprove", "dislike", "hand", "thumbs-o-down"] + }, { + title: "fas fa-thumbs-up", + searchTerms: ["agree", "approve", "favorite", "hand", "like", "ok", "okay", "success", "thumbs-o-up", "yes", "you got it dude"] + }, { + title: "far fa-thumbs-up", + searchTerms: ["agree", "approve", "favorite", "hand", "like", "ok", "okay", "success", "thumbs-o-up", "yes", "you got it dude"] + }, { + title: "fas fa-thumbtack", + searchTerms: ["coordinates", "location", "marker", "pin", "thumb-tack"] + }, { + title: "fas fa-ticket-alt", + searchTerms: ["ticket"] + }, { + title: "fas fa-times", + searchTerms: ["close", "cross", "error", "exit", "incorrect", "notice", "notification", "notify", "problem", "wrong", "x"] + }, { + title: "fas fa-times-circle", + searchTerms: ["close", "cross", "exit", "incorrect", "notice", "notification", "notify", "problem", "wrong", "x"] + }, { + title: "far fa-times-circle", + searchTerms: ["close", "cross", "exit", "incorrect", "notice", "notification", "notify", "problem", "wrong", "x"] + }, { + title: "fas fa-tint", + searchTerms: ["drop", "droplet", "raindrop", "waterdrop"] + }, { + title: "fas fa-tint-slash", + searchTerms: [] + }, { + title: "fas fa-tired", + searchTerms: ["emoticon", "face", "grumpy"] + }, { + title: "far fa-tired", + searchTerms: ["emoticon", "face", "grumpy"] + }, { + title: "fas fa-toggle-off", + searchTerms: ["switch"] + }, { + title: "fas fa-toggle-on", + searchTerms: ["switch"] + }, { + title: "fas fa-toilet-paper", + searchTerms: ["bathroom", "halloween", "holiday", "lavatory", "prank", "restroom", "roll"] + }, { + title: "fas fa-toolbox", + searchTerms: ["admin", "container", "fix", "repair", "settings", "tools"] + }, { + title: "fas fa-tooth", + searchTerms: ["bicuspid", "dental", "molar", "mouth", "teeth"] + }, { + title: "fas fa-torah", + searchTerms: ["book", "jewish", "judaism"] + }, { + title: "fas fa-torii-gate", + searchTerms: ["building", "shintoism"] + }, { + title: "fas fa-tractor", + searchTerms: [] + }, { + title: "fab fa-trade-federation", + searchTerms: [] + }, { + title: "fas fa-trademark", + searchTerms: [] + }, { + title: "fas fa-traffic-light", + searchTerms: [] + }, { + title: "fas fa-train", + searchTerms: ["bullet", "locomotive", "railway"] + }, { + title: "fas fa-transgender", + searchTerms: ["intersex"] + }, { + title: "fas fa-transgender-alt", + searchTerms: [] + }, { + title: "fas fa-trash", + searchTerms: ["delete", "garbage", "hide", "remove"] + }, { + title: "fas fa-trash-alt", + searchTerms: ["delete", "garbage", "hide", "remove", "trash", "trash-o"] + }, { + title: "far fa-trash-alt", + searchTerms: ["delete", "garbage", "hide", "remove", "trash", "trash-o"] + }, { + title: "fas fa-tree", + searchTerms: ["bark", "fall", "flora", "forest", "nature", "plant", "seasonal"] + }, { + title: "fab fa-trello", + searchTerms: [] + }, { + title: "fab fa-tripadvisor", + searchTerms: [] + }, { + title: "fas fa-trophy", + searchTerms: ["achievement", "award", "cup", "game", "winner"] + }, { + title: "fas fa-truck", + searchTerms: ["delivery", "shipping"] + }, { + title: "fas fa-truck-loading", + searchTerms: [] + }, { + title: "fas fa-truck-monster", + searchTerms: [] + }, { + title: "fas fa-truck-moving", + searchTerms: [] + }, { + title: "fas fa-truck-pickup", + searchTerms: [] + }, { + title: "fas fa-tshirt", + searchTerms: ["cloth", "clothing"] + }, { + title: "fas fa-tty", + searchTerms: [] + }, { + title: "fab fa-tumblr", + searchTerms: [] + }, { + title: "fab fa-tumblr-square", + searchTerms: [] + }, { + title: "fas fa-tv", + searchTerms: ["computer", "display", "monitor", "television"] + }, { + title: "fab fa-twitch", + searchTerms: [] + }, { + title: "fab fa-twitter", + searchTerms: ["social network", "tweet"] + }, { + title: "fab fa-twitter-square", + searchTerms: ["social network", "tweet"] + }, { + title: "fab fa-typo3", + searchTerms: [] + }, { + title: "fab fa-uber", + searchTerms: [] + }, { + title: "fab fa-uikit", + searchTerms: [] + }, { + title: "fas fa-umbrella", + searchTerms: ["protection", "rain"] + }, { + title: "fas fa-umbrella-beach", + searchTerms: ["protection", "recreation", "sun"] + }, { + title: "fas fa-underline", + searchTerms: [] + }, { + title: "fas fa-undo", + searchTerms: ["back", "control z", "exchange", "oops", "return", "rotate", "swap"] + }, { + title: "fas fa-undo-alt", + searchTerms: ["back", "control z", "exchange", "oops", "return", "swap"] + }, { + title: "fab fa-uniregistry", + searchTerms: [] + }, { + title: "fas fa-universal-access", + searchTerms: [] + }, { + title: "fas fa-university", + searchTerms: ["bank", "institution"] + }, { + title: "fas fa-unlink", + searchTerms: ["chain", "chain-broken", "remove"] + }, { + title: "fas fa-unlock", + searchTerms: ["admin", "lock", "password", "protect"] + }, { + title: "fas fa-unlock-alt", + searchTerms: ["admin", "lock", "password", "protect"] + }, { + title: "fab fa-untappd", + searchTerms: [] + }, { + title: "fas fa-upload", + searchTerms: ["export", "publish"] + }, { + title: "fab fa-usb", + searchTerms: [] + }, { + title: "fas fa-user", + searchTerms: ["account", "avatar", "head", "human", "man", "person", "profile"] + }, { + title: "far fa-user", + searchTerms: ["account", "avatar", "head", "human", "man", "person", "profile"] + }, { + title: "fas fa-user-alt", + searchTerms: ["account", "avatar", "head", "human", "man", "person", "profile"] + }, { + title: "fas fa-user-alt-slash", + searchTerms: [] + }, { + title: "fas fa-user-astronaut", + searchTerms: ["avatar", "clothing", "cosmonaut", "space", "suit"] + }, { + title: "fas fa-user-check", + searchTerms: [] + }, { + title: "fas fa-user-circle", + searchTerms: ["account", "avatar", "head", "human", "man", "person", "profile"] + }, { + title: "far fa-user-circle", + searchTerms: ["account", "avatar", "head", "human", "man", "person", "profile"] + }, { + title: "fas fa-user-clock", + searchTerms: [] + }, { + title: "fas fa-user-cog", + searchTerms: [] + }, { + title: "fas fa-user-edit", + searchTerms: [] + }, { + title: "fas fa-user-friends", + searchTerms: [] + }, { + title: "fas fa-user-graduate", + searchTerms: ["cap", "clothing", "commencement", "gown", "graduation", "student"] + }, { + title: "fas fa-user-injured", + searchTerms: ["cast", "ouch", "sling"] + }, { + title: "fas fa-user-lock", + searchTerms: [] + }, { + title: "fas fa-user-md", + searchTerms: ["doctor", "job", "medical", "nurse", "occupation", "profile"] + }, { + title: "fas fa-user-minus", + searchTerms: ["delete", "negative", "remove"] + }, { + title: "fas fa-user-ninja", + searchTerms: ["assassin", "avatar", "dangerous", "deadly", "sneaky"] + }, { + title: "fas fa-user-plus", + searchTerms: ["positive", "sign up", "signup"] + }, { + title: "fas fa-user-secret", + searchTerms: ["clothing", "coat", "hat", "incognito", "privacy", "spy", "whisper"] + }, { + title: "fas fa-user-shield", + searchTerms: [] + }, { + title: "fas fa-user-slash", + searchTerms: ["ban", "remove"] + }, { + title: "fas fa-user-tag", + searchTerms: [] + }, { + title: "fas fa-user-tie", + searchTerms: ["avatar", "business", "clothing", "formal"] + }, { + title: "fas fa-user-times", + searchTerms: ["archive", "delete", "remove", "x"] + }, { + title: "fas fa-users", + searchTerms: ["people", "persons", "profiles"] + }, { + title: "fas fa-users-cog", + searchTerms: [] + }, { + title: "fab fa-ussunnah", + searchTerms: [] + }, { + title: "fas fa-utensil-spoon", + searchTerms: ["spoon"] + }, { + title: "fas fa-utensils", + searchTerms: ["cutlery", "dinner", "eat", "food", "knife", "restaurant", "spoon"] + }, { + title: "fab fa-vaadin", + searchTerms: [] + }, { + title: "fas fa-vector-square", + searchTerms: ["anchors", "lines", "object"] + }, { + title: "fas fa-venus", + searchTerms: ["female"] + }, { + title: "fas fa-venus-double", + searchTerms: [] + }, { + title: "fas fa-venus-mars", + searchTerms: [] + }, { + title: "fab fa-viacoin", + searchTerms: [] + }, { + title: "fab fa-viadeo", + searchTerms: [] + }, { + title: "fab fa-viadeo-square", + searchTerms: [] + }, { + title: "fas fa-vial", + searchTerms: ["test tube"] + }, { + title: "fas fa-vials", + searchTerms: ["lab results", "test tubes"] + }, { + title: "fab fa-viber", + searchTerms: [] + }, { + title: "fas fa-video", + searchTerms: ["camera", "film", "movie", "record", "video-camera"] + }, { + title: "fas fa-video-slash", + searchTerms: [] + }, { + title: "fas fa-vihara", + searchTerms: ["buddhism", "buddhist", "building", "monastery"] + }, { + title: "fab fa-vimeo", + searchTerms: [] + }, { + title: "fab fa-vimeo-square", + searchTerms: [] + }, { + title: "fab fa-vimeo-v", + searchTerms: ["vimeo"] + }, { + title: "fab fa-vine", + searchTerms: [] + }, { + title: "fab fa-vk", + searchTerms: [] + }, { + title: "fab fa-vnv", + searchTerms: [] + }, { + title: "fas fa-volleyball-ball", + searchTerms: [] + }, { + title: "fas fa-volume-down", + searchTerms: ["audio", "lower", "music", "quieter", "sound", "speaker"] + }, { + title: "fas fa-volume-mute", + searchTerms: [] + }, { + title: "fas fa-volume-off", + searchTerms: ["audio", "music", "mute", "sound"] + }, { + title: "fas fa-volume-up", + searchTerms: ["audio", "higher", "louder", "music", "sound", "speaker"] + }, { + title: "fas fa-vote-yea", + searchTerms: ["accept", "cast", "election", "politics", "positive", "yes"] + }, { + title: "fas fa-vr-cardboard", + searchTerms: ["google", "reality", "virtual"] + }, { + title: "fab fa-vuejs", + searchTerms: [] + }, { + title: "fas fa-walking", + searchTerms: [] + }, { + title: "fas fa-wallet", + searchTerms: [] + }, { + title: "fas fa-warehouse", + searchTerms: [] + }, { + title: "fas fa-water", + searchTerms: [] + }, { + title: "fab fa-weebly", + searchTerms: [] + }, { + title: "fab fa-weibo", + searchTerms: [] + }, { + title: "fas fa-weight", + searchTerms: ["measurement", "scale", "weight"] + }, { + title: "fas fa-weight-hanging", + searchTerms: ["anvil", "heavy", "measurement"] + }, { + title: "fab fa-weixin", + searchTerms: [] + }, { + title: "fab fa-whatsapp", + searchTerms: [] + }, { + title: "fab fa-whatsapp-square", + searchTerms: [] + }, { + title: "fas fa-wheelchair", + searchTerms: ["handicap", "person"] + }, { + title: "fab fa-whmcs", + searchTerms: [] + }, { + title: "fas fa-wifi", + searchTerms: [] + }, { + title: "fab fa-wikipedia-w", + searchTerms: [] + }, { + title: "fas fa-wind", + searchTerms: ["air", "blow", "breeze", "fall", "seasonal"] + }, { + title: "fas fa-window-close", + searchTerms: [] + }, { + title: "far fa-window-close", + searchTerms: [] + }, { + title: "fas fa-window-maximize", + searchTerms: [] + }, { + title: "far fa-window-maximize", + searchTerms: [] + }, { + title: "fas fa-window-minimize", + searchTerms: [] + }, { + title: "far fa-window-minimize", + searchTerms: [] + }, { + title: "fas fa-window-restore", + searchTerms: [] + }, { + title: "far fa-window-restore", + searchTerms: [] + }, { + title: "fab fa-windows", + searchTerms: ["microsoft"] + }, { + title: "fas fa-wine-bottle", + searchTerms: ["alcohol", "beverage", "drink", "glass", "grapes"] + }, { + title: "fas fa-wine-glass", + searchTerms: ["alcohol", "beverage", "drink", "grapes"] + }, { + title: "fas fa-wine-glass-alt", + searchTerms: ["alcohol", "beverage", "drink", "grapes"] + }, { + title: "fab fa-wix", + searchTerms: [] + }, { + title: "fab fa-wizards-of-the-coast", + searchTerms: ["Dungeons & Dragons", "d&d", "dnd", "fantasy", "game", "gaming", "tabletop"] + }, { + title: "fab fa-wolf-pack-battalion", + searchTerms: [] + }, { + title: "fas fa-won-sign", + searchTerms: ["krw"] + }, { + title: "fab fa-wordpress", + searchTerms: [] + }, { + title: "fab fa-wordpress-simple", + searchTerms: [] + }, { + title: "fab fa-wpbeginner", + searchTerms: [] + }, { + title: "fab fa-wpexplorer", + searchTerms: [] + }, { + title: "fab fa-wpforms", + searchTerms: [] + }, { + title: "fab fa-wpressr", + searchTerms: ["rendact"] + }, { + title: "fas fa-wrench", + searchTerms: ["fix", "settings", "spanner", "tool", "update"] + }, { + title: "fas fa-x-ray", + searchTerms: ["radiological images", "radiology"] + }, { + title: "fab fa-xbox", + searchTerms: [] + }, { + title: "fab fa-xing", + searchTerms: [] + }, { + title: "fab fa-xing-square", + searchTerms: [] + }, { + title: "fab fa-y-combinator", + searchTerms: [] + }, { + title: "fab fa-yahoo", + searchTerms: [] + }, { + title: "fab fa-yandex", + searchTerms: [] + }, { + title: "fab fa-yandex-international", + searchTerms: [] + }, { + title: "fab fa-yelp", + searchTerms: [] + }, { + title: "fas fa-yen-sign", + searchTerms: ["jpy", "money"] + }, { + title: "fas fa-yin-yang", + searchTerms: ["daoism", "opposites", "taoism"] + }, { + title: "fab fa-yoast", + searchTerms: [] + }, { + title: "fab fa-youtube", + searchTerms: ["film", "video", "youtube-play", "youtube-square"] + }, { + title: "fab fa-youtube-square", + searchTerms: [] + }, { + title: "fab fa-zhihu", + searchTerms: [] + }] + }); +}); +// a wrapper around https://github.com/farbelous/fontawesome-iconpicker +// It makes easier to use a single picker instance with several input fields. +// How to use it: Call show() from outside , passing it the id's of the input fields you want the icon classes applied to. + +var iconPickerVue = new Vue({ + el: '#iconPickerVue', + data: { + targetInputField: '', + targetIconTag: '', + iconPickerModal: null + }, + mounted: function mounted() { + var self = this; + $('.icp-auto').iconpicker({ + title: false, + templates: { + search: '' // just to leave empty the placeholder because it is not localized + } + }); + $('#inline-picker').on('iconpickerSelected', function (e) { + var selected = e.iconpickerInstance.options.fullClassFormatter(e.iconpickerValue); + if (self.targetInputField) { + $('#' + self.targetInputField).val(selected); + } + if (self.targetIconTag) { + // We need to replace the full tag with the new class. + // We could simply apply the new selected class to the i element. + // But there is an issue: when the previous class is not a valid fa icon the icon does not refresh. + $('#' + self.targetIconTag).replaceWith(''); + } + if (self.iconPickerModal != null) { + self.iconPickerModal.hide(); + } + }); + }, + methods: { + show: function show(targetInputField, targetIconTag) { + this.targetInputField = targetInputField; + this.targetIconTag = targetIconTag; + if (this.iconPickerModal == null) { + this.iconPickerModal = new bootstrap.Modal($("#iconPickerModal"), { + keyboard: false + }); + } + this.iconPickerModal.show(); } -}) + } +}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.min.js b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.min.js index 2116268192b..69f9898a78f 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.min.js +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.min.js @@ -1 +1,9 @@ -var iconPickerVue=new Vue({el:"#iconPickerVue",data:{targetInputField:"",targetIconTag:"",iconPickerModal:null},mounted:function(){var e=this;$(".icp-auto").iconpicker({title:!1,templates:{search:''}}),$("#inline-picker").on("iconpickerSelected",function(i){var t=i.iconpickerInstance.options.fullClassFormatter(i.iconpickerValue);e.targetInputField&&$("#"+e.targetInputField).val(t),e.targetIconTag&&$("#"+e.targetIconTag).replaceWith(''),null!=e.iconPickerModal&&e.iconPickerModal.hide()})},methods:{show:function(e,i){this.targetInputField=e,this.targetIconTag=i,null==this.iconPickerModal&&(this.iconPickerModal=new bootstrap.Modal($("#iconPickerModal"),{keyboard:!1})),this.iconPickerModal.show()}}}); \ No newline at end of file +function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e) +/*! + * Font Awesome Icon Picker + * https://farbelous.github.io/fontawesome-iconpicker/ + * + * @author Javi Aguilar, itsjavi.com + * @license MIT License + * @see https://github.com/farbelous/fontawesome-iconpicker/blob/master/LICENSE + */}!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}((function(e){e.ui=e.ui||{};e.ui.version="1.12.1";!function(){var a,t=Math.max,s=Math.abs,r=/left|center|right/,i=/top|center|bottom/,c=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,l=/%$/,o=e.fn.pos;function n(e,a,t){return[parseFloat(e[0])*(l.test(e[0])?a/100:1),parseFloat(e[1])*(l.test(e[1])?t/100:1)]}function h(a,t){return parseInt(e.css(a,t),10)||0}e.pos={scrollbarWidth:function(){if(void 0!==a)return a;var t,s,r=e("
"),i=r.children()[0];return e("body").append(r),t=i.offsetWidth,r.css("overflow","scroll"),t===(s=i.offsetWidth)&&(s=r[0].clientWidth),r.remove(),a=t-s},getScrollInfo:function(a){var t=a.isWindow||a.isDocument?"":a.element.css("overflow-x"),s=a.isWindow||a.isDocument?"":a.element.css("overflow-y"),r="scroll"===t||"auto"===t&&a.width0?"right":"center",vertical:n<0?"top":l>0?"bottom":"middle"};mt(s(l),s(n))?h.important="horizontal":h.important="vertical",a.using.call(this,e,h)}),c.offset(e.extend(C,{using:i}))}))},e.ui.pos={_trigger:function(e,a,t,s){a.elem&&a.elem.trigger({type:t,position:e,positionData:a,triggered:s})},fit:{left:function(a,s){e.ui.pos._trigger(a,s,"posCollide","fitLeft");var r,i=s.within,c=i.isWindow?i.scrollLeft:i.offset.left,f=i.width,l=a.left-s.collisionPosition.marginLeft,o=c-l,n=l+s.collisionWidth-f-c;s.collisionWidth>f?o>0&&n<=0?(r=a.left+o+s.collisionWidth-f-c,a.left+=o-r):a.left=n>0&&o<=0?c:o>n?c+f-s.collisionWidth:c:o>0?a.left+=o:n>0?a.left-=n:a.left=t(a.left-l,a.left),e.ui.pos._trigger(a,s,"posCollided","fitLeft")},top:function(a,s){e.ui.pos._trigger(a,s,"posCollide","fitTop");var r,i=s.within,c=i.isWindow?i.scrollTop:i.offset.top,f=s.within.height,l=a.top-s.collisionPosition.marginTop,o=c-l,n=l+s.collisionHeight-f-c;s.collisionHeight>f?o>0&&n<=0?(r=a.top+o+s.collisionHeight-f-c,a.top+=o-r):a.top=n>0&&o<=0?c:o>n?c+f-s.collisionHeight:c:o>0?a.top+=o:n>0?a.top-=n:a.top=t(a.top-l,a.top),e.ui.pos._trigger(a,s,"posCollided","fitTop")}},flip:{left:function(a,t){e.ui.pos._trigger(a,t,"posCollide","flipLeft");var r,i,c=t.within,f=c.offset.left+c.scrollLeft,l=c.width,o=c.isWindow?c.scrollLeft:c.offset.left,n=a.left-t.collisionPosition.marginLeft,h=n-o,m=n+t.collisionWidth-l-o,p="left"===t.my[0]?-t.elemWidth:"right"===t.my[0]?t.elemWidth:0,d="left"===t.at[0]?t.targetWidth:"right"===t.at[0]?-t.targetWidth:0,T=-2*t.offset[0];h<0?((r=a.left+p+d+T+t.collisionWidth-l-f)<0||r0&&((i=a.left-t.collisionPosition.marginLeft+p+d+T-o)>0||s(i)0&&((r=a.top-t.collisionPosition.marginTop+p+d+T-o)>0||s(r)10&&r<11,a.innerHTML="",t.removeChild(a)}()}();e.ui.position})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):window.jQuery&&!window.jQuery.fn.iconpicker&&e(window.jQuery)}((function(e){"use strict";var a=function(e){return!1===e||""===e||null==e},t=function(a){return e(a).length>0},s=function(e){return"string"==typeof e||e instanceof String},r=function(a,t){return-1!==e.inArray(a,t)},i=function(a,s){this._id=i._idCounter++,this.element=e(a).addClass("iconpicker-element"),this._trigger("iconpickerCreate",{iconpickerValue:this.iconpickerValue}),this.options=e.extend({},i.defaultOptions,this.element.data(),s),this.options.templates=e.extend({},i.defaultOptions.templates,this.options.templates),this.options.originalPlacement=this.options.placement,this.container=!!t(this.options.container)&&e(this.options.container),!1===this.container&&(this.element.is(".dropdown-toggle")?this.container=e("~ .dropdown-menu:first",this.element):this.container=this.element.is("input,textarea,button,.btn")?this.element.parent():this.element),this.container.addClass("iconpicker-container"),this.isDropdownMenu()&&(this.options.placement="inline"),this.input=!!this.element.is("input,textarea")&&this.element.addClass("iconpicker-input"),!1===this.input&&(this.input=this.container.find(this.options.input),this.input.is("input,textarea")||(this.input=!1)),this.component=this.isDropdownMenu()?this.container.parent().find(this.options.component):this.container.find(this.options.component),0===this.component.length?this.component=!1:this.component.find("i").addClass("iconpicker-component"),this._createPopover(),this._createIconpicker(),0===this.getAcceptButton().length&&(this.options.mustAccept=!1),this.isInputGroup()?this.container.parent().append(this.popover):this.container.append(this.popover),this._bindElementEvents(),this._bindWindowEvents(),this.update(this.options.selected),this.isInline()&&this.show(),this._trigger("iconpickerCreated",{iconpickerValue:this.iconpickerValue})};i._idCounter=0,i.defaultOptions={title:!1,selected:!1,defaultValue:!1,placement:"bottom",collision:"none",animation:!0,hideOnSelect:!1,showFooter:!1,searchInFooter:!1,mustAccept:!1,selectedCustomClass:"bg-primary",icons:[],fullClassFormatter:function(e){return e},input:"input,.iconpicker-input",inputSearch:!1,container:!1,component:".input-group-addon,.iconpicker-component",templates:{popover:'
',footer:'',buttons:' ',search:'',iconpicker:'
',iconpickerItem:''}},i.batch=function(a,t){var s=Array.prototype.slice.call(arguments,2);return e(a).each((function(){var a=e(this).data("iconpicker");a&&a[t].apply(a,s)}))},i.prototype={constructor:i,options:{},_id:0,_trigger:function(a,t){t=t||{},this.element.trigger(e.extend({type:a,iconpickerInstance:this},t))},_createPopover:function(){this.popover=e(this.options.templates.popover);var t=this.popover.find(".popover-title");if(this.options.title&&t.append(e('
'+this.options.title+"
")),this.hasSeparatedSearchInput()&&!this.options.searchInFooter?t.append(this.options.templates.search):this.options.title||t.remove(),this.options.showFooter&&!a(this.options.templates.footer)){var s=e(this.options.templates.footer);this.hasSeparatedSearchInput()&&this.options.searchInFooter&&s.append(e(this.options.templates.search)),a(this.options.templates.buttons)||s.append(e(this.options.templates.buttons)),this.popover.append(s)}return!0===this.options.animation&&this.popover.addClass("fade"),this.popover},_createIconpicker:function(){var a=this;this.iconpicker=e(this.options.templates.iconpicker);var t=function(t){var s=e(this);s.is("i")&&(s=s.parent()),a._trigger("iconpickerSelect",{iconpickerItem:s,iconpickerValue:a.iconpickerValue}),!1===a.options.mustAccept?(a.update(s.data("iconpickerValue")),a._trigger("iconpickerSelected",{iconpickerItem:this,iconpickerValue:a.iconpickerValue})):a.update(s.data("iconpickerValue"),!0),a.options.hideOnSelect&&!1===a.options.mustAccept&&a.hide()},s=e(this.options.templates.iconpickerItem),r=[];for(var i in this.options.icons)if("string"==typeof this.options.icons[i].title){var c=s.clone();if(c.find("i").addClass(this.options.fullClassFormatter(this.options.icons[i].title)),c.data("iconpickerValue",this.options.icons[i].title).on("click.iconpicker",t),c.attr("title","."+this.options.icons[i].title),this.options.icons[i].searchTerms.length>0){for(var f="",l=0;l0?e.attr("class",this.options.fullClassFormatter(this.iconpickerValue)):this.component.html(this.getHtml())}},_updateFormGroupStatus:function(e){return!!this.hasInput()&&(!1!==e?this.input.parents(".form-group:first").removeClass("has-error"):this.input.parents(".form-group:first").addClass("has-error"),!0)},getValid:function(a){s(a)||(a="");var t=""===a;a=e.trim(a);for(var r=!1,i=0;i'},setSourceValue:function(e){return!1!==(e=this.setValue(e))&&""!==e&&(this.hasInput()?this.input.val(this.iconpickerValue):this.element.data("iconpickerValue",this.iconpickerValue),this._trigger("iconpickerSetSourceValue",{iconpickerValue:e})),e},getSourceValue:function(e){var a=e=e||this.options.defaultValue;return void 0!==(a=this.hasInput()?this.input.val():this.element.data("iconpickerValue"))&&""!==a&&null!==a&&!1!==a||(a=e),a},hasInput:function(){return!1!==this.input},isInputSearch:function(){return this.hasInput()&&!0===this.options.inputSearch},isInputGroup:function(){return this.container.is(".input-group")},isDropdownMenu:function(){return this.container.is(".dropdown-menu")},hasSeparatedSearchInput:function(){return!1!==this.options.templates.search&&!this.isInputSearch()},hasComponent:function(){return!1!==this.component},hasContainer:function(){return!1!==this.container},getAcceptButton:function(){return this.popover.find(".iconpicker-btn-accept")},getCancelButton:function(){return this.popover.find(".iconpicker-btn-cancel")},getSearchInput:function(){return this.popover.find(".iconpicker-search")},filter:function(t){if(a(t))return this.iconpicker.find(".iconpicker-item").show(),e(!1);var s=[];return this.iconpicker.find(".iconpicker-item").each((function(){var a=e(this),r=a.attr("title").toLowerCase();r=r+" "+(a.attr("data-search-terms")?a.attr("data-search-terms").toLowerCase():"");var i=!1;try{i=new RegExp("(^|\\W)"+t,"g")}catch(a){i=!1}!1!==i&&r.match(i)?(s.push(a),a.show()):a.hide()})),s},show:function(){if(this.popover.hasClass("in"))return!1;e.iconpicker.batch(e(".iconpicker-popover.in:not(.inline)").not(this.popover),"hide"),this._trigger("iconpickerShow",{iconpickerValue:this.iconpickerValue}),this.updatePlacement(),this.popover.addClass("in"),setTimeout(e.proxy((function(){this.popover.css("display",this.isInline()?"":"block"),this._trigger("iconpickerShown",{iconpickerValue:this.iconpickerValue})}),this),this.options.animation?300:1)},hide:function(){if(!this.popover.hasClass("in"))return!1;this._trigger("iconpickerHide",{iconpickerValue:this.iconpickerValue}),this.popover.removeClass("in"),setTimeout(e.proxy((function(){this.popover.css("display","none"),this.getSearchInput().val(""),this.filter(""),this._trigger("iconpickerHidden",{iconpickerValue:this.iconpickerValue})}),this),this.options.animation?300:1)},toggle:function(){this.popover.is(":visible")?this.hide():this.show(!0)},update:function(e,a){return e=e||this.getSourceValue(this.iconpickerValue),this._trigger("iconpickerUpdate",{iconpickerValue:this.iconpickerValue}),!0===a?e=this.setValue(e):(e=this.setSourceValue(e),this._updateFormGroupStatus(!1!==e)),!1!==e&&this._updateComponents(),this._trigger("iconpickerUpdated",{iconpickerValue:this.iconpickerValue}),e},destroy:function(){this._trigger("iconpickerDestroy",{iconpickerValue:this.iconpickerValue}),this.element.removeData("iconpicker").removeData("iconpickerValue").removeClass("iconpicker-element"),this._unbindElementEvents(),this._unbindWindowEvents(),e(this.popover).remove(),this._trigger("iconpickerDestroyed",{iconpickerValue:this.iconpickerValue})},disable:function(){return!!this.hasInput()&&(this.input.prop("disabled",!0),!0)},enable:function(){return!!this.hasInput()&&(this.input.prop("disabled",!1),!0)},isDisabled:function(){return!!this.hasInput()&&!0===this.input.prop("disabled")},isInline:function(){return"inline"===this.options.placement||this.popover.hasClass("inline")}},e.iconpicker=i,e.fn.iconpicker=function(a){return this.each((function(){var t=e(this);t.data("iconpicker")||t.data("iconpicker",new i(this,"object"===_typeof(a)?a:{}))}))},i.defaultOptions=e.extend(i.defaultOptions,{icons:[{title:"fab fa-500px",searchTerms:[]},{title:"fab fa-accessible-icon",searchTerms:["accessibility","handicap","person","wheelchair","wheelchair-alt"]},{title:"fab fa-accusoft",searchTerms:[]},{title:"fab fa-acquisitions-incorporated",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","game","gaming","tabletop"]},{title:"fas fa-ad",searchTerms:[]},{title:"fas fa-address-book",searchTerms:[]},{title:"far fa-address-book",searchTerms:[]},{title:"fas fa-address-card",searchTerms:[]},{title:"far fa-address-card",searchTerms:[]},{title:"fas fa-adjust",searchTerms:["contrast"]},{title:"fab fa-adn",searchTerms:[]},{title:"fab fa-adversal",searchTerms:[]},{title:"fab fa-affiliatetheme",searchTerms:[]},{title:"fas fa-air-freshener",searchTerms:[]},{title:"fab fa-algolia",searchTerms:[]},{title:"fas fa-align-center",searchTerms:["middle","text"]},{title:"fas fa-align-justify",searchTerms:["text"]},{title:"fas fa-align-left",searchTerms:["text"]},{title:"fas fa-align-right",searchTerms:["text"]},{title:"fab fa-alipay",searchTerms:[]},{title:"fas fa-allergies",searchTerms:["freckles","hand","intolerances","pox","spots"]},{title:"fab fa-amazon",searchTerms:[]},{title:"fab fa-amazon-pay",searchTerms:[]},{title:"fas fa-ambulance",searchTerms:["help","machine","support","vehicle"]},{title:"fas fa-american-sign-language-interpreting",searchTerms:[]},{title:"fab fa-amilia",searchTerms:[]},{title:"fas fa-anchor",searchTerms:["link"]},{title:"fab fa-android",searchTerms:["robot"]},{title:"fab fa-angellist",searchTerms:[]},{title:"fas fa-angle-double-down",searchTerms:["arrows"]},{title:"fas fa-angle-double-left",searchTerms:["arrows","back","laquo","previous","quote"]},{title:"fas fa-angle-double-right",searchTerms:["arrows","forward","next","quote","raquo"]},{title:"fas fa-angle-double-up",searchTerms:["arrows"]},{title:"fas fa-angle-down",searchTerms:["arrow"]},{title:"fas fa-angle-left",searchTerms:["arrow","back","previous"]},{title:"fas fa-angle-right",searchTerms:["arrow","forward","next"]},{title:"fas fa-angle-up",searchTerms:["arrow"]},{title:"fas fa-angry",searchTerms:["disapprove","emoticon","face","mad","upset"]},{title:"far fa-angry",searchTerms:["disapprove","emoticon","face","mad","upset"]},{title:"fab fa-angrycreative",searchTerms:[]},{title:"fab fa-angular",searchTerms:[]},{title:"fas fa-ankh",searchTerms:["amulet","copper","coptic christianity","copts","crux ansata","egyptian","venus"]},{title:"fab fa-app-store",searchTerms:[]},{title:"fab fa-app-store-ios",searchTerms:[]},{title:"fab fa-apper",searchTerms:[]},{title:"fab fa-apple",searchTerms:["food","fruit","mac","osx"]},{title:"fas fa-apple-alt",searchTerms:["fall","food","fruit","fuji","macintosh","seasonal"]},{title:"fab fa-apple-pay",searchTerms:[]},{title:"fas fa-archive",searchTerms:["box","package","storage"]},{title:"fas fa-archway",searchTerms:["arc","monument","road","street"]},{title:"fas fa-arrow-alt-circle-down",searchTerms:["arrow-circle-o-down","download"]},{title:"far fa-arrow-alt-circle-down",searchTerms:["arrow-circle-o-down","download"]},{title:"fas fa-arrow-alt-circle-left",searchTerms:["arrow-circle-o-left","back","previous"]},{title:"far fa-arrow-alt-circle-left",searchTerms:["arrow-circle-o-left","back","previous"]},{title:"fas fa-arrow-alt-circle-right",searchTerms:["arrow-circle-o-right","forward","next"]},{title:"far fa-arrow-alt-circle-right",searchTerms:["arrow-circle-o-right","forward","next"]},{title:"fas fa-arrow-alt-circle-up",searchTerms:["arrow-circle-o-up"]},{title:"far fa-arrow-alt-circle-up",searchTerms:["arrow-circle-o-up"]},{title:"fas fa-arrow-circle-down",searchTerms:["download"]},{title:"fas fa-arrow-circle-left",searchTerms:["back","previous"]},{title:"fas fa-arrow-circle-right",searchTerms:["forward","next"]},{title:"fas fa-arrow-circle-up",searchTerms:[]},{title:"fas fa-arrow-down",searchTerms:["download"]},{title:"fas fa-arrow-left",searchTerms:["back","previous"]},{title:"fas fa-arrow-right",searchTerms:["forward","next"]},{title:"fas fa-arrow-up",searchTerms:[]},{title:"fas fa-arrows-alt",searchTerms:["arrow","arrows","bigger","enlarge","expand","fullscreen","move","position","reorder","resize"]},{title:"fas fa-arrows-alt-h",searchTerms:["arrows-h","resize"]},{title:"fas fa-arrows-alt-v",searchTerms:["arrows-v","resize"]},{title:"fas fa-assistive-listening-systems",searchTerms:[]},{title:"fas fa-asterisk",searchTerms:["details"]},{title:"fab fa-asymmetrik",searchTerms:[]},{title:"fas fa-at",searchTerms:["e-mail","email"]},{title:"fas fa-atlas",searchTerms:["book","directions","geography","map","wayfinding"]},{title:"fas fa-atom",searchTerms:["atheism","chemistry","science"]},{title:"fab fa-audible",searchTerms:[]},{title:"fas fa-audio-description",searchTerms:[]},{title:"fab fa-autoprefixer",searchTerms:[]},{title:"fab fa-avianex",searchTerms:[]},{title:"fab fa-aviato",searchTerms:[]},{title:"fas fa-award",searchTerms:["honor","praise","prize","recognition","ribbon"]},{title:"fab fa-aws",searchTerms:[]},{title:"fas fa-backspace",searchTerms:["command","delete","keyboard","undo"]},{title:"fas fa-backward",searchTerms:["previous","rewind"]},{title:"fas fa-balance-scale",searchTerms:["balanced","justice","legal","measure","weight"]},{title:"fas fa-ban",searchTerms:["abort","ban","block","cancel","delete","hide","prohibit","remove","stop","trash"]},{title:"fas fa-band-aid",searchTerms:["bandage","boo boo","ouch"]},{title:"fab fa-bandcamp",searchTerms:[]},{title:"fas fa-barcode",searchTerms:["scan"]},{title:"fas fa-bars",searchTerms:["checklist","drag","hamburger","list","menu","nav","navigation","ol","reorder","settings","todo","ul"]},{title:"fas fa-baseball-ball",searchTerms:[]},{title:"fas fa-basketball-ball",searchTerms:[]},{title:"fas fa-bath",searchTerms:[]},{title:"fas fa-battery-empty",searchTerms:["power","status"]},{title:"fas fa-battery-full",searchTerms:["power","status"]},{title:"fas fa-battery-half",searchTerms:["power","status"]},{title:"fas fa-battery-quarter",searchTerms:["power","status"]},{title:"fas fa-battery-three-quarters",searchTerms:["power","status"]},{title:"fas fa-bed",searchTerms:["lodging","sleep","travel"]},{title:"fas fa-beer",searchTerms:["alcohol","bar","beverage","drink","liquor","mug","stein"]},{title:"fab fa-behance",searchTerms:[]},{title:"fab fa-behance-square",searchTerms:[]},{title:"fas fa-bell",searchTerms:["alert","notification","reminder"]},{title:"far fa-bell",searchTerms:["alert","notification","reminder"]},{title:"fas fa-bell-slash",searchTerms:[]},{title:"far fa-bell-slash",searchTerms:[]},{title:"fas fa-bezier-curve",searchTerms:["curves","illustrator","lines","path","vector"]},{title:"fas fa-bible",searchTerms:["book","catholicism","christianity"]},{title:"fas fa-bicycle",searchTerms:["bike","gears","transportation","vehicle"]},{title:"fab fa-bimobject",searchTerms:[]},{title:"fas fa-binoculars",searchTerms:[]},{title:"fas fa-birthday-cake",searchTerms:[]},{title:"fab fa-bitbucket",searchTerms:["bitbucket-square","git"]},{title:"fab fa-bitcoin",searchTerms:[]},{title:"fab fa-bity",searchTerms:[]},{title:"fab fa-black-tie",searchTerms:[]},{title:"fab fa-blackberry",searchTerms:[]},{title:"fas fa-blender",searchTerms:[]},{title:"fas fa-blender-phone",searchTerms:["appliance","fantasy","silly"]},{title:"fas fa-blind",searchTerms:[]},{title:"fab fa-blogger",searchTerms:[]},{title:"fab fa-blogger-b",searchTerms:[]},{title:"fab fa-bluetooth",searchTerms:[]},{title:"fab fa-bluetooth-b",searchTerms:[]},{title:"fas fa-bold",searchTerms:[]},{title:"fas fa-bolt",searchTerms:["electricity","lightning","weather","zap"]},{title:"fas fa-bomb",searchTerms:[]},{title:"fas fa-bone",searchTerms:[]},{title:"fas fa-bong",searchTerms:["aparatus","cannabis","marijuana","pipe","smoke","smoking"]},{title:"fas fa-book",searchTerms:["documentation","read"]},{title:"fas fa-book-dead",searchTerms:["Dungeons & Dragons","crossbones","d&d","dark arts","death","dnd","documentation","evil","fantasy","halloween","holiday","read","skull","spell"]},{title:"fas fa-book-open",searchTerms:["flyer","notebook","open book","pamphlet","reading"]},{title:"fas fa-book-reader",searchTerms:["library"]},{title:"fas fa-bookmark",searchTerms:["save"]},{title:"far fa-bookmark",searchTerms:["save"]},{title:"fas fa-bowling-ball",searchTerms:[]},{title:"fas fa-box",searchTerms:["package"]},{title:"fas fa-box-open",searchTerms:[]},{title:"fas fa-boxes",searchTerms:[]},{title:"fas fa-braille",searchTerms:[]},{title:"fas fa-brain",searchTerms:["cerebellum","gray matter","intellect","medulla oblongata","mind","noodle","wit"]},{title:"fas fa-briefcase",searchTerms:["bag","business","luggage","office","work"]},{title:"fas fa-briefcase-medical",searchTerms:["health briefcase"]},{title:"fas fa-broadcast-tower",searchTerms:["airwaves","radio","waves"]},{title:"fas fa-broom",searchTerms:["clean","firebolt","fly","halloween","holiday","nimbus 2000","quidditch","sweep","witch"]},{title:"fas fa-brush",searchTerms:["bristles","color","handle","painting"]},{title:"fab fa-btc",searchTerms:[]},{title:"fas fa-bug",searchTerms:["insect","report"]},{title:"fas fa-building",searchTerms:["apartment","business","company","office","work"]},{title:"far fa-building",searchTerms:["apartment","business","company","office","work"]},{title:"fas fa-bullhorn",searchTerms:["announcement","broadcast","louder","megaphone","share"]},{title:"fas fa-bullseye",searchTerms:["target"]},{title:"fas fa-burn",searchTerms:["energy"]},{title:"fab fa-buromobelexperte",searchTerms:[]},{title:"fas fa-bus",searchTerms:["machine","public transportation","transportation","vehicle"]},{title:"fas fa-bus-alt",searchTerms:["machine","public transportation","transportation","vehicle"]},{title:"fas fa-business-time",searchTerms:["briefcase","business socks","clock","flight of the conchords","wednesday"]},{title:"fab fa-buysellads",searchTerms:[]},{title:"fas fa-calculator",searchTerms:[]},{title:"fas fa-calendar",searchTerms:["calendar-o","date","event","schedule","time","when"]},{title:"far fa-calendar",searchTerms:["calendar-o","date","event","schedule","time","when"]},{title:"fas fa-calendar-alt",searchTerms:["calendar","date","event","schedule","time","when"]},{title:"far fa-calendar-alt",searchTerms:["calendar","date","event","schedule","time","when"]},{title:"fas fa-calendar-check",searchTerms:["accept","agree","appointment","confirm","correct","done","ok","select","success","todo"]},{title:"far fa-calendar-check",searchTerms:["accept","agree","appointment","confirm","correct","done","ok","select","success","todo"]},{title:"fas fa-calendar-minus",searchTerms:["delete","negative","remove"]},{title:"far fa-calendar-minus",searchTerms:["delete","negative","remove"]},{title:"fas fa-calendar-plus",searchTerms:["add","create","new","positive"]},{title:"far fa-calendar-plus",searchTerms:["add","create","new","positive"]},{title:"fas fa-calendar-times",searchTerms:["archive","delete","remove","x"]},{title:"far fa-calendar-times",searchTerms:["archive","delete","remove","x"]},{title:"fas fa-camera",searchTerms:["photo","picture","record"]},{title:"fas fa-camera-retro",searchTerms:["photo","picture","record"]},{title:"fas fa-campground",searchTerms:["camping","fall","outdoors","seasonal","tent"]},{title:"fas fa-cannabis",searchTerms:["bud","chronic","drugs","endica","endo","ganja","marijuana","mary jane","pot","reefer","sativa","spliff","weed","whacky-tabacky"]},{title:"fas fa-capsules",searchTerms:["drugs","medicine"]},{title:"fas fa-car",searchTerms:["machine","transportation","vehicle"]},{title:"fas fa-car-alt",searchTerms:[]},{title:"fas fa-car-battery",searchTerms:[]},{title:"fas fa-car-crash",searchTerms:[]},{title:"fas fa-car-side",searchTerms:[]},{title:"fas fa-caret-down",searchTerms:["arrow","dropdown","menu","more","triangle down"]},{title:"fas fa-caret-left",searchTerms:["arrow","back","previous","triangle left"]},{title:"fas fa-caret-right",searchTerms:["arrow","forward","next","triangle right"]},{title:"fas fa-caret-square-down",searchTerms:["caret-square-o-down","dropdown","menu","more"]},{title:"far fa-caret-square-down",searchTerms:["caret-square-o-down","dropdown","menu","more"]},{title:"fas fa-caret-square-left",searchTerms:["back","caret-square-o-left","previous"]},{title:"far fa-caret-square-left",searchTerms:["back","caret-square-o-left","previous"]},{title:"fas fa-caret-square-right",searchTerms:["caret-square-o-right","forward","next"]},{title:"far fa-caret-square-right",searchTerms:["caret-square-o-right","forward","next"]},{title:"fas fa-caret-square-up",searchTerms:["caret-square-o-up"]},{title:"far fa-caret-square-up",searchTerms:["caret-square-o-up"]},{title:"fas fa-caret-up",searchTerms:["arrow","triangle up"]},{title:"fas fa-cart-arrow-down",searchTerms:["shopping"]},{title:"fas fa-cart-plus",searchTerms:["add","create","new","positive","shopping"]},{title:"fas fa-cat",searchTerms:["feline","halloween","holiday","kitten","kitty","meow","pet"]},{title:"fab fa-cc-amazon-pay",searchTerms:[]},{title:"fab fa-cc-amex",searchTerms:["amex"]},{title:"fab fa-cc-apple-pay",searchTerms:[]},{title:"fab fa-cc-diners-club",searchTerms:[]},{title:"fab fa-cc-discover",searchTerms:[]},{title:"fab fa-cc-jcb",searchTerms:[]},{title:"fab fa-cc-mastercard",searchTerms:[]},{title:"fab fa-cc-paypal",searchTerms:[]},{title:"fab fa-cc-stripe",searchTerms:[]},{title:"fab fa-cc-visa",searchTerms:[]},{title:"fab fa-centercode",searchTerms:[]},{title:"fas fa-certificate",searchTerms:["badge","star"]},{title:"fas fa-chair",searchTerms:["furniture","seat"]},{title:"fas fa-chalkboard",searchTerms:["blackboard","learning","school","teaching","whiteboard","writing"]},{title:"fas fa-chalkboard-teacher",searchTerms:["blackboard","instructor","learning","professor","school","whiteboard","writing"]},{title:"fas fa-charging-station",searchTerms:[]},{title:"fas fa-chart-area",searchTerms:["analytics","area-chart","graph"]},{title:"fas fa-chart-bar",searchTerms:["analytics","bar-chart","graph"]},{title:"far fa-chart-bar",searchTerms:["analytics","bar-chart","graph"]},{title:"fas fa-chart-line",searchTerms:["activity","analytics","dashboard","graph","line-chart"]},{title:"fas fa-chart-pie",searchTerms:["analytics","graph","pie-chart"]},{title:"fas fa-check",searchTerms:["accept","agree","checkmark","confirm","correct","done","notice","notification","notify","ok","select","success","tick","todo","yes"]},{title:"fas fa-check-circle",searchTerms:["accept","agree","confirm","correct","done","ok","select","success","todo","yes"]},{title:"far fa-check-circle",searchTerms:["accept","agree","confirm","correct","done","ok","select","success","todo","yes"]},{title:"fas fa-check-double",searchTerms:["accept","agree","checkmark","confirm","correct","done","notice","notification","notify","ok","select","success","tick","todo"]},{title:"fas fa-check-square",searchTerms:["accept","agree","checkmark","confirm","correct","done","ok","select","success","todo","yes"]},{title:"far fa-check-square",searchTerms:["accept","agree","checkmark","confirm","correct","done","ok","select","success","todo","yes"]},{title:"fas fa-chess",searchTerms:[]},{title:"fas fa-chess-bishop",searchTerms:[]},{title:"fas fa-chess-board",searchTerms:[]},{title:"fas fa-chess-king",searchTerms:[]},{title:"fas fa-chess-knight",searchTerms:[]},{title:"fas fa-chess-pawn",searchTerms:[]},{title:"fas fa-chess-queen",searchTerms:[]},{title:"fas fa-chess-rook",searchTerms:[]},{title:"fas fa-chevron-circle-down",searchTerms:["arrow","dropdown","menu","more"]},{title:"fas fa-chevron-circle-left",searchTerms:["arrow","back","previous"]},{title:"fas fa-chevron-circle-right",searchTerms:["arrow","forward","next"]},{title:"fas fa-chevron-circle-up",searchTerms:["arrow"]},{title:"fas fa-chevron-down",searchTerms:[]},{title:"fas fa-chevron-left",searchTerms:["back","bracket","previous"]},{title:"fas fa-chevron-right",searchTerms:["bracket","forward","next"]},{title:"fas fa-chevron-up",searchTerms:[]},{title:"fas fa-child",searchTerms:[]},{title:"fab fa-chrome",searchTerms:["browser"]},{title:"fas fa-church",searchTerms:["building","community","religion"]},{title:"fas fa-circle",searchTerms:["circle-thin","dot","notification"]},{title:"far fa-circle",searchTerms:["circle-thin","dot","notification"]},{title:"fas fa-circle-notch",searchTerms:["circle-o-notch"]},{title:"fas fa-city",searchTerms:["buildings","busy","skyscrapers","urban","windows"]},{title:"fas fa-clipboard",searchTerms:["paste"]},{title:"far fa-clipboard",searchTerms:["paste"]},{title:"fas fa-clipboard-check",searchTerms:["accept","agree","confirm","done","ok","select","success","todo","yes"]},{title:"fas fa-clipboard-list",searchTerms:["checklist","completed","done","finished","intinerary","ol","schedule","todo","ul"]},{title:"fas fa-clock",searchTerms:["date","late","schedule","timer","timestamp","watch"]},{title:"far fa-clock",searchTerms:["date","late","schedule","timer","timestamp","watch"]},{title:"fas fa-clone",searchTerms:["copy","duplicate"]},{title:"far fa-clone",searchTerms:["copy","duplicate"]},{title:"fas fa-closed-captioning",searchTerms:["cc"]},{title:"far fa-closed-captioning",searchTerms:["cc"]},{title:"fas fa-cloud",searchTerms:["save"]},{title:"fas fa-cloud-download-alt",searchTerms:["import"]},{title:"fas fa-cloud-meatball",searchTerms:[]},{title:"fas fa-cloud-moon",searchTerms:["crescent","evening","halloween","holiday","lunar","night","sky"]},{title:"fas fa-cloud-moon-rain",searchTerms:[]},{title:"fas fa-cloud-rain",searchTerms:["precipitation"]},{title:"fas fa-cloud-showers-heavy",searchTerms:["precipitation","rain","storm"]},{title:"fas fa-cloud-sun",searchTerms:["day","daytime","fall","outdoors","seasonal"]},{title:"fas fa-cloud-sun-rain",searchTerms:[]},{title:"fas fa-cloud-upload-alt",searchTerms:["cloud-upload"]},{title:"fab fa-cloudscale",searchTerms:[]},{title:"fab fa-cloudsmith",searchTerms:[]},{title:"fab fa-cloudversify",searchTerms:[]},{title:"fas fa-cocktail",searchTerms:["alcohol","beverage","drink"]},{title:"fas fa-code",searchTerms:["brackets","html"]},{title:"fas fa-code-branch",searchTerms:["branch","code-fork","fork","git","github","rebase","svn","vcs","version"]},{title:"fab fa-codepen",searchTerms:[]},{title:"fab fa-codiepie",searchTerms:[]},{title:"fas fa-coffee",searchTerms:["beverage","breakfast","cafe","drink","fall","morning","mug","seasonal","tea"]},{title:"fas fa-cog",searchTerms:["settings"]},{title:"fas fa-cogs",searchTerms:["gears","settings"]},{title:"fas fa-coins",searchTerms:[]},{title:"fas fa-columns",searchTerms:["dashboard","panes","split"]},{title:"fas fa-comment",searchTerms:["bubble","chat","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"far fa-comment",searchTerms:["bubble","chat","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"fas fa-comment-alt",searchTerms:["bubble","chat","commenting","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"far fa-comment-alt",searchTerms:["bubble","chat","commenting","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"fas fa-comment-dollar",searchTerms:[]},{title:"fas fa-comment-dots",searchTerms:[]},{title:"far fa-comment-dots",searchTerms:[]},{title:"fas fa-comment-slash",searchTerms:[]},{title:"fas fa-comments",searchTerms:["bubble","chat","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"far fa-comments",searchTerms:["bubble","chat","conversation","feedback","message","note","notification","sms","speech","texting"]},{title:"fas fa-comments-dollar",searchTerms:[]},{title:"fas fa-compact-disc",searchTerms:["bluray","cd","disc","media"]},{title:"fas fa-compass",searchTerms:["directory","location","menu","safari"]},{title:"far fa-compass",searchTerms:["directory","location","menu","safari"]},{title:"fas fa-compress",searchTerms:["collapse","combine","contract","merge","smaller"]},{title:"fas fa-concierge-bell",searchTerms:["attention","hotel","service","support"]},{title:"fab fa-connectdevelop",searchTerms:[]},{title:"fab fa-contao",searchTerms:[]},{title:"fas fa-cookie",searchTerms:["baked good","chips","food","snack","sweet","treat"]},{title:"fas fa-cookie-bite",searchTerms:["baked good","bitten","chips","eating","food","snack","sweet","treat"]},{title:"fas fa-copy",searchTerms:["clone","duplicate","file","files-o"]},{title:"far fa-copy",searchTerms:["clone","duplicate","file","files-o"]},{title:"fas fa-copyright",searchTerms:[]},{title:"far fa-copyright",searchTerms:[]},{title:"fas fa-couch",searchTerms:["furniture","sofa"]},{title:"fab fa-cpanel",searchTerms:[]},{title:"fab fa-creative-commons",searchTerms:[]},{title:"fab fa-creative-commons-by",searchTerms:[]},{title:"fab fa-creative-commons-nc",searchTerms:[]},{title:"fab fa-creative-commons-nc-eu",searchTerms:[]},{title:"fab fa-creative-commons-nc-jp",searchTerms:[]},{title:"fab fa-creative-commons-nd",searchTerms:[]},{title:"fab fa-creative-commons-pd",searchTerms:[]},{title:"fab fa-creative-commons-pd-alt",searchTerms:[]},{title:"fab fa-creative-commons-remix",searchTerms:[]},{title:"fab fa-creative-commons-sa",searchTerms:[]},{title:"fab fa-creative-commons-sampling",searchTerms:[]},{title:"fab fa-creative-commons-sampling-plus",searchTerms:[]},{title:"fab fa-creative-commons-share",searchTerms:[]},{title:"fab fa-creative-commons-zero",searchTerms:[]},{title:"fas fa-credit-card",searchTerms:["buy","checkout","credit-card-alt","debit","money","payment","purchase"]},{title:"far fa-credit-card",searchTerms:["buy","checkout","credit-card-alt","debit","money","payment","purchase"]},{title:"fab fa-critical-role",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","game","gaming","tabletop"]},{title:"fas fa-crop",searchTerms:["design"]},{title:"fas fa-crop-alt",searchTerms:[]},{title:"fas fa-cross",searchTerms:["catholicism","christianity"]},{title:"fas fa-crosshairs",searchTerms:["gpd","picker","position"]},{title:"fas fa-crow",searchTerms:["bird","bullfrog","fauna","halloween","holiday","toad"]},{title:"fas fa-crown",searchTerms:[]},{title:"fab fa-css3",searchTerms:["code"]},{title:"fab fa-css3-alt",searchTerms:[]},{title:"fas fa-cube",searchTerms:["package"]},{title:"fas fa-cubes",searchTerms:["packages"]},{title:"fas fa-cut",searchTerms:["scissors"]},{title:"fab fa-cuttlefish",searchTerms:[]},{title:"fab fa-d-and-d",searchTerms:[]},{title:"fab fa-d-and-d-beyond",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","gaming","tabletop"]},{title:"fab fa-dashcube",searchTerms:[]},{title:"fas fa-database",searchTerms:[]},{title:"fas fa-deaf",searchTerms:[]},{title:"fab fa-delicious",searchTerms:[]},{title:"fas fa-democrat",searchTerms:["american","democratic party","donkey","election","left","left-wing","liberal","politics","usa"]},{title:"fab fa-deploydog",searchTerms:[]},{title:"fab fa-deskpro",searchTerms:[]},{title:"fas fa-desktop",searchTerms:["computer","cpu","demo","desktop","device","machine","monitor","pc","screen"]},{title:"fab fa-dev",searchTerms:[]},{title:"fab fa-deviantart",searchTerms:[]},{title:"fas fa-dharmachakra",searchTerms:["buddhism","buddhist","wheel of dharma"]},{title:"fas fa-diagnoses",searchTerms:[]},{title:"fas fa-dice",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-d20",searchTerms:["Dungeons & Dragons","chance","d&d","dnd","fantasy","gambling","game","roll"]},{title:"fas fa-dice-d6",searchTerms:["Dungeons & Dragons","chance","d&d","dnd","fantasy","gambling","game","roll"]},{title:"fas fa-dice-five",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-four",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-one",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-six",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-three",searchTerms:["chance","gambling","game","roll"]},{title:"fas fa-dice-two",searchTerms:["chance","gambling","game","roll"]},{title:"fab fa-digg",searchTerms:[]},{title:"fab fa-digital-ocean",searchTerms:[]},{title:"fas fa-digital-tachograph",searchTerms:[]},{title:"fas fa-directions",searchTerms:[]},{title:"fab fa-discord",searchTerms:[]},{title:"fab fa-discourse",searchTerms:[]},{title:"fas fa-divide",searchTerms:[]},{title:"fas fa-dizzy",searchTerms:["dazed","disapprove","emoticon","face"]},{title:"far fa-dizzy",searchTerms:["dazed","disapprove","emoticon","face"]},{title:"fas fa-dna",searchTerms:["double helix","helix"]},{title:"fab fa-dochub",searchTerms:[]},{title:"fab fa-docker",searchTerms:[]},{title:"fas fa-dog",searchTerms:["canine","fauna","mammmal","pet","pooch","puppy","woof"]},{title:"fas fa-dollar-sign",searchTerms:["$","dollar-sign","money","price","usd"]},{title:"fas fa-dolly",searchTerms:[]},{title:"fas fa-dolly-flatbed",searchTerms:[]},{title:"fas fa-donate",searchTerms:["generosity","give"]},{title:"fas fa-door-closed",searchTerms:[]},{title:"fas fa-door-open",searchTerms:[]},{title:"fas fa-dot-circle",searchTerms:["bullseye","notification","target"]},{title:"far fa-dot-circle",searchTerms:["bullseye","notification","target"]},{title:"fas fa-dove",searchTerms:["bird","fauna","flying","peace"]},{title:"fas fa-download",searchTerms:["import"]},{title:"fab fa-draft2digital",searchTerms:[]},{title:"fas fa-drafting-compass",searchTerms:["mechanical drawing","plot","plotting"]},{title:"fas fa-dragon",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy"]},{title:"fas fa-draw-polygon",searchTerms:[]},{title:"fab fa-dribbble",searchTerms:[]},{title:"fab fa-dribbble-square",searchTerms:[]},{title:"fab fa-dropbox",searchTerms:[]},{title:"fas fa-drum",searchTerms:["instrument","music","percussion","snare","sound"]},{title:"fas fa-drum-steelpan",searchTerms:["calypso","instrument","music","percussion","reggae","snare","sound","steel","tropical"]},{title:"fas fa-drumstick-bite",searchTerms:[]},{title:"fab fa-drupal",searchTerms:[]},{title:"fas fa-dumbbell",searchTerms:["exercise","gym","strength","weight","weight-lifting"]},{title:"fas fa-dungeon",searchTerms:["Dungeons & Dragons","d&d","dnd","door","entrance","fantasy","gate"]},{title:"fab fa-dyalog",searchTerms:[]},{title:"fab fa-earlybirds",searchTerms:[]},{title:"fab fa-ebay",searchTerms:[]},{title:"fab fa-edge",searchTerms:["browser","ie"]},{title:"fas fa-edit",searchTerms:["edit","pen","pencil","update","write"]},{title:"far fa-edit",searchTerms:["edit","pen","pencil","update","write"]},{title:"fas fa-eject",searchTerms:[]},{title:"fab fa-elementor",searchTerms:[]},{title:"fas fa-ellipsis-h",searchTerms:["dots","drag","kebab","list","menu","nav","navigation","ol","reorder","settings","ul"]},{title:"fas fa-ellipsis-v",searchTerms:["dots","drag","kebab","list","menu","nav","navigation","ol","reorder","settings","ul"]},{title:"fab fa-ello",searchTerms:[]},{title:"fab fa-ember",searchTerms:[]},{title:"fab fa-empire",searchTerms:[]},{title:"fas fa-envelope",searchTerms:["e-mail","email","letter","mail","message","notification","support"]},{title:"far fa-envelope",searchTerms:["e-mail","email","letter","mail","message","notification","support"]},{title:"fas fa-envelope-open",searchTerms:["e-mail","email","letter","mail","message","notification","support"]},{title:"far fa-envelope-open",searchTerms:["e-mail","email","letter","mail","message","notification","support"]},{title:"fas fa-envelope-open-text",searchTerms:[]},{title:"fas fa-envelope-square",searchTerms:["e-mail","email","letter","mail","message","notification","support"]},{title:"fab fa-envira",searchTerms:["leaf"]},{title:"fas fa-equals",searchTerms:[]},{title:"fas fa-eraser",searchTerms:["delete","remove"]},{title:"fab fa-erlang",searchTerms:[]},{title:"fab fa-ethereum",searchTerms:[]},{title:"fab fa-etsy",searchTerms:[]},{title:"fas fa-euro-sign",searchTerms:["eur"]},{title:"fas fa-exchange-alt",searchTerms:["arrow","arrows","exchange","reciprocate","return","swap","transfer"]},{title:"fas fa-exclamation",searchTerms:["alert","danger","error","important","notice","notification","notify","problem","warning"]},{title:"fas fa-exclamation-circle",searchTerms:["alert","danger","error","important","notice","notification","notify","problem","warning"]},{title:"fas fa-exclamation-triangle",searchTerms:["alert","danger","error","important","notice","notification","notify","problem","warning"]},{title:"fas fa-expand",searchTerms:["bigger","enlarge","resize"]},{title:"fas fa-expand-arrows-alt",searchTerms:["arrows-alt","bigger","enlarge","move","resize"]},{title:"fab fa-expeditedssl",searchTerms:[]},{title:"fas fa-external-link-alt",searchTerms:["external-link","new","open"]},{title:"fas fa-external-link-square-alt",searchTerms:["external-link-square","new","open"]},{title:"fas fa-eye",searchTerms:["optic","see","seen","show","sight","views","visible"]},{title:"far fa-eye",searchTerms:["optic","see","seen","show","sight","views","visible"]},{title:"fas fa-eye-dropper",searchTerms:["eyedropper"]},{title:"fas fa-eye-slash",searchTerms:["blind","hide","show","toggle","unseen","views","visible","visiblity"]},{title:"far fa-eye-slash",searchTerms:["blind","hide","show","toggle","unseen","views","visible","visiblity"]},{title:"fab fa-facebook",searchTerms:["facebook-official","social network"]},{title:"fab fa-facebook-f",searchTerms:["facebook"]},{title:"fab fa-facebook-messenger",searchTerms:[]},{title:"fab fa-facebook-square",searchTerms:["social network"]},{title:"fab fa-fantasy-flight-games",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","game","gaming","tabletop"]},{title:"fas fa-fast-backward",searchTerms:["beginning","first","previous","rewind","start"]},{title:"fas fa-fast-forward",searchTerms:["end","last","next"]},{title:"fas fa-fax",searchTerms:[]},{title:"fas fa-feather",searchTerms:["bird","light","plucked","quill"]},{title:"fas fa-feather-alt",searchTerms:["bird","light","plucked","quill"]},{title:"fas fa-female",searchTerms:["human","person","profile","user","woman"]},{title:"fas fa-fighter-jet",searchTerms:["airplane","fast","fly","goose","maverick","plane","quick","top gun","transportation","travel"]},{title:"fas fa-file",searchTerms:["document","new","page","pdf","resume"]},{title:"far fa-file",searchTerms:["document","new","page","pdf","resume"]},{title:"fas fa-file-alt",searchTerms:["document","file-text","invoice","new","page","pdf"]},{title:"far fa-file-alt",searchTerms:["document","file-text","invoice","new","page","pdf"]},{title:"fas fa-file-archive",searchTerms:[".zip","bundle","compress","compression","download","zip"]},{title:"far fa-file-archive",searchTerms:[".zip","bundle","compress","compression","download","zip"]},{title:"fas fa-file-audio",searchTerms:[]},{title:"far fa-file-audio",searchTerms:[]},{title:"fas fa-file-code",searchTerms:[]},{title:"far fa-file-code",searchTerms:[]},{title:"fas fa-file-contract",searchTerms:["agreement","binding","document","legal","signature"]},{title:"fas fa-file-csv",searchTerms:["spreadsheets"]},{title:"fas fa-file-download",searchTerms:[]},{title:"fas fa-file-excel",searchTerms:[]},{title:"far fa-file-excel",searchTerms:[]},{title:"fas fa-file-export",searchTerms:[]},{title:"fas fa-file-image",searchTerms:[]},{title:"far fa-file-image",searchTerms:[]},{title:"fas fa-file-import",searchTerms:[]},{title:"fas fa-file-invoice",searchTerms:["bill","document","receipt"]},{title:"fas fa-file-invoice-dollar",searchTerms:["$","bill","document","dollar-sign","money","receipt","usd"]},{title:"fas fa-file-medical",searchTerms:[]},{title:"fas fa-file-medical-alt",searchTerms:[]},{title:"fas fa-file-pdf",searchTerms:[]},{title:"far fa-file-pdf",searchTerms:[]},{title:"fas fa-file-powerpoint",searchTerms:[]},{title:"far fa-file-powerpoint",searchTerms:[]},{title:"fas fa-file-prescription",searchTerms:["drugs","medical","medicine","rx"]},{title:"fas fa-file-signature",searchTerms:["John Hancock","contract","document","name"]},{title:"fas fa-file-upload",searchTerms:[]},{title:"fas fa-file-video",searchTerms:[]},{title:"far fa-file-video",searchTerms:[]},{title:"fas fa-file-word",searchTerms:[]},{title:"far fa-file-word",searchTerms:[]},{title:"fas fa-fill",searchTerms:["bucket","color","paint","paint bucket"]},{title:"fas fa-fill-drip",searchTerms:["bucket","color","drop","paint","paint bucket","spill"]},{title:"fas fa-film",searchTerms:["movie"]},{title:"fas fa-filter",searchTerms:["funnel","options"]},{title:"fas fa-fingerprint",searchTerms:["human","id","identification","lock","smudge","touch","unique","unlock"]},{title:"fas fa-fire",searchTerms:["caliente","flame","heat","hot","popular"]},{title:"fas fa-fire-extinguisher",searchTerms:[]},{title:"fab fa-firefox",searchTerms:["browser"]},{title:"fas fa-first-aid",searchTerms:[]},{title:"fab fa-first-order",searchTerms:[]},{title:"fab fa-first-order-alt",searchTerms:[]},{title:"fab fa-firstdraft",searchTerms:[]},{title:"fas fa-fish",searchTerms:["fauna","gold","swimming"]},{title:"fas fa-fist-raised",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","hand","ki","monk","resist","strength","unarmed combat"]},{title:"fas fa-flag",searchTerms:["country","notice","notification","notify","pole","report","symbol"]},{title:"far fa-flag",searchTerms:["country","notice","notification","notify","pole","report","symbol"]},{title:"fas fa-flag-checkered",searchTerms:["notice","notification","notify","pole","racing","report","symbol"]},{title:"fas fa-flag-usa",searchTerms:["betsy ross","country","old glory","stars","stripes","symbol"]},{title:"fas fa-flask",searchTerms:["beaker","experimental","labs","science"]},{title:"fab fa-flickr",searchTerms:[]},{title:"fab fa-flipboard",searchTerms:[]},{title:"fas fa-flushed",searchTerms:["embarrassed","emoticon","face"]},{title:"far fa-flushed",searchTerms:["embarrassed","emoticon","face"]},{title:"fab fa-fly",searchTerms:[]},{title:"fas fa-folder",searchTerms:[]},{title:"far fa-folder",searchTerms:[]},{title:"fas fa-folder-minus",searchTerms:["archive","delete","negative","remove"]},{title:"fas fa-folder-open",searchTerms:[]},{title:"far fa-folder-open",searchTerms:[]},{title:"fas fa-folder-plus",searchTerms:["add","create","new","positive"]},{title:"fas fa-font",searchTerms:["text"]},{title:"fab fa-font-awesome",searchTerms:["meanpath"]},{title:"fab fa-font-awesome-alt",searchTerms:[]},{title:"fab fa-font-awesome-flag",searchTerms:[]},{title:"far fa-font-awesome-logo-full",searchTerms:[]},{title:"fas fa-font-awesome-logo-full",searchTerms:[]},{title:"fab fa-font-awesome-logo-full",searchTerms:[]},{title:"fab fa-fonticons",searchTerms:[]},{title:"fab fa-fonticons-fi",searchTerms:[]},{title:"fas fa-football-ball",searchTerms:["fall","pigskin","seasonal"]},{title:"fab fa-fort-awesome",searchTerms:["castle"]},{title:"fab fa-fort-awesome-alt",searchTerms:["castle"]},{title:"fab fa-forumbee",searchTerms:[]},{title:"fas fa-forward",searchTerms:["forward","next"]},{title:"fab fa-foursquare",searchTerms:[]},{title:"fab fa-free-code-camp",searchTerms:[]},{title:"fab fa-freebsd",searchTerms:[]},{title:"fas fa-frog",searchTerms:["amphibian","bullfrog","fauna","hop","kermit","kiss","prince","ribbit","toad","wart"]},{title:"fas fa-frown",searchTerms:["disapprove","emoticon","face","rating","sad"]},{title:"far fa-frown",searchTerms:["disapprove","emoticon","face","rating","sad"]},{title:"fas fa-frown-open",searchTerms:["disapprove","emoticon","face","rating","sad"]},{title:"far fa-frown-open",searchTerms:["disapprove","emoticon","face","rating","sad"]},{title:"fab fa-fulcrum",searchTerms:[]},{title:"fas fa-funnel-dollar",searchTerms:[]},{title:"fas fa-futbol",searchTerms:["ball","football","soccer"]},{title:"far fa-futbol",searchTerms:["ball","football","soccer"]},{title:"fab fa-galactic-republic",searchTerms:["politics","star wars"]},{title:"fab fa-galactic-senate",searchTerms:["star wars"]},{title:"fas fa-gamepad",searchTerms:["controller"]},{title:"fas fa-gas-pump",searchTerms:[]},{title:"fas fa-gavel",searchTerms:["hammer","judge","lawyer","opinion"]},{title:"fas fa-gem",searchTerms:["diamond"]},{title:"far fa-gem",searchTerms:["diamond"]},{title:"fas fa-genderless",searchTerms:[]},{title:"fab fa-get-pocket",searchTerms:[]},{title:"fab fa-gg",searchTerms:[]},{title:"fab fa-gg-circle",searchTerms:[]},{title:"fas fa-ghost",searchTerms:["apparition","blinky","clyde","floating","halloween","holiday","inky","pinky","spirit"]},{title:"fas fa-gift",searchTerms:["generosity","giving","party","present","wrapped"]},{title:"fab fa-git",searchTerms:[]},{title:"fab fa-git-square",searchTerms:[]},{title:"fab fa-github",searchTerms:["octocat"]},{title:"fab fa-github-alt",searchTerms:["octocat"]},{title:"fab fa-github-square",searchTerms:["octocat"]},{title:"fab fa-gitkraken",searchTerms:[]},{title:"fab fa-gitlab",searchTerms:["Axosoft"]},{title:"fab fa-gitter",searchTerms:[]},{title:"fas fa-glass-martini",searchTerms:["alcohol","bar","beverage","drink","glass","liquor","martini"]},{title:"fas fa-glass-martini-alt",searchTerms:[]},{title:"fas fa-glasses",searchTerms:["foureyes","hipster","nerd","reading","sight","spectacles"]},{title:"fab fa-glide",searchTerms:[]},{title:"fab fa-glide-g",searchTerms:[]},{title:"fas fa-globe",searchTerms:["all","coordinates","country","earth","global","gps","language","localize","location","map","online","place","planet","translate","travel","world"]},{title:"fas fa-globe-africa",searchTerms:["all","country","earth","global","gps","language","localize","location","map","online","place","planet","translate","travel","world"]},{title:"fas fa-globe-americas",searchTerms:["all","country","earth","global","gps","language","localize","location","map","online","place","planet","translate","travel","world"]},{title:"fas fa-globe-asia",searchTerms:["all","country","earth","global","gps","language","localize","location","map","online","place","planet","translate","travel","world"]},{title:"fab fa-gofore",searchTerms:[]},{title:"fas fa-golf-ball",searchTerms:[]},{title:"fab fa-goodreads",searchTerms:[]},{title:"fab fa-goodreads-g",searchTerms:[]},{title:"fab fa-google",searchTerms:[]},{title:"fab fa-google-drive",searchTerms:[]},{title:"fab fa-google-play",searchTerms:[]},{title:"fab fa-google-plus",searchTerms:["google-plus-circle","google-plus-official"]},{title:"fab fa-google-plus-g",searchTerms:["google-plus","social network"]},{title:"fab fa-google-plus-square",searchTerms:["social network"]},{title:"fab fa-google-wallet",searchTerms:[]},{title:"fas fa-gopuram",searchTerms:["building","entrance","hinduism","temple","tower"]},{title:"fas fa-graduation-cap",searchTerms:["learning","school","student"]},{title:"fab fa-gratipay",searchTerms:["favorite","heart","like","love"]},{title:"fab fa-grav",searchTerms:[]},{title:"fas fa-greater-than",searchTerms:[]},{title:"fas fa-greater-than-equal",searchTerms:[]},{title:"fas fa-grimace",searchTerms:["cringe","emoticon","face"]},{title:"far fa-grimace",searchTerms:["cringe","emoticon","face"]},{title:"fas fa-grin",searchTerms:["emoticon","face","laugh","smile"]},{title:"far fa-grin",searchTerms:["emoticon","face","laugh","smile"]},{title:"fas fa-grin-alt",searchTerms:["emoticon","face","laugh","smile"]},{title:"far fa-grin-alt",searchTerms:["emoticon","face","laugh","smile"]},{title:"fas fa-grin-beam",searchTerms:["emoticon","face","laugh","smile"]},{title:"far fa-grin-beam",searchTerms:["emoticon","face","laugh","smile"]},{title:"fas fa-grin-beam-sweat",searchTerms:["emoticon","face","smile"]},{title:"far fa-grin-beam-sweat",searchTerms:["emoticon","face","smile"]},{title:"fas fa-grin-hearts",searchTerms:["emoticon","face","love","smile"]},{title:"far fa-grin-hearts",searchTerms:["emoticon","face","love","smile"]},{title:"fas fa-grin-squint",searchTerms:["emoticon","face","laugh","smile"]},{title:"far fa-grin-squint",searchTerms:["emoticon","face","laugh","smile"]},{title:"fas fa-grin-squint-tears",searchTerms:["emoticon","face","happy","smile"]},{title:"far fa-grin-squint-tears",searchTerms:["emoticon","face","happy","smile"]},{title:"fas fa-grin-stars",searchTerms:["emoticon","face","star-struck"]},{title:"far fa-grin-stars",searchTerms:["emoticon","face","star-struck"]},{title:"fas fa-grin-tears",searchTerms:["LOL","emoticon","face"]},{title:"far fa-grin-tears",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-grin-tongue",searchTerms:["LOL","emoticon","face"]},{title:"far fa-grin-tongue",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-grin-tongue-squint",searchTerms:["LOL","emoticon","face"]},{title:"far fa-grin-tongue-squint",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-grin-tongue-wink",searchTerms:["LOL","emoticon","face"]},{title:"far fa-grin-tongue-wink",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-grin-wink",searchTerms:["emoticon","face","flirt","laugh","smile"]},{title:"far fa-grin-wink",searchTerms:["emoticon","face","flirt","laugh","smile"]},{title:"fas fa-grip-horizontal",searchTerms:["affordance","drag","drop","grab","handle"]},{title:"fas fa-grip-vertical",searchTerms:["affordance","drag","drop","grab","handle"]},{title:"fab fa-gripfire",searchTerms:[]},{title:"fab fa-grunt",searchTerms:[]},{title:"fab fa-gulp",searchTerms:[]},{title:"fas fa-h-square",searchTerms:["hospital","hotel"]},{title:"fab fa-hacker-news",searchTerms:[]},{title:"fab fa-hacker-news-square",searchTerms:[]},{title:"fab fa-hackerrank",searchTerms:[]},{title:"fas fa-hammer",searchTerms:["admin","fix","repair","settings","tool"]},{title:"fas fa-hamsa",searchTerms:["amulet","christianity","islam","jewish","judaism","muslim","protection"]},{title:"fas fa-hand-holding",searchTerms:[]},{title:"fas fa-hand-holding-heart",searchTerms:[]},{title:"fas fa-hand-holding-usd",searchTerms:["$","dollar sign","donation","giving","money","price"]},{title:"fas fa-hand-lizard",searchTerms:[]},{title:"far fa-hand-lizard",searchTerms:[]},{title:"fas fa-hand-paper",searchTerms:["stop"]},{title:"far fa-hand-paper",searchTerms:["stop"]},{title:"fas fa-hand-peace",searchTerms:[]},{title:"far fa-hand-peace",searchTerms:[]},{title:"fas fa-hand-point-down",searchTerms:["finger","hand-o-down","point"]},{title:"far fa-hand-point-down",searchTerms:["finger","hand-o-down","point"]},{title:"fas fa-hand-point-left",searchTerms:["back","finger","hand-o-left","left","point","previous"]},{title:"far fa-hand-point-left",searchTerms:["back","finger","hand-o-left","left","point","previous"]},{title:"fas fa-hand-point-right",searchTerms:["finger","forward","hand-o-right","next","point","right"]},{title:"far fa-hand-point-right",searchTerms:["finger","forward","hand-o-right","next","point","right"]},{title:"fas fa-hand-point-up",searchTerms:["finger","hand-o-up","point"]},{title:"far fa-hand-point-up",searchTerms:["finger","hand-o-up","point"]},{title:"fas fa-hand-pointer",searchTerms:["select"]},{title:"far fa-hand-pointer",searchTerms:["select"]},{title:"fas fa-hand-rock",searchTerms:[]},{title:"far fa-hand-rock",searchTerms:[]},{title:"fas fa-hand-scissors",searchTerms:[]},{title:"far fa-hand-scissors",searchTerms:[]},{title:"fas fa-hand-spock",searchTerms:[]},{title:"far fa-hand-spock",searchTerms:[]},{title:"fas fa-hands",searchTerms:[]},{title:"fas fa-hands-helping",searchTerms:["aid","assistance","partnership","volunteering"]},{title:"fas fa-handshake",searchTerms:["greeting","partnership"]},{title:"far fa-handshake",searchTerms:["greeting","partnership"]},{title:"fas fa-hanukiah",searchTerms:["candle","hanukkah","jewish","judaism","light"]},{title:"fas fa-hashtag",searchTerms:[]},{title:"fas fa-hat-wizard",searchTerms:["Dungeons & Dragons","buckle","cloth","clothing","d&d","dnd","fantasy","halloween","holiday","mage","magic","pointy","witch"]},{title:"fas fa-haykal",searchTerms:["bahai","bahá'í","star"]},{title:"fas fa-hdd",searchTerms:["cpu","hard drive","harddrive","machine","save","storage"]},{title:"far fa-hdd",searchTerms:["cpu","hard drive","harddrive","machine","save","storage"]},{title:"fas fa-heading",searchTerms:["header"]},{title:"fas fa-headphones",searchTerms:["audio","listen","music","sound","speaker"]},{title:"fas fa-headphones-alt",searchTerms:["audio","listen","music","sound","speaker"]},{title:"fas fa-headset",searchTerms:["audio","gamer","gaming","listen","live chat","microphone","shot caller","sound","support","telemarketer"]},{title:"fas fa-heart",searchTerms:["favorite","like","love"]},{title:"far fa-heart",searchTerms:["favorite","like","love"]},{title:"fas fa-heartbeat",searchTerms:["ekg","lifeline","vital signs"]},{title:"fas fa-helicopter",searchTerms:["airwolf","apache","chopper","flight","fly"]},{title:"fas fa-highlighter",searchTerms:["edit","marker","sharpie","update","write"]},{title:"fas fa-hiking",searchTerms:["activity","backpack","fall","fitness","outdoors","seasonal","walking"]},{title:"fas fa-hippo",searchTerms:["fauna","hungry","mammmal"]},{title:"fab fa-hips",searchTerms:[]},{title:"fab fa-hire-a-helper",searchTerms:[]},{title:"fas fa-history",searchTerms:[]},{title:"fas fa-hockey-puck",searchTerms:[]},{title:"fas fa-home",searchTerms:["house","main"]},{title:"fab fa-hooli",searchTerms:[]},{title:"fab fa-hornbill",searchTerms:[]},{title:"fas fa-horse",searchTerms:["equus","fauna","mammmal","neigh"]},{title:"fas fa-hospital",searchTerms:["building","emergency room","medical center"]},{title:"far fa-hospital",searchTerms:["building","emergency room","medical center"]},{title:"fas fa-hospital-alt",searchTerms:["building","emergency room","medical center"]},{title:"fas fa-hospital-symbol",searchTerms:[]},{title:"fas fa-hot-tub",searchTerms:[]},{title:"fas fa-hotel",searchTerms:["building","lodging"]},{title:"fab fa-hotjar",searchTerms:[]},{title:"fas fa-hourglass",searchTerms:[]},{title:"far fa-hourglass",searchTerms:[]},{title:"fas fa-hourglass-end",searchTerms:[]},{title:"fas fa-hourglass-half",searchTerms:[]},{title:"fas fa-hourglass-start",searchTerms:[]},{title:"fas fa-house-damage",searchTerms:["devastation","home"]},{title:"fab fa-houzz",searchTerms:[]},{title:"fas fa-hryvnia",searchTerms:["money"]},{title:"fab fa-html5",searchTerms:[]},{title:"fab fa-hubspot",searchTerms:[]},{title:"fas fa-i-cursor",searchTerms:[]},{title:"fas fa-id-badge",searchTerms:[]},{title:"far fa-id-badge",searchTerms:[]},{title:"fas fa-id-card",searchTerms:["document","identification","issued"]},{title:"far fa-id-card",searchTerms:["document","identification","issued"]},{title:"fas fa-id-card-alt",searchTerms:["demographics"]},{title:"fas fa-image",searchTerms:["album","photo","picture"]},{title:"far fa-image",searchTerms:["album","photo","picture"]},{title:"fas fa-images",searchTerms:["album","photo","picture"]},{title:"far fa-images",searchTerms:["album","photo","picture"]},{title:"fab fa-imdb",searchTerms:[]},{title:"fas fa-inbox",searchTerms:[]},{title:"fas fa-indent",searchTerms:[]},{title:"fas fa-industry",searchTerms:["factory","manufacturing"]},{title:"fas fa-infinity",searchTerms:[]},{title:"fas fa-info",searchTerms:["details","help","information","more"]},{title:"fas fa-info-circle",searchTerms:["details","help","information","more"]},{title:"fab fa-instagram",searchTerms:[]},{title:"fab fa-internet-explorer",searchTerms:["browser","ie"]},{title:"fab fa-ioxhost",searchTerms:[]},{title:"fas fa-italic",searchTerms:["italics"]},{title:"fab fa-itunes",searchTerms:[]},{title:"fab fa-itunes-note",searchTerms:[]},{title:"fab fa-java",searchTerms:[]},{title:"fas fa-jedi",searchTerms:["star wars"]},{title:"fab fa-jedi-order",searchTerms:["star wars"]},{title:"fab fa-jenkins",searchTerms:[]},{title:"fab fa-joget",searchTerms:[]},{title:"fas fa-joint",searchTerms:["blunt","cannabis","doobie","drugs","marijuana","roach","smoke","smoking","spliff"]},{title:"fab fa-joomla",searchTerms:[]},{title:"fas fa-journal-whills",searchTerms:["book","jedi","star wars","the force"]},{title:"fab fa-js",searchTerms:[]},{title:"fab fa-js-square",searchTerms:[]},{title:"fab fa-jsfiddle",searchTerms:[]},{title:"fas fa-kaaba",searchTerms:["building","cube","islam","muslim"]},{title:"fab fa-kaggle",searchTerms:[]},{title:"fas fa-key",searchTerms:["password","unlock"]},{title:"fab fa-keybase",searchTerms:[]},{title:"fas fa-keyboard",searchTerms:["input","type"]},{title:"far fa-keyboard",searchTerms:["input","type"]},{title:"fab fa-keycdn",searchTerms:[]},{title:"fas fa-khanda",searchTerms:["chakkar","sikh","sikhism","sword"]},{title:"fab fa-kickstarter",searchTerms:[]},{title:"fab fa-kickstarter-k",searchTerms:[]},{title:"fas fa-kiss",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"far fa-kiss",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"fas fa-kiss-beam",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"far fa-kiss-beam",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"fas fa-kiss-wink-heart",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"far fa-kiss-wink-heart",searchTerms:["beso","emoticon","face","love","smooch"]},{title:"fas fa-kiwi-bird",searchTerms:["bird","fauna"]},{title:"fab fa-korvue",searchTerms:[]},{title:"fas fa-landmark",searchTerms:["building","historic","memoroable","politics"]},{title:"fas fa-language",searchTerms:["dialect","idiom","localize","speech","translate","vernacular"]},{title:"fas fa-laptop",searchTerms:["computer","cpu","dell","demo","device","dude you're getting","mac","macbook","machine","pc"]},{title:"fas fa-laptop-code",searchTerms:[]},{title:"fab fa-laravel",searchTerms:[]},{title:"fab fa-lastfm",searchTerms:[]},{title:"fab fa-lastfm-square",searchTerms:[]},{title:"fas fa-laugh",searchTerms:["LOL","emoticon","face","laugh"]},{title:"far fa-laugh",searchTerms:["LOL","emoticon","face","laugh"]},{title:"fas fa-laugh-beam",searchTerms:["LOL","emoticon","face"]},{title:"far fa-laugh-beam",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-laugh-squint",searchTerms:["LOL","emoticon","face"]},{title:"far fa-laugh-squint",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-laugh-wink",searchTerms:["LOL","emoticon","face"]},{title:"far fa-laugh-wink",searchTerms:["LOL","emoticon","face"]},{title:"fas fa-layer-group",searchTerms:["layers"]},{title:"fas fa-leaf",searchTerms:["eco","flora","nature","plant"]},{title:"fab fa-leanpub",searchTerms:[]},{title:"fas fa-lemon",searchTerms:["food"]},{title:"far fa-lemon",searchTerms:["food"]},{title:"fab fa-less",searchTerms:[]},{title:"fas fa-less-than",searchTerms:[]},{title:"fas fa-less-than-equal",searchTerms:[]},{title:"fas fa-level-down-alt",searchTerms:["level-down"]},{title:"fas fa-level-up-alt",searchTerms:["level-up"]},{title:"fas fa-life-ring",searchTerms:["support"]},{title:"far fa-life-ring",searchTerms:["support"]},{title:"fas fa-lightbulb",searchTerms:["idea","inspiration"]},{title:"far fa-lightbulb",searchTerms:["idea","inspiration"]},{title:"fab fa-line",searchTerms:[]},{title:"fas fa-link",searchTerms:["chain"]},{title:"fab fa-linkedin",searchTerms:["linkedin-square"]},{title:"fab fa-linkedin-in",searchTerms:["linkedin"]},{title:"fab fa-linode",searchTerms:[]},{title:"fab fa-linux",searchTerms:["tux"]},{title:"fas fa-lira-sign",searchTerms:["try","turkish"]},{title:"fas fa-list",searchTerms:["checklist","completed","done","finished","ol","todo","ul"]},{title:"fas fa-list-alt",searchTerms:["checklist","completed","done","finished","ol","todo","ul"]},{title:"far fa-list-alt",searchTerms:["checklist","completed","done","finished","ol","todo","ul"]},{title:"fas fa-list-ol",searchTerms:["checklist","list","numbers","ol","todo","ul"]},{title:"fas fa-list-ul",searchTerms:["checklist","list","ol","todo","ul"]},{title:"fas fa-location-arrow",searchTerms:["address","coordinates","gps","location","map","place","where"]},{title:"fas fa-lock",searchTerms:["admin","protect","security"]},{title:"fas fa-lock-open",searchTerms:["admin","lock","open","password","protect"]},{title:"fas fa-long-arrow-alt-down",searchTerms:["long-arrow-down"]},{title:"fas fa-long-arrow-alt-left",searchTerms:["back","long-arrow-left","previous"]},{title:"fas fa-long-arrow-alt-right",searchTerms:["long-arrow-right"]},{title:"fas fa-long-arrow-alt-up",searchTerms:["long-arrow-up"]},{title:"fas fa-low-vision",searchTerms:[]},{title:"fas fa-luggage-cart",searchTerms:[]},{title:"fab fa-lyft",searchTerms:[]},{title:"fab fa-magento",searchTerms:[]},{title:"fas fa-magic",searchTerms:["autocomplete","automatic","mage","magic","spell","witch","wizard"]},{title:"fas fa-magnet",searchTerms:[]},{title:"fas fa-mail-bulk",searchTerms:[]},{title:"fab fa-mailchimp",searchTerms:[]},{title:"fas fa-male",searchTerms:["human","man","person","profile","user"]},{title:"fab fa-mandalorian",searchTerms:[]},{title:"fas fa-map",searchTerms:["coordinates","location","paper","place","travel"]},{title:"far fa-map",searchTerms:["coordinates","location","paper","place","travel"]},{title:"fas fa-map-marked",searchTerms:["address","coordinates","destination","gps","localize","location","map","paper","pin","place","point of interest","position","route","travel","where"]},{title:"fas fa-map-marked-alt",searchTerms:["address","coordinates","destination","gps","localize","location","map","paper","pin","place","point of interest","position","route","travel","where"]},{title:"fas fa-map-marker",searchTerms:["address","coordinates","gps","localize","location","map","pin","place","position","travel","where"]},{title:"fas fa-map-marker-alt",searchTerms:["address","coordinates","gps","localize","location","map","pin","place","position","travel","where"]},{title:"fas fa-map-pin",searchTerms:["address","coordinates","gps","localize","location","map","marker","place","position","travel","where"]},{title:"fas fa-map-signs",searchTerms:[]},{title:"fab fa-markdown",searchTerms:[]},{title:"fas fa-marker",searchTerms:["edit","sharpie","update","write"]},{title:"fas fa-mars",searchTerms:["male"]},{title:"fas fa-mars-double",searchTerms:[]},{title:"fas fa-mars-stroke",searchTerms:[]},{title:"fas fa-mars-stroke-h",searchTerms:[]},{title:"fas fa-mars-stroke-v",searchTerms:[]},{title:"fas fa-mask",searchTerms:["costume","disguise","halloween","holiday","secret","super hero"]},{title:"fab fa-mastodon",searchTerms:[]},{title:"fab fa-maxcdn",searchTerms:[]},{title:"fas fa-medal",searchTerms:[]},{title:"fab fa-medapps",searchTerms:[]},{title:"fab fa-medium",searchTerms:[]},{title:"fab fa-medium-m",searchTerms:[]},{title:"fas fa-medkit",searchTerms:["first aid","firstaid","health","help","support"]},{title:"fab fa-medrt",searchTerms:[]},{title:"fab fa-meetup",searchTerms:[]},{title:"fab fa-megaport",searchTerms:[]},{title:"fas fa-meh",searchTerms:["emoticon","face","neutral","rating"]},{title:"far fa-meh",searchTerms:["emoticon","face","neutral","rating"]},{title:"fas fa-meh-blank",searchTerms:["emoticon","face","neutral","rating"]},{title:"far fa-meh-blank",searchTerms:["emoticon","face","neutral","rating"]},{title:"fas fa-meh-rolling-eyes",searchTerms:["emoticon","face","neutral","rating"]},{title:"far fa-meh-rolling-eyes",searchTerms:["emoticon","face","neutral","rating"]},{title:"fas fa-memory",searchTerms:["DIMM","RAM"]},{title:"fas fa-menorah",searchTerms:["candle","hanukkah","jewish","judaism","light"]},{title:"fas fa-mercury",searchTerms:["transgender"]},{title:"fas fa-meteor",searchTerms:[]},{title:"fas fa-microchip",searchTerms:["cpu","processor"]},{title:"fas fa-microphone",searchTerms:["record","sound","voice"]},{title:"fas fa-microphone-alt",searchTerms:["record","sound","voice"]},{title:"fas fa-microphone-alt-slash",searchTerms:["disable","mute","record","sound","voice"]},{title:"fas fa-microphone-slash",searchTerms:["disable","mute","record","sound","voice"]},{title:"fas fa-microscope",searchTerms:[]},{title:"fab fa-microsoft",searchTerms:[]},{title:"fas fa-minus",searchTerms:["collapse","delete","hide","minify","negative","remove","trash"]},{title:"fas fa-minus-circle",searchTerms:["delete","hide","negative","remove","trash"]},{title:"fas fa-minus-square",searchTerms:["collapse","delete","hide","minify","negative","remove","trash"]},{title:"far fa-minus-square",searchTerms:["collapse","delete","hide","minify","negative","remove","trash"]},{title:"fab fa-mix",searchTerms:[]},{title:"fab fa-mixcloud",searchTerms:[]},{title:"fab fa-mizuni",searchTerms:[]},{title:"fas fa-mobile",searchTerms:["apple","call","cell phone","cellphone","device","iphone","number","screen","telephone","text"]},{title:"fas fa-mobile-alt",searchTerms:["apple","call","cell phone","cellphone","device","iphone","number","screen","telephone","text"]},{title:"fab fa-modx",searchTerms:[]},{title:"fab fa-monero",searchTerms:[]},{title:"fas fa-money-bill",searchTerms:["buy","cash","checkout","money","payment","price","purchase"]},{title:"fas fa-money-bill-alt",searchTerms:["buy","cash","checkout","money","payment","price","purchase"]},{title:"far fa-money-bill-alt",searchTerms:["buy","cash","checkout","money","payment","price","purchase"]},{title:"fas fa-money-bill-wave",searchTerms:[]},{title:"fas fa-money-bill-wave-alt",searchTerms:[]},{title:"fas fa-money-check",searchTerms:["bank check","cheque"]},{title:"fas fa-money-check-alt",searchTerms:["bank check","cheque"]},{title:"fas fa-monument",searchTerms:["building","historic","memoroable"]},{title:"fas fa-moon",searchTerms:["contrast","crescent","darker","lunar","night"]},{title:"far fa-moon",searchTerms:["contrast","crescent","darker","lunar","night"]},{title:"fas fa-mortar-pestle",searchTerms:["crush","culinary","grind","medical","mix","spices"]},{title:"fas fa-mosque",searchTerms:["building","islam","muslim"]},{title:"fas fa-motorcycle",searchTerms:["bike","machine","transportation","vehicle"]},{title:"fas fa-mountain",searchTerms:[]},{title:"fas fa-mouse-pointer",searchTerms:["select"]},{title:"fas fa-music",searchTerms:["note","sound"]},{title:"fab fa-napster",searchTerms:[]},{title:"fab fa-neos",searchTerms:[]},{title:"fas fa-network-wired",searchTerms:[]},{title:"fas fa-neuter",searchTerms:[]},{title:"fas fa-newspaper",searchTerms:["article","press"]},{title:"far fa-newspaper",searchTerms:["article","press"]},{title:"fab fa-nimblr",searchTerms:[]},{title:"fab fa-nintendo-switch",searchTerms:[]},{title:"fab fa-node",searchTerms:[]},{title:"fab fa-node-js",searchTerms:[]},{title:"fas fa-not-equal",searchTerms:[]},{title:"fas fa-notes-medical",searchTerms:[]},{title:"fab fa-npm",searchTerms:[]},{title:"fab fa-ns8",searchTerms:[]},{title:"fab fa-nutritionix",searchTerms:[]},{title:"fas fa-object-group",searchTerms:["design"]},{title:"far fa-object-group",searchTerms:["design"]},{title:"fas fa-object-ungroup",searchTerms:["design"]},{title:"far fa-object-ungroup",searchTerms:["design"]},{title:"fab fa-odnoklassniki",searchTerms:[]},{title:"fab fa-odnoklassniki-square",searchTerms:[]},{title:"fas fa-oil-can",searchTerms:[]},{title:"fab fa-old-republic",searchTerms:["politics","star wars"]},{title:"fas fa-om",searchTerms:["buddhism","hinduism","jainism","mantra"]},{title:"fab fa-opencart",searchTerms:[]},{title:"fab fa-openid",searchTerms:[]},{title:"fab fa-opera",searchTerms:[]},{title:"fab fa-optin-monster",searchTerms:[]},{title:"fab fa-osi",searchTerms:[]},{title:"fas fa-otter",searchTerms:["fauna","mammmal"]},{title:"fas fa-outdent",searchTerms:[]},{title:"fab fa-page4",searchTerms:[]},{title:"fab fa-pagelines",searchTerms:["eco","flora","leaf","leaves","nature","plant","tree"]},{title:"fas fa-paint-brush",searchTerms:[]},{title:"fas fa-paint-roller",searchTerms:["brush","painting","tool"]},{title:"fas fa-palette",searchTerms:["colors","painting"]},{title:"fab fa-palfed",searchTerms:[]},{title:"fas fa-pallet",searchTerms:[]},{title:"fas fa-paper-plane",searchTerms:[]},{title:"far fa-paper-plane",searchTerms:[]},{title:"fas fa-paperclip",searchTerms:["attachment"]},{title:"fas fa-parachute-box",searchTerms:["aid","assistance","rescue","supplies"]},{title:"fas fa-paragraph",searchTerms:[]},{title:"fas fa-parking",searchTerms:[]},{title:"fas fa-passport",searchTerms:["document","identification","issued"]},{title:"fas fa-pastafarianism",searchTerms:["agnosticism","atheism","flying spaghetti monster","fsm"]},{title:"fas fa-paste",searchTerms:["clipboard","copy"]},{title:"fab fa-patreon",searchTerms:[]},{title:"fas fa-pause",searchTerms:["wait"]},{title:"fas fa-pause-circle",searchTerms:[]},{title:"far fa-pause-circle",searchTerms:[]},{title:"fas fa-paw",searchTerms:["animal","pet"]},{title:"fab fa-paypal",searchTerms:[]},{title:"fas fa-peace",searchTerms:[]},{title:"fas fa-pen",searchTerms:["design","edit","update","write"]},{title:"fas fa-pen-alt",searchTerms:["design","edit","update","write"]},{title:"fas fa-pen-fancy",searchTerms:["design","edit","fountain pen","update","write"]},{title:"fas fa-pen-nib",searchTerms:["design","edit","fountain pen","update","write"]},{title:"fas fa-pen-square",searchTerms:["edit","pencil-square","update","write"]},{title:"fas fa-pencil-alt",searchTerms:["design","edit","pencil","update","write"]},{title:"fas fa-pencil-ruler",searchTerms:[]},{title:"fab fa-penny-arcade",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","game","gaming","pax","tabletop"]},{title:"fas fa-people-carry",searchTerms:["movers"]},{title:"fas fa-percent",searchTerms:[]},{title:"fas fa-percentage",searchTerms:[]},{title:"fab fa-periscope",searchTerms:[]},{title:"fas fa-person-booth",searchTerms:["changing","changing room","election","human","person","vote","voting"]},{title:"fab fa-phabricator",searchTerms:[]},{title:"fab fa-phoenix-framework",searchTerms:[]},{title:"fab fa-phoenix-squadron",searchTerms:[]},{title:"fas fa-phone",searchTerms:["call","earphone","number","support","telephone","voice"]},{title:"fas fa-phone-slash",searchTerms:[]},{title:"fas fa-phone-square",searchTerms:["call","number","support","telephone","voice"]},{title:"fas fa-phone-volume",searchTerms:["telephone","volume-control-phone"]},{title:"fab fa-php",searchTerms:[]},{title:"fab fa-pied-piper",searchTerms:[]},{title:"fab fa-pied-piper-alt",searchTerms:[]},{title:"fab fa-pied-piper-hat",searchTerms:["clothing"]},{title:"fab fa-pied-piper-pp",searchTerms:[]},{title:"fas fa-piggy-bank",searchTerms:["save","savings"]},{title:"fas fa-pills",searchTerms:["drugs","medicine"]},{title:"fab fa-pinterest",searchTerms:[]},{title:"fab fa-pinterest-p",searchTerms:[]},{title:"fab fa-pinterest-square",searchTerms:[]},{title:"fas fa-place-of-worship",searchTerms:[]},{title:"fas fa-plane",searchTerms:["airplane","destination","fly","location","mode","travel","trip"]},{title:"fas fa-plane-arrival",searchTerms:["airplane","arriving","destination","fly","land","landing","location","mode","travel","trip"]},{title:"fas fa-plane-departure",searchTerms:["airplane","departing","destination","fly","location","mode","take off","taking off","travel","trip"]},{title:"fas fa-play",searchTerms:["music","playing","sound","start"]},{title:"fas fa-play-circle",searchTerms:["playing","start"]},{title:"far fa-play-circle",searchTerms:["playing","start"]},{title:"fab fa-playstation",searchTerms:[]},{title:"fas fa-plug",searchTerms:["connect","online","power"]},{title:"fas fa-plus",searchTerms:["add","create","expand","new","positive"]},{title:"fas fa-plus-circle",searchTerms:["add","create","expand","new","positive"]},{title:"fas fa-plus-square",searchTerms:["add","create","expand","new","positive"]},{title:"far fa-plus-square",searchTerms:["add","create","expand","new","positive"]},{title:"fas fa-podcast",searchTerms:[]},{title:"fas fa-poll",searchTerms:["results","survey","vote","voting"]},{title:"fas fa-poll-h",searchTerms:["results","survey","vote","voting"]},{title:"fas fa-poo",searchTerms:[]},{title:"fas fa-poo-storm",searchTerms:["mess","poop","shit"]},{title:"fas fa-poop",searchTerms:[]},{title:"fas fa-portrait",searchTerms:[]},{title:"fas fa-pound-sign",searchTerms:["gbp"]},{title:"fas fa-power-off",searchTerms:["on","reboot","restart"]},{title:"fas fa-pray",searchTerms:[]},{title:"fas fa-praying-hands",searchTerms:[]},{title:"fas fa-prescription",searchTerms:["drugs","medical","medicine","rx"]},{title:"fas fa-prescription-bottle",searchTerms:["drugs","medical","medicine","rx"]},{title:"fas fa-prescription-bottle-alt",searchTerms:["drugs","medical","medicine","rx"]},{title:"fas fa-print",searchTerms:[]},{title:"fas fa-procedures",searchTerms:[]},{title:"fab fa-product-hunt",searchTerms:[]},{title:"fas fa-project-diagram",searchTerms:[]},{title:"fab fa-pushed",searchTerms:[]},{title:"fas fa-puzzle-piece",searchTerms:["add-on","addon","section"]},{title:"fab fa-python",searchTerms:[]},{title:"fab fa-qq",searchTerms:[]},{title:"fas fa-qrcode",searchTerms:["scan"]},{title:"fas fa-question",searchTerms:["help","information","support","unknown"]},{title:"fas fa-question-circle",searchTerms:["help","information","support","unknown"]},{title:"far fa-question-circle",searchTerms:["help","information","support","unknown"]},{title:"fas fa-quidditch",searchTerms:[]},{title:"fab fa-quinscape",searchTerms:[]},{title:"fab fa-quora",searchTerms:[]},{title:"fas fa-quote-left",searchTerms:[]},{title:"fas fa-quote-right",searchTerms:[]},{title:"fas fa-quran",searchTerms:["book","islam","muslim"]},{title:"fab fa-r-project",searchTerms:[]},{title:"fas fa-rainbow",searchTerms:[]},{title:"fas fa-random",searchTerms:["shuffle","sort"]},{title:"fab fa-ravelry",searchTerms:[]},{title:"fab fa-react",searchTerms:[]},{title:"fab fa-reacteurope",searchTerms:[]},{title:"fab fa-readme",searchTerms:[]},{title:"fab fa-rebel",searchTerms:[]},{title:"fas fa-receipt",searchTerms:["check","invoice","table"]},{title:"fas fa-recycle",searchTerms:[]},{title:"fab fa-red-river",searchTerms:[]},{title:"fab fa-reddit",searchTerms:[]},{title:"fab fa-reddit-alien",searchTerms:[]},{title:"fab fa-reddit-square",searchTerms:[]},{title:"fas fa-redo",searchTerms:["forward","refresh","reload","repeat"]},{title:"fas fa-redo-alt",searchTerms:["forward","refresh","reload","repeat"]},{title:"fas fa-registered",searchTerms:[]},{title:"far fa-registered",searchTerms:[]},{title:"fab fa-renren",searchTerms:[]},{title:"fas fa-reply",searchTerms:[]},{title:"fas fa-reply-all",searchTerms:[]},{title:"fab fa-replyd",searchTerms:[]},{title:"fas fa-republican",searchTerms:["american","conservative","election","elephant","politics","republican party","right","right-wing","usa"]},{title:"fab fa-researchgate",searchTerms:[]},{title:"fab fa-resolving",searchTerms:[]},{title:"fas fa-retweet",searchTerms:["refresh","reload","share","swap"]},{title:"fab fa-rev",searchTerms:[]},{title:"fas fa-ribbon",searchTerms:["badge","cause","lapel","pin"]},{title:"fas fa-ring",searchTerms:["Dungeons & Dragons","Gollum","band","binding","d&d","dnd","fantasy","jewelry","precious"]},{title:"fas fa-road",searchTerms:["street"]},{title:"fas fa-robot",searchTerms:[]},{title:"fas fa-rocket",searchTerms:["app"]},{title:"fab fa-rocketchat",searchTerms:[]},{title:"fab fa-rockrms",searchTerms:[]},{title:"fas fa-route",searchTerms:[]},{title:"fas fa-rss",searchTerms:["blog"]},{title:"fas fa-rss-square",searchTerms:["blog","feed"]},{title:"fas fa-ruble-sign",searchTerms:["rub"]},{title:"fas fa-ruler",searchTerms:[]},{title:"fas fa-ruler-combined",searchTerms:[]},{title:"fas fa-ruler-horizontal",searchTerms:[]},{title:"fas fa-ruler-vertical",searchTerms:[]},{title:"fas fa-running",searchTerms:["jog","sprint"]},{title:"fas fa-rupee-sign",searchTerms:["indian","inr"]},{title:"fas fa-sad-cry",searchTerms:["emoticon","face","tear","tears"]},{title:"far fa-sad-cry",searchTerms:["emoticon","face","tear","tears"]},{title:"fas fa-sad-tear",searchTerms:["emoticon","face","tear","tears"]},{title:"far fa-sad-tear",searchTerms:["emoticon","face","tear","tears"]},{title:"fab fa-safari",searchTerms:["browser"]},{title:"fab fa-sass",searchTerms:[]},{title:"fas fa-save",searchTerms:["floppy","floppy-o"]},{title:"far fa-save",searchTerms:["floppy","floppy-o"]},{title:"fab fa-schlix",searchTerms:[]},{title:"fas fa-school",searchTerms:[]},{title:"fas fa-screwdriver",searchTerms:["admin","fix","repair","settings","tool"]},{title:"fab fa-scribd",searchTerms:[]},{title:"fas fa-scroll",searchTerms:["Dungeons & Dragons","announcement","d&d","dnd","fantasy","paper"]},{title:"fas fa-search",searchTerms:["bigger","enlarge","magnify","preview","zoom"]},{title:"fas fa-search-dollar",searchTerms:[]},{title:"fas fa-search-location",searchTerms:[]},{title:"fas fa-search-minus",searchTerms:["minify","negative","smaller","zoom","zoom out"]},{title:"fas fa-search-plus",searchTerms:["bigger","enlarge","magnify","positive","zoom","zoom in"]},{title:"fab fa-searchengin",searchTerms:[]},{title:"fas fa-seedling",searchTerms:[]},{title:"fab fa-sellcast",searchTerms:["eercast"]},{title:"fab fa-sellsy",searchTerms:[]},{title:"fas fa-server",searchTerms:["cpu"]},{title:"fab fa-servicestack",searchTerms:[]},{title:"fas fa-shapes",searchTerms:["circle","square","triangle"]},{title:"fas fa-share",searchTerms:[]},{title:"fas fa-share-alt",searchTerms:[]},{title:"fas fa-share-alt-square",searchTerms:[]},{title:"fas fa-share-square",searchTerms:["send","social"]},{title:"far fa-share-square",searchTerms:["send","social"]},{title:"fas fa-shekel-sign",searchTerms:["ils"]},{title:"fas fa-shield-alt",searchTerms:["achievement","award","block","defend","security","winner"]},{title:"fas fa-ship",searchTerms:["boat","sea"]},{title:"fas fa-shipping-fast",searchTerms:[]},{title:"fab fa-shirtsinbulk",searchTerms:[]},{title:"fas fa-shoe-prints",searchTerms:["feet","footprints","steps"]},{title:"fas fa-shopping-bag",searchTerms:[]},{title:"fas fa-shopping-basket",searchTerms:[]},{title:"fas fa-shopping-cart",searchTerms:["buy","checkout","payment","purchase"]},{title:"fab fa-shopware",searchTerms:[]},{title:"fas fa-shower",searchTerms:[]},{title:"fas fa-shuttle-van",searchTerms:["machine","public-transportation","transportation","vehicle"]},{title:"fas fa-sign",searchTerms:[]},{title:"fas fa-sign-in-alt",searchTerms:["arrow","enter","join","log in","login","sign in","sign up","sign-in","signin","signup"]},{title:"fas fa-sign-language",searchTerms:[]},{title:"fas fa-sign-out-alt",searchTerms:["arrow","exit","leave","log out","logout","sign-out"]},{title:"fas fa-signal",searchTerms:["bars","graph","online","status"]},{title:"fas fa-signature",searchTerms:["John Hancock","cursive","name","writing"]},{title:"fab fa-simplybuilt",searchTerms:[]},{title:"fab fa-sistrix",searchTerms:[]},{title:"fas fa-sitemap",searchTerms:["directory","hierarchy","ia","information architecture","organization"]},{title:"fab fa-sith",searchTerms:[]},{title:"fas fa-skull",searchTerms:["bones","skeleton","yorick"]},{title:"fas fa-skull-crossbones",searchTerms:["Dungeons & Dragons","alert","bones","d&d","danger","dead","deadly","death","dnd","fantasy","halloween","holiday","jolly-roger","pirate","poison","skeleton","warning"]},{title:"fab fa-skyatlas",searchTerms:[]},{title:"fab fa-skype",searchTerms:[]},{title:"fab fa-slack",searchTerms:["anchor","hash","hashtag"]},{title:"fab fa-slack-hash",searchTerms:["anchor","hash","hashtag"]},{title:"fas fa-slash",searchTerms:[]},{title:"fas fa-sliders-h",searchTerms:["settings","sliders"]},{title:"fab fa-slideshare",searchTerms:[]},{title:"fas fa-smile",searchTerms:["approve","emoticon","face","happy","rating","satisfied"]},{title:"far fa-smile",searchTerms:["approve","emoticon","face","happy","rating","satisfied"]},{title:"fas fa-smile-beam",searchTerms:["emoticon","face","happy","positive"]},{title:"far fa-smile-beam",searchTerms:["emoticon","face","happy","positive"]},{title:"fas fa-smile-wink",searchTerms:["emoticon","face","happy"]},{title:"far fa-smile-wink",searchTerms:["emoticon","face","happy"]},{title:"fas fa-smog",searchTerms:["dragon"]},{title:"fas fa-smoking",searchTerms:["cigarette","nicotine","smoking status"]},{title:"fas fa-smoking-ban",searchTerms:["no smoking","non-smoking"]},{title:"fab fa-snapchat",searchTerms:[]},{title:"fab fa-snapchat-ghost",searchTerms:[]},{title:"fab fa-snapchat-square",searchTerms:[]},{title:"fas fa-snowflake",searchTerms:["precipitation","seasonal","winter"]},{title:"far fa-snowflake",searchTerms:["precipitation","seasonal","winter"]},{title:"fas fa-socks",searchTerms:["business socks","business time","flight of the conchords","wednesday"]},{title:"fas fa-solar-panel",searchTerms:["clean","eco-friendly","energy","green","sun"]},{title:"fas fa-sort",searchTerms:["order"]},{title:"fas fa-sort-alpha-down",searchTerms:["sort-alpha-asc"]},{title:"fas fa-sort-alpha-up",searchTerms:["sort-alpha-desc"]},{title:"fas fa-sort-amount-down",searchTerms:["sort-amount-asc"]},{title:"fas fa-sort-amount-up",searchTerms:["sort-amount-desc"]},{title:"fas fa-sort-down",searchTerms:["arrow","descending","sort-desc"]},{title:"fas fa-sort-numeric-down",searchTerms:["numbers","sort-numeric-asc"]},{title:"fas fa-sort-numeric-up",searchTerms:["numbers","sort-numeric-desc"]},{title:"fas fa-sort-up",searchTerms:["arrow","ascending","sort-asc"]},{title:"fab fa-soundcloud",searchTerms:[]},{title:"fas fa-spa",searchTerms:["flora","mindfullness","plant","wellness"]},{title:"fas fa-space-shuttle",searchTerms:["astronaut","machine","nasa","rocket","transportation"]},{title:"fab fa-speakap",searchTerms:[]},{title:"fas fa-spider",searchTerms:["arachnid","bug","charlotte","crawl","eight","halloween","holiday"]},{title:"fas fa-spinner",searchTerms:["loading","progress"]},{title:"fas fa-splotch",searchTerms:[]},{title:"fab fa-spotify",searchTerms:[]},{title:"fas fa-spray-can",searchTerms:[]},{title:"fas fa-square",searchTerms:["block","box"]},{title:"far fa-square",searchTerms:["block","box"]},{title:"fas fa-square-full",searchTerms:[]},{title:"fas fa-square-root-alt",searchTerms:[]},{title:"fab fa-squarespace",searchTerms:[]},{title:"fab fa-stack-exchange",searchTerms:[]},{title:"fab fa-stack-overflow",searchTerms:[]},{title:"fas fa-stamp",searchTerms:[]},{title:"fas fa-star",searchTerms:["achievement","award","favorite","important","night","rating","score"]},{title:"far fa-star",searchTerms:["achievement","award","favorite","important","night","rating","score"]},{title:"fas fa-star-and-crescent",searchTerms:["islam","muslim"]},{title:"fas fa-star-half",searchTerms:["achievement","award","rating","score","star-half-empty","star-half-full"]},{title:"far fa-star-half",searchTerms:["achievement","award","rating","score","star-half-empty","star-half-full"]},{title:"fas fa-star-half-alt",searchTerms:["achievement","award","rating","score","star-half-empty","star-half-full"]},{title:"fas fa-star-of-david",searchTerms:["jewish","judaism"]},{title:"fas fa-star-of-life",searchTerms:[]},{title:"fab fa-staylinked",searchTerms:[]},{title:"fab fa-steam",searchTerms:[]},{title:"fab fa-steam-square",searchTerms:[]},{title:"fab fa-steam-symbol",searchTerms:[]},{title:"fas fa-step-backward",searchTerms:["beginning","first","previous","rewind","start"]},{title:"fas fa-step-forward",searchTerms:["end","last","next"]},{title:"fas fa-stethoscope",searchTerms:[]},{title:"fab fa-sticker-mule",searchTerms:[]},{title:"fas fa-sticky-note",searchTerms:[]},{title:"far fa-sticky-note",searchTerms:[]},{title:"fas fa-stop",searchTerms:["block","box","square"]},{title:"fas fa-stop-circle",searchTerms:[]},{title:"far fa-stop-circle",searchTerms:[]},{title:"fas fa-stopwatch",searchTerms:["time"]},{title:"fas fa-store",searchTerms:[]},{title:"fas fa-store-alt",searchTerms:[]},{title:"fab fa-strava",searchTerms:[]},{title:"fas fa-stream",searchTerms:[]},{title:"fas fa-street-view",searchTerms:["map"]},{title:"fas fa-strikethrough",searchTerms:[]},{title:"fab fa-stripe",searchTerms:[]},{title:"fab fa-stripe-s",searchTerms:[]},{title:"fas fa-stroopwafel",searchTerms:["dessert","food","sweets","waffle"]},{title:"fab fa-studiovinari",searchTerms:[]},{title:"fab fa-stumbleupon",searchTerms:[]},{title:"fab fa-stumbleupon-circle",searchTerms:[]},{title:"fas fa-subscript",searchTerms:[]},{title:"fas fa-subway",searchTerms:["machine","railway","train","transportation","vehicle"]},{title:"fas fa-suitcase",searchTerms:["baggage","luggage","move","suitcase","travel","trip"]},{title:"fas fa-suitcase-rolling",searchTerms:[]},{title:"fas fa-sun",searchTerms:["brighten","contrast","day","lighter","sol","solar","star","weather"]},{title:"far fa-sun",searchTerms:["brighten","contrast","day","lighter","sol","solar","star","weather"]},{title:"fab fa-superpowers",searchTerms:[]},{title:"fas fa-superscript",searchTerms:["exponential"]},{title:"fab fa-supple",searchTerms:[]},{title:"fas fa-surprise",searchTerms:["emoticon","face","shocked"]},{title:"far fa-surprise",searchTerms:["emoticon","face","shocked"]},{title:"fas fa-swatchbook",searchTerms:[]},{title:"fas fa-swimmer",searchTerms:["athlete","head","man","person","water"]},{title:"fas fa-swimming-pool",searchTerms:["ladder","recreation","water"]},{title:"fas fa-synagogue",searchTerms:["building","jewish","judaism","star of david","temple"]},{title:"fas fa-sync",searchTerms:["exchange","refresh","reload","rotate","swap"]},{title:"fas fa-sync-alt",searchTerms:["refresh","reload","rotate"]},{title:"fas fa-syringe",searchTerms:["immunizations","needle"]},{title:"fas fa-table",searchTerms:["data","excel","spreadsheet"]},{title:"fas fa-table-tennis",searchTerms:[]},{title:"fas fa-tablet",searchTerms:["apple","device","ipad","kindle","screen"]},{title:"fas fa-tablet-alt",searchTerms:["apple","device","ipad","kindle","screen"]},{title:"fas fa-tablets",searchTerms:["drugs","medicine"]},{title:"fas fa-tachometer-alt",searchTerms:["dashboard","tachometer"]},{title:"fas fa-tag",searchTerms:["label"]},{title:"fas fa-tags",searchTerms:["labels"]},{title:"fas fa-tape",searchTerms:[]},{title:"fas fa-tasks",searchTerms:["downloading","downloads","loading","progress","settings"]},{title:"fas fa-taxi",searchTerms:["cab","cabbie","car","car service","lyft","machine","transportation","uber","vehicle"]},{title:"fab fa-teamspeak",searchTerms:[]},{title:"fas fa-teeth",searchTerms:[]},{title:"fas fa-teeth-open",searchTerms:[]},{title:"fab fa-telegram",searchTerms:[]},{title:"fab fa-telegram-plane",searchTerms:[]},{title:"fas fa-temperature-high",searchTerms:["mercury","thermometer","warm"]},{title:"fas fa-temperature-low",searchTerms:["cool","mercury","thermometer"]},{title:"fab fa-tencent-weibo",searchTerms:[]},{title:"fas fa-terminal",searchTerms:["code","command","console","prompt"]},{title:"fas fa-text-height",searchTerms:[]},{title:"fas fa-text-width",searchTerms:[]},{title:"fas fa-th",searchTerms:["blocks","boxes","grid","squares"]},{title:"fas fa-th-large",searchTerms:["blocks","boxes","grid","squares"]},{title:"fas fa-th-list",searchTerms:["checklist","completed","done","finished","ol","todo","ul"]},{title:"fab fa-the-red-yeti",searchTerms:[]},{title:"fas fa-theater-masks",searchTerms:[]},{title:"fab fa-themeco",searchTerms:[]},{title:"fab fa-themeisle",searchTerms:[]},{title:"fas fa-thermometer",searchTerms:["mercury","status","temperature"]},{title:"fas fa-thermometer-empty",searchTerms:["mercury","status","temperature"]},{title:"fas fa-thermometer-full",searchTerms:["fever","mercury","status","temperature"]},{title:"fas fa-thermometer-half",searchTerms:["mercury","status","temperature"]},{title:"fas fa-thermometer-quarter",searchTerms:["mercury","status","temperature"]},{title:"fas fa-thermometer-three-quarters",searchTerms:["mercury","status","temperature"]},{title:"fab fa-think-peaks",searchTerms:[]},{title:"fas fa-thumbs-down",searchTerms:["disagree","disapprove","dislike","hand","thumbs-o-down"]},{title:"far fa-thumbs-down",searchTerms:["disagree","disapprove","dislike","hand","thumbs-o-down"]},{title:"fas fa-thumbs-up",searchTerms:["agree","approve","favorite","hand","like","ok","okay","success","thumbs-o-up","yes","you got it dude"]},{title:"far fa-thumbs-up",searchTerms:["agree","approve","favorite","hand","like","ok","okay","success","thumbs-o-up","yes","you got it dude"]},{title:"fas fa-thumbtack",searchTerms:["coordinates","location","marker","pin","thumb-tack"]},{title:"fas fa-ticket-alt",searchTerms:["ticket"]},{title:"fas fa-times",searchTerms:["close","cross","error","exit","incorrect","notice","notification","notify","problem","wrong","x"]},{title:"fas fa-times-circle",searchTerms:["close","cross","exit","incorrect","notice","notification","notify","problem","wrong","x"]},{title:"far fa-times-circle",searchTerms:["close","cross","exit","incorrect","notice","notification","notify","problem","wrong","x"]},{title:"fas fa-tint",searchTerms:["drop","droplet","raindrop","waterdrop"]},{title:"fas fa-tint-slash",searchTerms:[]},{title:"fas fa-tired",searchTerms:["emoticon","face","grumpy"]},{title:"far fa-tired",searchTerms:["emoticon","face","grumpy"]},{title:"fas fa-toggle-off",searchTerms:["switch"]},{title:"fas fa-toggle-on",searchTerms:["switch"]},{title:"fas fa-toilet-paper",searchTerms:["bathroom","halloween","holiday","lavatory","prank","restroom","roll"]},{title:"fas fa-toolbox",searchTerms:["admin","container","fix","repair","settings","tools"]},{title:"fas fa-tooth",searchTerms:["bicuspid","dental","molar","mouth","teeth"]},{title:"fas fa-torah",searchTerms:["book","jewish","judaism"]},{title:"fas fa-torii-gate",searchTerms:["building","shintoism"]},{title:"fas fa-tractor",searchTerms:[]},{title:"fab fa-trade-federation",searchTerms:[]},{title:"fas fa-trademark",searchTerms:[]},{title:"fas fa-traffic-light",searchTerms:[]},{title:"fas fa-train",searchTerms:["bullet","locomotive","railway"]},{title:"fas fa-transgender",searchTerms:["intersex"]},{title:"fas fa-transgender-alt",searchTerms:[]},{title:"fas fa-trash",searchTerms:["delete","garbage","hide","remove"]},{title:"fas fa-trash-alt",searchTerms:["delete","garbage","hide","remove","trash","trash-o"]},{title:"far fa-trash-alt",searchTerms:["delete","garbage","hide","remove","trash","trash-o"]},{title:"fas fa-tree",searchTerms:["bark","fall","flora","forest","nature","plant","seasonal"]},{title:"fab fa-trello",searchTerms:[]},{title:"fab fa-tripadvisor",searchTerms:[]},{title:"fas fa-trophy",searchTerms:["achievement","award","cup","game","winner"]},{title:"fas fa-truck",searchTerms:["delivery","shipping"]},{title:"fas fa-truck-loading",searchTerms:[]},{title:"fas fa-truck-monster",searchTerms:[]},{title:"fas fa-truck-moving",searchTerms:[]},{title:"fas fa-truck-pickup",searchTerms:[]},{title:"fas fa-tshirt",searchTerms:["cloth","clothing"]},{title:"fas fa-tty",searchTerms:[]},{title:"fab fa-tumblr",searchTerms:[]},{title:"fab fa-tumblr-square",searchTerms:[]},{title:"fas fa-tv",searchTerms:["computer","display","monitor","television"]},{title:"fab fa-twitch",searchTerms:[]},{title:"fab fa-twitter",searchTerms:["social network","tweet"]},{title:"fab fa-twitter-square",searchTerms:["social network","tweet"]},{title:"fab fa-typo3",searchTerms:[]},{title:"fab fa-uber",searchTerms:[]},{title:"fab fa-uikit",searchTerms:[]},{title:"fas fa-umbrella",searchTerms:["protection","rain"]},{title:"fas fa-umbrella-beach",searchTerms:["protection","recreation","sun"]},{title:"fas fa-underline",searchTerms:[]},{title:"fas fa-undo",searchTerms:["back","control z","exchange","oops","return","rotate","swap"]},{title:"fas fa-undo-alt",searchTerms:["back","control z","exchange","oops","return","swap"]},{title:"fab fa-uniregistry",searchTerms:[]},{title:"fas fa-universal-access",searchTerms:[]},{title:"fas fa-university",searchTerms:["bank","institution"]},{title:"fas fa-unlink",searchTerms:["chain","chain-broken","remove"]},{title:"fas fa-unlock",searchTerms:["admin","lock","password","protect"]},{title:"fas fa-unlock-alt",searchTerms:["admin","lock","password","protect"]},{title:"fab fa-untappd",searchTerms:[]},{title:"fas fa-upload",searchTerms:["export","publish"]},{title:"fab fa-usb",searchTerms:[]},{title:"fas fa-user",searchTerms:["account","avatar","head","human","man","person","profile"]},{title:"far fa-user",searchTerms:["account","avatar","head","human","man","person","profile"]},{title:"fas fa-user-alt",searchTerms:["account","avatar","head","human","man","person","profile"]},{title:"fas fa-user-alt-slash",searchTerms:[]},{title:"fas fa-user-astronaut",searchTerms:["avatar","clothing","cosmonaut","space","suit"]},{title:"fas fa-user-check",searchTerms:[]},{title:"fas fa-user-circle",searchTerms:["account","avatar","head","human","man","person","profile"]},{title:"far fa-user-circle",searchTerms:["account","avatar","head","human","man","person","profile"]},{title:"fas fa-user-clock",searchTerms:[]},{title:"fas fa-user-cog",searchTerms:[]},{title:"fas fa-user-edit",searchTerms:[]},{title:"fas fa-user-friends",searchTerms:[]},{title:"fas fa-user-graduate",searchTerms:["cap","clothing","commencement","gown","graduation","student"]},{title:"fas fa-user-injured",searchTerms:["cast","ouch","sling"]},{title:"fas fa-user-lock",searchTerms:[]},{title:"fas fa-user-md",searchTerms:["doctor","job","medical","nurse","occupation","profile"]},{title:"fas fa-user-minus",searchTerms:["delete","negative","remove"]},{title:"fas fa-user-ninja",searchTerms:["assassin","avatar","dangerous","deadly","sneaky"]},{title:"fas fa-user-plus",searchTerms:["positive","sign up","signup"]},{title:"fas fa-user-secret",searchTerms:["clothing","coat","hat","incognito","privacy","spy","whisper"]},{title:"fas fa-user-shield",searchTerms:[]},{title:"fas fa-user-slash",searchTerms:["ban","remove"]},{title:"fas fa-user-tag",searchTerms:[]},{title:"fas fa-user-tie",searchTerms:["avatar","business","clothing","formal"]},{title:"fas fa-user-times",searchTerms:["archive","delete","remove","x"]},{title:"fas fa-users",searchTerms:["people","persons","profiles"]},{title:"fas fa-users-cog",searchTerms:[]},{title:"fab fa-ussunnah",searchTerms:[]},{title:"fas fa-utensil-spoon",searchTerms:["spoon"]},{title:"fas fa-utensils",searchTerms:["cutlery","dinner","eat","food","knife","restaurant","spoon"]},{title:"fab fa-vaadin",searchTerms:[]},{title:"fas fa-vector-square",searchTerms:["anchors","lines","object"]},{title:"fas fa-venus",searchTerms:["female"]},{title:"fas fa-venus-double",searchTerms:[]},{title:"fas fa-venus-mars",searchTerms:[]},{title:"fab fa-viacoin",searchTerms:[]},{title:"fab fa-viadeo",searchTerms:[]},{title:"fab fa-viadeo-square",searchTerms:[]},{title:"fas fa-vial",searchTerms:["test tube"]},{title:"fas fa-vials",searchTerms:["lab results","test tubes"]},{title:"fab fa-viber",searchTerms:[]},{title:"fas fa-video",searchTerms:["camera","film","movie","record","video-camera"]},{title:"fas fa-video-slash",searchTerms:[]},{title:"fas fa-vihara",searchTerms:["buddhism","buddhist","building","monastery"]},{title:"fab fa-vimeo",searchTerms:[]},{title:"fab fa-vimeo-square",searchTerms:[]},{title:"fab fa-vimeo-v",searchTerms:["vimeo"]},{title:"fab fa-vine",searchTerms:[]},{title:"fab fa-vk",searchTerms:[]},{title:"fab fa-vnv",searchTerms:[]},{title:"fas fa-volleyball-ball",searchTerms:[]},{title:"fas fa-volume-down",searchTerms:["audio","lower","music","quieter","sound","speaker"]},{title:"fas fa-volume-mute",searchTerms:[]},{title:"fas fa-volume-off",searchTerms:["audio","music","mute","sound"]},{title:"fas fa-volume-up",searchTerms:["audio","higher","louder","music","sound","speaker"]},{title:"fas fa-vote-yea",searchTerms:["accept","cast","election","politics","positive","yes"]},{title:"fas fa-vr-cardboard",searchTerms:["google","reality","virtual"]},{title:"fab fa-vuejs",searchTerms:[]},{title:"fas fa-walking",searchTerms:[]},{title:"fas fa-wallet",searchTerms:[]},{title:"fas fa-warehouse",searchTerms:[]},{title:"fas fa-water",searchTerms:[]},{title:"fab fa-weebly",searchTerms:[]},{title:"fab fa-weibo",searchTerms:[]},{title:"fas fa-weight",searchTerms:["measurement","scale","weight"]},{title:"fas fa-weight-hanging",searchTerms:["anvil","heavy","measurement"]},{title:"fab fa-weixin",searchTerms:[]},{title:"fab fa-whatsapp",searchTerms:[]},{title:"fab fa-whatsapp-square",searchTerms:[]},{title:"fas fa-wheelchair",searchTerms:["handicap","person"]},{title:"fab fa-whmcs",searchTerms:[]},{title:"fas fa-wifi",searchTerms:[]},{title:"fab fa-wikipedia-w",searchTerms:[]},{title:"fas fa-wind",searchTerms:["air","blow","breeze","fall","seasonal"]},{title:"fas fa-window-close",searchTerms:[]},{title:"far fa-window-close",searchTerms:[]},{title:"fas fa-window-maximize",searchTerms:[]},{title:"far fa-window-maximize",searchTerms:[]},{title:"fas fa-window-minimize",searchTerms:[]},{title:"far fa-window-minimize",searchTerms:[]},{title:"fas fa-window-restore",searchTerms:[]},{title:"far fa-window-restore",searchTerms:[]},{title:"fab fa-windows",searchTerms:["microsoft"]},{title:"fas fa-wine-bottle",searchTerms:["alcohol","beverage","drink","glass","grapes"]},{title:"fas fa-wine-glass",searchTerms:["alcohol","beverage","drink","grapes"]},{title:"fas fa-wine-glass-alt",searchTerms:["alcohol","beverage","drink","grapes"]},{title:"fab fa-wix",searchTerms:[]},{title:"fab fa-wizards-of-the-coast",searchTerms:["Dungeons & Dragons","d&d","dnd","fantasy","game","gaming","tabletop"]},{title:"fab fa-wolf-pack-battalion",searchTerms:[]},{title:"fas fa-won-sign",searchTerms:["krw"]},{title:"fab fa-wordpress",searchTerms:[]},{title:"fab fa-wordpress-simple",searchTerms:[]},{title:"fab fa-wpbeginner",searchTerms:[]},{title:"fab fa-wpexplorer",searchTerms:[]},{title:"fab fa-wpforms",searchTerms:[]},{title:"fab fa-wpressr",searchTerms:["rendact"]},{title:"fas fa-wrench",searchTerms:["fix","settings","spanner","tool","update"]},{title:"fas fa-x-ray",searchTerms:["radiological images","radiology"]},{title:"fab fa-xbox",searchTerms:[]},{title:"fab fa-xing",searchTerms:[]},{title:"fab fa-xing-square",searchTerms:[]},{title:"fab fa-y-combinator",searchTerms:[]},{title:"fab fa-yahoo",searchTerms:[]},{title:"fab fa-yandex",searchTerms:[]},{title:"fab fa-yandex-international",searchTerms:[]},{title:"fab fa-yelp",searchTerms:[]},{title:"fas fa-yen-sign",searchTerms:["jpy","money"]},{title:"fas fa-yin-yang",searchTerms:["daoism","opposites","taoism"]},{title:"fab fa-yoast",searchTerms:[]},{title:"fab fa-youtube",searchTerms:["film","video","youtube-play","youtube-square"]},{title:"fab fa-youtube-square",searchTerms:[]},{title:"fab fa-zhihu",searchTerms:[]}]})}));var iconPickerVue=new Vue({el:"#iconPickerVue",data:{targetInputField:"",targetIconTag:"",iconPickerModal:null},mounted:function(){var e=this;$(".icp-auto").iconpicker({title:!1,templates:{search:''}}),$("#inline-picker").on("iconpickerSelected",(function(a){var t=a.iconpickerInstance.options.fullClassFormatter(a.iconpickerValue);e.targetInputField&&$("#"+e.targetInputField).val(t),e.targetIconTag&&$("#"+e.targetIconTag).replaceWith(''),null!=e.iconPickerModal&&e.iconPickerModal.hide()}))},methods:{show:function(e,a){this.targetInputField=e,this.targetIconTag=a,null==this.iconPickerModal&&(this.iconPickerModal=new bootstrap.Modal($("#iconPickerModal"),{keyboard:!1})),this.iconPickerModal.show()}}}); diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js index bcc3b377423..451ed269dc5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js @@ -6,15 +6,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } -function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } -function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } -function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } //variables used in FlowPart.Edit sortable var widgetDragItem, lastContainer, widgetItemSourceId, widgetItemDestId; $(function () { diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js index 00bbad70a56..a7f71603e63 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js @@ -1 +1 @@ -function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var r=$(this).find("input:first-child").val(),n=t.attr("class").split(" ");$.each(n,(function(e,r){0===r.indexOf("col-md-")&&t.removeClass(r)}));var i=Math.round(r/100*12);t.addClass("col-md-"+i),$(this).closest(".dropdown-menu").prev("button").text(r+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")})),$(document).on("click",".widget-editor-btn-toggle",(function(){$(this).closest(".widget-editor").toggleClass("collapsed")})),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",(function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),r=$(this).val()+" "+e;t.text(r)}))})); +function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r0){var r=$(this).find("input:first-child").val(),n=t.attr("class").split(" ");$.each(n,(function(e,r){0===r.indexOf("col-md-")&&t.removeClass(r)}));var i=Math.round(r/100*12);t.addClass("col-md-"+i),$(this).closest(".dropdown-menu").prev("button").text(r+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")})),$(document).on("click",".widget-editor-btn-toggle",(function(){$(this).closest(".widget-editor").toggleClass("collapsed")})),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",(function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),r=$(this).val()+" "+e;t.text(r)}))})); diff --git a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js index fcecf549b1e..9dc9364f364 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js +++ b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js @@ -1029,13 +1029,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == dfd.resolve(files); }).fail(errorHandler); }, - readEntries = function readEntries() { + _readEntries = function readEntries() { dirReader.readEntries(function (results) { if (!results.length) { successHandler(entries); } else { entries = entries.concat(results); - readEntries(); + _readEntries(); } }, errorHandler); }; @@ -1054,7 +1054,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } else if (entry.isDirectory) { dirReader = entry.createReader(); - readEntries(); + _readEntries(); } else { // Return an empty list for file system items // other than files or directories: @@ -1538,20 +1538,20 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation $.ajaxSetup({ converters: { - 'iframe text': function iframeText(iframe) { + 'iframe text': function iframe_text(iframe) { return iframe && $(iframe[0].body).text(); }, - 'iframe json': function iframeJson(iframe) { + 'iframe json': function iframe_json(iframe) { return iframe && jsonAPI[jsonParse]($(iframe[0].body).text()); }, - 'iframe html': function iframeHtml(iframe) { + 'iframe html': function iframe_html(iframe) { return iframe && $(iframe[0].body).html(); }, - 'iframe xml': function iframeXml(iframe) { + 'iframe xml': function iframe_xml(iframe) { var xmlDoc = iframe && iframe[0]; return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : $.parseXML(xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml || $(xmlDoc.body).html()); }, - 'iframe script': function iframeScript(iframe) { + 'iframe script': function iframe_script(iframe) { return iframe && $.globalEval($(iframe[0].body).text()); } } @@ -1560,9 +1560,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } var initialized; var mediaApp; var bus = new Vue(); @@ -1931,7 +1931,6 @@ function initializeMediaApplication(displayMediaApplication, mediaApplicationUrl } //self.selectedMedia = null; }, - error: function error(_error4) { console.error(_error4.responseText); } @@ -2109,9 +2108,9 @@ $(document).bind('dragover', function (e) { function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // component Vue.component('folder', { template: "\n
  • \n \n
      \n \n \n
    \n
  • \n "), @@ -2261,7 +2260,6 @@ Vue.component('folder', { success: function success() { bus.$emit('mediaListMoved'); // MediaApp will listen to this, and then it will reload page so the moved medias won't be there anymore }, - error: function error(_error2) { console.error(_error2.responseText); bus.$emit('mediaListMoved', _error2.responseText); @@ -2536,7 +2534,6 @@ Vue.component('pager', { sourceItems: function sourceItems() { this.current = 0; // resetting current page after receiving a new list of unpaged items }, - pageSize: function pageSize() { this.current = 0; } @@ -2850,7 +2847,6 @@ function initializeAttachedMediaField(el, idOfUploadButton, uploadAction, mediaI } else { position = position - 8; // Adjust to hit the mouse pointer. } - return position + 'px'; } else { return '0'; @@ -2865,7 +2861,6 @@ function initializeAttachedMediaField(el, idOfUploadButton, uploadAction, mediaI } else { position = position + 5; // Adjust to hit the mouse pointer. } - return position + 'px'; } else { return '0'; diff --git a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js index 658b66ba60d..03b2c1e5caf 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js @@ -1 +1 @@ -function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_promisePipe:(i=e.fn.jquery.split("."),Number(i[0])>1||Number(i[1])>7?"then":"pipe"),_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)Object.prototype.hasOwnProperty.call(e._response,t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,a=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&a-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",a=(t.prop("files")||[1]).length;a;)n.push(i),a-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var a=e.Deferred(),o=a.promise();return i=i||this.options.context||o,!0===t?a.resolveWith(i,n):!1===t&&a.rejectWith(i,n),o.abort=a.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,i){var n=this,a=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,o){return(t||o)&&(i._processQueue=this._processQueue=(this._processQueue||a([this]))[n._promisePipe]((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():a(arguments)}))[n._promisePipe](t,o)),this._processQueue||a([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,a,o=this,r=t.files[0],s=r.size,l=t.uploadedBytes,d=t.maxChunkSize||s,c=this._blobSlice,u=e.Deferred(),m=u.promise();return!(!(this._isXHRUpload(t)&&c&&(l||("function"===e.type(d)?d(t):d)=s?(r.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",r.error])):(a=function(){var i=e.extend({},t),m=i._progress.loaded;i.blob=c.call(r,l,l+("function"===e.type(d)?d(i):d),r.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,o._trigger("chunkbeforesend",null,i),o._initXHRData(i),o._initProgressListener(i),n=(!1!==o._trigger("chunksend",null,i)&&e.ajax(i)||o._getXHRPromise(!1,i.context)).done((function(n,r,d){l=o._getUploadedBytes(d)||l+i.chunkSize,m+i.chunkSize-i._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=r,i.jqXHR=d,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),ls._sending)for(var n=s._slots.shift();n;){if("pending"===s._getDeferredState(n)){n.resolve();break}n=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),r=o[s._promisePipe](d)):(this._sequence=this._sequence[s._promisePipe](d,d),r=this._sequence),r.abort=function(){return a=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(l.context,a),d())},this._enhancePromise(r)):d()},_onAdd:function(t,i){var n,a,o,r,s=this,l=!0,d=e.extend({},this.options,i),c=i.files,u=c.length,m=d.limitMultiFileUploads,p=d.limitMultiFileUploadSize,f=d.limitMultiFileUploadSizeOverhead,h=0,g=this._getParamName(d),v=0;if(!u)return!1;if(p&&void 0===c[0].size&&(p=void 0),(d.singleFileUploads||m||p)&&this._isXHRUpload(d))if(d.singleFileUploads||p||!m)if(!d.singleFileUploads&&p)for(o=[],n=[],r=0;rp||m&&r+1-v>=m)&&(o.push(c.slice(v,r+1)),(a=g.slice(v,r+1)).length||(a=g),n.push(a),v=r+1,h=0);else n=g;else for(o=[],n=[],r=0;r").append(n)[0].reset(),i.after(n).detach(),a&&n.trigger("focus"),e.cleanData(i.off("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,a=this,o=e.Deferred(),r=[],s=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file((function(e){e.relativePath=i,o.resolve(e)}),s):t.isDirectory?(n=t.createReader(),function e(){n.readEntries((function(n){n.length?(r=r.concat(n),e()):function(e){a._handleFileTreeEntries(e,i+t.name+"/").done((function(e){o.resolve(e)})).fail(s)}(r)}),s)}()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)})))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,a=(t=e(t)).prop("entries");if(a&&a.length)return this._handleFileTreeEntries(a);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(a){n.files=a,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,a={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){a.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),a)&&i._onAdd(t,a)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,a){var o,r=a.name.toLowerCase();/^data-/.test(r)&&(r=r.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),o=n[r],t._isRegExpOption(r,o)&&(o=t._getRegExp(o)),i[r]=o)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,a=this,o=e.Deferred(),r=o.promise();return r.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),r)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=a._onSend(null,t)).then((function(e,t,i){o.resolve(e,t,i)}),(function(e,t,i){o.reject(e,t,i)}))):o.reject())})),this._enhancePromise(r)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0,i=e,n="parseJSON";"JSON"in window&&"parse"in JSON&&(i=JSON,n="parse"),e.ajaxTransport("iframe",(function(i){if(i.async){var n,a,o,r=i.initialIframeSrc||"javascript:false;";return{send:function(s,l){(n=e('
    ')).attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),a=e('').on("load",(function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];a.off("load").on("load",(function(){var t;try{if(!(t=a.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",a.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",o[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),window.setTimeout((function(){n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var a=e(t[i]);e(n).prop("name",a.prop("name")).attr("form",a.attr("form")),a.replaceWith(n)}))}),0)})),n.append(a).appendTo(document.body)},abort:function(){a&&a.off("load").prop("src",r),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}));var bus=new Vue;function initializeMediaApplication(e,t,i){initialized||(initialized=!0,t||console.error("mediaApplicationUrl variable is not defined"),$.ajax({url:t,method:"GET",success:function(t){$(".ta-content").append(t),$(document).trigger("mediaapplication:ready");var n={name:$("#t-mediaLibrary").text(),path:"",folder:"",isDirectory:!0,canCreateFolder:"true"===$("#allowNewRootFolders").val()};mediaApp=new Vue({el:"#mediaApp",data:{selectedFolder:{},mediaItems:[],selectedMedias:[],errors:[],dragDropThumbnail:new Image,smallThumbs:!1,gridView:!1,mediaFilter:"",sortBy:"",sortAsc:!0,itemsInPage:[]},created:function(){var e=this;e.dragDropThumbnail.src=(i||"")+"/OrchardCore.Media/Images/drag-thumbnail.png",bus.$on("folderSelected",(function(t){e.selectedFolder=t})),bus.$on("folderDeleted",(function(){e.selectRoot()})),bus.$on("folderAdded",(function(t){e.selectedFolder=t,t.selected=!0})),bus.$on("mediaListMoved",(function(t){e.loadFolder(e.selectedFolder),t&&e.errors.push(t)})),bus.$on("mediaRenamed",(function(t,i,n,a){var o=e.mediaItems.filter((function(e){return e.mediaPath===n}))[0];o.mediaPath=i,o.name=t,o.url=a})),bus.$on("createFolderRequested",(function(t){e.createFolder()})),bus.$on("deleteFolderRequested",(function(t){e.deleteFolder()})),bus.$on("sortChangeRequested",(function(t){e.changeSort(t)})),bus.$on("mediaToggleRequested",(function(t){e.toggleSelectionOfMedia(t)})),bus.$on("renameMediaRequested",(function(t){e.renameMedia(t)})),bus.$on("deleteMediaRequested",(function(t){e.deleteMediaItem(t)})),bus.$on("mediaDragStartRequested",(function(t,i){e.handleDragStart(t,i)})),bus.$on("pagerEvent",(function(t){e.itemsInPage=t,e.selectedMedias=[]})),localStorage.getItem("mediaApplicationPrefs")?e.currentPrefs=JSON.parse(localStorage.getItem("mediaApplicationPrefs")):e.selectedFolder=n},computed:{isHome:function(){return this.selectedFolder==n},parents:function(){var e=[];for(parentFolder=this.selectedFolder;parentFolder&&""!=parentFolder.path;)e.unshift(parentFolder),parentFolder=parentFolder.parent;return e},root:function(){return n},filteredMediaItems:function(){var e=this;e.selectedMedias=[];var t=e.mediaItems.filter((function(t){return t.name.toLowerCase().indexOf(e.mediaFilter.toLowerCase())>-1}));switch(e.sortBy){case"size":t.sort((function(t,i){return e.sortAsc?t.size-i.size:i.size-t.size}));break;case"mime":t.sort((function(t,i){return e.sortAsc?t.mime.toLowerCase().localeCompare(i.mime.toLowerCase()):i.mime.toLowerCase().localeCompare(t.mime.toLowerCase())}));break;case"lastModify":t.sort((function(t,i){return e.sortAsc?t.lastModify-i.lastModify:i.lastModify-t.lastModify}));break;default:t.sort((function(t,i){return e.sortAsc?t.name.toLowerCase().localeCompare(i.name.toLowerCase()):i.name.toLowerCase().localeCompare(t.name.toLowerCase())}))}return t},hiddenCount:function(){return this.mediaItems.length-this.filteredMediaItems.length},thumbSize:function(){return this.smallThumbs?100:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs,selectedFolder:this.selectedFolder,gridView:this.gridView}},set:function(e){e&&(this.smallThumbs=e.smallThumbs,this.selectedFolder=e.selectedFolder,this.gridView=e.gridView)}}},watch:{currentPrefs:function(e){localStorage.setItem("mediaApplicationPrefs",JSON.stringify(e))},selectedFolder:function(e){this.mediaFilter="",this.selectedFolder=e,this.loadFolder(e)}},mounted:function(){this.$refs.rootFolder.toggle()},methods:{uploadUrl:function(){if(!this.selectedFolder)return null;var e=$("#uploadFiles").val(),t=$("#allowedExtensions").val();return t&&""!==t&&(e=e+(-1==e.indexOf("?")?"?":"&")+"extensions="+encodeURIComponent(t)),e+(-1==e.indexOf("?")?"?":"&")+"path="+encodeURIComponent(this.selectedFolder.path)},selectRoot:function(){this.selectedFolder=this.root},loadFolder:function(e){this.errors=[],this.selectedMedias=[];var t=this,i=$("#getMediaItemsUrl").val(),n=$("#allowedExtensions").val();n&&""!==n&&(i=i+(-1==i.indexOf("?")?"?":"&")+"extensions="+encodeURIComponent(n)),console.log(e.path),$.ajax({url:i+(-1==i.indexOf("?")?"?":"&")+"path="+encodeURIComponent(e.path),method:"GET",success:function(e){e.forEach((function(e){e.open=!1})),t.mediaItems=e,t.selectedMedias=[],t.sortBy="",t.sortAsc=!0},error:function(i){console.log("error loading folder:"+e.path),t.selectRoot()}})},refresh:function(){var e=this;e.selectedFolder&&e.loadFolder(e.selectedFolder)},selectAll:function(){this.selectedMedias=[];for(var e=0;e-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",t.selectedMedias[i]))}t.selectedMedias=[]},error:function(e){console.error(e.responseText)}})}}}))},deleteMediaItem:function(e){var t=this;e&&confirmDialog(_objectSpread(_objectSpread({},$("#deleteMedia").data()),{},{callback:function(i){i&&$.ajax({url:$("#deleteMediaUrl").val()+"?path="+encodeURIComponent(e.mediaPath),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(i){var n=t.mediaItems&&t.mediaItems.indexOf(e);n>-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",e))},error:function(e){console.error(e.responseText)}})}}))},handleDragStart:function(e,t){var i=[];this.selectedMedias.forEach((function(e){i.push(e.name)})),0==this.isMediaSelected(e)&&(i.push(e.name),this.selectedMedias.push(e)),t.dataTransfer.setData("mediaNames",JSON.stringify(i)),t.dataTransfer.setData("sourceFolder",this.selectedFolder.path),t.dataTransfer.setDragImage(this.dragDropThumbnail,10,10),t.dataTransfer.effectAllowed="move"},handleScrollWhileDrag:function(e){e.clientY<150&&window.scrollBy(0,-10),e.clientY>window.innerHeight-100&&window.scrollBy(0,10)},changeSort:function(e){this.sortBy==e?this.sortAsc=!this.sortAsc:(this.sortAsc=!0,this.sortBy=e)}}}),$("#create-folder-name").keypress((function(e){if(13==e.which)return $("#modalFooterOk").click(),!1})),$("#modalFooterOk").on("click",(function(e){var t=$("#create-folder-name").val();""!==t&&$.ajax({url:$("#createFolderUrl").val()+"?path="+encodeURIComponent(mediaApp.selectedFolder.path)+"&name="+encodeURIComponent(t),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bus.$emit("addFolder",mediaApp.selectedFolder,e),bootstrap.Modal.getOrCreateInstance($("#createFolderModal")).hide()},error:function(e){$("#createFolderModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#createFolderModal-errors"))}})})),$("#renameMediaModalFooterOk").on("click",(function(e){var t=$("#new-item-name").val(),i=$("#old-item-name").val();if(""!==t){var n=mediaApp.selectedFolder.path+"/";"/"===n&&(n="");var a=n+t,o=n+i;if(a.toLowerCase()!==o.toLowerCase())$.ajax({url:$("#renameMediaUrl").val()+"?oldPath="+encodeURIComponent(o)+"&newPath="+encodeURIComponent(a),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide(),bus.$emit("mediaRenamed",t,a,o,e.newUrl)},error:function(e){$("#renameMediaModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#renameMediaModal-errors"))}});else bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide()}})),e&&(document.getElementById("mediaApp").style.display=""),$(document).trigger("mediaApp:ready")},error:function(e){console.error(e.responseText)}}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t\n \n
      \n \n \n
    \n \n '),props:{model:Object,selectedInMediaApp:Object,level:Number},data:function(){return{open:!1,children:null,parent:null,isHovered:!1,padding:0}},computed:{empty:function(){return!this.children||0==this.children.length},isSelected:function(){return this.selectedInMediaApp.name==this.model.name&&this.selectedInMediaApp.path==this.model.path},isRoot:function(){return""===this.model.path},canCreateFolder:function(){return void 0===this.model.canCreateFolder||this.model.canCreateFolder},canDeleteFolder:function(){return void 0===this.model.canDeleteFolder||this.model.canDeleteFolder}},mounted:function(){0==this.isRoot&&this.isAncestorOfSelectedFolder()&&this.toggle(),this.padding=this.level<3?16:16+8*this.level},created:function(){var e=this;bus.$on("deleteFolder",(function(t){if(e.children){var i=e.children&&e.children.indexOf(t);i>-1&&(e.children.splice(i,1),bus.$emit("folderDeleted"))}})),bus.$on("addFolder",(function(t,i){e.model==t&&(null!==e.children&&e.children.push(i),i.parent=e.model,bus.$emit("folderAdded",i))}))},methods:{isAncestorOfSelectedFolder:function(){for(parentFolder=mediaApp.selectedFolder;parentFolder;){if(parentFolder.path==this.model.path)return!0;parentFolder=parentFolder.parent}return!1},toggle:function(){this.open=!this.open,this.open&&!this.children&&this.loadChildren()},select:function(){bus.$emit("folderSelected",this.model),this.loadChildren()},createFolder:function(){bus.$emit("createFolderRequested")},deleteFolder:function(){bus.$emit("deleteFolderRequested")},loadChildren:function(){var e=this;0==this.open&&(this.open=!0),$.ajax({url:$("#getFoldersUrl").val()+"?path="+encodeURIComponent(e.model.path),method:"GET",success:function(t){e.children=t,e.children.forEach((function(t){t.parent=e.model}))},error:function(e){emtpy=!1,console.error(e.responseText)}})},handleDragOver:function(e){this.isHovered=!0},handleDragLeave:function(e){this.isHovered=!1},moveMediaToFolder:function(e,t){this.isHovered=!1;var i=JSON.parse(t.dataTransfer.getData("mediaNames"));if(!(i.length<1)){var n=t.dataTransfer.getData("sourceFolder"),a=e.path;""===n&&(n="root"),""===a&&(a="root"),n!==a?confirmDialog(_objectSpread(_objectSpread({},$("#moveMedia").data()),{},{callback:function(e){e&&$.ajax({url:$("#moveMediaListUrl").val(),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),mediaNames:i,sourceFolder:n,targetFolder:a},success:function(){bus.$emit("mediaListMoved")},error:function(e){console.error(e.responseText),bus.$emit("mediaListMoved",e.responseText)}})}})):alert($("#sameFolderMessage").val())}}}});var faIcons={image:"fa-regular fa-image",pdf:"fa-regular fa-file-pdf",word:"fa-regular fa-file-word",powerpoint:"fa-regular fa-file-powerpoint",excel:"fa-regular fa-file-excel",csv:"fa-regular fa-file",audio:"fa-regular fa-file-audio",video:"fa-regular fa-file-video",archive:"fa-regular fa-file-zipper",code:"fa-regular fa-file-code",text:"fa-regular fa-file-lines",file:"fa-regular fa-file"},faThumbnails={gif:faIcons.image,jpeg:faIcons.image,jpg:faIcons.image,png:faIcons.image,pdf:faIcons.pdf,doc:faIcons.word,docx:faIcons.word,ppt:faIcons.powerpoint,pptx:faIcons.powerpoint,xls:faIcons.excel,xlsx:faIcons.excel,csv:faIcons.csv,aac:faIcons.audio,mp3:faIcons.audio,ogg:faIcons.audio,avi:faIcons.video,flv:faIcons.video,mkv:faIcons.video,mp4:faIcons.video,webm:faIcons.video,gz:faIcons.archive,zip:faIcons.archive,css:faIcons.code,html:faIcons.code,js:faIcons.code,txt:faIcons.text};function getClassNameForExtension(e){return faThumbnails[e.toLowerCase()]||faIcons.file}function getExtensionForFilename(e){return e.slice(2+(e.lastIndexOf(".")-1>>>0))}function getClassNameForFilename(e){return getClassNameForExtension(getExtensionForFilename(e))}function initializeAttachedMediaField(e,t,i,n,a,o,r,s,l){var d,c=$(document.getElementById($(e).data("for"))).data("init"),u=$(e),m=u.attr("id");mediaFieldApps.push(d=new Vue({el:u.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:m,initialized:!1,allowMediaText:o,backupMediaText:"",allowAnchors:r,backupAnchor:null,mediaTextmodal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,isRemoved:t.isRemoved,isNew:t.isNew,mediaText:t.mediaText,anchor:t.anchor,attachedFileName:t.attachedFileName})})),JSON.stringify(e)):JSON.stringify(c)},set:function(e){var t=this,i=e||[],a=$.Deferred(),o=[],r=0;i.forEach((function(e,i){o.push({name:" "+e.path,mime:"",mediaPath:"",anchor:e.anchor,attachedFileName:e.attachedFileName}),promise=$.when(a).done((function(){$.ajax({url:n+"?path="+encodeURIComponent(e.path),method:"GET",success:function(n){n.vuekey=n.name+i.toString(),n.mediaText=e.mediaText,n.anchor=e.anchor,n.attachedFileName=e.attachedFileName,o.splice(i,1,n),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(n){console.log(JSON.stringify(n)),o.splice(i,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:.5,y:.5},attachedFileName:e.attachedFileName}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){for(var e=[],t=0;t0&&a},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=c,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)}));var n="#"+t,o=u.attr("id"),r=randomUUID();$(n).fileupload({limitConcurrentUploads:20,dropZone:$("#"+o),dataType:"json",url:i,maxChunkSize:l,add:function(t,i){var n,a=i.files.length;for(n=0;n0)for(var o=0;o1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(i[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(i),d.initialized=!0)):alert(n)},error:function(e,t,i){console.log("Error on upload."),console.log(e),console.log(t),console.log(i)}}).on("fileuploadchunkbeforesend",(function(e,t){var i=t.files[0];t.blob=new File([t.blob],i.name,{type:i.type,lastModified:i.lastModified})}))},methods:{selectMedia:function(e){this.selectedMedia=e},getUniqueId:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(t,1))}else 1===this.mediaItems.length&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(0,1));this.selectedMedia=null},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e;return t<17?t=17:t-=8,t+"px"}return"0"},anchorTop:function(){if(this.$refs.anchorImage&&this.selectedMedia){var e=this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight;return e<15?e=15:e+=5,e+"px"}return"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(e[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(e),d.initialized=!0)},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}function initializeMediaField(e,t,i,n,a,o,r){if(null!==e){var s,l=$(document.getElementById($(e).data("for"))).data("init"),d=$(e),c=d.attr("id");t.addEventListener("hidden.bs.modal",(function(e){$("#mediaApp").appendTo("body"),$("#mediaApp").hide()})),mediaFieldApps.push(s=new Vue({el:d.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:c,initialized:!1,allowMediaText:a,backupMediaText:"",allowAnchors:o,allowedExtensions:r,backupAnchor:null,mediaTextModal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,mediaText:t.mediaText,anchor:t.anchor})})),JSON.stringify(e)):JSON.stringify(l)},set:function(e){var t=this,n=e||[],a=$.Deferred(),o=[],r=0;n.forEach((function(e,n){o.push({name:" "+e.path,mime:"",mediaPath:""}),promise=$.when(a).done((function(){$.ajax({url:i+"?path="+encodeURIComponent(e.path),method:"GET",success:function(i){i.vuekey=i.name+n.toString(),i.mediaText=e.mediaText,i.anchor=e.anchor,o.splice(n,1,i),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(i){console.log(i),o.splice(n,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:0,y:0}}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){return 0===this.mediaItems.length||this.mediaItems.length>0&&n},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=l,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)})),e.$on("filesUploaded",(function(t){e.addMediaFiles(t)}))},methods:{selectMedia:function(e){this.selectedMedia=e},showModal:function(e){var i=this;if(i.canAddMedia){$("#allowedExtensions").val(this.allowedExtensions),$("#fileupload").attr("accept",this.allowedExtensions),$("#mediaApp").appendTo($(t).find(".modal-body")),$("#mediaApp").show(),mediaApp.refresh();var n=new bootstrap.Modal(t);n.show(),$(t).find(".mediaFieldSelectButton").off("click").on("click",(function(e){return i.addMediaFiles(mediaApp.selectedMedias),mediaApp.selectedMedias=[],n.hide(),!0}))}},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e,i=Math.round(this.$refs.modalBody.querySelector(".icon-media-anchor").clientWidth);return Number.isInteger(i)&&(t-=i/2),t+"px"}return"0"},anchorTop:function(){return this.$refs.anchorImage&&this.selectedMedia?this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight+"px":"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===n?(alert($("#onlyOneItemMessage").val()),s.mediaItems.push(e[0]),s.initialized=!0):(s.mediaItems=s.mediaItems.concat(e),s.initialized=!0)},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&this.mediaItems.splice(t,1)}else 1===this.mediaItems.length&&this.mediaItems.splice(0,1);this.selectedMedia=null},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}}Vue.component("media-items-grid",{template:'\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ',data:function(){return{T:{}}},props:{filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){this.T.editButton=$("#t-edit-button").val(),this.T.deleteButton=$("#t-delete-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("media-items-table",{template:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ',data:function(){return{T:{}}},props:{sortBy:String,sortAsc:Boolean,filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){var e=this;e.T.imageHeader=$("#t-image-header").val(),e.T.nameHeader=$("#t-name-header").val(),e.T.lastModifyHeader=$("#t-lastModify-header").val(),e.T.sizeHeader=$("#t-size-header").val(),e.T.typeHeader=$("#t-type-header").val(),e.T.editButton=$("#t-edit-button").val(),e.T.deleteButton=$("#t-delete-button").val(),e.T.viewButton=$("#t-view-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},changeSort:function(e){bus.$emit("sortChangeRequested",e)},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},printDateTime:function(e){return new Date(e).toLocaleString()},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("pager",{template:'\n
    \n \n \n
    \n ',props:{sourceItems:Array},data:function(){return{pageSize:10,pageSizeOptions:[10,30,50,100],current:0,T:{}}},created:function(){var e=this;e.T.pagerFirstButton=$("#t-pager-first-button").val(),e.T.pagerPreviousButton=$("#t-pager-previous-button").val(),e.T.pagerNextButton=$("#t-pager-next-button").val(),e.T.pagerLastButton=$("#t-pager-last-button").val(),e.T.pagerPageSizeLabel=$("#t-pager-page-size-label").val(),e.T.pagerPageLabel=$("#t-pager-page-label").val(),e.T.pagerTotalLabel=$("#t-pager-total-label").val()},methods:{next:function(){this.current=this.current+1},previous:function(){this.current=this.current-1},goFirst:function(){this.current=0},goLast:function(){this.current=this.totalPages-1},goTo:function(e){this.current=e}},computed:{total:function(){return this.sourceItems?this.sourceItems.length:0},totalPages:function(){var e=Math.ceil(this.total/this.pageSize);return e>0?e:1},isLastPage:function(){return this.current+1>=this.totalPages},isFirstPage:function(){return 0===this.current},canDoNext:function(){return!this.isLastPage},canDoPrev:function(){return!this.isFirstPage},canDoFirst:function(){return!this.isFirstPage},canDoLast:function(){return!this.isLastPage},itemsInCurrentPage:function(){var e=this.pageSize*this.current,t=e+this.pageSize,i=this.sourceItems.slice(e,t);return bus.$emit("pagerEvent",i),i},pageLinks:function(){var e=[];e.push(this.current+1);var t=this.current>0?this.current:-1;e.unshift(t);var i=this.current>1?this.current-1:-1;e.unshift(i);var n=this.totalPages-this.current>1?this.current+2:-1;e.push(n);var a=this.totalPages-this.current>2?this.current+3:-1;return e.push(a),e}},watch:{sourceItems:function(){this.current=0},pageSize:function(){this.current=0}}}),Vue.component("sortIndicator",{template:'\n
    \n \n \n
    \n ',props:{colname:String,selectedcolname:String,asc:Boolean},computed:{isActive:function(){return this.colname.toLowerCase()==this.selectedcolname.toLowerCase()}}}),Vue.component("mediaFieldThumbsContainer",{template:'
    {{T.noImages}}
  • {{ media.isNew ? media.name.substr(36) : media.name }}
    {{ T.mediaNotFound }} {{ T.discardWarning }}
    {{ media.name }}
  • ',data:function(){return{T:{}}},props:{mediaItems:Array,selectedMedia:Object,thumbSize:Number,idPrefix:String},created:function(){var e=this;e.T.mediaNotFound=$("#t-media-not-found").val(),e.T.discardWarning=$("#t-discard-warning").val(),e.T.noImages=$("#t-no-images").val()},methods:{selectAndDeleteMedia:function(e){this.$parent.$emit("selectAndDeleteMediaRequested",e)},selectMedia:function(e){this.$parent.$emit("selectMediaRequested",e)},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}});var mediaFieldApps=[];Vue.component("upload",{template:'

    {{ model.name }}

    Error: {{ model.errorMessage }}
    ',props:{model:Object,uploadInputId:String},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadprogress",(function(e,i){i.files[0].name===t.model.name&&(t.model.percentage=parseInt(i.loaded/i.total*100,10))})),$(i).bind("fileuploaddone",(function(e,i){i.files[0].name===t.model.name&&(i.result.files[0].error?t.handleFailure(i.files[0].name,i.result.files[0].error):bus.$emit("removalRequest",t.model))})),$(i).bind("fileuploadfail",(function(e,i){i.files[0].name===t.model.name&&t.handleFailure(i.files[0].name,$("#t-error").val())}))},methods:{handleFailure:function(e,t){e===this.model.name&&(this.model.errorMessage=t,bus.$emit("ErrorOnUpload",this.model))},dismissWarning:function(){bus.$emit("removalRequest",this.model)}}}),Vue.component("uploadList",{template:'
    {{ T.uploads }} (Pending: {{ pendingCount }}) ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} )
    ',data:function(){return{files:[],T:{},expanded:!1,pendingCount:0,errorCount:0}},props:{uploadInputId:String},created:function(){var e=this;e.T.uploads=$("#t-uploads").val(),e.T.errors=$("#t-errors").val(),e.T.clearErrors=$("#t-clear-errors").val()},computed:{fileCount:function(){return this.files.length}},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadadd",(function(e,i){i.files&&i.files.forEach((function(e){t.files.some((function(t){return t.name==e.name}))?console.error("A file with the same name is already on the queue:"+e.name):t.files.push({name:e.name,percentage:0,errorMessage:""})}))})),bus.$on("removalRequest",(function(e){t.files.forEach((function(t,i,n){t.name==e.name&&n.splice(i,1)}))})),bus.$on("ErrorOnUpload",(function(e){t.updateCount()}))},methods:{updateCount:function(){this.errorCount=this.files.filter((function(e){return""!=e.errorMessage})).length,this.pendingCount=this.files.length-this.errorCount,this.files.length<1&&(this.expanded=!1)},clearErrors:function(){this.files=this.files.filter((function(e){return""==e.errorMessage}))}},watch:{files:function(){this.updateCount()}}}); +function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_promisePipe:(i=e.fn.jquery.split("."),Number(i[0])>1||Number(i[1])>7?"then":"pipe"),_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)Object.prototype.hasOwnProperty.call(e._response,t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,a=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&a-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",a=(t.prop("files")||[1]).length;a;)n.push(i),a-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var a=e.Deferred(),o=a.promise();return i=i||this.options.context||o,!0===t?a.resolveWith(i,n):!1===t&&a.rejectWith(i,n),o.abort=a.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,i){var n=this,a=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,o){return(t||o)&&(i._processQueue=this._processQueue=(this._processQueue||a([this]))[n._promisePipe]((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():a(arguments)}))[n._promisePipe](t,o)),this._processQueue||a([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,a,o=this,r=t.files[0],s=r.size,l=t.uploadedBytes,d=t.maxChunkSize||s,c=this._blobSlice,u=e.Deferred(),m=u.promise();return!(!(this._isXHRUpload(t)&&c&&(l||("function"===e.type(d)?d(t):d)=s?(r.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",r.error])):(a=function(){var i=e.extend({},t),m=i._progress.loaded;i.blob=c.call(r,l,l+("function"===e.type(d)?d(i):d),r.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,o._trigger("chunkbeforesend",null,i),o._initXHRData(i),o._initProgressListener(i),n=(!1!==o._trigger("chunksend",null,i)&&e.ajax(i)||o._getXHRPromise(!1,i.context)).done((function(n,r,d){l=o._getUploadedBytes(d)||l+i.chunkSize,m+i.chunkSize-i._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=r,i.jqXHR=d,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),ls._sending)for(var n=s._slots.shift();n;){if("pending"===s._getDeferredState(n)){n.resolve();break}n=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),r=o[s._promisePipe](d)):(this._sequence=this._sequence[s._promisePipe](d,d),r=this._sequence),r.abort=function(){return a=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(l.context,a),d())},this._enhancePromise(r)):d()},_onAdd:function(t,i){var n,a,o,r,s=this,l=!0,d=e.extend({},this.options,i),c=i.files,u=c.length,m=d.limitMultiFileUploads,p=d.limitMultiFileUploadSize,f=d.limitMultiFileUploadSizeOverhead,h=0,g=this._getParamName(d),v=0;if(!u)return!1;if(p&&void 0===c[0].size&&(p=void 0),(d.singleFileUploads||m||p)&&this._isXHRUpload(d))if(d.singleFileUploads||p||!m)if(!d.singleFileUploads&&p)for(o=[],n=[],r=0;rp||m&&r+1-v>=m)&&(o.push(c.slice(v,r+1)),(a=g.slice(v,r+1)).length||(a=g),n.push(a),v=r+1,h=0);else n=g;else for(o=[],n=[],r=0;r").append(n)[0].reset(),i.after(n).detach(),a&&n.trigger("focus"),e.cleanData(i.off("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,a=this,o=e.Deferred(),r=[],s=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])},l=function(){n.readEntries((function(e){e.length?(r=r.concat(e),l()):function(e){a._handleFileTreeEntries(e,i+t.name+"/").done((function(e){o.resolve(e)})).fail(s)}(r)}),s)};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file((function(e){e.relativePath=i,o.resolve(e)}),s):t.isDirectory?(n=t.createReader(),l()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)})))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,a=(t=e(t)).prop("entries");if(a&&a.length)return this._handleFileTreeEntries(a);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(a){n.files=a,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,a={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){a.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),a)&&i._onAdd(t,a)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,a){var o,r=a.name.toLowerCase();/^data-/.test(r)&&(r=r.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),o=n[r],t._isRegExpOption(r,o)&&(o=t._getRegExp(o)),i[r]=o)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,a=this,o=e.Deferred(),r=o.promise();return r.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),r)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=a._onSend(null,t)).then((function(e,t,i){o.resolve(e,t,i)}),(function(e,t,i){o.reject(e,t,i)}))):o.reject())})),this._enhancePromise(r)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0,i=e,n="parseJSON";"JSON"in window&&"parse"in JSON&&(i=JSON,n="parse"),e.ajaxTransport("iframe",(function(i){if(i.async){var n,a,o,r=i.initialIframeSrc||"javascript:false;";return{send:function(s,l){(n=e('
    ')).attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),a=e('').on("load",(function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];a.off("load").on("load",(function(){var t;try{if(!(t=a.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",a.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",o[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),window.setTimeout((function(){n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var a=e(t[i]);e(n).prop("name",a.prop("name")).attr("form",a.attr("form")),a.replaceWith(n)}))}),0)})),n.append(a).appendTo(document.body)},abort:function(){a&&a.off("load").prop("src",r),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}));var bus=new Vue;function initializeMediaApplication(e,t,i){initialized||(initialized=!0,t||console.error("mediaApplicationUrl variable is not defined"),$.ajax({url:t,method:"GET",success:function(t){$(".ta-content").append(t),$(document).trigger("mediaapplication:ready");var n={name:$("#t-mediaLibrary").text(),path:"",folder:"",isDirectory:!0,canCreateFolder:"true"===$("#allowNewRootFolders").val()};mediaApp=new Vue({el:"#mediaApp",data:{selectedFolder:{},mediaItems:[],selectedMedias:[],errors:[],dragDropThumbnail:new Image,smallThumbs:!1,gridView:!1,mediaFilter:"",sortBy:"",sortAsc:!0,itemsInPage:[]},created:function(){var e=this;e.dragDropThumbnail.src=(i||"")+"/OrchardCore.Media/Images/drag-thumbnail.png",bus.$on("folderSelected",(function(t){e.selectedFolder=t})),bus.$on("folderDeleted",(function(){e.selectRoot()})),bus.$on("folderAdded",(function(t){e.selectedFolder=t,t.selected=!0})),bus.$on("mediaListMoved",(function(t){e.loadFolder(e.selectedFolder),t&&e.errors.push(t)})),bus.$on("mediaRenamed",(function(t,i,n,a){var o=e.mediaItems.filter((function(e){return e.mediaPath===n}))[0];o.mediaPath=i,o.name=t,o.url=a})),bus.$on("createFolderRequested",(function(t){e.createFolder()})),bus.$on("deleteFolderRequested",(function(t){e.deleteFolder()})),bus.$on("sortChangeRequested",(function(t){e.changeSort(t)})),bus.$on("mediaToggleRequested",(function(t){e.toggleSelectionOfMedia(t)})),bus.$on("renameMediaRequested",(function(t){e.renameMedia(t)})),bus.$on("deleteMediaRequested",(function(t){e.deleteMediaItem(t)})),bus.$on("mediaDragStartRequested",(function(t,i){e.handleDragStart(t,i)})),bus.$on("pagerEvent",(function(t){e.itemsInPage=t,e.selectedMedias=[]})),localStorage.getItem("mediaApplicationPrefs")?e.currentPrefs=JSON.parse(localStorage.getItem("mediaApplicationPrefs")):e.selectedFolder=n},computed:{isHome:function(){return this.selectedFolder==n},parents:function(){var e=[];for(parentFolder=this.selectedFolder;parentFolder&&""!=parentFolder.path;)e.unshift(parentFolder),parentFolder=parentFolder.parent;return e},root:function(){return n},filteredMediaItems:function(){var e=this;e.selectedMedias=[];var t=e.mediaItems.filter((function(t){return t.name.toLowerCase().indexOf(e.mediaFilter.toLowerCase())>-1}));switch(e.sortBy){case"size":t.sort((function(t,i){return e.sortAsc?t.size-i.size:i.size-t.size}));break;case"mime":t.sort((function(t,i){return e.sortAsc?t.mime.toLowerCase().localeCompare(i.mime.toLowerCase()):i.mime.toLowerCase().localeCompare(t.mime.toLowerCase())}));break;case"lastModify":t.sort((function(t,i){return e.sortAsc?t.lastModify-i.lastModify:i.lastModify-t.lastModify}));break;default:t.sort((function(t,i){return e.sortAsc?t.name.toLowerCase().localeCompare(i.name.toLowerCase()):i.name.toLowerCase().localeCompare(t.name.toLowerCase())}))}return t},hiddenCount:function(){return this.mediaItems.length-this.filteredMediaItems.length},thumbSize:function(){return this.smallThumbs?100:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs,selectedFolder:this.selectedFolder,gridView:this.gridView}},set:function(e){e&&(this.smallThumbs=e.smallThumbs,this.selectedFolder=e.selectedFolder,this.gridView=e.gridView)}}},watch:{currentPrefs:function(e){localStorage.setItem("mediaApplicationPrefs",JSON.stringify(e))},selectedFolder:function(e){this.mediaFilter="",this.selectedFolder=e,this.loadFolder(e)}},mounted:function(){this.$refs.rootFolder.toggle()},methods:{uploadUrl:function(){if(!this.selectedFolder)return null;var e=$("#uploadFiles").val(),t=$("#allowedExtensions").val();return t&&""!==t&&(e=e+(-1==e.indexOf("?")?"?":"&")+"extensions="+encodeURIComponent(t)),e+(-1==e.indexOf("?")?"?":"&")+"path="+encodeURIComponent(this.selectedFolder.path)},selectRoot:function(){this.selectedFolder=this.root},loadFolder:function(e){this.errors=[],this.selectedMedias=[];var t=this,i=$("#getMediaItemsUrl").val(),n=$("#allowedExtensions").val();n&&""!==n&&(i=i+(-1==i.indexOf("?")?"?":"&")+"extensions="+encodeURIComponent(n)),console.log(e.path),$.ajax({url:i+(-1==i.indexOf("?")?"?":"&")+"path="+encodeURIComponent(e.path),method:"GET",success:function(e){e.forEach((function(e){e.open=!1})),t.mediaItems=e,t.selectedMedias=[],t.sortBy="",t.sortAsc=!0},error:function(i){console.log("error loading folder:"+e.path),t.selectRoot()}})},refresh:function(){var e=this;e.selectedFolder&&e.loadFolder(e.selectedFolder)},selectAll:function(){this.selectedMedias=[];for(var e=0;e-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",t.selectedMedias[i]))}t.selectedMedias=[]},error:function(e){console.error(e.responseText)}})}}}))},deleteMediaItem:function(e){var t=this;e&&confirmDialog(_objectSpread(_objectSpread({},$("#deleteMedia").data()),{},{callback:function(i){i&&$.ajax({url:$("#deleteMediaUrl").val()+"?path="+encodeURIComponent(e.mediaPath),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(i){var n=t.mediaItems&&t.mediaItems.indexOf(e);n>-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",e))},error:function(e){console.error(e.responseText)}})}}))},handleDragStart:function(e,t){var i=[];this.selectedMedias.forEach((function(e){i.push(e.name)})),0==this.isMediaSelected(e)&&(i.push(e.name),this.selectedMedias.push(e)),t.dataTransfer.setData("mediaNames",JSON.stringify(i)),t.dataTransfer.setData("sourceFolder",this.selectedFolder.path),t.dataTransfer.setDragImage(this.dragDropThumbnail,10,10),t.dataTransfer.effectAllowed="move"},handleScrollWhileDrag:function(e){e.clientY<150&&window.scrollBy(0,-10),e.clientY>window.innerHeight-100&&window.scrollBy(0,10)},changeSort:function(e){this.sortBy==e?this.sortAsc=!this.sortAsc:(this.sortAsc=!0,this.sortBy=e)}}}),$("#create-folder-name").keypress((function(e){if(13==e.which)return $("#modalFooterOk").click(),!1})),$("#modalFooterOk").on("click",(function(e){var t=$("#create-folder-name").val();""!==t&&$.ajax({url:$("#createFolderUrl").val()+"?path="+encodeURIComponent(mediaApp.selectedFolder.path)+"&name="+encodeURIComponent(t),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bus.$emit("addFolder",mediaApp.selectedFolder,e),bootstrap.Modal.getOrCreateInstance($("#createFolderModal")).hide()},error:function(e){$("#createFolderModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#createFolderModal-errors"))}})})),$("#renameMediaModalFooterOk").on("click",(function(e){var t=$("#new-item-name").val(),i=$("#old-item-name").val();if(""!==t){var n=mediaApp.selectedFolder.path+"/";"/"===n&&(n="");var a=n+t,o=n+i;if(a.toLowerCase()!==o.toLowerCase())$.ajax({url:$("#renameMediaUrl").val()+"?oldPath="+encodeURIComponent(o)+"&newPath="+encodeURIComponent(a),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide(),bus.$emit("mediaRenamed",t,a,o,e.newUrl)},error:function(e){$("#renameMediaModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#renameMediaModal-errors"))}});else bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide()}})),e&&(document.getElementById("mediaApp").style.display=""),$(document).trigger("mediaApp:ready")},error:function(e){console.error(e.responseText)}}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t\n \n
      \n \n \n
    \n \n '),props:{model:Object,selectedInMediaApp:Object,level:Number},data:function(){return{open:!1,children:null,parent:null,isHovered:!1,padding:0}},computed:{empty:function(){return!this.children||0==this.children.length},isSelected:function(){return this.selectedInMediaApp.name==this.model.name&&this.selectedInMediaApp.path==this.model.path},isRoot:function(){return""===this.model.path},canCreateFolder:function(){return void 0===this.model.canCreateFolder||this.model.canCreateFolder},canDeleteFolder:function(){return void 0===this.model.canDeleteFolder||this.model.canDeleteFolder}},mounted:function(){0==this.isRoot&&this.isAncestorOfSelectedFolder()&&this.toggle(),this.padding=this.level<3?16:16+8*this.level},created:function(){var e=this;bus.$on("deleteFolder",(function(t){if(e.children){var i=e.children&&e.children.indexOf(t);i>-1&&(e.children.splice(i,1),bus.$emit("folderDeleted"))}})),bus.$on("addFolder",(function(t,i){e.model==t&&(null!==e.children&&e.children.push(i),i.parent=e.model,bus.$emit("folderAdded",i))}))},methods:{isAncestorOfSelectedFolder:function(){for(parentFolder=mediaApp.selectedFolder;parentFolder;){if(parentFolder.path==this.model.path)return!0;parentFolder=parentFolder.parent}return!1},toggle:function(){this.open=!this.open,this.open&&!this.children&&this.loadChildren()},select:function(){bus.$emit("folderSelected",this.model),this.loadChildren()},createFolder:function(){bus.$emit("createFolderRequested")},deleteFolder:function(){bus.$emit("deleteFolderRequested")},loadChildren:function(){var e=this;0==this.open&&(this.open=!0),$.ajax({url:$("#getFoldersUrl").val()+"?path="+encodeURIComponent(e.model.path),method:"GET",success:function(t){e.children=t,e.children.forEach((function(t){t.parent=e.model}))},error:function(e){emtpy=!1,console.error(e.responseText)}})},handleDragOver:function(e){this.isHovered=!0},handleDragLeave:function(e){this.isHovered=!1},moveMediaToFolder:function(e,t){this.isHovered=!1;var i=JSON.parse(t.dataTransfer.getData("mediaNames"));if(!(i.length<1)){var n=t.dataTransfer.getData("sourceFolder"),a=e.path;""===n&&(n="root"),""===a&&(a="root"),n!==a?confirmDialog(_objectSpread(_objectSpread({},$("#moveMedia").data()),{},{callback:function(e){e&&$.ajax({url:$("#moveMediaListUrl").val(),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),mediaNames:i,sourceFolder:n,targetFolder:a},success:function(){bus.$emit("mediaListMoved")},error:function(e){console.error(e.responseText),bus.$emit("mediaListMoved",e.responseText)}})}})):alert($("#sameFolderMessage").val())}}}});var faIcons={image:"fa-regular fa-image",pdf:"fa-regular fa-file-pdf",word:"fa-regular fa-file-word",powerpoint:"fa-regular fa-file-powerpoint",excel:"fa-regular fa-file-excel",csv:"fa-regular fa-file",audio:"fa-regular fa-file-audio",video:"fa-regular fa-file-video",archive:"fa-regular fa-file-zipper",code:"fa-regular fa-file-code",text:"fa-regular fa-file-lines",file:"fa-regular fa-file"},faThumbnails={gif:faIcons.image,jpeg:faIcons.image,jpg:faIcons.image,png:faIcons.image,pdf:faIcons.pdf,doc:faIcons.word,docx:faIcons.word,ppt:faIcons.powerpoint,pptx:faIcons.powerpoint,xls:faIcons.excel,xlsx:faIcons.excel,csv:faIcons.csv,aac:faIcons.audio,mp3:faIcons.audio,ogg:faIcons.audio,avi:faIcons.video,flv:faIcons.video,mkv:faIcons.video,mp4:faIcons.video,webm:faIcons.video,gz:faIcons.archive,zip:faIcons.archive,css:faIcons.code,html:faIcons.code,js:faIcons.code,txt:faIcons.text};function getClassNameForExtension(e){return faThumbnails[e.toLowerCase()]||faIcons.file}function getExtensionForFilename(e){return e.slice(2+(e.lastIndexOf(".")-1>>>0))}function getClassNameForFilename(e){return getClassNameForExtension(getExtensionForFilename(e))}function initializeAttachedMediaField(e,t,i,n,a,o,r,s,l){var d,c=$(document.getElementById($(e).data("for"))).data("init"),u=$(e),m=u.attr("id");mediaFieldApps.push(d=new Vue({el:u.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:m,initialized:!1,allowMediaText:o,backupMediaText:"",allowAnchors:r,backupAnchor:null,mediaTextmodal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,isRemoved:t.isRemoved,isNew:t.isNew,mediaText:t.mediaText,anchor:t.anchor,attachedFileName:t.attachedFileName})})),JSON.stringify(e)):JSON.stringify(c)},set:function(e){var t=this,i=e||[],a=$.Deferred(),o=[],r=0;i.forEach((function(e,i){o.push({name:" "+e.path,mime:"",mediaPath:"",anchor:e.anchor,attachedFileName:e.attachedFileName}),promise=$.when(a).done((function(){$.ajax({url:n+"?path="+encodeURIComponent(e.path),method:"GET",success:function(n){n.vuekey=n.name+i.toString(),n.mediaText=e.mediaText,n.anchor=e.anchor,n.attachedFileName=e.attachedFileName,o.splice(i,1,n),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(n){console.log(JSON.stringify(n)),o.splice(i,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:.5,y:.5},attachedFileName:e.attachedFileName}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){for(var e=[],t=0;t0&&a},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=c,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)}));var n="#"+t,o=u.attr("id"),r=randomUUID();$(n).fileupload({limitConcurrentUploads:20,dropZone:$("#"+o),dataType:"json",url:i,maxChunkSize:l,add:function(t,i){var n,a=i.files.length;for(n=0;n0)for(var o=0;o1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(i[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(i),d.initialized=!0)):alert(n)},error:function(e,t,i){console.log("Error on upload."),console.log(e),console.log(t),console.log(i)}}).on("fileuploadchunkbeforesend",(function(e,t){var i=t.files[0];t.blob=new File([t.blob],i.name,{type:i.type,lastModified:i.lastModified})}))},methods:{selectMedia:function(e){this.selectedMedia=e},getUniqueId:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(t,1))}else 1===this.mediaItems.length&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(0,1));this.selectedMedia=null},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e;return t<17?t=17:t-=8,t+"px"}return"0"},anchorTop:function(){if(this.$refs.anchorImage&&this.selectedMedia){var e=this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight;return e<15?e=15:e+=5,e+"px"}return"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(e[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(e),d.initialized=!0)},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}function initializeMediaField(e,t,i,n,a,o,r){if(null!==e){var s,l=$(document.getElementById($(e).data("for"))).data("init"),d=$(e),c=d.attr("id");t.addEventListener("hidden.bs.modal",(function(e){$("#mediaApp").appendTo("body"),$("#mediaApp").hide()})),mediaFieldApps.push(s=new Vue({el:d.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:c,initialized:!1,allowMediaText:a,backupMediaText:"",allowAnchors:o,allowedExtensions:r,backupAnchor:null,mediaTextModal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,mediaText:t.mediaText,anchor:t.anchor})})),JSON.stringify(e)):JSON.stringify(l)},set:function(e){var t=this,n=e||[],a=$.Deferred(),o=[],r=0;n.forEach((function(e,n){o.push({name:" "+e.path,mime:"",mediaPath:""}),promise=$.when(a).done((function(){$.ajax({url:i+"?path="+encodeURIComponent(e.path),method:"GET",success:function(i){i.vuekey=i.name+n.toString(),i.mediaText=e.mediaText,i.anchor=e.anchor,o.splice(n,1,i),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(i){console.log(i),o.splice(n,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:0,y:0}}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){return 0===this.mediaItems.length||this.mediaItems.length>0&&n},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=l,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)})),e.$on("filesUploaded",(function(t){e.addMediaFiles(t)}))},methods:{selectMedia:function(e){this.selectedMedia=e},showModal:function(e){var i=this;if(i.canAddMedia){$("#allowedExtensions").val(this.allowedExtensions),$("#fileupload").attr("accept",this.allowedExtensions),$("#mediaApp").appendTo($(t).find(".modal-body")),$("#mediaApp").show(),mediaApp.refresh();var n=new bootstrap.Modal(t);n.show(),$(t).find(".mediaFieldSelectButton").off("click").on("click",(function(e){return i.addMediaFiles(mediaApp.selectedMedias),mediaApp.selectedMedias=[],n.hide(),!0}))}},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e,i=Math.round(this.$refs.modalBody.querySelector(".icon-media-anchor").clientWidth);return Number.isInteger(i)&&(t-=i/2),t+"px"}return"0"},anchorTop:function(){return this.$refs.anchorImage&&this.selectedMedia?this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight+"px":"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===n?(alert($("#onlyOneItemMessage").val()),s.mediaItems.push(e[0]),s.initialized=!0):(s.mediaItems=s.mediaItems.concat(e),s.initialized=!0)},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&this.mediaItems.splice(t,1)}else 1===this.mediaItems.length&&this.mediaItems.splice(0,1);this.selectedMedia=null},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}}Vue.component("media-items-grid",{template:'\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ',data:function(){return{T:{}}},props:{filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){this.T.editButton=$("#t-edit-button").val(),this.T.deleteButton=$("#t-delete-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("media-items-table",{template:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ',data:function(){return{T:{}}},props:{sortBy:String,sortAsc:Boolean,filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){var e=this;e.T.imageHeader=$("#t-image-header").val(),e.T.nameHeader=$("#t-name-header").val(),e.T.lastModifyHeader=$("#t-lastModify-header").val(),e.T.sizeHeader=$("#t-size-header").val(),e.T.typeHeader=$("#t-type-header").val(),e.T.editButton=$("#t-edit-button").val(),e.T.deleteButton=$("#t-delete-button").val(),e.T.viewButton=$("#t-view-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},changeSort:function(e){bus.$emit("sortChangeRequested",e)},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},printDateTime:function(e){return new Date(e).toLocaleString()},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("pager",{template:'\n
    \n \n \n
    \n ',props:{sourceItems:Array},data:function(){return{pageSize:10,pageSizeOptions:[10,30,50,100],current:0,T:{}}},created:function(){var e=this;e.T.pagerFirstButton=$("#t-pager-first-button").val(),e.T.pagerPreviousButton=$("#t-pager-previous-button").val(),e.T.pagerNextButton=$("#t-pager-next-button").val(),e.T.pagerLastButton=$("#t-pager-last-button").val(),e.T.pagerPageSizeLabel=$("#t-pager-page-size-label").val(),e.T.pagerPageLabel=$("#t-pager-page-label").val(),e.T.pagerTotalLabel=$("#t-pager-total-label").val()},methods:{next:function(){this.current=this.current+1},previous:function(){this.current=this.current-1},goFirst:function(){this.current=0},goLast:function(){this.current=this.totalPages-1},goTo:function(e){this.current=e}},computed:{total:function(){return this.sourceItems?this.sourceItems.length:0},totalPages:function(){var e=Math.ceil(this.total/this.pageSize);return e>0?e:1},isLastPage:function(){return this.current+1>=this.totalPages},isFirstPage:function(){return 0===this.current},canDoNext:function(){return!this.isLastPage},canDoPrev:function(){return!this.isFirstPage},canDoFirst:function(){return!this.isFirstPage},canDoLast:function(){return!this.isLastPage},itemsInCurrentPage:function(){var e=this.pageSize*this.current,t=e+this.pageSize,i=this.sourceItems.slice(e,t);return bus.$emit("pagerEvent",i),i},pageLinks:function(){var e=[];e.push(this.current+1);var t=this.current>0?this.current:-1;e.unshift(t);var i=this.current>1?this.current-1:-1;e.unshift(i);var n=this.totalPages-this.current>1?this.current+2:-1;e.push(n);var a=this.totalPages-this.current>2?this.current+3:-1;return e.push(a),e}},watch:{sourceItems:function(){this.current=0},pageSize:function(){this.current=0}}}),Vue.component("sortIndicator",{template:'\n
    \n \n \n
    \n ',props:{colname:String,selectedcolname:String,asc:Boolean},computed:{isActive:function(){return this.colname.toLowerCase()==this.selectedcolname.toLowerCase()}}}),Vue.component("mediaFieldThumbsContainer",{template:'
    {{T.noImages}}
  • {{ media.isNew ? media.name.substr(36) : media.name }}
    {{ T.mediaNotFound }} {{ T.discardWarning }}
    {{ media.name }}
  • ',data:function(){return{T:{}}},props:{mediaItems:Array,selectedMedia:Object,thumbSize:Number,idPrefix:String},created:function(){var e=this;e.T.mediaNotFound=$("#t-media-not-found").val(),e.T.discardWarning=$("#t-discard-warning").val(),e.T.noImages=$("#t-no-images").val()},methods:{selectAndDeleteMedia:function(e){this.$parent.$emit("selectAndDeleteMediaRequested",e)},selectMedia:function(e){this.$parent.$emit("selectMediaRequested",e)},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}});var mediaFieldApps=[];Vue.component("upload",{template:'

    {{ model.name }}

    Error: {{ model.errorMessage }}
    ',props:{model:Object,uploadInputId:String},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadprogress",(function(e,i){i.files[0].name===t.model.name&&(t.model.percentage=parseInt(i.loaded/i.total*100,10))})),$(i).bind("fileuploaddone",(function(e,i){i.files[0].name===t.model.name&&(i.result.files[0].error?t.handleFailure(i.files[0].name,i.result.files[0].error):bus.$emit("removalRequest",t.model))})),$(i).bind("fileuploadfail",(function(e,i){i.files[0].name===t.model.name&&t.handleFailure(i.files[0].name,$("#t-error").val())}))},methods:{handleFailure:function(e,t){e===this.model.name&&(this.model.errorMessage=t,bus.$emit("ErrorOnUpload",this.model))},dismissWarning:function(){bus.$emit("removalRequest",this.model)}}}),Vue.component("uploadList",{template:'
    {{ T.uploads }} (Pending: {{ pendingCount }}) ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} )
    ',data:function(){return{files:[],T:{},expanded:!1,pendingCount:0,errorCount:0}},props:{uploadInputId:String},created:function(){var e=this;e.T.uploads=$("#t-uploads").val(),e.T.errors=$("#t-errors").val(),e.T.clearErrors=$("#t-clear-errors").val()},computed:{fileCount:function(){return this.files.length}},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadadd",(function(e,i){i.files&&i.files.forEach((function(e){t.files.some((function(t){return t.name==e.name}))?console.error("A file with the same name is already on the queue:"+e.name):t.files.push({name:e.name,percentage:0,errorMessage:""})}))})),bus.$on("removalRequest",(function(e){t.files.forEach((function(t,i,n){t.name==e.name&&n.splice(i,1)}))})),bus.$on("ErrorOnUpload",(function(e){t.updateCount()}))},methods:{updateCount:function(){this.errorCount=this.files.filter((function(e){return""!=e.errorMessage})).length,this.pendingCount=this.files.length-this.errorCount,this.files.length<1&&(this.expanded=!1)},clearErrors:function(){this.files=this.files.filter((function(e){return""==e.errorMessage}))}},watch:{files:function(){this.updateCount()}}}); diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/Sortable.min.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/Sortable.min.js index 95423a64911..abe4ddbfff0 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/Sortable.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/Sortable.min.js @@ -1,2 +1,2 @@ -/*! Sortable 1.15.6 - MIT | git://github.com/SortableJS/Sortable.git */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function e(e,t){var n,o=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)),o}function I(o){for(var t=1;tt.length)&&(e=t.length);for(var n=0,o=new Array(e);n"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&f(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function D(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[K]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return kt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jt.supportPointer&&"PointerEvent"in window&&(!u||c),emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},ft=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){D(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),a.supportPointer?(h(l,"pointerup",i._onDrop),this.nativeDraggable||h(l,"pointercancel",i._onDrop)):(h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop)),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(a.supportPointer?(h(l,"pointerup",i._disableDelayedDrag),h(l,"pointercancel",i._disableDelayedDrag)):(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag)),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;p(t,"mouseup",this._disableDelayedDrag),p(t,"touchend",this._disableDelayedDrag),p(t,"touchcancel",this._disableDelayedDrag),p(t,"pointerup",this._disableDelayedDrag),p(t,"pointercancel",this._disableDelayedDrag),p(t,"mousemove",this._delayedDragTouchMoveHandler),p(t,"touchmove",this._delayedDragTouchMoveHandler),p(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Dt=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&E(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Dt){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))E.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>E.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientYt.length)&&(e=t.length);for(var n=0,o=new Array(e);n"===e[0]&&(e=e.substring(1)),t))try{if(t.matches)return t.matches(e);if(t.msMatchesSelector)return t.msMatchesSelector(e);if(t.webkitMatchesSelector)return t.webkitMatchesSelector(e)}catch(t){return}}function g(t){return t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode}function P(t,e,n,o){if(t){n=n||document;do{if(null!=e&&(">"!==e[0]||t.parentNode===n)&&p(t,e)||o&&t===n)return t}while(t!==n&&(t=g(t)))}return null}var m,v=/\s+/g;function k(t,e,n){var o;t&&e&&(t.classList?t.classList[n?"add":"remove"](e):(o=(" "+t.className+" ").replace(v," ").replace(" "+e+" "," "),t.className=(o+(n?" "+e:"")).replace(v," ")))}function R(t,e,n){var o=t&&t.style;if(o){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(t,""):t.currentStyle&&(n=t.currentStyle),void 0===e?n:n[e];o[e=!(e in o||-1!==e.indexOf("webkit"))?"-webkit-"+e:e]=n+("string"==typeof n?"":"px")}}function b(t,e){var n="";if("string"==typeof t)n=t;else do{var o=R(t,"transform")}while(o&&"none"!==o&&(n=o+" "+n),!e&&(t=t.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function E(t,e,n){if(t){var o=t.getElementsByTagName(e),i=0,r=o.length;if(n)for(;i=n.left-e&&i<=n.right+e,e=r>=n.top-e&&r<=n.bottom+e;return o&&e?a=t:void 0}}),a);if(e){var n,o={};for(n in t)t.hasOwnProperty(n)&&(o[n]=t[n]);o.target=o.rootEl=e,o.preventDefault=void 0,o.stopPropagation=void 0,e[K]._onDragOver(o)}}var i,r,a}function Ft(t){Z&&Z.parentNode[K]._isOutsideThisEl(t.target)}function jt(t,e){if(!t||!t.nodeType||1!==t.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(t));this.el=t,this.options=e=a({},e),t[K]=this;var n,o,i={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(t.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return kt(t,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(t,e){t.setData("Text",e.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==jt.supportPointer&&"PointerEvent"in window&&!u,emptyInsertThreshold:5};for(n in z.initializePlugins(this,t,i),i)n in e||(e[n]=i[n]);for(o in Rt(e),this)"_"===o.charAt(0)&&"function"==typeof this[o]&&(this[o]=this[o].bind(this));this.nativeDraggable=!e.forceFallback&&It,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?h(t,"pointerdown",this._onTapStart):(h(t,"mousedown",this._onTapStart),h(t,"touchstart",this._onTapStart)),this.nativeDraggable&&(h(t,"dragover",this),h(t,"dragenter",this)),St.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),a(this,A())}function Ht(t,e,n,o,i,r,a,l){var s,c,u=t[K],d=u.options.onMove;return!window.CustomEvent||y||w?(s=document.createEvent("Event")).initEvent("move",!0,!0):s=new CustomEvent("move",{bubbles:!0,cancelable:!0}),s.to=e,s.from=t,s.dragged=n,s.draggedRect=o,s.related=i||e,s.relatedRect=r||X(e),s.willInsertAfter=l,s.originalEvent=a,t.dispatchEvent(s),c=d?d.call(u,s,a):c}function Lt(t){t.draggable=!1}function Kt(){xt=!1}function Wt(t){return setTimeout(t,0)}function zt(t){return clearTimeout(t)}jt.prototype={constructor:jt,_isOutsideThisEl:function(t){this.el.contains(t)||t===this.el||(vt=null)},_getDirection:function(t,e){return"function"==typeof this.options.direction?this.options.direction.call(this,t,e,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var n=this,o=this.el,t=this.options,i=t.preventOnFilter,r=e.type,a=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(a||e).target,s=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=t.filter;if(!function(t){Ot.length=0;var e=t.getElementsByTagName("input"),n=e.length;for(;n--;){var o=e[n];o.checked&&Ot.push(o)}}(o),!Z&&!(/mousedown|pointerdown/.test(r)&&0!==e.button||t.disabled)&&!s.isContentEditable&&(this.nativeDraggable||!u||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=P(l,t.draggable,o,!1))&&l.animated||et===l)){if(it=j(l),at=j(l,t.draggable),"function"==typeof c){if(c.call(this,e,l,this))return V({sortable:n,rootEl:s,name:"filter",targetEl:l,toEl:o,fromEl:o}),U("filter",n,{evt:e}),void(i&&e.cancelable&&e.preventDefault())}else if(c=c&&c.split(",").some(function(t){if(t=P(s,t.trim(),o,!1))return V({sortable:n,rootEl:t,name:"filter",targetEl:l,fromEl:o,toEl:o}),U("filter",n,{evt:e}),!0}))return void(i&&e.cancelable&&e.preventDefault());t.handle&&!P(s,t.handle,o,!1)||this._prepareDragStart(e,a,l)}}},_prepareDragStart:function(t,e,n){var o,i=this,r=i.el,a=i.options,l=r.ownerDocument;n&&!Z&&n.parentNode===r&&(o=X(n),J=r,$=(Z=n).parentNode,tt=Z.nextSibling,et=n,st=a.group,ut={target:jt.dragged=Z,clientX:(e||t).clientX,clientY:(e||t).clientY},pt=ut.clientX-o.left,gt=ut.clientY-o.top,this._lastX=(e||t).clientX,this._lastY=(e||t).clientY,Z.style["will-change"]="all",o=function(){U("delayEnded",i,{evt:t}),jt.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!s&&i.nativeDraggable&&(Z.draggable=!0),i._triggerDragStart(t,e),V({sortable:i,name:"choose",originalEvent:t}),k(Z,a.chosenClass,!0))},a.ignore.split(",").forEach(function(t){E(Z,t.trim(),Lt)}),h(l,"dragover",Bt),h(l,"mousemove",Bt),h(l,"touchmove",Bt),h(l,"mouseup",i._onDrop),h(l,"touchend",i._onDrop),h(l,"touchcancel",i._onDrop),s&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),U("delayStart",this,{evt:t}),!a.delay||a.delayOnTouchOnly&&!e||this.nativeDraggable&&(w||y)?o():jt.eventCanceled?this._onDrop():(h(l,"mouseup",i._disableDelayedDrag),h(l,"touchend",i._disableDelayedDrag),h(l,"touchcancel",i._disableDelayedDrag),h(l,"mousemove",i._delayedDragTouchMoveHandler),h(l,"touchmove",i._delayedDragTouchMoveHandler),a.supportPointer&&h(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(o,a.delay)))},_delayedDragTouchMoveHandler:function(t){t=t.touches?t.touches[0]:t;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Lt(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;f(t,"mouseup",this._disableDelayedDrag),f(t,"touchend",this._disableDelayedDrag),f(t,"touchcancel",this._disableDelayedDrag),f(t,"mousemove",this._delayedDragTouchMoveHandler),f(t,"touchmove",this._delayedDragTouchMoveHandler),f(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,e){e=e||"touch"==t.pointerType&&t,!this.nativeDraggable||e?this.options.supportPointer?h(document,"pointermove",this._onTouchMove):h(document,e?"touchmove":"mousemove",this._onTouchMove):(h(Z,"dragend",this),h(J,"dragstart",this._onDragStart));try{document.selection?Wt(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(t){}},_dragStarted:function(t,e){var n;Et=!1,J&&Z?(U("dragStarted",this,{evt:e}),this.nativeDraggable&&h(document,"dragover",Ft),n=this.options,t||k(Z,n.dragClass,!1),k(Z,n.ghostClass,!0),jt.active=this,t&&this._appendGhost(),V({sortable:this,name:"start",originalEvent:e})):this._nulling()},_emulateDragOver:function(){if(dt){this._lastX=dt.clientX,this._lastY=dt.clientY,Xt();for(var t=document.elementFromPoint(dt.clientX,dt.clientY),e=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(dt.clientX,dt.clientY))!==e;)e=t;if(Z.parentNode[K]._isOutsideThisEl(t),e)do{if(e[K])if(e[K]._onDragOver({clientX:dt.clientX,clientY:dt.clientY,target:t,rootEl:e})&&!this.options.dragoverBubble)break}while(e=g(t=e));Yt()}},_onTouchMove:function(t){if(ut){var e=this.options,n=e.fallbackTolerance,o=e.fallbackOffset,i=t.touches?t.touches[0]:t,r=Q&&b(Q,!0),a=Q&&r&&r.a,l=Q&&r&&r.d,e=At&&wt&&D(wt),a=(i.clientX-ut.clientX+o.x)/(a||1)+(e?e[0]-Tt[0]:0)/(a||1),l=(i.clientY-ut.clientY+o.y)/(l||1)+(e?e[1]-Tt[1]:0)/(l||1);if(!jt.active&&!Et){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))D.right+10||S.clientY>x.bottom&&S.clientX>x.left:S.clientY>D.bottom+10||S.clientX>x.right&&S.clientY>x.top)||m.animated)){if(m&&(t=n,e=r,C=X(B((_=this).el,0,_.options,!0)),_=L(_.el,_.options,Q),e?t.clientX<_.left-10||t.clientY - if (!String.prototype.startsWith) { - (function () { - 'use strict'; // needed to support `apply`/`call` with `undefined`/`null` - var toString = {}.toString; - var startsWith = function (search) { - if (this == null) { - throw new TypeError(); - } - var string = String(this); - if (search && toString.call(search) == '[object RegExp]') { - throw new TypeError(); - } - var stringLength = string.length; - var searchString = String(search); - var searchLength = searchString.length; - var position = arguments.length > 1 ? arguments[1] : undefined; - // `ToInteger` - var pos = position ? Number(position) : 0; - if (pos != pos) { // better `isNaN` - pos = 0; - } - var start = Math.min(Math.max(pos, 0), stringLength); - // Avoid the `indexOf` call if no match is possible - if (searchLength + start > stringLength) { - return false; - } - var index = -1; - while (++index < searchLength) { - if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) { + // shallow array comparison + function isEqual(array1, array2) { + return array1.length === array2.length && array1.every(function (element, index) { + return element === array2[index]; + }); + } + ; + + // + if (!String.prototype.startsWith) { + (function () { + 'use strict'; + + // needed to support `apply`/`call` with `undefined`/`null` + var toString = {}.toString; + var startsWith = function startsWith(search) { + if (this == null) { + throw new TypeError(); + } + var string = String(this); + if (search && toString.call(search) == '[object RegExp]') { + throw new TypeError(); + } + var stringLength = string.length; + var searchString = String(search); + var searchLength = searchString.length; + var position = arguments.length > 1 ? arguments[1] : undefined; + // `ToInteger` + var pos = position ? Number(position) : 0; + if (pos != pos) { + // better `isNaN` + pos = 0; + } + var start = Math.min(Math.max(pos, 0), stringLength); + // Avoid the `indexOf` call if no match is possible + if (searchLength + start > stringLength) { return false; } + var index = -1; + while (++index < searchLength) { + if (string.charCodeAt(start + index) != searchString.charCodeAt(index)) { + return false; + } + } + return true; + }; + if (Object.defineProperty) { + Object.defineProperty(String.prototype, 'startsWith', { + 'value': startsWith, + 'configurable': true, + 'writable': true + }); + } else { + String.prototype.startsWith = startsWith; } - return true; - }; - if (Object.defineProperty) { - Object.defineProperty(String.prototype, 'startsWith', { - 'value': startsWith, - 'configurable': true, - 'writable': true - }); - } else { - String.prototype.startsWith = startsWith; - } - }()); - } - - function toKebabCase (str) { - return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function ($, ofs) { - return (ofs ? '-' : '') + $.toLowerCase(); - }); - } - - function getSelectedOptions () { - var options = this.selectpicker.main.data; - - if (this.options.source.data || this.options.source.search) { - options = Object.values(this.selectpicker.optionValuesDataMap); + })(); } - - var selectedOptions = options.filter(function (item) { - if (item.selected) { - if (this.options.hideDisabled && item.disabled) return false; - return true; + function toKebabCase(str) { + return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, function ($, ofs) { + return (ofs ? '-' : '') + $.toLowerCase(); + }); + } + function getSelectedOptions() { + var options = this.selectpicker.main.data; + if (this.options.source.data || this.options.source.search) { + options = Object.values(this.selectpicker.optionValuesDataMap); } + var selectedOptions = options.filter(function (item) { + if (item.selected) { + if (this.options.hideDisabled && item.disabled) return false; + return true; + } + return false; + }, this); - return false; - }, this); - - // ensure only 1 option is selected if multiple are set in the data source - if (this.options.source.data && !this.multiple && selectedOptions.length > 1) { - for (var i = 0; i < selectedOptions.length - 1; i++) { - selectedOptions[i].selected = false; + // ensure only 1 option is selected if multiple are set in the data source + if (this.options.source.data && !this.multiple && selectedOptions.length > 1) { + for (var i = 0; i < selectedOptions.length - 1; i++) { + selectedOptions[i].selected = false; + } + selectedOptions = [selectedOptions[selectedOptions.length - 1]]; } - - selectedOptions = [ selectedOptions[selectedOptions.length - 1] ]; + return selectedOptions; } - return selectedOptions; - } - - // much faster than $.val() - function getSelectValues (selectedOptions) { - var value = [], + // much faster than $.val() + function getSelectValues(selectedOptions) { + var value = [], options = selectedOptions || getSelectedOptions.call(this), opt; - - for (var i = 0, len = options.length; i < len; i++) { - opt = options[i]; - - if (!opt.disabled) { - value.push(opt.value === undefined ? opt.text : opt.value); + for (var i = 0, len = options.length; i < len; i++) { + opt = options[i]; + if (!opt.disabled) { + value.push(opt.value === undefined ? opt.text : opt.value); + } } + if (!this.multiple) { + return !value.length ? null : value[0]; + } + return value; } - if (!this.multiple) { - return !value.length ? null : value[0]; - } - - return value; - } - - // set data-selected on select element if the value has been programmatically selected - // prior to initialization of bootstrap-select - // * consider removing or replacing an alternative method * - var valHooks = { - useDefault: false, - _set: $.valHooks.select.set - }; - - $.valHooks.select.set = function (elem, value) { - if (value && !valHooks.useDefault) $(elem).data('selected', true); - - return valHooks._set.apply(this, arguments); - }; - - var changedArguments = null; - - var EventIsSupported = (function () { - try { - new Event('change'); - return true; - } catch (e) { - return false; - } - })(); - - $.fn.triggerNative = function (eventName) { - var el = this[0], + // set data-selected on select element if the value has been programmatically selected + // prior to initialization of bootstrap-select + // * consider removing or replacing an alternative method * + var valHooks = { + useDefault: false, + _set: $.valHooks.select.set + }; + $.valHooks.select.set = function (elem, value) { + if (value && !valHooks.useDefault) $(elem).data('selected', true); + return valHooks._set.apply(this, arguments); + }; + var changedArguments = null; + var EventIsSupported = function () { + try { + new Event('change'); + return true; + } catch (e) { + return false; + } + }(); + $.fn.triggerNative = function (eventName) { + var el = this[0], event; - - if (el.dispatchEvent) { // for modern browsers & IE9+ - if (EventIsSupported) { - // For modern browsers - event = new Event(eventName, { - bubbles: true - }); - } else { - // For IE since it doesn't support Event constructor - event = document.createEvent('Event'); - event.initEvent(eventName, true, false); + if (el.dispatchEvent) { + // for modern browsers & IE9+ + if (EventIsSupported) { + // For modern browsers + event = new Event(eventName, { + bubbles: true + }); + } else { + // For IE since it doesn't support Event constructor + event = document.createEvent('Event'); + event.initEvent(eventName, true, false); + } + el.dispatchEvent(event); } + }; + // - el.dispatchEvent(event); - } - }; - // - - function stringSearch (li, searchString, method, normalize) { - var stringTypes = [ - 'display', - 'subtext', - 'tokens' - ], + function stringSearch(li, searchString, method, normalize) { + var stringTypes = ['display', 'subtext', 'tokens'], searchSuccess = false; - - for (var i = 0; i < stringTypes.length; i++) { - var stringType = stringTypes[i], + for (var i = 0; i < stringTypes.length; i++) { + var stringType = stringTypes[i], string = li[stringType]; + if (string) { + string = string.toString(); - if (string) { - string = string.toString(); - - // Strip HTML tags. This isn't perfect, but it's much faster than any other method - if (stringType === 'display') { - string = string.replace(/<[^>]+>/g, ''); - } - - if (normalize) string = normalizeToBase(string); - string = string.toUpperCase(); - - if (typeof method === 'function') { - searchSuccess = method(string, searchString); - } else if (method === 'contains') { - searchSuccess = string.indexOf(searchString) >= 0; - } else { - searchSuccess = string.startsWith(searchString); + // Strip HTML tags. This isn't perfect, but it's much faster than any other method + if (stringType === 'display') { + string = string.replace(/<[^>]+>/g, ''); + } + if (normalize) string = normalizeToBase(string); + string = string.toUpperCase(); + if (typeof method === 'function') { + searchSuccess = method(string, searchString); + } else if (method === 'contains') { + searchSuccess = string.indexOf(searchString) >= 0; + } else { + searchSuccess = string.startsWith(searchString); + } + if (searchSuccess) break; } - - if (searchSuccess) break; } + return searchSuccess; + } + function toInteger(value) { + return parseInt(value, 10) || 0; } - return searchSuccess; - } + // Borrowed from Lodash (_.deburr) + /** Used to map Latin Unicode letters to basic Latin letters. */ + var deburredLetters = { + // Latin-1 Supplement block. + '\xc0': 'A', + '\xc1': 'A', + '\xc2': 'A', + '\xc3': 'A', + '\xc4': 'A', + '\xc5': 'A', + '\xe0': 'a', + '\xe1': 'a', + '\xe2': 'a', + '\xe3': 'a', + '\xe4': 'a', + '\xe5': 'a', + '\xc7': 'C', + '\xe7': 'c', + '\xd0': 'D', + '\xf0': 'd', + '\xc8': 'E', + '\xc9': 'E', + '\xca': 'E', + '\xcb': 'E', + '\xe8': 'e', + '\xe9': 'e', + '\xea': 'e', + '\xeb': 'e', + '\xcc': 'I', + '\xcd': 'I', + '\xce': 'I', + '\xcf': 'I', + '\xec': 'i', + '\xed': 'i', + '\xee': 'i', + '\xef': 'i', + '\xd1': 'N', + '\xf1': 'n', + '\xd2': 'O', + '\xd3': 'O', + '\xd4': 'O', + '\xd5': 'O', + '\xd6': 'O', + '\xd8': 'O', + '\xf2': 'o', + '\xf3': 'o', + '\xf4': 'o', + '\xf5': 'o', + '\xf6': 'o', + '\xf8': 'o', + '\xd9': 'U', + '\xda': 'U', + '\xdb': 'U', + '\xdc': 'U', + '\xf9': 'u', + '\xfa': 'u', + '\xfb': 'u', + '\xfc': 'u', + '\xdd': 'Y', + '\xfd': 'y', + '\xff': 'y', + '\xc6': 'Ae', + '\xe6': 'ae', + '\xde': 'Th', + '\xfe': 'th', + '\xdf': 'ss', + // Latin Extended-A block. + "\u0100": 'A', + "\u0102": 'A', + "\u0104": 'A', + "\u0101": 'a', + "\u0103": 'a', + "\u0105": 'a', + "\u0106": 'C', + "\u0108": 'C', + "\u010A": 'C', + "\u010C": 'C', + "\u0107": 'c', + "\u0109": 'c', + "\u010B": 'c', + "\u010D": 'c', + "\u010E": 'D', + "\u0110": 'D', + "\u010F": 'd', + "\u0111": 'd', + "\u0112": 'E', + "\u0114": 'E', + "\u0116": 'E', + "\u0118": 'E', + "\u011A": 'E', + "\u0113": 'e', + "\u0115": 'e', + "\u0117": 'e', + "\u0119": 'e', + "\u011B": 'e', + "\u011C": 'G', + "\u011E": 'G', + "\u0120": 'G', + "\u0122": 'G', + "\u011D": 'g', + "\u011F": 'g', + "\u0121": 'g', + "\u0123": 'g', + "\u0124": 'H', + "\u0126": 'H', + "\u0125": 'h', + "\u0127": 'h', + "\u0128": 'I', + "\u012A": 'I', + "\u012C": 'I', + "\u012E": 'I', + "\u0130": 'I', + "\u0129": 'i', + "\u012B": 'i', + "\u012D": 'i', + "\u012F": 'i', + "\u0131": 'i', + "\u0134": 'J', + "\u0135": 'j', + "\u0136": 'K', + "\u0137": 'k', + "\u0138": 'k', + "\u0139": 'L', + "\u013B": 'L', + "\u013D": 'L', + "\u013F": 'L', + "\u0141": 'L', + "\u013A": 'l', + "\u013C": 'l', + "\u013E": 'l', + "\u0140": 'l', + "\u0142": 'l', + "\u0143": 'N', + "\u0145": 'N', + "\u0147": 'N', + "\u014A": 'N', + "\u0144": 'n', + "\u0146": 'n', + "\u0148": 'n', + "\u014B": 'n', + "\u014C": 'O', + "\u014E": 'O', + "\u0150": 'O', + "\u014D": 'o', + "\u014F": 'o', + "\u0151": 'o', + "\u0154": 'R', + "\u0156": 'R', + "\u0158": 'R', + "\u0155": 'r', + "\u0157": 'r', + "\u0159": 'r', + "\u015A": 'S', + "\u015C": 'S', + "\u015E": 'S', + "\u0160": 'S', + "\u015B": 's', + "\u015D": 's', + "\u015F": 's', + "\u0161": 's', + "\u0162": 'T', + "\u0164": 'T', + "\u0166": 'T', + "\u0163": 't', + "\u0165": 't', + "\u0167": 't', + "\u0168": 'U', + "\u016A": 'U', + "\u016C": 'U', + "\u016E": 'U', + "\u0170": 'U', + "\u0172": 'U', + "\u0169": 'u', + "\u016B": 'u', + "\u016D": 'u', + "\u016F": 'u', + "\u0171": 'u', + "\u0173": 'u', + "\u0174": 'W', + "\u0175": 'w', + "\u0176": 'Y', + "\u0177": 'y', + "\u0178": 'Y', + "\u0179": 'Z', + "\u017B": 'Z', + "\u017D": 'Z', + "\u017A": 'z', + "\u017C": 'z', + "\u017E": 'z', + "\u0132": 'IJ', + "\u0133": 'ij', + "\u0152": 'Oe', + "\u0153": 'oe', + "\u0149": "'n", + "\u017F": 's' + }; - function toInteger (value) { - return parseInt(value, 10) || 0; - } + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - // Borrowed from Lodash (_.deburr) - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to compose unicode character classes. */ - var rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboMarksExtendedRange = '\\u1ab0-\\u1aff', - rsComboMarksSupplementRange = '\\u1dc0-\\u1dff', + /** Used to compose unicode character classes. */ + var rsComboMarksRange = "\\u0300-\\u036f", + reComboHalfMarksRange = "\\ufe20-\\ufe2f", + rsComboSymbolsRange = "\\u20d0-\\u20ff", + rsComboMarksExtendedRange = "\\u1ab0-\\u1aff", + rsComboMarksSupplementRange = "\\u1dc0-\\u1dff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange + rsComboMarksExtendedRange + rsComboMarksSupplementRange; - /** Used to compose unicode capture groups. */ - var rsCombo = '[' + rsComboRange + ']'; + /** Used to compose unicode capture groups. */ + var rsCombo = '[' + rsComboRange + ']'; + + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); + function deburrLetter(key) { + return deburredLetters[key]; + } + ; + function normalizeToBase(string) { + string = string.toString(); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); + } - /** - * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and - * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); + // List of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; - function deburrLetter (key) { - return deburredLetters[key]; - }; + // Functions for escaping and unescaping strings to/from HTML interpolation. + var createEscaper = function createEscaper(map) { + var escaper = function escaper(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + Object.keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function (string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + }; + var htmlEscape = createEscaper(escapeMap); - function normalizeToBase (string) { - string = string.toString(); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ - // List of HTML entities for escaping. - var escapeMap = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''', - '`': '`' - }; - - // Functions for escaping and unescaping strings to/from HTML interpolation. - var createEscaper = function (map) { - var escaper = function (match) { - return map[match]; + var keyCodeMap = { + 32: ' ', + 48: '0', + 49: '1', + 50: '2', + 51: '3', + 52: '4', + 53: '5', + 54: '6', + 55: '7', + 56: '8', + 57: '9', + 59: ';', + 65: 'A', + 66: 'B', + 67: 'C', + 68: 'D', + 69: 'E', + 70: 'F', + 71: 'G', + 72: 'H', + 73: 'I', + 74: 'J', + 75: 'K', + 76: 'L', + 77: 'M', + 78: 'N', + 79: 'O', + 80: 'P', + 81: 'Q', + 82: 'R', + 83: 'S', + 84: 'T', + 85: 'U', + 86: 'V', + 87: 'W', + 88: 'X', + 89: 'Y', + 90: 'Z', + 96: '0', + 97: '1', + 98: '2', + 99: '3', + 100: '4', + 101: '5', + 102: '6', + 103: '7', + 104: '8', + 105: '9' }; - // Regexes for identifying a key that needs to be escaped. - var source = '(?:' + Object.keys(map).join('|') + ')'; - var testRegexp = RegExp(source); - var replaceRegexp = RegExp(source, 'g'); - return function (string) { - string = string == null ? '' : '' + string; - return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + var keyCodes = { + ESCAPE: 27, + // KeyboardEvent.which value for Escape (Esc) key + ENTER: 13, + // KeyboardEvent.which value for Enter key + SPACE: 32, + // KeyboardEvent.which value for space key + TAB: 9, + // KeyboardEvent.which value for tab key + ARROW_UP: 38, + // KeyboardEvent.which value for up arrow key + ARROW_DOWN: 40 // KeyboardEvent.which value for down arrow key }; - }; - - var htmlEscape = createEscaper(escapeMap); - - /** - * ------------------------------------------------------------------------ - * Constants - * ------------------------------------------------------------------------ - */ - - var keyCodeMap = { - 32: ' ', - 48: '0', - 49: '1', - 50: '2', - 51: '3', - 52: '4', - 53: '5', - 54: '6', - 55: '7', - 56: '8', - 57: '9', - 59: ';', - 65: 'A', - 66: 'B', - 67: 'C', - 68: 'D', - 69: 'E', - 70: 'F', - 71: 'G', - 72: 'H', - 73: 'I', - 74: 'J', - 75: 'K', - 76: 'L', - 77: 'M', - 78: 'N', - 79: 'O', - 80: 'P', - 81: 'Q', - 82: 'R', - 83: 'S', - 84: 'T', - 85: 'U', - 86: 'V', - 87: 'W', - 88: 'X', - 89: 'Y', - 90: 'Z', - 96: '0', - 97: '1', - 98: '2', - 99: '3', - 100: '4', - 101: '5', - 102: '6', - 103: '7', - 104: '8', - 105: '9' - }; - - var keyCodes = { - ESCAPE: 27, // KeyboardEvent.which value for Escape (Esc) key - ENTER: 13, // KeyboardEvent.which value for Enter key - SPACE: 32, // KeyboardEvent.which value for space key - TAB: 9, // KeyboardEvent.which value for tab key - ARROW_UP: 38, // KeyboardEvent.which value for up arrow key - ARROW_DOWN: 40 // KeyboardEvent.which value for down arrow key - }; - - // eslint-disable-next-line no-undef - var Dropdown = window.Dropdown || bootstrap.Dropdown; - - function getVersion () { - var version; + // eslint-disable-next-line no-undef + var Dropdown = window.Dropdown || bootstrap.Dropdown; + function getVersion() { + var version; + try { + version = $.fn.dropdown.Constructor.VERSION; + } catch (err) { + version = Dropdown.VERSION; + } + return version; + } + var version = { + success: false, + major: '3' + }; try { - version = $.fn.dropdown.Constructor.VERSION; + version.full = (getVersion() || '').split(' ')[0].split('.'); + version.major = version.full[0]; + version.success = true; } catch (err) { - version = Dropdown.VERSION; + // do nothing } - - return version; - } - - var version = { - success: false, - major: '3' - }; - - try { - version.full = (getVersion() || '').split(' ')[0].split('.'); - version.major = version.full[0]; - version.success = true; - } catch (err) { - // do nothing - } - - var selectId = 0; - - var EVENT_KEY = '.bs.select'; - - var classNames = { - DISABLED: 'disabled', - DIVIDER: 'divider', - SHOW: 'open', - DROPUP: 'dropup', - MENU: 'dropdown-menu', - MENURIGHT: 'dropdown-menu-right', - MENULEFT: 'dropdown-menu-left', - // to-do: replace with more advanced template/customization options - BUTTONCLASS: 'btn-default', - POPOVERHEADER: 'popover-title', - ICONBASE: 'glyphicon', - TICKICON: 'glyphicon-ok' - }; - - var Selector = { - MENU: '.' + classNames.MENU, - DATA_TOGGLE: 'data-toggle="dropdown"' - }; - - var elementTemplates = { - div: document.createElement('div'), - span: document.createElement('span'), - i: document.createElement('i'), - subtext: document.createElement('small'), - a: document.createElement('a'), - li: document.createElement('li'), - whitespace: document.createTextNode('\u00A0'), - fragment: document.createDocumentFragment(), - option: document.createElement('option') - }; - - elementTemplates.selectedOption = elementTemplates.option.cloneNode(false); - elementTemplates.selectedOption.setAttribute('selected', true); - - elementTemplates.noResults = elementTemplates.li.cloneNode(false); - elementTemplates.noResults.className = 'no-results'; - - elementTemplates.a.setAttribute('role', 'option'); - elementTemplates.a.className = 'dropdown-item'; - - elementTemplates.subtext.className = 'text-muted'; - - elementTemplates.text = elementTemplates.span.cloneNode(false); - elementTemplates.text.className = 'text'; - - elementTemplates.checkMark = elementTemplates.span.cloneNode(false); - - var REGEXP_ARROW = new RegExp(keyCodes.ARROW_UP + '|' + keyCodes.ARROW_DOWN); - var REGEXP_TAB_OR_ESCAPE = new RegExp('^' + keyCodes.TAB + '$|' + keyCodes.ESCAPE); - - var generateOption = { - li: function (content, classes, optgroup) { - var li = elementTemplates.li.cloneNode(false); - - if (content) { - if (content.nodeType === 1 || content.nodeType === 11) { - li.appendChild(content); + var selectId = 0; + var EVENT_KEY = '.bs.select'; + var classNames = { + DISABLED: 'disabled', + DIVIDER: 'divider', + SHOW: 'open', + DROPUP: 'dropup', + MENU: 'dropdown-menu', + MENURIGHT: 'dropdown-menu-right', + MENULEFT: 'dropdown-menu-left', + // to-do: replace with more advanced template/customization options + BUTTONCLASS: 'btn-default', + POPOVERHEADER: 'popover-title', + ICONBASE: 'glyphicon', + TICKICON: 'glyphicon-ok' + }; + var Selector = { + MENU: '.' + classNames.MENU, + DATA_TOGGLE: 'data-toggle="dropdown"' + }; + var elementTemplates = { + div: document.createElement('div'), + span: document.createElement('span'), + i: document.createElement('i'), + subtext: document.createElement('small'), + a: document.createElement('a'), + li: document.createElement('li'), + whitespace: document.createTextNode("\xA0"), + fragment: document.createDocumentFragment(), + option: document.createElement('option') + }; + elementTemplates.selectedOption = elementTemplates.option.cloneNode(false); + elementTemplates.selectedOption.setAttribute('selected', true); + elementTemplates.noResults = elementTemplates.li.cloneNode(false); + elementTemplates.noResults.className = 'no-results'; + elementTemplates.a.setAttribute('role', 'option'); + elementTemplates.a.className = 'dropdown-item'; + elementTemplates.subtext.className = 'text-muted'; + elementTemplates.text = elementTemplates.span.cloneNode(false); + elementTemplates.text.className = 'text'; + elementTemplates.checkMark = elementTemplates.span.cloneNode(false); + var REGEXP_ARROW = new RegExp(keyCodes.ARROW_UP + '|' + keyCodes.ARROW_DOWN); + var REGEXP_TAB_OR_ESCAPE = new RegExp('^' + keyCodes.TAB + '$|' + keyCodes.ESCAPE); + var generateOption = { + li: function li(content, classes, optgroup) { + var li = elementTemplates.li.cloneNode(false); + if (content) { + if (content.nodeType === 1 || content.nodeType === 11) { + li.appendChild(content); + } else { + li.innerHTML = content; + } + } + if (typeof classes !== 'undefined' && classes !== '') li.className = classes; + if (typeof optgroup !== 'undefined' && optgroup !== null) li.classList.add('optgroup-' + optgroup); + return li; + }, + a: function a(text, classes, inline) { + var a = elementTemplates.a.cloneNode(true); + if (text) { + if (text.nodeType === 11) { + a.appendChild(text); + } else { + a.insertAdjacentHTML('beforeend', text); + } + } + if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\s+/)); + if (inline) a.setAttribute('style', inline); + return a; + }, + text: function text(options, useFragment) { + var textElement = elementTemplates.text.cloneNode(false), + subtextElement, + iconElement; + if (options.content) { + textElement.innerHTML = options.content; } else { - li.innerHTML = content; + textElement.textContent = options.text; + if (options.icon) { + var whitespace = elementTemplates.whitespace.cloneNode(false); + + // need to use for icons in the button to prevent a breaking change + // note: switch to span in next major release + iconElement = (useFragment === true ? elementTemplates.i : elementTemplates.span).cloneNode(false); + iconElement.className = this.options.iconBase + ' ' + options.icon; + elementTemplates.fragment.appendChild(iconElement); + elementTemplates.fragment.appendChild(whitespace); + } + if (options.subtext) { + subtextElement = elementTemplates.subtext.cloneNode(false); + subtextElement.textContent = options.subtext; + textElement.appendChild(subtextElement); + } } - } - - if (typeof classes !== 'undefined' && classes !== '') li.className = classes; - if (typeof optgroup !== 'undefined' && optgroup !== null) li.classList.add('optgroup-' + optgroup); - - return li; - }, - - a: function (text, classes, inline) { - var a = elementTemplates.a.cloneNode(true); - - if (text) { - if (text.nodeType === 11) { - a.appendChild(text); + if (useFragment === true) { + while (textElement.childNodes.length > 0) { + elementTemplates.fragment.appendChild(textElement.childNodes[0]); + } } else { - a.insertAdjacentHTML('beforeend', text); + elementTemplates.fragment.appendChild(textElement); } - } - - if (typeof classes !== 'undefined' && classes !== '') a.classList.add.apply(a.classList, classes.split(/\s+/)); - if (inline) a.setAttribute('style', inline); - - return a; - }, - - text: function (options, useFragment) { - var textElement = elementTemplates.text.cloneNode(false), + return elementTemplates.fragment; + }, + label: function label(options) { + var textElement = elementTemplates.text.cloneNode(false), subtextElement, iconElement; - - if (options.content) { - textElement.innerHTML = options.content; - } else { - textElement.textContent = options.text; - + textElement.innerHTML = options.display; if (options.icon) { var whitespace = elementTemplates.whitespace.cloneNode(false); - - // need to use for icons in the button to prevent a breaking change - // note: switch to span in next major release - iconElement = (useFragment === true ? elementTemplates.i : elementTemplates.span).cloneNode(false); + iconElement = elementTemplates.span.cloneNode(false); iconElement.className = this.options.iconBase + ' ' + options.icon; - elementTemplates.fragment.appendChild(iconElement); elementTemplates.fragment.appendChild(whitespace); } - if (options.subtext) { subtextElement = elementTemplates.subtext.cloneNode(false); subtextElement.textContent = options.subtext; textElement.appendChild(subtextElement); } - } - - if (useFragment === true) { - while (textElement.childNodes.length > 0) { - elementTemplates.fragment.appendChild(textElement.childNodes[0]); - } - } else { elementTemplates.fragment.appendChild(textElement); + return elementTemplates.fragment; } - - return elementTemplates.fragment; - }, - - label: function (options) { - var textElement = elementTemplates.text.cloneNode(false), - subtextElement, - iconElement; - - textElement.innerHTML = options.display; - - if (options.icon) { - var whitespace = elementTemplates.whitespace.cloneNode(false); - - iconElement = elementTemplates.span.cloneNode(false); - iconElement.className = this.options.iconBase + ' ' + options.icon; - - elementTemplates.fragment.appendChild(iconElement); - elementTemplates.fragment.appendChild(whitespace); - } - - if (options.subtext) { - subtextElement = elementTemplates.subtext.cloneNode(false); - subtextElement.textContent = options.subtext; - textElement.appendChild(subtextElement); - } - - elementTemplates.fragment.appendChild(textElement); - - return elementTemplates.fragment; - } - }; - - var getOptionData = { - fromOption: function (option, type) { - var value; - - switch (type) { - case 'divider': - value = option.getAttribute('data-divider') === 'true'; - break; - - case 'text': - value = option.textContent; - break; - - case 'label': - value = option.label; - break; - - case 'style': - value = option.style.cssText; - break; - - case 'title': - value = option.title; - break; - - default: - value = option.getAttribute('data-' + toKebabCase(type)); - break; + }; + var getOptionData = { + fromOption: function fromOption(option, type) { + var value; + switch (type) { + case 'divider': + value = option.getAttribute('data-divider') === 'true'; + break; + case 'text': + value = option.textContent; + break; + case 'label': + value = option.label; + break; + case 'style': + value = option.style.cssText; + break; + case 'title': + value = option.title; + break; + default: + value = option.getAttribute('data-' + toKebabCase(type)); + break; + } + return value; + }, + fromDataSource: function fromDataSource(option, type) { + var value; + switch (type) { + case 'text': + case 'label': + value = option.text || option.value || ''; + break; + default: + value = option[type]; + break; + } + return value; } - - return value; - }, - fromDataSource: function (option, type) { - var value; - - switch (type) { - case 'text': - case 'label': - value = option.text || option.value || ''; - break; - - default: - value = option[type]; - break; + }; + function showNoResults(searchMatch, searchValue) { + if (!searchMatch.length) { + elementTemplates.noResults.innerHTML = this.options.noneResultsText.replace('{0}', '"' + htmlEscape(searchValue) + '"'); + this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults); } - - return value; } - }; - - function showNoResults (searchMatch, searchValue) { - if (!searchMatch.length) { - elementTemplates.noResults.innerHTML = this.options.noneResultsText.replace('{0}', '"' + htmlEscape(searchValue) + '"'); - this.$menuInner[0].firstChild.appendChild(elementTemplates.noResults); + function filterHidden(item) { + return !(item.hidden || this.options.hideDisabled && item.disabled); } - } + var _Selectpicker = function Selectpicker(element, options) { + var that = this; - function filterHidden (item) { - return !(item.hidden || this.options.hideDisabled && item.disabled); - } - - var Selectpicker = function (element, options) { - var that = this; - - // bootstrap-select has been initialized - revert valHooks.select.set back to its original function - if (!valHooks.useDefault) { - $.valHooks.select.set = valHooks._set; - valHooks.useDefault = true; - } - - this.$element = $(element); - this.$newElement = null; - this.$button = null; - this.$menu = null; - this.options = options; - this.selectpicker = { - main: { - data: [], - optionQueue: elementTemplates.fragment.cloneNode(false), - hasMore: false - }, - search: { - data: [], - hasMore: false - }, - current: {}, // current is either equal to main or search depending on if a search is in progress - view: {}, - // map of option values and their respective data (only used in conjunction with options.source) - optionValuesDataMap: {}, - isSearching: false, - keydown: { - keyHistory: '', - resetKeyHistory: { - start: function () { - return setTimeout(function () { - that.selectpicker.keydown.keyHistory = ''; - }, 800); + // bootstrap-select has been initialized - revert valHooks.select.set back to its original function + if (!valHooks.useDefault) { + $.valHooks.select.set = valHooks._set; + valHooks.useDefault = true; + } + this.$element = $(element); + this.$newElement = null; + this.$button = null; + this.$menu = null; + this.options = options; + this.selectpicker = { + main: { + data: [], + optionQueue: elementTemplates.fragment.cloneNode(false), + hasMore: false + }, + search: { + data: [], + hasMore: false + }, + current: {}, + // current is either equal to main or search depending on if a search is in progress + view: {}, + // map of option values and their respective data (only used in conjunction with options.source) + optionValuesDataMap: {}, + isSearching: false, + keydown: { + keyHistory: '', + resetKeyHistory: { + start: function start() { + return setTimeout(function () { + that.selectpicker.keydown.keyHistory = ''; + }, 800); + } } } - } + }; + this.sizeInfo = {}; + + // Format window padding + var winPad = this.options.windowPadding; + if (typeof winPad === 'number') { + this.options.windowPadding = [winPad, winPad, winPad, winPad]; + } + + // Expose public methods + this.val = _Selectpicker.prototype.val; + this.render = _Selectpicker.prototype.render; + this.refresh = _Selectpicker.prototype.refresh; + this.setStyle = _Selectpicker.prototype.setStyle; + this.selectAll = _Selectpicker.prototype.selectAll; + this.deselectAll = _Selectpicker.prototype.deselectAll; + this.destroy = _Selectpicker.prototype.destroy; + this.remove = _Selectpicker.prototype.remove; + this.show = _Selectpicker.prototype.show; + this.hide = _Selectpicker.prototype.hide; + this.init(); }; - - this.sizeInfo = {}; - - // Format window padding - var winPad = this.options.windowPadding; - if (typeof winPad === 'number') { - this.options.windowPadding = [winPad, winPad, winPad, winPad]; - } - - // Expose public methods - this.val = Selectpicker.prototype.val; - this.render = Selectpicker.prototype.render; - this.refresh = Selectpicker.prototype.refresh; - this.setStyle = Selectpicker.prototype.setStyle; - this.selectAll = Selectpicker.prototype.selectAll; - this.deselectAll = Selectpicker.prototype.deselectAll; - this.destroy = Selectpicker.prototype.destroy; - this.remove = Selectpicker.prototype.remove; - this.show = Selectpicker.prototype.show; - this.hide = Selectpicker.prototype.hide; - - this.init(); - }; - - Selectpicker.VERSION = '1.14.0-beta3'; - - // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both. - Selectpicker.DEFAULTS = { - noneSelectedText: 'Nothing selected', - noneResultsText: 'No results matched {0}', - countSelectedText: function (numSelected, numTotal) { - return (numSelected == 1) ? '{0} item selected' : '{0} items selected'; - }, - maxOptionsText: function (numAll, numGroup) { - return [ - (numAll == 1) ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)', - (numGroup == 1) ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)' - ]; - }, - selectAllText: 'Select All', - deselectAllText: 'Deselect All', - source: { - pageSize: 40 - }, - chunkSize: 40, - doneButton: false, - doneButtonText: 'Close', - multipleSeparator: ', ', - styleBase: 'btn', - style: classNames.BUTTONCLASS, - size: 'auto', - title: null, - placeholder: null, - allowClear: false, - selectedTextFormat: 'values', - width: false, - container: false, - hideDisabled: false, - showSubtext: false, - showIcon: true, - showContent: true, - dropupAuto: true, - header: false, - liveSearch: false, - liveSearchPlaceholder: null, - liveSearchNormalize: false, - liveSearchStyle: 'contains', - actionsBox: false, - iconBase: classNames.ICONBASE, - tickIcon: classNames.TICKICON, - showTick: false, - template: { - caret: '' - }, - maxOptions: false, - mobile: false, - selectOnTab: true, - dropdownAlignRight: false, - windowPadding: 0, - virtualScroll: 600, - display: false, - sanitize: true, - sanitizeFn: null, - whiteList: DefaultWhitelist - }; - - Selectpicker.prototype = { - - constructor: Selectpicker, - - init: function () { - var that = this, + _Selectpicker.VERSION = '1.14.0-beta3'; + + // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both. + _Selectpicker.DEFAULTS = { + noneSelectedText: 'Nothing selected', + noneResultsText: 'No results matched {0}', + countSelectedText: function countSelectedText(numSelected, numTotal) { + return numSelected == 1 ? '{0} item selected' : '{0} items selected'; + }, + maxOptionsText: function maxOptionsText(numAll, numGroup) { + return [numAll == 1 ? 'Limit reached ({n} item max)' : 'Limit reached ({n} items max)', numGroup == 1 ? 'Group limit reached ({n} item max)' : 'Group limit reached ({n} items max)']; + }, + selectAllText: 'Select All', + deselectAllText: 'Deselect All', + source: { + pageSize: 40 + }, + chunkSize: 40, + doneButton: false, + doneButtonText: 'Close', + multipleSeparator: ', ', + styleBase: 'btn', + style: classNames.BUTTONCLASS, + size: 'auto', + title: null, + placeholder: null, + allowClear: false, + selectedTextFormat: 'values', + width: false, + container: false, + hideDisabled: false, + showSubtext: false, + showIcon: true, + showContent: true, + dropupAuto: true, + header: false, + liveSearch: false, + liveSearchPlaceholder: null, + liveSearchNormalize: false, + liveSearchStyle: 'contains', + actionsBox: false, + iconBase: classNames.ICONBASE, + tickIcon: classNames.TICKICON, + showTick: false, + template: { + caret: '' + }, + maxOptions: false, + mobile: false, + selectOnTab: true, + dropdownAlignRight: false, + windowPadding: 0, + virtualScroll: 600, + display: false, + sanitize: true, + sanitizeFn: null, + whiteList: DefaultWhitelist + }; + _Selectpicker.prototype = { + constructor: _Selectpicker, + init: function init() { + var that = this, id = this.$element.attr('id'), element = this.$element[0], form = element.form; - - selectId++; - this.selectId = 'bs-select-' + selectId; - - element.classList.add('bs-select-hidden'); - - this.multiple = this.$element.prop('multiple'); - this.autofocus = this.$element.prop('autofocus'); - - if (element.classList.contains('show-tick')) { - this.options.showTick = true; - } - - this.$newElement = this.createDropdown(); - - this.$element - .after(this.$newElement) - .prependTo(this.$newElement); - - // ensure select is associated with form element if it got unlinked after moving it inside newElement - if (form && element.form === null) { - if (!form.id) form.id = 'form-' + this.selectId; - element.setAttribute('form', form.id); - } - - this.$button = this.$newElement.children('button'); - if (this.options.allowClear) this.$clearButton = this.$button.children('.bs-select-clear-selected'); - this.$menu = this.$newElement.children(Selector.MENU); - this.$menuInner = this.$menu.children('.inner'); - this.$searchbox = this.$menu.find('input'); - - element.classList.remove('bs-select-hidden'); - - this.fetchData(function () { - that.render(true); - that.buildList(); - - requestAnimationFrame(function () { - that.$element.trigger('loaded' + EVENT_KEY); + selectId++; + this.selectId = 'bs-select-' + selectId; + element.classList.add('bs-select-hidden'); + this.multiple = this.$element.prop('multiple'); + this.autofocus = this.$element.prop('autofocus'); + if (element.classList.contains('show-tick')) { + this.options.showTick = true; + } + this.$newElement = this.createDropdown(); + this.$element.after(this.$newElement).prependTo(this.$newElement); + + // ensure select is associated with form element if it got unlinked after moving it inside newElement + if (form && element.form === null) { + if (!form.id) form.id = 'form-' + this.selectId; + element.setAttribute('form', form.id); + } + this.$button = this.$newElement.children('button'); + if (this.options.allowClear) this.$clearButton = this.$button.children('.bs-select-clear-selected'); + this.$menu = this.$newElement.children(Selector.MENU); + this.$menuInner = this.$menu.children('.inner'); + this.$searchbox = this.$menu.find('input'); + element.classList.remove('bs-select-hidden'); + this.fetchData(function () { + that.render(true); + that.buildList(); + requestAnimationFrame(function () { + that.$element.trigger('loaded' + EVENT_KEY); + }); }); - }); - - if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT); - - if (typeof id !== 'undefined') { - this.$button.attr('data-id', id); - } - - this.checkDisabled(); - this.clickListener(); - - if (version.major > 4) this.dropdown = new Dropdown(this.$button[0]); - - if (this.options.liveSearch) { - this.liveSearchListener(); - this.focusedParent = this.$searchbox[0]; - } else { - this.focusedParent = this.$menuInner[0]; - } - - this.setStyle(); - this.setWidth(); - if (this.options.container) { - this.selectPosition(); - } else { - this.$element.on('hide' + EVENT_KEY, function () { - if (that.isVirtual()) { - // empty menu on close - var menuInner = that.$menuInner[0], + if (this.options.dropdownAlignRight === true) this.$menu[0].classList.add(classNames.MENURIGHT); + if (typeof id !== 'undefined') { + this.$button.attr('data-id', id); + } + this.checkDisabled(); + this.clickListener(); + if (version.major > 4) this.dropdown = new Dropdown(this.$button[0]); + if (this.options.liveSearch) { + this.liveSearchListener(); + this.focusedParent = this.$searchbox[0]; + } else { + this.focusedParent = this.$menuInner[0]; + } + this.setStyle(); + this.setWidth(); + if (this.options.container) { + this.selectPosition(); + } else { + this.$element.on('hide' + EVENT_KEY, function () { + if (that.isVirtual()) { + // empty menu on close + var menuInner = that.$menuInner[0], emptyMenu = menuInner.firstChild.cloneNode(false); - // replace the existing UL with an empty one - this is faster than $.empty() or innerHTML = '' - menuInner.replaceChild(emptyMenu, menuInner.firstChild); - menuInner.scrollTop = 0; + // replace the existing UL with an empty one - this is faster than $.empty() or innerHTML = '' + menuInner.replaceChild(emptyMenu, menuInner.firstChild); + menuInner.scrollTop = 0; + } + }); + } + this.$menu.data('this', this); + this.$newElement.data('this', this); + if (this.options.mobile) this.mobile(); + this.$newElement.on({ + 'hide.bs.dropdown': function hideBsDropdown(e) { + that.$element.trigger('hide' + EVENT_KEY, e); + }, + 'hidden.bs.dropdown': function hiddenBsDropdown(e) { + that.$element.trigger('hidden' + EVENT_KEY, e); + }, + 'show.bs.dropdown': function showBsDropdown(e) { + that.$element.trigger('show' + EVENT_KEY, e); + }, + 'shown.bs.dropdown': function shownBsDropdown(e) { + that.$element.trigger('shown' + EVENT_KEY, e); } }); - } - this.$menu.data('this', this); - this.$newElement.data('this', this); - if (this.options.mobile) this.mobile(); - - this.$newElement.on({ - 'hide.bs.dropdown': function (e) { - that.$element.trigger('hide' + EVENT_KEY, e); - }, - 'hidden.bs.dropdown': function (e) { - that.$element.trigger('hidden' + EVENT_KEY, e); - }, - 'show.bs.dropdown': function (e) { - that.$element.trigger('show' + EVENT_KEY, e); - }, - 'shown.bs.dropdown': function (e) { - that.$element.trigger('shown' + EVENT_KEY, e); - } - }); - - if (element.hasAttribute('required')) { - this.$element.on('invalid' + EVENT_KEY, function () { - that.$button[0].classList.add('bs-invalid'); - - that.$element - .on('shown' + EVENT_KEY + '.invalid', function () { - that.$element - .val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened - .off('shown' + EVENT_KEY + '.invalid'); - }) - .on('rendered' + EVENT_KEY, function () { + if (element.hasAttribute('required')) { + this.$element.on('invalid' + EVENT_KEY, function () { + that.$button[0].classList.add('bs-invalid'); + that.$element.on('shown' + EVENT_KEY + '.invalid', function () { + that.$element.val(that.$element.val()) // set the value to hide the validation message in Chrome when menu is opened + .off('shown' + EVENT_KEY + '.invalid'); + }).on('rendered' + EVENT_KEY, function () { // if select is no longer invalid, remove the bs-invalid class if (this.validity.valid) that.$button[0].classList.remove('bs-invalid'); that.$element.off('rendered' + EVENT_KEY); }); - - that.$button.on('blur' + EVENT_KEY, function () { - that.$element.trigger('focus').trigger('blur'); - that.$button.off('blur' + EVENT_KEY); + that.$button.on('blur' + EVENT_KEY, function () { + that.$element.trigger('focus').trigger('blur'); + that.$button.off('blur' + EVENT_KEY); + }); }); - }); - } - - if (form) { - $(form).on('reset' + EVENT_KEY, function () { - requestAnimationFrame(function () { - that.render(); + } + if (form) { + $(form).on('reset' + EVENT_KEY, function () { + requestAnimationFrame(function () { + that.render(); + }); }); - }); - } - }, - - createDropdown: function () { - // Options - // If we are multiple or showTick option is set, then add the show-tick class - var showTick = (this.multiple || this.options.showTick) ? ' show-tick' : '', + } + }, + createDropdown: function createDropdown() { + // Options + // If we are multiple or showTick option is set, then add the show-tick class + var showTick = this.multiple || this.options.showTick ? ' show-tick' : '', multiselectable = this.multiple ? ' aria-multiselectable="true"' : '', inputGroup = '', autofocus = this.autofocus ? ' autofocus' : ''; + if (version.major < 4 && this.$element.parent().hasClass('input-group')) { + inputGroup = ' input-group-btn'; + } - if (version.major < 4 && this.$element.parent().hasClass('input-group')) { - inputGroup = ' input-group-btn'; - } - - // Elements - var drop, + // Elements + var drop, header = '', searchbox = '', actionsbox = '', donebutton = '', clearButton = ''; - - if (this.options.header) { - header = - '
    ' + - '' + - this.options.header + - '
    '; - } - - if (this.options.liveSearch) { - searchbox = - ''; - } - - if (this.multiple && this.options.actionsBox) { - actionsbox = - '
    ' + - '
    ' + - '' + - '' + - '
    ' + - '
    '; - } - - if (this.multiple && this.options.doneButton) { - donebutton = - '
    ' + - '
    ' + - '' + - '
    ' + - '
    '; - } - - if (this.options.allowClear) { - clearButton = '×'; - } - - drop = - ''; - - return $(drop); - }, - - setPositionData: function () { - this.selectpicker.view.canHighlight = []; - this.selectpicker.view.size = 0; - this.selectpicker.view.firstHighlightIndex = false; - - for (var i = 0; i < this.selectpicker.current.data.length; i++) { - var li = this.selectpicker.current.data[i], - canHighlight = true; - - if (li.type === 'divider') { - canHighlight = false; - li.height = this.sizeInfo.dividerHeight; - } else if (li.type === 'optgroup-label') { - canHighlight = false; - li.height = this.sizeInfo.dropdownHeaderHeight; - } else { - li.height = this.sizeInfo.liHeight; + if (this.options.header) { + header = '
    ' + '' + this.options.header + '
    '; } - - if (li.disabled) canHighlight = false; - - this.selectpicker.view.canHighlight.push(canHighlight); - - if (canHighlight) { - this.selectpicker.view.size++; - li.posinset = this.selectpicker.view.size; - if (this.selectpicker.view.firstHighlightIndex === false) this.selectpicker.view.firstHighlightIndex = i; + if (this.options.liveSearch) { + searchbox = ''; } - - li.position = (i === 0 ? 0 : this.selectpicker.current.data[i - 1].position) + li.height; - } - }, - - isVirtual: function () { - return (this.options.virtualScroll !== false) && (this.selectpicker.main.data.length >= this.options.virtualScroll) || this.options.virtualScroll === true; - }, - - createView: function (isSearching, setSize, refresh) { - var that = this, + if (this.multiple && this.options.actionsBox) { + actionsbox = '
    ' + '
    ' + '' + '' + '
    ' + '
    '; + } + if (this.multiple && this.options.doneButton) { + donebutton = '
    ' + '
    ' + '' + '
    ' + '
    '; + } + if (this.options.allowClear) { + clearButton = '×'; + } + drop = ''; + return $(drop); + }, + setPositionData: function setPositionData() { + this.selectpicker.view.canHighlight = []; + this.selectpicker.view.size = 0; + this.selectpicker.view.firstHighlightIndex = false; + for (var i = 0; i < this.selectpicker.current.data.length; i++) { + var li = this.selectpicker.current.data[i], + canHighlight = true; + if (li.type === 'divider') { + canHighlight = false; + li.height = this.sizeInfo.dividerHeight; + } else if (li.type === 'optgroup-label') { + canHighlight = false; + li.height = this.sizeInfo.dropdownHeaderHeight; + } else { + li.height = this.sizeInfo.liHeight; + } + if (li.disabled) canHighlight = false; + this.selectpicker.view.canHighlight.push(canHighlight); + if (canHighlight) { + this.selectpicker.view.size++; + li.posinset = this.selectpicker.view.size; + if (this.selectpicker.view.firstHighlightIndex === false) this.selectpicker.view.firstHighlightIndex = i; + } + li.position = (i === 0 ? 0 : this.selectpicker.current.data[i - 1].position) + li.height; + } + }, + isVirtual: function isVirtual() { + return this.options.virtualScroll !== false && this.selectpicker.main.data.length >= this.options.virtualScroll || this.options.virtualScroll === true; + }, + createView: function createView(isSearching, setSize, refresh) { + var that = this, scrollTop = 0; - - this.selectpicker.isSearching = isSearching; - this.selectpicker.current = isSearching ? this.selectpicker.search : this.selectpicker.main; - - this.setPositionData(); - - if (setSize) { - if (refresh) { - scrollTop = this.$menuInner[0].scrollTop; - } else if (!that.multiple) { - var element = that.$element[0], + this.selectpicker.isSearching = isSearching; + this.selectpicker.current = isSearching ? this.selectpicker.search : this.selectpicker.main; + this.setPositionData(); + if (setSize) { + if (refresh) { + scrollTop = this.$menuInner[0].scrollTop; + } else if (!that.multiple) { + var element = that.$element[0], selectedIndex = (element.options[element.selectedIndex] || {}).liIndex; - - if (typeof selectedIndex === 'number' && that.options.size !== false) { - var selectedData = that.selectpicker.main.data[selectedIndex], + if (typeof selectedIndex === 'number' && that.options.size !== false) { + var selectedData = that.selectpicker.main.data[selectedIndex], position = selectedData && selectedData.position; - - if (position) { - scrollTop = position - ((that.sizeInfo.menuInnerHeight + that.sizeInfo.liHeight) / 2); + if (position) { + scrollTop = position - (that.sizeInfo.menuInnerHeight + that.sizeInfo.liHeight) / 2; + } } } } - } - - scroll(scrollTop, true); - - this.$menuInner.off('scroll.createView').on('scroll.createView', function (e, updateValue) { - if (!that.noScroll) scroll(this.scrollTop, updateValue); - that.noScroll = false; - }); - - function scroll (scrollTop, init) { - var size = that.selectpicker.current.data.length, + scroll(scrollTop, true); + this.$menuInner.off('scroll.createView').on('scroll.createView', function (e, updateValue) { + if (!that.noScroll) scroll(this.scrollTop, updateValue); + that.noScroll = false; + }); + function scroll(scrollTop, init) { + var size = that.selectpicker.current.data.length, chunks = [], chunkSize, chunkCount, @@ -1346,80 +1247,61 @@ previousElements, menuIsDifferent = true, isVirtual = that.isVirtual(); - - that.selectpicker.view.scrollTop = scrollTop; - - chunkSize = that.options.chunkSize; // number of options in a chunk - chunkCount = Math.ceil(size / chunkSize) || 1; // number of chunks - - for (var i = 0; i < chunkCount; i++) { - var endOfChunk = (i + 1) * chunkSize; - - if (i === chunkCount - 1) { - endOfChunk = size; - } - - chunks[i] = [ - (i) * chunkSize + (!i ? 0 : 1), - endOfChunk - ]; - - if (!size) break; - - if (currentChunk === undefined && scrollTop - 1 <= that.selectpicker.current.data[endOfChunk - 1].position - that.sizeInfo.menuInnerHeight) { - currentChunk = i; + that.selectpicker.view.scrollTop = scrollTop; + chunkSize = that.options.chunkSize; // number of options in a chunk + chunkCount = Math.ceil(size / chunkSize) || 1; // number of chunks + + for (var i = 0; i < chunkCount; i++) { + var endOfChunk = (i + 1) * chunkSize; + if (i === chunkCount - 1) { + endOfChunk = size; + } + chunks[i] = [i * chunkSize + (!i ? 0 : 1), endOfChunk]; + if (!size) break; + if (currentChunk === undefined && scrollTop - 1 <= that.selectpicker.current.data[endOfChunk - 1].position - that.sizeInfo.menuInnerHeight) { + currentChunk = i; + } } - } - - if (currentChunk === undefined) currentChunk = 0; - - prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1]; - - // always display previous, current, and next chunks - firstChunk = Math.max(0, currentChunk - 1); - lastChunk = Math.min(chunkCount - 1, currentChunk + 1); - - that.selectpicker.view.position0 = isVirtual === false ? 0 : (Math.max(0, chunks[firstChunk][0]) || 0); - that.selectpicker.view.position1 = isVirtual === false ? size : (Math.min(size, chunks[lastChunk][1]) || 0); - - positionIsDifferent = prevPositions[0] !== that.selectpicker.view.position0 || prevPositions[1] !== that.selectpicker.view.position1; - - if (that.activeElement !== undefined) { - if (init) { + if (currentChunk === undefined) currentChunk = 0; + prevPositions = [that.selectpicker.view.position0, that.selectpicker.view.position1]; + + // always display previous, current, and next chunks + firstChunk = Math.max(0, currentChunk - 1); + lastChunk = Math.min(chunkCount - 1, currentChunk + 1); + that.selectpicker.view.position0 = isVirtual === false ? 0 : Math.max(0, chunks[firstChunk][0]) || 0; + that.selectpicker.view.position1 = isVirtual === false ? size : Math.min(size, chunks[lastChunk][1]) || 0; + positionIsDifferent = prevPositions[0] !== that.selectpicker.view.position0 || prevPositions[1] !== that.selectpicker.view.position1; + if (that.activeElement !== undefined) { + if (init) { + if (that.activeElement !== that.selectedElement) { + that.defocusItem(that.activeElement); + } + that.activeElement = undefined; + } if (that.activeElement !== that.selectedElement) { - that.defocusItem(that.activeElement); + that.defocusItem(that.selectedElement); } - that.activeElement = undefined; - } - - if (that.activeElement !== that.selectedElement) { - that.defocusItem(that.selectedElement); } - } - - if (that.prevActiveElement !== undefined && that.prevActiveElement !== that.activeElement && that.prevActiveElement !== that.selectedElement) { - that.defocusItem(that.prevActiveElement); - } - - if (init || positionIsDifferent || that.selectpicker.current.hasMore) { - previousElements = that.selectpicker.view.visibleElements ? that.selectpicker.view.visibleElements.slice() : []; - - if (isVirtual === false) { - that.selectpicker.view.visibleElements = that.selectpicker.current.elements; - } else { - that.selectpicker.view.visibleElements = that.selectpicker.current.elements.slice(that.selectpicker.view.position0, that.selectpicker.view.position1); + if (that.prevActiveElement !== undefined && that.prevActiveElement !== that.activeElement && that.prevActiveElement !== that.selectedElement) { + that.defocusItem(that.prevActiveElement); } + if (init || positionIsDifferent || that.selectpicker.current.hasMore) { + previousElements = that.selectpicker.view.visibleElements ? that.selectpicker.view.visibleElements.slice() : []; + if (isVirtual === false) { + that.selectpicker.view.visibleElements = that.selectpicker.current.elements; + } else { + that.selectpicker.view.visibleElements = that.selectpicker.current.elements.slice(that.selectpicker.view.position0, that.selectpicker.view.position1); + } + that.setOptionStatus(); - that.setOptionStatus(); - - // if searching, check to make sure the list has actually been updated before updating DOM - // this prevents unnecessary repaints - if (isSearching || (isVirtual === false && init)) menuIsDifferent = !isEqual(previousElements, that.selectpicker.view.visibleElements); + // if searching, check to make sure the list has actually been updated before updating DOM + // this prevents unnecessary repaints + if (isSearching || isVirtual === false && init) menuIsDifferent = !isEqual(previousElements, that.selectpicker.view.visibleElements); - // if virtual scroll is disabled and not searching, - // menu should never need to be updated more than once - if ((init || isVirtual === true) && menuIsDifferent) { - var menuInner = that.$menuInner[0], + // if virtual scroll is disabled and not searching, + // menu should never need to be updated more than once + if ((init || isVirtual === true) && menuIsDifferent) { + var menuInner = that.$menuInner[0], menuFragment = document.createDocumentFragment(), emptyMenu = menuInner.firstChild.cloneNode(false), marginTop, @@ -1427,156 +1309,124 @@ elements = that.selectpicker.view.visibleElements, toSanitize = []; - // replace the existing UL with an empty one - this is faster than $.empty() - menuInner.replaceChild(emptyMenu, menuInner.firstChild); - - for (var i = 0, visibleElementsLen = elements.length; i < visibleElementsLen; i++) { - var element = elements[i], + // replace the existing UL with an empty one - this is faster than $.empty() + menuInner.replaceChild(emptyMenu, menuInner.firstChild); + for (var i = 0, visibleElementsLen = elements.length; i < visibleElementsLen; i++) { + var element = elements[i], elText, elementData; - - if (that.options.sanitize) { - elText = element.lastChild; - - if (elText) { - elementData = that.selectpicker.current.data[i + that.selectpicker.view.position0]; - - if (elementData && elementData.content && !elementData.sanitized) { - toSanitize.push(elText); - elementData.sanitized = true; + if (that.options.sanitize) { + elText = element.lastChild; + if (elText) { + elementData = that.selectpicker.current.data[i + that.selectpicker.view.position0]; + if (elementData && elementData.content && !elementData.sanitized) { + toSanitize.push(elText); + elementData.sanitized = true; + } } } + menuFragment.appendChild(element); } + if (that.options.sanitize && toSanitize.length) { + sanitizeHtml(toSanitize, that.options.whiteList, that.options.sanitizeFn); + } + if (isVirtual === true) { + marginTop = that.selectpicker.view.position0 === 0 ? 0 : that.selectpicker.current.data[that.selectpicker.view.position0 - 1].position; + marginBottom = that.selectpicker.view.position1 > size - 1 ? 0 : that.selectpicker.current.data[size - 1].position - that.selectpicker.current.data[that.selectpicker.view.position1 - 1].position; + menuInner.firstChild.style.marginTop = marginTop + 'px'; + menuInner.firstChild.style.marginBottom = marginBottom + 'px'; + } else { + menuInner.firstChild.style.marginTop = 0; + menuInner.firstChild.style.marginBottom = 0; + } + menuInner.firstChild.appendChild(menuFragment); - menuFragment.appendChild(element); - } - - if (that.options.sanitize && toSanitize.length) { - sanitizeHtml(toSanitize, that.options.whiteList, that.options.sanitizeFn); - } - - if (isVirtual === true) { - marginTop = (that.selectpicker.view.position0 === 0 ? 0 : that.selectpicker.current.data[that.selectpicker.view.position0 - 1].position); - marginBottom = (that.selectpicker.view.position1 > size - 1 ? 0 : that.selectpicker.current.data[size - 1].position - that.selectpicker.current.data[that.selectpicker.view.position1 - 1].position); - - menuInner.firstChild.style.marginTop = marginTop + 'px'; - menuInner.firstChild.style.marginBottom = marginBottom + 'px'; - } else { - menuInner.firstChild.style.marginTop = 0; - menuInner.firstChild.style.marginBottom = 0; - } - - menuInner.firstChild.appendChild(menuFragment); - - // if an option is encountered that is wider than the current menu width, update the menu width accordingly - // switch to ResizeObserver with increased browser support - if (isVirtual === true && that.sizeInfo.hasScrollBar) { - var menuInnerInnerWidth = menuInner.firstChild.offsetWidth; - - if (init && menuInnerInnerWidth < that.sizeInfo.menuInnerInnerWidth && that.sizeInfo.totalMenuWidth > that.sizeInfo.selectWidth) { - menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px'; - } else if (menuInnerInnerWidth > that.sizeInfo.menuInnerInnerWidth) { - // set to 0 to get actual width of menu - that.$menu[0].style.minWidth = 0; - - var actualMenuWidth = menuInner.firstChild.offsetWidth; - - if (actualMenuWidth > that.sizeInfo.menuInnerInnerWidth) { - that.sizeInfo.menuInnerInnerWidth = actualMenuWidth; + // if an option is encountered that is wider than the current menu width, update the menu width accordingly + // switch to ResizeObserver with increased browser support + if (isVirtual === true && that.sizeInfo.hasScrollBar) { + var menuInnerInnerWidth = menuInner.firstChild.offsetWidth; + if (init && menuInnerInnerWidth < that.sizeInfo.menuInnerInnerWidth && that.sizeInfo.totalMenuWidth > that.sizeInfo.selectWidth) { menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px'; - } + } else if (menuInnerInnerWidth > that.sizeInfo.menuInnerInnerWidth) { + // set to 0 to get actual width of menu + that.$menu[0].style.minWidth = 0; + var actualMenuWidth = menuInner.firstChild.offsetWidth; + if (actualMenuWidth > that.sizeInfo.menuInnerInnerWidth) { + that.sizeInfo.menuInnerInnerWidth = actualMenuWidth; + menuInner.firstChild.style.minWidth = that.sizeInfo.menuInnerInnerWidth + 'px'; + } - // reset to default CSS styling - that.$menu[0].style.minWidth = ''; + // reset to default CSS styling + that.$menu[0].style.minWidth = ''; + } } } - } - - if ((!isSearching && that.options.source.data || isSearching && that.options.source.search) && that.selectpicker.current.hasMore && currentChunk === chunkCount - 1) { - // Don't load the next chunk until scrolling has started - // This prevents unnecessary requests while the user is typing if pageSize is <= chunkSize - if (scrollTop > 0) { - // Chunks use 0-based indexing, but pages use 1-based. Add 1 to convert and add 1 again to get next page - var page = Math.floor((currentChunk * that.options.chunkSize) / that.options.source.pageSize) + 2; - - that.fetchData(function () { - that.render(); - that.buildList(size, isSearching); - that.setPositionData(); - scroll(scrollTop); - }, isSearching ? 'search' : 'data', page, isSearching ? that.selectpicker.search.previousValue : undefined); + if ((!isSearching && that.options.source.data || isSearching && that.options.source.search) && that.selectpicker.current.hasMore && currentChunk === chunkCount - 1) { + // Don't load the next chunk until scrolling has started + // This prevents unnecessary requests while the user is typing if pageSize is <= chunkSize + if (scrollTop > 0) { + // Chunks use 0-based indexing, but pages use 1-based. Add 1 to convert and add 1 again to get next page + var page = Math.floor(currentChunk * that.options.chunkSize / that.options.source.pageSize) + 2; + that.fetchData(function () { + that.render(); + that.buildList(size, isSearching); + that.setPositionData(); + scroll(scrollTop); + }, isSearching ? 'search' : 'data', page, isSearching ? that.selectpicker.search.previousValue : undefined); + } } } - } - - that.prevActiveElement = that.activeElement; - - if (!that.options.liveSearch) { - that.$menuInner.trigger('focus'); - } else if (isSearching && init) { - var index = 0, + that.prevActiveElement = that.activeElement; + if (!that.options.liveSearch) { + that.$menuInner.trigger('focus'); + } else if (isSearching && init) { + var index = 0, newActive; - - if (!that.selectpicker.view.canHighlight[index]) { - index = 1 + that.selectpicker.view.canHighlight.slice(1).indexOf(true); + if (!that.selectpicker.view.canHighlight[index]) { + index = 1 + that.selectpicker.view.canHighlight.slice(1).indexOf(true); + } + newActive = that.selectpicker.view.visibleElements[index]; + that.defocusItem(that.selectpicker.view.currentActive); + that.activeElement = (that.selectpicker.current.data[index] || {}).element; + that.focusItem(newActive); } - - newActive = that.selectpicker.view.visibleElements[index]; - - that.defocusItem(that.selectpicker.view.currentActive); - - that.activeElement = (that.selectpicker.current.data[index] || {}).element; - - that.focusItem(newActive); } - } - - $(window) - .off('resize' + EVENT_KEY + '.' + this.selectId + '.createView') - .on('resize' + EVENT_KEY + '.' + this.selectId + '.createView', function () { + $(window).off('resize' + EVENT_KEY + '.' + this.selectId + '.createView').on('resize' + EVENT_KEY + '.' + this.selectId + '.createView', function () { var isActive = that.$newElement.hasClass(classNames.SHOW); - if (isActive) scroll(that.$menuInner[0].scrollTop); }); - }, - - focusItem: function (li, liData, noStyle) { - if (li) { - liData = liData || this.selectpicker.current.data[this.selectpicker.current.elements.indexOf(this.activeElement)]; - var a = li.firstChild; - - if (a) { - a.setAttribute('aria-setsize', this.selectpicker.view.size); - a.setAttribute('aria-posinset', liData.posinset); - - if (noStyle !== true) { - this.focusedParent.setAttribute('aria-activedescendant', a.id); - li.classList.add('active'); - a.classList.add('active'); + }, + focusItem: function focusItem(li, liData, noStyle) { + if (li) { + liData = liData || this.selectpicker.current.data[this.selectpicker.current.elements.indexOf(this.activeElement)]; + var a = li.firstChild; + if (a) { + a.setAttribute('aria-setsize', this.selectpicker.view.size); + a.setAttribute('aria-posinset', liData.posinset); + if (noStyle !== true) { + this.focusedParent.setAttribute('aria-activedescendant', a.id); + li.classList.add('active'); + a.classList.add('active'); + } } } - } - }, - - defocusItem: function (li) { - if (li) { - li.classList.remove('active'); - if (li.firstChild) li.firstChild.classList.remove('active'); - } - }, - - setPlaceholder: function () { - var that = this, + }, + defocusItem: function defocusItem(li) { + if (li) { + li.classList.remove('active'); + if (li.firstChild) li.firstChild.classList.remove('active'); + } + }, + setPlaceholder: function setPlaceholder() { + var that = this, updateIndex = false; + if ((this.options.placeholder || this.options.allowClear) && !this.multiple) { + if (!this.selectpicker.view.titleOption) this.selectpicker.view.titleOption = document.createElement('option'); - if ((this.options.placeholder || this.options.allowClear) && !this.multiple) { - if (!this.selectpicker.view.titleOption) this.selectpicker.view.titleOption = document.createElement('option'); - - // this option doesn't create a new
  • element, but does add a new option at the start, - // so startIndex should increase to prevent having to check every option for the bs-title-option class - updateIndex = true; - - var element = this.$element[0], + // this option doesn't create a new
  • element, but does add a new option at the start, + // so startIndex should increase to prevent having to check every option for the bs-title-option class + updateIndex = true; + var element = this.$element[0], selectTitleOption = false, titleNotAppended = !this.selectpicker.view.titleOption.parentNode, selectedIndex = element.selectedIndex, @@ -1585,170 +1435,134 @@ firstSelectableIndex = firstSelectable ? firstSelectable.index : 0, navigation = window.performance && window.performance.getEntriesByType('navigation'), // Safari doesn't support getEntriesByType('navigation') - fall back to performance.navigation - isNotBackForward = (navigation && navigation.length) ? navigation[0].type !== 'back_forward' : window.performance.navigation.type !== 2; - - if (titleNotAppended) { - // Use native JS to prepend option (faster) - this.selectpicker.view.titleOption.className = 'bs-title-option'; - this.selectpicker.view.titleOption.value = ''; - - // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option. - // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs, - // if so, the select will have the data-selected attribute - selectTitleOption = !selectedOption || (selectedIndex === firstSelectableIndex && selectedOption.defaultSelected === false && this.$element.data('selected') === undefined); - } - - if (titleNotAppended || this.selectpicker.view.titleOption.index !== 0) { - element.insertBefore(this.selectpicker.view.titleOption, element.firstChild); - } + isNotBackForward = navigation && navigation.length ? navigation[0].type !== 'back_forward' : window.performance.navigation.type !== 2; + if (titleNotAppended) { + // Use native JS to prepend option (faster) + this.selectpicker.view.titleOption.className = 'bs-title-option'; + this.selectpicker.view.titleOption.value = ''; + + // Check if selected or data-selected attribute is already set on an option. If not, select the titleOption option. + // the selected item may have been changed by user or programmatically before the bootstrap select plugin runs, + // if so, the select will have the data-selected attribute + selectTitleOption = !selectedOption || selectedIndex === firstSelectableIndex && selectedOption.defaultSelected === false && this.$element.data('selected') === undefined; + } + if (titleNotAppended || this.selectpicker.view.titleOption.index !== 0) { + element.insertBefore(this.selectpicker.view.titleOption, element.firstChild); + } - // Set selected *after* appending to select, - // otherwise the option doesn't get selected in IE - // set using selectedIndex, as setting the selected attr to true here doesn't work in IE11 - if (selectTitleOption && isNotBackForward) { - element.selectedIndex = 0; - } else if (document.readyState !== 'complete') { - // if navigation type is back_forward, there's a chance the select will have its value set by BFCache - // wait for that value to be set, then run render again - window.addEventListener('pageshow', function () { - if (that.selectpicker.view.displayedValue !== element.value) that.render(); - }); + // Set selected *after* appending to select, + // otherwise the option doesn't get selected in IE + // set using selectedIndex, as setting the selected attr to true here doesn't work in IE11 + if (selectTitleOption && isNotBackForward) { + element.selectedIndex = 0; + } else if (document.readyState !== 'complete') { + // if navigation type is back_forward, there's a chance the select will have its value set by BFCache + // wait for that value to be set, then run render again + window.addEventListener('pageshow', function () { + if (that.selectpicker.view.displayedValue !== element.value) that.render(); + }); + } } - } - - return updateIndex; - }, - - fetchData: function (callback, type, page, searchValue) { - page = page || 1; - type = type || 'data'; - - var that = this, + return updateIndex; + }, + fetchData: function fetchData(callback, type, page, searchValue) { + page = page || 1; + type = type || 'data'; + var that = this, data = this.options.source[type], builtData; - - if (data) { - this.options.virtualScroll = true; - - if (typeof data === 'function') { - data.call( - this, - function (data, more, totalItems) { + if (data) { + this.options.virtualScroll = true; + if (typeof data === 'function') { + data.call(this, function (data, more, totalItems) { var current = that.selectpicker[type === 'search' ? 'search' : 'main']; current.hasMore = more; current.totalItems = totalItems; builtData = that.buildData(data, type); callback.call(that, builtData); that.$element.trigger('fetched' + EVENT_KEY); - }, - page, - searchValue - ); - } else if (Array.isArray(data)) { - builtData = that.buildData(data, type); + }, page, searchValue); + } else if (Array.isArray(data)) { + builtData = that.buildData(data, type); + callback.call(that, builtData); + } + } else { + builtData = this.buildData(false, type); callback.call(that, builtData); } - } else { - builtData = this.buildData(false, type); - callback.call(that, builtData); - } - }, - - buildData: function (data, type) { - var that = this; - var dataGetter = data === false ? getOptionData.fromOption : getOptionData.fromDataSource; - - var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([style*="display: none"])', + }, + buildData: function buildData(data, type) { + var that = this; + var dataGetter = data === false ? getOptionData.fromOption : getOptionData.fromDataSource; + var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([style*="display: none"])', mainData = [], startLen = this.selectpicker.main.data ? this.selectpicker.main.data.length : 0, optID = 0, startIndex = this.setPlaceholder() && !data ? 1 : 0; // append the titleOption if necessary and skip the first option in the loop - if (type === 'search') { - startLen = this.selectpicker.search.data.length; - } - - if (this.options.hideDisabled) optionSelector += ':not(:disabled)'; - - var selectOptions = data ? data.filter(filterHidden, this) : this.$element[0].querySelectorAll('select > *' + optionSelector); - - function addDivider (config) { - var previousData = mainData[mainData.length - 1]; - - // ensure optgroup doesn't create back-to-back dividers - if ( - previousData && - previousData.type === 'divider' && - (previousData.optID || config.optID) - ) { - return; + if (type === 'search') { + startLen = this.selectpicker.search.data.length; } + if (this.options.hideDisabled) optionSelector += ':not(:disabled)'; + var selectOptions = data ? data.filter(filterHidden, this) : this.$element[0].querySelectorAll('select > *' + optionSelector); + function addDivider(config) { + var previousData = mainData[mainData.length - 1]; - config = config || {}; - config.type = 'divider'; - - mainData.push(config); - } - - function addOption (item, config) { - config = config || {}; - - config.divider = dataGetter(item, 'divider'); - - if (config.divider === true) { - addDivider({ - optID: config.optID - }); - } else { - var liIndex = mainData.length + startLen, + // ensure optgroup doesn't create back-to-back dividers + if (previousData && previousData.type === 'divider' && (previousData.optID || config.optID)) { + return; + } + config = config || {}; + config.type = 'divider'; + mainData.push(config); + } + function addOption(item, config) { + config = config || {}; + config.divider = dataGetter(item, 'divider'); + if (config.divider === true) { + addDivider({ + optID: config.optID + }); + } else { + var liIndex = mainData.length + startLen, cssText = dataGetter(item, 'style'), inlineStyle = cssText ? htmlEscape(cssText) : '', optionClass = (item.className || '') + (config.optgroupClass || ''); - - if (config.optID) optionClass = 'opt ' + optionClass; - - config.optionClass = optionClass.trim(); - config.inlineStyle = inlineStyle; - - config.text = dataGetter(item, 'text'); - config.title = dataGetter(item, 'title'); - config.content = dataGetter(item, 'content'); - config.tokens = dataGetter(item, 'tokens'); - config.subtext = dataGetter(item, 'subtext'); - config.icon = dataGetter(item, 'icon'); - - config.display = config.content || config.text; - config.value = item.value === undefined ? item.text : item.value; - config.type = 'option'; - config.index = liIndex; - - config.option = !item.option ? item : item.option; // reference option element if it exists - config.option.liIndex = liIndex; - config.selected = !!item.selected; - config.disabled = config.disabled || !!item.disabled; - - if (data !== false) { - if (that.selectpicker.optionValuesDataMap[config.value]) { - config = $.extend(that.selectpicker.optionValuesDataMap[config.value], config); - } else { - that.selectpicker.optionValuesDataMap[config.value] = config; + if (config.optID) optionClass = 'opt ' + optionClass; + config.optionClass = optionClass.trim(); + config.inlineStyle = inlineStyle; + config.text = dataGetter(item, 'text'); + config.title = dataGetter(item, 'title'); + config.content = dataGetter(item, 'content'); + config.tokens = dataGetter(item, 'tokens'); + config.subtext = dataGetter(item, 'subtext'); + config.icon = dataGetter(item, 'icon'); + config.display = config.content || config.text; + config.value = item.value === undefined ? item.text : item.value; + config.type = 'option'; + config.index = liIndex; + config.option = !item.option ? item : item.option; // reference option element if it exists + config.option.liIndex = liIndex; + config.selected = !!item.selected; + config.disabled = config.disabled || !!item.disabled; + if (data !== false) { + if (that.selectpicker.optionValuesDataMap[config.value]) { + config = $.extend(that.selectpicker.optionValuesDataMap[config.value], config); + } else { + that.selectpicker.optionValuesDataMap[config.value] = config; + } } + mainData.push(config); } - - mainData.push(config); } - } - - function addOptgroup (index, selectOptions) { - var optgroup = selectOptions[index], + function addOptgroup(index, selectOptions) { + var optgroup = selectOptions[index], // skip placeholder option previous = index - 1 < startIndex ? false : selectOptions[index - 1], next = selectOptions[index + 1], options = data ? optgroup.children.filter(filterHidden, this) : optgroup.querySelectorAll('option' + optionSelector); - - if (!options.length) return; - - var config = { + if (!options.length) return; + var config = { display: htmlEscape(dataGetter(item, 'label')), subtext: dataGetter(optgroup, 'subtext'), icon: dataGetter(optgroup, 'icon'), @@ -1758,173 +1572,133 @@ }, headerIndex, lastIndex; - - optID++; - - if (previous) { - addDivider({ optID: optID }); - } - - config.optID = optID; - - mainData.push(config); - - for (var j = 0, len = options.length; j < len; j++) { - var option = options[j]; - - if (j === 0) { - headerIndex = mainData.length - 1; - lastIndex = headerIndex + len; + optID++; + if (previous) { + addDivider({ + optID: optID + }); + } + config.optID = optID; + mainData.push(config); + for (var j = 0, len = options.length; j < len; j++) { + var option = options[j]; + if (j === 0) { + headerIndex = mainData.length - 1; + lastIndex = headerIndex + len; + } + addOption(option, { + headerIndex: headerIndex, + lastIndex: lastIndex, + optID: config.optID, + optgroupClass: config.optgroupClass, + disabled: optgroup.disabled + }); + } + if (next) { + addDivider({ + optID: optID + }); } - - addOption(option, { - headerIndex: headerIndex, - lastIndex: lastIndex, - optID: config.optID, - optgroupClass: config.optgroupClass, - disabled: optgroup.disabled - }); - } - - if (next) { - addDivider({ optID: optID }); } - } - - for (var len = selectOptions.length, i = startIndex; i < len; i++) { - var item = selectOptions[i], + for (var len = selectOptions.length, i = startIndex; i < len; i++) { + var item = selectOptions[i], children = item.children; - - if (children && children.length) { - addOptgroup.call(this, i, selectOptions); - } else { - addOption.call(this, item, {}); - } - } - - switch (type) { - case 'data': { - if (!this.selectpicker.main.data) { - this.selectpicker.main.data = []; + if (children && children.length) { + addOptgroup.call(this, i, selectOptions); + } else { + addOption.call(this, item, {}); } - Array.prototype.push.apply(this.selectpicker.main.data, mainData); - this.selectpicker.current.data = this.selectpicker.main.data; - break; } - case 'search': { - Array.prototype.push.apply(this.selectpicker.search.data, mainData); - break; + switch (type) { + case 'data': + { + if (!this.selectpicker.main.data) { + this.selectpicker.main.data = []; + } + Array.prototype.push.apply(this.selectpicker.main.data, mainData); + this.selectpicker.current.data = this.selectpicker.main.data; + break; + } + case 'search': + { + Array.prototype.push.apply(this.selectpicker.search.data, mainData); + break; + } } - } - - return mainData; - }, - - buildList: function (size, searching) { - var that = this, + return mainData; + }, + buildList: function buildList(size, searching) { + var that = this, selectData = searching ? this.selectpicker.search.data : this.selectpicker.main.data, mainElements = [], widestOptionLength = 0; - - if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) { - elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark'; - elementTemplates.a.appendChild(elementTemplates.checkMark); - } - - function buildElement (mainElements, item) { - var liElement, - combinedLength = 0; - - switch (item.type) { - case 'divider': - liElement = generateOption.li( - false, - classNames.DIVIDER, - (item.optID ? item.optID + 'div' : undefined) - ); - - break; - - case 'option': - liElement = generateOption.li( - generateOption.a( - generateOption.text.call(that, item), - item.optionClass, - item.inlineStyle - ), - '', - item.optID - ); - - if (liElement.firstChild) { - liElement.firstChild.id = that.selectId + '-' + item.index; - } - - break; - - case 'optgroup-label': - liElement = generateOption.li( - generateOption.label.call(that, item), - 'dropdown-header' + item.optgroupClass, - item.optID - ); - - break; - } - - if (!item.element) { - item.element = liElement; - } else { - item.element.innerHTML = liElement.innerHTML; + if ((that.options.showTick || that.multiple) && !elementTemplates.checkMark.parentNode) { + elementTemplates.checkMark.className = this.options.iconBase + ' ' + that.options.tickIcon + ' check-mark'; + elementTemplates.a.appendChild(elementTemplates.checkMark); } - mainElements.push(item.element); - - // count the number of characters in the option - not perfect, but should work in most cases - if (item.display) combinedLength += item.display.length; - if (item.subtext) combinedLength += item.subtext.length; - // if there is an icon, ensure this option's width is checked - if (item.icon) combinedLength += 1; - - if (combinedLength > widestOptionLength) { - widestOptionLength = combinedLength; - - // guess which option is the widest - // use this when calculating menu width - // not perfect, but it's fast, and the width will be updating accordingly when scrolling - that.selectpicker.view.widestOption = mainElements[mainElements.length - 1]; + function buildElement(mainElements, item) { + var liElement, + combinedLength = 0; + switch (item.type) { + case 'divider': + liElement = generateOption.li(false, classNames.DIVIDER, item.optID ? item.optID + 'div' : undefined); + break; + case 'option': + liElement = generateOption.li(generateOption.a(generateOption.text.call(that, item), item.optionClass, item.inlineStyle), '', item.optID); + if (liElement.firstChild) { + liElement.firstChild.id = that.selectId + '-' + item.index; + } + break; + case 'optgroup-label': + liElement = generateOption.li(generateOption.label.call(that, item), 'dropdown-header' + item.optgroupClass, item.optID); + break; + } + if (!item.element) { + item.element = liElement; + } else { + item.element.innerHTML = liElement.innerHTML; + } + mainElements.push(item.element); + + // count the number of characters in the option - not perfect, but should work in most cases + if (item.display) combinedLength += item.display.length; + if (item.subtext) combinedLength += item.subtext.length; + // if there is an icon, ensure this option's width is checked + if (item.icon) combinedLength += 1; + if (combinedLength > widestOptionLength) { + widestOptionLength = combinedLength; + + // guess which option is the widest + // use this when calculating menu width + // not perfect, but it's fast, and the width will be updating accordingly when scrolling + that.selectpicker.view.widestOption = mainElements[mainElements.length - 1]; + } } - } - - var startIndex = size || 0; - - for (var len = selectData.length, i = startIndex; i < len; i++) { - var item = selectData[i]; - - buildElement(mainElements, item); - } - - if (size) { - if (searching) { - Array.prototype.push.apply(this.selectpicker.search.elements, mainElements); - } else { - Array.prototype.push.apply(this.selectpicker.main.elements, mainElements); - this.selectpicker.current.elements = this.selectpicker.main.elements; + var startIndex = size || 0; + for (var len = selectData.length, i = startIndex; i < len; i++) { + var item = selectData[i]; + buildElement(mainElements, item); } - } else { - if (searching) { - this.selectpicker.search.elements = mainElements; + if (size) { + if (searching) { + Array.prototype.push.apply(this.selectpicker.search.elements, mainElements); + } else { + Array.prototype.push.apply(this.selectpicker.main.elements, mainElements); + this.selectpicker.current.elements = this.selectpicker.main.elements; + } } else { - this.selectpicker.main.elements = this.selectpicker.current.elements = mainElements; + if (searching) { + this.selectpicker.search.elements = mainElements; + } else { + this.selectpicker.main.elements = this.selectpicker.current.elements = mainElements; + } } - } - }, - - findLis: function () { - return this.$menuInner.find('.inner > li'); - }, - - render: function (init) { - var that = this, + }, + findLis: function findLis() { + return this.$menuInner.find('.inner > li'); + }, + render: function render(init) { + var that = this, element = this.$element[0], // ensure titleOption is appended and selected (if necessary) before getting selectedOptions placeholderSelected = this.setPlaceholder() && element.selectedIndex === 0, @@ -1938,171 +1712,147 @@ showCount, countMax, hasContent = false; - - function createSelected (item) { - if (item.selected) { - that.createOption(item, true); - } else if (item.children && item.children.length) { - item.children.map(createSelected); + function createSelected(item) { + if (item.selected) { + that.createOption(item, true); + } else if (item.children && item.children.length) { + item.children.map(createSelected); + } } - } - - // create selected option elements to ensure select value is correct - if (this.options.source.data && init) { - selectedOptions.map(createSelected); - element.appendChild(this.selectpicker.main.optionQueue); - - if (placeholderSelected) placeholderSelected = element.selectedIndex === 0; - } - button.classList.toggle('bs-placeholder', that.multiple ? !selectedCount : !selectedValues && selectedValues !== 0); - - if (!that.multiple && selectedOptions.length === 1) { - that.selectpicker.view.displayedValue = selectedValues; - } - - if (this.options.selectedTextFormat === 'static') { - titleFragment = generateOption.text.call(this, { text: this.options.placeholder }, true); - } else { - showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 0; - - // determine if the number of selected options will be shown (showCount === true) - if (showCount) { - countMax = this.options.selectedTextFormat.split('>'); - showCount = (countMax.length > 1 && selectedCount > countMax[1]) || (countMax.length === 1 && selectedCount >= 2); + // create selected option elements to ensure select value is correct + if (this.options.source.data && init) { + selectedOptions.map(createSelected); + element.appendChild(this.selectpicker.main.optionQueue); + if (placeholderSelected) placeholderSelected = element.selectedIndex === 0; } + button.classList.toggle('bs-placeholder', that.multiple ? !selectedCount : !selectedValues && selectedValues !== 0); + if (!that.multiple && selectedOptions.length === 1) { + that.selectpicker.view.displayedValue = selectedValues; + } + if (this.options.selectedTextFormat === 'static') { + titleFragment = generateOption.text.call(this, { + text: this.options.placeholder + }, true); + } else { + showCount = this.multiple && this.options.selectedTextFormat.indexOf('count') !== -1 && selectedCount > 0; - // only loop through all selected options if the count won't be shown - if (showCount === false) { - if (!placeholderSelected) { - for (var selectedIndex = 0; selectedIndex < selectedCount; selectedIndex++) { - if (selectedIndex < 50) { - var option = selectedOptions[selectedIndex], - titleOptions = {}; - - if (option) { - if (this.multiple && selectedIndex > 0) { - titleFragment.appendChild(multipleSeparator.cloneNode(false)); - } + // determine if the number of selected options will be shown (showCount === true) + if (showCount) { + countMax = this.options.selectedTextFormat.split('>'); + showCount = countMax.length > 1 && selectedCount > countMax[1] || countMax.length === 1 && selectedCount >= 2; + } - if (option.title) { - titleOptions.text = option.title; - } else if (option.content && that.options.showContent) { - titleOptions.content = option.content.toString(); - hasContent = true; - } else { - if (that.options.showIcon) { - titleOptions.icon = option.icon; + // only loop through all selected options if the count won't be shown + if (showCount === false) { + if (!placeholderSelected) { + for (var selectedIndex = 0; selectedIndex < selectedCount; selectedIndex++) { + if (selectedIndex < 50) { + var option = selectedOptions[selectedIndex], + titleOptions = {}; + if (option) { + if (this.multiple && selectedIndex > 0) { + titleFragment.appendChild(multipleSeparator.cloneNode(false)); + } + if (option.title) { + titleOptions.text = option.title; + } else if (option.content && that.options.showContent) { + titleOptions.content = option.content.toString(); + hasContent = true; + } else { + if (that.options.showIcon) { + titleOptions.icon = option.icon; + } + if (that.options.showSubtext && !that.multiple && option.subtext) titleOptions.subtext = ' ' + option.subtext; + titleOptions.text = option.text.trim(); } - if (that.options.showSubtext && !that.multiple && option.subtext) titleOptions.subtext = ' ' + option.subtext; - titleOptions.text = option.text.trim(); + titleFragment.appendChild(generateOption.text.call(this, titleOptions, true)); } - - titleFragment.appendChild(generateOption.text.call(this, titleOptions, true)); + } else { + break; } - } else { - break; } - } - // add ellipsis - if (selectedCount > 49) { - titleFragment.appendChild(document.createTextNode('...')); + // add ellipsis + if (selectedCount > 49) { + titleFragment.appendChild(document.createTextNode('...')); + } } + } else { + var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([data-divider="true"]):not([style*="display: none"])'; + if (this.options.hideDisabled) optionSelector += ':not(:disabled)'; + + // If this is a multiselect, and selectedTextFormat is count, then show 1 of 2 selected, etc. + var totalCount = this.$element[0].querySelectorAll('select > option' + optionSelector + ', optgroup' + optionSelector + ' option' + optionSelector).length, + tr8nText = typeof this.options.countSelectedText === 'function' ? this.options.countSelectedText(selectedCount, totalCount) : this.options.countSelectedText; + titleFragment = generateOption.text.call(this, { + text: tr8nText.replace('{0}', selectedCount.toString()).replace('{1}', totalCount.toString()) + }, true); } - } else { - var optionSelector = ':not([hidden]):not([data-hidden="true"]):not([data-divider="true"]):not([style*="display: none"])'; - if (this.options.hideDisabled) optionSelector += ':not(:disabled)'; - - // If this is a multiselect, and selectedTextFormat is count, then show 1 of 2 selected, etc. - var totalCount = this.$element[0].querySelectorAll('select > option' + optionSelector + ', optgroup' + optionSelector + ' option' + optionSelector).length, - tr8nText = (typeof this.options.countSelectedText === 'function') ? this.options.countSelectedText(selectedCount, totalCount) : this.options.countSelectedText; + } + // If the select doesn't have a title, then use the default, or if nothing is set at all, use noneSelectedText + if (!titleFragment.childNodes.length) { titleFragment = generateOption.text.call(this, { - text: tr8nText.replace('{0}', selectedCount.toString()).replace('{1}', totalCount.toString()) + text: this.options.placeholder ? this.options.placeholder : this.options.noneSelectedText }, true); } - } - - // If the select doesn't have a title, then use the default, or if nothing is set at all, use noneSelectedText - if (!titleFragment.childNodes.length) { - titleFragment = generateOption.text.call(this, { - text: this.options.placeholder ? this.options.placeholder : this.options.noneSelectedText - }, true); - } - - // if the select has a title, apply it to the button, and if not, apply titleFragment text - // strip all HTML tags and trim the result, then unescape any escaped tags - button.title = titleFragment.textContent.replace(/<[^>]*>?/g, '').trim(); - - if (this.options.sanitize && hasContent) { - sanitizeHtml([titleFragment], that.options.whiteList, that.options.sanitizeFn); - } - - buttonInner.innerHTML = ''; - buttonInner.appendChild(titleFragment); - if (version.major < 4 && this.$newElement[0].classList.contains('bs3-has-addon')) { - var filterExpand = button.querySelector('.filter-expand'), + // if the select has a title, apply it to the button, and if not, apply titleFragment text + // strip all HTML tags and trim the result, then unescape any escaped tags + button.title = titleFragment.textContent.replace(/<[^>]*>?/g, '').trim(); + if (this.options.sanitize && hasContent) { + sanitizeHtml([titleFragment], that.options.whiteList, that.options.sanitizeFn); + } + buttonInner.innerHTML = ''; + buttonInner.appendChild(titleFragment); + if (version.major < 4 && this.$newElement[0].classList.contains('bs3-has-addon')) { + var filterExpand = button.querySelector('.filter-expand'), clone = buttonInner.cloneNode(true); - - clone.className = 'filter-expand'; - - if (filterExpand) { - button.replaceChild(clone, filterExpand); - } else { - button.appendChild(clone); + clone.className = 'filter-expand'; + if (filterExpand) { + button.replaceChild(clone, filterExpand); + } else { + button.appendChild(clone); + } } - } - - this.$element.trigger('rendered' + EVENT_KEY); - }, - - /** - * @param [style] - * @param [status] - */ - setStyle: function (newStyle, status) { - var button = this.$button[0], + this.$element.trigger('rendered' + EVENT_KEY); + }, + /** + * @param [style] + * @param [status] + */ + setStyle: function setStyle(newStyle, status) { + var button = this.$button[0], newElement = this.$newElement[0], style = this.options.style.trim(), buttonClass; - - if (this.$element.attr('class')) { - this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, '')); - } - - if (version.major < 4) { - newElement.classList.add('bs3'); - - if (newElement.parentNode.classList && newElement.parentNode.classList.contains('input-group') && - (newElement.previousElementSibling || newElement.nextElementSibling) && - (newElement.previousElementSibling || newElement.nextElementSibling).classList.contains('input-group-addon') - ) { - newElement.classList.add('bs3-has-addon'); + if (this.$element.attr('class')) { + this.$newElement.addClass(this.$element.attr('class').replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, '')); } - } - - if (newStyle) { - buttonClass = newStyle.trim(); - } else { - buttonClass = style; - } - - if (status == 'add') { - if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' ')); - } else if (status == 'remove') { - if (buttonClass) button.classList.remove.apply(button.classList, buttonClass.split(' ')); - } else { - if (style) button.classList.remove.apply(button.classList, style.split(' ')); - if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' ')); - } - }, - - liHeight: function (refresh) { - if (!refresh && (this.options.size === false || Object.keys(this.sizeInfo).length)) return; - - var newElement = elementTemplates.div.cloneNode(false), + if (version.major < 4) { + newElement.classList.add('bs3'); + if (newElement.parentNode.classList && newElement.parentNode.classList.contains('input-group') && (newElement.previousElementSibling || newElement.nextElementSibling) && (newElement.previousElementSibling || newElement.nextElementSibling).classList.contains('input-group-addon')) { + newElement.classList.add('bs3-has-addon'); + } + } + if (newStyle) { + buttonClass = newStyle.trim(); + } else { + buttonClass = style; + } + if (status == 'add') { + if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' ')); + } else if (status == 'remove') { + if (buttonClass) button.classList.remove.apply(button.classList, buttonClass.split(' ')); + } else { + if (style) button.classList.remove.apply(button.classList, style.split(' ')); + if (buttonClass) button.classList.add.apply(button.classList, buttonClass.split(' ')); + } + }, + liHeight: function liHeight(refresh) { + if (!refresh && (this.options.size === false || Object.keys(this.sizeInfo).length)) return; + var newElement = elementTemplates.div.cloneNode(false), menu = elementTemplates.div.cloneNode(false), menuInner = elementTemplates.div.cloneNode(false), menuInnerInner = document.createElement('ul'), @@ -2116,62 +1866,53 @@ actions = this.options.actionsBox && this.multiple && this.$menu.find('.bs-actionsbox').length > 0 ? this.$menu.find('.bs-actionsbox')[0].cloneNode(true) : null, doneButton = this.options.doneButton && this.multiple && this.$menu.find('.bs-donebutton').length > 0 ? this.$menu.find('.bs-donebutton')[0].cloneNode(true) : null, firstOption = this.$element[0].options[0]; - - this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth; - - text.className = 'text'; - a.className = 'dropdown-item ' + (firstOption ? firstOption.className : ''); - newElement.className = this.$menu[0].parentNode.className + ' ' + classNames.SHOW; - newElement.style.width = 0; // ensure button width doesn't affect natural width of menu when calculating - if (this.options.width === 'auto') menu.style.minWidth = 0; - menu.className = classNames.MENU + ' ' + classNames.SHOW; - menuInner.className = 'inner ' + classNames.SHOW; - menuInnerInner.className = classNames.MENU + ' inner ' + (version.major >= '4' ? classNames.SHOW : ''); - divider.className = classNames.DIVIDER; - dropdownHeader.className = 'dropdown-header'; - - text.appendChild(document.createTextNode('\u200b')); - - if (this.selectpicker.current.data.length) { - for (var i = 0; i < this.selectpicker.current.data.length; i++) { - var data = this.selectpicker.current.data[i]; - if (data.type === 'option' && $(data.element.firstChild).css('display') !== 'none') { - li = data.element; - break; + this.sizeInfo.selectWidth = this.$newElement[0].offsetWidth; + text.className = 'text'; + a.className = 'dropdown-item ' + (firstOption ? firstOption.className : ''); + newElement.className = this.$menu[0].parentNode.className + ' ' + classNames.SHOW; + newElement.style.width = 0; // ensure button width doesn't affect natural width of menu when calculating + if (this.options.width === 'auto') menu.style.minWidth = 0; + menu.className = classNames.MENU + ' ' + classNames.SHOW; + menuInner.className = 'inner ' + classNames.SHOW; + menuInnerInner.className = classNames.MENU + ' inner ' + (version.major >= '4' ? classNames.SHOW : ''); + divider.className = classNames.DIVIDER; + dropdownHeader.className = 'dropdown-header'; + text.appendChild(document.createTextNode("\u200B")); + if (this.selectpicker.current.data.length) { + for (var i = 0; i < this.selectpicker.current.data.length; i++) { + var data = this.selectpicker.current.data[i]; + if (data.type === 'option' && $(data.element.firstChild).css('display') !== 'none') { + li = data.element; + break; + } } - } - } else { - li = elementTemplates.li.cloneNode(false); - a.appendChild(text); - li.appendChild(a); - } - - dropdownHeader.appendChild(text.cloneNode(true)); - - if (this.selectpicker.view.widestOption) { - menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(true)); - } - - menuInnerInner.appendChild(li); - menuInnerInner.appendChild(divider); - menuInnerInner.appendChild(dropdownHeader); - if (header) menu.appendChild(header); - if (search) { - var input = document.createElement('input'); - search.className = 'bs-searchbox'; - input.className = 'form-control'; - search.appendChild(input); - menu.appendChild(search); - } - if (actions) menu.appendChild(actions); - menuInner.appendChild(menuInnerInner); - menu.appendChild(menuInner); - if (doneButton) menu.appendChild(doneButton); - newElement.appendChild(menu); - - document.body.appendChild(newElement); - - var liHeight = li.offsetHeight, + } else { + li = elementTemplates.li.cloneNode(false); + a.appendChild(text); + li.appendChild(a); + } + dropdownHeader.appendChild(text.cloneNode(true)); + if (this.selectpicker.view.widestOption) { + menuInnerInner.appendChild(this.selectpicker.view.widestOption.cloneNode(true)); + } + menuInnerInner.appendChild(li); + menuInnerInner.appendChild(divider); + menuInnerInner.appendChild(dropdownHeader); + if (header) menu.appendChild(header); + if (search) { + var input = document.createElement('input'); + search.className = 'bs-searchbox'; + input.className = 'form-control'; + search.appendChild(input); + menu.appendChild(search); + } + if (actions) menu.appendChild(actions); + menuInner.appendChild(menuInnerInner); + menu.appendChild(menuInner); + if (doneButton) menu.appendChild(doneButton); + newElement.appendChild(menu); + document.body.appendChild(newElement); + var liHeight = li.offsetHeight, dropdownHeaderHeight = dropdownHeader ? dropdownHeader.offsetHeight : 0, headerHeight = header ? header.offsetHeight : 0, searchHeight = search ? search.offsetHeight : 0, @@ -2181,78 +1922,60 @@ menuStyle = window.getComputedStyle(menu), menuWidth = menu.offsetWidth, menuPadding = { - vert: toInteger(menuStyle.paddingTop) + - toInteger(menuStyle.paddingBottom) + - toInteger(menuStyle.borderTopWidth) + - toInteger(menuStyle.borderBottomWidth), - horiz: toInteger(menuStyle.paddingLeft) + - toInteger(menuStyle.paddingRight) + - toInteger(menuStyle.borderLeftWidth) + - toInteger(menuStyle.borderRightWidth) + vert: toInteger(menuStyle.paddingTop) + toInteger(menuStyle.paddingBottom) + toInteger(menuStyle.borderTopWidth) + toInteger(menuStyle.borderBottomWidth), + horiz: toInteger(menuStyle.paddingLeft) + toInteger(menuStyle.paddingRight) + toInteger(menuStyle.borderLeftWidth) + toInteger(menuStyle.borderRightWidth) }, menuExtras = { - vert: menuPadding.vert + - toInteger(menuStyle.marginTop) + - toInteger(menuStyle.marginBottom) + 2, - horiz: menuPadding.horiz + - toInteger(menuStyle.marginLeft) + - toInteger(menuStyle.marginRight) + 2 + vert: menuPadding.vert + toInteger(menuStyle.marginTop) + toInteger(menuStyle.marginBottom) + 2, + horiz: menuPadding.horiz + toInteger(menuStyle.marginLeft) + toInteger(menuStyle.marginRight) + 2 }, scrollBarWidth; - - menuInner.style.overflowY = 'scroll'; - - scrollBarWidth = menu.offsetWidth - menuWidth; - - document.body.removeChild(newElement); - - this.sizeInfo.liHeight = liHeight; - this.sizeInfo.dropdownHeaderHeight = dropdownHeaderHeight; - this.sizeInfo.headerHeight = headerHeight; - this.sizeInfo.searchHeight = searchHeight; - this.sizeInfo.actionsHeight = actionsHeight; - this.sizeInfo.doneButtonHeight = doneButtonHeight; - this.sizeInfo.dividerHeight = dividerHeight; - this.sizeInfo.menuPadding = menuPadding; - this.sizeInfo.menuExtras = menuExtras; - this.sizeInfo.menuWidth = menuWidth; - this.sizeInfo.menuInnerInnerWidth = menuWidth - menuPadding.horiz; - this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth; - this.sizeInfo.scrollBarWidth = scrollBarWidth; - this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight; - - this.setPositionData(); - }, - - getSelectPosition: function () { - var that = this, + menuInner.style.overflowY = 'scroll'; + scrollBarWidth = menu.offsetWidth - menuWidth; + document.body.removeChild(newElement); + this.sizeInfo.liHeight = liHeight; + this.sizeInfo.dropdownHeaderHeight = dropdownHeaderHeight; + this.sizeInfo.headerHeight = headerHeight; + this.sizeInfo.searchHeight = searchHeight; + this.sizeInfo.actionsHeight = actionsHeight; + this.sizeInfo.doneButtonHeight = doneButtonHeight; + this.sizeInfo.dividerHeight = dividerHeight; + this.sizeInfo.menuPadding = menuPadding; + this.sizeInfo.menuExtras = menuExtras; + this.sizeInfo.menuWidth = menuWidth; + this.sizeInfo.menuInnerInnerWidth = menuWidth - menuPadding.horiz; + this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth; + this.sizeInfo.scrollBarWidth = scrollBarWidth; + this.sizeInfo.selectHeight = this.$newElement[0].offsetHeight; + this.setPositionData(); + }, + getSelectPosition: function getSelectPosition() { + var that = this, $window = $(window), pos = that.$newElement.offset(), $container = $(that.options.container), containerPos; - - if (that.options.container && $container.length && !$container.is('body')) { - containerPos = $container.offset(); - containerPos.top += parseInt($container.css('borderTopWidth')); - containerPos.left += parseInt($container.css('borderLeftWidth')); - } else { - containerPos = { top: 0, left: 0 }; - } - - var winPad = that.options.windowPadding; - - this.sizeInfo.selectOffsetTop = pos.top - containerPos.top - $window.scrollTop(); - this.sizeInfo.selectOffsetBot = $window.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - containerPos.top - winPad[2]; - this.sizeInfo.selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft(); - this.sizeInfo.selectOffsetRight = $window.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - containerPos.left - winPad[1]; - this.sizeInfo.selectOffsetTop -= winPad[0]; - this.sizeInfo.selectOffsetLeft -= winPad[3]; - }, - - setMenuSize: function (isAuto) { - this.getSelectPosition(); - - var selectWidth = this.sizeInfo.selectWidth, + if (that.options.container && $container.length && !$container.is('body')) { + containerPos = $container.offset(); + containerPos.top += parseInt($container.css('borderTopWidth')); + containerPos.left += parseInt($container.css('borderLeftWidth')); + } else { + containerPos = { + top: 0, + left: 0 + }; + } + var winPad = that.options.windowPadding; + this.sizeInfo.selectOffsetTop = pos.top - containerPos.top - $window.scrollTop(); + this.sizeInfo.selectOffsetBot = $window.height() - this.sizeInfo.selectOffsetTop - this.sizeInfo.selectHeight - containerPos.top - winPad[2]; + this.sizeInfo.selectOffsetLeft = pos.left - containerPos.left - $window.scrollLeft(); + this.sizeInfo.selectOffsetRight = $window.width() - this.sizeInfo.selectOffsetLeft - this.sizeInfo.selectWidth - containerPos.left - winPad[1]; + this.sizeInfo.selectOffsetTop -= winPad[0]; + this.sizeInfo.selectOffsetLeft -= winPad[3]; + }, + setMenuSize: function setMenuSize(isAuto) { + this.getSelectPosition(); + var selectWidth = this.sizeInfo.selectWidth, liHeight = this.sizeInfo.liHeight, headerHeight = this.sizeInfo.headerHeight, searchHeight = this.sizeInfo.searchHeight, @@ -2269,177 +1992,146 @@ menuInnerMinHeight, estimate, isDropup; - - if (this.options.dropupAuto) { - // Get the estimated height of the menu without scrollbars. - // This is useful for smaller menus, where there might be plenty of room - // below the button without setting dropup, but we can't know - // the exact height of the menu until createView is called later - estimate = liHeight * this.selectpicker.current.data.length + menuPadding.vert; - - isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot; - - // ensure dropup doesn't change while searching (so menu doesn't bounce back and forth) - if (this.selectpicker.isSearching === true) { - isDropup = this.selectpicker.dropup; + if (this.options.dropupAuto) { + // Get the estimated height of the menu without scrollbars. + // This is useful for smaller menus, where there might be plenty of room + // below the button without setting dropup, but we can't know + // the exact height of the menu until createView is called later + estimate = liHeight * this.selectpicker.current.data.length + menuPadding.vert; + isDropup = this.sizeInfo.selectOffsetTop - this.sizeInfo.selectOffsetBot > this.sizeInfo.menuExtras.vert && estimate + this.sizeInfo.menuExtras.vert + 50 > this.sizeInfo.selectOffsetBot; + + // ensure dropup doesn't change while searching (so menu doesn't bounce back and forth) + if (this.selectpicker.isSearching === true) { + isDropup = this.selectpicker.dropup; + } + this.$newElement.toggleClass(classNames.DROPUP, isDropup); + this.selectpicker.dropup = isDropup; } + if (this.options.size === 'auto') { + _minHeight = this.selectpicker.current.data.length > 3 ? this.sizeInfo.liHeight * 3 + this.sizeInfo.menuExtras.vert - 2 : 0; + menuHeight = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert; + minHeight = _minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight; + menuInnerMinHeight = Math.max(_minHeight - menuPadding.vert, 0); + if (this.$newElement.hasClass(classNames.DROPUP)) { + menuHeight = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert; + } + maxHeight = menuHeight; + menuInnerHeight = menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert; + } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) { + for (var i = 0; i < this.options.size; i++) { + if (this.selectpicker.current.data[i].type === 'divider') divLength++; + } + menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert; + menuInnerHeight = menuHeight - menuPadding.vert; + maxHeight = menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight; + minHeight = menuInnerMinHeight = ''; + } + this.$menu.css({ + 'max-height': maxHeight + 'px', + 'overflow': 'hidden', + 'min-height': minHeight + 'px' + }); + this.$menuInner.css({ + 'max-height': menuInnerHeight + 'px', + 'overflow': 'hidden auto', + 'min-height': menuInnerMinHeight + 'px' + }); - this.$newElement.toggleClass(classNames.DROPUP, isDropup); - this.selectpicker.dropup = isDropup; - } - - if (this.options.size === 'auto') { - _minHeight = this.selectpicker.current.data.length > 3 ? this.sizeInfo.liHeight * 3 + this.sizeInfo.menuExtras.vert - 2 : 0; - menuHeight = this.sizeInfo.selectOffsetBot - this.sizeInfo.menuExtras.vert; - minHeight = _minHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight; - menuInnerMinHeight = Math.max(_minHeight - menuPadding.vert, 0); - - if (this.$newElement.hasClass(classNames.DROPUP)) { - menuHeight = this.sizeInfo.selectOffsetTop - this.sizeInfo.menuExtras.vert; + // ensure menuInnerHeight is always a positive number to prevent issues calculating chunkSize in createView + this.sizeInfo.menuInnerHeight = Math.max(menuInnerHeight, 1); + if (this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight) { + this.sizeInfo.hasScrollBar = true; + this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth; } - - maxHeight = menuHeight; - menuInnerHeight = menuHeight - headerHeight - searchHeight - actionsHeight - doneButtonHeight - menuPadding.vert; - } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) { - for (var i = 0; i < this.options.size; i++) { - if (this.selectpicker.current.data[i].type === 'divider') divLength++; + if (this.options.dropdownAlignRight === 'auto') { + this.$menu.toggleClass(classNames.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < this.sizeInfo.totalMenuWidth - selectWidth); } - - menuHeight = liHeight * this.options.size + divLength * divHeight + menuPadding.vert; - menuInnerHeight = menuHeight - menuPadding.vert; - maxHeight = menuHeight + headerHeight + searchHeight + actionsHeight + doneButtonHeight; - minHeight = menuInnerMinHeight = ''; - } - - this.$menu.css({ - 'max-height': maxHeight + 'px', - 'overflow': 'hidden', - 'min-height': minHeight + 'px' - }); - - this.$menuInner.css({ - 'max-height': menuInnerHeight + 'px', - 'overflow': 'hidden auto', - 'min-height': menuInnerMinHeight + 'px' - }); - - // ensure menuInnerHeight is always a positive number to prevent issues calculating chunkSize in createView - this.sizeInfo.menuInnerHeight = Math.max(menuInnerHeight, 1); - - if (this.selectpicker.current.data.length && this.selectpicker.current.data[this.selectpicker.current.data.length - 1].position > this.sizeInfo.menuInnerHeight) { - this.sizeInfo.hasScrollBar = true; - this.sizeInfo.totalMenuWidth = this.sizeInfo.menuWidth + this.sizeInfo.scrollBarWidth; - } - - if (this.options.dropdownAlignRight === 'auto') { - this.$menu.toggleClass(classNames.MENURIGHT, this.sizeInfo.selectOffsetLeft > this.sizeInfo.selectOffsetRight && this.sizeInfo.selectOffsetRight < (this.sizeInfo.totalMenuWidth - selectWidth)); - } - - if (this.dropdown && this.dropdown._popper) this.dropdown._popper.update(); - }, - - setSize: function (refresh) { - this.liHeight(refresh); - - if (this.options.header) this.$menu.css('padding-top', 0); - - if (this.options.size !== false) { - var that = this, + if (this.dropdown && this.dropdown._popper) this.dropdown._popper.update(); + }, + setSize: function setSize(refresh) { + this.liHeight(refresh); + if (this.options.header) this.$menu.css('padding-top', 0); + if (this.options.size !== false) { + var that = this, $window = $(window); - - this.setMenuSize(); - - if (this.options.liveSearch) { - this.$searchbox - .off('input.setMenuSize propertychange.setMenuSize') - .on('input.setMenuSize propertychange.setMenuSize', function () { + this.setMenuSize(); + if (this.options.liveSearch) { + this.$searchbox.off('input.setMenuSize propertychange.setMenuSize').on('input.setMenuSize propertychange.setMenuSize', function () { return that.setMenuSize(); }); - } - - if (this.options.size === 'auto') { - $window - .off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize') - .on('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize', function () { + } + if (this.options.size === 'auto') { + $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize').on('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize', function () { return that.setMenuSize(); }); - } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) { - $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize'); + } else if (this.options.size && this.options.size != 'auto' && this.selectpicker.current.elements.length > this.options.size) { + $window.off('resize' + EVENT_KEY + '.' + this.selectId + '.setMenuSize' + ' scroll' + EVENT_KEY + '.' + this.selectId + '.setMenuSize'); + } } - } - - this.createView(false, true, refresh); - }, - - setWidth: function () { - var that = this; - - if (this.options.width === 'auto') { - requestAnimationFrame(function () { - that.$menu.css('min-width', '0'); - - that.$element.on('loaded' + EVENT_KEY, function () { - that.liHeight(); - that.setMenuSize(); + this.createView(false, true, refresh); + }, + setWidth: function setWidth() { + var that = this; + if (this.options.width === 'auto') { + requestAnimationFrame(function () { + that.$menu.css('min-width', '0'); + that.$element.on('loaded' + EVENT_KEY, function () { + that.liHeight(); + that.setMenuSize(); - // Get correct width if element is hidden - var $selectClone = that.$newElement.clone().appendTo('body'), + // Get correct width if element is hidden + var $selectClone = that.$newElement.clone().appendTo('body'), btnWidth = $selectClone.css('width', 'auto').children('button').outerWidth(); + $selectClone.remove(); - $selectClone.remove(); - - // Set width to whatever's larger, button title or longest option - that.sizeInfo.selectWidth = Math.max(that.sizeInfo.totalMenuWidth, btnWidth); - that.$newElement.css('width', that.sizeInfo.selectWidth + 'px'); + // Set width to whatever's larger, button title or longest option + that.sizeInfo.selectWidth = Math.max(that.sizeInfo.totalMenuWidth, btnWidth); + that.$newElement.css('width', that.sizeInfo.selectWidth + 'px'); + }); }); - }); - } else if (this.options.width === 'fit') { - // Remove inline min-width so width can be changed from 'auto' - this.$menu.css('min-width', ''); - this.$newElement.css('width', '').addClass('fit-width'); - } else if (this.options.width) { - // Remove inline min-width so width can be changed from 'auto' - this.$menu.css('min-width', ''); - this.$newElement.css('width', this.options.width); - } else { - // Remove inline min-width/width so width can be changed - this.$menu.css('min-width', ''); - this.$newElement.css('width', ''); - } - // Remove fit-width class if width is changed programmatically - if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') { - this.$newElement[0].classList.remove('fit-width'); - } - }, - - selectPosition: function () { - this.$bsContainer = $('
    '); - - var that = this, + } else if (this.options.width === 'fit') { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', '').addClass('fit-width'); + } else if (this.options.width) { + // Remove inline min-width so width can be changed from 'auto' + this.$menu.css('min-width', ''); + this.$newElement.css('width', this.options.width); + } else { + // Remove inline min-width/width so width can be changed + this.$menu.css('min-width', ''); + this.$newElement.css('width', ''); + } + // Remove fit-width class if width is changed programmatically + if (this.$newElement.hasClass('fit-width') && this.options.width !== 'fit') { + this.$newElement[0].classList.remove('fit-width'); + } + }, + selectPosition: function selectPosition() { + this.$bsContainer = $('
    '); + var that = this, $container = $(this.options.container), pos, containerPos, actualHeight, - getPlacement = function ($element) { + getPlacement = function getPlacement($element) { var containerPosition = {}, - // fall back to dropdown's default display setting if display is not manually set - display = that.options.display || ( - // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default - $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display - : false - ); - + // fall back to dropdown's default display setting if display is not manually set + display = that.options.display || ( + // Bootstrap 3 doesn't have $.fn.dropdown.Constructor.Default + $.fn.dropdown.Constructor.Default ? $.fn.dropdown.Constructor.Default.display : false); that.$bsContainer.addClass($element.attr('class').replace(/form-control|fit-width/gi, '')).toggleClass(classNames.DROPUP, $element.hasClass(classNames.DROPUP)); pos = $element.offset(); - if (!$container.is('body')) { containerPos = $container.offset(); containerPos.top += parseInt($container.css('borderTopWidth')) - $container.scrollTop(); containerPos.left += parseInt($container.css('borderLeftWidth')) - $container.scrollLeft(); } else { - containerPos = { top: 0, left: 0 }; + containerPos = { + top: 0, + left: 0 + }; } - actualHeight = $element.hasClass(classNames.DROPUP) ? 0 : $element[0].offsetHeight; // Bootstrap 4+ uses Popper for menu positioning @@ -2447,93 +2139,67 @@ containerPosition.top = pos.top - containerPos.top + actualHeight; containerPosition.left = pos.left - containerPos.left; } - containerPosition.width = $element[0].offsetWidth; - that.$bsContainer.css(containerPosition); }; - - this.$button.on('click.bs.dropdown.data-api', function () { - if (that.isDisabled()) { - return; - } - - getPlacement(that.$newElement); - - that.$bsContainer - .appendTo(that.options.container) - .toggleClass(classNames.SHOW, !that.$button.hasClass(classNames.SHOW)) - .append(that.$menu); - }); - - $(window) - .off('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId) - .on('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId, function () { + this.$button.on('click.bs.dropdown.data-api', function () { + if (that.isDisabled()) { + return; + } + getPlacement(that.$newElement); + that.$bsContainer.appendTo(that.options.container).toggleClass(classNames.SHOW, !that.$button.hasClass(classNames.SHOW)).append(that.$menu); + }); + $(window).off('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId).on('resize' + EVENT_KEY + '.' + this.selectId + ' scroll' + EVENT_KEY + '.' + this.selectId, function () { var isActive = that.$newElement.hasClass(classNames.SHOW); - if (isActive) getPlacement(that.$newElement); }); - - this.$element.on('hide' + EVENT_KEY, function () { - that.$menu.data('height', that.$menu.height()); - that.$bsContainer.detach(); - }); - }, - - createOption: function (data, init) { - var optionData = !data.option ? data : data.option; - - if (optionData && optionData.nodeType !== 1) { - var option = (init ? elementTemplates.selectedOption : elementTemplates.option).cloneNode(true); - if (optionData.value !== undefined) option.value = optionData.value; - option.textContent = optionData.text; - - option.selected = true; - - if (optionData.liIndex !== undefined) { - option.liIndex = optionData.liIndex; - } else if (!init) { - option.liIndex = data.index; + this.$element.on('hide' + EVENT_KEY, function () { + that.$menu.data('height', that.$menu.height()); + that.$bsContainer.detach(); + }); + }, + createOption: function createOption(data, init) { + var optionData = !data.option ? data : data.option; + if (optionData && optionData.nodeType !== 1) { + var option = (init ? elementTemplates.selectedOption : elementTemplates.option).cloneNode(true); + if (optionData.value !== undefined) option.value = optionData.value; + option.textContent = optionData.text; + option.selected = true; + if (optionData.liIndex !== undefined) { + option.liIndex = optionData.liIndex; + } else if (!init) { + option.liIndex = data.index; + } + data.option = option; + this.selectpicker.main.optionQueue.appendChild(option); } - - data.option = option; - - this.selectpicker.main.optionQueue.appendChild(option); - } - }, - - setOptionStatus: function (selectedOnly) { - var that = this; - - that.noScroll = false; - - if (that.selectpicker.view.visibleElements && that.selectpicker.view.visibleElements.length) { - for (var i = 0; i < that.selectpicker.view.visibleElements.length; i++) { - var liData = that.selectpicker.current.data[i + that.selectpicker.view.position0], + }, + setOptionStatus: function setOptionStatus(selectedOnly) { + var that = this; + that.noScroll = false; + if (that.selectpicker.view.visibleElements && that.selectpicker.view.visibleElements.length) { + for (var i = 0; i < that.selectpicker.view.visibleElements.length; i++) { + var liData = that.selectpicker.current.data[i + that.selectpicker.view.position0], option = liData.option; - - if (option) { - if (selectedOnly !== true) { - that.setDisabled(liData); + if (option) { + if (selectedOnly !== true) { + that.setDisabled(liData); + } + that.setSelected(liData); } - - that.setSelected(liData); } - } - // append optionQueue (documentFragment with option elements for select options) - if (this.options.source.data) this.$element[0].appendChild(this.selectpicker.main.optionQueue); - } - }, - - /** - * @param {Object} liData - the option object that is being changed - * @param {boolean} selected - true if the option is being selected, false if being deselected - */ - setSelected: function (liData, selected) { - selected = selected === undefined ? liData.selected : selected; - - var li = liData.element, + // append optionQueue (documentFragment with option elements for select options) + if (this.options.source.data) this.$element[0].appendChild(this.selectpicker.main.optionQueue); + } + }, + /** + * @param {Object} liData - the option object that is being changed + * @param {boolean} selected - true if the option is being selected, false if being deselected + */ + setSelected: function setSelected(liData, selected) { + selected = selected === undefined ? liData.selected : selected; + var li = liData.element, activeElementIsSet = this.activeElement !== undefined, thisIsActive = this.activeElement === li, prevActive, @@ -2545,211 +2211,174 @@ // - when the menu is first being opened, OR // - after a search has been performed, OR // - when retainActive is false when selecting a new option (i.e. index of the newly selected option is not the same as the current activeElement) - keepActive = thisIsActive || (selected && !this.multiple && !activeElementIsSet); - - if (!li) return; - - if (selected !== undefined) { - liData.selected = selected; - if (liData.option) liData.option.selected = selected; - } - - if (selected && this.options.source.data) { - this.createOption(liData, false); - } - - a = li.firstChild; - - if (selected) { - this.selectedElement = li; - } - - li.classList.toggle('selected', selected); - - if (keepActive) { - this.focusItem(li, liData); - this.selectpicker.view.currentActive = li; - this.activeElement = li; - } else { - this.defocusItem(li); - } - - if (a) { - a.classList.toggle('selected', selected); - + keepActive = thisIsActive || selected && !this.multiple && !activeElementIsSet; + if (!li) return; + if (selected !== undefined) { + liData.selected = selected; + if (liData.option) liData.option.selected = selected; + } + if (selected && this.options.source.data) { + this.createOption(liData, false); + } + a = li.firstChild; if (selected) { - a.setAttribute('aria-selected', true); + this.selectedElement = li; + } + li.classList.toggle('selected', selected); + if (keepActive) { + this.focusItem(li, liData); + this.selectpicker.view.currentActive = li; + this.activeElement = li; } else { - if (this.multiple) { - a.setAttribute('aria-selected', false); + this.defocusItem(li); + } + if (a) { + a.classList.toggle('selected', selected); + if (selected) { + a.setAttribute('aria-selected', true); } else { - a.removeAttribute('aria-selected'); + if (this.multiple) { + a.setAttribute('aria-selected', false); + } else { + a.removeAttribute('aria-selected'); + } } } - } - - if (!keepActive && !activeElementIsSet && selected && this.prevActiveElement !== undefined) { - prevActive = this.prevActiveElement; - - this.defocusItem(prevActive); - } - }, - - /** - * @param {number} index - the index of the option that is being disabled - * @param {boolean} disabled - true if the option is being disabled, false if being enabled - */ - setDisabled: function (liData) { - var disabled = liData.disabled, + if (!keepActive && !activeElementIsSet && selected && this.prevActiveElement !== undefined) { + prevActive = this.prevActiveElement; + this.defocusItem(prevActive); + } + }, + /** + * @param {number} index - the index of the option that is being disabled + * @param {boolean} disabled - true if the option is being disabled, false if being enabled + */ + setDisabled: function setDisabled(liData) { + var disabled = liData.disabled, li = liData.element, a; - - if (!li) return; - - a = li.firstChild; - - li.classList.toggle(classNames.DISABLED, disabled); - - if (a) { - if (version.major >= '4') a.classList.toggle(classNames.DISABLED, disabled); - - if (disabled) { - a.setAttribute('aria-disabled', disabled); - a.setAttribute('tabindex', -1); - } else { - a.removeAttribute('aria-disabled'); - a.setAttribute('tabindex', 0); + if (!li) return; + a = li.firstChild; + li.classList.toggle(classNames.DISABLED, disabled); + if (a) { + if (version.major >= '4') a.classList.toggle(classNames.DISABLED, disabled); + if (disabled) { + a.setAttribute('aria-disabled', disabled); + a.setAttribute('tabindex', -1); + } else { + a.removeAttribute('aria-disabled'); + a.setAttribute('tabindex', 0); + } } - } - }, - - isDisabled: function () { - return this.$element[0].disabled; - }, - - checkDisabled: function () { - if (this.isDisabled()) { - this.$newElement[0].classList.add(classNames.DISABLED); - this.$button.addClass(classNames.DISABLED).attr('aria-disabled', true); - } else { - if (this.$button[0].classList.contains(classNames.DISABLED)) { - this.$newElement[0].classList.remove(classNames.DISABLED); - this.$button.removeClass(classNames.DISABLED).attr('aria-disabled', false); + }, + isDisabled: function isDisabled() { + return this.$element[0].disabled; + }, + checkDisabled: function checkDisabled() { + if (this.isDisabled()) { + this.$newElement[0].classList.add(classNames.DISABLED); + this.$button.addClass(classNames.DISABLED).attr('aria-disabled', true); + } else { + if (this.$button[0].classList.contains(classNames.DISABLED)) { + this.$newElement[0].classList.remove(classNames.DISABLED); + this.$button.removeClass(classNames.DISABLED).attr('aria-disabled', false); + } } - } - }, - - clickListener: function () { - var that = this, + }, + clickListener: function clickListener() { + var that = this, $document = $(document); - - $document.data('spaceSelect', false); - - this.$button.on('keyup', function (e) { - if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) { - e.preventDefault(); - $document.data('spaceSelect', false); - } - }); - - this.$newElement.on('show.bs.dropdown', function () { - if (!that.dropdown && version.major === '4') { - that.dropdown = that.$button.data('bs.dropdown'); - that.dropdown._menu = that.$menu[0]; - } - }); - - function clearSelection (e) { - if (that.multiple) { - that.deselectAll(); - } else { - var element = that.$element[0], + $document.data('spaceSelect', false); + this.$button.on('keyup', function (e) { + if (/(32)/.test(e.keyCode.toString(10)) && $document.data('spaceSelect')) { + e.preventDefault(); + $document.data('spaceSelect', false); + } + }); + this.$newElement.on('show.bs.dropdown', function () { + if (!that.dropdown && version.major === '4') { + that.dropdown = that.$button.data('bs.dropdown'); + that.dropdown._menu = that.$menu[0]; + } + }); + function clearSelection(e) { + if (that.multiple) { + that.deselectAll(); + } else { + var element = that.$element[0], prevValue = element.value, prevIndex = element.selectedIndex, prevOption = element.options[prevIndex], prevData = prevOption ? that.selectpicker.main.data[prevOption.liIndex] : false; - - if (prevData) { - that.setSelected(prevData, false); + if (prevData) { + that.setSelected(prevData, false); + } + element.selectedIndex = 0; + changedArguments = [prevIndex, false, prevValue]; + that.$element.triggerNative('change'); } - element.selectedIndex = 0; - - changedArguments = [prevIndex, false, prevValue]; - that.$element.triggerNative('change'); - } - - // remove selected styling if menu is open - if (that.$newElement.hasClass(classNames.SHOW)) { - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); + // remove selected styling if menu is open + if (that.$newElement.hasClass(classNames.SHOW)) { + if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); + } + that.createView(false); } - - that.createView(false); } - } - - this.$button.on('click.bs.dropdown.data-api', function (e) { - if (that.options.allowClear) { - var target = e.target, + this.$button.on('click.bs.dropdown.data-api', function (e) { + if (that.options.allowClear) { + var target = e.target, clearButton = that.$clearButton[0]; - // IE doesn't support event listeners on child elements of buttons - if (/MSIE|Trident/.test(window.navigator.userAgent)) { - target = document.elementFromPoint(e.clientX, e.clientY); + // IE doesn't support event listeners on child elements of buttons + if (/MSIE|Trident/.test(window.navigator.userAgent)) { + target = document.elementFromPoint(e.clientX, e.clientY); + } + if (target === clearButton || target.parentElement === clearButton) { + e.stopImmediatePropagation(); + clearSelection(e); + } } - - if (target === clearButton || target.parentElement === clearButton) { - e.stopImmediatePropagation(); - clearSelection(e); + if (!that.$newElement.hasClass(classNames.SHOW)) { + that.setSize(); + } + }); + function setFocus() { + if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); + } else { + that.$menuInner.trigger('focus'); } } - - if (!that.$newElement.hasClass(classNames.SHOW)) { - that.setSize(); - } - }); - - function setFocus () { - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); - } else { - that.$menuInner.trigger('focus'); - } - } - - function checkPopperExists () { - if (that.dropdown && that.dropdown._popper && that.dropdown._popper.state) { - setFocus(); - } else { - requestAnimationFrame(checkPopperExists); - } - } - - this.$element.on('shown' + EVENT_KEY, function () { - if (that.$menuInner[0].scrollTop !== that.selectpicker.view.scrollTop) { - that.$menuInner[0].scrollTop = that.selectpicker.view.scrollTop; - } - - if (version.major > 3) { - requestAnimationFrame(checkPopperExists); - } else { - setFocus(); + function checkPopperExists() { + if (that.dropdown && that.dropdown._popper && that.dropdown._popper.state) { + setFocus(); + } else { + requestAnimationFrame(checkPopperExists); + } } - }); + this.$element.on('shown' + EVENT_KEY, function () { + if (that.$menuInner[0].scrollTop !== that.selectpicker.view.scrollTop) { + that.$menuInner[0].scrollTop = that.selectpicker.view.scrollTop; + } + if (version.major > 3) { + requestAnimationFrame(checkPopperExists); + } else { + setFocus(); + } + }); - // ensure posinset and setsize are correct before selecting an option via a click - this.$menuInner.on('mouseenter', 'li a', function (e) { - var hoverLi = this.parentElement, + // ensure posinset and setsize are correct before selecting an option via a click + this.$menuInner.on('mouseenter', 'li a', function (e) { + var hoverLi = this.parentElement, position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0, index = Array.prototype.indexOf.call(hoverLi.parentElement.children, hoverLi), hoverData = that.selectpicker.current.data[index + position0]; - - that.focusItem(hoverLi, hoverData, true); - }); - - this.$menuInner.on('click', 'li a', function (e, retainActive) { - var $this = $(this), + that.focusItem(hoverLi, hoverData, true); + }); + this.$menuInner.on('click', 'li a', function (e, retainActive) { + var $this = $(this), element = that.$element[0], position0 = that.isVirtual() ? that.selectpicker.view.position0 : 0, clickedData = that.selectpicker.current.data[$this.parent().index() + position0], @@ -2760,16 +2389,15 @@ prevData = prevOption ? that.selectpicker.main.data[prevOption.liIndex] : false, triggerChange = true; - // Don't close on multi choice menu - if (that.multiple && that.options.maxOptions !== 1) { - e.stopPropagation(); - } - - e.preventDefault(); + // Don't close on multi choice menu + if (that.multiple && that.options.maxOptions !== 1) { + e.stopPropagation(); + } + e.preventDefault(); - // Don't run if the select is disabled - if (!that.isDisabled() && !$this.parent().hasClass(classNames.DISABLED)) { - var option = clickedData.option, + // Don't run if the select is disabled + if (!that.isDisabled() && !$this.parent().hasClass(classNames.DISABLED)) { + var option = clickedData.option, $option = $(option), state = option.selected, optgroupData = that.selectpicker.current.data.find(function (datum) { @@ -2780,155 +2408,131 @@ optgroupOptions = optgroup && optgroup.children, maxOptions = parseInt(that.options.maxOptions), maxOptionsGrp = optgroup && parseInt(dataGetter(optgroup, 'maxOptions')) || false; - - if (clickedElement === that.activeElement) retainActive = true; - - if (!retainActive) { - that.prevActiveElement = that.activeElement; - that.activeElement = undefined; - } - - if (!that.multiple || maxOptions === 1) { // Deselect previous option if not multi select - if (prevData) that.setSelected(prevData, false); - that.setSelected(clickedData, true); - } else { // Toggle the clicked option if multi select. - that.setSelected(clickedData, !state); - that.focusedParent.focus(); - - if (maxOptions !== false || maxOptionsGrp !== false) { - var maxReached = maxOptions < getSelectedOptions.call(that).length, + if (clickedElement === that.activeElement) retainActive = true; + if (!retainActive) { + that.prevActiveElement = that.activeElement; + that.activeElement = undefined; + } + if (!that.multiple || maxOptions === 1) { + // Deselect previous option if not multi select + if (prevData) that.setSelected(prevData, false); + that.setSelected(clickedData, true); + } else { + // Toggle the clicked option if multi select. + that.setSelected(clickedData, !state); + that.focusedParent.focus(); + if (maxOptions !== false || maxOptionsGrp !== false) { + var maxReached = maxOptions < getSelectedOptions.call(that).length, selectedGroupOptions = 0; - - if (optgroup && optgroup.children) { - for (var i = 0; i < optgroup.children.length; i++) { - if (optgroup.children[i].selected) selectedGroupOptions++; - } - } - - var maxReachedGrp = maxOptionsGrp < selectedGroupOptions; - - if ((maxOptions && maxReached) || (maxOptionsGrp && maxReachedGrp)) { - if (maxOptions && maxOptions === 1) { - element.selectedIndex = -1; - that.setOptionStatus(true); - } else if (maxOptionsGrp && maxOptionsGrp === 1) { - for (var i = 0; i < optgroupOptions.length; i++) { - var _option = optgroupOptions[i]; - that.setSelected(that.selectpicker.current.data[_option.liIndex], false); + if (optgroup && optgroup.children) { + for (var i = 0; i < optgroup.children.length; i++) { + if (optgroup.children[i].selected) selectedGroupOptions++; } - - that.setSelected(clickedData, true); - } else { - var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText, + } + var maxReachedGrp = maxOptionsGrp < selectedGroupOptions; + if (maxOptions && maxReached || maxOptionsGrp && maxReachedGrp) { + if (maxOptions && maxOptions === 1) { + element.selectedIndex = -1; + that.setOptionStatus(true); + } else if (maxOptionsGrp && maxOptionsGrp === 1) { + for (var i = 0; i < optgroupOptions.length; i++) { + var _option = optgroupOptions[i]; + that.setSelected(that.selectpicker.current.data[_option.liIndex], false); + } + that.setSelected(clickedData, true); + } else { + var maxOptionsText = typeof that.options.maxOptionsText === 'string' ? [that.options.maxOptionsText, that.options.maxOptionsText] : that.options.maxOptionsText, maxOptionsArr = typeof maxOptionsText === 'function' ? maxOptionsText(maxOptions, maxOptionsGrp) : maxOptionsText, maxTxt = maxOptionsArr[0].replace('{n}', maxOptions), maxTxtGrp = maxOptionsArr[1].replace('{n}', maxOptionsGrp), $notify = $('
    '); - // If {var} is set in array, replace it - /** @deprecated */ - if (maxOptionsArr[2]) { - maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]); - maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]); - } - - that.$menu.append($notify); - - if (maxOptions && maxReached) { - $notify.append($('
    ' + maxTxt + '
    ')); - triggerChange = false; - that.$element.trigger('maxReached' + EVENT_KEY); - } - - if (maxOptionsGrp && maxReachedGrp) { - $notify.append($('
    ' + maxTxtGrp + '
    ')); - triggerChange = false; - that.$element.trigger('maxReachedGrp' + EVENT_KEY); + // If {var} is set in array, replace it + /** @deprecated */ + if (maxOptionsArr[2]) { + maxTxt = maxTxt.replace('{var}', maxOptionsArr[2][maxOptions > 1 ? 0 : 1]); + maxTxtGrp = maxTxtGrp.replace('{var}', maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1]); + } + that.$menu.append($notify); + if (maxOptions && maxReached) { + $notify.append($('
    ' + maxTxt + '
    ')); + triggerChange = false; + that.$element.trigger('maxReached' + EVENT_KEY); + } + if (maxOptionsGrp && maxReachedGrp) { + $notify.append($('
    ' + maxTxtGrp + '
    ')); + triggerChange = false; + that.$element.trigger('maxReachedGrp' + EVENT_KEY); + } + setTimeout(function () { + that.setSelected(clickedData, false); + }, 10); + $notify[0].classList.add('fadeOut'); + setTimeout(function () { + $notify.remove(); + }, 1050); } - - setTimeout(function () { - that.setSelected(clickedData, false); - }, 10); - - $notify[0].classList.add('fadeOut'); - - setTimeout(function () { - $notify.remove(); - }, 1050); } } } - } - - if (that.options.source.data) that.$element[0].appendChild(that.selectpicker.main.optionQueue); + if (that.options.source.data) that.$element[0].appendChild(that.selectpicker.main.optionQueue); + if (!that.multiple || that.multiple && that.options.maxOptions === 1) { + that.$button.trigger('focus'); + } else if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); + } - if (!that.multiple || (that.multiple && that.options.maxOptions === 1)) { - that.$button.trigger('focus'); - } else if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); + // Trigger select 'change' + if (triggerChange) { + if (that.multiple || prevIndex !== element.selectedIndex) { + // $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed. + changedArguments = [option.index, $option.prop('selected'), prevValue]; + that.$element.triggerNative('change'); + } + } } - - // Trigger select 'change' - if (triggerChange) { - if (that.multiple || prevIndex !== element.selectedIndex) { - // $option.prop('selected') is current option state (selected/unselected). prevValue is the value of the select prior to being changed. - changedArguments = [option.index, $option.prop('selected'), prevValue]; - that.$element - .triggerNative('change'); + }); + this.$menu.on('click', 'li.' + classNames.DISABLED + ' a, .' + classNames.POPOVERHEADER + ', .' + classNames.POPOVERHEADER + ' :not(.close)', function (e) { + if (e.currentTarget == this) { + e.preventDefault(); + e.stopPropagation(); + if (that.options.liveSearch && !$(e.target).hasClass('close')) { + that.$searchbox.trigger('focus'); + } else { + that.$button.trigger('focus'); } } - } - }); - - this.$menu.on('click', 'li.' + classNames.DISABLED + ' a, .' + classNames.POPOVERHEADER + ', .' + classNames.POPOVERHEADER + ' :not(.close)', function (e) { - if (e.currentTarget == this) { + }); + this.$menuInner.on('click', '.divider, .dropdown-header', function (e) { e.preventDefault(); e.stopPropagation(); - if (that.options.liveSearch && !$(e.target).hasClass('close')) { + if (that.options.liveSearch) { that.$searchbox.trigger('focus'); } else { that.$button.trigger('focus'); } - } - }); - - this.$menuInner.on('click', '.divider, .dropdown-header', function (e) { - e.preventDefault(); - e.stopPropagation(); - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); - } else { - that.$button.trigger('focus'); - } - }); - - this.$menu.on('click', '.' + classNames.POPOVERHEADER + ' .close', function () { - that.$button.trigger('click'); - }); - - this.$searchbox.on('click', function (e) { - e.stopPropagation(); - }); - - this.$menu.on('click', '.actions-btn', function (e) { - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); - } else { - that.$button.trigger('focus'); - } - - e.preventDefault(); - e.stopPropagation(); - - if ($(this).hasClass('bs-select-all')) { - that.selectAll(); - } else { - that.deselectAll(); - } - }); - - this.$button - .on('focus' + EVENT_KEY, function (e) { - var tabindex = that.$element[0].getAttribute('tabindex'); + }); + this.$menu.on('click', '.' + classNames.POPOVERHEADER + ' .close', function () { + that.$button.trigger('click'); + }); + this.$searchbox.on('click', function (e) { + e.stopPropagation(); + }); + this.$menu.on('click', '.actions-btn', function (e) { + if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); + } else { + that.$button.trigger('focus'); + } + e.preventDefault(); + e.stopPropagation(); + if ($(this).hasClass('bs-select-all')) { + that.selectAll(); + } else { + that.deselectAll(); + } + }); + this.$button.on('focus' + EVENT_KEY, function (e) { + var tabindex = that.$element[0].getAttribute('tabindex'); // only change when button is actually focused if (tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) { @@ -2938,8 +2542,7 @@ that.$element[0].setAttribute('tabindex', -1); that.selectpicker.view.tabindex = tabindex; } - }) - .on('blur' + EVENT_KEY, function (e) { + }).on('blur' + EVENT_KEY, function (e) { // revert everything to original tabindex if (that.selectpicker.view.tabindex !== undefined && e.originalEvent && e.originalEvent.isTrusted) { that.$element[0].setAttribute('tabindex', that.selectpicker.view.tabindex); @@ -2947,239 +2550,183 @@ that.selectpicker.view.tabindex = undefined; } }); - - this.$element - .on('change' + EVENT_KEY, function () { + this.$element.on('change' + EVENT_KEY, function () { that.render(); that.$element.trigger('changed' + EVENT_KEY, changedArguments); changedArguments = null; - }) - .on('focus' + EVENT_KEY, function () { + }).on('focus' + EVENT_KEY, function () { if (!that.options.mobile) that.$button[0].focus(); }); - }, - - liveSearchListener: function () { - var that = this; - - this.$button.on('click.bs.dropdown.data-api', function () { - if (!!that.$searchbox.val()) { - that.$searchbox.val(''); - that.selectpicker.search.previousValue = undefined; - } - }); - - this.$searchbox.on('click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api', function (e) { - e.stopPropagation(); - }); - - this.$searchbox.on('input propertychange', function () { - var searchValue = that.$searchbox[0].value; - - that.selectpicker.search.elements = []; - that.selectpicker.search.data = []; - - if (searchValue) { - that.selectpicker.search.previousValue = searchValue; - - if (that.options.source.search) { - that.fetchData(function (builtData) { - that.render(); - that.buildList(undefined, true); - that.noScroll = true; - that.$menuInner.scrollTop(0); - that.createView(true); - showNoResults.call(that, builtData, searchValue); - }, 'search', 0, searchValue); - } else { - var i, + }, + liveSearchListener: function liveSearchListener() { + var that = this; + this.$button.on('click.bs.dropdown.data-api', function () { + if (!!that.$searchbox.val()) { + that.$searchbox.val(''); + that.selectpicker.search.previousValue = undefined; + } + }); + this.$searchbox.on('click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api', function (e) { + e.stopPropagation(); + }); + this.$searchbox.on('input propertychange', function () { + var searchValue = that.$searchbox[0].value; + that.selectpicker.search.elements = []; + that.selectpicker.search.data = []; + if (searchValue) { + that.selectpicker.search.previousValue = searchValue; + if (that.options.source.search) { + that.fetchData(function (builtData) { + that.render(); + that.buildList(undefined, true); + that.noScroll = true; + that.$menuInner.scrollTop(0); + that.createView(true); + showNoResults.call(that, builtData, searchValue); + }, 'search', 0, searchValue); + } else { + var i, searchMatch = [], q = searchValue.toUpperCase(), cache = {}, cacheArr = [], searchStyle = that._searchStyle(), normalizeSearch = that.options.liveSearchNormalize; - - if (normalizeSearch) q = normalizeToBase(q); - - for (var i = 0; i < that.selectpicker.main.data.length; i++) { - var li = that.selectpicker.main.data[i]; - - if (!cache[i]) { - cache[i] = stringSearch(li, q, searchStyle, normalizeSearch); - } - - if (cache[i] && li.headerIndex !== undefined && cacheArr.indexOf(li.headerIndex) === -1) { - if (li.headerIndex > 0) { - cache[li.headerIndex - 1] = true; - cacheArr.push(li.headerIndex - 1); + if (normalizeSearch) q = normalizeToBase(q); + for (var i = 0; i < that.selectpicker.main.data.length; i++) { + var li = that.selectpicker.main.data[i]; + if (!cache[i]) { + cache[i] = stringSearch(li, q, searchStyle, normalizeSearch); } - - cache[li.headerIndex] = true; - cacheArr.push(li.headerIndex); - - cache[li.lastIndex + 1] = true; + if (cache[i] && li.headerIndex !== undefined && cacheArr.indexOf(li.headerIndex) === -1) { + if (li.headerIndex > 0) { + cache[li.headerIndex - 1] = true; + cacheArr.push(li.headerIndex - 1); + } + cache[li.headerIndex] = true; + cacheArr.push(li.headerIndex); + cache[li.lastIndex + 1] = true; + } + if (cache[i] && li.type !== 'optgroup-label') cacheArr.push(i); } - - if (cache[i] && li.type !== 'optgroup-label') cacheArr.push(i); - } - - for (var i = 0, cacheLen = cacheArr.length; i < cacheLen; i++) { - var index = cacheArr[i], + for (var i = 0, cacheLen = cacheArr.length; i < cacheLen; i++) { + var index = cacheArr[i], prevIndex = cacheArr[i - 1], li = that.selectpicker.main.data[index], liPrev = that.selectpicker.main.data[prevIndex]; - - if (li.type !== 'divider' || (li.type === 'divider' && liPrev && liPrev.type !== 'divider' && cacheLen - 1 !== i)) { - that.selectpicker.search.data.push(li); - searchMatch.push(that.selectpicker.main.elements[index]); + if (li.type !== 'divider' || li.type === 'divider' && liPrev && liPrev.type !== 'divider' && cacheLen - 1 !== i) { + that.selectpicker.search.data.push(li); + searchMatch.push(that.selectpicker.main.elements[index]); + } } + that.activeElement = undefined; + that.noScroll = true; + that.$menuInner.scrollTop(0); + that.selectpicker.search.elements = searchMatch; + that.createView(true); + showNoResults.call(that, searchMatch, searchValue); } - - that.activeElement = undefined; - that.noScroll = true; + } else if (that.selectpicker.search.previousValue) { + // for IE11 (#2402) that.$menuInner.scrollTop(0); - that.selectpicker.search.elements = searchMatch; - that.createView(true); - showNoResults.call(that, searchMatch, searchValue); + that.createView(false); } - } else if (that.selectpicker.search.previousValue) { // for IE11 (#2402) - that.$menuInner.scrollTop(0); - that.createView(false); - } - }); - }, - - _searchStyle: function () { - return this.options.liveSearchStyle || 'contains'; - }, - - val: function (value) { - var element = this.$element[0]; - - if (typeof value !== 'undefined') { - var selectedOptions = getSelectedOptions.call(this), + }); + }, + _searchStyle: function _searchStyle() { + return this.options.liveSearchStyle || 'contains'; + }, + val: function val(value) { + var element = this.$element[0]; + if (typeof value !== 'undefined') { + var selectedOptions = getSelectedOptions.call(this), prevValue = getSelectValues.call(this, selectedOptions); - - changedArguments = [null, null, prevValue]; - - if (!Array.isArray(value)) value = [ value ]; - - value.map(String); - - for (var i = 0; i < selectedOptions.length; i++) { - var item = selectedOptions[i]; - - if (item && value.indexOf(String(item.value)) === -1) { - this.setSelected(item, false); - } - } - - // only update selected value if it matches an existing option - this.selectpicker.main.data.filter(function (item) { - if (value.indexOf(String(item.value)) !== -1) { - this.setSelected(item, true); - return true; + changedArguments = [null, null, prevValue]; + if (!Array.isArray(value)) value = [value]; + value.map(String); + for (var i = 0; i < selectedOptions.length; i++) { + var item = selectedOptions[i]; + if (item && value.indexOf(String(item.value)) === -1) { + this.setSelected(item, false); + } } - return false; - }, this); - - if (this.options.source.data) element.appendChild(this.selectpicker.main.optionQueue); - - this.$element.trigger('changed' + EVENT_KEY, changedArguments); - - if (this.$newElement.hasClass(classNames.SHOW)) { - if (this.multiple) { - this.setOptionStatus(true); - } else { - var liSelectedIndex = (element.options[element.selectedIndex] || {}).liIndex; - - if (typeof liSelectedIndex === 'number') { - this.setSelected(this.selectpicker.current.data[liSelectedIndex], true); + // only update selected value if it matches an existing option + this.selectpicker.main.data.filter(function (item) { + if (value.indexOf(String(item.value)) !== -1) { + this.setSelected(item, true); + return true; + } + return false; + }, this); + if (this.options.source.data) element.appendChild(this.selectpicker.main.optionQueue); + this.$element.trigger('changed' + EVENT_KEY, changedArguments); + if (this.$newElement.hasClass(classNames.SHOW)) { + if (this.multiple) { + this.setOptionStatus(true); + } else { + var liSelectedIndex = (element.options[element.selectedIndex] || {}).liIndex; + if (typeof liSelectedIndex === 'number') { + this.setSelected(this.selectpicker.current.data[liSelectedIndex], true); + } } } + this.render(); + changedArguments = null; + return this.$element; + } else { + return this.$element.val(); } - - this.render(); - - changedArguments = null; - - return this.$element; - } else { - return this.$element.val(); - } - }, - - changeAll: function (status) { - if (!this.multiple) return; - if (typeof status === 'undefined') status = true; - - var element = this.$element[0], + }, + changeAll: function changeAll(status) { + if (!this.multiple) return; + if (typeof status === 'undefined') status = true; + var element = this.$element[0], previousSelected = 0, currentSelected = 0, prevValue = getSelectValues.call(this); - - element.classList.add('bs-select-hidden'); - - for (var i = 0, data = this.selectpicker.current.data, len = data.length; i < len; i++) { - var liData = data[i], + element.classList.add('bs-select-hidden'); + for (var i = 0, data = this.selectpicker.current.data, len = data.length; i < len; i++) { + var liData = data[i], option = liData.option; - - if (option && !liData.disabled && liData.type !== 'divider') { - if (liData.selected) previousSelected++; - option.selected = status; - liData.selected = status; - if (status === true) currentSelected++; + if (option && !liData.disabled && liData.type !== 'divider') { + if (liData.selected) previousSelected++; + option.selected = status; + liData.selected = status; + if (status === true) currentSelected++; + } } - } - - element.classList.remove('bs-select-hidden'); - - if (previousSelected === currentSelected) return; - - this.setOptionStatus(); - - changedArguments = [null, null, prevValue]; - - this.$element - .triggerNative('change'); - }, - - selectAll: function () { - return this.changeAll(true); - }, - - deselectAll: function () { - return this.changeAll(false); - }, - - toggle: function (e, state) { - var isActive, + element.classList.remove('bs-select-hidden'); + if (previousSelected === currentSelected) return; + this.setOptionStatus(); + changedArguments = [null, null, prevValue]; + this.$element.triggerNative('change'); + }, + selectAll: function selectAll() { + return this.changeAll(true); + }, + deselectAll: function deselectAll() { + return this.changeAll(false); + }, + toggle: function toggle(e, state) { + var isActive, triggerClick = state === undefined; - - e = e || window.event; - - if (e) e.stopPropagation(); - - if (triggerClick === false) { - isActive = this.$newElement[0].classList.contains(classNames.SHOW); - triggerClick = state === true && isActive === false || state === false && isActive === true; - } - - if (triggerClick) this.$button.trigger('click.bs.dropdown.data-api'); - }, - - open: function (e) { - this.toggle(e, true); - }, - - close: function (e) { - this.toggle(e, false); - }, - - keydown: function (e) { - var $this = $(this), + e = e || window.event; + if (e) e.stopPropagation(); + if (triggerClick === false) { + isActive = this.$newElement[0].classList.contains(classNames.SHOW); + triggerClick = state === true && isActive === false || state === false && isActive === true; + } + if (triggerClick) this.$button.trigger('click.bs.dropdown.data-api'); + }, + open: function open(e) { + this.toggle(e, true); + }, + close: function close(e) { + this.toggle(e, false); + }, + keydown: function keydown(e) { + var $this = $(this), isToggle = $this.hasClass('dropdown-toggle'), $parent = isToggle ? $this.closest('.dropdown') : $this.closest(Selector.MENU), that = $parent.data('this'), @@ -3196,436 +2743,343 @@ isVirtual = that.isVirtual(), position0 = isVirtual === true ? that.selectpicker.view.position0 : 0; - // do nothing if a function key is pressed - if (e.which >= 112 && e.which <= 123) return; - - isActive = that.$menu.hasClass(classNames.SHOW); - - if ( - !isActive && - ( - isArrowKey || - (e.which >= 48 && e.which <= 57) || - (e.which >= 96 && e.which <= 105) || - (e.which >= 65 && e.which <= 90) - ) - ) { - that.$button.trigger('click.bs.dropdown.data-api'); - - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); - return; - } - } - - if (e.which === keyCodes.ESCAPE && isActive) { - e.preventDefault(); - that.$button.trigger('click.bs.dropdown.data-api').trigger('focus'); - } - - if (isArrowKey) { // if up or down - if (!$items.length) return; - - liActive = that.activeElement; - index = liActive ? Array.prototype.indexOf.call(liActive.parentElement.children, liActive) : -1; - - if (index !== -1) { - that.defocusItem(liActive); + // do nothing if a function key is pressed + if (e.which >= 112 && e.which <= 123) return; + isActive = that.$menu.hasClass(classNames.SHOW); + if (!isActive && (isArrowKey || e.which >= 48 && e.which <= 57 || e.which >= 96 && e.which <= 105 || e.which >= 65 && e.which <= 90)) { + that.$button.trigger('click.bs.dropdown.data-api'); + if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); + return; + } } - - if (e.which === keyCodes.ARROW_UP) { // up - if (index !== -1) index--; - if (index + position0 < 0) index += $items.length; - - if (!that.selectpicker.view.canHighlight[index + position0]) { - index = that.selectpicker.view.canHighlight.slice(0, index + position0).lastIndexOf(true) - position0; - if (index === -1) index = $items.length - 1; + if (e.which === keyCodes.ESCAPE && isActive) { + e.preventDefault(); + that.$button.trigger('click.bs.dropdown.data-api').trigger('focus'); + } + if (isArrowKey) { + // if up or down + if (!$items.length) return; + liActive = that.activeElement; + index = liActive ? Array.prototype.indexOf.call(liActive.parentElement.children, liActive) : -1; + if (index !== -1) { + that.defocusItem(liActive); } - } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down - index++; - if (index + position0 >= that.selectpicker.view.canHighlight.length) index = that.selectpicker.view.firstHighlightIndex; - - if (!that.selectpicker.view.canHighlight[index + position0]) { - index = index + 1 + that.selectpicker.view.canHighlight.slice(index + position0 + 1).indexOf(true); + if (e.which === keyCodes.ARROW_UP) { + // up + if (index !== -1) index--; + if (index + position0 < 0) index += $items.length; + if (!that.selectpicker.view.canHighlight[index + position0]) { + index = that.selectpicker.view.canHighlight.slice(0, index + position0).lastIndexOf(true) - position0; + if (index === -1) index = $items.length - 1; + } + } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { + // down + index++; + if (index + position0 >= that.selectpicker.view.canHighlight.length) index = that.selectpicker.view.firstHighlightIndex; + if (!that.selectpicker.view.canHighlight[index + position0]) { + index = index + 1 + that.selectpicker.view.canHighlight.slice(index + position0 + 1).indexOf(true); + } } - } - - e.preventDefault(); - - var liActiveIndex = position0 + index; - - if (e.which === keyCodes.ARROW_UP) { // up - // scroll to bottom and highlight last option - if (position0 === 0 && index === $items.length - 1) { - that.$menuInner[0].scrollTop = that.$menuInner[0].scrollHeight; - - liActiveIndex = that.selectpicker.current.elements.length - 1; - } else { - activeLi = that.selectpicker.current.data[liActiveIndex]; + e.preventDefault(); + var liActiveIndex = position0 + index; + if (e.which === keyCodes.ARROW_UP) { + // up + // scroll to bottom and highlight last option + if (position0 === 0 && index === $items.length - 1) { + that.$menuInner[0].scrollTop = that.$menuInner[0].scrollHeight; + liActiveIndex = that.selectpicker.current.elements.length - 1; + } else { + activeLi = that.selectpicker.current.data[liActiveIndex]; - // could be undefined if no results exist - if (activeLi) { - offset = activeLi.position - activeLi.height; + // could be undefined if no results exist + if (activeLi) { + offset = activeLi.position - activeLi.height; + updateScroll = offset < scrollTop; + } + } + } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { + // down + // scroll to top and highlight first option + if (index === that.selectpicker.view.firstHighlightIndex) { + that.$menuInner[0].scrollTop = 0; + liActiveIndex = that.selectpicker.view.firstHighlightIndex; + } else { + activeLi = that.selectpicker.current.data[liActiveIndex]; - updateScroll = offset < scrollTop; + // could be undefined if no results exist + if (activeLi) { + offset = activeLi.position - that.sizeInfo.menuInnerHeight; + updateScroll = offset > scrollTop; + } } } - } else if (e.which === keyCodes.ARROW_DOWN || downOnTab) { // down - // scroll to top and highlight first option - if (index === that.selectpicker.view.firstHighlightIndex) { - that.$menuInner[0].scrollTop = 0; - - liActiveIndex = that.selectpicker.view.firstHighlightIndex; + liActive = that.selectpicker.current.elements[liActiveIndex]; + that.activeElement = (that.selectpicker.current.data[liActiveIndex] || {}).element; + that.focusItem(liActive); + that.selectpicker.view.currentActive = liActive; + if (updateScroll) that.$menuInner[0].scrollTop = offset; + if (that.options.liveSearch) { + that.$searchbox.trigger('focus'); } else { - activeLi = that.selectpicker.current.data[liActiveIndex]; - - // could be undefined if no results exist - if (activeLi) { - offset = activeLi.position - that.sizeInfo.menuInnerHeight; - - updateScroll = offset > scrollTop; - } + $this.trigger('focus'); } - } - - liActive = that.selectpicker.current.elements[liActiveIndex]; - - that.activeElement = (that.selectpicker.current.data[liActiveIndex] || {}).element; - - that.focusItem(liActive); - - that.selectpicker.view.currentActive = liActive; - - if (updateScroll) that.$menuInner[0].scrollTop = offset; - - if (that.options.liveSearch) { - that.$searchbox.trigger('focus'); - } else { - $this.trigger('focus'); - } - } else if ( - (!$this.is('input') && !REGEXP_TAB_OR_ESCAPE.test(e.which)) || - (e.which === keyCodes.SPACE && that.selectpicker.keydown.keyHistory) - ) { - var searchMatch, + } else if (!$this.is('input') && !REGEXP_TAB_OR_ESCAPE.test(e.which) || e.which === keyCodes.SPACE && that.selectpicker.keydown.keyHistory) { + var searchMatch, matches = [], keyHistory; + e.preventDefault(); + that.selectpicker.keydown.keyHistory += keyCodeMap[e.which]; + if (that.selectpicker.keydown.resetKeyHistory.cancel) clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel); + that.selectpicker.keydown.resetKeyHistory.cancel = that.selectpicker.keydown.resetKeyHistory.start(); + keyHistory = that.selectpicker.keydown.keyHistory; + + // if all letters are the same, set keyHistory to just the first character when searching + if (/^(.)\1+$/.test(keyHistory)) { + keyHistory = keyHistory.charAt(0); + } - e.preventDefault(); - - that.selectpicker.keydown.keyHistory += keyCodeMap[e.which]; - - if (that.selectpicker.keydown.resetKeyHistory.cancel) clearTimeout(that.selectpicker.keydown.resetKeyHistory.cancel); - that.selectpicker.keydown.resetKeyHistory.cancel = that.selectpicker.keydown.resetKeyHistory.start(); - - keyHistory = that.selectpicker.keydown.keyHistory; - - // if all letters are the same, set keyHistory to just the first character when searching - if (/^(.)\1+$/.test(keyHistory)) { - keyHistory = keyHistory.charAt(0); - } - - // find matches - for (var i = 0; i < that.selectpicker.current.data.length; i++) { - var li = that.selectpicker.current.data[i], + // find matches + for (var i = 0; i < that.selectpicker.current.data.length; i++) { + var li = that.selectpicker.current.data[i], hasMatch; - - hasMatch = stringSearch(li, keyHistory, 'startsWith', true); - - if (hasMatch && that.selectpicker.view.canHighlight[i]) { - matches.push(li.element); + hasMatch = stringSearch(li, keyHistory, 'startsWith', true); + if (hasMatch && that.selectpicker.view.canHighlight[i]) { + matches.push(li.element); + } } - } - - if (matches.length) { - var matchIndex = 0; - - $items.removeClass('active').find('a').removeClass('active'); - - // either only one key has been pressed or they are all the same key - if (keyHistory.length === 1) { - matchIndex = matches.indexOf(that.activeElement); - - if (matchIndex === -1 || matchIndex === matches.length - 1) { - matchIndex = 0; + if (matches.length) { + var matchIndex = 0; + $items.removeClass('active').find('a').removeClass('active'); + + // either only one key has been pressed or they are all the same key + if (keyHistory.length === 1) { + matchIndex = matches.indexOf(that.activeElement); + if (matchIndex === -1 || matchIndex === matches.length - 1) { + matchIndex = 0; + } else { + matchIndex++; + } + } + searchMatch = matches[matchIndex]; + activeLi = that.selectpicker.main.data[searchMatch]; + if (scrollTop - activeLi.position > 0) { + offset = activeLi.position - activeLi.height; + updateScroll = true; } else { - matchIndex++; + offset = activeLi.position - that.sizeInfo.menuInnerHeight; + // if the option is already visible at the current scroll position, just keep it the same + updateScroll = activeLi.position > scrollTop + that.sizeInfo.menuInnerHeight; } + liActive = that.selectpicker.main.elements[searchMatch]; + that.activeElement = liActive; + that.focusItem(liActive); + if (liActive) liActive.firstChild.focus(); + if (updateScroll) that.$menuInner[0].scrollTop = offset; + $this.trigger('focus'); } + } - searchMatch = matches[matchIndex]; - - activeLi = that.selectpicker.main.data[searchMatch]; - - if (scrollTop - activeLi.position > 0) { - offset = activeLi.position - activeLi.height; - updateScroll = true; - } else { - offset = activeLi.position - that.sizeInfo.menuInnerHeight; - // if the option is already visible at the current scroll position, just keep it the same - updateScroll = activeLi.position > scrollTop + that.sizeInfo.menuInnerHeight; + // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu. + if (isActive && (e.which === keyCodes.SPACE && !that.selectpicker.keydown.keyHistory || e.which === keyCodes.ENTER || e.which === keyCodes.TAB && that.options.selectOnTab)) { + if (e.which !== keyCodes.SPACE) e.preventDefault(); + if (!that.options.liveSearch || e.which !== keyCodes.SPACE) { + that.$menuInner.find('.active a').trigger('click', true); // retain active class + $this.trigger('focus'); + if (!that.options.liveSearch) { + // Prevent screen from scrolling if the user hits the spacebar + e.preventDefault(); + // Fixes spacebar selection of dropdown items in FF & IE + $(document).data('spaceSelect', true); + } } - - liActive = that.selectpicker.main.elements[searchMatch]; - - that.activeElement = liActive; - - that.focusItem(liActive); - - if (liActive) liActive.firstChild.focus(); - - if (updateScroll) that.$menuInner[0].scrollTop = offset; - - $this.trigger('focus'); } + }, + mobile: function mobile() { + // ensure mobile is set to true if mobile function is called after init + this.options.mobile = true; + this.$element[0].classList.add('mobile-device'); + }, + refresh: function refresh() { + var that = this; + // update options if data attributes have been changed + var config = $.extend({}, this.options, getAttributesObject(this.$element), this.$element.data()); // in this order on refresh, as user may change attributes on select, and options object is not passed on refresh + this.options = config; + if (this.options.source.data) { + this.render(); + this.buildList(); + } else { + this.fetchData(function () { + that.render(); + that.buildList(); + }); + } + this.checkDisabled(); + this.setStyle(); + this.setWidth(); + this.setSize(true); + this.$element.trigger('refreshed' + EVENT_KEY); + }, + hide: function hide() { + this.$newElement.hide(); + }, + show: function show() { + this.$newElement.show(); + }, + remove: function remove() { + this.$newElement.remove(); + this.$element.remove(); + }, + destroy: function destroy() { + this.$newElement.before(this.$element).remove(); + if (this.$bsContainer) { + this.$bsContainer.remove(); + } else { + this.$menu.remove(); + } + if (this.selectpicker.view.titleOption && this.selectpicker.view.titleOption.parentNode) { + this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption); + } + this.$element.off(EVENT_KEY).removeData('selectpicker').removeClass('bs-select-hidden selectpicker mobile-device'); + $(window).off(EVENT_KEY + '.' + this.selectId); } + }; - // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu. - if ( - isActive && - ( - (e.which === keyCodes.SPACE && !that.selectpicker.keydown.keyHistory) || - e.which === keyCodes.ENTER || - (e.which === keyCodes.TAB && that.options.selectOnTab) - ) - ) { - if (e.which !== keyCodes.SPACE) e.preventDefault(); - - if (!that.options.liveSearch || e.which !== keyCodes.SPACE) { - that.$menuInner.find('.active a').trigger('click', true); // retain active class - $this.trigger('focus'); - - if (!that.options.liveSearch) { - // Prevent screen from scrolling if the user hits the spacebar - e.preventDefault(); - // Fixes spacebar selection of dropdown items in FF & IE - $(document).data('spaceSelect', true); + // SELECTPICKER PLUGIN DEFINITION + // ============================== + function Plugin(option) { + // get the args of the outer function.. + var args = arguments; + // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them + // to get lost/corrupted in android 2.3 and IE9 #715 #775 + var _option = option; + [].shift.apply(args); + + // if the version was not set successfully + if (!version.success) { + // try to retreive it again + try { + version.full = (getVersion() || '').split(' ')[0].split('.'); + } catch (err) { + // fall back to use BootstrapVersion if set + if (_Selectpicker.BootstrapVersion) { + version.full = _Selectpicker.BootstrapVersion.split(' ')[0].split('.'); + } else { + version.full = [version.major, '0', '0']; + console.warn('There was an issue retrieving Bootstrap\'s version. ' + 'Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. ' + 'If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.', err); } } + version.major = version.full[0]; + version.success = true; } - }, - - mobile: function () { - // ensure mobile is set to true if mobile function is called after init - this.options.mobile = true; - this.$element[0].classList.add('mobile-device'); - }, - - refresh: function () { - var that = this; - // update options if data attributes have been changed - var config = $.extend({}, this.options, getAttributesObject(this.$element), this.$element.data()); // in this order on refresh, as user may change attributes on select, and options object is not passed on refresh - this.options = config; - - if (this.options.source.data) { - this.render(); - this.buildList(); - } else { - this.fetchData(function () { - that.render(); - that.buildList(); + if (version.major >= '4') { + // some defaults need to be changed if using Bootstrap 4 + // check to see if they have already been manually changed before forcing them to update + var toUpdate = []; + if (_Selectpicker.DEFAULTS.style === classNames.BUTTONCLASS) toUpdate.push({ + name: 'style', + className: 'BUTTONCLASS' }); - } - - this.checkDisabled(); - this.setStyle(); - this.setWidth(); - - this.setSize(true); - - this.$element.trigger('refreshed' + EVENT_KEY); - }, - - hide: function () { - this.$newElement.hide(); - }, - - show: function () { - this.$newElement.show(); - }, - - remove: function () { - this.$newElement.remove(); - this.$element.remove(); - }, - - destroy: function () { - this.$newElement.before(this.$element).remove(); - - if (this.$bsContainer) { - this.$bsContainer.remove(); - } else { - this.$menu.remove(); - } - - if (this.selectpicker.view.titleOption && this.selectpicker.view.titleOption.parentNode) { - this.selectpicker.view.titleOption.parentNode.removeChild(this.selectpicker.view.titleOption); - } - - this.$element - .off(EVENT_KEY) - .removeData('selectpicker') - .removeClass('bs-select-hidden selectpicker mobile-device'); - - $(window).off(EVENT_KEY + '.' + this.selectId); - } - }; - - // SELECTPICKER PLUGIN DEFINITION - // ============================== - function Plugin (option) { - // get the args of the outer function.. - var args = arguments; - // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them - // to get lost/corrupted in android 2.3 and IE9 #715 #775 - var _option = option; - - [].shift.apply(args); - - // if the version was not set successfully - if (!version.success) { - // try to retreive it again - try { - version.full = (getVersion() || '').split(' ')[0].split('.'); - } catch (err) { - // fall back to use BootstrapVersion if set - if (Selectpicker.BootstrapVersion) { - version.full = Selectpicker.BootstrapVersion.split(' ')[0].split('.'); - } else { - version.full = [version.major, '0', '0']; - - console.warn( - 'There was an issue retrieving Bootstrap\'s version. ' + - 'Ensure Bootstrap is being loaded before bootstrap-select and there is no namespace collision. ' + - 'If loading Bootstrap asynchronously, the version may need to be manually specified via $.fn.selectpicker.Constructor.BootstrapVersion.', - err - ); + if (_Selectpicker.DEFAULTS.iconBase === classNames.ICONBASE) toUpdate.push({ + name: 'iconBase', + className: 'ICONBASE' + }); + if (_Selectpicker.DEFAULTS.tickIcon === classNames.TICKICON) toUpdate.push({ + name: 'tickIcon', + className: 'TICKICON' + }); + classNames.DIVIDER = 'dropdown-divider'; + classNames.SHOW = 'show'; + classNames.BUTTONCLASS = 'btn-light'; + classNames.POPOVERHEADER = 'popover-header'; + classNames.ICONBASE = ''; + classNames.TICKICON = 'bs-ok-default'; + for (var i = 0; i < toUpdate.length; i++) { + var option = toUpdate[i]; + _Selectpicker.DEFAULTS[option.name] = classNames[option.className]; } } - - version.major = version.full[0]; - version.success = true; - } - - if (version.major >= '4') { - // some defaults need to be changed if using Bootstrap 4 - // check to see if they have already been manually changed before forcing them to update - var toUpdate = []; - - if (Selectpicker.DEFAULTS.style === classNames.BUTTONCLASS) toUpdate.push({ name: 'style', className: 'BUTTONCLASS' }); - if (Selectpicker.DEFAULTS.iconBase === classNames.ICONBASE) toUpdate.push({ name: 'iconBase', className: 'ICONBASE' }); - if (Selectpicker.DEFAULTS.tickIcon === classNames.TICKICON) toUpdate.push({ name: 'tickIcon', className: 'TICKICON' }); - - classNames.DIVIDER = 'dropdown-divider'; - classNames.SHOW = 'show'; - classNames.BUTTONCLASS = 'btn-light'; - classNames.POPOVERHEADER = 'popover-header'; - classNames.ICONBASE = ''; - classNames.TICKICON = 'bs-ok-default'; - - for (var i = 0; i < toUpdate.length; i++) { - var option = toUpdate[i]; - Selectpicker.DEFAULTS[option.name] = classNames[option.className]; + if (version.major > '4') { + Selector.DATA_TOGGLE = 'data-bs-toggle="dropdown"'; } - } - - if (version.major > '4') { - Selector.DATA_TOGGLE = 'data-bs-toggle="dropdown"'; - } - - var value; - var chain = this.each(function () { - var $this = $(this); - if ($this.is('select')) { - var data = $this.data('selectpicker'), - options = typeof _option == 'object' && _option; - - // for backwards compatibility - // (using title as placeholder is deprecated - remove in v2.0.0) - if (options.title) options.placeholder = options.title; - - if (!data) { - var dataAttributes = $this.data(); - - for (var dataAttr in dataAttributes) { - if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { - delete dataAttributes[dataAttr]; + var value; + var chain = this.each(function () { + var $this = $(this); + if ($this.is('select')) { + var data = $this.data('selectpicker'), + options = _typeof(_option) == 'object' && _option; + + // for backwards compatibility + // (using title as placeholder is deprecated - remove in v2.0.0) + if (options.title) options.placeholder = options.title; + if (!data) { + var dataAttributes = $this.data(); + for (var dataAttr in dataAttributes) { + if (Object.prototype.hasOwnProperty.call(dataAttributes, dataAttr) && $.inArray(dataAttr, DISALLOWED_ATTRIBUTES) !== -1) { + delete dataAttributes[dataAttr]; + } } - } - - var config = $.extend({}, Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, getAttributesObject($this), dataAttributes, options); // this is correct order on initial render - config.template = $.extend({}, Selectpicker.DEFAULTS.template, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}), dataAttributes.template, options.template); - config.source = $.extend({}, Selectpicker.DEFAULTS.source, ($.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.source : {}), options.source); - $this.data('selectpicker', (data = new Selectpicker(this, config))); - } else if (options) { - for (var i in options) { - if (Object.prototype.hasOwnProperty.call(options, i)) { - data.options[i] = options[i]; + var config = $.extend({}, _Selectpicker.DEFAULTS, $.fn.selectpicker.defaults || {}, getAttributesObject($this), dataAttributes, options); // this is correct order on initial render + config.template = $.extend({}, _Selectpicker.DEFAULTS.template, $.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.template : {}, dataAttributes.template, options.template); + config.source = $.extend({}, _Selectpicker.DEFAULTS.source, $.fn.selectpicker.defaults ? $.fn.selectpicker.defaults.source : {}, options.source); + $this.data('selectpicker', data = new _Selectpicker(this, config)); + } else if (options) { + for (var i in options) { + if (Object.prototype.hasOwnProperty.call(options, i)) { + data.options[i] = options[i]; + } } } - } - - if (typeof _option == 'string') { - if (data[_option] instanceof Function) { - value = data[_option].apply(data, args); - } else { - value = data.options[_option]; + if (typeof _option == 'string') { + if (data[_option] instanceof Function) { + value = data[_option].apply(data, args); + } else { + value = data.options[_option]; + } } } + }); + if (typeof value !== 'undefined') { + // noinspection JSUnusedAssignment + return value; + } else { + return chain; } - }); - - if (typeof value !== 'undefined') { - // noinspection JSUnusedAssignment - return value; - } else { - return chain; } - } + var old = $.fn.selectpicker; + $.fn.selectpicker = Plugin; + $.fn.selectpicker.Constructor = _Selectpicker; + + // SELECTPICKER NO CONFLICT + // ======================== + $.fn.selectpicker.noConflict = function () { + $.fn.selectpicker = old; + return this; + }; - var old = $.fn.selectpicker; - $.fn.selectpicker = Plugin; - $.fn.selectpicker.Constructor = Selectpicker; - - // SELECTPICKER NO CONFLICT - // ======================== - $.fn.selectpicker.noConflict = function () { - $.fn.selectpicker = old; - return this; - }; - - // get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3 - function keydownHandler () { - if (version.major < 5) { - if ($.fn.dropdown) { - // wait to define until function is called in case Bootstrap isn't loaded yet - var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown; - return bootstrapKeydown.apply(this, arguments); + // get Bootstrap's keydown event handler for either Bootstrap 4 or Bootstrap 3 + function keydownHandler() { + if (version.major < 5) { + if ($.fn.dropdown) { + // wait to define until function is called in case Bootstrap isn't loaded yet + var bootstrapKeydown = $.fn.dropdown.Constructor._dataApiKeydownHandler || $.fn.dropdown.Constructor.prototype.keydown; + return bootstrapKeydown.apply(this, arguments); + } + } else { + return Dropdown.dataApiKeydownHandler; } - } else { - return Dropdown.dataApiKeydownHandler; } - } - - $(document) - .off('keydown.bs.dropdown.data-api') - .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > [' + Selector.DATA_TOGGLE + ']', keydownHandler) - .on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > .dropdown-menu', keydownHandler) - .on('keydown' + EVENT_KEY, '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', Selectpicker.prototype.keydown) - .on('focusin.modal', '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', function (e) { + $(document).off('keydown.bs.dropdown.data-api').on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > [' + Selector.DATA_TOGGLE + ']', keydownHandler).on('keydown.bs.dropdown.data-api', ':not(.bootstrap-select) > .dropdown-menu', keydownHandler).on('keydown' + EVENT_KEY, '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', _Selectpicker.prototype.keydown).on('focusin.modal', '.bootstrap-select [' + Selector.DATA_TOGGLE + '], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input', function (e) { e.stopPropagation(); }); - // SELECTPICKER DATA-API - // ===================== - document.addEventListener('DOMContentLoaded', function () { - $('.selectpicker').each(function () { - var $selectpicker = $(this); - Plugin.call($selectpicker, $selectpicker.data()); + // SELECTPICKER DATA-API + // ===================== + document.addEventListener('DOMContentLoaded', function () { + $('.selectpicker').each(function () { + var $selectpicker = $(this); + Plugin.call($selectpicker, $selectpicker.data()); + }); }); - }); -})(jQuery); - - -})); -//# sourceMappingURL=bootstrap-select.js.map \ No newline at end of file + })(jQuery); +}); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js index 6294dff3dfb..d54172f7774 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js @@ -1,13 +1,47 @@ +/* +** NOTE: This file is generated by Gulp and should not be edited directly! +** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. +*/ + +function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } +function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } +function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } +function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } +function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } +function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } +function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } +function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } +function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*! * Bootstrap v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 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' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory()); -})(this, (function () { 'use strict'; + (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory()); +})(this, function () { + 'use strict'; /** * -------------------------------------------------------------------------- @@ -19,40 +53,39 @@ /** * Constants */ - - const elementMap = new Map(); - const Data = { - set(element, key, instance) { + var elementMap = new Map(); + var Data = { + set: function set(element, key, instance) { if (!elementMap.has(element)) { elementMap.set(element, new Map()); } - const instanceMap = elementMap.get(element); + var instanceMap = elementMap.get(element); // make it clear we only want one instance per element // can be removed later when multiple key/instances are fine to be used if (!instanceMap.has(key) && instanceMap.size !== 0) { // eslint-disable-next-line no-console - console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); + console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(instanceMap.keys())[0], ".")); return; } instanceMap.set(key, instance); }, - get(element, key) { + get: function get(element, key) { if (elementMap.has(element)) { return elementMap.get(element).get(key) || null; } return null; }, - remove(element, key) { + remove: function remove(element, key) { if (!elementMap.has(element)) { return; } - const instanceMap = elementMap.get(element); - instanceMap.delete(key); + var instanceMap = elementMap.get(element); + instanceMap["delete"](key); // free up element references if there are no instances left for an element if (instanceMap.size === 0) { - elementMap.delete(element); + elementMap["delete"](element); } } }; @@ -64,27 +97,29 @@ * -------------------------------------------------------------------------- */ - const MAX_UID = 1000000; - const MILLISECONDS_MULTIPLIER = 1000; - const TRANSITION_END = 'transitionend'; + var MAX_UID = 1000000; + var MILLISECONDS_MULTIPLIER = 1000; + var TRANSITION_END = 'transitionend'; /** * Properly escape IDs selectors to handle weird IDs * @param {string} selector * @returns {string} */ - const parseSelector = selector => { + var parseSelector = function parseSelector(selector) { if (selector && window.CSS && window.CSS.escape) { // document.querySelector needs escaping to handle IDs (html5+) containing for instance / - selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); + selector = selector.replace(/#([^\s"#']+)/g, function (match, id) { + return "#".concat(CSS.escape(id)); + }); } return selector; }; // Shout-out Angus Croll (https://goo.gl/pxwQGp) - const toType = object => { + var toType = function toType(object) { if (object === null || object === undefined) { - return `${object}`; + return "".concat(object); } return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); }; @@ -93,24 +128,23 @@ * Public Util API */ - const getUID = prefix => { + var getUID = function getUID(prefix) { do { prefix += Math.floor(Math.random() * MAX_UID); } while (document.getElementById(prefix)); return prefix; }; - const getTransitionDurationFromElement = element => { + var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) { if (!element) { return 0; } // Get transition-duration of the element - let { - transitionDuration, - transitionDelay - } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); + var _window$getComputedSt = window.getComputedStyle(element), + transitionDuration = _window$getComputedSt.transitionDuration, + transitionDelay = _window$getComputedSt.transitionDelay; + var floatTransitionDuration = Number.parseFloat(transitionDuration); + var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found if (!floatTransitionDuration && !floatTransitionDelay) { @@ -122,11 +156,11 @@ transitionDelay = transitionDelay.split(',')[0]; return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; }; - const triggerTransitionEnd = element => { + var triggerTransitionEnd = function triggerTransitionEnd(element) { element.dispatchEvent(new Event(TRANSITION_END)); }; - const isElement$1 = object => { - if (!object || typeof object !== 'object') { + var isElement$1 = function isElement$1(object) { + if (!object || _typeof(object) !== 'object') { return false; } if (typeof object.jquery !== 'undefined') { @@ -134,7 +168,7 @@ } return typeof object.nodeType !== 'undefined'; }; - const getElement = object => { + var getElement = function getElement(object) { // it's a jQuery object or a node element if (isElement$1(object)) { return object.jquery ? object[0] : object; @@ -144,18 +178,18 @@ } return null; }; - const isVisible = element => { + var isVisible = function isVisible(element) { if (!isElement$1(element) || element.getClientRects().length === 0) { return false; } - const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; + var elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed - const closedDetails = element.closest('details:not([open])'); + var closedDetails = element.closest('details:not([open])'); if (!closedDetails) { return elementIsVisible; } if (closedDetails !== element) { - const summary = element.closest('summary'); + var summary = element.closest('summary'); if (summary && summary.parentNode !== closedDetails) { return false; } @@ -165,7 +199,7 @@ } return elementIsVisible; }; - const isDisabled = element => { + var isDisabled = function isDisabled(element) { if (!element || element.nodeType !== Node.ELEMENT_NODE) { return true; } @@ -177,14 +211,14 @@ } return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; }; - const findShadowRoot = element => { + var _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') { - const root = element.getRootNode(); + var root = element.getRootNode(); return root instanceof ShadowRoot ? root : null; } if (element instanceof ShadowRoot) { @@ -195,9 +229,9 @@ if (!element.parentNode) { return null; } - return findShadowRoot(element.parentNode); + return _findShadowRoot(element.parentNode); }; - const noop = () => {}; + var noop = function noop() {}; /** * Trick to restart an element's animation @@ -207,23 +241,24 @@ * * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation */ - const reflow = element => { + var reflow = function reflow(element) { element.offsetHeight; // eslint-disable-line no-unused-expressions }; - const getjQuery = () => { + var getjQuery = function getjQuery() { if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { return window.jQuery; } return null; }; - const DOMContentLoadedCallbacks = []; - const onDOMContentLoaded = callback => { + var DOMContentLoadedCallbacks = []; + var onDOMContentLoaded = function onDOMContentLoaded(callback) { if (document.readyState === 'loading') { // add listener on the first call when the document is in loading state if (!DOMContentLoadedCallbacks.length) { - document.addEventListener('DOMContentLoaded', () => { - for (const callback of DOMContentLoadedCallbacks) { - callback(); + document.addEventListener('DOMContentLoaded', function () { + for (var _i2 = 0, _DOMContentLoadedCall = DOMContentLoadedCallbacks; _i2 < _DOMContentLoadedCall.length; _i2++) { + var _callback = _DOMContentLoadedCall[_i2]; + _callback(); } }); } @@ -232,46 +267,50 @@ callback(); } }; - const isRTL = () => document.documentElement.dir === 'rtl'; - const defineJQueryPlugin = plugin => { - onDOMContentLoaded(() => { - const $ = getjQuery(); + var isRTL = function isRTL() { + return document.documentElement.dir === 'rtl'; + }; + var defineJQueryPlugin = function defineJQueryPlugin(plugin) { + onDOMContentLoaded(function () { + var $ = getjQuery(); /* istanbul ignore if */ if ($) { - const name = plugin.NAME; - const JQUERY_NO_CONFLICT = $.fn[name]; + var name = plugin.NAME; + var JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = plugin.jQueryInterface; $.fn[name].Constructor = plugin; - $.fn[name].noConflict = () => { + $.fn[name].noConflict = function () { $.fn[name] = JQUERY_NO_CONFLICT; return plugin.jQueryInterface; }; } }); }; - const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { - return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue; + var execute = function execute(possibleCallback) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : possibleCallback; + return typeof possibleCallback === 'function' ? possibleCallback.apply(void 0, _toConsumableArray(args)) : defaultValue; }; - const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { + var executeAfterTransition = function executeAfterTransition(callback, transitionElement) { + var waitForTransition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (!waitForTransition) { execute(callback); return; } - const durationPadding = 5; - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; - let called = false; - const handler = ({ - target - }) => { + var durationPadding = 5; + var emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; + var called = false; + var _handler = function handler(_ref6) { + var target = _ref6.target; if (target !== transitionElement) { return; } called = true; - transitionElement.removeEventListener(TRANSITION_END, handler); + transitionElement.removeEventListener(TRANSITION_END, _handler); execute(callback); }; - transitionElement.addEventListener(TRANSITION_END, handler); - setTimeout(() => { + transitionElement.addEventListener(TRANSITION_END, _handler); + setTimeout(function () { if (!called) { triggerTransitionEnd(transitionElement); } @@ -287,9 +326,9 @@ * @param isCycleAllowed * @return {Element|elem} The proper element */ - const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { - const listLength = list.length; - let index = list.indexOf(activeElement); + var getNextActiveElement = function getNextActiveElement(list, activeElement, shouldGetNext, isCycleAllowed) { + var listLength = list.length; + var index = list.indexOf(activeElement); // if the element does not exist in the list return an element // depending on the direction and if cycle is allowed @@ -310,31 +349,30 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const namespaceRegex = /[^.]*(?=\..*)\.|.*/; - const stripNameRegex = /\..*/; - const stripUidRegex = /::\d+$/; - const eventRegistry = {}; // Events storage - let uidEvent = 1; - const customEvents = { + var namespaceRegex = /[^.]*(?=\..*)\.|.*/; + var stripNameRegex = /\..*/; + var stripUidRegex = /::\d+$/; + var eventRegistry = {}; // Events storage + var uidEvent = 1; + var customEvents = { mouseenter: 'mouseover', mouseleave: 'mouseout' }; - const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); + var nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); /** * Private methods */ function makeEventUid(element, uid) { - return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; + return uid && "".concat(uid, "::").concat(uidEvent++) || element.uidEvent || uidEvent++; } function getElementEvents(element) { - const uid = makeEventUid(element); + var uid = makeEventUid(element); element.uidEvent = uid; eventRegistry[uid] = eventRegistry[uid] || {}; return eventRegistry[uid]; @@ -352,33 +390,43 @@ } function bootstrapDelegationHandler(element, selector, fn) { return function handler(event) { - const domElements = element.querySelectorAll(selector); - for (let { - target - } = event; target && target !== this; target = target.parentNode) { - for (const domElement of domElements) { - if (domElement !== target) { - continue; - } - hydrateObj(event, { - delegateTarget: target - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, selector, fn); + var domElements = element.querySelectorAll(selector); + for (var target = event.target; target && target !== this; target = target.parentNode) { + var _iterator = _createForOfIteratorHelper(domElements), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var domElement = _step.value; + if (domElement !== target) { + continue; + } + hydrateObj(event, { + delegateTarget: target + }); + if (handler.oneOff) { + EventHandler.off(element, event.type, selector, fn); + } + return fn.apply(target, [event]); } - return fn.apply(target, [event]); + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } }; } - function findHandler(events, callable, delegationSelector = null) { - return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); + function findHandler(events, callable) { + var delegationSelector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return Object.values(events).find(function (event) { + return event.callable === callable && event.delegationSelector === delegationSelector; + }); } function normalizeParameters(originalTypeEvent, handler, delegationFunction) { - const isDelegated = typeof handler === 'string'; + var isDelegated = typeof handler === 'string'; // TODO: tooltip passes `false` instead of selector, so we need to check - const callable = isDelegated ? delegationFunction : handler || delegationFunction; - let typeEvent = getTypeEvent(originalTypeEvent); + var callable = isDelegated ? delegationFunction : handler || delegationFunction; + var typeEvent = getTypeEvent(originalTypeEvent); if (!nativeEvents.has(typeEvent)) { typeEvent = originalTypeEvent; } @@ -388,12 +436,16 @@ if (typeof originalTypeEvent !== 'string' || !element) { return; } - let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); + var _normalizeParameters = normalizeParameters(originalTypeEvent, handler, delegationFunction), + _normalizeParameters2 = _slicedToArray(_normalizeParameters, 3), + isDelegated = _normalizeParameters2[0], + callable = _normalizeParameters2[1], + typeEvent = _normalizeParameters2[2]; // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position // this prevents the handler from being dispatched the same way as mouseover or mouseout does if (originalTypeEvent in customEvents) { - const wrapFunction = fn => { + var wrapFunction = function wrapFunction(fn) { return function (event) { if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { return fn.call(this, event); @@ -402,15 +454,15 @@ }; callable = wrapFunction(callable); } - const events = getElementEvents(element); - const handlers = events[typeEvent] || (events[typeEvent] = {}); - const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); + var events = getElementEvents(element); + var handlers = events[typeEvent] || (events[typeEvent] = {}); + var previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); if (previousFunction) { previousFunction.oneOff = previousFunction.oneOff && oneOff; return; } - const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); - const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); + var uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); + var fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); fn.delegationSelector = isDelegated ? handler : null; fn.callable = callable; fn.oneOff = oneOff; @@ -419,7 +471,7 @@ element.addEventListener(typeEvent, fn, isDelegated); } function removeHandler(element, events, typeEvent, handler, delegationSelector) { - const fn = findHandler(events[typeEvent], handler, delegationSelector); + var fn = findHandler(events[typeEvent], handler, delegationSelector); if (!fn) { return; } @@ -427,8 +479,11 @@ delete events[typeEvent][fn.uidEvent]; } function removeNamespacedHandlers(element, events, typeEvent, namespace) { - const storeElementEvent = events[typeEvent] || {}; - for (const [handlerKey, event] of Object.entries(storeElementEvent)) { + var storeElementEvent = events[typeEvent] || {}; + for (var _i3 = 0, _Object$entries = Object.entries(storeElementEvent); _i3 < _Object$entries.length; _i3++) { + var _Object$entries$_i = _slicedToArray(_Object$entries[_i3], 2), + handlerKey = _Object$entries$_i[0], + event = _Object$entries$_i[1]; if (handlerKey.includes(namespace)) { removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } @@ -439,22 +494,26 @@ event = event.replace(stripNameRegex, ''); return customEvents[event] || event; } - const EventHandler = { - on(element, event, handler, delegationFunction) { + var EventHandler = { + on: function on(element, event, handler, delegationFunction) { addHandler(element, event, handler, delegationFunction, false); }, - one(element, event, handler, delegationFunction) { + one: function one(element, event, handler, delegationFunction) { addHandler(element, event, handler, delegationFunction, true); }, - off(element, originalTypeEvent, handler, delegationFunction) { + off: function off(element, originalTypeEvent, handler, delegationFunction) { if (typeof originalTypeEvent !== 'string' || !element) { return; } - const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - const inNamespace = typeEvent !== originalTypeEvent; - const events = getElementEvents(element); - const storeElementEvent = events[typeEvent] || {}; - const isNamespace = originalTypeEvent.startsWith('.'); + var _normalizeParameters3 = normalizeParameters(originalTypeEvent, handler, delegationFunction), + _normalizeParameters4 = _slicedToArray(_normalizeParameters3, 3), + isDelegated = _normalizeParameters4[0], + callable = _normalizeParameters4[1], + typeEvent = _normalizeParameters4[2]; + var inNamespace = typeEvent !== originalTypeEvent; + var events = getElementEvents(element); + var storeElementEvent = events[typeEvent] || {}; + var isNamespace = originalTypeEvent.startsWith('.'); if (typeof callable !== 'undefined') { // Simplest case: handler is passed, remove that listener ONLY. if (!Object.keys(storeElementEvent).length) { @@ -464,28 +523,32 @@ return; } if (isNamespace) { - for (const elementEvent of Object.keys(events)) { + for (var _i4 = 0, _Object$keys = Object.keys(events); _i4 < _Object$keys.length; _i4++) { + var elementEvent = _Object$keys[_i4]; removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); } } - for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { - const handlerKey = keyHandlers.replace(stripUidRegex, ''); + for (var _i5 = 0, _Object$entries2 = Object.entries(storeElementEvent); _i5 < _Object$entries2.length; _i5++) { + var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i5], 2), + keyHandlers = _Object$entries2$_i[0], + event = _Object$entries2$_i[1]; + var handlerKey = keyHandlers.replace(stripUidRegex, ''); if (!inNamespace || originalTypeEvent.includes(handlerKey)) { removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } } }, - trigger(element, event, args) { + trigger: function trigger(element, event, args) { if (typeof event !== 'string' || !element) { return null; } - const $ = getjQuery(); - const typeEvent = getTypeEvent(event); - const inNamespace = event !== typeEvent; - let jQueryEvent = null; - let bubbles = true; - let nativeDispatch = true; - let defaultPrevented = false; + var $ = getjQuery(); + var typeEvent = getTypeEvent(event); + var inNamespace = event !== typeEvent; + var jQueryEvent = null; + var bubbles = true; + var nativeDispatch = true; + var defaultPrevented = false; if (inNamespace && $) { jQueryEvent = $.Event(event, args); $(element).trigger(jQueryEvent); @@ -493,8 +556,8 @@ nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); defaultPrevented = jQueryEvent.isDefaultPrevented(); } - const evt = hydrateObj(new Event(event, { - bubbles, + var evt = hydrateObj(new Event(event, { + bubbles: bubbles, cancelable: true }), args); if (defaultPrevented) { @@ -509,18 +572,25 @@ return evt; } }; - function hydrateObj(obj, meta = {}) { - for (const [key, value] of Object.entries(meta)) { + function hydrateObj(obj) { + var meta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _loop2 = function _loop2() { + var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i6], 2), + key = _Object$entries3$_i[0], + value = _Object$entries3$_i[1]; try { obj[key] = value; } catch (_unused) { Object.defineProperty(obj, key, { configurable: true, - get() { + get: function get() { return value; } }); } + }; + for (var _i6 = 0, _Object$entries3 = Object.entries(meta); _i6 < _Object$entries3.length; _i6++) { + _loop2(); } return obj; } @@ -555,30 +625,43 @@ } } function normalizeDataKey(key) { - return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); + return key.replace(/[A-Z]/g, function (chr) { + return "-".concat(chr.toLowerCase()); + }); } - const Manipulator = { - setDataAttribute(element, key, value) { - element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); + var Manipulator = { + setDataAttribute: function setDataAttribute(element, key, value) { + element.setAttribute("data-bs-".concat(normalizeDataKey(key)), value); }, - removeDataAttribute(element, key) { - element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); + removeDataAttribute: function removeDataAttribute(element, key) { + element.removeAttribute("data-bs-".concat(normalizeDataKey(key))); }, - getDataAttributes(element) { + getDataAttributes: function getDataAttributes(element) { if (!element) { return {}; } - const attributes = {}; - const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); - for (const key of bsKeys) { - let pureKey = key.replace(/^bs/, ''); - pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); - attributes[pureKey] = normalizeData(element.dataset[key]); + var attributes = {}; + var bsKeys = Object.keys(element.dataset).filter(function (key) { + return key.startsWith('bs') && !key.startsWith('bsConfig'); + }); + var _iterator2 = _createForOfIteratorHelper(bsKeys), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var key = _step2.value; + var pureKey = key.replace(/^bs/, ''); + pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); + attributes[pureKey] = normalizeData(element.dataset[key]); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } return attributes; }, - getDataAttribute(element, key) { - return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); + getDataAttribute: function getDataAttribute(element, key) { + return normalizeData(element.getAttribute("data-bs-".concat(normalizeDataKey(key)))); } }; @@ -589,132 +672,175 @@ * -------------------------------------------------------------------------- */ - /** * Class definition */ - - class Config { - // Getters - static get Default() { - return {}; - } - static get DefaultType() { - return {}; - } - static get NAME() { - throw new Error('You have to implement the static method "NAME", for each component!'); - } - _getConfig(config) { - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - return config; - } - _mergeConfigObj(config, element) { - const jsonConfig = isElement$1(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse - - return { - ...this.constructor.Default, - ...(typeof jsonConfig === 'object' ? jsonConfig : {}), - ...(isElement$1(element) ? Manipulator.getDataAttributes(element) : {}), - ...(typeof config === 'object' ? config : {}) - }; - } - _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { - for (const [property, expectedTypes] of Object.entries(configTypes)) { - const value = config[property]; - const valueType = isElement$1(value) ? 'element' : toType(value); - if (!new RegExp(expectedTypes).test(valueType)) { - throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); + var Config = /*#__PURE__*/function () { + function Config() { + _classCallCheck(this, Config); + } + return _createClass(Config, [{ + key: "_getConfig", + value: function _getConfig(config) { + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + return config; + } + }, { + key: "_mergeConfigObj", + value: function _mergeConfigObj(config, element) { + var jsonConfig = isElement$1(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse + + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this.constructor.Default), _typeof(jsonConfig) === 'object' ? jsonConfig : {}), isElement$1(element) ? Manipulator.getDataAttributes(element) : {}), _typeof(config) === 'object' ? config : {}); + } + }, { + key: "_typeCheckConfig", + value: function _typeCheckConfig(config) { + var configTypes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.constructor.DefaultType; + for (var _i7 = 0, _Object$entries4 = Object.entries(configTypes); _i7 < _Object$entries4.length; _i7++) { + var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i7], 2), + property = _Object$entries4$_i[0], + expectedTypes = _Object$entries4$_i[1]; + var value = config[property]; + var valueType = isElement$1(value) ? 'element' : toType(value); + if (!new RegExp(expectedTypes).test(valueType)) { + throw new TypeError("".concat(this.constructor.NAME.toUpperCase(), ": Option \"").concat(property, "\" provided type \"").concat(valueType, "\" but expected type \"").concat(expectedTypes, "\".")); + } } } - } - } - + }], [{ + key: "Default", + get: + // Getters + function get() { + return {}; + } + }, { + key: "DefaultType", + get: function get() { + return {}; + } + }, { + key: "NAME", + get: function get() { + throw new Error('You have to implement the static method "NAME", for each component!'); + } + }]); + }(); /** * -------------------------------------------------------------------------- * Bootstrap base-component.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const VERSION = '5.3.3'; + var VERSION = '5.3.3'; /** * Class definition */ - - class BaseComponent extends Config { - constructor(element, config) { - super(); + var BaseComponent = /*#__PURE__*/function (_Config) { + function BaseComponent(element, config) { + var _this; + _classCallCheck(this, BaseComponent); + _this = _callSuper(this, BaseComponent); element = getElement(element); if (!element) { - return; + return _possibleConstructorReturn(_this); } - this._element = element; - this._config = this._getConfig(config); - Data.set(this._element, this.constructor.DATA_KEY, this); + _this._element = element; + _this._config = _this._getConfig(config); + Data.set(_this._element, _this.constructor.DATA_KEY, _this); + return _this; } // Public - dispose() { - Data.remove(this._element, this.constructor.DATA_KEY); - EventHandler.off(this._element, this.constructor.EVENT_KEY); - for (const propertyName of Object.getOwnPropertyNames(this)) { - this[propertyName] = null; + _inherits(BaseComponent, _Config); + return _createClass(BaseComponent, [{ + key: "dispose", + value: function dispose() { + Data.remove(this._element, this.constructor.DATA_KEY); + EventHandler.off(this._element, this.constructor.EVENT_KEY); + var _iterator3 = _createForOfIteratorHelper(Object.getOwnPropertyNames(this)), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var propertyName = _step3.value; + this[propertyName] = null; + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } } - } - _queueCallback(callback, element, isAnimated = true) { - executeAfterTransition(callback, element, isAnimated); - } - _getConfig(config) { - config = this._mergeConfigObj(config, this._element); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - - // Static - static getInstance(element) { - return Data.get(getElement(element), this.DATA_KEY); - } - static getOrCreateInstance(element, config = {}) { - return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); - } - static get VERSION() { - return VERSION; - } - static get DATA_KEY() { - return `bs.${this.NAME}`; - } - static get EVENT_KEY() { - return `.${this.DATA_KEY}`; - } - static eventName(name) { - return `${name}${this.EVENT_KEY}`; - } - } - + }, { + key: "_queueCallback", + value: function _queueCallback(callback, element) { + var isAnimated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + executeAfterTransition(callback, element, isAnimated); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + config = this._mergeConfigObj(config, this._element); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + + // Static + }], [{ + key: "getInstance", + value: function getInstance(element) { + return Data.get(getElement(element), this.DATA_KEY); + } + }, { + key: "getOrCreateInstance", + value: function getOrCreateInstance(element) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.getInstance(element) || new this(element, _typeof(config) === 'object' ? config : null); + } + }, { + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "DATA_KEY", + get: function get() { + return "bs.".concat(this.NAME); + } + }, { + key: "EVENT_KEY", + get: function get() { + return ".".concat(this.DATA_KEY); + } + }, { + key: "eventName", + value: function eventName(name) { + return "".concat(name).concat(this.EVENT_KEY); + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap dom/selector-engine.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - const getSelector = element => { - let selector = element.getAttribute('data-bs-target'); + var getSelector = function getSelector(element) { + var selector = element.getAttribute('data-bs-target'); if (!selector || selector === '#') { - let hrefAttribute = element.getAttribute('href'); + var hrefAttribute = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes, // so everything starting with `#` or `.`. If a "real" URL is used as the selector, @@ -726,33 +852,41 @@ // Just in case some CMS puts out a full URL with the anchor appended if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { - hrefAttribute = `#${hrefAttribute.split('#')[1]}`; + hrefAttribute = "#".concat(hrefAttribute.split('#')[1]); } selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; } - return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null; + return selector ? selector.split(',').map(function (sel) { + return parseSelector(sel); + }).join(',') : null; }; - const SelectorEngine = { - find(selector, element = document.documentElement) { - return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); + var SelectorEngine = { + find: function find(selector) { + var _ref7; + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; + return (_ref7 = []).concat.apply(_ref7, _toConsumableArray(Element.prototype.querySelectorAll.call(element, selector))); }, - findOne(selector, element = document.documentElement) { + findOne: function findOne(selector) { + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; return Element.prototype.querySelector.call(element, selector); }, - children(element, selector) { - return [].concat(...element.children).filter(child => child.matches(selector)); + children: function children(element, selector) { + var _ref8; + return (_ref8 = []).concat.apply(_ref8, _toConsumableArray(element.children)).filter(function (child) { + return child.matches(selector); + }); }, - parents(element, selector) { - const parents = []; - let ancestor = element.parentNode.closest(selector); + parents: function parents(element, selector) { + var parents = []; + var ancestor = element.parentNode.closest(selector); while (ancestor) { parents.push(ancestor); ancestor = ancestor.parentNode.closest(selector); } return parents; }, - prev(element, selector) { - let previous = element.previousElementSibling; + prev: function prev(element, selector) { + var previous = element.previousElementSibling; while (previous) { if (previous.matches(selector)) { return [previous]; @@ -762,8 +896,8 @@ return []; }, // TODO: this is now unused; remove later along with prev() - next(element, selector) { - let next = element.nextElementSibling; + next: function next(element, selector) { + var next = element.nextElementSibling; while (next) { if (next.matches(selector)) { return [next]; @@ -772,23 +906,27 @@ } return []; }, - focusableChildren(element) { - const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); - return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); + focusableChildren: function focusableChildren(element) { + var focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(function (selector) { + return "".concat(selector, ":not([tabindex^=\"-\"])"); + }).join(','); + return this.find(focusables, element).filter(function (el) { + return !isDisabled(el) && isVisible(el); + }); }, - getSelectorFromElement(element) { - const selector = getSelector(element); + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = getSelector(element); if (selector) { return SelectorEngine.findOne(selector) ? selector : null; } return null; }, - getElementFromSelector(element) { - const selector = getSelector(element); + getElementFromSelector: function getElementFromSelector(element) { + var selector = getSelector(element); return selector ? SelectorEngine.findOne(selector) : null; }, - getMultipleElementsFromSelector(element) { - const selector = getSelector(element); + getMultipleElementsFromSelector: function getMultipleElementsFromSelector(element) { + var selector = getSelector(element); return selector ? SelectorEngine.find(selector) : []; } }; @@ -800,18 +938,19 @@ * -------------------------------------------------------------------------- */ - const enableDismissTrigger = (component, method = 'hide') => { - const clickEvent = `click.dismiss${component.EVENT_KEY}`; - const name = component.NAME; - EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { + var enableDismissTrigger = function enableDismissTrigger(component) { + var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hide'; + var clickEvent = "click.dismiss".concat(component.EVENT_KEY); + var name = component.NAME; + EventHandler.on(document, clickEvent, "[data-bs-dismiss=\"".concat(name, "\"]"), function (event) { if (['A', 'AREA'].includes(this.tagName)) { event.preventDefault(); } if (isDisabled(this)) { return; } - const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); - const instance = component.getOrCreateInstance(target); + var target = SelectorEngine.getElementFromSelector(this) || this.closest(".".concat(name)); + var instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method instance[method](); @@ -825,66 +964,80 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$f = 'alert'; - const DATA_KEY$a = 'bs.alert'; - const EVENT_KEY$b = `.${DATA_KEY$a}`; - const EVENT_CLOSE = `close${EVENT_KEY$b}`; - const EVENT_CLOSED = `closed${EVENT_KEY$b}`; - const CLASS_NAME_FADE$5 = 'fade'; - const CLASS_NAME_SHOW$8 = 'show'; + var NAME$f = 'alert'; + var DATA_KEY$a = 'bs.alert'; + var EVENT_KEY$b = ".".concat(DATA_KEY$a); + var EVENT_CLOSE = "close".concat(EVENT_KEY$b); + var EVENT_CLOSED = "closed".concat(EVENT_KEY$b); + var CLASS_NAME_FADE$5 = 'fade'; + var CLASS_NAME_SHOW$8 = 'show'; /** * Class definition */ - - class Alert extends BaseComponent { - // Getters - static get NAME() { - return NAME$f; - } - - // Public - close() { - const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); - if (closeEvent.defaultPrevented) { - return; - } - this._element.classList.remove(CLASS_NAME_SHOW$8); - const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); - this._queueCallback(() => this._destroyElement(), this._element, isAnimated); - } - - // Private - _destroyElement() { - this._element.remove(); - EventHandler.trigger(this._element, EVENT_CLOSED); - this.dispose(); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Alert.getOrCreateInstance(this); - if (typeof config !== 'string') { + var Alert = /*#__PURE__*/function (_BaseComponent) { + function Alert() { + _classCallCheck(this, Alert); + return _callSuper(this, Alert, arguments); + } + _inherits(Alert, _BaseComponent); + return _createClass(Alert, [{ + key: "close", + value: + // Public + function close() { + var _this2 = this; + var closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); + if (closeEvent.defaultPrevented) { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - }); - } - } + this._element.classList.remove(CLASS_NAME_SHOW$8); + var isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); + this._queueCallback(function () { + return _this2._destroyElement(); + }, this._element, isAnimated); + } + + // Private + }, { + key: "_destroyElement", + value: function _destroyElement() { + this._element.remove(); + EventHandler.trigger(this._element, EVENT_CLOSED); + this.dispose(); + } + // Static + }], [{ + key: "NAME", + get: + // Getters + function get() { + return NAME$f; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Alert.getOrCreateInstance(this); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](this); + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - enableDismissTrigger(Alert, 'close'); /** @@ -900,54 +1053,63 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$e = 'button'; - const DATA_KEY$9 = 'bs.button'; - const EVENT_KEY$a = `.${DATA_KEY$9}`; - const DATA_API_KEY$6 = '.data-api'; - const CLASS_NAME_ACTIVE$3 = 'active'; - const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; - const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; + var NAME$e = 'button'; + var DATA_KEY$9 = 'bs.button'; + var EVENT_KEY$a = ".".concat(DATA_KEY$9); + var DATA_API_KEY$6 = '.data-api'; + var CLASS_NAME_ACTIVE$3 = 'active'; + var SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; + var EVENT_CLICK_DATA_API$6 = "click".concat(EVENT_KEY$a).concat(DATA_API_KEY$6); /** * Class definition */ - - class Button extends BaseComponent { - // Getters - static get NAME() { - return NAME$e; - } - - // Public - toggle() { - // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method - this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Button.getOrCreateInstance(this); - if (config === 'toggle') { - data[config](); - } - }); - } - } - + var Button = /*#__PURE__*/function (_BaseComponent2) { + function Button() { + _classCallCheck(this, Button); + return _callSuper(this, Button, arguments); + } + _inherits(Button, _BaseComponent2); + return _createClass(Button, [{ + key: "toggle", + value: + // Public + function toggle() { + // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method + this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); + } + + // Static + }], [{ + key: "NAME", + get: + // Getters + function get() { + return NAME$e; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Button.getOrCreateInstance(this); + if (config === 'toggle') { + data[config](); + } + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { + EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, function (event) { event.preventDefault(); - const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); - const data = Button.getOrCreateInstance(button); + var button = event.target.closest(SELECTOR_DATA_TOGGLE$5); + var data = Button.getOrCreateInstance(button); data.toggle(); }); @@ -964,28 +1126,27 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$d = 'swipe'; - const EVENT_KEY$9 = '.bs.swipe'; - const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; - const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; - const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; - const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; - const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; - const POINTER_TYPE_TOUCH = 'touch'; - const POINTER_TYPE_PEN = 'pen'; - const CLASS_NAME_POINTER_EVENT = 'pointer-event'; - const SWIPE_THRESHOLD = 40; - const Default$c = { + var NAME$d = 'swipe'; + var EVENT_KEY$9 = '.bs.swipe'; + var EVENT_TOUCHSTART = "touchstart".concat(EVENT_KEY$9); + var EVENT_TOUCHMOVE = "touchmove".concat(EVENT_KEY$9); + var EVENT_TOUCHEND = "touchend".concat(EVENT_KEY$9); + var EVENT_POINTERDOWN = "pointerdown".concat(EVENT_KEY$9); + var EVENT_POINTERUP = "pointerup".concat(EVENT_KEY$9); + var POINTER_TYPE_TOUCH = 'touch'; + var POINTER_TYPE_PEN = 'pen'; + var CLASS_NAME_POINTER_EVENT = 'pointer-event'; + var SWIPE_THRESHOLD = 40; + var Default$c = { endCallback: null, leftCallback: null, rightCallback: null }; - const DefaultType$c = { + var DefaultType$c = { endCallback: '(function|null)', leftCallback: '(function|null)', rightCallback: '(function|null)' @@ -994,140 +1155,170 @@ /** * Class definition */ - - class Swipe extends Config { - constructor(element, config) { - super(); - this._element = element; + var Swipe = /*#__PURE__*/function (_Config2) { + function Swipe(element, config) { + var _this3; + _classCallCheck(this, Swipe); + _this3 = _callSuper(this, Swipe); + _this3._element = element; if (!element || !Swipe.isSupported()) { - return; + return _possibleConstructorReturn(_this3); } - this._config = this._getConfig(config); - this._deltaX = 0; - this._supportPointerEvents = Boolean(window.PointerEvent); - this._initEvents(); + _this3._config = _this3._getConfig(config); + _this3._deltaX = 0; + _this3._supportPointerEvents = Boolean(window.PointerEvent); + _this3._initEvents(); + return _this3; } // Getters - static get Default() { - return Default$c; - } - static get DefaultType() { - return DefaultType$c; - } - static get NAME() { - return NAME$d; - } - - // Public - dispose() { - EventHandler.off(this._element, EVENT_KEY$9); - } + _inherits(Swipe, _Config2); + return _createClass(Swipe, [{ + key: "dispose", + value: + // Public + function dispose() { + EventHandler.off(this._element, EVENT_KEY$9); + } - // Private - _start(event) { - if (!this._supportPointerEvents) { - this._deltaX = event.touches[0].clientX; - return; + // Private + }, { + key: "_start", + value: function _start(event) { + if (!this._supportPointerEvents) { + this._deltaX = event.touches[0].clientX; + return; + } + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX; + } + } + }, { + key: "_end", + value: function _end(event) { + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX - this._deltaX; + } + this._handleSwipe(); + execute(this._config.endCallback); + } + }, { + key: "_move", + value: function _move(event) { + this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; + } + }, { + key: "_handleSwipe", + value: function _handleSwipe() { + var absDeltaX = Math.abs(this._deltaX); + if (absDeltaX <= SWIPE_THRESHOLD) { + return; + } + var direction = absDeltaX / this._deltaX; + this._deltaX = 0; + if (!direction) { + return; + } + execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); + } + }, { + key: "_initEvents", + value: function _initEvents() { + var _this4 = this; + if (this._supportPointerEvents) { + EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) { + return _this4._start(event); + }); + EventHandler.on(this._element, EVENT_POINTERUP, function (event) { + return _this4._end(event); + }); + this._element.classList.add(CLASS_NAME_POINTER_EVENT); + } else { + EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) { + return _this4._start(event); + }); + EventHandler.on(this._element, EVENT_TOUCHMOVE, function (event) { + return _this4._move(event); + }); + EventHandler.on(this._element, EVENT_TOUCHEND, function (event) { + return _this4._end(event); + }); + } } - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX; + }, { + key: "_eventIsPointerPenTouch", + value: function _eventIsPointerPenTouch(event) { + return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); } - } - _end(event) { - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX - this._deltaX; + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$c; } - this._handleSwipe(); - execute(this._config.endCallback); - } - _move(event) { - this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; - } - _handleSwipe() { - const absDeltaX = Math.abs(this._deltaX); - if (absDeltaX <= SWIPE_THRESHOLD) { - return; + }, { + key: "DefaultType", + get: function get() { + return DefaultType$c; } - const direction = absDeltaX / this._deltaX; - this._deltaX = 0; - if (!direction) { - return; + }, { + key: "NAME", + get: function get() { + return NAME$d; } - execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); - } - _initEvents() { - if (this._supportPointerEvents) { - EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); - EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); - this._element.classList.add(CLASS_NAME_POINTER_EVENT); - } else { - EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); - EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); - EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); + }, { + key: "isSupported", + value: function isSupported() { + return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } - } - _eventIsPointerPenTouch(event) { - return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); - } - - // Static - static isSupported() { - return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; - } - } - + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$c = 'carousel'; - const DATA_KEY$8 = 'bs.carousel'; - const EVENT_KEY$8 = `.${DATA_KEY$8}`; - const DATA_API_KEY$5 = '.data-api'; - const ARROW_LEFT_KEY$1 = 'ArrowLeft'; - const ARROW_RIGHT_KEY$1 = 'ArrowRight'; - const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch - - const ORDER_NEXT = 'next'; - const ORDER_PREV = 'prev'; - const DIRECTION_LEFT = 'left'; - const DIRECTION_RIGHT = 'right'; - const EVENT_SLIDE = `slide${EVENT_KEY$8}`; - const EVENT_SLID = `slid${EVENT_KEY$8}`; - const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; - const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; - const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; - const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; - const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; - const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; - const CLASS_NAME_CAROUSEL = 'carousel'; - const CLASS_NAME_ACTIVE$2 = 'active'; - const CLASS_NAME_SLIDE = 'slide'; - const CLASS_NAME_END = 'carousel-item-end'; - const CLASS_NAME_START = 'carousel-item-start'; - const CLASS_NAME_NEXT = 'carousel-item-next'; - const CLASS_NAME_PREV = 'carousel-item-prev'; - const SELECTOR_ACTIVE = '.active'; - const SELECTOR_ITEM = '.carousel-item'; - const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; - const SELECTOR_ITEM_IMG = '.carousel-item img'; - const SELECTOR_INDICATORS = '.carousel-indicators'; - const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; - const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - const KEY_TO_DIRECTION = { - [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, - [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT - }; - const Default$b = { + var NAME$c = 'carousel'; + var DATA_KEY$8 = 'bs.carousel'; + var EVENT_KEY$8 = ".".concat(DATA_KEY$8); + var DATA_API_KEY$5 = '.data-api'; + var ARROW_LEFT_KEY$1 = 'ArrowLeft'; + var ARROW_RIGHT_KEY$1 = 'ArrowRight'; + var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch + + var ORDER_NEXT = 'next'; + var ORDER_PREV = 'prev'; + var DIRECTION_LEFT = 'left'; + var DIRECTION_RIGHT = 'right'; + var EVENT_SLIDE = "slide".concat(EVENT_KEY$8); + var EVENT_SLID = "slid".concat(EVENT_KEY$8); + var EVENT_KEYDOWN$1 = "keydown".concat(EVENT_KEY$8); + var EVENT_MOUSEENTER$1 = "mouseenter".concat(EVENT_KEY$8); + var EVENT_MOUSELEAVE$1 = "mouseleave".concat(EVENT_KEY$8); + var EVENT_DRAG_START = "dragstart".concat(EVENT_KEY$8); + var EVENT_LOAD_DATA_API$3 = "load".concat(EVENT_KEY$8).concat(DATA_API_KEY$5); + var EVENT_CLICK_DATA_API$5 = "click".concat(EVENT_KEY$8).concat(DATA_API_KEY$5); + var CLASS_NAME_CAROUSEL = 'carousel'; + var CLASS_NAME_ACTIVE$2 = 'active'; + var CLASS_NAME_SLIDE = 'slide'; + var CLASS_NAME_END = 'carousel-item-end'; + var CLASS_NAME_START = 'carousel-item-start'; + var CLASS_NAME_NEXT = 'carousel-item-next'; + var CLASS_NAME_PREV = 'carousel-item-prev'; + var SELECTOR_ACTIVE = '.active'; + var SELECTOR_ITEM = '.carousel-item'; + var SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; + var SELECTOR_ITEM_IMG = '.carousel-item img'; + var SELECTOR_INDICATORS = '.carousel-indicators'; + var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; + var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; + var KEY_TO_DIRECTION = _defineProperty(_defineProperty({}, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), ARROW_RIGHT_KEY$1, DIRECTION_LEFT); + var Default$b = { interval: 5000, keyboard: true, pause: 'hover', @@ -1135,7 +1326,7 @@ touch: true, wrap: true }; - const DefaultType$b = { + var DefaultType$b = { interval: '(number|boolean)', // TODO:v6 remove boolean support keyboard: 'boolean', @@ -1148,282 +1339,372 @@ /** * Class definition */ - - class Carousel extends BaseComponent { - constructor(element, config) { - super(element, config); - this._interval = null; - this._activeElement = null; - this._isSliding = false; - this.touchTimeout = null; - this._swipeHelper = null; - this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); - this._addEventListeners(); - if (this._config.ride === CLASS_NAME_CAROUSEL) { - this.cycle(); - } + var Carousel = /*#__PURE__*/function (_BaseComponent3) { + function Carousel(element, config) { + var _this5; + _classCallCheck(this, Carousel); + _this5 = _callSuper(this, Carousel, [element, config]); + _this5._interval = null; + _this5._activeElement = null; + _this5._isSliding = false; + _this5.touchTimeout = null; + _this5._swipeHelper = null; + _this5._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this5._element); + _this5._addEventListeners(); + if (_this5._config.ride === CLASS_NAME_CAROUSEL) { + _this5.cycle(); + } + return _this5; } // Getters - static get Default() { - return Default$b; - } - static get DefaultType() { - return DefaultType$b; - } - static get NAME() { - return NAME$c; - } - - // Public - next() { - this._slide(ORDER_NEXT); - } - nextWhenVisible() { - // FIXME TODO use `document.visibilityState` - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && isVisible(this._element)) { - this.next(); - } - } - prev() { - this._slide(ORDER_PREV); - } - pause() { - if (this._isSliding) { - triggerTransitionEnd(this._element); - } - this._clearInterval(); - } - cycle() { - this._clearInterval(); - this._updateInterval(); - this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); - } - _maybeEnableCycle() { - if (!this._config.ride) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); - return; + _inherits(Carousel, _BaseComponent3); + return _createClass(Carousel, [{ + key: "next", + value: + // Public + function next() { + this._slide(ORDER_NEXT); + } + }, { + key: "nextWhenVisible", + value: function nextWhenVisible() { + // FIXME TODO use `document.visibilityState` + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && isVisible(this._element)) { + this.next(); + } } - this.cycle(); - } - to(index) { - const items = this._getItems(); - if (index > items.length - 1 || index < 0) { - return; + }, { + key: "prev", + value: function prev() { + this._slide(ORDER_PREV); } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); - return; + }, { + key: "pause", + value: function pause() { + if (this._isSliding) { + triggerTransitionEnd(this._element); + } + this._clearInterval(); + } + }, { + key: "cycle", + value: function cycle() { + var _this6 = this; + this._clearInterval(); + this._updateInterval(); + this._interval = setInterval(function () { + return _this6.nextWhenVisible(); + }, this._config.interval); + } + }, { + key: "_maybeEnableCycle", + value: function _maybeEnableCycle() { + var _this7 = this; + if (!this._config.ride) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, function () { + return _this7.cycle(); + }); + return; + } + this.cycle(); } - const activeIndex = this._getItemIndex(this._getActive()); - if (activeIndex === index) { - return; + }, { + key: "to", + value: function to(index) { + var _this8 = this; + var items = this._getItems(); + if (index > items.length - 1 || index < 0) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, function () { + return _this8.to(index); + }); + return; + } + var activeIndex = this._getItemIndex(this._getActive()); + if (activeIndex === index) { + return; + } + var order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; + this._slide(order, items[index]); + } + }, { + key: "dispose", + value: function dispose() { + if (this._swipeHelper) { + this._swipeHelper.dispose(); + } + _superPropGet(Carousel, "dispose", this, 3)([]); } - const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; - this._slide(order, items[index]); - } - dispose() { - if (this._swipeHelper) { - this._swipeHelper.dispose(); + + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.defaultInterval = config.interval; + return config; + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this9 = this; + if (this._config.keyboard) { + EventHandler.on(this._element, EVENT_KEYDOWN$1, function (event) { + return _this9._keydown(event); + }); + } + if (this._config.pause === 'hover') { + EventHandler.on(this._element, EVENT_MOUSEENTER$1, function () { + return _this9.pause(); + }); + EventHandler.on(this._element, EVENT_MOUSELEAVE$1, function () { + return _this9._maybeEnableCycle(); + }); + } + if (this._config.touch && Swipe.isSupported()) { + this._addTouchEventListeners(); + } } - super.dispose(); - } + }, { + key: "_addTouchEventListeners", + value: function _addTouchEventListeners() { + var _this10 = this; + var _iterator4 = _createForOfIteratorHelper(SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var img = _step4.value; + EventHandler.on(img, EVENT_DRAG_START, function (event) { + return event.preventDefault(); + }); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + var endCallBack = function endCallBack() { + if (_this10._config.pause !== 'hover') { + return; + } - // Private - _configAfterMerge(config) { - config.defaultInterval = config.interval; - return config; - } - _addEventListeners() { - if (this._config.keyboard) { - EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); + // 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 + + _this10.pause(); + if (_this10.touchTimeout) { + clearTimeout(_this10.touchTimeout); + } + _this10.touchTimeout = setTimeout(function () { + return _this10._maybeEnableCycle(); + }, TOUCHEVENT_COMPAT_WAIT + _this10._config.interval); + }; + var swipeConfig = { + leftCallback: function leftCallback() { + return _this10._slide(_this10._directionToOrder(DIRECTION_LEFT)); + }, + rightCallback: function rightCallback() { + return _this10._slide(_this10._directionToOrder(DIRECTION_RIGHT)); + }, + endCallback: endCallBack + }; + this._swipeHelper = new Swipe(this._element, swipeConfig); } - if (this._config.pause === 'hover') { - EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); - EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); + }, { + key: "_keydown", + value: function _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + var direction = KEY_TO_DIRECTION[event.key]; + if (direction) { + event.preventDefault(); + this._slide(this._directionToOrder(direction)); + } } - if (this._config.touch && Swipe.isSupported()) { - this._addTouchEventListeners(); + }, { + key: "_getItemIndex", + value: function _getItemIndex(element) { + return this._getItems().indexOf(element); } - } - _addTouchEventListeners() { - for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { - EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); + }, { + key: "_setActiveIndicatorElement", + value: function _setActiveIndicatorElement(index) { + if (!this._indicatorsElement) { + return; + } + var activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); + activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); + activeIndicator.removeAttribute('aria-current'); + var newActiveIndicator = SelectorEngine.findOne("[data-bs-slide-to=\"".concat(index, "\"]"), this._indicatorsElement); + if (newActiveIndicator) { + newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); + newActiveIndicator.setAttribute('aria-current', 'true'); + } } - const endCallBack = () => { - if (this._config.pause !== 'hover') { + }, { + key: "_updateInterval", + value: function _updateInterval() { + var element = this._activeElement || this._getActive(); + if (!element) { return; } - - // 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 - + var elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); + this._config.interval = elementInterval || this._config.defaultInterval; + } + }, { + key: "_slide", + value: function _slide(order) { + var _this11 = this; + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + if (this._isSliding) { + return; + } + var activeElement = this._getActive(); + var isNext = order === ORDER_NEXT; + var nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); + if (nextElement === activeElement) { + return; + } + var nextElementIndex = this._getItemIndex(nextElement); + var triggerEvent = function triggerEvent(eventName) { + return EventHandler.trigger(_this11._element, eventName, { + relatedTarget: nextElement, + direction: _this11._orderToDirection(order), + from: _this11._getItemIndex(activeElement), + to: nextElementIndex + }); + }; + var slideEvent = triggerEvent(EVENT_SLIDE); + if (slideEvent.defaultPrevented) { + return; + } + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + // TODO: change tests that use empty divs to avoid this check + return; + } + var isCycling = Boolean(this._interval); this.pause(); - if (this.touchTimeout) { - clearTimeout(this.touchTimeout); + this._isSliding = true; + this._setActiveIndicatorElement(nextElementIndex); + this._activeElement = nextElement; + var directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; + var orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; + nextElement.classList.add(orderClassName); + reflow(nextElement); + activeElement.classList.add(directionalClassName); + nextElement.classList.add(directionalClassName); + var completeCallBack = function completeCallBack() { + nextElement.classList.remove(directionalClassName, orderClassName); + nextElement.classList.add(CLASS_NAME_ACTIVE$2); + activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); + _this11._isSliding = false; + triggerEvent(EVENT_SLID); + }; + this._queueCallback(completeCallBack, activeElement, this._isAnimated()); + if (isCycling) { + this.cycle(); } - this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); - }; - const swipeConfig = { - leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), - rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), - endCallback: endCallBack - }; - this._swipeHelper = new Swipe(this._element, swipeConfig); - } - _keydown(event) { - if (/input|textarea/i.test(event.target.tagName)) { - return; - } - const direction = KEY_TO_DIRECTION[event.key]; - if (direction) { - event.preventDefault(); - this._slide(this._directionToOrder(direction)); } - } - _getItemIndex(element) { - return this._getItems().indexOf(element); - } - _setActiveIndicatorElement(index) { - if (!this._indicatorsElement) { - return; + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._element.classList.contains(CLASS_NAME_SLIDE); + } + }, { + key: "_getActive", + value: function _getActive() { + return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + } + }, { + key: "_getItems", + value: function _getItems() { + return SelectorEngine.find(SELECTOR_ITEM, this._element); + } + }, { + key: "_clearInterval", + value: function _clearInterval() { + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } } - const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); - activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); - activeIndicator.removeAttribute('aria-current'); - const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); - if (newActiveIndicator) { - newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); - newActiveIndicator.setAttribute('aria-current', 'true'); + }, { + key: "_directionToOrder", + value: function _directionToOrder(direction) { + if (isRTL()) { + return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; + } + return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; } - } - _updateInterval() { - const element = this._activeElement || this._getActive(); - if (!element) { - return; + }, { + key: "_orderToDirection", + value: function _orderToDirection(order) { + if (isRTL()) { + return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; + } + return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$b; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$b; + } + }, { + key: "NAME", + get: function get() { + return NAME$c; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Carousel.getOrCreateInstance(this, config); + if (typeof config === 'number') { + data.to(config); + return; + } + if (typeof config === 'string') { + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + } + }); } - const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); - this._config.interval = elementInterval || this._config.defaultInterval; - } - _slide(order, element = null) { - if (this._isSliding) { - return; - } - const activeElement = this._getActive(); - const isNext = order === ORDER_NEXT; - const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); - if (nextElement === activeElement) { - return; - } - const nextElementIndex = this._getItemIndex(nextElement); - const triggerEvent = eventName => { - return EventHandler.trigger(this._element, eventName, { - relatedTarget: nextElement, - direction: this._orderToDirection(order), - from: this._getItemIndex(activeElement), - to: nextElementIndex - }); - }; - const slideEvent = triggerEvent(EVENT_SLIDE); - if (slideEvent.defaultPrevented) { - return; - } - if (!activeElement || !nextElement) { - // Some weirdness is happening, so we bail - // TODO: change tests that use empty divs to avoid this check - return; - } - const isCycling = Boolean(this._interval); - this.pause(); - this._isSliding = true; - this._setActiveIndicatorElement(nextElementIndex); - this._activeElement = nextElement; - const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; - const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; - nextElement.classList.add(orderClassName); - reflow(nextElement); - activeElement.classList.add(directionalClassName); - nextElement.classList.add(directionalClassName); - const completeCallBack = () => { - nextElement.classList.remove(directionalClassName, orderClassName); - nextElement.classList.add(CLASS_NAME_ACTIVE$2); - activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); - this._isSliding = false; - triggerEvent(EVENT_SLID); - }; - this._queueCallback(completeCallBack, activeElement, this._isAnimated()); - if (isCycling) { - this.cycle(); - } - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_SLIDE); - } - _getActive() { - return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); - } - _getItems() { - return SelectorEngine.find(SELECTOR_ITEM, this._element); - } - _clearInterval() { - if (this._interval) { - clearInterval(this._interval); - this._interval = null; - } - } - _directionToOrder(direction) { - if (isRTL()) { - return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; - } - return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; - } - _orderToDirection(order) { - if (isRTL()) { - return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; - } - return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Carousel.getOrCreateInstance(this, config); - if (typeof config === 'number') { - data.to(config); - return; - } - if (typeof config === 'string') { - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - } - }); - } - } - - /** - * Data API implementation - */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { - return; + }]); + }(BaseComponent); + /** + * Data API implementation + */ + EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { + var target = SelectorEngine.getElementFromSelector(this); + if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { + return; } event.preventDefault(); - const carousel = Carousel.getOrCreateInstance(target); - const slideIndex = this.getAttribute('data-bs-slide-to'); + var carousel = Carousel.getOrCreateInstance(target); + var slideIndex = this.getAttribute('data-bs-slide-to'); if (slideIndex) { carousel.to(slideIndex); carousel._maybeEnableCycle(); @@ -1437,10 +1718,19 @@ carousel.prev(); carousel._maybeEnableCycle(); }); - EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { - const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); - for (const carousel of carousels) { - Carousel.getOrCreateInstance(carousel); + EventHandler.on(window, EVENT_LOAD_DATA_API$3, function () { + var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); + var _iterator5 = _createForOfIteratorHelper(carousels), + _step5; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var carousel = _step5.value; + Carousel.getOrCreateInstance(carousel); + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); } }); @@ -1457,35 +1747,34 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$b = 'collapse'; - const DATA_KEY$7 = 'bs.collapse'; - const EVENT_KEY$7 = `.${DATA_KEY$7}`; - const DATA_API_KEY$4 = '.data-api'; - const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; - const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; - const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; - const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; - const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; - const CLASS_NAME_SHOW$7 = 'show'; - const CLASS_NAME_COLLAPSE = 'collapse'; - const CLASS_NAME_COLLAPSING = 'collapsing'; - const CLASS_NAME_COLLAPSED = 'collapsed'; - const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; - const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; - const WIDTH = 'width'; - const HEIGHT = 'height'; - const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; - const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; - const Default$a = { + var NAME$b = 'collapse'; + var DATA_KEY$7 = 'bs.collapse'; + var EVENT_KEY$7 = ".".concat(DATA_KEY$7); + var DATA_API_KEY$4 = '.data-api'; + var EVENT_SHOW$6 = "show".concat(EVENT_KEY$7); + var EVENT_SHOWN$6 = "shown".concat(EVENT_KEY$7); + var EVENT_HIDE$6 = "hide".concat(EVENT_KEY$7); + var EVENT_HIDDEN$6 = "hidden".concat(EVENT_KEY$7); + var EVENT_CLICK_DATA_API$4 = "click".concat(EVENT_KEY$7).concat(DATA_API_KEY$4); + var CLASS_NAME_SHOW$7 = 'show'; + var CLASS_NAME_COLLAPSE = 'collapse'; + var CLASS_NAME_COLLAPSING = 'collapsing'; + var CLASS_NAME_COLLAPSED = 'collapsed'; + var CLASS_NAME_DEEPER_CHILDREN = ":scope .".concat(CLASS_NAME_COLLAPSE, " .").concat(CLASS_NAME_COLLAPSE); + var CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; + var WIDTH = 'width'; + var HEIGHT = 'height'; + var SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; + var SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; + var Default$a = { parent: null, toggle: true }; - const DefaultType$a = { + var DefaultType$a = { parent: '(null|element)', toggle: 'boolean' }; @@ -1493,188 +1782,281 @@ /** * Class definition */ - - class Collapse extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isTransitioning = false; - this._triggerArray = []; - const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); - for (const elem of toggleList) { - const selector = SelectorEngine.getSelectorFromElement(elem); - const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); - if (selector !== null && filterElement.length) { - this._triggerArray.push(elem); + var Collapse = /*#__PURE__*/function (_BaseComponent4) { + function Collapse(element, config) { + var _this12; + _classCallCheck(this, Collapse); + _this12 = _callSuper(this, Collapse, [element, config]); + _this12._isTransitioning = false; + _this12._triggerArray = []; + var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); + var _iterator6 = _createForOfIteratorHelper(toggleList), + _step6; + try { + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + var elem = _step6.value; + var selector = SelectorEngine.getSelectorFromElement(elem); + var filterElement = SelectorEngine.find(selector).filter(function (foundElement) { + return foundElement === _this12._element; + }); + if (selector !== null && filterElement.length) { + _this12._triggerArray.push(elem); + } } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); } - this._initializeChildren(); - if (!this._config.parent) { - this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); + _this12._initializeChildren(); + if (!_this12._config.parent) { + _this12._addAriaAndCollapsedClass(_this12._triggerArray, _this12._isShown()); } - if (this._config.toggle) { - this.toggle(); + if (_this12._config.toggle) { + _this12.toggle(); } + return _this12; } // Getters - static get Default() { - return Default$a; - } - static get DefaultType() { - return DefaultType$a; - } - static get NAME() { - return NAME$b; - } - - // Public - toggle() { - if (this._isShown()) { - this.hide(); - } else { - this.show(); - } - } - show() { - if (this._isTransitioning || this._isShown()) { - return; - } - let activeChildren = []; - - // find active children - if (this._config.parent) { - activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { - toggle: false - })); - } - if (activeChildren.length && activeChildren[0]._isTransitioning) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); - if (startEvent.defaultPrevented) { - return; - } - for (const activeInstance of activeChildren) { - activeInstance.hide(); + _inherits(Collapse, _BaseComponent4); + return _createClass(Collapse, [{ + key: "toggle", + value: + // Public + function toggle() { + if (this._isShown()) { + this.hide(); + } else { + this.show(); + } } - const dimension = this._getDimension(); - this._element.classList.remove(CLASS_NAME_COLLAPSE); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.style[dimension] = 0; - this._addAriaAndCollapsedClass(this._triggerArray, true); - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + }, { + key: "show", + value: function show() { + var _this13 = this; + if (this._isTransitioning || this._isShown()) { + return; + } + var activeChildren = []; + + // find active children + if (this._config.parent) { + activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(function (element) { + return element !== _this13._element; + }).map(function (element) { + return Collapse.getOrCreateInstance(element, { + toggle: false + }); + }); + } + if (activeChildren.length && activeChildren[0]._isTransitioning) { + return; + } + var startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); + if (startEvent.defaultPrevented) { + return; + } + var _iterator7 = _createForOfIteratorHelper(activeChildren), + _step7; + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var activeInstance = _step7.value; + activeInstance.hide(); + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + var dimension = this._getDimension(); + this._element.classList.remove(CLASS_NAME_COLLAPSE); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.style[dimension] = 0; + this._addAriaAndCollapsedClass(this._triggerArray, true); + this._isTransitioning = true; + var complete = function complete() { + _this13._isTransitioning = false; + _this13._element.classList.remove(CLASS_NAME_COLLAPSING); + _this13._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + _this13._element.style[dimension] = ''; + EventHandler.trigger(_this13._element, EVENT_SHOWN$6); + }; + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = "scroll".concat(capitalizedDimension); + this._queueCallback(complete, this._element, true); + this._element.style[dimension] = "".concat(this._element[scrollSize], "px"); + } + }, { + key: "hide", + value: function hide() { + var _this14 = this; + if (this._isTransitioning || !this._isShown()) { + return; + } + var startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); + if (startEvent.defaultPrevented) { + return; + } + var dimension = this._getDimension(); + this._element.style[dimension] = "".concat(this._element.getBoundingClientRect()[dimension], "px"); + reflow(this._element); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + var _iterator8 = _createForOfIteratorHelper(this._triggerArray), + _step8; + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var trigger = _step8.value; + var element = SelectorEngine.getElementFromSelector(trigger); + if (element && !this._isShown(element)) { + this._addAriaAndCollapsedClass([trigger], false); + } + } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); + } + this._isTransitioning = true; + var complete = function complete() { + _this14._isTransitioning = false; + _this14._element.classList.remove(CLASS_NAME_COLLAPSING); + _this14._element.classList.add(CLASS_NAME_COLLAPSE); + EventHandler.trigger(_this14._element, EVENT_HIDDEN$6); + }; this._element.style[dimension] = ''; - EventHandler.trigger(this._element, EVENT_SHOWN$6); - }; - const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - const scrollSize = `scroll${capitalizedDimension}`; - this._queueCallback(complete, this._element, true); - this._element.style[dimension] = `${this._element[scrollSize]}px`; - } - hide() { - if (this._isTransitioning || !this._isShown()) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); - if (startEvent.defaultPrevented) { - return; + this._queueCallback(complete, this._element, true); } - const dimension = this._getDimension(); - this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; - reflow(this._element); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - for (const trigger of this._triggerArray) { - const element = SelectorEngine.getElementFromSelector(trigger); - if (element && !this._isShown(element)) { - this._addAriaAndCollapsedClass([trigger], false); - } + }, { + key: "_isShown", + value: function _isShown() { + var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._element; + return element.classList.contains(CLASS_NAME_SHOW$7); } - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE); - EventHandler.trigger(this._element, EVENT_HIDDEN$6); - }; - this._element.style[dimension] = ''; - this._queueCallback(complete, this._element, true); - } - _isShown(element = this._element) { - return element.classList.contains(CLASS_NAME_SHOW$7); - } - // Private - _configAfterMerge(config) { - config.toggle = Boolean(config.toggle); // Coerce string values - config.parent = getElement(config.parent); - return config; - } - _getDimension() { - return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; - } - _initializeChildren() { - if (!this._config.parent) { - return; - } - const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); - for (const element of children) { - const selected = SelectorEngine.getElementFromSelector(element); - if (selected) { - this._addAriaAndCollapsedClass([element], this._isShown(selected)); + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.toggle = Boolean(config.toggle); // Coerce string values + config.parent = getElement(config.parent); + return config; + } + }, { + key: "_getDimension", + value: function _getDimension() { + return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; + } + }, { + key: "_initializeChildren", + value: function _initializeChildren() { + if (!this._config.parent) { + return; + } + var children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); + var _iterator9 = _createForOfIteratorHelper(children), + _step9; + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var element = _step9.value; + var selected = SelectorEngine.getElementFromSelector(element); + if (selected) { + this._addAriaAndCollapsedClass([element], this._isShown(selected)); + } + } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); } } - } - _getFirstLevelChildren(selector) { - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - // remove children if greater depth - return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); - } - _addAriaAndCollapsedClass(triggerArray, isOpen) { - if (!triggerArray.length) { - return; - } - for (const element of triggerArray) { - element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); - element.setAttribute('aria-expanded', isOpen); - } - } - - // Static - static jQueryInterface(config) { - const _config = {}; - if (typeof config === 'string' && /show|hide/.test(config)) { - _config.toggle = false; + }, { + key: "_getFirstLevelChildren", + value: function _getFirstLevelChildren(selector) { + var children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); + // remove children if greater depth + return SelectorEngine.find(selector, this._config.parent).filter(function (element) { + return !children.includes(element); + }); } - return this.each(function () { - const data = Collapse.getOrCreateInstance(this, _config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + }, { + key: "_addAriaAndCollapsedClass", + value: function _addAriaAndCollapsedClass(triggerArray, isOpen) { + if (!triggerArray.length) { + return; + } + var _iterator10 = _createForOfIteratorHelper(triggerArray), + _step10; + try { + for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { + var element = _step10.value; + element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); + element.setAttribute('aria-expanded', isOpen); } - data[config](); + } catch (err) { + _iterator10.e(err); + } finally { + _iterator10.f(); } - }); - } - } + } + // Static + }], [{ + key: "Default", + get: function get() { + return Default$a; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$a; + } + }, { + key: "NAME", + get: function get() { + return NAME$b; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + var _config = {}; + if (typeof config === 'string' && /show|hide/.test(config)) { + _config.toggle = false; + } + return this.each(function () { + var data = Collapse.getOrCreateInstance(this, _config); + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + } + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { // preventDefault only for elements (which change the URL) not inside the collapsible element if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { event.preventDefault(); } - for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { - Collapse.getOrCreateInstance(element, { - toggle: false - }).toggle(); + var _iterator11 = _createForOfIteratorHelper(SelectorEngine.getMultipleElementsFromSelector(this)), + _step11; + try { + for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) { + var element = _step11.value; + Collapse.getOrCreateInstance(element, { + toggle: false + }).toggle(); + } + } catch (err) { + _iterator11.e(err); + } finally { + _iterator11.f(); } }); @@ -1683,7 +2065,6 @@ */ defineJQueryPlugin(Collapse); - var top = 'top'; var bottom = 'bottom'; var right = 'right'; @@ -1715,40 +2096,32 @@ var write = 'write'; var afterWrite = 'afterWrite'; var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; - function getNodeName(element) { return element ? (element.nodeName || '').toLowerCase() : null; } - function getWindow(node) { if (node == null) { return window; } - if (node.toString() !== '[object Window]') { var ownerDocument = node.ownerDocument; return ownerDocument ? ownerDocument.defaultView || window : window; } - return node; } - function isElement(node) { var OwnElement = getWindow(node).Element; return node instanceof OwnElement || node instanceof Element; } - function isHTMLElement(node) { var OwnElement = getWindow(node).HTMLElement; return node instanceof OwnElement || node instanceof HTMLElement; } - function isShadowRoot(node) { // IE 11 has no ShadowRoot if (typeof ShadowRoot === 'undefined') { return false; } - var OwnElement = getWindow(node).ShadowRoot; return node instanceof OwnElement || node instanceof ShadowRoot; } @@ -1768,11 +2141,9 @@ // effective way to apply styles to an HTMLElement // $FlowFixMe[cannot-write] - Object.assign(element.style, style); Object.keys(attributes).forEach(function (name) { var value = attributes[name]; - if (value === false) { element.removeAttribute(name); } else { @@ -1781,7 +2152,6 @@ }); }); } - function effect$2(_ref2) { var state = _ref2.state; var initialStyles = { @@ -1798,11 +2168,9 @@ }; Object.assign(state.elements.popper.style, initialStyles.popper); state.styles = initialStyles; - if (state.elements.arrow) { Object.assign(state.elements.arrow.style, initialStyles.arrow); } - return function () { Object.keys(state.elements).forEach(function (name) { var element = state.elements[name]; @@ -1817,7 +2185,6 @@ if (!isHTMLElement(element) || !getNodeName(element)) { return; } - Object.assign(element.style, style); Object.keys(attributes).forEach(function (attribute) { element.removeAttribute(attribute); @@ -1826,8 +2193,7 @@ }; } // eslint-disable-next-line import/no-unused-modules - - const applyStyles$1 = { + var applyStyles$1 = { name: 'applyStyles', enabled: true, phase: 'write', @@ -1835,52 +2201,40 @@ effect: effect$2, requires: ['computeStyles'] }; - function getBasePlacement(placement) { return placement.split('-')[0]; } - var max = Math.max; var min = Math.min; var round = Math.round; - function getUAString() { var uaData = navigator.userAgentData; - if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { return uaData.brands.map(function (item) { return item.brand + "/" + item.version; }).join(' '); } - return navigator.userAgent; } - function isLayoutViewport() { return !/^((?!chrome|android).)*safari/i.test(getUAString()); } - function getBoundingClientRect(element, includeScale, isFixedStrategy) { if (includeScale === void 0) { includeScale = false; } - if (isFixedStrategy === void 0) { isFixedStrategy = false; } - var clientRect = element.getBoundingClientRect(); var scaleX = 1; var scaleY = 1; - if (includeScale && isHTMLElement(element)) { scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; } - var _ref = isElement(element) ? getWindow(element) : window, - visualViewport = _ref.visualViewport; - + visualViewport = _ref.visualViewport; var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; @@ -1906,15 +2260,12 @@ var width = element.offsetWidth; var height = element.offsetHeight; - if (Math.abs(clientRect.width - width) <= 1) { width = clientRect.width; } - if (Math.abs(clientRect.height - height) <= 1) { height = clientRect.height; } - return { x: element.offsetLeft, y: element.offsetTop, @@ -1922,7 +2273,6 @@ height: height }; } - function contains(parent, child) { var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method @@ -1930,83 +2280,72 @@ return true; } // then fallback to custom implementation with Shadow DOM support else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - - do { - if (next && parent.isSameNode(next)) { - return true; - } // $FlowFixMe[prop-missing]: need a better way to handle this... - - - next = next.parentNode || next.host; - } while (next); - } // Give up, the result is false + var next = child; + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false return false; } - function getComputedStyle$1(element) { return getWindow(element).getComputedStyle(element); } - function isTableElement(element) { return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; } - function getDocumentElement(element) { // $FlowFixMe[incompatible-return]: assume body is always available - return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] + return ((isElement(element) ? element.ownerDocument : + // $FlowFixMe[prop-missing] element.document) || window.document).documentElement; } - function getParentNode(element) { if (getNodeName(element) === 'html') { return element; } - - return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + return ( + // this is a quicker (but less type safe) way to save quite some bytes from the bundle // $FlowFixMe[incompatible-return] // $FlowFixMe[prop-missing] - element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + element.assignedSlot || + // step into the shadow DOM of the parent of a slotted node + element.parentNode || ( + // DOM Element detected + isShadowRoot(element) ? element.host : null) || + // ShadowRoot detected // $FlowFixMe[incompatible-call]: HTMLElement is a Node getDocumentElement(element) // fallback - ); } - function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + if (!isHTMLElement(element) || + // https://github.com/popperjs/popper-core/issues/837 getComputedStyle$1(element).position === 'fixed') { return null; } - return element.offsetParent; } // `.offsetParent` reports `null` for fixed elements, while absolute elements // return the containing block - function getContainingBlock(element) { var isFirefox = /firefox/i.test(getUAString()); var isIE = /Trident/i.test(getUAString()); - if (isIE && isHTMLElement(element)) { // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport var elementCss = getComputedStyle$1(element); - if (elementCss.position === 'fixed') { return null; } } - var currentNode = getParentNode(element); - if (isShadowRoot(currentNode)) { currentNode = currentNode.host; } - while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that // create a containing block. @@ -2018,31 +2357,24 @@ currentNode = currentNode.parentNode; } } - return null; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. - function getOffsetParent(element) { var window = getWindow(element); var offsetParent = getTrueOffsetParent(element); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent); } - if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) { return window; } - return offsetParent || getContainingBlock(element) || window; } - function getMainAxisFromPlacement(placement) { return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; } - function within(min$1, value, max$1) { return max(min$1, min(value, max$1)); } @@ -2050,7 +2382,6 @@ var v = within(min, value, max); return v > max ? max : v; } - function getFreshSideObject() { return { top: 0, @@ -2059,42 +2390,35 @@ left: 0 }; } - function mergePaddingObject(paddingObject) { return Object.assign({}, getFreshSideObject(), paddingObject); } - function expandToHashMap(value, keys) { return keys.reduce(function (hashMap, key) { hashMap[key] = value; return hashMap; }, {}); } - var toPaddingObject = function toPaddingObject(padding, state) { padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { placement: state.placement })) : padding; return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); }; - function arrow(_ref) { var _state$modifiersData$; - var state = _ref.state, - name = _ref.name, - options = _ref.options; + name = _ref.name, + options = _ref.options; var arrowElement = state.elements.arrow; var popperOffsets = state.modifiersData.popperOffsets; var basePlacement = getBasePlacement(state.placement); var axis = getMainAxisFromPlacement(basePlacement); var isVertical = [left, right].indexOf(basePlacement) >= 0; var len = isVertical ? 'height' : 'width'; - if (!arrowElement || !popperOffsets) { return; } - var paddingObject = toPaddingObject(options.padding, state); var arrowRect = getLayoutRect(arrowElement); var minProp = axis === 'y' ? top : left; @@ -2114,35 +2438,28 @@ var axisProp = axis; state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); } - function effect$1(_ref2) { var state = _ref2.state, - options = _ref2.options; + options = _ref2.options; var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; - + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; if (arrowElement == null) { return; } // CSS selector - if (typeof arrowElement === 'string') { arrowElement = state.elements.popper.querySelector(arrowElement); - if (!arrowElement) { return; } } - if (!contains(state.elements.popper, arrowElement)) { return; } - state.elements.arrow = arrowElement; } // eslint-disable-next-line import/no-unused-modules - - const arrow$1 = { + var arrow$1 = { name: 'arrow', enabled: true, phase: 'main', @@ -2151,11 +2468,9 @@ requires: ['popperOffsets'], requiresIfExists: ['preventOverflow'] }; - function getVariation(placement) { return placement.split('-')[1]; } - var unsetSides = { top: 'auto', right: 'auto', @@ -2167,32 +2482,29 @@ function roundOffsetsByDPR(_ref, win) { var x = _ref.x, - y = _ref.y; + y = _ref.y; var dpr = win.devicePixelRatio || 1; return { x: round(x * dpr) / dpr || 0, y: round(y * dpr) / dpr || 0 }; } - function mapToStyles(_ref2) { var _Object$assign2; - var popper = _ref2.popper, - popperRect = _ref2.popperRect, - placement = _ref2.placement, - variation = _ref2.variation, - offsets = _ref2.offsets, - position = _ref2.position, - gpuAcceleration = _ref2.gpuAcceleration, - adaptive = _ref2.adaptive, - roundOffsets = _ref2.roundOffsets, - isFixed = _ref2.isFixed; + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets, + isFixed = _ref2.isFixed; var _offsets$x = offsets.x, - x = _offsets$x === void 0 ? 0 : _offsets$x, - _offsets$y = offsets.y, - y = _offsets$y === void 0 ? 0 : _offsets$y; - + x = _offsets$x === void 0 ? 0 : _offsets$x, + _offsets$y = offsets.y, + y = _offsets$y === void 0 ? 0 : _offsets$y; var _ref3 = typeof roundOffsets === 'function' ? roundOffsets({ x: x, y: y @@ -2200,7 +2512,6 @@ x: x, y: y }; - x = _ref3.x; y = _ref3.y; var hasX = offsets.hasOwnProperty('x'); @@ -2208,45 +2519,39 @@ var sideX = left; var sideY = top; var win = window; - if (adaptive) { var offsetParent = getOffsetParent(popper); var heightProp = 'clientHeight'; var widthProp = 'clientWidth'; - if (offsetParent === getWindow(popper)) { offsetParent = getDocumentElement(popper); - if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') { heightProp = 'scrollHeight'; widthProp = 'scrollWidth'; } } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it - offsetParent = offsetParent; - if (placement === top || (placement === left || placement === right) && variation === end) { sideY = bottom; - var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing] + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : + // $FlowFixMe[prop-missing] offsetParent[heightProp]; y -= offsetY - popperRect.height; y *= gpuAcceleration ? 1 : -1; } - if (placement === left || (placement === top || placement === bottom) && variation === end) { sideX = right; - var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing] + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : + // $FlowFixMe[prop-missing] offsetParent[widthProp]; x -= offsetX - popperRect.width; x *= gpuAcceleration ? 1 : -1; } } - var commonStyles = Object.assign({ position: position }, adaptive && unsetSides); - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ x: x, y: y @@ -2254,28 +2559,23 @@ x: x, y: y }; - x = _ref4.x; y = _ref4.y; - if (gpuAcceleration) { var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); } - function computeStyles(_ref5) { var state = _ref5.state, - options = _ref5.options; + options = _ref5.options; var _options$gpuAccelerat = options.gpuAcceleration, - gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, - _options$adaptive = options.adaptive, - adaptive = _options$adaptive === void 0 ? true : _options$adaptive, - _options$roundOffsets = options.roundOffsets, - roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; var commonStyles = { placement: getBasePlacement(state.placement), variation: getVariation(state.placement), @@ -2284,7 +2584,6 @@ gpuAcceleration: gpuAcceleration, isFixed: state.options.strategy === 'fixed' }; - if (state.modifiersData.popperOffsets != null) { state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { offsets: state.modifiersData.popperOffsets, @@ -2293,7 +2592,6 @@ roundOffsets: roundOffsets }))); } - if (state.modifiersData.arrow != null) { state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { offsets: state.modifiersData.arrow, @@ -2302,61 +2600,52 @@ roundOffsets: roundOffsets }))); } - state.attributes.popper = Object.assign({}, state.attributes.popper, { 'data-popper-placement': state.placement }); } // eslint-disable-next-line import/no-unused-modules - - const computeStyles$1 = { + var computeStyles$1 = { name: 'computeStyles', enabled: true, phase: 'beforeWrite', fn: computeStyles, data: {} }; - var passive = { passive: true }; - function effect(_ref) { var state = _ref.state, - instance = _ref.instance, - options = _ref.options; + instance = _ref.instance, + options = _ref.options; var _options$scroll = options.scroll, - scroll = _options$scroll === void 0 ? true : _options$scroll, - _options$resize = options.resize, - resize = _options$resize === void 0 ? true : _options$resize; + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; var window = getWindow(state.elements.popper); var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - if (scroll) { scrollParents.forEach(function (scrollParent) { scrollParent.addEventListener('scroll', instance.update, passive); }); } - if (resize) { window.addEventListener('resize', instance.update, passive); } - return function () { if (scroll) { scrollParents.forEach(function (scrollParent) { scrollParent.removeEventListener('scroll', instance.update, passive); }); } - if (resize) { window.removeEventListener('resize', instance.update, passive); } }; } // eslint-disable-next-line import/no-unused-modules - - const eventListeners = { + var eventListeners = { name: 'eventListeners', enabled: true, phase: 'write', @@ -2364,7 +2653,6 @@ effect: effect, data: {} }; - var hash$1 = { left: 'right', right: 'left', @@ -2376,7 +2664,6 @@ return hash$1[matched]; }); } - var hash = { start: 'end', end: 'start' @@ -2386,7 +2673,6 @@ return hash[matched]; }); } - function getWindowScroll(node) { var win = getWindow(node); var scrollLeft = win.pageXOffset; @@ -2396,7 +2682,6 @@ scrollTop: scrollTop }; } - function getWindowScrollBarX(element) { // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. @@ -2407,7 +2692,6 @@ // this (e.g. Edge 2019, IE11, Safari) return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; } - function getViewportRect(element, strategy) { var win = getWindow(element); var html = getDocumentElement(element); @@ -2416,18 +2700,15 @@ var height = html.clientHeight; var x = 0; var y = 0; - if (visualViewport) { width = visualViewport.width; height = visualViewport.height; var layoutViewport = isLayoutViewport(); - if (layoutViewport || !layoutViewport && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } - return { width: width, height: height, @@ -2440,7 +2721,6 @@ function getDocumentRect(element) { var _element$ownerDocumen; - var html = getDocumentElement(element); var winScroll = getWindowScroll(element); var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; @@ -2448,11 +2728,9 @@ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); var x = -winScroll.scrollLeft + getWindowScrollBarX(element); var y = -winScroll.scrollTop; - if (getComputedStyle$1(body || html).direction === 'rtl') { x += max(html.clientWidth, body ? body.clientWidth : 0) - width; } - return { width: width, height: height, @@ -2460,27 +2738,22 @@ y: y }; } - function isScrollParent(element) { // Firefox wants us to check `-x` and `-y` variations as well var _getComputedStyle = getComputedStyle$1(element), - overflow = _getComputedStyle.overflow, - overflowX = _getComputedStyle.overflowX, - overflowY = _getComputedStyle.overflowY; - + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); } - function getScrollParent(node) { if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { // $FlowFixMe[incompatible-return]: assume body is always available return node.ownerDocument.body; } - if (isHTMLElement(node) && isScrollParent(node)) { return node; } - return getScrollParent(getParentNode(node)); } @@ -2493,20 +2766,18 @@ function listScrollParents(element, list) { var _element$ownerDocumen; - if (list === void 0) { list = []; } - var scrollParent = getScrollParent(element); var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); var win = getWindow(scrollParent); var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; var updatedList = list.concat(target); - return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + return isBody ? updatedList : + // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here updatedList.concat(listScrollParents(getParentNode(target))); } - function rectToClientRect(rect) { return Object.assign({}, rect, { left: rect.x, @@ -2515,7 +2786,6 @@ bottom: rect.y + rect.height }); } - function getInnerBoundingClientRect(element, strategy) { var rect = getBoundingClientRect(element, false, strategy === 'fixed'); rect.top = rect.top + element.clientTop; @@ -2528,31 +2798,26 @@ rect.y = rect.top; return rect; } - function getClientRectFromMixedType(element, clippingParent, strategy) { return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); } // A "clipping parent" is an overflowable container with the characteristic of // clipping (or hiding) overflowing elements with a position different from // `initial` - function getClippingParents(element) { var clippingParents = listScrollParents(getParentNode(element)); var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0; var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; - if (!isElement(clipperElement)) { return []; } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 - return clippingParents.filter(function (clippingParent) { return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; }); } // Gets the maximum area that the element is visible in due to any number of // clipping parents - function getClippingRect(element, boundary, rootBoundary, strategy) { var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); var clippingParents = [].concat(mainClippingParents, [rootBoundary]); @@ -2571,17 +2836,15 @@ clippingRect.y = clippingRect.top; return clippingRect; } - function computeOffsets(_ref) { var reference = _ref.reference, - element = _ref.element, - placement = _ref.placement; + element = _ref.element, + placement = _ref.placement; var basePlacement = placement ? getBasePlacement(placement) : null; var variation = placement ? getVariation(placement) : null; var commonX = reference.x + reference.width / 2 - element.width / 2; var commonY = reference.y + reference.height / 2 - element.height / 2; var offsets; - switch (basePlacement) { case top: offsets = { @@ -2589,74 +2852,63 @@ y: reference.y - element.height }; break; - case bottom: offsets = { x: commonX, y: reference.y + reference.height }; break; - case right: offsets = { x: reference.x + reference.width, y: commonY }; break; - case left: offsets = { x: reference.x - element.width, y: commonY }; break; - default: offsets = { x: reference.x, y: reference.y }; } - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - if (mainAxis != null) { var len = mainAxis === 'y' ? 'height' : 'width'; - switch (variation) { case start: offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); break; - case end: offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); break; } } - return offsets; } - function detectOverflow(state, options) { if (options === void 0) { options = {}; } - var _options = options, - _options$placement = _options.placement, - placement = _options$placement === void 0 ? state.placement : _options$placement, - _options$strategy = _options.strategy, - strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, - _options$boundary = _options.boundary, - boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, - _options$rootBoundary = _options.rootBoundary, - rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, - _options$elementConte = _options.elementContext, - elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, - _options$altBoundary = _options.altBoundary, - altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, - _options$padding = _options.padding, - padding = _options$padding === void 0 ? 0 : _options$padding; + _options$placement = _options.placement, + placement = _options$placement === void 0 ? state.placement : _options$placement, + _options$strategy = _options.strategy, + strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, + _options$boundary = _options.boundary, + boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); var altContext = elementContext === popper ? reference : popper; var popperRect = state.rects.popper; @@ -2689,23 +2941,20 @@ overflowOffsets[key] += offset[axis] * multiply; }); } - return overflowOffsets; } - function computeAutoPlacement(state, options) { if (options === void 0) { options = {}; } - var _options = options, - placement = _options.placement, - boundary = _options.boundary, - rootBoundary = _options.rootBoundary, - padding = _options.padding, - flipVariations = _options.flipVariations, - _options$allowedAutoP = _options.allowedAutoPlacements, - allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; var variation = getVariation(placement); var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { return getVariation(placement) === variation; @@ -2713,12 +2962,10 @@ var allowedPlacements = placements$1.filter(function (placement) { return allowedAutoPlacements.indexOf(placement) >= 0; }); - if (allowedPlacements.length === 0) { allowedPlacements = placements$1; } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... - var overflows = allowedPlacements.reduce(function (acc, placement) { acc[placement] = detectOverflow(state, { placement: placement, @@ -2732,37 +2979,32 @@ return overflows[a] - overflows[b]; }); } - function getExpandedFallbackPlacements(placement) { if (getBasePlacement(placement) === auto) { return []; } - var oppositePlacement = getOppositePlacement(placement); return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; } - function flip(_ref) { var state = _ref.state, - options = _ref.options, - name = _ref.name; - + options = _ref.options, + name = _ref.name; if (state.modifiersData[name]._skip) { return; } - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, - specifiedFallbackPlacements = options.fallbackPlacements, - padding = options.padding, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - _options$flipVariatio = options.flipVariations, - flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, - allowedAutoPlacements = options.allowedAutoPlacements; + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; var preferredPlacement = state.options.placement; var basePlacement = getBasePlacement(preferredPlacement); var isBasePlacement = basePlacement === preferredPlacement; @@ -2782,12 +3024,9 @@ var checksMap = new Map(); var makeFallbackChecks = true; var firstFittingPlacement = placements[0]; - for (var i = 0; i < placements.length; i++) { var placement = placements[i]; - var _basePlacement = getBasePlacement(placement); - var isStartVariation = getVariation(placement) === start; var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; var len = isVertical ? 'width' : 'height'; @@ -2799,22 +3038,17 @@ padding: padding }); var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; - if (referenceRect[len] > popperRect[len]) { mainVariationSide = getOppositePlacement(mainVariationSide); } - var altVariationSide = getOppositePlacement(mainVariationSide); var checks = []; - if (checkMainAxis) { checks.push(overflow[_basePlacement] <= 0); } - if (checkAltAxis) { checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); } - if (checks.every(function (check) { return check; })) { @@ -2822,38 +3056,30 @@ makeFallbackChecks = false; break; } - checksMap.set(placement, checks); } - if (makeFallbackChecks) { // `2` may be desired in some cases – research later var numberOfChecks = flipVariations ? 3 : 1; - var _loop = function _loop(_i) { var fittingPlacement = placements.find(function (placement) { var checks = checksMap.get(placement); - if (checks) { return checks.slice(0, _i).every(function (check) { return check; }); } }); - if (fittingPlacement) { firstFittingPlacement = fittingPlacement; return "break"; } }; - for (var _i = numberOfChecks; _i > 0; _i--) { var _ret = _loop(_i); - if (_ret === "break") break; } } - if (state.placement !== firstFittingPlacement) { state.modifiersData[name]._skip = true; state.placement = firstFittingPlacement; @@ -2861,8 +3087,7 @@ } } // eslint-disable-next-line import/no-unused-modules - - const flip$1 = { + var flip$1 = { name: 'flip', enabled: true, phase: 'main', @@ -2872,7 +3097,6 @@ _skip: false } }; - function getSideOffsets(overflow, rect, preventedOffsets) { if (preventedOffsets === void 0) { preventedOffsets = { @@ -2880,7 +3104,6 @@ y: 0 }; } - return { top: overflow.top - rect.height - preventedOffsets.y, right: overflow.right - rect.width + preventedOffsets.x, @@ -2888,16 +3111,14 @@ left: overflow.left - rect.width - preventedOffsets.x }; } - function isAnySideFullyClipped(overflow) { return [top, right, bottom, left].some(function (side) { return overflow[side] >= 0; }); } - function hide(_ref) { var state = _ref.state, - name = _ref.name; + name = _ref.name; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var preventedOffsets = state.modifiersData.preventOverflow; @@ -2923,25 +3144,21 @@ }); } // eslint-disable-next-line import/no-unused-modules - - const hide$1 = { + var hide$1 = { name: 'hide', enabled: true, phase: 'main', requiresIfExists: ['preventOverflow'], fn: hide }; - function distanceAndSkiddingToXY(placement, rects, offset) { var basePlacement = getBasePlacement(placement); var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { - placement: placement - })) : offset, - skidding = _ref[0], - distance = _ref[1]; - + placement: placement + })) : offset, + skidding = _ref[0], + distance = _ref[1]; skidding = skidding || 0; distance = (distance || 0) * invertDistance; return [left, right].indexOf(basePlacement) >= 0 ? { @@ -2952,41 +3169,36 @@ y: distance }; } - function offset(_ref2) { var state = _ref2.state, - options = _ref2.options, - name = _ref2.name; + options = _ref2.options, + name = _ref2.name; var _options$offset = options.offset, - offset = _options$offset === void 0 ? [0, 0] : _options$offset; + offset = _options$offset === void 0 ? [0, 0] : _options$offset; var data = placements.reduce(function (acc, placement) { acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); return acc; }, {}); var _data$state$placement = data[state.placement], - x = _data$state$placement.x, - y = _data$state$placement.y; - + x = _data$state$placement.x, + y = _data$state$placement.y; if (state.modifiersData.popperOffsets != null) { state.modifiersData.popperOffsets.x += x; state.modifiersData.popperOffsets.y += y; } - state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules - - const offset$1 = { + var offset$1 = { name: 'offset', enabled: true, phase: 'main', requires: ['popperOffsets'], fn: offset }; - function popperOffsets(_ref) { var state = _ref.state, - name = _ref.name; + name = _ref.name; // Offsets are the actual position the popper needs to have to be // properly positioned near its reference element // This is the most basic placement, and will be adjusted by @@ -2999,35 +3211,32 @@ }); } // eslint-disable-next-line import/no-unused-modules - - const popperOffsets$1 = { + var popperOffsets$1 = { name: 'popperOffsets', enabled: true, phase: 'read', fn: popperOffsets, data: {} }; - function getAltAxis(axis) { return axis === 'x' ? 'y' : 'x'; } - function preventOverflow(_ref) { var state = _ref.state, - options = _ref.options, - name = _ref.name; + options = _ref.options, + name = _ref.name; var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - padding = options.padding, - _options$tether = options.tether, - tether = _options$tether === void 0 ? true : _options$tether, - _options$tetherOffset = options.tetherOffset, - tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; var overflow = detectOverflow(state, { boundary: boundary, rootBoundary: rootBoundary, @@ -3057,14 +3266,11 @@ x: 0, y: 0 }; - if (!popperOffsets) { return; } - if (checkMainAxis) { var _offsetModifierState$; - var mainSide = mainAxis === 'y' ? top : left; var altSide = mainAxis === 'y' ? bottom : right; var len = mainAxis === 'y' ? 'height' : 'width'; @@ -3101,55 +3307,38 @@ popperOffsets[mainAxis] = preventedOffset; data[mainAxis] = preventedOffset - offset; } - if (checkAltAxis) { var _offsetModifierState$2; - var _mainSide = mainAxis === 'x' ? top : left; - var _altSide = mainAxis === 'x' ? bottom : right; - var _offset = popperOffsets[altAxis]; - var _len = altAxis === 'y' ? 'height' : 'width'; - var _min = _offset + overflow[_mainSide]; - var _max = _offset - overflow[_altSide]; - var isOriginSide = [top, left].indexOf(basePlacement) !== -1; - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - popperOffsets[altAxis] = _preventedOffset; data[altAxis] = _preventedOffset - _offset; } - state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules - - const preventOverflow$1 = { + var preventOverflow$1 = { name: 'preventOverflow', enabled: true, phase: 'main', fn: preventOverflow, requiresIfExists: ['offset'] }; - function getHTMLElementScroll(element) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } - function getNodeScroll(node) { if (node === getWindow(node) || !isHTMLElement(node)) { return getWindowScroll(node); @@ -3157,7 +3346,6 @@ return getHTMLElementScroll(node); } } - function isElementScaled(element) { var rect = element.getBoundingClientRect(); var scaleX = round(rect.width) / element.offsetWidth || 1; @@ -3166,12 +3354,10 @@ } // Returns the composite rect of an element relative to its offsetParent. // Composite means it takes into account transforms as well as layout. - function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { if (isFixed === void 0) { isFixed = false; } - var isOffsetParentAnElement = isHTMLElement(offsetParent); var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); var documentElement = getDocumentElement(offsetParent); @@ -3184,13 +3370,12 @@ x: 0, y: 0 }; - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 + if (getNodeName(offsetParent) !== 'body' || + // https://github.com/popperjs/popper-core/issues/1078 isScrollParent(documentElement)) { scroll = getNodeScroll(offsetParent); } - if (isHTMLElement(offsetParent)) { offsets = getBoundingClientRect(offsetParent, true); offsets.x += offsetParent.clientLeft; @@ -3199,7 +3384,6 @@ offsets.x = getWindowScrollBarX(documentElement); } } - return { x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, @@ -3207,7 +3391,6 @@ height: rect.height }; } - function order(modifiers) { var map = new Map(); var visited = new Set(); @@ -3222,7 +3405,6 @@ requires.forEach(function (dep) { if (!visited.has(dep)) { var depModifier = map.get(dep); - if (depModifier) { sort(depModifier); } @@ -3230,7 +3412,6 @@ }); result.push(modifier); } - modifiers.forEach(function (modifier) { if (!visited.has(modifier.name)) { // check for visited object @@ -3239,7 +3420,6 @@ }); return result; } - function orderModifiers(modifiers) { // order based on dependencies var orderedModifiers = order(modifiers); // order based on phase @@ -3250,7 +3430,6 @@ })); }, []); } - function debounce(fn) { var pending; return function () { @@ -3262,11 +3441,9 @@ }); }); } - return pending; }; } - function mergeByName(modifiers) { var merged = modifiers.reduce(function (merged, current) { var existing = merged[current.name]; @@ -3281,38 +3458,32 @@ return merged[key]; }); } - var DEFAULT_OPTIONS = { placement: 'bottom', modifiers: [], strategy: 'absolute' }; - function areValidElements() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } - return !args.some(function (element) { return !(element && typeof element.getBoundingClientRect === 'function'); }); } - function popperGenerator(generatorOptions) { if (generatorOptions === void 0) { generatorOptions = {}; } - var _generatorOptions = generatorOptions, - _generatorOptions$def = _generatorOptions.defaultModifiers, - defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, - _generatorOptions$def2 = _generatorOptions.defaultOptions, - defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; return function createPopper(reference, popper, options) { if (options === void 0) { options = defaultOptions; } - var state = { placement: 'bottom', orderedModifiers: [], @@ -3356,17 +3527,15 @@ if (isDestroyed) { return; } - var _state$elements = state.elements, - reference = _state$elements.reference, - popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements // anymore if (!areValidElements(reference, popper)) { return; } // Store the reference and popper rects to be read by modifiers - state.rects = { reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), popper: getLayoutRect(popper) @@ -3385,20 +3554,17 @@ state.orderedModifiers.forEach(function (modifier) { return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); }); - for (var index = 0; index < state.orderedModifiers.length; index++) { if (state.reset === true) { state.reset = false; index = -1; continue; } - var _state$orderedModifie = state.orderedModifiers[index], - fn = _state$orderedModifie.fn, - _state$orderedModifie2 = _state$orderedModifie.options, - _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, - name = _state$orderedModifie.name; - + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; if (typeof fn === 'function') { state = fn({ state: state, @@ -3422,11 +3588,9 @@ isDestroyed = true; } }; - if (!areValidElements(reference, popper)) { return instance; } - instance.setOptions(options).then(function (state) { if (!isDestroyed && options.onFirstUpdate) { options.onFirstUpdate(state); @@ -3440,10 +3604,9 @@ function runModifierEffects() { state.orderedModifiers.forEach(function (_ref) { var name = _ref.name, - _ref$options = _ref.options, - options = _ref$options === void 0 ? {} : _ref$options, - effect = _ref.effect; - + _ref$options = _ref.options, + options = _ref$options === void 0 ? {} : _ref$options, + effect = _ref.effect; if (typeof effect === 'function') { var cleanupFn = effect({ state: state, @@ -3451,21 +3614,17 @@ instance: instance, options: options }); - var noopFn = function noopFn() {}; - effectCleanupFns.push(cleanupFn || noopFn); } }); } - function cleanupModifierEffects() { effectCleanupFns.forEach(function (fn) { return fn(); }); effectCleanupFns = []; } - return instance; }; } @@ -3481,47 +3640,49 @@ defaultModifiers: defaultModifiers }); // eslint-disable-next-line import/no-unused-modules - const Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ + var Popper = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({ __proto__: null, - afterMain, - afterRead, - afterWrite, + afterMain: afterMain, + afterRead: afterRead, + afterWrite: afterWrite, applyStyles: applyStyles$1, arrow: arrow$1, - auto, - basePlacements, - beforeMain, - beforeRead, - beforeWrite, - bottom, - clippingParents, + auto: auto, + basePlacements: basePlacements, + beforeMain: beforeMain, + beforeRead: beforeRead, + beforeWrite: beforeWrite, + bottom: bottom, + clippingParents: clippingParents, computeStyles: computeStyles$1, - createPopper, + createPopper: createPopper, createPopperBase: createPopper$2, createPopperLite: createPopper$1, - detectOverflow, - end, - eventListeners, + detectOverflow: detectOverflow, + end: end, + eventListeners: eventListeners, flip: flip$1, hide: hide$1, - left, - main, - modifierPhases, + left: left, + main: main, + modifierPhases: modifierPhases, offset: offset$1, - placements, - popper, - popperGenerator, + placements: placements, + popper: popper, + popperGenerator: popperGenerator, popperOffsets: popperOffsets$1, preventOverflow: preventOverflow$1, - read, - reference, - right, - start, - top, - variationPlacements, - viewport, - write - }, Symbol.toStringTag, { value: 'Module' })); + read: read, + reference: reference, + right: right, + start: start, + top: top, + variationPlacements: variationPlacements, + viewport: viewport, + write: write + }, Symbol.toStringTag, { + value: 'Module' + })); /** * -------------------------------------------------------------------------- @@ -3530,49 +3691,48 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$a = 'dropdown'; - const DATA_KEY$6 = 'bs.dropdown'; - const EVENT_KEY$6 = `.${DATA_KEY$6}`; - const DATA_API_KEY$3 = '.data-api'; - const ESCAPE_KEY$2 = 'Escape'; - const TAB_KEY$1 = 'Tab'; - const ARROW_UP_KEY$1 = 'ArrowUp'; - const ARROW_DOWN_KEY$1 = 'ArrowDown'; - const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button - - const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; - const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; - const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; - const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; - const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; - const CLASS_NAME_SHOW$6 = 'show'; - const CLASS_NAME_DROPUP = 'dropup'; - const CLASS_NAME_DROPEND = 'dropend'; - const CLASS_NAME_DROPSTART = 'dropstart'; - const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; - const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; - const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; - const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; - const SELECTOR_MENU = '.dropdown-menu'; - const SELECTOR_NAVBAR = '.navbar'; - const SELECTOR_NAVBAR_NAV = '.navbar-nav'; - const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; - const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; - const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; - const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; - const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; - const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; - const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; - const PLACEMENT_TOPCENTER = 'top'; - const PLACEMENT_BOTTOMCENTER = 'bottom'; - const Default$9 = { + var NAME$a = 'dropdown'; + var DATA_KEY$6 = 'bs.dropdown'; + var EVENT_KEY$6 = ".".concat(DATA_KEY$6); + var DATA_API_KEY$3 = '.data-api'; + var ESCAPE_KEY$2 = 'Escape'; + var TAB_KEY$1 = 'Tab'; + var ARROW_UP_KEY$1 = 'ArrowUp'; + var ARROW_DOWN_KEY$1 = 'ArrowDown'; + var RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button + + var EVENT_HIDE$5 = "hide".concat(EVENT_KEY$6); + var EVENT_HIDDEN$5 = "hidden".concat(EVENT_KEY$6); + var EVENT_SHOW$5 = "show".concat(EVENT_KEY$6); + var EVENT_SHOWN$5 = "shown".concat(EVENT_KEY$6); + var EVENT_CLICK_DATA_API$3 = "click".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var EVENT_KEYDOWN_DATA_API = "keydown".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var EVENT_KEYUP_DATA_API = "keyup".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var CLASS_NAME_SHOW$6 = 'show'; + var CLASS_NAME_DROPUP = 'dropup'; + var CLASS_NAME_DROPEND = 'dropend'; + var CLASS_NAME_DROPSTART = 'dropstart'; + var CLASS_NAME_DROPUP_CENTER = 'dropup-center'; + var CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; + var SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; + var SELECTOR_DATA_TOGGLE_SHOWN = "".concat(SELECTOR_DATA_TOGGLE$3, ".").concat(CLASS_NAME_SHOW$6); + var SELECTOR_MENU = '.dropdown-menu'; + var SELECTOR_NAVBAR = '.navbar'; + var SELECTOR_NAVBAR_NAV = '.navbar-nav'; + var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; + var PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; + var PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; + var PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; + var PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; + var PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; + var PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; + var PLACEMENT_TOPCENTER = 'top'; + var PLACEMENT_BOTTOMCENTER = 'bottom'; + var Default$9 = { autoClose: true, boundary: 'clippingParents', display: 'dynamic', @@ -3580,7 +3740,7 @@ popperConfig: null, reference: 'toggle' }; - const DefaultType$9 = { + var DefaultType$9 = { autoClose: '(boolean|string)', boundary: '(string|element)', display: 'string', @@ -3592,290 +3752,362 @@ /** * Class definition */ - - class Dropdown extends BaseComponent { - constructor(element, config) { - super(element, config); - this._popper = null; - this._parent = this._element.parentNode; // dropdown wrapper + var Dropdown = /*#__PURE__*/function (_BaseComponent5) { + function Dropdown(element, config) { + var _this15; + _classCallCheck(this, Dropdown); + _this15 = _callSuper(this, Dropdown, [element, config]); + _this15._popper = null; + _this15._parent = _this15._element.parentNode; // dropdown wrapper // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); - this._inNavbar = this._detectNavbar(); + _this15._menu = SelectorEngine.next(_this15._element, SELECTOR_MENU)[0] || SelectorEngine.prev(_this15._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, _this15._parent); + _this15._inNavbar = _this15._detectNavbar(); + return _this15; } // Getters - static get Default() { - return Default$9; - } - static get DefaultType() { - return DefaultType$9; - } - static get NAME() { - return NAME$a; - } - - // Public - toggle() { - return this._isShown() ? this.hide() : this.show(); - } - show() { - if (isDisabled(this._element) || this._isShown()) { - return; + _inherits(Dropdown, _BaseComponent5); + return _createClass(Dropdown, [{ + key: "toggle", + value: + // Public + function toggle() { + return this._isShown() ? this.hide() : this.show(); + } + }, { + key: "show", + value: function show() { + if (isDisabled(this._element) || this._isShown()) { + return; + } + var relatedTarget = { + relatedTarget: this._element + }; + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); + if (showEvent.defaultPrevented) { + return; + } + this._createPopper(); + + // 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 && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { + var _ref9; + var _iterator12 = _createForOfIteratorHelper((_ref9 = []).concat.apply(_ref9, _toConsumableArray(document.body.children))), + _step12; + try { + for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) { + var element = _step12.value; + EventHandler.on(element, 'mouseover', noop); + } + } catch (err) { + _iterator12.e(err); + } finally { + _iterator12.f(); + } + } + this._element.focus(); + this._element.setAttribute('aria-expanded', true); + this._menu.classList.add(CLASS_NAME_SHOW$6); + this._element.classList.add(CLASS_NAME_SHOW$6); + EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); + } + }, { + key: "hide", + value: function hide() { + if (isDisabled(this._element) || !this._isShown()) { + return; + } + var relatedTarget = { + relatedTarget: this._element + }; + this._completeHide(relatedTarget); } - const relatedTarget = { - relatedTarget: this._element - }; - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); - if (showEvent.defaultPrevented) { - return; + }, { + key: "dispose", + value: function dispose() { + if (this._popper) { + this._popper.destroy(); + } + _superPropGet(Dropdown, "dispose", this, 3)([]); + } + }, { + key: "update", + value: function update() { + this._inNavbar = this._detectNavbar(); + if (this._popper) { + this._popper.update(); + } } - this._createPopper(); - // 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 && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); + // Private + }, { + key: "_completeHide", + value: function _completeHide(relatedTarget) { + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); + if (hideEvent.defaultPrevented) { + return; } - } - this._element.focus(); - this._element.setAttribute('aria-expanded', true); - this._menu.classList.add(CLASS_NAME_SHOW$6); - this._element.classList.add(CLASS_NAME_SHOW$6); - EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); - } - hide() { - if (isDisabled(this._element) || !this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - this._completeHide(relatedTarget); - } - dispose() { - if (this._popper) { - this._popper.destroy(); - } - super.dispose(); - } - update() { - this._inNavbar = this._detectNavbar(); - if (this._popper) { - this._popper.update(); - } - } - // Private - _completeHide(relatedTarget) { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); - if (hideEvent.defaultPrevented) { - return; + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + var _ref10; + var _iterator13 = _createForOfIteratorHelper((_ref10 = []).concat.apply(_ref10, _toConsumableArray(document.body.children))), + _step13; + try { + for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { + var element = _step13.value; + EventHandler.off(element, 'mouseover', noop); + } + } catch (err) { + _iterator13.e(err); + } finally { + _iterator13.f(); + } + } + if (this._popper) { + this._popper.destroy(); + } + this._menu.classList.remove(CLASS_NAME_SHOW$6); + this._element.classList.remove(CLASS_NAME_SHOW$6); + this._element.setAttribute('aria-expanded', 'false'); + Manipulator.removeDataAttribute(this._menu, 'popper'); + EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + config = _superPropGet(Dropdown, "_getConfig", this, 3)([config]); + if (_typeof(config.reference) === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { + // Popper virtual elements require a getBoundingClientRect method + throw new TypeError("".concat(NAME$a.toUpperCase(), ": Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.")); + } + return config; } + }, { + key: "_createPopper", + value: function _createPopper() { + 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 = this._parent; + } else if (isElement$1(this._config.reference)) { + referenceElement = getElement(this._config.reference); + } else if (_typeof(this._config.reference) === 'object') { + referenceElement = this._config.reference; + } + var popperConfig = this._getPopperConfig(); + this._popper = createPopper(referenceElement, this._menu, popperConfig); + } + }, { + key: "_isShown", + value: function _isShown() { + return this._menu.classList.contains(CLASS_NAME_SHOW$6); + } + }, { + key: "_getPlacement", + value: function _getPlacement() { + var parentDropdown = this._parent; + if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { + return PLACEMENT_RIGHT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { + return PLACEMENT_LEFT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { + return PLACEMENT_TOPCENTER; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { + return PLACEMENT_BOTTOMCENTER; + } - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); + // We need to trim the value because custom properties can also include spaces + var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { + return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; } - } - if (this._popper) { - this._popper.destroy(); - } - this._menu.classList.remove(CLASS_NAME_SHOW$6); - this._element.classList.remove(CLASS_NAME_SHOW$6); - this._element.setAttribute('aria-expanded', 'false'); - Manipulator.removeDataAttribute(this._menu, 'popper'); - EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); - } - _getConfig(config) { - config = super._getConfig(config); - if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { - // Popper virtual elements require a getBoundingClientRect method - throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); - } - return config; - } - _createPopper() { - if (typeof Popper === 'undefined') { - throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); - } - let referenceElement = this._element; - if (this._config.reference === 'parent') { - referenceElement = this._parent; - } else if (isElement$1(this._config.reference)) { - referenceElement = getElement(this._config.reference); - } else if (typeof this._config.reference === 'object') { - referenceElement = this._config.reference; - } - const popperConfig = this._getPopperConfig(); - this._popper = createPopper(referenceElement, this._menu, popperConfig); - } - _isShown() { - return this._menu.classList.contains(CLASS_NAME_SHOW$6); - } - _getPlacement() { - const parentDropdown = this._parent; - if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { - return PLACEMENT_RIGHT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { - return PLACEMENT_LEFT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { - return PLACEMENT_TOPCENTER; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { - return PLACEMENT_BOTTOMCENTER; - } + return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; + } + }, { + key: "_detectNavbar", + value: function _detectNavbar() { + return this._element.closest(SELECTOR_NAVBAR) !== null; + } + }, { + key: "_getOffset", + value: function _getOffset() { + var _this16 = this; + var offset = this._config.offset; + if (typeof offset === 'string') { + return offset.split(',').map(function (value) { + return Number.parseInt(value, 10); + }); + } + if (typeof offset === 'function') { + return function (popperData) { + return offset(popperData, _this16._element); + }; + } + return offset; + } + }, { + key: "_getPopperConfig", + value: function _getPopperConfig() { + var defaultBsPopperConfig = { + placement: this._getPlacement(), + modifiers: [{ + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }] + }; - // We need to trim the value because custom properties can also include spaces - const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { - return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; - } - return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; - } - _detectNavbar() { - return this._element.closest(SELECTOR_NAVBAR) !== null; - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _getPopperConfig() { - const defaultBsPopperConfig = { - placement: this._getPlacement(), - modifiers: [{ - name: 'preventOverflow', - options: { - boundary: this._config.boundary + // Disable Popper if we have a static display or Dropdown is in Navbar + if (this._inNavbar || this._config.display === 'static') { + Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove + defaultBsPopperConfig.modifiers = [{ + name: 'applyStyles', + enabled: false + }]; + } + return _objectSpread(_objectSpread({}, defaultBsPopperConfig), execute(this._config.popperConfig, [defaultBsPopperConfig])); + } + }, { + key: "_selectMenuItem", + value: function _selectMenuItem(_ref11) { + var key = _ref11.key, + target = _ref11.target; + var items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(function (element) { + return isVisible(element); + }); + if (!items.length) { + return; + } + + // if target isn't included in items (e.g. when expanding the dropdown) + // allow cycling to get the last item in case key equals ARROW_UP_KEY + getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$9; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$9; + } + }, { + key: "NAME", + get: function get() { + return NAME$a; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Dropdown.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; } - }, { - name: 'offset', - options: { - offset: this._getOffset() + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); } - }] - }; - - // Disable Popper if we have a static display or Dropdown is in Navbar - if (this._inNavbar || this._config.display === 'static') { - Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove - defaultBsPopperConfig.modifiers = [{ - name: 'applyStyles', - enabled: false - }]; - } - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _selectMenuItem({ - key, - target - }) { - const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); - if (!items.length) { - return; + data[config](); + }); } - - // if target isn't included in items (e.g. when expanding the dropdown) - // allow cycling to get the last item in case key equals ARROW_UP_KEY - getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Dropdown.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "clearMenus", + value: function clearMenus(event) { + if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + var openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); + var _iterator14 = _createForOfIteratorHelper(openToggles), + _step14; + try { + for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) { + var toggle = _step14.value; + var context = Dropdown.getInstance(toggle); + if (!context || context._config.autoClose === false) { + continue; + } + var composedPath = event.composedPath(); + var isMenuTarget = composedPath.includes(context._menu); + if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { + continue; + } + + // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu + if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { + continue; + } + var relatedTarget = { + relatedTarget: context._element + }; + if (event.type === 'click') { + relatedTarget.clickEvent = event; + } + context._completeHide(relatedTarget); + } + } catch (err) { + _iterator14.e(err); + } finally { + _iterator14.f(); } - data[config](); - }); - } - static clearMenus(event) { - if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { - return; } - const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); - for (const toggle of openToggles) { - const context = Dropdown.getInstance(toggle); - if (!context || context._config.autoClose === false) { - continue; + }, { + key: "dataApiKeydownHandler", + value: function dataApiKeydownHandler(event) { + // If not an UP | DOWN | ESCAPE key => not a dropdown command + // If input/textarea && if key is other than ESCAPE => not a dropdown command + + var isInput = /input|textarea/i.test(event.target.tagName); + var isEscapeEvent = event.key === ESCAPE_KEY$2; + var isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); + if (!isUpOrDownEvent && !isEscapeEvent) { + return; } - const composedPath = event.composedPath(); - const isMenuTarget = composedPath.includes(context._menu); - if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { - continue; + if (isInput && !isEscapeEvent) { + return; } + event.preventDefault(); - // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu - if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { - continue; + // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ + var getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); + var instance = Dropdown.getOrCreateInstance(getToggleButton); + if (isUpOrDownEvent) { + event.stopPropagation(); + instance.show(); + instance._selectMenuItem(event); + return; } - const relatedTarget = { - relatedTarget: context._element - }; - if (event.type === 'click') { - relatedTarget.clickEvent = event; + if (instance._isShown()) { + // else is escape and we check if it is shown + event.stopPropagation(); + instance.hide(); + getToggleButton.focus(); } - context._completeHide(relatedTarget); - } - } - static dataApiKeydownHandler(event) { - // If not an UP | DOWN | ESCAPE key => not a dropdown command - // If input/textarea && if key is other than ESCAPE => not a dropdown command - - const isInput = /input|textarea/i.test(event.target.tagName); - const isEscapeEvent = event.key === ESCAPE_KEY$2; - const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); - if (!isUpOrDownEvent && !isEscapeEvent) { - return; - } - if (isInput && !isEscapeEvent) { - return; } - event.preventDefault(); - - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); - const instance = Dropdown.getOrCreateInstance(getToggleButton); - if (isUpOrDownEvent) { - event.stopPropagation(); - instance.show(); - instance._selectMenuItem(event); - return; - } - if (instance._isShown()) { - // else is escape and we check if it is shown - event.stopPropagation(); - instance.hide(); - getToggleButton.focus(); - } - } - } - + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); @@ -3898,16 +4130,15 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$9 = 'backdrop'; - const CLASS_NAME_FADE$4 = 'fade'; - const CLASS_NAME_SHOW$5 = 'show'; - const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; - const Default$8 = { + var NAME$9 = 'backdrop'; + var CLASS_NAME_FADE$4 = 'fade'; + var CLASS_NAME_SHOW$5 = 'show'; + var EVENT_MOUSEDOWN = "mousedown.bs.".concat(NAME$9); + var Default$8 = { className: 'modal-backdrop', clickCallback: null, isAnimated: false, @@ -3915,7 +4146,7 @@ // if false, we use the backdrop helper without adding any element to the dom rootElement: 'body' // give the choice to place backdrop under different elements }; - const DefaultType$8 = { + var DefaultType$8 = { className: 'string', clickCallback: '(function|null)', isAnimated: 'boolean', @@ -3926,120 +4157,142 @@ /** * Class definition */ - - class Backdrop extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isAppended = false; - this._element = null; + var Backdrop = /*#__PURE__*/function (_Config3) { + function Backdrop(config) { + var _this17; + _classCallCheck(this, Backdrop); + _this17 = _callSuper(this, Backdrop); + _this17._config = _this17._getConfig(config); + _this17._isAppended = false; + _this17._element = null; + return _this17; } // Getters - static get Default() { - return Default$8; - } - static get DefaultType() { - return DefaultType$8; - } - static get NAME() { - return NAME$9; - } - - // Public - show(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._append(); - const element = this._getElement(); - if (this._config.isAnimated) { - reflow(element); + _inherits(Backdrop, _Config3); + return _createClass(Backdrop, [{ + key: "show", + value: + // Public + function show(callback) { + if (!this._config.isVisible) { + execute(callback); + return; + } + this._append(); + var element = this._getElement(); + if (this._config.isAnimated) { + reflow(element); + } + element.classList.add(CLASS_NAME_SHOW$5); + this._emulateAnimation(function () { + execute(callback); + }); } - element.classList.add(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - execute(callback); - }); - } - hide(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._getElement().classList.remove(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - this.dispose(); - execute(callback); - }); - } - dispose() { - if (!this._isAppended) { - return; - } - EventHandler.off(this._element, EVENT_MOUSEDOWN); - this._element.remove(); - this._isAppended = false; - } - - // Private - _getElement() { - if (!this._element) { - const backdrop = document.createElement('div'); - backdrop.className = this._config.className; - if (this._config.isAnimated) { - backdrop.classList.add(CLASS_NAME_FADE$4); + }, { + key: "hide", + value: function hide(callback) { + var _this18 = this; + if (!this._config.isVisible) { + execute(callback); + return; } - this._element = backdrop; + this._getElement().classList.remove(CLASS_NAME_SHOW$5); + this._emulateAnimation(function () { + _this18.dispose(); + execute(callback); + }); } - return this._element; - } - _configAfterMerge(config) { - // use getElement() with the default "body" to get a fresh Element on each instantiation - config.rootElement = getElement(config.rootElement); - return config; - } - _append() { - if (this._isAppended) { - return; + }, { + key: "dispose", + value: function dispose() { + if (!this._isAppended) { + return; + } + EventHandler.off(this._element, EVENT_MOUSEDOWN); + this._element.remove(); + this._isAppended = false; } - const element = this._getElement(); - this._config.rootElement.append(element); - EventHandler.on(element, EVENT_MOUSEDOWN, () => { - execute(this._config.clickCallback); - }); - this._isAppended = true; - } - _emulateAnimation(callback) { - executeAfterTransition(callback, this._getElement(), this._config.isAnimated); - } - } + // Private + }, { + key: "_getElement", + value: function _getElement() { + if (!this._element) { + var backdrop = document.createElement('div'); + backdrop.className = this._config.className; + if (this._config.isAnimated) { + backdrop.classList.add(CLASS_NAME_FADE$4); + } + this._element = backdrop; + } + return this._element; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + // use getElement() with the default "body" to get a fresh Element on each instantiation + config.rootElement = getElement(config.rootElement); + return config; + } + }, { + key: "_append", + value: function _append() { + var _this19 = this; + if (this._isAppended) { + return; + } + var element = this._getElement(); + this._config.rootElement.append(element); + EventHandler.on(element, EVENT_MOUSEDOWN, function () { + execute(_this19._config.clickCallback); + }); + this._isAppended = true; + } + }, { + key: "_emulateAnimation", + value: function _emulateAnimation(callback) { + executeAfterTransition(callback, this._getElement(), this._config.isAnimated); + } + }], [{ + key: "Default", + get: function get() { + return Default$8; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$8; + } + }, { + key: "NAME", + get: function get() { + return NAME$9; + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap util/focustrap.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$8 = 'focustrap'; - const DATA_KEY$5 = 'bs.focustrap'; - const EVENT_KEY$5 = `.${DATA_KEY$5}`; - const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; - const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; - const TAB_KEY = 'Tab'; - const TAB_NAV_FORWARD = 'forward'; - const TAB_NAV_BACKWARD = 'backward'; - const Default$7 = { + var NAME$8 = 'focustrap'; + var DATA_KEY$5 = 'bs.focustrap'; + var EVENT_KEY$5 = ".".concat(DATA_KEY$5); + var EVENT_FOCUSIN$2 = "focusin".concat(EVENT_KEY$5); + var EVENT_KEYDOWN_TAB = "keydown.tab".concat(EVENT_KEY$5); + var TAB_KEY = 'Tab'; + var TAB_NAV_FORWARD = 'forward'; + var TAB_NAV_BACKWARD = 'backward'; + var Default$7 = { autofocus: true, trapElement: null // The element to trap focus inside of }; - const DefaultType$7 = { + var DefaultType$7 = { autofocus: 'boolean', trapElement: 'element' }; @@ -4047,211 +4300,259 @@ /** * Class definition */ - - class FocusTrap extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isActive = false; - this._lastTabNavDirection = null; + var FocusTrap = /*#__PURE__*/function (_Config4) { + function FocusTrap(config) { + var _this20; + _classCallCheck(this, FocusTrap); + _this20 = _callSuper(this, FocusTrap); + _this20._config = _this20._getConfig(config); + _this20._isActive = false; + _this20._lastTabNavDirection = null; + return _this20; } // Getters - static get Default() { - return Default$7; - } - static get DefaultType() { - return DefaultType$7; - } - static get NAME() { - return NAME$8; - } - - // Public - activate() { - if (this._isActive) { - return; - } - if (this._config.autofocus) { - this._config.trapElement.focus(); + _inherits(FocusTrap, _Config4); + return _createClass(FocusTrap, [{ + key: "activate", + value: + // Public + function activate() { + var _this21 = this; + if (this._isActive) { + return; + } + if (this._config.autofocus) { + this._config.trapElement.focus(); + } + EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop + EventHandler.on(document, EVENT_FOCUSIN$2, function (event) { + return _this21._handleFocusin(event); + }); + EventHandler.on(document, EVENT_KEYDOWN_TAB, function (event) { + return _this21._handleKeydown(event); + }); + this._isActive = true; } - EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop - EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); - EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); - this._isActive = true; - } - deactivate() { - if (!this._isActive) { - return; + }, { + key: "deactivate", + value: function deactivate() { + if (!this._isActive) { + return; + } + this._isActive = false; + EventHandler.off(document, EVENT_KEY$5); } - this._isActive = false; - EventHandler.off(document, EVENT_KEY$5); - } - // Private - _handleFocusin(event) { - const { - trapElement - } = this._config; - if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { - return; + // Private + }, { + key: "_handleFocusin", + value: function _handleFocusin(event) { + var trapElement = this._config.trapElement; + if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { + return; + } + var elements = SelectorEngine.focusableChildren(trapElement); + if (elements.length === 0) { + trapElement.focus(); + } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { + elements[elements.length - 1].focus(); + } else { + elements[0].focus(); + } } - const elements = SelectorEngine.focusableChildren(trapElement); - if (elements.length === 0) { - trapElement.focus(); - } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { - elements[elements.length - 1].focus(); - } else { - elements[0].focus(); + }, { + key: "_handleKeydown", + value: function _handleKeydown(event) { + if (event.key !== TAB_KEY) { + return; + } + this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; } - } - _handleKeydown(event) { - if (event.key !== TAB_KEY) { - return; + }], [{ + key: "Default", + get: function get() { + return Default$7; } - this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; - } - } - + }, { + key: "DefaultType", + get: function get() { + return DefaultType$7; + } + }, { + key: "NAME", + get: function get() { + return NAME$8; + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap util/scrollBar.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; - const SELECTOR_STICKY_CONTENT = '.sticky-top'; - const PROPERTY_PADDING = 'padding-right'; - const PROPERTY_MARGIN = 'margin-right'; + var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; + var SELECTOR_STICKY_CONTENT = '.sticky-top'; + var PROPERTY_PADDING = 'padding-right'; + var PROPERTY_MARGIN = 'margin-right'; /** * Class definition */ - - class ScrollBarHelper { - constructor() { + var ScrollBarHelper = /*#__PURE__*/function () { + function ScrollBarHelper() { + _classCallCheck(this, ScrollBarHelper); this._element = document.body; } // Public - getWidth() { - // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes - const documentWidth = document.documentElement.clientWidth; - return Math.abs(window.innerWidth - documentWidth); - } - hide() { - const width = this.getWidth(); - this._disableOverFlow(); - // give padding to element to balance the hidden scrollbar width - this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); - } - reset() { - this._resetElementAttributes(this._element, 'overflow'); - this._resetElementAttributes(this._element, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); - } - isOverflowing() { - return this.getWidth() > 0; - } - - // Private - _disableOverFlow() { - this._saveInitialAttribute(this._element, 'overflow'); - this._element.style.overflow = 'hidden'; - } - _setElementAttributes(selector, styleProperty, callback) { - const scrollbarWidth = this.getWidth(); - const manipulationCallBack = element => { - if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { - return; + return _createClass(ScrollBarHelper, [{ + key: "getWidth", + value: function getWidth() { + // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes + var documentWidth = document.documentElement.clientWidth; + return Math.abs(window.innerWidth - documentWidth); + } + }, { + key: "hide", + value: function hide() { + var width = this.getWidth(); + this._disableOverFlow(); + // give padding to element to balance the hidden scrollbar width + this._setElementAttributes(this._element, PROPERTY_PADDING, function (calculatedValue) { + return calculatedValue + width; + }); + // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth + this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, function (calculatedValue) { + return calculatedValue + width; + }); + this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, function (calculatedValue) { + return calculatedValue - width; + }); + } + }, { + key: "reset", + value: function reset() { + this._resetElementAttributes(this._element, 'overflow'); + this._resetElementAttributes(this._element, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); + } + }, { + key: "isOverflowing", + value: function isOverflowing() { + return this.getWidth() > 0; + } + + // Private + }, { + key: "_disableOverFlow", + value: function _disableOverFlow() { + this._saveInitialAttribute(this._element, 'overflow'); + this._element.style.overflow = 'hidden'; + } + }, { + key: "_setElementAttributes", + value: function _setElementAttributes(selector, styleProperty, callback) { + var _this22 = this; + var scrollbarWidth = this.getWidth(); + var manipulationCallBack = function manipulationCallBack(element) { + if (element !== _this22._element && window.innerWidth > element.clientWidth + scrollbarWidth) { + return; + } + _this22._saveInitialAttribute(element, styleProperty); + var calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); + element.style.setProperty(styleProperty, "".concat(callback(Number.parseFloat(calculatedValue)), "px")); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + }, { + key: "_saveInitialAttribute", + value: function _saveInitialAttribute(element, styleProperty) { + var actualValue = element.style.getPropertyValue(styleProperty); + if (actualValue) { + Manipulator.setDataAttribute(element, styleProperty, actualValue); } - this._saveInitialAttribute(element, styleProperty); - const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); - element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _saveInitialAttribute(element, styleProperty) { - const actualValue = element.style.getPropertyValue(styleProperty); - if (actualValue) { - Manipulator.setDataAttribute(element, styleProperty, actualValue); } - } - _resetElementAttributes(selector, styleProperty) { - const manipulationCallBack = element => { - const value = Manipulator.getDataAttribute(element, styleProperty); - // We only want to remove the property if the value is `null`; the value can also be zero - if (value === null) { - element.style.removeProperty(styleProperty); + }, { + key: "_resetElementAttributes", + value: function _resetElementAttributes(selector, styleProperty) { + var manipulationCallBack = function manipulationCallBack(element) { + var value = Manipulator.getDataAttribute(element, styleProperty); + // We only want to remove the property if the value is `null`; the value can also be zero + if (value === null) { + element.style.removeProperty(styleProperty); + return; + } + Manipulator.removeDataAttribute(element, styleProperty); + element.style.setProperty(styleProperty, value); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + }, { + key: "_applyManipulationCallback", + value: function _applyManipulationCallback(selector, callBack) { + if (isElement$1(selector)) { + callBack(selector); return; } - Manipulator.removeDataAttribute(element, styleProperty); - element.style.setProperty(styleProperty, value); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _applyManipulationCallback(selector, callBack) { - if (isElement$1(selector)) { - callBack(selector); - return; - } - for (const sel of SelectorEngine.find(selector, this._element)) { - callBack(sel); + var _iterator15 = _createForOfIteratorHelper(SelectorEngine.find(selector, this._element)), + _step15; + try { + for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) { + var sel = _step15.value; + callBack(sel); + } + } catch (err) { + _iterator15.e(err); + } finally { + _iterator15.f(); + } } - } - } - + }]); + }(); /** * -------------------------------------------------------------------------- * Bootstrap modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$7 = 'modal'; - const DATA_KEY$4 = 'bs.modal'; - const EVENT_KEY$4 = `.${DATA_KEY$4}`; - const DATA_API_KEY$2 = '.data-api'; - const ESCAPE_KEY$1 = 'Escape'; - const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; - const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; - const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; - const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; - const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; - const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; - const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`; - const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; - const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; - const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; - const CLASS_NAME_OPEN = 'modal-open'; - const CLASS_NAME_FADE$3 = 'fade'; - const CLASS_NAME_SHOW$4 = 'show'; - const CLASS_NAME_STATIC = 'modal-static'; - const OPEN_SELECTOR$1 = '.modal.show'; - const SELECTOR_DIALOG = '.modal-dialog'; - const SELECTOR_MODAL_BODY = '.modal-body'; - const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; - const Default$6 = { + var NAME$7 = 'modal'; + var DATA_KEY$4 = 'bs.modal'; + var EVENT_KEY$4 = ".".concat(DATA_KEY$4); + var DATA_API_KEY$2 = '.data-api'; + var ESCAPE_KEY$1 = 'Escape'; + var EVENT_HIDE$4 = "hide".concat(EVENT_KEY$4); + var EVENT_HIDE_PREVENTED$1 = "hidePrevented".concat(EVENT_KEY$4); + var EVENT_HIDDEN$4 = "hidden".concat(EVENT_KEY$4); + var EVENT_SHOW$4 = "show".concat(EVENT_KEY$4); + var EVENT_SHOWN$4 = "shown".concat(EVENT_KEY$4); + var EVENT_RESIZE$1 = "resize".concat(EVENT_KEY$4); + var EVENT_CLICK_DISMISS = "click.dismiss".concat(EVENT_KEY$4); + var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss".concat(EVENT_KEY$4); + var EVENT_KEYDOWN_DISMISS$1 = "keydown.dismiss".concat(EVENT_KEY$4); + var EVENT_CLICK_DATA_API$2 = "click".concat(EVENT_KEY$4).concat(DATA_API_KEY$2); + var CLASS_NAME_OPEN = 'modal-open'; + var CLASS_NAME_FADE$3 = 'fade'; + var CLASS_NAME_SHOW$4 = 'show'; + var CLASS_NAME_STATIC = 'modal-static'; + var OPEN_SELECTOR$1 = '.modal.show'; + var SELECTOR_DIALOG = '.modal-dialog'; + var SELECTOR_MODAL_BODY = '.modal-body'; + var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; + var Default$6 = { backdrop: true, focus: true, keyboard: true }; - const DefaultType$6 = { + var DefaultType$6 = { backdrop: '(boolean|string)', focus: 'boolean', keyboard: 'boolean' @@ -4260,252 +4561,300 @@ /** * Class definition */ - - class Modal extends BaseComponent { - constructor(element, config) { - super(element, config); - this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._isShown = false; - this._isTransitioning = false; - this._scrollBar = new ScrollBarHelper(); - this._addEventListeners(); + var Modal = /*#__PURE__*/function (_BaseComponent6) { + function Modal(element, config) { + var _this23; + _classCallCheck(this, Modal); + _this23 = _callSuper(this, Modal, [element, config]); + _this23._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, _this23._element); + _this23._backdrop = _this23._initializeBackDrop(); + _this23._focustrap = _this23._initializeFocusTrap(); + _this23._isShown = false; + _this23._isTransitioning = false; + _this23._scrollBar = new ScrollBarHelper(); + _this23._addEventListeners(); + return _this23; } // Getters - static get Default() { - return Default$6; - } - static get DefaultType() { - return DefaultType$6; - } - static get NAME() { - return NAME$7; - } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown || this._isTransitioning) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._isTransitioning = true; - this._scrollBar.hide(); - document.body.classList.add(CLASS_NAME_OPEN); - this._adjustDialog(); - this._backdrop.show(() => this._showElement(relatedTarget)); - } - hide() { - if (!this._isShown || this._isTransitioning) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); - if (hideEvent.defaultPrevented) { - return; - } - this._isShown = false; - this._isTransitioning = true; - this._focustrap.deactivate(); - this._element.classList.remove(CLASS_NAME_SHOW$4); - this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); - } - dispose() { - EventHandler.off(window, EVENT_KEY$4); - EventHandler.off(this._dialog, EVENT_KEY$4); - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - handleUpdate() { - this._adjustDialog(); - } - - // Private - _initializeBackDrop() { - return new Backdrop({ - isVisible: Boolean(this._config.backdrop), - // 'static' option will be translated to true, and booleans will keep their value, - isAnimated: this._isAnimated() - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _showElement(relatedTarget) { - // try to append dynamic modal - if (!document.body.contains(this._element)) { - document.body.append(this._element); - } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.scrollTop = 0; - const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); - if (modalBody) { - modalBody.scrollTop = 0; - } - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW$4); - const transitionComplete = () => { - if (this._config.focus) { - this._focustrap.activate(); + _inherits(Modal, _BaseComponent6); + return _createClass(Modal, [{ + key: "toggle", + value: + // Public + function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: "show", + value: function show(relatedTarget) { + var _this24 = this; + if (this._isShown || this._isTransitioning) { + return; } - this._isTransitioning = false; - EventHandler.trigger(this._element, EVENT_SHOWN$4, { - relatedTarget + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { + relatedTarget: relatedTarget }); - }; - this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { - if (event.key !== ESCAPE_KEY$1) { + if (showEvent.defaultPrevented) { return; } - if (this._config.keyboard) { - this.hide(); + this._isShown = true; + this._isTransitioning = true; + this._scrollBar.hide(); + document.body.classList.add(CLASS_NAME_OPEN); + this._adjustDialog(); + this._backdrop.show(function () { + return _this24._showElement(relatedTarget); + }); + } + }, { + key: "hide", + value: function hide() { + var _this25 = this; + if (!this._isShown || this._isTransitioning) { return; } - this._triggerBackdropTransition(); - }); - EventHandler.on(window, EVENT_RESIZE$1, () => { - if (this._isShown && !this._isTransitioning) { - this._adjustDialog(); + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); + if (hideEvent.defaultPrevented) { + return; } - }); - EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { - // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks - EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { - if (this._element !== event.target || this._element !== event2.target) { + this._isShown = false; + this._isTransitioning = true; + this._focustrap.deactivate(); + this._element.classList.remove(CLASS_NAME_SHOW$4); + this._queueCallback(function () { + return _this25._hideModal(); + }, this._element, this._isAnimated()); + } + }, { + key: "dispose", + value: function dispose() { + EventHandler.off(window, EVENT_KEY$4); + EventHandler.off(this._dialog, EVENT_KEY$4); + this._backdrop.dispose(); + this._focustrap.deactivate(); + _superPropGet(Modal, "dispose", this, 3)([]); + } + }, { + key: "handleUpdate", + value: function handleUpdate() { + this._adjustDialog(); + } + + // Private + }, { + key: "_initializeBackDrop", + value: function _initializeBackDrop() { + return new Backdrop({ + isVisible: Boolean(this._config.backdrop), + // 'static' option will be translated to true, and booleans will keep their value, + isAnimated: this._isAnimated() + }); + } + }, { + key: "_initializeFocusTrap", + value: function _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + }, { + key: "_showElement", + value: function _showElement(relatedTarget) { + var _this26 = this; + // try to append dynamic modal + if (!document.body.contains(this._element)) { + document.body.append(this._element); + } + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.scrollTop = 0; + var modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); + if (modalBody) { + modalBody.scrollTop = 0; + } + reflow(this._element); + this._element.classList.add(CLASS_NAME_SHOW$4); + var transitionComplete = function transitionComplete() { + if (_this26._config.focus) { + _this26._focustrap.activate(); + } + _this26._isTransitioning = false; + EventHandler.trigger(_this26._element, EVENT_SHOWN$4, { + relatedTarget: relatedTarget + }); + }; + this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this27 = this; + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, function (event) { + if (event.key !== ESCAPE_KEY$1) { return; } - if (this._config.backdrop === 'static') { - this._triggerBackdropTransition(); + if (_this27._config.keyboard) { + _this27.hide(); return; } - if (this._config.backdrop) { - this.hide(); + _this27._triggerBackdropTransition(); + }); + EventHandler.on(window, EVENT_RESIZE$1, function () { + if (_this27._isShown && !_this27._isTransitioning) { + _this27._adjustDialog(); } }); - }); - } - _hideModal() { - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', true); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - this._isTransitioning = false; - this._backdrop.hide(() => { - document.body.classList.remove(CLASS_NAME_OPEN); - this._resetAdjustments(); - this._scrollBar.reset(); - EventHandler.trigger(this._element, EVENT_HIDDEN$4); - }); - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_FADE$3); - } - _triggerBackdropTransition() { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); - if (hideEvent.defaultPrevented) { - return; - } - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const initialOverflowY = this._element.style.overflowY; - // return if the following background transition hasn't yet completed - if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { - return; - } - if (!isModalOverflowing) { - this._element.style.overflowY = 'hidden'; - } - this._element.classList.add(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.classList.remove(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.style.overflowY = initialOverflowY; - }, this._dialog); - }, this._dialog); - this._element.focus(); - } - - /** - * The following methods are used to handle overflowing modals - */ - - _adjustDialog() { - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const scrollbarWidth = this._scrollBar.getWidth(); - const isBodyOverflowing = scrollbarWidth > 0; - if (isBodyOverflowing && !isModalOverflowing) { - const property = isRTL() ? 'paddingLeft' : 'paddingRight'; - this._element.style[property] = `${scrollbarWidth}px`; + EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, function (event) { + // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks + EventHandler.one(_this27._element, EVENT_CLICK_DISMISS, function (event2) { + if (_this27._element !== event.target || _this27._element !== event2.target) { + return; + } + if (_this27._config.backdrop === 'static') { + _this27._triggerBackdropTransition(); + return; + } + if (_this27._config.backdrop) { + _this27.hide(); + } + }); + }); } - if (!isBodyOverflowing && isModalOverflowing) { - const property = isRTL() ? 'paddingRight' : 'paddingLeft'; - this._element.style[property] = `${scrollbarWidth}px`; + }, { + key: "_hideModal", + value: function _hideModal() { + var _this28 = 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._backdrop.hide(function () { + document.body.classList.remove(CLASS_NAME_OPEN); + _this28._resetAdjustments(); + _this28._scrollBar.reset(); + EventHandler.trigger(_this28._element, EVENT_HIDDEN$4); + }); } - } - _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; - } - - // Static - static jQueryInterface(config, relatedTarget) { - return this.each(function () { - const data = Modal.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._element.classList.contains(CLASS_NAME_FADE$3); + } + }, { + key: "_triggerBackdropTransition", + value: function _triggerBackdropTransition() { + var _this29 = this; + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); + if (hideEvent.defaultPrevented) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + var initialOverflowY = this._element.style.overflowY; + // return if the following background transition hasn't yet completed + if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { + return; } - data[config](relatedTarget); - }); - } - } - + if (!isModalOverflowing) { + this._element.style.overflowY = 'hidden'; + } + this._element.classList.add(CLASS_NAME_STATIC); + this._queueCallback(function () { + _this29._element.classList.remove(CLASS_NAME_STATIC); + _this29._queueCallback(function () { + _this29._element.style.overflowY = initialOverflowY; + }, _this29._dialog); + }, this._dialog); + this._element.focus(); + } + + /** + * The following methods are used to handle overflowing modals + */ + }, { + key: "_adjustDialog", + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + var scrollbarWidth = this._scrollBar.getWidth(); + var isBodyOverflowing = scrollbarWidth > 0; + if (isBodyOverflowing && !isModalOverflowing) { + var property = isRTL() ? 'paddingLeft' : 'paddingRight'; + this._element.style[property] = "".concat(scrollbarWidth, "px"); + } + if (!isBodyOverflowing && isModalOverflowing) { + var _property = isRTL() ? 'paddingRight' : 'paddingLeft'; + this._element.style[_property] = "".concat(scrollbarWidth, "px"); + } + } + }, { + key: "_resetAdjustments", + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$6; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$6; + } + }, { + key: "NAME", + get: function get() { + return NAME$7; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = Modal.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](relatedTarget); + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { - const target = SelectorEngine.getElementFromSelector(this); + var _this30 = this; + var target = SelectorEngine.getElementFromSelector(this); if (['A', 'AREA'].includes(this.tagName)) { event.preventDefault(); } - EventHandler.one(target, EVENT_SHOW$4, showEvent => { + EventHandler.one(target, EVENT_SHOW$4, function (showEvent) { if (showEvent.defaultPrevented) { // only register focus restorer if modal will actually get shown return; } - EventHandler.one(target, EVENT_HIDDEN$4, () => { - if (isVisible(this)) { - this.focus(); + EventHandler.one(target, EVENT_HIDDEN$4, function () { + if (isVisible(_this30)) { + _this30.focus(); } }); }); // avoid conflict when clicking modal toggler while another one is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); + var alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); if (alreadyOpen) { Modal.getInstance(alreadyOpen).hide(); } - const data = Modal.getOrCreateInstance(target); + var data = Modal.getOrCreateInstance(target); data.toggle(this); }); enableDismissTrigger(Modal); @@ -4523,37 +4872,36 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$6 = 'offcanvas'; - const DATA_KEY$3 = 'bs.offcanvas'; - const EVENT_KEY$3 = `.${DATA_KEY$3}`; - const DATA_API_KEY$1 = '.data-api'; - const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; - const ESCAPE_KEY = 'Escape'; - const CLASS_NAME_SHOW$3 = 'show'; - const CLASS_NAME_SHOWING$1 = 'showing'; - const CLASS_NAME_HIDING = 'hiding'; - const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; - const OPEN_SELECTOR = '.offcanvas.show'; - const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; - const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; - const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; - const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; - const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; - const EVENT_RESIZE = `resize${EVENT_KEY$3}`; - const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; - const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; - const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; - const Default$5 = { + var NAME$6 = 'offcanvas'; + var DATA_KEY$3 = 'bs.offcanvas'; + var EVENT_KEY$3 = ".".concat(DATA_KEY$3); + var DATA_API_KEY$1 = '.data-api'; + var EVENT_LOAD_DATA_API$2 = "load".concat(EVENT_KEY$3).concat(DATA_API_KEY$1); + var ESCAPE_KEY = 'Escape'; + var CLASS_NAME_SHOW$3 = 'show'; + var CLASS_NAME_SHOWING$1 = 'showing'; + var CLASS_NAME_HIDING = 'hiding'; + var CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; + var OPEN_SELECTOR = '.offcanvas.show'; + var EVENT_SHOW$3 = "show".concat(EVENT_KEY$3); + var EVENT_SHOWN$3 = "shown".concat(EVENT_KEY$3); + var EVENT_HIDE$3 = "hide".concat(EVENT_KEY$3); + var EVENT_HIDE_PREVENTED = "hidePrevented".concat(EVENT_KEY$3); + var EVENT_HIDDEN$3 = "hidden".concat(EVENT_KEY$3); + var EVENT_RESIZE = "resize".concat(EVENT_KEY$3); + var EVENT_CLICK_DATA_API$1 = "click".concat(EVENT_KEY$3).concat(DATA_API_KEY$1); + var EVENT_KEYDOWN_DISMISS = "keydown.dismiss".concat(EVENT_KEY$3); + var SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; + var Default$5 = { backdrop: true, keyboard: true, scroll: false }; - const DefaultType$5 = { + var DefaultType$5 = { backdrop: '(boolean|string)', keyboard: 'boolean', scroll: 'boolean' @@ -4562,181 +4910,228 @@ /** * Class definition */ - - class Offcanvas extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isShown = false; - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._addEventListeners(); + var Offcanvas = /*#__PURE__*/function (_BaseComponent7) { + function Offcanvas(element, config) { + var _this31; + _classCallCheck(this, Offcanvas); + _this31 = _callSuper(this, Offcanvas, [element, config]); + _this31._isShown = false; + _this31._backdrop = _this31._initializeBackDrop(); + _this31._focustrap = _this31._initializeFocusTrap(); + _this31._addEventListeners(); + return _this31; } // Getters - static get Default() { - return Default$5; - } - static get DefaultType() { - return DefaultType$5; - } - static get NAME() { - return NAME$6; - } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._backdrop.show(); - if (!this._config.scroll) { - new ScrollBarHelper().hide(); - } - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.classList.add(CLASS_NAME_SHOWING$1); - const completeCallBack = () => { - if (!this._config.scroll || this._config.backdrop) { - this._focustrap.activate(); - } - this._element.classList.add(CLASS_NAME_SHOW$3); - this._element.classList.remove(CLASS_NAME_SHOWING$1); - EventHandler.trigger(this._element, EVENT_SHOWN$3, { - relatedTarget - }); - }; - this._queueCallback(completeCallBack, this._element, true); - } - hide() { - if (!this._isShown) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); - if (hideEvent.defaultPrevented) { - return; - } - this._focustrap.deactivate(); - this._element.blur(); - this._isShown = false; - this._element.classList.add(CLASS_NAME_HIDING); - this._backdrop.hide(); - const completeCallback = () => { - this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - if (!this._config.scroll) { - new ScrollBarHelper().reset(); - } - EventHandler.trigger(this._element, EVENT_HIDDEN$3); - }; - this._queueCallback(completeCallback, this._element, true); - } - dispose() { - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - - // Private - _initializeBackDrop() { - const clickCallback = () => { - if (this._config.backdrop === 'static') { - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); + _inherits(Offcanvas, _BaseComponent7); + return _createClass(Offcanvas, [{ + key: "toggle", + value: + // Public + function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: "show", + value: function show(relatedTarget) { + var _this32 = this; + if (this._isShown) { return; } - this.hide(); - }; - - // 'static' option will be translated to true, and booleans will keep their value - const isVisible = Boolean(this._config.backdrop); - return new Backdrop({ - className: CLASS_NAME_BACKDROP, - isVisible, - isAnimated: true, - rootElement: this._element.parentNode, - clickCallback: isVisible ? clickCallback : null - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { - if (event.key !== ESCAPE_KEY) { + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { + relatedTarget: relatedTarget + }); + if (showEvent.defaultPrevented) { return; } - if (this._config.keyboard) { - this.hide(); - return; + this._isShown = true; + this._backdrop.show(); + if (!this._config.scroll) { + new ScrollBarHelper().hide(); } - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - }); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Offcanvas.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.classList.add(CLASS_NAME_SHOWING$1); + var completeCallBack = function completeCallBack() { + if (!_this32._config.scroll || _this32._config.backdrop) { + _this32._focustrap.activate(); + } + _this32._element.classList.add(CLASS_NAME_SHOW$3); + _this32._element.classList.remove(CLASS_NAME_SHOWING$1); + EventHandler.trigger(_this32._element, EVENT_SHOWN$3, { + relatedTarget: relatedTarget + }); + }; + this._queueCallback(completeCallBack, this._element, true); + } + }, { + key: "hide", + value: function hide() { + var _this33 = this; + if (!this._isShown) { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); + if (hideEvent.defaultPrevented) { + return; } - data[config](this); - }); - } - } + this._focustrap.deactivate(); + this._element.blur(); + this._isShown = false; + this._element.classList.add(CLASS_NAME_HIDING); + this._backdrop.hide(); + var completeCallback = function completeCallback() { + _this33._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); + _this33._element.removeAttribute('aria-modal'); + _this33._element.removeAttribute('role'); + if (!_this33._config.scroll) { + new ScrollBarHelper().reset(); + } + EventHandler.trigger(_this33._element, EVENT_HIDDEN$3); + }; + this._queueCallback(completeCallback, this._element, true); + } + }, { + key: "dispose", + value: function dispose() { + this._backdrop.dispose(); + this._focustrap.deactivate(); + _superPropGet(Offcanvas, "dispose", this, 3)([]); + } - /** - * Data API implementation - */ + // Private + }, { + key: "_initializeBackDrop", + value: function _initializeBackDrop() { + var _this34 = this; + var clickCallback = function clickCallback() { + if (_this34._config.backdrop === 'static') { + EventHandler.trigger(_this34._element, EVENT_HIDE_PREVENTED); + return; + } + _this34.hide(); + }; - EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } + // 'static' option will be translated to true, and booleans will keep their value + var isVisible = Boolean(this._config.backdrop); + return new Backdrop({ + className: CLASS_NAME_BACKDROP, + isVisible: isVisible, + isAnimated: true, + rootElement: this._element.parentNode, + clickCallback: isVisible ? clickCallback : null + }); + } + }, { + key: "_initializeFocusTrap", + value: function _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this35 = this; + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) { + if (event.key !== ESCAPE_KEY) { + return; + } + if (_this35._config.keyboard) { + _this35.hide(); + return; + } + EventHandler.trigger(_this35._element, EVENT_HIDE_PREVENTED); + }); + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$5; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$5; + } + }, { + key: "NAME", + get: function get() { + return NAME$6; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Offcanvas.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](this); + }); + } + }]); + }(BaseComponent); + /** + * Data API implementation + */ + EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { + var _this36 = this; + var target = SelectorEngine.getElementFromSelector(this); + if (['A', 'AREA'].includes(this.tagName)) { + event.preventDefault(); + } if (isDisabled(this)) { return; } - EventHandler.one(target, EVENT_HIDDEN$3, () => { + EventHandler.one(target, EVENT_HIDDEN$3, function () { // focus on trigger when it is closed - if (isVisible(this)) { - this.focus(); + if (isVisible(_this36)) { + _this36.focus(); } }); // avoid conflict when clicking a toggler of an offcanvas, while another is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); + var alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); if (alreadyOpen && alreadyOpen !== target) { Offcanvas.getInstance(alreadyOpen).hide(); } - const data = Offcanvas.getOrCreateInstance(target); + var data = Offcanvas.getOrCreateInstance(target); data.toggle(this); }); - EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { - for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { - Offcanvas.getOrCreateInstance(selector).show(); + EventHandler.on(window, EVENT_LOAD_DATA_API$2, function () { + var _iterator16 = _createForOfIteratorHelper(SelectorEngine.find(OPEN_SELECTOR)), + _step16; + try { + for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) { + var selector = _step16.value; + Offcanvas.getOrCreateInstance(selector).show(); + } + } catch (err) { + _iterator16.e(err); + } finally { + _iterator16.f(); } }); - EventHandler.on(window, EVENT_RESIZE, () => { - for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { - if (getComputedStyle(element).position !== 'fixed') { - Offcanvas.getOrCreateInstance(element).hide(); + EventHandler.on(window, EVENT_RESIZE, function () { + var _iterator17 = _createForOfIteratorHelper(SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')), + _step17; + try { + for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) { + var element = _step17.value; + if (getComputedStyle(element).position !== 'fixed') { + Offcanvas.getOrCreateInstance(element).hide(); + } } + } catch (err) { + _iterator17.e(err); + } finally { + _iterator17.f(); } }); enableDismissTrigger(Offcanvas); @@ -4755,8 +5150,8 @@ */ // js-docs-start allow-list - const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; - const DefaultAllowlist = { + var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; + var DefaultAllowlist = { // Global attributes allowed on any supplied element below. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], a: ['target', 'href', 'title', 'rel'], @@ -4794,7 +5189,7 @@ }; // js-docs-end allow-list - const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); + var uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); /** * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation @@ -4803,9 +5198,9 @@ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 */ // eslint-disable-next-line unicorn/better-regex - const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; - const allowedAttribute = (attribute, allowedAttributeList) => { - const attributeName = attribute.nodeName.toLowerCase(); + var SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; + var allowedAttribute = function allowedAttribute(attribute, allowedAttributeList) { + var attributeName = attribute.nodeName.toLowerCase(); if (allowedAttributeList.includes(attributeName)) { if (uriAttributes.has(attributeName)) { return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); @@ -4814,31 +5209,55 @@ } // Check if a regular expression validates the attribute. - return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); + return allowedAttributeList.filter(function (attributeRegex) { + return attributeRegex instanceof RegExp; + }).some(function (regex) { + return regex.test(attributeName); + }); }; function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { + var _ref12; if (!unsafeHtml.length) { return unsafeHtml; } if (sanitizeFunction && typeof sanitizeFunction === 'function') { return sanitizeFunction(unsafeHtml); } - const domParser = new window.DOMParser(); - const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); - const elements = [].concat(...createdDocument.body.querySelectorAll('*')); - for (const element of elements) { - const elementName = element.nodeName.toLowerCase(); - if (!Object.keys(allowList).includes(elementName)) { - element.remove(); - continue; - } - const attributeList = [].concat(...element.attributes); - const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); - for (const attribute of attributeList) { - if (!allowedAttribute(attribute, allowedAttributes)) { - element.removeAttribute(attribute.nodeName); + var domParser = new window.DOMParser(); + var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); + var elements = (_ref12 = []).concat.apply(_ref12, _toConsumableArray(createdDocument.body.querySelectorAll('*'))); + var _iterator18 = _createForOfIteratorHelper(elements), + _step18; + try { + for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { + var _ref13; + var element = _step18.value; + var elementName = element.nodeName.toLowerCase(); + if (!Object.keys(allowList).includes(elementName)) { + element.remove(); + continue; + } + var attributeList = (_ref13 = []).concat.apply(_ref13, _toConsumableArray(element.attributes)); + var allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); + var _iterator19 = _createForOfIteratorHelper(attributeList), + _step19; + try { + for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { + var attribute = _step19.value; + if (!allowedAttribute(attribute, allowedAttributes)) { + element.removeAttribute(attribute.nodeName); + } + } + } catch (err) { + _iterator19.e(err); + } finally { + _iterator19.f(); } } + } catch (err) { + _iterator18.e(err); + } finally { + _iterator18.f(); } return createdDocument.body.innerHTML; } @@ -4850,13 +5269,12 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$5 = 'TemplateFactory'; - const Default$4 = { + var NAME$5 = 'TemplateFactory'; + var Default$4 = { allowList: DefaultAllowlist, content: {}, // { selector : text , selector2 : text2 , } @@ -4866,7 +5284,7 @@ sanitizeFn: null, template: '
    ' }; - const DefaultType$4 = { + var DefaultType$4 = { allowList: 'object', content: 'object', extraClass: '(string|function)', @@ -4875,7 +5293,7 @@ sanitizeFn: '(null|function)', template: 'string' }; - const DefaultContentType = { + var DefaultContentType = { entry: '(string|element|function|null)', selector: '(string|element)' }; @@ -4883,144 +5301,177 @@ /** * Class definition */ - - class TemplateFactory extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); + var TemplateFactory = /*#__PURE__*/function (_Config5) { + function TemplateFactory(config) { + var _this37; + _classCallCheck(this, TemplateFactory); + _this37 = _callSuper(this, TemplateFactory); + _this37._config = _this37._getConfig(config); + return _this37; } // Getters - static get Default() { - return Default$4; - } - static get DefaultType() { - return DefaultType$4; - } - static get NAME() { - return NAME$5; - } - - // Public - getContent() { - return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); - } - hasContent() { - return this.getContent().length > 0; - } - changeContent(content) { - this._checkContent(content); - this._config.content = { - ...this._config.content, - ...content - }; - return this; - } - toHtml() { - const templateWrapper = document.createElement('div'); - templateWrapper.innerHTML = this._maybeSanitize(this._config.template); - for (const [selector, text] of Object.entries(this._config.content)) { - this._setContent(templateWrapper, text, selector); - } - const template = templateWrapper.children[0]; - const extraClass = this._resolvePossibleFunction(this._config.extraClass); - if (extraClass) { - template.classList.add(...extraClass.split(' ')); + _inherits(TemplateFactory, _Config5); + return _createClass(TemplateFactory, [{ + key: "getContent", + value: + // Public + function getContent() { + var _this38 = this; + return Object.values(this._config.content).map(function (config) { + return _this38._resolvePossibleFunction(config); + }).filter(Boolean); + } + }, { + key: "hasContent", + value: function hasContent() { + return this.getContent().length > 0; + } + }, { + key: "changeContent", + value: function changeContent(content) { + this._checkContent(content); + this._config.content = _objectSpread(_objectSpread({}, this._config.content), content); + return this; + } + }, { + key: "toHtml", + value: function toHtml() { + var templateWrapper = document.createElement('div'); + templateWrapper.innerHTML = this._maybeSanitize(this._config.template); + for (var _i8 = 0, _Object$entries5 = Object.entries(this._config.content); _i8 < _Object$entries5.length; _i8++) { + var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i8], 2), + selector = _Object$entries5$_i[0], + text = _Object$entries5$_i[1]; + this._setContent(templateWrapper, text, selector); + } + var template = templateWrapper.children[0]; + var extraClass = this._resolvePossibleFunction(this._config.extraClass); + if (extraClass) { + var _template$classList; + (_template$classList = template.classList).add.apply(_template$classList, _toConsumableArray(extraClass.split(' '))); + } + return template; } - return template; - } - // Private - _typeCheckConfig(config) { - super._typeCheckConfig(config); - this._checkContent(config.content); - } - _checkContent(arg) { - for (const [selector, content] of Object.entries(arg)) { - super._typeCheckConfig({ - selector, - entry: content - }, DefaultContentType); - } - } - _setContent(template, content, selector) { - const templateElement = SelectorEngine.findOne(selector, template); - if (!templateElement) { - return; + // Private + }, { + key: "_typeCheckConfig", + value: function _typeCheckConfig(config) { + _superPropGet(TemplateFactory, "_typeCheckConfig", this, 3)([config]); + this._checkContent(config.content); + } + }, { + key: "_checkContent", + value: function _checkContent(arg) { + for (var _i9 = 0, _Object$entries6 = Object.entries(arg); _i9 < _Object$entries6.length; _i9++) { + var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i9], 2), + selector = _Object$entries6$_i[0], + content = _Object$entries6$_i[1]; + _superPropGet(TemplateFactory, "_typeCheckConfig", this, 3)([{ + selector: selector, + entry: content + }, DefaultContentType]); + } } - content = this._resolvePossibleFunction(content); - if (!content) { - templateElement.remove(); - return; + }, { + key: "_setContent", + value: function _setContent(template, content, selector) { + var templateElement = SelectorEngine.findOne(selector, template); + if (!templateElement) { + return; + } + content = this._resolvePossibleFunction(content); + if (!content) { + templateElement.remove(); + return; + } + if (isElement$1(content)) { + this._putElementInTemplate(getElement(content), templateElement); + return; + } + if (this._config.html) { + templateElement.innerHTML = this._maybeSanitize(content); + return; + } + templateElement.textContent = content; + } + }, { + key: "_maybeSanitize", + value: function _maybeSanitize(arg) { + return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; + } + }, { + key: "_resolvePossibleFunction", + value: function _resolvePossibleFunction(arg) { + return execute(arg, [this]); + } + }, { + key: "_putElementInTemplate", + value: function _putElementInTemplate(element, templateElement) { + if (this._config.html) { + templateElement.innerHTML = ''; + templateElement.append(element); + return; + } + templateElement.textContent = element.textContent; } - if (isElement$1(content)) { - this._putElementInTemplate(getElement(content), templateElement); - return; + }], [{ + key: "Default", + get: function get() { + return Default$4; } - if (this._config.html) { - templateElement.innerHTML = this._maybeSanitize(content); - return; + }, { + key: "DefaultType", + get: function get() { + return DefaultType$4; } - templateElement.textContent = content; - } - _maybeSanitize(arg) { - return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this]); - } - _putElementInTemplate(element, templateElement) { - if (this._config.html) { - templateElement.innerHTML = ''; - templateElement.append(element); - return; + }, { + key: "NAME", + get: function get() { + return NAME$5; } - templateElement.textContent = element.textContent; - } - } - + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$4 = 'tooltip'; - const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); - const CLASS_NAME_FADE$2 = 'fade'; - const CLASS_NAME_MODAL = 'modal'; - const CLASS_NAME_SHOW$2 = 'show'; - const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; - const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; - const EVENT_MODAL_HIDE = 'hide.bs.modal'; - const TRIGGER_HOVER = 'hover'; - const TRIGGER_FOCUS = 'focus'; - const TRIGGER_CLICK = 'click'; - const TRIGGER_MANUAL = 'manual'; - const EVENT_HIDE$2 = 'hide'; - const EVENT_HIDDEN$2 = 'hidden'; - const EVENT_SHOW$2 = 'show'; - const EVENT_SHOWN$2 = 'shown'; - const EVENT_INSERTED = 'inserted'; - const EVENT_CLICK$1 = 'click'; - const EVENT_FOCUSIN$1 = 'focusin'; - const EVENT_FOCUSOUT$1 = 'focusout'; - const EVENT_MOUSEENTER = 'mouseenter'; - const EVENT_MOUSELEAVE = 'mouseleave'; - const AttachmentMap = { + var NAME$4 = 'tooltip'; + var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); + var CLASS_NAME_FADE$2 = 'fade'; + var CLASS_NAME_MODAL = 'modal'; + var CLASS_NAME_SHOW$2 = 'show'; + var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; + var SELECTOR_MODAL = ".".concat(CLASS_NAME_MODAL); + var EVENT_MODAL_HIDE = 'hide.bs.modal'; + var TRIGGER_HOVER = 'hover'; + var TRIGGER_FOCUS = 'focus'; + var TRIGGER_CLICK = 'click'; + var TRIGGER_MANUAL = 'manual'; + var EVENT_HIDE$2 = 'hide'; + var EVENT_HIDDEN$2 = 'hidden'; + var EVENT_SHOW$2 = 'show'; + var EVENT_SHOWN$2 = 'shown'; + var EVENT_INSERTED = 'inserted'; + var EVENT_CLICK$1 = 'click'; + var EVENT_FOCUSIN$1 = 'focusin'; + var EVENT_FOCUSOUT$1 = 'focusout'; + var EVENT_MOUSEENTER = 'mouseenter'; + var EVENT_MOUSELEAVE = 'mouseleave'; + var AttachmentMap = { AUTO: 'auto', TOP: 'top', RIGHT: isRTL() ? 'left' : 'right', BOTTOM: 'bottom', LEFT: isRTL() ? 'right' : 'left' }; - const Default$3 = { + var Default$3 = { allowList: DefaultAllowlist, animation: true, boundary: 'clippingParents', @@ -5039,7 +5490,7 @@ title: '', trigger: 'hover focus' }; - const DefaultType$3 = { + var DefaultType$3 = { allowList: 'object', animation: 'boolean', boundary: '(string|element)', @@ -5062,433 +5513,538 @@ /** * Class definition */ - - class Tooltip extends BaseComponent { - constructor(element, config) { + var Tooltip = /*#__PURE__*/function (_BaseComponent8) { + function Tooltip(element, config) { + var _this39; + _classCallCheck(this, Tooltip); if (typeof Popper === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); } - super(element, config); + _this39 = _callSuper(this, Tooltip, [element, config]); // Private - this._isEnabled = true; - this._timeout = 0; - this._isHovered = null; - this._activeTrigger = {}; - this._popper = null; - this._templateFactory = null; - this._newContent = null; + _this39._isEnabled = true; + _this39._timeout = 0; + _this39._isHovered = null; + _this39._activeTrigger = {}; + _this39._popper = null; + _this39._templateFactory = null; + _this39._newContent = null; // Protected - this.tip = null; - this._setListeners(); - if (!this._config.selector) { - this._fixTitle(); + _this39.tip = null; + _this39._setListeners(); + if (!_this39._config.selector) { + _this39._fixTitle(); } + return _this39; } // Getters - static get Default() { - return Default$3; - } - static get DefaultType() { - return DefaultType$3; - } - static get NAME() { - return NAME$4; - } - - // Public - enable() { - this._isEnabled = true; - } - disable() { - this._isEnabled = false; - } - toggleEnabled() { - this._isEnabled = !this._isEnabled; - } - toggle() { - if (!this._isEnabled) { - return; - } - this._activeTrigger.click = !this._activeTrigger.click; - if (this._isShown()) { - this._leave(); - return; - } - this._enter(); - } - dispose() { - clearTimeout(this._timeout); - EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - if (this._element.getAttribute('data-bs-original-title')) { - this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); - } - this._disposePopper(); - super.dispose(); - } - show() { - if (this._element.style.display === 'none') { - throw new Error('Please use show on visible elements'); - } - if (!(this._isWithContent() && this._isEnabled)) { - return; - } - const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); - const shadowRoot = findShadowRoot(this._element); - const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); - if (showEvent.defaultPrevented || !isInTheDom) { - return; - } - - // TODO: v6 remove this or make it optional - this._disposePopper(); - const tip = this._getTipElement(); - this._element.setAttribute('aria-describedby', tip.getAttribute('id')); - const { - container - } = this._config; - if (!this._element.ownerDocument.documentElement.contains(this.tip)) { - container.append(tip); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); - } - this._popper = this._createPopper(tip); - tip.classList.add(CLASS_NAME_SHOW$2); - - // 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) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); - } - } - const complete = () => { - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); - if (this._isHovered === false) { + _inherits(Tooltip, _BaseComponent8); + return _createClass(Tooltip, [{ + key: "enable", + value: + // Public + function enable() { + this._isEnabled = true; + } + }, { + key: "disable", + value: function disable() { + this._isEnabled = false; + } + }, { + key: "toggleEnabled", + value: function toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + }, { + key: "toggle", + value: function toggle() { + if (!this._isEnabled) { + return; + } + this._activeTrigger.click = !this._activeTrigger.click; + if (this._isShown()) { this._leave(); + return; } - this._isHovered = false; - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - hide() { - if (!this._isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); - if (hideEvent.defaultPrevented) { - return; - } - const tip = this._getTipElement(); - tip.classList.remove(CLASS_NAME_SHOW$2); - - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); + this._enter(); + } + }, { + key: "dispose", + value: function dispose() { + clearTimeout(this._timeout); + EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + if (this._element.getAttribute('data-bs-original-title')) { + this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); } - } - this._activeTrigger[TRIGGER_CLICK] = false; - this._activeTrigger[TRIGGER_FOCUS] = false; - this._activeTrigger[TRIGGER_HOVER] = false; - this._isHovered = null; // it is a trick to support manual triggering - - const complete = () => { - if (this._isWithActiveTrigger()) { + this._disposePopper(); + _superPropGet(Tooltip, "dispose", this, 3)([]); + } + }, { + key: "show", + value: function show() { + var _this40 = this; + if (this._element.style.display === 'none') { + throw new Error('Please use show on visible elements'); + } + if (!(this._isWithContent() && this._isEnabled)) { return; } - if (!this._isHovered) { - this._disposePopper(); + var showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); + var shadowRoot = _findShadowRoot(this._element); + var isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); + if (showEvent.defaultPrevented || !isInTheDom) { + return; } - this._element.removeAttribute('aria-describedby'); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - update() { - if (this._popper) { - this._popper.update(); - } - } - - // Protected - _isWithContent() { - return Boolean(this._getTitle()); - } - _getTipElement() { - if (!this.tip) { - this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); - } - return this.tip; - } - _createTipElement(content) { - const tip = this._getTemplateFactory(content).toHtml(); - // TODO: remove this check in v6 - if (!tip) { - return null; - } - tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); - // TODO: v6 the following can be achieved with CSS only - tip.classList.add(`bs-${this.constructor.NAME}-auto`); - const tipId = getUID(this.constructor.NAME).toString(); - tip.setAttribute('id', tipId); - if (this._isAnimated()) { - tip.classList.add(CLASS_NAME_FADE$2); - } - return tip; - } - setContent(content) { - this._newContent = content; - if (this._isShown()) { + // TODO: v6 remove this or make it optional this._disposePopper(); - this.show(); - } - } - _getTemplateFactory(content) { - if (this._templateFactory) { - this._templateFactory.changeContent(content); - } else { - this._templateFactory = new TemplateFactory({ - ...this._config, - // the `content` var has to be after `this._config` - // to override config.content in case of popover - content, - extraClass: this._resolvePossibleFunction(this._config.customClass) - }); - } - return this._templateFactory; - } - _getContentForTemplate() { - return { - [SELECTOR_TOOLTIP_INNER]: this._getTitle() - }; - } - _getTitle() { - return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); - } - - // Private - _initializeOnDelegatedTarget(event) { - return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); - } - _isAnimated() { - return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); - } - _isShown() { - return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); - } - _createPopper(tip) { - const placement = execute(this._config.placement, [this, tip, this._element]); - const attachment = AttachmentMap[placement.toUpperCase()]; - return createPopper(this._element, tip, this._getPopperConfig(attachment)); - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this._element]); - } - _getPopperConfig(attachment) { - const defaultBsPopperConfig = { - placement: attachment, - modifiers: [{ - name: 'flip', - options: { - fallbackPlacements: this._config.fallbackPlacements + var tip = this._getTipElement(); + this._element.setAttribute('aria-describedby', tip.getAttribute('id')); + var container = this._config.container; + if (!this._element.ownerDocument.documentElement.contains(this.tip)) { + container.append(tip); + EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); + } + this._popper = this._createPopper(tip); + tip.classList.add(CLASS_NAME_SHOW$2); + + // 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) { + var _ref14; + var _iterator20 = _createForOfIteratorHelper((_ref14 = []).concat.apply(_ref14, _toConsumableArray(document.body.children))), + _step20; + try { + for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { + var element = _step20.value; + EventHandler.on(element, 'mouseover', noop); + } + } catch (err) { + _iterator20.e(err); + } finally { + _iterator20.f(); } - }, { - name: 'offset', - options: { - offset: this._getOffset() + } + var complete = function complete() { + EventHandler.trigger(_this40._element, _this40.constructor.eventName(EVENT_SHOWN$2)); + if (_this40._isHovered === false) { + _this40._leave(); } - }, { - name: 'preventOverflow', - options: { - boundary: this._config.boundary + _this40._isHovered = false; + }; + this._queueCallback(complete, this.tip, this._isAnimated()); + } + }, { + key: "hide", + value: function hide() { + var _this41 = this; + if (!this._isShown()) { + return; + } + var hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); + if (hideEvent.defaultPrevented) { + return; + } + var tip = this._getTipElement(); + tip.classList.remove(CLASS_NAME_SHOW$2); + + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + var _ref15; + var _iterator21 = _createForOfIteratorHelper((_ref15 = []).concat.apply(_ref15, _toConsumableArray(document.body.children))), + _step21; + try { + for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) { + var element = _step21.value; + EventHandler.off(element, 'mouseover', noop); + } + } catch (err) { + _iterator21.e(err); + } finally { + _iterator21.f(); } - }, { - name: 'arrow', - options: { - element: `.${this.constructor.NAME}-arrow` + } + this._activeTrigger[TRIGGER_CLICK] = false; + this._activeTrigger[TRIGGER_FOCUS] = false; + this._activeTrigger[TRIGGER_HOVER] = false; + this._isHovered = null; // it is a trick to support manual triggering + + var complete = function complete() { + if (_this41._isWithActiveTrigger()) { + return; } - }, { - name: 'preSetPlacement', - enabled: true, - phase: 'beforeMain', - fn: data => { - // Pre-set Popper's placement attribute in order to read the arrow sizes properly. - // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement - this._getTipElement().setAttribute('data-popper-placement', data.state.placement); + if (!_this41._isHovered) { + _this41._disposePopper(); } - }] - }; - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _setListeners() { - const triggers = this._config.trigger.split(' '); - for (const trigger of triggers) { - if (trigger === 'click') { - EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context.toggle(); - }); - } else if (trigger !== TRIGGER_MANUAL) { - const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); - const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); - EventHandler.on(this._element, eventIn, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; - context._enter(); - }); - EventHandler.on(this._element, eventOut, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); - context._leave(); - }); - } + _this41._element.removeAttribute('aria-describedby'); + EventHandler.trigger(_this41._element, _this41.constructor.eventName(EVENT_HIDDEN$2)); + }; + this._queueCallback(complete, this.tip, this._isAnimated()); } - this._hideModalHandler = () => { - if (this._element) { - this.hide(); + }, { + key: "update", + value: function update() { + if (this._popper) { + this._popper.update(); } - }; - EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - } - _fixTitle() { - const title = this._element.getAttribute('title'); - if (!title) { - return; - } - if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { - this._element.setAttribute('aria-label', title); } - this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility - this._element.removeAttribute('title'); - } - _enter() { - if (this._isShown() || this._isHovered) { - this._isHovered = true; - return; - } - this._isHovered = true; - this._setTimeout(() => { - if (this._isHovered) { - this.show(); + + // Protected + }, { + key: "_isWithContent", + value: function _isWithContent() { + return Boolean(this._getTitle()); + } + }, { + key: "_getTipElement", + value: function _getTipElement() { + if (!this.tip) { + this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); } - }, this._config.delay.show); - } - _leave() { - if (this._isWithActiveTrigger()) { - return; + return this.tip; } - this._isHovered = false; - this._setTimeout(() => { - if (!this._isHovered) { - this.hide(); + }, { + key: "_createTipElement", + value: function _createTipElement(content) { + var tip = this._getTemplateFactory(content).toHtml(); + + // TODO: remove this check in v6 + if (!tip) { + return null; } - }, this._config.delay.hide); - } - _setTimeout(handler, timeout) { - clearTimeout(this._timeout); - this._timeout = setTimeout(handler, timeout); - } - _isWithActiveTrigger() { - return Object.values(this._activeTrigger).includes(true); - } - _getConfig(config) { - const dataAttributes = Manipulator.getDataAttributes(this._element); - for (const dataAttribute of Object.keys(dataAttributes)) { - if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { - delete dataAttributes[dataAttribute]; + tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); + // TODO: v6 the following can be achieved with CSS only + tip.classList.add("bs-".concat(this.constructor.NAME, "-auto")); + var tipId = getUID(this.constructor.NAME).toString(); + tip.setAttribute('id', tipId); + if (this._isAnimated()) { + tip.classList.add(CLASS_NAME_FADE$2); } + return tip; } - config = { - ...dataAttributes, - ...(typeof config === 'object' && config ? config : {}) - }; - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - config.container = config.container === false ? document.body : getElement(config.container); - if (typeof config.delay === 'number') { - config.delay = { - show: config.delay, - hide: config.delay - }; + }, { + key: "setContent", + value: function setContent(content) { + this._newContent = content; + if (this._isShown()) { + this._disposePopper(); + this.show(); + } } - if (typeof config.title === 'number') { - config.title = config.title.toString(); + }, { + key: "_getTemplateFactory", + value: function _getTemplateFactory(content) { + if (this._templateFactory) { + this._templateFactory.changeContent(content); + } else { + this._templateFactory = new TemplateFactory(_objectSpread(_objectSpread({}, this._config), {}, { + // the `content` var has to be after `this._config` + // to override config.content in case of popover + content: content, + extraClass: this._resolvePossibleFunction(this._config.customClass) + })); + } + return this._templateFactory; } - if (typeof config.content === 'number') { - config.content = config.content.toString(); + }, { + key: "_getContentForTemplate", + value: function _getContentForTemplate() { + return _defineProperty({}, SELECTOR_TOOLTIP_INNER, this._getTitle()); } - return config; - } - _getDelegateConfig() { - const config = {}; - for (const [key, value] of Object.entries(this._config)) { - if (this.constructor.Default[key] !== value) { - config[key] = value; - } + }, { + key: "_getTitle", + value: function _getTitle() { + return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); } - config.selector = false; - config.trigger = 'manual'; - // In the future can be replaced with: - // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) - // `Object.fromEntries(keysWithDifferentValues)` - return config; - } - _disposePopper() { - if (this._popper) { - this._popper.destroy(); - this._popper = null; + // Private + }, { + key: "_initializeOnDelegatedTarget", + value: function _initializeOnDelegatedTarget(event) { + return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); + } + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); + } + }, { + key: "_isShown", + value: function _isShown() { + return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); + } + }, { + key: "_createPopper", + value: function _createPopper(tip) { + var placement = execute(this._config.placement, [this, tip, this._element]); + var attachment = AttachmentMap[placement.toUpperCase()]; + return createPopper(this._element, tip, this._getPopperConfig(attachment)); + } + }, { + key: "_getOffset", + value: function _getOffset() { + var _this42 = this; + var offset = this._config.offset; + if (typeof offset === 'string') { + return offset.split(',').map(function (value) { + return Number.parseInt(value, 10); + }); + } + if (typeof offset === 'function') { + return function (popperData) { + return offset(popperData, _this42._element); + }; + } + return offset; + } + }, { + key: "_resolvePossibleFunction", + value: function _resolvePossibleFunction(arg) { + return execute(arg, [this._element]); + } + }, { + key: "_getPopperConfig", + value: function _getPopperConfig(attachment) { + var _this43 = this; + var defaultBsPopperConfig = { + placement: attachment, + modifiers: [{ + name: 'flip', + options: { + fallbackPlacements: this._config.fallbackPlacements + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }, { + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'arrow', + options: { + element: ".".concat(this.constructor.NAME, "-arrow") + } + }, { + name: 'preSetPlacement', + enabled: true, + phase: 'beforeMain', + fn: function fn(data) { + // Pre-set Popper's placement attribute in order to read the arrow sizes properly. + // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement + _this43._getTipElement().setAttribute('data-popper-placement', data.state.placement); + } + }] + }; + return _objectSpread(_objectSpread({}, defaultBsPopperConfig), execute(this._config.popperConfig, [defaultBsPopperConfig])); + } + }, { + key: "_setListeners", + value: function _setListeners() { + var _this44 = this; + var triggers = this._config.trigger.split(' '); + var _iterator22 = _createForOfIteratorHelper(triggers), + _step22; + try { + for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) { + var trigger = _step22.value; + if (trigger === 'click') { + EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context.toggle(); + }); + } else if (trigger !== TRIGGER_MANUAL) { + var eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); + var eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); + EventHandler.on(this._element, eventIn, this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; + context._enter(); + }); + EventHandler.on(this._element, eventOut, this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); + context._leave(); + }); + } + } + } catch (err) { + _iterator22.e(err); + } finally { + _iterator22.f(); + } + this._hideModalHandler = function () { + if (_this44._element) { + _this44.hide(); + } + }; + EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); } - if (this.tip) { - this.tip.remove(); - this.tip = null; + }, { + key: "_fixTitle", + value: function _fixTitle() { + var title = this._element.getAttribute('title'); + if (!title) { + return; + } + if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { + this._element.setAttribute('aria-label', title); + } + this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility + this._element.removeAttribute('title'); + } + }, { + key: "_enter", + value: function _enter() { + var _this45 = this; + if (this._isShown() || this._isHovered) { + this._isHovered = true; + return; + } + this._isHovered = true; + this._setTimeout(function () { + if (_this45._isHovered) { + _this45.show(); + } + }, this._config.delay.show); } - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Tooltip.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "_leave", + value: function _leave() { + var _this46 = this; + if (this._isWithActiveTrigger()) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + this._isHovered = false; + this._setTimeout(function () { + if (!_this46._isHovered) { + _this46.hide(); + } + }, this._config.delay.hide); + } + }, { + key: "_setTimeout", + value: function _setTimeout(handler, timeout) { + clearTimeout(this._timeout); + this._timeout = setTimeout(handler, timeout); + } + }, { + key: "_isWithActiveTrigger", + value: function _isWithActiveTrigger() { + return Object.values(this._activeTrigger).includes(true); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + var dataAttributes = Manipulator.getDataAttributes(this._element); + for (var _i10 = 0, _Object$keys2 = Object.keys(dataAttributes); _i10 < _Object$keys2.length; _i10++) { + var dataAttribute = _Object$keys2[_i10]; + if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { + delete dataAttributes[dataAttribute]; + } + } + config = _objectSpread(_objectSpread({}, dataAttributes), _typeof(config) === 'object' && config ? config : {}); + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.container = config.container === false ? document.body : getElement(config.container); + if (typeof config.delay === 'number') { + config.delay = { + show: config.delay, + hide: config.delay + }; } - data[config](); - }); - } - } + if (typeof config.title === 'number') { + config.title = config.title.toString(); + } + if (typeof config.content === 'number') { + config.content = config.content.toString(); + } + return config; + } + }, { + key: "_getDelegateConfig", + value: function _getDelegateConfig() { + var config = {}; + for (var _i11 = 0, _Object$entries7 = Object.entries(this._config); _i11 < _Object$entries7.length; _i11++) { + var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i11], 2), + key = _Object$entries7$_i[0], + value = _Object$entries7$_i[1]; + if (this.constructor.Default[key] !== value) { + config[key] = value; + } + } + config.selector = false; + config.trigger = 'manual'; + + // In the future can be replaced with: + // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) + // `Object.fromEntries(keysWithDifferentValues)` + return config; + } + }, { + key: "_disposePopper", + value: function _disposePopper() { + if (this._popper) { + this._popper.destroy(); + this._popper = null; + } + if (this.tip) { + this.tip.remove(); + this.tip = null; + } + } + // Static + }], [{ + key: "Default", + get: function get() { + return Default$3; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$3; + } + }, { + key: "NAME", + get: function get() { + return NAME$4; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Tooltip.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + }); + } + }]); + }(BaseComponent); /** * jQuery */ - defineJQueryPlugin(Tooltip); /** @@ -5498,78 +6054,90 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$3 = 'popover'; - const SELECTOR_TITLE = '.popover-header'; - const SELECTOR_CONTENT = '.popover-body'; - const Default$2 = { - ...Tooltip.Default, + var NAME$3 = 'popover'; + var SELECTOR_TITLE = '.popover-header'; + var SELECTOR_CONTENT = '.popover-body'; + var Default$2 = _objectSpread(_objectSpread({}, Tooltip.Default), {}, { content: '', offset: [0, 8], placement: 'right', template: '', trigger: 'click' - }; - const DefaultType$2 = { - ...Tooltip.DefaultType, + }); + var DefaultType$2 = _objectSpread(_objectSpread({}, Tooltip.DefaultType), {}, { content: '(null|string|element|function)' - }; + }); /** * Class definition */ - - class Popover extends Tooltip { - // Getters - static get Default() { - return Default$2; - } - static get DefaultType() { - return DefaultType$2; - } - static get NAME() { - return NAME$3; + var Popover = /*#__PURE__*/function (_Tooltip) { + function Popover() { + _classCallCheck(this, Popover); + return _callSuper(this, Popover, arguments); } + _inherits(Popover, _Tooltip); + return _createClass(Popover, [{ + key: "_isWithContent", + value: + // Overrides + function _isWithContent() { + return this._getTitle() || this._getContent(); + } - // Overrides - _isWithContent() { - return this._getTitle() || this._getContent(); - } - - // Private - _getContentForTemplate() { - return { - [SELECTOR_TITLE]: this._getTitle(), - [SELECTOR_CONTENT]: this._getContent() - }; - } - _getContent() { - return this._resolvePossibleFunction(this._config.content); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Popover.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); - } - } - + // Private + }, { + key: "_getContentForTemplate", + value: function _getContentForTemplate() { + return _defineProperty(_defineProperty({}, SELECTOR_TITLE, this._getTitle()), SELECTOR_CONTENT, this._getContent()); + } + }, { + key: "_getContent", + value: function _getContent() { + return this._resolvePossibleFunction(this._config.content); + } + + // Static + }], [{ + key: "Default", + get: + // Getters + function get() { + return Default$2; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$2; + } + }, { + key: "NAME", + get: function get() { + return NAME$3; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Popover.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + }); + } + }]); + }(Tooltip); /** * jQuery */ - defineJQueryPlugin(Popover); /** @@ -5579,30 +6147,29 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$2 = 'scrollspy'; - const DATA_KEY$2 = 'bs.scrollspy'; - const EVENT_KEY$2 = `.${DATA_KEY$2}`; - const DATA_API_KEY = '.data-api'; - const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; - const EVENT_CLICK = `click${EVENT_KEY$2}`; - const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`; - const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; - const CLASS_NAME_ACTIVE$1 = 'active'; - const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; - const SELECTOR_TARGET_LINKS = '[href]'; - const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; - const SELECTOR_NAV_LINKS = '.nav-link'; - const SELECTOR_NAV_ITEMS = '.nav-item'; - const SELECTOR_LIST_ITEMS = '.list-group-item'; - const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; - const SELECTOR_DROPDOWN = '.dropdown'; - const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; - const Default$1 = { + var NAME$2 = 'scrollspy'; + var DATA_KEY$2 = 'bs.scrollspy'; + var EVENT_KEY$2 = ".".concat(DATA_KEY$2); + var DATA_API_KEY = '.data-api'; + var EVENT_ACTIVATE = "activate".concat(EVENT_KEY$2); + var EVENT_CLICK = "click".concat(EVENT_KEY$2); + var EVENT_LOAD_DATA_API$1 = "load".concat(EVENT_KEY$2).concat(DATA_API_KEY); + var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; + var CLASS_NAME_ACTIVE$1 = 'active'; + var SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; + var SELECTOR_TARGET_LINKS = '[href]'; + 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_LINK_ITEMS = "".concat(SELECTOR_NAV_LINKS, ", ").concat(SELECTOR_NAV_ITEMS, " > ").concat(SELECTOR_NAV_LINKS, ", ").concat(SELECTOR_LIST_ITEMS); + var SELECTOR_DROPDOWN = '.dropdown'; + var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; + var Default$1 = { offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons rootMargin: '0px 0px -25%', @@ -5610,7 +6177,7 @@ target: null, threshold: [0.1, 0.5, 1] }; - const DefaultType$1 = { + var DefaultType$1 = { offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons rootMargin: 'string', @@ -5622,207 +6189,309 @@ /** * Class definition */ - - class ScrollSpy extends BaseComponent { - constructor(element, config) { - super(element, config); + var ScrollSpy = /*#__PURE__*/function (_BaseComponent9) { + function ScrollSpy(element, config) { + var _this47; + _classCallCheck(this, ScrollSpy); + _this47 = _callSuper(this, ScrollSpy, [element, config]); // this._element is the observablesContainer and config.target the menu links wrapper - this._targetLinks = new Map(); - this._observableSections = new Map(); - this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; - this._activeTarget = null; - this._observer = null; - this._previousScrollData = { + _this47._targetLinks = new Map(); + _this47._observableSections = new Map(); + _this47._rootElement = getComputedStyle(_this47._element).overflowY === 'visible' ? null : _this47._element; + _this47._activeTarget = null; + _this47._observer = null; + _this47._previousScrollData = { visibleEntryTop: 0, parentScrollTop: 0 }; - this.refresh(); // initialize + _this47.refresh(); // initialize + return _this47; } // Getters - static get Default() { - return Default$1; - } - static get DefaultType() { - return DefaultType$1; - } - static get NAME() { - return NAME$2; - } - - // Public - refresh() { - this._initializeTargetsAndObservables(); - this._maybeEnableSmoothScroll(); - if (this._observer) { + _inherits(ScrollSpy, _BaseComponent9); + return _createClass(ScrollSpy, [{ + key: "refresh", + value: + // Public + function refresh() { + this._initializeTargetsAndObservables(); + this._maybeEnableSmoothScroll(); + if (this._observer) { + this._observer.disconnect(); + } else { + this._observer = this._getNewObserver(); + } + var _iterator23 = _createForOfIteratorHelper(this._observableSections.values()), + _step23; + try { + for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) { + var section = _step23.value; + this._observer.observe(section); + } + } catch (err) { + _iterator23.e(err); + } finally { + _iterator23.f(); + } + } + }, { + key: "dispose", + value: function dispose() { this._observer.disconnect(); - } else { - this._observer = this._getNewObserver(); + _superPropGet(ScrollSpy, "dispose", this, 3)([]); } - for (const section of this._observableSections.values()) { - this._observer.observe(section); + + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case + config.target = getElement(config.target) || document.body; + + // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only + config.rootMargin = config.offset ? "".concat(config.offset, "px 0px -30%") : config.rootMargin; + if (typeof config.threshold === 'string') { + config.threshold = config.threshold.split(',').map(function (value) { + return Number.parseFloat(value); + }); + } + return config; } - } - dispose() { - this._observer.disconnect(); - super.dispose(); - } + }, { + key: "_maybeEnableSmoothScroll", + value: function _maybeEnableSmoothScroll() { + var _this48 = this; + if (!this._config.smoothScroll) { + return; + } - // Private - _configAfterMerge(config) { - // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case - config.target = getElement(config.target) || document.body; + // unregister any previous listeners + EventHandler.off(this._config.target, EVENT_CLICK); + EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, function (event) { + var observableSection = _this48._observableSections.get(event.target.hash); + if (observableSection) { + event.preventDefault(); + var root = _this48._rootElement || window; + var height = observableSection.offsetTop - _this48._element.offsetTop; + if (root.scrollTo) { + root.scrollTo({ + top: height, + behavior: 'smooth' + }); + return; + } - // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only - config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; - if (typeof config.threshold === 'string') { - config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); - } - return config; - } - _maybeEnableSmoothScroll() { - if (!this._config.smoothScroll) { - return; + // Chrome 60 doesn't support `scrollTo` + root.scrollTop = height; + } + }); } + }, { + key: "_getNewObserver", + value: function _getNewObserver() { + var _this49 = this; + var options = { + root: this._rootElement, + threshold: this._config.threshold, + rootMargin: this._config.rootMargin + }; + return new IntersectionObserver(function (entries) { + return _this49._observerCallback(entries); + }, options); + } + + // The logic of selection + }, { + key: "_observerCallback", + value: function _observerCallback(entries) { + var _this50 = this; + var targetElement = function targetElement(entry) { + return _this50._targetLinks.get("#".concat(entry.target.id)); + }; + var activate = function activate(entry) { + _this50._previousScrollData.visibleEntryTop = entry.target.offsetTop; + _this50._process(targetElement(entry)); + }; + var parentScrollTop = (this._rootElement || document.documentElement).scrollTop; + var userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; + this._previousScrollData.parentScrollTop = parentScrollTop; + var _iterator24 = _createForOfIteratorHelper(entries), + _step24; + try { + for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) { + var entry = _step24.value; + if (!entry.isIntersecting) { + this._activeTarget = null; + this._clearActiveClass(targetElement(entry)); + continue; + } + var entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; + // if we are scrolling down, pick the bigger offsetTop + if (userScrollsDown && entryIsLowerThanPrevious) { + activate(entry); + // if parent isn't scrolled, let's keep the first visible item, breaking the iteration + if (!parentScrollTop) { + return; + } + continue; + } - // unregister any previous listeners - EventHandler.off(this._config.target, EVENT_CLICK); - EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { - const observableSection = this._observableSections.get(event.target.hash); - if (observableSection) { - event.preventDefault(); - const root = this._rootElement || window; - const height = observableSection.offsetTop - this._element.offsetTop; - if (root.scrollTo) { - root.scrollTo({ - top: height, - behavior: 'smooth' - }); - return; + // if we are scrolling up, pick the smallest offsetTop + if (!userScrollsDown && !entryIsLowerThanPrevious) { + activate(entry); + } } - - // Chrome 60 doesn't support `scrollTo` - root.scrollTop = height; + } catch (err) { + _iterator24.e(err); + } finally { + _iterator24.f(); } - }); - } - _getNewObserver() { - const options = { - root: this._rootElement, - threshold: this._config.threshold, - rootMargin: this._config.rootMargin - }; - return new IntersectionObserver(entries => this._observerCallback(entries), options); - } + } + }, { + key: "_initializeTargetsAndObservables", + value: function _initializeTargetsAndObservables() { + this._targetLinks = new Map(); + this._observableSections = new Map(); + var targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); + var _iterator25 = _createForOfIteratorHelper(targetLinks), + _step25; + try { + for (_iterator25.s(); !(_step25 = _iterator25.n()).done;) { + var anchor = _step25.value; + // ensure that the anchor has an id and is not disabled + if (!anchor.hash || isDisabled(anchor)) { + continue; + } + var observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); - // The logic of selection - _observerCallback(entries) { - const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); - const activate = entry => { - this._previousScrollData.visibleEntryTop = entry.target.offsetTop; - this._process(targetElement(entry)); - }; - const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; - const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; - this._previousScrollData.parentScrollTop = parentScrollTop; - for (const entry of entries) { - if (!entry.isIntersecting) { - this._activeTarget = null; - this._clearActiveClass(targetElement(entry)); - continue; - } - const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; - // if we are scrolling down, pick the bigger offsetTop - if (userScrollsDown && entryIsLowerThanPrevious) { - activate(entry); - // if parent isn't scrolled, let's keep the first visible item, breaking the iteration - if (!parentScrollTop) { - return; + // ensure that the observableSection exists & is visible + if (isVisible(observableSection)) { + this._targetLinks.set(decodeURI(anchor.hash), anchor); + this._observableSections.set(anchor.hash, observableSection); + } } - continue; + } catch (err) { + _iterator25.e(err); + } finally { + _iterator25.f(); } - - // if we are scrolling up, pick the smallest offsetTop - if (!userScrollsDown && !entryIsLowerThanPrevious) { - activate(entry); + } + }, { + key: "_process", + value: function _process(target) { + if (this._activeTarget === target) { + return; } + this._clearActiveClass(this._config.target); + this._activeTarget = target; + target.classList.add(CLASS_NAME_ACTIVE$1); + this._activateParents(target); + EventHandler.trigger(this._element, EVENT_ACTIVATE, { + relatedTarget: target + }); } - } - _initializeTargetsAndObservables() { - this._targetLinks = new Map(); - this._observableSections = new Map(); - const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); - for (const anchor of targetLinks) { - // ensure that the anchor has an id and is not disabled - if (!anchor.hash || isDisabled(anchor)) { - continue; + }, { + key: "_activateParents", + value: function _activateParents(target) { + // Activate dropdown parents + if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { + SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); + return; } - const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); - - // ensure that the observableSection exists & is visible - if (isVisible(observableSection)) { - this._targetLinks.set(decodeURI(anchor.hash), anchor); - this._observableSections.set(anchor.hash, observableSection); + var _iterator26 = _createForOfIteratorHelper(SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)), + _step26; + try { + for (_iterator26.s(); !(_step26 = _iterator26.n()).done;) { + var listGroup = _step26.value; + // Set triggered links parents as active + // With both
      and
    ',title:"",trigger:"hover focus"},vr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},mr=function(e){function t(e,n){var i;if(_classCallCheck(this,t),void 0===Sn)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(i=_callSuper(this,t,[e,n]))._isEnabled=!0,i._timeout=0,i._isHovered=null,i._activeTrigger={},i._popper=null,i._templateFactory=null,i._newContent=null,i.tip=null,i._setListeners(),i._config.selector||i._fixTitle(),i}return _inherits(t,e),_createClass(t,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}},{key:"dispose",value:function(){clearTimeout(this._timeout),M.off(this._element.closest(ur),fr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),_superPropGet(t,"dispose",this,3)([])}},{key:"show",value:function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=M.trigger(this._element,this.constructor.eventName("show")),n=(f(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&n){this._disposePopper();var i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));var r=this._config.container;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),M.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(cr),"ontouchstart"in document.documentElement){var o,a,s=_createForOfIteratorHelper((o=[]).concat.apply(o,_toConsumableArray(document.body.children)));try{for(s.s();!(a=s.n()).done;){var l=a.value;M.on(l,"mouseover",d)}}catch(e){s.e(e)}finally{s.f()}}this._queueCallback((function(){M.trigger(e._element,e.constructor.eventName("shown")),!1===e._isHovered&&e._leave(),e._isHovered=!1}),this.tip,this._isAnimated())}}}},{key:"hide",value:function(){var e=this;if(this._isShown()&&!M.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(cr),"ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;M.off(r,"mouseover",d)}}catch(e){i.e(e)}finally{i.f()}}this._activeTrigger.click=!1,this._activeTrigger[hr]=!1,this._activeTrigger[dr]=!1,this._isHovered=null;this._queueCallback((function(){e._isWithActiveTrigger()||(e._isHovered||e._disposePopper(),e._element.removeAttribute("aria-describedby"),M.trigger(e._element,e.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}},{key:"update",value:function(){this._popper&&this._popper.update()}},{key:"_isWithContent",value:function(){return Boolean(this._getTitle())}},{key:"_getTipElement",value:function(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}},{key:"_createTipElement",value:function(e){var t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(lr,cr),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));var n=function(e){do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e}(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(lr),t}},{key:"setContent",value:function(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}},{key:"_getTemplateFactory",value:function(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new ar(_objectSpread(_objectSpread({},this._config),{},{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}},{key:"_getContentForTemplate",value:function(){return _defineProperty({},".tooltip-inner",this._getTitle())}},{key:"_getTitle",value:function(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}},{key:"_initializeOnDelegatedTarget",value:function(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}},{key:"_isAnimated",value:function(){return this._config.animation||this.tip&&this.tip.classList.contains(lr)}},{key:"_isShown",value:function(){return this.tip&&this.tip.classList.contains(cr)}},{key:"_createPopper",value:function(e){var t=g(this._config.placement,[this,e,this._element]),n=pr[t.toUpperCase()];return Tn(this._element,e,this._getPopperConfig(n))}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_resolvePossibleFunction",value:function(e){return g(e,[this._element])}},{key:"_getPopperConfig",value:function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:function(e){t._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return _objectSpread(_objectSpread({},n),g(this._config.popperConfig,[n]))}},{key:"_setListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(this._config.trigger.split(" "));try{for(n.s();!(e=n.n()).done;){var i=e.value;if("click"===i)M.on(this._element,this.constructor.eventName("click"),this._config.selector,(function(e){t._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==i){var r=i===dr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),o=i===dr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");M.on(this._element,r,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusin"===e.type?hr:dr]=!0,n._enter()})),M.on(this._element,o,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusout"===e.type?hr:dr]=n._element.contains(e.relatedTarget),n._leave()}))}}}catch(e){n.e(e)}finally{n.f()}this._hideModalHandler=function(){t._element&&t.hide()},M.on(this._element.closest(ur),fr,this._hideModalHandler)}},{key:"_fixTitle",value:function(){var e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}},{key:"_enter",value:function(){var e=this;this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((function(){e._isHovered&&e.show()}),this._config.delay.show))}},{key:"_leave",value:function(){var e=this;this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((function(){e._isHovered||e.hide()}),this._config.delay.hide))}},{key:"_setTimeout",value:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}},{key:"_isWithActiveTrigger",value:function(){return Object.values(this._activeTrigger).includes(!0)}},{key:"_getConfig",value:function(e){for(var t=z(this._element),n=0,i=Object.keys(t);n

    ',trigger:"click"}),yr=_objectSpread(_objectSpread({},mr.DefaultType),{},{content:"(null|string|element|function)"}),br=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"_isWithContent",value:function(){return this._getTitle()||this._getContent()}},{key:"_getContentForTemplate",value:function(){return _defineProperty(_defineProperty({},".popover-header",this._getTitle()),".popover-body",this._getContent())}},{key:"_getContent",value:function(){return this._resolvePossibleFunction(this._config.content)}}],[{key:"Default",get:function(){return gr}},{key:"DefaultType",get:function(){return yr}},{key:"NAME",get:function(){return"popover"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(mr);m(br);var kr=".".concat("bs.scrollspy"),wr="activate".concat(kr),Cr="click".concat(kr),Ar="load".concat(kr).concat(".data-api"),Or="active",Er="[href]",Tr=".nav-link",Sr="".concat(Tr,", ").concat(".nav-item"," > ").concat(Tr,", ").concat(".list-group-item"),xr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ir={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},Pr=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._targetLinks=new Map,i._observableSections=new Map,i._rootElement="visible"===getComputedStyle(i._element).overflowY?null:i._element,i._activeTarget=null,i._observer=null,i._previousScrollData={visibleEntryTop:0,parentScrollTop:0},i.refresh(),i}return _inherits(t,e),_createClass(t,[{key:"refresh",value:function(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();var e,t=_createForOfIteratorHelper(this._observableSections.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._observer.observe(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){this._observer.disconnect(),_superPropGet(t,"dispose",this,3)([])}},{key:"_configAfterMerge",value:function(e){return e.target=l(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((function(e){return Number.parseFloat(e)}))),e}},{key:"_maybeEnableSmoothScroll",value:function(){var e=this;this._config.smoothScroll&&(M.off(this._config.target,Cr),M.on(this._config.target,Cr,Er,(function(t){var n=e._observableSections.get(t.target.hash);if(n){t.preventDefault();var i=e._rootElement||window,r=n.offsetTop-e._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:r,behavior:"smooth"});i.scrollTop=r}})))}},{key:"_getNewObserver",value:function(){var e=this,t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((function(t){return e._observerCallback(t)}),t)}},{key:"_observerCallback",value:function(e){var t=this,n=function(e){return t._targetLinks.get("#".concat(e.target.id))},i=function(e){t._previousScrollData.visibleEntryTop=e.target.offsetTop,t._process(n(e))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;var a,s=_createForOfIteratorHelper(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.isIntersecting){var c=l.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&c){if(i(l),!r)return}else o||c||i(l)}else this._activeTarget=null,this._clearActiveClass(n(l))}}catch(e){s.e(e)}finally{s.f()}}},{key:"_initializeTargetsAndObservables",value:function(){this._targetLinks=new Map,this._observableSections=new Map;var e,t=_createForOfIteratorHelper(U.find(Er,this._config.target));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.hash&&!u(n)){var i=U.findOne(decodeURI(n.hash),this._element);c(i)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,i))}}}catch(e){t.e(e)}finally{t.f()}}},{key:"_process",value:function(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Or),this._activateParents(e),M.trigger(this._element,wr,{relatedTarget:e}))}},{key:"_activateParents",value:function(e){if(e.classList.contains("dropdown-item"))U.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Or);else{var t,n=_createForOfIteratorHelper(U.parents(e,".nav, .list-group"));try{for(n.s();!(t=n.n()).done;){var i,r=t.value,o=_createForOfIteratorHelper(U.prev(r,Sr));try{for(o.s();!(i=o.n()).done;){i.value.classList.add(Or)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_clearActiveClass",value:function(e){e.classList.remove(Or);var t,n=_createForOfIteratorHelper(U.find("".concat(Er,".").concat(Or),e));try{for(n.s();!(t=n.n()).done;){t.value.classList.remove(Or)}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"Default",get:function(){return xr}},{key:"DefaultType",get:function(){return Ir}},{key:"NAME",get:function(){return"scrollspy"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(K);M.on(window,Ar,(function(){var e,t=_createForOfIteratorHelper(U.find('[data-bs-spy="scroll"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;Pr.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),m(Pr);var Lr=".".concat("bs.tab"),jr="hide".concat(Lr),Dr="hidden".concat(Lr),Nr="show".concat(Lr),Mr="shown".concat(Lr),Fr="click".concat(Lr),Hr="keydown".concat(Lr),Rr="load".concat(Lr),Wr="ArrowLeft",Br="ArrowRight",zr="ArrowUp",qr="ArrowDown",Vr="Home",Kr="End",Qr="active",Ur="fade",Xr="show",Yr=".dropdown-toggle",Gr=":not(".concat(Yr,")"),$r=".nav-link".concat(Gr,", .list-group-item").concat(Gr,', [role="tab"]').concat(Gr),Jr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Zr="".concat($r,", ").concat(Jr),eo=".".concat(Qr,'[data-bs-toggle="tab"], .').concat(Qr,'[data-bs-toggle="pill"], .').concat(Qr,'[data-bs-toggle="list"]'),to=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t,[e]))._parent=n._element.closest('.list-group, .nav, [role="tablist"]'),n._parent?(n._setInitialAttributes(n._parent,n._getChildren()),M.on(n._element,Hr,(function(e){return n._keydown(e)})),n):_possibleConstructorReturn(n)}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this._element;if(!this._elemIsActive(e)){var t=this._getActiveElem(),n=t?M.trigger(t,jr,{relatedTarget:e}):null;M.trigger(e,Nr,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}}},{key:"_activate",value:function(e,t){var n=this;if(e){e.classList.add(Qr),this._activate(U.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),n._toggleDropDown(e,!0),M.trigger(e,Mr,{relatedTarget:t})):e.classList.add(Xr)}),e,e.classList.contains(Ur))}}},{key:"_deactivate",value:function(e,t){var n=this;if(e){e.classList.remove(Qr),e.blur(),this._deactivate(U.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),n._toggleDropDown(e,!1),M.trigger(e,Dr,{relatedTarget:t})):e.classList.remove(Xr)}),e,e.classList.contains(Ur))}}},{key:"_keydown",value:function(e){if([Wr,Br,zr,qr,Vr,Kr].includes(e.key)){e.stopPropagation(),e.preventDefault();var n,i=this._getChildren().filter((function(e){return!u(e)}));if([Vr,Kr].includes(e.key))n=i[e.key===Vr?0:i.length-1];else{var r=[Br,qr].includes(e.key);n=b(i,e.target,r,!0)}n&&(n.focus({preventScroll:!0}),t.getOrCreateInstance(n).show())}}},{key:"_getChildren",value:function(){return U.find(Zr,this._parent)}},{key:"_getActiveElem",value:function(){var e=this;return this._getChildren().find((function(t){return e._elemIsActive(t)}))||null}},{key:"_setInitialAttributes",value:function(e,t){this._setAttributeIfNotExists(e,"role","tablist");var n,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._setInitialAttributesOnChild(r)}}catch(e){i.e(e)}finally{i.f()}}},{key:"_setInitialAttributesOnChild",value:function(e){e=this._getInnerElement(e);var t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}},{key:"_setInitialAttributesOnTargetPanel",value:function(e){var t=U.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}},{key:"_toggleDropDown",value:function(e,t){var n=this._getOuterElement(e);if(n.classList.contains("dropdown")){var i=function(e,i){var r=U.findOne(e,n);r&&r.classList.toggle(i,t)};i(Yr,Qr),i(".dropdown-menu",Xr),n.setAttribute("aria-expanded",t)}}},{key:"_setAttributeIfNotExists",value:function(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}},{key:"_elemIsActive",value:function(e){return e.classList.contains(Qr)}},{key:"_getInnerElement",value:function(e){return e.matches(Zr)?e:U.findOne(Zr,e)}},{key:"_getOuterElement",value:function(e){return e.closest(".nav-item, .list-group-item")||e}}],[{key:"NAME",get:function(){return"tab"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(K);M.on(document,Fr,Jr,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),u(this)||to.getOrCreateInstance(this).show()})),M.on(window,Rr,(function(){var e,t=_createForOfIteratorHelper(U.find(eo));try{for(t.s();!(e=t.n()).done;){var n=e.value;to.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),m(to);var no=".".concat("bs.toast"),io="mouseover".concat(no),ro="mouseout".concat(no),oo="focusin".concat(no),ao="focusout".concat(no),so="hide".concat(no),lo="hidden".concat(no),co="show".concat(no),uo="shown".concat(no),fo="hide",ho="show",po="showing",_o={animation:"boolean",autohide:"boolean",delay:"number"},vo={animation:!0,autohide:!0,delay:5e3},mo=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._timeout=null,i._hasMouseInteraction=!1,i._hasKeyboardInteraction=!1,i._setListeners(),i}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this;if(!M.trigger(this._element,co).defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(fo),h(this._element),this._element.classList.add(ho,po),this._queueCallback((function(){e._element.classList.remove(po),M.trigger(e._element,uo),e._maybeScheduleHide()}),this._element,this._config.animation)}}},{key:"hide",value:function(){var e=this;if(this.isShown()&&!M.trigger(this._element,so).defaultPrevented){this._element.classList.add(po),this._queueCallback((function(){e._element.classList.add(fo),e._element.classList.remove(po,ho),M.trigger(e._element,lo)}),this._element,this._config.animation)}}},{key:"dispose",value:function(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ho),_superPropGet(t,"dispose",this,3)([])}},{key:"isShown",value:function(){return this._element.classList.contains(ho)}},{key:"_maybeScheduleHide",value:function(){var e=this;this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((function(){e.hide()}),this._config.delay)))}},{key:"_onInteraction",value:function(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)this._clearTimeout();else{var n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}}},{key:"_setListeners",value:function(){var e=this;M.on(this._element,io,(function(t){return e._onInteraction(t,!0)})),M.on(this._element,ro,(function(t){return e._onInteraction(t,!1)})),M.on(this._element,oo,(function(t){return e._onInteraction(t,!0)})),M.on(this._element,ao,(function(t){return e._onInteraction(t,!1)}))}},{key:"_clearTimeout",value:function(){clearTimeout(this._timeout),this._timeout=null}}],[{key:"Default",get:function(){return vo}},{key:"DefaultType",get:function(){return _o}},{key:"NAME",get:function(){return"toast"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(K);return X(mo),m(mo),{Alert:J,Button:ne,Carousel:De,Collapse:Xe,Dropdown:Zn,Modal:Di,Offcanvas:Ji,Popover:br,ScrollSpy:Pr,Tab:to,Toast:mo,Tooltip:mr}})); diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js index e3a59e3a1c3..e3836898f76 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js @@ -1,32 +1,72 @@ +/* +** NOTE: This file is generated by Gulp and should not be edited directly! +** Any changes made directly to this file will be overwritten next time its asset group is processed by Gulp. +*/ + +function _superPropGet(t, o, e, r) { var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } +function _get() { return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = _superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, _get.apply(null, arguments); } +function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); return t; } +function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } +function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } +function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } +function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } +function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } +function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } +function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } +function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } +function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); } +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } +function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; } +function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } +function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } +function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } +function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*! * Bootstrap v5.3.3 (https://getbootstrap.com/) * Copyright 2011-2024 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' ? module.exports = factory(require('@popperjs/core')) : - typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); -})(this, (function (Popper) { 'use strict'; + (typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('@popperjs/core')) : typeof define === 'function' && define.amd ? define(['@popperjs/core'], factory) : (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory(global.Popper)); +})(this, function (Popper) { + 'use strict'; function _interopNamespaceDefault(e) { - const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } }); + var n = Object.create(null, _defineProperty({}, Symbol.toStringTag, { + value: 'Module' + })); if (e) { - for (const k in e) { + var _loop = function _loop(k) { if (k !== 'default') { - const d = Object.getOwnPropertyDescriptor(e, k); + var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: () => e[k] + get: function get() { + return e[k]; + } }); } + }; + for (var k in e) { + _loop(k); } } - n.default = e; + n["default"] = e; return Object.freeze(n); } - - const Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); + var Popper__namespace = /*#__PURE__*/_interopNamespaceDefault(Popper); /** * -------------------------------------------------------------------------- @@ -39,39 +79,39 @@ * Constants */ - const elementMap = new Map(); - const Data = { - set(element, key, instance) { + var elementMap = new Map(); + var Data = { + set: function set(element, key, instance) { if (!elementMap.has(element)) { elementMap.set(element, new Map()); } - const instanceMap = elementMap.get(element); + var instanceMap = elementMap.get(element); // make it clear we only want one instance per element // can be removed later when multiple key/instances are fine to be used if (!instanceMap.has(key) && instanceMap.size !== 0) { // eslint-disable-next-line no-console - console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); + console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(instanceMap.keys())[0], ".")); return; } instanceMap.set(key, instance); }, - get(element, key) { + get: function get(element, key) { if (elementMap.has(element)) { return elementMap.get(element).get(key) || null; } return null; }, - remove(element, key) { + remove: function remove(element, key) { if (!elementMap.has(element)) { return; } - const instanceMap = elementMap.get(element); - instanceMap.delete(key); + var instanceMap = elementMap.get(element); + instanceMap["delete"](key); // free up element references if there are no instances left for an element if (instanceMap.size === 0) { - elementMap.delete(element); + elementMap["delete"](element); } } }; @@ -83,27 +123,29 @@ * -------------------------------------------------------------------------- */ - const MAX_UID = 1000000; - const MILLISECONDS_MULTIPLIER = 1000; - const TRANSITION_END = 'transitionend'; + var MAX_UID = 1000000; + var MILLISECONDS_MULTIPLIER = 1000; + var TRANSITION_END = 'transitionend'; /** * Properly escape IDs selectors to handle weird IDs * @param {string} selector * @returns {string} */ - const parseSelector = selector => { + var parseSelector = function parseSelector(selector) { if (selector && window.CSS && window.CSS.escape) { // document.querySelector needs escaping to handle IDs (html5+) containing for instance / - selector = selector.replace(/#([^\s"#']+)/g, (match, id) => `#${CSS.escape(id)}`); + selector = selector.replace(/#([^\s"#']+)/g, function (match, id) { + return "#".concat(CSS.escape(id)); + }); } return selector; }; // Shout-out Angus Croll (https://goo.gl/pxwQGp) - const toType = object => { + var toType = function toType(object) { if (object === null || object === undefined) { - return `${object}`; + return "".concat(object); } return Object.prototype.toString.call(object).match(/\s([a-z]+)/i)[1].toLowerCase(); }; @@ -112,24 +154,23 @@ * Public Util API */ - const getUID = prefix => { + var getUID = function getUID(prefix) { do { prefix += Math.floor(Math.random() * MAX_UID); } while (document.getElementById(prefix)); return prefix; }; - const getTransitionDurationFromElement = element => { + var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) { if (!element) { return 0; } // Get transition-duration of the element - let { - transitionDuration, - transitionDelay - } = window.getComputedStyle(element); - const floatTransitionDuration = Number.parseFloat(transitionDuration); - const floatTransitionDelay = Number.parseFloat(transitionDelay); + var _window$getComputedSt = window.getComputedStyle(element), + transitionDuration = _window$getComputedSt.transitionDuration, + transitionDelay = _window$getComputedSt.transitionDelay; + var floatTransitionDuration = Number.parseFloat(transitionDuration); + var floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found if (!floatTransitionDuration && !floatTransitionDelay) { @@ -141,11 +182,11 @@ transitionDelay = transitionDelay.split(',')[0]; return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; }; - const triggerTransitionEnd = element => { + var triggerTransitionEnd = function triggerTransitionEnd(element) { element.dispatchEvent(new Event(TRANSITION_END)); }; - const isElement = object => { - if (!object || typeof object !== 'object') { + var isElement = function isElement(object) { + if (!object || _typeof(object) !== 'object') { return false; } if (typeof object.jquery !== 'undefined') { @@ -153,7 +194,7 @@ } return typeof object.nodeType !== 'undefined'; }; - const getElement = object => { + var getElement = function getElement(object) { // it's a jQuery object or a node element if (isElement(object)) { return object.jquery ? object[0] : object; @@ -163,18 +204,18 @@ } return null; }; - const isVisible = element => { + var isVisible = function isVisible(element) { if (!isElement(element) || element.getClientRects().length === 0) { return false; } - const elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; + var elementIsVisible = getComputedStyle(element).getPropertyValue('visibility') === 'visible'; // Handle `details` element as its content may falsie appear visible when it is closed - const closedDetails = element.closest('details:not([open])'); + var closedDetails = element.closest('details:not([open])'); if (!closedDetails) { return elementIsVisible; } if (closedDetails !== element) { - const summary = element.closest('summary'); + var summary = element.closest('summary'); if (summary && summary.parentNode !== closedDetails) { return false; } @@ -184,7 +225,7 @@ } return elementIsVisible; }; - const isDisabled = element => { + var isDisabled = function isDisabled(element) { if (!element || element.nodeType !== Node.ELEMENT_NODE) { return true; } @@ -196,14 +237,14 @@ } return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; }; - const findShadowRoot = element => { + var _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') { - const root = element.getRootNode(); + var root = element.getRootNode(); return root instanceof ShadowRoot ? root : null; } if (element instanceof ShadowRoot) { @@ -214,9 +255,9 @@ if (!element.parentNode) { return null; } - return findShadowRoot(element.parentNode); + return _findShadowRoot(element.parentNode); }; - const noop = () => {}; + var noop = function noop() {}; /** * Trick to restart an element's animation @@ -226,23 +267,24 @@ * * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation */ - const reflow = element => { + var reflow = function reflow(element) { element.offsetHeight; // eslint-disable-line no-unused-expressions }; - const getjQuery = () => { + var getjQuery = function getjQuery() { if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { return window.jQuery; } return null; }; - const DOMContentLoadedCallbacks = []; - const onDOMContentLoaded = callback => { + var DOMContentLoadedCallbacks = []; + var onDOMContentLoaded = function onDOMContentLoaded(callback) { if (document.readyState === 'loading') { // add listener on the first call when the document is in loading state if (!DOMContentLoadedCallbacks.length) { - document.addEventListener('DOMContentLoaded', () => { - for (const callback of DOMContentLoadedCallbacks) { - callback(); + document.addEventListener('DOMContentLoaded', function () { + for (var _i = 0, _DOMContentLoadedCall = DOMContentLoadedCallbacks; _i < _DOMContentLoadedCall.length; _i++) { + var _callback = _DOMContentLoadedCall[_i]; + _callback(); } }); } @@ -251,46 +293,50 @@ callback(); } }; - const isRTL = () => document.documentElement.dir === 'rtl'; - const defineJQueryPlugin = plugin => { - onDOMContentLoaded(() => { - const $ = getjQuery(); + var isRTL = function isRTL() { + return document.documentElement.dir === 'rtl'; + }; + var defineJQueryPlugin = function defineJQueryPlugin(plugin) { + onDOMContentLoaded(function () { + var $ = getjQuery(); /* istanbul ignore if */ if ($) { - const name = plugin.NAME; - const JQUERY_NO_CONFLICT = $.fn[name]; + var name = plugin.NAME; + var JQUERY_NO_CONFLICT = $.fn[name]; $.fn[name] = plugin.jQueryInterface; $.fn[name].Constructor = plugin; - $.fn[name].noConflict = () => { + $.fn[name].noConflict = function () { $.fn[name] = JQUERY_NO_CONFLICT; return plugin.jQueryInterface; }; } }); }; - const execute = (possibleCallback, args = [], defaultValue = possibleCallback) => { - return typeof possibleCallback === 'function' ? possibleCallback(...args) : defaultValue; + var execute = function execute(possibleCallback) { + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; + var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : possibleCallback; + return typeof possibleCallback === 'function' ? possibleCallback.apply(void 0, _toConsumableArray(args)) : defaultValue; }; - const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { + var executeAfterTransition = function executeAfterTransition(callback, transitionElement) { + var waitForTransition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; if (!waitForTransition) { execute(callback); return; } - const durationPadding = 5; - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; - let called = false; - const handler = ({ - target - }) => { + var durationPadding = 5; + var emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; + var called = false; + var _handler = function handler(_ref) { + var target = _ref.target; if (target !== transitionElement) { return; } called = true; - transitionElement.removeEventListener(TRANSITION_END, handler); + transitionElement.removeEventListener(TRANSITION_END, _handler); execute(callback); }; - transitionElement.addEventListener(TRANSITION_END, handler); - setTimeout(() => { + transitionElement.addEventListener(TRANSITION_END, _handler); + setTimeout(function () { if (!called) { triggerTransitionEnd(transitionElement); } @@ -306,9 +352,9 @@ * @param isCycleAllowed * @return {Element|elem} The proper element */ - const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { - const listLength = list.length; - let index = list.indexOf(activeElement); + var getNextActiveElement = function getNextActiveElement(list, activeElement, shouldGetNext, isCycleAllowed) { + var listLength = list.length; + var index = list.indexOf(activeElement); // if the element does not exist in the list return an element // depending on the direction and if cycle is allowed @@ -329,31 +375,30 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const namespaceRegex = /[^.]*(?=\..*)\.|.*/; - const stripNameRegex = /\..*/; - const stripUidRegex = /::\d+$/; - const eventRegistry = {}; // Events storage - let uidEvent = 1; - const customEvents = { + var namespaceRegex = /[^.]*(?=\..*)\.|.*/; + var stripNameRegex = /\..*/; + var stripUidRegex = /::\d+$/; + var eventRegistry = {}; // Events storage + var uidEvent = 1; + var customEvents = { mouseenter: 'mouseover', mouseleave: 'mouseout' }; - const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); + var nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); /** * Private methods */ function makeEventUid(element, uid) { - return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; + return uid && "".concat(uid, "::").concat(uidEvent++) || element.uidEvent || uidEvent++; } function getElementEvents(element) { - const uid = makeEventUid(element); + var uid = makeEventUid(element); element.uidEvent = uid; eventRegistry[uid] = eventRegistry[uid] || {}; return eventRegistry[uid]; @@ -371,33 +416,43 @@ } function bootstrapDelegationHandler(element, selector, fn) { return function handler(event) { - const domElements = element.querySelectorAll(selector); - for (let { - target - } = event; target && target !== this; target = target.parentNode) { - for (const domElement of domElements) { - if (domElement !== target) { - continue; - } - hydrateObj(event, { - delegateTarget: target - }); - if (handler.oneOff) { - EventHandler.off(element, event.type, selector, fn); + var domElements = element.querySelectorAll(selector); + for (var target = event.target; target && target !== this; target = target.parentNode) { + var _iterator = _createForOfIteratorHelper(domElements), + _step; + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var domElement = _step.value; + if (domElement !== target) { + continue; + } + hydrateObj(event, { + delegateTarget: target + }); + if (handler.oneOff) { + EventHandler.off(element, event.type, selector, fn); + } + return fn.apply(target, [event]); } - return fn.apply(target, [event]); + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); } } }; } - function findHandler(events, callable, delegationSelector = null) { - return Object.values(events).find(event => event.callable === callable && event.delegationSelector === delegationSelector); + function findHandler(events, callable) { + var delegationSelector = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; + return Object.values(events).find(function (event) { + return event.callable === callable && event.delegationSelector === delegationSelector; + }); } function normalizeParameters(originalTypeEvent, handler, delegationFunction) { - const isDelegated = typeof handler === 'string'; + var isDelegated = typeof handler === 'string'; // TODO: tooltip passes `false` instead of selector, so we need to check - const callable = isDelegated ? delegationFunction : handler || delegationFunction; - let typeEvent = getTypeEvent(originalTypeEvent); + var callable = isDelegated ? delegationFunction : handler || delegationFunction; + var typeEvent = getTypeEvent(originalTypeEvent); if (!nativeEvents.has(typeEvent)) { typeEvent = originalTypeEvent; } @@ -407,12 +462,16 @@ if (typeof originalTypeEvent !== 'string' || !element) { return; } - let [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); + var _normalizeParameters = normalizeParameters(originalTypeEvent, handler, delegationFunction), + _normalizeParameters2 = _slicedToArray(_normalizeParameters, 3), + isDelegated = _normalizeParameters2[0], + callable = _normalizeParameters2[1], + typeEvent = _normalizeParameters2[2]; // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position // this prevents the handler from being dispatched the same way as mouseover or mouseout does if (originalTypeEvent in customEvents) { - const wrapFunction = fn => { + var wrapFunction = function wrapFunction(fn) { return function (event) { if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { return fn.call(this, event); @@ -421,15 +480,15 @@ }; callable = wrapFunction(callable); } - const events = getElementEvents(element); - const handlers = events[typeEvent] || (events[typeEvent] = {}); - const previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); + var events = getElementEvents(element); + var handlers = events[typeEvent] || (events[typeEvent] = {}); + var previousFunction = findHandler(handlers, callable, isDelegated ? handler : null); if (previousFunction) { previousFunction.oneOff = previousFunction.oneOff && oneOff; return; } - const uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); - const fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); + var uid = makeEventUid(callable, originalTypeEvent.replace(namespaceRegex, '')); + var fn = isDelegated ? bootstrapDelegationHandler(element, handler, callable) : bootstrapHandler(element, callable); fn.delegationSelector = isDelegated ? handler : null; fn.callable = callable; fn.oneOff = oneOff; @@ -438,7 +497,7 @@ element.addEventListener(typeEvent, fn, isDelegated); } function removeHandler(element, events, typeEvent, handler, delegationSelector) { - const fn = findHandler(events[typeEvent], handler, delegationSelector); + var fn = findHandler(events[typeEvent], handler, delegationSelector); if (!fn) { return; } @@ -446,8 +505,11 @@ delete events[typeEvent][fn.uidEvent]; } function removeNamespacedHandlers(element, events, typeEvent, namespace) { - const storeElementEvent = events[typeEvent] || {}; - for (const [handlerKey, event] of Object.entries(storeElementEvent)) { + var storeElementEvent = events[typeEvent] || {}; + for (var _i2 = 0, _Object$entries = Object.entries(storeElementEvent); _i2 < _Object$entries.length; _i2++) { + var _Object$entries$_i = _slicedToArray(_Object$entries[_i2], 2), + handlerKey = _Object$entries$_i[0], + event = _Object$entries$_i[1]; if (handlerKey.includes(namespace)) { removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } @@ -458,22 +520,26 @@ event = event.replace(stripNameRegex, ''); return customEvents[event] || event; } - const EventHandler = { - on(element, event, handler, delegationFunction) { + var EventHandler = { + on: function on(element, event, handler, delegationFunction) { addHandler(element, event, handler, delegationFunction, false); }, - one(element, event, handler, delegationFunction) { + one: function one(element, event, handler, delegationFunction) { addHandler(element, event, handler, delegationFunction, true); }, - off(element, originalTypeEvent, handler, delegationFunction) { + off: function off(element, originalTypeEvent, handler, delegationFunction) { if (typeof originalTypeEvent !== 'string' || !element) { return; } - const [isDelegated, callable, typeEvent] = normalizeParameters(originalTypeEvent, handler, delegationFunction); - const inNamespace = typeEvent !== originalTypeEvent; - const events = getElementEvents(element); - const storeElementEvent = events[typeEvent] || {}; - const isNamespace = originalTypeEvent.startsWith('.'); + var _normalizeParameters3 = normalizeParameters(originalTypeEvent, handler, delegationFunction), + _normalizeParameters4 = _slicedToArray(_normalizeParameters3, 3), + isDelegated = _normalizeParameters4[0], + callable = _normalizeParameters4[1], + typeEvent = _normalizeParameters4[2]; + var inNamespace = typeEvent !== originalTypeEvent; + var events = getElementEvents(element); + var storeElementEvent = events[typeEvent] || {}; + var isNamespace = originalTypeEvent.startsWith('.'); if (typeof callable !== 'undefined') { // Simplest case: handler is passed, remove that listener ONLY. if (!Object.keys(storeElementEvent).length) { @@ -483,28 +549,32 @@ return; } if (isNamespace) { - for (const elementEvent of Object.keys(events)) { + for (var _i3 = 0, _Object$keys = Object.keys(events); _i3 < _Object$keys.length; _i3++) { + var elementEvent = _Object$keys[_i3]; removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); } } - for (const [keyHandlers, event] of Object.entries(storeElementEvent)) { - const handlerKey = keyHandlers.replace(stripUidRegex, ''); + for (var _i4 = 0, _Object$entries2 = Object.entries(storeElementEvent); _i4 < _Object$entries2.length; _i4++) { + var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i4], 2), + keyHandlers = _Object$entries2$_i[0], + event = _Object$entries2$_i[1]; + var handlerKey = keyHandlers.replace(stripUidRegex, ''); if (!inNamespace || originalTypeEvent.includes(handlerKey)) { removeHandler(element, events, typeEvent, event.callable, event.delegationSelector); } } }, - trigger(element, event, args) { + trigger: function trigger(element, event, args) { if (typeof event !== 'string' || !element) { return null; } - const $ = getjQuery(); - const typeEvent = getTypeEvent(event); - const inNamespace = event !== typeEvent; - let jQueryEvent = null; - let bubbles = true; - let nativeDispatch = true; - let defaultPrevented = false; + var $ = getjQuery(); + var typeEvent = getTypeEvent(event); + var inNamespace = event !== typeEvent; + var jQueryEvent = null; + var bubbles = true; + var nativeDispatch = true; + var defaultPrevented = false; if (inNamespace && $) { jQueryEvent = $.Event(event, args); $(element).trigger(jQueryEvent); @@ -512,8 +582,8 @@ nativeDispatch = !jQueryEvent.isImmediatePropagationStopped(); defaultPrevented = jQueryEvent.isDefaultPrevented(); } - const evt = hydrateObj(new Event(event, { - bubbles, + var evt = hydrateObj(new Event(event, { + bubbles: bubbles, cancelable: true }), args); if (defaultPrevented) { @@ -528,18 +598,25 @@ return evt; } }; - function hydrateObj(obj, meta = {}) { - for (const [key, value] of Object.entries(meta)) { + function hydrateObj(obj) { + var meta = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var _loop2 = function _loop2() { + var _Object$entries3$_i = _slicedToArray(_Object$entries3[_i5], 2), + key = _Object$entries3$_i[0], + value = _Object$entries3$_i[1]; try { obj[key] = value; } catch (_unused) { Object.defineProperty(obj, key, { configurable: true, - get() { + get: function get() { return value; } }); } + }; + for (var _i5 = 0, _Object$entries3 = Object.entries(meta); _i5 < _Object$entries3.length; _i5++) { + _loop2(); } return obj; } @@ -574,30 +651,43 @@ } } function normalizeDataKey(key) { - return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); + return key.replace(/[A-Z]/g, function (chr) { + return "-".concat(chr.toLowerCase()); + }); } - const Manipulator = { - setDataAttribute(element, key, value) { - element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value); + var Manipulator = { + setDataAttribute: function setDataAttribute(element, key, value) { + element.setAttribute("data-bs-".concat(normalizeDataKey(key)), value); }, - removeDataAttribute(element, key) { - element.removeAttribute(`data-bs-${normalizeDataKey(key)}`); + removeDataAttribute: function removeDataAttribute(element, key) { + element.removeAttribute("data-bs-".concat(normalizeDataKey(key))); }, - getDataAttributes(element) { + getDataAttributes: function getDataAttributes(element) { if (!element) { return {}; } - const attributes = {}; - const bsKeys = Object.keys(element.dataset).filter(key => key.startsWith('bs') && !key.startsWith('bsConfig')); - for (const key of bsKeys) { - let pureKey = key.replace(/^bs/, ''); - pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); - attributes[pureKey] = normalizeData(element.dataset[key]); + var attributes = {}; + var bsKeys = Object.keys(element.dataset).filter(function (key) { + return key.startsWith('bs') && !key.startsWith('bsConfig'); + }); + var _iterator2 = _createForOfIteratorHelper(bsKeys), + _step2; + try { + for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) { + var key = _step2.value; + var pureKey = key.replace(/^bs/, ''); + pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); + attributes[pureKey] = normalizeData(element.dataset[key]); + } + } catch (err) { + _iterator2.e(err); + } finally { + _iterator2.f(); } return attributes; }, - getDataAttribute(element, key) { - return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); + getDataAttribute: function getDataAttribute(element, key) { + return normalizeData(element.getAttribute("data-bs-".concat(normalizeDataKey(key)))); } }; @@ -608,132 +698,175 @@ * -------------------------------------------------------------------------- */ - /** * Class definition */ - - class Config { - // Getters - static get Default() { - return {}; - } - static get DefaultType() { - return {}; - } - static get NAME() { - throw new Error('You have to implement the static method "NAME", for each component!'); - } - _getConfig(config) { - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - return config; - } - _mergeConfigObj(config, element) { - const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse - - return { - ...this.constructor.Default, - ...(typeof jsonConfig === 'object' ? jsonConfig : {}), - ...(isElement(element) ? Manipulator.getDataAttributes(element) : {}), - ...(typeof config === 'object' ? config : {}) - }; - } - _typeCheckConfig(config, configTypes = this.constructor.DefaultType) { - for (const [property, expectedTypes] of Object.entries(configTypes)) { - const value = config[property]; - const valueType = isElement(value) ? 'element' : toType(value); - if (!new RegExp(expectedTypes).test(valueType)) { - throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); + var Config = /*#__PURE__*/function () { + function Config() { + _classCallCheck(this, Config); + } + return _createClass(Config, [{ + key: "_getConfig", + value: function _getConfig(config) { + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + return config; + } + }, { + key: "_mergeConfigObj", + value: function _mergeConfigObj(config, element) { + var jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {}; // try to parse + + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, this.constructor.Default), _typeof(jsonConfig) === 'object' ? jsonConfig : {}), isElement(element) ? Manipulator.getDataAttributes(element) : {}), _typeof(config) === 'object' ? config : {}); + } + }, { + key: "_typeCheckConfig", + value: function _typeCheckConfig(config) { + var configTypes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.constructor.DefaultType; + for (var _i6 = 0, _Object$entries4 = Object.entries(configTypes); _i6 < _Object$entries4.length; _i6++) { + var _Object$entries4$_i = _slicedToArray(_Object$entries4[_i6], 2), + property = _Object$entries4$_i[0], + expectedTypes = _Object$entries4$_i[1]; + var value = config[property]; + var valueType = isElement(value) ? 'element' : toType(value); + if (!new RegExp(expectedTypes).test(valueType)) { + throw new TypeError("".concat(this.constructor.NAME.toUpperCase(), ": Option \"").concat(property, "\" provided type \"").concat(valueType, "\" but expected type \"").concat(expectedTypes, "\".")); + } } } - } - } - + }], [{ + key: "Default", + get: + // Getters + function get() { + return {}; + } + }, { + key: "DefaultType", + get: function get() { + return {}; + } + }, { + key: "NAME", + get: function get() { + throw new Error('You have to implement the static method "NAME", for each component!'); + } + }]); + }(); /** * -------------------------------------------------------------------------- * Bootstrap base-component.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const VERSION = '5.3.3'; + var VERSION = '5.3.3'; /** * Class definition */ - - class BaseComponent extends Config { - constructor(element, config) { - super(); + var BaseComponent = /*#__PURE__*/function (_Config) { + function BaseComponent(element, config) { + var _this; + _classCallCheck(this, BaseComponent); + _this = _callSuper(this, BaseComponent); element = getElement(element); if (!element) { - return; + return _possibleConstructorReturn(_this); } - this._element = element; - this._config = this._getConfig(config); - Data.set(this._element, this.constructor.DATA_KEY, this); + _this._element = element; + _this._config = _this._getConfig(config); + Data.set(_this._element, _this.constructor.DATA_KEY, _this); + return _this; } // Public - dispose() { - Data.remove(this._element, this.constructor.DATA_KEY); - EventHandler.off(this._element, this.constructor.EVENT_KEY); - for (const propertyName of Object.getOwnPropertyNames(this)) { - this[propertyName] = null; + _inherits(BaseComponent, _Config); + return _createClass(BaseComponent, [{ + key: "dispose", + value: function dispose() { + Data.remove(this._element, this.constructor.DATA_KEY); + EventHandler.off(this._element, this.constructor.EVENT_KEY); + var _iterator3 = _createForOfIteratorHelper(Object.getOwnPropertyNames(this)), + _step3; + try { + for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) { + var propertyName = _step3.value; + this[propertyName] = null; + } + } catch (err) { + _iterator3.e(err); + } finally { + _iterator3.f(); + } } - } - _queueCallback(callback, element, isAnimated = true) { - executeAfterTransition(callback, element, isAnimated); - } - _getConfig(config) { - config = this._mergeConfigObj(config, this._element); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - - // Static - static getInstance(element) { - return Data.get(getElement(element), this.DATA_KEY); - } - static getOrCreateInstance(element, config = {}) { - return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); - } - static get VERSION() { - return VERSION; - } - static get DATA_KEY() { - return `bs.${this.NAME}`; - } - static get EVENT_KEY() { - return `.${this.DATA_KEY}`; - } - static eventName(name) { - return `${name}${this.EVENT_KEY}`; - } - } - + }, { + key: "_queueCallback", + value: function _queueCallback(callback, element) { + var isAnimated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; + executeAfterTransition(callback, element, isAnimated); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + config = this._mergeConfigObj(config, this._element); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + + // Static + }], [{ + key: "getInstance", + value: function getInstance(element) { + return Data.get(getElement(element), this.DATA_KEY); + } + }, { + key: "getOrCreateInstance", + value: function getOrCreateInstance(element) { + var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return this.getInstance(element) || new this(element, _typeof(config) === 'object' ? config : null); + } + }, { + key: "VERSION", + get: function get() { + return VERSION; + } + }, { + key: "DATA_KEY", + get: function get() { + return "bs.".concat(this.NAME); + } + }, { + key: "EVENT_KEY", + get: function get() { + return ".".concat(this.DATA_KEY); + } + }, { + key: "eventName", + value: function eventName(name) { + return "".concat(name).concat(this.EVENT_KEY); + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap dom/selector-engine.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - const getSelector = element => { - let selector = element.getAttribute('data-bs-target'); + var getSelector = function getSelector(element) { + var selector = element.getAttribute('data-bs-target'); if (!selector || selector === '#') { - let hrefAttribute = element.getAttribute('href'); + var hrefAttribute = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes, // so everything starting with `#` or `.`. If a "real" URL is used as the selector, @@ -745,33 +878,41 @@ // Just in case some CMS puts out a full URL with the anchor appended if (hrefAttribute.includes('#') && !hrefAttribute.startsWith('#')) { - hrefAttribute = `#${hrefAttribute.split('#')[1]}`; + hrefAttribute = "#".concat(hrefAttribute.split('#')[1]); } selector = hrefAttribute && hrefAttribute !== '#' ? hrefAttribute.trim() : null; } - return selector ? selector.split(',').map(sel => parseSelector(sel)).join(',') : null; + return selector ? selector.split(',').map(function (sel) { + return parseSelector(sel); + }).join(',') : null; }; - const SelectorEngine = { - find(selector, element = document.documentElement) { - return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); + var SelectorEngine = { + find: function find(selector) { + var _ref2; + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; + return (_ref2 = []).concat.apply(_ref2, _toConsumableArray(Element.prototype.querySelectorAll.call(element, selector))); }, - findOne(selector, element = document.documentElement) { + findOne: function findOne(selector) { + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.documentElement; return Element.prototype.querySelector.call(element, selector); }, - children(element, selector) { - return [].concat(...element.children).filter(child => child.matches(selector)); + children: function children(element, selector) { + var _ref3; + return (_ref3 = []).concat.apply(_ref3, _toConsumableArray(element.children)).filter(function (child) { + return child.matches(selector); + }); }, - parents(element, selector) { - const parents = []; - let ancestor = element.parentNode.closest(selector); + parents: function parents(element, selector) { + var parents = []; + var ancestor = element.parentNode.closest(selector); while (ancestor) { parents.push(ancestor); ancestor = ancestor.parentNode.closest(selector); } return parents; }, - prev(element, selector) { - let previous = element.previousElementSibling; + prev: function prev(element, selector) { + var previous = element.previousElementSibling; while (previous) { if (previous.matches(selector)) { return [previous]; @@ -781,8 +922,8 @@ return []; }, // TODO: this is now unused; remove later along with prev() - next(element, selector) { - let next = element.nextElementSibling; + next: function next(element, selector) { + var next = element.nextElementSibling; while (next) { if (next.matches(selector)) { return [next]; @@ -791,23 +932,27 @@ } return []; }, - focusableChildren(element) { - const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(','); - return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); + focusableChildren: function focusableChildren(element) { + var focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(function (selector) { + return "".concat(selector, ":not([tabindex^=\"-\"])"); + }).join(','); + return this.find(focusables, element).filter(function (el) { + return !isDisabled(el) && isVisible(el); + }); }, - getSelectorFromElement(element) { - const selector = getSelector(element); + getSelectorFromElement: function getSelectorFromElement(element) { + var selector = getSelector(element); if (selector) { return SelectorEngine.findOne(selector) ? selector : null; } return null; }, - getElementFromSelector(element) { - const selector = getSelector(element); + getElementFromSelector: function getElementFromSelector(element) { + var selector = getSelector(element); return selector ? SelectorEngine.findOne(selector) : null; }, - getMultipleElementsFromSelector(element) { - const selector = getSelector(element); + getMultipleElementsFromSelector: function getMultipleElementsFromSelector(element) { + var selector = getSelector(element); return selector ? SelectorEngine.find(selector) : []; } }; @@ -819,18 +964,19 @@ * -------------------------------------------------------------------------- */ - const enableDismissTrigger = (component, method = 'hide') => { - const clickEvent = `click.dismiss${component.EVENT_KEY}`; - const name = component.NAME; - EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { + var enableDismissTrigger = function enableDismissTrigger(component) { + var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'hide'; + var clickEvent = "click.dismiss".concat(component.EVENT_KEY); + var name = component.NAME; + EventHandler.on(document, clickEvent, "[data-bs-dismiss=\"".concat(name, "\"]"), function (event) { if (['A', 'AREA'].includes(this.tagName)) { event.preventDefault(); } if (isDisabled(this)) { return; } - const target = SelectorEngine.getElementFromSelector(this) || this.closest(`.${name}`); - const instance = component.getOrCreateInstance(target); + var target = SelectorEngine.getElementFromSelector(this) || this.closest(".".concat(name)); + var instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method instance[method](); @@ -844,66 +990,80 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$f = 'alert'; - const DATA_KEY$a = 'bs.alert'; - const EVENT_KEY$b = `.${DATA_KEY$a}`; - const EVENT_CLOSE = `close${EVENT_KEY$b}`; - const EVENT_CLOSED = `closed${EVENT_KEY$b}`; - const CLASS_NAME_FADE$5 = 'fade'; - const CLASS_NAME_SHOW$8 = 'show'; + var NAME$f = 'alert'; + var DATA_KEY$a = 'bs.alert'; + var EVENT_KEY$b = ".".concat(DATA_KEY$a); + var EVENT_CLOSE = "close".concat(EVENT_KEY$b); + var EVENT_CLOSED = "closed".concat(EVENT_KEY$b); + var CLASS_NAME_FADE$5 = 'fade'; + var CLASS_NAME_SHOW$8 = 'show'; /** * Class definition */ - - class Alert extends BaseComponent { - // Getters - static get NAME() { - return NAME$f; - } - - // Public - close() { - const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); - if (closeEvent.defaultPrevented) { - return; - } - this._element.classList.remove(CLASS_NAME_SHOW$8); - const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); - this._queueCallback(() => this._destroyElement(), this._element, isAnimated); - } - - // Private - _destroyElement() { - this._element.remove(); - EventHandler.trigger(this._element, EVENT_CLOSED); - this.dispose(); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Alert.getOrCreateInstance(this); - if (typeof config !== 'string') { + var Alert = /*#__PURE__*/function (_BaseComponent) { + function Alert() { + _classCallCheck(this, Alert); + return _callSuper(this, Alert, arguments); + } + _inherits(Alert, _BaseComponent); + return _createClass(Alert, [{ + key: "close", + value: + // Public + function close() { + var _this2 = this; + var closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); + if (closeEvent.defaultPrevented) { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](this); - }); - } - } + this._element.classList.remove(CLASS_NAME_SHOW$8); + var isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); + this._queueCallback(function () { + return _this2._destroyElement(); + }, this._element, isAnimated); + } + // Private + }, { + key: "_destroyElement", + value: function _destroyElement() { + this._element.remove(); + EventHandler.trigger(this._element, EVENT_CLOSED); + this.dispose(); + } + + // Static + }], [{ + key: "NAME", + get: + // Getters + function get() { + return NAME$f; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Alert.getOrCreateInstance(this); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](this); + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - enableDismissTrigger(Alert, 'close'); /** @@ -919,54 +1079,63 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$e = 'button'; - const DATA_KEY$9 = 'bs.button'; - const EVENT_KEY$a = `.${DATA_KEY$9}`; - const DATA_API_KEY$6 = '.data-api'; - const CLASS_NAME_ACTIVE$3 = 'active'; - const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; - const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; + var NAME$e = 'button'; + var DATA_KEY$9 = 'bs.button'; + var EVENT_KEY$a = ".".concat(DATA_KEY$9); + var DATA_API_KEY$6 = '.data-api'; + var CLASS_NAME_ACTIVE$3 = 'active'; + var SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; + var EVENT_CLICK_DATA_API$6 = "click".concat(EVENT_KEY$a).concat(DATA_API_KEY$6); /** * Class definition */ - - class Button extends BaseComponent { - // Getters - static get NAME() { - return NAME$e; - } - - // Public - toggle() { - // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method - this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Button.getOrCreateInstance(this); - if (config === 'toggle') { - data[config](); - } - }); - } - } - + var Button = /*#__PURE__*/function (_BaseComponent2) { + function Button() { + _classCallCheck(this, Button); + return _callSuper(this, Button, arguments); + } + _inherits(Button, _BaseComponent2); + return _createClass(Button, [{ + key: "toggle", + value: + // Public + function toggle() { + // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method + this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); + } + + // Static + }], [{ + key: "NAME", + get: + // Getters + function get() { + return NAME$e; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Button.getOrCreateInstance(this); + if (config === 'toggle') { + data[config](); + } + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { + EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, function (event) { event.preventDefault(); - const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); - const data = Button.getOrCreateInstance(button); + var button = event.target.closest(SELECTOR_DATA_TOGGLE$5); + var data = Button.getOrCreateInstance(button); data.toggle(); }); @@ -983,28 +1152,27 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$d = 'swipe'; - const EVENT_KEY$9 = '.bs.swipe'; - const EVENT_TOUCHSTART = `touchstart${EVENT_KEY$9}`; - const EVENT_TOUCHMOVE = `touchmove${EVENT_KEY$9}`; - const EVENT_TOUCHEND = `touchend${EVENT_KEY$9}`; - const EVENT_POINTERDOWN = `pointerdown${EVENT_KEY$9}`; - const EVENT_POINTERUP = `pointerup${EVENT_KEY$9}`; - const POINTER_TYPE_TOUCH = 'touch'; - const POINTER_TYPE_PEN = 'pen'; - const CLASS_NAME_POINTER_EVENT = 'pointer-event'; - const SWIPE_THRESHOLD = 40; - const Default$c = { + var NAME$d = 'swipe'; + var EVENT_KEY$9 = '.bs.swipe'; + var EVENT_TOUCHSTART = "touchstart".concat(EVENT_KEY$9); + var EVENT_TOUCHMOVE = "touchmove".concat(EVENT_KEY$9); + var EVENT_TOUCHEND = "touchend".concat(EVENT_KEY$9); + var EVENT_POINTERDOWN = "pointerdown".concat(EVENT_KEY$9); + var EVENT_POINTERUP = "pointerup".concat(EVENT_KEY$9); + var POINTER_TYPE_TOUCH = 'touch'; + var POINTER_TYPE_PEN = 'pen'; + var CLASS_NAME_POINTER_EVENT = 'pointer-event'; + var SWIPE_THRESHOLD = 40; + var Default$c = { endCallback: null, leftCallback: null, rightCallback: null }; - const DefaultType$c = { + var DefaultType$c = { endCallback: '(function|null)', leftCallback: '(function|null)', rightCallback: '(function|null)' @@ -1013,140 +1181,170 @@ /** * Class definition */ - - class Swipe extends Config { - constructor(element, config) { - super(); - this._element = element; + var Swipe = /*#__PURE__*/function (_Config2) { + function Swipe(element, config) { + var _this3; + _classCallCheck(this, Swipe); + _this3 = _callSuper(this, Swipe); + _this3._element = element; if (!element || !Swipe.isSupported()) { - return; + return _possibleConstructorReturn(_this3); } - this._config = this._getConfig(config); - this._deltaX = 0; - this._supportPointerEvents = Boolean(window.PointerEvent); - this._initEvents(); + _this3._config = _this3._getConfig(config); + _this3._deltaX = 0; + _this3._supportPointerEvents = Boolean(window.PointerEvent); + _this3._initEvents(); + return _this3; } // Getters - static get Default() { - return Default$c; - } - static get DefaultType() { - return DefaultType$c; - } - static get NAME() { - return NAME$d; - } - - // Public - dispose() { - EventHandler.off(this._element, EVENT_KEY$9); - } + _inherits(Swipe, _Config2); + return _createClass(Swipe, [{ + key: "dispose", + value: + // Public + function dispose() { + EventHandler.off(this._element, EVENT_KEY$9); + } - // Private - _start(event) { - if (!this._supportPointerEvents) { - this._deltaX = event.touches[0].clientX; - return; + // Private + }, { + key: "_start", + value: function _start(event) { + if (!this._supportPointerEvents) { + this._deltaX = event.touches[0].clientX; + return; + } + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX; + } + } + }, { + key: "_end", + value: function _end(event) { + if (this._eventIsPointerPenTouch(event)) { + this._deltaX = event.clientX - this._deltaX; + } + this._handleSwipe(); + execute(this._config.endCallback); + } + }, { + key: "_move", + value: function _move(event) { + this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; + } + }, { + key: "_handleSwipe", + value: function _handleSwipe() { + var absDeltaX = Math.abs(this._deltaX); + if (absDeltaX <= SWIPE_THRESHOLD) { + return; + } + var direction = absDeltaX / this._deltaX; + this._deltaX = 0; + if (!direction) { + return; + } + execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); + } + }, { + key: "_initEvents", + value: function _initEvents() { + var _this4 = this; + if (this._supportPointerEvents) { + EventHandler.on(this._element, EVENT_POINTERDOWN, function (event) { + return _this4._start(event); + }); + EventHandler.on(this._element, EVENT_POINTERUP, function (event) { + return _this4._end(event); + }); + this._element.classList.add(CLASS_NAME_POINTER_EVENT); + } else { + EventHandler.on(this._element, EVENT_TOUCHSTART, function (event) { + return _this4._start(event); + }); + EventHandler.on(this._element, EVENT_TOUCHMOVE, function (event) { + return _this4._move(event); + }); + EventHandler.on(this._element, EVENT_TOUCHEND, function (event) { + return _this4._end(event); + }); + } } - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX; + }, { + key: "_eventIsPointerPenTouch", + value: function _eventIsPointerPenTouch(event) { + return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); } - } - _end(event) { - if (this._eventIsPointerPenTouch(event)) { - this._deltaX = event.clientX - this._deltaX; + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$c; } - this._handleSwipe(); - execute(this._config.endCallback); - } - _move(event) { - this._deltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this._deltaX; - } - _handleSwipe() { - const absDeltaX = Math.abs(this._deltaX); - if (absDeltaX <= SWIPE_THRESHOLD) { - return; + }, { + key: "DefaultType", + get: function get() { + return DefaultType$c; } - const direction = absDeltaX / this._deltaX; - this._deltaX = 0; - if (!direction) { - return; + }, { + key: "NAME", + get: function get() { + return NAME$d; } - execute(direction > 0 ? this._config.rightCallback : this._config.leftCallback); - } - _initEvents() { - if (this._supportPointerEvents) { - EventHandler.on(this._element, EVENT_POINTERDOWN, event => this._start(event)); - EventHandler.on(this._element, EVENT_POINTERUP, event => this._end(event)); - this._element.classList.add(CLASS_NAME_POINTER_EVENT); - } else { - EventHandler.on(this._element, EVENT_TOUCHSTART, event => this._start(event)); - EventHandler.on(this._element, EVENT_TOUCHMOVE, event => this._move(event)); - EventHandler.on(this._element, EVENT_TOUCHEND, event => this._end(event)); + }, { + key: "isSupported", + value: function isSupported() { + return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } - } - _eventIsPointerPenTouch(event) { - return this._supportPointerEvents && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); - } - - // Static - static isSupported() { - return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; - } - } - + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap carousel.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$c = 'carousel'; - const DATA_KEY$8 = 'bs.carousel'; - const EVENT_KEY$8 = `.${DATA_KEY$8}`; - const DATA_API_KEY$5 = '.data-api'; - const ARROW_LEFT_KEY$1 = 'ArrowLeft'; - const ARROW_RIGHT_KEY$1 = 'ArrowRight'; - const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch - - const ORDER_NEXT = 'next'; - const ORDER_PREV = 'prev'; - const DIRECTION_LEFT = 'left'; - const DIRECTION_RIGHT = 'right'; - const EVENT_SLIDE = `slide${EVENT_KEY$8}`; - const EVENT_SLID = `slid${EVENT_KEY$8}`; - const EVENT_KEYDOWN$1 = `keydown${EVENT_KEY$8}`; - const EVENT_MOUSEENTER$1 = `mouseenter${EVENT_KEY$8}`; - const EVENT_MOUSELEAVE$1 = `mouseleave${EVENT_KEY$8}`; - const EVENT_DRAG_START = `dragstart${EVENT_KEY$8}`; - const EVENT_LOAD_DATA_API$3 = `load${EVENT_KEY$8}${DATA_API_KEY$5}`; - const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$8}${DATA_API_KEY$5}`; - const CLASS_NAME_CAROUSEL = 'carousel'; - const CLASS_NAME_ACTIVE$2 = 'active'; - const CLASS_NAME_SLIDE = 'slide'; - const CLASS_NAME_END = 'carousel-item-end'; - const CLASS_NAME_START = 'carousel-item-start'; - const CLASS_NAME_NEXT = 'carousel-item-next'; - const CLASS_NAME_PREV = 'carousel-item-prev'; - const SELECTOR_ACTIVE = '.active'; - const SELECTOR_ITEM = '.carousel-item'; - const SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; - const SELECTOR_ITEM_IMG = '.carousel-item img'; - const SELECTOR_INDICATORS = '.carousel-indicators'; - const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; - const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - const KEY_TO_DIRECTION = { - [ARROW_LEFT_KEY$1]: DIRECTION_RIGHT, - [ARROW_RIGHT_KEY$1]: DIRECTION_LEFT - }; - const Default$b = { + var NAME$c = 'carousel'; + var DATA_KEY$8 = 'bs.carousel'; + var EVENT_KEY$8 = ".".concat(DATA_KEY$8); + var DATA_API_KEY$5 = '.data-api'; + var ARROW_LEFT_KEY$1 = 'ArrowLeft'; + var ARROW_RIGHT_KEY$1 = 'ArrowRight'; + var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch + + var ORDER_NEXT = 'next'; + var ORDER_PREV = 'prev'; + var DIRECTION_LEFT = 'left'; + var DIRECTION_RIGHT = 'right'; + var EVENT_SLIDE = "slide".concat(EVENT_KEY$8); + var EVENT_SLID = "slid".concat(EVENT_KEY$8); + var EVENT_KEYDOWN$1 = "keydown".concat(EVENT_KEY$8); + var EVENT_MOUSEENTER$1 = "mouseenter".concat(EVENT_KEY$8); + var EVENT_MOUSELEAVE$1 = "mouseleave".concat(EVENT_KEY$8); + var EVENT_DRAG_START = "dragstart".concat(EVENT_KEY$8); + var EVENT_LOAD_DATA_API$3 = "load".concat(EVENT_KEY$8).concat(DATA_API_KEY$5); + var EVENT_CLICK_DATA_API$5 = "click".concat(EVENT_KEY$8).concat(DATA_API_KEY$5); + var CLASS_NAME_CAROUSEL = 'carousel'; + var CLASS_NAME_ACTIVE$2 = 'active'; + var CLASS_NAME_SLIDE = 'slide'; + var CLASS_NAME_END = 'carousel-item-end'; + var CLASS_NAME_START = 'carousel-item-start'; + var CLASS_NAME_NEXT = 'carousel-item-next'; + var CLASS_NAME_PREV = 'carousel-item-prev'; + var SELECTOR_ACTIVE = '.active'; + var SELECTOR_ITEM = '.carousel-item'; + var SELECTOR_ACTIVE_ITEM = SELECTOR_ACTIVE + SELECTOR_ITEM; + var SELECTOR_ITEM_IMG = '.carousel-item img'; + var SELECTOR_INDICATORS = '.carousel-indicators'; + var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; + var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; + var KEY_TO_DIRECTION = _defineProperty(_defineProperty({}, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), ARROW_RIGHT_KEY$1, DIRECTION_LEFT); + var Default$b = { interval: 5000, keyboard: true, pause: 'hover', @@ -1154,7 +1352,7 @@ touch: true, wrap: true }; - const DefaultType$b = { + var DefaultType$b = { interval: '(number|boolean)', // TODO:v6 remove boolean support keyboard: 'boolean', @@ -1167,286 +1365,376 @@ /** * Class definition */ - - class Carousel extends BaseComponent { - constructor(element, config) { - super(element, config); - this._interval = null; - this._activeElement = null; - this._isSliding = false; - this.touchTimeout = null; - this._swipeHelper = null; - this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); - this._addEventListeners(); - if (this._config.ride === CLASS_NAME_CAROUSEL) { - this.cycle(); - } + var Carousel = /*#__PURE__*/function (_BaseComponent3) { + function Carousel(element, config) { + var _this5; + _classCallCheck(this, Carousel); + _this5 = _callSuper(this, Carousel, [element, config]); + _this5._interval = null; + _this5._activeElement = null; + _this5._isSliding = false; + _this5.touchTimeout = null; + _this5._swipeHelper = null; + _this5._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, _this5._element); + _this5._addEventListeners(); + if (_this5._config.ride === CLASS_NAME_CAROUSEL) { + _this5.cycle(); + } + return _this5; } // Getters - static get Default() { - return Default$b; - } - static get DefaultType() { - return DefaultType$b; - } - static get NAME() { - return NAME$c; - } - - // Public - next() { - this._slide(ORDER_NEXT); - } - nextWhenVisible() { - // FIXME TODO use `document.visibilityState` - // Don't call next when the page isn't visible - // or the carousel or its parent isn't visible - if (!document.hidden && isVisible(this._element)) { - this.next(); - } - } - prev() { - this._slide(ORDER_PREV); - } - pause() { - if (this._isSliding) { - triggerTransitionEnd(this._element); - } - this._clearInterval(); - } - cycle() { - this._clearInterval(); - this._updateInterval(); - this._interval = setInterval(() => this.nextWhenVisible(), this._config.interval); - } - _maybeEnableCycle() { - if (!this._config.ride) { - return; - } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.cycle()); - return; + _inherits(Carousel, _BaseComponent3); + return _createClass(Carousel, [{ + key: "next", + value: + // Public + function next() { + this._slide(ORDER_NEXT); + } + }, { + key: "nextWhenVisible", + value: function nextWhenVisible() { + // FIXME TODO use `document.visibilityState` + // Don't call next when the page isn't visible + // or the carousel or its parent isn't visible + if (!document.hidden && isVisible(this._element)) { + this.next(); + } } - this.cycle(); - } - to(index) { - const items = this._getItems(); - if (index > items.length - 1 || index < 0) { - return; + }, { + key: "prev", + value: function prev() { + this._slide(ORDER_PREV); } - if (this._isSliding) { - EventHandler.one(this._element, EVENT_SLID, () => this.to(index)); - return; + }, { + key: "pause", + value: function pause() { + if (this._isSliding) { + triggerTransitionEnd(this._element); + } + this._clearInterval(); + } + }, { + key: "cycle", + value: function cycle() { + var _this6 = this; + this._clearInterval(); + this._updateInterval(); + this._interval = setInterval(function () { + return _this6.nextWhenVisible(); + }, this._config.interval); + } + }, { + key: "_maybeEnableCycle", + value: function _maybeEnableCycle() { + var _this7 = this; + if (!this._config.ride) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, function () { + return _this7.cycle(); + }); + return; + } + this.cycle(); } - const activeIndex = this._getItemIndex(this._getActive()); - if (activeIndex === index) { - return; + }, { + key: "to", + value: function to(index) { + var _this8 = this; + var items = this._getItems(); + if (index > items.length - 1 || index < 0) { + return; + } + if (this._isSliding) { + EventHandler.one(this._element, EVENT_SLID, function () { + return _this8.to(index); + }); + return; + } + var activeIndex = this._getItemIndex(this._getActive()); + if (activeIndex === index) { + return; + } + var order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; + this._slide(order, items[index]); + } + }, { + key: "dispose", + value: function dispose() { + if (this._swipeHelper) { + this._swipeHelper.dispose(); + } + _superPropGet(Carousel, "dispose", this, 3)([]); } - const order = index > activeIndex ? ORDER_NEXT : ORDER_PREV; - this._slide(order, items[index]); - } - dispose() { - if (this._swipeHelper) { - this._swipeHelper.dispose(); + + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.defaultInterval = config.interval; + return config; + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this9 = this; + if (this._config.keyboard) { + EventHandler.on(this._element, EVENT_KEYDOWN$1, function (event) { + return _this9._keydown(event); + }); + } + if (this._config.pause === 'hover') { + EventHandler.on(this._element, EVENT_MOUSEENTER$1, function () { + return _this9.pause(); + }); + EventHandler.on(this._element, EVENT_MOUSELEAVE$1, function () { + return _this9._maybeEnableCycle(); + }); + } + if (this._config.touch && Swipe.isSupported()) { + this._addTouchEventListeners(); + } } - super.dispose(); - } + }, { + key: "_addTouchEventListeners", + value: function _addTouchEventListeners() { + var _this10 = this; + var _iterator4 = _createForOfIteratorHelper(SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)), + _step4; + try { + for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) { + var img = _step4.value; + EventHandler.on(img, EVENT_DRAG_START, function (event) { + return event.preventDefault(); + }); + } + } catch (err) { + _iterator4.e(err); + } finally { + _iterator4.f(); + } + var endCallBack = function endCallBack() { + if (_this10._config.pause !== 'hover') { + return; + } - // Private - _configAfterMerge(config) { - config.defaultInterval = config.interval; - return config; - } - _addEventListeners() { - if (this._config.keyboard) { - EventHandler.on(this._element, EVENT_KEYDOWN$1, event => this._keydown(event)); + // 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 + + _this10.pause(); + if (_this10.touchTimeout) { + clearTimeout(_this10.touchTimeout); + } + _this10.touchTimeout = setTimeout(function () { + return _this10._maybeEnableCycle(); + }, TOUCHEVENT_COMPAT_WAIT + _this10._config.interval); + }; + var swipeConfig = { + leftCallback: function leftCallback() { + return _this10._slide(_this10._directionToOrder(DIRECTION_LEFT)); + }, + rightCallback: function rightCallback() { + return _this10._slide(_this10._directionToOrder(DIRECTION_RIGHT)); + }, + endCallback: endCallBack + }; + this._swipeHelper = new Swipe(this._element, swipeConfig); } - if (this._config.pause === 'hover') { - EventHandler.on(this._element, EVENT_MOUSEENTER$1, () => this.pause()); - EventHandler.on(this._element, EVENT_MOUSELEAVE$1, () => this._maybeEnableCycle()); + }, { + key: "_keydown", + value: function _keydown(event) { + if (/input|textarea/i.test(event.target.tagName)) { + return; + } + var direction = KEY_TO_DIRECTION[event.key]; + if (direction) { + event.preventDefault(); + this._slide(this._directionToOrder(direction)); + } } - if (this._config.touch && Swipe.isSupported()) { - this._addTouchEventListeners(); + }, { + key: "_getItemIndex", + value: function _getItemIndex(element) { + return this._getItems().indexOf(element); } - } - _addTouchEventListeners() { - for (const img of SelectorEngine.find(SELECTOR_ITEM_IMG, this._element)) { - EventHandler.on(img, EVENT_DRAG_START, event => event.preventDefault()); + }, { + key: "_setActiveIndicatorElement", + value: function _setActiveIndicatorElement(index) { + if (!this._indicatorsElement) { + return; + } + var activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); + activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); + activeIndicator.removeAttribute('aria-current'); + var newActiveIndicator = SelectorEngine.findOne("[data-bs-slide-to=\"".concat(index, "\"]"), this._indicatorsElement); + if (newActiveIndicator) { + newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); + newActiveIndicator.setAttribute('aria-current', 'true'); + } } - const endCallBack = () => { - if (this._config.pause !== 'hover') { + }, { + key: "_updateInterval", + value: function _updateInterval() { + var element = this._activeElement || this._getActive(); + if (!element) { return; } - - // 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 - + var elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); + this._config.interval = elementInterval || this._config.defaultInterval; + } + }, { + key: "_slide", + value: function _slide(order) { + var _this11 = this; + var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; + if (this._isSliding) { + return; + } + var activeElement = this._getActive(); + var isNext = order === ORDER_NEXT; + var nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); + if (nextElement === activeElement) { + return; + } + var nextElementIndex = this._getItemIndex(nextElement); + var triggerEvent = function triggerEvent(eventName) { + return EventHandler.trigger(_this11._element, eventName, { + relatedTarget: nextElement, + direction: _this11._orderToDirection(order), + from: _this11._getItemIndex(activeElement), + to: nextElementIndex + }); + }; + var slideEvent = triggerEvent(EVENT_SLIDE); + if (slideEvent.defaultPrevented) { + return; + } + if (!activeElement || !nextElement) { + // Some weirdness is happening, so we bail + // TODO: change tests that use empty divs to avoid this check + return; + } + var isCycling = Boolean(this._interval); this.pause(); - if (this.touchTimeout) { - clearTimeout(this.touchTimeout); + this._isSliding = true; + this._setActiveIndicatorElement(nextElementIndex); + this._activeElement = nextElement; + var directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; + var orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; + nextElement.classList.add(orderClassName); + reflow(nextElement); + activeElement.classList.add(directionalClassName); + nextElement.classList.add(directionalClassName); + var completeCallBack = function completeCallBack() { + nextElement.classList.remove(directionalClassName, orderClassName); + nextElement.classList.add(CLASS_NAME_ACTIVE$2); + activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); + _this11._isSliding = false; + triggerEvent(EVENT_SLID); + }; + this._queueCallback(completeCallBack, activeElement, this._isAnimated()); + if (isCycling) { + this.cycle(); } - this.touchTimeout = setTimeout(() => this._maybeEnableCycle(), TOUCHEVENT_COMPAT_WAIT + this._config.interval); - }; - const swipeConfig = { - leftCallback: () => this._slide(this._directionToOrder(DIRECTION_LEFT)), - rightCallback: () => this._slide(this._directionToOrder(DIRECTION_RIGHT)), - endCallback: endCallBack - }; - this._swipeHelper = new Swipe(this._element, swipeConfig); - } - _keydown(event) { - if (/input|textarea/i.test(event.target.tagName)) { - return; } - const direction = KEY_TO_DIRECTION[event.key]; - if (direction) { - event.preventDefault(); - this._slide(this._directionToOrder(direction)); + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._element.classList.contains(CLASS_NAME_SLIDE); + } + }, { + key: "_getActive", + value: function _getActive() { + return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + } + }, { + key: "_getItems", + value: function _getItems() { + return SelectorEngine.find(SELECTOR_ITEM, this._element); + } + }, { + key: "_clearInterval", + value: function _clearInterval() { + if (this._interval) { + clearInterval(this._interval); + this._interval = null; + } } - } - _getItemIndex(element) { - return this._getItems().indexOf(element); - } - _setActiveIndicatorElement(index) { - if (!this._indicatorsElement) { - return; + }, { + key: "_directionToOrder", + value: function _directionToOrder(direction) { + if (isRTL()) { + return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; + } + return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; } - const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement); - activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); - activeIndicator.removeAttribute('aria-current'); - const newActiveIndicator = SelectorEngine.findOne(`[data-bs-slide-to="${index}"]`, this._indicatorsElement); - if (newActiveIndicator) { - newActiveIndicator.classList.add(CLASS_NAME_ACTIVE$2); - newActiveIndicator.setAttribute('aria-current', 'true'); + }, { + key: "_orderToDirection", + value: function _orderToDirection(order) { + if (isRTL()) { + return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; + } + return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$b; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$b; + } + }, { + key: "NAME", + get: function get() { + return NAME$c; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Carousel.getOrCreateInstance(this, config); + if (typeof config === 'number') { + data.to(config); + return; + } + if (typeof config === 'string') { + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + } + }); } + }]); + }(BaseComponent); + /** + * Data API implementation + */ + EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { + var target = SelectorEngine.getElementFromSelector(this); + if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { + return; } - _updateInterval() { - const element = this._activeElement || this._getActive(); - if (!element) { - return; - } - const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); - this._config.interval = elementInterval || this._config.defaultInterval; - } - _slide(order, element = null) { - if (this._isSliding) { - return; - } - const activeElement = this._getActive(); - const isNext = order === ORDER_NEXT; - const nextElement = element || getNextActiveElement(this._getItems(), activeElement, isNext, this._config.wrap); - if (nextElement === activeElement) { - return; - } - const nextElementIndex = this._getItemIndex(nextElement); - const triggerEvent = eventName => { - return EventHandler.trigger(this._element, eventName, { - relatedTarget: nextElement, - direction: this._orderToDirection(order), - from: this._getItemIndex(activeElement), - to: nextElementIndex - }); - }; - const slideEvent = triggerEvent(EVENT_SLIDE); - if (slideEvent.defaultPrevented) { - return; - } - if (!activeElement || !nextElement) { - // Some weirdness is happening, so we bail - // TODO: change tests that use empty divs to avoid this check - return; - } - const isCycling = Boolean(this._interval); - this.pause(); - this._isSliding = true; - this._setActiveIndicatorElement(nextElementIndex); - this._activeElement = nextElement; - const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END; - const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV; - nextElement.classList.add(orderClassName); - reflow(nextElement); - activeElement.classList.add(directionalClassName); - nextElement.classList.add(directionalClassName); - const completeCallBack = () => { - nextElement.classList.remove(directionalClassName, orderClassName); - nextElement.classList.add(CLASS_NAME_ACTIVE$2); - activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); - this._isSliding = false; - triggerEvent(EVENT_SLID); - }; - this._queueCallback(completeCallBack, activeElement, this._isAnimated()); - if (isCycling) { - this.cycle(); - } - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_SLIDE); - } - _getActive() { - return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); - } - _getItems() { - return SelectorEngine.find(SELECTOR_ITEM, this._element); - } - _clearInterval() { - if (this._interval) { - clearInterval(this._interval); - this._interval = null; - } - } - _directionToOrder(direction) { - if (isRTL()) { - return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT; - } - return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV; - } - _orderToDirection(order) { - if (isRTL()) { - return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT; - } - return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Carousel.getOrCreateInstance(this, config); - if (typeof config === 'number') { - data.to(config); - return; - } - if (typeof config === 'string') { - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - } - }); - } - } - - /** - * Data API implementation - */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, function (event) { - const target = SelectorEngine.getElementFromSelector(this); - if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) { - return; - } - event.preventDefault(); - const carousel = Carousel.getOrCreateInstance(target); - const slideIndex = this.getAttribute('data-bs-slide-to'); - if (slideIndex) { - carousel.to(slideIndex); - carousel._maybeEnableCycle(); - return; + event.preventDefault(); + var carousel = Carousel.getOrCreateInstance(target); + var slideIndex = this.getAttribute('data-bs-slide-to'); + if (slideIndex) { + carousel.to(slideIndex); + carousel._maybeEnableCycle(); + return; } if (Manipulator.getDataAttribute(this, 'slide') === 'next') { carousel.next(); @@ -1456,10 +1744,19 @@ carousel.prev(); carousel._maybeEnableCycle(); }); - EventHandler.on(window, EVENT_LOAD_DATA_API$3, () => { - const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); - for (const carousel of carousels) { - Carousel.getOrCreateInstance(carousel); + EventHandler.on(window, EVENT_LOAD_DATA_API$3, function () { + var carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); + var _iterator5 = _createForOfIteratorHelper(carousels), + _step5; + try { + for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) { + var carousel = _step5.value; + Carousel.getOrCreateInstance(carousel); + } + } catch (err) { + _iterator5.e(err); + } finally { + _iterator5.f(); } }); @@ -1476,35 +1773,34 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$b = 'collapse'; - const DATA_KEY$7 = 'bs.collapse'; - const EVENT_KEY$7 = `.${DATA_KEY$7}`; - const DATA_API_KEY$4 = '.data-api'; - const EVENT_SHOW$6 = `show${EVENT_KEY$7}`; - const EVENT_SHOWN$6 = `shown${EVENT_KEY$7}`; - const EVENT_HIDE$6 = `hide${EVENT_KEY$7}`; - const EVENT_HIDDEN$6 = `hidden${EVENT_KEY$7}`; - const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$7}${DATA_API_KEY$4}`; - const CLASS_NAME_SHOW$7 = 'show'; - const CLASS_NAME_COLLAPSE = 'collapse'; - const CLASS_NAME_COLLAPSING = 'collapsing'; - const CLASS_NAME_COLLAPSED = 'collapsed'; - const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; - const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; - const WIDTH = 'width'; - const HEIGHT = 'height'; - const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; - const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; - const Default$a = { + var NAME$b = 'collapse'; + var DATA_KEY$7 = 'bs.collapse'; + var EVENT_KEY$7 = ".".concat(DATA_KEY$7); + var DATA_API_KEY$4 = '.data-api'; + var EVENT_SHOW$6 = "show".concat(EVENT_KEY$7); + var EVENT_SHOWN$6 = "shown".concat(EVENT_KEY$7); + var EVENT_HIDE$6 = "hide".concat(EVENT_KEY$7); + var EVENT_HIDDEN$6 = "hidden".concat(EVENT_KEY$7); + var EVENT_CLICK_DATA_API$4 = "click".concat(EVENT_KEY$7).concat(DATA_API_KEY$4); + var CLASS_NAME_SHOW$7 = 'show'; + var CLASS_NAME_COLLAPSE = 'collapse'; + var CLASS_NAME_COLLAPSING = 'collapsing'; + var CLASS_NAME_COLLAPSED = 'collapsed'; + var CLASS_NAME_DEEPER_CHILDREN = ":scope .".concat(CLASS_NAME_COLLAPSE, " .").concat(CLASS_NAME_COLLAPSE); + var CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; + var WIDTH = 'width'; + var HEIGHT = 'height'; + var SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; + var SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; + var Default$a = { parent: null, toggle: true }; - const DefaultType$a = { + var DefaultType$a = { parent: '(null|element)', toggle: 'boolean' }; @@ -1512,188 +1808,281 @@ /** * Class definition */ - - class Collapse extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isTransitioning = false; - this._triggerArray = []; - const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); - for (const elem of toggleList) { - const selector = SelectorEngine.getSelectorFromElement(elem); - const filterElement = SelectorEngine.find(selector).filter(foundElement => foundElement === this._element); - if (selector !== null && filterElement.length) { - this._triggerArray.push(elem); + var Collapse = /*#__PURE__*/function (_BaseComponent4) { + function Collapse(element, config) { + var _this12; + _classCallCheck(this, Collapse); + _this12 = _callSuper(this, Collapse, [element, config]); + _this12._isTransitioning = false; + _this12._triggerArray = []; + var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); + var _iterator6 = _createForOfIteratorHelper(toggleList), + _step6; + try { + for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) { + var elem = _step6.value; + var selector = SelectorEngine.getSelectorFromElement(elem); + var filterElement = SelectorEngine.find(selector).filter(function (foundElement) { + return foundElement === _this12._element; + }); + if (selector !== null && filterElement.length) { + _this12._triggerArray.push(elem); + } } + } catch (err) { + _iterator6.e(err); + } finally { + _iterator6.f(); } - this._initializeChildren(); - if (!this._config.parent) { - this._addAriaAndCollapsedClass(this._triggerArray, this._isShown()); + _this12._initializeChildren(); + if (!_this12._config.parent) { + _this12._addAriaAndCollapsedClass(_this12._triggerArray, _this12._isShown()); } - if (this._config.toggle) { - this.toggle(); + if (_this12._config.toggle) { + _this12.toggle(); } + return _this12; } // Getters - static get Default() { - return Default$a; - } - static get DefaultType() { - return DefaultType$a; - } - static get NAME() { - return NAME$b; - } - - // Public - toggle() { - if (this._isShown()) { - this.hide(); - } else { - this.show(); - } - } - show() { - if (this._isTransitioning || this._isShown()) { - return; - } - let activeChildren = []; - - // find active children - if (this._config.parent) { - activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(element => element !== this._element).map(element => Collapse.getOrCreateInstance(element, { - toggle: false - })); - } - if (activeChildren.length && activeChildren[0]._isTransitioning) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); - if (startEvent.defaultPrevented) { - return; - } - for (const activeInstance of activeChildren) { - activeInstance.hide(); + _inherits(Collapse, _BaseComponent4); + return _createClass(Collapse, [{ + key: "toggle", + value: + // Public + function toggle() { + if (this._isShown()) { + this.hide(); + } else { + this.show(); + } } - const dimension = this._getDimension(); - this._element.classList.remove(CLASS_NAME_COLLAPSE); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.style[dimension] = 0; - this._addAriaAndCollapsedClass(this._triggerArray, true); - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + }, { + key: "show", + value: function show() { + var _this13 = this; + if (this._isTransitioning || this._isShown()) { + return; + } + var activeChildren = []; + + // find active children + if (this._config.parent) { + activeChildren = this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(function (element) { + return element !== _this13._element; + }).map(function (element) { + return Collapse.getOrCreateInstance(element, { + toggle: false + }); + }); + } + if (activeChildren.length && activeChildren[0]._isTransitioning) { + return; + } + var startEvent = EventHandler.trigger(this._element, EVENT_SHOW$6); + if (startEvent.defaultPrevented) { + return; + } + var _iterator7 = _createForOfIteratorHelper(activeChildren), + _step7; + try { + for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) { + var activeInstance = _step7.value; + activeInstance.hide(); + } + } catch (err) { + _iterator7.e(err); + } finally { + _iterator7.f(); + } + var dimension = this._getDimension(); + this._element.classList.remove(CLASS_NAME_COLLAPSE); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.style[dimension] = 0; + this._addAriaAndCollapsedClass(this._triggerArray, true); + this._isTransitioning = true; + var complete = function complete() { + _this13._isTransitioning = false; + _this13._element.classList.remove(CLASS_NAME_COLLAPSING); + _this13._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + _this13._element.style[dimension] = ''; + EventHandler.trigger(_this13._element, EVENT_SHOWN$6); + }; + var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + var scrollSize = "scroll".concat(capitalizedDimension); + this._queueCallback(complete, this._element, true); + this._element.style[dimension] = "".concat(this._element[scrollSize], "px"); + } + }, { + key: "hide", + value: function hide() { + var _this14 = this; + if (this._isTransitioning || !this._isShown()) { + return; + } + var startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); + if (startEvent.defaultPrevented) { + return; + } + var dimension = this._getDimension(); + this._element.style[dimension] = "".concat(this._element.getBoundingClientRect()[dimension], "px"); + reflow(this._element); + this._element.classList.add(CLASS_NAME_COLLAPSING); + this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); + var _iterator8 = _createForOfIteratorHelper(this._triggerArray), + _step8; + try { + for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) { + var trigger = _step8.value; + var element = SelectorEngine.getElementFromSelector(trigger); + if (element && !this._isShown(element)) { + this._addAriaAndCollapsedClass([trigger], false); + } + } + } catch (err) { + _iterator8.e(err); + } finally { + _iterator8.f(); + } + this._isTransitioning = true; + var complete = function complete() { + _this14._isTransitioning = false; + _this14._element.classList.remove(CLASS_NAME_COLLAPSING); + _this14._element.classList.add(CLASS_NAME_COLLAPSE); + EventHandler.trigger(_this14._element, EVENT_HIDDEN$6); + }; this._element.style[dimension] = ''; - EventHandler.trigger(this._element, EVENT_SHOWN$6); - }; - const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); - const scrollSize = `scroll${capitalizedDimension}`; - this._queueCallback(complete, this._element, true); - this._element.style[dimension] = `${this._element[scrollSize]}px`; - } - hide() { - if (this._isTransitioning || !this._isShown()) { - return; - } - const startEvent = EventHandler.trigger(this._element, EVENT_HIDE$6); - if (startEvent.defaultPrevented) { - return; + this._queueCallback(complete, this._element, true); } - const dimension = this._getDimension(); - this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; - reflow(this._element); - this._element.classList.add(CLASS_NAME_COLLAPSING); - this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - for (const trigger of this._triggerArray) { - const element = SelectorEngine.getElementFromSelector(trigger); - if (element && !this._isShown(element)) { - this._addAriaAndCollapsedClass([trigger], false); - } + }, { + key: "_isShown", + value: function _isShown() { + var element = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this._element; + return element.classList.contains(CLASS_NAME_SHOW$7); } - this._isTransitioning = true; - const complete = () => { - this._isTransitioning = false; - this._element.classList.remove(CLASS_NAME_COLLAPSING); - this._element.classList.add(CLASS_NAME_COLLAPSE); - EventHandler.trigger(this._element, EVENT_HIDDEN$6); - }; - this._element.style[dimension] = ''; - this._queueCallback(complete, this._element, true); - } - _isShown(element = this._element) { - return element.classList.contains(CLASS_NAME_SHOW$7); - } - // Private - _configAfterMerge(config) { - config.toggle = Boolean(config.toggle); // Coerce string values - config.parent = getElement(config.parent); - return config; - } - _getDimension() { - return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; - } - _initializeChildren() { - if (!this._config.parent) { - return; - } - const children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); - for (const element of children) { - const selected = SelectorEngine.getElementFromSelector(element); - if (selected) { - this._addAriaAndCollapsedClass([element], this._isShown(selected)); + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.toggle = Boolean(config.toggle); // Coerce string values + config.parent = getElement(config.parent); + return config; + } + }, { + key: "_getDimension", + value: function _getDimension() { + return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; + } + }, { + key: "_initializeChildren", + value: function _initializeChildren() { + if (!this._config.parent) { + return; + } + var children = this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$4); + var _iterator9 = _createForOfIteratorHelper(children), + _step9; + try { + for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) { + var element = _step9.value; + var selected = SelectorEngine.getElementFromSelector(element); + if (selected) { + this._addAriaAndCollapsedClass([element], this._isShown(selected)); + } + } + } catch (err) { + _iterator9.e(err); + } finally { + _iterator9.f(); } } - } - _getFirstLevelChildren(selector) { - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - // remove children if greater depth - return SelectorEngine.find(selector, this._config.parent).filter(element => !children.includes(element)); - } - _addAriaAndCollapsedClass(triggerArray, isOpen) { - if (!triggerArray.length) { - return; - } - for (const element of triggerArray) { - element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); - element.setAttribute('aria-expanded', isOpen); - } - } - - // Static - static jQueryInterface(config) { - const _config = {}; - if (typeof config === 'string' && /show|hide/.test(config)) { - _config.toggle = false; + }, { + key: "_getFirstLevelChildren", + value: function _getFirstLevelChildren(selector) { + var children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); + // remove children if greater depth + return SelectorEngine.find(selector, this._config.parent).filter(function (element) { + return !children.includes(element); + }); } - return this.each(function () { - const data = Collapse.getOrCreateInstance(this, _config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + }, { + key: "_addAriaAndCollapsedClass", + value: function _addAriaAndCollapsedClass(triggerArray, isOpen) { + if (!triggerArray.length) { + return; + } + var _iterator10 = _createForOfIteratorHelper(triggerArray), + _step10; + try { + for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) { + var element = _step10.value; + element.classList.toggle(CLASS_NAME_COLLAPSED, !isOpen); + element.setAttribute('aria-expanded', isOpen); } - data[config](); + } catch (err) { + _iterator10.e(err); + } finally { + _iterator10.f(); } - }); - } - } + } + // Static + }], [{ + key: "Default", + get: function get() { + return Default$a; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$a; + } + }, { + key: "NAME", + get: function get() { + return NAME$b; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + var _config = {}; + if (typeof config === 'string' && /show|hide/.test(config)) { + _config.toggle = false; + } + return this.each(function () { + var data = Collapse.getOrCreateInstance(this, _config); + if (typeof config === 'string') { + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + } + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { // preventDefault only for elements (which change the URL) not inside the collapsible element if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { event.preventDefault(); } - for (const element of SelectorEngine.getMultipleElementsFromSelector(this)) { - Collapse.getOrCreateInstance(element, { - toggle: false - }).toggle(); + var _iterator11 = _createForOfIteratorHelper(SelectorEngine.getMultipleElementsFromSelector(this)), + _step11; + try { + for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) { + var element = _step11.value; + Collapse.getOrCreateInstance(element, { + toggle: false + }).toggle(); + } + } catch (err) { + _iterator11.e(err); + } finally { + _iterator11.f(); } }); @@ -1710,49 +2099,48 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$a = 'dropdown'; - const DATA_KEY$6 = 'bs.dropdown'; - const EVENT_KEY$6 = `.${DATA_KEY$6}`; - const DATA_API_KEY$3 = '.data-api'; - const ESCAPE_KEY$2 = 'Escape'; - const TAB_KEY$1 = 'Tab'; - const ARROW_UP_KEY$1 = 'ArrowUp'; - const ARROW_DOWN_KEY$1 = 'ArrowDown'; - const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button - - const EVENT_HIDE$5 = `hide${EVENT_KEY$6}`; - const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$6}`; - const EVENT_SHOW$5 = `show${EVENT_KEY$6}`; - const EVENT_SHOWN$5 = `shown${EVENT_KEY$6}`; - const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$6}${DATA_API_KEY$3}`; - const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$6}${DATA_API_KEY$3}`; - const CLASS_NAME_SHOW$6 = 'show'; - const CLASS_NAME_DROPUP = 'dropup'; - const CLASS_NAME_DROPEND = 'dropend'; - const CLASS_NAME_DROPSTART = 'dropstart'; - const CLASS_NAME_DROPUP_CENTER = 'dropup-center'; - const CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; - const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; - const SELECTOR_DATA_TOGGLE_SHOWN = `${SELECTOR_DATA_TOGGLE$3}.${CLASS_NAME_SHOW$6}`; - const SELECTOR_MENU = '.dropdown-menu'; - const SELECTOR_NAVBAR = '.navbar'; - const SELECTOR_NAVBAR_NAV = '.navbar-nav'; - const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; - const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; - const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; - const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; - const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; - const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; - const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; - const PLACEMENT_TOPCENTER = 'top'; - const PLACEMENT_BOTTOMCENTER = 'bottom'; - const Default$9 = { + var NAME$a = 'dropdown'; + var DATA_KEY$6 = 'bs.dropdown'; + var EVENT_KEY$6 = ".".concat(DATA_KEY$6); + var DATA_API_KEY$3 = '.data-api'; + var ESCAPE_KEY$2 = 'Escape'; + var TAB_KEY$1 = 'Tab'; + var ARROW_UP_KEY$1 = 'ArrowUp'; + var ARROW_DOWN_KEY$1 = 'ArrowDown'; + var RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button + + var EVENT_HIDE$5 = "hide".concat(EVENT_KEY$6); + var EVENT_HIDDEN$5 = "hidden".concat(EVENT_KEY$6); + var EVENT_SHOW$5 = "show".concat(EVENT_KEY$6); + var EVENT_SHOWN$5 = "shown".concat(EVENT_KEY$6); + var EVENT_CLICK_DATA_API$3 = "click".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var EVENT_KEYDOWN_DATA_API = "keydown".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var EVENT_KEYUP_DATA_API = "keyup".concat(EVENT_KEY$6).concat(DATA_API_KEY$3); + var CLASS_NAME_SHOW$6 = 'show'; + var CLASS_NAME_DROPUP = 'dropup'; + var CLASS_NAME_DROPEND = 'dropend'; + var CLASS_NAME_DROPSTART = 'dropstart'; + var CLASS_NAME_DROPUP_CENTER = 'dropup-center'; + var CLASS_NAME_DROPDOWN_CENTER = 'dropdown-center'; + var SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)'; + var SELECTOR_DATA_TOGGLE_SHOWN = "".concat(SELECTOR_DATA_TOGGLE$3, ".").concat(CLASS_NAME_SHOW$6); + var SELECTOR_MENU = '.dropdown-menu'; + var SELECTOR_NAVBAR = '.navbar'; + var SELECTOR_NAVBAR_NAV = '.navbar-nav'; + var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; + var PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; + var PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; + var PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; + var PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; + var PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; + var PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; + var PLACEMENT_TOPCENTER = 'top'; + var PLACEMENT_BOTTOMCENTER = 'bottom'; + var Default$9 = { autoClose: true, boundary: 'clippingParents', display: 'dynamic', @@ -1760,7 +2148,7 @@ popperConfig: null, reference: 'toggle' }; - const DefaultType$9 = { + var DefaultType$9 = { autoClose: '(boolean|string)', boundary: '(string|element)', display: 'string', @@ -1772,290 +2160,362 @@ /** * Class definition */ - - class Dropdown extends BaseComponent { - constructor(element, config) { - super(element, config); - this._popper = null; - this._parent = this._element.parentNode; // dropdown wrapper + var Dropdown = /*#__PURE__*/function (_BaseComponent5) { + function Dropdown(element, config) { + var _this15; + _classCallCheck(this, Dropdown); + _this15 = _callSuper(this, Dropdown, [element, config]); + _this15._popper = null; + _this15._parent = _this15._element.parentNode; // dropdown wrapper // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - this._menu = SelectorEngine.next(this._element, SELECTOR_MENU)[0] || SelectorEngine.prev(this._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, this._parent); - this._inNavbar = this._detectNavbar(); + _this15._menu = SelectorEngine.next(_this15._element, SELECTOR_MENU)[0] || SelectorEngine.prev(_this15._element, SELECTOR_MENU)[0] || SelectorEngine.findOne(SELECTOR_MENU, _this15._parent); + _this15._inNavbar = _this15._detectNavbar(); + return _this15; } // Getters - static get Default() { - return Default$9; - } - static get DefaultType() { - return DefaultType$9; - } - static get NAME() { - return NAME$a; - } - - // Public - toggle() { - return this._isShown() ? this.hide() : this.show(); - } - show() { - if (isDisabled(this._element) || this._isShown()) { - return; + _inherits(Dropdown, _BaseComponent5); + return _createClass(Dropdown, [{ + key: "toggle", + value: + // Public + function toggle() { + return this._isShown() ? this.hide() : this.show(); + } + }, { + key: "show", + value: function show() { + if (isDisabled(this._element) || this._isShown()) { + return; + } + var relatedTarget = { + relatedTarget: this._element + }; + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); + if (showEvent.defaultPrevented) { + return; + } + this._createPopper(); + + // 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 && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { + var _ref4; + var _iterator12 = _createForOfIteratorHelper((_ref4 = []).concat.apply(_ref4, _toConsumableArray(document.body.children))), + _step12; + try { + for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) { + var element = _step12.value; + EventHandler.on(element, 'mouseover', noop); + } + } catch (err) { + _iterator12.e(err); + } finally { + _iterator12.f(); + } + } + this._element.focus(); + this._element.setAttribute('aria-expanded', true); + this._menu.classList.add(CLASS_NAME_SHOW$6); + this._element.classList.add(CLASS_NAME_SHOW$6); + EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); + } + }, { + key: "hide", + value: function hide() { + if (isDisabled(this._element) || !this._isShown()) { + return; + } + var relatedTarget = { + relatedTarget: this._element + }; + this._completeHide(relatedTarget); } - const relatedTarget = { - relatedTarget: this._element - }; - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$5, relatedTarget); - if (showEvent.defaultPrevented) { - return; + }, { + key: "dispose", + value: function dispose() { + if (this._popper) { + this._popper.destroy(); + } + _superPropGet(Dropdown, "dispose", this, 3)([]); + } + }, { + key: "update", + value: function update() { + this._inNavbar = this._detectNavbar(); + if (this._popper) { + this._popper.update(); + } } - this._createPopper(); - // 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 && !this._parent.closest(SELECTOR_NAVBAR_NAV)) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); + // Private + }, { + key: "_completeHide", + value: function _completeHide(relatedTarget) { + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); + if (hideEvent.defaultPrevented) { + return; } - } - this._element.focus(); - this._element.setAttribute('aria-expanded', true); - this._menu.classList.add(CLASS_NAME_SHOW$6); - this._element.classList.add(CLASS_NAME_SHOW$6); - EventHandler.trigger(this._element, EVENT_SHOWN$5, relatedTarget); - } - hide() { - if (isDisabled(this._element) || !this._isShown()) { - return; - } - const relatedTarget = { - relatedTarget: this._element - }; - this._completeHide(relatedTarget); - } - dispose() { - if (this._popper) { - this._popper.destroy(); - } - super.dispose(); - } - update() { - this._inNavbar = this._detectNavbar(); - if (this._popper) { - this._popper.update(); - } - } - // Private - _completeHide(relatedTarget) { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$5, relatedTarget); - if (hideEvent.defaultPrevented) { - return; + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + var _ref5; + var _iterator13 = _createForOfIteratorHelper((_ref5 = []).concat.apply(_ref5, _toConsumableArray(document.body.children))), + _step13; + try { + for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) { + var element = _step13.value; + EventHandler.off(element, 'mouseover', noop); + } + } catch (err) { + _iterator13.e(err); + } finally { + _iterator13.f(); + } + } + if (this._popper) { + this._popper.destroy(); + } + this._menu.classList.remove(CLASS_NAME_SHOW$6); + this._element.classList.remove(CLASS_NAME_SHOW$6); + this._element.setAttribute('aria-expanded', 'false'); + Manipulator.removeDataAttribute(this._menu, 'popper'); + EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + config = _superPropGet(Dropdown, "_getConfig", this, 3)([config]); + if (_typeof(config.reference) === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { + // Popper virtual elements require a getBoundingClientRect method + throw new TypeError("".concat(NAME$a.toUpperCase(), ": Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.")); + } + return config; } + }, { + key: "_createPopper", + value: function _createPopper() { + if (typeof Popper__namespace === 'undefined') { + throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); + } + var referenceElement = this._element; + if (this._config.reference === 'parent') { + referenceElement = this._parent; + } else if (isElement(this._config.reference)) { + referenceElement = getElement(this._config.reference); + } else if (_typeof(this._config.reference) === 'object') { + referenceElement = this._config.reference; + } + var popperConfig = this._getPopperConfig(); + this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig); + } + }, { + key: "_isShown", + value: function _isShown() { + return this._menu.classList.contains(CLASS_NAME_SHOW$6); + } + }, { + key: "_getPlacement", + value: function _getPlacement() { + var parentDropdown = this._parent; + if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { + return PLACEMENT_RIGHT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { + return PLACEMENT_LEFT; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { + return PLACEMENT_TOPCENTER; + } + if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { + return PLACEMENT_BOTTOMCENTER; + } - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); + // We need to trim the value because custom properties can also include spaces + var isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; + if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { + return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; } - } - if (this._popper) { - this._popper.destroy(); - } - this._menu.classList.remove(CLASS_NAME_SHOW$6); - this._element.classList.remove(CLASS_NAME_SHOW$6); - this._element.setAttribute('aria-expanded', 'false'); - Manipulator.removeDataAttribute(this._menu, 'popper'); - EventHandler.trigger(this._element, EVENT_HIDDEN$5, relatedTarget); - } - _getConfig(config) { - config = super._getConfig(config); - if (typeof config.reference === 'object' && !isElement(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { - // Popper virtual elements require a getBoundingClientRect method - throw new TypeError(`${NAME$a.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); - } - return config; - } - _createPopper() { - if (typeof Popper__namespace === 'undefined') { - throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); - } - let referenceElement = this._element; - if (this._config.reference === 'parent') { - referenceElement = this._parent; - } else if (isElement(this._config.reference)) { - referenceElement = getElement(this._config.reference); - } else if (typeof this._config.reference === 'object') { - referenceElement = this._config.reference; - } - const popperConfig = this._getPopperConfig(); - this._popper = Popper__namespace.createPopper(referenceElement, this._menu, popperConfig); - } - _isShown() { - return this._menu.classList.contains(CLASS_NAME_SHOW$6); - } - _getPlacement() { - const parentDropdown = this._parent; - if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) { - return PLACEMENT_RIGHT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) { - return PLACEMENT_LEFT; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP_CENTER)) { - return PLACEMENT_TOPCENTER; - } - if (parentDropdown.classList.contains(CLASS_NAME_DROPDOWN_CENTER)) { - return PLACEMENT_BOTTOMCENTER; - } + return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; + } + }, { + key: "_detectNavbar", + value: function _detectNavbar() { + return this._element.closest(SELECTOR_NAVBAR) !== null; + } + }, { + key: "_getOffset", + value: function _getOffset() { + var _this16 = this; + var offset = this._config.offset; + if (typeof offset === 'string') { + return offset.split(',').map(function (value) { + return Number.parseInt(value, 10); + }); + } + if (typeof offset === 'function') { + return function (popperData) { + return offset(popperData, _this16._element); + }; + } + return offset; + } + }, { + key: "_getPopperConfig", + value: function _getPopperConfig() { + var defaultBsPopperConfig = { + placement: this._getPlacement(), + modifiers: [{ + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }] + }; - // We need to trim the value because custom properties can also include spaces - const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; - if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { - return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; - } - return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM; - } - _detectNavbar() { - return this._element.closest(SELECTOR_NAVBAR) !== null; - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _getPopperConfig() { - const defaultBsPopperConfig = { - placement: this._getPlacement(), - modifiers: [{ - name: 'preventOverflow', - options: { - boundary: this._config.boundary + // Disable Popper if we have a static display or Dropdown is in Navbar + if (this._inNavbar || this._config.display === 'static') { + Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove + defaultBsPopperConfig.modifiers = [{ + name: 'applyStyles', + enabled: false + }]; + } + return _objectSpread(_objectSpread({}, defaultBsPopperConfig), execute(this._config.popperConfig, [defaultBsPopperConfig])); + } + }, { + key: "_selectMenuItem", + value: function _selectMenuItem(_ref6) { + var key = _ref6.key, + target = _ref6.target; + var items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(function (element) { + return isVisible(element); + }); + if (!items.length) { + return; + } + + // if target isn't included in items (e.g. when expanding the dropdown) + // allow cycling to get the last item in case key equals ARROW_UP_KEY + getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$9; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$9; + } + }, { + key: "NAME", + get: function get() { + return NAME$a; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Dropdown.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; } - }, { - name: 'offset', - options: { - offset: this._getOffset() + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); } - }] - }; - - // Disable Popper if we have a static display or Dropdown is in Navbar - if (this._inNavbar || this._config.display === 'static') { - Manipulator.setDataAttribute(this._menu, 'popper', 'static'); // TODO: v6 remove - defaultBsPopperConfig.modifiers = [{ - name: 'applyStyles', - enabled: false - }]; - } - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _selectMenuItem({ - key, - target - }) { - const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(element => isVisible(element)); - if (!items.length) { - return; + data[config](); + }); } - - // if target isn't included in items (e.g. when expanding the dropdown) - // allow cycling to get the last item in case key equals ARROW_UP_KEY - getNextActiveElement(items, target, key === ARROW_DOWN_KEY$1, !items.includes(target)).focus(); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Dropdown.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "clearMenus", + value: function clearMenus(event) { + if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + var openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); + var _iterator14 = _createForOfIteratorHelper(openToggles), + _step14; + try { + for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) { + var toggle = _step14.value; + var context = Dropdown.getInstance(toggle); + if (!context || context._config.autoClose === false) { + continue; + } + var composedPath = event.composedPath(); + var isMenuTarget = composedPath.includes(context._menu); + if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { + continue; + } + + // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu + if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { + continue; + } + var relatedTarget = { + relatedTarget: context._element + }; + if (event.type === 'click') { + relatedTarget.clickEvent = event; + } + context._completeHide(relatedTarget); + } + } catch (err) { + _iterator14.e(err); + } finally { + _iterator14.f(); } - data[config](); - }); - } - static clearMenus(event) { - if (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1) { - return; } - const openToggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN); - for (const toggle of openToggles) { - const context = Dropdown.getInstance(toggle); - if (!context || context._config.autoClose === false) { - continue; + }, { + key: "dataApiKeydownHandler", + value: function dataApiKeydownHandler(event) { + // If not an UP | DOWN | ESCAPE key => not a dropdown command + // If input/textarea && if key is other than ESCAPE => not a dropdown command + + var isInput = /input|textarea/i.test(event.target.tagName); + var isEscapeEvent = event.key === ESCAPE_KEY$2; + var isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); + if (!isUpOrDownEvent && !isEscapeEvent) { + return; } - const composedPath = event.composedPath(); - const isMenuTarget = composedPath.includes(context._menu); - if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { - continue; + if (isInput && !isEscapeEvent) { + return; } + event.preventDefault(); - // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu - if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { - continue; + // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ + var getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); + var instance = Dropdown.getOrCreateInstance(getToggleButton); + if (isUpOrDownEvent) { + event.stopPropagation(); + instance.show(); + instance._selectMenuItem(event); + return; } - const relatedTarget = { - relatedTarget: context._element - }; - if (event.type === 'click') { - relatedTarget.clickEvent = event; + if (instance._isShown()) { + // else is escape and we check if it is shown + event.stopPropagation(); + instance.hide(); + getToggleButton.focus(); } - context._completeHide(relatedTarget); - } - } - static dataApiKeydownHandler(event) { - // If not an UP | DOWN | ESCAPE key => not a dropdown command - // If input/textarea && if key is other than ESCAPE => not a dropdown command - - const isInput = /input|textarea/i.test(event.target.tagName); - const isEscapeEvent = event.key === ESCAPE_KEY$2; - const isUpOrDownEvent = [ARROW_UP_KEY$1, ARROW_DOWN_KEY$1].includes(event.key); - if (!isUpOrDownEvent && !isEscapeEvent) { - return; - } - if (isInput && !isEscapeEvent) { - return; - } - event.preventDefault(); - - // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.next(this, SELECTOR_DATA_TOGGLE$3)[0] || SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$3, event.delegateTarget.parentNode); - const instance = Dropdown.getOrCreateInstance(getToggleButton); - if (isUpOrDownEvent) { - event.stopPropagation(); - instance.show(); - instance._selectMenuItem(event); - return; - } - if (instance._isShown()) { - // else is escape and we check if it is shown - event.stopPropagation(); - instance.hide(); - getToggleButton.focus(); } - } - } - + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); @@ -2078,16 +2538,15 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$9 = 'backdrop'; - const CLASS_NAME_FADE$4 = 'fade'; - const CLASS_NAME_SHOW$5 = 'show'; - const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$9}`; - const Default$8 = { + var NAME$9 = 'backdrop'; + var CLASS_NAME_FADE$4 = 'fade'; + var CLASS_NAME_SHOW$5 = 'show'; + var EVENT_MOUSEDOWN = "mousedown.bs.".concat(NAME$9); + var Default$8 = { className: 'modal-backdrop', clickCallback: null, isAnimated: false, @@ -2095,7 +2554,7 @@ // if false, we use the backdrop helper without adding any element to the dom rootElement: 'body' // give the choice to place backdrop under different elements }; - const DefaultType$8 = { + var DefaultType$8 = { className: 'string', clickCallback: '(function|null)', isAnimated: 'boolean', @@ -2106,120 +2565,142 @@ /** * Class definition */ - - class Backdrop extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isAppended = false; - this._element = null; + var Backdrop = /*#__PURE__*/function (_Config3) { + function Backdrop(config) { + var _this17; + _classCallCheck(this, Backdrop); + _this17 = _callSuper(this, Backdrop); + _this17._config = _this17._getConfig(config); + _this17._isAppended = false; + _this17._element = null; + return _this17; } // Getters - static get Default() { - return Default$8; - } - static get DefaultType() { - return DefaultType$8; - } - static get NAME() { - return NAME$9; - } - - // Public - show(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._append(); - const element = this._getElement(); - if (this._config.isAnimated) { - reflow(element); - } - element.classList.add(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - execute(callback); - }); - } - hide(callback) { - if (!this._config.isVisible) { - execute(callback); - return; - } - this._getElement().classList.remove(CLASS_NAME_SHOW$5); - this._emulateAnimation(() => { - this.dispose(); - execute(callback); - }); - } - dispose() { - if (!this._isAppended) { - return; - } - EventHandler.off(this._element, EVENT_MOUSEDOWN); - this._element.remove(); - this._isAppended = false; - } - - // Private - _getElement() { - if (!this._element) { - const backdrop = document.createElement('div'); - backdrop.className = this._config.className; + _inherits(Backdrop, _Config3); + return _createClass(Backdrop, [{ + key: "show", + value: + // Public + function show(callback) { + if (!this._config.isVisible) { + execute(callback); + return; + } + this._append(); + var element = this._getElement(); if (this._config.isAnimated) { - backdrop.classList.add(CLASS_NAME_FADE$4); + reflow(element); } - this._element = backdrop; + element.classList.add(CLASS_NAME_SHOW$5); + this._emulateAnimation(function () { + execute(callback); + }); } - return this._element; - } - _configAfterMerge(config) { - // use getElement() with the default "body" to get a fresh Element on each instantiation - config.rootElement = getElement(config.rootElement); - return config; - } - _append() { - if (this._isAppended) { - return; + }, { + key: "hide", + value: function hide(callback) { + var _this18 = this; + if (!this._config.isVisible) { + execute(callback); + return; + } + this._getElement().classList.remove(CLASS_NAME_SHOW$5); + this._emulateAnimation(function () { + _this18.dispose(); + execute(callback); + }); + } + }, { + key: "dispose", + value: function dispose() { + if (!this._isAppended) { + return; + } + EventHandler.off(this._element, EVENT_MOUSEDOWN); + this._element.remove(); + this._isAppended = false; } - const element = this._getElement(); - this._config.rootElement.append(element); - EventHandler.on(element, EVENT_MOUSEDOWN, () => { - execute(this._config.clickCallback); - }); - this._isAppended = true; - } - _emulateAnimation(callback) { - executeAfterTransition(callback, this._getElement(), this._config.isAnimated); - } - } + // Private + }, { + key: "_getElement", + value: function _getElement() { + if (!this._element) { + var backdrop = document.createElement('div'); + backdrop.className = this._config.className; + if (this._config.isAnimated) { + backdrop.classList.add(CLASS_NAME_FADE$4); + } + this._element = backdrop; + } + return this._element; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + // use getElement() with the default "body" to get a fresh Element on each instantiation + config.rootElement = getElement(config.rootElement); + return config; + } + }, { + key: "_append", + value: function _append() { + var _this19 = this; + if (this._isAppended) { + return; + } + var element = this._getElement(); + this._config.rootElement.append(element); + EventHandler.on(element, EVENT_MOUSEDOWN, function () { + execute(_this19._config.clickCallback); + }); + this._isAppended = true; + } + }, { + key: "_emulateAnimation", + value: function _emulateAnimation(callback) { + executeAfterTransition(callback, this._getElement(), this._config.isAnimated); + } + }], [{ + key: "Default", + get: function get() { + return Default$8; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$8; + } + }, { + key: "NAME", + get: function get() { + return NAME$9; + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap util/focustrap.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$8 = 'focustrap'; - const DATA_KEY$5 = 'bs.focustrap'; - const EVENT_KEY$5 = `.${DATA_KEY$5}`; - const EVENT_FOCUSIN$2 = `focusin${EVENT_KEY$5}`; - const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$5}`; - const TAB_KEY = 'Tab'; - const TAB_NAV_FORWARD = 'forward'; - const TAB_NAV_BACKWARD = 'backward'; - const Default$7 = { + var NAME$8 = 'focustrap'; + var DATA_KEY$5 = 'bs.focustrap'; + var EVENT_KEY$5 = ".".concat(DATA_KEY$5); + var EVENT_FOCUSIN$2 = "focusin".concat(EVENT_KEY$5); + var EVENT_KEYDOWN_TAB = "keydown.tab".concat(EVENT_KEY$5); + var TAB_KEY = 'Tab'; + var TAB_NAV_FORWARD = 'forward'; + var TAB_NAV_BACKWARD = 'backward'; + var Default$7 = { autofocus: true, trapElement: null // The element to trap focus inside of }; - const DefaultType$7 = { + var DefaultType$7 = { autofocus: 'boolean', trapElement: 'element' }; @@ -2227,211 +2708,259 @@ /** * Class definition */ - - class FocusTrap extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); - this._isActive = false; - this._lastTabNavDirection = null; + var FocusTrap = /*#__PURE__*/function (_Config4) { + function FocusTrap(config) { + var _this20; + _classCallCheck(this, FocusTrap); + _this20 = _callSuper(this, FocusTrap); + _this20._config = _this20._getConfig(config); + _this20._isActive = false; + _this20._lastTabNavDirection = null; + return _this20; } // Getters - static get Default() { - return Default$7; - } - static get DefaultType() { - return DefaultType$7; - } - static get NAME() { - return NAME$8; - } - - // Public - activate() { - if (this._isActive) { - return; - } - if (this._config.autofocus) { - this._config.trapElement.focus(); + _inherits(FocusTrap, _Config4); + return _createClass(FocusTrap, [{ + key: "activate", + value: + // Public + function activate() { + var _this21 = this; + if (this._isActive) { + return; + } + if (this._config.autofocus) { + this._config.trapElement.focus(); + } + EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop + EventHandler.on(document, EVENT_FOCUSIN$2, function (event) { + return _this21._handleFocusin(event); + }); + EventHandler.on(document, EVENT_KEYDOWN_TAB, function (event) { + return _this21._handleKeydown(event); + }); + this._isActive = true; } - EventHandler.off(document, EVENT_KEY$5); // guard against infinite focus loop - EventHandler.on(document, EVENT_FOCUSIN$2, event => this._handleFocusin(event)); - EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); - this._isActive = true; - } - deactivate() { - if (!this._isActive) { - return; + }, { + key: "deactivate", + value: function deactivate() { + if (!this._isActive) { + return; + } + this._isActive = false; + EventHandler.off(document, EVENT_KEY$5); } - this._isActive = false; - EventHandler.off(document, EVENT_KEY$5); - } - // Private - _handleFocusin(event) { - const { - trapElement - } = this._config; - if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { - return; + // Private + }, { + key: "_handleFocusin", + value: function _handleFocusin(event) { + var trapElement = this._config.trapElement; + if (event.target === document || event.target === trapElement || trapElement.contains(event.target)) { + return; + } + var elements = SelectorEngine.focusableChildren(trapElement); + if (elements.length === 0) { + trapElement.focus(); + } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { + elements[elements.length - 1].focus(); + } else { + elements[0].focus(); + } } - const elements = SelectorEngine.focusableChildren(trapElement); - if (elements.length === 0) { - trapElement.focus(); - } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) { - elements[elements.length - 1].focus(); - } else { - elements[0].focus(); + }, { + key: "_handleKeydown", + value: function _handleKeydown(event) { + if (event.key !== TAB_KEY) { + return; + } + this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; } - } - _handleKeydown(event) { - if (event.key !== TAB_KEY) { - return; + }], [{ + key: "Default", + get: function get() { + return Default$7; } - this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; - } - } - + }, { + key: "DefaultType", + get: function get() { + return DefaultType$7; + } + }, { + key: "NAME", + get: function get() { + return NAME$8; + } + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap util/scrollBar.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; - const SELECTOR_STICKY_CONTENT = '.sticky-top'; - const PROPERTY_PADDING = 'padding-right'; - const PROPERTY_MARGIN = 'margin-right'; + var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; + var SELECTOR_STICKY_CONTENT = '.sticky-top'; + var PROPERTY_PADDING = 'padding-right'; + var PROPERTY_MARGIN = 'margin-right'; /** * Class definition */ - - class ScrollBarHelper { - constructor() { + var ScrollBarHelper = /*#__PURE__*/function () { + function ScrollBarHelper() { + _classCallCheck(this, ScrollBarHelper); this._element = document.body; } // Public - getWidth() { - // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes - const documentWidth = document.documentElement.clientWidth; - return Math.abs(window.innerWidth - documentWidth); - } - hide() { - const width = this.getWidth(); - this._disableOverFlow(); - // give padding to element to balance the hidden scrollbar width - this._setElementAttributes(this._element, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, calculatedValue => calculatedValue + width); - this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, calculatedValue => calculatedValue - width); - } - reset() { - this._resetElementAttributes(this._element, 'overflow'); - this._resetElementAttributes(this._element, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); - this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); - } - isOverflowing() { - return this.getWidth() > 0; - } + return _createClass(ScrollBarHelper, [{ + key: "getWidth", + value: function getWidth() { + // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes + var documentWidth = document.documentElement.clientWidth; + return Math.abs(window.innerWidth - documentWidth); + } + }, { + key: "hide", + value: function hide() { + var width = this.getWidth(); + this._disableOverFlow(); + // give padding to element to balance the hidden scrollbar width + this._setElementAttributes(this._element, PROPERTY_PADDING, function (calculatedValue) { + return calculatedValue + width; + }); + // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth + this._setElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING, function (calculatedValue) { + return calculatedValue + width; + }); + this._setElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN, function (calculatedValue) { + return calculatedValue - width; + }); + } + }, { + key: "reset", + value: function reset() { + this._resetElementAttributes(this._element, 'overflow'); + this._resetElementAttributes(this._element, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_FIXED_CONTENT, PROPERTY_PADDING); + this._resetElementAttributes(SELECTOR_STICKY_CONTENT, PROPERTY_MARGIN); + } + }, { + key: "isOverflowing", + value: function isOverflowing() { + return this.getWidth() > 0; + } - // Private - _disableOverFlow() { - this._saveInitialAttribute(this._element, 'overflow'); - this._element.style.overflow = 'hidden'; - } - _setElementAttributes(selector, styleProperty, callback) { - const scrollbarWidth = this.getWidth(); - const manipulationCallBack = element => { - if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { - return; + // Private + }, { + key: "_disableOverFlow", + value: function _disableOverFlow() { + this._saveInitialAttribute(this._element, 'overflow'); + this._element.style.overflow = 'hidden'; + } + }, { + key: "_setElementAttributes", + value: function _setElementAttributes(selector, styleProperty, callback) { + var _this22 = this; + var scrollbarWidth = this.getWidth(); + var manipulationCallBack = function manipulationCallBack(element) { + if (element !== _this22._element && window.innerWidth > element.clientWidth + scrollbarWidth) { + return; + } + _this22._saveInitialAttribute(element, styleProperty); + var calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); + element.style.setProperty(styleProperty, "".concat(callback(Number.parseFloat(calculatedValue)), "px")); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + }, { + key: "_saveInitialAttribute", + value: function _saveInitialAttribute(element, styleProperty) { + var actualValue = element.style.getPropertyValue(styleProperty); + if (actualValue) { + Manipulator.setDataAttribute(element, styleProperty, actualValue); } - this._saveInitialAttribute(element, styleProperty); - const calculatedValue = window.getComputedStyle(element).getPropertyValue(styleProperty); - element.style.setProperty(styleProperty, `${callback(Number.parseFloat(calculatedValue))}px`); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _saveInitialAttribute(element, styleProperty) { - const actualValue = element.style.getPropertyValue(styleProperty); - if (actualValue) { - Manipulator.setDataAttribute(element, styleProperty, actualValue); } - } - _resetElementAttributes(selector, styleProperty) { - const manipulationCallBack = element => { - const value = Manipulator.getDataAttribute(element, styleProperty); - // We only want to remove the property if the value is `null`; the value can also be zero - if (value === null) { - element.style.removeProperty(styleProperty); + }, { + key: "_resetElementAttributes", + value: function _resetElementAttributes(selector, styleProperty) { + var manipulationCallBack = function manipulationCallBack(element) { + var value = Manipulator.getDataAttribute(element, styleProperty); + // We only want to remove the property if the value is `null`; the value can also be zero + if (value === null) { + element.style.removeProperty(styleProperty); + return; + } + Manipulator.removeDataAttribute(element, styleProperty); + element.style.setProperty(styleProperty, value); + }; + this._applyManipulationCallback(selector, manipulationCallBack); + } + }, { + key: "_applyManipulationCallback", + value: function _applyManipulationCallback(selector, callBack) { + if (isElement(selector)) { + callBack(selector); return; } - Manipulator.removeDataAttribute(element, styleProperty); - element.style.setProperty(styleProperty, value); - }; - this._applyManipulationCallback(selector, manipulationCallBack); - } - _applyManipulationCallback(selector, callBack) { - if (isElement(selector)) { - callBack(selector); - return; - } - for (const sel of SelectorEngine.find(selector, this._element)) { - callBack(sel); + var _iterator15 = _createForOfIteratorHelper(SelectorEngine.find(selector, this._element)), + _step15; + try { + for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) { + var sel = _step15.value; + callBack(sel); + } + } catch (err) { + _iterator15.e(err); + } finally { + _iterator15.f(); + } } - } - } - + }]); + }(); /** * -------------------------------------------------------------------------- * Bootstrap modal.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$7 = 'modal'; - const DATA_KEY$4 = 'bs.modal'; - const EVENT_KEY$4 = `.${DATA_KEY$4}`; - const DATA_API_KEY$2 = '.data-api'; - const ESCAPE_KEY$1 = 'Escape'; - const EVENT_HIDE$4 = `hide${EVENT_KEY$4}`; - const EVENT_HIDE_PREVENTED$1 = `hidePrevented${EVENT_KEY$4}`; - const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$4}`; - const EVENT_SHOW$4 = `show${EVENT_KEY$4}`; - const EVENT_SHOWN$4 = `shown${EVENT_KEY$4}`; - const EVENT_RESIZE$1 = `resize${EVENT_KEY$4}`; - const EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY$4}`; - const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$4}`; - const EVENT_KEYDOWN_DISMISS$1 = `keydown.dismiss${EVENT_KEY$4}`; - const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$4}${DATA_API_KEY$2}`; - const CLASS_NAME_OPEN = 'modal-open'; - const CLASS_NAME_FADE$3 = 'fade'; - const CLASS_NAME_SHOW$4 = 'show'; - const CLASS_NAME_STATIC = 'modal-static'; - const OPEN_SELECTOR$1 = '.modal.show'; - const SELECTOR_DIALOG = '.modal-dialog'; - const SELECTOR_MODAL_BODY = '.modal-body'; - const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; - const Default$6 = { + var NAME$7 = 'modal'; + var DATA_KEY$4 = 'bs.modal'; + var EVENT_KEY$4 = ".".concat(DATA_KEY$4); + var DATA_API_KEY$2 = '.data-api'; + var ESCAPE_KEY$1 = 'Escape'; + var EVENT_HIDE$4 = "hide".concat(EVENT_KEY$4); + var EVENT_HIDE_PREVENTED$1 = "hidePrevented".concat(EVENT_KEY$4); + var EVENT_HIDDEN$4 = "hidden".concat(EVENT_KEY$4); + var EVENT_SHOW$4 = "show".concat(EVENT_KEY$4); + var EVENT_SHOWN$4 = "shown".concat(EVENT_KEY$4); + var EVENT_RESIZE$1 = "resize".concat(EVENT_KEY$4); + var EVENT_CLICK_DISMISS = "click.dismiss".concat(EVENT_KEY$4); + var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss".concat(EVENT_KEY$4); + var EVENT_KEYDOWN_DISMISS$1 = "keydown.dismiss".concat(EVENT_KEY$4); + var EVENT_CLICK_DATA_API$2 = "click".concat(EVENT_KEY$4).concat(DATA_API_KEY$2); + var CLASS_NAME_OPEN = 'modal-open'; + var CLASS_NAME_FADE$3 = 'fade'; + var CLASS_NAME_SHOW$4 = 'show'; + var CLASS_NAME_STATIC = 'modal-static'; + var OPEN_SELECTOR$1 = '.modal.show'; + var SELECTOR_DIALOG = '.modal-dialog'; + var SELECTOR_MODAL_BODY = '.modal-body'; + var SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; + var Default$6 = { backdrop: true, focus: true, keyboard: true }; - const DefaultType$6 = { + var DefaultType$6 = { backdrop: '(boolean|string)', focus: 'boolean', keyboard: 'boolean' @@ -2440,252 +2969,300 @@ /** * Class definition */ - - class Modal extends BaseComponent { - constructor(element, config) { - super(element, config); - this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element); - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._isShown = false; - this._isTransitioning = false; - this._scrollBar = new ScrollBarHelper(); - this._addEventListeners(); + var Modal = /*#__PURE__*/function (_BaseComponent6) { + function Modal(element, config) { + var _this23; + _classCallCheck(this, Modal); + _this23 = _callSuper(this, Modal, [element, config]); + _this23._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, _this23._element); + _this23._backdrop = _this23._initializeBackDrop(); + _this23._focustrap = _this23._initializeFocusTrap(); + _this23._isShown = false; + _this23._isTransitioning = false; + _this23._scrollBar = new ScrollBarHelper(); + _this23._addEventListeners(); + return _this23; } // Getters - static get Default() { - return Default$6; - } - static get DefaultType() { - return DefaultType$6; - } - static get NAME() { - return NAME$7; - } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown || this._isTransitioning) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._isTransitioning = true; - this._scrollBar.hide(); - document.body.classList.add(CLASS_NAME_OPEN); - this._adjustDialog(); - this._backdrop.show(() => this._showElement(relatedTarget)); - } - hide() { - if (!this._isShown || this._isTransitioning) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); - if (hideEvent.defaultPrevented) { - return; - } - this._isShown = false; - this._isTransitioning = true; - this._focustrap.deactivate(); - this._element.classList.remove(CLASS_NAME_SHOW$4); - this._queueCallback(() => this._hideModal(), this._element, this._isAnimated()); - } - dispose() { - EventHandler.off(window, EVENT_KEY$4); - EventHandler.off(this._dialog, EVENT_KEY$4); - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - handleUpdate() { - this._adjustDialog(); - } - - // Private - _initializeBackDrop() { - return new Backdrop({ - isVisible: Boolean(this._config.backdrop), - // 'static' option will be translated to true, and booleans will keep their value, - isAnimated: this._isAnimated() - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _showElement(relatedTarget) { - // try to append dynamic modal - if (!document.body.contains(this._element)) { - document.body.append(this._element); - } - this._element.style.display = 'block'; - this._element.removeAttribute('aria-hidden'); - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.scrollTop = 0; - const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); - if (modalBody) { - modalBody.scrollTop = 0; - } - reflow(this._element); - this._element.classList.add(CLASS_NAME_SHOW$4); - const transitionComplete = () => { - if (this._config.focus) { - this._focustrap.activate(); + _inherits(Modal, _BaseComponent6); + return _createClass(Modal, [{ + key: "toggle", + value: + // Public + function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: "show", + value: function show(relatedTarget) { + var _this24 = this; + if (this._isShown || this._isTransitioning) { + return; } - this._isTransitioning = false; - EventHandler.trigger(this._element, EVENT_SHOWN$4, { - relatedTarget + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, { + relatedTarget: relatedTarget }); - }; - this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { - if (event.key !== ESCAPE_KEY$1) { + if (showEvent.defaultPrevented) { return; } - if (this._config.keyboard) { - this.hide(); + this._isShown = true; + this._isTransitioning = true; + this._scrollBar.hide(); + document.body.classList.add(CLASS_NAME_OPEN); + this._adjustDialog(); + this._backdrop.show(function () { + return _this24._showElement(relatedTarget); + }); + } + }, { + key: "hide", + value: function hide() { + var _this25 = this; + if (!this._isShown || this._isTransitioning) { return; } - this._triggerBackdropTransition(); - }); - EventHandler.on(window, EVENT_RESIZE$1, () => { - if (this._isShown && !this._isTransitioning) { - this._adjustDialog(); + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4); + if (hideEvent.defaultPrevented) { + return; } - }); - EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, event => { - // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks - EventHandler.one(this._element, EVENT_CLICK_DISMISS, event2 => { - if (this._element !== event.target || this._element !== event2.target) { + this._isShown = false; + this._isTransitioning = true; + this._focustrap.deactivate(); + this._element.classList.remove(CLASS_NAME_SHOW$4); + this._queueCallback(function () { + return _this25._hideModal(); + }, this._element, this._isAnimated()); + } + }, { + key: "dispose", + value: function dispose() { + EventHandler.off(window, EVENT_KEY$4); + EventHandler.off(this._dialog, EVENT_KEY$4); + this._backdrop.dispose(); + this._focustrap.deactivate(); + _superPropGet(Modal, "dispose", this, 3)([]); + } + }, { + key: "handleUpdate", + value: function handleUpdate() { + this._adjustDialog(); + } + + // Private + }, { + key: "_initializeBackDrop", + value: function _initializeBackDrop() { + return new Backdrop({ + isVisible: Boolean(this._config.backdrop), + // 'static' option will be translated to true, and booleans will keep their value, + isAnimated: this._isAnimated() + }); + } + }, { + key: "_initializeFocusTrap", + value: function _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + }, { + key: "_showElement", + value: function _showElement(relatedTarget) { + var _this26 = this; + // try to append dynamic modal + if (!document.body.contains(this._element)) { + document.body.append(this._element); + } + this._element.style.display = 'block'; + this._element.removeAttribute('aria-hidden'); + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.scrollTop = 0; + var modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); + if (modalBody) { + modalBody.scrollTop = 0; + } + reflow(this._element); + this._element.classList.add(CLASS_NAME_SHOW$4); + var transitionComplete = function transitionComplete() { + if (_this26._config.focus) { + _this26._focustrap.activate(); + } + _this26._isTransitioning = false; + EventHandler.trigger(_this26._element, EVENT_SHOWN$4, { + relatedTarget: relatedTarget + }); + }; + this._queueCallback(transitionComplete, this._dialog, this._isAnimated()); + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this27 = this; + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, function (event) { + if (event.key !== ESCAPE_KEY$1) { return; } - if (this._config.backdrop === 'static') { - this._triggerBackdropTransition(); + if (_this27._config.keyboard) { + _this27.hide(); return; } - if (this._config.backdrop) { - this.hide(); + _this27._triggerBackdropTransition(); + }); + EventHandler.on(window, EVENT_RESIZE$1, function () { + if (_this27._isShown && !_this27._isTransitioning) { + _this27._adjustDialog(); } }); - }); - } - _hideModal() { - this._element.style.display = 'none'; - this._element.setAttribute('aria-hidden', true); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - this._isTransitioning = false; - this._backdrop.hide(() => { - document.body.classList.remove(CLASS_NAME_OPEN); - this._resetAdjustments(); - this._scrollBar.reset(); - EventHandler.trigger(this._element, EVENT_HIDDEN$4); - }); - } - _isAnimated() { - return this._element.classList.contains(CLASS_NAME_FADE$3); - } - _triggerBackdropTransition() { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); - if (hideEvent.defaultPrevented) { - return; - } - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const initialOverflowY = this._element.style.overflowY; - // return if the following background transition hasn't yet completed - if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { - return; - } - if (!isModalOverflowing) { - this._element.style.overflowY = 'hidden'; - } - this._element.classList.add(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.classList.remove(CLASS_NAME_STATIC); - this._queueCallback(() => { - this._element.style.overflowY = initialOverflowY; - }, this._dialog); - }, this._dialog); - this._element.focus(); - } - - /** - * The following methods are used to handle overflowing modals - */ - - _adjustDialog() { - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; - const scrollbarWidth = this._scrollBar.getWidth(); - const isBodyOverflowing = scrollbarWidth > 0; - if (isBodyOverflowing && !isModalOverflowing) { - const property = isRTL() ? 'paddingLeft' : 'paddingRight'; - this._element.style[property] = `${scrollbarWidth}px`; + EventHandler.on(this._element, EVENT_MOUSEDOWN_DISMISS, function (event) { + // a bad trick to segregate clicks that may start inside dialog but end outside, and avoid listen to scrollbar clicks + EventHandler.one(_this27._element, EVENT_CLICK_DISMISS, function (event2) { + if (_this27._element !== event.target || _this27._element !== event2.target) { + return; + } + if (_this27._config.backdrop === 'static') { + _this27._triggerBackdropTransition(); + return; + } + if (_this27._config.backdrop) { + _this27.hide(); + } + }); + }); } - if (!isBodyOverflowing && isModalOverflowing) { - const property = isRTL() ? 'paddingRight' : 'paddingLeft'; - this._element.style[property] = `${scrollbarWidth}px`; + }, { + key: "_hideModal", + value: function _hideModal() { + var _this28 = 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._backdrop.hide(function () { + document.body.classList.remove(CLASS_NAME_OPEN); + _this28._resetAdjustments(); + _this28._scrollBar.reset(); + EventHandler.trigger(_this28._element, EVENT_HIDDEN$4); + }); } - } - _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; - } - - // Static - static jQueryInterface(config, relatedTarget) { - return this.each(function () { - const data = Modal.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._element.classList.contains(CLASS_NAME_FADE$3); + } + }, { + key: "_triggerBackdropTransition", + value: function _triggerBackdropTransition() { + var _this29 = this; + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED$1); + if (hideEvent.defaultPrevented) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + var initialOverflowY = this._element.style.overflowY; + // return if the following background transition hasn't yet completed + if (initialOverflowY === 'hidden' || this._element.classList.contains(CLASS_NAME_STATIC)) { + return; } - data[config](relatedTarget); - }); - } - } - + if (!isModalOverflowing) { + this._element.style.overflowY = 'hidden'; + } + this._element.classList.add(CLASS_NAME_STATIC); + this._queueCallback(function () { + _this29._element.classList.remove(CLASS_NAME_STATIC); + _this29._queueCallback(function () { + _this29._element.style.overflowY = initialOverflowY; + }, _this29._dialog); + }, this._dialog); + this._element.focus(); + } + + /** + * The following methods are used to handle overflowing modals + */ + }, { + key: "_adjustDialog", + value: function _adjustDialog() { + var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + var scrollbarWidth = this._scrollBar.getWidth(); + var isBodyOverflowing = scrollbarWidth > 0; + if (isBodyOverflowing && !isModalOverflowing) { + var property = isRTL() ? 'paddingLeft' : 'paddingRight'; + this._element.style[property] = "".concat(scrollbarWidth, "px"); + } + if (!isBodyOverflowing && isModalOverflowing) { + var _property = isRTL() ? 'paddingRight' : 'paddingLeft'; + this._element.style[_property] = "".concat(scrollbarWidth, "px"); + } + } + }, { + key: "_resetAdjustments", + value: function _resetAdjustments() { + this._element.style.paddingLeft = ''; + this._element.style.paddingRight = ''; + } + + // Static + }], [{ + key: "Default", + get: function get() { + return Default$6; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$6; + } + }, { + key: "NAME", + get: function get() { + return NAME$7; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config, relatedTarget) { + return this.each(function () { + var data = Modal.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](relatedTarget); + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { - const target = SelectorEngine.getElementFromSelector(this); + var _this30 = this; + var target = SelectorEngine.getElementFromSelector(this); if (['A', 'AREA'].includes(this.tagName)) { event.preventDefault(); } - EventHandler.one(target, EVENT_SHOW$4, showEvent => { + EventHandler.one(target, EVENT_SHOW$4, function (showEvent) { if (showEvent.defaultPrevented) { // only register focus restorer if modal will actually get shown return; } - EventHandler.one(target, EVENT_HIDDEN$4, () => { - if (isVisible(this)) { - this.focus(); + EventHandler.one(target, EVENT_HIDDEN$4, function () { + if (isVisible(_this30)) { + _this30.focus(); } }); }); // avoid conflict when clicking modal toggler while another one is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); + var alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); if (alreadyOpen) { Modal.getInstance(alreadyOpen).hide(); } - const data = Modal.getOrCreateInstance(target); + var data = Modal.getOrCreateInstance(target); data.toggle(this); }); enableDismissTrigger(Modal); @@ -2703,37 +3280,36 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$6 = 'offcanvas'; - const DATA_KEY$3 = 'bs.offcanvas'; - const EVENT_KEY$3 = `.${DATA_KEY$3}`; - const DATA_API_KEY$1 = '.data-api'; - const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$3}${DATA_API_KEY$1}`; - const ESCAPE_KEY = 'Escape'; - const CLASS_NAME_SHOW$3 = 'show'; - const CLASS_NAME_SHOWING$1 = 'showing'; - const CLASS_NAME_HIDING = 'hiding'; - const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; - const OPEN_SELECTOR = '.offcanvas.show'; - const EVENT_SHOW$3 = `show${EVENT_KEY$3}`; - const EVENT_SHOWN$3 = `shown${EVENT_KEY$3}`; - const EVENT_HIDE$3 = `hide${EVENT_KEY$3}`; - const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$3}`; - const EVENT_HIDDEN$3 = `hidden${EVENT_KEY$3}`; - const EVENT_RESIZE = `resize${EVENT_KEY$3}`; - const EVENT_CLICK_DATA_API$1 = `click${EVENT_KEY$3}${DATA_API_KEY$1}`; - const EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY$3}`; - const SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; - const Default$5 = { + var NAME$6 = 'offcanvas'; + var DATA_KEY$3 = 'bs.offcanvas'; + var EVENT_KEY$3 = ".".concat(DATA_KEY$3); + var DATA_API_KEY$1 = '.data-api'; + var EVENT_LOAD_DATA_API$2 = "load".concat(EVENT_KEY$3).concat(DATA_API_KEY$1); + var ESCAPE_KEY = 'Escape'; + var CLASS_NAME_SHOW$3 = 'show'; + var CLASS_NAME_SHOWING$1 = 'showing'; + var CLASS_NAME_HIDING = 'hiding'; + var CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; + var OPEN_SELECTOR = '.offcanvas.show'; + var EVENT_SHOW$3 = "show".concat(EVENT_KEY$3); + var EVENT_SHOWN$3 = "shown".concat(EVENT_KEY$3); + var EVENT_HIDE$3 = "hide".concat(EVENT_KEY$3); + var EVENT_HIDE_PREVENTED = "hidePrevented".concat(EVENT_KEY$3); + var EVENT_HIDDEN$3 = "hidden".concat(EVENT_KEY$3); + var EVENT_RESIZE = "resize".concat(EVENT_KEY$3); + var EVENT_CLICK_DATA_API$1 = "click".concat(EVENT_KEY$3).concat(DATA_API_KEY$1); + var EVENT_KEYDOWN_DISMISS = "keydown.dismiss".concat(EVENT_KEY$3); + var SELECTOR_DATA_TOGGLE$1 = '[data-bs-toggle="offcanvas"]'; + var Default$5 = { backdrop: true, keyboard: true, scroll: false }; - const DefaultType$5 = { + var DefaultType$5 = { backdrop: '(boolean|string)', keyboard: 'boolean', scroll: 'boolean' @@ -2742,181 +3318,228 @@ /** * Class definition */ - - class Offcanvas extends BaseComponent { - constructor(element, config) { - super(element, config); - this._isShown = false; - this._backdrop = this._initializeBackDrop(); - this._focustrap = this._initializeFocusTrap(); - this._addEventListeners(); + var Offcanvas = /*#__PURE__*/function (_BaseComponent7) { + function Offcanvas(element, config) { + var _this31; + _classCallCheck(this, Offcanvas); + _this31 = _callSuper(this, Offcanvas, [element, config]); + _this31._isShown = false; + _this31._backdrop = _this31._initializeBackDrop(); + _this31._focustrap = _this31._initializeFocusTrap(); + _this31._addEventListeners(); + return _this31; } // Getters - static get Default() { - return Default$5; - } - static get DefaultType() { - return DefaultType$5; - } - static get NAME() { - return NAME$6; - } - - // Public - toggle(relatedTarget) { - return this._isShown ? this.hide() : this.show(relatedTarget); - } - show(relatedTarget) { - if (this._isShown) { - return; - } - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { - relatedTarget - }); - if (showEvent.defaultPrevented) { - return; - } - this._isShown = true; - this._backdrop.show(); - if (!this._config.scroll) { - new ScrollBarHelper().hide(); - } - this._element.setAttribute('aria-modal', true); - this._element.setAttribute('role', 'dialog'); - this._element.classList.add(CLASS_NAME_SHOWING$1); - const completeCallBack = () => { - if (!this._config.scroll || this._config.backdrop) { - this._focustrap.activate(); - } - this._element.classList.add(CLASS_NAME_SHOW$3); - this._element.classList.remove(CLASS_NAME_SHOWING$1); - EventHandler.trigger(this._element, EVENT_SHOWN$3, { - relatedTarget - }); - }; - this._queueCallback(completeCallBack, this._element, true); - } - hide() { - if (!this._isShown) { - return; - } - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); - if (hideEvent.defaultPrevented) { - return; - } - this._focustrap.deactivate(); - this._element.blur(); - this._isShown = false; - this._element.classList.add(CLASS_NAME_HIDING); - this._backdrop.hide(); - const completeCallback = () => { - this._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); - this._element.removeAttribute('aria-modal'); - this._element.removeAttribute('role'); - if (!this._config.scroll) { - new ScrollBarHelper().reset(); - } - EventHandler.trigger(this._element, EVENT_HIDDEN$3); - }; - this._queueCallback(completeCallback, this._element, true); - } - dispose() { - this._backdrop.dispose(); - this._focustrap.deactivate(); - super.dispose(); - } - - // Private - _initializeBackDrop() { - const clickCallback = () => { - if (this._config.backdrop === 'static') { - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); + _inherits(Offcanvas, _BaseComponent7); + return _createClass(Offcanvas, [{ + key: "toggle", + value: + // Public + function toggle(relatedTarget) { + return this._isShown ? this.hide() : this.show(relatedTarget); + } + }, { + key: "show", + value: function show(relatedTarget) { + var _this32 = this; + if (this._isShown) { return; } - this.hide(); - }; - - // 'static' option will be translated to true, and booleans will keep their value - const isVisible = Boolean(this._config.backdrop); - return new Backdrop({ - className: CLASS_NAME_BACKDROP, - isVisible, - isAnimated: true, - rootElement: this._element.parentNode, - clickCallback: isVisible ? clickCallback : null - }); - } - _initializeFocusTrap() { - return new FocusTrap({ - trapElement: this._element - }); - } - _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { - if (event.key !== ESCAPE_KEY) { + var showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { + relatedTarget: relatedTarget + }); + if (showEvent.defaultPrevented) { return; } - if (this._config.keyboard) { - this.hide(); - return; + this._isShown = true; + this._backdrop.show(); + if (!this._config.scroll) { + new ScrollBarHelper().hide(); } - EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); - }); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Offcanvas.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + this._element.setAttribute('aria-modal', true); + this._element.setAttribute('role', 'dialog'); + this._element.classList.add(CLASS_NAME_SHOWING$1); + var completeCallBack = function completeCallBack() { + if (!_this32._config.scroll || _this32._config.backdrop) { + _this32._focustrap.activate(); + } + _this32._element.classList.add(CLASS_NAME_SHOW$3); + _this32._element.classList.remove(CLASS_NAME_SHOWING$1); + EventHandler.trigger(_this32._element, EVENT_SHOWN$3, { + relatedTarget: relatedTarget + }); + }; + this._queueCallback(completeCallBack, this._element, true); + } + }, { + key: "hide", + value: function hide() { + var _this33 = this; + if (!this._isShown) { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { - throw new TypeError(`No method named "${config}"`); + var hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$3); + if (hideEvent.defaultPrevented) { + return; } - data[config](this); - }); - } - } + this._focustrap.deactivate(); + this._element.blur(); + this._isShown = false; + this._element.classList.add(CLASS_NAME_HIDING); + this._backdrop.hide(); + var completeCallback = function completeCallback() { + _this33._element.classList.remove(CLASS_NAME_SHOW$3, CLASS_NAME_HIDING); + _this33._element.removeAttribute('aria-modal'); + _this33._element.removeAttribute('role'); + if (!_this33._config.scroll) { + new ScrollBarHelper().reset(); + } + EventHandler.trigger(_this33._element, EVENT_HIDDEN$3); + }; + this._queueCallback(completeCallback, this._element, true); + } + }, { + key: "dispose", + value: function dispose() { + this._backdrop.dispose(); + this._focustrap.deactivate(); + _superPropGet(Offcanvas, "dispose", this, 3)([]); + } + + // Private + }, { + key: "_initializeBackDrop", + value: function _initializeBackDrop() { + var _this34 = this; + var clickCallback = function clickCallback() { + if (_this34._config.backdrop === 'static') { + EventHandler.trigger(_this34._element, EVENT_HIDE_PREVENTED); + return; + } + _this34.hide(); + }; + + // 'static' option will be translated to true, and booleans will keep their value + var isVisible = Boolean(this._config.backdrop); + return new Backdrop({ + className: CLASS_NAME_BACKDROP, + isVisible: isVisible, + isAnimated: true, + rootElement: this._element.parentNode, + clickCallback: isVisible ? clickCallback : null + }); + } + }, { + key: "_initializeFocusTrap", + value: function _initializeFocusTrap() { + return new FocusTrap({ + trapElement: this._element + }); + } + }, { + key: "_addEventListeners", + value: function _addEventListeners() { + var _this35 = this; + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, function (event) { + if (event.key !== ESCAPE_KEY) { + return; + } + if (_this35._config.keyboard) { + _this35.hide(); + return; + } + EventHandler.trigger(_this35._element, EVENT_HIDE_PREVENTED); + }); + } + // Static + }], [{ + key: "Default", + get: function get() { + return Default$5; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$5; + } + }, { + key: "NAME", + get: function get() { + return NAME$6; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Offcanvas.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](this); + }); + } + }]); + }(BaseComponent); /** * Data API implementation */ - EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { - const target = SelectorEngine.getElementFromSelector(this); + var _this36 = this; + var target = SelectorEngine.getElementFromSelector(this); if (['A', 'AREA'].includes(this.tagName)) { event.preventDefault(); } if (isDisabled(this)) { return; } - EventHandler.one(target, EVENT_HIDDEN$3, () => { + EventHandler.one(target, EVENT_HIDDEN$3, function () { // focus on trigger when it is closed - if (isVisible(this)) { - this.focus(); + if (isVisible(_this36)) { + _this36.focus(); } }); // avoid conflict when clicking a toggler of an offcanvas, while another is open - const alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); + var alreadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); if (alreadyOpen && alreadyOpen !== target) { Offcanvas.getInstance(alreadyOpen).hide(); } - const data = Offcanvas.getOrCreateInstance(target); + var data = Offcanvas.getOrCreateInstance(target); data.toggle(this); }); - EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { - for (const selector of SelectorEngine.find(OPEN_SELECTOR)) { - Offcanvas.getOrCreateInstance(selector).show(); + EventHandler.on(window, EVENT_LOAD_DATA_API$2, function () { + var _iterator16 = _createForOfIteratorHelper(SelectorEngine.find(OPEN_SELECTOR)), + _step16; + try { + for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) { + var selector = _step16.value; + Offcanvas.getOrCreateInstance(selector).show(); + } + } catch (err) { + _iterator16.e(err); + } finally { + _iterator16.f(); } }); - EventHandler.on(window, EVENT_RESIZE, () => { - for (const element of SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')) { - if (getComputedStyle(element).position !== 'fixed') { - Offcanvas.getOrCreateInstance(element).hide(); + EventHandler.on(window, EVENT_RESIZE, function () { + var _iterator17 = _createForOfIteratorHelper(SelectorEngine.find('[aria-modal][class*=show][class*=offcanvas-]')), + _step17; + try { + for (_iterator17.s(); !(_step17 = _iterator17.n()).done;) { + var element = _step17.value; + if (getComputedStyle(element).position !== 'fixed') { + Offcanvas.getOrCreateInstance(element).hide(); + } } + } catch (err) { + _iterator17.e(err); + } finally { + _iterator17.f(); } }); enableDismissTrigger(Offcanvas); @@ -2935,8 +3558,8 @@ */ // js-docs-start allow-list - const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; - const DefaultAllowlist = { + var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; + var DefaultAllowlist = { // Global attributes allowed on any supplied element below. '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], a: ['target', 'href', 'title', 'rel'], @@ -2974,7 +3597,7 @@ }; // js-docs-end allow-list - const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); + var uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); /** * A pattern that recognizes URLs that are safe wrt. XSS in URL navigation @@ -2983,9 +3606,9 @@ * Shout-out to Angular https://github.com/angular/angular/blob/15.2.8/packages/core/src/sanitization/url_sanitizer.ts#L38 */ // eslint-disable-next-line unicorn/better-regex - const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; - const allowedAttribute = (attribute, allowedAttributeList) => { - const attributeName = attribute.nodeName.toLowerCase(); + var SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i; + var allowedAttribute = function allowedAttribute(attribute, allowedAttributeList) { + var attributeName = attribute.nodeName.toLowerCase(); if (allowedAttributeList.includes(attributeName)) { if (uriAttributes.has(attributeName)) { return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue)); @@ -2994,31 +3617,55 @@ } // Check if a regular expression validates the attribute. - return allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp).some(regex => regex.test(attributeName)); + return allowedAttributeList.filter(function (attributeRegex) { + return attributeRegex instanceof RegExp; + }).some(function (regex) { + return regex.test(attributeName); + }); }; function sanitizeHtml(unsafeHtml, allowList, sanitizeFunction) { + var _ref7; if (!unsafeHtml.length) { return unsafeHtml; } if (sanitizeFunction && typeof sanitizeFunction === 'function') { return sanitizeFunction(unsafeHtml); } - const domParser = new window.DOMParser(); - const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); - const elements = [].concat(...createdDocument.body.querySelectorAll('*')); - for (const element of elements) { - const elementName = element.nodeName.toLowerCase(); - if (!Object.keys(allowList).includes(elementName)) { - element.remove(); - continue; - } - const attributeList = [].concat(...element.attributes); - const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); - for (const attribute of attributeList) { - if (!allowedAttribute(attribute, allowedAttributes)) { - element.removeAttribute(attribute.nodeName); + var domParser = new window.DOMParser(); + var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); + var elements = (_ref7 = []).concat.apply(_ref7, _toConsumableArray(createdDocument.body.querySelectorAll('*'))); + var _iterator18 = _createForOfIteratorHelper(elements), + _step18; + try { + for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) { + var _ref8; + var element = _step18.value; + var elementName = element.nodeName.toLowerCase(); + if (!Object.keys(allowList).includes(elementName)) { + element.remove(); + continue; + } + var attributeList = (_ref8 = []).concat.apply(_ref8, _toConsumableArray(element.attributes)); + var allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); + var _iterator19 = _createForOfIteratorHelper(attributeList), + _step19; + try { + for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) { + var attribute = _step19.value; + if (!allowedAttribute(attribute, allowedAttributes)) { + element.removeAttribute(attribute.nodeName); + } + } + } catch (err) { + _iterator19.e(err); + } finally { + _iterator19.f(); } } + } catch (err) { + _iterator18.e(err); + } finally { + _iterator18.f(); } return createdDocument.body.innerHTML; } @@ -3030,13 +3677,12 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$5 = 'TemplateFactory'; - const Default$4 = { + var NAME$5 = 'TemplateFactory'; + var Default$4 = { allowList: DefaultAllowlist, content: {}, // { selector : text , selector2 : text2 , } @@ -3046,7 +3692,7 @@ sanitizeFn: null, template: '
    ' }; - const DefaultType$4 = { + var DefaultType$4 = { allowList: 'object', content: 'object', extraClass: '(string|function)', @@ -3055,7 +3701,7 @@ sanitizeFn: '(null|function)', template: 'string' }; - const DefaultContentType = { + var DefaultContentType = { entry: '(string|element|function|null)', selector: '(string|element)' }; @@ -3063,144 +3709,177 @@ /** * Class definition */ - - class TemplateFactory extends Config { - constructor(config) { - super(); - this._config = this._getConfig(config); + var TemplateFactory = /*#__PURE__*/function (_Config5) { + function TemplateFactory(config) { + var _this37; + _classCallCheck(this, TemplateFactory); + _this37 = _callSuper(this, TemplateFactory); + _this37._config = _this37._getConfig(config); + return _this37; } // Getters - static get Default() { - return Default$4; - } - static get DefaultType() { - return DefaultType$4; - } - static get NAME() { - return NAME$5; - } - - // Public - getContent() { - return Object.values(this._config.content).map(config => this._resolvePossibleFunction(config)).filter(Boolean); - } - hasContent() { - return this.getContent().length > 0; - } - changeContent(content) { - this._checkContent(content); - this._config.content = { - ...this._config.content, - ...content - }; - return this; - } - toHtml() { - const templateWrapper = document.createElement('div'); - templateWrapper.innerHTML = this._maybeSanitize(this._config.template); - for (const [selector, text] of Object.entries(this._config.content)) { - this._setContent(templateWrapper, text, selector); - } - const template = templateWrapper.children[0]; - const extraClass = this._resolvePossibleFunction(this._config.extraClass); - if (extraClass) { - template.classList.add(...extraClass.split(' ')); - } - return template; - } - - // Private - _typeCheckConfig(config) { - super._typeCheckConfig(config); - this._checkContent(config.content); - } - _checkContent(arg) { - for (const [selector, content] of Object.entries(arg)) { - super._typeCheckConfig({ - selector, - entry: content - }, DefaultContentType); + _inherits(TemplateFactory, _Config5); + return _createClass(TemplateFactory, [{ + key: "getContent", + value: + // Public + function getContent() { + var _this38 = this; + return Object.values(this._config.content).map(function (config) { + return _this38._resolvePossibleFunction(config); + }).filter(Boolean); + } + }, { + key: "hasContent", + value: function hasContent() { + return this.getContent().length > 0; + } + }, { + key: "changeContent", + value: function changeContent(content) { + this._checkContent(content); + this._config.content = _objectSpread(_objectSpread({}, this._config.content), content); + return this; + } + }, { + key: "toHtml", + value: function toHtml() { + var templateWrapper = document.createElement('div'); + templateWrapper.innerHTML = this._maybeSanitize(this._config.template); + for (var _i7 = 0, _Object$entries5 = Object.entries(this._config.content); _i7 < _Object$entries5.length; _i7++) { + var _Object$entries5$_i = _slicedToArray(_Object$entries5[_i7], 2), + selector = _Object$entries5$_i[0], + text = _Object$entries5$_i[1]; + this._setContent(templateWrapper, text, selector); + } + var template = templateWrapper.children[0]; + var extraClass = this._resolvePossibleFunction(this._config.extraClass); + if (extraClass) { + var _template$classList; + (_template$classList = template.classList).add.apply(_template$classList, _toConsumableArray(extraClass.split(' '))); + } + return template; } - } - _setContent(template, content, selector) { - const templateElement = SelectorEngine.findOne(selector, template); - if (!templateElement) { - return; + + // Private + }, { + key: "_typeCheckConfig", + value: function _typeCheckConfig(config) { + _superPropGet(TemplateFactory, "_typeCheckConfig", this, 3)([config]); + this._checkContent(config.content); + } + }, { + key: "_checkContent", + value: function _checkContent(arg) { + for (var _i8 = 0, _Object$entries6 = Object.entries(arg); _i8 < _Object$entries6.length; _i8++) { + var _Object$entries6$_i = _slicedToArray(_Object$entries6[_i8], 2), + selector = _Object$entries6$_i[0], + content = _Object$entries6$_i[1]; + _superPropGet(TemplateFactory, "_typeCheckConfig", this, 3)([{ + selector: selector, + entry: content + }, DefaultContentType]); + } } - content = this._resolvePossibleFunction(content); - if (!content) { - templateElement.remove(); - return; + }, { + key: "_setContent", + value: function _setContent(template, content, selector) { + var templateElement = SelectorEngine.findOne(selector, template); + if (!templateElement) { + return; + } + content = this._resolvePossibleFunction(content); + if (!content) { + templateElement.remove(); + return; + } + if (isElement(content)) { + this._putElementInTemplate(getElement(content), templateElement); + return; + } + if (this._config.html) { + templateElement.innerHTML = this._maybeSanitize(content); + return; + } + templateElement.textContent = content; + } + }, { + key: "_maybeSanitize", + value: function _maybeSanitize(arg) { + return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; + } + }, { + key: "_resolvePossibleFunction", + value: function _resolvePossibleFunction(arg) { + return execute(arg, [this]); + } + }, { + key: "_putElementInTemplate", + value: function _putElementInTemplate(element, templateElement) { + if (this._config.html) { + templateElement.innerHTML = ''; + templateElement.append(element); + return; + } + templateElement.textContent = element.textContent; } - if (isElement(content)) { - this._putElementInTemplate(getElement(content), templateElement); - return; + }], [{ + key: "Default", + get: function get() { + return Default$4; } - if (this._config.html) { - templateElement.innerHTML = this._maybeSanitize(content); - return; + }, { + key: "DefaultType", + get: function get() { + return DefaultType$4; } - templateElement.textContent = content; - } - _maybeSanitize(arg) { - return this._config.sanitize ? sanitizeHtml(arg, this._config.allowList, this._config.sanitizeFn) : arg; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this]); - } - _putElementInTemplate(element, templateElement) { - if (this._config.html) { - templateElement.innerHTML = ''; - templateElement.append(element); - return; + }, { + key: "NAME", + get: function get() { + return NAME$5; } - templateElement.textContent = element.textContent; - } - } - + }]); + }(Config); /** * -------------------------------------------------------------------------- * Bootstrap tooltip.js * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - - /** * Constants */ - - const NAME$4 = 'tooltip'; - const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); - const CLASS_NAME_FADE$2 = 'fade'; - const CLASS_NAME_MODAL = 'modal'; - const CLASS_NAME_SHOW$2 = 'show'; - const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; - const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; - const EVENT_MODAL_HIDE = 'hide.bs.modal'; - const TRIGGER_HOVER = 'hover'; - const TRIGGER_FOCUS = 'focus'; - const TRIGGER_CLICK = 'click'; - const TRIGGER_MANUAL = 'manual'; - const EVENT_HIDE$2 = 'hide'; - const EVENT_HIDDEN$2 = 'hidden'; - const EVENT_SHOW$2 = 'show'; - const EVENT_SHOWN$2 = 'shown'; - const EVENT_INSERTED = 'inserted'; - const EVENT_CLICK$1 = 'click'; - const EVENT_FOCUSIN$1 = 'focusin'; - const EVENT_FOCUSOUT$1 = 'focusout'; - const EVENT_MOUSEENTER = 'mouseenter'; - const EVENT_MOUSELEAVE = 'mouseleave'; - const AttachmentMap = { + var NAME$4 = 'tooltip'; + var DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); + var CLASS_NAME_FADE$2 = 'fade'; + var CLASS_NAME_MODAL = 'modal'; + var CLASS_NAME_SHOW$2 = 'show'; + var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; + var SELECTOR_MODAL = ".".concat(CLASS_NAME_MODAL); + var EVENT_MODAL_HIDE = 'hide.bs.modal'; + var TRIGGER_HOVER = 'hover'; + var TRIGGER_FOCUS = 'focus'; + var TRIGGER_CLICK = 'click'; + var TRIGGER_MANUAL = 'manual'; + var EVENT_HIDE$2 = 'hide'; + var EVENT_HIDDEN$2 = 'hidden'; + var EVENT_SHOW$2 = 'show'; + var EVENT_SHOWN$2 = 'shown'; + var EVENT_INSERTED = 'inserted'; + var EVENT_CLICK$1 = 'click'; + var EVENT_FOCUSIN$1 = 'focusin'; + var EVENT_FOCUSOUT$1 = 'focusout'; + var EVENT_MOUSEENTER = 'mouseenter'; + var EVENT_MOUSELEAVE = 'mouseleave'; + var AttachmentMap = { AUTO: 'auto', TOP: 'top', RIGHT: isRTL() ? 'left' : 'right', BOTTOM: 'bottom', LEFT: isRTL() ? 'right' : 'left' }; - const Default$3 = { + var Default$3 = { allowList: DefaultAllowlist, animation: true, boundary: 'clippingParents', @@ -3219,7 +3898,7 @@ title: '', trigger: 'hover focus' }; - const DefaultType$3 = { + var DefaultType$3 = { allowList: 'object', animation: 'boolean', boundary: '(string|element)', @@ -3242,433 +3921,538 @@ /** * Class definition */ - - class Tooltip extends BaseComponent { - constructor(element, config) { + var Tooltip = /*#__PURE__*/function (_BaseComponent8) { + function Tooltip(element, config) { + var _this39; + _classCallCheck(this, Tooltip); if (typeof Popper__namespace === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); } - super(element, config); + _this39 = _callSuper(this, Tooltip, [element, config]); // Private - this._isEnabled = true; - this._timeout = 0; - this._isHovered = null; - this._activeTrigger = {}; - this._popper = null; - this._templateFactory = null; - this._newContent = null; + _this39._isEnabled = true; + _this39._timeout = 0; + _this39._isHovered = null; + _this39._activeTrigger = {}; + _this39._popper = null; + _this39._templateFactory = null; + _this39._newContent = null; // Protected - this.tip = null; - this._setListeners(); - if (!this._config.selector) { - this._fixTitle(); + _this39.tip = null; + _this39._setListeners(); + if (!_this39._config.selector) { + _this39._fixTitle(); } + return _this39; } // Getters - static get Default() { - return Default$3; - } - static get DefaultType() { - return DefaultType$3; - } - static get NAME() { - return NAME$4; - } - - // Public - enable() { - this._isEnabled = true; - } - disable() { - this._isEnabled = false; - } - toggleEnabled() { - this._isEnabled = !this._isEnabled; - } - toggle() { - if (!this._isEnabled) { - return; - } - this._activeTrigger.click = !this._activeTrigger.click; - if (this._isShown()) { - this._leave(); - return; - } - this._enter(); - } - dispose() { - clearTimeout(this._timeout); - EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - if (this._element.getAttribute('data-bs-original-title')) { - this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); - } - this._disposePopper(); - super.dispose(); - } - show() { - if (this._element.style.display === 'none') { - throw new Error('Please use show on visible elements'); - } - if (!(this._isWithContent() && this._isEnabled)) { - return; - } - const showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); - const shadowRoot = findShadowRoot(this._element); - const isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); - if (showEvent.defaultPrevented || !isInTheDom) { - return; - } - - // TODO: v6 remove this or make it optional - this._disposePopper(); - const tip = this._getTipElement(); - this._element.setAttribute('aria-describedby', tip.getAttribute('id')); - const { - container - } = this._config; - if (!this._element.ownerDocument.documentElement.contains(this.tip)) { - container.append(tip); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); - } - this._popper = this._createPopper(tip); - tip.classList.add(CLASS_NAME_SHOW$2); - - // 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) { - for (const element of [].concat(...document.body.children)) { - EventHandler.on(element, 'mouseover', noop); - } - } - const complete = () => { - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOWN$2)); - if (this._isHovered === false) { + _inherits(Tooltip, _BaseComponent8); + return _createClass(Tooltip, [{ + key: "enable", + value: + // Public + function enable() { + this._isEnabled = true; + } + }, { + key: "disable", + value: function disable() { + this._isEnabled = false; + } + }, { + key: "toggleEnabled", + value: function toggleEnabled() { + this._isEnabled = !this._isEnabled; + } + }, { + key: "toggle", + value: function toggle() { + if (!this._isEnabled) { + return; + } + this._activeTrigger.click = !this._activeTrigger.click; + if (this._isShown()) { this._leave(); + return; } - this._isHovered = false; - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - hide() { - if (!this._isShown()) { - return; - } - const hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); - if (hideEvent.defaultPrevented) { - return; - } - const tip = this._getTipElement(); - tip.classList.remove(CLASS_NAME_SHOW$2); - - // If this is a touch-enabled device we remove the extra - // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - for (const element of [].concat(...document.body.children)) { - EventHandler.off(element, 'mouseover', noop); + this._enter(); + } + }, { + key: "dispose", + value: function dispose() { + clearTimeout(this._timeout); + EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + if (this._element.getAttribute('data-bs-original-title')) { + this._element.setAttribute('title', this._element.getAttribute('data-bs-original-title')); } - } - this._activeTrigger[TRIGGER_CLICK] = false; - this._activeTrigger[TRIGGER_FOCUS] = false; - this._activeTrigger[TRIGGER_HOVER] = false; - this._isHovered = null; // it is a trick to support manual triggering - - const complete = () => { - if (this._isWithActiveTrigger()) { + this._disposePopper(); + _superPropGet(Tooltip, "dispose", this, 3)([]); + } + }, { + key: "show", + value: function show() { + var _this40 = this; + if (this._element.style.display === 'none') { + throw new Error('Please use show on visible elements'); + } + if (!(this._isWithContent() && this._isEnabled)) { return; } - if (!this._isHovered) { - this._disposePopper(); + var showEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_SHOW$2)); + var shadowRoot = _findShadowRoot(this._element); + var isInTheDom = (shadowRoot || this._element.ownerDocument.documentElement).contains(this._element); + if (showEvent.defaultPrevented || !isInTheDom) { + return; } - this._element.removeAttribute('aria-describedby'); - EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDDEN$2)); - }; - this._queueCallback(complete, this.tip, this._isAnimated()); - } - update() { - if (this._popper) { - this._popper.update(); - } - } - - // Protected - _isWithContent() { - return Boolean(this._getTitle()); - } - _getTipElement() { - if (!this.tip) { - this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); - } - return this.tip; - } - _createTipElement(content) { - const tip = this._getTemplateFactory(content).toHtml(); - // TODO: remove this check in v6 - if (!tip) { - return null; - } - tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); - // TODO: v6 the following can be achieved with CSS only - tip.classList.add(`bs-${this.constructor.NAME}-auto`); - const tipId = getUID(this.constructor.NAME).toString(); - tip.setAttribute('id', tipId); - if (this._isAnimated()) { - tip.classList.add(CLASS_NAME_FADE$2); - } - return tip; - } - setContent(content) { - this._newContent = content; - if (this._isShown()) { + // TODO: v6 remove this or make it optional this._disposePopper(); - this.show(); - } - } - _getTemplateFactory(content) { - if (this._templateFactory) { - this._templateFactory.changeContent(content); - } else { - this._templateFactory = new TemplateFactory({ - ...this._config, - // the `content` var has to be after `this._config` - // to override config.content in case of popover - content, - extraClass: this._resolvePossibleFunction(this._config.customClass) - }); - } - return this._templateFactory; - } - _getContentForTemplate() { - return { - [SELECTOR_TOOLTIP_INNER]: this._getTitle() - }; - } - _getTitle() { - return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); - } - - // Private - _initializeOnDelegatedTarget(event) { - return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); - } - _isAnimated() { - return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); - } - _isShown() { - return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); - } - _createPopper(tip) { - const placement = execute(this._config.placement, [this, tip, this._element]); - const attachment = AttachmentMap[placement.toUpperCase()]; - return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); - } - _getOffset() { - const { - offset - } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(value => Number.parseInt(value, 10)); - } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); - } - return offset; - } - _resolvePossibleFunction(arg) { - return execute(arg, [this._element]); - } - _getPopperConfig(attachment) { - const defaultBsPopperConfig = { - placement: attachment, - modifiers: [{ - name: 'flip', - options: { - fallbackPlacements: this._config.fallbackPlacements + var tip = this._getTipElement(); + this._element.setAttribute('aria-describedby', tip.getAttribute('id')); + var container = this._config.container; + if (!this._element.ownerDocument.documentElement.contains(this.tip)) { + container.append(tip); + EventHandler.trigger(this._element, this.constructor.eventName(EVENT_INSERTED)); + } + this._popper = this._createPopper(tip); + tip.classList.add(CLASS_NAME_SHOW$2); + + // 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) { + var _ref9; + var _iterator20 = _createForOfIteratorHelper((_ref9 = []).concat.apply(_ref9, _toConsumableArray(document.body.children))), + _step20; + try { + for (_iterator20.s(); !(_step20 = _iterator20.n()).done;) { + var element = _step20.value; + EventHandler.on(element, 'mouseover', noop); + } + } catch (err) { + _iterator20.e(err); + } finally { + _iterator20.f(); } - }, { - name: 'offset', - options: { - offset: this._getOffset() + } + var complete = function complete() { + EventHandler.trigger(_this40._element, _this40.constructor.eventName(EVENT_SHOWN$2)); + if (_this40._isHovered === false) { + _this40._leave(); } - }, { - name: 'preventOverflow', - options: { - boundary: this._config.boundary + _this40._isHovered = false; + }; + this._queueCallback(complete, this.tip, this._isAnimated()); + } + }, { + key: "hide", + value: function hide() { + var _this41 = this; + if (!this._isShown()) { + return; + } + var hideEvent = EventHandler.trigger(this._element, this.constructor.eventName(EVENT_HIDE$2)); + if (hideEvent.defaultPrevented) { + return; + } + var tip = this._getTipElement(); + tip.classList.remove(CLASS_NAME_SHOW$2); + + // If this is a touch-enabled device we remove the extra + // empty mouseover listeners we added for iOS support + if ('ontouchstart' in document.documentElement) { + var _ref10; + var _iterator21 = _createForOfIteratorHelper((_ref10 = []).concat.apply(_ref10, _toConsumableArray(document.body.children))), + _step21; + try { + for (_iterator21.s(); !(_step21 = _iterator21.n()).done;) { + var element = _step21.value; + EventHandler.off(element, 'mouseover', noop); + } + } catch (err) { + _iterator21.e(err); + } finally { + _iterator21.f(); } - }, { - name: 'arrow', - options: { - element: `.${this.constructor.NAME}-arrow` + } + this._activeTrigger[TRIGGER_CLICK] = false; + this._activeTrigger[TRIGGER_FOCUS] = false; + this._activeTrigger[TRIGGER_HOVER] = false; + this._isHovered = null; // it is a trick to support manual triggering + + var complete = function complete() { + if (_this41._isWithActiveTrigger()) { + return; } - }, { - name: 'preSetPlacement', - enabled: true, - phase: 'beforeMain', - fn: data => { - // Pre-set Popper's placement attribute in order to read the arrow sizes properly. - // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement - this._getTipElement().setAttribute('data-popper-placement', data.state.placement); + if (!_this41._isHovered) { + _this41._disposePopper(); } - }] - }; - return { - ...defaultBsPopperConfig, - ...execute(this._config.popperConfig, [defaultBsPopperConfig]) - }; - } - _setListeners() { - const triggers = this._config.trigger.split(' '); - for (const trigger of triggers) { - if (trigger === 'click') { - EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context.toggle(); - }); - } else if (trigger !== TRIGGER_MANUAL) { - const eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); - const eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); - EventHandler.on(this._element, eventIn, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; - context._enter(); - }); - EventHandler.on(this._element, eventOut, this._config.selector, event => { - const context = this._initializeOnDelegatedTarget(event); - context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); - context._leave(); - }); - } + _this41._element.removeAttribute('aria-describedby'); + EventHandler.trigger(_this41._element, _this41.constructor.eventName(EVENT_HIDDEN$2)); + }; + this._queueCallback(complete, this.tip, this._isAnimated()); } - this._hideModalHandler = () => { - if (this._element) { - this.hide(); + }, { + key: "update", + value: function update() { + if (this._popper) { + this._popper.update(); } - }; - EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); - } - _fixTitle() { - const title = this._element.getAttribute('title'); - if (!title) { - return; - } - if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { - this._element.setAttribute('aria-label', title); - } - this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility - this._element.removeAttribute('title'); - } - _enter() { - if (this._isShown() || this._isHovered) { - this._isHovered = true; - return; } - this._isHovered = true; - this._setTimeout(() => { - if (this._isHovered) { - this.show(); + + // Protected + }, { + key: "_isWithContent", + value: function _isWithContent() { + return Boolean(this._getTitle()); + } + }, { + key: "_getTipElement", + value: function _getTipElement() { + if (!this.tip) { + this.tip = this._createTipElement(this._newContent || this._getContentForTemplate()); } - }, this._config.delay.show); - } - _leave() { - if (this._isWithActiveTrigger()) { - return; + return this.tip; } - this._isHovered = false; - this._setTimeout(() => { - if (!this._isHovered) { - this.hide(); + }, { + key: "_createTipElement", + value: function _createTipElement(content) { + var tip = this._getTemplateFactory(content).toHtml(); + + // TODO: remove this check in v6 + if (!tip) { + return null; } - }, this._config.delay.hide); - } - _setTimeout(handler, timeout) { - clearTimeout(this._timeout); - this._timeout = setTimeout(handler, timeout); - } - _isWithActiveTrigger() { - return Object.values(this._activeTrigger).includes(true); - } - _getConfig(config) { - const dataAttributes = Manipulator.getDataAttributes(this._element); - for (const dataAttribute of Object.keys(dataAttributes)) { - if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { - delete dataAttributes[dataAttribute]; + tip.classList.remove(CLASS_NAME_FADE$2, CLASS_NAME_SHOW$2); + // TODO: v6 the following can be achieved with CSS only + tip.classList.add("bs-".concat(this.constructor.NAME, "-auto")); + var tipId = getUID(this.constructor.NAME).toString(); + tip.setAttribute('id', tipId); + if (this._isAnimated()) { + tip.classList.add(CLASS_NAME_FADE$2); } + return tip; } - config = { - ...dataAttributes, - ...(typeof config === 'object' && config ? config : {}) - }; - config = this._mergeConfigObj(config); - config = this._configAfterMerge(config); - this._typeCheckConfig(config); - return config; - } - _configAfterMerge(config) { - config.container = config.container === false ? document.body : getElement(config.container); - if (typeof config.delay === 'number') { - config.delay = { - show: config.delay, - hide: config.delay - }; + }, { + key: "setContent", + value: function setContent(content) { + this._newContent = content; + if (this._isShown()) { + this._disposePopper(); + this.show(); + } } - if (typeof config.title === 'number') { - config.title = config.title.toString(); + }, { + key: "_getTemplateFactory", + value: function _getTemplateFactory(content) { + if (this._templateFactory) { + this._templateFactory.changeContent(content); + } else { + this._templateFactory = new TemplateFactory(_objectSpread(_objectSpread({}, this._config), {}, { + // the `content` var has to be after `this._config` + // to override config.content in case of popover + content: content, + extraClass: this._resolvePossibleFunction(this._config.customClass) + })); + } + return this._templateFactory; } - if (typeof config.content === 'number') { - config.content = config.content.toString(); + }, { + key: "_getContentForTemplate", + value: function _getContentForTemplate() { + return _defineProperty({}, SELECTOR_TOOLTIP_INNER, this._getTitle()); } - return config; - } - _getDelegateConfig() { - const config = {}; - for (const [key, value] of Object.entries(this._config)) { - if (this.constructor.Default[key] !== value) { - config[key] = value; - } + }, { + key: "_getTitle", + value: function _getTitle() { + return this._resolvePossibleFunction(this._config.title) || this._element.getAttribute('data-bs-original-title'); } - config.selector = false; - config.trigger = 'manual'; - // In the future can be replaced with: - // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) - // `Object.fromEntries(keysWithDifferentValues)` - return config; - } - _disposePopper() { - if (this._popper) { - this._popper.destroy(); - this._popper = null; + // Private + }, { + key: "_initializeOnDelegatedTarget", + value: function _initializeOnDelegatedTarget(event) { + return this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); + } + }, { + key: "_isAnimated", + value: function _isAnimated() { + return this._config.animation || this.tip && this.tip.classList.contains(CLASS_NAME_FADE$2); + } + }, { + key: "_isShown", + value: function _isShown() { + return this.tip && this.tip.classList.contains(CLASS_NAME_SHOW$2); + } + }, { + key: "_createPopper", + value: function _createPopper(tip) { + var placement = execute(this._config.placement, [this, tip, this._element]); + var attachment = AttachmentMap[placement.toUpperCase()]; + return Popper__namespace.createPopper(this._element, tip, this._getPopperConfig(attachment)); + } + }, { + key: "_getOffset", + value: function _getOffset() { + var _this42 = this; + var offset = this._config.offset; + if (typeof offset === 'string') { + return offset.split(',').map(function (value) { + return Number.parseInt(value, 10); + }); + } + if (typeof offset === 'function') { + return function (popperData) { + return offset(popperData, _this42._element); + }; + } + return offset; + } + }, { + key: "_resolvePossibleFunction", + value: function _resolvePossibleFunction(arg) { + return execute(arg, [this._element]); + } + }, { + key: "_getPopperConfig", + value: function _getPopperConfig(attachment) { + var _this43 = this; + var defaultBsPopperConfig = { + placement: attachment, + modifiers: [{ + name: 'flip', + options: { + fallbackPlacements: this._config.fallbackPlacements + } + }, { + name: 'offset', + options: { + offset: this._getOffset() + } + }, { + name: 'preventOverflow', + options: { + boundary: this._config.boundary + } + }, { + name: 'arrow', + options: { + element: ".".concat(this.constructor.NAME, "-arrow") + } + }, { + name: 'preSetPlacement', + enabled: true, + phase: 'beforeMain', + fn: function fn(data) { + // Pre-set Popper's placement attribute in order to read the arrow sizes properly. + // Otherwise, Popper mixes up the width and height dimensions since the initial arrow style is for top placement + _this43._getTipElement().setAttribute('data-popper-placement', data.state.placement); + } + }] + }; + return _objectSpread(_objectSpread({}, defaultBsPopperConfig), execute(this._config.popperConfig, [defaultBsPopperConfig])); + } + }, { + key: "_setListeners", + value: function _setListeners() { + var _this44 = this; + var triggers = this._config.trigger.split(' '); + var _iterator22 = _createForOfIteratorHelper(triggers), + _step22; + try { + for (_iterator22.s(); !(_step22 = _iterator22.n()).done;) { + var trigger = _step22.value; + if (trigger === 'click') { + EventHandler.on(this._element, this.constructor.eventName(EVENT_CLICK$1), this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context.toggle(); + }); + } else if (trigger !== TRIGGER_MANUAL) { + var eventIn = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSEENTER) : this.constructor.eventName(EVENT_FOCUSIN$1); + var eventOut = trigger === TRIGGER_HOVER ? this.constructor.eventName(EVENT_MOUSELEAVE) : this.constructor.eventName(EVENT_FOCUSOUT$1); + EventHandler.on(this._element, eventIn, this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; + context._enter(); + }); + EventHandler.on(this._element, eventOut, this._config.selector, function (event) { + var context = _this44._initializeOnDelegatedTarget(event); + context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); + context._leave(); + }); + } + } + } catch (err) { + _iterator22.e(err); + } finally { + _iterator22.f(); + } + this._hideModalHandler = function () { + if (_this44._element) { + _this44.hide(); + } + }; + EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); } - if (this.tip) { - this.tip.remove(); - this.tip = null; + }, { + key: "_fixTitle", + value: function _fixTitle() { + var title = this._element.getAttribute('title'); + if (!title) { + return; + } + if (!this._element.getAttribute('aria-label') && !this._element.textContent.trim()) { + this._element.setAttribute('aria-label', title); + } + this._element.setAttribute('data-bs-original-title', title); // DO NOT USE IT. Is only for backwards compatibility + this._element.removeAttribute('title'); + } + }, { + key: "_enter", + value: function _enter() { + var _this45 = this; + if (this._isShown() || this._isHovered) { + this._isHovered = true; + return; + } + this._isHovered = true; + this._setTimeout(function () { + if (_this45._isHovered) { + _this45.show(); + } + }, this._config.delay.show); } - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Tooltip.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + }, { + key: "_leave", + value: function _leave() { + var _this46 = this; + if (this._isWithActiveTrigger()) { return; } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); + this._isHovered = false; + this._setTimeout(function () { + if (!_this46._isHovered) { + _this46.hide(); + } + }, this._config.delay.hide); + } + }, { + key: "_setTimeout", + value: function _setTimeout(handler, timeout) { + clearTimeout(this._timeout); + this._timeout = setTimeout(handler, timeout); + } + }, { + key: "_isWithActiveTrigger", + value: function _isWithActiveTrigger() { + return Object.values(this._activeTrigger).includes(true); + } + }, { + key: "_getConfig", + value: function _getConfig(config) { + var dataAttributes = Manipulator.getDataAttributes(this._element); + for (var _i9 = 0, _Object$keys2 = Object.keys(dataAttributes); _i9 < _Object$keys2.length; _i9++) { + var dataAttribute = _Object$keys2[_i9]; + if (DISALLOWED_ATTRIBUTES.has(dataAttribute)) { + delete dataAttributes[dataAttribute]; + } } - data[config](); - }); - } - } + config = _objectSpread(_objectSpread({}, dataAttributes), _typeof(config) === 'object' && config ? config : {}); + config = this._mergeConfigObj(config); + config = this._configAfterMerge(config); + this._typeCheckConfig(config); + return config; + } + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + config.container = config.container === false ? document.body : getElement(config.container); + 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(); + } + return config; + } + }, { + key: "_getDelegateConfig", + value: function _getDelegateConfig() { + var config = {}; + for (var _i10 = 0, _Object$entries7 = Object.entries(this._config); _i10 < _Object$entries7.length; _i10++) { + var _Object$entries7$_i = _slicedToArray(_Object$entries7[_i10], 2), + key = _Object$entries7$_i[0], + value = _Object$entries7$_i[1]; + if (this.constructor.Default[key] !== value) { + config[key] = value; + } + } + config.selector = false; + config.trigger = 'manual'; + + // In the future can be replaced with: + // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) + // `Object.fromEntries(keysWithDifferentValues)` + return config; + } + }, { + key: "_disposePopper", + value: function _disposePopper() { + if (this._popper) { + this._popper.destroy(); + this._popper = null; + } + if (this.tip) { + this.tip.remove(); + this.tip = null; + } + } + // Static + }], [{ + key: "Default", + get: function get() { + return Default$3; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$3; + } + }, { + key: "NAME", + get: function get() { + return NAME$4; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Tooltip.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + }); + } + }]); + }(BaseComponent); /** * jQuery */ - defineJQueryPlugin(Tooltip); /** @@ -3678,78 +4462,90 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$3 = 'popover'; - const SELECTOR_TITLE = '.popover-header'; - const SELECTOR_CONTENT = '.popover-body'; - const Default$2 = { - ...Tooltip.Default, + var NAME$3 = 'popover'; + var SELECTOR_TITLE = '.popover-header'; + var SELECTOR_CONTENT = '.popover-body'; + var Default$2 = _objectSpread(_objectSpread({}, Tooltip.Default), {}, { content: '', offset: [0, 8], placement: 'right', template: '', trigger: 'click' - }; - const DefaultType$2 = { - ...Tooltip.DefaultType, + }); + var DefaultType$2 = _objectSpread(_objectSpread({}, Tooltip.DefaultType), {}, { content: '(null|string|element|function)' - }; + }); /** * Class definition */ - - class Popover extends Tooltip { - // Getters - static get Default() { - return Default$2; - } - static get DefaultType() { - return DefaultType$2; - } - static get NAME() { - return NAME$3; - } - - // Overrides - _isWithContent() { - return this._getTitle() || this._getContent(); - } - - // Private - _getContentForTemplate() { - return { - [SELECTOR_TITLE]: this._getTitle(), - [SELECTOR_CONTENT]: this._getContent() - }; - } - _getContent() { - return this._resolvePossibleFunction(this._config.content); - } - - // Static - static jQueryInterface(config) { - return this.each(function () { - const data = Popover.getOrCreateInstance(this, config); - if (typeof config !== 'string') { - return; - } - if (typeof data[config] === 'undefined') { - throw new TypeError(`No method named "${config}"`); - } - data[config](); - }); + var Popover = /*#__PURE__*/function (_Tooltip) { + function Popover() { + _classCallCheck(this, Popover); + return _callSuper(this, Popover, arguments); } - } + _inherits(Popover, _Tooltip); + return _createClass(Popover, [{ + key: "_isWithContent", + value: + // Overrides + function _isWithContent() { + return this._getTitle() || this._getContent(); + } + // Private + }, { + key: "_getContentForTemplate", + value: function _getContentForTemplate() { + return _defineProperty(_defineProperty({}, SELECTOR_TITLE, this._getTitle()), SELECTOR_CONTENT, this._getContent()); + } + }, { + key: "_getContent", + value: function _getContent() { + return this._resolvePossibleFunction(this._config.content); + } + + // Static + }], [{ + key: "Default", + get: + // Getters + function get() { + return Default$2; + } + }, { + key: "DefaultType", + get: function get() { + return DefaultType$2; + } + }, { + key: "NAME", + get: function get() { + return NAME$3; + } + }, { + key: "jQueryInterface", + value: function jQueryInterface(config) { + return this.each(function () { + var data = Popover.getOrCreateInstance(this, config); + if (typeof config !== 'string') { + return; + } + if (typeof data[config] === 'undefined') { + throw new TypeError("No method named \"".concat(config, "\"")); + } + data[config](); + }); + } + }]); + }(Tooltip); /** * jQuery */ - defineJQueryPlugin(Popover); /** @@ -3759,30 +4555,29 @@ * -------------------------------------------------------------------------- */ - /** * Constants */ - const NAME$2 = 'scrollspy'; - const DATA_KEY$2 = 'bs.scrollspy'; - const EVENT_KEY$2 = `.${DATA_KEY$2}`; - const DATA_API_KEY = '.data-api'; - const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; - const EVENT_CLICK = `click${EVENT_KEY$2}`; - const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$2}${DATA_API_KEY}`; - const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; - const CLASS_NAME_ACTIVE$1 = 'active'; - const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; - const SELECTOR_TARGET_LINKS = '[href]'; - const SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; - const SELECTOR_NAV_LINKS = '.nav-link'; - const SELECTOR_NAV_ITEMS = '.nav-item'; - const SELECTOR_LIST_ITEMS = '.list-group-item'; - const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_NAV_ITEMS} > ${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}`; - const SELECTOR_DROPDOWN = '.dropdown'; - const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; - const Default$1 = { + var NAME$2 = 'scrollspy'; + var DATA_KEY$2 = 'bs.scrollspy'; + var EVENT_KEY$2 = ".".concat(DATA_KEY$2); + var DATA_API_KEY = '.data-api'; + var EVENT_ACTIVATE = "activate".concat(EVENT_KEY$2); + var EVENT_CLICK = "click".concat(EVENT_KEY$2); + var EVENT_LOAD_DATA_API$1 = "load".concat(EVENT_KEY$2).concat(DATA_API_KEY); + var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; + var CLASS_NAME_ACTIVE$1 = 'active'; + var SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; + var SELECTOR_TARGET_LINKS = '[href]'; + 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_LINK_ITEMS = "".concat(SELECTOR_NAV_LINKS, ", ").concat(SELECTOR_NAV_ITEMS, " > ").concat(SELECTOR_NAV_LINKS, ", ").concat(SELECTOR_LIST_ITEMS); + var SELECTOR_DROPDOWN = '.dropdown'; + var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; + var Default$1 = { offset: null, // TODO: v6 @deprecated, keep it for backwards compatibility reasons rootMargin: '0px 0px -25%', @@ -3790,7 +4585,7 @@ target: null, threshold: [0.1, 0.5, 1] }; - const DefaultType$1 = { + var DefaultType$1 = { offset: '(number|null)', // TODO v6 @deprecated, keep it for backwards compatibility reasons rootMargin: 'string', @@ -3802,207 +4597,309 @@ /** * Class definition */ - - class ScrollSpy extends BaseComponent { - constructor(element, config) { - super(element, config); + var ScrollSpy = /*#__PURE__*/function (_BaseComponent9) { + function ScrollSpy(element, config) { + var _this47; + _classCallCheck(this, ScrollSpy); + _this47 = _callSuper(this, ScrollSpy, [element, config]); // this._element is the observablesContainer and config.target the menu links wrapper - this._targetLinks = new Map(); - this._observableSections = new Map(); - this._rootElement = getComputedStyle(this._element).overflowY === 'visible' ? null : this._element; - this._activeTarget = null; - this._observer = null; - this._previousScrollData = { + _this47._targetLinks = new Map(); + _this47._observableSections = new Map(); + _this47._rootElement = getComputedStyle(_this47._element).overflowY === 'visible' ? null : _this47._element; + _this47._activeTarget = null; + _this47._observer = null; + _this47._previousScrollData = { visibleEntryTop: 0, parentScrollTop: 0 }; - this.refresh(); // initialize + _this47.refresh(); // initialize + return _this47; } // Getters - static get Default() { - return Default$1; - } - static get DefaultType() { - return DefaultType$1; - } - static get NAME() { - return NAME$2; - } - - // Public - refresh() { - this._initializeTargetsAndObservables(); - this._maybeEnableSmoothScroll(); - if (this._observer) { - this._observer.disconnect(); - } else { - this._observer = this._getNewObserver(); - } - for (const section of this._observableSections.values()) { - this._observer.observe(section); - } - } - dispose() { - this._observer.disconnect(); - super.dispose(); - } - - // Private - _configAfterMerge(config) { - // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case - config.target = getElement(config.target) || document.body; - - // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only - config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin; - if (typeof config.threshold === 'string') { - config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value)); - } - return config; - } - _maybeEnableSmoothScroll() { - if (!this._config.smoothScroll) { - return; - } - - // unregister any previous listeners - EventHandler.off(this._config.target, EVENT_CLICK); - EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, event => { - const observableSection = this._observableSections.get(event.target.hash); - if (observableSection) { - event.preventDefault(); - const root = this._rootElement || window; - const height = observableSection.offsetTop - this._element.offsetTop; - if (root.scrollTo) { - root.scrollTo({ - top: height, - behavior: 'smooth' - }); - return; - } - - // Chrome 60 doesn't support `scrollTo` - root.scrollTop = height; - } - }); - } - _getNewObserver() { - const options = { - root: this._rootElement, - threshold: this._config.threshold, - rootMargin: this._config.rootMargin - }; - return new IntersectionObserver(entries => this._observerCallback(entries), options); - } - - // The logic of selection - _observerCallback(entries) { - const targetElement = entry => this._targetLinks.get(`#${entry.target.id}`); - const activate = entry => { - this._previousScrollData.visibleEntryTop = entry.target.offsetTop; - this._process(targetElement(entry)); - }; - const parentScrollTop = (this._rootElement || document.documentElement).scrollTop; - const userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; - this._previousScrollData.parentScrollTop = parentScrollTop; - for (const entry of entries) { - if (!entry.isIntersecting) { - this._activeTarget = null; - this._clearActiveClass(targetElement(entry)); - continue; + _inherits(ScrollSpy, _BaseComponent9); + return _createClass(ScrollSpy, [{ + key: "refresh", + value: + // Public + function refresh() { + this._initializeTargetsAndObservables(); + this._maybeEnableSmoothScroll(); + if (this._observer) { + this._observer.disconnect(); + } else { + this._observer = this._getNewObserver(); } - const entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; - // if we are scrolling down, pick the bigger offsetTop - if (userScrollsDown && entryIsLowerThanPrevious) { - activate(entry); - // if parent isn't scrolled, let's keep the first visible item, breaking the iteration - if (!parentScrollTop) { - return; + var _iterator23 = _createForOfIteratorHelper(this._observableSections.values()), + _step23; + try { + for (_iterator23.s(); !(_step23 = _iterator23.n()).done;) { + var section = _step23.value; + this._observer.observe(section); } - continue; + } catch (err) { + _iterator23.e(err); + } finally { + _iterator23.f(); } + } + }, { + key: "dispose", + value: function dispose() { + this._observer.disconnect(); + _superPropGet(ScrollSpy, "dispose", this, 3)([]); + } - // if we are scrolling up, pick the smallest offsetTop - if (!userScrollsDown && !entryIsLowerThanPrevious) { - activate(entry); + // Private + }, { + key: "_configAfterMerge", + value: function _configAfterMerge(config) { + // TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case + config.target = getElement(config.target) || document.body; + + // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only + config.rootMargin = config.offset ? "".concat(config.offset, "px 0px -30%") : config.rootMargin; + if (typeof config.threshold === 'string') { + config.threshold = config.threshold.split(',').map(function (value) { + return Number.parseFloat(value); + }); } + return config; } - } - _initializeTargetsAndObservables() { - this._targetLinks = new Map(); - this._observableSections = new Map(); - const targetLinks = SelectorEngine.find(SELECTOR_TARGET_LINKS, this._config.target); - for (const anchor of targetLinks) { - // ensure that the anchor has an id and is not disabled - if (!anchor.hash || isDisabled(anchor)) { - continue; + }, { + key: "_maybeEnableSmoothScroll", + value: function _maybeEnableSmoothScroll() { + var _this48 = this; + if (!this._config.smoothScroll) { + return; } - const observableSection = SelectorEngine.findOne(decodeURI(anchor.hash), this._element); - // ensure that the observableSection exists & is visible - if (isVisible(observableSection)) { - this._targetLinks.set(decodeURI(anchor.hash), anchor); - this._observableSections.set(anchor.hash, observableSection); - } - } - } - _process(target) { - if (this._activeTarget === target) { - return; + // unregister any previous listeners + EventHandler.off(this._config.target, EVENT_CLICK); + EventHandler.on(this._config.target, EVENT_CLICK, SELECTOR_TARGET_LINKS, function (event) { + var observableSection = _this48._observableSections.get(event.target.hash); + if (observableSection) { + event.preventDefault(); + var root = _this48._rootElement || window; + var height = observableSection.offsetTop - _this48._element.offsetTop; + if (root.scrollTo) { + root.scrollTo({ + top: height, + behavior: 'smooth' + }); + return; + } + + // Chrome 60 doesn't support `scrollTo` + root.scrollTop = height; + } + }); } - this._clearActiveClass(this._config.target); - this._activeTarget = target; - target.classList.add(CLASS_NAME_ACTIVE$1); - this._activateParents(target); - EventHandler.trigger(this._element, EVENT_ACTIVATE, { - relatedTarget: target - }); - } - _activateParents(target) { - // Activate dropdown parents - if (target.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { - SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, target.closest(SELECTOR_DROPDOWN)).classList.add(CLASS_NAME_ACTIVE$1); - return; + }, { + key: "_getNewObserver", + value: function _getNewObserver() { + var _this49 = this; + var options = { + root: this._rootElement, + threshold: this._config.threshold, + rootMargin: this._config.rootMargin + }; + return new IntersectionObserver(function (entries) { + return _this49._observerCallback(entries); + }, options); + } + + // The logic of selection + }, { + key: "_observerCallback", + value: function _observerCallback(entries) { + var _this50 = this; + var targetElement = function targetElement(entry) { + return _this50._targetLinks.get("#".concat(entry.target.id)); + }; + var activate = function activate(entry) { + _this50._previousScrollData.visibleEntryTop = entry.target.offsetTop; + _this50._process(targetElement(entry)); + }; + var parentScrollTop = (this._rootElement || document.documentElement).scrollTop; + var userScrollsDown = parentScrollTop >= this._previousScrollData.parentScrollTop; + this._previousScrollData.parentScrollTop = parentScrollTop; + var _iterator24 = _createForOfIteratorHelper(entries), + _step24; + try { + for (_iterator24.s(); !(_step24 = _iterator24.n()).done;) { + var entry = _step24.value; + if (!entry.isIntersecting) { + this._activeTarget = null; + this._clearActiveClass(targetElement(entry)); + continue; + } + var entryIsLowerThanPrevious = entry.target.offsetTop >= this._previousScrollData.visibleEntryTop; + // if we are scrolling down, pick the bigger offsetTop + if (userScrollsDown && entryIsLowerThanPrevious) { + activate(entry); + // if parent isn't scrolled, let's keep the first visible item, breaking the iteration + if (!parentScrollTop) { + return; + } + continue; + } + + // if we are scrolling up, pick the smallest offsetTop + if (!userScrollsDown && !entryIsLowerThanPrevious) { + activate(entry); + } + } + } catch (err) { + _iterator24.e(err); + } finally { + _iterator24.f(); + } } - for (const listGroup of SelectorEngine.parents(target, SELECTOR_NAV_LIST_GROUP)) { - // Set triggered links parents as active - // With both
      and