vrembem 1.38.0 → 1.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/scripts.esm.js +27 -13
- package/dev/scripts.esm.js.map +1 -1
- package/dev/scripts.js +27 -13
- package/dev/scripts.js.map +1 -1
- package/dev/scripts.modern.js +25 -13
- package/dev/scripts.modern.js.map +1 -1
- package/dev/scripts.umd.js +27 -13
- package/dev/scripts.umd.js.map +1 -1
- package/dev/styles.css +25 -17
- package/dev/styles.css.map +1 -1
- package/dist/scripts.esm.js +1 -1
- package/dist/scripts.esm.js.map +1 -1
- package/dist/scripts.js +1 -1
- package/dist/scripts.js.map +1 -1
- package/dist/scripts.modern.js +1 -1
- package/dist/scripts.modern.js.map +1 -1
- package/dist/scripts.umd.js +1 -1
- package/dist/scripts.umd.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +26 -26
package/dist/scripts.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},e=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},n=function(t){t&&document.querySelectorAll(t).forEach(function(t){t.setAttribute("tabindex","-1")})},i=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).add.apply(n,[].slice.call(e,1))})},r=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],s=function(t,e){var n=t.querySelector("[data-"+e.dataFocus+"]");if(n)n.focus();else{var i=t.querySelector('[tabindex="-1"]');i&&i.focus()}},o=function(t){void 0===t&&(t=null),t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)},a=/*#__PURE__*/function(){function t(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}var e=t.prototype;return e.init=function(t){this.target=t,this.inner=this.target.querySelector('[tabindex="-1"]'),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):this.target.addEventListener("keydown",this.handlerFocusLock)},e.destroy=function(){this.target&&(this.inner=null,this.focusable=null,this.focusableFirst=null,this.focusableLast=null,this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.target=null)},e.refresh=function(){this.target&&(this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):(this.focusableFirst=null,this.focusableLast=null,this.target.addEventListener("keydown",this.handlerFocusLock)))},e.handlerFocusTrap=function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.inner||(this.focusableLast.focus(),t.preventDefault()):document.activeElement!==this.focusableLast&&document.activeElement!==this.inner||(this.focusableFirst.focus(),t.preventDefault()))},e.handlerFocusLock=function(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()},e.getFocusable=function(){var t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(r.join(",")).forEach(function(e){e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t},t}(),c=function(t,e){return void 0===e&&(e=0),"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},l=function(t){return t=[].slice.call(t=t.forEach?t:[t]),[].slice.call(arguments,1).some(function(e){return t.some(function(t){if(t.classList.contains(e))return!0})})};function d(t,e,n){if(void 0===n&&(n=!1),n){var i=c(t);if(!i.length)throw new Error('Move target element "'+t+'" not found!');var r=c(n,1);if(!r)throw new Error('Move reference element "'+n+'" not found!');i.forEach(function(t){switch(e){case"after":return r.after(t),{ref:r,el:t,type:e};case"before":return r.before(t),{ref:r,el:t,type:e};case"append":return r.append(t),{ref:r,el:t,type:e};case"prepend":return r.prepend(t),{ref:r,el:t,type:e};default:throw new Error('Move type "'+e+'" does not exist!')}})}}var u=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).remove.apply(n,[].slice.call(e,1))})},f=function(t,e){return new Promise(function(n){e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function i(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",i)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))})},p=function(t,e){return new Promise(function(n){e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function i(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",i)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))})},h={xs:"480px",sm:"620px",md:"760px",lg:"990px",xl:"1380px"},g={__proto__:null,setInert:t,setOverflowHidden:e,setTabindex:n,addClass:i,camelCase:function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},focusTarget:s,focusTrigger:o,FocusTrap:a,getElement:c,hasClass:l,hyphenCase:function(t){return t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()})},moveElement:d,removeClass:u,toggleClass:function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){[].slice.call(e,1).forEach(function(e){t.classList.toggle(e)})})},openTransition:f,closeTransition:p,breakpoints:h};function v(){return(v=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t}).apply(this,arguments)}var m=/*#__PURE__*/function(){function t(t){this.defaults={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},this.settings=v({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t));var e=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)},e.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},e.handlerClick=function(t){var e=t.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');e&&(this.removeAriaState(e),this.setIndeterminate(e))},e.setAriaState=function(t,e){var n=this;void 0===e&&(e=this.settings.stateValue),(t=t.forEach?t:[t]).forEach(function(t){t.setAttribute(n.settings.stateAttr,e)})},e.removeAriaState=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.removeAttribute(e.settings.stateAttr)})},e.setIndeterminate=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.indeterminate=!!t.hasAttribute(e.settings.stateAttr)})},t}(),y={autoInit:!1,dataDrawer:"drawer",dataDialog:"drawer-dialog",dataToggle:"drawer-toggle",dataOpen:"drawer-open",dataClose:"drawer-close",dataBreakpoint:"drawer-breakpoint",dataFocus:"drawer-focus",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",selectorInert:null,selectorOverflow:null,breakpoints:h,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0},b=function(n,r){try{var s=r.getDrawer(n);return s?l(s,r.settings.classModal)?(t(!1,r.settings.selectorInert),e(!1,r.settings.selectorOverflow),u(s,r.settings.classModal),r.focusTrap.destroy(),n=s.getAttribute("data-"+r.settings.dataDrawer),r.state[n]==r.settings.stateOpened&&(i(s,r.settings.stateOpened),u(s,r.settings.stateClosed)),s.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"toDefault",{bubbles:!0})),Promise.resolve(s)):Promise.resolve():Promise.resolve(r.drawerNotFound(n))}catch(t){return Promise.reject(t)}},w=function(t,e){try{var n=e.getDrawer(t);return n?l(n,e.settings.classModal)?Promise.resolve():(i(n,e.settings.classModal),i(n,e.settings.stateClosed),u(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),Promise.resolve(n)):Promise.resolve(e.drawerNotFound(t))}catch(t){return Promise.reject(t)}},E=/*#__PURE__*/function(){function t(t){this.mediaQueryLists=[],this.parent=t,this.__check=this.check.bind(this)}var e=t.prototype;return e.init=function(){var t=this;document.querySelectorAll("[data-"+this.parent.settings.dataBreakpoint+"]").forEach(function(e){var n=e.getAttribute("data-"+t.parent.settings.dataDrawer),i=e.getAttribute("data-"+t.parent.settings.dataBreakpoint),r=window.matchMedia("(min-width:"+(t.parent.settings.breakpoints[i]?t.parent.settings.breakpoints[i]:i)+")");t.match(r,e),r.addEventListener("change",t.__check),t.mediaQueryLists.push({mql:r,drawer:n})})},e.destroy=function(){var t=this;this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(function(e){e.mql.removeListener(t.__check)}),this.mediaQueryLists=null},e.check=function(t){var e=this;void 0===t&&(t=null),this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(function(n){if(!t||t.media==n.mql.media){var i=document.querySelector("[data-"+e.parent.settings.dataDrawer+'="'+n.drawer+'"]');i&&e.match(n.mql,i)}}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))},e.match=function(t,e){t.matches?b(e,this.parent):w(e,this.parent)},t}();function x(t){if(!this.working){var e=t.target.closest("[data-"+this.settings.dataToggle+"]");if(e){var n=e.getAttribute("data-"+this.settings.dataToggle);return this.memory.trigger=e,this.toggle(n),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataOpen+"]")){var i=e.getAttribute("data-"+this.settings.dataOpen);return this.memory.trigger=e,this.open(i),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataClose+"]")){var r=e.getAttribute("data-"+this.settings.dataClose);if(r)this.memory.trigger=e,this.close(r);else{var s=t.target.closest("[data-"+this.settings.dataDrawer+"]");s&&this.close(s)}t.preventDefault()}else t.target.hasAttribute("data-"+this.settings.dataDrawer)&&this.close(t.target)}}function O(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("."+this.settings.classModal+"."+this.settings.stateOpened);e&&this.close(e)}}function L(t,e){if(!e.stateSave)return k(e);var n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll("[data-"+e.dataDrawer+"]")).forEach(function(t){if(!l(t,e.classModal)){var i=t.getAttribute("data-"+e.dataDrawer);n[i]=l(t,e.stateOpened)?e.stateOpened:e.stateClosed}}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function k(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}var _=/*#__PURE__*/function(){function r(t){this.defaults=y,this.settings=v({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new a,this.breakpoint=new E(this),this.__handlerClick=x.bind(this),this.__handlerKeydown=O.bind(this),this.settings.autoInit&&this.init()}var c=r.prototype;return c.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()},c.destroy=function(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()},c.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},c.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},c.getDrawer=function(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataDrawer+'="'+t+'"]')},c.drawerNotFound=function(t){return Promise.reject(new Error('Did not find drawer with key: "'+t+'"'))},c.setTabindex=function(){n("\n [data-"+this.settings.dataDrawer+"]\n [data-"+this.settings.dataDialog+"]\n ")},c.stateSet=function(){this.state=function(t){if(!t.stateSave)return k(t);var e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return L(null,t);var n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(function(e){var r=document.querySelector("[data-"+t.dataDrawer+'="'+e+'"]');r&&(n[e]==t.stateOpened?i(r,t.stateOpened):u(r,t.stateOpened))}),n}(this.settings)},c.stateSave=function(t){void 0===t&&(t=null),this.state=L(t,this.settings)},c.stateClear=function(){this.state=k(this.settings)},c.switchToDefault=function(t){return b(t,this)},c.switchToModal=function(t){return w(t,this)},c.toggle=function(t){try{var e=this,n=e.getDrawer(t);if(!n)return Promise.resolve(e.drawerNotFound(t));var i=!l(n,e.settings.stateOpened);return Promise.resolve(i?e.open(n):e.close(n))}catch(t){return Promise.reject(t)}},c.open=function(n){try{var i=this,r=i.getDrawer(n);if(!r)return Promise.resolve(i.drawerNotFound(n));if(l(r,i.settings.stateOpened))return s(r,i.settings),Promise.resolve(r);i.working=!0;var o=l(r,i.settings.classModal);return o&&e(!0,i.settings.selectorOverflow),Promise.resolve(f(r,i.settings)).then(function(){return i.stateSave(r),o&&(i.focusTrap.init(r),t(!0,i.settings.selectorInert)),s(r,i.settings),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"opened",{detail:i,bubbles:!0})),i.working=!1,r})}catch(t){return Promise.reject(t)}},c.close=function(n){try{var i=this,r=i.getDrawer(n);return r?l(r,i.settings.stateOpened)?(i.working=!0,l(r,i.settings.classModal)&&(t(!1,i.settings.selectorInert),e(!1,i.settings.selectorOverflow)),Promise.resolve(p(r,i.settings)).then(function(){return i.stateSave(r),o(i),i.focusTrap.destroy(),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"closed",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r):Promise.resolve(i.drawerNotFound(n))}catch(t){return Promise.reject(t)}},r}(),A={autoInit:!1,dataModal:"modal",dataDialog:"modal-dialog",dataOpen:"modal-open",dataClose:"modal-close",dataFocus:"modal-focus",dataRequired:"modal-required",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",selectorInert:null,selectorOverflow:"body",customEventPrefix:"modal:",eventListeners:!0,moveModals:{ref:null,type:null},setTabindex:!0,transition:!0},P=function(t){try{var e,n=function(n){return e?n:t.target.closest("[data-"+i.settings.dataClose+"]")?(t.preventDefault(),void i.close()):void(t.target.hasAttribute("data-"+i.settings.dataModal)&&!t.target.hasAttribute("data-"+i.settings.dataRequired)&&i.close())},i=this;if(i.working)return Promise.resolve();var r=t.target.closest("[data-"+i.settings.dataOpen+"]"),s=function(){if(r){t.preventDefault();var n=r.getAttribute("data-"+i.settings.dataOpen),s=t.target.closest("[data-"+i.settings.dataModal+"]");return s||(i.memory.trigger=r),Promise.resolve(i.close(!s)).then(function(){i.open(n),e=1})}}();return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(t){return Promise.reject(t)}};function C(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("[data-"+this.settings.dataModal+"]."+this.settings.stateOpened);e&&!e.hasAttribute("data-"+this.settings.dataRequired)&&this.close()}}var S=/*#__PURE__*/function(){function r(t){this.defaults=A,this.settings=v({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new a,this.__handlerClick=P.bind(this),this.__handlerKeydown=C.bind(this),this.settings.autoInit&&this.init()}var c=r.prototype;return c.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t)),this.moveModals(),this.settings.setTabindex&&this.setTabindex(),this.setInitialState(),this.settings.eventListeners&&this.initEventListeners()},c.destroy=function(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()},c.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},c.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},c.getModal=function(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataModal+'="'+t+'"]')},c.modalNotFound=function(t){return Promise.reject(new Error('Did not find modal with key: "'+t+'"'))},c.setTabindex=function(){n("\n [data-"+this.settings.dataModal+"]\n [data-"+this.settings.dataDialog+"]\n ")},c.setInitialState=function(){var n;n=this,document.querySelectorAll("[data-"+n.settings.dataModal+"]").forEach(function(r){r.classList.contains(n.settings.stateOpened)&&(t(!1,n.settings.selectorInert),e(!1,n.settings.selectorOverflow),o(n),n.focusTrap.destroy()),u(r,n.settings.stateOpened,n.settings.stateOpening,n.settings.stateClosing),i(r,n.settings.stateClosed)})},c.moveModals=function(t,e){void 0===t&&(t=this.settings.moveModals.type),void 0===e&&(e=this.settings.moveModals.ref);var n=document.querySelectorAll("[data-"+this.settings.dataModal+"]");n.length&&d(n,t,e)},c.open=function(n){try{var i=this,r=i.getModal(n);return r?l(r,i.settings.stateClosed)?(i.working=!0,e(!0,i.settings.selectorOverflow),Promise.resolve(f(r,i.settings)).then(function(){return i.focusTrap.init(r),s(r,i.settings),t(!0,i.settings.selectorInert),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"opened",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r):Promise.resolve(i.modalNotFound(n))}catch(t){return Promise.reject(t)}},c.close=function(n){void 0===n&&(n=!0);try{var i=this,r=document.querySelector("[data-"+i.settings.dataModal+"]."+i.settings.stateOpened);return r?(i.working=!0,t(!1,i.settings.selectorInert),e(!1,i.settings.selectorOverflow),Promise.resolve(p(r,i.settings)).then(function(){return n&&o(i),i.focusTrap.destroy(),r.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"closed",{detail:i,bubbles:!0})),i.working=!1,r})):Promise.resolve(r)}catch(t){return Promise.reject(t)}},r}(),D={autoInit:!1,dataPopover:"popover",dataTrigger:"popover-trigger",dataArrow:"popover-arrow",dataEventType:"popover-event",dataPlacement:"popover-placement",stateActive:"is-active",eventType:"click",eventListeners:!0,placement:"bottom-start"};function T(t,e){t.target.classList.remove(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]});var n=e.collection.findIndex(function(e){return e.target===t.target});return e.collection[n].state="hide",t}function M(t){return t.collection.forEach(function(e){"show"===e.state&&T(e,t)}),t.collection}function j(t,e){setTimeout(function(){var n=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,i=document.activeElement.closest("[data-"+e.settings.dataPopover+"]")===t.target||document.activeElement.closest("[data-"+e.settings.dataTrigger+"]")===t.trigger;return n||i||T(t,e),t},1)}function q(t,e){var n=getComputedStyle(t),i={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":"[data-"+e.dataArrow+"]","arrow-padding":0};for(var r in i){var s=n.getPropertyValue("--popover-"+r).trim();s&&(i[r]=s)}return i}function I(t,e,n){return void 0===n&&(n=!1),t.hasAttribute("data-"+e)?t.getAttribute("data-"+e):n}function F(t){var e,n="string"==typeof t?t.trim().split(" "):[t];switch(n.forEach(function(t,e){n[e]=parseInt(t,10)}),n.length){case 1:e=n[0];break;case 2:e={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:e={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:e={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:e=!1}return e}function B(t,e){var n;t.target.classList.add(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","true"),t.config=q(t.target,e.settings),t.popper.setOptions({placement:I(t.target,e.settings.dataPlacement,t.config.placement),modifiers:[{name:"eventListeners",enabled:!0}].concat((n=t.config,[{name:"offset",options:{offset:[0,parseInt(n.offset,10)]}},{name:"preventOverflow",options:{padding:F(n["overflow-padding"])}},{name:"flip",options:{padding:F(n["flip-padding"])}},{name:"arrow",options:{element:n["arrow-element"],padding:F(n["arrow-padding"])}}]))}),t.popper.update();var i=e.collection.findIndex(function(e){return e.target===t.target});return e.collection[i].state="show",t}function N(t){t.target.classList.contains(this.settings.stateActive)?T(t,this):(B(t,this),W(t,this))}function K(t){"Escape"===t.key&&M(this)}function W(t,e){document.addEventListener("click",function n(i){var r=i.target.closest("[data-"+e.settings.dataPopover+"], [data-"+e.settings.dataTrigger+"]");r===t.target||r===t.trigger?t.target.classList.contains(e.settings.stateActive)||this.removeEventListener("click",n):(t.target.classList.contains(e.settings.stateActive)&&T(t,e),this.removeEventListener("click",n))})}var R="top",H="bottom",V="right",Q="left",z=[R,H,V,Q],U=/*#__PURE__*/z.reduce(function(t,e){return t.concat([e+"-start",e+"-end"])},[]),J=/*#__PURE__*/[].concat(z,["auto"]).reduce(function(t,e){return t.concat([e,e+"-start",e+"-end"])},[]),X=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function Y(t){return t?(t.nodeName||"").toLowerCase():null}function Z(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function G(t){return t instanceof Z(t).Element||t instanceof Element}function $(t){return t instanceof Z(t).HTMLElement||t instanceof HTMLElement}function tt(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Z(t).ShadowRoot||t instanceof ShadowRoot)}function et(t){return t.split("-")[0]}var nt=Math.max,it=Math.min,rt=Math.round;function st(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),i=1,r=1;if($(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(i=rt(n.width)/o||1),s>0&&(r=rt(n.height)/s||1)}return{width:n.width/i,height:n.height/r,top:n.top/r,right:n.right/i,bottom:n.bottom/r,left:n.left/i,x:n.left/i,y:n.top/r}}function ot(t){var e=st(t),n=t.offsetWidth,i=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-i)<=1&&(i=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:i}}function at(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&tt(n)){var i=e;do{if(i&&t.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function ct(t){return Z(t).getComputedStyle(t)}function lt(t){return["table","td","th"].indexOf(Y(t))>=0}function dt(t){return((G(t)?t.ownerDocument:t.document)||window.document).documentElement}function ut(t){return"html"===Y(t)?t:t.assignedSlot||t.parentNode||(tt(t)?t.host:null)||dt(t)}function ft(t){return $(t)&&"fixed"!==ct(t).position?t.offsetParent:null}function pt(t){for(var e=Z(t),n=ft(t);n&<(n)&&"static"===ct(n).position;)n=ft(n);return n&&("html"===Y(n)||"body"===Y(n)&&"static"===ct(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&$(t)&&"fixed"===ct(t).position)return null;for(var n=ut(t);$(n)&&["html","body"].indexOf(Y(n))<0;){var i=ct(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||e&&"filter"===i.willChange||e&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(t)||e}function ht(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function gt(t,e,n){return nt(t,it(e,n))}function vt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function mt(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function yt(t){return t.split("-")[1]}var bt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function wt(t){var e,n=t.popper,i=t.popperRect,r=t.placement,s=t.variation,o=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,d=t.roundOffsets,u=t.isFixed,f=o.x,p=void 0===f?0:f,h=o.y,g=void 0===h?0:h,v="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var m=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=Q,w=R,E=window;if(l){var x=pt(n),O="clientHeight",L="clientWidth";x===Z(n)&&"static"!==ct(x=dt(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(r===R||(r===Q||r===V)&&"end"===s)&&(w=H,g-=(u&&E.visualViewport?E.visualViewport.height:x[O])-i.height,g*=c?1:-1),r!==Q&&(r!==R&&r!==H||"end"!==s)||(b=V,p-=(u&&E.visualViewport?E.visualViewport.width:x[L])-i.width,p*=c?1:-1)}var k,_=Object.assign({position:a},l&&bt),A=!0===d?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:rt(t.x*n)/n||0,y:rt(e*n)/n||0}}({x:p,y:g}):{x:p,y:g};return p=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=m?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k):((e={})[w]=y?g+"px":"",e[b]=m?p+"px":"",e.transform="",e))}var Et={passive:!0},xt={left:"right",right:"left",bottom:"top",top:"bottom"};function Ot(t){return t.replace(/left|right|bottom|top/g,function(t){return xt[t]})}var Lt={start:"end",end:"start"};function kt(t){return t.replace(/start|end/g,function(t){return Lt[t]})}function _t(t){var e=Z(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function At(t){return st(dt(t)).left+_t(t).scrollLeft}function Pt(t){var e=ct(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Ct(t){return["html","body","#document"].indexOf(Y(t))>=0?t.ownerDocument.body:$(t)&&Pt(t)?t:Ct(ut(t))}function St(t,e){var n;void 0===e&&(e=[]);var i=Ct(t),r=i===(null==(n=t.ownerDocument)?void 0:n.body),s=Z(i),o=r?[s].concat(s.visualViewport||[],Pt(i)?i:[]):i,a=e.concat(o);return r?a:a.concat(St(ut(o)))}function Dt(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Tt(t,e){return"viewport"===e?Dt(function(t){var e=Z(t),n=dt(t),i=e.visualViewport,r=n.clientWidth,s=n.clientHeight,o=0,a=0;return i&&(r=i.width,s=i.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=i.offsetLeft,a=i.offsetTop)),{width:r,height:s,x:o+At(t),y:a}}(t)):G(e)?function(t){var e=st(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):Dt(function(t){var e,n=dt(t),i=_t(t),r=null==(e=t.ownerDocument)?void 0:e.body,s=nt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),o=nt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),a=-i.scrollLeft+At(t),c=-i.scrollTop;return"rtl"===ct(r||n).direction&&(a+=nt(n.clientWidth,r?r.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}(dt(t)))}function Mt(t){var e,n=t.reference,i=t.element,r=t.placement,s=r?et(r):null,o=r?yt(r):null,a=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(s){case R:e={x:a,y:n.y-i.height};break;case H:e={x:a,y:n.y+n.height};break;case V:e={x:n.x+n.width,y:c};break;case Q:e={x:n.x-i.width,y:c};break;default:e={x:n.x,y:n.y}}var l=s?ht(s):null;if(null!=l){var d="y"===l?"height":"width";switch(o){case"start":e[l]=e[l]-(n[d]/2-i[d]/2);break;case"end":e[l]=e[l]+(n[d]/2-i[d]/2)}}return e}function jt(t,e){void 0===e&&(e={});var n=e.placement,i=void 0===n?t.placement:n,r=e.boundary,s=void 0===r?"clippingParents":r,o=e.rootBoundary,a=void 0===o?"viewport":o,c=e.elementContext,l=void 0===c?"popper":c,d=e.altBoundary,u=void 0!==d&&d,f=e.padding,p=void 0===f?0:f,h=vt("number"!=typeof p?p:mt(p,z)),g=t.rects.popper,v=t.elements[u?"popper"===l?"reference":"popper":l],m=function(t,e,n){var i="clippingParents"===e?function(t){var e=St(ut(t)),n=["absolute","fixed"].indexOf(ct(t).position)>=0&&$(t)?pt(t):t;return G(n)?e.filter(function(t){return G(t)&&at(t,n)&&"body"!==Y(t)}):[]}(t):[].concat(e),r=[].concat(i,[n]),s=r.reduce(function(e,n){var i=Tt(t,n);return e.top=nt(i.top,e.top),e.right=it(i.right,e.right),e.bottom=it(i.bottom,e.bottom),e.left=nt(i.left,e.left),e},Tt(t,r[0]));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(G(v)?v:v.contextElement||dt(t.elements.popper),s,a),y=st(t.elements.reference),b=Mt({reference:y,element:g,strategy:"absolute",placement:i}),w=Dt(Object.assign({},g,b)),E="popper"===l?w:y,x={top:m.top-E.top+h.top,bottom:E.bottom-m.bottom+h.bottom,left:m.left-E.left+h.left,right:E.right-m.right+h.right},O=t.modifiersData.offset;if("popper"===l&&O){var L=O[i];Object.keys(x).forEach(function(t){var e=[V,H].indexOf(t)>=0?1:-1,n=[R,H].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function qt(t,e){void 0===e&&(e={});var n=e.boundary,i=e.rootBoundary,r=e.padding,s=e.flipVariations,o=e.allowedAutoPlacements,a=void 0===o?J:o,c=yt(e.placement),l=c?s?U:U.filter(function(t){return yt(t)===c}):z,d=l.filter(function(t){return a.indexOf(t)>=0});0===d.length&&(d=l);var u=d.reduce(function(e,s){return e[s]=jt(t,{placement:s,boundary:n,rootBoundary:i,padding:r})[et(s)],e},{});return Object.keys(u).sort(function(t,e){return u[t]-u[e]})}function It(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function Ft(t){return[R,V,H,Q].some(function(e){return t[e]>=0})}function Bt(t,e,n){void 0===n&&(n=!1);var i,r,s=$(e),o=$(e)&&function(t){var e=t.getBoundingClientRect(),n=rt(e.width)/t.offsetWidth||1,i=rt(e.height)/t.offsetHeight||1;return 1!==n||1!==i}(e),a=dt(e),c=st(t,o),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!n)&&(("body"!==Y(e)||Pt(a))&&(l=(i=e)!==Z(i)&&$(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:_t(i)),$(e)?((d=st(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=At(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function Nt(t){var e=new Map,n=new Set,i=[];function r(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var i=e.get(t);i&&r(i)}}),i.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||r(t)}),i}var Kt={placement:"bottom",modifiers:[],strategy:"absolute"};function Wt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Rt(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,i=t.defaultOptions,r=void 0===i?Kt:i;return function(t,e,i){void 0===i&&(i=r);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Kt,r),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,d={state:a,setOptions:function(i){var s="function"==typeof i?i(a.options):i;u(),a.options=Object.assign({},r,a.options,s),a.scrollParents={reference:G(t)?St(t):t.contextElement?St(t.contextElement):[],popper:St(e)};var o,l,f=function(t){var e=Nt(t);return X.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((o=[].concat(n,a.options.modifiers),l=o.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return a.orderedModifiers=f.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var i=n({state:a,name:t.name,instance:d,options:void 0===e?{}:e});c.push(i||function(){})}}),d.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(Wt(e,n)){a.rects={reference:Bt(e,pt(n),"fixed"===a.options.strategy),popper:ot(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var i=0;i<a.orderedModifiers.length;i++)if(!0!==a.reset){var r=a.orderedModifiers[i],s=r.fn,o=r.options;"function"==typeof s&&(a=s({state:a,options:void 0===o?{}:o,name:r.name,instance:d})||a)}else a.reset=!1,i=-1}}},update:(s=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(s())})})),o}),destroy:function(){u(),l=!0}};if(!Wt(t,e))return d;function u(){c.forEach(function(t){return t()}),c=[]}return d.setOptions(i).then(function(t){!l&&i.onFirstUpdate&&i.onFirstUpdate(t)}),d}}var Ht=/*#__PURE__*/Rt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,i=t.options,r=i.scroll,s=void 0===r||r,o=i.resize,a=void 0===o||o,c=Z(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(t){t.addEventListener("scroll",n.update,Et)}),a&&c.addEventListener("resize",n.update,Et),function(){s&&l.forEach(function(t){t.removeEventListener("scroll",n.update,Et)}),a&&c.removeEventListener("resize",n.update,Et)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Mt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,i=n.gpuAcceleration,r=void 0===i||i,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,c=void 0===a||a,l={placement:et(e.placement),variation:yt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:r,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,wt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,wt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},i=e.attributes[t]||{},r=e.elements[t];$(r)&&Y(r)&&(Object.assign(r.style,n),Object.keys(i).forEach(function(t){var e=i[t];!1===e?r.removeAttribute(t):r.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var i=e.elements[t],r=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});$(i)&&Y(i)&&(Object.assign(i.style,s),Object.keys(r).forEach(function(t){i.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,i=t.options.offset,r=void 0===i?[0,0]:i,s=J.reduce(function(t,n){return t[n]=function(t,e,n){var i=et(t),r=[Q,R].indexOf(i)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[Q,V].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,r),t},{}),o=s[e.placement],a=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name;if(!e.modifiersData[i]._skip){for(var r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0===o||o,c=n.fallbackPlacements,l=n.padding,d=n.boundary,u=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=void 0===p||p,g=n.allowedAutoPlacements,v=e.options.placement,m=et(v),y=c||(m!==v&&h?function(t){if("auto"===et(t))return[];var e=Ot(t);return[kt(t),e,kt(e)]}(v):[Ot(v)]),b=[v].concat(y).reduce(function(t,n){return t.concat("auto"===et(n)?qt(e,{placement:n,boundary:d,rootBoundary:u,padding:l,flipVariations:h,allowedAutoPlacements:g}):n)},[]),w=e.rects.reference,E=e.rects.popper,x=new Map,O=!0,L=b[0],k=0;k<b.length;k++){var _=b[k],A=et(_),P="start"===yt(_),C=[R,H].indexOf(A)>=0,S=C?"width":"height",D=jt(e,{placement:_,boundary:d,rootBoundary:u,altBoundary:f,padding:l}),T=C?P?V:Q:P?H:R;w[S]>E[S]&&(T=Ot(T));var M=Ot(T),j=[];if(s&&j.push(D[A]<=0),a&&j.push(D[T]<=0,D[M]<=0),j.every(function(t){return t})){L=_,O=!1;break}x.set(_,j)}if(O)for(var q=function(t){var e=b.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},I=h?3:1;I>0&&"break"!==q(I);I--);e.placement!==L&&(e.modifiersData[i]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,i=t.name,r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0!==o&&o,c=n.tether,l=void 0===c||c,d=n.tetherOffset,u=void 0===d?0:d,f=jt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),p=et(e.placement),h=yt(e.placement),g=!h,v=ht(p),m="x"===v?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,x="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(s){var k,_="y"===v?R:Q,A="y"===v?H:V,P="y"===v?"height":"width",C=y[v],S=C+f[_],D=C-f[A],T=l?-w[P]/2:0,M="start"===h?b[P]:w[P],j="start"===h?-w[P]:-b[P],q=e.elements.arrow,I=l&&q?ot(q):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=F[_],N=F[A],K=gt(0,b[P],I[P]),W=g?b[P]/2-T-K-B-x.mainAxis:M-K-B-x.mainAxis,z=g?-b[P]/2+T+K+N+x.mainAxis:j+K+N+x.mainAxis,U=e.elements.arrow&&pt(e.elements.arrow),J=null!=(k=null==O?void 0:O[v])?k:0,X=C+z-J,Y=gt(l?it(S,C+W-J-(U?"y"===v?U.clientTop||0:U.clientLeft||0:0)):S,C,l?nt(D,X):D);y[v]=Y,L[v]=Y-C}if(a){var Z,G=y[m],$="y"===m?"height":"width",tt=G+f["x"===v?R:Q],rt=G-f["x"===v?H:V],st=-1!==[R,Q].indexOf(p),at=null!=(Z=null==O?void 0:O[m])?Z:0,ct=st?tt:G-b[$]-w[$]-at+x.altAxis,lt=st?G+b[$]+w[$]-at-x.altAxis:rt,dt=l&&st?function(t,e,n){var i=gt(t,e,n);return i>n?n:i}(ct,G,lt):gt(l?ct:tt,G,l?lt:rt);y[m]=dt,L[m]=dt-G}e.modifiersData[i]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,i=t.name,r=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=et(n.placement),c=ht(a),l=[Q,V].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(t,e){return vt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:mt(t,z))}(r.padding,n),u=ot(s),f="y"===c?R:Q,p="y"===c?H:V,h=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],g=o[c]-n.rects.reference[c],v=pt(s),m=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-u[l]/2+(h/2-g/2),b=gt(d[f],y,m-u[l]-d[p]);n.modifiersData[i]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=e.elements.popper.querySelector(i)))&&at(e.elements.popper,i)&&(e.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,i=e.rects.reference,r=e.rects.popper,s=e.modifiersData.preventOverflow,o=jt(e,{elementContext:"reference"}),a=jt(e,{altBoundary:!0}),c=It(o,i),l=It(a,r,s),d=Ft(c),u=Ft(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function Vt(t,e,n){if(!e&&!(e=function(t,e){var n=t.getAttribute("data-"+e.dataTrigger).trim();return n?document.querySelector("[data-"+e.dataPopover+'="'+n+'"]'):!(!t.nextElementSibling||!t.nextElementSibling.hasAttribute("data-"+e.dataPopover))&&t.nextElementSibling}(t,n.settings)))return console.error("No popover associated with the provided trigger:",t),!1;var i,r=n.collection.findIndex(function(n){return n.trigger===t&&n.target===e});if(r>=0)i=n.collection[r];else{var s=Ht(t,e);i={state:"hide",trigger:t,target:e,popper:s,config:q(e,n.settings)},n.collection.push(i)}return zt(i,n),i.target.classList.contains(n.settings.stateActive)?(B(i,n),W(i,n)):T(i,n),i}function Qt(t,e){var n=e.collection.findIndex(function(e){return e.trigger===t.trigger&&e.target===t.target});return n>=0&&("show"===t.state&&T(t,e),t.popper.destroy(),Ut(t),e.collection.splice(n,1)),e.collection}function zt(t,e){return t.__eventListeners||("hover"===I(t.target,e.settings.dataEventType,t.config.event)?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:B.bind(null,t,e)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:j.bind(null,t,e)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].addEventListener(i,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:N.bind(e,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].addEventListener(i,e.listener,!1)})})}))),t}function Ut(t){return t.__eventListeners&&(t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(i){t[n].removeEventListener(i,e.listener,!1)})})}),delete t.__eventListeners),t}function Jt(t){return document.querySelectorAll("[data-"+t.settings.dataTrigger+"]").forEach(function(e){Vt(e,!1,t)}),t.collection}function Xt(t){for(;t.collection.length>0;)Qt(t.collection[0],t);return t.collection}var Yt=/*#__PURE__*/function(){function t(t){this.defaults=D,this.settings=v({},this.defaults,t),this.collection=[],this.__handlerKeydown=K.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=v({},this.settings,t)),Jt(this),this.settings.eventListeners&&this.initEventListeners(!1)},e.destroy=function(){Xt(this),this.settings.eventListeners&&this.destroyEventListeners(!1)},e.initEventListeners=function(t){var e=this;void 0===t&&(t=!0),t&&this.collection.forEach(function(t){zt(t,e)}),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(t){void 0===t&&(t=!0),t&&this.collection.forEach(function(t){Ut(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.register=function(t,e){return void 0===e&&(e=!1),Vt(t,e,this)},e.deregister=function(t){return Qt(t,this)},e.registerCollection=function(){return Jt(this)},e.deregisterCollection=function(){return Xt(this)},e.show=function(t){return B(t,this)},e.hide=function(t){return T(t,this)},e.hideAll=function(){return M(this)},t}();exports.Checkbox=m,exports.Drawer=_,exports.Modal=S,exports.Popover=Yt,exports.core=g;
|
|
1
|
+
var t=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?(e.inert=!0,e.setAttribute("aria-hidden",!0)):(e.inert=null,e.removeAttribute("aria-hidden"))})},e=function(t,e){e&&document.querySelectorAll(e).forEach(function(e){t?e.style.overflow="hidden":e.style.removeProperty("overflow")})},n=function(t){t&&document.querySelectorAll(t).forEach(function(t){t.setAttribute("tabindex","-1")})},r=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).add.apply(n,[].slice.call(e,1))})},i=['a[href]:not([tabindex^="-"])','area[href]:not([tabindex^="-"])','input:not([type="hidden"]):not([type="radio"]):not([disabled]):not([tabindex^="-"])','input[type="radio"]:not([disabled]):not([tabindex^="-"])','select:not([disabled]):not([tabindex^="-"])','textarea:not([disabled]):not([tabindex^="-"])','button:not([disabled]):not([tabindex^="-"])','iframe:not([tabindex^="-"])','audio[controls]:not([tabindex^="-"])','video[controls]:not([tabindex^="-"])','[contenteditable]:not([tabindex^="-"])','[tabindex]:not([tabindex^="-"])'],s=function(t,e){var n=t.querySelector("[data-"+e.dataFocus+"]");if(n)n.focus();else{var r=t.querySelector('[tabindex="-1"]');r&&r.focus()}},o=function(t){void 0===t&&(t=null),t&&t.memory&&t.memory.trigger&&(t.memory.trigger.focus(),t.memory.trigger=null)},a=/*#__PURE__*/function(){function t(){this.target=null,this.__handlerFocusTrap=this.handlerFocusTrap.bind(this)}var e=t.prototype;return e.init=function(t){this.target=t,this.inner=this.target.querySelector('[tabindex="-1"]'),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):this.target.addEventListener("keydown",this.handlerFocusLock)},e.destroy=function(){this.target&&(this.inner=null,this.focusable=null,this.focusableFirst=null,this.focusableLast=null,this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.target=null)},e.refresh=function(){this.target&&(this.target.removeEventListener("keydown",this.__handlerFocusTrap),this.target.removeEventListener("keydown",this.handlerFocusLock),this.focusable=this.getFocusable(),this.focusable.length?(this.focusableFirst=this.focusable[0],this.focusableLast=this.focusable[this.focusable.length-1],this.target.addEventListener("keydown",this.__handlerFocusTrap)):(this.focusableFirst=null,this.focusableLast=null,this.target.addEventListener("keydown",this.handlerFocusLock)))},e.handlerFocusTrap=function(t){("Tab"===t.key||9===t.keyCode)&&(t.shiftKey?document.activeElement!==this.focusableFirst&&document.activeElement!==this.inner||(this.focusableLast.focus(),t.preventDefault()):document.activeElement!==this.focusableLast&&document.activeElement!==this.inner||(this.focusableFirst.focus(),t.preventDefault()))},e.handlerFocusLock=function(t){("Tab"===t.key||9===t.keyCode)&&t.preventDefault()},e.getFocusable=function(){var t=[],e=document.activeElement,n=this.inner?this.inner.scrollTop:0;return this.target.querySelectorAll(i.join(",")).forEach(function(e){e.focus(),e===document.activeElement&&t.push(e)}),this.inner&&(this.inner.scrollTop=n),e.focus(),t},t}(),c=function(t,e){return void 0===e&&(e=0),"string"!=typeof t?t:e?document.querySelector(t):document.querySelectorAll(t)},l=function(t){return t=[].slice.call(t=t.forEach?t:[t]),[].slice.call(arguments,1).some(function(e){return t.some(function(t){if(t.classList.contains(e))return!0})})};function d(t,e,n){if(void 0===n&&(n=!1),n){var r=c(t);if(!r.length)throw new Error('Move target element "'+t+'" not found!');var i=c(n,1);if(!i)throw new Error('Move reference element "'+n+'" not found!');r.forEach(function(t){switch(e){case"after":return i.after(t),{ref:i,el:t,type:e};case"before":return i.before(t),{ref:i,el:t,type:e};case"append":return i.append(t),{ref:i,el:t,type:e};case"prepend":return i.prepend(t),{ref:i,el:t,type:e};default:throw new Error('Move type "'+e+'" does not exist!')}})}}var u=function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){var n;(n=t.classList).remove.apply(n,[].slice.call(e,1))})},f=function(t,e){return new Promise(function(n){e.transition?(t.classList.remove(e.stateClosed),t.classList.add(e.stateOpening),t.addEventListener("transitionend",function r(){t.classList.add(e.stateOpened),t.classList.remove(e.stateOpening),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateOpened),t.classList.remove(e.stateClosed),n(t))})},p=function(t,e){return new Promise(function(n){e.transition?(t.classList.add(e.stateClosing),t.classList.remove(e.stateOpened),t.addEventListener("transitionend",function r(){t.classList.remove(e.stateClosing),t.classList.add(e.stateClosed),n(t),this.removeEventListener("transitionend",r)})):(t.classList.add(e.stateClosed),t.classList.remove(e.stateOpened),n(t))})},h={__proto__:null,setInert:t,setOverflowHidden:e,setTabindex:n,addClass:r,camelCase:function(t){return t.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})},focusTarget:s,focusTrigger:o,FocusTrap:a,getElement:c,hasClass:l,hyphenCase:function(t){return t.replace(/([a-z][A-Z])/g,function(t){return t[0]+"-"+t[1].toLowerCase()})},moveElement:d,removeClass:u,toggleClass:function(t){var e=arguments;(t=t.forEach?t:[t]).forEach(function(t){[].slice.call(e,1).forEach(function(e){t.classList.toggle(e)})})},openTransition:f,closeTransition:p};function g(){return(g=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var v=/*#__PURE__*/function(){function t(t){this.defaults={autoInit:!1,stateAttr:"aria-checked",stateValue:"mixed"},this.settings=g({},this.defaults,t),this.__handlerClick=this.handlerClick.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t));var e=document.querySelectorAll("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');this.setIndeterminate(e),document.addEventListener("click",this.__handlerClick,!1)},e.destroy=function(){document.removeEventListener("click",this.__handlerClick,!1)},e.handlerClick=function(t){var e=t.target.closest("["+this.settings.stateAttr+'="'+this.settings.stateValue+'"]');e&&(this.removeAriaState(e),this.setIndeterminate(e))},e.setAriaState=function(t,e){var n=this;void 0===e&&(e=this.settings.stateValue),(t=t.forEach?t:[t]).forEach(function(t){t.setAttribute(n.settings.stateAttr,e)})},e.removeAriaState=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.removeAttribute(e.settings.stateAttr)})},e.setIndeterminate=function(t){var e=this;(t=t.forEach?t:[t]).forEach(function(t){t.indeterminate=!!t.hasAttribute(e.settings.stateAttr)})},t}(),m={autoInit:!1,dataDrawer:"drawer",dataDialog:"drawer-dialog",dataToggle:"drawer-toggle",dataOpen:"drawer-open",dataClose:"drawer-close",dataBreakpoint:"drawer-breakpoint",dataFocus:"drawer-focus",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",classModal:"drawer_modal",selectorInert:null,selectorOverflow:null,breakpoints:null,customEventPrefix:"drawer:",eventListeners:!0,stateSave:!0,stateKey:"DrawerState",setTabindex:!0,transition:!0},y=function(n,i){try{var s=i.getDrawer(n);return s?l(s,i.settings.classModal)?(t(!1,i.settings.selectorInert),e(!1,i.settings.selectorOverflow),u(s,i.settings.classModal),i.focusTrap.destroy(),n=s.getAttribute("data-"+i.settings.dataDrawer),i.state[n]==i.settings.stateOpened&&(r(s,i.settings.stateOpened),u(s,i.settings.stateClosed)),s.dispatchEvent(new CustomEvent(i.settings.customEventPrefix+"toDefault",{bubbles:!0})),Promise.resolve(s)):Promise.resolve():Promise.resolve(i.drawerNotFound(n))}catch(t){return Promise.reject(t)}},b=function(t,e){try{var n=e.getDrawer(t);return n?l(n,e.settings.classModal)?Promise.resolve():(r(n,e.settings.classModal),r(n,e.settings.stateClosed),u(n,e.settings.stateOpened),n.dispatchEvent(new CustomEvent(e.settings.customEventPrefix+"toModal",{bubbles:!0})),Promise.resolve(n)):Promise.resolve(e.drawerNotFound(t))}catch(t){return Promise.reject(t)}},w=/*#__PURE__*/function(){function t(t){this.mediaQueryLists=[],this.parent=t,this.prefix=this.getVariablePrefix(),this.__check=this.check.bind(this)}var e=t.prototype;return e.init=function(){var t=this;document.querySelectorAll("[data-"+this.parent.settings.dataBreakpoint+"]").forEach(function(e){var n=e.getAttribute("data-"+t.parent.settings.dataDrawer),r=e.getAttribute("data-"+t.parent.settings.dataBreakpoint),i=t.getBreakpoint(r),s=window.matchMedia("(min-width:"+i+")");t.match(s,e),s.addEventListener("change",t.__check),t.mediaQueryLists.push({mql:s,drawer:n})})},e.destroy=function(){var t=this;this.mediaQueryLists&&this.mediaQueryLists.length&&this.mediaQueryLists.forEach(function(e){e.mql.removeListener(t.__check)}),this.mediaQueryLists=null},e.check=function(t){var e=this;void 0===t&&(t=null),this.mediaQueryLists&&this.mediaQueryLists.length&&(this.mediaQueryLists.forEach(function(n){if(!t||t.media==n.mql.media){var r=document.querySelector("[data-"+e.parent.settings.dataDrawer+'="'+n.drawer+'"]');r&&e.match(n.mql,r)}}),document.dispatchEvent(new CustomEvent(this.parent.settings.customEventPrefix+"breakpoint",{bubbles:!0})))},e.match=function(t,e){t.matches?y(e,this.parent):b(e,this.parent)},e.getBreakpoint=function(t){var e=t;return this.parent.settings.breakpoints&&this.parent.settings.breakpoints[t]?e=this.parent.settings.breakpoints[t]:getComputedStyle(document.body).getPropertyValue(this.prefix+t)&&(e=getComputedStyle(document.body).getPropertyValue(this.prefix+t)),e},e.getVariablePrefix=function(){var t="--";return(t+=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"))+"breakpoint-"},t}();function E(t){if(!this.working){var e=t.target.closest("[data-"+this.settings.dataToggle+"]");if(e){var n=e.getAttribute("data-"+this.settings.dataToggle);return this.memory.trigger=e,this.toggle(n),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataOpen+"]")){var r=e.getAttribute("data-"+this.settings.dataOpen);return this.memory.trigger=e,this.open(r),void t.preventDefault()}if(e=t.target.closest("[data-"+this.settings.dataClose+"]")){var i=e.getAttribute("data-"+this.settings.dataClose);if(i)this.memory.trigger=e,this.close(i);else{var s=t.target.closest("[data-"+this.settings.dataDrawer+"]");s&&this.close(s)}t.preventDefault()}else t.target.hasAttribute("data-"+this.settings.dataDrawer)&&this.close(t.target)}}function x(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("."+this.settings.classModal+"."+this.settings.stateOpened);e&&this.close(e)}}function O(t,e){if(!e.stateSave)return L(e);var n=localStorage.getItem(e.stateKey)?JSON.parse(localStorage.getItem(e.stateKey)):{};return(t?[t]:document.querySelectorAll("[data-"+e.dataDrawer+"]")).forEach(function(t){if(!l(t,e.classModal)){var r=t.getAttribute("data-"+e.dataDrawer);n[r]=l(t,e.stateOpened)?e.stateOpened:e.stateClosed}}),localStorage.setItem(e.stateKey,JSON.stringify(n)),n}function L(t){return localStorage.getItem(t.stateKey)&&localStorage.removeItem(t.stateKey),{}}var k=/*#__PURE__*/function(){function i(t){this.defaults=m,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.state={},this.focusTrap=new a,this.breakpoint=new w(this),this.__handlerClick=E.bind(this),this.__handlerKeydown=x.bind(this),this.settings.autoInit&&this.init()}var c=i.prototype;return c.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t)),this.stateSet(),this.settings.setTabindex&&this.setTabindex(),this.breakpoint.init(),this.settings.eventListeners&&this.initEventListeners()},c.destroy=function(){this.breakpoint.destroy(),this.memory={},this.state={},localStorage.removeItem(this.settings.stateKey),this.settings.eventListeners&&this.destroyEventListeners()},c.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},c.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},c.getDrawer=function(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataDrawer+'="'+t+'"]')},c.drawerNotFound=function(t){return Promise.reject(new Error('Did not find drawer with key: "'+t+'"'))},c.setTabindex=function(){n("\n [data-"+this.settings.dataDrawer+"]\n [data-"+this.settings.dataDialog+"]\n ")},c.stateSet=function(){this.state=function(t){if(!t.stateSave)return L(t);var e=localStorage.getItem(t.stateKey);if(!e||e&&0===Object.keys(JSON.parse(e)).length)return O(null,t);var n=JSON.parse(localStorage.getItem(t.stateKey));return Object.keys(n).forEach(function(e){var i=document.querySelector("[data-"+t.dataDrawer+'="'+e+'"]');i&&(n[e]==t.stateOpened?r(i,t.stateOpened):u(i,t.stateOpened))}),n}(this.settings)},c.stateSave=function(t){void 0===t&&(t=null),this.state=O(t,this.settings)},c.stateClear=function(){this.state=L(this.settings)},c.switchToDefault=function(t){return y(t,this)},c.switchToModal=function(t){return b(t,this)},c.toggle=function(t){try{var e=this,n=e.getDrawer(t);if(!n)return Promise.resolve(e.drawerNotFound(t));var r=!l(n,e.settings.stateOpened);return Promise.resolve(r?e.open(n):e.close(n))}catch(t){return Promise.reject(t)}},c.open=function(n){try{var r=this,i=r.getDrawer(n);if(!i)return Promise.resolve(r.drawerNotFound(n));if(l(i,r.settings.stateOpened))return s(i,r.settings),Promise.resolve(i);r.working=!0;var o=l(i,r.settings.classModal);return o&&e(!0,r.settings.selectorOverflow),Promise.resolve(f(i,r.settings)).then(function(){return r.stateSave(i),o&&(r.focusTrap.init(i),t(!0,r.settings.selectorInert)),s(i,r.settings),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"opened",{detail:r,bubbles:!0})),r.working=!1,i})}catch(t){return Promise.reject(t)}},c.close=function(n){try{var r=this,i=r.getDrawer(n);return i?l(i,r.settings.stateOpened)?(r.working=!0,l(i,r.settings.classModal)&&(t(!1,r.settings.selectorInert),e(!1,r.settings.selectorOverflow)),Promise.resolve(p(i,r.settings)).then(function(){return r.stateSave(i),o(r),r.focusTrap.destroy(),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"closed",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i):Promise.resolve(r.drawerNotFound(n))}catch(t){return Promise.reject(t)}},i}(),_={autoInit:!1,dataModal:"modal",dataDialog:"modal-dialog",dataOpen:"modal-open",dataClose:"modal-close",dataFocus:"modal-focus",dataRequired:"modal-required",stateOpened:"is-opened",stateOpening:"is-opening",stateClosing:"is-closing",stateClosed:"is-closed",selectorInert:null,selectorOverflow:"body",customEventPrefix:"modal:",eventListeners:!0,moveModals:{ref:null,type:null},setTabindex:!0,transition:!0},A=function(t){try{var e,n=function(n){return e?n:t.target.closest("[data-"+r.settings.dataClose+"]")?(t.preventDefault(),void r.close()):void(t.target.hasAttribute("data-"+r.settings.dataModal)&&!t.target.hasAttribute("data-"+r.settings.dataRequired)&&r.close())},r=this;if(r.working)return Promise.resolve();var i=t.target.closest("[data-"+r.settings.dataOpen+"]"),s=function(){if(i){t.preventDefault();var n=i.getAttribute("data-"+r.settings.dataOpen),s=t.target.closest("[data-"+r.settings.dataModal+"]");return s||(r.memory.trigger=i),Promise.resolve(r.close(!s)).then(function(){r.open(n),e=1})}}();return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(t){return Promise.reject(t)}};function P(t){if(!this.working&&"Escape"===t.key){var e=document.querySelector("[data-"+this.settings.dataModal+"]."+this.settings.stateOpened);e&&!e.hasAttribute("data-"+this.settings.dataRequired)&&this.close()}}var C=/*#__PURE__*/function(){function i(t){this.defaults=_,this.settings=g({},this.defaults,t),this.working=!1,this.memory={},this.focusTrap=new a,this.__handlerClick=A.bind(this),this.__handlerKeydown=P.bind(this),this.settings.autoInit&&this.init()}var c=i.prototype;return c.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t)),this.moveModals(),this.settings.setTabindex&&this.setTabindex(),this.setInitialState(),this.settings.eventListeners&&this.initEventListeners()},c.destroy=function(){this.memory={},this.settings.eventListeners&&this.destroyEventListeners()},c.initEventListeners=function(){document.addEventListener("click",this.__handlerClick,!1),document.addEventListener("touchend",this.__handlerClick,!1),document.addEventListener("keydown",this.__handlerKeydown,!1)},c.destroyEventListeners=function(){document.removeEventListener("click",this.__handlerClick,!1),document.removeEventListener("touchend",this.__handlerClick,!1),document.removeEventListener("keydown",this.__handlerKeydown,!1)},c.getModal=function(t){return"string"!=typeof t?t:document.querySelector("[data-"+this.settings.dataModal+'="'+t+'"]')},c.modalNotFound=function(t){return Promise.reject(new Error('Did not find modal with key: "'+t+'"'))},c.setTabindex=function(){n("\n [data-"+this.settings.dataModal+"]\n [data-"+this.settings.dataDialog+"]\n ")},c.setInitialState=function(){var n;n=this,document.querySelectorAll("[data-"+n.settings.dataModal+"]").forEach(function(i){i.classList.contains(n.settings.stateOpened)&&(t(!1,n.settings.selectorInert),e(!1,n.settings.selectorOverflow),o(n),n.focusTrap.destroy()),u(i,n.settings.stateOpened,n.settings.stateOpening,n.settings.stateClosing),r(i,n.settings.stateClosed)})},c.moveModals=function(t,e){void 0===t&&(t=this.settings.moveModals.type),void 0===e&&(e=this.settings.moveModals.ref);var n=document.querySelectorAll("[data-"+this.settings.dataModal+"]");n.length&&d(n,t,e)},c.open=function(n){try{var r=this,i=r.getModal(n);return i?l(i,r.settings.stateClosed)?(r.working=!0,e(!0,r.settings.selectorOverflow),Promise.resolve(f(i,r.settings)).then(function(){return r.focusTrap.init(i),s(i,r.settings),t(!0,r.settings.selectorInert),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"opened",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i):Promise.resolve(r.modalNotFound(n))}catch(t){return Promise.reject(t)}},c.close=function(n){void 0===n&&(n=!0);try{var r=this,i=document.querySelector("[data-"+r.settings.dataModal+"]."+r.settings.stateOpened);return i?(r.working=!0,t(!1,r.settings.selectorInert),e(!1,r.settings.selectorOverflow),Promise.resolve(p(i,r.settings)).then(function(){return n&&o(r),r.focusTrap.destroy(),i.dispatchEvent(new CustomEvent(r.settings.customEventPrefix+"closed",{detail:r,bubbles:!0})),r.working=!1,i})):Promise.resolve(i)}catch(t){return Promise.reject(t)}},i}(),S={autoInit:!1,dataPopover:"popover",dataTrigger:"popover-trigger",dataArrow:"popover-arrow",dataEventType:"popover-event",dataPlacement:"popover-placement",stateActive:"is-active",eventType:"click",eventListeners:!0,placement:"bottom-start"};function D(t,e){t.target.classList.remove(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","false"),t.popper.setOptions({modifiers:[{name:"eventListeners",enabled:!1}]});var n=e.collection.findIndex(function(e){return e.target===t.target});return e.collection[n].state="hide",t}function T(t){return t.collection.forEach(function(e){"show"===e.state&&D(e,t)}),t.collection}function M(t,e){setTimeout(function(){var n=t.target.closest(":hover")===t.target||t.trigger.closest(":hover")===t.trigger,r=document.activeElement.closest("[data-"+e.settings.dataPopover+"]")===t.target||document.activeElement.closest("[data-"+e.settings.dataTrigger+"]")===t.trigger;return n||r||D(t,e),t},1)}function j(t,e){var n=getComputedStyle(t),r={placement:e.placement,event:e.eventType,offset:0,"overflow-padding":0,"flip-padding":0,"arrow-element":"[data-"+e.dataArrow+"]","arrow-padding":0};for(var i in r){var s=getComputedStyle(document.body).getPropertyValue("--vrembem-variable-prefix"),o=n.getPropertyValue("--"+s+"popover-"+i).trim();o&&(r[i]=o)}return r}function q(t,e,n){return void 0===n&&(n=!1),t.hasAttribute("data-"+e)?t.getAttribute("data-"+e):n}function I(t){var e,n="string"==typeof t?t.trim().split(" "):[t];switch(n.forEach(function(t,e){n[e]=parseInt(t,10)}),n.length){case 1:e=n[0];break;case 2:e={top:n[0],right:n[1],bottom:n[0],left:n[1]};break;case 3:e={top:n[0],right:n[1],bottom:n[2],left:n[1]};break;case 4:e={top:n[0],right:n[1],bottom:n[2],left:n[3]};break;default:e=!1}return e}function F(t,e){var n;t.target.classList.add(e.settings.stateActive),t.trigger.setAttribute("aria-expanded","true"),t.config=j(t.target,e.settings),t.popper.setOptions({placement:q(t.target,e.settings.dataPlacement,t.config.placement),modifiers:[{name:"eventListeners",enabled:!0}].concat((n=t.config,[{name:"offset",options:{offset:[0,parseInt(n.offset,10)]}},{name:"preventOverflow",options:{padding:I(n["overflow-padding"])}},{name:"flip",options:{padding:I(n["flip-padding"])}},{name:"arrow",options:{element:n["arrow-element"],padding:I(n["arrow-padding"])}}]))}),t.popper.update();var r=e.collection.findIndex(function(e){return e.target===t.target});return e.collection[r].state="show",t}function B(t){t.target.classList.contains(this.settings.stateActive)?D(t,this):(F(t,this),N(t,this))}function V(t){"Escape"===t.key&&T(this)}function N(t,e){document.addEventListener("click",function n(r){var i=r.target.closest("[data-"+e.settings.dataPopover+"], [data-"+e.settings.dataTrigger+"]");i===t.target||i===t.trigger?t.target.classList.contains(e.settings.stateActive)||this.removeEventListener("click",n):(t.target.classList.contains(e.settings.stateActive)&&D(t,e),this.removeEventListener("click",n))})}var K="top",W="bottom",R="right",H="left",Q=[K,W,R,H],z=/*#__PURE__*/Q.reduce(function(t,e){return t.concat([e+"-start",e+"-end"])},[]),U=/*#__PURE__*/[].concat(Q,["auto"]).reduce(function(t,e){return t.concat([e,e+"-start",e+"-end"])},[]),J=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function X(t){return t?(t.nodeName||"").toLowerCase():null}function Y(t){if(null==t)return window;if("[object Window]"!==t.toString()){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Z(t){return t instanceof Y(t).Element||t instanceof Element}function G(t){return t instanceof Y(t).HTMLElement||t instanceof HTMLElement}function $(t){return"undefined"!=typeof ShadowRoot&&(t instanceof Y(t).ShadowRoot||t instanceof ShadowRoot)}function tt(t){return t.split("-")[0]}var et=Math.max,nt=Math.min,rt=Math.round;function it(t,e){void 0===e&&(e=!1);var n=t.getBoundingClientRect(),r=1,i=1;if(G(t)&&e){var s=t.offsetHeight,o=t.offsetWidth;o>0&&(r=rt(n.width)/o||1),s>0&&(i=rt(n.height)/s||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function st(t){var e=it(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function ot(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&$(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function at(t){return Y(t).getComputedStyle(t)}function ct(t){return["table","td","th"].indexOf(X(t))>=0}function lt(t){return((Z(t)?t.ownerDocument:t.document)||window.document).documentElement}function dt(t){return"html"===X(t)?t:t.assignedSlot||t.parentNode||($(t)?t.host:null)||lt(t)}function ut(t){return G(t)&&"fixed"!==at(t).position?t.offsetParent:null}function ft(t){for(var e=Y(t),n=ut(t);n&&ct(n)&&"static"===at(n).position;)n=ut(n);return n&&("html"===X(n)||"body"===X(n)&&"static"===at(n).position)?e:n||function(t){var e=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&G(t)&&"fixed"===at(t).position)return null;for(var n=dt(t);G(n)&&["html","body"].indexOf(X(n))<0;){var r=at(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||e&&"filter"===r.willChange||e&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(t)||e}function pt(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ht(t,e,n){return et(t,nt(e,n))}function gt(t){return Object.assign({},{top:0,right:0,bottom:0,left:0},t)}function vt(t,e){return e.reduce(function(e,n){return e[n]=t,e},{})}function mt(t){return t.split("-")[1]}var yt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function bt(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,a=t.position,c=t.gpuAcceleration,l=t.adaptive,d=t.roundOffsets,u=t.isFixed,f=o.x,p=void 0===f?0:f,h=o.y,g=void 0===h?0:h,v="function"==typeof d?d({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var m=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),b=H,w=K,E=window;if(l){var x=ft(n),O="clientHeight",L="clientWidth";x===Y(n)&&"static"!==at(x=lt(n)).position&&"absolute"===a&&(O="scrollHeight",L="scrollWidth"),x=x,(i===K||(i===H||i===R)&&"end"===s)&&(w=W,g-=(u&&E.visualViewport?E.visualViewport.height:x[O])-r.height,g*=c?1:-1),i!==H&&(i!==K&&i!==W||"end"!==s)||(b=R,p-=(u&&E.visualViewport?E.visualViewport.width:x[L])-r.width,p*=c?1:-1)}var k,_=Object.assign({position:a},l&&yt),A=!0===d?function(t){var e=t.y,n=window.devicePixelRatio||1;return{x:rt(t.x*n)/n||0,y:rt(e*n)/n||0}}({x:p,y:g}):{x:p,y:g};return p=A.x,g=A.y,Object.assign({},_,c?((k={})[w]=y?"0":"",k[b]=m?"0":"",k.transform=(E.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",k):((e={})[w]=y?g+"px":"",e[b]=m?p+"px":"",e.transform="",e))}var wt={passive:!0},Et={left:"right",right:"left",bottom:"top",top:"bottom"};function xt(t){return t.replace(/left|right|bottom|top/g,function(t){return Et[t]})}var Ot={start:"end",end:"start"};function Lt(t){return t.replace(/start|end/g,function(t){return Ot[t]})}function kt(t){var e=Y(t);return{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function _t(t){return it(lt(t)).left+kt(t).scrollLeft}function At(t){var e=at(t);return/auto|scroll|overlay|hidden/.test(e.overflow+e.overflowY+e.overflowX)}function Pt(t){return["html","body","#document"].indexOf(X(t))>=0?t.ownerDocument.body:G(t)&&At(t)?t:Pt(dt(t))}function Ct(t,e){var n;void 0===e&&(e=[]);var r=Pt(t),i=r===(null==(n=t.ownerDocument)?void 0:n.body),s=Y(r),o=i?[s].concat(s.visualViewport||[],At(r)?r:[]):r,a=e.concat(o);return i?a:a.concat(Ct(dt(o)))}function St(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Dt(t,e){return"viewport"===e?St(function(t){var e=Y(t),n=lt(t),r=e.visualViewport,i=n.clientWidth,s=n.clientHeight,o=0,a=0;return r&&(i=r.width,s=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=r.offsetLeft,a=r.offsetTop)),{width:i,height:s,x:o+_t(t),y:a}}(t)):Z(e)?function(t){var e=it(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}(e):St(function(t){var e,n=lt(t),r=kt(t),i=null==(e=t.ownerDocument)?void 0:e.body,s=et(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=et(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),a=-r.scrollLeft+_t(t),c=-r.scrollTop;return"rtl"===at(i||n).direction&&(a+=et(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:a,y:c}}(lt(t)))}function Tt(t){var e,n=t.reference,r=t.element,i=t.placement,s=i?tt(i):null,o=i?mt(i):null,a=n.x+n.width/2-r.width/2,c=n.y+n.height/2-r.height/2;switch(s){case K:e={x:a,y:n.y-r.height};break;case W:e={x:a,y:n.y+n.height};break;case R:e={x:n.x+n.width,y:c};break;case H:e={x:n.x-r.width,y:c};break;default:e={x:n.x,y:n.y}}var l=s?pt(s):null;if(null!=l){var d="y"===l?"height":"width";switch(o){case"start":e[l]=e[l]-(n[d]/2-r[d]/2);break;case"end":e[l]=e[l]+(n[d]/2-r[d]/2)}}return e}function Mt(t,e){void 0===e&&(e={});var n=e.placement,r=void 0===n?t.placement:n,i=e.boundary,s=void 0===i?"clippingParents":i,o=e.rootBoundary,a=void 0===o?"viewport":o,c=e.elementContext,l=void 0===c?"popper":c,d=e.altBoundary,u=void 0!==d&&d,f=e.padding,p=void 0===f?0:f,h=gt("number"!=typeof p?p:vt(p,Q)),g=t.rects.popper,v=t.elements[u?"popper"===l?"reference":"popper":l],m=function(t,e,n){var r="clippingParents"===e?function(t){var e=Ct(dt(t)),n=["absolute","fixed"].indexOf(at(t).position)>=0&&G(t)?ft(t):t;return Z(n)?e.filter(function(t){return Z(t)&&ot(t,n)&&"body"!==X(t)}):[]}(t):[].concat(e),i=[].concat(r,[n]),s=i.reduce(function(e,n){var r=Dt(t,n);return e.top=et(r.top,e.top),e.right=nt(r.right,e.right),e.bottom=nt(r.bottom,e.bottom),e.left=et(r.left,e.left),e},Dt(t,i[0]));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}(Z(v)?v:v.contextElement||lt(t.elements.popper),s,a),y=it(t.elements.reference),b=Tt({reference:y,element:g,strategy:"absolute",placement:r}),w=St(Object.assign({},g,b)),E="popper"===l?w:y,x={top:m.top-E.top+h.top,bottom:E.bottom-m.bottom+h.bottom,left:m.left-E.left+h.left,right:E.right-m.right+h.right},O=t.modifiersData.offset;if("popper"===l&&O){var L=O[r];Object.keys(x).forEach(function(t){var e=[R,W].indexOf(t)>=0?1:-1,n=[K,W].indexOf(t)>=0?"y":"x";x[t]+=L[n]*e})}return x}function jt(t,e){void 0===e&&(e={});var n=e.boundary,r=e.rootBoundary,i=e.padding,s=e.flipVariations,o=e.allowedAutoPlacements,a=void 0===o?U:o,c=mt(e.placement),l=c?s?z:z.filter(function(t){return mt(t)===c}):Q,d=l.filter(function(t){return a.indexOf(t)>=0});0===d.length&&(d=l);var u=d.reduce(function(e,s){return e[s]=Mt(t,{placement:s,boundary:n,rootBoundary:r,padding:i})[tt(s)],e},{});return Object.keys(u).sort(function(t,e){return u[t]-u[e]})}function qt(t,e,n){return void 0===n&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function It(t){return[K,R,W,H].some(function(e){return t[e]>=0})}function Ft(t,e,n){void 0===n&&(n=!1);var r,i,s=G(e),o=G(e)&&function(t){var e=t.getBoundingClientRect(),n=rt(e.width)/t.offsetWidth||1,r=rt(e.height)/t.offsetHeight||1;return 1!==n||1!==r}(e),a=lt(e),c=it(t,o),l={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(s||!s&&!n)&&(("body"!==X(e)||At(a))&&(l=(r=e)!==Y(r)&&G(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:kt(r)),G(e)?((d=it(e,!0)).x+=e.clientLeft,d.y+=e.clientTop):a&&(d.x=_t(a))),{x:c.left+l.scrollLeft-d.x,y:c.top+l.scrollTop-d.y,width:c.width,height:c.height}}function Bt(t){var e=new Map,n=new Set,r=[];function i(t){n.add(t.name),[].concat(t.requires||[],t.requiresIfExists||[]).forEach(function(t){if(!n.has(t)){var r=e.get(t);r&&i(r)}}),r.push(t)}return t.forEach(function(t){e.set(t.name,t)}),t.forEach(function(t){n.has(t.name)||i(t)}),r}var Vt={placement:"bottom",modifiers:[],strategy:"absolute"};function Nt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(t){return!(t&&"function"==typeof t.getBoundingClientRect)})}function Kt(t){void 0===t&&(t={});var e=t.defaultModifiers,n=void 0===e?[]:e,r=t.defaultOptions,i=void 0===r?Vt:r;return function(t,e,r){void 0===r&&(r=i);var s,o,a={placement:"bottom",orderedModifiers:[],options:Object.assign({},Vt,i),modifiersData:{},elements:{reference:t,popper:e},attributes:{},styles:{}},c=[],l=!1,d={state:a,setOptions:function(r){var s="function"==typeof r?r(a.options):r;u(),a.options=Object.assign({},i,a.options,s),a.scrollParents={reference:Z(t)?Ct(t):t.contextElement?Ct(t.contextElement):[],popper:Ct(e)};var o,l,f=function(t){var e=Bt(t);return J.reduce(function(t,n){return t.concat(e.filter(function(t){return t.phase===n}))},[])}((o=[].concat(n,a.options.modifiers),l=o.reduce(function(t,e){var n=t[e.name];return t[e.name]=n?Object.assign({},n,e,{options:Object.assign({},n.options,e.options),data:Object.assign({},n.data,e.data)}):e,t},{}),Object.keys(l).map(function(t){return l[t]})));return a.orderedModifiers=f.filter(function(t){return t.enabled}),a.orderedModifiers.forEach(function(t){var e=t.options,n=t.effect;if("function"==typeof n){var r=n({state:a,name:t.name,instance:d,options:void 0===e?{}:e});c.push(r||function(){})}}),d.update()},forceUpdate:function(){if(!l){var t=a.elements,e=t.reference,n=t.popper;if(Nt(e,n)){a.rects={reference:Ft(e,ft(n),"fixed"===a.options.strategy),popper:st(n)},a.reset=!1,a.placement=a.options.placement,a.orderedModifiers.forEach(function(t){return a.modifiersData[t.name]=Object.assign({},t.data)});for(var r=0;r<a.orderedModifiers.length;r++)if(!0!==a.reset){var i=a.orderedModifiers[r],s=i.fn,o=i.options;"function"==typeof s&&(a=s({state:a,options:void 0===o?{}:o,name:i.name,instance:d})||a)}else a.reset=!1,r=-1}}},update:(s=function(){return new Promise(function(t){d.forceUpdate(),t(a)})},function(){return o||(o=new Promise(function(t){Promise.resolve().then(function(){o=void 0,t(s())})})),o}),destroy:function(){u(),l=!0}};if(!Nt(t,e))return d;function u(){c.forEach(function(t){return t()}),c=[]}return d.setOptions(r).then(function(t){!l&&r.onFirstUpdate&&r.onFirstUpdate(t)}),d}}var Wt=/*#__PURE__*/Kt({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=void 0===i||i,o=r.resize,a=void 0===o||o,c=Y(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&l.forEach(function(t){t.addEventListener("scroll",n.update,wt)}),a&&c.addEventListener("resize",n.update,wt),function(){s&&l.forEach(function(t){t.removeEventListener("scroll",n.update,wt)}),a&&c.removeEventListener("resize",n.update,wt)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(t){var e=t.state;e.modifiersData[t.name]=Tt({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=void 0===r||r,s=n.adaptive,o=void 0===s||s,a=n.roundOffsets,c=void 0===a||a,l={placement:tt(e.placement),variation:mt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:"fixed"===e.options.strategy};null!=e.modifiersData.popperOffsets&&(e.styles.popper=Object.assign({},e.styles.popper,bt(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),null!=e.modifiersData.arrow&&(e.styles.arrow=Object.assign({},e.styles.arrow,bt(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})},data:{}},{name:"applyStyles",enabled:!0,phase:"write",fn:function(t){var e=t.state;Object.keys(e.elements).forEach(function(t){var n=e.styles[t]||{},r=e.attributes[t]||{},i=e.elements[t];G(i)&&X(i)&&(Object.assign(i.style,n),Object.keys(r).forEach(function(t){var e=r[t];!1===e?i.removeAttribute(t):i.setAttribute(t,!0===e?"":e)}))})},effect:function(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(t){var r=e.elements[t],i=e.attributes[t]||{},s=Object.keys(e.styles.hasOwnProperty(t)?e.styles[t]:n[t]).reduce(function(t,e){return t[e]="",t},{});G(r)&&X(r)&&(Object.assign(r.style,s),Object.keys(i).forEach(function(t){r.removeAttribute(t)}))})}},requires:["computeStyles"]},{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(t){var e=t.state,n=t.name,r=t.options.offset,i=void 0===r?[0,0]:r,s=U.reduce(function(t,n){return t[n]=function(t,e,n){var r=tt(t),i=[H,K].indexOf(r)>=0?-1:1,s="function"==typeof n?n(Object.assign({},e,{placement:t})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*i,[H,R].indexOf(r)>=0?{x:a,y:o}:{x:o,y:a}}(n,e.rects,i),t},{}),o=s[e.placement],a=o.y;null!=e.modifiersData.popperOffsets&&(e.modifiersData.popperOffsets.x+=o.x,e.modifiersData.popperOffsets.y+=a),e.modifiersData[n]=s}},{name:"flip",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0===o||o,c=n.fallbackPlacements,l=n.padding,d=n.boundary,u=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=void 0===p||p,g=n.allowedAutoPlacements,v=e.options.placement,m=tt(v),y=c||(m!==v&&h?function(t){if("auto"===tt(t))return[];var e=xt(t);return[Lt(t),e,Lt(e)]}(v):[xt(v)]),b=[v].concat(y).reduce(function(t,n){return t.concat("auto"===tt(n)?jt(e,{placement:n,boundary:d,rootBoundary:u,padding:l,flipVariations:h,allowedAutoPlacements:g}):n)},[]),w=e.rects.reference,E=e.rects.popper,x=new Map,O=!0,L=b[0],k=0;k<b.length;k++){var _=b[k],A=tt(_),P="start"===mt(_),C=[K,W].indexOf(A)>=0,S=C?"width":"height",D=Mt(e,{placement:_,boundary:d,rootBoundary:u,altBoundary:f,padding:l}),T=C?P?R:H:P?W:K;w[S]>E[S]&&(T=xt(T));var M=xt(T),j=[];if(s&&j.push(D[A]<=0),a&&j.push(D[T]<=0,D[M]<=0),j.every(function(t){return t})){L=_,O=!1;break}x.set(_,j)}if(O)for(var q=function(t){var e=b.find(function(e){var n=x.get(e);if(n)return n.slice(0,t).every(function(t){return t})});if(e)return L=e,"break"},I=h?3:1;I>0&&"break"!==q(I);I--);e.placement!==L&&(e.modifiersData[r]._skip=!0,e.placement=L,e.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=void 0===i||i,o=n.altAxis,a=void 0!==o&&o,c=n.tether,l=void 0===c||c,d=n.tetherOffset,u=void 0===d?0:d,f=Mt(e,{boundary:n.boundary,rootBoundary:n.rootBoundary,padding:n.padding,altBoundary:n.altBoundary}),p=tt(e.placement),h=mt(e.placement),g=!h,v=pt(p),m="x"===v?"y":"x",y=e.modifiersData.popperOffsets,b=e.rects.reference,w=e.rects.popper,E="function"==typeof u?u(Object.assign({},e.rects,{placement:e.placement})):u,x="number"==typeof E?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),O=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,L={x:0,y:0};if(y){if(s){var k,_="y"===v?K:H,A="y"===v?W:R,P="y"===v?"height":"width",C=y[v],S=C+f[_],D=C-f[A],T=l?-w[P]/2:0,M="start"===h?b[P]:w[P],j="start"===h?-w[P]:-b[P],q=e.elements.arrow,I=l&&q?st(q):{width:0,height:0},F=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},B=F[_],V=F[A],N=ht(0,b[P],I[P]),Q=g?b[P]/2-T-N-B-x.mainAxis:M-N-B-x.mainAxis,z=g?-b[P]/2+T+N+V+x.mainAxis:j+N+V+x.mainAxis,U=e.elements.arrow&&ft(e.elements.arrow),J=null!=(k=null==O?void 0:O[v])?k:0,X=C+z-J,Y=ht(l?nt(S,C+Q-J-(U?"y"===v?U.clientTop||0:U.clientLeft||0:0)):S,C,l?et(D,X):D);y[v]=Y,L[v]=Y-C}if(a){var Z,G=y[m],$="y"===m?"height":"width",rt=G+f["x"===v?K:H],it=G-f["x"===v?W:R],ot=-1!==[K,H].indexOf(p),at=null!=(Z=null==O?void 0:O[m])?Z:0,ct=ot?rt:G-b[$]-w[$]-at+x.altAxis,lt=ot?G+b[$]+w[$]-at-x.altAxis:it,dt=l&&ot?function(t,e,n){var r=ht(t,e,n);return r>n?n:r}(ct,G,lt):ht(l?ct:rt,G,l?lt:it);y[m]=dt,L[m]=dt-G}e.modifiersData[r]=L}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=tt(n.placement),c=pt(a),l=[H,R].indexOf(a)>=0?"height":"width";if(s&&o){var d=function(t,e){return gt("number"!=typeof(t="function"==typeof t?t(Object.assign({},e.rects,{placement:e.placement})):t)?t:vt(t,Q))}(i.padding,n),u=st(s),f="y"===c?K:H,p="y"===c?W:R,h=n.rects.reference[l]+n.rects.reference[c]-o[c]-n.rects.popper[l],g=o[c]-n.rects.reference[c],v=ft(s),m=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-u[l]/2+(h/2-g/2),b=ht(d[f],y,m-u[l]-d[p]);n.modifiersData[r]=((e={})[c]=b,e.centerOffset=b-y,e)}},effect:function(t){var e=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=e.elements.popper.querySelector(r)))&&ot(e.elements.popper,r)&&(e.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=Mt(e,{elementContext:"reference"}),a=Mt(e,{altBoundary:!0}),c=qt(o,r),l=qt(a,i,s),d=It(c),u=It(l);e.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:u},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":u})}}]});function Rt(t,e,n){if(!e&&!(e=function(t,e){var n=t.getAttribute("data-"+e.dataTrigger).trim();return n?document.querySelector("[data-"+e.dataPopover+'="'+n+'"]'):!(!t.nextElementSibling||!t.nextElementSibling.hasAttribute("data-"+e.dataPopover))&&t.nextElementSibling}(t,n.settings)))return console.error("No popover associated with the provided trigger:",t),!1;var r,i=n.collection.findIndex(function(n){return n.trigger===t&&n.target===e});if(i>=0)r=n.collection[i];else{var s=Wt(t,e);r={state:"hide",trigger:t,target:e,popper:s,config:j(e,n.settings)},n.collection.push(r)}return Qt(r,n),r.target.classList.contains(n.settings.stateActive)?(F(r,n),N(r,n)):D(r,n),r}function Ht(t,e){var n=e.collection.findIndex(function(e){return e.trigger===t.trigger&&e.target===t.target});return n>=0&&("show"===t.state&&D(t,e),t.popper.destroy(),zt(t),e.collection.splice(n,1)),e.collection}function Qt(t,e){return t.__eventListeners||("hover"===q(t.target,e.settings.dataEventType,t.config.event)?(t.__eventListeners=[{el:["trigger"],type:["mouseenter","focus"],listener:F.bind(null,t,e)},{el:["trigger","target"],type:["mouseleave","focusout"],listener:M.bind(null,t,e)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})})):(t.__eventListeners=[{el:["trigger"],type:["click"],listener:B.bind(e,t)}],t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].addEventListener(r,e.listener,!1)})})}))),t}function zt(t){return t.__eventListeners&&(t.__eventListeners.forEach(function(e){e.el.forEach(function(n){e.type.forEach(function(r){t[n].removeEventListener(r,e.listener,!1)})})}),delete t.__eventListeners),t}function Ut(t){return document.querySelectorAll("[data-"+t.settings.dataTrigger+"]").forEach(function(e){Rt(e,!1,t)}),t.collection}function Jt(t){for(;t.collection.length>0;)Ht(t.collection[0],t);return t.collection}var Xt=/*#__PURE__*/function(){function t(t){this.defaults=S,this.settings=g({},this.defaults,t),this.collection=[],this.__handlerKeydown=V.bind(this),this.settings.autoInit&&this.init()}var e=t.prototype;return e.init=function(t){void 0===t&&(t=null),t&&(this.settings=g({},this.settings,t)),Ut(this),this.settings.eventListeners&&this.initEventListeners(!1)},e.destroy=function(){Jt(this),this.settings.eventListeners&&this.destroyEventListeners(!1)},e.initEventListeners=function(t){var e=this;void 0===t&&(t=!0),t&&this.collection.forEach(function(t){Qt(t,e)}),document.addEventListener("keydown",this.__handlerKeydown,!1)},e.destroyEventListeners=function(t){void 0===t&&(t=!0),t&&this.collection.forEach(function(t){zt(t)}),document.removeEventListener("keydown",this.__handlerKeydown,!1)},e.register=function(t,e){return void 0===e&&(e=!1),Rt(t,e,this)},e.deregister=function(t){return Ht(t,this)},e.registerCollection=function(){return Ut(this)},e.deregisterCollection=function(){return Jt(this)},e.show=function(t){return F(t,this)},e.hide=function(t){return D(t,this)},e.hideAll=function(){return T(this)},t}();exports.Checkbox=v,exports.Drawer=k,exports.Modal=C,exports.Popover=Xt,exports.core=h;
|
|
2
2
|
//# sourceMappingURL=scripts.js.map
|