diff --git a/.github/Pull_Request_Template.md b/.github/Pull_Request_Template.md index df91d55..3b6433d 100644 --- a/.github/Pull_Request_Template.md +++ b/.github/Pull_Request_Template.md @@ -15,7 +15,7 @@ information. --> -## Checklist +## Checklist @@ -23,4 +23,4 @@ information. --> - [ ] My code adheres to the established style guidelines of the project. - [ ] I have included comments in areas that may be difficult to understand. - [ ] My changes have not introduced any new warnings. -- [ ] I have conducted a self-review of my code. \ No newline at end of file +- [ ] I have conducted a self-review of my code. diff --git a/README.md b/README.md index 5bf764b..287af18 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ - ## welcome to the official GitHub repository of Eduhub Community Website - Eduhub is a community of the people, for the people and by the people. - Our vision is to create an environment where people can learn and apply technical knowledge together. - Our mission is to build a strong technical community which is open-minded and has an intense desire for consistent learning from one another in the community. We have been conducting and organizing numerous Open Source Programs, Hackathons, Meetups, Conferences and 1:1 Mentorships. -### An Open Source project Website built using HTML, CSS, JavaScript and Bootstrap Php +Eduhub is a community of the people, for the people and by the people. +Our vision is to create an environment where people can learn and apply technical knowledge together. +Our mission is to build a strong technical community which is open-minded and has an intense desire for consistent learning from one another in the community. We have been conducting and organizing numerous Open Source Programs, Hackathons, Meetups, Conferences and 1:1 Mentorships. + +### An Open Source project Website built using HTML, CSS, JavaScript and Bootstrap Php -![image](https://eduhubcommunity.tech/assets/img/Eduhub%20Logo%20(2).png) +![image]()

GSSOC'23 Accepted


@@ -21,14 +21,16 @@ ## How to contribute + ## Contributing + 1. Fork it 2. Create your feature branch `(git checkout -b my-new-feature)` 3. Commit your changes `(git commit -m 'Add some feature')` 4. In case of multiple commits squash them. You can find guide here -4. Run the tests with Go Live and make sure all tests are passed. -5. Push your branch `(git push origin my-new-feature)` -6. Create a new Pull Request, following the template +5. Run the tests with Go Live and make sure all tests are passed. +6. Push your branch `(git push origin my-new-feature)` +7. Create a new Pull Request, following the template Questions can be asked by raising an `Issue`. @@ -127,7 +129,6 @@ or -

OUR VALUABLE CONTRIBUTORS✨

@@ -140,4 +141,3 @@ or [![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) [![forthebadge](https://forthebadge.com/images/badges/built-by-developers.svg)](https://forthebadge.com) - diff --git a/assets/js/gallery-scripts.js b/assets/js/gallery-scripts.js index b0b6041..ad9887f 100644 --- a/assets/js/gallery-scripts.js +++ b/assets/js/gallery-scripts.js @@ -1,4 +1,3 @@ - /* $('.gallery-menu').click(() => { $('.gallery-menu ul button').removeClass('active'); $(this).addClass('active'); @@ -7,27 +6,25 @@ return false; }); */ - $(document).ready(() => { - - let popup_btn = $('.popup-btn') - popup_btn.magnificPopup({ - type: 'image', - gallery: { - enabled: true - }, - image: { - // options for image content type - titleSrc: 'title' - } - }) + let popup_btn = $(".popup-btn"); + popup_btn.magnificPopup({ + type: "image", + gallery: { + enabled: true, + }, + image: { + // options for image content type + titleSrc: "title", + }, + }); + + $(".gallery-menu button").on("click", (e) => { + $(".gallery-menu button").removeClass("active"); + $(e.target).addClass("active"); + let selector = $(e.target).attr("data-filter"); + $(".gallery-item").isotope({ filter: selector }); - $('.gallery-menu button').on('click', (e) => { - $('.gallery-menu button').removeClass('active') - $(e.target).addClass('active') - let selector = $(e.target).attr('data-filter') - $('.gallery-item').isotope({ filter: selector}) - - return false - }) -}) \ No newline at end of file + return false; + }); +}); diff --git a/assets/js/main.js b/assets/js/main.js index d4c5e4a..61fea67 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -1,139 +1,152 @@ /** -* Template Name: Bikin - v4.7.0 -* Template URL: https://bootstrapmade.com/bikin-free-simple-landing-page-template/ -* Author: BootstrapMade.com -* License: https://bootstrapmade.com/license/ -*/ -(function() { + * Template Name: Bikin - v4.7.0 + * Template URL: https://bootstrapmade.com/bikin-free-simple-landing-page-template/ + * Author: BootstrapMade.com + * License: https://bootstrapmade.com/license/ + */ +(function () { "use strict"; /** * Easy selector helper function */ const select = (el, all = false) => { - el = el.trim() + el = el.trim(); if (all) { - return [...document.querySelectorAll(el)] + return [...document.querySelectorAll(el)]; } else { - return document.querySelector(el) + return document.querySelector(el); } - } + }; /** * Easy event listener function */ const on = (type, el, listener, all = false) => { - let selectEl = select(el, all) + let selectEl = select(el, all); if (selectEl) { if (all) { - selectEl.forEach(e => e.addEventListener(type, listener)) + selectEl.forEach((e) => e.addEventListener(type, listener)); } else { - selectEl.addEventListener(type, listener) + selectEl.addEventListener(type, listener); } } - } + }; /** - * Easy on scroll event listener + * Easy on scroll event listener */ const onscroll = (el, listener) => { - el.addEventListener('scroll', listener) - } + el.addEventListener("scroll", listener); + }; /** * Navbar links active state on scroll */ - let navbarlinks = select('#navbar .scrollto', true) + let navbarlinks = select("#navbar .scrollto", true); const navbarlinksActive = () => { - let position = window.scrollY + 200 - navbarlinks.forEach(navbarlink => { - if (!navbarlink.hash) return - let section = select(navbarlink.hash) - if (!section) return - if (position >= section.offsetTop && position <= (section.offsetTop + section.offsetHeight)) { - navbarlink.classList.add('active') + let position = window.scrollY + 200; + navbarlinks.forEach((navbarlink) => { + if (!navbarlink.hash) return; + let section = select(navbarlink.hash); + if (!section) return; + if ( + position >= section.offsetTop && + position <= section.offsetTop + section.offsetHeight + ) { + navbarlink.classList.add("active"); } else { - navbarlink.classList.remove('active') + navbarlink.classList.remove("active"); } - }) - } - window.addEventListener('load', navbarlinksActive) - onscroll(document, navbarlinksActive) + }); + }; + window.addEventListener("load", navbarlinksActive); + onscroll(document, navbarlinksActive); /** * Scrolls to an element with header offset */ const scrollto = (el) => { - let header = select('#header') - let offset = header.offsetHeight + let header = select("#header"); + let offset = header.offsetHeight; - let elementPos = select(el).offsetTop + let elementPos = select(el).offsetTop; window.scrollTo({ top: elementPos - offset, - behavior: 'smooth' - }) - } + behavior: "smooth", + }); + }; /** * Back to top button */ - let backtotop = select('.back-to-top') + let backtotop = select(".back-to-top"); if (backtotop) { const toggleBacktotop = () => { if (window.scrollY > 100) { - backtotop.classList.add('active') + backtotop.classList.add("active"); } else { - backtotop.classList.remove('active') + backtotop.classList.remove("active"); } - } - window.addEventListener('load', toggleBacktotop) - onscroll(document, toggleBacktotop) + }; + window.addEventListener("load", toggleBacktotop); + onscroll(document, toggleBacktotop); } /** * Mobile nav toggle */ - on('click', '.mobile-nav-toggle', function(e) { - select('#navbar').classList.toggle('navbar-mobile') - this.classList.toggle('bi-list') - this.classList.toggle('bi-x') - }) + on("click", ".mobile-nav-toggle", function (e) { + select("#navbar").classList.toggle("navbar-mobile"); + this.classList.toggle("bi-list"); + this.classList.toggle("bi-x"); + }); /** * Mobile nav dropdowns activate */ - on('click', '.navbar .dropdown > a', function(e) { - if (select('#navbar').classList.contains('navbar-mobile')) { - e.preventDefault() - this.nextElementSibling.classList.toggle('dropdown-active') - } - }, true) + on( + "click", + ".navbar .dropdown > a", + function (e) { + if (select("#navbar").classList.contains("navbar-mobile")) { + e.preventDefault(); + this.nextElementSibling.classList.toggle("dropdown-active"); + } + }, + true + ); /** * Scrool with ofset on links with a class name .scrollto */ - on('click', '.scrollto', function(e) { - if (select(this.hash)) { - e.preventDefault() + on( + "click", + ".scrollto", + function (e) { + if (select(this.hash)) { + e.preventDefault(); - let navbar = select('#navbar') - if (navbar.classList.contains('navbar-mobile')) { - navbar.classList.remove('navbar-mobile') - let navbarToggle = select('.mobile-nav-toggle') - navbarToggle.classList.toggle('bi-list') - navbarToggle.classList.toggle('bi-x') + let navbar = select("#navbar"); + if (navbar.classList.contains("navbar-mobile")) { + navbar.classList.remove("navbar-mobile"); + let navbarToggle = select(".mobile-nav-toggle"); + navbarToggle.classList.toggle("bi-list"); + navbarToggle.classList.toggle("bi-x"); + } + scrollto(this.hash); } - scrollto(this.hash) - } - }, true) + }, + true + ); /** * Scroll with ofset on page load with hash links in the url */ - window.addEventListener('load', () => { + window.addEventListener("load", () => { if (window.location.hash) { if (select(window.location.hash)) { - scrollto(window.location.hash) + scrollto(window.location.hash); } } }); @@ -141,126 +154,130 @@ /** * Preloader */ - let preloader = select('#preloader'); + let preloader = select("#preloader"); if (preloader) { - window.addEventListener('load', () => { - preloader.remove() + window.addEventListener("load", () => { + preloader.remove(); }); } /** * Porfolio isotope and filter */ - window.addEventListener('load', () => { - let portfolioContainer = select('.portfolio-container'); + window.addEventListener("load", () => { + let portfolioContainer = select(".portfolio-container"); if (portfolioContainer) { let portfolioIsotope = new Isotope(portfolioContainer, { - itemSelector: '.portfolio-item' + itemSelector: ".portfolio-item", }); - let portfolioFilters = select('#portfolio-flters li', true); + let portfolioFilters = select("#portfolio-flters li", true); - on('click', '#portfolio-flters li', function(e) { - e.preventDefault(); - portfolioFilters.forEach(function(el) { - el.classList.remove('filter-active'); - }); - this.classList.add('filter-active'); + on( + "click", + "#portfolio-flters li", + function (e) { + e.preventDefault(); + portfolioFilters.forEach(function (el) { + el.classList.remove("filter-active"); + }); + this.classList.add("filter-active"); - portfolioIsotope.arrange({ - filter: this.getAttribute('data-filter') - }); - portfolioIsotope.on('arrangeComplete', function() { - AOS.refresh() - }); - }, true); + portfolioIsotope.arrange({ + filter: this.getAttribute("data-filter"), + }); + portfolioIsotope.on("arrangeComplete", function () { + AOS.refresh(); + }); + }, + true + ); } - }); /** - * Initiate portfolio lightbox + * Initiate portfolio lightbox */ const portfolioLightbox = GLightbox({ - selector: '.portfolio-lightbox' + selector: ".portfolio-lightbox", }); /** * Portfolio details slider */ - new Swiper('.portfolio-details-slider', { + new Swiper(".portfolio-details-slider", { speed: 400, loop: true, autoplay: { delay: 5000, - disableOnInteraction: false + disableOnInteraction: false, }, pagination: { - el: '.swiper-pagination', - type: 'bullets', - clickable: true - } + el: ".swiper-pagination", + type: "bullets", + clickable: true, + }, }); /** * Testimonials slider */ - new Swiper('.testimonials-slider', { + new Swiper(".testimonials-slider", { speed: 600, loop: true, autoplay: { delay: 5000, - disableOnInteraction: false + disableOnInteraction: false, }, - slidesPerView: 'auto', + slidesPerView: "auto", pagination: { - el: '.swiper-pagination', - type: 'bullets', - clickable: true + el: ".swiper-pagination", + type: "bullets", + clickable: true, }, breakpoints: { 320: { slidesPerView: 1, - spaceBetween: 20 + spaceBetween: 20, }, 1200: { slidesPerView: 3, - spaceBetween: 20 - } - } + spaceBetween: 20, + }, + }, }); /** * Animation on scroll */ - window.addEventListener('load', () => { + window.addEventListener("load", () => { AOS.init({ duration: 1000, - easing: 'ease-in-out', + easing: "ease-in-out", once: true, - mirror: false - }) + mirror: false, + }); }); - -})() +})(); /* Function that sends the email to eduuhub */ function SendMail() { - const Data = '{"service" : "service_t4spjxu", "template" : "template_voik16d"}'; + const Data = + '{"service" : "service_t4spjxu", "template" : "template_voik16d"}'; const Object = JSON.parse(Data); - var params = { - from_name: document.forms["contact-form"]["name"].value, - from_email: document.forms["contact-form"]["email"].value, - subject_tittle: document.forms["contact-form"]["subject"].value, - message: document.forms["contact-form"]["message"].value, - } - emailjs.send(Object.service, Object.template, params).then(function (res) { - var element = document.getElementById('sent_message'); + var params = { + from_name: document.forms["contact-form"]["name"].value, + from_email: document.forms["contact-form"]["email"].value, + subject_tittle: document.forms["contact-form"]["subject"].value, + message: document.forms["contact-form"]["message"].value, + }; + emailjs.send(Object.service, Object.template, params).then(function (res) { + var element = document.getElementById("sent_message"); element.innerHTML = "Your message has been sent. Thank you!"; element.classList.add("alert"); element.classList.add("alert-success"); - }) -} \ No newline at end of file + }); +} diff --git a/assets/vendor/aos/aos.js b/assets/vendor/aos/aos.js index 86dc4bf..4e3bdb9 100644 --- a/assets/vendor/aos/aos.js +++ b/assets/vendor/aos/aos.js @@ -1 +1,672 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.AOS=t():e.AOS=t()}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),x.disableMutationObserver=!0),document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready("[data-aos]",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(s);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return f;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s="Expected a function",f=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==f}function a(e){if("number"==typeof e)return e;if(r(e))return s;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",s=NaN,f="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;te.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])}); \ No newline at end of file +!(function (e, t) { + "object" == typeof exports && "object" == typeof module + ? (module.exports = t()) + : "function" == typeof define && define.amd + ? define([], t) + : "object" == typeof exports + ? (exports.AOS = t()) + : (e.AOS = t()); +})(this, function () { + return (function (e) { + function t(o) { + if (n[o]) return n[o].exports; + var i = (n[o] = { exports: {}, id: o, loaded: !1 }); + return e[o].call(i.exports, i, i.exports, t), (i.loaded = !0), i.exports; + } + var n = {}; + return (t.m = e), (t.c = n), (t.p = "dist/"), t(0); + })([ + function (e, t, n) { + "use strict"; + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + var i = + Object.assign || + function (e) { + for (var t = 1; t < arguments.length; t++) { + var n = arguments[t]; + for (var o in n) + Object.prototype.hasOwnProperty.call(n, o) && (e[o] = n[o]); + } + return e; + }, + r = n(1), + a = (o(r), n(6)), + u = o(a), + c = n(7), + s = o(c), + f = n(8), + d = o(f), + l = n(9), + p = o(l), + m = n(10), + b = o(m), + v = n(11), + y = o(v), + g = n(14), + h = o(g), + w = [], + k = !1, + x = { + offset: 120, + delay: 0, + easing: "ease", + duration: 400, + disable: !1, + once: !1, + startEvent: "DOMContentLoaded", + throttleDelay: 99, + debounceDelay: 50, + disableMutationObserver: !1, + }, + j = function () { + var e = + arguments.length > 0 && void 0 !== arguments[0] && arguments[0]; + if ((e && (k = !0), k)) + return (w = (0, y.default)(w, x)), (0, b.default)(w, x.once), w; + }, + O = function () { + (w = (0, h.default)()), j(); + }, + M = function () { + w.forEach(function (e, t) { + e.node.removeAttribute("data-aos"), + e.node.removeAttribute("data-aos-easing"), + e.node.removeAttribute("data-aos-duration"), + e.node.removeAttribute("data-aos-delay"); + }); + }, + S = function (e) { + return ( + e === !0 || + ("mobile" === e && p.default.mobile()) || + ("phone" === e && p.default.phone()) || + ("tablet" === e && p.default.tablet()) || + ("function" == typeof e && e() === !0) + ); + }, + _ = function (e) { + (x = i(x, e)), (w = (0, h.default)()); + var t = document.all && !window.atob; + return S(x.disable) || t + ? M() + : (x.disableMutationObserver || + d.default.isSupported() || + (console.info( + '\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n ' + ), + (x.disableMutationObserver = !0)), + document + .querySelector("body") + .setAttribute("data-aos-easing", x.easing), + document + .querySelector("body") + .setAttribute("data-aos-duration", x.duration), + document + .querySelector("body") + .setAttribute("data-aos-delay", x.delay), + "DOMContentLoaded" === x.startEvent && + ["complete", "interactive"].indexOf(document.readyState) > -1 + ? j(!0) + : "load" === x.startEvent + ? window.addEventListener(x.startEvent, function () { + j(!0); + }) + : document.addEventListener(x.startEvent, function () { + j(!0); + }), + window.addEventListener( + "resize", + (0, s.default)(j, x.debounceDelay, !0) + ), + window.addEventListener( + "orientationchange", + (0, s.default)(j, x.debounceDelay, !0) + ), + window.addEventListener( + "scroll", + (0, u.default)(function () { + (0, b.default)(w, x.once); + }, x.throttleDelay) + ), + x.disableMutationObserver || d.default.ready("[data-aos]", O), + w); + }; + e.exports = { init: _, refresh: j, refreshHard: O }; + }, + function (e, t) {}, + , + , + , + , + function (e, t) { + (function (t) { + "use strict"; + function n(e, t, n) { + function o(t) { + var n = b, + o = v; + return (b = v = void 0), (k = t), (g = e.apply(o, n)); + } + function r(e) { + return (k = e), (h = setTimeout(f, t)), M ? o(e) : g; + } + function a(e) { + var n = e - w, + o = e - k, + i = t - n; + return S ? j(i, y - o) : i; + } + function c(e) { + var n = e - w, + o = e - k; + return void 0 === w || n >= t || n < 0 || (S && o >= y); + } + function f() { + var e = O(); + return c(e) ? d(e) : void (h = setTimeout(f, a(e))); + } + function d(e) { + return (h = void 0), _ && b ? o(e) : ((b = v = void 0), g); + } + function l() { + void 0 !== h && clearTimeout(h), (k = 0), (b = w = v = h = void 0); + } + function p() { + return void 0 === h ? g : d(O()); + } + function m() { + var e = O(), + n = c(e); + if (((b = arguments), (v = this), (w = e), n)) { + if (void 0 === h) return r(w); + if (S) return (h = setTimeout(f, t)), o(w); + } + return void 0 === h && (h = setTimeout(f, t)), g; + } + var b, + v, + y, + g, + h, + w, + k = 0, + M = !1, + S = !1, + _ = !0; + if ("function" != typeof e) throw new TypeError(s); + return ( + (t = u(t) || 0), + i(n) && + ((M = !!n.leading), + (S = "maxWait" in n), + (y = S ? x(u(n.maxWait) || 0, t) : y), + (_ = "trailing" in n ? !!n.trailing : _)), + (m.cancel = l), + (m.flush = p), + m + ); + } + function o(e, t, o) { + var r = !0, + a = !0; + if ("function" != typeof e) throw new TypeError(s); + return ( + i(o) && + ((r = "leading" in o ? !!o.leading : r), + (a = "trailing" in o ? !!o.trailing : a)), + n(e, t, { leading: r, maxWait: t, trailing: a }) + ); + } + function i(e) { + var t = "undefined" == typeof e ? "undefined" : c(e); + return !!e && ("object" == t || "function" == t); + } + function r(e) { + return ( + !!e && "object" == ("undefined" == typeof e ? "undefined" : c(e)) + ); + } + function a(e) { + return ( + "symbol" == ("undefined" == typeof e ? "undefined" : c(e)) || + (r(e) && k.call(e) == d) + ); + } + function u(e) { + if ("number" == typeof e) return e; + if (a(e)) return f; + if (i(e)) { + var t = "function" == typeof e.valueOf ? e.valueOf() : e; + e = i(t) ? t + "" : t; + } + if ("string" != typeof e) return 0 === e ? e : +e; + e = e.replace(l, ""); + var n = m.test(e); + return n || b.test(e) ? v(e.slice(2), n ? 2 : 8) : p.test(e) ? f : +e; + } + var c = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (e) { + return typeof e; + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : typeof e; + }, + s = "Expected a function", + f = NaN, + d = "[object Symbol]", + l = /^\s+|\s+$/g, + p = /^[-+]0x[0-9a-f]+$/i, + m = /^0b[01]+$/i, + b = /^0o[0-7]+$/i, + v = parseInt, + y = + "object" == ("undefined" == typeof t ? "undefined" : c(t)) && + t && + t.Object === Object && + t, + g = + "object" == ("undefined" == typeof self ? "undefined" : c(self)) && + self && + self.Object === Object && + self, + h = y || g || Function("return this")(), + w = Object.prototype, + k = w.toString, + x = Math.max, + j = Math.min, + O = function () { + return h.Date.now(); + }; + e.exports = o; + }).call( + t, + (function () { + return this; + })() + ); + }, + function (e, t) { + (function (t) { + "use strict"; + function n(e, t, n) { + function i(t) { + var n = b, + o = v; + return (b = v = void 0), (O = t), (g = e.apply(o, n)); + } + function r(e) { + return (O = e), (h = setTimeout(f, t)), M ? i(e) : g; + } + function u(e) { + var n = e - w, + o = e - O, + i = t - n; + return S ? x(i, y - o) : i; + } + function s(e) { + var n = e - w, + o = e - O; + return void 0 === w || n >= t || n < 0 || (S && o >= y); + } + function f() { + var e = j(); + return s(e) ? d(e) : void (h = setTimeout(f, u(e))); + } + function d(e) { + return (h = void 0), _ && b ? i(e) : ((b = v = void 0), g); + } + function l() { + void 0 !== h && clearTimeout(h), (O = 0), (b = w = v = h = void 0); + } + function p() { + return void 0 === h ? g : d(j()); + } + function m() { + var e = j(), + n = s(e); + if (((b = arguments), (v = this), (w = e), n)) { + if (void 0 === h) return r(w); + if (S) return (h = setTimeout(f, t)), i(w); + } + return void 0 === h && (h = setTimeout(f, t)), g; + } + var b, + v, + y, + g, + h, + w, + O = 0, + M = !1, + S = !1, + _ = !0; + if ("function" != typeof e) throw new TypeError(c); + return ( + (t = a(t) || 0), + o(n) && + ((M = !!n.leading), + (S = "maxWait" in n), + (y = S ? k(a(n.maxWait) || 0, t) : y), + (_ = "trailing" in n ? !!n.trailing : _)), + (m.cancel = l), + (m.flush = p), + m + ); + } + function o(e) { + var t = "undefined" == typeof e ? "undefined" : u(e); + return !!e && ("object" == t || "function" == t); + } + function i(e) { + return ( + !!e && "object" == ("undefined" == typeof e ? "undefined" : u(e)) + ); + } + function r(e) { + return ( + "symbol" == ("undefined" == typeof e ? "undefined" : u(e)) || + (i(e) && w.call(e) == f) + ); + } + function a(e) { + if ("number" == typeof e) return e; + if (r(e)) return s; + if (o(e)) { + var t = "function" == typeof e.valueOf ? e.valueOf() : e; + e = o(t) ? t + "" : t; + } + if ("string" != typeof e) return 0 === e ? e : +e; + e = e.replace(d, ""); + var n = p.test(e); + return n || m.test(e) ? b(e.slice(2), n ? 2 : 8) : l.test(e) ? s : +e; + } + var u = + "function" == typeof Symbol && "symbol" == typeof Symbol.iterator + ? function (e) { + return typeof e; + } + : function (e) { + return e && + "function" == typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : typeof e; + }, + c = "Expected a function", + s = NaN, + f = "[object Symbol]", + d = /^\s+|\s+$/g, + l = /^[-+]0x[0-9a-f]+$/i, + p = /^0b[01]+$/i, + m = /^0o[0-7]+$/i, + b = parseInt, + v = + "object" == ("undefined" == typeof t ? "undefined" : u(t)) && + t && + t.Object === Object && + t, + y = + "object" == ("undefined" == typeof self ? "undefined" : u(self)) && + self && + self.Object === Object && + self, + g = v || y || Function("return this")(), + h = Object.prototype, + w = h.toString, + k = Math.max, + x = Math.min, + j = function () { + return g.Date.now(); + }; + e.exports = n; + }).call( + t, + (function () { + return this; + })() + ); + }, + function (e, t) { + "use strict"; + function n(e) { + var t = void 0, + o = void 0, + i = void 0; + for (t = 0; t < e.length; t += 1) { + if (((o = e[t]), o.dataset && o.dataset.aos)) return !0; + if ((i = o.children && n(o.children))) return !0; + } + return !1; + } + function o() { + return ( + window.MutationObserver || + window.WebKitMutationObserver || + window.MozMutationObserver + ); + } + function i() { + return !!o(); + } + function r(e, t) { + var n = window.document, + i = o(), + r = new i(a); + (u = t), + r.observe(n.documentElement, { + childList: !0, + subtree: !0, + removedNodes: !0, + }); + } + function a(e) { + e && + e.forEach(function (e) { + var t = Array.prototype.slice.call(e.addedNodes), + o = Array.prototype.slice.call(e.removedNodes), + i = t.concat(o); + if (n(i)) return u(); + }); + } + Object.defineProperty(t, "__esModule", { value: !0 }); + var u = function () {}; + t.default = { isSupported: i, ready: r }; + }, + function (e, t) { + "use strict"; + function n(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + } + function o() { + return navigator.userAgent || navigator.vendor || window.opera || ""; + } + Object.defineProperty(t, "__esModule", { value: !0 }); + var i = (function () { + function e(e, t) { + for (var n = 0; n < t.length; n++) { + var o = t[n]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + return function (t, n, o) { + return n && e(t.prototype, n), o && e(t, o), t; + }; + })(), + r = + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, + a = + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + u = + /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i, + c = + /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i, + s = (function () { + function e() { + n(this, e); + } + return ( + i(e, [ + { + key: "phone", + value: function () { + var e = o(); + return !(!r.test(e) && !a.test(e.substr(0, 4))); + }, + }, + { + key: "mobile", + value: function () { + var e = o(); + return !(!u.test(e) && !c.test(e.substr(0, 4))); + }, + }, + { + key: "tablet", + value: function () { + return this.mobile() && !this.phone(); + }, + }, + ]), + e + ); + })(); + t.default = new s(); + }, + function (e, t) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }); + var n = function (e, t, n) { + var o = e.node.getAttribute("data-aos-once"); + t > e.position + ? e.node.classList.add("aos-animate") + : "undefined" != typeof o && + ("false" === o || (!n && "true" !== o)) && + e.node.classList.remove("aos-animate"); + }, + o = function (e, t) { + var o = window.pageYOffset, + i = window.innerHeight; + e.forEach(function (e, r) { + n(e, i + o, t); + }); + }; + t.default = o; + }, + function (e, t, n) { + "use strict"; + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + Object.defineProperty(t, "__esModule", { value: !0 }); + var i = n(12), + r = o(i), + a = function (e, t) { + return ( + e.forEach(function (e, n) { + e.node.classList.add("aos-init"), + (e.position = (0, r.default)(e.node, t.offset)); + }), + e + ); + }; + t.default = a; + }, + function (e, t, n) { + "use strict"; + function o(e) { + return e && e.__esModule ? e : { default: e }; + } + Object.defineProperty(t, "__esModule", { value: !0 }); + var i = n(13), + r = o(i), + a = function (e, t) { + var n = 0, + o = 0, + i = window.innerHeight, + a = { + offset: e.getAttribute("data-aos-offset"), + anchor: e.getAttribute("data-aos-anchor"), + anchorPlacement: e.getAttribute("data-aos-anchor-placement"), + }; + switch ( + (a.offset && !isNaN(a.offset) && (o = parseInt(a.offset)), + a.anchor && + document.querySelectorAll(a.anchor) && + (e = document.querySelectorAll(a.anchor)[0]), + (n = (0, r.default)(e).top), + a.anchorPlacement) + ) { + case "top-bottom": + break; + case "center-bottom": + n += e.offsetHeight / 2; + break; + case "bottom-bottom": + n += e.offsetHeight; + break; + case "top-center": + n += i / 2; + break; + case "bottom-center": + n += i / 2 + e.offsetHeight; + break; + case "center-center": + n += i / 2 + e.offsetHeight / 2; + break; + case "top-top": + n += i; + break; + case "bottom-top": + n += e.offsetHeight + i; + break; + case "center-top": + n += e.offsetHeight / 2 + i; + } + return a.anchorPlacement || a.offset || isNaN(t) || (o = t), n + o; + }; + t.default = a; + }, + function (e, t) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }); + var n = function (e) { + for ( + var t = 0, n = 0; + e && !isNaN(e.offsetLeft) && !isNaN(e.offsetTop); + + ) + (t += e.offsetLeft - ("BODY" != e.tagName ? e.scrollLeft : 0)), + (n += e.offsetTop - ("BODY" != e.tagName ? e.scrollTop : 0)), + (e = e.offsetParent); + return { top: n, left: t }; + }; + t.default = n; + }, + function (e, t) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }); + var n = function (e) { + return ( + (e = e || document.querySelectorAll("[data-aos]")), + Array.prototype.map.call(e, function (e) { + return { node: e }; + }) + ); + }; + t.default = n; + }, + ]); +}); diff --git a/assets/vendor/bootstrap/js/bootstrap.bundle.js b/assets/vendor/bootstrap/js/bootstrap.bundle.js index e5d26a2..8acee9e 100644 --- a/assets/vendor/bootstrap/js/bootstrap.bundle.js +++ b/assets/vendor/bootstrap/js/bootstrap.bundle.js @@ -1,13 +1,18 @@ /*! - * 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) - */ + * 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 (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.bootstrap = factory()); -})(this, (function () { 'use strict'; + typeof exports === "object" && typeof module !== "undefined" + ? (module.exports = factory()) + : typeof define === "function" && define.amd + ? define(factory) + : ((global = + typeof globalThis !== "undefined" ? globalThis : global || self), + (global.bootstrap = factory())); +})(this, function () { + "use strict"; /** * -------------------------------------------------------------------------- @@ -17,14 +22,17 @@ */ const MAX_UID = 1000000; const MILLISECONDS_MULTIPLIER = 1000; - const TRANSITION_END = 'transitionend'; // Shoutout AngusCroll (https://goo.gl/pxwQGp) + const TRANSITION_END = "transitionend"; // Shoutout AngusCroll (https://goo.gl/pxwQGp) - const toType = obj => { + const toType = (obj) => { if (obj === null || obj === undefined) { return `${obj}`; } - return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); + return {}.toString + .call(obj) + .match(/\s([a-z]+)/i)[1] + .toLowerCase(); }; /** * -------------------------------------------------------------------------- @@ -32,8 +40,7 @@ * -------------------------------------------------------------------------- */ - - const getUID = prefix => { + const getUID = (prefix) => { do { prefix += Math.floor(Math.random() * MAX_UID); } while (document.getElementById(prefix)); @@ -41,31 +48,30 @@ return prefix; }; - const getSelector = element => { - let selector = element.getAttribute('data-bs-target'); + const getSelector = (element) => { + let selector = element.getAttribute("data-bs-target"); - if (!selector || selector === '#') { - let hrefAttr = element.getAttribute('href'); // The only valid content that could double as a selector are IDs or classes, + if (!selector || selector === "#") { + let hrefAttr = element.getAttribute("href"); // The only valid content that could double as a selector are IDs or classes, // so everything starting with `#` or `.`. If a "real" URL is used as the selector, // `document.querySelector` will rightfully complain it is invalid. // See https://github.com/twbs/bootstrap/issues/32273 - if (!hrefAttr || !hrefAttr.includes('#') && !hrefAttr.startsWith('.')) { + if (!hrefAttr || (!hrefAttr.includes("#") && !hrefAttr.startsWith("."))) { return null; } // Just in case some CMS puts out a full URL with the anchor appended - - if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) { - hrefAttr = `#${hrefAttr.split('#')[1]}`; + if (hrefAttr.includes("#") && !hrefAttr.startsWith("#")) { + hrefAttr = `#${hrefAttr.split("#")[1]}`; } - selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null; + selector = hrefAttr && hrefAttr !== "#" ? hrefAttr.trim() : null; } return selector; }; - const getSelectorFromElement = element => { + const getSelectorFromElement = (element) => { const selector = getSelector(element); if (selector) { @@ -75,21 +81,18 @@ return null; }; - const getElementFromSelector = element => { + const getElementFromSelector = (element) => { const selector = getSelector(element); return selector ? document.querySelector(selector) : null; }; - const getTransitionDurationFromElement = element => { + const getTransitionDurationFromElement = (element) => { if (!element) { return 0; } // Get transition-duration of the element - - let { - transitionDuration, - transitionDelay - } = window.getComputedStyle(element); + let { transitionDuration, transitionDelay } = + window.getComputedStyle(element); const floatTransitionDuration = Number.parseFloat(transitionDuration); const floatTransitionDelay = Number.parseFloat(transitionDelay); // Return 0 if element or transition duration is not found @@ -97,35 +100,38 @@ return 0; } // If multiple durations are defined, take the first - - transitionDuration = transitionDuration.split(',')[0]; - transitionDelay = transitionDelay.split(',')[0]; - return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; + transitionDuration = transitionDuration.split(",")[0]; + transitionDelay = transitionDelay.split(",")[0]; + return ( + (Number.parseFloat(transitionDuration) + + Number.parseFloat(transitionDelay)) * + MILLISECONDS_MULTIPLIER + ); }; - const triggerTransitionEnd = element => { + const triggerTransitionEnd = (element) => { element.dispatchEvent(new Event(TRANSITION_END)); }; - const isElement$1 = obj => { - if (!obj || typeof obj !== 'object') { + const isElement$1 = (obj) => { + if (!obj || typeof obj !== "object") { return false; } - if (typeof obj.jquery !== 'undefined') { + if (typeof obj.jquery !== "undefined") { obj = obj[0]; } - return typeof obj.nodeType !== 'undefined'; + return typeof obj.nodeType !== "undefined"; }; - const getElement = obj => { + const getElement = (obj) => { if (isElement$1(obj)) { // it's a jQuery object or a node element return obj.jquery ? obj[0] : obj; } - if (typeof obj === 'string' && obj.length > 0) { + if (typeof obj === "string" && obj.length > 0) { return document.querySelector(obj); } @@ -133,48 +139,54 @@ }; const typeCheckConfig = (componentName, config, configTypes) => { - Object.keys(configTypes).forEach(property => { + Object.keys(configTypes).forEach((property) => { const expectedTypes = configTypes[property]; const value = config[property]; - const valueType = value && isElement$1(value) ? 'element' : toType(value); + const valueType = value && isElement$1(value) ? "element" : toType(value); if (!new RegExp(expectedTypes).test(valueType)) { - throw new TypeError(`${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".`); + throw new TypeError( + `${componentName.toUpperCase()}: Option "${property}" provided type "${valueType}" but expected type "${expectedTypes}".` + ); } }); }; - const isVisible = element => { + const isVisible = (element) => { if (!isElement$1(element) || element.getClientRects().length === 0) { return false; } - return getComputedStyle(element).getPropertyValue('visibility') === 'visible'; + return ( + getComputedStyle(element).getPropertyValue("visibility") === "visible" + ); }; - const isDisabled = element => { + const isDisabled = (element) => { if (!element || element.nodeType !== Node.ELEMENT_NODE) { return true; } - if (element.classList.contains('disabled')) { + if (element.classList.contains("disabled")) { return true; } - if (typeof element.disabled !== 'undefined') { + if (typeof element.disabled !== "undefined") { return element.disabled; } - return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'; + return ( + element.hasAttribute("disabled") && + element.getAttribute("disabled") !== "false" + ); }; - const findShadowRoot = element => { + const findShadowRoot = (element) => { if (!document.documentElement.attachShadow) { return null; } // Can find the shadow root otherwise it'll return the document - - if (typeof element.getRootNode === 'function') { + if (typeof element.getRootNode === "function") { const root = element.getRootNode(); return root instanceof ShadowRoot ? root : null; } @@ -183,7 +195,6 @@ return element; } // when we don't find a shadow root - if (!element.parentNode) { return null; } @@ -201,18 +212,15 @@ * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation */ - - const reflow = element => { + const reflow = (element) => { // eslint-disable-next-line no-unused-expressions element.offsetHeight; }; const getjQuery = () => { - const { - jQuery - } = window; + const { jQuery } = window; - if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { + if (jQuery && !document.body.hasAttribute("data-bs-no-jquery")) { return jQuery; } @@ -221,12 +229,12 @@ const DOMContentLoadedCallbacks = []; - const onDOMContentLoaded = callback => { - if (document.readyState === 'loading') { + const onDOMContentLoaded = (callback) => { + if (document.readyState === "loading") { // add listener on the first call when the document is in loading state if (!DOMContentLoadedCallbacks.length) { - document.addEventListener('DOMContentLoaded', () => { - DOMContentLoadedCallbacks.forEach(callback => callback()); + document.addEventListener("DOMContentLoaded", () => { + DOMContentLoadedCallbacks.forEach((callback) => callback()); }); } @@ -236,9 +244,9 @@ } }; - const isRTL = () => document.documentElement.dir === 'rtl'; + const isRTL = () => document.documentElement.dir === "rtl"; - const defineJQueryPlugin = plugin => { + const defineJQueryPlugin = (plugin) => { onDOMContentLoaded(() => { const $ = getjQuery(); /* istanbul ignore if */ @@ -257,25 +265,28 @@ }); }; - const execute = callback => { - if (typeof callback === 'function') { + const execute = (callback) => { + if (typeof callback === "function") { callback(); } }; - const executeAfterTransition = (callback, transitionElement, waitForTransition = true) => { + const executeAfterTransition = ( + callback, + transitionElement, + waitForTransition = true + ) => { if (!waitForTransition) { execute(callback); return; } const durationPadding = 5; - const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding; + const emulatedDuration = + getTransitionDurationFromElement(transitionElement) + durationPadding; let called = false; - const handler = ({ - target - }) => { + const handler = ({ target }) => { if (target !== transitionElement) { return; } @@ -302,8 +313,12 @@ * @return {Element|elem} The proper element */ - - const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => { + const getNextActiveElement = ( + list, + activeElement, + shouldGetNext, + isCycleAllowed + ) => { let index = list.indexOf(activeElement); // if the element does not exist in the list return an element depending on the direction and if cycle is allowed if (index === -1) { @@ -339,11 +354,58 @@ let uidEvent = 1; const customEvents = { - mouseenter: 'mouseover', - mouseleave: 'mouseout' + mouseenter: "mouseover", + mouseleave: "mouseout", }; const customEventsRegex = /^(mouseenter|mouseleave)/i; - const nativeEvents = new Set(['click', 'dblclick', 'mouseup', 'mousedown', 'contextmenu', 'mousewheel', 'DOMMouseScroll', 'mouseover', 'mouseout', 'mousemove', 'selectstart', 'selectend', 'keydown', 'keypress', 'keyup', 'orientationchange', 'touchstart', 'touchmove', 'touchend', 'touchcancel', 'pointerdown', 'pointermove', 'pointerup', 'pointerleave', 'pointercancel', 'gesturestart', 'gesturechange', 'gestureend', 'focus', 'blur', 'change', 'reset', 'select', 'submit', 'focusin', 'focusout', 'load', 'unload', 'beforeunload', 'resize', 'move', 'DOMContentLoaded', 'readystatechange', 'error', 'abort', 'scroll']); + const nativeEvents = new Set([ + "click", + "dblclick", + "mouseup", + "mousedown", + "contextmenu", + "mousewheel", + "DOMMouseScroll", + "mouseover", + "mouseout", + "mousemove", + "selectstart", + "selectend", + "keydown", + "keypress", + "keyup", + "orientationchange", + "touchstart", + "touchmove", + "touchend", + "touchcancel", + "pointerdown", + "pointermove", + "pointerup", + "pointerleave", + "pointercancel", + "gesturestart", + "gesturechange", + "gestureend", + "focus", + "blur", + "change", + "reset", + "select", + "submit", + "focusin", + "focusout", + "load", + "unload", + "beforeunload", + "resize", + "move", + "DOMContentLoaded", + "readystatechange", + "error", + "abort", + "scroll", + ]); /** * ------------------------------------------------------------------------ * Private methods @@ -351,7 +413,7 @@ */ function getUidEvent(element, uid) { - return uid && `${uid}::${uidEvent++}` || element.uidEvent || uidEvent++; + return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++; } function getEvent(element) { @@ -377,10 +439,12 @@ return function handler(event) { const domElements = element.querySelectorAll(selector); - for (let { - target - } = event; target && target !== this; target = target.parentNode) { - for (let i = domElements.length; i--;) { + for ( + let { target } = event; + target && target !== this; + target = target.parentNode + ) { + for (let i = domElements.length; i--; ) { if (domElements[i] === target) { event.delegateTarget = target; @@ -393,7 +457,6 @@ } } // To please ESLint - return null; }; } @@ -404,7 +467,10 @@ for (let i = 0, len = uidEventList.length; i < len; i++) { const event = events[uidEventList[i]]; - if (event.originalHandler === handler && event.delegationSelector === delegationSelector) { + if ( + event.originalHandler === handler && + event.delegationSelector === delegationSelector + ) { return event; } } @@ -413,7 +479,7 @@ } function normalizeParams(originalTypeEvent, handler, delegationFn) { - const delegation = typeof handler === 'string'; + const delegation = typeof handler === "string"; const originalHandler = delegation ? delegationFn : handler; let typeEvent = getTypeEvent(originalTypeEvent); const isNative = nativeEvents.has(typeEvent); @@ -425,8 +491,14 @@ return [delegation, originalHandler, typeEvent]; } - function addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) { - if (typeof originalTypeEvent !== 'string' || !element) { + function addHandler( + element, + originalTypeEvent, + handler, + delegationFn, + oneOff + ) { + if (typeof originalTypeEvent !== "string" || !element) { return; } @@ -436,11 +508,14 @@ } // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position // this prevents the handler from being dispatched the same way as mouseover or mouseout does - if (customEventsRegex.test(originalTypeEvent)) { - const wrapFn = fn => { + const wrapFn = (fn) => { return function (event) { - if (!event.relatedTarget || event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget)) { + if ( + !event.relatedTarget || + (event.relatedTarget !== event.delegateTarget && + !event.delegateTarget.contains(event.relatedTarget)) + ) { return fn.call(this, event); } }; @@ -453,18 +528,31 @@ } } - const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn); + const [delegation, originalHandler, typeEvent] = normalizeParams( + originalTypeEvent, + handler, + delegationFn + ); const events = getEvent(element); const handlers = events[typeEvent] || (events[typeEvent] = {}); - const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null); + const previousFn = findHandler( + handlers, + originalHandler, + delegation ? handler : null + ); if (previousFn) { previousFn.oneOff = previousFn.oneOff && oneOff; return; } - const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, '')); - const fn = delegation ? bootstrapDelegationHandler(element, handler, delegationFn) : bootstrapHandler(element, handler); + const uid = getUidEvent( + originalHandler, + originalTypeEvent.replace(namespaceRegex, "") + ); + const fn = delegation + ? bootstrapDelegationHandler(element, handler, delegationFn) + : bootstrapHandler(element, handler); fn.delegationSelector = delegation ? handler : null; fn.originalHandler = originalHandler; fn.oneOff = oneOff; @@ -473,7 +561,13 @@ element.addEventListener(typeEvent, fn, delegation); } - function removeHandler(element, events, typeEvent, handler, delegationSelector) { + function removeHandler( + element, + events, + typeEvent, + handler, + delegationSelector + ) { const fn = findHandler(events[typeEvent], handler, delegationSelector); if (!fn) { @@ -486,17 +580,23 @@ function removeNamespacedHandlers(element, events, typeEvent, namespace) { const storeElementEvent = events[typeEvent] || {}; - Object.keys(storeElementEvent).forEach(handlerKey => { + Object.keys(storeElementEvent).forEach((handlerKey) => { if (handlerKey.includes(namespace)) { const event = storeElementEvent[handlerKey]; - removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); + removeHandler( + element, + events, + typeEvent, + event.originalHandler, + event.delegationSelector + ); } }); } function getTypeEvent(event) { // allow to get the native events from namespaced events ('click.bs.button' --> 'click') - event = event.replace(stripNameRegex, ''); + event = event.replace(stripNameRegex, ""); return customEvents[event] || event; } @@ -510,44 +610,65 @@ }, off(element, originalTypeEvent, handler, delegationFn) { - if (typeof originalTypeEvent !== 'string' || !element) { + if (typeof originalTypeEvent !== "string" || !element) { return; } - const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn); + const [delegation, originalHandler, typeEvent] = normalizeParams( + originalTypeEvent, + handler, + delegationFn + ); const inNamespace = typeEvent !== originalTypeEvent; const events = getEvent(element); - const isNamespace = originalTypeEvent.startsWith('.'); + const isNamespace = originalTypeEvent.startsWith("."); - if (typeof originalHandler !== 'undefined') { + if (typeof originalHandler !== "undefined") { // Simplest case: handler is passed, remove that listener ONLY. if (!events || !events[typeEvent]) { return; } - removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null); + removeHandler( + element, + events, + typeEvent, + originalHandler, + delegation ? handler : null + ); return; } if (isNamespace) { - Object.keys(events).forEach(elementEvent => { - removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1)); + Object.keys(events).forEach((elementEvent) => { + removeNamespacedHandlers( + element, + events, + elementEvent, + originalTypeEvent.slice(1) + ); }); } const storeElementEvent = events[typeEvent] || {}; - Object.keys(storeElementEvent).forEach(keyHandlers => { - const handlerKey = keyHandlers.replace(stripUidRegex, ''); + Object.keys(storeElementEvent).forEach((keyHandlers) => { + const handlerKey = keyHandlers.replace(stripUidRegex, ""); if (!inNamespace || originalTypeEvent.includes(handlerKey)) { const event = storeElementEvent[keyHandlers]; - removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector); + removeHandler( + element, + events, + typeEvent, + event.originalHandler, + event.delegationSelector + ); } }); }, trigger(element, event, args) { - if (typeof event !== 'string' || !element) { + if (typeof event !== "string" || !element) { return null; } @@ -570,23 +691,21 @@ } if (isNative) { - evt = document.createEvent('HTMLEvents'); + evt = document.createEvent("HTMLEvents"); evt.initEvent(typeEvent, bubbles, true); } else { evt = new CustomEvent(event, { bubbles, - cancelable: true + cancelable: true, }); } // merge custom information in our event - - if (typeof args !== 'undefined') { - Object.keys(args).forEach(key => { + if (typeof args !== "undefined") { + Object.keys(args).forEach((key) => { Object.defineProperty(evt, key, { get() { return args[key]; - } - + }, }); }); } @@ -599,13 +718,12 @@ element.dispatchEvent(evt); } - if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') { + if (evt.defaultPrevented && typeof jQueryEvent !== "undefined") { jQueryEvent.preventDefault(); } return evt; - } - + }, }; /** @@ -632,7 +750,11 @@ if (!instanceMap.has(key) && instanceMap.size !== 0) { // eslint-disable-next-line no-console - console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`); + console.error( + `Bootstrap doesn't allow more than one instance per element. Bound instance: ${ + Array.from(instanceMap.keys())[0] + }.` + ); return; } @@ -658,8 +780,7 @@ if (instanceMap.size === 0) { elementMap.delete(element); } - } - + }, }; /** @@ -674,7 +795,7 @@ * ------------------------------------------------------------------------ */ - const VERSION = '5.1.3'; + const VERSION = "5.1.3"; class BaseComponent { constructor(element) { @@ -691,7 +812,7 @@ dispose() { Data.remove(this._element, this.constructor.DATA_KEY); EventHandler.off(this._element, this.constructor.EVENT_KEY); - Object.getOwnPropertyNames(this).forEach(propertyName => { + Object.getOwnPropertyNames(this).forEach((propertyName) => { this[propertyName] = null; }); } @@ -701,13 +822,15 @@ } /** Static */ - static getInstance(element) { return Data.get(getElement(element), this.DATA_KEY); } static getOrCreateInstance(element, config = {}) { - return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null); + return ( + this.getInstance(element) || + new this(element, typeof config === "object" ? config : null) + ); } static get VERSION() { @@ -715,7 +838,9 @@ } static get NAME() { - throw new Error('You have to implement the static method "NAME", for each component!'); + throw new Error( + 'You have to implement the static method "NAME", for each component!' + ); } static get DATA_KEY() { @@ -725,7 +850,6 @@ static get EVENT_KEY() { return `.${this.DATA_KEY}`; } - } /** @@ -735,23 +859,28 @@ * -------------------------------------------------------------------------- */ - const enableDismissTrigger = (component, method = 'hide') => { + const enableDismissTrigger = (component, method = "hide") => { const clickEvent = `click.dismiss${component.EVENT_KEY}`; const name = component.NAME; - EventHandler.on(document, clickEvent, `[data-bs-dismiss="${name}"]`, function (event) { - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } + EventHandler.on( + document, + clickEvent, + `[data-bs-dismiss="${name}"]`, + function (event) { + if (["A", "AREA"].includes(this.tagName)) { + event.preventDefault(); + } - if (isDisabled(this)) { - return; - } + if (isDisabled(this)) { + return; + } - const target = getElementFromSelector(this) || this.closest(`.${name}`); - const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method + const target = getElementFromSelector(this) || this.closest(`.${name}`); + const instance = component.getOrCreateInstance(target); // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method - instance[method](); - }); + instance[method](); + } + ); }; /** @@ -766,13 +895,13 @@ * ------------------------------------------------------------------------ */ - const NAME$d = 'alert'; - const DATA_KEY$c = 'bs.alert'; + const NAME$d = "alert"; + const DATA_KEY$c = "bs.alert"; const EVENT_KEY$c = `.${DATA_KEY$c}`; const EVENT_CLOSE = `close${EVENT_KEY$c}`; const EVENT_CLOSED = `closed${EVENT_KEY$c}`; - const CLASS_NAME_FADE$5 = 'fade'; - const CLASS_NAME_SHOW$8 = 'show'; + const CLASS_NAME_FADE$5 = "fade"; + const CLASS_NAME_SHOW$8 = "show"; /** * ------------------------------------------------------------------------ * Class Definition @@ -785,7 +914,6 @@ return NAME$d; } // Public - close() { const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE); @@ -797,10 +925,13 @@ const isAnimated = this._element.classList.contains(CLASS_NAME_FADE$5); - this._queueCallback(() => this._destroyElement(), this._element, isAnimated); + this._queueCallback( + () => this._destroyElement(), + this._element, + isAnimated + ); } // Private - _destroyElement() { this._element.remove(); @@ -808,23 +939,25 @@ this.dispose(); } // Static - static jQueryInterface(config) { return this.each(function () { const data = Alert.getOrCreateInstance(this); - if (typeof config !== 'string') { + if (typeof config !== "string") { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + if ( + data[config] === undefined || + config.startsWith("_") || + config === "constructor" + ) { throw new TypeError(`No method named "${config}"`); } data[config](this); }); } - } /** * ------------------------------------------------------------------------ @@ -832,8 +965,7 @@ * ------------------------------------------------------------------------ */ - - enableDismissTrigger(Alert, 'close'); + enableDismissTrigger(Alert, "close"); /** * ------------------------------------------------------------------------ * jQuery @@ -855,11 +987,11 @@ * ------------------------------------------------------------------------ */ - const NAME$c = 'button'; - const DATA_KEY$b = 'bs.button'; + const NAME$c = "button"; + const DATA_KEY$b = "bs.button"; const EVENT_KEY$b = `.${DATA_KEY$b}`; - const DATA_API_KEY$7 = '.data-api'; - const CLASS_NAME_ACTIVE$3 = 'active'; + const DATA_API_KEY$7 = ".data-api"; + const CLASS_NAME_ACTIVE$3 = "active"; const SELECTOR_DATA_TOGGLE$5 = '[data-bs-toggle="button"]'; const EVENT_CLICK_DATA_API$6 = `click${EVENT_KEY$b}${DATA_API_KEY$7}`; /** @@ -874,23 +1006,23 @@ return NAME$c; } // Public - toggle() { // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method - this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE$3)); + this._element.setAttribute( + "aria-pressed", + this._element.classList.toggle(CLASS_NAME_ACTIVE$3) + ); } // Static - static jQueryInterface(config) { return this.each(function () { const data = Button.getOrCreateInstance(this); - if (config === 'toggle') { + if (config === "toggle") { data[config](); } }); } - } /** * ------------------------------------------------------------------------ @@ -898,13 +1030,17 @@ * ------------------------------------------------------------------------ */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$6, SELECTOR_DATA_TOGGLE$5, event => { - event.preventDefault(); - const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); - const data = Button.getOrCreateInstance(button); - data.toggle(); - }); + EventHandler.on( + document, + EVENT_CLICK_DATA_API$6, + SELECTOR_DATA_TOGGLE$5, + (event) => { + event.preventDefault(); + const button = event.target.closest(SELECTOR_DATA_TOGGLE$5); + const data = Button.getOrCreateInstance(button); + data.toggle(); + } + ); /** * ------------------------------------------------------------------------ * jQuery @@ -921,11 +1057,11 @@ * -------------------------------------------------------------------------- */ function normalizeData(val) { - if (val === 'true') { + if (val === "true") { return true; } - if (val === 'false') { + if (val === "false") { return false; } @@ -933,7 +1069,7 @@ return Number(val); } - if (val === '' || val === 'null') { + if (val === "" || val === "null") { return null; } @@ -941,7 +1077,7 @@ } function normalizeDataKey(key) { - return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`); + return key.replace(/[A-Z]/g, (chr) => `-${chr.toLowerCase()}`); } const Manipulator = { @@ -959,33 +1095,37 @@ } const attributes = {}; - Object.keys(element.dataset).filter(key => key.startsWith('bs')).forEach(key => { - let pureKey = key.replace(/^bs/, ''); - pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); - attributes[pureKey] = normalizeData(element.dataset[key]); - }); + Object.keys(element.dataset) + .filter((key) => key.startsWith("bs")) + .forEach((key) => { + let pureKey = key.replace(/^bs/, ""); + pureKey = + pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length); + attributes[pureKey] = normalizeData(element.dataset[key]); + }); return attributes; }, getDataAttribute(element, key) { - return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`)); + return normalizeData( + element.getAttribute(`data-bs-${normalizeDataKey(key)}`) + ); }, offset(element) { const rect = element.getBoundingClientRect(); return { top: rect.top + window.pageYOffset, - left: rect.left + window.pageXOffset + left: rect.left + window.pageXOffset, }; }, position(element) { return { top: element.offsetTop, - left: element.offsetLeft + left: element.offsetLeft, }; - } - + }, }; /** @@ -997,7 +1137,9 @@ const NODE_TEXT = 3; const SelectorEngine = { find(selector, element = document.documentElement) { - return [].concat(...Element.prototype.querySelectorAll.call(element, selector)); + return [].concat( + ...Element.prototype.querySelectorAll.call(element, selector) + ); }, findOne(selector, element = document.documentElement) { @@ -1005,14 +1147,20 @@ }, children(element, selector) { - return [].concat(...element.children).filter(child => child.matches(selector)); + return [] + .concat(...element.children) + .filter((child) => child.matches(selector)); }, parents(element, selector) { const parents = []; let ancestor = element.parentNode; - while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) { + while ( + ancestor && + ancestor.nodeType === Node.ELEMENT_NODE && + ancestor.nodeType !== NODE_TEXT + ) { if (ancestor.matches(selector)) { parents.push(ancestor); } @@ -1052,10 +1200,22 @@ }, focusableChildren(element) { - const focusables = ['a', 'button', 'input', 'textarea', 'select', 'details', '[tabindex]', '[contenteditable="true"]'].map(selector => `${selector}:not([tabindex^="-"])`).join(', '); - return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el)); - } - + const focusables = [ + "a", + "button", + "input", + "textarea", + "select", + "details", + "[tabindex]", + '[contenteditable="true"]', + ] + .map((selector) => `${selector}:not([tabindex^="-"])`) + .join(", "); + return this.find(focusables, element).filter( + (el) => !isDisabled(el) && isVisible(el) + ); + }, }; /** @@ -1070,12 +1230,12 @@ * ------------------------------------------------------------------------ */ - const NAME$b = 'carousel'; - const DATA_KEY$a = 'bs.carousel'; + const NAME$b = "carousel"; + const DATA_KEY$a = "bs.carousel"; const EVENT_KEY$a = `.${DATA_KEY$a}`; - const DATA_API_KEY$6 = '.data-api'; - const ARROW_LEFT_KEY = 'ArrowLeft'; - const ARROW_RIGHT_KEY = 'ArrowRight'; + const DATA_API_KEY$6 = ".data-api"; + const ARROW_LEFT_KEY = "ArrowLeft"; + const ARROW_RIGHT_KEY = "ArrowRight"; const TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch const SWIPE_THRESHOLD = 40; @@ -1083,25 +1243,25 @@ interval: 5000, keyboard: true, slide: false, - pause: 'hover', + pause: "hover", wrap: true, - touch: true + touch: true, }; const DefaultType$a = { - interval: '(number|boolean)', - keyboard: 'boolean', - slide: '(boolean|string)', - pause: '(string|boolean)', - wrap: 'boolean', - touch: 'boolean' + interval: "(number|boolean)", + keyboard: "boolean", + slide: "(boolean|string)", + pause: "(string|boolean)", + wrap: "boolean", + touch: "boolean", }; - const ORDER_NEXT = 'next'; - const ORDER_PREV = 'prev'; - const DIRECTION_LEFT = 'left'; - const DIRECTION_RIGHT = 'right'; + const ORDER_NEXT = "next"; + const ORDER_PREV = "prev"; + const DIRECTION_LEFT = "left"; + const DIRECTION_RIGHT = "right"; const KEY_TO_DIRECTION = { [ARROW_LEFT_KEY]: DIRECTION_RIGHT, - [ARROW_RIGHT_KEY]: DIRECTION_LEFT + [ARROW_RIGHT_KEY]: DIRECTION_LEFT, }; const EVENT_SLIDE = `slide${EVENT_KEY$a}`; const EVENT_SLID = `slid${EVENT_KEY$a}`; @@ -1116,25 +1276,25 @@ const EVENT_DRAG_START = `dragstart${EVENT_KEY$a}`; const EVENT_LOAD_DATA_API$2 = `load${EVENT_KEY$a}${DATA_API_KEY$6}`; const EVENT_CLICK_DATA_API$5 = `click${EVENT_KEY$a}${DATA_API_KEY$6}`; - const CLASS_NAME_CAROUSEL = 'carousel'; - const CLASS_NAME_ACTIVE$2 = 'active'; - const CLASS_NAME_SLIDE = 'slide'; - const CLASS_NAME_END = 'carousel-item-end'; - const CLASS_NAME_START = 'carousel-item-start'; - const CLASS_NAME_NEXT = 'carousel-item-next'; - const CLASS_NAME_PREV = 'carousel-item-prev'; - const CLASS_NAME_POINTER_EVENT = 'pointer-event'; - const SELECTOR_ACTIVE$1 = '.active'; - const SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; - const SELECTOR_ITEM = '.carousel-item'; - const SELECTOR_ITEM_IMG = '.carousel-item img'; - const SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; - const SELECTOR_INDICATORS = '.carousel-indicators'; - const SELECTOR_INDICATOR = '[data-bs-target]'; - const SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; + const CLASS_NAME_CAROUSEL = "carousel"; + const CLASS_NAME_ACTIVE$2 = "active"; + const CLASS_NAME_SLIDE = "slide"; + const CLASS_NAME_END = "carousel-item-end"; + const CLASS_NAME_START = "carousel-item-start"; + const CLASS_NAME_NEXT = "carousel-item-next"; + const CLASS_NAME_PREV = "carousel-item-prev"; + const CLASS_NAME_POINTER_EVENT = "pointer-event"; + const SELECTOR_ACTIVE$1 = ".active"; + const SELECTOR_ACTIVE_ITEM = ".active.carousel-item"; + const SELECTOR_ITEM = ".carousel-item"; + const SELECTOR_ITEM_IMG = ".carousel-item img"; + const SELECTOR_NEXT_PREV = ".carousel-item-next, .carousel-item-prev"; + const SELECTOR_INDICATORS = ".carousel-indicators"; + const SELECTOR_INDICATOR = "[data-bs-target]"; + const SELECTOR_DATA_SLIDE = "[data-bs-slide], [data-bs-slide-to]"; const SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - const POINTER_TYPE_TOUCH = 'touch'; - const POINTER_TYPE_PEN = 'pen'; + const POINTER_TYPE_TOUCH = "touch"; + const POINTER_TYPE_PEN = "pen"; /** * ------------------------------------------------------------------------ * Class Definition @@ -1153,14 +1313,18 @@ this.touchStartX = 0; this.touchDeltaX = 0; this._config = this._getConfig(config); - this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element); - this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; + this._indicatorsElement = SelectorEngine.findOne( + SELECTOR_INDICATORS, + this._element + ); + this._touchSupported = + "ontouchstart" in document.documentElement || + navigator.maxTouchPoints > 0; this._pointerEvent = Boolean(window.PointerEvent); this._addEventListeners(); } // Getters - static get Default() { return Default$a; } @@ -1169,7 +1333,6 @@ return NAME$b; } // Public - next() { this._slide(ORDER_NEXT); } @@ -1213,12 +1376,20 @@ if (this._config && this._config.interval && !this._isPaused) { this._updateInterval(); - this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); + this._interval = setInterval( + (document.visibilityState ? this.nextWhenVisible : this.next).bind( + this + ), + this._config.interval + ); } } to(index) { - this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + this._activeElement = SelectorEngine.findOne( + SELECTOR_ACTIVE_ITEM, + this._element + ); const activeIndex = this._getItemIndex(this._activeElement); @@ -1242,11 +1413,11 @@ this._slide(order, this._items[index]); } // Private - _getConfig(config) { - config = { ...Default$a, + config = { + ...Default$a, ...Manipulator.getDataAttributes(this._element), - ...(typeof config === 'object' ? config : {}) + ...(typeof config === "object" ? config : {}), }; typeCheckConfig(NAME$b, config, DefaultType$a); return config; @@ -1271,12 +1442,18 @@ _addEventListeners() { if (this._config.keyboard) { - EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event)); + EventHandler.on(this._element, EVENT_KEYDOWN, (event) => + this._keydown(event) + ); } - if (this._config.pause === 'hover') { - EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event)); - EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event)); + if (this._config.pause === "hover") { + EventHandler.on(this._element, EVENT_MOUSEENTER, (event) => + this.pause(event) + ); + EventHandler.on(this._element, EVENT_MOUSELEAVE, (event) => + this.cycle(event) + ); } if (this._config.touch && this._touchSupported) { @@ -1285,11 +1462,15 @@ } _addTouchEventListeners() { - const hasPointerPenTouch = event => { - return this._pointerEvent && (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH); + const hasPointerPenTouch = (event) => { + return ( + this._pointerEvent && + (event.pointerType === POINTER_TYPE_PEN || + event.pointerType === POINTER_TYPE_TOUCH) + ); }; - const start = event => { + const start = (event) => { if (hasPointerPenTouch(event)) { this.touchStartX = event.clientX; } else if (!this._pointerEvent) { @@ -1297,19 +1478,22 @@ } }; - const move = event => { + const move = (event) => { // ensure swiping with one touch and not pinching - this.touchDeltaX = event.touches && event.touches.length > 1 ? 0 : event.touches[0].clientX - this.touchStartX; + this.touchDeltaX = + event.touches && event.touches.length > 1 + ? 0 + : event.touches[0].clientX - this.touchStartX; }; - const end = event => { + const end = (event) => { if (hasPointerPenTouch(event)) { this.touchDeltaX = event.clientX - this.touchStartX; } this._handleSwipe(); - if (this._config.pause === 'hover') { + if (this._config.pause === "hover") { // If it's a touch-enabled device, mouseenter/leave are fired as // part of the mouse compatibility events on first tap - the carousel // would stop cycling until user tapped out of it; @@ -1323,23 +1507,34 @@ clearTimeout(this.touchTimeout); } - this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval); + this.touchTimeout = setTimeout( + (event) => this.cycle(event), + TOUCHEVENT_COMPAT_WAIT + this._config.interval + ); } }; - SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => { - EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault()); - }); + SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach( + (itemImg) => { + EventHandler.on(itemImg, EVENT_DRAG_START, (event) => + event.preventDefault() + ); + } + ); if (this._pointerEvent) { - EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event)); - EventHandler.on(this._element, EVENT_POINTERUP, event => end(event)); + EventHandler.on(this._element, EVENT_POINTERDOWN, (event) => + start(event) + ); + EventHandler.on(this._element, EVENT_POINTERUP, (event) => end(event)); this._element.classList.add(CLASS_NAME_POINTER_EVENT); } else { - EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event)); - EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event)); - EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event)); + EventHandler.on(this._element, EVENT_TOUCHSTART, (event) => + start(event) + ); + EventHandler.on(this._element, EVENT_TOUCHMOVE, (event) => move(event)); + EventHandler.on(this._element, EVENT_TOUCHEND, (event) => end(event)); } } @@ -1358,39 +1553,60 @@ } _getItemIndex(element) { - this._items = element && element.parentNode ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) : []; + this._items = + element && element.parentNode + ? SelectorEngine.find(SELECTOR_ITEM, element.parentNode) + : []; return this._items.indexOf(element); } _getItemByOrder(order, activeElement) { const isNext = order === ORDER_NEXT; - return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap); + return getNextActiveElement( + this._items, + activeElement, + isNext, + this._config.wrap + ); } _triggerSlideEvent(relatedTarget, eventDirectionName) { const targetIndex = this._getItemIndex(relatedTarget); - const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)); + const fromIndex = this._getItemIndex( + SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element) + ); return EventHandler.trigger(this._element, EVENT_SLIDE, { relatedTarget, direction: eventDirectionName, from: fromIndex, - to: targetIndex + to: targetIndex, }); } _setActiveIndicatorElement(element) { if (this._indicatorsElement) { - const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE$1, this._indicatorsElement); + const activeIndicator = SelectorEngine.findOne( + SELECTOR_ACTIVE$1, + this._indicatorsElement + ); activeIndicator.classList.remove(CLASS_NAME_ACTIVE$2); - activeIndicator.removeAttribute('aria-current'); - const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement); + activeIndicator.removeAttribute("aria-current"); + const indicators = SelectorEngine.find( + SELECTOR_INDICATOR, + this._indicatorsElement + ); for (let i = 0; i < indicators.length; i++) { - if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) { + if ( + Number.parseInt( + indicators[i].getAttribute("data-bs-slide-to"), + 10 + ) === this._getItemIndex(element) + ) { indicators[i].classList.add(CLASS_NAME_ACTIVE$2); - indicators[i].setAttribute('aria-current', 'true'); + indicators[i].setAttribute("aria-current", "true"); break; } } @@ -1398,26 +1614,36 @@ } _updateInterval() { - const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + const element = + this._activeElement || + SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); if (!element) { return; } - const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10); + const elementInterval = Number.parseInt( + element.getAttribute("data-bs-interval"), + 10 + ); if (elementInterval) { - this._config.defaultInterval = this._config.defaultInterval || this._config.interval; + this._config.defaultInterval = + this._config.defaultInterval || this._config.interval; this._config.interval = elementInterval; } else { - this._config.interval = this._config.defaultInterval || this._config.interval; + this._config.interval = + this._config.defaultInterval || this._config.interval; } } _slide(directionOrOrder, element) { const order = this._directionToOrder(directionOrOrder); - const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element); + const activeElement = SelectorEngine.findOne( + SELECTOR_ACTIVE_ITEM, + this._element + ); const activeElementIndex = this._getItemIndex(activeElement); @@ -1441,7 +1667,10 @@ return; } - const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); + const slideEvent = this._triggerSlideEvent( + nextElement, + eventDirectionName + ); if (slideEvent.defaultPrevented) { return; @@ -1467,7 +1696,7 @@ relatedTarget: nextElement, direction: eventDirectionName, from: activeElementIndex, - to: nextElementIndex + to: nextElementIndex, }); }; @@ -1480,7 +1709,11 @@ const completeCallBack = () => { nextElement.classList.remove(directionalClassName, orderClassName); nextElement.classList.add(CLASS_NAME_ACTIVE$2); - activeElement.classList.remove(CLASS_NAME_ACTIVE$2, orderClassName, directionalClassName); + activeElement.classList.remove( + CLASS_NAME_ACTIVE$2, + orderClassName, + directionalClassName + ); this._isSliding = false; setTimeout(triggerSlidEvent, 0); }; @@ -1522,25 +1755,20 @@ return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT; } // Static - static carouselInterface(element, config) { const data = Carousel.getOrCreateInstance(element, config); - let { - _config - } = data; + let { _config } = data; - if (typeof config === 'object') { - _config = { ..._config, - ...config - }; + if (typeof config === "object") { + _config = { ..._config, ...config }; } - const action = typeof config === 'string' ? config : _config.slide; + const action = typeof config === "string" ? config : _config.slide; - if (typeof config === 'number') { + if (typeof config === "number") { data.to(config); - } else if (typeof action === 'string') { - if (typeof data[action] === 'undefined') { + } else if (typeof action === "string") { + if (typeof data[action] === "undefined") { throw new TypeError(`No method named "${action}"`); } @@ -1564,10 +1792,11 @@ return; } - const config = { ...Manipulator.getDataAttributes(target), - ...Manipulator.getDataAttributes(this) + const config = { + ...Manipulator.getDataAttributes(target), + ...Manipulator.getDataAttributes(this), }; - const slideIndex = this.getAttribute('data-bs-slide-to'); + const slideIndex = this.getAttribute("data-bs-slide-to"); if (slideIndex) { config.interval = false; @@ -1581,7 +1810,6 @@ event.preventDefault(); } - } /** * ------------------------------------------------------------------------ @@ -1589,13 +1817,20 @@ * ------------------------------------------------------------------------ */ - - EventHandler.on(document, EVENT_CLICK_DATA_API$5, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler); + EventHandler.on( + document, + EVENT_CLICK_DATA_API$5, + SELECTOR_DATA_SLIDE, + Carousel.dataApiClickHandler + ); EventHandler.on(window, EVENT_LOAD_DATA_API$2, () => { const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE); for (let i = 0, len = carousels.length; i < len; i++) { - Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i])); + Carousel.carouselInterface( + carousels[i], + Carousel.getInstance(carousels[i]) + ); } }); /** @@ -1619,32 +1854,32 @@ * ------------------------------------------------------------------------ */ - const NAME$a = 'collapse'; - const DATA_KEY$9 = 'bs.collapse'; + const NAME$a = "collapse"; + const DATA_KEY$9 = "bs.collapse"; const EVENT_KEY$9 = `.${DATA_KEY$9}`; - const DATA_API_KEY$5 = '.data-api'; + const DATA_API_KEY$5 = ".data-api"; const Default$9 = { toggle: true, - parent: null + parent: null, }; const DefaultType$9 = { - toggle: 'boolean', - parent: '(null|element)' + toggle: "boolean", + parent: "(null|element)", }; const EVENT_SHOW$5 = `show${EVENT_KEY$9}`; const EVENT_SHOWN$5 = `shown${EVENT_KEY$9}`; const EVENT_HIDE$5 = `hide${EVENT_KEY$9}`; const EVENT_HIDDEN$5 = `hidden${EVENT_KEY$9}`; const EVENT_CLICK_DATA_API$4 = `click${EVENT_KEY$9}${DATA_API_KEY$5}`; - const CLASS_NAME_SHOW$7 = 'show'; - const CLASS_NAME_COLLAPSE = 'collapse'; - const CLASS_NAME_COLLAPSING = 'collapsing'; - const CLASS_NAME_COLLAPSED = 'collapsed'; + const CLASS_NAME_SHOW$7 = "show"; + const CLASS_NAME_COLLAPSE = "collapse"; + const CLASS_NAME_COLLAPSING = "collapsing"; + const CLASS_NAME_COLLAPSED = "collapsed"; const CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`; - const CLASS_NAME_HORIZONTAL = 'collapse-horizontal'; - const WIDTH = 'width'; - const HEIGHT = 'height'; - const SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'; + const CLASS_NAME_HORIZONTAL = "collapse-horizontal"; + const WIDTH = "width"; + const HEIGHT = "height"; + const SELECTOR_ACTIVES = ".collapse.show, .collapse.collapsing"; const SELECTOR_DATA_TOGGLE$4 = '[data-bs-toggle="collapse"]'; /** * ------------------------------------------------------------------------ @@ -1663,7 +1898,9 @@ for (let i = 0, len = toggleList.length; i < len; i++) { const elem = toggleList[i]; const selector = getSelectorFromElement(elem); - const filterElement = SelectorEngine.find(selector).filter(foundElem => foundElem === this._element); + const filterElement = SelectorEngine.find(selector).filter( + (foundElem) => foundElem === this._element + ); if (selector !== null && filterElement.length) { this._selector = selector; @@ -1683,7 +1920,6 @@ } } // Getters - static get Default() { return Default$9; } @@ -1692,7 +1928,6 @@ return NAME$a; } // Public - toggle() { if (this._isShown()) { this.hide(); @@ -1710,15 +1945,23 @@ let activesData; if (this._config.parent) { - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)); // remove children if greater depth + const children = SelectorEngine.find( + CLASS_NAME_DEEPER_CHILDREN, + this._config.parent + ); + actives = SelectorEngine.find( + SELECTOR_ACTIVES, + this._config.parent + ).filter((elem) => !children.includes(elem)); // remove children if greater depth } const container = SelectorEngine.findOne(this._selector); if (actives.length) { - const tempActiveData = actives.find(elem => container !== elem); - activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null; + const tempActiveData = actives.find((elem) => container !== elem); + activesData = tempActiveData + ? Collapse.getInstance(tempActiveData) + : null; if (activesData && activesData._isTransitioning) { return; @@ -1731,10 +1974,10 @@ return; } - actives.forEach(elemActive => { + actives.forEach((elemActive) => { if (container !== elemActive) { Collapse.getOrCreateInstance(elemActive, { - toggle: false + toggle: false, }).hide(); } @@ -1762,11 +2005,12 @@ this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW$7); - this._element.style[dimension] = ''; + this._element.style[dimension] = ""; EventHandler.trigger(this._element, EVENT_SHOWN$5); }; - const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); + const capitalizedDimension = + dimension[0].toUpperCase() + dimension.slice(1); const scrollSize = `scroll${capitalizedDimension}`; this._queueCallback(complete, this._element, true); @@ -1787,7 +2031,9 @@ const dimension = this._getDimension(); - this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`; + this._element.style[dimension] = `${ + this._element.getBoundingClientRect()[dimension] + }px`; reflow(this._element); this._element.classList.add(CLASS_NAME_COLLAPSING); @@ -1817,7 +2063,7 @@ EventHandler.trigger(this._element, EVENT_HIDDEN$5); }; - this._element.style[dimension] = ''; + this._element.style[dimension] = ""; this._queueCallback(complete, this._element, true); } @@ -1826,11 +2072,11 @@ return element.classList.contains(CLASS_NAME_SHOW$7); } // Private - _getConfig(config) { - config = { ...Default$9, + config = { + ...Default$9, ...Manipulator.getDataAttributes(this._element), - ...config + ...config, }; config.toggle = Boolean(config.toggle); // Coerce string values @@ -1840,7 +2086,9 @@ } _getDimension() { - return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT; + return this._element.classList.contains(CLASS_NAME_HORIZONTAL) + ? WIDTH + : HEIGHT; } _initializeChildren() { @@ -1848,14 +2096,19 @@ return; } - const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent); - SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent).filter(elem => !children.includes(elem)).forEach(element => { - const selected = getElementFromSelector(element); + const children = SelectorEngine.find( + CLASS_NAME_DEEPER_CHILDREN, + this._config.parent + ); + SelectorEngine.find(SELECTOR_DATA_TOGGLE$4, this._config.parent) + .filter((elem) => !children.includes(elem)) + .forEach((element) => { + const selected = getElementFromSelector(element); - if (selected) { - this._addAriaAndCollapsedClass([element], this._isShown(selected)); - } - }); + if (selected) { + this._addAriaAndCollapsedClass([element], this._isShown(selected)); + } + }); } _addAriaAndCollapsedClass(triggerArray, isOpen) { @@ -1863,30 +2116,29 @@ return; } - triggerArray.forEach(elem => { + triggerArray.forEach((elem) => { if (isOpen) { elem.classList.remove(CLASS_NAME_COLLAPSED); } else { elem.classList.add(CLASS_NAME_COLLAPSED); } - elem.setAttribute('aria-expanded', isOpen); + elem.setAttribute("aria-expanded", isOpen); }); } // Static - static jQueryInterface(config) { return this.each(function () { const _config = {}; - if (typeof config === 'string' && /show|hide/.test(config)) { + if (typeof config === "string" && /show|hide/.test(config)) { _config.toggle = false; } const data = Collapse.getOrCreateInstance(this, _config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { + if (typeof config === "string") { + if (typeof data[config] === "undefined") { throw new TypeError(`No method named "${config}"`); } @@ -1894,7 +2146,6 @@ } }); } - } /** * ------------------------------------------------------------------------ @@ -1902,21 +2153,28 @@ * ------------------------------------------------------------------------ */ + EventHandler.on( + document, + EVENT_CLICK_DATA_API$4, + SELECTOR_DATA_TOGGLE$4, + function (event) { + // preventDefault only for elements (which change the URL) not inside the collapsible element + if ( + event.target.tagName === "A" || + (event.delegateTarget && event.delegateTarget.tagName === "A") + ) { + event.preventDefault(); + } - EventHandler.on(document, EVENT_CLICK_DATA_API$4, SELECTOR_DATA_TOGGLE$4, function (event) { - // preventDefault only for elements (which change the URL) not inside the collapsible element - if (event.target.tagName === 'A' || event.delegateTarget && event.delegateTarget.tagName === 'A') { - event.preventDefault(); + const selector = getSelectorFromElement(this); + const selectorElements = SelectorEngine.find(selector); + selectorElements.forEach((element) => { + Collapse.getOrCreateInstance(element, { + toggle: false, + }).toggle(); + }); } - - const selector = getSelectorFromElement(this); - const selectorElements = SelectorEngine.find(selector); - selectorElements.forEach(element => { - Collapse.getOrCreateInstance(element, { - toggle: false - }).toggle(); - }); - }); + ); /** * ------------------------------------------------------------------------ * jQuery @@ -1926,40 +2184,60 @@ defineJQueryPlugin(Collapse); - var top = 'top'; - var bottom = 'bottom'; - var right = 'right'; - var left = 'left'; - var auto = 'auto'; + var top = "top"; + var bottom = "bottom"; + var right = "right"; + var left = "left"; + var auto = "auto"; var basePlacements = [top, bottom, right, left]; - var start = 'start'; - var end = 'end'; - var clippingParents = 'clippingParents'; - var viewport = 'viewport'; - var popper = 'popper'; - var reference = 'reference'; - var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { + var start = "start"; + var end = "end"; + var clippingParents = "clippingParents"; + var viewport = "viewport"; + var popper = "popper"; + var reference = "reference"; + var variationPlacements = /*#__PURE__*/ basePlacements.reduce(function ( + acc, + placement + ) { return acc.concat([placement + "-" + start, placement + "-" + end]); - }, []); - var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { - return acc.concat([placement, placement + "-" + start, placement + "-" + end]); - }, []); // modifiers that need to read the DOM - - var beforeRead = 'beforeRead'; - var read = 'read'; - var afterRead = 'afterRead'; // pure-logic modifiers - - var beforeMain = 'beforeMain'; - var main = 'main'; - var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) - - var beforeWrite = 'beforeWrite'; - var write = 'write'; - var afterWrite = 'afterWrite'; - var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + }, + []); + var placements = /*#__PURE__*/ [] + .concat(basePlacements, [auto]) + .reduce(function (acc, placement) { + return acc.concat([ + placement, + placement + "-" + start, + placement + "-" + end, + ]); + }, []); // modifiers that need to read the DOM + + var beforeRead = "beforeRead"; + var read = "read"; + var afterRead = "afterRead"; // pure-logic modifiers + + var beforeMain = "beforeMain"; + var main = "main"; + var afterMain = "afterMain"; // modifier with the purpose to write to the DOM (or write into a framework state) + + var beforeWrite = "beforeWrite"; + var write = "write"; + var afterWrite = "afterWrite"; + var modifierPhases = [ + beforeRead, + read, + afterRead, + beforeMain, + main, + afterMain, + beforeWrite, + write, + afterWrite, + ]; function getNodeName(element) { - return element ? (element.nodeName || '').toLowerCase() : null; + return element ? (element.nodeName || "").toLowerCase() : null; } function getWindow(node) { @@ -1967,7 +2245,7 @@ return window; } - if (node.toString() !== '[object Window]') { + if (node.toString() !== "[object Window]") { var ownerDocument = node.ownerDocument; return ownerDocument ? ownerDocument.defaultView || window : window; } @@ -1987,7 +2265,7 @@ function isShadowRoot(node) { // IE 11 has no ShadowRoot - if (typeof ShadowRoot === 'undefined') { + if (typeof ShadowRoot === "undefined") { return false; } @@ -2010,7 +2288,6 @@ // effective way to apply styles to an HTMLElement // $FlowFixMe[cannot-write] - Object.assign(element.style, style); Object.keys(attributes).forEach(function (name) { var value = attributes[name]; @@ -2018,7 +2295,7 @@ if (value === false) { element.removeAttribute(name); } else { - element.setAttribute(name, value === true ? '' : value); + element.setAttribute(name, value === true ? "" : value); } }); }); @@ -2029,14 +2306,14 @@ var initialStyles = { popper: { position: state.options.strategy, - left: '0', - top: '0', - margin: '0' + left: "0", + top: "0", + margin: "0", }, arrow: { - position: 'absolute' + position: "absolute", }, - reference: {} + reference: {}, }; Object.assign(state.elements.popper.style, initialStyles.popper); state.styles = initialStyles; @@ -2049,10 +2326,14 @@ Object.keys(state.elements).forEach(function (name) { var element = state.elements[name]; var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them + var styleProperties = Object.keys( + state.styles.hasOwnProperty(name) + ? state.styles[name] + : initialStyles[name] + ); // Set all values to an empty string to unset them var style = styleProperties.reduce(function (style, property) { - style[property] = ''; + style[property] = ""; return style; }, {}); // arrow is optional + virtual elements @@ -2068,24 +2349,24 @@ }; } // eslint-disable-next-line import/no-unused-modules - const applyStyles$1 = { - name: 'applyStyles', + name: "applyStyles", enabled: true, - phase: 'write', + phase: "write", fn: applyStyles, effect: effect$2, - requires: ['computeStyles'] + requires: ["computeStyles"], }; function getBasePlacement(placement) { - return placement.split('-')[0]; + return placement.split("-")[0]; } // import { isHTMLElement } from './instanceOf'; - function getBoundingClientRect(element, // eslint-disable-next-line unused-imports/no-unused-vars - includeScale) { - + function getBoundingClientRect( + element, // eslint-disable-next-line unused-imports/no-unused-vars + includeScale + ) { var rect = element.getBoundingClientRect(); var scaleX = 1; var scaleY = 1; // FIXME: @@ -2114,7 +2395,7 @@ bottom: rect.bottom / scaleY, left: rect.left / scaleX, x: rect.left / scaleX, - y: rect.top / scaleY + y: rect.top / scaleY, }; } @@ -2139,7 +2420,7 @@ x: element.offsetLeft, y: element.offsetTop, width: width, - height: height + height: height, }; } @@ -2150,18 +2431,16 @@ return true; } // then fallback to custom implementation with Shadow DOM support else if (rootNode && isShadowRoot(rootNode)) { - var next = child; + var next = child; - do { - if (next && parent.isSameNode(next)) { - return true; - } // $FlowFixMe[prop-missing]: need a better way to handle this... - - - next = next.parentNode || next.host; - } while (next); - } // Give up, the result is false + do { + if (next && parent.isSameNode(next)) { + return true; + } // $FlowFixMe[prop-missing]: need a better way to handle this... + next = next.parentNode || next.host; + } while (next); + } // Give up, the result is false return false; } @@ -2171,35 +2450,40 @@ } function isTableElement(element) { - return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; + return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; } function getDocumentElement(element) { // $FlowFixMe[incompatible-return]: assume body is always available - return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] - element.document) || window.document).documentElement; + return ( + (isElement(element) + ? element.ownerDocument // $FlowFixMe[prop-missing] + : element.document) || window.document + ).documentElement; } function getParentNode(element) { - if (getNodeName(element) === 'html') { + if (getNodeName(element) === "html") { return element; } - return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle + return ( + // this is a quicker (but less type safe) way to save quite some bytes from the bundle // $FlowFixMe[incompatible-return] // $FlowFixMe[prop-missing] element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + element.parentNode || // DOM Element detected + (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected // $FlowFixMe[incompatible-call]: HTMLElement is a Node getDocumentElement(element) // fallback - ); } function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 - getComputedStyle$1(element).position === 'fixed') { + if ( + !isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle$1(element).position === "fixed" + ) { return null; } @@ -2207,28 +2491,37 @@ } // `.offsetParent` reports `null` for fixed elements, while absolute elements // return the containing block - function getContainingBlock(element) { - var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; - var isIE = navigator.userAgent.indexOf('Trident') !== -1; + var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1; + var isIE = navigator.userAgent.indexOf("Trident") !== -1; if (isIE && isHTMLElement(element)) { // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport var elementCss = getComputedStyle$1(element); - if (elementCss.position === 'fixed') { + if (elementCss.position === "fixed") { return null; } } var currentNode = getParentNode(element); - while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { + while ( + isHTMLElement(currentNode) && + ["html", "body"].indexOf(getNodeName(currentNode)) < 0 + ) { var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that // create a containing block. // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + if ( + css.transform !== "none" || + css.perspective !== "none" || + css.contain === "paint" || + ["transform", "perspective"].indexOf(css.willChange) !== -1 || + (isFirefox && css.willChange === "filter") || + (isFirefox && css.filter && css.filter !== "none") + ) { return currentNode; } else { currentNode = currentNode.parentNode; @@ -2239,16 +2532,24 @@ } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. - function getOffsetParent(element) { var window = getWindow(element); var offsetParent = getTrueOffsetParent(element); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') { + while ( + offsetParent && + isTableElement(offsetParent) && + getComputedStyle$1(offsetParent).position === "static" + ) { offsetParent = getTrueOffsetParent(offsetParent); } - if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) { + if ( + offsetParent && + (getNodeName(offsetParent) === "html" || + (getNodeName(offsetParent) === "body" && + getComputedStyle$1(offsetParent).position === "static")) + ) { return window; } @@ -2256,7 +2557,7 @@ } function getMainAxisFromPlacement(placement) { - return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; + return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; } var max = Math.max; @@ -2272,7 +2573,7 @@ top: 0, right: 0, bottom: 0, - left: 0 + left: 0, }; } @@ -2288,24 +2589,33 @@ } var toPaddingObject = function toPaddingObject(padding, state) { - padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + padding = + typeof padding === "function" + ? padding( + Object.assign({}, state.rects, { + placement: state.placement, + }) + ) + : padding; + return mergePaddingObject( + typeof padding !== "number" + ? padding + : expandToHashMap(padding, basePlacements) + ); }; function arrow(_ref) { var _state$modifiersData$; var state = _ref.state, - name = _ref.name, - options = _ref.options; + name = _ref.name, + options = _ref.options; var arrowElement = state.elements.arrow; var popperOffsets = state.modifiersData.popperOffsets; var basePlacement = getBasePlacement(state.placement); var axis = getMainAxisFromPlacement(basePlacement); var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? 'height' : 'width'; + var len = isVertical ? "height" : "width"; if (!arrowElement || !popperOffsets) { return; @@ -2313,12 +2623,20 @@ var paddingObject = toPaddingObject(options.padding, state); var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === 'y' ? top : left; - var maxProp = axis === 'y' ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; + var minProp = axis === "y" ? top : left; + var maxProp = axis === "y" ? bottom : right; + var endDiff = + state.rects.reference[len] + + state.rects.reference[axis] - + popperOffsets[axis] - + state.rects.popper[len]; var startDiff = popperOffsets[axis] - state.rects.reference[axis]; var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var clientSize = arrowOffsetParent + ? axis === "y" + ? arrowOffsetParent.clientHeight || 0 + : arrowOffsetParent.clientWidth || 0 + : 0; var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is // outside of the popper bounds @@ -2328,21 +2646,25 @@ var offset = within(min, center, max); // Prevents breaking syntax highlighting... var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); + state.modifiersData[name] = + ((_state$modifiersData$ = {}), + (_state$modifiersData$[axisProp] = offset), + (_state$modifiersData$.centerOffset = offset - center), + _state$modifiersData$); } function effect$1(_ref2) { var state = _ref2.state, - options = _ref2.options; + options = _ref2.options; var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + arrowElement = + _options$element === void 0 ? "[data-popper-arrow]" : _options$element; if (arrowElement == null) { return; } // CSS selector - - if (typeof arrowElement === 'string') { + if (typeof arrowElement === "string") { arrowElement = state.elements.popper.querySelector(arrowElement); if (!arrowElement) { @@ -2351,45 +2673,43 @@ } if (!contains(state.elements.popper, arrowElement)) { - return; } state.elements.arrow = arrowElement; } // eslint-disable-next-line import/no-unused-modules - const arrow$1 = { - name: 'arrow', + name: "arrow", enabled: true, - phase: 'main', + phase: "main", fn: arrow, effect: effect$1, - requires: ['popperOffsets'], - requiresIfExists: ['preventOverflow'] + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"], }; function getVariation(placement) { - return placement.split('-')[1]; + return placement.split("-")[1]; } var unsetSides = { - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto' + top: "auto", + right: "auto", + bottom: "auto", + left: "auto", }; // Round the offsets to the nearest suitable subpixel based on the DPR. // Zooming can change the DPR, but it seems to report a value that will // cleanly divide the values into the appropriate subpixels. function roundOffsetsByDPR(_ref) { var x = _ref.x, - y = _ref.y; + y = _ref.y; var win = window; var dpr = win.devicePixelRatio || 1; return { x: round(round(x * dpr) / dpr) || 0, - y: round(round(y * dpr) / dpr) || 0 + y: round(round(y * dpr) / dpr) || 0, }; } @@ -2397,52 +2717,65 @@ var _Object$assign2; var popper = _ref2.popper, - popperRect = _ref2.popperRect, - placement = _ref2.placement, - variation = _ref2.variation, - offsets = _ref2.offsets, - position = _ref2.position, - gpuAcceleration = _ref2.gpuAcceleration, - adaptive = _ref2.adaptive, - roundOffsets = _ref2.roundOffsets; - - var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, - _ref3$x = _ref3.x, - x = _ref3$x === void 0 ? 0 : _ref3$x, - _ref3$y = _ref3.y, - y = _ref3$y === void 0 ? 0 : _ref3$y; - - var hasX = offsets.hasOwnProperty('x'); - var hasY = offsets.hasOwnProperty('y'); + popperRect = _ref2.popperRect, + placement = _ref2.placement, + variation = _ref2.variation, + offsets = _ref2.offsets, + position = _ref2.position, + gpuAcceleration = _ref2.gpuAcceleration, + adaptive = _ref2.adaptive, + roundOffsets = _ref2.roundOffsets; + + var _ref3 = + roundOffsets === true + ? roundOffsetsByDPR(offsets) + : typeof roundOffsets === "function" + ? roundOffsets(offsets) + : offsets, + _ref3$x = _ref3.x, + x = _ref3$x === void 0 ? 0 : _ref3$x, + _ref3$y = _ref3.y, + y = _ref3$y === void 0 ? 0 : _ref3$y; + + var hasX = offsets.hasOwnProperty("x"); + var hasY = offsets.hasOwnProperty("y"); var sideX = left; var sideY = top; var win = window; if (adaptive) { var offsetParent = getOffsetParent(popper); - var heightProp = 'clientHeight'; - var widthProp = 'clientWidth'; + var heightProp = "clientHeight"; + var widthProp = "clientWidth"; if (offsetParent === getWindow(popper)) { offsetParent = getDocumentElement(popper); - if (getComputedStyle$1(offsetParent).position !== 'static' && position === 'absolute') { - heightProp = 'scrollHeight'; - widthProp = 'scrollWidth'; + if ( + getComputedStyle$1(offsetParent).position !== "static" && + position === "absolute" + ) { + heightProp = "scrollHeight"; + widthProp = "scrollWidth"; } } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it - offsetParent = offsetParent; - if (placement === top || (placement === left || placement === right) && variation === end) { + if ( + placement === top || + ((placement === left || placement === right) && variation === end) + ) { sideY = bottom; // $FlowFixMe[prop-missing] y -= offsetParent[heightProp] - popperRect.height; y *= gpuAcceleration ? 1 : -1; } - if (placement === left || (placement === top || placement === bottom) && variation === end) { + if ( + placement === left || + ((placement === top || placement === bottom) && variation === end) + ) { sideX = right; // $FlowFixMe[prop-missing] x -= offsetParent[widthProp] - popperRect.width; @@ -2450,122 +2783,159 @@ } } - var commonStyles = Object.assign({ - position: position - }, adaptive && unsetSides); + var commonStyles = Object.assign( + { + position: position, + }, + adaptive && unsetSides + ); if (gpuAcceleration) { var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); + return Object.assign( + {}, + commonStyles, + ((_Object$assign = {}), + (_Object$assign[sideY] = hasY ? "0" : ""), + (_Object$assign[sideX] = hasX ? "0" : ""), + (_Object$assign.transform = + (win.devicePixelRatio || 1) <= 1 + ? "translate(" + x + "px, " + y + "px)" + : "translate3d(" + x + "px, " + y + "px, 0)"), + _Object$assign) + ); + } + + return Object.assign( + {}, + commonStyles, + ((_Object$assign2 = {}), + (_Object$assign2[sideY] = hasY ? y + "px" : ""), + (_Object$assign2[sideX] = hasX ? x + "px" : ""), + (_Object$assign2.transform = ""), + _Object$assign2) + ); } function computeStyles(_ref4) { var state = _ref4.state, - options = _ref4.options; + options = _ref4.options; var _options$gpuAccelerat = options.gpuAcceleration, - gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, - _options$adaptive = options.adaptive, - adaptive = _options$adaptive === void 0 ? true : _options$adaptive, - _options$roundOffsets = options.roundOffsets, - roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + gpuAcceleration = + _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, + _options$adaptive = options.adaptive, + adaptive = _options$adaptive === void 0 ? true : _options$adaptive, + _options$roundOffsets = options.roundOffsets, + roundOffsets = + _options$roundOffsets === void 0 ? true : _options$roundOffsets; var commonStyles = { placement: getBasePlacement(state.placement), variation: getVariation(state.placement), popper: state.elements.popper, popperRect: state.rects.popper, - gpuAcceleration: gpuAcceleration + gpuAcceleration: gpuAcceleration, }; if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive: adaptive, - roundOffsets: roundOffsets - }))); + state.styles.popper = Object.assign( + {}, + state.styles.popper, + mapToStyles( + Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive: adaptive, + roundOffsets: roundOffsets, + }) + ) + ); } if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: 'absolute', - adaptive: false, - roundOffsets: roundOffsets - }))); + state.styles.arrow = Object.assign( + {}, + state.styles.arrow, + mapToStyles( + Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: "absolute", + adaptive: false, + roundOffsets: roundOffsets, + }) + ) + ); } state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-placement': state.placement + "data-popper-placement": state.placement, }); } // eslint-disable-next-line import/no-unused-modules - const computeStyles$1 = { - name: 'computeStyles', + name: "computeStyles", enabled: true, - phase: 'beforeWrite', + phase: "beforeWrite", fn: computeStyles, - data: {} + data: {}, }; var passive = { - passive: true + passive: true, }; function effect(_ref) { var state = _ref.state, - instance = _ref.instance, - options = _ref.options; + instance = _ref.instance, + options = _ref.options; var _options$scroll = options.scroll, - scroll = _options$scroll === void 0 ? true : _options$scroll, - _options$resize = options.resize, - resize = _options$resize === void 0 ? true : _options$resize; + scroll = _options$scroll === void 0 ? true : _options$scroll, + _options$resize = options.resize, + resize = _options$resize === void 0 ? true : _options$resize; var window = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + var scrollParents = [].concat( + state.scrollParents.reference, + state.scrollParents.popper + ); if (scroll) { scrollParents.forEach(function (scrollParent) { - scrollParent.addEventListener('scroll', instance.update, passive); + scrollParent.addEventListener("scroll", instance.update, passive); }); } if (resize) { - window.addEventListener('resize', instance.update, passive); + window.addEventListener("resize", instance.update, passive); } return function () { if (scroll) { scrollParents.forEach(function (scrollParent) { - scrollParent.removeEventListener('scroll', instance.update, passive); + scrollParent.removeEventListener("scroll", instance.update, passive); }); } if (resize) { - window.removeEventListener('resize', instance.update, passive); + window.removeEventListener("resize", instance.update, passive); } }; } // eslint-disable-next-line import/no-unused-modules - const eventListeners = { - name: 'eventListeners', + name: "eventListeners", enabled: true, - phase: 'write', + phase: "write", fn: function fn() {}, effect: effect, - data: {} + data: {}, }; var hash$1 = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' + left: "right", + right: "left", + bottom: "top", + top: "bottom", }; function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, function (matched) { @@ -2574,8 +2944,8 @@ } var hash = { - start: 'end', - end: 'start' + start: "end", + end: "start", }; function getOppositeVariationPlacement(placement) { return placement.replace(/start|end/g, function (matched) { @@ -2589,7 +2959,7 @@ var scrollTop = win.pageYOffset; return { scrollLeft: scrollLeft, - scrollTop: scrollTop + scrollTop: scrollTop, }; } @@ -2601,7 +2971,10 @@ // anyway. // Browsers where the left scrollbar doesn't cause an issue report `0` for // this (e.g. Edge 2019, IE11, Safari) - return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; + return ( + getBoundingClientRect(getDocumentElement(element)).left + + getWindowScroll(element).scrollLeft + ); } function getViewportRect(element) { @@ -2638,7 +3011,7 @@ width: width, height: height, x: x + getWindowScrollBarX(element), - y: y + y: y, }; } @@ -2649,13 +3022,26 @@ var html = getDocumentElement(element); var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var body = + (_element$ownerDocumen = element.ownerDocument) == null + ? void 0 + : _element$ownerDocumen.body; + var width = max( + html.scrollWidth, + html.clientWidth, + body ? body.scrollWidth : 0, + body ? body.clientWidth : 0 + ); + var height = max( + html.scrollHeight, + html.clientHeight, + body ? body.scrollHeight : 0, + body ? body.clientHeight : 0 + ); var x = -winScroll.scrollLeft + getWindowScrollBarX(element); var y = -winScroll.scrollTop; - if (getComputedStyle$1(body || html).direction === 'rtl') { + if (getComputedStyle$1(body || html).direction === "rtl") { x += max(html.clientWidth, body ? body.clientWidth : 0) - width; } @@ -2663,22 +3049,22 @@ width: width, height: height, x: x, - y: y + y: y, }; } function isScrollParent(element) { // Firefox wants us to check `-x` and `-y` variations as well var _getComputedStyle = getComputedStyle$1(element), - overflow = _getComputedStyle.overflow, - overflowX = _getComputedStyle.overflowX, - overflowY = _getComputedStyle.overflowY; + overflow = _getComputedStyle.overflow, + overflowX = _getComputedStyle.overflowX, + overflowY = _getComputedStyle.overflowY; return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); } function getScrollParent(node) { - if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { + if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { // $FlowFixMe[incompatible-return]: assume body is always available return node.ownerDocument.body; } @@ -2705,12 +3091,22 @@ } var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var isBody = + scrollParent === + ((_element$ownerDocumen = element.ownerDocument) == null + ? void 0 + : _element$ownerDocumen.body); var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var target = isBody + ? [win].concat( + win.visualViewport || [], + isScrollParent(scrollParent) ? scrollParent : [] + ) + : scrollParent; var updatedList = list.concat(target); - return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here - updatedList.concat(listScrollParents(getParentNode(target))); + return isBody + ? updatedList // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + : updatedList.concat(listScrollParents(getParentNode(target))); } function rectToClientRect(rect) { @@ -2718,7 +3114,7 @@ left: rect.x, top: rect.y, right: rect.x + rect.width, - bottom: rect.y + rect.height + bottom: rect.y + rect.height, }); } @@ -2736,41 +3132,57 @@ } function getClientRectFromMixedType(element, clippingParent) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); + return clippingParent === viewport + ? rectToClientRect(getViewportRect(element)) + : isHTMLElement(clippingParent) + ? getInnerBoundingClientRect(clippingParent) + : rectToClientRect(getDocumentRect(getDocumentElement(element))); } // A "clipping parent" is an overflowable container with the characteristic of // clipping (or hiding) overflowing elements with a position different from // `initial` - function getClippingParents(element) { var clippingParents = listScrollParents(getParentNode(element)); - var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle$1(element).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + var canEscapeClipping = + ["absolute", "fixed"].indexOf(getComputedStyle$1(element).position) >= 0; + var clipperElement = + canEscapeClipping && isHTMLElement(element) + ? getOffsetParent(element) + : element; if (!isElement(clipperElement)) { return []; } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 - return clippingParents.filter(function (clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; + return ( + isElement(clippingParent) && + contains(clippingParent, clipperElement) && + getNodeName(clippingParent) !== "body" + ); }); } // Gets the maximum area that the element is visible in due to any number of // clipping parents - function getClippingRect(element, boundary, rootBoundary) { - var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); + var mainClippingParents = + boundary === "clippingParents" + ? getClippingParents(element) + : [].concat(boundary); var clippingParents = [].concat(mainClippingParents, [rootBoundary]); var firstClippingParent = clippingParents[0]; - var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { + var clippingRect = clippingParents.reduce(function ( + accRect, + clippingParent + ) { var rect = getClientRectFromMixedType(element, clippingParent); accRect.top = max(rect.top, accRect.top); accRect.right = min(rect.right, accRect.right); accRect.bottom = min(rect.bottom, accRect.bottom); accRect.left = max(rect.left, accRect.left); return accRect; - }, getClientRectFromMixedType(element, firstClippingParent)); + }, + getClientRectFromMixedType(element, firstClippingParent)); clippingRect.width = clippingRect.right - clippingRect.left; clippingRect.height = clippingRect.bottom - clippingRect.top; clippingRect.x = clippingRect.left; @@ -2780,8 +3192,8 @@ function computeOffsets(_ref) { var reference = _ref.reference, - element = _ref.element, - placement = _ref.placement; + element = _ref.element, + placement = _ref.placement; var basePlacement = placement ? getBasePlacement(placement) : null; var variation = placement ? getVariation(placement) : null; var commonX = reference.x + reference.width / 2 - element.width / 2; @@ -2792,50 +3204,54 @@ case top: offsets = { x: commonX, - y: reference.y - element.height + y: reference.y - element.height, }; break; case bottom: offsets = { x: commonX, - y: reference.y + reference.height + y: reference.y + reference.height, }; break; case right: offsets = { x: reference.x + reference.width, - y: commonY + y: commonY, }; break; case left: offsets = { x: reference.x - element.width, - y: commonY + y: commonY, }; break; default: offsets = { x: reference.x, - y: reference.y + y: reference.y, }; } - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + var mainAxis = basePlacement + ? getMainAxisFromPlacement(basePlacement) + : null; if (mainAxis != null) { - var len = mainAxis === 'y' ? 'height' : 'width'; + var len = mainAxis === "y" ? "height" : "width"; switch (variation) { case start: - offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); + offsets[mainAxis] = + offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); break; case end: - offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); + offsets[mainAxis] = + offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); break; } } @@ -2849,39 +3265,64 @@ } var _options = options, - _options$placement = _options.placement, - placement = _options$placement === void 0 ? state.placement : _options$placement, - _options$boundary = _options.boundary, - boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, - _options$rootBoundary = _options.rootBoundary, - rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, - _options$elementConte = _options.elementContext, - elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, - _options$altBoundary = _options.altBoundary, - altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, - _options$padding = _options.padding, - padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); + _options$placement = _options.placement, + placement = + _options$placement === void 0 ? state.placement : _options$placement, + _options$boundary = _options.boundary, + boundary = + _options$boundary === void 0 ? clippingParents : _options$boundary, + _options$rootBoundary = _options.rootBoundary, + rootBoundary = + _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, + _options$elementConte = _options.elementContext, + elementContext = + _options$elementConte === void 0 ? popper : _options$elementConte, + _options$altBoundary = _options.altBoundary, + altBoundary = + _options$altBoundary === void 0 ? false : _options$altBoundary, + _options$padding = _options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject( + typeof padding !== "number" + ? padding + : expandToHashMap(padding, basePlacements) + ); var altContext = elementContext === popper ? reference : popper; var popperRect = state.rects.popper; var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); + var clippingClientRect = getClippingRect( + isElement(element) + ? element + : element.contextElement || getDocumentElement(state.elements.popper), + boundary, + rootBoundary + ); var referenceClientRect = getBoundingClientRect(state.elements.reference); var popperOffsets = computeOffsets({ reference: referenceClientRect, element: popperRect, - strategy: 'absolute', - placement: placement + strategy: "absolute", + placement: placement, }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect + var popperClientRect = rectToClientRect( + Object.assign({}, popperRect, popperOffsets) + ); + var elementClientRect = + elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect // 0 or negative = within the clipping rect var overflowOffsets = { top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right + bottom: + elementClientRect.bottom - + clippingClientRect.bottom + + paddingObject.bottom, + left: + clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: + elementClientRect.right - + clippingClientRect.right + + paddingObject.right, }; var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element @@ -2889,7 +3330,7 @@ var offset = offsetData[placement]; Object.keys(overflowOffsets).forEach(function (key) { var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; + var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; overflowOffsets[key] += offset[axis] * multiply; }); } @@ -2903,17 +3344,22 @@ } var _options = options, - placement = _options.placement, - boundary = _options.boundary, - rootBoundary = _options.rootBoundary, - padding = _options.padding, - flipVariations = _options.flipVariations, - _options$allowedAutoP = _options.allowedAutoPlacements, - allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + placement = _options.placement, + boundary = _options.boundary, + rootBoundary = _options.rootBoundary, + padding = _options.padding, + flipVariations = _options.flipVariations, + _options$allowedAutoP = _options.allowedAutoPlacements, + allowedAutoPlacements = + _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; var variation = getVariation(placement); - var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { - return getVariation(placement) === variation; - }) : basePlacements; + var placements$1 = variation + ? flipVariations + ? variationPlacements + : variationPlacements.filter(function (placement) { + return getVariation(placement) === variation; + }) + : basePlacements; var allowedPlacements = placements$1.filter(function (placement) { return allowedAutoPlacements.indexOf(placement) >= 0; }); @@ -2922,13 +3368,12 @@ allowedPlacements = placements$1; } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... - var overflows = allowedPlacements.reduce(function (acc, placement) { acc[placement] = detectOverflow(state, { placement: placement, boundary: boundary, rootBoundary: rootBoundary, - padding: padding + padding: padding, })[getBasePlacement(placement)]; return acc; }, {}); @@ -2943,44 +3388,59 @@ } var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; + return [ + getOppositeVariationPlacement(placement), + oppositePlacement, + getOppositeVariationPlacement(oppositePlacement), + ]; } function flip(_ref) { var state = _ref.state, - options = _ref.options, - name = _ref.name; + options = _ref.options, + name = _ref.name; if (state.modifiersData[name]._skip) { return; } var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, - specifiedFallbackPlacements = options.fallbackPlacements, - padding = options.padding, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - _options$flipVariatio = options.flipVariations, - flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, - allowedAutoPlacements = options.allowedAutoPlacements; + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, + specifiedFallbackPlacements = options.fallbackPlacements, + padding = options.padding, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + _options$flipVariatio = options.flipVariations, + flipVariations = + _options$flipVariatio === void 0 ? true : _options$flipVariatio, + allowedAutoPlacements = options.allowedAutoPlacements; var preferredPlacement = state.options.placement; var basePlacement = getBasePlacement(preferredPlacement); var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { - return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - flipVariations: flipVariations, - allowedAutoPlacements: allowedAutoPlacements - }) : placement); - }, []); + var fallbackPlacements = + specifiedFallbackPlacements || + (isBasePlacement || !flipVariations + ? [getOppositePlacement(preferredPlacement)] + : getExpandedFallbackPlacements(preferredPlacement)); + var placements = [preferredPlacement] + .concat(fallbackPlacements) + .reduce(function (acc, placement) { + return acc.concat( + getBasePlacement(placement) === auto + ? computeAutoPlacement(state, { + placement: placement, + boundary: boundary, + rootBoundary: rootBoundary, + padding: padding, + flipVariations: flipVariations, + allowedAutoPlacements: allowedAutoPlacements, + }) + : placement + ); + }, []); var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var checksMap = new Map(); @@ -2994,15 +3454,21 @@ var isStartVariation = getVariation(placement) === start; var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? 'width' : 'height'; + var len = isVertical ? "width" : "height"; var overflow = detectOverflow(state, { placement: placement, boundary: boundary, rootBoundary: rootBoundary, altBoundary: altBoundary, - padding: padding + padding: padding, }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + var mainVariationSide = isVertical + ? isStartVariation + ? right + : left + : isStartVariation + ? bottom + : top; if (referenceRect[len] > popperRect[len]) { mainVariationSide = getOppositePlacement(mainVariationSide); @@ -3016,12 +3482,17 @@ } if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + checks.push( + overflow[mainVariationSide] <= 0, + overflow[altVariationSide] <= 0 + ); } - if (checks.every(function (check) { - return check; - })) { + if ( + checks.every(function (check) { + return check; + }) + ) { firstFittingPlacement = placement; makeFallbackChecks = false; break; @@ -3065,23 +3536,22 @@ } } // eslint-disable-next-line import/no-unused-modules - const flip$1 = { - name: 'flip', + name: "flip", enabled: true, - phase: 'main', + phase: "main", fn: flip, - requiresIfExists: ['offset'], + requiresIfExists: ["offset"], data: { - _skip: false - } + _skip: false, + }, }; function getSideOffsets(overflow, rect, preventedOffsets) { if (preventedOffsets === void 0) { preventedOffsets = { x: 0, - y: 0 + y: 0, }; } @@ -3089,7 +3559,7 @@ top: overflow.top - rect.height - preventedOffsets.y, right: overflow.right - rect.width + preventedOffsets.x, bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x + left: overflow.left - rect.width - preventedOffsets.x, }; } @@ -3101,75 +3571,88 @@ function hide(_ref) { var state = _ref.state, - name = _ref.name; + name = _ref.name; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; var preventedOffsets = state.modifiersData.preventOverflow; var referenceOverflow = detectOverflow(state, { - elementContext: 'reference' + elementContext: "reference", }); var popperAltOverflow = detectOverflow(state, { - altBoundary: true + altBoundary: true, }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var referenceClippingOffsets = getSideOffsets( + referenceOverflow, + referenceRect + ); + var popperEscapeOffsets = getSideOffsets( + popperAltOverflow, + popperRect, + preventedOffsets + ); var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); state.modifiersData[name] = { referenceClippingOffsets: referenceClippingOffsets, popperEscapeOffsets: popperEscapeOffsets, isReferenceHidden: isReferenceHidden, - hasPopperEscaped: hasPopperEscaped + hasPopperEscaped: hasPopperEscaped, }; state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-reference-hidden': isReferenceHidden, - 'data-popper-escaped': hasPopperEscaped + "data-popper-reference-hidden": isReferenceHidden, + "data-popper-escaped": hasPopperEscaped, }); } // eslint-disable-next-line import/no-unused-modules - const hide$1 = { - name: 'hide', + name: "hide", enabled: true, - phase: 'main', - requiresIfExists: ['preventOverflow'], - fn: hide + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: hide, }; function distanceAndSkiddingToXY(placement, rects, offset) { var basePlacement = getBasePlacement(placement); var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { - placement: placement - })) : offset, - skidding = _ref[0], - distance = _ref[1]; + var _ref = + typeof offset === "function" + ? offset( + Object.assign({}, rects, { + placement: placement, + }) + ) + : offset, + skidding = _ref[0], + distance = _ref[1]; skidding = skidding || 0; distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; + return [left, right].indexOf(basePlacement) >= 0 + ? { + x: distance, + y: skidding, + } + : { + x: skidding, + y: distance, + }; } function offset(_ref2) { var state = _ref2.state, - options = _ref2.options, - name = _ref2.name; + options = _ref2.options, + name = _ref2.name; var _options$offset = options.offset, - offset = _options$offset === void 0 ? [0, 0] : _options$offset; + offset = _options$offset === void 0 ? [0, 0] : _options$offset; var data = placements.reduce(function (acc, placement) { acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); return acc; }, {}); var _data$state$placement = data[state.placement], - x = _data$state$placement.x, - y = _data$state$placement.y; + x = _data$state$placement.x, + y = _data$state$placement.y; if (state.modifiersData.popperOffsets != null) { state.modifiersData.popperOffsets.x += x; @@ -3179,18 +3662,17 @@ state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules - const offset$1 = { - name: 'offset', + name: "offset", enabled: true, - phase: 'main', - requires: ['popperOffsets'], - fn: offset + phase: "main", + requires: ["popperOffsets"], + fn: offset, }; function popperOffsets(_ref) { var state = _ref.state, - name = _ref.name; + name = _ref.name; // Offsets are the actual position the popper needs to have to be // properly positioned near its reference element // This is the most basic placement, and will be adjusted by @@ -3198,45 +3680,45 @@ state.modifiersData[name] = computeOffsets({ reference: state.rects.reference, element: state.rects.popper, - strategy: 'absolute', - placement: state.placement + strategy: "absolute", + placement: state.placement, }); } // eslint-disable-next-line import/no-unused-modules - const popperOffsets$1 = { - name: 'popperOffsets', + name: "popperOffsets", enabled: true, - phase: 'read', + phase: "read", fn: popperOffsets, - data: {} + data: {}, }; function getAltAxis(axis) { - return axis === 'x' ? 'y' : 'x'; + return axis === "x" ? "y" : "x"; } function preventOverflow(_ref) { var state = _ref.state, - options = _ref.options, - name = _ref.name; + options = _ref.options, + name = _ref.name; var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - padding = options.padding, - _options$tether = options.tether, - tether = _options$tether === void 0 ? true : _options$tether, - _options$tetherOffset = options.tetherOffset, - tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; + checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, + _options$altAxis = options.altAxis, + checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, + boundary = options.boundary, + rootBoundary = options.rootBoundary, + altBoundary = options.altBoundary, + padding = options.padding, + _options$tether = options.tether, + tether = _options$tether === void 0 ? true : _options$tether, + _options$tetherOffset = options.tetherOffset, + tetherOffset = + _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; var overflow = detectOverflow(state, { boundary: boundary, rootBoundary: rootBoundary, padding: padding, - altBoundary: altBoundary + altBoundary: altBoundary, }); var basePlacement = getBasePlacement(state.placement); var variation = getVariation(state.placement); @@ -3246,12 +3728,17 @@ var popperOffsets = state.modifiersData.popperOffsets; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; + var tetherOffsetValue = + typeof tetherOffset === "function" + ? tetherOffset( + Object.assign({}, state.rects, { + placement: state.placement, + }) + ) + : tetherOffset; var data = { x: 0, - y: 0 + y: 0, }; if (!popperOffsets) { @@ -3259,9 +3746,9 @@ } if (checkMainAxis || checkAltAxis) { - var mainSide = mainAxis === 'y' ? top : left; - var altSide = mainAxis === 'y' ? bottom : right; - var len = mainAxis === 'y' ? 'height' : 'width'; + var mainSide = mainAxis === "y" ? top : left; + var altSide = mainAxis === "y" ? bottom : right; + var len = mainAxis === "y" ? "height" : "width"; var offset = popperOffsets[mainAxis]; var min$1 = popperOffsets[mainAxis] + overflow[mainSide]; var max$1 = popperOffsets[mainAxis] - overflow[altSide]; @@ -3271,11 +3758,16 @@ // outside the reference bounds var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); + var arrowRect = + tether && arrowElement + ? getLayoutRect(arrowElement) + : { + width: 0, + height: 0, + }; + var arrowPaddingObject = state.modifiersData["arrow#persistent"] + ? state.modifiersData["arrow#persistent"].padding + : getFreshSideObject(); var arrowPaddingMin = arrowPaddingObject[mainSide]; var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want // to include its full size in the calculation. If the reference is small @@ -3284,24 +3776,51 @@ // width or height) var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; - var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; + var minOffset = isBasePlacement + ? referenceRect[len] / 2 - + additive - + arrowLen - + arrowPaddingMin - + tetherOffsetValue + : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; + var maxOffset = isBasePlacement + ? -referenceRect[len] / 2 + + additive + + arrowLen + + arrowPaddingMax + + tetherOffsetValue + : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; + var arrowOffsetParent = + state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent + ? mainAxis === "y" + ? arrowOffsetParent.clientTop || 0 + : arrowOffsetParent.clientLeft || 0 + : 0; + var offsetModifierValue = state.modifiersData.offset + ? state.modifiersData.offset[state.placement][mainAxis] + : 0; + var tetherMin = + popperOffsets[mainAxis] + + minOffset - + offsetModifierValue - + clientOffset; var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; if (checkMainAxis) { - var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); + var preventedOffset = within( + tether ? min(min$1, tetherMin) : min$1, + offset, + tether ? max(max$1, tetherMax) : max$1 + ); popperOffsets[mainAxis] = preventedOffset; data[mainAxis] = preventedOffset - offset; } if (checkAltAxis) { - var _mainSide = mainAxis === 'x' ? top : left; + var _mainSide = mainAxis === "x" ? top : left; - var _altSide = mainAxis === 'x' ? bottom : right; + var _altSide = mainAxis === "x" ? bottom : right; var _offset = popperOffsets[altAxis]; @@ -3309,7 +3828,11 @@ var _max = _offset - overflow[_altSide]; - var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max); + var _preventedOffset = within( + tether ? min(_min, tetherMin) : _min, + _offset, + tether ? max(_max, tetherMax) : _max + ); popperOffsets[altAxis] = _preventedOffset; data[altAxis] = _preventedOffset - _offset; @@ -3319,19 +3842,18 @@ state.modifiersData[name] = data; } // eslint-disable-next-line import/no-unused-modules - const preventOverflow$1 = { - name: 'preventOverflow', + name: "preventOverflow", enabled: true, - phase: 'main', + phase: "main", fn: preventOverflow, - requiresIfExists: ['offset'] + requiresIfExists: ["offset"], }; function getHTMLElementScroll(element) { return { scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop + scrollTop: element.scrollTop, }; } @@ -3351,7 +3873,6 @@ } // Returns the composite rect of an element relative to its offsetParent. // Composite means it takes into account transforms as well as layout. - function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { if (isFixed === void 0) { isFixed = false; @@ -3363,16 +3884,18 @@ var rect = getBoundingClientRect(elementOrVirtualElement); var scroll = { scrollLeft: 0, - scrollTop: 0 + scrollTop: 0, }; var offsets = { x: 0, - y: 0 + y: 0, }; - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 - isScrollParent(documentElement)) { + if (isOffsetParentAnElement || (!isOffsetParentAnElement && !isFixed)) { + if ( + getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement) + ) { scroll = getNodeScroll(offsetParent); } @@ -3389,7 +3912,7 @@ x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, width: rect.width, - height: rect.height + height: rect.height, }; } @@ -3403,7 +3926,10 @@ function sort(modifier) { visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + var requires = [].concat( + modifier.requires || [], + modifier.requiresIfExists || [] + ); requires.forEach(function (dep) { if (!visited.has(dep)) { var depModifier = map.get(dep); @@ -3430,9 +3956,11 @@ var orderedModifiers = order(modifiers); // order based on phase return modifierPhases.reduce(function (acc, phase) { - return acc.concat(orderedModifiers.filter(function (modifier) { - return modifier.phase === phase; - })); + return acc.concat( + orderedModifiers.filter(function (modifier) { + return modifier.phase === phase; + }) + ); }, []); } @@ -3455,10 +3983,12 @@ function mergeByName(modifiers) { var merged = modifiers.reduce(function (merged, current) { var existing = merged[current.name]; - merged[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; + merged[current.name] = existing + ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data), + }) + : current; return merged; }, {}); // IE11 does not support Object.values @@ -3468,18 +3998,22 @@ } var DEFAULT_OPTIONS = { - placement: 'bottom', + placement: "bottom", modifiers: [], - strategy: 'absolute' + strategy: "absolute", }; function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + for ( + var _len = arguments.length, args = new Array(_len), _key = 0; + _key < _len; + _key++ + ) { args[_key] = arguments[_key]; } return !args.some(function (element) { - return !(element && typeof element.getBoundingClientRect === 'function'); + return !(element && typeof element.getBoundingClientRect === "function"); }); } @@ -3489,42 +4023,60 @@ } var _generatorOptions = generatorOptions, - _generatorOptions$def = _generatorOptions.defaultModifiers, - defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, - _generatorOptions$def2 = _generatorOptions.defaultOptions, - defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + _generatorOptions$def = _generatorOptions.defaultModifiers, + defaultModifiers = + _generatorOptions$def === void 0 ? [] : _generatorOptions$def, + _generatorOptions$def2 = _generatorOptions.defaultOptions, + defaultOptions = + _generatorOptions$def2 === void 0 + ? DEFAULT_OPTIONS + : _generatorOptions$def2; return function createPopper(reference, popper, options) { if (options === void 0) { options = defaultOptions; } var state = { - placement: 'bottom', + placement: "bottom", orderedModifiers: [], options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), modifiersData: {}, elements: { reference: reference, - popper: popper + popper: popper, }, attributes: {}, - styles: {} + styles: {}, }; var effectCleanupFns = []; var isDestroyed = false; var instance = { state: state, setOptions: function setOptions(setOptionsAction) { - var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; + var options = + typeof setOptionsAction === "function" + ? setOptionsAction(state.options) + : setOptionsAction; cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options); + state.options = Object.assign( + {}, + defaultOptions, + state.options, + options + ); state.scrollParents = { - reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], - popper: listScrollParents(popper) + reference: isElement(reference) + ? listScrollParents(reference) + : reference.contextElement + ? listScrollParents(reference.contextElement) + : [], + popper: listScrollParents(popper), }; // Orders the modifiers based on their dependencies and `phase` // properties - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers + var orderedModifiers = orderModifiers( + mergeByName([].concat(defaultModifiers, state.options.modifiers)) + ); // Strip out disabled modifiers state.orderedModifiers = orderedModifiers.filter(function (m) { return m.enabled; @@ -3544,19 +4096,21 @@ } var _state$elements = state.elements, - reference = _state$elements.reference, - popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements + reference = _state$elements.reference, + popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements // anymore if (!areValidElements(reference, popper)) { - return; } // Store the reference and popper rects to be read by modifiers - state.rects = { - reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), - popper: getLayoutRect(popper) + reference: getCompositeRect( + reference, + getOffsetParent(popper), + state.options.strategy === "fixed" + ), + popper: getLayoutRect(popper), }; // Modifiers have the ability to reset the current update cycle. The // most common use case for this is the `flip` modifier changing the // placement, which then needs to re-run all the modifiers, because the @@ -3570,11 +4124,13 @@ // To ensure persistent data, use `${name}#persistent` state.orderedModifiers.forEach(function (modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + return (state.modifiersData[modifier.name] = Object.assign( + {}, + modifier.data + )); }); for (var index = 0; index < state.orderedModifiers.length; index++) { - if (state.reset === true) { state.reset = false; index = -1; @@ -3582,18 +4138,20 @@ } var _state$orderedModifie = state.orderedModifiers[index], - fn = _state$orderedModifie.fn, - _state$orderedModifie2 = _state$orderedModifie.options, - _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, - name = _state$orderedModifie.name; - - if (typeof fn === 'function') { - state = fn({ - state: state, - options: _options, - name: name, - instance: instance - }) || state; + fn = _state$orderedModifie.fn, + _state$orderedModifie2 = _state$orderedModifie.options, + _options = + _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, + name = _state$orderedModifie.name; + + if (typeof fn === "function") { + state = + fn({ + state: state, + options: _options, + name: name, + instance: instance, + }) || state; } } }, @@ -3608,11 +4166,10 @@ destroy: function destroy() { cleanupModifierEffects(); isDestroyed = true; - } + }, }; if (!areValidElements(reference, popper)) { - return instance; } @@ -3629,16 +4186,16 @@ function runModifierEffects() { state.orderedModifiers.forEach(function (_ref3) { var name = _ref3.name, - _ref3$options = _ref3.options, - options = _ref3$options === void 0 ? {} : _ref3$options, - effect = _ref3.effect; + _ref3$options = _ref3.options, + options = _ref3$options === void 0 ? {} : _ref3$options, + effect = _ref3.effect; - if (typeof effect === 'function') { + if (typeof effect === "function") { var cleanupFn = effect({ state: state, name: name, instance: instance, - options: options + options: options, }); var noopFn = function noopFn() {}; @@ -3658,19 +4215,34 @@ return instance; }; } - var createPopper$2 = /*#__PURE__*/popperGenerator(); // eslint-disable-next-line import/no-unused-modules + var createPopper$2 = /*#__PURE__*/ popperGenerator(); // eslint-disable-next-line import/no-unused-modules - var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; - var createPopper$1 = /*#__PURE__*/popperGenerator({ - defaultModifiers: defaultModifiers$1 + var defaultModifiers$1 = [ + eventListeners, + popperOffsets$1, + computeStyles$1, + applyStyles$1, + ]; + var createPopper$1 = /*#__PURE__*/ popperGenerator({ + defaultModifiers: defaultModifiers$1, }); // eslint-disable-next-line import/no-unused-modules - var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; - var createPopper = /*#__PURE__*/popperGenerator({ - defaultModifiers: defaultModifiers + var defaultModifiers = [ + eventListeners, + popperOffsets$1, + computeStyles$1, + applyStyles$1, + offset$1, + flip$1, + preventOverflow$1, + arrow$1, + hide$1, + ]; + var createPopper = /*#__PURE__*/ popperGenerator({ + defaultModifiers: defaultModifiers, }); // eslint-disable-next-line import/no-unused-modules - const Popper = /*#__PURE__*/Object.freeze({ + const Popper = /*#__PURE__*/ Object.freeze({ __proto__: null, popperGenerator, detectOverflow, @@ -3709,7 +4281,7 @@ hide: hide$1, offset: offset$1, popperOffsets: popperOffsets$1, - preventOverflow: preventOverflow$1 + preventOverflow: preventOverflow$1, }); /** @@ -3724,18 +4296,20 @@ * ------------------------------------------------------------------------ */ - const NAME$9 = 'dropdown'; - const DATA_KEY$8 = 'bs.dropdown'; + const NAME$9 = "dropdown"; + const DATA_KEY$8 = "bs.dropdown"; const EVENT_KEY$8 = `.${DATA_KEY$8}`; - const DATA_API_KEY$4 = '.data-api'; - const ESCAPE_KEY$2 = 'Escape'; - const SPACE_KEY = 'Space'; - const TAB_KEY$1 = 'Tab'; - const ARROW_UP_KEY = 'ArrowUp'; - const ARROW_DOWN_KEY = 'ArrowDown'; + const DATA_API_KEY$4 = ".data-api"; + const ESCAPE_KEY$2 = "Escape"; + const SPACE_KEY = "Space"; + const TAB_KEY$1 = "Tab"; + const ARROW_UP_KEY = "ArrowUp"; + const ARROW_DOWN_KEY = "ArrowDown"; const RIGHT_MOUSE_BUTTON = 2; // MouseEvent.button value for the secondary button, usually the right button - const REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}`); + const REGEXP_KEYDOWN = new RegExp( + `${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY$2}` + ); const EVENT_HIDE$4 = `hide${EVENT_KEY$8}`; const EVENT_HIDDEN$4 = `hidden${EVENT_KEY$8}`; const EVENT_SHOW$4 = `show${EVENT_KEY$8}`; @@ -3743,36 +4317,37 @@ const EVENT_CLICK_DATA_API$3 = `click${EVENT_KEY$8}${DATA_API_KEY$4}`; const EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY$8}${DATA_API_KEY$4}`; const EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY$8}${DATA_API_KEY$4}`; - const CLASS_NAME_SHOW$6 = 'show'; - const CLASS_NAME_DROPUP = 'dropup'; - const CLASS_NAME_DROPEND = 'dropend'; - const CLASS_NAME_DROPSTART = 'dropstart'; - const CLASS_NAME_NAVBAR = 'navbar'; + const CLASS_NAME_SHOW$6 = "show"; + const CLASS_NAME_DROPUP = "dropup"; + const CLASS_NAME_DROPEND = "dropend"; + const CLASS_NAME_DROPSTART = "dropstart"; + const CLASS_NAME_NAVBAR = "navbar"; const SELECTOR_DATA_TOGGLE$3 = '[data-bs-toggle="dropdown"]'; - const SELECTOR_MENU = '.dropdown-menu'; - const SELECTOR_NAVBAR_NAV = '.navbar-nav'; - const SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; - const PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'; - const PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'; - const PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'; - const PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'; - const PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'; - const PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'; + const SELECTOR_MENU = ".dropdown-menu"; + const SELECTOR_NAVBAR_NAV = ".navbar-nav"; + const SELECTOR_VISIBLE_ITEMS = + ".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)"; + const PLACEMENT_TOP = isRTL() ? "top-end" : "top-start"; + const PLACEMENT_TOPEND = isRTL() ? "top-start" : "top-end"; + const PLACEMENT_BOTTOM = isRTL() ? "bottom-end" : "bottom-start"; + const PLACEMENT_BOTTOMEND = isRTL() ? "bottom-start" : "bottom-end"; + const PLACEMENT_RIGHT = isRTL() ? "left-start" : "right-start"; + const PLACEMENT_LEFT = isRTL() ? "right-start" : "left-start"; const Default$8 = { offset: [0, 2], - boundary: 'clippingParents', - reference: 'toggle', - display: 'dynamic', + boundary: "clippingParents", + reference: "toggle", + display: "dynamic", popperConfig: null, - autoClose: true + autoClose: true, }; const DefaultType$8 = { - offset: '(array|string|function)', - boundary: '(string|element)', - reference: '(string|element|object)', - display: 'string', - popperConfig: '(null|object|function)', - autoClose: '(boolean|string)' + offset: "(array|string|function)", + boundary: "(string|element)", + reference: "(string|element|object)", + display: "string", + popperConfig: "(null|object|function)", + autoClose: "(boolean|string)", }; /** * ------------------------------------------------------------------------ @@ -3789,7 +4364,6 @@ this._inNavbar = this._detectNavbar(); } // Getters - static get Default() { return Default$8; } @@ -3802,7 +4376,6 @@ return NAME$9; } // Public - toggle() { return this._isShown() ? this.hide() : this.show(); } @@ -3813,9 +4386,13 @@ } const relatedTarget = { - relatedTarget: this._element + relatedTarget: this._element, }; - const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$4, relatedTarget); + const showEvent = EventHandler.trigger( + this._element, + EVENT_SHOW$4, + relatedTarget + ); if (showEvent.defaultPrevented) { return; @@ -3824,7 +4401,7 @@ const parent = Dropdown.getParentFromElement(this._element); // Totally disable Popper for Dropdowns in Navbar if (this._inNavbar) { - Manipulator.setDataAttribute(this._menu, 'popper', 'none'); + Manipulator.setDataAttribute(this._menu, "popper", "none"); } else { this._createPopper(parent); } // If this is a touch-enabled device we add extra @@ -3832,14 +4409,18 @@ // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - - if ('ontouchstart' in document.documentElement && !parent.closest(SELECTOR_NAVBAR_NAV)) { - [].concat(...document.body.children).forEach(elem => EventHandler.on(elem, 'mouseover', noop)); + if ( + "ontouchstart" in document.documentElement && + !parent.closest(SELECTOR_NAVBAR_NAV) + ) { + [] + .concat(...document.body.children) + .forEach((elem) => EventHandler.on(elem, "mouseover", noop)); } this._element.focus(); - this._element.setAttribute('aria-expanded', true); + this._element.setAttribute("aria-expanded", true); this._menu.classList.add(CLASS_NAME_SHOW$6); @@ -3854,7 +4435,7 @@ } const relatedTarget = { - relatedTarget: this._element + relatedTarget: this._element, }; this._completeHide(relatedTarget); @@ -3876,18 +4457,22 @@ } } // Private - _completeHide(relatedTarget) { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE$4, relatedTarget); + const hideEvent = EventHandler.trigger( + this._element, + EVENT_HIDE$4, + relatedTarget + ); if (hideEvent.defaultPrevented) { return; } // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support - - if ('ontouchstart' in document.documentElement) { - [].concat(...document.body.children).forEach(elem => EventHandler.off(elem, 'mouseover', noop)); + if ("ontouchstart" in document.documentElement) { + [] + .concat(...document.body.children) + .forEach((elem) => EventHandler.off(elem, "mouseover", noop)); } if (this._popper) { @@ -3898,49 +4483,61 @@ this._element.classList.remove(CLASS_NAME_SHOW$6); - this._element.setAttribute('aria-expanded', 'false'); + this._element.setAttribute("aria-expanded", "false"); - Manipulator.removeDataAttribute(this._menu, 'popper'); + Manipulator.removeDataAttribute(this._menu, "popper"); EventHandler.trigger(this._element, EVENT_HIDDEN$4, relatedTarget); } _getConfig(config) { - config = { ...this.constructor.Default, + config = { + ...this.constructor.Default, ...Manipulator.getDataAttributes(this._element), - ...config + ...config, }; typeCheckConfig(NAME$9, config, this.constructor.DefaultType); - if (typeof config.reference === 'object' && !isElement$1(config.reference) && typeof config.reference.getBoundingClientRect !== 'function') { + if ( + typeof config.reference === "object" && + !isElement$1(config.reference) && + typeof config.reference.getBoundingClientRect !== "function" + ) { // Popper virtual elements require a getBoundingClientRect method - throw new TypeError(`${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`); + throw new TypeError( + `${NAME$9.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.` + ); } return config; } _createPopper(parent) { - if (typeof Popper === 'undefined') { - throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); + if (typeof Popper === "undefined") { + throw new TypeError( + "Bootstrap's dropdowns require Popper (https://popper.js.org)" + ); } let referenceElement = this._element; - if (this._config.reference === 'parent') { + if (this._config.reference === "parent") { referenceElement = parent; } else if (isElement$1(this._config.reference)) { referenceElement = getElement(this._config.reference); - } else if (typeof this._config.reference === 'object') { + } else if (typeof this._config.reference === "object") { referenceElement = this._config.reference; } const popperConfig = this._getPopperConfig(); - const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false); + const isDisplayStatic = popperConfig.modifiers.find( + (modifier) => + modifier.name === "applyStyles" && modifier.enabled === false + ); this._popper = createPopper(referenceElement, this._menu, popperConfig); if (isDisplayStatic) { - Manipulator.setDataAttribute(this._menu, 'popper', 'static'); + Manipulator.setDataAttribute(this._menu, "popper", "static"); } } @@ -3963,8 +4560,10 @@ return PLACEMENT_LEFT; } // We need to trim the value because custom properties can also include spaces - - const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'; + const isEnd = + getComputedStyle(this._menu) + .getPropertyValue("--bs-position") + .trim() === "end"; if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) { return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP; @@ -3978,16 +4577,14 @@ } _getOffset() { - const { - offset - } = this._config; + const { offset } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(val => Number.parseInt(val, 10)); + if (typeof offset === "string") { + return offset.split(",").map((val) => Number.parseInt(val, 10)); } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); + if (typeof offset === "function") { + return (popperData) => offset(popperData, this._element); } return offset; @@ -3996,56 +4593,67 @@ _getPopperConfig() { const defaultBsPopperConfig = { placement: this._getPlacement(), - modifiers: [{ - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }] + modifiers: [ + { + name: "preventOverflow", + options: { + boundary: this._config.boundary, + }, + }, + { + name: "offset", + options: { + offset: this._getOffset(), + }, + }, + ], }; // Disable Popper if we have a static display - if (this._config.display === 'static') { - defaultBsPopperConfig.modifiers = [{ - name: 'applyStyles', - enabled: false - }]; + if (this._config.display === "static") { + defaultBsPopperConfig.modifiers = [ + { + name: "applyStyles", + enabled: false, + }, + ]; } - return { ...defaultBsPopperConfig, - ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) + return { + ...defaultBsPopperConfig, + ...(typeof this._config.popperConfig === "function" + ? this._config.popperConfig(defaultBsPopperConfig) + : this._config.popperConfig), }; } - _selectMenuItem({ - key, - target - }) { - const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible); + _selectMenuItem({ key, target }) { + const items = SelectorEngine.find( + SELECTOR_VISIBLE_ITEMS, + this._menu + ).filter(isVisible); if (!items.length) { return; } // if target isn't included in items (e.g. when expanding the dropdown) // allow cycling to get the last item in case key equals ARROW_UP_KEY - - getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus(); + getNextActiveElement( + items, + target, + key === ARROW_DOWN_KEY, + !items.includes(target) + ).focus(); } // Static - static jQueryInterface(config) { return this.each(function () { const data = Dropdown.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + if (typeof config !== "string") { return; } - if (typeof data[config] === 'undefined') { + if (typeof data[config] === "undefined") { throw new TypeError(`No method named "${config}"`); } @@ -4054,7 +4662,11 @@ } static clearMenus(event) { - if (event && (event.button === RIGHT_MOUSE_BUTTON || event.type === 'keyup' && event.key !== TAB_KEY$1)) { + if ( + event && + (event.button === RIGHT_MOUSE_BUTTON || + (event.type === "keyup" && event.key !== TAB_KEY$1)) + ) { return; } @@ -4072,23 +4684,30 @@ } const relatedTarget = { - relatedTarget: context._element + relatedTarget: context._element, }; if (event) { const composedPath = event.composedPath(); const isMenuTarget = composedPath.includes(context._menu); - if (composedPath.includes(context._element) || context._config.autoClose === 'inside' && !isMenuTarget || context._config.autoClose === 'outside' && isMenuTarget) { + if ( + composedPath.includes(context._element) || + (context._config.autoClose === "inside" && !isMenuTarget) || + (context._config.autoClose === "outside" && isMenuTarget) + ) { continue; } // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu - - if (context._menu.contains(event.target) && (event.type === 'keyup' && event.key === TAB_KEY$1 || /input|select|option|textarea|form/i.test(event.target.tagName))) { + if ( + context._menu.contains(event.target) && + ((event.type === "keyup" && event.key === TAB_KEY$1) || + /input|select|option|textarea|form/i.test(event.target.tagName)) + ) { continue; } - if (event.type === 'click') { + if (event.type === "click") { relatedTarget.clickEvent = event; } } @@ -4109,7 +4728,14 @@ // - If key is other than escape // - If key is not up or down => not a dropdown command // - If trigger inside the menu => not a dropdown command - if (/input|textarea/i.test(event.target.tagName) ? event.key === SPACE_KEY || event.key !== ESCAPE_KEY$2 && (event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY || event.target.closest(SELECTOR_MENU)) : !REGEXP_KEYDOWN.test(event.key)) { + if ( + /input|textarea/i.test(event.target.tagName) + ? event.key === SPACE_KEY || + (event.key !== ESCAPE_KEY$2 && + ((event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY) || + event.target.closest(SELECTOR_MENU))) + : !REGEXP_KEYDOWN.test(event.key) + ) { return; } @@ -4126,7 +4752,9 @@ return; } - const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0]; + const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE$3) + ? this + : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE$3)[0]; const instance = Dropdown.getOrCreateInstance(getToggleButton); if (event.key === ESCAPE_KEY$2) { @@ -4148,7 +4776,6 @@ Dropdown.clearMenus(); } } - } /** * ------------------------------------------------------------------------ @@ -4156,15 +4783,29 @@ * ------------------------------------------------------------------------ */ - - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$3, Dropdown.dataApiKeydownHandler); - EventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler); + EventHandler.on( + document, + EVENT_KEYDOWN_DATA_API, + SELECTOR_DATA_TOGGLE$3, + Dropdown.dataApiKeydownHandler + ); + EventHandler.on( + document, + EVENT_KEYDOWN_DATA_API, + SELECTOR_MENU, + Dropdown.dataApiKeydownHandler + ); EventHandler.on(document, EVENT_CLICK_DATA_API$3, Dropdown.clearMenus); EventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus); - EventHandler.on(document, EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { - event.preventDefault(); - Dropdown.getOrCreateInstance(this).toggle(); - }); + EventHandler.on( + document, + EVENT_CLICK_DATA_API$3, + SELECTOR_DATA_TOGGLE$3, + function (event) { + event.preventDefault(); + Dropdown.getOrCreateInstance(this).toggle(); + } + ); /** * ------------------------------------------------------------------------ * jQuery @@ -4180,8 +4821,9 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - const SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; - const SELECTOR_STICKY_CONTENT = '.sticky-top'; + const SELECTOR_FIXED_CONTENT = + ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top"; + const SELECTOR_STICKY_CONTENT = ".sticky-top"; class ScrollBarHelper { constructor() { @@ -4199,46 +4841,61 @@ this._disableOverFlow(); // give padding to element to balance the hidden scrollbar width + this._setElementAttributes( + this._element, + "paddingRight", + (calculatedValue) => calculatedValue + width + ); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width); // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth - - - this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width); + this._setElementAttributes( + SELECTOR_FIXED_CONTENT, + "paddingRight", + (calculatedValue) => calculatedValue + width + ); - this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width); + this._setElementAttributes( + SELECTOR_STICKY_CONTENT, + "marginRight", + (calculatedValue) => calculatedValue - width + ); } _disableOverFlow() { - this._saveInitialAttribute(this._element, 'overflow'); + this._saveInitialAttribute(this._element, "overflow"); - this._element.style.overflow = 'hidden'; + this._element.style.overflow = "hidden"; } _setElementAttributes(selector, styleProp, callback) { const scrollbarWidth = this.getWidth(); - const manipulationCallBack = element => { - if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) { + const manipulationCallBack = (element) => { + if ( + element !== this._element && + window.innerWidth > element.clientWidth + scrollbarWidth + ) { return; } this._saveInitialAttribute(element, styleProp); const calculatedValue = window.getComputedStyle(element)[styleProp]; - element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`; + element.style[styleProp] = `${callback( + Number.parseFloat(calculatedValue) + )}px`; }; this._applyManipulationCallback(selector, manipulationCallBack); } reset() { - this._resetElementAttributes(this._element, 'overflow'); + this._resetElementAttributes(this._element, "overflow"); - this._resetElementAttributes(this._element, 'paddingRight'); + this._resetElementAttributes(this._element, "paddingRight"); - this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight'); + this._resetElementAttributes(SELECTOR_FIXED_CONTENT, "paddingRight"); - this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight'); + this._resetElementAttributes(SELECTOR_STICKY_CONTENT, "marginRight"); } _saveInitialAttribute(element, styleProp) { @@ -4250,10 +4907,10 @@ } _resetElementAttributes(selector, styleProp) { - const manipulationCallBack = element => { + const manipulationCallBack = (element) => { const value = Manipulator.getDataAttribute(element, styleProp); - if (typeof value === 'undefined') { + if (typeof value === "undefined") { element.style.removeProperty(styleProp); } else { Manipulator.removeDataAttribute(element, styleProp); @@ -4275,7 +4932,6 @@ isOverflowing() { return this.getWidth() > 0; } - } /** @@ -4285,24 +4941,24 @@ * -------------------------------------------------------------------------- */ const Default$7 = { - className: 'modal-backdrop', + className: "modal-backdrop", isVisible: true, // if false, we use the backdrop helper without adding any element to the dom isAnimated: false, - rootElement: 'body', + rootElement: "body", // give the choice to place backdrop under different elements - clickCallback: null + clickCallback: null, }; const DefaultType$7 = { - className: 'string', - isVisible: 'boolean', - isAnimated: 'boolean', - rootElement: '(element|string)', - clickCallback: '(function|null)' + className: "string", + isVisible: "boolean", + isAnimated: "boolean", + rootElement: "(element|string)", + clickCallback: "(function|null)", }; - const NAME$8 = 'backdrop'; - const CLASS_NAME_FADE$4 = 'fade'; - const CLASS_NAME_SHOW$5 = 'show'; + const NAME$8 = "backdrop"; + const CLASS_NAME_FADE$4 = "fade"; + const CLASS_NAME_SHOW$5 = "show"; const EVENT_MOUSEDOWN = `mousedown.bs.${NAME$8}`; class Backdrop { @@ -4345,10 +5001,9 @@ }); } // Private - _getElement() { if (!this._element) { - const backdrop = document.createElement('div'); + const backdrop = document.createElement("div"); backdrop.className = this._config.className; if (this._config.isAnimated) { @@ -4362,9 +5017,7 @@ } _getConfig(config) { - config = { ...Default$7, - ...(typeof config === 'object' ? config : {}) - }; // use getElement() with the default "body" to get a fresh Element on each instantiation + config = { ...Default$7, ...(typeof config === "object" ? config : {}) }; // use getElement() with the default "body" to get a fresh Element on each instantiation config.rootElement = getElement(config.rootElement); typeCheckConfig(NAME$8, config, DefaultType$7); @@ -4397,9 +5050,12 @@ } _emulateAnimation(callback) { - executeAfterTransition(callback, this._getElement(), this._config.isAnimated); + executeAfterTransition( + callback, + this._getElement(), + this._config.isAnimated + ); } - } /** @@ -4411,20 +5067,20 @@ const Default$6 = { trapElement: null, // The element to trap focus inside of - autofocus: true + autofocus: true, }; const DefaultType$6 = { - trapElement: 'element', - autofocus: 'boolean' + trapElement: "element", + autofocus: "boolean", }; - const NAME$7 = 'focustrap'; - const DATA_KEY$7 = 'bs.focustrap'; + const NAME$7 = "focustrap"; + const DATA_KEY$7 = "bs.focustrap"; const EVENT_KEY$7 = `.${DATA_KEY$7}`; const EVENT_FOCUSIN$1 = `focusin${EVENT_KEY$7}`; const EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY$7}`; - const TAB_KEY = 'Tab'; - const TAB_NAV_FORWARD = 'forward'; - const TAB_NAV_BACKWARD = 'backward'; + const TAB_KEY = "Tab"; + const TAB_NAV_FORWARD = "forward"; + const TAB_NAV_BACKWARD = "backward"; class FocusTrap { constructor(config) { @@ -4434,10 +5090,7 @@ } activate() { - const { - trapElement, - autofocus - } = this._config; + const { trapElement, autofocus } = this._config; if (this._isActive) { return; @@ -4449,8 +5102,12 @@ EventHandler.off(document, EVENT_KEY$7); // guard against infinite focus loop - EventHandler.on(document, EVENT_FOCUSIN$1, event => this._handleFocusin(event)); - EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event)); + EventHandler.on(document, EVENT_FOCUSIN$1, (event) => + this._handleFocusin(event) + ); + EventHandler.on(document, EVENT_KEYDOWN_TAB, (event) => + this._handleKeydown(event) + ); this._isActive = true; } @@ -4463,16 +5120,15 @@ EventHandler.off(document, EVENT_KEY$7); } // Private - _handleFocusin(event) { - const { - target - } = event; - const { - trapElement - } = this._config; - - if (target === document || target === trapElement || trapElement.contains(target)) { + const { target } = event; + const { trapElement } = this._config; + + if ( + target === document || + target === trapElement || + trapElement.contains(target) + ) { return; } @@ -4492,17 +5148,16 @@ return; } - this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD; + this._lastTabNavDirection = event.shiftKey + ? TAB_NAV_BACKWARD + : TAB_NAV_FORWARD; } _getConfig(config) { - config = { ...Default$6, - ...(typeof config === 'object' ? config : {}) - }; + config = { ...Default$6, ...(typeof config === "object" ? config : {}) }; typeCheckConfig(NAME$7, config, DefaultType$6); return config; } - } /** @@ -4517,20 +5172,20 @@ * ------------------------------------------------------------------------ */ - const NAME$6 = 'modal'; - const DATA_KEY$6 = 'bs.modal'; + const NAME$6 = "modal"; + const DATA_KEY$6 = "bs.modal"; const EVENT_KEY$6 = `.${DATA_KEY$6}`; - const DATA_API_KEY$3 = '.data-api'; - const ESCAPE_KEY$1 = 'Escape'; + const DATA_API_KEY$3 = ".data-api"; + const ESCAPE_KEY$1 = "Escape"; const Default$5 = { backdrop: true, keyboard: true, - focus: true + focus: true, }; const DefaultType$5 = { - backdrop: '(boolean|string)', - keyboard: 'boolean', - focus: 'boolean' + backdrop: "(boolean|string)", + keyboard: "boolean", + focus: "boolean", }; const EVENT_HIDE$3 = `hide${EVENT_KEY$6}`; const EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY$6}`; @@ -4543,13 +5198,13 @@ const EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY$6}`; const EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY$6}`; const EVENT_CLICK_DATA_API$2 = `click${EVENT_KEY$6}${DATA_API_KEY$3}`; - const CLASS_NAME_OPEN = 'modal-open'; - const CLASS_NAME_FADE$3 = 'fade'; - const CLASS_NAME_SHOW$4 = 'show'; - const CLASS_NAME_STATIC = 'modal-static'; - const OPEN_SELECTOR$1 = '.modal.show'; - const SELECTOR_DIALOG = '.modal-dialog'; - const SELECTOR_MODAL_BODY = '.modal-body'; + const CLASS_NAME_OPEN = "modal-open"; + const CLASS_NAME_FADE$3 = "fade"; + const CLASS_NAME_SHOW$4 = "show"; + const CLASS_NAME_STATIC = "modal-static"; + const OPEN_SELECTOR$1 = ".modal.show"; + const SELECTOR_DIALOG = ".modal-dialog"; + const SELECTOR_MODAL_BODY = ".modal-body"; const SELECTOR_DATA_TOGGLE$2 = '[data-bs-toggle="modal"]'; /** * ------------------------------------------------------------------------ @@ -4570,7 +5225,6 @@ this._scrollBar = new ScrollBarHelper(); } // Getters - static get Default() { return Default$5; } @@ -4579,7 +5233,6 @@ return NAME$6; } // Public - toggle(relatedTarget) { return this._isShown ? this.hide() : this.show(relatedTarget); } @@ -4590,7 +5243,7 @@ } const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$3, { - relatedTarget + relatedTarget, }); if (showEvent.defaultPrevented) { @@ -4614,7 +5267,7 @@ this._setResizeEvent(); EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => { - EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => { + EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, (event) => { if (event.target === this._element) { this._ignoreBackdropClick = true; } @@ -4658,7 +5311,9 @@ } dispose() { - [window, this._dialog].forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY$6)); + [window, this._dialog].forEach((htmlElement) => + EventHandler.off(htmlElement, EVENT_KEY$6) + ); this._backdrop.dispose(); @@ -4671,25 +5326,25 @@ this._adjustDialog(); } // Private - _initializeBackDrop() { return new Backdrop({ isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value - isAnimated: this._isAnimated() + isAnimated: this._isAnimated(), }); } _initializeFocusTrap() { return new FocusTrap({ - trapElement: this._element + trapElement: this._element, }); } _getConfig(config) { - config = { ...Default$5, + config = { + ...Default$5, ...Manipulator.getDataAttributes(this._element), - ...(typeof config === 'object' ? config : {}) + ...(typeof config === "object" ? config : {}), }; typeCheckConfig(NAME$6, config, DefaultType$5); return config; @@ -4698,20 +5353,26 @@ _showElement(relatedTarget) { const isAnimated = this._isAnimated(); - const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog); + const modalBody = SelectorEngine.findOne( + SELECTOR_MODAL_BODY, + this._dialog + ); - if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { + if ( + !this._element.parentNode || + this._element.parentNode.nodeType !== Node.ELEMENT_NODE + ) { // Don't move modal's DOM position document.body.append(this._element); } - this._element.style.display = 'block'; + this._element.style.display = "block"; - this._element.removeAttribute('aria-hidden'); + this._element.removeAttribute("aria-hidden"); - this._element.setAttribute('aria-modal', true); + this._element.setAttribute("aria-modal", true); - this._element.setAttribute('role', 'dialog'); + this._element.setAttribute("role", "dialog"); this._element.scrollTop = 0; @@ -4732,7 +5393,7 @@ this._isTransitioning = false; EventHandler.trigger(this._element, EVENT_SHOWN$3, { - relatedTarget + relatedTarget, }); }; @@ -4741,7 +5402,7 @@ _setEscapeEvent() { if (this._isShown) { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, event => { + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS$1, (event) => { if (this._config.keyboard && event.key === ESCAPE_KEY$1) { event.preventDefault(); this.hide(); @@ -4763,13 +5424,13 @@ } _hideModal() { - this._element.style.display = 'none'; + this._element.style.display = "none"; - this._element.setAttribute('aria-hidden', true); + this._element.setAttribute("aria-hidden", true); - this._element.removeAttribute('aria-modal'); + this._element.removeAttribute("aria-modal"); - this._element.removeAttribute('role'); + this._element.removeAttribute("role"); this._isTransitioning = false; @@ -4785,7 +5446,7 @@ } _showBackdrop(callback) { - EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => { + EventHandler.on(this._element, EVENT_CLICK_DISMISS, (event) => { if (this._ignoreBackdropClick) { this._ignoreBackdropClick = false; return; @@ -4797,7 +5458,7 @@ if (this._config.backdrop === true) { this.hide(); - } else if (this._config.backdrop === 'static') { + } else if (this._config.backdrop === "static") { this._triggerBackdropTransition(); } }); @@ -4810,25 +5471,28 @@ } _triggerBackdropTransition() { - const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED); + const hideEvent = EventHandler.trigger( + this._element, + EVENT_HIDE_PREVENTED + ); if (hideEvent.defaultPrevented) { return; } - const { - classList, - scrollHeight, - style - } = this._element; - const isModalOverflowing = scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed + const { classList, scrollHeight, style } = this._element; + const isModalOverflowing = + scrollHeight > document.documentElement.clientHeight; // return if the following background transition hasn't yet completed - if (!isModalOverflowing && style.overflowY === 'hidden' || classList.contains(CLASS_NAME_STATIC)) { + if ( + (!isModalOverflowing && style.overflowY === "hidden") || + classList.contains(CLASS_NAME_STATIC) + ) { return; } if (!isModalOverflowing) { - style.overflowY = 'hidden'; + style.overflowY = "hidden"; } classList.add(CLASS_NAME_STATIC); @@ -4838,7 +5502,7 @@ if (!isModalOverflowing) { this._queueCallback(() => { - style.overflowY = ''; + style.overflowY = ""; }, this._dialog); } }, this._dialog); @@ -4848,45 +5512,49 @@ // the following methods are used to handle overflowing modals // ---------------------------------------------------------------------- - _adjustDialog() { - const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; + const isModalOverflowing = + this._element.scrollHeight > document.documentElement.clientHeight; const scrollbarWidth = this._scrollBar.getWidth(); const isBodyOverflowing = scrollbarWidth > 0; - if (!isBodyOverflowing && isModalOverflowing && !isRTL() || isBodyOverflowing && !isModalOverflowing && isRTL()) { + if ( + (!isBodyOverflowing && isModalOverflowing && !isRTL()) || + (isBodyOverflowing && !isModalOverflowing && isRTL()) + ) { this._element.style.paddingLeft = `${scrollbarWidth}px`; } - if (isBodyOverflowing && !isModalOverflowing && !isRTL() || !isBodyOverflowing && isModalOverflowing && isRTL()) { + if ( + (isBodyOverflowing && !isModalOverflowing && !isRTL()) || + (!isBodyOverflowing && isModalOverflowing && isRTL()) + ) { this._element.style.paddingRight = `${scrollbarWidth}px`; } } _resetAdjustments() { - this._element.style.paddingLeft = ''; - this._element.style.paddingRight = ''; + this._element.style.paddingLeft = ""; + this._element.style.paddingRight = ""; } // Static - static jQueryInterface(config, relatedTarget) { return this.each(function () { const data = Modal.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + if (typeof config !== "string") { return; } - if (typeof data[config] === 'undefined') { + if (typeof data[config] === "undefined") { throw new TypeError(`No method named "${config}"`); } data[config](relatedTarget); }); } - } /** * ------------------------------------------------------------------------ @@ -4894,36 +5562,40 @@ * ------------------------------------------------------------------------ */ + EventHandler.on( + document, + EVENT_CLICK_DATA_API$2, + SELECTOR_DATA_TOGGLE$2, + function (event) { + const target = getElementFromSelector(this); - EventHandler.on(document, EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { - const target = getElementFromSelector(this); - - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } - - EventHandler.one(target, EVENT_SHOW$3, showEvent => { - if (showEvent.defaultPrevented) { - // only register focus restorer if modal will actually get shown - return; + if (["A", "AREA"].includes(this.tagName)) { + event.preventDefault(); } - EventHandler.one(target, EVENT_HIDDEN$3, () => { - if (isVisible(this)) { - this.focus(); + EventHandler.one(target, EVENT_SHOW$3, (showEvent) => { + if (showEvent.defaultPrevented) { + // only register focus restorer if modal will actually get shown + return; } - }); - }); // avoid conflict when clicking moddal toggler while another one is open - const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); + EventHandler.one(target, EVENT_HIDDEN$3, () => { + if (isVisible(this)) { + this.focus(); + } + }); + }); // avoid conflict when clicking moddal toggler while another one is open + + const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR$1); - if (allReadyOpen) { - Modal.getInstance(allReadyOpen).hide(); - } + if (allReadyOpen) { + Modal.getInstance(allReadyOpen).hide(); + } - const data = Modal.getOrCreateInstance(target); - data.toggle(this); - }); + const data = Modal.getOrCreateInstance(target); + data.toggle(this); + } + ); enableDismissTrigger(Modal); /** * ------------------------------------------------------------------------ @@ -4946,25 +5618,25 @@ * ------------------------------------------------------------------------ */ - const NAME$5 = 'offcanvas'; - const DATA_KEY$5 = 'bs.offcanvas'; + const NAME$5 = "offcanvas"; + const DATA_KEY$5 = "bs.offcanvas"; const EVENT_KEY$5 = `.${DATA_KEY$5}`; - const DATA_API_KEY$2 = '.data-api'; + const DATA_API_KEY$2 = ".data-api"; const EVENT_LOAD_DATA_API$1 = `load${EVENT_KEY$5}${DATA_API_KEY$2}`; - const ESCAPE_KEY = 'Escape'; + const ESCAPE_KEY = "Escape"; const Default$4 = { backdrop: true, keyboard: true, - scroll: false + scroll: false, }; const DefaultType$4 = { - backdrop: 'boolean', - keyboard: 'boolean', - scroll: 'boolean' + backdrop: "boolean", + keyboard: "boolean", + scroll: "boolean", }; - const CLASS_NAME_SHOW$3 = 'show'; - const CLASS_NAME_BACKDROP = 'offcanvas-backdrop'; - const OPEN_SELECTOR = '.offcanvas.show'; + const CLASS_NAME_SHOW$3 = "show"; + const CLASS_NAME_BACKDROP = "offcanvas-backdrop"; + const OPEN_SELECTOR = ".offcanvas.show"; const EVENT_SHOW$2 = `show${EVENT_KEY$5}`; const EVENT_SHOWN$2 = `shown${EVENT_KEY$5}`; const EVENT_HIDE$2 = `hide${EVENT_KEY$5}`; @@ -4989,7 +5661,6 @@ this._addEventListeners(); } // Getters - static get NAME() { return NAME$5; } @@ -4998,7 +5669,6 @@ return Default$4; } // Public - toggle(relatedTarget) { return this._isShown ? this.hide() : this.show(relatedTarget); } @@ -5009,7 +5679,7 @@ } const showEvent = EventHandler.trigger(this._element, EVENT_SHOW$2, { - relatedTarget + relatedTarget, }); if (showEvent.defaultPrevented) { @@ -5017,7 +5687,7 @@ } this._isShown = true; - this._element.style.visibility = 'visible'; + this._element.style.visibility = "visible"; this._backdrop.show(); @@ -5025,11 +5695,11 @@ new ScrollBarHelper().hide(); } - this._element.removeAttribute('aria-hidden'); + this._element.removeAttribute("aria-hidden"); - this._element.setAttribute('aria-modal', true); + this._element.setAttribute("aria-modal", true); - this._element.setAttribute('role', 'dialog'); + this._element.setAttribute("role", "dialog"); this._element.classList.add(CLASS_NAME_SHOW$3); @@ -5039,7 +5709,7 @@ } EventHandler.trigger(this._element, EVENT_SHOWN$2, { - relatedTarget + relatedTarget, }); }; @@ -5068,13 +5738,13 @@ this._backdrop.hide(); const completeCallback = () => { - this._element.setAttribute('aria-hidden', true); + this._element.setAttribute("aria-hidden", true); - this._element.removeAttribute('aria-modal'); + this._element.removeAttribute("aria-modal"); - this._element.removeAttribute('role'); + this._element.removeAttribute("role"); - this._element.style.visibility = 'hidden'; + this._element.style.visibility = "hidden"; if (!this._config.scroll) { new ScrollBarHelper().reset(); @@ -5094,11 +5764,11 @@ super.dispose(); } // Private - _getConfig(config) { - config = { ...Default$4, + config = { + ...Default$4, ...Manipulator.getDataAttributes(this._element), - ...(typeof config === 'object' ? config : {}) + ...(typeof config === "object" ? config : {}), }; typeCheckConfig(NAME$5, config, DefaultType$4); return config; @@ -5110,41 +5780,43 @@ isVisible: this._config.backdrop, isAnimated: true, rootElement: this._element.parentNode, - clickCallback: () => this.hide() + clickCallback: () => this.hide(), }); } _initializeFocusTrap() { return new FocusTrap({ - trapElement: this._element + trapElement: this._element, }); } _addEventListeners() { - EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => { + EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, (event) => { if (this._config.keyboard && event.key === ESCAPE_KEY) { this.hide(); } }); } // Static - static jQueryInterface(config) { return this.each(function () { const data = Offcanvas.getOrCreateInstance(this, config); - if (typeof config !== 'string') { + if (typeof config !== "string") { return; } - if (data[config] === undefined || config.startsWith('_') || config === 'constructor') { + if ( + data[config] === undefined || + config.startsWith("_") || + config === "constructor" + ) { throw new TypeError(`No method named "${config}"`); } data[config](this); }); } - } /** * ------------------------------------------------------------------------ @@ -5152,35 +5824,43 @@ * ------------------------------------------------------------------------ */ + EventHandler.on( + document, + EVENT_CLICK_DATA_API$1, + SELECTOR_DATA_TOGGLE$1, + function (event) { + const target = getElementFromSelector(this); - EventHandler.on(document, EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { - const target = getElementFromSelector(this); + if (["A", "AREA"].includes(this.tagName)) { + event.preventDefault(); + } - if (['A', 'AREA'].includes(this.tagName)) { - event.preventDefault(); - } + if (isDisabled(this)) { + return; + } - if (isDisabled(this)) { - return; - } + EventHandler.one(target, EVENT_HIDDEN$2, () => { + // focus on trigger when it is closed + if (isVisible(this)) { + this.focus(); + } + }); // avoid conflict when clicking a toggler of an offcanvas, while another is open - EventHandler.one(target, EVENT_HIDDEN$2, () => { - // focus on trigger when it is closed - if (isVisible(this)) { - this.focus(); - } - }); // avoid conflict when clicking a toggler of an offcanvas, while another is open + const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); - const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR); + if (allReadyOpen && allReadyOpen !== target) { + Offcanvas.getInstance(allReadyOpen).hide(); + } - if (allReadyOpen && allReadyOpen !== target) { - Offcanvas.getInstance(allReadyOpen).hide(); + const data = Offcanvas.getOrCreateInstance(target); + data.toggle(this); } - - const data = Offcanvas.getOrCreateInstance(target); - data.toggle(this); - }); - EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show())); + ); + EventHandler.on(window, EVENT_LOAD_DATA_API$1, () => + SelectorEngine.find(OPEN_SELECTOR).forEach((el) => + Offcanvas.getOrCreateInstance(el).show() + ) + ); enableDismissTrigger(Offcanvas); /** * ------------------------------------------------------------------------ @@ -5196,7 +5876,16 @@ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) * -------------------------------------------------------------------------- */ - const uriAttributes = new Set(['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']); + const uriAttributes = new Set([ + "background", + "cite", + "href", + "itemtype", + "longdesc", + "poster", + "src", + "xlink:href", + ]); const ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; /** * A pattern that recognizes a commonly useful subset of URLs that are safe. @@ -5204,27 +5893,34 @@ * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts */ - const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; + const SAFE_URL_PATTERN = + /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; /** * A pattern that matches safe data URLs. Only matches image, video and audio types. * * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts */ - const DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; + const DATA_URL_PATTERN = + /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; const allowedAttribute = (attribute, allowedAttributeList) => { const attributeName = attribute.nodeName.toLowerCase(); if (allowedAttributeList.includes(attributeName)) { if (uriAttributes.has(attributeName)) { - return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue)); + return Boolean( + SAFE_URL_PATTERN.test(attribute.nodeValue) || + DATA_URL_PATTERN.test(attribute.nodeValue) + ); } return true; } - const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp); // Check if a regular expression validates the attribute. + const regExp = allowedAttributeList.filter( + (attributeRegex) => attributeRegex instanceof RegExp + ); // Check if a regular expression validates the attribute. for (let i = 0, len = regExp.length; i < len; i++) { if (regExp[i].test(attributeName)) { @@ -5237,8 +5933,8 @@ const DefaultAllowlist = { // Global attributes allowed on any supplied element below. - '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], - a: ['target', 'href', 'title', 'rel'], + "*": ["class", "dir", "id", "lang", "role", ARIA_ATTRIBUTE_PATTERN], + a: ["target", "href", "title", "rel"], area: [], b: [], br: [], @@ -5254,7 +5950,7 @@ h5: [], h6: [], i: [], - img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], + img: ["src", "srcset", "alt", "title", "width", "height"], li: [], ol: [], p: [], @@ -5266,20 +5962,20 @@ sup: [], strong: [], u: [], - ul: [] + ul: [], }; function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) { if (!unsafeHtml.length) { return unsafeHtml; } - if (sanitizeFn && typeof sanitizeFn === 'function') { + if (sanitizeFn && typeof sanitizeFn === "function") { return sanitizeFn(unsafeHtml); } const domParser = new window.DOMParser(); - const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); - const elements = [].concat(...createdDocument.body.querySelectorAll('*')); + const createdDocument = domParser.parseFromString(unsafeHtml, "text/html"); + const elements = [].concat(...createdDocument.body.querySelectorAll("*")); for (let i = 0, len = elements.length; i < len; i++) { const element = elements[i]; @@ -5291,8 +5987,11 @@ } const attributeList = [].concat(...element.attributes); - const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || []); - attributeList.forEach(attribute => { + const allowedAttributes = [].concat( + allowList["*"] || [], + allowList[elementName] || [] + ); + attributeList.forEach((attribute) => { if (!allowedAttribute(attribute, allowedAttributes)) { element.removeAttribute(attribute.nodeName); } @@ -5314,55 +6013,63 @@ * ------------------------------------------------------------------------ */ - const NAME$4 = 'tooltip'; - const DATA_KEY$4 = 'bs.tooltip'; + const NAME$4 = "tooltip"; + const DATA_KEY$4 = "bs.tooltip"; const EVENT_KEY$4 = `.${DATA_KEY$4}`; - const CLASS_PREFIX$1 = 'bs-tooltip'; - const DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn']); + const CLASS_PREFIX$1 = "bs-tooltip"; + const DISALLOWED_ATTRIBUTES = new Set([ + "sanitize", + "allowList", + "sanitizeFn", + ]); const DefaultType$3 = { - 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)' + 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)", }; const AttachmentMap = { - AUTO: 'auto', - TOP: 'top', - RIGHT: isRTL() ? 'left' : 'right', - BOTTOM: 'bottom', - LEFT: isRTL() ? 'right' : 'left' + AUTO: "auto", + TOP: "top", + RIGHT: isRTL() ? "left" : "right", + BOTTOM: "bottom", + LEFT: isRTL() ? "right" : "left", }; const Default$3 = { animation: true, - template: '

', - trigger: 'hover focus', - title: '', + template: + '", + trigger: "hover focus", + title: "", delay: 0, html: false, selector: false, - placement: 'top', + placement: "top", offset: [0, 0], container: false, - fallbackPlacements: ['top', 'right', 'bottom', 'left'], - boundary: 'clippingParents', - customClass: '', + fallbackPlacements: ["top", "right", "bottom", "left"], + boundary: "clippingParents", + customClass: "", sanitize: true, sanitizeFn: null, allowList: DefaultAllowlist, - popperConfig: null + popperConfig: null, }; const Event$2 = { HIDE: `hide${EVENT_KEY$4}`, @@ -5374,20 +6081,20 @@ FOCUSIN: `focusin${EVENT_KEY$4}`, FOCUSOUT: `focusout${EVENT_KEY$4}`, MOUSEENTER: `mouseenter${EVENT_KEY$4}`, - MOUSELEAVE: `mouseleave${EVENT_KEY$4}` + MOUSELEAVE: `mouseleave${EVENT_KEY$4}`, }; - const CLASS_NAME_FADE$2 = 'fade'; - const CLASS_NAME_MODAL = 'modal'; - const CLASS_NAME_SHOW$2 = 'show'; - const HOVER_STATE_SHOW = 'show'; - const HOVER_STATE_OUT = 'out'; - const SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; + const CLASS_NAME_FADE$2 = "fade"; + const CLASS_NAME_MODAL = "modal"; + const CLASS_NAME_SHOW$2 = "show"; + const HOVER_STATE_SHOW = "show"; + const HOVER_STATE_OUT = "out"; + const SELECTOR_TOOLTIP_INNER = ".tooltip-inner"; const SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`; - const EVENT_MODAL_HIDE = 'hide.bs.modal'; - const TRIGGER_HOVER = 'hover'; - const TRIGGER_FOCUS = 'focus'; - const TRIGGER_CLICK = 'click'; - const TRIGGER_MANUAL = 'manual'; + const EVENT_MODAL_HIDE = "hide.bs.modal"; + const TRIGGER_HOVER = "hover"; + const TRIGGER_FOCUS = "focus"; + const TRIGGER_CLICK = "click"; + const TRIGGER_MANUAL = "manual"; /** * ------------------------------------------------------------------------ * Class Definition @@ -5396,15 +6103,17 @@ class Tooltip extends BaseComponent { constructor(element, config) { - if (typeof Popper === 'undefined') { - throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); + if (typeof Popper === "undefined") { + throw new TypeError( + "Bootstrap's tooltips require Popper (https://popper.js.org)" + ); } super(element); // private this._isEnabled = true; this._timeout = 0; - this._hoverState = ''; + this._hoverState = ""; this._activeTrigger = {}; this._popper = null; // Protected @@ -5414,7 +6123,6 @@ this._setListeners(); } // Getters - static get Default() { return Default$3; } @@ -5431,7 +6139,6 @@ return DefaultType$3; } // Public - enable() { this._isEnabled = true; } @@ -5472,7 +6179,11 @@ dispose() { clearTimeout(this._timeout); - EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + EventHandler.off( + this._element.closest(SELECTOR_MODAL), + EVENT_MODAL_HIDE, + this._hideModalHandler + ); if (this.tip) { this.tip.remove(); @@ -5484,25 +6195,35 @@ } show() { - if (this._element.style.display === 'none') { - throw new Error('Please use show on visible elements'); + if (this._element.style.display === "none") { + throw new Error("Please use show on visible elements"); } if (!(this.isWithContent() && this._isEnabled)) { return; } - const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW); + const showEvent = EventHandler.trigger( + this._element, + this.constructor.Event.SHOW + ); const shadowRoot = findShadowRoot(this._element); - const isInTheDom = shadowRoot === null ? this._element.ownerDocument.documentElement.contains(this._element) : shadowRoot.contains(this._element); + const isInTheDom = + shadowRoot === null + ? this._element.ownerDocument.documentElement.contains(this._element) + : shadowRoot.contains(this._element); if (showEvent.defaultPrevented || !isInTheDom) { return; } // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title` // This will be removed later in favor of a `setContent` method - - if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) { + if ( + this.constructor.NAME === "tooltip" && + this.tip && + this.getTitle() !== + this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML + ) { this._disposePopper(); this.tip.remove(); @@ -5511,23 +6232,24 @@ const tip = this.getTipElement(); const tipId = getUID(this.constructor.NAME); - tip.setAttribute('id', tipId); + tip.setAttribute("id", tipId); - this._element.setAttribute('aria-describedby', tipId); + this._element.setAttribute("aria-describedby", tipId); if (this._config.animation) { tip.classList.add(CLASS_NAME_FADE$2); } - const placement = typeof this._config.placement === 'function' ? this._config.placement.call(this, tip, this._element) : this._config.placement; + const placement = + typeof this._config.placement === "function" + ? this._config.placement.call(this, tip, this._element) + : this._config.placement; const attachment = this._getAttachment(placement); this._addAttachmentClass(attachment); - const { - container - } = this._config; + const { container } = this._config; Data.set(tip, this.constructor.DATA_KEY, this); if (!this._element.ownerDocument.documentElement.contains(this.tip)) { @@ -5538,24 +6260,29 @@ if (this._popper) { this._popper.update(); } else { - this._popper = createPopper(this._element, tip, this._getPopperConfig(attachment)); + this._popper = createPopper( + this._element, + tip, + this._getPopperConfig(attachment) + ); } tip.classList.add(CLASS_NAME_SHOW$2); - const customClass = this._resolvePossibleFunction(this._config.customClass); + const customClass = this._resolvePossibleFunction( + this._config.customClass + ); if (customClass) { - tip.classList.add(...customClass.split(' ')); + tip.classList.add(...customClass.split(" ")); } // If this is a touch-enabled device we add extra // empty mouseover listeners to the body's immediate children; // only needed because of broken event delegation on iOS // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html - - if ('ontouchstart' in document.documentElement) { - [].concat(...document.body.children).forEach(element => { - EventHandler.on(element, 'mouseover', noop); + if ("ontouchstart" in document.documentElement) { + [].concat(...document.body.children).forEach((element) => { + EventHandler.on(element, "mouseover", noop); }); } @@ -5592,14 +6319,17 @@ this._cleanTipClass(); - this._element.removeAttribute('aria-describedby'); + this._element.removeAttribute("aria-describedby"); EventHandler.trigger(this._element, this.constructor.Event.HIDDEN); this._disposePopper(); }; - const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE); + const hideEvent = EventHandler.trigger( + this._element, + this.constructor.Event.HIDE + ); if (hideEvent.defaultPrevented) { return; @@ -5608,8 +6338,10 @@ tip.classList.remove(CLASS_NAME_SHOW$2); // If this is a touch-enabled device we remove the extra // empty mouseover listeners we added for iOS support - if ('ontouchstart' in document.documentElement) { - [].concat(...document.body.children).forEach(element => EventHandler.off(element, 'mouseover', noop)); + if ("ontouchstart" in document.documentElement) { + [] + .concat(...document.body.children) + .forEach((element) => EventHandler.off(element, "mouseover", noop)); } this._activeTrigger[TRIGGER_CLICK] = false; @@ -5619,7 +6351,7 @@ this._queueCallback(complete, this.tip, isAnimated); - this._hoverState = ''; + this._hoverState = ""; } update() { @@ -5628,7 +6360,6 @@ } } // Protected - isWithContent() { return Boolean(this.getTitle()); } @@ -5638,7 +6369,7 @@ return this.tip; } - const element = document.createElement('div'); + const element = document.createElement("div"); element.innerHTML = this._config.template; const tip = element.children[0]; this.setContent(tip); @@ -5659,7 +6390,6 @@ return; } // we use append for html objects to maintain js events - this.setElementContent(templateElement, content); } @@ -5673,7 +6403,7 @@ if (this._config.html) { if (content.parentNode !== element) { - element.innerHTML = ''; + element.innerHTML = ""; element.append(content); } } else { @@ -5685,7 +6415,11 @@ if (this._config.html) { if (this._config.sanitize) { - content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn); + content = sanitizeHtml( + content, + this._config.allowList, + this._config.sanitizeFn + ); } element.innerHTML = content; @@ -5695,90 +6429,108 @@ } getTitle() { - const title = this._element.getAttribute('data-bs-original-title') || this._config.title; + const title = + this._element.getAttribute("data-bs-original-title") || + this._config.title; return this._resolvePossibleFunction(title); } updateAttachment(attachment) { - if (attachment === 'right') { - return 'end'; + if (attachment === "right") { + return "end"; } - if (attachment === 'left') { - return 'start'; + if (attachment === "left") { + return "start"; } return attachment; } // Private - _initializeOnDelegatedTarget(event, context) { - return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()); + return ( + context || + this.constructor.getOrCreateInstance( + event.delegateTarget, + this._getDelegateConfig() + ) + ); } _getOffset() { - const { - offset - } = this._config; + const { offset } = this._config; - if (typeof offset === 'string') { - return offset.split(',').map(val => Number.parseInt(val, 10)); + if (typeof offset === "string") { + return offset.split(",").map((val) => Number.parseInt(val, 10)); } - if (typeof offset === 'function') { - return popperData => offset(popperData, this._element); + if (typeof offset === "function") { + return (popperData) => offset(popperData, this._element); } return offset; } _resolvePossibleFunction(content) { - return typeof content === 'function' ? content.call(this._element) : content; + return typeof content === "function" + ? content.call(this._element) + : content; } _getPopperConfig(attachment) { const defaultBsPopperConfig = { placement: attachment, - modifiers: [{ - name: 'flip', - options: { - fallbackPlacements: this._config.fallbackPlacements - } - }, { - name: 'offset', - options: { - offset: this._getOffset() - } - }, { - name: 'preventOverflow', - options: { - boundary: this._config.boundary - } - }, { - name: 'arrow', - options: { - element: `.${this.constructor.NAME}-arrow` - } - }, { - name: 'onChange', - enabled: true, - phase: 'afterWrite', - fn: data => this._handlePopperPlacementChange(data) - }], - onFirstUpdate: data => { + 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: true, + phase: "afterWrite", + fn: (data) => this._handlePopperPlacementChange(data), + }, + ], + onFirstUpdate: (data) => { if (data.options.placement !== data.placement) { this._handlePopperPlacementChange(data); } - } + }, }; - return { ...defaultBsPopperConfig, - ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig) + return { + ...defaultBsPopperConfig, + ...(typeof this._config.popperConfig === "function" + ? this._config.popperConfig(defaultBsPopperConfig) + : this._config.popperConfig), }; } _addAttachmentClass(attachment) { - this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`); + this.getTipElement().classList.add( + `${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}` + ); } _getAttachment(placement) { @@ -5786,16 +6538,37 @@ } _setListeners() { - const triggers = this._config.trigger.split(' '); - - triggers.forEach(trigger => { - if (trigger === 'click') { - EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event)); + const triggers = this._config.trigger.split(" "); + + triggers.forEach((trigger) => { + if (trigger === "click") { + EventHandler.on( + this._element, + this.constructor.Event.CLICK, + this._config.selector, + (event) => this.toggle(event) + ); } else if (trigger !== TRIGGER_MANUAL) { - const eventIn = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSEENTER : this.constructor.Event.FOCUSIN; - const eventOut = trigger === TRIGGER_HOVER ? this.constructor.Event.MOUSELEAVE : this.constructor.Event.FOCUSOUT; - EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event)); - EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event)); + const eventIn = + trigger === TRIGGER_HOVER + ? this.constructor.Event.MOUSEENTER + : this.constructor.Event.FOCUSIN; + const eventOut = + trigger === TRIGGER_HOVER + ? this.constructor.Event.MOUSELEAVE + : this.constructor.Event.FOCUSOUT; + EventHandler.on( + this._element, + eventIn, + this._config.selector, + (event) => this._enter(event) + ); + EventHandler.on( + this._element, + eventOut, + this._config.selector, + (event) => this._leave(event) + ); } }); @@ -5805,31 +6578,38 @@ } }; - EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler); + EventHandler.on( + this._element.closest(SELECTOR_MODAL), + EVENT_MODAL_HIDE, + this._hideModalHandler + ); if (this._config.selector) { - this._config = { ...this._config, - trigger: 'manual', - selector: '' - }; + this._config = { ...this._config, trigger: "manual", selector: "" }; } else { this._fixTitle(); } } _fixTitle() { - const title = this._element.getAttribute('title'); + const title = this._element.getAttribute("title"); - const originalTitleType = typeof this._element.getAttribute('data-bs-original-title'); + const originalTitleType = typeof this._element.getAttribute( + "data-bs-original-title" + ); - if (title || originalTitleType !== 'string') { - this._element.setAttribute('data-bs-original-title', title || ''); + if (title || originalTitleType !== "string") { + this._element.setAttribute("data-bs-original-title", title || ""); - if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) { - this._element.setAttribute('aria-label', title); + if ( + title && + !this._element.getAttribute("aria-label") && + !this._element.textContent + ) { + this._element.setAttribute("aria-label", title); } - this._element.setAttribute('title', ''); + this._element.setAttribute("title", ""); } } @@ -5837,10 +6617,15 @@ context = this._initializeOnDelegatedTarget(event, context); if (event) { - context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; + context._activeTrigger[ + event.type === "focusin" ? TRIGGER_FOCUS : TRIGGER_HOVER + ] = true; } - if (context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || context._hoverState === HOVER_STATE_SHOW) { + if ( + context.getTipElement().classList.contains(CLASS_NAME_SHOW$2) || + context._hoverState === HOVER_STATE_SHOW + ) { context._hoverState = HOVER_STATE_SHOW; return; } @@ -5864,7 +6649,9 @@ context = this._initializeOnDelegatedTarget(event, context); if (event) { - context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = context._element.contains(event.relatedTarget); + context._activeTrigger[ + event.type === "focusout" ? TRIGGER_FOCUS : TRIGGER_HOVER + ] = context._element.contains(event.relatedTarget); } if (context._isWithActiveTrigger()) { @@ -5898,36 +6685,44 @@ _getConfig(config) { const dataAttributes = Manipulator.getDataAttributes(this._element); - Object.keys(dataAttributes).forEach(dataAttr => { + Object.keys(dataAttributes).forEach((dataAttr) => { if (DISALLOWED_ATTRIBUTES.has(dataAttr)) { delete dataAttributes[dataAttr]; } }); - config = { ...this.constructor.Default, + config = { + ...this.constructor.Default, ...dataAttributes, - ...(typeof config === 'object' && config ? config : {}) + ...(typeof config === "object" && config ? config : {}), }; - config.container = config.container === false ? document.body : getElement(config.container); + config.container = + config.container === false + ? document.body + : getElement(config.container); - if (typeof config.delay === 'number') { + if (typeof config.delay === "number") { config.delay = { show: config.delay, - hide: config.delay + hide: config.delay, }; } - if (typeof config.title === 'number') { + if (typeof config.title === "number") { config.title = config.title.toString(); } - if (typeof config.content === 'number') { + if (typeof config.content === "number") { config.content = config.content.toString(); } typeCheckConfig(NAME$4, config, this.constructor.DefaultType); if (config.sanitize) { - config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn); + config.template = sanitizeHtml( + config.template, + config.allowList, + config.sanitizeFn + ); } return config; @@ -5944,17 +6739,21 @@ // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]]) // `Object.fromEntries(keysWithDifferentValues)` - return config; } _cleanTipClass() { const tip = this.getTipElement(); - const basicClassPrefixRegex = new RegExp(`(^|\\s)${this._getBasicClassPrefix()}\\S+`, 'g'); - const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex); + const basicClassPrefixRegex = new RegExp( + `(^|\\s)${this._getBasicClassPrefix()}\\S+`, + "g" + ); + const tabClass = tip.getAttribute("class").match(basicClassPrefixRegex); if (tabClass !== null && tabClass.length > 0) { - tabClass.map(token => token.trim()).forEach(tClass => tip.classList.remove(tClass)); + tabClass + .map((token) => token.trim()) + .forEach((tClass) => tip.classList.remove(tClass)); } } @@ -5963,9 +6762,7 @@ } _handlePopperPlacementChange(popperData) { - const { - state - } = popperData; + const { state } = popperData; if (!state) { return; @@ -5986,13 +6783,12 @@ } } // Static - static jQueryInterface(config) { return this.each(function () { const data = Tooltip.getOrCreateInstance(this, config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { + if (typeof config === "string") { + if (typeof data[config] === "undefined") { throw new TypeError(`No method named "${config}"`); } @@ -6000,7 +6796,6 @@ } }); } - } /** * ------------------------------------------------------------------------ @@ -6009,7 +6804,6 @@ * add .Tooltip to jQuery only if jQuery is present */ - defineJQueryPlugin(Tooltip); /** @@ -6024,19 +6818,26 @@ * ------------------------------------------------------------------------ */ - const NAME$3 = 'popover'; - const DATA_KEY$3 = 'bs.popover'; + const NAME$3 = "popover"; + const DATA_KEY$3 = "bs.popover"; const EVENT_KEY$3 = `.${DATA_KEY$3}`; - const CLASS_PREFIX = 'bs-popover'; - const Default$2 = { ...Tooltip.Default, - placement: 'right', + const CLASS_PREFIX = "bs-popover"; + const Default$2 = { + ...Tooltip.Default, + placement: "right", offset: [0, 8], - trigger: 'click', - content: '', - template: '' + trigger: "click", + content: "", + template: + '", }; - const DefaultType$2 = { ...Tooltip.DefaultType, - content: '(string|element|function)' + const DefaultType$2 = { + ...Tooltip.DefaultType, + content: "(string|element|function)", }; const Event$1 = { HIDE: `hide${EVENT_KEY$3}`, @@ -6048,10 +6849,10 @@ FOCUSIN: `focusin${EVENT_KEY$3}`, FOCUSOUT: `focusout${EVENT_KEY$3}`, MOUSEENTER: `mouseenter${EVENT_KEY$3}`, - MOUSELEAVE: `mouseleave${EVENT_KEY$3}` + MOUSELEAVE: `mouseleave${EVENT_KEY$3}`, }; - const SELECTOR_TITLE = '.popover-header'; - const SELECTOR_CONTENT = '.popover-body'; + const SELECTOR_TITLE = ".popover-header"; + const SELECTOR_CONTENT = ".popover-body"; /** * ------------------------------------------------------------------------ * Class Definition @@ -6076,7 +6877,6 @@ return DefaultType$2; } // Overrides - isWithContent() { return this.getTitle() || this._getContent(); } @@ -6087,7 +6887,6 @@ this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT); } // Private - _getContent() { return this._resolvePossibleFunction(this._config.content); } @@ -6096,13 +6895,12 @@ return CLASS_PREFIX; } // Static - static jQueryInterface(config) { return this.each(function () { const data = Popover.getOrCreateInstance(this, config); - if (typeof config === 'string') { - if (typeof data[config] === 'undefined') { + if (typeof config === "string") { + if (typeof data[config] === "undefined") { throw new TypeError(`No method named "${config}"`); } @@ -6110,7 +6908,6 @@ } }); } - } /** * ------------------------------------------------------------------------ @@ -6119,7 +6916,6 @@ * add .Popover to jQuery only if jQuery is present */ - defineJQueryPlugin(Popover); /** @@ -6134,35 +6930,35 @@ * ------------------------------------------------------------------------ */ - const NAME$2 = 'scrollspy'; - const DATA_KEY$2 = 'bs.scrollspy'; + const NAME$2 = "scrollspy"; + const DATA_KEY$2 = "bs.scrollspy"; const EVENT_KEY$2 = `.${DATA_KEY$2}`; - const DATA_API_KEY$1 = '.data-api'; + const DATA_API_KEY$1 = ".data-api"; const Default$1 = { offset: 10, - method: 'auto', - target: '' + method: "auto", + target: "", }; const DefaultType$1 = { - offset: 'number', - method: 'string', - target: '(string|element)' + offset: "number", + method: "string", + target: "(string|element)", }; const EVENT_ACTIVATE = `activate${EVENT_KEY$2}`; const EVENT_SCROLL = `scroll${EVENT_KEY$2}`; const EVENT_LOAD_DATA_API = `load${EVENT_KEY$2}${DATA_API_KEY$1}`; - const CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; - const CLASS_NAME_ACTIVE$1 = 'active'; + const CLASS_NAME_DROPDOWN_ITEM = "dropdown-item"; + const CLASS_NAME_ACTIVE$1 = "active"; const SELECTOR_DATA_SPY = '[data-bs-spy="scroll"]'; - const SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; - const SELECTOR_NAV_LINKS = '.nav-link'; - const SELECTOR_NAV_ITEMS = '.nav-item'; - const SELECTOR_LIST_ITEMS = '.list-group-item'; + const SELECTOR_NAV_LIST_GROUP$1 = ".nav, .list-group"; + const SELECTOR_NAV_LINKS = ".nav-link"; + const SELECTOR_NAV_ITEMS = ".nav-item"; + const SELECTOR_LIST_ITEMS = ".list-group-item"; const SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`; - const SELECTOR_DROPDOWN$1 = '.dropdown'; - const SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; - const METHOD_OFFSET = 'offset'; - const METHOD_POSITION = 'position'; + const SELECTOR_DROPDOWN$1 = ".dropdown"; + const SELECTOR_DROPDOWN_TOGGLE$1 = ".dropdown-toggle"; + const METHOD_OFFSET = "offset"; + const METHOD_POSITION = "position"; /** * ------------------------------------------------------------------------ * Class Definition @@ -6172,7 +6968,8 @@ class ScrollSpy extends BaseComponent { constructor(element, config) { super(element); - this._scrollElement = this._element.tagName === 'BODY' ? window : this._element; + this._scrollElement = + this._element.tagName === "BODY" ? window : this._element; this._config = this._getConfig(config); this._offsets = []; this._targets = []; @@ -6184,7 +6981,6 @@ this._process(); } // Getters - static get Default() { return Default$1; } @@ -6193,33 +6989,49 @@ return NAME$2; } // Public - refresh() { - const autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; - const offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; - const offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; + const autoMethod = + this._scrollElement === this._scrollElement.window + ? METHOD_OFFSET + : METHOD_POSITION; + const offsetMethod = + this._config.method === "auto" ? autoMethod : this._config.method; + const offsetBase = + offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; this._offsets = []; this._targets = []; this._scrollHeight = this._getScrollHeight(); - const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target); - targets.map(element => { - const targetSelector = getSelectorFromElement(element); - const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null; - - if (target) { - const targetBCR = target.getBoundingClientRect(); - - if (targetBCR.width || targetBCR.height) { - return [Manipulator[offsetMethod](target).top + offsetBase, targetSelector]; + const targets = SelectorEngine.find( + SELECTOR_LINK_ITEMS, + this._config.target + ); + targets + .map((element) => { + const targetSelector = getSelectorFromElement(element); + const target = targetSelector + ? SelectorEngine.findOne(targetSelector) + : null; + + if (target) { + const targetBCR = target.getBoundingClientRect(); + + if (targetBCR.width || targetBCR.height) { + return [ + Manipulator[offsetMethod](target).top + offsetBase, + targetSelector, + ]; + } } - } - return null; - }).filter(item => item).sort((a, b) => a[0] - b[0]).forEach(item => { - this._offsets.push(item[0]); + return null; + }) + .filter((item) => item) + .sort((a, b) => a[0] - b[0]) + .forEach((item) => { + this._offsets.push(item[0]); - this._targets.push(item[1]); - }); + this._targets.push(item[1]); + }); } dispose() { @@ -6227,11 +7039,11 @@ super.dispose(); } // Private - _getConfig(config) { - config = { ...Default$1, + config = { + ...Default$1, ...Manipulator.getDataAttributes(this._element), - ...(typeof config === 'object' && config ? config : {}) + ...(typeof config === "object" && config ? config : {}), }; config.target = getElement(config.target) || document.documentElement; typeCheckConfig(NAME$2, config, DefaultType$1); @@ -6239,15 +7051,25 @@ } _getScrollTop() { - return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; + return this._scrollElement === window + ? this._scrollElement.pageYOffset + : this._scrollElement.scrollTop; } _getScrollHeight() { - return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); + return ( + this._scrollElement.scrollHeight || + Math.max( + document.body.scrollHeight, + document.documentElement.scrollHeight + ) + ); } _getOffsetHeight() { - return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; + return this._scrollElement === window + ? window.innerHeight + : this._scrollElement.getBoundingClientRect().height; } _process() { @@ -6255,7 +7077,8 @@ const scrollHeight = this._getScrollHeight(); - const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); + const maxScroll = + this._config.offset + scrollHeight - this._getOffsetHeight(); if (this._scrollHeight !== scrollHeight) { this.refresh(); @@ -6271,7 +7094,11 @@ return; } - if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { + if ( + this._activeTarget && + scrollTop < this._offsets[0] && + this._offsets[0] > 0 + ) { this._activeTarget = null; this._clear(); @@ -6279,8 +7106,12 @@ return; } - for (let i = this._offsets.length; i--;) { - const isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); + for (let i = this._offsets.length; i--; ) { + const isActiveTarget = + this._activeTarget !== this._targets[i] && + scrollTop >= this._offsets[i] && + (typeof this._offsets[i + 1] === "undefined" || + scrollTop < this._offsets[i + 1]); if (isActiveTarget) { this._activate(this._targets[i]); @@ -6293,50 +7124,68 @@ this._clear(); - const queries = SELECTOR_LINK_ITEMS.split(',').map(selector => `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]`); - const link = SelectorEngine.findOne(queries.join(','), this._config.target); + const queries = SELECTOR_LINK_ITEMS.split(",").map( + (selector) => + `${selector}[data-bs-target="${target}"],${selector}[href="${target}"]` + ); + const link = SelectorEngine.findOne( + queries.join(","), + this._config.target + ); link.classList.add(CLASS_NAME_ACTIVE$1); if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) { - SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE$1, link.closest(SELECTOR_DROPDOWN$1)).classList.add(CLASS_NAME_ACTIVE$1); + SelectorEngine.findOne( + SELECTOR_DROPDOWN_TOGGLE$1, + link.closest(SELECTOR_DROPDOWN$1) + ).classList.add(CLASS_NAME_ACTIVE$1); } else { - SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP$1).forEach(listGroup => { - // Set triggered links parents as active - // With both