From f2d4acbec5326fddb90cc06255d451e941dc6881 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Wed, 27 Apr 2022 20:48:02 -0400 Subject: [PATCH 01/19] Updates min Bootstrap version Updates minimum-supported Bootstrap version. WIP to add support for BS5 --- bootbox.js | 69 +++++++--------------- bower.json | 2 +- dist/bootbox.all.min.js | 2 +- dist/bootbox.locales.min.js | 2 +- dist/bootbox.min.js | 2 +- header.txt | 2 +- karma-base.conf.js | 5 +- karma.conf.js | 2 +- karma.conf.legacy.js | 9 +++ package-lock.json | 26 ++++++-- package.json | 10 ++-- tests/vendor/bootstrap-4.0.0.bundle.min.js | 7 --- tests/vendor/bootstrap-4.1.0.bundle.min.js | 7 --- tests/vendor/bootstrap-4.3.1.bundle.min.js | 7 --- tests/vendor/bootstrap-4.6.1.bundle.min.js | 7 +++ tests/vendor/bootstrap-5.1.3.bundle.min.js | 7 +++ 16 files changed, 77 insertions(+), 89 deletions(-) create mode 100644 karma.conf.legacy.js delete mode 100644 tests/vendor/bootstrap-4.0.0.bundle.min.js delete mode 100644 tests/vendor/bootstrap-4.1.0.bundle.min.js delete mode 100644 tests/vendor/bootstrap-4.3.1.bundle.min.js create mode 100644 tests/vendor/bootstrap-4.6.1.bundle.min.js create mode 100644 tests/vendor/bootstrap-5.1.3.bundle.min.js diff --git a/bootbox.js b/bootbox.js index 1a9d613b..ff622a5b 100644 --- a/bootbox.js +++ b/bootbox.js @@ -1,6 +1,6 @@ /*! @preserve * bootbox.js - * version: 5.5.2 + * version: 6.0.0-wip * author: Nick Payne * license: MIT * http://bootboxjs.com/ @@ -65,7 +65,7 @@ var exports = {}; - var VERSION = '5.5.2'; + var VERSION = '6.0.0-wip'; exports.VERSION = VERSION; var locales = { @@ -77,53 +77,26 @@ }; var templates = { - dialog: - '', - header: - '', - footer: - '', - closeButton: - '', - form: - '
', - button: - '', - option: - '', - promptMessage: - '
', + dialog: '', + header: '', + footer: '', + closeButton: '', + form: '
', + button: '', + option: '', + promptMessage: '
', inputs: { - text: - '', - textarea: - '', - email: - '', - select: - '', - checkbox: - '
', - radio: - '
', - date: - '', - time: - '', - number: - '', - password: - '', - range: - '' + text: '', + textarea: '', + email: '', + select: '', + checkbox: '
', + radio: '
', + date: '', + time: '', + number: '', + password: '', + range: '' } }; diff --git a/bower.json b/bower.json index efa634b1..e4f40352 100644 --- a/bower.json +++ b/bower.json @@ -12,6 +12,6 @@ "tests" ], "dependencies": { - "bootstrap": ">= 3.3.7" + "bootstrap": ">= 4.6.1" } } diff --git a/dist/bootbox.all.min.js b/dist/bootbox.all.min.js index c25de39a..d1059bc4 100644 --- a/dist/bootbox.all.min.js +++ b/dist/bootbox.all.min.js @@ -1,5 +1,5 @@ /** - * bootbox.js 5.5.2 + * bootbox.js 6.0.0-wip * * http://bootboxjs.com/license.txt */ diff --git a/dist/bootbox.locales.min.js b/dist/bootbox.locales.min.js index a74b382e..e4fa48de 100644 --- a/dist/bootbox.locales.min.js +++ b/dist/bootbox.locales.min.js @@ -1,5 +1,5 @@ /** - * bootbox.js 5.5.2 + * bootbox.js 6.0.0-wip * * http://bootboxjs.com/license.txt */ diff --git a/dist/bootbox.min.js b/dist/bootbox.min.js index a6e5fcb4..bcb8cb50 100644 --- a/dist/bootbox.min.js +++ b/dist/bootbox.min.js @@ -1,5 +1,5 @@ /** - * bootbox.js 5.5.2 + * bootbox.js 6.0.0-wip * * http://bootboxjs.com/license.txt */ diff --git a/header.txt b/header.txt index a7a8de5f..20fefea4 100644 --- a/header.txt +++ b/header.txt @@ -1,5 +1,5 @@ /** - * bootbox.js 5.5.2 + * bootbox.js 6.0.0-wip * * http://bootboxjs.com/license.txt */ \ No newline at end of file diff --git a/karma-base.conf.js b/karma-base.conf.js index 731d81a6..0a881942 100644 --- a/karma-base.conf.js +++ b/karma-base.conf.js @@ -4,7 +4,6 @@ process.env.CHROME_BIN = puppeteer.executablePath(); module.exports = function(params) { 'use strict'; return function(config) { - return config.set({ basePath: '', frameworks: ['mocha', 'sinon-chai'], @@ -34,7 +33,5 @@ module.exports = function(params) { outputDir: 'tests/reports' } }); - }; - -}; +}; \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 5e2680b0..2553cafe 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,7 @@ var baseConfig = require('./karma-base.conf'); module.exports = baseConfig({ vendor: [ 'tests/vendor/jquery-3.3.1.slim.min.js', - 'tests/vendor/bootstrap-4.3.1.bundle.min.js' + 'tests/vendor/bootstrap-5.1.3.bundle.min.js' ], src: ['bootbox.js', 'bootbox.locales.js'] }); diff --git a/karma.conf.legacy.js b/karma.conf.legacy.js new file mode 100644 index 00000000..19cd5837 --- /dev/null +++ b/karma.conf.legacy.js @@ -0,0 +1,9 @@ +var baseConfig = require('./karma-base.conf'); + +module.exports = baseConfig({ + vendor: [ + 'tests/vendor/jquery-3.3.1.slim.min.js', + 'tests/vendor/bootstrap-4.6.1.bundle.min.js' + ], + src: ['bootbox.js', 'bootbox.locales.js'] +}); diff --git a/package-lock.json b/package-lock.json index 578ee19f..6b91fec1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { "name": "bootbox", - "version": "5.5.2", + "version": "6.0.0-wip", "lockfileVersion": 2, "requires": true, "packages": { "": { - "version": "5.5.2", + "version": "6.0.0-wip", "license": "MIT", "devDependencies": { "chai": "^4.2.0", @@ -36,9 +36,9 @@ "webpack": "^4.41.2" }, "peerDependencies": { - "bootstrap": "^3.1.0 || ^4.4.0", - "jquery": "^3.5.1", - "popper.js": "^1.16.0" + "@popperjs/core": "^2.0.0", + "bootstrap": "^4.4.0 || ^5.0.0", + "jquery": "^3.5.1" } }, "node_modules/@babel/code-frame": { @@ -389,6 +389,16 @@ "node": ">=8" } }, + "node_modules/@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, "node_modules/@sinonjs/commons": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", @@ -10101,6 +10111,12 @@ "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, + "@popperjs/core": { + "version": "2.11.5", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.5.tgz", + "integrity": "sha512-9X2obfABZuDVLCgPK9aX0a/x4jaOEweTTWE2+9sr0Qqqevj2Uv5XorvusThmc9XGYpS9yI+fhh8RTafBtGposw==", + "peer": true + }, "@sinonjs/commons": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.6.0.tgz", diff --git a/package.json b/package.json index f396d302..922ad02b 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "name": "bootbox", - "version": "5.5.2", + "version": "6.0.0-wip", "description": "Wrappers for JavaScript alert(), confirm(), prompt(), and other flexible dialogs using the Bootstrap framework", "directories": { "test": "tests" }, "scripts": { - "test": "./node_modules/.bin/karma start" + "test": "karma start karma.conf.legacy.js && karma start karma.conf.js" }, "repository": { "type": "git", @@ -51,8 +51,8 @@ "webpack": "^4.41.2" }, "peerDependencies": { - "bootstrap": "^3.1.0 || ^4.4.0", - "jquery": "^3.5.1", - "popper.js": "^1.16.0" + "@popperjs/core": "^2.0.0", + "bootstrap": "^4.4.0 || ^5.0.0", + "jquery": "^3.5.1" } } diff --git a/tests/vendor/bootstrap-4.0.0.bundle.min.js b/tests/vendor/bootstrap-4.0.0.bundle.min.js deleted file mode 100644 index 7d50e873..00000000 --- a/tests/vendor/bootstrap-4.0.0.bundle.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.0.0 (https://getbootstrap.com) - * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e(t.bootstrap={},t.jQuery)}(this,function(t,e){"use strict";function n(t,e){for(var n=0;n0?i:null}catch(t){return null}},reflow:function(t){return t.offsetHeight},triggerTransitionEnd:function(n){t(n).trigger(e.end)},supportsTransitionEnd:function(){return Boolean(e)},isElement:function(t){return(t[0]||t).nodeType},typeCheckConfig:function(t,e,n){for(var r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var o=n[r],s=e[r],a=s&&i.isElement(s)?"element":(l=s,{}.toString.call(l).match(/\s([a-zA-Z]+)/)[1].toLowerCase());if(!new RegExp(o).test(a))throw new Error(t.toUpperCase()+': Option "'+r+'" provided type "'+a+'" but expected type "'+o+'".')}var l}};return e=("undefined"==typeof window||!window.QUnit)&&{end:"transitionend"},t.fn.emulateTransitionEnd=n,i.supportsTransitionEnd()&&(t.event.special[i.TRANSITION_END]={bindType:e.end,delegateType:e.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}}),i}(e=e&&e.hasOwnProperty("default")?e.default:e),L=(s="alert",l="."+(a="bs.alert"),c=(o=e).fn[s],h={CLOSE:"close"+l,CLOSED:"closed"+l,CLICK_DATA_API:"click"+l+".data-api"},f="alert",u="fade",d="show",p=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){t=t||this._element;var e=this._getRootElement(t);this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){o.removeData(this._element,a),this._element=null},e._getRootElement=function(t){var e=k.getSelectorFromElement(t),n=!1;return e&&(n=o(e)[0]),n||(n=o(t).closest("."+f)[0]),n},e._triggerCloseEvent=function(t){var e=o.Event(h.CLOSE);return o(t).trigger(e),e},e._removeElement=function(t){var e=this;o(t).removeClass(d),k.supportsTransitionEnd()&&o(t).hasClass(u)?o(t).one(k.TRANSITION_END,function(n){return e._destroyElement(t,n)}).emulateTransitionEnd(150):this._destroyElement(t)},e._destroyElement=function(t){o(t).detach().trigger(h.CLOSED).remove()},t._jQueryInterface=function(e){return this.each(function(){var n=o(this),i=n.data(a);i||(i=new t(this),n.data(a,i)),"close"===e&&i[e](this)})},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},i(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),o(document).on(h.CLICK_DATA_API,'[data-dismiss="alert"]',p._handleDismiss(new p)),o.fn[s]=p._jQueryInterface,o.fn[s].Constructor=p,o.fn[s].noConflict=function(){return o.fn[s]=c,p._jQueryInterface},p),P=(m="button",v="."+(_="bs.button"),E=".data-api",y=(g=e).fn[m],b="active",T="btn",C="focus",w='[data-toggle^="button"]',I='[data-toggle="buttons"]',A="input",D=".active",S=".btn",O={CLICK_DATA_API:"click"+v+E,FOCUS_BLUR_DATA_API:"focus"+v+E+" blur"+v+E},N=function(){function t(t){this._element=t}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=g(this._element).closest(I)[0];if(n){var i=g(this._element).find(A)[0];if(i){if("radio"===i.type)if(i.checked&&g(this._element).hasClass(b))t=!1;else{var r=g(n).find(D)[0];r&&g(r).removeClass(b)}if(t){if(i.hasAttribute("disabled")||n.hasAttribute("disabled")||i.classList.contains("disabled")||n.classList.contains("disabled"))return;i.checked=!g(this._element).hasClass(b),g(i).trigger("change")}i.focus(),e=!1}}e&&this._element.setAttribute("aria-pressed",!g(this._element).hasClass(b)),t&&g(this._element).toggleClass(b)},e.dispose=function(){g.removeData(this._element,_),this._element=null},t._jQueryInterface=function(e){return this.each(function(){var n=g(this).data(_);n||(n=new t(this),g(this).data(_,n)),"toggle"===e&&n[e]()})},i(t,null,[{key:"VERSION",get:function(){return"4.0.0"}}]),t}(),g(document).on(O.CLICK_DATA_API,w,function(t){t.preventDefault();var e=t.target;g(e).hasClass(T)||(e=g(e).closest(S)),N._jQueryInterface.call(g(e),"toggle")}).on(O.FOCUS_BLUR_DATA_API,w,function(t){var e=g(t.target).closest(S)[0];g(e).toggleClass(C,/^focus(in)?$/.test(t.type))}),g.fn[m]=N._jQueryInterface,g.fn[m].Constructor=N,g.fn[m].noConflict=function(){return g.fn[m]=y,N._jQueryInterface},N),x=function(t){var e="carousel",n="bs.carousel",o="."+n,s=t.fn[e],a={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0},l={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean"},c="next",h="prev",f="left",u="right",d={SLIDE:"slide"+o,SLID:"slid"+o,KEYDOWN:"keydown"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o,TOUCHEND:"touchend"+o,LOAD_DATA_API:"load"+o+".data-api",CLICK_DATA_API:"click"+o+".data-api"},p="carousel",g="active",m="slide",_="carousel-item-right",v="carousel-item-left",E="carousel-item-next",y="carousel-item-prev",b={ACTIVE:".active",ACTIVE_ITEM:".active.carousel-item",ITEM:".carousel-item",NEXT_PREV:".carousel-item-next, .carousel-item-prev",INDICATORS:".carousel-indicators",DATA_SLIDE:"[data-slide], [data-slide-to]",DATA_RIDE:'[data-ride="carousel"]'},T=function(){function s(e,n){this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this._config=this._getConfig(n),this._element=t(e)[0],this._indicatorsElement=t(this._element).find(b.INDICATORS)[0],this._addEventListeners()}var T=s.prototype;return T.next=function(){this._isSliding||this._slide(c)},T.nextWhenVisible=function(){!document.hidden&&t(this._element).is(":visible")&&"hidden"!==t(this._element).css("visibility")&&this.next()},T.prev=function(){this._isSliding||this._slide(h)},T.pause=function(e){e||(this._isPaused=!0),t(this._element).find(b.NEXT_PREV)[0]&&k.supportsTransitionEnd()&&(k.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},T.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},T.to=function(e){var n=this;this._activeElement=t(this._element).find(b.ACTIVE_ITEM)[0];var i=this._getItemIndex(this._activeElement);if(!(e>this._items.length-1||e<0))if(this._isSliding)t(this._element).one(d.SLID,function(){return n.to(e)});else{if(i===e)return this.pause(),void this.cycle();var r=e>i?c:h;this._slide(r,this._items[e])}},T.dispose=function(){t(this._element).off(o),t.removeData(this._element,n),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},T._getConfig=function(t){return t=r({},a,t),k.typeCheckConfig(e,t,l),t},T._addEventListeners=function(){var e=this;this._config.keyboard&&t(this._element).on(d.KEYDOWN,function(t){return e._keydown(t)}),"hover"===this._config.pause&&(t(this._element).on(d.MOUSEENTER,function(t){return e.pause(t)}).on(d.MOUSELEAVE,function(t){return e.cycle(t)}),"ontouchstart"in document.documentElement&&t(this._element).on(d.TOUCHEND,function(){e.pause(),e.touchTimeout&&clearTimeout(e.touchTimeout),e.touchTimeout=setTimeout(function(t){return e.cycle(t)},500+e._config.interval)}))},T._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},T._getItemIndex=function(e){return this._items=t.makeArray(t(e).parent().find(b.ITEM)),this._items.indexOf(e)},T._getItemByDirection=function(t,e){var n=t===c,i=t===h,r=this._getItemIndex(e),o=this._items.length-1;if((i&&0===r||n&&r===o)&&!this._config.wrap)return e;var s=(r+(t===h?-1:1))%this._items.length;return-1===s?this._items[this._items.length-1]:this._items[s]},T._triggerSlideEvent=function(e,n){var i=this._getItemIndex(e),r=this._getItemIndex(t(this._element).find(b.ACTIVE_ITEM)[0]),o=t.Event(d.SLIDE,{relatedTarget:e,direction:n,from:r,to:i});return t(this._element).trigger(o),o},T._setActiveIndicatorElement=function(e){if(this._indicatorsElement){t(this._indicatorsElement).find(b.ACTIVE).removeClass(g);var n=this._indicatorsElement.children[this._getItemIndex(e)];n&&t(n).addClass(g)}},T._slide=function(e,n){var i,r,o,s=this,a=t(this._element).find(b.ACTIVE_ITEM)[0],l=this._getItemIndex(a),h=n||a&&this._getItemByDirection(e,a),p=this._getItemIndex(h),T=Boolean(this._interval);if(e===c?(i=v,r=E,o=f):(i=_,r=y,o=u),h&&t(h).hasClass(g))this._isSliding=!1;else if(!this._triggerSlideEvent(h,o).isDefaultPrevented()&&a&&h){this._isSliding=!0,T&&this.pause(),this._setActiveIndicatorElement(h);var C=t.Event(d.SLID,{relatedTarget:h,direction:o,from:l,to:p});k.supportsTransitionEnd()&&t(this._element).hasClass(m)?(t(h).addClass(r),k.reflow(h),t(a).addClass(i),t(h).addClass(i),t(a).one(k.TRANSITION_END,function(){t(h).removeClass(i+" "+r).addClass(g),t(a).removeClass(g+" "+r+" "+i),s._isSliding=!1,setTimeout(function(){return t(s._element).trigger(C)},0)}).emulateTransitionEnd(600)):(t(a).removeClass(g),t(h).addClass(g),this._isSliding=!1,t(this._element).trigger(C)),T&&this.cycle()}},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),o=r({},a,t(this).data());"object"==typeof e&&(o=r({},o,e));var l="string"==typeof e?e:o.slide;if(i||(i=new s(this,o),t(this).data(n,i)),"number"==typeof e)i.to(e);else if("string"==typeof l){if("undefined"==typeof i[l])throw new TypeError('No method named "'+l+'"');i[l]()}else o.interval&&(i.pause(),i.cycle())})},s._dataApiClickHandler=function(e){var i=k.getSelectorFromElement(this);if(i){var o=t(i)[0];if(o&&t(o).hasClass(p)){var a=r({},t(o).data(),t(this).data()),l=this.getAttribute("data-slide-to");l&&(a.interval=!1),s._jQueryInterface.call(t(o),a),l&&t(o).data(n).to(l),e.preventDefault()}}},i(s,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),s}();return t(document).on(d.CLICK_DATA_API,b.DATA_SLIDE,T._dataApiClickHandler),t(window).on(d.LOAD_DATA_API,function(){t(b.DATA_RIDE).each(function(){var e=t(this);T._jQueryInterface.call(e,e.data())})}),t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=s,T._jQueryInterface},T}(e),R=function(t){var e="collapse",n="bs.collapse",o="."+n,s=t.fn[e],a={toggle:!0,parent:""},l={toggle:"boolean",parent:"(string|element)"},c={SHOW:"show"+o,SHOWN:"shown"+o,HIDE:"hide"+o,HIDDEN:"hidden"+o,CLICK_DATA_API:"click"+o+".data-api"},h="show",f="collapse",u="collapsing",d="collapsed",p="width",g="height",m={ACTIVES:".show, .collapsing",DATA_TOGGLE:'[data-toggle="collapse"]'},_=function(){function o(e,n){this._isTransitioning=!1,this._element=e,this._config=this._getConfig(n),this._triggerArray=t.makeArray(t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'));for(var i=t(m.DATA_TOGGLE),r=0;r0&&(this._selector=s,this._triggerArray.push(o))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var s=o.prototype;return s.toggle=function(){t(this._element).hasClass(h)?this.hide():this.show()},s.show=function(){var e,i,r=this;if(!this._isTransitioning&&!t(this._element).hasClass(h)&&(this._parent&&0===(e=t.makeArray(t(this._parent).find(m.ACTIVES).filter('[data-parent="'+this._config.parent+'"]'))).length&&(e=null),!(e&&(i=t(e).not(this._selector).data(n))&&i._isTransitioning))){var s=t.Event(c.SHOW);if(t(this._element).trigger(s),!s.isDefaultPrevented()){e&&(o._jQueryInterface.call(t(e).not(this._selector),"hide"),i||t(e).data(n,null));var a=this._getDimension();t(this._element).removeClass(f).addClass(u),this._element.style[a]=0,this._triggerArray.length>0&&t(this._triggerArray).removeClass(d).attr("aria-expanded",!0),this.setTransitioning(!0);var l=function(){t(r._element).removeClass(u).addClass(f).addClass(h),r._element.style[a]="",r.setTransitioning(!1),t(r._element).trigger(c.SHOWN)};if(k.supportsTransitionEnd()){var p="scroll"+(a[0].toUpperCase()+a.slice(1));t(this._element).one(k.TRANSITION_END,l).emulateTransitionEnd(600),this._element.style[a]=this._element[p]+"px"}else l()}}},s.hide=function(){var e=this;if(!this._isTransitioning&&t(this._element).hasClass(h)){var n=t.Event(c.HIDE);if(t(this._element).trigger(n),!n.isDefaultPrevented()){var i=this._getDimension();if(this._element.style[i]=this._element.getBoundingClientRect()[i]+"px",k.reflow(this._element),t(this._element).addClass(u).removeClass(f).removeClass(h),this._triggerArray.length>0)for(var r=0;r0&&t(n).toggleClass(d,!i).attr("aria-expanded",i)}},o._getTargetFromElement=function(e){var n=k.getSelectorFromElement(e);return n?t(n)[0]:null},o._jQueryInterface=function(e){return this.each(function(){var i=t(this),s=i.data(n),l=r({},a,i.data(),"object"==typeof e&&e);if(!s&&l.toggle&&/show|hide/.test(e)&&(l.toggle=!1),s||(s=new o(this,l),i.data(n,s)),"string"==typeof e){if("undefined"==typeof s[e])throw new TypeError('No method named "'+e+'"');s[e]()}})},i(o,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return a}}]),o}();return t(document).on(c.CLICK_DATA_API,m.DATA_TOGGLE,function(e){"A"===e.currentTarget.tagName&&e.preventDefault();var i=t(this),r=k.getSelectorFromElement(this);t(r).each(function(){var e=t(this),r=e.data(n)?"toggle":i.data();_._jQueryInterface.call(e,r)})}),t.fn[e]=_._jQueryInterface,t.fn[e].Constructor=_,t.fn[e].noConflict=function(){return t.fn[e]=s,_._jQueryInterface},_}(e),j="undefined"!=typeof window&&"undefined"!=typeof document,H=["Edge","Trident","Firefox"],M=0,W=0;W=0){M=1;break}var U=j&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then(function(){e=!1,t()}))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout(function(){e=!1,t()},M))}};function B(t){return t&&"[object Function]"==={}.toString.call(t)}function F(t,e){if(1!==t.nodeType)return[];var n=getComputedStyle(t,null);return e?n[e]:n}function K(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function V(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=F(t),n=e.overflow,i=e.overflowX,r=e.overflowY;return/(auto|scroll)/.test(n+r+i)?t:V(K(t))}function Q(t){var e=t&&t.offsetParent,n=e&&e.nodeName;return n&&"BODY"!==n&&"HTML"!==n?-1!==["TD","TABLE"].indexOf(e.nodeName)&&"static"===F(e,"position")?Q(e):e:t?t.ownerDocument.documentElement:document.documentElement}function Y(t){return null!==t.parentNode?Y(t.parentNode):t}function G(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,r=n?e:t,o=document.createRange();o.setStart(i,0),o.setEnd(r,0);var s,a,l=o.commonAncestorContainer;if(t!==l&&e!==l||i.contains(r))return"BODY"===(a=(s=l).nodeName)||"HTML"!==a&&Q(s.firstElementChild)!==s?Q(l):l;var c=Y(t);return c.host?G(c.host,e):G(t,Y(e).host)}function q(t){var e="top"===(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top")?"scrollTop":"scrollLeft",n=t.nodeName;if("BODY"===n||"HTML"===n){var i=t.ownerDocument.documentElement;return(t.ownerDocument.scrollingElement||i)[e]}return t[e]}function z(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"],10)+parseFloat(t["border"+i+"Width"],10)}var X=void 0,Z=function(){return void 0===X&&(X=-1!==navigator.appVersion.indexOf("MSIE 10")),X};function J(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],Z()?n["offset"+t]+i["margin"+("Height"===t?"Top":"Left")]+i["margin"+("Height"===t?"Bottom":"Right")]:0)}function $(){var t=document.body,e=document.documentElement,n=Z()&&getComputedStyle(e);return{height:J("Height",t,e,n),width:J("Width",t,e,n)}}var tt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},et=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=q(e,"top"),r=q(e,"left"),o=n?-1:1;return t.top+=i*o,t.bottom+=i*o,t.left+=r*o,t.right+=r*o,t}(h,e)),h}function at(t,e,n,i){var r,o,s,a,l,c,h,f={top:0,left:0},u=G(t,e);if("viewport"===i)o=(r=u).ownerDocument.documentElement,s=st(r,o),a=Math.max(o.clientWidth,window.innerWidth||0),l=Math.max(o.clientHeight,window.innerHeight||0),c=q(o),h=q(o,"left"),f=rt({top:c-s.top+s.marginTop,left:h-s.left+s.marginLeft,width:a,height:l});else{var d=void 0;"scrollParent"===i?"BODY"===(d=V(K(e))).nodeName&&(d=t.ownerDocument.documentElement):d="window"===i?t.ownerDocument.documentElement:i;var p=st(d,u);if("HTML"!==d.nodeName||function t(e){var n=e.nodeName;return"BODY"!==n&&"HTML"!==n&&("fixed"===F(e,"position")||t(K(e)))}(u))f=p;else{var g=$(),m=g.height,_=g.width;f.top+=p.top-p.marginTop,f.bottom=m+p.top,f.left+=p.left-p.marginLeft,f.right=_+p.left}}return f.left+=n,f.top+=n,f.right-=n,f.bottom-=n,f}function lt(t,e,n,i,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var s=at(n,i,o,r),a={top:{width:s.width,height:e.top-s.top},right:{width:s.right-e.right,height:s.height},bottom:{width:s.width,height:s.bottom-e.bottom},left:{width:e.left-s.left,height:s.height}},l=Object.keys(a).map(function(t){return it({key:t},a[t],{area:(e=a[t],e.width*e.height)});var e}).sort(function(t,e){return e.area-t.area}),c=l.filter(function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight}),h=c.length>0?c[0].key:l[0].key,f=t.split("-")[1];return h+(f?"-"+f:"")}function ct(t,e,n){return st(n,G(e,n))}function ht(t){var e=getComputedStyle(t),n=parseFloat(e.marginTop)+parseFloat(e.marginBottom),i=parseFloat(e.marginLeft)+parseFloat(e.marginRight);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function ft(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,function(t){return e[t]})}function ut(t,e,n){n=n.split("-")[0];var i=ht(t),r={width:i.width,height:i.height},o=-1!==["right","left"].indexOf(n),s=o?"top":"left",a=o?"left":"top",l=o?"height":"width",c=o?"width":"height";return r[s]=e[s]+e[l]/2-i[l]/2,r[a]=n===a?e[a]-i[c]:e[ft(a)],r}function dt(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function pt(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex(function(t){return t[e]===n});var i=dt(t,function(t){return t[e]===n});return t.indexOf(i)}(t,"name",n))).forEach(function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&B(n)&&(e.offsets.popper=rt(e.offsets.popper),e.offsets.reference=rt(e.offsets.reference),e=n(e,t))}),e}function gt(t,e){return t.some(function(t){var n=t.name;return t.enabled&&n===e})}function mt(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=wt.indexOf(t),i=wt.slice(n+1).concat(wt.slice(0,n));return e?i.reverse():i}var At={FLIP:"flip",CLOCKWISE:"clockwise",COUNTERCLOCKWISE:"counterclockwise"};function Dt(t,e,n,i){var r=[0,0],o=-1!==["right","left"].indexOf(i),s=t.split(/(\+|\-)/).map(function(t){return t.trim()}),a=s.indexOf(dt(s,function(t){return-1!==t.search(/,|\s/)}));s[a]&&-1===s[a].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,c=-1!==a?[s.slice(0,a).concat([s[a].split(l)[0]]),[s[a].split(l)[1]].concat(s.slice(a+1))]:[s];return(c=c.map(function(t,i){var r=(1===i?!o:o)?"height":"width",s=!1;return t.reduce(function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,s=!0,t):s?(t[t.length-1]+=e,s=!1,t):t.concat(e)},[]).map(function(t){return function(t,e,n,i){var r=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),o=+r[1],s=r[2];if(!o)return t;if(0===s.indexOf("%")){var a=void 0;switch(s){case"%p":a=n;break;case"%":case"%r":default:a=i}return rt(a)[e]/100*o}if("vh"===s||"vw"===s)return("vh"===s?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*o;return o}(t,r,e,n)})})).forEach(function(t,e){t.forEach(function(n,i){yt(n)&&(r[e]+=n*("-"===t[i-1]?-1:1))})}),r}var St={placement:"bottom",eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var r=t.offsets,o=r.reference,s=r.popper,a=-1!==["bottom","top"].indexOf(n),l=a?"left":"top",c=a?"width":"height",h={start:nt({},l,o[l]),end:nt({},l,o[l]+o[c]-s[c])};t.offsets.popper=it({},s,h[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n=e.offset,i=t.placement,r=t.offsets,o=r.popper,s=r.reference,a=i.split("-")[0],l=void 0;return l=yt(+n)?[+n,0]:Dt(n,o,s,a),"left"===a?(o.top+=l[0],o.left-=l[1]):"right"===a?(o.top+=l[0],o.left+=l[1]):"top"===a?(o.left+=l[0],o.top-=l[1]):"bottom"===a&&(o.left+=l[0],o.top+=l[1]),t.popper=o,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||Q(t.instance.popper);t.instance.reference===n&&(n=Q(n));var i=at(t.instance.popper,t.instance.reference,e.padding,n);e.boundaries=i;var r=e.priority,o=t.offsets.popper,s={primary:function(t){var n=o[t];return o[t]i[t]&&!e.escapeWithReference&&(r=Math.min(o[n],i[t]-("right"===t?o.width:o.height))),nt({},n,r)}};return r.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";o=it({},o,s[e](t))}),t.offsets.popper=o,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,r=t.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]o(i[a])&&(t.offsets.popper[l]=o(i[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!Tt(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],o=t.offsets,s=o.popper,a=o.reference,l=-1!==["left","right"].indexOf(r),c=l?"height":"width",h=l?"Top":"Left",f=h.toLowerCase(),u=l?"left":"top",d=l?"bottom":"right",p=ht(i)[c];a[d]-ps[d]&&(t.offsets.popper[f]+=a[f]+p-s[d]),t.offsets.popper=rt(t.offsets.popper);var g=a[f]+a[c]/2-p/2,m=F(t.instance.popper),_=parseFloat(m["margin"+h],10),v=parseFloat(m["border"+h+"Width"],10),E=g-t.offsets.popper[f]-_-v;return E=Math.max(Math.min(s[c]-p,E),0),t.arrowElement=i,t.offsets.arrow=(nt(n={},f,Math.round(E)),nt(n,u,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(gt(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=at(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement),i=t.placement.split("-")[0],r=ft(i),o=t.placement.split("-")[1]||"",s=[];switch(e.behavior){case At.FLIP:s=[i,r];break;case At.CLOCKWISE:s=It(i);break;case At.COUNTERCLOCKWISE:s=It(i,!0);break;default:s=e.behavior}return s.forEach(function(a,l){if(i!==a||s.length===l+1)return t;i=t.placement.split("-")[0],r=ft(i);var c,h=t.offsets.popper,f=t.offsets.reference,u=Math.floor,d="left"===i&&u(h.right)>u(f.left)||"right"===i&&u(h.left)u(f.top)||"bottom"===i&&u(h.top)u(n.right),m=u(h.top)u(n.bottom),v="left"===i&&p||"right"===i&&g||"top"===i&&m||"bottom"===i&&_,E=-1!==["top","bottom"].indexOf(i),y=!!e.flipVariations&&(E&&"start"===o&&p||E&&"end"===o&&g||!E&&"start"===o&&m||!E&&"end"===o&&_);(d||v||y)&&(t.flipped=!0,(d||v)&&(i=s[l+1]),y&&(o="end"===(c=o)?"start":"start"===c?"end":c),t.placement=i+(o?"-"+o:""),t.offsets.popper=it({},t.offsets.popper,ut(t.instance.popper,t.offsets.reference,t.placement)),t=pt(t.instance.modifiers,t,"flip"))}),t},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,r=i.popper,o=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[s?"left":"top"]=o[n]-(a?r[s?"width":"height"]:0),t.placement=ft(e),t.offsets.popper=rt(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!Tt(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=dt(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};tt(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=U(this.update.bind(this)),this.options=it({},t.Defaults,r),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(it({},t.Defaults.modifiers,r.modifiers)).forEach(function(e){i.options.modifiers[e]=it({},t.Defaults.modifiers[e]||{},r.modifiers?r.modifiers[e]:{})}),this.modifiers=Object.keys(this.options.modifiers).map(function(t){return it({name:t},i.options.modifiers[t])}).sort(function(t,e){return t.order-e.order}),this.modifiers.forEach(function(t){t.enabled&&B(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)}),this.update();var o=this.options.eventsEnabled;o&&this.enableEventListeners(),this.state.eventsEnabled=o}return et(t,[{key:"update",value:function(){return function(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=ct(this.state,this.popper,this.reference),t.placement=lt(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.offsets.popper=ut(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position="absolute",t=pt(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}.call(this)}},{key:"destroy",value:function(){return function(){return this.state.isDestroyed=!0,gt(this.modifiers,"applyStyle")&&(this.popper.removeAttribute("x-placement"),this.popper.style.left="",this.popper.style.position="",this.popper.style.top="",this.popper.style[mt("transform")]=""),this.disableEventListeners(),this.options.removeOnDestroy&&this.popper.parentNode.removeChild(this.popper),this}.call(this)}},{key:"enableEventListeners",value:function(){return function(){this.state.eventsEnabled||(this.state=vt(this.reference,this.options,this.state,this.scheduleUpdate))}.call(this)}},{key:"disableEventListeners",value:function(){return Et.call(this)}}]),t}();Ot.Utils=("undefined"!=typeof window?window:global).PopperUtils,Ot.placements=Ct,Ot.Defaults=St;var Nt=function(t){var e="dropdown",n="bs.dropdown",o="."+n,s=t.fn[e],a=new RegExp("38|40|27"),l={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,CLICK:"click"+o,CLICK_DATA_API:"click"+o+".data-api",KEYDOWN_DATA_API:"keydown"+o+".data-api",KEYUP_DATA_API:"keyup"+o+".data-api"},c="disabled",h="show",f="dropup",u="dropright",d="dropleft",p="dropdown-menu-right",g="dropdown-menu-left",m="position-static",_='[data-toggle="dropdown"]',v=".dropdown form",E=".dropdown-menu",y=".navbar-nav",b=".dropdown-menu .dropdown-item:not(.disabled)",T="top-start",C="top-end",w="bottom-start",I="bottom-end",A="right-start",D="left-start",S={offset:0,flip:!0,boundary:"scrollParent"},O={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)"},N=function(){function s(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var v=s.prototype;return v.toggle=function(){if(!this._element.disabled&&!t(this._element).hasClass(c)){var e=s._getParentFromElement(this._element),n=t(this._menu).hasClass(h);if(s._clearMenus(),!n){var i={relatedTarget:this._element},r=t.Event(l.SHOW,i);if(t(e).trigger(r),!r.isDefaultPrevented()){if(!this._inNavbar){if("undefined"==typeof Ot)throw new TypeError("Bootstrap dropdown require Popper.js (https://popper.js.org)");var o=this._element;t(e).hasClass(f)&&(t(this._menu).hasClass(g)||t(this._menu).hasClass(p))&&(o=e),"scrollParent"!==this._config.boundary&&t(e).addClass(m),this._popper=new Ot(o,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===t(e).closest(y).length&&t("body").children().on("mouseover",null,t.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),t(this._menu).toggleClass(h),t(e).toggleClass(h).trigger(t.Event(l.SHOWN,i))}}}},v.dispose=function(){t.removeData(this._element,n),t(this._element).off(o),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},v.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},v._addEventListeners=function(){var e=this;t(this._element).on(l.CLICK,function(t){t.preventDefault(),t.stopPropagation(),e.toggle()})},v._getConfig=function(n){return n=r({},this.constructor.Default,t(this._element).data(),n),k.typeCheckConfig(e,n,this.constructor.DefaultType),n},v._getMenuElement=function(){if(!this._menu){var e=s._getParentFromElement(this._element);this._menu=t(e).find(E)[0]}return this._menu},v._getPlacement=function(){var e=t(this._element).parent(),n=w;return e.hasClass(f)?(n=T,t(this._menu).hasClass(p)&&(n=C)):e.hasClass(u)?n=A:e.hasClass(d)?n=D:t(this._menu).hasClass(p)&&(n=I),n},v._detectNavbar=function(){return t(this._element).closest(".navbar").length>0},v._getPopperConfig=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=r({},e.offsets,t._config.offset(e.offsets)||{}),e}:e.offset=this._config.offset,{placement:this._getPlacement(),modifiers:{offset:e,flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}}},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n);if(i||(i=new s(this,"object"==typeof e?e:null),t(this).data(n,i)),"string"==typeof e){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},s._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var i=t.makeArray(t(_)),r=0;r0&&o--,40===e.which&&odocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},g._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},g._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},f="show",u="out",d={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},p="fade",g="show",m=".tooltip-inner",_=".arrow",v="hover",E="focus",y="click",b="manual",T=function(){function s(t,e){if("undefined"==typeof Ot)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var T=s.prototype;return T.enable=function(){this._isEnabled=!0},T.disable=function(){this._isEnabled=!1},T.toggleEnabled=function(){this._isEnabled=!this._isEnabled},T.toggle=function(e){if(this._isEnabled)if(e){var n=this.constructor.DATA_KEY,i=t(e.currentTarget).data(n);i||(i=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(n,i)),i._activeTrigger.click=!i._activeTrigger.click,i._isWithActiveTrigger()?i._enter(null,i):i._leave(null,i)}else{if(t(this.getTipElement()).hasClass(g))return void this._leave(null,this);this._enter(null,this)}},T.dispose=function(){clearTimeout(this._timeout),t.removeData(this.element,this.constructor.DATA_KEY),t(this.element).off(this.constructor.EVENT_KEY),t(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&t(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,null!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},T.show=function(){var e=this;if("none"===t(this.element).css("display"))throw new Error("Please use show on visible elements");var n=t.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){t(this.element).trigger(n);var i=t.contains(this.element.ownerDocument.documentElement,this.element);if(n.isDefaultPrevented()||!i)return;var r=this.getTipElement(),o=k.getUID(this.constructor.NAME);r.setAttribute("id",o),this.element.setAttribute("aria-describedby",o),this.setContent(),this.config.animation&&t(r).addClass(p);var a="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,l=this._getAttachment(a);this.addAttachmentClass(l);var c=!1===this.config.container?document.body:t(this.config.container);t(r).data(this.constructor.DATA_KEY,this),t.contains(this.element.ownerDocument.documentElement,this.tip)||t(r).appendTo(c),t(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Ot(this.element,r,{placement:l,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:_},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),t(r).addClass(g),"ontouchstart"in document.documentElement&&t("body").children().on("mouseover",null,t.noop);var h=function(){e.config.animation&&e._fixTransition();var n=e._hoverState;e._hoverState=null,t(e.element).trigger(e.constructor.Event.SHOWN),n===u&&e._leave(null,e)};k.supportsTransitionEnd()&&t(this.tip).hasClass(p)?t(this.tip).one(k.TRANSITION_END,h).emulateTransitionEnd(s._TRANSITION_DURATION):h()}},T.hide=function(e){var n=this,i=this.getTipElement(),r=t.Event(this.constructor.Event.HIDE),o=function(){n._hoverState!==f&&i.parentNode&&i.parentNode.removeChild(i),n._cleanTipClass(),n.element.removeAttribute("aria-describedby"),t(n.element).trigger(n.constructor.Event.HIDDEN),null!==n._popper&&n._popper.destroy(),e&&e()};t(this.element).trigger(r),r.isDefaultPrevented()||(t(i).removeClass(g),"ontouchstart"in document.documentElement&&t("body").children().off("mouseover",null,t.noop),this._activeTrigger[y]=!1,this._activeTrigger[E]=!1,this._activeTrigger[v]=!1,k.supportsTransitionEnd()&&t(this.tip).hasClass(p)?t(i).one(k.TRANSITION_END,o).emulateTransitionEnd(150):o(),this._hoverState="")},T.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},T.isWithContent=function(){return Boolean(this.getTitle())},T.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-tooltip-"+e)},T.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},T.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(m),this.getTitle()),e.removeClass(p+" "+g)},T.setElementContent=function(e,n){var i=this.config.html;"object"==typeof n&&(n.nodeType||n.jquery)?i?t(n).parent().is(e)||e.empty().append(n):e.text(t(n).text()):e[i?"html":"text"](n)},T.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},T._getAttachment=function(t){return c[t.toUpperCase()]},T._setListeners=function(){var e=this;this.config.trigger.split(" ").forEach(function(n){if("click"===n)t(e.element).on(e.constructor.Event.CLICK,e.config.selector,function(t){return e.toggle(t)});else if(n!==b){var i=n===v?e.constructor.Event.MOUSEENTER:e.constructor.Event.FOCUSIN,r=n===v?e.constructor.Event.MOUSELEAVE:e.constructor.Event.FOCUSOUT;t(e.element).on(i,e.config.selector,function(t){return e._enter(t)}).on(r,e.config.selector,function(t){return e._leave(t)})}t(e.element).closest(".modal").on("hide.bs.modal",function(){return e.hide()})}),this.config.selector?this.config=r({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},T._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},T._enter=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusin"===e.type?E:v]=!0),t(n.getTipElement()).hasClass(g)||n._hoverState===f?n._hoverState=f:(clearTimeout(n._timeout),n._hoverState=f,n.config.delay&&n.config.delay.show?n._timeout=setTimeout(function(){n._hoverState===f&&n.show()},n.config.delay.show):n.show())},T._leave=function(e,n){var i=this.constructor.DATA_KEY;(n=n||t(e.currentTarget).data(i))||(n=new this.constructor(e.currentTarget,this._getDelegateConfig()),t(e.currentTarget).data(i,n)),e&&(n._activeTrigger["focusout"===e.type?E:v]=!1),n._isWithActiveTrigger()||(clearTimeout(n._timeout),n._hoverState=u,n.config.delay&&n.config.delay.hide?n._timeout=setTimeout(function(){n._hoverState===u&&n.hide()},n.config.delay.hide):n.hide())},T._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},T._getConfig=function(n){return"number"==typeof(n=r({},this.constructor.Default,t(this.element).data(),n)).delay&&(n.delay={show:n.delay,hide:n.delay}),"number"==typeof n.title&&(n.title=n.title.toString()),"number"==typeof n.content&&(n.content=n.content.toString()),k.typeCheckConfig(e,n,this.constructor.DefaultType),n},T._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},T._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},T._handlePopperPlacementChange=function(t){this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},T._fixTransition=function(){var e=this.getTipElement(),n=this.config.animation;null===e.getAttribute("x-placement")&&(t(e).removeClass(p),this.config.animation=!1,this.hide(),this.show(),this.config.animation=n)},s._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),r="object"==typeof e&&e;if((i||!/dispose|hide/.test(e))&&(i||(i=new s(this,r),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},i(s,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return h}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return d}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return l}}]),s}();return t.fn[e]=T._jQueryInterface,t.fn[e].Constructor=T,t.fn[e].noConflict=function(){return t.fn[e]=s,T._jQueryInterface},T}(e),Pt=function(t){var e="popover",n="bs.popover",o="."+n,s=t.fn[e],a=new RegExp("(^|\\s)bs-popover\\S+","g"),l=r({},Lt.Default,{placement:"right",trigger:"click",content:"",template:''}),c=r({},Lt.DefaultType,{content:"(string|element|function)"}),h="fade",f="show",u=".popover-header",d=".popover-body",p={HIDE:"hide"+o,HIDDEN:"hidden"+o,SHOW:"show"+o,SHOWN:"shown"+o,INSERTED:"inserted"+o,CLICK:"click"+o,FOCUSIN:"focusin"+o,FOCUSOUT:"focusout"+o,MOUSEENTER:"mouseenter"+o,MOUSELEAVE:"mouseleave"+o},g=function(r){var s,g;function m(){return r.apply(this,arguments)||this}g=r,(s=m).prototype=Object.create(g.prototype),s.prototype.constructor=s,s.__proto__=g;var _=m.prototype;return _.isWithContent=function(){return this.getTitle()||this._getContent()},_.addAttachmentClass=function(e){t(this.getTipElement()).addClass("bs-popover-"+e)},_.getTipElement=function(){return this.tip=this.tip||t(this.config.template)[0],this.tip},_.setContent=function(){var e=t(this.getTipElement());this.setElementContent(e.find(u),this.getTitle());var n=this._getContent();"function"==typeof n&&(n=n.call(this.element)),this.setElementContent(e.find(d),n),e.removeClass(h+" "+f)},_._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},_._cleanTipClass=function(){var e=t(this.getTipElement()),n=e.attr("class").match(a);null!==n&&n.length>0&&e.removeClass(n.join(""))},m._jQueryInterface=function(e){return this.each(function(){var i=t(this).data(n),r="object"==typeof e?e:null;if((i||!/destroy|hide/.test(e))&&(i||(i=new m(this,r),t(this).data(n,i)),"string"==typeof e)){if("undefined"==typeof i[e])throw new TypeError('No method named "'+e+'"');i[e]()}})},i(m,null,[{key:"VERSION",get:function(){return"4.0.0"}},{key:"Default",get:function(){return l}},{key:"NAME",get:function(){return e}},{key:"DATA_KEY",get:function(){return n}},{key:"Event",get:function(){return p}},{key:"EVENT_KEY",get:function(){return o}},{key:"DefaultType",get:function(){return c}}]),m}(Lt);return t.fn[e]=g._jQueryInterface,t.fn[e].Constructor=g,t.fn[e].noConflict=function(){return t.fn[e]=s,g._jQueryInterface},g}(e),xt=function(t){var e="scrollspy",n="bs.scrollspy",o="."+n,s=t.fn[e],a={offset:10,method:"auto",target:""},l={offset:"number",method:"string",target:"(string|element)"},c={ACTIVATE:"activate"+o,SCROLL:"scroll"+o,LOAD_DATA_API:"load"+o+".data-api"},h="dropdown-item",f="active",u={DATA_SPY:'[data-spy="scroll"]',ACTIVE:".active",NAV_LIST_GROUP:".nav, .list-group",NAV_LINKS:".nav-link",NAV_ITEMS:".nav-item",LIST_ITEMS:".list-group-item",DROPDOWN:".dropdown",DROPDOWN_ITEMS:".dropdown-item",DROPDOWN_TOGGLE:".dropdown-toggle"},d="offset",p="position",g=function(){function s(e,n){var i=this;this._element=e,this._scrollElement="BODY"===e.tagName?window:e,this._config=this._getConfig(n),this._selector=this._config.target+" "+u.NAV_LINKS+","+this._config.target+" "+u.LIST_ITEMS+","+this._config.target+" "+u.DROPDOWN_ITEMS,this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,t(this._scrollElement).on(c.SCROLL,function(t){return i._process(t)}),this.refresh(),this._process()}var g=s.prototype;return g.refresh=function(){var e=this,n=this._scrollElement===this._scrollElement.window?d:p,i="auto"===this._config.method?n:this._config.method,r=i===p?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),t.makeArray(t(this._selector)).map(function(e){var n,o=k.getSelectorFromElement(e);if(o&&(n=t(o)[0]),n){var s=n.getBoundingClientRect();if(s.width||s.height)return[t(n)[i]().top+r,o]}return null}).filter(function(t){return t}).sort(function(t,e){return t[0]-e[0]}).forEach(function(t){e._offsets.push(t[0]),e._targets.push(t[1])})},g.dispose=function(){t.removeData(this._element,n),t(this._scrollElement).off(o),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},g._getConfig=function(n){if("string"!=typeof(n=r({},a,n)).target){var i=t(n.target).attr("id");i||(i=k.getUID(e),t(n.target).attr("id",i)),n.target="#"+i}return k.typeCheckConfig(e,n,l),n},g._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},g._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},g._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},g._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var r=this._offsets.length;r--;){this._activeTarget!==this._targets[r]&&t>=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||t=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}(e),t.Util=k,t.Alert=L,t.Button=P,t.Carousel=x,t.Collapse=R,t.Dropdown=Nt,t.Modal=kt,t.Popover=Pt,t.Scrollspy=xt,t.Tab=Rt,t.Tooltip=Lt,Object.defineProperty(t,"__esModule",{value:!0})}); -//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/tests/vendor/bootstrap-4.1.0.bundle.min.js b/tests/vendor/bootstrap-4.1.0.bundle.min.js deleted file mode 100644 index e0608e8b..00000000 --- a/tests/vendor/bootstrap-4.1.0.bundle.min.js +++ /dev/null @@ -1,7 +0,0 @@ -/*! - * Bootstrap v4.1.0 (https://getbootstrap.com/) - * Copyright 2011-2018 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jquery")):"function"==typeof define&&define.amd?define(["exports","jquery"],e):e(t.bootstrap={},t.jQuery)}(this,function(t,e){"use strict";function i(t,e){for(var n=0;nthis._items.length-1||t<0))if(this._isSliding)k(this._element).one(K.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n=i.clientWidth&&n>=i.clientHeight}),f=0r[t]&&!i.escapeWithReference&&(n=Math.min(o[e],r[t]-("right"===t?o.width:o.height))),Ft({},e,n)}};return n.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";o=Ut({},o,s[e](t))}),t.offsets.popper=o,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,r=t.placement.split("-")[0],o=Math.floor,s=-1!==["top","bottom"].indexOf(r),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]o(i[a])&&(t.offsets.popper[l]=o(i[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!ae(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var r=t.placement.split("-")[0],o=t.offsets,s=o.popper,a=o.reference,l=-1!==["left","right"].indexOf(r),c=l?"height":"width",f=l?"Top":"Left",h=f.toLowerCase(),u=l?"left":"top",d=l?"bottom":"right",p=zt(i)[c];a[d]-ps[d]&&(t.offsets.popper[h]+=a[h]+p-s[d]),t.offsets.popper=Bt(t.offsets.popper);var g=a[h]+a[c]/2-p/2,m=Dt(t.instance.popper),_=parseFloat(m["margin"+f],10),v=parseFloat(m["border"+f+"Width"],10),E=g-t.offsets.popper[h]-_-v;return E=Math.max(Math.min(s[c]-p,E),0),t.arrowElement=i,t.offsets.arrow=(Ft(n={},h,Math.round(E)),Ft(n,u,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(p,g){if(te(p.instance.modifiers,"inner"))return p;if(p.flipped&&p.placement===p.originalPlacement)return p;var m=Yt(p.instance.popper,p.instance.reference,g.padding,g.boundariesElement,p.positionFixed),_=p.placement.split("-")[0],v=Xt(_),E=p.placement.split("-")[1]||"",y=[];switch(g.behavior){case he.FLIP:y=[_,v];break;case he.CLOCKWISE:y=fe(_);break;case he.COUNTERCLOCKWISE:y=fe(_,!0);break;default:y=g.behavior}return y.forEach(function(t,e){if(_!==t||y.length===e+1)return p;_=p.placement.split("-")[0],v=Xt(_);var n,i=p.offsets.popper,r=p.offsets.reference,o=Math.floor,s="left"===_&&o(i.right)>o(r.left)||"right"===_&&o(i.left)o(r.top)||"bottom"===_&&o(i.top)o(m.right),c=o(i.top)o(m.bottom),h="left"===_&&a||"right"===_&&l||"top"===_&&c||"bottom"===_&&f,u=-1!==["top","bottom"].indexOf(_),d=!!g.flipVariations&&(u&&"start"===E&&a||u&&"end"===E&&l||!u&&"start"===E&&c||!u&&"end"===E&&f);(s||h||d)&&(p.flipped=!0,(s||h)&&(_=y[e+1]),d&&(E="end"===(n=E)?"start":"start"===n?"end":n),p.placement=_+(E?"-"+E:""),p.offsets.popper=Ut({},p.offsets.popper,Jt(p.instance.popper,p.offsets.reference,p.placement)),p=$t(p.instance.modifiers,p,"flip"))}),p},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,r=i.popper,o=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[s?"left":"top"]=o[n]-(a?r[s?"width":"height"]:0),t.placement=Xt(e),t.offsets.popper=Bt(r),t}},hide:{order:800,enabled:!0,fn:function(t){if(!ae(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=Zt(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.rightdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!(pn={AUTO:"auto",TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left"}),selector:!(dn={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)"}),placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent"},_n="out",vn={HIDE:"hide"+cn,HIDDEN:"hidden"+cn,SHOW:(mn="show")+cn,SHOWN:"shown"+cn,INSERTED:"inserted"+cn,CLICK:"click"+cn,FOCUSIN:"focusin"+cn,FOCUSOUT:"focusout"+cn,MOUSEENTER:"mouseenter"+cn,MOUSELEAVE:"mouseleave"+cn},En="fade",yn="show",bn=".tooltip-inner",Tn=".arrow",Cn="hover",wn="focus",In="click",Dn="manual",An=function(){function i(t,e){if("undefined"==typeof pe)throw new TypeError("Bootstrap tooltips require Popper.js (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=sn(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),sn(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(sn(this.getTipElement()).hasClass(yn))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),sn.removeData(this.element,this.constructor.DATA_KEY),sn(this.element).off(this.constructor.EVENT_KEY),sn(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&sn(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===sn(this.element).css("display"))throw new Error("Please use show on visible elements");var t=sn.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){sn(this.element).trigger(t);var n=sn.contains(this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!n)return;var i=this.getTipElement(),r=gt.getUID(this.constructor.NAME);i.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&sn(i).addClass(En);var o="function"==typeof this.config.placement?this.config.placement.call(this,i,this.element):this.config.placement,s=this._getAttachment(o);this.addAttachmentClass(s);var a=!1===this.config.container?document.body:sn(this.config.container);sn(i).data(this.constructor.DATA_KEY,this),sn.contains(this.element.ownerDocument.documentElement,this.tip)||sn(i).appendTo(a),sn(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new pe(this.element,i,{placement:s,modifiers:{offset:{offset:this.config.offset},flip:{behavior:this.config.fallbackPlacement},arrow:{element:Tn},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){e._handlePopperPlacementChange(t)}}),sn(i).addClass(yn),"ontouchstart"in document.documentElement&&sn(document.body).children().on("mouseover",null,sn.noop);var l=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,sn(e.element).trigger(e.constructor.Event.SHOWN),t===_n&&e._leave(null,e)};if(sn(this.tip).hasClass(En)){var c=gt.getTransitionDurationFromElement(this.tip);sn(this.tip).one(gt.TRANSITION_END,l).emulateTransitionEnd(c)}else l()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=sn.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==mn&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),sn(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(sn(this.element).trigger(i),!i.isDefaultPrevented()){if(sn(n).removeClass(yn),"ontouchstart"in document.documentElement&&sn(document.body).children().off("mouseover",null,sn.noop),this._activeTrigger[In]=!1,this._activeTrigger[wn]=!1,this._activeTrigger[Cn]=!1,sn(this.tip).hasClass(En)){var o=gt.getTransitionDurationFromElement(n);sn(n).one(gt.TRANSITION_END,r).emulateTransitionEnd(o)}else r();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){sn(this.getTipElement()).addClass(hn+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||sn(this.config.template)[0],this.tip},t.setContent=function(){var t=sn(this.getTipElement());this.setElementContent(t.find(bn),this.getTitle()),t.removeClass(En+" "+yn)},t.setElementContent=function(t,e){var n=this.config.html;"object"==typeof e&&(e.nodeType||e.jquery)?n?sn(e).parent().is(t)||t.empty().append(e):t.text(sn(e).text()):t[n?"html":"text"](e)},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getAttachment=function(t){return pn[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)sn(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Dn){var e=t===Cn?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===Cn?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;sn(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}sn(i.element).closest(".modal").on("hide.bs.modal",function(){return i.hide()})}),this.config.selector?this.config=c({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||sn(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),sn(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?wn:Cn]=!0),sn(e.getTipElement()).hasClass(yn)||e._hoverState===mn?e._hoverState=mn:(clearTimeout(e._timeout),e._hoverState=mn,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===mn&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||sn(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),sn(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?wn:Cn]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=_n,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===_n&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){return"number"==typeof(t=c({},this.constructor.Default,sn(this.element).data(),t)).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),gt.typeCheckConfig(an,t,this.constructor.DefaultType),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=sn(this.getTipElement()),e=t.attr("class").match(un);null!==e&&0

'}),Rn=c({},Ci.DefaultType,{content:"(string|element|function)"}),Mn="fade",Wn=".popover-header",Fn=".popover-body",Un={HIDE:"hide"+kn,HIDDEN:"hidden"+kn,SHOW:(Hn="show")+kn,SHOWN:"shown"+kn,INSERTED:"inserted"+kn,CLICK:"click"+kn,FOCUSIN:"focusin"+kn,FOCUSOUT:"focusout"+kn,MOUSEENTER:"mouseenter"+kn,MOUSELEAVE:"mouseleave"+kn},Bn=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var r=i.prototype;return r.isWithContent=function(){return this.getTitle()||this._getContent()},r.addAttachmentClass=function(t){Sn(this.getTipElement()).addClass(Pn+"-"+t)},r.getTipElement=function(){return this.tip=this.tip||Sn(this.config.template)[0],this.tip},r.setContent=function(){var t=Sn(this.getTipElement());this.setElementContent(t.find(Wn),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(Fn),e),t.removeClass(Mn+" "+Hn)},r._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},r._cleanTipClass=function(){var t=Sn(this.getTipElement()),e=t.attr("class").match(xn);null!==e&&0=this._offsets[r]&&("undefined"==typeof this._offsets[r+1]||tthis._items.length-1||t<0))if(this._isSliding)p(this._element).one(q.SLID,function(){return e.to(t)});else{if(n===t)return this.pause(),void this.cycle();var i=n=i.clientWidth&&n>=i.clientHeight}),h=0l[t]&&!i.escapeWithReference&&(n=Math.min(h[e],l[t]-("right"===t?h.width:h.height))),Kt({},e,n)}};return c.forEach(function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";h=Qt({},h,u[e](t))}),t.offsets.popper=h,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,o=t.placement.split("-")[0],r=Math.floor,s=-1!==["top","bottom"].indexOf(o),a=s?"right":"bottom",l=s?"left":"top",c=s?"width":"height";return n[a]r(i[a])&&(t.offsets.popper[l]=r(i[a])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!fe(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var o=t.placement.split("-")[0],r=t.offsets,s=r.popper,a=r.reference,l=-1!==["left","right"].indexOf(o),c=l?"height":"width",h=l?"Top":"Left",u=h.toLowerCase(),f=l?"left":"top",d=l?"bottom":"right",p=Zt(i)[c];a[d]-ps[d]&&(t.offsets.popper[u]+=a[u]+p-s[d]),t.offsets.popper=Vt(t.offsets.popper);var m=a[u]+a[c]/2-p/2,g=Nt(t.instance.popper),_=parseFloat(g["margin"+h],10),v=parseFloat(g["border"+h+"Width"],10),y=m-t.offsets.popper[u]-_-v;return y=Math.max(Math.min(s[c]-p,y),0),t.arrowElement=i,t.offsets.arrow=(Kt(n={},u,Math.round(y)),Kt(n,f,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(p,m){if(oe(p.instance.modifiers,"inner"))return p;if(p.flipped&&p.placement===p.originalPlacement)return p;var g=Gt(p.instance.popper,p.instance.reference,m.padding,m.boundariesElement,p.positionFixed),_=p.placement.split("-")[0],v=te(_),y=p.placement.split("-")[1]||"",E=[];switch(m.behavior){case ge:E=[_,v];break;case _e:E=me(_);break;case ve:E=me(_,!0);break;default:E=m.behavior}return E.forEach(function(t,e){if(_!==t||E.length===e+1)return p;_=p.placement.split("-")[0],v=te(_);var n,i=p.offsets.popper,o=p.offsets.reference,r=Math.floor,s="left"===_&&r(i.right)>r(o.left)||"right"===_&&r(i.left)r(o.top)||"bottom"===_&&r(i.top)r(g.right),c=r(i.top)r(g.bottom),u="left"===_&&a||"right"===_&&l||"top"===_&&c||"bottom"===_&&h,f=-1!==["top","bottom"].indexOf(_),d=!!m.flipVariations&&(f&&"start"===y&&a||f&&"end"===y&&l||!f&&"start"===y&&c||!f&&"end"===y&&h);(s||u||d)&&(p.flipped=!0,(s||u)&&(_=E[e+1]),d&&(y="end"===(n=y)?"start":"start"===n?"end":n),p.placement=_+(y?"-"+y:""),p.offsets.popper=Qt({},p.offsets.popper,ee(p.instance.popper,p.offsets.reference,p.placement)),p=ie(p.instance.modifiers,p,"flip"))}),p},behavior:"flip",padding:5,boundariesElement:"viewport"},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,o=i.popper,r=i.reference,s=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return o[s?"left":"top"]=r[n]-(a?o[s?"width":"height"]:0),t.placement=te(e),t.offsets.popper=Vt(o),t}},hide:{order:800,enabled:!0,fn:function(t){if(!fe(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=ne(t.instance.modifiers,function(t){return"preventOverflow"===t.name}).boundaries;if(e.bottomn.right||e.top>n.bottom||e.rightdocument.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},t._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},t._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=t.left+t.right
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",sanitize:!0,sanitizeFn:null,whiteList:vn},Ln="show",xn="out",Pn={HIDE:"hide"+Tn,HIDDEN:"hidden"+Tn,SHOW:"show"+Tn,SHOWN:"shown"+Tn,INSERTED:"inserted"+Tn,CLICK:"click"+Tn,FOCUSIN:"focusin"+Tn,FOCUSOUT:"focusout"+Tn,MOUSEENTER:"mouseenter"+Tn,MOUSELEAVE:"mouseleave"+Tn},Hn="fade",jn="show",Rn=".tooltip-inner",Fn=".arrow",Mn="hover",Wn="focus",Un="click",Bn="manual",qn=function(){function i(t,e){if("undefined"==typeof be)throw new TypeError("Bootstrap's tooltips require Popper.js (https://popper.js.org/)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var t=i.prototype;return t.enable=function(){this._isEnabled=!0},t.disable=function(){this._isEnabled=!1},t.toggleEnabled=function(){this._isEnabled=!this._isEnabled},t.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=p(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),p(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(p(this.getTipElement()).hasClass(jn))return void this._leave(null,this);this._enter(null,this)}},t.dispose=function(){clearTimeout(this._timeout),p.removeData(this.element,this.constructor.DATA_KEY),p(this.element).off(this.constructor.EVENT_KEY),p(this.element).closest(".modal").off("hide.bs.modal"),this.tip&&p(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,(this._activeTrigger=null)!==this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},t.show=function(){var e=this;if("none"===p(this.element).css("display"))throw new Error("Please use show on visible elements");var t=p.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){p(this.element).trigger(t);var n=m.findShadowRoot(this.element),i=p.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(t.isDefaultPrevented()||!i)return;var o=this.getTipElement(),r=m.getUID(this.constructor.NAME);o.setAttribute("id",r),this.element.setAttribute("aria-describedby",r),this.setContent(),this.config.animation&&p(o).addClass(Hn);var s="function"==typeof this.config.placement?this.config.placement.call(this,o,this.element):this.config.placement,a=this._getAttachment(s);this.addAttachmentClass(a);var l=this._getContainer();p(o).data(this.constructor.DATA_KEY,this),p.contains(this.element.ownerDocument.documentElement,this.tip)||p(o).appendTo(l),p(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new be(this.element,o,{placement:a,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:Fn},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}}),p(o).addClass(jn),"ontouchstart"in document.documentElement&&p(document.body).children().on("mouseover",null,p.noop);var c=function(){e.config.animation&&e._fixTransition();var t=e._hoverState;e._hoverState=null,p(e.element).trigger(e.constructor.Event.SHOWN),t===xn&&e._leave(null,e)};if(p(this.tip).hasClass(Hn)){var h=m.getTransitionDurationFromElement(this.tip);p(this.tip).one(m.TRANSITION_END,c).emulateTransitionEnd(h)}else c()}},t.hide=function(t){var e=this,n=this.getTipElement(),i=p.Event(this.constructor.Event.HIDE),o=function(){e._hoverState!==Ln&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),p(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(p(this.element).trigger(i),!i.isDefaultPrevented()){if(p(n).removeClass(jn),"ontouchstart"in document.documentElement&&p(document.body).children().off("mouseover",null,p.noop),this._activeTrigger[Un]=!1,this._activeTrigger[Wn]=!1,this._activeTrigger[Mn]=!1,p(this.tip).hasClass(Hn)){var r=m.getTransitionDurationFromElement(n);p(n).one(m.TRANSITION_END,o).emulateTransitionEnd(r)}else o();this._hoverState=""}},t.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},t.isWithContent=function(){return Boolean(this.getTitle())},t.addAttachmentClass=function(t){p(this.getTipElement()).addClass(Dn+"-"+t)},t.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},t.setContent=function(){var t=this.getTipElement();this.setElementContent(p(t.querySelectorAll(Rn)),this.getTitle()),p(t).removeClass(Hn+" "+jn)},t.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=bn(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?p(e).parent().is(t)||t.empty().append(e):t.text(p(e).text())},t.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},t._getOffset=function(){var e=this,t={};return"function"==typeof this.config.offset?t.fn=function(t){return t.offsets=l({},t.offsets,e.config.offset(t.offsets,e.element)||{}),t}:t.offset=this.config.offset,t},t._getContainer=function(){return!1===this.config.container?document.body:m.isElement(this.config.container)?p(this.config.container):p(document).find(this.config.container)},t._getAttachment=function(t){return Nn[t.toUpperCase()]},t._setListeners=function(){var i=this;this.config.trigger.split(" ").forEach(function(t){if("click"===t)p(i.element).on(i.constructor.Event.CLICK,i.config.selector,function(t){return i.toggle(t)});else if(t!==Bn){var e=t===Mn?i.constructor.Event.MOUSEENTER:i.constructor.Event.FOCUSIN,n=t===Mn?i.constructor.Event.MOUSELEAVE:i.constructor.Event.FOCUSOUT;p(i.element).on(e,i.config.selector,function(t){return i._enter(t)}).on(n,i.config.selector,function(t){return i._leave(t)})}}),p(this.element).closest(".modal").on("hide.bs.modal",function(){i.element&&i.hide()}),this.config.selector?this.config=l({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},t._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},t._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||p(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),p(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?Wn:Mn]=!0),p(e.getTipElement()).hasClass(jn)||e._hoverState===Ln?e._hoverState=Ln:(clearTimeout(e._timeout),e._hoverState=Ln,e.config.delay&&e.config.delay.show?e._timeout=setTimeout(function(){e._hoverState===Ln&&e.show()},e.config.delay.show):e.show())},t._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||p(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),p(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?Wn:Mn]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=xn,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout(function(){e._hoverState===xn&&e.hide()},e.config.delay.hide):e.hide())},t._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},t._getConfig=function(t){var e=p(this.element).data();return Object.keys(e).forEach(function(t){-1!==An.indexOf(t)&&delete e[t]}),"number"==typeof(t=l({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),m.typeCheckConfig(wn,t,this.constructor.DefaultType),t.sanitize&&(t.template=bn(t.template,t.whiteList,t.sanitizeFn)),t},t._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},t._cleanTipClass=function(){var t=p(this.getTipElement()),e=t.attr("class").match(In);null!==e&&e.length&&t.removeClass(e.join(""))},t._handlePopperPlacementChange=function(t){var e=t.instance;this.tip=e.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},t._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(p(t).removeClass(Hn),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},i._jQueryInterface=function(n){return this.each(function(){var t=p(this).data(Cn),e="object"==typeof n&&n;if((t||!/dispose|hide/.test(n))&&(t||(t=new i(this,e),p(this).data(Cn,t)),"string"==typeof n)){if("undefined"==typeof t[n])throw new TypeError('No method named "'+n+'"');t[n]()}})},s(i,null,[{key:"VERSION",get:function(){return"4.3.1"}},{key:"Default",get:function(){return kn}},{key:"NAME",get:function(){return wn}},{key:"DATA_KEY",get:function(){return Cn}},{key:"Event",get:function(){return Pn}},{key:"EVENT_KEY",get:function(){return Tn}},{key:"DefaultType",get:function(){return On}}]),i}();p.fn[wn]=qn._jQueryInterface,p.fn[wn].Constructor=qn,p.fn[wn].noConflict=function(){return p.fn[wn]=Sn,qn._jQueryInterface};var Kn="popover",Qn="bs.popover",Vn="."+Qn,Yn=p.fn[Kn],zn="bs-popover",Xn=new RegExp("(^|\\s)"+zn+"\\S+","g"),Gn=l({},qn.Default,{placement:"right",trigger:"click",content:"",template:''}),$n=l({},qn.DefaultType,{content:"(string|element|function)"}),Jn="fade",Zn="show",ti=".popover-header",ei=".popover-body",ni={HIDE:"hide"+Vn,HIDDEN:"hidden"+Vn,SHOW:"show"+Vn,SHOWN:"shown"+Vn,INSERTED:"inserted"+Vn,CLICK:"click"+Vn,FOCUSIN:"focusin"+Vn,FOCUSOUT:"focusout"+Vn,MOUSEENTER:"mouseenter"+Vn,MOUSELEAVE:"mouseleave"+Vn},ii=function(t){var e,n;function i(){return t.apply(this,arguments)||this}n=t,(e=i).prototype=Object.create(n.prototype),(e.prototype.constructor=e).__proto__=n;var o=i.prototype;return o.isWithContent=function(){return this.getTitle()||this._getContent()},o.addAttachmentClass=function(t){p(this.getTipElement()).addClass(zn+"-"+t)},o.getTipElement=function(){return this.tip=this.tip||p(this.config.template)[0],this.tip},o.setContent=function(){var t=p(this.getTipElement());this.setElementContent(t.find(ti),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(ei),e),t.removeClass(Jn+" "+Zn)},o._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},o._cleanTipClass=function(){var t=p(this.getTipElement()),e=t.attr("class").match(Xn);null!==e&&0=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t=4)throw new Error("Bootstrap's JavaScript requires at least jQuery v1.9.1 but less than v4.0.0")}};u.jQueryDetection(),i.default.fn.emulateTransitionEnd=function(t){var e=this,n=!1;return i.default(this).one(u.TRANSITION_END,(function(){n=!0})),setTimeout((function(){n||u.triggerTransitionEnd(e)}),t),this},i.default.event.special[u.TRANSITION_END]={bindType:l,delegateType:l,handle:function(t){if(i.default(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}};var f="bs.alert",d=i.default.fn.alert,c=function(){function t(t){this._element=t}var e=t.prototype;return e.close=function(t){var e=this._element;t&&(e=this._getRootElement(t)),this._triggerCloseEvent(e).isDefaultPrevented()||this._removeElement(e)},e.dispose=function(){i.default.removeData(this._element,f),this._element=null},e._getRootElement=function(t){var e=u.getSelectorFromElement(t),n=!1;return e&&(n=document.querySelector(e)),n||(n=i.default(t).closest(".alert")[0]),n},e._triggerCloseEvent=function(t){var e=i.default.Event("close.bs.alert");return i.default(t).trigger(e),e},e._removeElement=function(t){var e=this;if(i.default(t).removeClass("show"),i.default(t).hasClass("fade")){var n=u.getTransitionDurationFromElement(t);i.default(t).one(u.TRANSITION_END,(function(n){return e._destroyElement(t,n)})).emulateTransitionEnd(n)}else this._destroyElement(t)},e._destroyElement=function(t){i.default(t).detach().trigger("closed.bs.alert").remove()},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(f);o||(o=new t(this),n.data(f,o)),"close"===e&&o[e](this)}))},t._handleDismiss=function(t){return function(e){e&&e.preventDefault(),t.close(this)}},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.alert.data-api",'[data-dismiss="alert"]',c._handleDismiss(new c)),i.default.fn.alert=c._jQueryInterface,i.default.fn.alert.Constructor=c,i.default.fn.alert.noConflict=function(){return i.default.fn.alert=d,c._jQueryInterface};var h="bs.button",p=i.default.fn.button,m="active",g='[data-toggle^="button"]',_='input:not([type="hidden"])',v=".btn",b=function(){function t(t){this._element=t,this.shouldAvoidTriggerChange=!1}var e=t.prototype;return e.toggle=function(){var t=!0,e=!0,n=i.default(this._element).closest('[data-toggle="buttons"]')[0];if(n){var o=this._element.querySelector(_);if(o){if("radio"===o.type)if(o.checked&&this._element.classList.contains(m))t=!1;else{var r=n.querySelector(".active");r&&i.default(r).removeClass(m)}t&&("checkbox"!==o.type&&"radio"!==o.type||(o.checked=!this._element.classList.contains(m)),this.shouldAvoidTriggerChange||i.default(o).trigger("change")),o.focus(),e=!1}}this._element.hasAttribute("disabled")||this._element.classList.contains("disabled")||(e&&this._element.setAttribute("aria-pressed",!this._element.classList.contains(m)),t&&i.default(this._element).toggleClass(m))},e.dispose=function(){i.default.removeData(this._element,h),this._element=null},t._jQueryInterface=function(e,n){return this.each((function(){var o=i.default(this),r=o.data(h);r||(r=new t(this),o.data(h,r)),r.shouldAvoidTriggerChange=n,"toggle"===e&&r[e]()}))},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.button.data-api",g,(function(t){var e=t.target,n=e;if(i.default(e).hasClass("btn")||(e=i.default(e).closest(v)[0]),!e||e.hasAttribute("disabled")||e.classList.contains("disabled"))t.preventDefault();else{var o=e.querySelector(_);if(o&&(o.hasAttribute("disabled")||o.classList.contains("disabled")))return void t.preventDefault();"INPUT"!==n.tagName&&"LABEL"===e.tagName||b._jQueryInterface.call(i.default(e),"toggle","INPUT"===n.tagName)}})).on("focus.bs.button.data-api blur.bs.button.data-api",g,(function(t){var e=i.default(t.target).closest(v)[0];i.default(e).toggleClass("focus",/^focus(in)?$/.test(t.type))})),i.default(window).on("load.bs.button.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-toggle="buttons"] .btn')),e=0,n=t.length;e0,this._pointerEvent=Boolean(window.PointerEvent||window.MSPointerEvent),this._addEventListeners()}var e=t.prototype;return e.next=function(){this._isSliding||this._slide(C)},e.nextWhenVisible=function(){var t=i.default(this._element);!document.hidden&&t.is(":visible")&&"hidden"!==t.css("visibility")&&this.next()},e.prev=function(){this._isSliding||this._slide(S)},e.pause=function(t){t||(this._isPaused=!0),this._element.querySelector(".carousel-item-next, .carousel-item-prev")&&(u.triggerTransitionEnd(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null},e.cycle=function(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))},e.to=function(t){var e=this;this._activeElement=this._element.querySelector(D);var n=this._getItemIndex(this._activeElement);if(!(t>this._items.length-1||t<0))if(this._isSliding)i.default(this._element).one(N,(function(){return e.to(t)}));else{if(n===t)return this.pause(),void this.cycle();var o=t>n?C:S;this._slide(o,this._items[t])}},e.dispose=function(){i.default(this._element).off(".bs.carousel"),i.default.removeData(this._element,E),this._items=null,this._config=null,this._element=null,this._interval=null,this._isPaused=null,this._isSliding=null,this._activeElement=null,this._indicatorsElement=null},e._getConfig=function(t){return t=a({},A,t),u.typeCheckConfig(y,t,k),t},e._handleSwipe=function(){var t=Math.abs(this.touchDeltaX);if(!(t<=40)){var e=t/this.touchDeltaX;this.touchDeltaX=0,e>0&&this.prev(),e<0&&this.next()}},e._addEventListeners=function(){var t=this;this._config.keyboard&&i.default(this._element).on("keydown.bs.carousel",(function(e){return t._keydown(e)})),"hover"===this._config.pause&&i.default(this._element).on("mouseenter.bs.carousel",(function(e){return t.pause(e)})).on("mouseleave.bs.carousel",(function(e){return t.cycle(e)})),this._config.touch&&this._addTouchEventListeners()},e._addTouchEventListeners=function(){var t=this;if(this._touchSupported){var e=function(e){t._pointerEvent&&I[e.originalEvent.pointerType.toUpperCase()]?t.touchStartX=e.originalEvent.clientX:t._pointerEvent||(t.touchStartX=e.originalEvent.touches[0].clientX)},n=function(e){t._pointerEvent&&I[e.originalEvent.pointerType.toUpperCase()]&&(t.touchDeltaX=e.originalEvent.clientX-t.touchStartX),t._handleSwipe(),"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(e){return t.cycle(e)}),500+t._config.interval))};i.default(this._element.querySelectorAll(".carousel-item img")).on("dragstart.bs.carousel",(function(t){return t.preventDefault()})),this._pointerEvent?(i.default(this._element).on("pointerdown.bs.carousel",(function(t){return e(t)})),i.default(this._element).on("pointerup.bs.carousel",(function(t){return n(t)})),this._element.classList.add("pointer-event")):(i.default(this._element).on("touchstart.bs.carousel",(function(t){return e(t)})),i.default(this._element).on("touchmove.bs.carousel",(function(e){return function(e){t.touchDeltaX=e.originalEvent.touches&&e.originalEvent.touches.length>1?0:e.originalEvent.touches[0].clientX-t.touchStartX}(e)})),i.default(this._element).on("touchend.bs.carousel",(function(t){return n(t)})))}},e._keydown=function(t){if(!/input|textarea/i.test(t.target.tagName))switch(t.which){case 37:t.preventDefault(),this.prev();break;case 39:t.preventDefault(),this.next()}},e._getItemIndex=function(t){return this._items=t&&t.parentNode?[].slice.call(t.parentNode.querySelectorAll(".carousel-item")):[],this._items.indexOf(t)},e._getItemByDirection=function(t,e){var n=t===C,i=t===S,o=this._getItemIndex(e),r=this._items.length-1;if((i&&0===o||n&&o===r)&&!this._config.wrap)return e;var a=(o+(t===S?-1:1))%this._items.length;return-1===a?this._items[this._items.length-1]:this._items[a]},e._triggerSlideEvent=function(t,e){var n=this._getItemIndex(t),o=this._getItemIndex(this._element.querySelector(D)),r=i.default.Event("slide.bs.carousel",{relatedTarget:t,direction:e,from:o,to:n});return i.default(this._element).trigger(r),r},e._setActiveIndicatorElement=function(t){if(this._indicatorsElement){var e=[].slice.call(this._indicatorsElement.querySelectorAll(".active"));i.default(e).removeClass(T);var n=this._indicatorsElement.children[this._getItemIndex(t)];n&&i.default(n).addClass(T)}},e._updateInterval=function(){var t=this._activeElement||this._element.querySelector(D);if(t){var e=parseInt(t.getAttribute("data-interval"),10);e?(this._config.defaultInterval=this._config.defaultInterval||this._config.interval,this._config.interval=e):this._config.interval=this._config.defaultInterval||this._config.interval}},e._slide=function(t,e){var n,o,r,a=this,s=this._element.querySelector(D),l=this._getItemIndex(s),f=e||s&&this._getItemByDirection(t,s),d=this._getItemIndex(f),c=Boolean(this._interval);if(t===C?(n="carousel-item-left",o="carousel-item-next",r="left"):(n="carousel-item-right",o="carousel-item-prev",r="right"),f&&i.default(f).hasClass(T))this._isSliding=!1;else if(!this._triggerSlideEvent(f,r).isDefaultPrevented()&&s&&f){this._isSliding=!0,c&&this.pause(),this._setActiveIndicatorElement(f),this._activeElement=f;var h=i.default.Event(N,{relatedTarget:f,direction:r,from:l,to:d});if(i.default(this._element).hasClass("slide")){i.default(f).addClass(o),u.reflow(f),i.default(s).addClass(n),i.default(f).addClass(n);var p=u.getTransitionDurationFromElement(s);i.default(s).one(u.TRANSITION_END,(function(){i.default(f).removeClass(n+" "+o).addClass(T),i.default(s).removeClass("active "+o+" "+n),a._isSliding=!1,setTimeout((function(){return i.default(a._element).trigger(h)}),0)})).emulateTransitionEnd(p)}else i.default(s).removeClass(T),i.default(f).addClass(T),this._isSliding=!1,i.default(this._element).trigger(h);c&&this.cycle()}},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(E),o=a({},A,i.default(this).data());"object"==typeof e&&(o=a({},o,e));var r="string"==typeof e?e:o.slide;if(n||(n=new t(this,o),i.default(this).data(E,n)),"number"==typeof e)n.to(e);else if("string"==typeof r){if("undefined"==typeof n[r])throw new TypeError('No method named "'+r+'"');n[r]()}else o.interval&&o.ride&&(n.pause(),n.cycle())}))},t._dataApiClickHandler=function(e){var n=u.getSelectorFromElement(this);if(n){var o=i.default(n)[0];if(o&&i.default(o).hasClass("carousel")){var r=a({},i.default(o).data(),i.default(this).data()),s=this.getAttribute("data-slide-to");s&&(r.interval=!1),t._jQueryInterface.call(i.default(o),r),s&&i.default(o).data(E).to(s),e.preventDefault()}}},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return A}}]),t}();i.default(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",O._dataApiClickHandler),i.default(window).on("load.bs.carousel.data-api",(function(){for(var t=[].slice.call(document.querySelectorAll('[data-ride="carousel"]')),e=0,n=t.length;e0&&(this._selector=a,this._triggerArray.push(r))}this._parent=this._config.parent?this._getParent():null,this._config.parent||this._addAriaAndCollapsedClass(this._element,this._triggerArray),this._config.toggle&&this.toggle()}var e=t.prototype;return e.toggle=function(){i.default(this._element).hasClass(P)?this.hide():this.show()},e.show=function(){var e,n,o=this;if(!(this._isTransitioning||i.default(this._element).hasClass(P)||(this._parent&&0===(e=[].slice.call(this._parent.querySelectorAll(".show, .collapsing")).filter((function(t){return"string"==typeof o._config.parent?t.getAttribute("data-parent")===o._config.parent:t.classList.contains(F)}))).length&&(e=null),e&&(n=i.default(e).not(this._selector).data(j))&&n._isTransitioning))){var r=i.default.Event("show.bs.collapse");if(i.default(this._element).trigger(r),!r.isDefaultPrevented()){e&&(t._jQueryInterface.call(i.default(e).not(this._selector),"hide"),n||i.default(e).data(j,null));var a=this._getDimension();i.default(this._element).removeClass(F).addClass(R),this._element.style[a]=0,this._triggerArray.length&&i.default(this._triggerArray).removeClass(H).attr("aria-expanded",!0),this.setTransitioning(!0);var s="scroll"+(a[0].toUpperCase()+a.slice(1)),l=u.getTransitionDurationFromElement(this._element);i.default(this._element).one(u.TRANSITION_END,(function(){i.default(o._element).removeClass(R).addClass("collapse show"),o._element.style[a]="",o.setTransitioning(!1),i.default(o._element).trigger("shown.bs.collapse")})).emulateTransitionEnd(l),this._element.style[a]=this._element[s]+"px"}}},e.hide=function(){var t=this;if(!this._isTransitioning&&i.default(this._element).hasClass(P)){var e=i.default.Event("hide.bs.collapse");if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){var n=this._getDimension();this._element.style[n]=this._element.getBoundingClientRect()[n]+"px",u.reflow(this._element),i.default(this._element).addClass(R).removeClass("collapse show");var o=this._triggerArray.length;if(o>0)for(var r=0;r=0)return 1;return 0}(),Y=U&&window.Promise?function(t){var e=!1;return function(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){var e=!1;return function(){e||(e=!0,setTimeout((function(){e=!1,t()}),V))}};function z(t){return t&&"[object Function]"==={}.toString.call(t)}function K(t,e){if(1!==t.nodeType)return[];var n=t.ownerDocument.defaultView.getComputedStyle(t,null);return e?n[e]:n}function X(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}function G(t){if(!t)return document.body;switch(t.nodeName){case"HTML":case"BODY":return t.ownerDocument.body;case"#document":return t.body}var e=K(t),n=e.overflow,i=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+i)?t:G(X(t))}function $(t){return t&&t.referenceNode?t.referenceNode:t}var J=U&&!(!window.MSInputMethodContext||!document.documentMode),Z=U&&/MSIE 10/.test(navigator.userAgent);function tt(t){return 11===t?J:10===t?Z:J||Z}function et(t){if(!t)return document.documentElement;for(var e=tt(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;var i=n&&n.nodeName;return i&&"BODY"!==i&&"HTML"!==i?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===K(n,"position")?et(n):n:t?t.ownerDocument.documentElement:document.documentElement}function nt(t){return null!==t.parentNode?nt(t.parentNode):t}function it(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))return document.documentElement;var n=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,i=n?t:e,o=n?e:t,r=document.createRange();r.setStart(i,0),r.setEnd(o,0);var a,s,l=r.commonAncestorContainer;if(t!==l&&e!==l||i.contains(o))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&et(a.firstElementChild)!==a?et(l):l;var u=nt(t);return u.host?it(u.host,e):it(t,nt(e).host)}function ot(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",i=t.nodeName;if("BODY"===i||"HTML"===i){var o=t.ownerDocument.documentElement,r=t.ownerDocument.scrollingElement||o;return r[n]}return t[n]}function rt(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=ot(e,"top"),o=ot(e,"left"),r=n?-1:1;return t.top+=i*r,t.bottom+=i*r,t.left+=o*r,t.right+=o*r,t}function at(t,e){var n="x"===e?"Left":"Top",i="Left"===n?"Right":"Bottom";return parseFloat(t["border"+n+"Width"])+parseFloat(t["border"+i+"Width"])}function st(t,e,n,i){return Math.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],tt(10)?parseInt(n["offset"+t])+parseInt(i["margin"+("Height"===t?"Top":"Left")])+parseInt(i["margin"+("Height"===t?"Bottom":"Right")]):0)}function lt(t){var e=t.body,n=t.documentElement,i=tt(10)&&getComputedStyle(n);return{height:st("Height",e,n,i),width:st("Width",e,n,i)}}var ut=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},ft=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]&&arguments[2],i=tt(10),o="HTML"===e.nodeName,r=pt(t),a=pt(e),s=G(t),l=K(e),u=parseFloat(l.borderTopWidth),f=parseFloat(l.borderLeftWidth);n&&o&&(a.top=Math.max(a.top,0),a.left=Math.max(a.left,0));var d=ht({top:r.top-a.top-u,left:r.left-a.left-f,width:r.width,height:r.height});if(d.marginTop=0,d.marginLeft=0,!i&&o){var c=parseFloat(l.marginTop),h=parseFloat(l.marginLeft);d.top-=u-c,d.bottom-=u-c,d.left-=f-h,d.right-=f-h,d.marginTop=c,d.marginLeft=h}return(i&&!n?e.contains(s):e===s&&"BODY"!==s.nodeName)&&(d=rt(d,e)),d}function gt(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t.ownerDocument.documentElement,i=mt(t,n),o=Math.max(n.clientWidth,window.innerWidth||0),r=Math.max(n.clientHeight,window.innerHeight||0),a=e?0:ot(n),s=e?0:ot(n,"left"),l={top:a-i.top+i.marginTop,left:s-i.left+i.marginLeft,width:o,height:r};return ht(l)}function _t(t){var e=t.nodeName;if("BODY"===e||"HTML"===e)return!1;if("fixed"===K(t,"position"))return!0;var n=X(t);return!!n&&_t(n)}function vt(t){if(!t||!t.parentElement||tt())return document.documentElement;for(var e=t.parentElement;e&&"none"===K(e,"transform");)e=e.parentElement;return e||document.documentElement}function bt(t,e,n,i){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r={top:0,left:0},a=o?vt(t):it(t,$(e));if("viewport"===i)r=gt(a,o);else{var s=void 0;"scrollParent"===i?"BODY"===(s=G(X(e))).nodeName&&(s=t.ownerDocument.documentElement):s="window"===i?t.ownerDocument.documentElement:i;var l=mt(s,a,o);if("HTML"!==s.nodeName||_t(a))r=l;else{var u=lt(t.ownerDocument),f=u.height,d=u.width;r.top+=l.top-l.marginTop,r.bottom=f+l.top,r.left+=l.left-l.marginLeft,r.right=d+l.left}}var c="number"==typeof(n=n||0);return r.left+=c?n:n.left||0,r.top+=c?n:n.top||0,r.right-=c?n:n.right||0,r.bottom-=c?n:n.bottom||0,r}function yt(t){return t.width*t.height}function Et(t,e,n,i,o){var r=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;if(-1===t.indexOf("auto"))return t;var a=bt(n,i,r,o),s={top:{width:a.width,height:e.top-a.top},right:{width:a.right-e.right,height:a.height},bottom:{width:a.width,height:a.bottom-e.bottom},left:{width:e.left-a.left,height:a.height}},l=Object.keys(s).map((function(t){return ct({key:t},s[t],{area:yt(s[t])})})).sort((function(t,e){return e.area-t.area})),u=l.filter((function(t){var e=t.width,i=t.height;return e>=n.clientWidth&&i>=n.clientHeight})),f=u.length>0?u[0].key:l[0].key,d=t.split("-")[1];return f+(d?"-"+d:"")}function wt(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,o=i?vt(e):it(e,$(n));return mt(n,o,i)}function Tt(t){var e=t.ownerDocument.defaultView.getComputedStyle(t),n=parseFloat(e.marginTop||0)+parseFloat(e.marginBottom||0),i=parseFloat(e.marginLeft||0)+parseFloat(e.marginRight||0);return{width:t.offsetWidth+i,height:t.offsetHeight+n}}function Ct(t){var e={left:"right",right:"left",bottom:"top",top:"bottom"};return t.replace(/left|right|bottom|top/g,(function(t){return e[t]}))}function St(t,e,n){n=n.split("-")[0];var i=Tt(t),o={width:i.width,height:i.height},r=-1!==["right","left"].indexOf(n),a=r?"top":"left",s=r?"left":"top",l=r?"height":"width",u=r?"width":"height";return o[a]=e[a]+e[l]/2-i[l]/2,o[s]=n===s?e[s]-i[u]:e[Ct(s)],o}function Nt(t,e){return Array.prototype.find?t.find(e):t.filter(e)[0]}function Dt(t,e,n){return(void 0===n?t:t.slice(0,function(t,e,n){if(Array.prototype.findIndex)return t.findIndex((function(t){return t.name===n}));var i=Nt(t,(function(t){return t.name===n}));return t.indexOf(i)}(t,0,n))).forEach((function(t){t.function&&console.warn("`modifier.function` is deprecated, use `modifier.fn`!");var n=t.function||t.fn;t.enabled&&z(n)&&(e.offsets.popper=ht(e.offsets.popper),e.offsets.reference=ht(e.offsets.reference),e=n(e,t))})),e}function At(){if(!this.state.isDestroyed){var t={instance:this,styles:{},arrowStyles:{},attributes:{},flipped:!1,offsets:{}};t.offsets.reference=wt(this.state,this.popper,this.reference,this.options.positionFixed),t.placement=Et(this.options.placement,t.offsets.reference,this.popper,this.reference,this.options.modifiers.flip.boundariesElement,this.options.modifiers.flip.padding),t.originalPlacement=t.placement,t.positionFixed=this.options.positionFixed,t.offsets.popper=St(this.popper,t.offsets.reference,t.placement),t.offsets.popper.position=this.options.positionFixed?"fixed":"absolute",t=Dt(this.modifiers,t),this.state.isCreated?this.options.onUpdate(t):(this.state.isCreated=!0,this.options.onCreate(t))}}function kt(t,e){return t.some((function(t){var n=t.name;return t.enabled&&n===e}))}function It(t){for(var e=[!1,"ms","Webkit","Moz","O"],n=t.charAt(0).toUpperCase()+t.slice(1),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=Qt.indexOf(t),i=Qt.slice(n+1).concat(Qt.slice(0,n));return e?i.reverse():i}var Ut={placement:"bottom",positionFixed:!1,eventsEnabled:!0,removeOnDestroy:!1,onCreate:function(){},onUpdate:function(){},modifiers:{shift:{order:100,enabled:!0,fn:function(t){var e=t.placement,n=e.split("-")[0],i=e.split("-")[1];if(i){var o=t.offsets,r=o.reference,a=o.popper,s=-1!==["bottom","top"].indexOf(n),l=s?"left":"top",u=s?"width":"height",f={start:dt({},l,r[l]),end:dt({},l,r[l]+r[u]-a[u])};t.offsets.popper=ct({},a,f[i])}return t}},offset:{order:200,enabled:!0,fn:function(t,e){var n,i=e.offset,o=t.placement,r=t.offsets,a=r.popper,s=r.reference,l=o.split("-")[0];return n=Rt(+i)?[+i,0]:function(t,e,n,i){var o=[0,0],r=-1!==["right","left"].indexOf(i),a=t.split(/(\+|\-)/).map((function(t){return t.trim()})),s=a.indexOf(Nt(a,(function(t){return-1!==t.search(/,|\s/)})));a[s]&&-1===a[s].indexOf(",")&&console.warn("Offsets separated by white space(s) are deprecated, use a comma (,) instead.");var l=/\s*,\s*|\s+/,u=-1!==s?[a.slice(0,s).concat([a[s].split(l)[0]]),[a[s].split(l)[1]].concat(a.slice(s+1))]:[a];return u=u.map((function(t,i){var o=(1===i?!r:r)?"height":"width",a=!1;return t.reduce((function(t,e){return""===t[t.length-1]&&-1!==["+","-"].indexOf(e)?(t[t.length-1]=e,a=!0,t):a?(t[t.length-1]+=e,a=!1,t):t.concat(e)}),[]).map((function(t){return function(t,e,n,i){var o=t.match(/((?:\-|\+)?\d*\.?\d*)(.*)/),r=+o[1],a=o[2];return r?0===a.indexOf("%")?ht("%p"===a?n:i)[e]/100*r:"vh"===a||"vw"===a?("vh"===a?Math.max(document.documentElement.clientHeight,window.innerHeight||0):Math.max(document.documentElement.clientWidth,window.innerWidth||0))/100*r:r:t}(t,o,e,n)}))})),u.forEach((function(t,e){t.forEach((function(n,i){Rt(n)&&(o[e]+=n*("-"===t[i-1]?-1:1))}))})),o}(i,a,s,l),"left"===l?(a.top+=n[0],a.left-=n[1]):"right"===l?(a.top+=n[0],a.left+=n[1]):"top"===l?(a.left+=n[0],a.top-=n[1]):"bottom"===l&&(a.left+=n[0],a.top+=n[1]),t.popper=a,t},offset:0},preventOverflow:{order:300,enabled:!0,fn:function(t,e){var n=e.boundariesElement||et(t.instance.popper);t.instance.reference===n&&(n=et(n));var i=It("transform"),o=t.instance.popper.style,r=o.top,a=o.left,s=o[i];o.top="",o.left="",o[i]="";var l=bt(t.instance.popper,t.instance.reference,e.padding,n,t.positionFixed);o.top=r,o.left=a,o[i]=s,e.boundaries=l;var u=e.priority,f=t.offsets.popper,d={primary:function(t){var n=f[t];return f[t]l[t]&&!e.escapeWithReference&&(i=Math.min(f[n],l[t]-("right"===t?f.width:f.height))),dt({},n,i)}};return u.forEach((function(t){var e=-1!==["left","top"].indexOf(t)?"primary":"secondary";f=ct({},f,d[e](t))})),t.offsets.popper=f,t},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function(t){var e=t.offsets,n=e.popper,i=e.reference,o=t.placement.split("-")[0],r=Math.floor,a=-1!==["top","bottom"].indexOf(o),s=a?"right":"bottom",l=a?"left":"top",u=a?"width":"height";return n[s]r(i[s])&&(t.offsets.popper[l]=r(i[s])),t}},arrow:{order:500,enabled:!0,fn:function(t,e){var n;if(!qt(t.instance.modifiers,"arrow","keepTogether"))return t;var i=e.element;if("string"==typeof i){if(!(i=t.instance.popper.querySelector(i)))return t}else if(!t.instance.popper.contains(i))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),t;var o=t.placement.split("-")[0],r=t.offsets,a=r.popper,s=r.reference,l=-1!==["left","right"].indexOf(o),u=l?"height":"width",f=l?"Top":"Left",d=f.toLowerCase(),c=l?"left":"top",h=l?"bottom":"right",p=Tt(i)[u];s[h]-pa[h]&&(t.offsets.popper[d]+=s[d]+p-a[h]),t.offsets.popper=ht(t.offsets.popper);var m=s[d]+s[u]/2-p/2,g=K(t.instance.popper),_=parseFloat(g["margin"+f]),v=parseFloat(g["border"+f+"Width"]),b=m-t.offsets.popper[d]-_-v;return b=Math.max(Math.min(a[u]-p,b),0),t.arrowElement=i,t.offsets.arrow=(dt(n={},d,Math.round(b)),dt(n,c,""),n),t},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function(t,e){if(kt(t.instance.modifiers,"inner"))return t;if(t.flipped&&t.placement===t.originalPlacement)return t;var n=bt(t.instance.popper,t.instance.reference,e.padding,e.boundariesElement,t.positionFixed),i=t.placement.split("-")[0],o=Ct(i),r=t.placement.split("-")[1]||"",a=[];switch(e.behavior){case"flip":a=[i,o];break;case"clockwise":a=Wt(i);break;case"counterclockwise":a=Wt(i,!0);break;default:a=e.behavior}return a.forEach((function(s,l){if(i!==s||a.length===l+1)return t;i=t.placement.split("-")[0],o=Ct(i);var u=t.offsets.popper,f=t.offsets.reference,d=Math.floor,c="left"===i&&d(u.right)>d(f.left)||"right"===i&&d(u.left)d(f.top)||"bottom"===i&&d(u.top)d(n.right),m=d(u.top)d(n.bottom),_="left"===i&&h||"right"===i&&p||"top"===i&&m||"bottom"===i&&g,v=-1!==["top","bottom"].indexOf(i),b=!!e.flipVariations&&(v&&"start"===r&&h||v&&"end"===r&&p||!v&&"start"===r&&m||!v&&"end"===r&&g),y=!!e.flipVariationsByContent&&(v&&"start"===r&&p||v&&"end"===r&&h||!v&&"start"===r&&g||!v&&"end"===r&&m),E=b||y;(c||_||E)&&(t.flipped=!0,(c||_)&&(i=a[l+1]),E&&(r=function(t){return"end"===t?"start":"start"===t?"end":t}(r)),t.placement=i+(r?"-"+r:""),t.offsets.popper=ct({},t.offsets.popper,St(t.instance.popper,t.offsets.reference,t.placement)),t=Dt(t.instance.modifiers,t,"flip"))})),t},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function(t){var e=t.placement,n=e.split("-")[0],i=t.offsets,o=i.popper,r=i.reference,a=-1!==["left","right"].indexOf(n),s=-1===["top","left"].indexOf(n);return o[a?"left":"top"]=r[n]-(s?o[a?"width":"height"]:0),t.placement=Ct(e),t.offsets.popper=ht(o),t}},hide:{order:800,enabled:!0,fn:function(t){if(!qt(t.instance.modifiers,"hide","preventOverflow"))return t;var e=t.offsets.reference,n=Nt(t.instance.modifiers,(function(t){return"preventOverflow"===t.name})).boundaries;if(e.bottomn.right||e.top>n.bottom||e.right2&&void 0!==arguments[2]?arguments[2]:{};ut(this,t),this.scheduleUpdate=function(){return requestAnimationFrame(i.update)},this.update=Y(this.update.bind(this)),this.options=ct({},t.Defaults,o),this.state={isDestroyed:!1,isCreated:!1,scrollParents:[]},this.reference=e&&e.jquery?e[0]:e,this.popper=n&&n.jquery?n[0]:n,this.options.modifiers={},Object.keys(ct({},t.Defaults.modifiers,o.modifiers)).forEach((function(e){i.options.modifiers[e]=ct({},t.Defaults.modifiers[e]||{},o.modifiers?o.modifiers[e]:{})})),this.modifiers=Object.keys(this.options.modifiers).map((function(t){return ct({name:t},i.options.modifiers[t])})).sort((function(t,e){return t.order-e.order})),this.modifiers.forEach((function(t){t.enabled&&z(t.onLoad)&&t.onLoad(i.reference,i.popper,i.options,t,i.state)})),this.update();var r=this.options.eventsEnabled;r&&this.enableEventListeners(),this.state.eventsEnabled=r}return ft(t,[{key:"update",value:function(){return At.call(this)}},{key:"destroy",value:function(){return Ot.call(this)}},{key:"enableEventListeners",value:function(){return Pt.call(this)}},{key:"disableEventListeners",value:function(){return Ft.call(this)}}]),t}();Vt.Utils=("undefined"!=typeof window?window:global).PopperUtils,Vt.placements=Bt,Vt.Defaults=Ut;var Yt=Vt,zt="dropdown",Kt="bs.dropdown",Xt=i.default.fn[zt],Gt=new RegExp("38|40|27"),$t="disabled",Jt="show",Zt="dropdown-menu-right",te="hide.bs.dropdown",ee="hidden.bs.dropdown",ne="click.bs.dropdown.data-api",ie="keydown.bs.dropdown.data-api",oe='[data-toggle="dropdown"]',re=".dropdown-menu",ae={offset:0,flip:!0,boundary:"scrollParent",reference:"toggle",display:"dynamic",popperConfig:null},se={offset:"(number|string|function)",flip:"boolean",boundary:"(string|element)",reference:"(string|element)",display:"string",popperConfig:"(null|object)"},le=function(){function t(t,e){this._element=t,this._popper=null,this._config=this._getConfig(e),this._menu=this._getMenuElement(),this._inNavbar=this._detectNavbar(),this._addEventListeners()}var e=t.prototype;return e.toggle=function(){if(!this._element.disabled&&!i.default(this._element).hasClass($t)){var e=i.default(this._menu).hasClass(Jt);t._clearMenus(),e||this.show(!0)}},e.show=function(e){if(void 0===e&&(e=!1),!(this._element.disabled||i.default(this._element).hasClass($t)||i.default(this._menu).hasClass(Jt))){var n={relatedTarget:this._element},o=i.default.Event("show.bs.dropdown",n),r=t._getParentFromElement(this._element);if(i.default(r).trigger(o),!o.isDefaultPrevented()){if(!this._inNavbar&&e){if("undefined"==typeof Yt)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var a=this._element;"parent"===this._config.reference?a=r:u.isElement(this._config.reference)&&(a=this._config.reference,"undefined"!=typeof this._config.reference.jquery&&(a=this._config.reference[0])),"scrollParent"!==this._config.boundary&&i.default(r).addClass("position-static"),this._popper=new Yt(a,this._menu,this._getPopperConfig())}"ontouchstart"in document.documentElement&&0===i.default(r).closest(".navbar-nav").length&&i.default(document.body).children().on("mouseover",null,i.default.noop),this._element.focus(),this._element.setAttribute("aria-expanded",!0),i.default(this._menu).toggleClass(Jt),i.default(r).toggleClass(Jt).trigger(i.default.Event("shown.bs.dropdown",n))}}},e.hide=function(){if(!this._element.disabled&&!i.default(this._element).hasClass($t)&&i.default(this._menu).hasClass(Jt)){var e={relatedTarget:this._element},n=i.default.Event(te,e),o=t._getParentFromElement(this._element);i.default(o).trigger(n),n.isDefaultPrevented()||(this._popper&&this._popper.destroy(),i.default(this._menu).toggleClass(Jt),i.default(o).toggleClass(Jt).trigger(i.default.Event(ee,e)))}},e.dispose=function(){i.default.removeData(this._element,Kt),i.default(this._element).off(".bs.dropdown"),this._element=null,this._menu=null,null!==this._popper&&(this._popper.destroy(),this._popper=null)},e.update=function(){this._inNavbar=this._detectNavbar(),null!==this._popper&&this._popper.scheduleUpdate()},e._addEventListeners=function(){var t=this;i.default(this._element).on("click.bs.dropdown",(function(e){e.preventDefault(),e.stopPropagation(),t.toggle()}))},e._getConfig=function(t){return t=a({},this.constructor.Default,i.default(this._element).data(),t),u.typeCheckConfig(zt,t,this.constructor.DefaultType),t},e._getMenuElement=function(){if(!this._menu){var e=t._getParentFromElement(this._element);e&&(this._menu=e.querySelector(re))}return this._menu},e._getPlacement=function(){var t=i.default(this._element.parentNode),e="bottom-start";return t.hasClass("dropup")?e=i.default(this._menu).hasClass(Zt)?"top-end":"top-start":t.hasClass("dropright")?e="right-start":t.hasClass("dropleft")?e="left-start":i.default(this._menu).hasClass(Zt)&&(e="bottom-end"),e},e._detectNavbar=function(){return i.default(this._element).closest(".navbar").length>0},e._getOffset=function(){var t=this,e={};return"function"==typeof this._config.offset?e.fn=function(e){return e.offsets=a({},e.offsets,t._config.offset(e.offsets,t._element)),e}:e.offset=this._config.offset,e},e._getPopperConfig=function(){var t={placement:this._getPlacement(),modifiers:{offset:this._getOffset(),flip:{enabled:this._config.flip},preventOverflow:{boundariesElement:this._config.boundary}}};return"static"===this._config.display&&(t.modifiers.applyStyle={enabled:!1}),a({},t,this._config.popperConfig)},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this).data(Kt);if(n||(n=new t(this,"object"==typeof e?e:null),i.default(this).data(Kt,n)),"string"==typeof e){if("undefined"==typeof n[e])throw new TypeError('No method named "'+e+'"');n[e]()}}))},t._clearMenus=function(e){if(!e||3!==e.which&&("keyup"!==e.type||9===e.which))for(var n=[].slice.call(document.querySelectorAll(oe)),o=0,r=n.length;o0&&a--,40===e.which&&adocument.documentElement.clientHeight;n||(this._element.style.overflowY="hidden"),this._element.classList.add(pe);var o=u.getTransitionDurationFromElement(this._dialog);i.default(this._element).off(u.TRANSITION_END),i.default(this._element).one(u.TRANSITION_END,(function(){t._element.classList.remove(pe),n||i.default(t._element).one(u.TRANSITION_END,(function(){t._element.style.overflowY=""})).emulateTransitionEnd(t._element,o)})).emulateTransitionEnd(o),this._element.focus()}},e._showElement=function(t){var e=this,n=i.default(this._element).hasClass(ce),o=this._dialog?this._dialog.querySelector(".modal-body"):null;this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.appendChild(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),i.default(this._dialog).hasClass("modal-dialog-scrollable")&&o?o.scrollTop=0:this._element.scrollTop=0,n&&u.reflow(this._element),i.default(this._element).addClass(he),this._config.focus&&this._enforceFocus();var r=i.default.Event("shown.bs.modal",{relatedTarget:t}),a=function(){e._config.focus&&e._element.focus(),e._isTransitioning=!1,i.default(e._element).trigger(r)};if(n){var s=u.getTransitionDurationFromElement(this._dialog);i.default(this._dialog).one(u.TRANSITION_END,a).emulateTransitionEnd(s)}else a()},e._enforceFocus=function(){var t=this;i.default(document).off(_e).on(_e,(function(e){document!==e.target&&t._element!==e.target&&0===i.default(t._element).has(e.target).length&&t._element.focus()}))},e._setEscapeEvent=function(){var t=this;this._isShown?i.default(this._element).on(ye,(function(e){t._config.keyboard&&27===e.which?(e.preventDefault(),t.hide()):t._config.keyboard||27!==e.which||t._triggerBackdropTransition()})):this._isShown||i.default(this._element).off(ye)},e._setResizeEvent=function(){var t=this;this._isShown?i.default(window).on(ve,(function(e){return t.handleUpdate(e)})):i.default(window).off(ve)},e._hideModal=function(){var t=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._showBackdrop((function(){i.default(document.body).removeClass(de),t._resetAdjustments(),t._resetScrollbar(),i.default(t._element).trigger(me)}))},e._removeBackdrop=function(){this._backdrop&&(i.default(this._backdrop).remove(),this._backdrop=null)},e._showBackdrop=function(t){var e=this,n=i.default(this._element).hasClass(ce)?ce:"";if(this._isShown&&this._config.backdrop){if(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",n&&this._backdrop.classList.add(n),i.default(this._backdrop).appendTo(document.body),i.default(this._element).on(be,(function(t){e._ignoreBackdropClick?e._ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"===e._config.backdrop?e._triggerBackdropTransition():e.hide())})),n&&u.reflow(this._backdrop),i.default(this._backdrop).addClass(he),!t)return;if(!n)return void t();var o=u.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(u.TRANSITION_END,t).emulateTransitionEnd(o)}else if(!this._isShown&&this._backdrop){i.default(this._backdrop).removeClass(he);var r=function(){e._removeBackdrop(),t&&t()};if(i.default(this._element).hasClass(ce)){var a=u.getTransitionDurationFromElement(this._backdrop);i.default(this._backdrop).one(u.TRANSITION_END,r).emulateTransitionEnd(a)}else r()}else t&&t()},e._adjustDialog=function(){var t=this._element.scrollHeight>document.documentElement.clientHeight;!this._isBodyOverflowing&&t&&(this._element.style.paddingLeft=this._scrollbarWidth+"px"),this._isBodyOverflowing&&!t&&(this._element.style.paddingRight=this._scrollbarWidth+"px")},e._resetAdjustments=function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""},e._checkScrollbar=function(){var t=document.body.getBoundingClientRect();this._isBodyOverflowing=Math.round(t.left+t.right)
',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:0,container:!1,fallbackPlacement:"flip",boundary:"scrollParent",customClass:"",sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},We={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(number|string|function)",container:"(string|element|boolean)",fallbackPlacement:"(string|array)",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",whiteList:"object",popperConfig:"(null|object)"},Ue={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},Ve=function(){function t(t,e){if("undefined"==typeof Yt)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this.element=t,this.config=this._getConfig(e),this.tip=null,this._setListeners()}var e=t.prototype;return e.enable=function(){this._isEnabled=!0},e.disable=function(){this._isEnabled=!1},e.toggleEnabled=function(){this._isEnabled=!this._isEnabled},e.toggle=function(t){if(this._isEnabled)if(t){var e=this.constructor.DATA_KEY,n=i.default(t.currentTarget).data(e);n||(n=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(e,n)),n._activeTrigger.click=!n._activeTrigger.click,n._isWithActiveTrigger()?n._enter(null,n):n._leave(null,n)}else{if(i.default(this.getTipElement()).hasClass(Fe))return void this._leave(null,this);this._enter(null,this)}},e.dispose=function(){clearTimeout(this._timeout),i.default.removeData(this.element,this.constructor.DATA_KEY),i.default(this.element).off(this.constructor.EVENT_KEY),i.default(this.element).closest(".modal").off("hide.bs.modal",this._hideModalHandler),this.tip&&i.default(this.tip).remove(),this._isEnabled=null,this._timeout=null,this._hoverState=null,this._activeTrigger=null,this._popper&&this._popper.destroy(),this._popper=null,this.element=null,this.config=null,this.tip=null},e.show=function(){var t=this;if("none"===i.default(this.element).css("display"))throw new Error("Please use show on visible elements");var e=i.default.Event(this.constructor.Event.SHOW);if(this.isWithContent()&&this._isEnabled){i.default(this.element).trigger(e);var n=u.findShadowRoot(this.element),o=i.default.contains(null!==n?n:this.element.ownerDocument.documentElement,this.element);if(e.isDefaultPrevented()||!o)return;var r=this.getTipElement(),a=u.getUID(this.constructor.NAME);r.setAttribute("id",a),this.element.setAttribute("aria-describedby",a),this.setContent(),this.config.animation&&i.default(r).addClass(Pe);var s="function"==typeof this.config.placement?this.config.placement.call(this,r,this.element):this.config.placement,l=this._getAttachment(s);this.addAttachmentClass(l);var f=this._getContainer();i.default(r).data(this.constructor.DATA_KEY,this),i.default.contains(this.element.ownerDocument.documentElement,this.tip)||i.default(r).appendTo(f),i.default(this.element).trigger(this.constructor.Event.INSERTED),this._popper=new Yt(this.element,r,this._getPopperConfig(l)),i.default(r).addClass(Fe),i.default(r).addClass(this.config.customClass),"ontouchstart"in document.documentElement&&i.default(document.body).children().on("mouseover",null,i.default.noop);var d=function(){t.config.animation&&t._fixTransition();var e=t._hoverState;t._hoverState=null,i.default(t.element).trigger(t.constructor.Event.SHOWN),e===He&&t._leave(null,t)};if(i.default(this.tip).hasClass(Pe)){var c=u.getTransitionDurationFromElement(this.tip);i.default(this.tip).one(u.TRANSITION_END,d).emulateTransitionEnd(c)}else d()}},e.hide=function(t){var e=this,n=this.getTipElement(),o=i.default.Event(this.constructor.Event.HIDE),r=function(){e._hoverState!==Re&&n.parentNode&&n.parentNode.removeChild(n),e._cleanTipClass(),e.element.removeAttribute("aria-describedby"),i.default(e.element).trigger(e.constructor.Event.HIDDEN),null!==e._popper&&e._popper.destroy(),t&&t()};if(i.default(this.element).trigger(o),!o.isDefaultPrevented()){if(i.default(n).removeClass(Fe),"ontouchstart"in document.documentElement&&i.default(document.body).children().off("mouseover",null,i.default.noop),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,i.default(this.tip).hasClass(Pe)){var a=u.getTransitionDurationFromElement(n);i.default(n).one(u.TRANSITION_END,r).emulateTransitionEnd(a)}else r();this._hoverState=""}},e.update=function(){null!==this._popper&&this._popper.scheduleUpdate()},e.isWithContent=function(){return Boolean(this.getTitle())},e.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass("bs-tooltip-"+t)},e.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},e.setContent=function(){var t=this.getTipElement();this.setElementContent(i.default(t.querySelectorAll(".tooltip-inner")),this.getTitle()),i.default(t).removeClass("fade show")},e.setElementContent=function(t,e){"object"!=typeof e||!e.nodeType&&!e.jquery?this.config.html?(this.config.sanitize&&(e=ke(e,this.config.whiteList,this.config.sanitizeFn)),t.html(e)):t.text(e):this.config.html?i.default(e).parent().is(t)||t.empty().append(e):t.text(i.default(e).text())},e.getTitle=function(){var t=this.element.getAttribute("data-original-title");return t||(t="function"==typeof this.config.title?this.config.title.call(this.element):this.config.title),t},e._getPopperConfig=function(t){var e=this;return a({},{placement:t,modifiers:{offset:this._getOffset(),flip:{behavior:this.config.fallbackPlacement},arrow:{element:".arrow"},preventOverflow:{boundariesElement:this.config.boundary}},onCreate:function(t){t.originalPlacement!==t.placement&&e._handlePopperPlacementChange(t)},onUpdate:function(t){return e._handlePopperPlacementChange(t)}},this.config.popperConfig)},e._getOffset=function(){var t=this,e={};return"function"==typeof this.config.offset?e.fn=function(e){return e.offsets=a({},e.offsets,t.config.offset(e.offsets,t.element)),e}:e.offset=this.config.offset,e},e._getContainer=function(){return!1===this.config.container?document.body:u.isElement(this.config.container)?i.default(this.config.container):i.default(document).find(this.config.container)},e._getAttachment=function(t){return Be[t.toUpperCase()]},e._setListeners=function(){var t=this;this.config.trigger.split(" ").forEach((function(e){if("click"===e)i.default(t.element).on(t.constructor.Event.CLICK,t.config.selector,(function(e){return t.toggle(e)}));else if("manual"!==e){var n=e===Me?t.constructor.Event.MOUSEENTER:t.constructor.Event.FOCUSIN,o=e===Me?t.constructor.Event.MOUSELEAVE:t.constructor.Event.FOCUSOUT;i.default(t.element).on(n,t.config.selector,(function(e){return t._enter(e)})).on(o,t.config.selector,(function(e){return t._leave(e)}))}})),this._hideModalHandler=function(){t.element&&t.hide()},i.default(this.element).closest(".modal").on("hide.bs.modal",this._hideModalHandler),this.config.selector?this.config=a({},this.config,{trigger:"manual",selector:""}):this._fixTitle()},e._fixTitle=function(){var t=typeof this.element.getAttribute("data-original-title");(this.element.getAttribute("title")||"string"!==t)&&(this.element.setAttribute("data-original-title",this.element.getAttribute("title")||""),this.element.setAttribute("title",""))},e._enter=function(t,e){var n=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusin"===t.type?qe:Me]=!0),i.default(e.getTipElement()).hasClass(Fe)||e._hoverState===Re?e._hoverState=Re:(clearTimeout(e._timeout),e._hoverState=Re,e.config.delay&&e.config.delay.show?e._timeout=setTimeout((function(){e._hoverState===Re&&e.show()}),e.config.delay.show):e.show())},e._leave=function(t,e){var n=this.constructor.DATA_KEY;(e=e||i.default(t.currentTarget).data(n))||(e=new this.constructor(t.currentTarget,this._getDelegateConfig()),i.default(t.currentTarget).data(n,e)),t&&(e._activeTrigger["focusout"===t.type?qe:Me]=!1),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=He,e.config.delay&&e.config.delay.hide?e._timeout=setTimeout((function(){e._hoverState===He&&e.hide()}),e.config.delay.hide):e.hide())},e._isWithActiveTrigger=function(){for(var t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1},e._getConfig=function(t){var e=i.default(this.element).data();return Object.keys(e).forEach((function(t){-1!==Le.indexOf(t)&&delete e[t]})),"number"==typeof(t=a({},this.constructor.Default,e,"object"==typeof t&&t?t:{})).delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),u.typeCheckConfig(Ie,t,this.constructor.DefaultType),t.sanitize&&(t.template=ke(t.template,t.whiteList,t.sanitizeFn)),t},e._getDelegateConfig=function(){var t={};if(this.config)for(var e in this.config)this.constructor.Default[e]!==this.config[e]&&(t[e]=this.config[e]);return t},e._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(je);null!==e&&e.length&&t.removeClass(e.join(""))},e._handlePopperPlacementChange=function(t){this.tip=t.instance.popper,this._cleanTipClass(),this.addAttachmentClass(this._getAttachment(t.placement))},e._fixTransition=function(){var t=this.getTipElement(),e=this.config.animation;null===t.getAttribute("x-placement")&&(i.default(t).removeClass(Pe),this.config.animation=!1,this.hide(),this.show(),this.config.animation=e)},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(Oe),r="object"==typeof e&&e;if((o||!/dispose|hide/.test(e))&&(o||(o=new t(this,r),n.data(Oe,o)),"string"==typeof e)){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return Qe}},{key:"NAME",get:function(){return Ie}},{key:"DATA_KEY",get:function(){return Oe}},{key:"Event",get:function(){return Ue}},{key:"EVENT_KEY",get:function(){return".bs.tooltip"}},{key:"DefaultType",get:function(){return We}}]),t}();i.default.fn.tooltip=Ve._jQueryInterface,i.default.fn.tooltip.Constructor=Ve,i.default.fn.tooltip.noConflict=function(){return i.default.fn.tooltip=xe,Ve._jQueryInterface};var Ye="bs.popover",ze=i.default.fn.popover,Ke=new RegExp("(^|\\s)bs-popover\\S+","g"),Xe=a({},Ve.Default,{placement:"right",trigger:"click",content:"",template:''}),Ge=a({},Ve.DefaultType,{content:"(string|element|function)"}),$e={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"},Je=function(t){var e,n;function o(){return t.apply(this,arguments)||this}n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,s(e,n);var a=o.prototype;return a.isWithContent=function(){return this.getTitle()||this._getContent()},a.addAttachmentClass=function(t){i.default(this.getTipElement()).addClass("bs-popover-"+t)},a.getTipElement=function(){return this.tip=this.tip||i.default(this.config.template)[0],this.tip},a.setContent=function(){var t=i.default(this.getTipElement());this.setElementContent(t.find(".popover-header"),this.getTitle());var e=this._getContent();"function"==typeof e&&(e=e.call(this.element)),this.setElementContent(t.find(".popover-body"),e),t.removeClass("fade show")},a._getContent=function(){return this.element.getAttribute("data-content")||this.config.content},a._cleanTipClass=function(){var t=i.default(this.getTipElement()),e=t.attr("class").match(Ke);null!==e&&e.length>0&&t.removeClass(e.join(""))},o._jQueryInterface=function(t){return this.each((function(){var e=i.default(this).data(Ye),n="object"==typeof t?t:null;if((e||!/dispose|hide/.test(t))&&(e||(e=new o(this,n),i.default(this).data(Ye,e)),"string"==typeof t)){if("undefined"==typeof e[t])throw new TypeError('No method named "'+t+'"');e[t]()}}))},r(o,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"Default",get:function(){return Xe}},{key:"NAME",get:function(){return"popover"}},{key:"DATA_KEY",get:function(){return Ye}},{key:"Event",get:function(){return $e}},{key:"EVENT_KEY",get:function(){return".bs.popover"}},{key:"DefaultType",get:function(){return Ge}}]),o}(Ve);i.default.fn.popover=Je._jQueryInterface,i.default.fn.popover.Constructor=Je,i.default.fn.popover.noConflict=function(){return i.default.fn.popover=ze,Je._jQueryInterface};var Ze="scrollspy",tn="bs.scrollspy",en=i.default.fn[Ze],nn="active",on="position",rn=".nav, .list-group",an={offset:10,method:"auto",target:""},sn={offset:"number",method:"string",target:"(string|element)"},ln=function(){function t(t,e){var n=this;this._element=t,this._scrollElement="BODY"===t.tagName?window:t,this._config=this._getConfig(e),this._selector=this._config.target+" .nav-link,"+this._config.target+" .list-group-item,"+this._config.target+" .dropdown-item",this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,i.default(this._scrollElement).on("scroll.bs.scrollspy",(function(t){return n._process(t)})),this.refresh(),this._process()}var e=t.prototype;return e.refresh=function(){var t=this,e=this._scrollElement===this._scrollElement.window?"offset":on,n="auto"===this._config.method?e:this._config.method,o=n===on?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),[].slice.call(document.querySelectorAll(this._selector)).map((function(t){var e,r=u.getSelectorFromElement(t);if(r&&(e=document.querySelector(r)),e){var a=e.getBoundingClientRect();if(a.width||a.height)return[i.default(e)[n]().top+o,r]}return null})).filter((function(t){return t})).sort((function(t,e){return t[0]-e[0]})).forEach((function(e){t._offsets.push(e[0]),t._targets.push(e[1])}))},e.dispose=function(){i.default.removeData(this._element,tn),i.default(this._scrollElement).off(".bs.scrollspy"),this._element=null,this._scrollElement=null,this._config=null,this._selector=null,this._offsets=null,this._targets=null,this._activeTarget=null,this._scrollHeight=null},e._getConfig=function(t){if("string"!=typeof(t=a({},an,"object"==typeof t&&t?t:{})).target&&u.isElement(t.target)){var e=i.default(t.target).attr("id");e||(e=u.getUID(Ze),i.default(t.target).attr("id",e)),t.target="#"+e}return u.typeCheckConfig(Ze,t,sn),t},e._getScrollTop=function(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop},e._getScrollHeight=function(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)},e._getOffsetHeight=function(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height},e._process=function(){var t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),n=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=n){var i=this._targets[this._targets.length-1];this._activeTarget!==i&&this._activate(i)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(var o=this._offsets.length;o--;)this._activeTarget!==this._targets[o]&&t>=this._offsets[o]&&("undefined"==typeof this._offsets[o+1]||t li > .active",gn=function(){function t(t){this._element=t}var e=t.prototype;return e.show=function(){var t=this;if(!(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&i.default(this._element).hasClass(dn)||i.default(this._element).hasClass("disabled"))){var e,n,o=i.default(this._element).closest(".nav, .list-group")[0],r=u.getSelectorFromElement(this._element);if(o){var a="UL"===o.nodeName||"OL"===o.nodeName?mn:pn;n=(n=i.default.makeArray(i.default(o).find(a)))[n.length-1]}var s=i.default.Event("hide.bs.tab",{relatedTarget:this._element}),l=i.default.Event("show.bs.tab",{relatedTarget:n});if(n&&i.default(n).trigger(s),i.default(this._element).trigger(l),!l.isDefaultPrevented()&&!s.isDefaultPrevented()){r&&(e=document.querySelector(r)),this._activate(this._element,o);var f=function(){var e=i.default.Event("hidden.bs.tab",{relatedTarget:t._element}),o=i.default.Event("shown.bs.tab",{relatedTarget:n});i.default(n).trigger(e),i.default(t._element).trigger(o)};e?this._activate(e,e.parentNode,f):f()}}},e.dispose=function(){i.default.removeData(this._element,un),this._element=null},e._activate=function(t,e,n){var o=this,r=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?i.default(e).children(pn):i.default(e).find(mn))[0],a=n&&r&&i.default(r).hasClass(cn),s=function(){return o._transitionComplete(t,r,n)};if(r&&a){var l=u.getTransitionDurationFromElement(r);i.default(r).removeClass(hn).one(u.TRANSITION_END,s).emulateTransitionEnd(l)}else s()},e._transitionComplete=function(t,e,n){if(e){i.default(e).removeClass(dn);var o=i.default(e.parentNode).find("> .dropdown-menu .active")[0];o&&i.default(o).removeClass(dn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}i.default(t).addClass(dn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),u.reflow(t),t.classList.contains(cn)&&t.classList.add(hn);var r=t.parentNode;if(r&&"LI"===r.nodeName&&(r=r.parentNode),r&&i.default(r).hasClass("dropdown-menu")){var a=i.default(t).closest(".dropdown")[0];if(a){var s=[].slice.call(a.querySelectorAll(".dropdown-toggle"));i.default(s).addClass(dn)}t.setAttribute("aria-expanded",!0)}n&&n()},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(un);if(o||(o=new t(this),n.data(un,o)),"string"==typeof e){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e]()}}))},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}}]),t}();i.default(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',(function(t){t.preventDefault(),gn._jQueryInterface.call(i.default(this),"show")})),i.default.fn.tab=gn._jQueryInterface,i.default.fn.tab.Constructor=gn,i.default.fn.tab.noConflict=function(){return i.default.fn.tab=fn,gn._jQueryInterface};var _n="bs.toast",vn=i.default.fn.toast,bn="hide",yn="show",En="showing",wn="click.dismiss.bs.toast",Tn={animation:!0,autohide:!0,delay:500},Cn={animation:"boolean",autohide:"boolean",delay:"number"},Sn=function(){function t(t,e){this._element=t,this._config=this._getConfig(e),this._timeout=null,this._setListeners()}var e=t.prototype;return e.show=function(){var t=this,e=i.default.Event("show.bs.toast");if(i.default(this._element).trigger(e),!e.isDefaultPrevented()){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");var n=function(){t._element.classList.remove(En),t._element.classList.add(yn),i.default(t._element).trigger("shown.bs.toast"),t._config.autohide&&(t._timeout=setTimeout((function(){t.hide()}),t._config.delay))};if(this._element.classList.remove(bn),u.reflow(this._element),this._element.classList.add(En),this._config.animation){var o=u.getTransitionDurationFromElement(this._element);i.default(this._element).one(u.TRANSITION_END,n).emulateTransitionEnd(o)}else n()}},e.hide=function(){if(this._element.classList.contains(yn)){var t=i.default.Event("hide.bs.toast");i.default(this._element).trigger(t),t.isDefaultPrevented()||this._close()}},e.dispose=function(){this._clearTimeout(),this._element.classList.contains(yn)&&this._element.classList.remove(yn),i.default(this._element).off(wn),i.default.removeData(this._element,_n),this._element=null,this._config=null},e._getConfig=function(t){return t=a({},Tn,i.default(this._element).data(),"object"==typeof t&&t?t:{}),u.typeCheckConfig("toast",t,this.constructor.DefaultType),t},e._setListeners=function(){var t=this;i.default(this._element).on(wn,'[data-dismiss="toast"]',(function(){return t.hide()}))},e._close=function(){var t=this,e=function(){t._element.classList.add(bn),i.default(t._element).trigger("hidden.bs.toast")};if(this._element.classList.remove(yn),this._config.animation){var n=u.getTransitionDurationFromElement(this._element);i.default(this._element).one(u.TRANSITION_END,e).emulateTransitionEnd(n)}else e()},e._clearTimeout=function(){clearTimeout(this._timeout),this._timeout=null},t._jQueryInterface=function(e){return this.each((function(){var n=i.default(this),o=n.data(_n);if(o||(o=new t(this,"object"==typeof e&&e),n.data(_n,o)),"string"==typeof e){if("undefined"==typeof o[e])throw new TypeError('No method named "'+e+'"');o[e](this)}}))},r(t,null,[{key:"VERSION",get:function(){return"4.6.1"}},{key:"DefaultType",get:function(){return Cn}},{key:"Default",get:function(){return Tn}}]),t}();i.default.fn.toast=Sn._jQueryInterface,i.default.fn.toast.Constructor=Sn,i.default.fn.toast.noConflict=function(){return i.default.fn.toast=vn,Sn._jQueryInterface},t.Alert=c,t.Button=b,t.Carousel=O,t.Collapse=W,t.Dropdown=le,t.Modal=Se,t.Popover=Je,t.Scrollspy=ln,t.Tab=gn,t.Toast=Sn,t.Tooltip=Ve,t.Util=u,Object.defineProperty(t,"__esModule",{value:!0})})); +//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file diff --git a/tests/vendor/bootstrap-5.1.3.bundle.min.js b/tests/vendor/bootstrap-5.1.3.bundle.min.js new file mode 100644 index 00000000..cc0a2556 --- /dev/null +++ b/tests/vendor/bootstrap-5.1.3.bundle.min.js @@ -0,0 +1,7 @@ +/*! + * Bootstrap v5.1.3 (https://getbootstrap.com/) + * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).bootstrap=e()}(this,(function(){"use strict";const t="transitionend",e=t=>{let e=t.getAttribute("data-bs-target");if(!e||"#"===e){let i=t.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),e=i&&"#"!==i?i.trim():null}return e},i=t=>{const i=e(t);return i&&document.querySelector(i)?i:null},n=t=>{const i=e(t);return i?document.querySelector(i):null},s=e=>{e.dispatchEvent(new Event(t))},o=t=>!(!t||"object"!=typeof t)&&(void 0!==t.jquery&&(t=t[0]),void 0!==t.nodeType),r=t=>o(t)?t.jquery?t[0]:t:"string"==typeof t&&t.length>0?document.querySelector(t):null,a=(t,e,i)=>{Object.keys(i).forEach((n=>{const s=i[n],r=e[n],a=r&&o(r)?"element":null==(l=r)?`${l}`:{}.toString.call(l).match(/\s([a-z]+)/i)[1].toLowerCase();var l;if(!new RegExp(s).test(a))throw new TypeError(`${t.toUpperCase()}: Option "${n}" provided type "${a}" but expected type "${s}".`)}))},l=t=>!(!o(t)||0===t.getClientRects().length)&&"visible"===getComputedStyle(t).getPropertyValue("visibility"),c=t=>!t||t.nodeType!==Node.ELEMENT_NODE||!!t.classList.contains("disabled")||(void 0!==t.disabled?t.disabled:t.hasAttribute("disabled")&&"false"!==t.getAttribute("disabled")),h=t=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){const e=t.getRootNode();return e instanceof ShadowRoot?e:null}return t instanceof ShadowRoot?t:t.parentNode?h(t.parentNode):null},d=()=>{},u=t=>{t.offsetHeight},f=()=>{const{jQuery:t}=window;return t&&!document.body.hasAttribute("data-bs-no-jquery")?t:null},p=[],m=()=>"rtl"===document.documentElement.dir,g=t=>{var e;e=()=>{const e=f();if(e){const i=t.NAME,n=e.fn[i];e.fn[i]=t.jQueryInterface,e.fn[i].Constructor=t,e.fn[i].noConflict=()=>(e.fn[i]=n,t.jQueryInterface)}},"loading"===document.readyState?(p.length||document.addEventListener("DOMContentLoaded",(()=>{p.forEach((t=>t()))})),p.push(e)):e()},_=t=>{"function"==typeof t&&t()},b=(e,i,n=!0)=>{if(!n)return void _(e);const o=(t=>{if(!t)return 0;let{transitionDuration:e,transitionDelay:i}=window.getComputedStyle(t);const n=Number.parseFloat(e),s=Number.parseFloat(i);return n||s?(e=e.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(e)+Number.parseFloat(i))):0})(i)+5;let r=!1;const a=({target:n})=>{n===i&&(r=!0,i.removeEventListener(t,a),_(e))};i.addEventListener(t,a),setTimeout((()=>{r||s(i)}),o)},v=(t,e,i,n)=>{let s=t.indexOf(e);if(-1===s)return t[!i&&n?t.length-1:0];const o=t.length;return s+=i?1:-1,n&&(s=(s+o)%o),t[Math.max(0,Math.min(s,o-1))]},y=/[^.]*(?=\..*)\.|.*/,w=/\..*/,E=/::\d+$/,A={};let T=1;const O={mouseenter:"mouseover",mouseleave:"mouseout"},C=/^(mouseenter|mouseleave)/i,k=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"]);function L(t,e){return e&&`${e}::${T++}`||t.uidEvent||T++}function x(t){const e=L(t);return t.uidEvent=e,A[e]=A[e]||{},A[e]}function D(t,e,i=null){const n=Object.keys(t);for(let s=0,o=n.length;sfunction(e){if(!e.relatedTarget||e.relatedTarget!==e.delegateTarget&&!e.delegateTarget.contains(e.relatedTarget))return t.call(this,e)};n?n=t(n):i=t(i)}const[o,r,a]=S(e,i,n),l=x(t),c=l[a]||(l[a]={}),h=D(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=L(r,e.replace(y,"")),u=o?function(t,e,i){return function n(s){const o=t.querySelectorAll(e);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(let a=o.length;a--;)if(o[a]===r)return s.delegateTarget=r,n.oneOff&&j.off(t,s.type,e,i),i.apply(r,[s]);return null}}(t,i,n):function(t,e){return function i(n){return n.delegateTarget=t,i.oneOff&&j.off(t,n.type,e),e.apply(t,[n])}}(t,i);u.delegationSelector=o?i:null,u.originalHandler=r,u.oneOff=s,u.uidEvent=d,c[d]=u,t.addEventListener(a,u,o)}function I(t,e,i,n,s){const o=D(e[i],n,s);o&&(t.removeEventListener(i,o,Boolean(s)),delete e[i][o.uidEvent])}function P(t){return t=t.replace(w,""),O[t]||t}const j={on(t,e,i,n){N(t,e,i,n,!1)},one(t,e,i,n){N(t,e,i,n,!0)},off(t,e,i,n){if("string"!=typeof e||!t)return;const[s,o,r]=S(e,i,n),a=r!==e,l=x(t),c=e.startsWith(".");if(void 0!==o){if(!l||!l[r])return;return void I(t,l,r,o,s?i:null)}c&&Object.keys(l).forEach((i=>{!function(t,e,i,n){const s=e[i]||{};Object.keys(s).forEach((o=>{if(o.includes(n)){const n=s[o];I(t,e,i,n.originalHandler,n.delegationSelector)}}))}(t,l,i,e.slice(1))}));const h=l[r]||{};Object.keys(h).forEach((i=>{const n=i.replace(E,"");if(!a||e.includes(n)){const e=h[i];I(t,l,r,e.originalHandler,e.delegationSelector)}}))},trigger(t,e,i){if("string"!=typeof e||!t)return null;const n=f(),s=P(e),o=e!==s,r=k.has(s);let a,l=!0,c=!0,h=!1,d=null;return o&&n&&(a=n.Event(e,i),n(t).trigger(a),l=!a.isPropagationStopped(),c=!a.isImmediatePropagationStopped(),h=a.isDefaultPrevented()),r?(d=document.createEvent("HTMLEvents"),d.initEvent(s,l,!0)):d=new CustomEvent(e,{bubbles:l,cancelable:!0}),void 0!==i&&Object.keys(i).forEach((t=>{Object.defineProperty(d,t,{get:()=>i[t]})})),h&&d.preventDefault(),c&&t.dispatchEvent(d),d.defaultPrevented&&void 0!==a&&a.preventDefault(),d}},M=new Map,H={set(t,e,i){M.has(t)||M.set(t,new Map);const n=M.get(t);n.has(e)||0===n.size?n.set(e,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(t,e)=>M.has(t)&&M.get(t).get(e)||null,remove(t,e){if(!M.has(t))return;const i=M.get(t);i.delete(e),0===i.size&&M.delete(t)}};class B{constructor(t){(t=r(t))&&(this._element=t,H.set(this._element,this.constructor.DATA_KEY,this))}dispose(){H.remove(this._element,this.constructor.DATA_KEY),j.off(this._element,this.constructor.EVENT_KEY),Object.getOwnPropertyNames(this).forEach((t=>{this[t]=null}))}_queueCallback(t,e,i=!0){b(t,e,i)}static getInstance(t){return H.get(r(t),this.DATA_KEY)}static getOrCreateInstance(t,e={}){return this.getInstance(t)||new this(t,"object"==typeof e?e:null)}static get VERSION(){return"5.1.3"}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}}const R=(t,e="hide")=>{const i=`click.dismiss${t.EVENT_KEY}`,s=t.NAME;j.on(document,i,`[data-bs-dismiss="${s}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),c(this))return;const o=n(this)||this.closest(`.${s}`);t.getOrCreateInstance(o)[e]()}))};class W extends B{static get NAME(){return"alert"}close(){if(j.trigger(this._element,"close.bs.alert").defaultPrevented)return;this._element.classList.remove("show");const t=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,t)}_destroyElement(){this._element.remove(),j.trigger(this._element,"closed.bs.alert"),this.dispose()}static jQueryInterface(t){return this.each((function(){const e=W.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}R(W,"close"),g(W);const $='[data-bs-toggle="button"]';class z extends B{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(t){return this.each((function(){const e=z.getOrCreateInstance(this);"toggle"===t&&e[t]()}))}}function q(t){return"true"===t||"false"!==t&&(t===Number(t).toString()?Number(t):""===t||"null"===t?null:t)}function F(t){return t.replace(/[A-Z]/g,(t=>`-${t.toLowerCase()}`))}j.on(document,"click.bs.button.data-api",$,(t=>{t.preventDefault();const e=t.target.closest($);z.getOrCreateInstance(e).toggle()})),g(z);const U={setDataAttribute(t,e,i){t.setAttribute(`data-bs-${F(e)}`,i)},removeDataAttribute(t,e){t.removeAttribute(`data-bs-${F(e)}`)},getDataAttributes(t){if(!t)return{};const e={};return Object.keys(t.dataset).filter((t=>t.startsWith("bs"))).forEach((i=>{let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1,n.length),e[n]=q(t.dataset[i])})),e},getDataAttribute:(t,e)=>q(t.getAttribute(`data-bs-${F(e)}`)),offset(t){const e=t.getBoundingClientRect();return{top:e.top+window.pageYOffset,left:e.left+window.pageXOffset}},position:t=>({top:t.offsetTop,left:t.offsetLeft})},V={find:(t,e=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(e,t)),findOne:(t,e=document.documentElement)=>Element.prototype.querySelector.call(e,t),children:(t,e)=>[].concat(...t.children).filter((t=>t.matches(e))),parents(t,e){const i=[];let n=t.parentNode;for(;n&&n.nodeType===Node.ELEMENT_NODE&&3!==n.nodeType;)n.matches(e)&&i.push(n),n=n.parentNode;return i},prev(t,e){let i=t.previousElementSibling;for(;i;){if(i.matches(e))return[i];i=i.previousElementSibling}return[]},next(t,e){let i=t.nextElementSibling;for(;i;){if(i.matches(e))return[i];i=i.nextElementSibling}return[]},focusableChildren(t){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((t=>`${t}:not([tabindex^="-"])`)).join(", ");return this.find(e,t).filter((t=>!c(t)&&l(t)))}},K="carousel",X={interval:5e3,keyboard:!0,slide:!1,pause:"hover",wrap:!0,touch:!0},Y={interval:"(number|boolean)",keyboard:"boolean",slide:"(boolean|string)",pause:"(string|boolean)",wrap:"boolean",touch:"boolean"},Q="next",G="prev",Z="left",J="right",tt={ArrowLeft:J,ArrowRight:Z},et="slid.bs.carousel",it="active",nt=".active.carousel-item";class st extends B{constructor(t,e){super(t),this._items=null,this._interval=null,this._activeElement=null,this._isPaused=!1,this._isSliding=!1,this.touchTimeout=null,this.touchStartX=0,this.touchDeltaX=0,this._config=this._getConfig(e),this._indicatorsElement=V.findOne(".carousel-indicators",this._element),this._touchSupported="ontouchstart"in document.documentElement||navigator.maxTouchPoints>0,this._pointerEvent=Boolean(window.PointerEvent),this._addEventListeners()}static get Default(){return X}static get NAME(){return K}next(){this._slide(Q)}nextWhenVisible(){!document.hidden&&l(this._element)&&this.next()}prev(){this._slide(G)}pause(t){t||(this._isPaused=!0),V.findOne(".carousel-item-next, .carousel-item-prev",this._element)&&(s(this._element),this.cycle(!0)),clearInterval(this._interval),this._interval=null}cycle(t){t||(this._isPaused=!1),this._interval&&(clearInterval(this._interval),this._interval=null),this._config&&this._config.interval&&!this._isPaused&&(this._updateInterval(),this._interval=setInterval((document.visibilityState?this.nextWhenVisible:this.next).bind(this),this._config.interval))}to(t){this._activeElement=V.findOne(nt,this._element);const e=this._getItemIndex(this._activeElement);if(t>this._items.length-1||t<0)return;if(this._isSliding)return void j.one(this._element,et,(()=>this.to(t)));if(e===t)return this.pause(),void this.cycle();const i=t>e?Q:G;this._slide(i,this._items[t])}_getConfig(t){return t={...X,...U.getDataAttributes(this._element),..."object"==typeof t?t:{}},a(K,t,Y),t}_handleSwipe(){const t=Math.abs(this.touchDeltaX);if(t<=40)return;const e=t/this.touchDeltaX;this.touchDeltaX=0,e&&this._slide(e>0?J:Z)}_addEventListeners(){this._config.keyboard&&j.on(this._element,"keydown.bs.carousel",(t=>this._keydown(t))),"hover"===this._config.pause&&(j.on(this._element,"mouseenter.bs.carousel",(t=>this.pause(t))),j.on(this._element,"mouseleave.bs.carousel",(t=>this.cycle(t)))),this._config.touch&&this._touchSupported&&this._addTouchEventListeners()}_addTouchEventListeners(){const t=t=>this._pointerEvent&&("pen"===t.pointerType||"touch"===t.pointerType),e=e=>{t(e)?this.touchStartX=e.clientX:this._pointerEvent||(this.touchStartX=e.touches[0].clientX)},i=t=>{this.touchDeltaX=t.touches&&t.touches.length>1?0:t.touches[0].clientX-this.touchStartX},n=e=>{t(e)&&(this.touchDeltaX=e.clientX-this.touchStartX),this._handleSwipe(),"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((t=>this.cycle(t)),500+this._config.interval))};V.find(".carousel-item img",this._element).forEach((t=>{j.on(t,"dragstart.bs.carousel",(t=>t.preventDefault()))})),this._pointerEvent?(j.on(this._element,"pointerdown.bs.carousel",(t=>e(t))),j.on(this._element,"pointerup.bs.carousel",(t=>n(t))),this._element.classList.add("pointer-event")):(j.on(this._element,"touchstart.bs.carousel",(t=>e(t))),j.on(this._element,"touchmove.bs.carousel",(t=>i(t))),j.on(this._element,"touchend.bs.carousel",(t=>n(t))))}_keydown(t){if(/input|textarea/i.test(t.target.tagName))return;const e=tt[t.key];e&&(t.preventDefault(),this._slide(e))}_getItemIndex(t){return this._items=t&&t.parentNode?V.find(".carousel-item",t.parentNode):[],this._items.indexOf(t)}_getItemByOrder(t,e){const i=t===Q;return v(this._items,e,i,this._config.wrap)}_triggerSlideEvent(t,e){const i=this._getItemIndex(t),n=this._getItemIndex(V.findOne(nt,this._element));return j.trigger(this._element,"slide.bs.carousel",{relatedTarget:t,direction:e,from:n,to:i})}_setActiveIndicatorElement(t){if(this._indicatorsElement){const e=V.findOne(".active",this._indicatorsElement);e.classList.remove(it),e.removeAttribute("aria-current");const i=V.find("[data-bs-target]",this._indicatorsElement);for(let e=0;e{j.trigger(this._element,et,{relatedTarget:o,direction:d,from:s,to:r})};if(this._element.classList.contains("slide")){o.classList.add(h),u(o),n.classList.add(c),o.classList.add(c);const t=()=>{o.classList.remove(c,h),o.classList.add(it),n.classList.remove(it,h,c),this._isSliding=!1,setTimeout(f,0)};this._queueCallback(t,n,!0)}else n.classList.remove(it),o.classList.add(it),this._isSliding=!1,f();a&&this.cycle()}_directionToOrder(t){return[J,Z].includes(t)?m()?t===Z?G:Q:t===Z?Q:G:t}_orderToDirection(t){return[Q,G].includes(t)?m()?t===G?Z:J:t===G?J:Z:t}static carouselInterface(t,e){const i=st.getOrCreateInstance(t,e);let{_config:n}=i;"object"==typeof e&&(n={...n,...e});const s="string"==typeof e?e:n.slide;if("number"==typeof e)i.to(e);else if("string"==typeof s){if(void 0===i[s])throw new TypeError(`No method named "${s}"`);i[s]()}else n.interval&&n.ride&&(i.pause(),i.cycle())}static jQueryInterface(t){return this.each((function(){st.carouselInterface(this,t)}))}static dataApiClickHandler(t){const e=n(this);if(!e||!e.classList.contains("carousel"))return;const i={...U.getDataAttributes(e),...U.getDataAttributes(this)},s=this.getAttribute("data-bs-slide-to");s&&(i.interval=!1),st.carouselInterface(e,i),s&&st.getInstance(e).to(s),t.preventDefault()}}j.on(document,"click.bs.carousel.data-api","[data-bs-slide], [data-bs-slide-to]",st.dataApiClickHandler),j.on(window,"load.bs.carousel.data-api",(()=>{const t=V.find('[data-bs-ride="carousel"]');for(let e=0,i=t.length;et===this._element));null!==s&&o.length&&(this._selector=s,this._triggerArray.push(e))}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return rt}static get NAME(){return ot}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t,e=[];if(this._config.parent){const t=V.find(ut,this._config.parent);e=V.find(".collapse.show, .collapse.collapsing",this._config.parent).filter((e=>!t.includes(e)))}const i=V.findOne(this._selector);if(e.length){const n=e.find((t=>i!==t));if(t=n?pt.getInstance(n):null,t&&t._isTransitioning)return}if(j.trigger(this._element,"show.bs.collapse").defaultPrevented)return;e.forEach((e=>{i!==e&&pt.getOrCreateInstance(e,{toggle:!1}).hide(),t||H.set(e,"bs.collapse",null)}));const n=this._getDimension();this._element.classList.remove(ct),this._element.classList.add(ht),this._element.style[n]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=`scroll${n[0].toUpperCase()+n.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove(ht),this._element.classList.add(ct,lt),this._element.style[n]="",j.trigger(this._element,"shown.bs.collapse")}),this._element,!0),this._element.style[n]=`${this._element[s]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(j.trigger(this._element,"hide.bs.collapse").defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,u(this._element),this._element.classList.add(ht),this._element.classList.remove(ct,lt);const e=this._triggerArray.length;for(let t=0;t{this._isTransitioning=!1,this._element.classList.remove(ht),this._element.classList.add(ct),j.trigger(this._element,"hidden.bs.collapse")}),this._element,!0)}_isShown(t=this._element){return t.classList.contains(lt)}_getConfig(t){return(t={...rt,...U.getDataAttributes(this._element),...t}).toggle=Boolean(t.toggle),t.parent=r(t.parent),a(ot,t,at),t}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const t=V.find(ut,this._config.parent);V.find(ft,this._config.parent).filter((e=>!t.includes(e))).forEach((t=>{const e=n(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}))}_addAriaAndCollapsedClass(t,e){t.length&&t.forEach((t=>{e?t.classList.remove(dt):t.classList.add(dt),t.setAttribute("aria-expanded",e)}))}static jQueryInterface(t){return this.each((function(){const e={};"string"==typeof t&&/show|hide/.test(t)&&(e.toggle=!1);const i=pt.getOrCreateInstance(this,e);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}))}}j.on(document,"click.bs.collapse.data-api",ft,(function(t){("A"===t.target.tagName||t.delegateTarget&&"A"===t.delegateTarget.tagName)&&t.preventDefault();const e=i(this);V.find(e).forEach((t=>{pt.getOrCreateInstance(t,{toggle:!1}).toggle()}))})),g(pt);var mt="top",gt="bottom",_t="right",bt="left",vt="auto",yt=[mt,gt,_t,bt],wt="start",Et="end",At="clippingParents",Tt="viewport",Ot="popper",Ct="reference",kt=yt.reduce((function(t,e){return t.concat([e+"-"+wt,e+"-"+Et])}),[]),Lt=[].concat(yt,[vt]).reduce((function(t,e){return t.concat([e,e+"-"+wt,e+"-"+Et])}),[]),xt="beforeRead",Dt="read",St="afterRead",Nt="beforeMain",It="main",Pt="afterMain",jt="beforeWrite",Mt="write",Ht="afterWrite",Bt=[xt,Dt,St,Nt,It,Pt,jt,Mt,Ht];function Rt(t){return t?(t.nodeName||"").toLowerCase():null}function Wt(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function $t(t){return t instanceof Wt(t).Element||t instanceof Element}function zt(t){return t instanceof Wt(t).HTMLElement||t instanceof HTMLElement}function qt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Wt(t).ShadowRoot||t instanceof ShadowRoot)}const Ft={name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach((function(t){var i=e.styles[t]||{},n=e.attributes[t]||{},s=e.elements[t];zt(s)&&Rt(s)&&(Object.assign(s.style,i),Object.keys(n).forEach((function(t){var e=n[t];!1===e?s.removeAttribute(t):s.setAttribute(t,!0===e?"":e)})))}))},effect:function(t){var e=t.state,i={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,i.popper),e.styles=i,e.elements.arrow&&Object.assign(e.elements.arrow.style,i.arrow),function(){Object.keys(e.elements).forEach((function(t){var n=e.elements[t],s=e.attributes[t]||{},o=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:i[t]).reduce((function(t,e){return t[e]="",t}),{});zt(n)&&Rt(n)&&(Object.assign(n.style,o),Object.keys(s).forEach((function(t){n.removeAttribute(t)})))}))}},requires:["computeStyles"]};function Ut(t){return t.split("-")[0]}function Vt(t,e){var i=t.getBoundingClientRect();return{width:i.width/1,height:i.height/1,top:i.top/1,right:i.right/1,bottom:i.bottom/1,left:i.left/1,x:i.left/1,y:i.top/1}}function Kt(t){var e=Vt(t),i=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-i)<=1&&(i=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:i,height:n}}function Xt(t,e){var i=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(i&&qt(i)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Yt(t){return Wt(t).getComputedStyle(t)}function Qt(t){return["table","td","th"].indexOf(Rt(t))>=0}function Gt(t){return(($t(t)?t.ownerDocument:t.document)||window.document).documentElement}function Zt(t){return"html"===Rt(t)?t:t.assignedSlot||t.parentNode||(qt(t)?t.host:null)||Gt(t)}function Jt(t){return zt(t)&&"fixed"!==Yt(t).position?t.offsetParent:null}function te(t){for(var e=Wt(t),i=Jt(t);i&&Qt(i)&&"static"===Yt(i).position;)i=Jt(i);return i&&("html"===Rt(i)||"body"===Rt(i)&&"static"===Yt(i).position)?e:i||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&zt(t)&&"fixed"===Yt(t).position)return null;for(var i=Zt(t);zt(i)&&["html","body"].indexOf(Rt(i))<0;){var n=Yt(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||e&&"filter"===n.willChange||e&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(t)||e}function ee(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}var ie=Math.max,ne=Math.min,se=Math.round;function oe(t,e,i){return ie(t,ne(e,i))}function re(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function ae(t,e){return e.reduce((function(e,i){return e[i]=t,e}),{})}const le={name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,i=t.state,n=t.name,s=t.options,o=i.elements.arrow,r=i.modifiersData.popperOffsets,a=Ut(i.placement),l=ee(a),c=[bt,_t].indexOf(a)>=0?"height":"width";if(o&&r){var h=function(t,e){return re("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:ae(t,yt))}(s.padding,i),d=Kt(o),u="y"===l?mt:bt,f="y"===l?gt:_t,p=i.rects.reference[c]+i.rects.reference[l]-r[l]-i.rects.popper[c],m=r[l]-i.rects.reference[l],g=te(o),_=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-m/2,v=h[u],y=_-d[c]-h[f],w=_/2-d[c]/2+b,E=oe(v,w,y),A=l;i.modifiersData[n]=((e={})[A]=E,e.centerOffset=E-w,e)}},effect:function(t){var e=t.state,i=t.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=e.elements.popper.querySelector(n)))&&Xt(e.elements.popper,n)&&(e.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ce(t){return t.split("-")[1]}var he={top:"auto",right:"auto",bottom:"auto",left:"auto"};function de(t){var e,i=t.popper,n=t.popperRect,s=t.placement,o=t.variation,r=t.offsets,a=t.position,l=t.gpuAcceleration,c=t.adaptive,h=t.roundOffsets,d=!0===h?function(t){var e=t.x,i=t.y,n=window.devicePixelRatio||1;return{x:se(se(e*n)/n)||0,y:se(se(i*n)/n)||0}}(r):"function"==typeof h?h(r):r,u=d.x,f=void 0===u?0:u,p=d.y,m=void 0===p?0:p,g=r.hasOwnProperty("x"),_=r.hasOwnProperty("y"),b=bt,v=mt,y=window;if(c){var w=te(i),E="clientHeight",A="clientWidth";w===Wt(i)&&"static"!==Yt(w=Gt(i)).position&&"absolute"===a&&(E="scrollHeight",A="scrollWidth"),w=w,s!==mt&&(s!==bt&&s!==_t||o!==Et)||(v=gt,m-=w[E]-n.height,m*=l?1:-1),s!==bt&&(s!==mt&&s!==gt||o!==Et)||(b=_t,f-=w[A]-n.width,f*=l?1:-1)}var T,O=Object.assign({position:a},c&&he);return l?Object.assign({},O,((T={})[v]=_?"0":"",T[b]=g?"0":"",T.transform=(y.devicePixelRatio||1)<=1?"translate("+f+"px, "+m+"px)":"translate3d("+f+"px, "+m+"px, 0)",T)):Object.assign({},O,((e={})[v]=_?m+"px":"",e[b]=g?f+"px":"",e.transform="",e))}const ue={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,i=t.options,n=i.gpuAcceleration,s=void 0===n||n,o=i.adaptive,r=void 0===o||o,a=i.roundOffsets,l=void 0===a||a,c={placement:Ut(e.placement),variation:ce(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,de(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:r,roundOffsets:l})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,de(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}};var fe={passive:!0};const pe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,i=t.instance,n=t.options,s=n.scroll,o=void 0===s||s,r=n.resize,a=void 0===r||r,l=Wt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&c.forEach((function(t){t.addEventListener("scroll",i.update,fe)})),a&&l.addEventListener("resize",i.update,fe),function(){o&&c.forEach((function(t){t.removeEventListener("scroll",i.update,fe)})),a&&l.removeEventListener("resize",i.update,fe)}},data:{}};var me={left:"right",right:"left",bottom:"top",top:"bottom"};function ge(t){return t.replace(/left|right|bottom|top/g,(function(t){return me[t]}))}var _e={start:"end",end:"start"};function be(t){return t.replace(/start|end/g,(function(t){return _e[t]}))}function ve(t){var e=Wt(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ye(t){return Vt(Gt(t)).left+ve(t).scrollLeft}function we(t){var e=Yt(t),i=e.overflow,n=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function Ee(t){return["html","body","#document"].indexOf(Rt(t))>=0?t.ownerDocument.body:zt(t)&&we(t)?t:Ee(Zt(t))}function Ae(t,e){var i;void 0===e&&(e=[]);var n=Ee(t),s=n===(null==(i=t.ownerDocument)?void 0:i.body),o=Wt(n),r=s?[o].concat(o.visualViewport||[],we(n)?n:[]):n,a=e.concat(r);return s?a:a.concat(Ae(Zt(r)))}function Te(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Oe(t,e){return e===Tt?Te(function(t){var e=Wt(t),i=Gt(t),n=e.visualViewport,s=i.clientWidth,o=i.clientHeight,r=0,a=0;return n&&(s=n.width,o=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(r=n.offsetLeft,a=n.offsetTop)),{width:s,height:o,x:r+ye(t),y:a}}(t)):zt(e)?function(t){var e=Vt(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Te(function(t){var e,i=Gt(t),n=ve(t),s=null==(e=t.ownerDocument)?void 0:e.body,o=ie(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),r=ie(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-n.scrollLeft+ye(t),l=-n.scrollTop;return"rtl"===Yt(s||i).direction&&(a+=ie(i.clientWidth,s?s.clientWidth:0)-o),{width:o,height:r,x:a,y:l}}(Gt(t)))}function Ce(t){var e,i=t.reference,n=t.element,s=t.placement,o=s?Ut(s):null,r=s?ce(s):null,a=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(o){case mt:e={x:a,y:i.y-n.height};break;case gt:e={x:a,y:i.y+i.height};break;case _t:e={x:i.x+i.width,y:l};break;case bt:e={x:i.x-n.width,y:l};break;default:e={x:i.x,y:i.y}}var c=o?ee(o):null;if(null!=c){var h="y"===c?"height":"width";switch(r){case wt:e[c]=e[c]-(i[h]/2-n[h]/2);break;case Et:e[c]=e[c]+(i[h]/2-n[h]/2)}}return e}function ke(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=void 0===n?t.placement:n,o=i.boundary,r=void 0===o?At:o,a=i.rootBoundary,l=void 0===a?Tt:a,c=i.elementContext,h=void 0===c?Ot:c,d=i.altBoundary,u=void 0!==d&&d,f=i.padding,p=void 0===f?0:f,m=re("number"!=typeof p?p:ae(p,yt)),g=h===Ot?Ct:Ot,_=t.rects.popper,b=t.elements[u?g:h],v=function(t,e,i){var n="clippingParents"===e?function(t){var e=Ae(Zt(t)),i=["absolute","fixed"].indexOf(Yt(t).position)>=0&&zt(t)?te(t):t;return $t(i)?e.filter((function(t){return $t(t)&&Xt(t,i)&&"body"!==Rt(t)})):[]}(t):[].concat(e),s=[].concat(n,[i]),o=s[0],r=s.reduce((function(e,i){var n=Oe(t,i);return e.top=ie(n.top,e.top),e.right=ne(n.right,e.right),e.bottom=ne(n.bottom,e.bottom),e.left=ie(n.left,e.left),e}),Oe(t,o));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}($t(b)?b:b.contextElement||Gt(t.elements.popper),r,l),y=Vt(t.elements.reference),w=Ce({reference:y,element:_,strategy:"absolute",placement:s}),E=Te(Object.assign({},_,w)),A=h===Ot?E:y,T={top:v.top-A.top+m.top,bottom:A.bottom-v.bottom+m.bottom,left:v.left-A.left+m.left,right:A.right-v.right+m.right},O=t.modifiersData.offset;if(h===Ot&&O){var C=O[s];Object.keys(T).forEach((function(t){var e=[_t,gt].indexOf(t)>=0?1:-1,i=[mt,gt].indexOf(t)>=0?"y":"x";T[t]+=C[i]*e}))}return T}function Le(t,e){void 0===e&&(e={});var i=e,n=i.placement,s=i.boundary,o=i.rootBoundary,r=i.padding,a=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?Lt:l,h=ce(n),d=h?a?kt:kt.filter((function(t){return ce(t)===h})):yt,u=d.filter((function(t){return c.indexOf(t)>=0}));0===u.length&&(u=d);var f=u.reduce((function(e,i){return e[i]=ke(t,{placement:i,boundary:s,rootBoundary:o,padding:r})[Ut(i)],e}),{});return Object.keys(f).sort((function(t,e){return f[t]-f[e]}))}const xe={name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0===r||r,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,f=i.flipVariations,p=void 0===f||f,m=i.allowedAutoPlacements,g=e.options.placement,_=Ut(g),b=l||(_!==g&&p?function(t){if(Ut(t)===vt)return[];var e=ge(t);return[be(t),e,be(e)]}(g):[ge(g)]),v=[g].concat(b).reduce((function(t,i){return t.concat(Ut(i)===vt?Le(e,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:m}):i)}),[]),y=e.rects.reference,w=e.rects.popper,E=new Map,A=!0,T=v[0],O=0;O=0,D=x?"width":"height",S=ke(e,{placement:C,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),N=x?L?_t:bt:L?gt:mt;y[D]>w[D]&&(N=ge(N));var I=ge(N),P=[];if(o&&P.push(S[k]<=0),a&&P.push(S[N]<=0,S[I]<=0),P.every((function(t){return t}))){T=C,A=!1;break}E.set(C,P)}if(A)for(var j=function(t){var e=v.find((function(e){var i=E.get(e);if(i)return i.slice(0,t).every((function(t){return t}))}));if(e)return T=e,"break"},M=p?3:1;M>0&&"break"!==j(M);M--);e.placement!==T&&(e.modifiersData[n]._skip=!0,e.placement=T,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function De(t,e,i){return void 0===i&&(i={x:0,y:0}),{top:t.top-e.height-i.y,right:t.right-e.width+i.x,bottom:t.bottom-e.height+i.y,left:t.left-e.width-i.x}}function Se(t){return[mt,_t,gt,bt].some((function(e){return t[e]>=0}))}const Ne={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,i=t.name,n=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,r=ke(e,{elementContext:"reference"}),a=ke(e,{altBoundary:!0}),l=De(r,n),c=De(a,s,o),h=Se(l),d=Se(c);e.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},Ie={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.offset,o=void 0===s?[0,0]:s,r=Lt.reduce((function(t,i){return t[i]=function(t,e,i){var n=Ut(t),s=[bt,mt].indexOf(n)>=0?-1:1,o="function"==typeof i?i(Object.assign({},e,{placement:t})):i,r=o[0],a=o[1];return r=r||0,a=(a||0)*s,[bt,_t].indexOf(n)>=0?{x:a,y:r}:{x:r,y:a}}(i,e.rects,o),t}),{}),a=r[e.placement],l=a.x,c=a.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=l,e.modifiersData.popperOffsets.y+=c),e.modifiersData[n]=r}},Pe={name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state,i=t.name;e.modifiersData[i]=Ce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},je={name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,i=t.options,n=t.name,s=i.mainAxis,o=void 0===s||s,r=i.altAxis,a=void 0!==r&&r,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,f=void 0===u||u,p=i.tetherOffset,m=void 0===p?0:p,g=ke(e,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),_=Ut(e.placement),b=ce(e.placement),v=!b,y=ee(_),w="x"===y?"y":"x",E=e.modifiersData.popperOffsets,A=e.rects.reference,T=e.rects.popper,O="function"==typeof m?m(Object.assign({},e.rects,{placement:e.placement})):m,C={x:0,y:0};if(E){if(o||a){var k="y"===y?mt:bt,L="y"===y?gt:_t,x="y"===y?"height":"width",D=E[y],S=E[y]+g[k],N=E[y]-g[L],I=f?-T[x]/2:0,P=b===wt?A[x]:T[x],j=b===wt?-T[x]:-A[x],M=e.elements.arrow,H=f&&M?Kt(M):{width:0,height:0},B=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},R=B[k],W=B[L],$=oe(0,A[x],H[x]),z=v?A[x]/2-I-$-R-O:P-$-R-O,q=v?-A[x]/2+I+$+W+O:j+$+W+O,F=e.elements.arrow&&te(e.elements.arrow),U=F?"y"===y?F.clientTop||0:F.clientLeft||0:0,V=e.modifiersData.offset?e.modifiersData.offset[e.placement][y]:0,K=E[y]+z-V-U,X=E[y]+q-V;if(o){var Y=oe(f?ne(S,K):S,D,f?ie(N,X):N);E[y]=Y,C[y]=Y-D}if(a){var Q="x"===y?mt:bt,G="x"===y?gt:_t,Z=E[w],J=Z+g[Q],tt=Z-g[G],et=oe(f?ne(J,K):J,Z,f?ie(tt,X):tt);E[w]=et,C[w]=et-Z}}e.modifiersData[n]=C}},requiresIfExists:["offset"]};function Me(t,e,i){void 0===i&&(i=!1);var n=zt(e);zt(e)&&function(t){var e=t.getBoundingClientRect();e.width,t.offsetWidth,e.height,t.offsetHeight}(e);var s,o,r=Gt(e),a=Vt(t),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!i)&&(("body"!==Rt(e)||we(r))&&(l=(s=e)!==Wt(s)&&zt(s)?{scrollLeft:(o=s).scrollLeft,scrollTop:o.scrollTop}:ve(s)),zt(e)?((c=Vt(e)).x+=e.clientLeft,c.y+=e.clientTop):r&&(c.x=ye(r))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function He(t){var e=new Map,i=new Set,n=[];function s(t){i.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach((function(t){if(!i.has(t)){var n=e.get(t);n&&s(n)}})),n.push(t)}return t.forEach((function(t){e.set(t.name,t)})),t.forEach((function(t){i.has(t.name)||s(t)})),n}var Be={placement:"bottom",modifiers:[],strategy:"absolute"};function Re(){for(var t=arguments.length,e=new Array(t),i=0;ij.on(t,"mouseover",d))),this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Je),this._element.classList.add(Je),j.trigger(this._element,"shown.bs.dropdown",t)}hide(){if(c(this._element)||!this._isShown(this._menu))return;const t={relatedTarget:this._element};this._completeHide(t)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(t){j.trigger(this._element,"hide.bs.dropdown",t).defaultPrevented||("ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((t=>j.off(t,"mouseover",d))),this._popper&&this._popper.destroy(),this._menu.classList.remove(Je),this._element.classList.remove(Je),this._element.setAttribute("aria-expanded","false"),U.removeDataAttribute(this._menu,"popper"),j.trigger(this._element,"hidden.bs.dropdown",t))}_getConfig(t){if(t={...this.constructor.Default,...U.getDataAttributes(this._element),...t},a(Ue,t,this.constructor.DefaultType),"object"==typeof t.reference&&!o(t.reference)&&"function"!=typeof t.reference.getBoundingClientRect)throw new TypeError(`${Ue.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return t}_createPopper(t){if(void 0===Fe)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;"parent"===this._config.reference?e=t:o(this._config.reference)?e=r(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const i=this._getPopperConfig(),n=i.modifiers.find((t=>"applyStyles"===t.name&&!1===t.enabled));this._popper=qe(e,this._menu,i),n&&U.setDataAttribute(this._menu,"popper","static")}_isShown(t=this._element){return t.classList.contains(Je)}_getMenuElement(){return V.next(this._element,ei)[0]}_getPlacement(){const t=this._element.parentNode;if(t.classList.contains("dropend"))return ri;if(t.classList.contains("dropstart"))return ai;const e="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return t.classList.contains("dropup")?e?ni:ii:e?oi:si}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_getPopperConfig(){const t={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return"static"===this._config.display&&(t.modifiers=[{name:"applyStyles",enabled:!1}]),{...t,..."function"==typeof this._config.popperConfig?this._config.popperConfig(t):this._config.popperConfig}}_selectMenuItem({key:t,target:e}){const i=V.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(l);i.length&&v(i,e,t===Ye,!i.includes(e)).focus()}static jQueryInterface(t){return this.each((function(){const e=hi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}static clearMenus(t){if(t&&(2===t.button||"keyup"===t.type&&"Tab"!==t.key))return;const e=V.find(ti);for(let i=0,n=e.length;ie+t)),this._setElementAttributes(di,"paddingRight",(e=>e+t)),this._setElementAttributes(ui,"marginRight",(e=>e-t))}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(t,e,i){const n=this.getWidth();this._applyManipulationCallback(t,(t=>{if(t!==this._element&&window.innerWidth>t.clientWidth+n)return;this._saveInitialAttribute(t,e);const s=window.getComputedStyle(t)[e];t.style[e]=`${i(Number.parseFloat(s))}px`}))}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,"paddingRight"),this._resetElementAttributes(di,"paddingRight"),this._resetElementAttributes(ui,"marginRight")}_saveInitialAttribute(t,e){const i=t.style[e];i&&U.setDataAttribute(t,e,i)}_resetElementAttributes(t,e){this._applyManipulationCallback(t,(t=>{const i=U.getDataAttribute(t,e);void 0===i?t.style.removeProperty(e):(U.removeDataAttribute(t,e),t.style[e]=i)}))}_applyManipulationCallback(t,e){o(t)?e(t):V.find(t,this._element).forEach(e)}isOverflowing(){return this.getWidth()>0}}const pi={className:"modal-backdrop",isVisible:!0,isAnimated:!1,rootElement:"body",clickCallback:null},mi={className:"string",isVisible:"boolean",isAnimated:"boolean",rootElement:"(element|string)",clickCallback:"(function|null)"},gi="show",_i="mousedown.bs.backdrop";class bi{constructor(t){this._config=this._getConfig(t),this._isAppended=!1,this._element=null}show(t){this._config.isVisible?(this._append(),this._config.isAnimated&&u(this._getElement()),this._getElement().classList.add(gi),this._emulateAnimation((()=>{_(t)}))):_(t)}hide(t){this._config.isVisible?(this._getElement().classList.remove(gi),this._emulateAnimation((()=>{this.dispose(),_(t)}))):_(t)}_getElement(){if(!this._element){const t=document.createElement("div");t.className=this._config.className,this._config.isAnimated&&t.classList.add("fade"),this._element=t}return this._element}_getConfig(t){return(t={...pi,..."object"==typeof t?t:{}}).rootElement=r(t.rootElement),a("backdrop",t,mi),t}_append(){this._isAppended||(this._config.rootElement.append(this._getElement()),j.on(this._getElement(),_i,(()=>{_(this._config.clickCallback)})),this._isAppended=!0)}dispose(){this._isAppended&&(j.off(this._element,_i),this._element.remove(),this._isAppended=!1)}_emulateAnimation(t){b(t,this._getElement(),this._config.isAnimated)}}const vi={trapElement:null,autofocus:!0},yi={trapElement:"element",autofocus:"boolean"},wi=".bs.focustrap",Ei="backward";class Ai{constructor(t){this._config=this._getConfig(t),this._isActive=!1,this._lastTabNavDirection=null}activate(){const{trapElement:t,autofocus:e}=this._config;this._isActive||(e&&t.focus(),j.off(document,wi),j.on(document,"focusin.bs.focustrap",(t=>this._handleFocusin(t))),j.on(document,"keydown.tab.bs.focustrap",(t=>this._handleKeydown(t))),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,j.off(document,wi))}_handleFocusin(t){const{target:e}=t,{trapElement:i}=this._config;if(e===document||e===i||i.contains(e))return;const n=V.focusableChildren(i);0===n.length?i.focus():this._lastTabNavDirection===Ei?n[n.length-1].focus():n[0].focus()}_handleKeydown(t){"Tab"===t.key&&(this._lastTabNavDirection=t.shiftKey?Ei:"forward")}_getConfig(t){return t={...vi,..."object"==typeof t?t:{}},a("focustrap",t,yi),t}}const Ti="modal",Oi="Escape",Ci={backdrop:!0,keyboard:!0,focus:!0},ki={backdrop:"(boolean|string)",keyboard:"boolean",focus:"boolean"},Li="hidden.bs.modal",xi="show.bs.modal",Di="resize.bs.modal",Si="click.dismiss.bs.modal",Ni="keydown.dismiss.bs.modal",Ii="mousedown.dismiss.bs.modal",Pi="modal-open",ji="show",Mi="modal-static";class Hi extends B{constructor(t,e){super(t),this._config=this._getConfig(e),this._dialog=V.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._ignoreBackdropClick=!1,this._isTransitioning=!1,this._scrollBar=new fi}static get Default(){return Ci}static get NAME(){return Ti}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||this._isTransitioning||j.trigger(this._element,xi,{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._isAnimated()&&(this._isTransitioning=!0),this._scrollBar.hide(),document.body.classList.add(Pi),this._adjustDialog(),this._setEscapeEvent(),this._setResizeEvent(),j.on(this._dialog,Ii,(()=>{j.one(this._element,"mouseup.dismiss.bs.modal",(t=>{t.target===this._element&&(this._ignoreBackdropClick=!0)}))})),this._showBackdrop((()=>this._showElement(t))))}hide(){if(!this._isShown||this._isTransitioning)return;if(j.trigger(this._element,"hide.bs.modal").defaultPrevented)return;this._isShown=!1;const t=this._isAnimated();t&&(this._isTransitioning=!0),this._setEscapeEvent(),this._setResizeEvent(),this._focustrap.deactivate(),this._element.classList.remove(ji),j.off(this._element,Si),j.off(this._dialog,Ii),this._queueCallback((()=>this._hideModal()),this._element,t)}dispose(){[window,this._dialog].forEach((t=>j.off(t,".bs.modal"))),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new bi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Ai({trapElement:this._element})}_getConfig(t){return t={...Ci,...U.getDataAttributes(this._element),..."object"==typeof t?t:{}},a(Ti,t,ki),t}_showElement(t){const e=this._isAnimated(),i=V.findOne(".modal-body",this._dialog);this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0,i&&(i.scrollTop=0),e&&u(this._element),this._element.classList.add(ji),this._queueCallback((()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,j.trigger(this._element,"shown.bs.modal",{relatedTarget:t})}),this._dialog,e)}_setEscapeEvent(){this._isShown?j.on(this._element,Ni,(t=>{this._config.keyboard&&t.key===Oi?(t.preventDefault(),this.hide()):this._config.keyboard||t.key!==Oi||this._triggerBackdropTransition()})):j.off(this._element,Ni)}_setResizeEvent(){this._isShown?j.on(window,Di,(()=>this._adjustDialog())):j.off(window,Di)}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((()=>{document.body.classList.remove(Pi),this._resetAdjustments(),this._scrollBar.reset(),j.trigger(this._element,Li)}))}_showBackdrop(t){j.on(this._element,Si,(t=>{this._ignoreBackdropClick?this._ignoreBackdropClick=!1:t.target===t.currentTarget&&(!0===this._config.backdrop?this.hide():"static"===this._config.backdrop&&this._triggerBackdropTransition())})),this._backdrop.show(t)}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(j.trigger(this._element,"hidePrevented.bs.modal").defaultPrevented)return;const{classList:t,scrollHeight:e,style:i}=this._element,n=e>document.documentElement.clientHeight;!n&&"hidden"===i.overflowY||t.contains(Mi)||(n||(i.overflowY="hidden"),t.add(Mi),this._queueCallback((()=>{t.remove(Mi),n||this._queueCallback((()=>{i.overflowY=""}),this._dialog)}),this._dialog),this._element.focus())}_adjustDialog(){const t=this._element.scrollHeight>document.documentElement.clientHeight,e=this._scrollBar.getWidth(),i=e>0;(!i&&t&&!m()||i&&!t&&m())&&(this._element.style.paddingLeft=`${e}px`),(i&&!t&&!m()||!i&&t&&m())&&(this._element.style.paddingRight=`${e}px`)}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(t,e){return this.each((function(){const i=Hi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t](e)}}))}}j.on(document,"click.bs.modal.data-api",'[data-bs-toggle="modal"]',(function(t){const e=n(this);["A","AREA"].includes(this.tagName)&&t.preventDefault(),j.one(e,xi,(t=>{t.defaultPrevented||j.one(e,Li,(()=>{l(this)&&this.focus()}))}));const i=V.findOne(".modal.show");i&&Hi.getInstance(i).hide(),Hi.getOrCreateInstance(e).toggle(this)})),R(Hi),g(Hi);const Bi="offcanvas",Ri={backdrop:!0,keyboard:!0,scroll:!1},Wi={backdrop:"boolean",keyboard:"boolean",scroll:"boolean"},$i="show",zi=".offcanvas.show",qi="hidden.bs.offcanvas";class Fi extends B{constructor(t,e){super(t),this._config=this._getConfig(e),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get NAME(){return Bi}static get Default(){return Ri}toggle(t){return this._isShown?this.hide():this.show(t)}show(t){this._isShown||j.trigger(this._element,"show.bs.offcanvas",{relatedTarget:t}).defaultPrevented||(this._isShown=!0,this._element.style.visibility="visible",this._backdrop.show(),this._config.scroll||(new fi).hide(),this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add($i),this._queueCallback((()=>{this._config.scroll||this._focustrap.activate(),j.trigger(this._element,"shown.bs.offcanvas",{relatedTarget:t})}),this._element,!0))}hide(){this._isShown&&(j.trigger(this._element,"hide.bs.offcanvas").defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.remove($i),this._backdrop.hide(),this._queueCallback((()=>{this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._element.style.visibility="hidden",this._config.scroll||(new fi).reset(),j.trigger(this._element,qi)}),this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_getConfig(t){return t={...Ri,...U.getDataAttributes(this._element),..."object"==typeof t?t:{}},a(Bi,t,Wi),t}_initializeBackDrop(){return new bi({className:"offcanvas-backdrop",isVisible:this._config.backdrop,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_initializeFocusTrap(){return new Ai({trapElement:this._element})}_addEventListeners(){j.on(this._element,"keydown.dismiss.bs.offcanvas",(t=>{this._config.keyboard&&"Escape"===t.key&&this.hide()}))}static jQueryInterface(t){return this.each((function(){const e=Fi.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t]||t.startsWith("_")||"constructor"===t)throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}j.on(document,"click.bs.offcanvas.data-api",'[data-bs-toggle="offcanvas"]',(function(t){const e=n(this);if(["A","AREA"].includes(this.tagName)&&t.preventDefault(),c(this))return;j.one(e,qi,(()=>{l(this)&&this.focus()}));const i=V.findOne(zi);i&&i!==e&&Fi.getInstance(i).hide(),Fi.getOrCreateInstance(e).toggle(this)})),j.on(window,"load.bs.offcanvas.data-api",(()=>V.find(zi).forEach((t=>Fi.getOrCreateInstance(t).show())))),R(Fi),g(Fi);const Ui=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Vi=/^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i,Ki=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i,Xi=(t,e)=>{const i=t.nodeName.toLowerCase();if(e.includes(i))return!Ui.has(i)||Boolean(Vi.test(t.nodeValue)||Ki.test(t.nodeValue));const n=e.filter((t=>t instanceof RegExp));for(let t=0,e=n.length;t{Xi(t,r)||i.removeAttribute(t.nodeName)}))}return n.body.innerHTML}const Qi="tooltip",Gi=new Set(["sanitize","allowList","sanitizeFn"]),Zi={animation:"boolean",template:"string",title:"(string|element|function)",trigger:"string",delay:"(number|object)",html:"boolean",selector:"(string|boolean)",placement:"(string|function)",offset:"(array|string|function)",container:"(string|element|boolean)",fallbackPlacements:"array",boundary:"(string|element)",customClass:"(string|function)",sanitize:"boolean",sanitizeFn:"(null|function)",allowList:"object",popperConfig:"(null|object|function)"},Ji={AUTO:"auto",TOP:"top",RIGHT:m()?"left":"right",BOTTOM:"bottom",LEFT:m()?"right":"left"},tn={animation:!0,template:'',trigger:"hover focus",title:"",delay:0,html:!1,selector:!1,placement:"top",offset:[0,0],container:!1,fallbackPlacements:["top","right","bottom","left"],boundary:"clippingParents",customClass:"",sanitize:!0,sanitizeFn:null,allowList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},popperConfig:null},en={HIDE:"hide.bs.tooltip",HIDDEN:"hidden.bs.tooltip",SHOW:"show.bs.tooltip",SHOWN:"shown.bs.tooltip",INSERTED:"inserted.bs.tooltip",CLICK:"click.bs.tooltip",FOCUSIN:"focusin.bs.tooltip",FOCUSOUT:"focusout.bs.tooltip",MOUSEENTER:"mouseenter.bs.tooltip",MOUSELEAVE:"mouseleave.bs.tooltip"},nn="fade",sn="show",on="show",rn="out",an=".tooltip-inner",ln=".modal",cn="hide.bs.modal",hn="hover",dn="focus";class un extends B{constructor(t,e){if(void 0===Fe)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(t),this._isEnabled=!0,this._timeout=0,this._hoverState="",this._activeTrigger={},this._popper=null,this._config=this._getConfig(e),this.tip=null,this._setListeners()}static get Default(){return tn}static get NAME(){return Qi}static get Event(){return en}static get DefaultType(){return Zi}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(t){if(this._isEnabled)if(t){const e=this._initializeOnDelegatedTarget(t);e._activeTrigger.click=!e._activeTrigger.click,e._isWithActiveTrigger()?e._enter(null,e):e._leave(null,e)}else{if(this.getTipElement().classList.contains(sn))return void this._leave(null,this);this._enter(null,this)}}dispose(){clearTimeout(this._timeout),j.off(this._element.closest(ln),cn,this._hideModalHandler),this.tip&&this.tip.remove(),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this.isWithContent()||!this._isEnabled)return;const t=j.trigger(this._element,this.constructor.Event.SHOW),e=h(this._element),i=null===e?this._element.ownerDocument.documentElement.contains(this._element):e.contains(this._element);if(t.defaultPrevented||!i)return;"tooltip"===this.constructor.NAME&&this.tip&&this.getTitle()!==this.tip.querySelector(an).innerHTML&&(this._disposePopper(),this.tip.remove(),this.tip=null);const n=this.getTipElement(),s=(t=>{do{t+=Math.floor(1e6*Math.random())}while(document.getElementById(t));return t})(this.constructor.NAME);n.setAttribute("id",s),this._element.setAttribute("aria-describedby",s),this._config.animation&&n.classList.add(nn);const o="function"==typeof this._config.placement?this._config.placement.call(this,n,this._element):this._config.placement,r=this._getAttachment(o);this._addAttachmentClass(r);const{container:a}=this._config;H.set(n,this.constructor.DATA_KEY,this),this._element.ownerDocument.documentElement.contains(this.tip)||(a.append(n),j.trigger(this._element,this.constructor.Event.INSERTED)),this._popper?this._popper.update():this._popper=qe(this._element,n,this._getPopperConfig(r)),n.classList.add(sn);const l=this._resolvePossibleFunction(this._config.customClass);l&&n.classList.add(...l.split(" ")),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((t=>{j.on(t,"mouseover",d)}));const c=this.tip.classList.contains(nn);this._queueCallback((()=>{const t=this._hoverState;this._hoverState=null,j.trigger(this._element,this.constructor.Event.SHOWN),t===rn&&this._leave(null,this)}),this.tip,c)}hide(){if(!this._popper)return;const t=this.getTipElement();if(j.trigger(this._element,this.constructor.Event.HIDE).defaultPrevented)return;t.classList.remove(sn),"ontouchstart"in document.documentElement&&[].concat(...document.body.children).forEach((t=>j.off(t,"mouseover",d))),this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1;const e=this.tip.classList.contains(nn);this._queueCallback((()=>{this._isWithActiveTrigger()||(this._hoverState!==on&&t.remove(),this._cleanTipClass(),this._element.removeAttribute("aria-describedby"),j.trigger(this._element,this.constructor.Event.HIDDEN),this._disposePopper())}),this.tip,e),this._hoverState=""}update(){null!==this._popper&&this._popper.update()}isWithContent(){return Boolean(this.getTitle())}getTipElement(){if(this.tip)return this.tip;const t=document.createElement("div");t.innerHTML=this._config.template;const e=t.children[0];return this.setContent(e),e.classList.remove(nn,sn),this.tip=e,this.tip}setContent(t){this._sanitizeAndSetContent(t,this.getTitle(),an)}_sanitizeAndSetContent(t,e,i){const n=V.findOne(i,t);e||!n?this.setElementContent(n,e):n.remove()}setElementContent(t,e){if(null!==t)return o(e)?(e=r(e),void(this._config.html?e.parentNode!==t&&(t.innerHTML="",t.append(e)):t.textContent=e.textContent)):void(this._config.html?(this._config.sanitize&&(e=Yi(e,this._config.allowList,this._config.sanitizeFn)),t.innerHTML=e):t.textContent=e)}getTitle(){const t=this._element.getAttribute("data-bs-original-title")||this._config.title;return this._resolvePossibleFunction(t)}updateAttachment(t){return"right"===t?"end":"left"===t?"start":t}_initializeOnDelegatedTarget(t,e){return e||this.constructor.getOrCreateInstance(t.delegateTarget,this._getDelegateConfig())}_getOffset(){const{offset:t}=this._config;return"string"==typeof t?t.split(",").map((t=>Number.parseInt(t,10))):"function"==typeof t?e=>t(e,this._element):t}_resolvePossibleFunction(t){return"function"==typeof t?t.call(this._element):t}_getPopperConfig(t){const e={placement:t,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:`.${this.constructor.NAME}-arrow`}},{name:"onChange",enabled:!0,phase:"afterWrite",fn:t=>this._handlePopperPlacementChange(t)}],onFirstUpdate:t=>{t.options.placement!==t.placement&&this._handlePopperPlacementChange(t)}};return{...e,..."function"==typeof this._config.popperConfig?this._config.popperConfig(e):this._config.popperConfig}}_addAttachmentClass(t){this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(t)}`)}_getAttachment(t){return Ji[t.toUpperCase()]}_setListeners(){this._config.trigger.split(" ").forEach((t=>{if("click"===t)j.on(this._element,this.constructor.Event.CLICK,this._config.selector,(t=>this.toggle(t)));else if("manual"!==t){const e=t===hn?this.constructor.Event.MOUSEENTER:this.constructor.Event.FOCUSIN,i=t===hn?this.constructor.Event.MOUSELEAVE:this.constructor.Event.FOCUSOUT;j.on(this._element,e,this._config.selector,(t=>this._enter(t))),j.on(this._element,i,this._config.selector,(t=>this._leave(t)))}})),this._hideModalHandler=()=>{this._element&&this.hide()},j.on(this._element.closest(ln),cn,this._hideModalHandler),this._config.selector?this._config={...this._config,trigger:"manual",selector:""}:this._fixTitle()}_fixTitle(){const t=this._element.getAttribute("title"),e=typeof this._element.getAttribute("data-bs-original-title");(t||"string"!==e)&&(this._element.setAttribute("data-bs-original-title",t||""),!t||this._element.getAttribute("aria-label")||this._element.textContent||this._element.setAttribute("aria-label",t),this._element.setAttribute("title",""))}_enter(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusin"===t.type?dn:hn]=!0),e.getTipElement().classList.contains(sn)||e._hoverState===on?e._hoverState=on:(clearTimeout(e._timeout),e._hoverState=on,e._config.delay&&e._config.delay.show?e._timeout=setTimeout((()=>{e._hoverState===on&&e.show()}),e._config.delay.show):e.show())}_leave(t,e){e=this._initializeOnDelegatedTarget(t,e),t&&(e._activeTrigger["focusout"===t.type?dn:hn]=e._element.contains(t.relatedTarget)),e._isWithActiveTrigger()||(clearTimeout(e._timeout),e._hoverState=rn,e._config.delay&&e._config.delay.hide?e._timeout=setTimeout((()=>{e._hoverState===rn&&e.hide()}),e._config.delay.hide):e.hide())}_isWithActiveTrigger(){for(const t in this._activeTrigger)if(this._activeTrigger[t])return!0;return!1}_getConfig(t){const e=U.getDataAttributes(this._element);return Object.keys(e).forEach((t=>{Gi.has(t)&&delete e[t]})),(t={...this.constructor.Default,...e,..."object"==typeof t&&t?t:{}}).container=!1===t.container?document.body:r(t.container),"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),"number"==typeof t.title&&(t.title=t.title.toString()),"number"==typeof t.content&&(t.content=t.content.toString()),a(Qi,t,this.constructor.DefaultType),t.sanitize&&(t.template=Yi(t.template,t.allowList,t.sanitizeFn)),t}_getDelegateConfig(){const t={};for(const e in this._config)this.constructor.Default[e]!==this._config[e]&&(t[e]=this._config[e]);return t}_cleanTipClass(){const t=this.getTipElement(),e=new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`,"g"),i=t.getAttribute("class").match(e);null!==i&&i.length>0&&i.map((t=>t.trim())).forEach((e=>t.classList.remove(e)))}_getBasicClassPrefix(){return"bs-tooltip"}_handlePopperPlacementChange(t){const{state:e}=t;e&&(this.tip=e.elements.popper,this._cleanTipClass(),this._addAttachmentClass(this._getAttachment(e.placement)))}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null)}static jQueryInterface(t){return this.each((function(){const e=un.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}g(un);const fn={...un.Default,placement:"right",offset:[0,8],trigger:"click",content:"",template:''},pn={...un.DefaultType,content:"(string|element|function)"},mn={HIDE:"hide.bs.popover",HIDDEN:"hidden.bs.popover",SHOW:"show.bs.popover",SHOWN:"shown.bs.popover",INSERTED:"inserted.bs.popover",CLICK:"click.bs.popover",FOCUSIN:"focusin.bs.popover",FOCUSOUT:"focusout.bs.popover",MOUSEENTER:"mouseenter.bs.popover",MOUSELEAVE:"mouseleave.bs.popover"};class gn extends un{static get Default(){return fn}static get NAME(){return"popover"}static get Event(){return mn}static get DefaultType(){return pn}isWithContent(){return this.getTitle()||this._getContent()}setContent(t){this._sanitizeAndSetContent(t,this.getTitle(),".popover-header"),this._sanitizeAndSetContent(t,this._getContent(),".popover-body")}_getContent(){return this._resolvePossibleFunction(this._config.content)}_getBasicClassPrefix(){return"bs-popover"}static jQueryInterface(t){return this.each((function(){const e=gn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}g(gn);const _n="scrollspy",bn={offset:10,method:"auto",target:""},vn={offset:"number",method:"string",target:"(string|element)"},yn="active",wn=".nav-link, .list-group-item, .dropdown-item",En="position";class An extends B{constructor(t,e){super(t),this._scrollElement="BODY"===this._element.tagName?window:this._element,this._config=this._getConfig(e),this._offsets=[],this._targets=[],this._activeTarget=null,this._scrollHeight=0,j.on(this._scrollElement,"scroll.bs.scrollspy",(()=>this._process())),this.refresh(),this._process()}static get Default(){return bn}static get NAME(){return _n}refresh(){const t=this._scrollElement===this._scrollElement.window?"offset":En,e="auto"===this._config.method?t:this._config.method,n=e===En?this._getScrollTop():0;this._offsets=[],this._targets=[],this._scrollHeight=this._getScrollHeight(),V.find(wn,this._config.target).map((t=>{const s=i(t),o=s?V.findOne(s):null;if(o){const t=o.getBoundingClientRect();if(t.width||t.height)return[U[e](o).top+n,s]}return null})).filter((t=>t)).sort(((t,e)=>t[0]-e[0])).forEach((t=>{this._offsets.push(t[0]),this._targets.push(t[1])}))}dispose(){j.off(this._scrollElement,".bs.scrollspy"),super.dispose()}_getConfig(t){return(t={...bn,...U.getDataAttributes(this._element),..."object"==typeof t&&t?t:{}}).target=r(t.target)||document.documentElement,a(_n,t,vn),t}_getScrollTop(){return this._scrollElement===window?this._scrollElement.pageYOffset:this._scrollElement.scrollTop}_getScrollHeight(){return this._scrollElement.scrollHeight||Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)}_getOffsetHeight(){return this._scrollElement===window?window.innerHeight:this._scrollElement.getBoundingClientRect().height}_process(){const t=this._getScrollTop()+this._config.offset,e=this._getScrollHeight(),i=this._config.offset+e-this._getOffsetHeight();if(this._scrollHeight!==e&&this.refresh(),t>=i){const t=this._targets[this._targets.length-1];this._activeTarget!==t&&this._activate(t)}else{if(this._activeTarget&&t0)return this._activeTarget=null,void this._clear();for(let e=this._offsets.length;e--;)this._activeTarget!==this._targets[e]&&t>=this._offsets[e]&&(void 0===this._offsets[e+1]||t`${e}[data-bs-target="${t}"],${e}[href="${t}"]`)),i=V.findOne(e.join(","),this._config.target);i.classList.add(yn),i.classList.contains("dropdown-item")?V.findOne(".dropdown-toggle",i.closest(".dropdown")).classList.add(yn):V.parents(i,".nav, .list-group").forEach((t=>{V.prev(t,".nav-link, .list-group-item").forEach((t=>t.classList.add(yn))),V.prev(t,".nav-item").forEach((t=>{V.children(t,".nav-link").forEach((t=>t.classList.add(yn)))}))})),j.trigger(this._scrollElement,"activate.bs.scrollspy",{relatedTarget:t})}_clear(){V.find(wn,this._config.target).filter((t=>t.classList.contains(yn))).forEach((t=>t.classList.remove(yn)))}static jQueryInterface(t){return this.each((function(){const e=An.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}j.on(window,"load.bs.scrollspy.data-api",(()=>{V.find('[data-bs-spy="scroll"]').forEach((t=>new An(t)))})),g(An);const Tn="active",On="fade",Cn="show",kn=".active",Ln=":scope > li > .active";class xn extends B{static get NAME(){return"tab"}show(){if(this._element.parentNode&&this._element.parentNode.nodeType===Node.ELEMENT_NODE&&this._element.classList.contains(Tn))return;let t;const e=n(this._element),i=this._element.closest(".nav, .list-group");if(i){const e="UL"===i.nodeName||"OL"===i.nodeName?Ln:kn;t=V.find(e,i),t=t[t.length-1]}const s=t?j.trigger(t,"hide.bs.tab",{relatedTarget:this._element}):null;if(j.trigger(this._element,"show.bs.tab",{relatedTarget:t}).defaultPrevented||null!==s&&s.defaultPrevented)return;this._activate(this._element,i);const o=()=>{j.trigger(t,"hidden.bs.tab",{relatedTarget:this._element}),j.trigger(this._element,"shown.bs.tab",{relatedTarget:t})};e?this._activate(e,e.parentNode,o):o()}_activate(t,e,i){const n=(!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?V.children(e,kn):V.find(Ln,e))[0],s=i&&n&&n.classList.contains(On),o=()=>this._transitionComplete(t,n,i);n&&s?(n.classList.remove(Cn),this._queueCallback(o,t,!0)):o()}_transitionComplete(t,e,i){if(e){e.classList.remove(Tn);const t=V.findOne(":scope > .dropdown-menu .active",e.parentNode);t&&t.classList.remove(Tn),"tab"===e.getAttribute("role")&&e.setAttribute("aria-selected",!1)}t.classList.add(Tn),"tab"===t.getAttribute("role")&&t.setAttribute("aria-selected",!0),u(t),t.classList.contains(On)&&t.classList.add(Cn);let n=t.parentNode;if(n&&"LI"===n.nodeName&&(n=n.parentNode),n&&n.classList.contains("dropdown-menu")){const e=t.closest(".dropdown");e&&V.find(".dropdown-toggle",e).forEach((t=>t.classList.add(Tn))),t.setAttribute("aria-expanded",!0)}i&&i()}static jQueryInterface(t){return this.each((function(){const e=xn.getOrCreateInstance(this);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t]()}}))}}j.on(document,"click.bs.tab.data-api",'[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',(function(t){["A","AREA"].includes(this.tagName)&&t.preventDefault(),c(this)||xn.getOrCreateInstance(this).show()})),g(xn);const Dn="toast",Sn="hide",Nn="show",In="showing",Pn={animation:"boolean",autohide:"boolean",delay:"number"},jn={animation:!0,autohide:!0,delay:5e3};class Mn extends B{constructor(t,e){super(t),this._config=this._getConfig(e),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get DefaultType(){return Pn}static get Default(){return jn}static get NAME(){return Dn}show(){j.trigger(this._element,"show.bs.toast").defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Sn),u(this._element),this._element.classList.add(Nn),this._element.classList.add(In),this._queueCallback((()=>{this._element.classList.remove(In),j.trigger(this._element,"shown.bs.toast"),this._maybeScheduleHide()}),this._element,this._config.animation))}hide(){this._element.classList.contains(Nn)&&(j.trigger(this._element,"hide.bs.toast").defaultPrevented||(this._element.classList.add(In),this._queueCallback((()=>{this._element.classList.add(Sn),this._element.classList.remove(In),this._element.classList.remove(Nn),j.trigger(this._element,"hidden.bs.toast")}),this._element,this._config.animation)))}dispose(){this._clearTimeout(),this._element.classList.contains(Nn)&&this._element.classList.remove(Nn),super.dispose()}_getConfig(t){return t={...jn,...U.getDataAttributes(this._element),..."object"==typeof t&&t?t:{}},a(Dn,t,this.constructor.DefaultType),t}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((()=>{this.hide()}),this._config.delay)))}_onInteraction(t,e){switch(t.type){case"mouseover":case"mouseout":this._hasMouseInteraction=e;break;case"focusin":case"focusout":this._hasKeyboardInteraction=e}if(e)return void this._clearTimeout();const i=t.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){j.on(this._element,"mouseover.bs.toast",(t=>this._onInteraction(t,!0))),j.on(this._element,"mouseout.bs.toast",(t=>this._onInteraction(t,!1))),j.on(this._element,"focusin.bs.toast",(t=>this._onInteraction(t,!0))),j.on(this._element,"focusout.bs.toast",(t=>this._onInteraction(t,!1)))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(t){return this.each((function(){const e=Mn.getOrCreateInstance(this,t);if("string"==typeof t){if(void 0===e[t])throw new TypeError(`No method named "${t}"`);e[t](this)}}))}}return R(Mn),g(Mn),{Alert:W,Button:z,Carousel:st,Collapse:pt,Dropdown:hi,Modal:Hi,Offcanvas:Fi,Popover:gn,ScrollSpy:An,Tab:xn,Toast:Mn,Tooltip:un}})); +//# sourceMappingURL=bootstrap.bundle.min.js.map \ No newline at end of file From ad56b24fba58741f7122b39e592fffee63d3d399 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Wed, 27 Apr 2022 20:57:52 -0400 Subject: [PATCH 02/19] Update package.json --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 922ad02b..308929c4 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ }, "peerDependencies": { "@popperjs/core": "^2.0.0", - "bootstrap": "^4.4.0 || ^5.0.0", - "jquery": "^3.5.1" + "jquery": "^3.5.1", + "bootstrap": "^4.4.0 || ^5.0.0" } } From 52124b43b45d7e8dc8ce011d2e2e050534e8757e Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Wed, 27 Apr 2022 21:32:41 -0400 Subject: [PATCH 03/19] Removing bootbox.all.js bootbox.all.js is a manual merge of the base bootbox file and the locales file. We need a better, automated process for doing that. --- Gruntfile.js | 5 +- bootbox.all.js | 1444 ------------------------------------------------ bootbox.js | 123 +++-- package.json | 5 +- 4 files changed, 70 insertions(+), 1507 deletions(-) delete mode 100644 bootbox.all.js diff --git a/Gruntfile.js b/Gruntfile.js index 420b1fec..cab2fcd3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,8 +13,7 @@ module.exports = function (grunt) { my_target: { files: { 'dist/bootbox.min.js': ['bootbox.js'], - 'dist/bootbox.locales.min.js': ['bootbox.locales.js'], - 'dist/bootbox.all.min.js': ['bootbox.all.js'] + 'dist/bootbox.locales.min.js': ['bootbox.locales.js'] } } }, @@ -24,7 +23,7 @@ module.exports = function (grunt) { jshintrc: '.jshintrc', force: true }, - all: ['bootbox.js', 'bootbox.locales.js', 'bootbox.all.js'] + all: ['bootbox.js', 'bootbox.locales.js'] }, karma: { diff --git a/bootbox.all.js b/bootbox.all.js deleted file mode 100644 index 34c2e61f..00000000 --- a/bootbox.all.js +++ /dev/null @@ -1,1444 +0,0 @@ -/*! @preserve - * bootbox.js - * version: 5.5.2 - * author: Nick Payne - * license: MIT - * http://bootboxjs.com/ - */ -(function (root, factory) { - 'use strict'; - if (typeof define === 'function' && define.amd) { - // AMD - define(['jquery'], factory); - } else if (typeof exports === 'object') { - // Node, CommonJS-like - module.exports = factory(require('jquery')); - } else { - // Browser globals (root is window) - root.bootbox = factory(root.jQuery); - } -}(this, function init($, undefined) { - 'use strict'; - - // Polyfills Object.keys, if necessary. - // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys - if (!Object.keys) { - Object.keys = (function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, - hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), - dontEnums = [ - 'toString', - 'toLocaleString', - 'valueOf', - 'hasOwnProperty', - 'isPrototypeOf', - 'propertyIsEnumerable', - 'constructor' - ], - dontEnumsLength = dontEnums.length; - - return function (obj) { - if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { - throw new TypeError('Object.keys called on non-object'); - } - - var result = [], prop, i; - - for (prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - result.push(prop); - } - } - - if (hasDontEnumBug) { - for (i = 0; i < dontEnumsLength; i++) { - if (hasOwnProperty.call(obj, dontEnums[i])) { - result.push(dontEnums[i]); - } - } - } - - return result; - }; - }()); - } - - var exports = {}; - - var VERSION = '5.5.2'; - exports.VERSION = VERSION; - - var locales = { - ar : { - OK : 'موافق', - CANCEL : 'الغاء', - CONFIRM : 'تأكيد' - }, - bg_BG : { - OK : 'Ок', - CANCEL : 'Отказ', - CONFIRM : 'Потвърждавам' - }, - br : { - OK : 'OK', - CANCEL : 'Cancelar', - CONFIRM : 'Sim' - }, - cs : { - OK : 'OK', - CANCEL : 'Zrušit', - CONFIRM : 'Potvrdit' - }, - da : { - OK : 'OK', - CANCEL : 'Annuller', - CONFIRM : 'Accepter' - }, - de : { - OK : 'OK', - CANCEL : 'Abbrechen', - CONFIRM : 'Akzeptieren' - }, - el : { - OK : 'Εντάξει', - CANCEL : 'Ακύρωση', - CONFIRM : 'Επιβεβαίωση' - }, - en : { - OK : 'OK', - CANCEL : 'Cancel', - CONFIRM : 'OK' - }, - es : { - OK : 'OK', - CANCEL : 'Cancelar', - CONFIRM : 'Aceptar' - }, - eu : { - OK : 'OK', - CANCEL : 'Ezeztatu', - CONFIRM : 'Onartu' - }, - et : { - OK : 'OK', - CANCEL : 'Katkesta', - CONFIRM : 'OK' - }, - fa : { - OK : 'قبول', - CANCEL : 'لغو', - CONFIRM : 'تایید' - }, - fi : { - OK : 'OK', - CANCEL : 'Peruuta', - CONFIRM : 'OK' - }, - fr : { - OK : 'OK', - CANCEL : 'Annuler', - CONFIRM : 'Confirmer' - }, - he : { - OK : 'אישור', - CANCEL : 'ביטול', - CONFIRM : 'אישור' - }, - hu : { - OK : 'OK', - CANCEL : 'Mégsem', - CONFIRM : 'Megerősít' - }, - hr : { - OK : 'OK', - CANCEL : 'Odustani', - CONFIRM : 'Potvrdi' - }, - id : { - OK : 'OK', - CANCEL : 'Batal', - CONFIRM : 'OK' - }, - it : { - OK : 'OK', - CANCEL : 'Annulla', - CONFIRM : 'Conferma' - }, - ja : { - OK : 'OK', - CANCEL : 'キャンセル', - CONFIRM : '確認' - }, - ka : { - OK: 'OK', - CANCEL: 'გაუქმება', - CONFIRM: 'დადასტურება' - }, - ko : { - OK: 'OK', - CANCEL: '취소', - CONFIRM: '확인' - }, - lt : { - OK : 'Gerai', - CANCEL : 'Atšaukti', - CONFIRM : 'Patvirtinti' - }, - lv : { - OK : 'Labi', - CANCEL : 'Atcelt', - CONFIRM : 'Apstiprināt' - }, - nl : { - OK : 'OK', - CANCEL : 'Annuleren', - CONFIRM : 'Accepteren' - }, - no : { - OK : 'OK', - CANCEL : 'Avbryt', - CONFIRM : 'OK' - }, - pl : { - OK : 'OK', - CANCEL : 'Anuluj', - CONFIRM : 'Potwierdź' - }, - pt : { - OK : 'OK', - CANCEL : 'Cancelar', - CONFIRM : 'Confirmar' - }, - ru : { - OK : 'OK', - CANCEL : 'Отмена', - CONFIRM : 'Применить' - }, - sk : { - OK : 'OK', - CANCEL : 'Zrušiť', - CONFIRM : 'Potvrdiť' - }, - sl : { - OK : 'OK', - CANCEL : 'Prekliči', - CONFIRM : 'Potrdi' - }, - sq : { - OK : 'OK', - CANCEL : 'Anulo', - CONFIRM : 'Prano' - }, - sv : { - OK : 'OK', - CANCEL : 'Avbryt', - CONFIRM : 'OK' - }, - sw: { - OK : 'Sawa', - CANCEL : 'Ghairi', - CONFIRM: 'Thibitisha' - }, - ta:{ - OK : 'சரி', - CANCEL : 'ரத்து செய்', - CONFIRM : 'உறுதி செய்' - }, - th : { - OK : 'ตกลง', - CANCEL : 'ยกเลิก', - CONFIRM : 'ยืนยัน' - }, - tr : { - OK : 'Tamam', - CANCEL : 'İptal', - CONFIRM : 'Onayla' - }, - uk : { - OK : 'OK', - CANCEL : 'Відміна', - CONFIRM : 'Прийняти' - }, - vi : { - OK : 'OK', - CANCEL : 'Hủy bỏ', - CONFIRM : 'Xác nhận' - }, - zh_CN : { - OK : 'OK', - CANCEL : '取消', - CONFIRM : '确认' - }, - zh_TW : { - OK : 'OK', - CANCEL : '取消', - CONFIRM : '確認' - } - }; - - var templates = { - dialog: - '', - header: - '', - footer: - '', - closeButton: - '', - form: - '
', - button: - '', - option: - '', - promptMessage: - '
', - inputs: { - text: - '', - textarea: - '', - email: - '', - select: - '', - checkbox: - '
', - radio: - '
', - date: - '', - time: - '', - number: - '', - password: - '', - range: - '' - } - }; - - - var defaults = { - // default language - locale: 'en', - // show backdrop or not. Default to static so user has to interact with dialog - backdrop: 'static', - // animate the modal in/out - animate: true, - // additional class string applied to the top level dialog - className: null, - // whether or not to include a close button - closeButton: true, - // show the dialog immediately by default - show: true, - // dialog container - container: 'body', - // default value (used by the prompt helper) - value: '', - // default input type (used by the prompt helper) - inputType: 'text', - // switch button order from cancel/confirm (default) to confirm/cancel - swapButtonOrder: false, - // center modal vertically in page - centerVertical: false, - // Append "multiple" property to the select when using the "prompt" helper - multiple: false, - // Automatically scroll modal content when height exceeds viewport height - scrollable: false, - // whether or not to destroy the modal on hide - reusable: false - }; - - - // PUBLIC FUNCTIONS - // ************************************************************************************************************* - - // Return all currently registered locales, or a specific locale if "name" is defined - exports.locales = function (name) { - return name ? locales[name] : locales; - }; - - - // Register localized strings for the OK, CONFIRM, and CANCEL buttons - exports.addLocale = function (name, values) { - $.each(['OK', 'CANCEL', 'CONFIRM'], function (_, v) { - if (!values[v]) { - throw new Error('Please supply a translation for "' + v + '"'); - } - }); - - locales[name] = { - OK: values.OK, - CANCEL: values.CANCEL, - CONFIRM: values.CONFIRM - }; - - return exports; - }; - - - // Remove a previously-registered locale - exports.removeLocale = function (name) { - if (name !== 'en') { - delete locales[name]; - } - else { - throw new Error('"en" is used as the default and fallback locale and cannot be removed.'); - } - - return exports; - }; - - - // Set the default locale - exports.setLocale = function (name) { - return exports.setDefaults('locale', name); - }; - - - // Override default value(s) of Bootbox. - exports.setDefaults = function () { - var values = {}; - - if (arguments.length === 2) { - // allow passing of single key/value... - values[arguments[0]] = arguments[1]; - } else { - // ... and as an object too - values = arguments[0]; - } - - $.extend(defaults, values); - - return exports; - }; - - - // Hides all currently active Bootbox modals - exports.hideAll = function () { - $('.bootbox').modal('hide'); - - return exports; - }; - - - // Allows the base init() function to be overridden - exports.init = function (_$) { - return init(_$ || $); - }; - - - // CORE HELPER FUNCTIONS - // ************************************************************************************************************* - - // Core dialog function - exports.dialog = function (options) { - if ($.fn.modal === undefined) { - throw new Error( - '"$.fn.modal" is not defined; please double check you have included ' + - 'the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.4/getting-started/javascript/ ' + - 'for more details.' - ); - } - - options = sanitize(options); - - if ($.fn.modal.Constructor.VERSION) { - options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION; - var i = options.fullBootstrapVersion.indexOf('.'); - options.bootstrap = options.fullBootstrapVersion.substring(0, i); - } - else { - // Assuming version 2.3.2, as that was the last "supported" 2.x version - options.bootstrap = '2'; - options.fullBootstrapVersion = '2.3.2'; - console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.'); - } - - var dialog = $(templates.dialog); - var innerDialog = dialog.find('.modal-dialog'); - var body = dialog.find('.modal-body'); - var header = $(templates.header); - var footer = $(templates.footer); - var buttons = options.buttons; - - var callbacks = { - onEscape: options.onEscape - }; - - body.find('.bootbox-body').html(options.message); - - // Only attempt to create buttons if at least one has - // been defined in the options object - if (getKeyLength(options.buttons) > 0) { - each(buttons, function (key, b) { - var button = $(templates.button); - button.data('bb-handler', key); - button.addClass(b.className); - - switch (key) { - case 'ok': - case 'confirm': - button.addClass('bootbox-accept'); - break; - - case 'cancel': - button.addClass('bootbox-cancel'); - break; - } - - button.html(b.label); - footer.append(button); - - callbacks[key] = b.callback; - }); - - body.after(footer); - } - - if (options.animate === true) { - dialog.addClass('fade'); - } - - if (options.className) { - dialog.addClass(options.className); - } - - if (options.size) { - // Requires Bootstrap 3.1.0 or higher - if (options.fullBootstrapVersion.substring(0, 3) < '3.1') { - console.warn('"size" requires Bootstrap 3.1.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); - } - - switch (options.size) { - case 'small': - case 'sm': - innerDialog.addClass('modal-sm'); - break; - - case 'large': - case 'lg': - innerDialog.addClass('modal-lg'); - break; - - case 'extra-large': - case 'xl': - innerDialog.addClass('modal-xl'); - - // Requires Bootstrap 4.2.0 or higher - if (options.fullBootstrapVersion.substring(0, 3) < '4.2') { - console.warn('Using size "xl"/"extra-large" requires Bootstrap 4.2.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); - } - break; - } - } - - if (options.scrollable) { - innerDialog.addClass('modal-dialog-scrollable'); - - // Requires Bootstrap 4.3.0 or higher - if (options.fullBootstrapVersion.substring(0, 3) < '4.3') { - console.warn('Using "scrollable" requires Bootstrap 4.3.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); - } - } - - if (options.title) { - body.before(header); - dialog.find('.modal-title').html(options.title); - } - - if (options.closeButton) { - var closeButton = $(templates.closeButton); - - if (options.title) { - if (options.bootstrap > 3) { - dialog.find('.modal-header').append(closeButton); - } - else { - dialog.find('.modal-header').prepend(closeButton); - } - } else { - closeButton.prependTo(body); - } - } - - if (options.centerVertical) { - innerDialog.addClass('modal-dialog-centered'); - - // Requires Bootstrap 4.0.0-beta.3 or higher - if (options.fullBootstrapVersion < '4.0.0') { - console.warn('"centerVertical" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); - } - } - - // Bootstrap event listeners; these handle extra - // setup & teardown required after the underlying - // modal has performed certain actions. - - if(!options.reusable) { - // make sure we unbind any listeners once the dialog has definitively been dismissed - dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal); - } - - if (options.onHide) { - if ($.isFunction(options.onHide)) { - dialog.on('hide.bs.modal', options.onHide); - } - else { - throw new Error('Argument supplied to "onHide" must be a function'); - } - } - - if(!options.reusable) { - dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal); - } - - if (options.onHidden) { - if ($.isFunction(options.onHidden)) { - dialog.on('hidden.bs.modal', options.onHidden); - } - else { - throw new Error('Argument supplied to "onHidden" must be a function'); - } - } - - if (options.onShow) { - if ($.isFunction(options.onShow)) { - dialog.on('show.bs.modal', options.onShow); - } - else { - throw new Error('Argument supplied to "onShow" must be a function'); - } - } - - dialog.one('shown.bs.modal', { dialog: dialog }, focusPrimaryButton); - - if (options.onShown) { - if ($.isFunction(options.onShown)) { - dialog.on('shown.bs.modal', options.onShown); - } - else { - throw new Error('Argument supplied to "onShown" must be a function'); - } - } - - // Bootbox event listeners; used to decouple some - // behaviours from their respective triggers - - if (options.backdrop === true) { - // A boolean true/false according to the Bootstrap docs - // should show a dialog the user can dismiss by clicking on - // the background. - // We always only ever pass static/false to the actual - // $.modal function because with "true" we can't trap - // this event (the .modal-backdrop swallows it) - // However, we still want to sort-of respect true - // and invoke the escape mechanism instead - dialog.on('click.dismiss.bs.modal', function (e) { - // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop - // moved *inside* the outer dialog rather than *alongside* it - if (dialog.children('.modal-backdrop').length) { - e.currentTarget = dialog.children('.modal-backdrop').get(0); - } - - if (e.target !== e.currentTarget) { - return; - } - - dialog.trigger('escape.close.bb'); - }); - } - - dialog.on('escape.close.bb', function (e) { - // the if statement looks redundant but it isn't; without it - // if we *didn't* have an onEscape handler then processCallback - // would automatically dismiss the dialog - if (callbacks.onEscape) { - processCallback(e, dialog, callbacks.onEscape); - } - }); - - - dialog.on('click', '.modal-footer button:not(.disabled)', function (e) { - var callbackKey = $(this).data('bb-handler'); - - if (callbackKey !== undefined) { - // Only process callbacks for buttons we recognize: - processCallback(e, dialog, callbacks[callbackKey]); - } - }); - - dialog.on('click', '.bootbox-close-button', function (e) { - // onEscape might be falsy but that's fine; the fact is - // if the user has managed to click the close button we - // have to close the dialog, callback or not - processCallback(e, dialog, callbacks.onEscape); - }); - - dialog.on('keyup', function (e) { - if (e.which === 27) { - dialog.trigger('escape.close.bb'); - } - }); - - // the remainder of this method simply deals with adding our - // dialog element to the DOM, augmenting it with Bootstrap's modal - // functionality and then giving the resulting object back - // to our caller - - $(options.container).append(dialog); - - dialog.modal({ - backdrop: options.backdrop, - keyboard: false, - show: false - }); - - if (options.show) { - dialog.modal('show'); - } - - return dialog; - }; - - - // Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the alert is dismissed should be placed within the callback function - // for this alert. - exports.alert = function () { - var options; - - options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments); - - // @TODO: can this move inside exports.dialog when we're iterating over each - // button and checking its button.callback value instead? - if (options.callback && !$.isFunction(options.callback)) { - throw new Error('alert requires the "callback" property to be a function when provided'); - } - - // override the ok and escape callback to make sure they just invoke - // the single user-supplied one (if provided) - options.buttons.ok.callback = options.onEscape = function () { - if ($.isFunction(options.callback)) { - return options.callback.call(this); - } - - return true; - }; - - return exports.dialog(options); - }; - - - // Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the confirm is dismissed should be placed within the callback function - // for this confirm. - exports.confirm = function () { - var options; - - options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments); - - // confirm specific validation; they don't make sense without a callback so make - // sure it's present - if (!$.isFunction(options.callback)) { - throw new Error('confirm requires a callback'); - } - - // overrides; undo anything the user tried to set they shouldn't have - options.buttons.cancel.callback = options.onEscape = function () { - return options.callback.call(this, false); - }; - - options.buttons.confirm.callback = function () { - return options.callback.call(this, true); - }; - - return exports.dialog(options); - }; - - - // Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the prompt is dismissed should be placed within the callback function - // for this prompt. - exports.prompt = function () { - var options; - var promptDialog; - var form; - var input; - var shouldShow; - var inputOptions; - - // we have to create our form first otherwise - // its value is undefined when gearing up our options - // @TODO this could be solved by allowing message to - // be a function instead... - form = $(templates.form); - - // prompt defaults are more complex than others in that - // users can override more defaults - options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments); - - if (!options.value) { - options.value = defaults.value; - } - - if (!options.inputType) { - options.inputType = defaults.inputType; - } - - // capture the user's show value; we always set this to false before - // spawning the dialog to give us a chance to attach some handlers to - // it, but we need to make sure we respect a preference not to show it - shouldShow = (options.show === undefined) ? defaults.show : options.show; - - // This is required prior to calling the dialog builder below - we need to - // add an event handler just before the prompt is shown - options.show = false; - - // Handles the 'cancel' action - options.buttons.cancel.callback = options.onEscape = function () { - return options.callback.call(this, null); - }; - - // Prompt submitted - extract the prompt value. This requires a bit of work, - // given the different input types available. - options.buttons.confirm.callback = function () { - var value; - - if (options.inputType === 'checkbox') { - value = input.find('input:checked').map(function () { - return $(this).val(); - }).get(); - } else if (options.inputType === 'radio') { - value = input.find('input:checked').val(); - } - else { - if (input[0].checkValidity && !input[0].checkValidity()) { - // prevents button callback from being called - return false; - } else { - if (options.inputType === 'select' && options.multiple === true) { - value = input.find('option:selected').map(function () { - return $(this).val(); - }).get(); - } - else { - value = input.val(); - } - } - } - - return options.callback.call(this, value); - }; - - // prompt-specific validation - if (!options.title) { - throw new Error('prompt requires a title'); - } - - if (!$.isFunction(options.callback)) { - throw new Error('prompt requires a callback'); - } - - if (!templates.inputs[options.inputType]) { - throw new Error('Invalid prompt type'); - } - - // create the input based on the supplied type - input = $(templates.inputs[options.inputType]); - - switch (options.inputType) { - case 'text': - case 'textarea': - case 'email': - case 'password': - input.val(options.value); - - if (options.placeholder) { - input.attr('placeholder', options.placeholder); - } - - if (options.pattern) { - input.attr('pattern', options.pattern); - } - - if (options.maxlength) { - input.attr('maxlength', options.maxlength); - } - - if (options.required) { - input.prop({ 'required': true }); - } - - if (options.rows && !isNaN(parseInt(options.rows))) { - if (options.inputType === 'textarea') { - input.attr({ 'rows': options.rows }); - } - } - - break; - - - case 'date': - case 'time': - case 'number': - case 'range': - input.val(options.value); - - if (options.placeholder) { - input.attr('placeholder', options.placeholder); - } - - if (options.pattern) { - input.attr('pattern', options.pattern); - } - - if (options.required) { - input.prop({ 'required': true }); - } - - // These input types have extra attributes which affect their input validation. - // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so - // this attribute will have no effect. Therefore, we don't set the attribute for date inputs. - // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates - if (options.inputType !== 'date') { - if (options.step) { - if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) { - input.attr('step', options.step); - } - else { - throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.'); - } - } - } - - if (minAndMaxAreValid(options.inputType, options.min, options.max)) { - if (options.min !== undefined) { - input.attr('min', options.min); - } - if (options.max !== undefined) { - input.attr('max', options.max); - } - } - - break; - - - case 'select': - var groups = {}; - inputOptions = options.inputOptions || []; - - if (!$.isArray(inputOptions)) { - throw new Error('Please pass an array of input options'); - } - - if (!inputOptions.length) { - throw new Error('prompt with "inputType" set to "select" requires at least one option'); - } - - // placeholder is not actually a valid attribute for select, - // but we'll allow it, assuming it might be used for a plugin - if (options.placeholder) { - input.attr('placeholder', options.placeholder); - } - - if (options.required) { - input.prop({ 'required': true }); - } - - if (options.multiple) { - input.prop({ 'multiple': true }); - } - - each(inputOptions, function (_, option) { - // assume the element to attach to is the input... - var elem = input; - - if (option.value === undefined || option.text === undefined) { - throw new Error('each option needs a "value" property and a "text" property'); - } - - // ... but override that element if this option sits in a group - - if (option.group) { - // initialise group if necessary - if (!groups[option.group]) { - groups[option.group] = $('').attr('label', option.group); - } - - elem = groups[option.group]; - } - - var o = $(templates.option); - o.attr('value', option.value).text(option.text); - elem.append(o); - }); - - each(groups, function (_, group) { - input.append(group); - }); - - // safe to set a select's value as per a normal input - input.val(options.value); - - break; - - - case 'checkbox': - var checkboxValues = $.isArray(options.value) ? options.value : [options.value]; - inputOptions = options.inputOptions || []; - - if (!inputOptions.length) { - throw new Error('prompt with "inputType" set to "checkbox" requires at least one option'); - } - - // checkboxes have to nest within a containing element, so - // they break the rules a bit and we end up re-assigning - // our 'input' element to this container instead - input = $('
'); - - each(inputOptions, function (_, option) { - if (option.value === undefined || option.text === undefined) { - throw new Error('each option needs a "value" property and a "text" property'); - } - - var checkbox = $(templates.inputs[options.inputType]); - - checkbox.find('input').attr('value', option.value); - checkbox.find('label').append('\n' + option.text); - - // we've ensured values is an array so we can always iterate over it - each(checkboxValues, function (_, value) { - if (value === option.value) { - checkbox.find('input').prop('checked', true); - } - }); - - input.append(checkbox); - }); - break; - - - case 'radio': - // Make sure that value is not an array (only a single radio can ever be checked) - if (options.value !== undefined && $.isArray(options.value)) { - throw new Error('prompt with "inputType" set to "radio" requires a single, non-array value for "value"'); - } - - inputOptions = options.inputOptions || []; - - if (!inputOptions.length) { - throw new Error('prompt with "inputType" set to "radio" requires at least one option'); - } - - // Radiobuttons have to nest within a containing element, so - // they break the rules a bit and we end up re-assigning - // our 'input' element to this container instead - input = $('
'); - - // Radiobuttons should always have an initial checked input checked in a "group". - // If value is undefined or doesn't match an input option, select the first radiobutton - var checkFirstRadio = true; - - each(inputOptions, function (_, option) { - if (option.value === undefined || option.text === undefined) { - throw new Error('each option needs a "value" property and a "text" property'); - } - - var radio = $(templates.inputs[options.inputType]); - - radio.find('input').attr('value', option.value); - radio.find('label').append('\n' + option.text); - - if (options.value !== undefined) { - if (option.value === options.value) { - radio.find('input').prop('checked', true); - checkFirstRadio = false; - } - } - - input.append(radio); - }); - - if (checkFirstRadio) { - input.find('input[type="radio"]').first().prop('checked', true); - } - break; - } - - // now place it in our form - form.append(input); - - form.on('submit', function (e) { - e.preventDefault(); - // Fix for SammyJS (or similar JS routing library) hijacking the form post. - e.stopPropagation(); - - // @TODO can we actually click *the* button object instead? - // e.g. buttons.confirm.click() or similar - promptDialog.find('.bootbox-accept').trigger('click'); - }); - - if ($.trim(options.message) !== '') { - // Add the form to whatever content the user may have added. - var message = $(templates.promptMessage).html(options.message); - form.prepend(message); - options.message = form; - } - else { - options.message = form; - } - - // Generate the dialog - promptDialog = exports.dialog(options); - - // clear the existing handler focusing the submit button... - promptDialog.off('shown.bs.modal', focusPrimaryButton); - - // ...and replace it with one focusing our input, if possible - promptDialog.on('shown.bs.modal', function () { - // need the closure here since input isn't - // an object otherwise - input.focus(); - }); - - if (shouldShow === true) { - promptDialog.modal('show'); - } - - return promptDialog; - }; - - - // INTERNAL FUNCTIONS - // ************************************************************************************************************* - - // Map a flexible set of arguments into a single returned object - // If args.length is already one just return it, otherwise - // use the properties argument to map the unnamed args to - // object properties. - // So in the latter case: - // mapArguments(["foo", $.noop], ["message", "callback"]) - // -> { message: "foo", callback: $.noop } - function mapArguments(args, properties) { - var argn = args.length; - var options = {}; - - if (argn < 1 || argn > 2) { - throw new Error('Invalid argument length'); - } - - if (argn === 2 || typeof args[0] === 'string') { - options[properties[0]] = args[0]; - options[properties[1]] = args[1]; - } else { - options = args[0]; - } - - return options; - } - - - // Merge a set of default dialog options with user supplied arguments - function mergeArguments(defaults, args, properties) { - return $.extend( - // deep merge - true, - // ensure the target is an empty, unreferenced object - {}, - // the base options object for this type of dialog (often just buttons) - defaults, - // args could be an object or array; if it's an array properties will - // map it to a proper options object - mapArguments( - args, - properties - ) - ); - } - - - // This entry-level method makes heavy use of composition to take a simple - // range of inputs and return valid options suitable for passing to bootbox.dialog - function mergeDialogOptions(className, labels, properties, args) { - var locale; - if (args && args[0]) { - locale = args[0].locale || defaults.locale; - var swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder; - - if (swapButtons) { - labels = labels.reverse(); - } - } - - // build up a base set of dialog properties - var baseOptions = { - className: 'bootbox-' + className, - buttons: createLabels(labels, locale) - }; - - // Ensure the buttons properties generated, *after* merging - // with user args are still valid against the supplied labels - return validateButtons( - // merge the generated base properties with user supplied arguments - mergeArguments( - baseOptions, - args, - // if args.length > 1, properties specify how each arg maps to an object key - properties - ), - labels - ); - } - - - // Checks each button object to see if key is valid. - // This function will only be called by the alert, confirm, and prompt helpers. - function validateButtons(options, buttons) { - var allowedButtons = {}; - each(buttons, function (key, value) { - allowedButtons[value] = true; - }); - - each(options.buttons, function (key) { - if (allowedButtons[key] === undefined) { - throw new Error('button key "' + key + '" is not allowed (options are ' + buttons.join(' ') + ')'); - } - }); - - return options; - } - - - - // From a given list of arguments, return a suitable object of button labels. - // All this does is normalise the given labels and translate them where possible. - // e.g. "ok", "confirm" -> { ok: "OK", cancel: "Annuleren" } - function createLabels(labels, locale) { - var buttons = {}; - - for (var i = 0, j = labels.length; i < j; i++) { - var argument = labels[i]; - var key = argument.toLowerCase(); - var value = argument.toUpperCase(); - - buttons[key] = { - label: getText(value, locale) - }; - } - - return buttons; - } - - - - // Get localized text from a locale. Defaults to 'en' locale if no locale - // provided or a non-registered locale is requested - function getText(key, locale) { - var labels = locales[locale]; - - return labels ? labels[key] : locales.en[key]; - } - - - - // Filter and tidy up any user supplied parameters to this dialog. - // Also looks for any shorthands used and ensures that the options - // which are returned are all normalized properly - function sanitize(options) { - var buttons; - var total; - - if (typeof options !== 'object') { - throw new Error('Please supply an object of options'); - } - - if (!options.message) { - throw new Error('"message" option must not be null or an empty string.'); - } - - // make sure any supplied options take precedence over defaults - options = $.extend({}, defaults, options); - - //make sure backdrop is either true, false, or 'static' - if (!options.backdrop) { - options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static'; - } else { - options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true; - } - - // no buttons is still a valid dialog but it's cleaner to always have - // a buttons object to iterate over, even if it's empty - if (!options.buttons) { - options.buttons = {}; - } - - buttons = options.buttons; - - total = getKeyLength(buttons); - - each(buttons, function (key, button, index) { - if ($.isFunction(button)) { - // short form, assume value is our callback. Since button - // isn't an object it isn't a reference either so re-assign it - button = buttons[key] = { - callback: button - }; - } - - // before any further checks make sure by now button is the correct type - if ($.type(button) !== 'object') { - throw new Error('button with key "' + key + '" must be an object'); - } - - if (!button.label) { - // the lack of an explicit label means we'll assume the key is good enough - button.label = key; - } - - if (!button.className) { - var isPrimary = false; - if (options.swapButtonOrder) { - isPrimary = index === 0; - } - else { - isPrimary = index === total - 1; - } - - if (total <= 2 && isPrimary) { - // always add a primary to the main option in a one or two-button dialog - button.className = 'btn-primary'; - } else { - // adding both classes allows us to target both BS3 and BS4 without needing to check the version - button.className = 'btn-secondary btn-default'; - } - } - }); - - return options; - } - - - // Returns a count of the properties defined on the object - function getKeyLength(obj) { - return Object.keys(obj).length; - } - - - // Tiny wrapper function around jQuery.each; just adds index as the third parameter - function each(collection, iterator) { - var index = 0; - $.each(collection, function (key, value) { - iterator(key, value, index++); - }); - } - - - function focusPrimaryButton(e) { - e.data.dialog.find('.bootbox-accept').first().trigger('focus'); - } - - - function destroyModal(e) { - // ensure we don't accidentally intercept hidden events triggered - // by children of the current dialog. We shouldn't need to handle this anymore, - // now that Bootstrap namespaces its events, but still worth doing. - if (e.target === e.data.dialog[0]) { - e.data.dialog.remove(); - } - } - - - function unbindModal(e) { - if (e.target === e.data.dialog[0]) { - e.data.dialog.off('escape.close.bb'); - e.data.dialog.off('click'); - } - } - - - // Handle the invoked dialog callback - function processCallback(e, dialog, callback) { - e.stopPropagation(); - e.preventDefault(); - - // by default we assume a callback will get rid of the dialog, - // although it is given the opportunity to override this - - // so, if the callback can be invoked and it *explicitly returns false* - // then we'll set a flag to keep the dialog active... - var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; - - // ... otherwise we'll bin it - if (!preserveDialog) { - dialog.modal('hide'); - } - } - - // Validate `min` and `max` values based on the current `inputType` value - function minAndMaxAreValid(type, min, max) { - var result = false; - var minValid = true; - var maxValid = true; - - if (type === 'date') { - if (min !== undefined && !(minValid = dateIsValid(min))) { - console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.'); - } - else if (max !== undefined && !(maxValid = dateIsValid(max))) { - console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.'); - } - } - else if (type === 'time') { - if (min !== undefined && !(minValid = timeIsValid(min))) { - throw new Error('"min" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.'); - } - else if (max !== undefined && !(maxValid = timeIsValid(max))) { - throw new Error('"max" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.'); - } - } - else { - if (min !== undefined && isNaN(min)) { - minValid = false; - throw new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.'); - } - - if (max !== undefined && isNaN(max)) { - maxValid = false; - throw new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); - } - } - - if (minValid && maxValid) { - if (max <= min) { - throw new Error('"max" must be greater than "min". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); - } - else { - result = true; - } - } - - return result; - } - - function timeIsValid(value) { - return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(value); - } - - function dateIsValid(value) { - return /(\d{4})-(\d{2})-(\d{2})/.test(value); - } - - // The Bootbox object - return exports; -})); \ No newline at end of file diff --git a/bootbox.js b/bootbox.js index 8006899d..40412662 100644 --- a/bootbox.js +++ b/bootbox.js @@ -24,7 +24,7 @@ // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys if (!Object.keys) { Object.keys = (function () { - var hasOwnProperty = Object.prototype.hasOwnProperty, + let hasOwnProperty = Object.prototype.hasOwnProperty, hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), dontEnums = [ 'toString', @@ -42,7 +42,7 @@ throw new TypeError('Object.keys called on non-object'); } - var result = [], prop, i; + let result = [], prop, i; for (prop in obj) { if (hasOwnProperty.call(obj, prop)) { @@ -63,12 +63,12 @@ }()); } - var exports = {}; + let exports = {}; - var VERSION = '6.0.0-wip'; + let VERSION = '6.0.0-wip'; exports.VERSION = VERSION; - var locales = { + let locales = { en : { OK : 'OK', CANCEL : 'Cancel', @@ -76,14 +76,14 @@ } }; - var templates = { + let templates = { dialog: '', header: '', footer: '', closeButton: '', form: '
', button: '', - option: '', + option: '', promptMessage: '
', inputs: { text: '', @@ -101,7 +101,7 @@ }; - var defaults = { + let defaults = { // default language locale: 'en', // show backdrop or not. Default to static so user has to interact with dialog @@ -183,7 +183,7 @@ // Override default value(s) of Bootbox. exports.setDefaults = function () { - var values = {}; + let values = {}; if (arguments.length === 2) { // allow passing of single key/value... @@ -230,7 +230,7 @@ if ($.fn.modal.Constructor.VERSION) { options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION; - var i = options.fullBootstrapVersion.indexOf('.'); + let i = options.fullBootstrapVersion.indexOf('.'); options.bootstrap = options.fullBootstrapVersion.substring(0, i); } else { @@ -240,14 +240,14 @@ console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.'); } - var dialog = $(templates.dialog); - var innerDialog = dialog.find('.modal-dialog'); - var body = dialog.find('.modal-body'); - var header = $(templates.header); - var footer = $(templates.footer); - var buttons = options.buttons; + let dialog = $(templates.dialog); + let innerDialog = dialog.find('.modal-dialog'); + let body = dialog.find('.modal-body'); + let header = $(templates.header); + let footer = $(templates.footer); + let buttons = options.buttons; - var callbacks = { + let callbacks = { onEscape: options.onEscape }; @@ -257,7 +257,7 @@ // been defined in the options object if (getKeyLength(options.buttons) > 0) { each(buttons, function (key, b) { - var button = $(templates.button); + let button = $(templates.button); button.data('bb-handler', key); button.addClass(b.className); @@ -273,6 +273,15 @@ } button.html(b.label); + + if (b.id) { + button.attr({ 'id': b.id }); + } + + if (b.disabled === true) { + button.prop({ disabled: true }); + } + footer.append(button); callbacks[key] = b.callback; @@ -333,7 +342,7 @@ } if (options.closeButton) { - var closeButton = $(templates.closeButton); + let closeButton = $(templates.closeButton); if (options.title) { if (options.bootstrap > 3) { @@ -445,7 +454,7 @@ dialog.on('click', '.modal-footer button:not(.disabled)', function (e) { - var callbackKey = $(this).data('bb-handler'); + let callbackKey = $(this).data('bb-handler'); if (callbackKey !== undefined) { // Only process callbacks for buttons we recognize: @@ -491,7 +500,7 @@ // code that must happen after the alert is dismissed should be placed within the callback function // for this alert. exports.alert = function () { - var options; + let options; options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments); @@ -519,7 +528,7 @@ // code that must happen after the confirm is dismissed should be placed within the callback function // for this confirm. exports.confirm = function () { - var options; + let options; options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments); @@ -546,12 +555,12 @@ // code that must happen after the prompt is dismissed should be placed within the callback function // for this prompt. exports.prompt = function () { - var options; - var promptDialog; - var form; - var input; - var shouldShow; - var inputOptions; + let options; + let promptDialog; + let form; + let input; + let shouldShow; + let inputOptions; // we have to create our form first otherwise // its value is undefined when gearing up our options @@ -588,7 +597,7 @@ // Prompt submitted - extract the prompt value. This requires a bit of work, // given the different input types available. options.buttons.confirm.callback = function () { - var value; + let value; if (options.inputType === 'checkbox') { value = input.find('input:checked').map(function () { @@ -710,7 +719,7 @@ case 'select': - var groups = {}; + let groups = {}; inputOptions = options.inputOptions || []; if (!$.isArray(inputOptions)) { @@ -737,7 +746,7 @@ each(inputOptions, function (_, option) { // assume the element to attach to is the input... - var elem = input; + let elem = input; if (option.value === undefined || option.text === undefined) { throw new Error('each option needs a "value" property and a "text" property'); @@ -754,7 +763,7 @@ elem = groups[option.group]; } - var o = $(templates.option); + let o = $(templates.option); o.attr('value', option.value).text(option.text); elem.append(o); }); @@ -770,7 +779,7 @@ case 'checkbox': - var checkboxValues = $.isArray(options.value) ? options.value : [options.value]; + let checkboxValues = $.isArray(options.value) ? options.value : [options.value]; inputOptions = options.inputOptions || []; if (!inputOptions.length) { @@ -787,7 +796,7 @@ throw new Error('each option needs a "value" property and a "text" property'); } - var checkbox = $(templates.inputs[options.inputType]); + let checkbox = $(templates.inputs[options.inputType]); checkbox.find('input').attr('value', option.value); checkbox.find('label').append('\n' + option.text); @@ -823,14 +832,14 @@ // Radiobuttons should always have an initial checked input checked in a "group". // If value is undefined or doesn't match an input option, select the first radiobutton - var checkFirstRadio = true; + let checkFirstRadio = true; each(inputOptions, function (_, option) { if (option.value === undefined || option.text === undefined) { throw new Error('each option needs a "value" property and a "text" property'); } - var radio = $(templates.inputs[options.inputType]); + let radio = $(templates.inputs[options.inputType]); radio.find('input').attr('value', option.value); radio.find('label').append('\n' + option.text); @@ -866,7 +875,7 @@ if ($.trim(options.message) !== '') { // Add the form to whatever content the user may have added. - var message = $(templates.promptMessage).html(options.message); + let message = $(templates.promptMessage).html(options.message); form.prepend(message); options.message = form; } @@ -906,8 +915,8 @@ // mapArguments(["foo", $.noop], ["message", "callback"]) // -> { message: "foo", callback: $.noop } function mapArguments(args, properties) { - var argn = args.length; - var options = {}; + let argn = args.length; + let options = {}; if (argn < 1 || argn > 2) { throw new Error('Invalid argument length'); @@ -946,10 +955,10 @@ // This entry-level method makes heavy use of composition to take a simple // range of inputs and return valid options suitable for passing to bootbox.dialog function mergeDialogOptions(className, labels, properties, args) { - var locale; + let locale; if (args && args[0]) { locale = args[0].locale || defaults.locale; - var swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder; + let swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder; if (swapButtons) { labels = labels.reverse(); @@ -957,7 +966,7 @@ } // build up a base set of dialog properties - var baseOptions = { + let baseOptions = { className: 'bootbox-' + className, buttons: createLabels(labels, locale) }; @@ -980,7 +989,7 @@ // Checks each button object to see if key is valid. // This function will only be called by the alert, confirm, and prompt helpers. function validateButtons(options, buttons) { - var allowedButtons = {}; + let allowedButtons = {}; each(buttons, function (key, value) { allowedButtons[value] = true; }); @@ -1000,12 +1009,12 @@ // All this does is normalise the given labels and translate them where possible. // e.g. "ok", "confirm" -> { ok: "OK", cancel: "Annuleren" } function createLabels(labels, locale) { - var buttons = {}; + let buttons = {}; - for (var i = 0, j = labels.length; i < j; i++) { - var argument = labels[i]; - var key = argument.toLowerCase(); - var value = argument.toUpperCase(); + for (let i = 0, j = labels.length; i < j; i++) { + let argument = labels[i]; + let key = argument.toLowerCase(); + let value = argument.toUpperCase(); buttons[key] = { label: getText(value, locale) @@ -1020,7 +1029,7 @@ // Get localized text from a locale. Defaults to 'en' locale if no locale // provided or a non-registered locale is requested function getText(key, locale) { - var labels = locales[locale]; + let labels = locales[locale]; return labels ? labels[key] : locales.en[key]; } @@ -1031,8 +1040,8 @@ // Also looks for any shorthands used and ensures that the options // which are returned are all normalized properly function sanitize(options) { - var buttons; - var total; + let buttons; + let total; if (typeof options !== 'object') { throw new Error('Please supply an object of options'); @@ -1082,7 +1091,7 @@ } if (!button.className) { - var isPrimary = false; + let isPrimary = false; if (options.swapButtonOrder) { isPrimary = index === 0; } @@ -1112,7 +1121,7 @@ // Tiny wrapper function around jQuery.each; just adds index as the third parameter function each(collection, iterator) { - var index = 0; + let index = 0; $.each(collection, function (key, value) { iterator(key, value, index++); }); @@ -1152,7 +1161,7 @@ // so, if the callback can be invoked and it *explicitly returns false* // then we'll set a flag to keep the dialog active... - var preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; + let preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; // ... otherwise we'll bin it if (!preserveDialog) { @@ -1162,9 +1171,9 @@ // Validate `min` and `max` values based on the current `inputType` value function minAndMaxAreValid(type, min, max) { - var result = false; - var minValid = true; - var maxValid = true; + let result = false; + let minValid = true; + let maxValid = true; if (type === 'date') { if (min !== undefined && !(minValid = dateIsValid(min))) { diff --git a/package.json b/package.json index 308929c4..59194e4d 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,11 @@ "author": "Nick Payne ", "license": "MIT", "readmeFilename": "README.md", - "main": "bootbox.all.js", + "main": "bootbox.js", "files": [ "dist/*.js", "bootbox.js", - "bootbox.locales.js", - "bootbox.all.js" + "bootbox.locales.js" ], "devDependencies": { "chai": "^4.2.0", From 5bc956b66d62995b2db3e7aa31540916eb6138b4 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Thu, 28 Apr 2022 15:26:32 -0400 Subject: [PATCH 04/19] Adds some JSDoc comments - Adds some JSDoc comments to public functions. - Changes to always add the .modal-header element to the dialog template - Test fixes and updates --- bootbox.js | 114 ++++++++++++++++++++++++----------------- tests/alert.test.js | 20 ++++++-- tests/defaults.test.js | 31 +++++++++++ tests/dialog.test.js | 8 +-- 4 files changed, 120 insertions(+), 53 deletions(-) diff --git a/bootbox.js b/bootbox.js index 40412662..ccc0a97b 100644 --- a/bootbox.js +++ b/bootbox.js @@ -138,13 +138,22 @@ // PUBLIC FUNCTIONS // ************************************************************************************************************* - // Return all currently registered locales, or a specific locale if "name" is defined + /** + * Return all currently registered locales, or a specific locale if "name" is defined + * @param {*} name + * @returns {object[]|object} An array of the available locale objects, or a single locale object if {name} is not null + */ exports.locales = function (name) { return name ? locales[name] : locales; }; - // Register localized strings for the OK, CONFIRM, and CANCEL buttons + /** + * Register localized strings for the OK, CONFIRM, and CANCEL buttons + * @param {*} name The key used to identify the new locale in the locales array + * @param {*} values An object containing the localized string for each of the OK, CANCEL, and CONFIRM properties of a locale + * @returns The updated bootbox object + */ exports.addLocale = function (name, values) { $.each(['OK', 'CANCEL', 'CONFIRM'], function (_, v) { if (!values[v]) { @@ -161,8 +170,12 @@ return exports; }; - - // Remove a previously-registered locale + + /** + * Remove a previously-registered locale + * @param {*} name The key identifying the locale to remove + * @returns The updated bootbox object + */ exports.removeLocale = function (name) { if (name !== 'en') { delete locales[name]; @@ -175,13 +188,20 @@ }; - // Set the default locale + /** + * Set the default locale + * @param {*} name The key identifying the locale to set as the default locale for all future bootbox calls + * @returns The updated bootbox object + */ exports.setLocale = function (name) { return exports.setDefaults('locale', name); }; - // Override default value(s) of Bootbox. + /** + * Override default value(s) of Bootbox. + * @returns The updated bootbox object + */ exports.setDefaults = function () { let values = {}; @@ -199,15 +219,22 @@ }; - // Hides all currently active Bootbox modals + /** + * Hides all currently active Bootbox modals + * @returns The current bootbox object + */ exports.hideAll = function () { $('.bootbox').modal('hide'); return exports; }; - - // Allows the base init() function to be overridden + + /** + * Allows the base init() function to be overridden + * @param {*} _$ A function to be called when the bootbox instance is created + * @returns The current bootbox object + */ exports.init = function (_$) { return init(_$ || $); }; @@ -216,13 +243,15 @@ // CORE HELPER FUNCTIONS // ************************************************************************************************************* - // Core dialog function + /** + * The core dialog helper function, which can be used to create any custom Bootstrap modal. + * @param {*} options An object used to configure the various properties which define a Bootbox dialog + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ exports.dialog = function (options) { if ($.fn.modal === undefined) { throw new Error( - '"$.fn.modal" is not defined; please double check you have included ' + - 'the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.4/getting-started/javascript/ ' + - 'for more details.' + '"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.6/getting-started/introduction/ for more details.' ); } @@ -336,23 +365,24 @@ } } + // 6.0.0: Always append a modal header + body.before(header); + if (options.title) { - body.before(header); dialog.find('.modal-title').html(options.title); } if (options.closeButton) { - let closeButton = $(templates.closeButton); + let closeButton = $(templates.closeButton); + if (options.fullBootstrapVersion < '5.0.0') { + closeButton.html('×'); + } - if (options.title) { - if (options.bootstrap > 3) { - dialog.find('.modal-header').append(closeButton); - } - else { - dialog.find('.modal-header').prepend(closeButton); - } - } else { - closeButton.prependTo(body); + if (options.bootstrap > 3) { + dialog.find('.modal-header').append(closeButton); + } + else { + dialog.find('.modal-header').prepend(closeButton); } } @@ -372,6 +402,7 @@ if(!options.reusable) { // make sure we unbind any listeners once the dialog has definitively been dismissed dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal); + dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal); } if (options.onHide) { @@ -383,10 +414,6 @@ } } - if(!options.reusable) { - dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal); - } - if (options.onHidden) { if ($.isFunction(options.onHidden)) { dialog.on('hidden.bs.modal', options.onHidden); @@ -496,9 +523,10 @@ }; - // Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the alert is dismissed should be placed within the callback function - // for this alert. + /** + * Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any code that must happen after the alert is dismissed should be placed within the callback function for this alert. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ exports.alert = function () { let options; @@ -524,9 +552,10 @@ }; - // Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the confirm is dismissed should be placed within the callback function - // for this confirm. + /** + * Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any code that must happen after the confirm is dismissed should be placed within the callback function for this confirm. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ exports.confirm = function () { let options; @@ -551,9 +580,10 @@ }; - // Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any - // code that must happen after the prompt is dismissed should be placed within the callback function - // for this prompt. + /** + * Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any code that must happen after the prompt is dismissed should be placed within the callback function for this prompt. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ exports.prompt = function () { let options; let promptDialog; @@ -568,8 +598,7 @@ // be a function instead... form = $(templates.form); - // prompt defaults are more complex than others in that - // users can override more defaults + // prompt defaults are more complex than others in that users can override more defaults options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments); if (!options.value) { @@ -669,10 +698,8 @@ input.attr({ 'rows': options.rows }); } } - break; - case 'date': case 'time': case 'number': @@ -714,10 +741,8 @@ input.attr('max', options.max); } } - break; - case 'select': let groups = {}; inputOptions = options.inputOptions || []; @@ -774,10 +799,8 @@ // safe to set a select's value as per a normal input input.val(options.value); - break; - case 'checkbox': let checkboxValues = $.isArray(options.value) ? options.value : [options.value]; inputOptions = options.inputOptions || []; @@ -812,7 +835,6 @@ }); break; - case 'radio': // Make sure that value is not an array (only a single radio can ever be checked) if (options.value !== undefined && $.isArray(options.value)) { diff --git a/tests/alert.test.js b/tests/alert.test.js index d722990a..c4111644 100644 --- a/tests/alert.test.js +++ b/tests/alert.test.js @@ -1,6 +1,12 @@ describe('bootbox.alert', function() { 'use strict'; var self; + var _this = this; + _this.bootstrapVersion = function() { + let fullVersion = $.fn.modal.Constructor.VERSION; + let i = fullVersion.indexOf('.'); + return fullVersion.substring(0, i); + }; beforeEach(function() { self = this; @@ -53,12 +59,20 @@ describe('bootbox.alert', function() { expect(this.find('.modal-footer button:first').hasClass('bootbox-accept')).to.be.true; }); - it('shows a close button inside the body', function() { - expect(this.text('.modal-body button')).to.equal('×'); + it('shows a close button inside the header', function() { + if(_this.bootstrapVersion() >= 5) { + expect(this.text('.modal-header button')).to.equal(''); + } + else { + expect(this.text('.modal-header button')).to.equal('×'); + } }); it('applies the close class to the close button', function() { - expect(this.find('.modal-body button').hasClass('close')).to.be.true; + if(_this.bootstrapVersion() >= 5) { + expect(this.find('.modal-header button').hasClass('btn-close')).to.be.true; + } + expect(this.find('.modal-header button').hasClass('close')).to.be.true; }); it('applies the correct aria-hidden attribute to the close button', function() { diff --git a/tests/defaults.test.js b/tests/defaults.test.js index ec912038..90f214eb 100644 --- a/tests/defaults.test.js +++ b/tests/defaults.test.js @@ -103,6 +103,37 @@ describe('bootbox.setDefaults', function() { }); }); + describe('when set to extra-large', function() { + beforeEach(function() { + bootbox.setDefaults({ + size: 'extra-large' + }); + + this.dialog = bootbox.dialog({ + message: 'test' + }); + }); + + it('adds the extra-large class to the innerDialog', function() { + expect(this.dialog.children('.modal-dialog').hasClass('modal-xl')).to.be.true; + }); + }); + describe('when set to xl', function() { + beforeEach(function() { + bootbox.setDefaults({ + size: 'xl' + }); + + this.dialog = bootbox.dialog({ + message: 'test' + }); + }); + + it('adds the extra-large class to the innerDialog', function() { + expect(this.dialog.children('.modal-dialog').hasClass('modal-xl')).to.be.true; + }); + }); + describe('when set to large', function() { beforeEach(function() { bootbox.setDefaults({ diff --git a/tests/dialog.test.js b/tests/dialog.test.js index a6a25b08..da14a6ef 100644 --- a/tests/dialog.test.js +++ b/tests/dialog.test.js @@ -90,11 +90,11 @@ describe('bootbox.dialog', function() { it('shows the expected message', function() { return expect(this.text('.bootbox-body')).to.equal('test'); }); - it('does not have a header', function() { - return expect(this.exists('.modal-header')).not.to.be.ok; + it('has a header', function() { + return expect(this.exists('.modal-header')).to.be.ok; }); - it('has a close button inside the body', function() { - return expect(this.exists('.modal-body .close')).to.be.ok; + it('has a close button inside the header', function() { + return expect(this.exists('.modal-header .close')).to.be.ok; }); it('does not have a footer', function() { return expect(this.exists('.modal-footer')).not.to.be.ok; From 95036ee3290f6892cec1a7d962f2f6919eb86dcb Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Thu, 28 Apr 2022 16:13:11 -0400 Subject: [PATCH 05/19] Update bootbox.js Cleanup for comments --- bootbox.js | 224 ++++++++++++++++++++++------------------------------- 1 file changed, 92 insertions(+), 132 deletions(-) diff --git a/bootbox.js b/bootbox.js index ccc0a97b..7663ef17 100644 --- a/bootbox.js +++ b/bootbox.js @@ -102,35 +102,35 @@ let defaults = { - // default language + // Default language used when generating buttons for alert, confirm, and prompt dialogs locale: 'en', - // show backdrop or not. Default to static so user has to interact with dialog + // Show backdrop or not. Default to static so user has to interact with dialog backdrop: 'static', - // animate the modal in/out + // Animate the modal in/out animate: true, - // additional class string applied to the top level dialog + // Additional class string applied to the top level dialog className: null, - // whether or not to include a close button + // Whether or not to include a close button closeButton: true, - // show the dialog immediately by default + // Show the dialog immediately by default show: true, - // dialog container + // Dialog container container: 'body', - // default value (used by the prompt helper) + // Default value (used by the prompt helper) value: '', - // default input type (used by the prompt helper) + // Default input type (used by the prompt helper) inputType: 'text', - // switch button order from cancel/confirm (default) to confirm/cancel + // Switch button order from cancel/confirm (default) to confirm/cancel swapButtonOrder: false, - // center modal vertically in page + // Center modal vertically in page centerVertical: false, // Append "multiple" property to the select when using the "prompt" helper multiple: false, // Automatically scroll modal content when height exceeds viewport height scrollable: false, - // whether or not to destroy the modal on hide + // Whether or not to destroy the modal on hide reusable: false, - // the element that triggered the dialog opening + // The element which triggered the dialog relatedTarget: null }; @@ -206,7 +206,7 @@ let values = {}; if (arguments.length === 2) { - // allow passing of single key/value... + // Allow passing of single key/value... values[arguments[0]] = arguments[1]; } else { // ... and as an object too @@ -282,8 +282,7 @@ body.find('.bootbox-body').html(options.message); - // Only attempt to create buttons if at least one has - // been defined in the options object + // Only attempt to create buttons if at least one has been defined in the options object if (getKeyLength(options.buttons) > 0) { each(buttons, function (key, b) { let button = $(templates.button); @@ -365,7 +364,7 @@ } } - // 6.0.0: Always append a modal header + // 6.0.0: Always append a modal header to the dialog template body.before(header); if (options.title) { @@ -395,9 +394,7 @@ } } - // Bootstrap event listeners; these handle extra - // setup & teardown required after the underlying - // modal has performed certain actions. + // Bootstrap event listeners; these handle extra setup & teardown required after the underlying modal has performed certain actions. if(!options.reusable) { // make sure we unbind any listeners once the dialog has definitively been dismissed @@ -443,21 +440,14 @@ } } - // Bootbox event listeners; used to decouple some - // behaviours from their respective triggers + // Bootbox event listeners; used to decouple some behaviours from their respective triggers if (options.backdrop === true) { - // A boolean true/false according to the Bootstrap docs - // should show a dialog the user can dismiss by clicking on - // the background. - // We always only ever pass static/false to the actual - // $.modal function because with "true" we can't trap - // this event (the .modal-backdrop swallows it) - // However, we still want to sort-of respect true - // and invoke the escape mechanism instead + // A boolean true/false according to the Bootstrap docs should show a dialog the user can dismiss by clicking on the background. + // We always only ever pass static/false to the actual $.modal function because with "true" we can't trap this event (the .modal-backdrop swallows it). + // However, we still want to sort-of respect true and invoke the escape mechanism instead dialog.on('click.dismiss.bs.modal', function (e) { - // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop - // moved *inside* the outer dialog rather than *alongside* it + // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop moved *inside* the outer dialog rather than *alongside* it if (dialog.children('.modal-backdrop').length) { e.currentTarget = dialog.children('.modal-backdrop').get(0); } @@ -471,9 +461,7 @@ } dialog.on('escape.close.bb', function (e) { - // the if statement looks redundant but it isn't; without it - // if we *didn't* have an onEscape handler then processCallback - // would automatically dismiss the dialog + // The if() statement looks redundant but it isn't; without it, if we *didn't* have an onEscape handler then processCallback would automatically dismiss the dialog if (callbacks.onEscape) { processCallback(e, dialog, callbacks.onEscape); } @@ -490,9 +478,7 @@ }); dialog.on('click', '.bootbox-close-button', function (e) { - // onEscape might be falsy but that's fine; the fact is - // if the user has managed to click the close button we - // have to close the dialog, callback or not + // onEscape might be falsy, but that's fine; the fact is if the user has managed to click the close button we have to close the dialog, callback or not processCallback(e, dialog, callbacks.onEscape); }); @@ -502,10 +488,10 @@ } }); - // the remainder of this method simply deals with adding our - // dialog element to the DOM, augmenting it with Bootstrap's modal - // functionality and then giving the resulting object back - // to our caller + /* + The remainder of this method simply deals with adding our dialog element to the DOM, augmenting it with + Bootstrap's modal functionality and then giving the resulting object back to our caller + */ $(options.container).append(dialog); @@ -532,14 +518,12 @@ options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments); - // @TODO: can this move inside exports.dialog when we're iterating over each - // button and checking its button.callback value instead? + // @TODO: can this move inside exports.dialog when we're iterating over each button and checking its button.callback value instead? if (options.callback && !$.isFunction(options.callback)) { throw new Error('alert requires the "callback" property to be a function when provided'); } - // override the ok and escape callback to make sure they just invoke - // the single user-supplied one (if provided) + // Override the ok and escape callback to make sure they just invoke the single user-supplied one (if provided) options.buttons.ok.callback = options.onEscape = function () { if ($.isFunction(options.callback)) { return options.callback.call(this); @@ -561,13 +545,12 @@ options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments); - // confirm specific validation; they don't make sense without a callback so make - // sure it's present + // confirm specific validation; they don't make sense without a callback so make sure it's present if (!$.isFunction(options.callback)) { throw new Error('confirm requires a callback'); } - // overrides; undo anything the user tried to set they shouldn't have + // Overrides; undo anything the user tried to set they shouldn't have options.buttons.cancel.callback = options.onEscape = function () { return options.callback.call(this, false); }; @@ -592,10 +575,8 @@ let shouldShow; let inputOptions; - // we have to create our form first otherwise - // its value is undefined when gearing up our options - // @TODO this could be solved by allowing message to - // be a function instead... + // We have to create our form first, otherwise its value is undefined when gearing up our options. + // @TODO this could be solved by allowing message to be a function instead... form = $(templates.form); // prompt defaults are more complex than others in that users can override more defaults @@ -609,13 +590,10 @@ options.inputType = defaults.inputType; } - // capture the user's show value; we always set this to false before - // spawning the dialog to give us a chance to attach some handlers to - // it, but we need to make sure we respect a preference not to show it + // Capture the user's 'show' value; we always set this to false before spawning the dialog to give us a chance to attach some handlers to it, but we need to make sure we respect a preference not to show it shouldShow = (options.show === undefined) ? defaults.show : options.show; - // This is required prior to calling the dialog builder below - we need to - // add an event handler just before the prompt is shown + // This is required prior to calling the dialog builder below - we need to add an event handler just before the prompt is shown options.show = false; // Handles the 'cancel' action @@ -623,8 +601,7 @@ return options.callback.call(this, null); }; - // Prompt submitted - extract the prompt value. This requires a bit of work, - // given the different input types available. + // Prompt submitted - extract the prompt value. This requires a bit of work, given the different input types available. options.buttons.confirm.callback = function () { let value; @@ -667,7 +644,7 @@ throw new Error('Invalid prompt type'); } - // create the input based on the supplied type + // Create the input based on the supplied type input = $(templates.inputs[options.inputType]); switch (options.inputType) { @@ -719,8 +696,7 @@ } // These input types have extra attributes which affect their input validation. - // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so - // this attribute will have no effect. Therefore, we don't set the attribute for date inputs. + // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs. // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates if (options.inputType !== 'date') { if (options.step) { @@ -755,8 +731,7 @@ throw new Error('prompt with "inputType" set to "select" requires at least one option'); } - // placeholder is not actually a valid attribute for select, - // but we'll allow it, assuming it might be used for a plugin + // Note: 'placeholder' is not actually a valid attribute for a select element, but we'll allow it, assuming it might be used for a plugin if (options.placeholder) { input.attr('placeholder', options.placeholder); } @@ -770,7 +745,7 @@ } each(inputOptions, function (_, option) { - // assume the element to attach to is the input... + // Assume the element to attach to is the input... let elem = input; if (option.value === undefined || option.text === undefined) { @@ -780,7 +755,7 @@ // ... but override that element if this option sits in a group if (option.group) { - // initialise group if necessary + // Initialise group if necessary if (!groups[option.group]) { groups[option.group] = $('').attr('label', option.group); } @@ -797,7 +772,7 @@ input.append(group); }); - // safe to set a select's value as per a normal input + // Safe to set a select's value as per a normal input input.val(options.value); break; @@ -809,9 +784,7 @@ throw new Error('prompt with "inputType" set to "checkbox" requires at least one option'); } - // checkboxes have to nest within a containing element, so - // they break the rules a bit and we end up re-assigning - // our 'input' element to this container instead + // Checkboxes have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead input = $('
'); each(inputOptions, function (_, option) { @@ -824,7 +797,7 @@ checkbox.find('input').attr('value', option.value); checkbox.find('label').append('\n' + option.text); - // we've ensured values is an array so we can always iterate over it + // We've ensured values is an array, so we can always iterate over it each(checkboxValues, function (_, value) { if (value === option.value) { checkbox.find('input').prop('checked', true); @@ -847,9 +820,7 @@ throw new Error('prompt with "inputType" set to "radio" requires at least one option'); } - // Radiobuttons have to nest within a containing element, so - // they break the rules a bit and we end up re-assigning - // our 'input' element to this container instead + // Radiobuttons have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead input = $('
'); // Radiobuttons should always have an initial checked input checked in a "group". @@ -882,7 +853,7 @@ break; } - // now place it in our form + // Now place it in our form form.append(input); form.on('submit', function (e) { @@ -908,13 +879,12 @@ // Generate the dialog promptDialog = exports.dialog(options); - // clear the existing handler focusing the submit button... + // Clear the existing handler focusing the submit button... promptDialog.off('shown.bs.modal', focusPrimaryButton); // ...and replace it with one focusing our input, if possible promptDialog.on('shown.bs.modal', function () { - // need the closure here since input isn't - // an object otherwise + // Need the closure here since input isn'tcan object otherwise input.focus(); }); @@ -929,22 +899,25 @@ // INTERNAL FUNCTIONS // ************************************************************************************************************* - // Map a flexible set of arguments into a single returned object - // If args.length is already one just return it, otherwise - // use the properties argument to map the unnamed args to - // object properties. + // Map a flexible set of arguments into a single returned object. + // If args.length is already one just return it, otherwise use the properties argument to map the unnamed args to object properties. // So in the latter case: - // mapArguments(["foo", $.noop], ["message", "callback"]) - // -> { message: "foo", callback: $.noop } + // + // mapArguments(["foo", $.noop], ["message", "callback"]) + // + // results in + // + // { message: "foo", callback: $.noop } + // function mapArguments(args, properties) { - let argn = args.length; + let argsLength = args.length; let options = {}; - if (argn < 1 || argn > 2) { + if (argsLength < 1 || argsLength > 2) { throw new Error('Invalid argument length'); } - if (argn === 2 || typeof args[0] === 'string') { + if (argsLength === 2 || typeof args[0] === 'string') { options[properties[0]] = args[0]; options[properties[1]] = args[1]; } else { @@ -955,27 +928,22 @@ } - // Merge a set of default dialog options with user supplied arguments + // Merge a set of default dialog options with user supplied arguments function mergeArguments(defaults, args, properties) { return $.extend( - // deep merge + // Deep merge true, - // ensure the target is an empty, unreferenced object + // Ensure the target is an empty, unreferenced object {}, - // the base options object for this type of dialog (often just buttons) + // The base options object for this type of dialog (often just buttons) defaults, - // args could be an object or array; if it's an array properties will - // map it to a proper options object - mapArguments( - args, - properties - ) + // 'args' could be an object or array; if it's an array properties will map it to a proper options object + mapArguments(args, properties) ); } - // This entry-level method makes heavy use of composition to take a simple - // range of inputs and return valid options suitable for passing to bootbox.dialog + // This entry-level method makes heavy use of composition to take a simple range of inputs and return valid options suitable for passing to bootbox.dialog function mergeDialogOptions(className, labels, properties, args) { let locale; if (args && args[0]) { @@ -987,20 +955,19 @@ } } - // build up a base set of dialog properties + // Build up a base set of dialog properties let baseOptions = { className: 'bootbox-' + className, buttons: createLabels(labels, locale) }; - // Ensure the buttons properties generated, *after* merging - // with user args are still valid against the supplied labels + // Ensure the buttons properties generated, *after* merging with user args are still valid against the supplied labels return validateButtons( - // merge the generated base properties with user supplied arguments + // Merge the generated base properties with user supplied arguments mergeArguments( baseOptions, args, - // if args.length > 1, properties specify how each arg maps to an object key + // If args.length > 1, properties specify how each arg maps to an object key properties ), labels @@ -1008,8 +975,8 @@ } - // Checks each button object to see if key is valid. - // This function will only be called by the alert, confirm, and prompt helpers. + // Checks each button object to see if key is valid. + // This function will only be called by the alert, confirm, and prompt helpers. function validateButtons(options, buttons) { let allowedButtons = {}; each(buttons, function (key, value) { @@ -1027,9 +994,9 @@ - // From a given list of arguments, return a suitable object of button labels. - // All this does is normalise the given labels and translate them where possible. - // e.g. "ok", "confirm" -> { ok: "OK", cancel: "Annuleren" } + // From a given list of arguments, return a suitable object of button labels. + // All this does is normalise the given labels and translate them where possible. + // e.g. "ok", "confirm" -> { ok: "OK", cancel: "Annuleren" } function createLabels(labels, locale) { let buttons = {}; @@ -1048,8 +1015,7 @@ - // Get localized text from a locale. Defaults to 'en' locale if no locale - // provided or a non-registered locale is requested + // Get localized text from a locale. Defaults to 'en' locale if no locale provided or a non-registered locale is requested function getText(key, locale) { let labels = locales[locale]; @@ -1058,9 +1024,8 @@ - // Filter and tidy up any user supplied parameters to this dialog. - // Also looks for any shorthands used and ensures that the options - // which are returned are all normalized properly + // Filter and tidy up any user supplied parameters to this dialog. + // Also looks for any shorthands used and ensures that the options which are returned are all normalized properly function sanitize(options) { let buttons; let total; @@ -1073,18 +1038,17 @@ throw new Error('"message" option must not be null or an empty string.'); } - // make sure any supplied options take precedence over defaults + // Make sure any supplied options take precedence over defaults options = $.extend({}, defaults, options); - //make sure backdrop is either true, false, or 'static' + // Make sure backdrop is either true, false, or 'static' if (!options.backdrop) { options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static'; } else { options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true; } - // no buttons is still a valid dialog but it's cleaner to always have - // a buttons object to iterate over, even if it's empty + // No buttons is still a valid dialog but it's cleaner to always have a buttons object to iterate over, even if it's empty if (!options.buttons) { options.buttons = {}; } @@ -1095,20 +1059,19 @@ each(buttons, function (key, button, index) { if ($.isFunction(button)) { - // short form, assume value is our callback. Since button - // isn't an object it isn't a reference either so re-assign it + // Short form, assume value is our callback. Since button isn't an object it isn't a reference either so re-assign it button = buttons[key] = { callback: button }; } - // before any further checks make sure by now button is the correct type + // Before any further checks, make sure button is the correct type if ($.type(button) !== 'object') { throw new Error('button with key "' + key + '" must be an object'); } if (!button.label) { - // the lack of an explicit label means we'll assume the key is good enough + // The lack of an explicit label means we'll assume the key is good enough button.label = key; } @@ -1135,13 +1098,13 @@ } - // Returns a count of the properties defined on the object + // Returns a count of the properties defined on the object function getKeyLength(obj) { return Object.keys(obj).length; } - // Tiny wrapper function around jQuery.each; just adds index as the third parameter + // Tiny wrapper function around jQuery.each; just adds index as the third parameter function each(collection, iterator) { let index = 0; $.each(collection, function (key, value) { @@ -1156,9 +1119,8 @@ function destroyModal(e) { - // ensure we don't accidentally intercept hidden events triggered - // by children of the current dialog. We shouldn't need to handle this anymore, - // now that Bootstrap namespaces its events, but still worth doing. + // Ensure we don't accidentally intercept hidden events triggered by children of the current dialog. + // We shouldn't need to handle this anymore, now that Bootstrap namespaces its events, but still worth doing. if (e.target === e.data.dialog[0]) { e.data.dialog.remove(); } @@ -1178,11 +1140,9 @@ e.stopPropagation(); e.preventDefault(); - // by default we assume a callback will get rid of the dialog, - // although it is given the opportunity to override this + // By default we assume a callback will get rid of the dialog, although it is given the opportunity to override this - // so, if the callback can be invoked and it *explicitly returns false* - // then we'll set a flag to keep the dialog active... + // If the callback can be invoked and it *explicitly returns false*, then we'll set a flag to keep the dialog active... let preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; // ... otherwise we'll bin it From f6108a3bb5e3c4ca4f03383bb7c81ab9d076eb75 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Fri, 29 Apr 2022 19:57:54 -0400 Subject: [PATCH 06/19] Only append modal header if closeButton or title are truthy --- bootbox.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/bootbox.js b/bootbox.js index 7663ef17..21e0089a 100644 --- a/bootbox.js +++ b/bootbox.js @@ -364,24 +364,25 @@ } } - // 6.0.0: Always append a modal header to the dialog template - body.before(header); + if(options.title || options.closeButton){ + body.before(header); - if (options.title) { - dialog.find('.modal-title').html(options.title); - } - - if (options.closeButton) { - let closeButton = $(templates.closeButton); - if (options.fullBootstrapVersion < '5.0.0') { - closeButton.html('×'); + if (options.title) { + dialog.find('.modal-title').html(options.title); } - if (options.bootstrap > 3) { - dialog.find('.modal-header').append(closeButton); - } - else { - dialog.find('.modal-header').prepend(closeButton); + if (options.closeButton) { + let closeButton = $(templates.closeButton); + if (options.fullBootstrapVersion < '5.0.0') { + closeButton.html('×'); + } + + if (options.bootstrap > 3) { + dialog.find('.modal-header').append(closeButton); + } + else { + dialog.find('.modal-header').prepend(closeButton); + } } } @@ -467,7 +468,6 @@ } }); - dialog.on('click', '.modal-footer button:not(.disabled)', function (e) { let callbackKey = $(this).data('bb-handler'); From 975a2b021702f08a104331ccd8221d44a493fd59 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Tue, 31 May 2022 22:41:14 -0400 Subject: [PATCH 07/19] Configurable error message for prompt --- bootbox.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bootbox.js b/bootbox.js index 21e0089a..3344083a 100644 --- a/bootbox.js +++ b/bootbox.js @@ -120,6 +120,8 @@ value: '', // Default input type (used by the prompt helper) inputType: 'text', + // Custom error message to report if prompt fails validation + errorMessage: null, // Switch button order from cancel/confirm (default) to confirm/cancel swapButtonOrder: false, // Center modal vertically in page @@ -613,7 +615,21 @@ value = input.find('input:checked').val(); } else { - if (input[0].checkValidity && !input[0].checkValidity()) { + let el = input[0]; + + // Clear any previous custom error message + if(options.errorMessage){ + el.setCustomValidity(''); + } + + if (el.checkValidity && !el.checkValidity()) { + // If a custom error message was provided, add it now + if(options.errorMessage){ + el.setCustomValidity(options.errorMessage); + } + + el.reportValidity && el.reportValidity(); + // prevents button callback from being called return false; } else { From 1dc87a1e5588bb8a289edbebc8b4bea3c5fb49bc Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Sun, 5 Jun 2022 20:05:47 -0400 Subject: [PATCH 08/19] Tweaks for modal header --- bootbox.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/bootbox.js b/bootbox.js index 3344083a..896a8412 100644 --- a/bootbox.js +++ b/bootbox.js @@ -80,7 +80,7 @@ dialog: '', header: '', footer: '', - closeButton: '', + closeButton: '', form: '
', button: '', option: '', @@ -379,11 +379,15 @@ closeButton.html('×'); } - if (options.bootstrap > 3) { - dialog.find('.modal-header').append(closeButton); - } - else { - dialog.find('.modal-header').prepend(closeButton); + /* Note: the close button for Bootstrap 5+ does not contain content */ + if(options.bootstrap < 5){ + if (options.bootstrap == 4) { + dialog.find('.modal-header').append(closeButton); + } + else { + /* Bootstrap 3 and under */ + dialog.find('.modal-header').prepend(closeButton); + } } } } From 0749264eea0ad6d1ef60258465172d3545cdaff9 Mon Sep 17 00:00:00 2001 From: Tieson Trowbridge Date: Tue, 14 Jun 2022 04:59:47 -0400 Subject: [PATCH 09/19] Package updates. Set eslint to ES6. Tweaks modal header - Package updates. - Set eslint to ES6. - Tweaks modal header --- .jshintrc | 1 + Gruntfile.js | 18 +- bootbox.all.js | 1573 ++++ bootbox.js | 43 +- dist/bootbox.all.min.js | 2 +- dist/bootbox.min.js | 2 +- package-lock.json | 16092 ++++++++++++-------------------------- package.json | 42 +- 8 files changed, 6811 insertions(+), 10962 deletions(-) create mode 100644 bootbox.all.js diff --git a/.jshintrc b/.jshintrc index 2abc5fba..a60e72c9 100644 --- a/.jshintrc +++ b/.jshintrc @@ -9,6 +9,7 @@ "quotmark": "single", "browser": true, "node": true, + "esversion": 6, "globals": { "beforeEach": true, "afterEach": true, diff --git a/Gruntfile.js b/Gruntfile.js index cab2fcd3..90330b17 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,6 +1,16 @@ module.exports = function (grunt) { 'use strict'; grunt.initConfig({ + concat: { + options: { + separator: ';', + }, + dist: { + src: ['bootbox.js', 'bootbox.locales.js'], + dest: 'bootbox.all.js', + } + }, + uglify: { options: { compress: true, @@ -13,7 +23,8 @@ module.exports = function (grunt) { my_target: { files: { 'dist/bootbox.min.js': ['bootbox.js'], - 'dist/bootbox.locales.min.js': ['bootbox.locales.js'] + 'dist/bootbox.locales.min.js': ['bootbox.locales.js'], + 'dist/bootbox.all.min.js': ['bootbox.all.js'] } } }, @@ -30,12 +41,13 @@ module.exports = function (grunt) { unit: { configFile: 'karma.conf.js' } - } + }, }); + grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-karma'); - grunt.registerTask('default', ['uglify', 'jshint', 'karma']); + grunt.registerTask('default', ['concat', 'uglify', 'jshint', 'karma']); }; \ No newline at end of file diff --git a/bootbox.all.js b/bootbox.all.js new file mode 100644 index 00000000..496bc5bc --- /dev/null +++ b/bootbox.all.js @@ -0,0 +1,1573 @@ +/*! @preserve + * bootbox.js + * version: 6.0.0-wip + * author: Nick Payne + * license: MIT + * http://bootboxjs.com/ + */ +(function (root, factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + // AMD + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node, CommonJS-like + module.exports = factory(require('jquery')); + } else { + // Browser globals (root is window) + root.bootbox = factory(root.jQuery); + } +}(this, function init($, undefined) { + 'use strict'; + + // Polyfills Object.keys, if necessary. + // @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys + if (!Object.keys) { + Object.keys = (function () { + let hasOwnProperty = Object.prototype.hasOwnProperty, + hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), + dontEnums = [ + 'toString', + 'toLocaleString', + 'valueOf', + 'hasOwnProperty', + 'isPrototypeOf', + 'propertyIsEnumerable', + 'constructor' + ], + dontEnumsLength = dontEnums.length; + + return function (obj) { + if (typeof obj !== 'function' && (typeof obj !== 'object' || obj === null)) { + throw new TypeError('Object.keys called on non-object'); + } + + let result = [], prop, i; + + for (prop in obj) { + if (hasOwnProperty.call(obj, prop)) { + result.push(prop); + } + } + + if (hasDontEnumBug) { + for (i = 0; i < dontEnumsLength; i++) { + if (hasOwnProperty.call(obj, dontEnums[i])) { + result.push(dontEnums[i]); + } + } + } + + return result; + }; + }()); + } + + let exports = {}; + + let VERSION = '6.0.0-wip'; + exports.VERSION = VERSION; + + let locales = { + en : { + OK : 'OK', + CANCEL : 'Cancel', + CONFIRM : 'OK' + } + }; + + let templates = { + dialog: '', + header: '', + footer: '', + closeButton: '', + form: '
', + button: '', + option: '', + promptMessage: '
', + inputs: { + text: '', + textarea: '', + email: '', + select: '', + checkbox: '
', + radio: '
', + date: '', + time: '', + number: '', + password: '', + range: '' + } + }; + + + let defaults = { + // Default language used when generating buttons for alert, confirm, and prompt dialogs + locale: 'en', + // Show backdrop or not. Default to static so user has to interact with dialog + backdrop: 'static', + // Animate the modal in/out + animate: true, + // Additional class string applied to the top level dialog + className: null, + // Whether or not to include a close button + closeButton: true, + // Show the dialog immediately by default + show: true, + // Dialog container + container: 'body', + // Default value (used by the prompt helper) + value: '', + // Default input type (used by the prompt helper) + inputType: 'text', + // Switch button order from cancel/confirm (default) to confirm/cancel + swapButtonOrder: false, + // Center modal vertically in page + centerVertical: false, + // Append "multiple" property to the select when using the "prompt" helper + multiple: false, + // Automatically scroll modal content when height exceeds viewport height + scrollable: false, + // Whether or not to destroy the modal on hide + reusable: false, + // The element which triggered the dialog + relatedTarget: null, + // The size of the modal to generate + size: null, + // A unique indentifier for this modal + id: null + }; + + + // PUBLIC FUNCTIONS + // ************************************************************************************************************* + + /** + * Return all currently registered locales, or a specific locale if "name" is defined + * @param {*} name + * @returns {object[]|object} An array of the available locale objects, or a single locale object if {name} is not null + */ + exports.locales = function (name) { + return name ? locales[name] : locales; + }; + + + /** + * Register localized strings for the OK, CONFIRM, and CANCEL buttons + * @param {*} name The key used to identify the new locale in the locales array + * @param {*} values An object containing the localized string for each of the OK, CANCEL, and CONFIRM properties of a locale + * @returns The updated bootbox object + */ + exports.addLocale = function (name, values) { + $.each(['OK', 'CANCEL', 'CONFIRM'], function (_, v) { + if (!values[v]) { + throw new Error('Please supply a translation for "' + v + '"'); + } + }); + + locales[name] = { + OK: values.OK, + CANCEL: values.CANCEL, + CONFIRM: values.CONFIRM + }; + + return exports; + }; + + + /** + * Remove a previously-registered locale + * @param {*} name The key identifying the locale to remove + * @returns The updated bootbox object + */ + exports.removeLocale = function (name) { + if (name !== 'en') { + delete locales[name]; + } + else { + throw new Error('"en" is used as the default and fallback locale and cannot be removed.'); + } + + return exports; + }; + + + /** + * Set the default locale + * @param {*} name The key identifying the locale to set as the default locale for all future bootbox calls + * @returns The updated bootbox object + */ + exports.setLocale = function (name) { + return exports.setDefaults('locale', name); + }; + + + /** + * Override default value(s) of Bootbox. + * @returns The updated bootbox object + */ + exports.setDefaults = function () { + let values = {}; + + if (arguments.length === 2) { + // Allow passing of single key/value... + values[arguments[0]] = arguments[1]; + } else { + // ... and as an object too + values = arguments[0]; + } + + $.extend(defaults, values); + + return exports; + }; + + + /** + * Hides all currently active Bootbox modals + * @returns The current bootbox object + */ + exports.hideAll = function () { + $('.bootbox').modal('hide'); + + return exports; + }; + + + /** + * Allows the base init() function to be overridden + * @param {*} _$ A function to be called when the bootbox instance is created + * @returns The current bootbox object + */ + exports.init = function (_$) { + return init(_$ || $); + }; + + + // CORE HELPER FUNCTIONS + // ************************************************************************************************************* + + /** + * The core dialog helper function, which can be used to create any custom Bootstrap modal. + * @param {*} options An object used to configure the various properties which define a Bootbox dialog + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ + exports.dialog = function (options) { + if ($.fn.modal === undefined) { + throw new Error( + '"$.fn.modal" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/4.6/getting-started/introduction/ for more details.' + ); + } + + options = sanitize(options); + + if ($.fn.modal.Constructor.VERSION) { + options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION; + let i = options.fullBootstrapVersion.indexOf('.'); + options.bootstrap = options.fullBootstrapVersion.substring(0, i); + } + else { + // Assuming version 2.3.2, as that was the last "supported" 2.x version + options.bootstrap = '2'; + options.fullBootstrapVersion = '2.3.2'; + console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.'); + } + + let dialog = $(templates.dialog); + let innerDialog = dialog.find('.modal-dialog'); + let body = dialog.find('.modal-body'); + let header = $(templates.header); + let footer = $(templates.footer); + let buttons = options.buttons; + + let callbacks = { + onEscape: options.onEscape + }; + + body.find('.bootbox-body').html(options.message); + + // Only attempt to create buttons if at least one has been defined in the options object + if (getKeyLength(options.buttons) > 0) { + each(buttons, function (key, b) { + let button = $(templates.button); + button.data('bb-handler', key); + button.addClass(b.className); + + switch (key) { + case 'ok': + case 'confirm': + button.addClass('bootbox-accept'); + break; + + case 'cancel': + button.addClass('bootbox-cancel'); + break; + } + + button.html(b.label); + + if (b.id) { + button.attr({ 'id': b.id }); + } + + if (b.disabled === true) { + button.prop({ disabled: true }); + } + + footer.append(button); + + callbacks[key] = b.callback; + }); + + body.after(footer); + } + + if (options.animate === true) { + dialog.addClass('fade'); + } + + if (options.className) { + dialog.addClass(options.className); + } + + if (options.id) { + dialog.attr({ 'id': options.id }); + } + + if (options.size) { + // Requires Bootstrap 3.1.0 or higher + if (options.fullBootstrapVersion.substring(0, 3) < '3.1') { + console.warn('"size" requires Bootstrap 3.1.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); + } + + switch (options.size) { + case 'small': + case 'sm': + innerDialog.addClass('modal-sm'); + break; + + case 'large': + case 'lg': + innerDialog.addClass('modal-lg'); + break; + + case 'extra-large': + case 'xl': + innerDialog.addClass('modal-xl'); + + // Requires Bootstrap 4.2.0 or higher + if (options.fullBootstrapVersion.substring(0, 3) < '4.2') { + console.warn('Using size "xl"/"extra-large" requires Bootstrap 4.2.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); + } + break; + } + } + + if (options.scrollable) { + innerDialog.addClass('modal-dialog-scrollable'); + + // Requires Bootstrap 4.3.0 or higher + if (options.fullBootstrapVersion.substring(0, 3) < '4.3') { + console.warn('Using "scrollable" requires Bootstrap 4.3.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); + } + } + + if(options.title){ + header.find('.modal-title').html(options.title); + } + else { + header.addClass('pb-0 border-0'); + } + + body.before(header); + + if (options.closeButton) { + let closeButton = $(templates.closeButton); + if (options.fullBootstrapVersion < '5.0.0') { + closeButton.html('×'); + } + + if (options.bootstrap > 3) { + dialog.find('.modal-header').append(closeButton); + } + else { + dialog.find('.modal-header').prepend(closeButton); + } + } + + if (options.centerVertical) { + innerDialog.addClass('modal-dialog-centered'); + + // Requires Bootstrap 4.0.0-beta.3 or higher + if (options.fullBootstrapVersion < '4.0.0') { + console.warn('"centerVertical" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.'); + } + } + + // Bootstrap event listeners; these handle extra setup & teardown required after the underlying modal has performed certain actions. + + if(!options.reusable) { + // make sure we unbind any listeners once the dialog has definitively been dismissed + dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal); + dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal); + } + + if (options.onHide) { + if ($.isFunction(options.onHide)) { + dialog.on('hide.bs.modal', options.onHide); + } + else { + throw new Error('Argument supplied to "onHide" must be a function'); + } + } + + if (options.onHidden) { + if ($.isFunction(options.onHidden)) { + dialog.on('hidden.bs.modal', options.onHidden); + } + else { + throw new Error('Argument supplied to "onHidden" must be a function'); + } + } + + if (options.onShow) { + if ($.isFunction(options.onShow)) { + dialog.on('show.bs.modal', options.onShow); + } + else { + throw new Error('Argument supplied to "onShow" must be a function'); + } + } + + dialog.one('shown.bs.modal', { dialog: dialog }, focusPrimaryButton); + + if (options.onShown) { + if ($.isFunction(options.onShown)) { + dialog.on('shown.bs.modal', options.onShown); + } + else { + throw new Error('Argument supplied to "onShown" must be a function'); + } + } + + // Bootbox event listeners; used to decouple some behaviours from their respective triggers + + if (options.backdrop === true) { + // A boolean true/false according to the Bootstrap docs should show a dialog the user can dismiss by clicking on the background. + // We always only ever pass static/false to the actual $.modal function because with "true" we can't trap this event (the .modal-backdrop swallows it). + // However, we still want to sort-of respect true and invoke the escape mechanism instead + dialog.on('click.dismiss.bs.modal', function (e) { + // @NOTE: the target varies in >= 3.3.x releases since the modal backdrop moved *inside* the outer dialog rather than *alongside* it + if (dialog.children('.modal-backdrop').length) { + e.currentTarget = dialog.children('.modal-backdrop').get(0); + } + + if (e.target !== e.currentTarget) { + return; + } + + dialog.trigger('escape.close.bb'); + }); + } + + dialog.on('escape.close.bb', function (e) { + // The if() statement looks redundant but it isn't; without it, if we *didn't* have an onEscape handler then processCallback would automatically dismiss the dialog + if (callbacks.onEscape) { + processCallback(e, dialog, callbacks.onEscape); + } + }); + + dialog.on('click', '.modal-footer button:not(.disabled)', function (e) { + let callbackKey = $(this).data('bb-handler'); + + if (callbackKey !== undefined) { + // Only process callbacks for buttons we recognize: + processCallback(e, dialog, callbacks[callbackKey]); + } + }); + + dialog.on('click', '.bootbox-close-button', function (e) { + // onEscape might be falsy, but that's fine; the fact is if the user has managed to click the close button we have to close the dialog, callback or not + processCallback(e, dialog, callbacks.onEscape); + }); + + dialog.on('keyup', function (e) { + if (e.which === 27) { + dialog.trigger('escape.close.bb'); + } + }); + + /* + The remainder of this method simply deals with adding our dialog element to the DOM, augmenting it with + Bootstrap's modal functionality and then giving the resulting object back to our caller + */ + + $(options.container).append(dialog); + + dialog.modal({ + backdrop: options.backdrop, + keyboard: false, + show: false + }); + + if (options.show) { + dialog.modal('show', options.relatedTarget); + } + + return dialog; + }; + + + /** + * Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any code that must happen after the alert is dismissed should be placed within the callback function for this alert. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ + exports.alert = function () { + let options; + + options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments); + + // @TODO: can this move inside exports.dialog when we're iterating over each button and checking its button.callback value instead? + if (options.callback && !$.isFunction(options.callback)) { + throw new Error('alert requires the "callback" property to be a function when provided'); + } + + // Override the ok and escape callback to make sure they just invoke the single user-supplied one (if provided) + options.buttons.ok.callback = options.onEscape = function () { + if ($.isFunction(options.callback)) { + return options.callback.call(this); + } + + return true; + }; + + return exports.dialog(options); + }; + + + /** + * Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any code that must happen after the confirm is dismissed should be placed within the callback function for this confirm. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ + exports.confirm = function () { + let options; + + options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments); + + // confirm specific validation; they don't make sense without a callback so make sure it's present + if (!$.isFunction(options.callback)) { + throw new Error('confirm requires a callback'); + } + + // Overrides; undo anything the user tried to set they shouldn't have + options.buttons.cancel.callback = options.onEscape = function () { + return options.callback.call(this, false); + }; + + options.buttons.confirm.callback = function () { + return options.callback.call(this, true); + }; + + return exports.dialog(options); + }; + + + /** + * Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any code that must happen after the prompt is dismissed should be placed within the callback function for this prompt. + * @returns A jQuery object upon which Bootstrap's modal function has been called + */ + exports.prompt = function () { + let options; + let promptDialog; + let form; + let input; + let shouldShow; + let inputOptions; + + // We have to create our form first, otherwise its value is undefined when gearing up our options. + // @TODO this could be solved by allowing message to be a function instead... + form = $(templates.form); + + // prompt defaults are more complex than others in that users can override more defaults + options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments); + + if (!options.value) { + options.value = defaults.value; + } + + if (!options.inputType) { + options.inputType = defaults.inputType; + } + + // Capture the user's 'show' value; we always set this to false before spawning the dialog to give us a chance to attach some handlers to it, but we need to make sure we respect a preference not to show it + shouldShow = (options.show === undefined) ? defaults.show : options.show; + + // This is required prior to calling the dialog builder below - we need to add an event handler just before the prompt is shown + options.show = false; + + // Handles the 'cancel' action + options.buttons.cancel.callback = options.onEscape = function () { + return options.callback.call(this, null); + }; + + // Prompt submitted - extract the prompt value. This requires a bit of work, given the different input types available. + options.buttons.confirm.callback = function () { + let value; + + if (options.inputType === 'checkbox') { + value = input.find('input:checked').map(function () { + return $(this).val(); + }).get(); + } else if (options.inputType === 'radio') { + value = input.find('input:checked').val(); + } + else { + if (input[0].checkValidity && !input[0].checkValidity()) { + // prevents button callback from being called + return false; + } else { + if (options.inputType === 'select' && options.multiple === true) { + value = input.find('option:selected').map(function () { + return $(this).val(); + }).get(); + } + else { + value = input.val(); + } + } + } + + return options.callback.call(this, value); + }; + + // prompt-specific validation + if (!options.title) { + throw new Error('prompt requires a title'); + } + + if (!$.isFunction(options.callback)) { + throw new Error('prompt requires a callback'); + } + + if (!templates.inputs[options.inputType]) { + throw new Error('Invalid prompt type'); + } + + // Create the input based on the supplied type + input = $(templates.inputs[options.inputType]); + + switch (options.inputType) { + case 'text': + case 'textarea': + case 'email': + case 'password': + input.val(options.value); + + if (options.placeholder) { + input.attr('placeholder', options.placeholder); + } + + if (options.pattern) { + input.attr('pattern', options.pattern); + } + + if (options.maxlength) { + input.attr('maxlength', options.maxlength); + } + + if (options.required) { + input.prop({ 'required': true }); + } + + if (options.rows && !isNaN(parseInt(options.rows))) { + if (options.inputType === 'textarea') { + input.attr({ 'rows': options.rows }); + } + } + break; + + case 'date': + case 'time': + case 'number': + case 'range': + input.val(options.value); + + if (options.placeholder) { + input.attr('placeholder', options.placeholder); + } + + if (options.pattern) { + input.attr('pattern', options.pattern); + } + + if (options.required) { + input.prop({ 'required': true }); + } + + // These input types have extra attributes which affect their input validation. + // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs. + // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates + if (options.inputType !== 'date') { + if (options.step) { + if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) { + input.attr('step', options.step); + } + else { + throw new Error('"step" must be a valid positive number or the value "any". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.'); + } + } + } + + if (minAndMaxAreValid(options.inputType, options.min, options.max)) { + if (options.min !== undefined) { + input.attr('min', options.min); + } + if (options.max !== undefined) { + input.attr('max', options.max); + } + } + break; + + case 'select': + let groups = {}; + inputOptions = options.inputOptions || []; + + if (!$.isArray(inputOptions)) { + throw new Error('Please pass an array of input options'); + } + + if (!inputOptions.length) { + throw new Error('prompt with "inputType" set to "select" requires at least one option'); + } + + // Note: 'placeholder' is not actually a valid attribute for a select element, but we'll allow it, assuming it might be used for a plugin + if (options.placeholder) { + input.attr('placeholder', options.placeholder); + } + + if (options.required) { + input.prop({ 'required': true }); + } + + if (options.multiple) { + input.prop({ 'multiple': true }); + } + + each(inputOptions, function (_, option) { + // Assume the element to attach to is the input... + let elem = input; + + if (option.value === undefined || option.text === undefined) { + throw new Error('each option needs a "value" property and a "text" property'); + } + + // ... but override that element if this option sits in a group + + if (option.group) { + // Initialise group if necessary + if (!groups[option.group]) { + groups[option.group] = $('').attr('label', option.group); + } + + elem = groups[option.group]; + } + + let o = $(templates.option); + o.attr('value', option.value).text(option.text); + elem.append(o); + }); + + each(groups, function (_, group) { + input.append(group); + }); + + // Safe to set a select's value as per a normal input + input.val(options.value); + break; + + case 'checkbox': + let checkboxValues = $.isArray(options.value) ? options.value : [options.value]; + inputOptions = options.inputOptions || []; + + if (!inputOptions.length) { + throw new Error('prompt with "inputType" set to "checkbox" requires at least one option'); + } + + // Checkboxes have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead + input = $('
'); + + each(inputOptions, function (_, option) { + if (option.value === undefined || option.text === undefined) { + throw new Error('each option needs a "value" property and a "text" property'); + } + + let checkbox = $(templates.inputs[options.inputType]); + + checkbox.find('input').attr('value', option.value); + checkbox.find('label').append('\n' + option.text); + + // We've ensured values is an array, so we can always iterate over it + each(checkboxValues, function (_, value) { + if (value === option.value) { + checkbox.find('input').prop('checked', true); + } + }); + + input.append(checkbox); + }); + break; + + case 'radio': + // Make sure that value is not an array (only a single radio can ever be checked) + if (options.value !== undefined && $.isArray(options.value)) { + throw new Error('prompt with "inputType" set to "radio" requires a single, non-array value for "value"'); + } + + inputOptions = options.inputOptions || []; + + if (!inputOptions.length) { + throw new Error('prompt with "inputType" set to "radio" requires at least one option'); + } + + // Radiobuttons have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead + input = $('
'); + + // Radiobuttons should always have an initial checked input checked in a "group". + // If value is undefined or doesn't match an input option, select the first radiobutton + let checkFirstRadio = true; + + each(inputOptions, function (_, option) { + if (option.value === undefined || option.text === undefined) { + throw new Error('each option needs a "value" property and a "text" property'); + } + + let radio = $(templates.inputs[options.inputType]); + + radio.find('input').attr('value', option.value); + radio.find('label').append('\n' + option.text); + + if (options.value !== undefined) { + if (option.value === options.value) { + radio.find('input').prop('checked', true); + checkFirstRadio = false; + } + } + + input.append(radio); + }); + + if (checkFirstRadio) { + input.find('input[type="radio"]').first().prop('checked', true); + } + break; + } + + // Now place it in our form + form.append(input); + + form.on('submit', function (e) { + e.preventDefault(); + // Fix for SammyJS (or similar JS routing library) hijacking the form post. + e.stopPropagation(); + + // @TODO can we actually click *the* button object instead? + // e.g. buttons.confirm.click() or similar + promptDialog.find('.bootbox-accept').trigger('click'); + }); + + if ($.trim(options.message) !== '') { + // Add the form to whatever content the user may have added. + let message = $(templates.promptMessage).html(options.message); + form.prepend(message); + options.message = form; + } + else { + options.message = form; + } + + // Generate the dialog + promptDialog = exports.dialog(options); + + // Clear the existing handler focusing the submit button... + promptDialog.off('shown.bs.modal', focusPrimaryButton); + + // ...and replace it with one focusing our input, if possible + promptDialog.on('shown.bs.modal', function () { + // Need the closure here since input isn'tcan object otherwise + input.focus(); + }); + + if (shouldShow === true) { + promptDialog.modal('show'); + } + + return promptDialog; + }; + + + // INTERNAL FUNCTIONS + // ************************************************************************************************************* + + // Map a flexible set of arguments into a single returned object. + // If args.length is already one just return it, otherwise use the properties argument to map the unnamed args to object properties. + // So in the latter case: + // + // mapArguments(["foo", $.noop], ["message", "callback"]) + // + // results in + // + // { message: "foo", callback: $.noop } + // + function mapArguments(args, properties) { + let argsLength = args.length; + let options = {}; + + if (argsLength < 1 || argsLength > 2) { + throw new Error('Invalid argument length'); + } + + if (argsLength === 2 || typeof args[0] === 'string') { + options[properties[0]] = args[0]; + options[properties[1]] = args[1]; + } else { + options = args[0]; + } + + return options; + } + + + // Merge a set of default dialog options with user supplied arguments + function mergeArguments(defaults, args, properties) { + return $.extend( + // Deep merge + true, + // Ensure the target is an empty, unreferenced object + {}, + // The base options object for this type of dialog (often just buttons) + defaults, + // 'args' could be an object or array; if it's an array properties will map it to a proper options object + mapArguments(args, properties) + ); + } + + + // This entry-level method makes heavy use of composition to take a simple range of inputs and return valid options suitable for passing to bootbox.dialog + function mergeDialogOptions(className, labels, properties, args) { + let locale; + if (args && args[0]) { + locale = args[0].locale || defaults.locale; + let swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder; + + if (swapButtons) { + labels = labels.reverse(); + } + } + + // Build up a base set of dialog properties + let baseOptions = { + className: 'bootbox-' + className, + buttons: createLabels(labels, locale) + }; + + // Ensure the buttons properties generated, *after* merging with user args are still valid against the supplied labels + return validateButtons( + // Merge the generated base properties with user supplied arguments + mergeArguments( + baseOptions, + args, + // If args.length > 1, properties specify how each arg maps to an object key + properties + ), + labels + ); + } + + + // Checks each button object to see if key is valid. + // This function will only be called by the alert, confirm, and prompt helpers. + function validateButtons(options, buttons) { + let allowedButtons = {}; + each(buttons, function (key, value) { + allowedButtons[value] = true; + }); + + each(options.buttons, function (key) { + if (allowedButtons[key] === undefined) { + throw new Error('button key "' + key + '" is not allowed (options are ' + buttons.join(' ') + ')'); + } + }); + + return options; + } + + + + // From a given list of arguments, return a suitable object of button labels. + // All this does is normalise the given labels and translate them where possible. + // e.g. "ok", "confirm" -> { ok: "OK", cancel: "Annuleren" } + function createLabels(labels, locale) { + let buttons = {}; + + for (let i = 0, j = labels.length; i < j; i++) { + let argument = labels[i]; + let key = argument.toLowerCase(); + let value = argument.toUpperCase(); + + buttons[key] = { + label: getText(value, locale) + }; + } + + return buttons; + } + + + + // Get localized text from a locale. Defaults to 'en' locale if no locale provided or a non-registered locale is requested + function getText(key, locale) { + let labels = locales[locale]; + + return labels ? labels[key] : locales.en[key]; + } + + + + // Filter and tidy up any user supplied parameters to this dialog. + // Also looks for any shorthands used and ensures that the options which are returned are all normalized properly + function sanitize(options) { + let buttons; + let total; + + if (typeof options !== 'object') { + throw new Error('Please supply an object of options'); + } + + if (!options.message) { + throw new Error('"message" option must not be null or an empty string.'); + } + + // Make sure any supplied options take precedence over defaults + options = $.extend({}, defaults, options); + + // Make sure backdrop is either true, false, or 'static' + if (!options.backdrop) { + options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static'; + } else { + options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true; + } + + // No buttons is still a valid dialog but it's cleaner to always have a buttons object to iterate over, even if it's empty + if (!options.buttons) { + options.buttons = {}; + } + + buttons = options.buttons; + + total = getKeyLength(buttons); + + each(buttons, function (key, button, index) { + if ($.isFunction(button)) { + // Short form, assume value is our callback. Since button isn't an object it isn't a reference either so re-assign it + button = buttons[key] = { + callback: button + }; + } + + // Before any further checks, make sure button is the correct type + if ($.type(button) !== 'object') { + throw new Error('button with key "' + key + '" must be an object'); + } + + if (!button.label) { + // The lack of an explicit label means we'll assume the key is good enough + button.label = key; + } + + if (!button.className) { + let isPrimary = false; + if (options.swapButtonOrder) { + isPrimary = index === 0; + } + else { + isPrimary = index === total - 1; + } + + if (total <= 2 && isPrimary) { + // always add a primary to the main option in a one or two-button dialog + button.className = 'btn-primary'; + } else { + // adding both classes allows us to target both BS3 and BS4 without needing to check the version + button.className = 'btn-secondary btn-default'; + } + } + }); + + return options; + } + + + // Returns a count of the properties defined on the object + function getKeyLength(obj) { + return Object.keys(obj).length; + } + + + // Tiny wrapper function around jQuery.each; just adds index as the third parameter + function each(collection, iterator) { + let index = 0; + $.each(collection, function (key, value) { + iterator(key, value, index++); + }); + } + + + function focusPrimaryButton(e) { + e.data.dialog.find('.bootbox-accept').first().trigger('focus'); + } + + + function destroyModal(e) { + // Ensure we don't accidentally intercept hidden events triggered by children of the current dialog. + // We shouldn't need to handle this anymore, now that Bootstrap namespaces its events, but still worth doing. + if (e.target === e.data.dialog[0]) { + e.data.dialog.remove(); + } + } + + + function unbindModal(e) { + if (e.target === e.data.dialog[0]) { + e.data.dialog.off('escape.close.bb'); + e.data.dialog.off('click'); + } + } + + + // Handle the invoked dialog callback + function processCallback(e, dialog, callback) { + e.stopPropagation(); + e.preventDefault(); + + // By default we assume a callback will get rid of the dialog, although it is given the opportunity to override this + + // If the callback can be invoked and it *explicitly returns false*, then we'll set a flag to keep the dialog active... + let preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false; + + // ... otherwise we'll bin it + if (!preserveDialog) { + dialog.modal('hide'); + } + } + + // Validate `min` and `max` values based on the current `inputType` value + function minAndMaxAreValid(type, min, max) { + let result = false; + let minValid = true; + let maxValid = true; + + if (type === 'date') { + if (min !== undefined && !(minValid = dateIsValid(min))) { + console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.'); + } + else if (max !== undefined && !(maxValid = dateIsValid(max))) { + console.warn('Browsers which natively support the "date" input type expect date values to be of the form "YYYY-MM-DD" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.'); + } + } + else if (type === 'time') { + if (min !== undefined && !(minValid = timeIsValid(min))) { + throw new Error('"min" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.'); + } + else if (max !== undefined && !(maxValid = timeIsValid(max))) { + throw new Error('"max" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.'); + } + } + else { + if (min !== undefined && isNaN(min)) { + minValid = false; + throw new Error('"min" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.'); + } + + if (max !== undefined && isNaN(max)) { + maxValid = false; + throw new Error('"max" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); + } + } + + if (minValid && maxValid) { + if (max <= min) { + throw new Error('"max" must be greater than "min". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.'); + } + else { + result = true; + } + } + + return result; + } + + function timeIsValid(value) { + return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(value); + } + + function dateIsValid(value) { + return /(\d{4})-(\d{2})-(\d{2})/.test(value); + } + + // The Bootbox object + return exports; +})); +;/*! @preserve + * bootbox.locales.js + * version: 5.5.2 + * author: Nick Payne + * license: MIT + * http://bootboxjs.com/ + */ +(function (global, factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + define(['bootbox'], factory); + } else if (typeof module === 'object' && module.exports) { + factory(require('./bootbox')); + } else { + factory(global.bootbox); + } +}(this, function (bootbox) { + 'use strict'; + (function () { + bootbox.addLocale('ar', { + OK: 'موافق', + CANCEL: 'الغاء', + CONFIRM: 'تأكيد' + }); + })(); + + (function () { + bootbox.addLocale('az', { + OK: 'OK', + CANCEL: 'İmtina et', + CONFIRM: 'Təsdiq et' + }); + })(); + + (function () { + bootbox.addLocale('bg_BG', { + OK: 'Ок', + CANCEL: 'Отказ', + CONFIRM: 'Потвърждавам' + }); + })(); + + (function () { + bootbox.addLocale('br', { + OK: 'OK', + CANCEL: 'Cancelar', + CONFIRM: 'Sim' + }); + })(); + + (function () { + bootbox.addLocale('cs', { + OK: 'OK', + CANCEL: 'Zrušit', + CONFIRM: 'Potvrdit' + }); + })(); + + (function () { + bootbox.addLocale('da', { + OK: 'OK', + CANCEL: 'Annuller', + CONFIRM: 'Accepter' + }); + })(); + + (function () { + bootbox.addLocale('de', { + OK: 'OK', + CANCEL: 'Abbrechen', + CONFIRM: 'Akzeptieren' + }); + })(); + + (function () { + bootbox.addLocale('el', { + OK: 'Εντάξει', + CANCEL: 'Ακύρωση', + CONFIRM: 'Επιβεβαίωση' + }); + })(); + + (function () { + bootbox.addLocale('en', { + OK: 'OK', + CANCEL: 'Cancel', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('es', { + OK: 'OK', + CANCEL: 'Cancelar', + CONFIRM: 'Aceptar' + }); + })(); + + (function () { + bootbox.addLocale('eu', { + OK: 'OK', + CANCEL: 'Ezeztatu', + CONFIRM: 'Onartu' + }); + })(); + + (function () { + bootbox.addLocale('et', { + OK: 'OK', + CANCEL: 'Katkesta', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('fa', { + OK: 'قبول', + CANCEL: 'لغو', + CONFIRM: 'تایید' + }); + })(); + + (function () { + bootbox.addLocale('fi', { + OK: 'OK', + CANCEL: 'Peruuta', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('fr', { + OK: 'OK', + CANCEL: 'Annuler', + CONFIRM: 'Confirmer' + }); + })(); + + (function () { + bootbox.addLocale('he', { + OK: 'אישור', + CANCEL: 'ביטול', + CONFIRM: 'אישור' + }); + })(); + + (function () { + bootbox.addLocale('hu', { + OK: 'OK', + CANCEL: 'Mégsem', + CONFIRM: 'Megerősít' + }); + })(); + + (function () { + bootbox.addLocale('hr', { + OK: 'OK', + CANCEL: 'Odustani', + CONFIRM: 'Potvrdi' + }); + })(); + + (function () { + bootbox.addLocale('id', { + OK: 'OK', + CANCEL: 'Batal', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('it', { + OK: 'OK', + CANCEL: 'Annulla', + CONFIRM: 'Conferma' + }); + })(); + + (function () { + bootbox.addLocale('ja', { + OK: 'OK', + CANCEL: 'キャンセル', + CONFIRM: '確認' + }); + })(); + + (function () { + bootbox.addLocale('ka', { + OK: 'OK', + CANCEL: 'გაუქმება', + CONFIRM: 'დადასტურება' + }); + })(); + + (function () { + bootbox.addLocale('ko', { + OK: 'OK', + CANCEL: '취소', + CONFIRM: '확인' + }); + })(); + + (function () { + bootbox.addLocale('lt', { + OK: 'Gerai', + CANCEL: 'Atšaukti', + CONFIRM: 'Patvirtinti' + }); + })(); + + (function () { + bootbox.addLocale('lv', { + OK: 'Labi', + CANCEL: 'Atcelt', + CONFIRM: 'Apstiprināt' + }); + })(); + + (function () { + bootbox.addLocale('nl', { + OK: 'OK', + CANCEL: 'Annuleren', + CONFIRM: 'Accepteren' + }); + })(); + + (function () { + bootbox.addLocale('no', { + OK: 'OK', + CANCEL: 'Avbryt', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('pl', { + OK: 'OK', + CANCEL: 'Anuluj', + CONFIRM: 'Potwierdź' + }); + })(); + + (function () { + bootbox.addLocale('pt', { + OK: 'OK', + CANCEL: 'Cancelar', + CONFIRM: 'Confirmar' + }); + })(); + + (function () { + bootbox.addLocale('ru', { + OK: 'OK', + CANCEL: 'Отмена', + CONFIRM: 'Подтвердить' + }); + })(); + + (function () { + bootbox.addLocale('sk', { + OK: 'OK', + CANCEL: 'Zrušiť', + CONFIRM: 'Potvrdiť' + }); + })(); + + (function () { + bootbox.addLocale('sl', { + OK: 'OK', + CANCEL: 'Prekliči', + CONFIRM: 'Potrdi' + }); + })(); + + (function () { + bootbox.addLocale('sq', { + OK: 'OK', + CANCEL: 'Anulo', + CONFIRM: 'Prano' + }); + })(); + + (function () { + bootbox.addLocale('sv', { + OK: 'OK', + CANCEL: 'Avbryt', + CONFIRM: 'OK' + }); + })(); + + (function () { + bootbox.addLocale('sw', { + OK: 'Sawa', + CANCEL: 'Ghairi', + CONFIRM: 'Thibitisha' + }); + })(); + + (function () { + bootbox.addLocale('ta', { + OK : 'சரி', + CANCEL : 'ரத்து செய்', + CONFIRM : 'உறுதி செய்' + }); + })(); + + (function () { + bootbox.addLocale('th', { + OK: 'ตกลง', + CANCEL: 'ยกเลิก', + CONFIRM: 'ยืนยัน' + }); + })(); + + (function () { + bootbox.addLocale('tr', { + OK: 'Tamam', + CANCEL: 'İptal', + CONFIRM: 'Onayla' + }); + })(); + + (function () { + bootbox.addLocale('uk', { + OK: 'OK', + CANCEL: 'Відміна', + CONFIRM: 'Прийняти' + }); + })(); + + (function () { + bootbox.addLocale('vi', { + OK: 'OK', + CANCEL: 'Hủy bỏ', + CONFIRM: 'Xác nhận' + }); + })(); + + (function () { + bootbox.addLocale('zh_CN', { + OK: 'OK', + CANCEL: '取消', + CONFIRM: '确认' + }); + })(); + + (function () { + bootbox.addLocale('zh_TW', { + OK: 'OK', + CANCEL: '取消', + CONFIRM: '確認' + }); + })(); +})); \ No newline at end of file diff --git a/bootbox.js b/bootbox.js index 21e0089a..8acfa3e8 100644 --- a/bootbox.js +++ b/bootbox.js @@ -131,7 +131,11 @@ // Whether or not to destroy the modal on hide reusable: false, // The element which triggered the dialog - relatedTarget: null + relatedTarget: null, + // The size of the modal to generate + size: null, + // A unique indentifier for this modal + id: null }; @@ -326,6 +330,10 @@ dialog.addClass(options.className); } + if (options.id) { + dialog.attr({ 'id': options.id }); + } + if (options.size) { // Requires Bootstrap 3.1.0 or higher if (options.fullBootstrapVersion.substring(0, 3) < '3.1') { @@ -364,25 +372,26 @@ } } - if(options.title || options.closeButton){ - body.before(header); + if(options.title){ + header.find('.modal-title').html(options.title); + } + else { + header.addClass('pb-0 border-0'); + } - if (options.title) { - dialog.find('.modal-title').html(options.title); - } + body.before(header); - if (options.closeButton) { - let closeButton = $(templates.closeButton); - if (options.fullBootstrapVersion < '5.0.0') { - closeButton.html('×'); - } + if (options.closeButton) { + let closeButton = $(templates.closeButton); + if (options.fullBootstrapVersion < '5.0.0') { + closeButton.html('×'); + } - if (options.bootstrap > 3) { - dialog.find('.modal-header').append(closeButton); - } - else { - dialog.find('.modal-header').prepend(closeButton); - } + if (options.bootstrap > 3) { + dialog.find('.modal-header').append(closeButton); + } + else { + dialog.find('.modal-header').prepend(closeButton); } } diff --git a/dist/bootbox.all.min.js b/dist/bootbox.all.min.js index d1059bc4..29e98598 100644 --- a/dist/bootbox.all.min.js +++ b/dist/bootbox.all.min.js @@ -3,4 +3,4 @@ * * http://bootboxjs.com/license.txt */ -!function(t,e){'use strict';'function'==typeof define&&define.amd?define(['jquery'],e):'object'==typeof exports?module.exports=e(require('jquery')):t.bootbox=e(t.jQuery)}(this,function e(u,p){'use strict';var r,n,i,l;Object.keys||(Object.keys=(r=Object.prototype.hasOwnProperty,n=!{toString:null}.propertyIsEnumerable('toString'),l=(i=['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor']).length,function(t){if('function'!=typeof t&&('object'!=typeof t||null===t))throw new TypeError('Object.keys called on non-object');var e,o,a=[];for(e in t)r.call(t,e)&&a.push(e);if(n)for(o=0;o
",header:"
",footer:'',closeButton:'',form:'
',button:'',option:'',promptMessage:'
',inputs:{text:'',textarea:'',email:'',select:'',checkbox:'
',radio:'
',date:'',time:'',number:'',password:'',range:''}},m={locale:'en',backdrop:'static',animate:!0,className:null,closeButton:!0,show:!0,container:'body',value:'',inputType:'text',swapButtonOrder:!1,centerVertical:!1,multiple:!1,scrollable:!1,reusable:!1};function c(t,e,o){return u.extend(!0,{},t,function(t,e){var o=t.length,a={};if(o<1||2').attr('label',e.group)),o=i[e.group]);var a=u(f.option);a.attr('value',e.value).text(e.text),o.append(a)}),O(i,function(t,e){n.append(e)}),n.val(r.value);break;case'checkbox':var l=u.isArray(r.value)?r.value:[r.value];if(!(a=r.inputOptions||[]).length)throw new Error('prompt with "inputType" set to "checkbox" requires at least one option');n=u('
'),O(a,function(t,o){if(o.value===p||o.text===p)throw new Error('each option needs a "value" property and a "text" property');var a=u(f.inputs[r.inputType]);a.find('input').attr('value',o.value),a.find('label').append('\n'+o.text),O(l,function(t,e){e===o.value&&a.find('input').prop('checked',!0)}),n.append(a)});break;case'radio':if(r.value!==p&&u.isArray(r.value))throw new Error('prompt with "inputType" set to "radio" requires a single, non-array value for "value"');if(!(a=r.inputOptions||[]).length)throw new Error('prompt with "inputType" set to "radio" requires at least one option');n=u('
');var s=!0;O(a,function(t,e){if(e.value===p||e.text===p)throw new Error('each option needs a "value" property and a "text" property');var o=u(f.inputs[r.inputType]);o.find('input').attr('value',e.value),o.find('label').append('\n'+e.text),r.value!==p&&e.value===r.value&&(o.find('input').prop('checked',!0),s=!1),n.append(o)}),s&&n.find('input[type="radio"]').first().prop('checked',!0)}if(t.append(n),t.on('submit',function(t){t.preventDefault(),t.stopPropagation(),e.find('.bootbox-accept').trigger('click')}),''!==u.trim(r.message)){var c=u(f.promptMessage).html(r.message);t.prepend(c),r.message=t}else r.message=t;return(e=d.dialog(r)).off('shown.bs.modal',w),e.on('shown.bs.modal',function(){n.focus()}),!0===o&&e.modal('show'),e},d}); \ No newline at end of file +!function(e,t){'use strict';'function'==typeof define&&define.amd?define(['jquery'],t):'object'==typeof exports?module.exports=t(require('jquery')):e.bootbox=t(e.jQuery)}(this,function t(s,c){'use strict';Object.keys||(Object.keys=function(){let r=Object.prototype.hasOwnProperty,n=!{toString:null}.propertyIsEnumerable('toString'),l=['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'],i=l.length;return function(e){if('function'!=typeof e&&('object'!=typeof e||null===e))throw new TypeError('Object.keys called on non-object');let t=[],o,a;for(o in e)r.call(e,o)&&t.push(o);if(n)for(a=0;a