blob: ed2e96d3a1a9b1b92eb43a7f1f339551c6389982 [file] [edit]
/*!
* Bootstrap v6.0.0-alpha.2 (https://getbootstrap.com/)
* Copyright 2011-2026 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
const elementMap=new Map;var data_default={set(e,t,n){elementMap.has(e)||elementMap.set(e,new Map),elementMap.get(e).set(t,n)},get:(e,t)=>e&&elementMap.has(e)&&elementMap.get(e).get(t)||null,remove(e,t){if(!elementMap.has(e))return;const n=elementMap.get(e);n.delete(t),0===n.size&&elementMap.delete(e)}};const namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","input","compositionstart","compositionupdate","compositionend","paste","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerover","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll","scrollend","hashchange"]);function makeEventUid(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getElementEvents(e){const t=makeEventUid(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function isMouseEventWithinTarget(e){const{delegateTarget:t,relatedTarget:n}=e;return Boolean(n&&t.contains(n))}function bootstrapHandler(e,t,n){const i=n in customEvents;return function s(o){const a=hydrateObj(o,{delegateTarget:e});if(!i||!isMouseEventWithinTarget(a))return s.oneOff&&EventHandler.off(e,n,t),t.apply(e,[a])}}function bootstrapDelegationHandler(e,t,n,i){const s=i in customEvents;return function o(a){const r=e.querySelectorAll(t);for(let{target:l}=a;l&&l!==this;l=l.parentNode)for(const c of r){if(c!==l)continue;const r=hydrateObj(a,{delegateTarget:l});if(s&&isMouseEventWithinTarget(r))return;return o.oneOff&&EventHandler.off(e,i,t,n),n.apply(l,[r])}}}function findHandler(e,t,n,i=null){return Object.values(e).find(e=>e.callable===t&&e.handlerTypeEvent===n&&e.delegationSelector===i)}function normalizeParameters(e,t,n){const i="string"==typeof t,s=i?n:t||n,o=e.replace(stripNameRegex,"");let a=customEvents[o]||o;return nativeEvents.has(a)||(a=e),{isDelegated:i,callable:s,typeEvent:a,handlerTypeEvent:o in customEvents?o:a}}function addHandler(e,t,n,i,s){if("string"!=typeof t||!e)return;const{isDelegated:o,callable:a,typeEvent:r,handlerTypeEvent:l}=normalizeParameters(t,n,i),c=getElementEvents(e),h=c[r]||(c[r]={}),u=findHandler(h,a,l,o?n:null);if(u)return void(u.oneOff=u.oneOff&&s);const d=makeEventUid(a,t.replace(namespaceRegex,"")),_=o?bootstrapDelegationHandler(e,n,a,l):bootstrapHandler(e,a,l);_.delegationSelector=o?n:null,_.callable=a,_.handlerTypeEvent=l,_.oneOff=s,_.uidEvent=d,h[d]=_,e.addEventListener(r,_,o)}function removeHandler(e,t,n,i){e.removeEventListener(n,i,Boolean(i.delegationSelector)),delete t[n][i.uidEvent]}function removeNamespacedHandlers(e,t,n,i){const s=t[n]||{};for(const[o,a]of Object.entries(s))o.includes(i)&&removeHandler(e,t,n,a)}function trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=hydrateObj(new Event(t,{bubbles:!0,cancelable:!0}),n);return e.dispatchEvent(i),i}const EventHandler={on(e,t,n,i){addHandler(e,t,n,i,!1)},one(e,t,n,i){addHandler(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const{isDelegated:s,callable:o,typeEvent:a,handlerTypeEvent:r}=normalizeParameters(t,n,i),l=a!==t&&r!==t,c=getElementEvents(e),h=c[a]||{},u=t.startsWith(".");if(void 0!==o){if(!Object.keys(h).length)return;const t=findHandler(h,o,r,s?n:null);return void(t&&removeHandler(e,c,a,t))}if(u)for(const n of Object.keys(c))removeNamespacedHandlers(e,c,n,t.slice(1));for(const[n,i]of Object.entries(h)){const s=n.replace(stripUidRegex,"");i.handlerTypeEvent!==r||l&&!t.includes(s)||removeHandler(e,c,a,i)}},trigger:trigger};function hydrateObj(e,t={}){for(const[n,i]of Object.entries(t))try{e[n]=i}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>i})}return e}function normalizeData(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function normalizeDataKey(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Manipulator={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${normalizeDataKey(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${normalizeDataKey(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=normalizeData(e.dataset[i])}return t},getDataAttribute:(e,t)=>normalizeData(e.getAttribute(`data-bs-${normalizeDataKey(t)}`))},MAX_UID=1e6,MILLISECONDS_MULTIPLIER=1e3,TRANSITION_END="transitionend",parseSelector=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),toType=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},getTransitionDurationFromElement=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);return Number.parseFloat(t)||Number.parseFloat(n)?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END))},isElement$1=e=>!(!e||"object"!=typeof e)&&void 0!==e.nodeType,getElement=e=>isElement$1(e)?e:"string"==typeof e&&e.length>0?document.querySelector(parseSelector(e)):null,isVisible=e=>{if(!isElement$1(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},isDisabled=e=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return!0;if(e.classList.contains("disabled"))return!0;const t=e;return void 0!==t.disabled?t.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")},setAriaAttribute=(e,t,n)=>{e.setAttribute(t,String(n))},findShadowRoot=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?findShadowRoot(e.parentNode):null},noop=()=>{},isRTL$1=()=>"rtl"===document.documentElement.dir,execute=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,executeAfterTransition=(e,t,n=!0)=>{if(!n)return void execute(e);const i=getTransitionDurationFromElement(t)+5,s=({target:n})=>{n===t&&(a(),execute(e))};t.addEventListener(TRANSITION_END,s);const o=setTimeout(()=>triggerTransitionEnd(t),i),a=()=>{clearTimeout(o),t.removeEventListener(TRANSITION_END,s)};return a},getNextActiveElement=(e,t,n,i)=>{const s=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[s-1]:e[0]:(o+=n?1:-1,i&&(o=(o+s)%s),e[Math.max(0,Math.min(o,s-1))])};var Config=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=isElement$1(t)?Manipulator.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...isElement$1(t)?Manipulator.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,i]of Object.entries(t)){const t=e[n],s=isElement$1(t)?"element":toType(t);if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${s}" but expected type "${i}".`)}}};const VERSION="6.0.0-alpha.2";var BaseComponent=class extends Config{constructor(e,t){if(super(),!(e=getElement(e)))return;this._element=e,this._config=this._getConfig(t);const n=data_default.get(this._element,this.constructor.DATA_KEY);n&&n.dispose(),data_default.set(this._element,this.constructor.DATA_KEY,this)}dispose(){data_default.remove(this._element,this.constructor.DATA_KEY),EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){return new Promise(i=>{executeAfterTransition(()=>{this._element&&e(),i()},t,n)})}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return data_default.get(getElement(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return VERSION}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}};const getSelector=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map(e=>parseSelector(e)).join(","):null},SelectorEngine={find:(e,t=document.documentElement)=>[...Element.prototype.querySelectorAll.call(t,e)],findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},closest:(e,t)=>Element.prototype.closest.call(e,t),prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},getSelectorFromElement(e){const t=getSelector(e);return t&&SelectorEngine.findOne(t)?t:null},getElementFromSelector(e){const t=getSelector(e);return t?SelectorEngine.findOne(t):null},getMultipleElementsFromSelector(e){const t=getSelector(e);return t?SelectorEngine.find(t):[]}},enableDismissTrigger=(e,t="hide")=>{const n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME,s="dialog"===i||"drawer"===i;EventHandler.on(document,n,`[data-bs-dismiss="${i}"]`,function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),isDisabled(this))return;const o=SelectorEngine.getElementFromSelector(this)||this.closest(`.${i}, [class*=":${i}"]`);o&&(!s||o instanceof HTMLDialogElement)&&e.getOrCreateInstance(o)[t]()})},eventActionOnPlugin=(e,t,n,i,s=null)=>{eventAction(`${t}.${e.NAME}`,n,t=>{const n=t.targets.filter(Boolean).map(t=>e.getOrCreateInstance(t));"function"==typeof s&&s({...t,instances:n});for(const e of n)e[i]()})},eventAction=(e,t,n)=>{const i=`${t}:not(.disabled):not(:disabled)`;EventHandler.on(document,e,i,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault();const t=SelectorEngine.getSelectorFromElement(this);n({targets:t?SelectorEngine.find(t):[this],event:e})})},onDocumentReady=(e,t)=>{EventHandler.on(document,e,t),"loading"!==document.readyState&&t()},NAME$20="alert",EVENT_KEY$17=".bs.alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert",CLASS_NAME_HIDING="hiding",CLASS_NAME_SHOW$7="show";var Alert=class extends BaseComponent{static get NAME(){return"alert"}async close(){if(EventHandler.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove("show"),this._element.classList.add("hiding");const e=getTransitionDurationFromElement(this._element)>0;await this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),EventHandler.trigger(this._element,EVENT_CLOSED),this.dispose()}};enableDismissTrigger(Alert,"close");const NAME$19="button",EVENT_KEY$16=".bs.button",DATA_API_KEY$11=".data-api",CLASS_NAME_ACTIVE$3="active",SELECTOR_DATA_TOGGLE$10='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$8="click.bs.button.data-api",EVENT_DOM_CONTENT_LOADED$1="DOMContentLoaded.bs.button.data-api";var Button=class extends BaseComponent{static get NAME(){return NAME$19}toggle(){setAriaAttribute(this._element,"aria-pressed",this._element.classList.toggle("active"))}};EventHandler.on(document,EVENT_CLICK_DATA_API$8,SELECTOR_DATA_TOGGLE$10,e=>{e.preventDefault();const t=e.target.closest(SELECTOR_DATA_TOGGLE$10);Button.getOrCreateInstance(t).toggle()}),onDocumentReady(EVENT_DOM_CONTENT_LOADED$1,()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_TOGGLE$10))e.hasAttribute("aria-pressed")||setAriaAttribute(e,"aria-pressed",e.classList.contains("active"))});const NAME$18="carousel",EVENT_KEY$15=".bs.carousel",DATA_API_KEY$10=".data-api",ARROW_LEFT_KEY$2="ArrowLeft",ARROW_RIGHT_KEY$2="ArrowRight",DIRECTION_LEFT="left",DIRECTION_RIGHT="right",EVENT_SLIDE=`slide${EVENT_KEY$15}`,EVENT_SLID=`slid${EVENT_KEY$15}`,EVENT_KEYDOWN$3=`keydown${EVENT_KEY$15}`,EVENT_MOUSEENTER$2=`mouseenter${EVENT_KEY$15}`,EVENT_MOUSELEAVE$1=`mouseleave${EVENT_KEY$15}`,EVENT_POINTERDOWN$3=`pointerdown${EVENT_KEY$15}`,EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$15}.data-api`,EVENT_CLICK_DATA_API$7=`click${EVENT_KEY$15}.data-api`,CLASS_NAME_CAROUSEL="carousel",CLASS_NAME_ACTIVE$2="active",CLASS_NAME_FADE="carousel-fade",CLASS_NAME_CENTER="carousel-center",CLASS_NAME_AUTO="carousel-auto",CLASS_NAME_CLONE="carousel-item-clone",CLASS_NAME_PAUSED="paused",CLASS_NAME_PLAYING="carousel-playing",PROPERTY_INTERVAL="--bs-carousel-interval",SCROLL_DURATION=300,ACTIVE_RATIO_TOLERANCE=.05,SELECTOR_ACTIVE=".active",SELECTOR_ITEM=`.carousel-item:not(.${CLASS_NAME_CLONE})`,SELECTOR_ACTIVE_ITEM=".active"+SELECTOR_ITEM,SELECTOR_INNER$1=".carousel-inner",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_PLAY_PAUSE=".carousel-control-play-pause",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_SLIDE_PREV='[data-bs-slide="prev"]',SELECTOR_DATA_SLIDE_NEXT='[data-bs-slide="next"]',SELECTOR_DATA_AUTOPLAY='[data-bs-autoplay="true"]',ENDS_STOP="stop",ENDS_WRAP="wrap",ENDS_LOOP="loop",Default$17={autoplay:!1,ends:ENDS_LOOP,interval:5e3,keyboard:!0,pause:"hover"},DefaultType$17={autoplay:"boolean",ends:"string",interval:"number",keyboard:"boolean",pause:"(string|boolean)"},easeInOutCubic=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;var Carousel=class extends BaseComponent{constructor(e,t){super(e,t),this._viewport=SelectorEngine.findOne(SELECTOR_INNER$1,this._element)||this._element,this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element),this._playPauseElement=SelectorEngine.findOne(SELECTOR_PLAY_PAUSE,this._element),this._prevControls=SelectorEngine.find('[data-bs-slide="prev"]',this._element),this._nextControls=SelectorEngine.find('[data-bs-slide="next"]',this._element),this._interval=null,this._observer=null,this._scrollFrame=null,this._looping=!1,this._visibility=new Map,this._playing=this._config.autoplay,this._activeIndex=this._initialActiveIndex(),this._addEventListeners(),this._observeItems(),this._refreshActiveState(),this._playing&&this.cycle(),this._updatePlayPauseControl()}static get Default(){return Default$17}static get DefaultType(){return DefaultType$17}static get NAME(){return NAME$18}next(){this.to(this._navIndex()+1)}nextWhenVisible(){"visible"===document.visibilityState&&isVisible(this._element)&&this.next()}prev(){this.to(this._navIndex()-1)}pause(){this._clearInterval(),this._element.classList.remove("carousel-playing")}cycle(){this._clearInterval(),this._scheduleAutoplay(),this._element.classList.add("carousel-playing")}to(e){if(this._looping)return;const t=this._getItems(),n=Number.parseInt(e,10);if(this._config.ends===ENDS_LOOP&&!this._prefersReducedMotion()&&this._canLoop()){if(n>t.length-1)return void this._loopTransition(!0);if(n<0)return void this._loopTransition(!1)}const i=this._normalizeIndex(n,t.length),s=this._navIndex();null!==i&&i!==s&&(EventHandler.trigger(this._element,EVENT_SLIDE,{relatedTarget:t[i],direction:this._direction(s,i),from:s,to:i}).defaultPrevented||(this._isFade()?this._fadeTo(i):this._scrollToIndex(i)))}dispose(){this._clearInterval(),this._observer&&this._observer.disconnect(),null!==this._scrollFrame&&cancelAnimationFrame(this._scrollFrame);for(const e of SelectorEngine.find(`.${CLASS_NAME_CLONE}`,this._viewport))e.remove();this._viewport.style.scrollSnapType="",EventHandler.off(this._viewport,EVENT_KEY$15),super.dispose()}_configAfterMerge(e){return[ENDS_STOP,ENDS_WRAP,ENDS_LOOP].includes(e.ends)||(e.ends=Default$17.ends),e}_initialActiveIndex(){const e=SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element),t=e?this._getItems().indexOf(e):0;return Math.max(t,0)}_addEventListeners(){this._config.keyboard&&EventHandler.on(this._element,EVENT_KEYDOWN$3,e=>this._keydown(e)),"hover"===this._config.pause&&(EventHandler.on(this._element,EVENT_MOUSEENTER$2,()=>this.pause()),EventHandler.on(this._element,EVENT_MOUSELEAVE$1,()=>this._maybeEnableCycle())),EventHandler.on(this._viewport,EVENT_POINTERDOWN$3,()=>this._pauseFromInteraction())}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const{key:t}=e;"ArrowLeft"!==t&&"ArrowRight"!==t||(e.preventDefault(),this._pauseFromInteraction(),t===(isRTL$1()?"ArrowLeft":"ArrowRight")?this.next():this.prev())}_observeItems(){if(!this._isFade()&&"undefined"!=typeof IntersectionObserver){this._observer=new IntersectionObserver(e=>this._handleIntersection(e),{root:this._viewport,threshold:[0,.25,.5,.75,1]});for(const e of this._getItems())this._observer.observe(e)}}_handleIntersection(e){if(this._looping)return;for(const t of e)this._visibility.set(t.target,t.isIntersecting?t.intersectionRatio:0);const t=this._getItems().map(e=>this._visibility.get(e)??0),n=Math.max(...t);let i=this._activeIndex;n>0&&(i=t.findIndex(e=>e>=n-.05)),this._setActive(i),this._updateEndControls()}_navIndex(){if(this._isFade()||this._viewport.scrollWidth-this._viewport.clientWidth<=0)return this._activeIndex;let e=this._activeIndex,t=Number.POSITIVE_INFINITY;for(const[n,i]of this._getItems().entries()){const s=Math.abs(this._scrollDelta(i));s<t&&(t=s,e=n)}return e}_scrollToIndex(e){const t=this._getItems()[e];if(!t)return;const n=this._scrollDelta(t);if(Math.abs(n)<1)return;const i=this._viewport.scrollLeft+n;this._viewport.style.scrollSnapType="none",this._animateScroll(i,()=>{this._viewport.style.scrollSnapType="",this._observer||this._setActive(e),this._updateEndControls()})}_animateScroll(e,t){null!==this._scrollFrame&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null);const n=this._viewport.scrollLeft,i=e-n;if(this._prefersReducedMotion()||"undefined"==typeof requestAnimationFrame)return this._viewport.scrollTo({left:e,behavior:"instant"}),void t();let s=null;const o=a=>{null===s&&(s=a);const r=Math.min((a-s)/300,1);this._viewport.scrollTo({left:n+i*easeInOutCubic(r),behavior:"instant"}),r<1?this._scrollFrame=requestAnimationFrame(o):(this._viewport.scrollTo({left:e,behavior:"instant"}),this._scrollFrame=null,t())};this._scrollFrame=requestAnimationFrame(o)}_scrollDelta(e){const t=this._viewport.getBoundingClientRect(),n=e.getBoundingClientRect();if(this._element.classList.contains("carousel-center"))return n.left+n.width/2-(t.left+t.width/2);const i=Number.parseFloat(getComputedStyle(this._viewport).scrollPaddingInlineStart)||0;return isRTL$1()?n.right-(t.right-i):n.left-(t.left+i)}_loopTransition(e){const t=this._getItems(),n=t.length-1,i=this._activeIndex,s=e?0:n,o=this._loopDirection(e);if(EventHandler.trigger(this._element,EVENT_SLIDE,{relatedTarget:t[s],direction:o,from:i,to:s}).defaultPrevented)return;this._looping=!0;const a=(e?t[0]:t[n]).cloneNode(!0);a.classList.add(CLASS_NAME_CLONE),a.classList.remove("active"),a.removeAttribute("id");for(const e of SelectorEngine.find("[id]",a))e.removeAttribute("id");a.setAttribute("aria-hidden","true"),a.inert=!0,this._viewport.style.scrollSnapType="none",e?this._viewport.append(a):(this._viewport.prepend(a),this._jumpScroll(this._scrollDelta(t[i]))),this._animateScroll(this._viewport.scrollLeft+this._scrollDelta(a),()=>{a.remove(),this._jumpScroll(this._scrollDelta(t[s])),this._activeIndex=s,this._refreshActiveState(),EventHandler.trigger(this._element,EVENT_SLID,{relatedTarget:t[s],direction:o,from:i,to:s}),this._viewport.style.scrollSnapType="",this._looping=!1})}_loopDirection(e){return isRTL$1()?e?"right":"left":e?"left":"right"}_jumpScroll(e){this._viewport.style.scrollSnapType="none",this._viewport.scrollBy({left:e,top:0,behavior:"instant"})}_fadeTo(e){this._setActive(e)}_setActive(e){const t=this._getItems();if(e===this._activeIndex||!t[e])return;const n=this._activeIndex;this._activeIndex=e,this._refreshActiveState(),EventHandler.trigger(this._element,EVENT_SLID,{relatedTarget:t[e],direction:this._direction(n,e),from:n,to:e})}_refreshActiveState(){const e=this._getItems();for(const[t,n]of e.entries())n.classList.toggle("active",t===this._activeIndex);this._setActiveIndicatorElement(this._activeIndex),this._updateEndControls()}_updateEndControls(){if(this._config.ends!==ENDS_STOP)return;const e=this._viewport,t=e.scrollWidth-e.clientWidth;let n,i;if(t>0){const s=Math.abs(e.scrollLeft);n=s<=1,i=s>=t-1}else{const e=this._getItems().length-1;n=this._activeIndex<=0,i=this._activeIndex>=e}this._setControlsDisabled(this._prevControls,n),this._setControlsDisabled(this._nextControls,i)}_setControlsDisabled(e,t){for(const n of e)t&&n===document.activeElement&&(((e===this._prevControls?this._nextControls:this._prevControls)[0]??this._viewport).focus({preventScroll:!0}),document.activeElement===n&&n.blur()),n.disabled=t}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine.findOne(".active",this._indicatorsElement);t&&(t.classList.remove("active"),t.removeAttribute("aria-current"));const n=SelectorEngine.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add("active"),n.setAttribute("aria-current","true"))}_normalizeIndex(e,t){return Number.isNaN(e)||0===t?null:e<0?this._wrapsAround()?t-1:null:e>t-1?this._wrapsAround()?0:null:e}_wrapsAround(){return this._config.ends===ENDS_WRAP||this._config.ends===ENDS_LOOP}_canLoop(){if(this._isFade()||this._getItems().length<2)return!1;const e=getComputedStyle(this._element),t=t=>Number.parseFloat(e.getPropertyValue(t))||0;return 1===(t("--bs-carousel-items")||1)&&0===t("--bs-carousel-items-peek")&&!this._element.classList.contains("carousel-center")&&!this._element.classList.contains("carousel-auto")}_direction(e,t){const n=t>e;return isRTL$1()?n?"right":"left":n?"left":"right"}_scheduleAutoplay(e=this._activeIndex){const t=this._itemInterval(e);this._element.style.setProperty(PROPERTY_INTERVAL,`${t}ms`),this._interval=setTimeout(()=>{const e=this._upcomingIndex();this.nextWhenVisible(),null!==e?this._scheduleAutoplay(e):this.pause()},t)}_upcomingIndex(){return this._normalizeIndex(this._navIndex()+1,this._getItems().length)}_itemInterval(e=this._activeIndex){const t=this._getItems()[e],n=t?Number.parseInt(t.getAttribute("data-bs-interval"),10):NaN;return Number.isNaN(n)?this._config.interval:n}_maybeEnableCycle(){this._playing&&this.cycle()}_pauseFromInteraction(){this._playing=!1,this.pause(),this._updatePlayPauseControl()}_togglePlayPause(){this._playing?this._pauseFromInteraction():(this._playing=!0,this.cycle(),this._updatePlayPauseControl())}_updatePlayPauseControl(){if(!this._playPauseElement)return;this._playPauseElement.classList.toggle("paused",!this._playing);const e=this._playPauseElement.getAttribute(this._playing?"data-bs-pause-label":"data-bs-play-label");e&&this._playPauseElement.setAttribute("aria-label",e)}_isFade(){return this._element.classList.contains("carousel-fade")}_prefersReducedMotion(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearTimeout(this._interval),this._interval=null)}};EventHandler.on(document,EVENT_CLICK_DATA_API$7,SELECTOR_DATA_SLIDE,function(e){const t=SelectorEngine.getElementFromSelector(this);if(!t||!t.classList.contains("carousel"))return;e.preventDefault();const n=Carousel.getOrCreateInstance(t);n._pauseFromInteraction();const i=this.getAttribute("data-bs-slide-to");i?n.to(i):"next"!==Manipulator.getDataAttribute(this,"slide")?n.prev():n.next()}),EventHandler.on(document,EVENT_CLICK_DATA_API$7,SELECTOR_PLAY_PAUSE,function(e){const t=SelectorEngine.getElementFromSelector(this);t&&t.classList.contains("carousel")&&(e.preventDefault(),Carousel.getOrCreateInstance(t)._togglePlayPause())}),EventHandler.on(window,EVENT_LOAD_DATA_API$3,()=>{const e=SelectorEngine.find(SELECTOR_DATA_AUTOPLAY);for(const t of e)Carousel.getOrCreateInstance(t)});const decodeFragment$1=e=>{try{return decodeURIComponent(e)}catch{return e}},getHashTarget=()=>{const{hash:e}=window.location;if(!e||"#"===e)return null;const t=decodeFragment$1(e.slice(1));if(!t)return null;const n=document.getElementById(t);return n?.hasAttribute("data-bs-hash")?n:null},enableHashTarget=(e,t)=>{let n=0;const i=()=>{const e=++n,i=getHashTarget();if(!i||!t.matches(i))return;const s=t.getAnchor?.(i);s&&s.scrollIntoView(),t.open(i,()=>{e===n&&i.isConnected&&getHashTarget()===i&&i.scrollIntoView()})};EventHandler.on(window,`load${e}`,i),EventHandler.on(window,`hashchange${e}`,i),"complete"===document.readyState&&i()},NAME$17="collapse",EVENT_KEY$14=".bs.collapse",DATA_API_KEY$9=".data-api",EVENT_SHOW$5=`show${EVENT_KEY$14}`,EVENT_SHOWN$5=`shown${EVENT_KEY$14}`,EVENT_HIDE$5=`hide${EVENT_KEY$14}`,EVENT_HIDDEN$5=`hidden${EVENT_KEY$14}`,EVENT_CLICK_DATA_API$6=`click${EVENT_KEY$14}.data-api`,CLASS_NAME_SHOW$6="show",CLASS_NAME_COLLAPSE="collapse",CLASS_NAME_DEEPER_CHILDREN=":scope .collapse .collapse",SELECTOR_ACTIVES=".collapse.show",SELECTOR_DATA_TOGGLE$9='[data-bs-toggle="collapse"]',Default$16={parent:null},DefaultType$16={parent:"(null|element)"};var Collapse=class e extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=SelectorEngine.find(SELECTOR_DATA_TOGGLE$9);for(const e of n){const t=SelectorEngine.getSelectorFromElement(e),n=SelectorEngine.find(t).filter(e=>e===this._element);null!==t&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._setAriaExpanded(this._triggerArray,this._isShown())}static get Default(){return Default$16}static get DefaultType(){return DefaultType$16}static get NAME(){return NAME$17}toggle(){return this._isShown()?this.hide():this.show()}async show(){if(this._isTransitioning||this._isShown())return;let t=[];if(!(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show").filter(e=>e!==this._element&&!this._sharesTrigger(e)).map(t=>e.getOrCreateInstance(t))),t.length&&t[0]._isTransitioning||EventHandler.trigger(this._element,EVENT_SHOW$5).defaultPrevented)){for(const e of t)e.hide();this._element.classList.add("show"),this._setAriaExpanded(this._triggerArray,!0),this._isTransitioning=!0,await this._queueCallback(()=>{this._isTransitioning=!1,EventHandler.trigger(this._element,EVENT_SHOWN$5)},this._element,this._isAnimated())}}async hide(){if(!this._isTransitioning&&this._isShown()&&!EventHandler.trigger(this._element,EVENT_HIDE$5).defaultPrevented){this._element.classList.remove("show");for(const e of this._triggerArray){const t=SelectorEngine.getElementFromSelector(e);t&&!this._isShown(t)&&this._setAriaExpanded([e],!1)}this._isTransitioning=!0,await this._queueCallback(()=>{this._isTransitioning=!1,EventHandler.trigger(this._element,EVENT_HIDDEN$5)},this._element,this._isAnimated())}}_isShown(e=this._element){return e.classList.contains("show")}_isAnimated(){return getTransitionDurationFromElement(this._element)>0}_sharesTrigger(e){return this._triggerArray.some(t=>SelectorEngine.getMultipleElementsFromSelector(t).includes(e))}_configAfterMerge(e){return e.parent=getElement(e.parent),e}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$9);for(const t of e){const e=SelectorEngine.getElementFromSelector(t);e&&this._setAriaExpanded([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine.find(e,this._config.parent).filter(e=>!t.includes(e))}_setAriaExpanded(e,t){if(e.length)for(const n of e)setAriaAttribute(n,"aria-expanded",t)}};EventHandler.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_DATA_TOGGLE$9,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of SelectorEngine.getMultipleElementsFromSelector(this))Collapse.getOrCreateInstance(e).toggle()});const getCollapseTrigger=e=>{for(const t of SelectorEngine.find(SELECTOR_DATA_TOGGLE$9))if(SelectorEngine.getMultipleElementsFromSelector(t).includes(e))return t;return null};enableHashTarget(`${EVENT_KEY$14}.data-api`,{matches:e=>e.classList.contains("collapse"),getAnchor:getCollapseTrigger,async open(e,t){e.classList.contains("show")?t():(await Collapse.getOrCreateInstance(e).show(),e.classList.contains("show")&&t())}});const min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"};function clamp(e,t,n){return max(e,min(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}function getSideAxis(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const i=getAlignment(e),s=getAlignmentAxis(e),o=getAxisLength(s);let a="x"===s?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=getOppositePlacement(a)),[a,getOppositePlacement(a)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,i){const s=getAlignment(e);let o=getSideList(getSide(e),"start"===n,i);return s&&(o=o.map(e=>e+"-"+s),t&&(o=o.concat(o.map(getOppositeAlignmentPlacement)))),o}function getOppositePlacement(e){const t=getSide(e);return oppositeSideMap[t]+e.slice(t.length)}function expandPaddingObject(e){var t,n,i,s;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(i=e.bottom)?i:0,left:null!=(s=e.left)?s:0}}function getPaddingObject(e){return"number"!=typeof e?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:i,floating:s}=e;const o=getSideAxis(t),a=getAlignmentAxis(t),r=getAxisLength(a),l=getSide(t),c="y"===o,h=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,d=i[r]/2-s[r]/2;let _;switch(l){case"top":_={x:h,y:i.y-s.height};break;case"bottom":_={x:h,y:i.y+i.height};break;case"right":_={x:i.x+i.width,y:u};break;case"left":_={x:i.x-s.width,y:u};break;default:_={x:i.x,y:i.y}}const m=getAlignment(t);return m&&(_[a]+=d*("end"===m?1:-1)*(n&&c?-1:1)),_}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:i,y:s,platform:o,rects:a,elements:r,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:d=!1,padding:_=0}=evaluate(t,e),m=getPaddingObject(_),p=r[d?"floating"===u?"reference":"floating":u],g=rectToClientRect(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(p)))||n?p:p.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(r.floating)),boundary:c,rootBoundary:h,strategy:l})),E="floating"===u?{x:i,y:s,width:a.floating.width,height:a.floating.height}:a.reference,f=await(null==o.getOffsetParent?void 0:o.getOffsetParent(r.floating)),v=await(null==o.isElement?void 0:o.isElement(f))&&await(null==o.getScale?void 0:o.getScale(f))||{x:1,y:1},b=rectToClientRect(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:r,rect:E,offsetParent:f,strategy:l}):E);return{top:(g.top-b.top+m.top)/v.y,bottom:(b.bottom-g.bottom+m.bottom)/v.y,left:(g.left-b.left+m.left)/v.x,right:(b.right-g.right+m.right)/v.x}}const MAX_RESET_COUNT=50,computePosition$1=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,r=a.detectOverflow?a:{...a,detectOverflow:detectOverflow},l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:u}=computeCoordsFromPlacement(c,i,l),d=i,_=0;const m={};for(let n=0;n<o.length;n++){const p=o[n];if(!p)continue;const{name:g,fn:E}=p,{x:f,y:v,data:b,reset:T}=await E({x:h,y:u,initialPlacement:i,placement:d,strategy:s,middlewareData:m,rects:c,platform:r,elements:{reference:e,floating:t}});h=null!=f?f:h,u=null!=v?v:u,m[g]={...m[g],...b},T&&_<50&&(_++,"object"==typeof T&&(T.placement&&(d=T.placement),T.rects&&(c=!0===T.rects?await a.getElementRects({reference:e,floating:t,strategy:s}):T.rects),({x:h,y:u}=computeCoordsFromPlacement(c,d,l))),n=-1)}return{x:h,y:u,placement:d,strategy:s,middlewareData:m}},arrow$1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:o,platform:a,elements:r,middlewareData:l}=t,{element:c,padding:h=0}=evaluate(e,t)||{};if(null==c)return{};const u=getPaddingObject(h),d={x:n,y:i},_=getAlignmentAxis(s),m=getAxisLength(_),p=await a.getDimensions(c),g="y"===_,E=g?"top":"left",f=g?"bottom":"right",v=g?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[_]-d[_]-o.floating[m],T=d[_]-o.reference[_],y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=y?y[v]:0;S&&await(null==a.isElement?void 0:a.isElement(y))||(S=r.floating[v]||o.floating[m]);const A=b/2-T/2,w=S/2-p[m]/2-1,C=min(u[E],w),D=min(u[f],w),N=S-p[m]-D,O=S/2-p[m]/2+A,x=clamp(C,O,N),I=!l.arrow&&null!=getAlignment(s)&&O!==x&&o.reference[m]/2-(O<C?C:D)-p[m]/2<0,L=I?O<C?O-C:O-N:0;return{[_]:d[_]+L,data:{[_]:x,centerOffset:O-x-L,...I&&{alignmentOffset:L}},reset:I}}}),flip$1=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:r,platform:l,elements:c}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=evaluate(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const E=getSide(s),f=getSideAxis(r),v=getSide(r)===r,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),T=d||(v||!p?[getOppositePlacement(r)]:getExpandedPlacements(r)),y="none"!==m;!d&&y&&T.push(...getOppositeAxisPlacements(r,p,m,b));const S=[r,...T],A=await l.detectOverflow(t,g),w=[];let C=(null==(i=o.flip)?void 0:i.overflows)||[];if(h&&w.push(A[E]),u){const e=getAlignmentSides(s,a,b);w.push(A[e[0]],A[e[1]])}if(C=[...C,{placement:s,overflows:w}],!w.every(e=>e<=0)){var D,N;const e=((null==(D=o.flip)?void 0:D.index)||0)+1,t=S[e];if(t&&("alignment"!==u||f===getSideAxis(t)||C.every(e=>getSideAxis(e.placement)!==f||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(N=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!n)switch(_){case"bestFit":{var O;const e=null==(O=C.filter(e=>{if(y){const t=getSideAxis(e.placement);return t===f||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=r}if(s!==n)return{reset:{placement:n}}}return{}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:i,elements:s}=e,o=await(null==i.isRTL?void 0:i.isRTL(s.floating)),a=getSide(n),r=getAlignment(n),l="y"===getSideAxis(n),c=originSides.has(a)?-1:1,h=o&&l?-1:1,u=evaluate(t,e);let{mainAxis:d,crossAxis:_,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return r&&"number"==typeof m&&(_="end"===r?-1*m:m),l?{x:_*h,y:d*c}:{x:d*c,y:_*h}}const offset$1=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:o,placement:a,middlewareData:r}=t,l=await convertValueToCoords(t,e);return a===(null==(n=r.offset)?void 0:n.placement)&&null!=(i=r.arrow)&&i.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:a}}}}},shift$1=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s,platform:o}=t,{mainAxis:a=!0,crossAxis:r=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=evaluate(e,t),h={x:n,y:i},u=await o.detectOverflow(t,c),d=getSideAxis(s),_=getOppositeAxis(d);let m=h[_],p=h[d];const g=(e,t)=>clamp(t+u["y"===e?"top":"left"],t,t-u["y"===e?"bottom":"right"]);a&&(m=g(_,m)),r&&(p=g(d,p));const E=l.fn({...t,[_]:m,[d]:p});return{...E,data:{x:E.x-n,y:E.y-i,enabled:{[_]:a,[d]:r}}}}}},size$1=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:s,elements:o}=t,{apply:a=()=>{},...r}=evaluate(e,t),l=await s.detectOverflow(t,r),c=getSide(n),h=getAlignment(n),u="y"===getSideAxis(n),{width:d,height:_}=i.floating;let m,p;"top"===c||"bottom"===c?(m=c,p=h===(await(null==s.isRTL?void 0:s.isRTL(o.floating))?"start":"end")?"left":"right"):(p=c,m="end"===h?"top":"bottom");const g=_-l.top-l.bottom,E=d-l.left-l.right,f=min(_-l[m],g),v=min(d-l[p],E),b=t.middlewareData.shift,T=!b;let y=f,S=v;null!=b&&b.enabled.x&&(S=E),null!=b&&b.enabled.y&&(y=g),T&&!h&&(u?S=d-2*max(l.left,l.right):y=_-2*max(l.top,l.bottom)),await a({...t,availableWidth:S,availableHeight:y});const A=await s.getDimensions(o.floating);return d!==A.width||_!==A.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return"undefined"!=typeof window}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&"inline"!==s&&"contents"!==s}function isTableElement(e){return/^(table|td|th)$/.test(getNodeName(e))}function isTopLayer(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const willChangeRe=/transform|translate|scale|rotate|perspective|filter/,containRe=/paint|layout|strict|content/,isNotNone=e=>!!e&&"none"!==e;let isWebKitValue;function isContainingBlock(e){const t=isElement(e)?getComputedStyle$1(e):e;return isNotNone(t.transform)||isNotNone(t.translate)||isNotNone(t.scale)||isNotNone(t.rotate)||isNotNone(t.perspective)||!isWebKit()&&(isNotNone(t.backdropFilter)||isNotNone(t.filter))||willChangeRe.test(t.willChange||"")||containRe.test(t.contain||"")}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return null==isWebKitValue&&(isWebKitValue="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),isWebKitValue}function isLastTraversableNode(e){return/^(html|body|#document)$/.test(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?(e.ownerDocument||e).body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const s=getNearestOverflowAncestor(e),o=s===(null==(i=e.ownerDocument)?void 0:i.body),a=getWindow(s);if(o){const e=getFrameElement(a);return t.concat(a,a.visualViewport||[],isOverflowElement(s)?s:[],e&&n?getOverflowAncestors(e):[])}return t.concat(s,getOverflowAncestors(s,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=isHTMLElement(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:i,r=round(n)!==o||round(i)!==a;return r&&(n=o,i=a),{width:n,height:i,$:r}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=getCssDimensions(t);let a=(o?round(n.width):n.width)/i,r=(o?round(n.height):n.height)/s;return a&&Number.isFinite(a)||(a=1),r&&Number.isFinite(r)||(r=1),{x:a,y:r}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===getWindow(e)}function getBoundingClientRect(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),o=unwrapElement(e);let a=createCoords(1);t&&(i?isElement(i)&&(a=getScale(i)):a=getScale(e));const r=shouldAddVisualOffsets(o,n,i)?getVisualOffsets(o):createCoords(0);let l=(s.left+r.x)/a.x,c=(s.top+r.y)/a.y,h=s.width/a.x,u=s.height/a.y;if(o&&i){const e=getWindow(o),t=isElement(i)?getWindow(i):i;let n=e,s=getFrameElement(n);for(;s&&t!==n;){const e=getScale(s),t=s.getBoundingClientRect(),i=getComputedStyle$1(s),o=t.left+(s.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(s.clientTop+parseFloat(i.paddingTop))*e.y;l*=e.x,c*=e.y,h*=e.x,u*=e.y,l+=o,c+=a,n=getWindow(s),s=getFrameElement(n)}}return rectToClientRect({width:h,height:u,x:l,y:c})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o="fixed"===s,a=getDocumentElement(i),r=!!t&&isTopLayer(t.floating);if(i===a||r&&o)return n;let l={scrollLeft:0,scrollTop:0},c=createCoords(1);const h=createCoords(0),u=isHTMLElement(i);if((u||!o)&&(("body"!==getNodeName(i)||isOverflowElement(a))&&(l=getNodeScroll(i)),u)){const e=getBoundingClientRect(i);c=getScale(i),h.x=e.x+i.clientLeft,h.y=e.y+i.clientTop}const d=!a||u||o?createCoords(0):getHTMLOffset(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+d.x,y:n.y*c.y-l.scrollTop*c.y+h.y+d.y}}function getClientRects(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function getDocumentRect(e){const t=getNodeScroll(e),n=e.ownerDocument.body,i=max(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),s=max(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+getWindowScrollBarX(e);const a=-t.scrollTop;return"rtl"===getComputedStyle$1(n).direction&&(o+=max(e.clientWidth,n.clientWidth)-i),{width:i,height:s,x:o,y:a}}const SCROLLBAR_MAX=25;function getViewportRect(e,t,n){void 0===n&&(n="viewport");const i="layoutViewport"===n,s=getWindow(e),o=getDocumentElement(e),a=s.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,h=0;if(a){const e=!isWebKit()||"fixed"===t;i?e||(c=-a.offsetLeft,h=-a.offsetTop):(r=a.width,l=a.height,e&&(c=a.offsetLeft,h=a.offsetTop))}if(getWindowScrollBarX(o)<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),i="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-t.clientWidth-i),a="stable both-edges"===getComputedStyle(o).scrollbarGutter?s/2:s;a<=25&&(r-=a)}return{width:r,height:l,x:c,y:h}}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=getScale(e);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:s*o.x,y:i*o.y}}function getClientRectFromClippingAncestor(e,t,n){let i;if("viewport"===t||"layoutViewport"===t)i=getViewportRect(e,n,t);else if("document"===t)i=getDocumentRect(getDocumentElement(e));else if(isElement(t))i=getInnerBoundingClientRect(t,n);else{const n=getVisualOffsets(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(i)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let i=getOverflowAncestors(e,[],!1).filter(e=>isElement(e)&&"body"!==getNodeName(e)),s=null;const o="fixed"===getComputedStyle$1(e).position;let a=o?getParentNode(e):e;for(;isElement(a)&&!isLastTraversableNode(a);){const e=getComputedStyle$1(a),t=isContainingBlock(a),n=s?s.position:o?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?s=e:i=i.filter(e=>e!==a),a=getParentNode(a)}return t.set(e,i),i}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=[..."clippingAncestors"===n?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),i],a=getClientRectFromClippingAncestor(t,o[0],s);let r=a.top,l=a.right,c=a.bottom,h=a.left;for(let e=1;e<o.length;e++){const n=getClientRectFromClippingAncestor(t,o[e],s);r=max(n.top,r),l=min(n.right,l),c=min(n.bottom,c),h=max(n.left,h)}return{width:l-h,height:c-r,x:h,y:r}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const i=isHTMLElement(t),s=getDocumentElement(t),o="fixed"===n,a=getBoundingClientRect(e,!0,o,t);let r={scrollLeft:0,scrollTop:0};const l=createCoords(0);if((i||!o)&&(("body"!==getNodeName(t)||isOverflowElement(s))&&(r=getNodeScroll(t)),i)){const e=getBoundingClientRect(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}!i&&s&&(l.x=getWindowScrollBarX(s));const c=!s||i||o?createCoords(0):getHTMLOffset(s,r);return{x:a.left+r.scrollLeft-l.x-c.x,y:a.top+r.scrollTop-l.y-c.y,width:a.width,height:a.height}}function isStaticPositioned(e){return"static"===getComputedStyle$1(e).position}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||"fixed"===getComputedStyle$1(e).position)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let i=getTrueOffsetParent(e,t);for(;i&&isTableElement(i)&&isStaticPositioned(i);)i=getTrueOffsetParent(i,t);return i&&isLastTraversableNode(i)&&isStaticPositioned(i)&&!isContainingBlock(i)?n:i||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,i=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function isRTL(e){return"rtl"===getComputedStyle$1(e).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t,n){let i,s=null;const o=getDocumentElement(e);function a(){var e;clearTimeout(i),null==(e=s)||e.disconnect(),s=null}function r(n,l){void 0===n&&(n=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:h,top:u,width:d,height:_}=c;if(n||t(),!d||!_)return;const m={rootMargin:-floor(u)+"px "+-floor(o.clientWidth-(h+d))+"px "+-floor(o.clientHeight-(u+_))+"px "+-floor(h)+"px",threshold:max(0,min(1,l))||1};let p=!0;function g(t){const n=t[0].intersectionRatio;if(!rectsAreEqual(c,e.getBoundingClientRect()))return r();if(n!==l){if(!p)return r();n?r(!1,n):i=setTimeout(()=>{r(!1,1e-7)},1e3)}p=!1}try{s=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){s=new IntersectionObserver(g,m)}s.observe(e)}const l=getWindow(e),c=()=>r(n);return l.addEventListener("resize",c),r(!0),()=>{l.removeEventListener("resize",c),a()}}function autoUpdate(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:r="function"==typeof IntersectionObserver,animationFrame:l=!1}=i,c=unwrapElement(e),h=s||o?[...c?getOverflowAncestors(c):[],...t?getOverflowAncestors(t):[]]:[];h.forEach(e=>{s&&e.addEventListener("scroll",n),o&&e.addEventListener("resize",n)});const u=c&&r?observeMove(c,n,o):null;let d,_=-1,m=null;a&&(m=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!l&&m.observe(c),t&&m.observe(t));let p=l?getBoundingClientRect(e):null;return l&&function t(){const i=getBoundingClientRect(e);p&&!rectsAreEqual(p,i)&&n(),p=i,d=requestAnimationFrame(t)}(),n(),()=>{var e;h.forEach(e=>{s&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),u?.(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(d)}}const offset=offset$1,shift=shift$1,flip=flip$1,size=size$1,arrow=arrow$1,computePosition=(e,t,n)=>{const i=new Map,s=null!=n?n:{},o={...platform,...s.platform,_c:i};return computePosition$1(e,t,{...s,platform:o})},BREAKPOINTS={sm:576,md:768,lg:1024,xl:1280,"2xl":1536},parseResponsivePlacement=(e,t="bottom")=>{if(!e||!e.includes(":"))return null;const n=e.split(/\s+/),i={xs:t};for(const e of n)if(e.includes(":")){const[t,n]=e.split(":");void 0!==BREAKPOINTS[t]&&(i[t]=n)}else i.xs=e;return i},getResponsivePlacement=(e,t="bottom")=>{if(!e)return t;const n=window.innerWidth;let i=e.xs||t;for(const t of["sm","md","lg","xl","2xl"])n>=BREAKPOINTS[t]&&e[t]&&(i=e[t]);return i},createBreakpointListeners=e=>{const t=[];for(const n of Object.keys(BREAKPOINTS)){const i=BREAKPOINTS[n],s=window.matchMedia(`(min-width: ${i}px)`);s.addEventListener("change",e),t.push({mql:s,handler:e})}return t},disposeBreakpointListeners=e=>{for(const{mql:t,handler:n}of e)t.removeEventListener("change",n)},toFloatingOffset=e=>Array.isArray(e)?{mainAxis:e[1]||0,crossAxis:e[0]||0}:e,NAME$16="menu",EVENT_KEY$13=".bs.menu",DATA_API_KEY$8=".data-api",ESCAPE_KEY$2="Escape",TAB_KEY$1="Tab",ARROW_UP_KEY$2="ArrowUp",ARROW_DOWN_KEY$2="ArrowDown",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",HOME_KEY$2="Home",END_KEY$2="End",ENTER_KEY$1="Enter",SPACE_KEY$1=" ",ITEM_NAVIGATION_KEYS=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"]),RIGHT_MOUSE_BUTTON=2,SUBMENU_CLOSE_DELAY=100,EVENT_HIDE$4="hide.bs.menu",EVENT_HIDDEN$4="hidden.bs.menu",EVENT_SHOW$4="show.bs.menu",EVENT_SHOWN$4="shown.bs.menu",EVENT_CLICK_DATA_API$5="click.bs.menu.data-api",EVENT_KEYDOWN_DATA_API="keydown.bs.menu.data-api",EVENT_KEYUP_DATA_API="keyup.bs.menu.data-api",EVENT_TOUCH_MOUSEOVER="mouseover.bs.menu",CLASS_NAME_SHOW$5="show",CLASS_NAME_MENU_BACK="menu-back",SELECTOR_DATA_TOGGLE$8='[data-bs-toggle="menu"]:not(.disabled):not(:disabled)',SELECTOR_MENU$3=".menu",SELECTOR_SUBMENU=".submenu",SELECTOR_SUBMENU_TOGGLE=".submenu > .menu-item",SELECTOR_NAVBAR_NAV=".navbar-nav",SELECTOR_VISIBLE_ITEMS$1=".menu-item:not(.disabled):not(:disabled)",SELECTOR_TAB_STOPS=":is(a[href], button, input, select, textarea, summary, [tabindex], [contenteditable]):not(:disabled, .disabled)",DEFAULT_PLACEMENT="bottom-start",SUBMENU_PLACEMENT="end-start",resolveLogicalPlacement=e=>isRTL$1()?e.replace(/^start(?=-|$)/,"right").replace(/^end(?=-|$)/,"left"):e.replace(/^start(?=-|$)/,"left").replace(/^end(?=-|$)/,"right"),triangleSign=(e,t,n)=>(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y),Default$15={autoClose:!0,boundary:"clippingParents",container:!1,display:"dynamic",offset:[0,2],floatingConfig:null,menu:null,placement:"bottom-start",reference:"toggle",strategy:"absolute",submenuTrigger:"both",submenuDelay:100},DefaultType$15={autoClose:"(boolean|string)",boundary:"(string|element)",container:"(string|element|boolean)",display:"string",offset:"(array|string|function)",floatingConfig:"(null|object|function)",menu:"(null|element)",placement:"string",reference:"(string|element|object)",strategy:"string",submenuTrigger:"string",submenuDelay:"number"};var Menu=class e extends BaseComponent{static _openInstances=new Set;constructor(e,t){super(e,t),this._floatingCleanup=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this._parent=this._element.parentNode,this._openSubmenus=new Map,this._submenuCloseTimeouts=new Map,this._hoverIntentData=null,this._submenuPointerType="mouse",this._touchMouseover=()=>{},this._touchMouseoverTargets=new Set,this._menu=this._config.menu||this._findMenu(),!this._config.menu&&this._menu&&(this._parent=this._findWrapper(this._menu)),this._isSubmenu=this._parent.classList?.contains("submenu"),this._menuOriginalParent=this._menu?.parentNode,this._menuOriginalNextSibling=null,this._parseResponsivePlacements(),this._setupSubmenuListeners(),this._initSubmenuTriggers()}static get Default(){return Default$15}static get DefaultType(){return DefaultType$15}static get NAME(){return"menu"}toggle(){return this._isShown()?this.hide():this.show()}show(){return this._show()}async _show(t){if(isDisabled(this._element)||this._isShown())return;const n={relatedTarget:this._element};if(!EventHandler.trigger(this._element,EVENT_SHOW$4,n).defaultPrevented){if(this._moveMenuToContainer(),this._disposeFloating(),this._submenuPointerType="mouse","ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of document.body.children)EventHandler.on(e,"mouseover.bs.menu",this._touchMouseover),this._touchMouseoverTargets.add(e);this._element.setAttribute("aria-expanded","true"),this._menu.classList.add("show"),this._element.classList.add("show"),this._parent&&this._parent.classList.add("show"),this._syncSubmenuLayout(),this._createFloating(),e._openInstances.add(this),t?t():this._element.focus({focusVisible:!1}),this._element&&this._isShown()&&await this._queueCallback(()=>{this._menu&&this._isShown()&&EventHandler.trigger(this._element,EVENT_SHOWN$4,n)},this._menu,this._isAnimated())}}async hide(){if(isDisabled(this._element)||!this._isShown())return;const e={relatedTarget:this._element};await this._completeHide(e)}dispose(){this._removeTouchMouseoverListeners(),EventHandler.off(this._menu,".bs.menu"),this._disposeFloating(),this._clearSize(),this._restoreMenuToOriginalParent(),this._disposeMediaQueryListeners(),this._closeAllSubmenus(),this._clearAllSubmenuTimeouts(),e._openInstances.delete(this),super.dispose()}update(){this._floatingCleanup&&this._updateFloatingPosition()}_findMenu(){const e=SelectorEngine.closest(this._element,":has(.menu)");return SelectorEngine.next(this._element,".menu")[0]||SelectorEngine.prev(this._element,".menu")[0]||SelectorEngine.findOne(".menu",e||this._parent)}_findWrapper(e){let t=this._element.parentNode;for(;t instanceof Element&&!t.contains(e);)t=t.parentNode;return t instanceof Element?t:this._element.parentNode}async _completeHide(t){EventHandler.trigger(this._element,EVENT_HIDE$4,t).defaultPrevented||(this._closeAllSubmenus(),this._removeTouchMouseoverListeners(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._parent&&this._parent.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),e._openInstances.delete(this),await this._queueCallback(()=>{this._menu&&!this._isShown()&&(this._disposeFloating(),this._clearSize(),this._restoreMenuToOriginalParent(),Manipulator.removeDataAttribute(this._menu,"placement"),Manipulator.removeDataAttribute(this._menu,"display"),EventHandler.trigger(this._element,EVENT_HIDDEN$4,t))},this._menu,this._isAnimated()))}_removeTouchMouseoverListeners(){for(const e of this._touchMouseoverTargets)EventHandler.off(e,"mouseover.bs.menu",this._touchMouseover);this._touchMouseoverTargets.clear()}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!isElement$1(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${"menu".toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createFloating(){if("static"===this._config.display)return void Manipulator.setDataAttribute(this._menu,"display","static");let e=this._element;"parent"===this._config.reference?e=this._parent:isElement$1(this._config.reference)?e=getElement(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference),this._floatingCleanup=autoUpdate(e,this._menu,()=>this._updateFloatingPosition(e))}async _updateFloatingPosition(e=null){if(!this._menu)return;e||(e="parent"===this._config.reference?this._parent:isElement$1(this._config.reference)?getElement(this._config.reference):"object"==typeof this._config.reference?this._config.reference:this._element);const t=this._getPlacement(),n=this._getFloatingMiddleware(),i=this._getFloatingConfig(t,n);await this._applyFloatingPosition(e,this._menu,i.placement,i.middleware,i.strategy)}_isShown(){return this._menu.classList.contains("show")}_isAnimated(){return getTransitionDurationFromElement(this._menu)>0}_getPlacement(){const e=this._responsivePlacements?getResponsivePlacement(this._responsivePlacements,"bottom-start"):this._config.placement;return resolveLogicalPlacement(e)}_parseResponsivePlacements(){this._responsivePlacements=parseResponsivePlacement(this._config.placement,"bottom-start"),this._responsivePlacements&&this._setupMediaQueryListeners()}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=createBreakpointListeners(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){disposeBreakpointListeners(this._mediaQueryListeners),this._mediaQueryListeners=[]}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?({placement:t,rects:n})=>toFloatingOffset(e({placement:t,reference:n.reference,floating:n.floating},this._element)):e}_getFloatingMiddleware(){const e=this._getOffset(),t="clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary;return[offset("function"==typeof e?e:toFloatingOffset(e)),flip({boundary:t,fallbackPlacements:this._getFallbackPlacements()}),shift({boundary:t}),size({boundary:t,apply:({availableWidth:e,availableHeight:t,elements:n})=>{this._menu===n.floating&&this._isShown()&&"static"!==getComputedStyle(this._menu).position&&(this._menu.style.setProperty("--bs-menu-available-width",`${Math.max(0,Math.floor(e))}px`),this._menu.style.setProperty("--bs-menu-available-height",`${Math.max(0,Math.floor(t))}px`),this._syncSubmenuLayout())}})]}_syncSubmenuLayout(){this._openSubmenus.size?this._usesStackedSubmenus()&&this._menu.scrollHeight>this._menu.clientHeight&&this._menu.setAttribute("data-bs-menu-constrained",""):this._menu.toggleAttribute("data-bs-menu-constrained",this._menu.scrollHeight>this._menu.clientHeight);const{overflowX:e,overflowY:t}=getComputedStyle(this._menu);this._menu.toggleAttribute("data-bs-menu-stacked","visible"!==e||"visible"!==t)}_clearSize(){this._menu&&(this._menu.style.removeProperty("--bs-menu-available-width"),this._menu.style.removeProperty("--bs-menu-available-height"),this._menu.removeAttribute("data-bs-menu-constrained"),this._menu.removeAttribute("data-bs-menu-stacked"))}_getFallbackPlacements(){return{bottom:["top","bottom-start","bottom-end","top-start","top-end"],"bottom-start":["top-start","bottom-end","top-end"],"bottom-end":["top-end","bottom-start","top-start"],top:["bottom","top-start","top-end","bottom-start","bottom-end"],"top-start":["bottom-start","top-end","bottom-end"],"top-end":["bottom-end","top-start","bottom-start"],right:["left","right-start","right-end","left-start","left-end"],"right-start":["left-start","right-end","left-end","top-start","bottom-start"],"right-end":["left-end","right-start","left-start","top-end","bottom-end"],left:["right","left-start","left-end","right-start","right-end"],"left-start":["right-start","left-end","right-end","top-start","bottom-start"],"left-end":["right-end","left-start","right-start","top-end","bottom-end"]}[this._getPlacement()]||["top","bottom","right","left"]}_getFloatingConfig(e,t){const n={placement:e,middleware:t,strategy:this._config.strategy};return{...n,...execute(this._config.floatingConfig,[void 0,n])}}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null)}_getContainer(){const{container:e}=this._config;return!1===e?null:!0===e?document.body:getElement(e)}_moveMenuToContainer(){const e=this._getContainer();e&&this._menu&&this._menu.parentNode!==e&&(this._menuOriginalNextSibling=this._menu.nextSibling,e.append(this._menu))}_restoreMenuToOriginalParent(){if(this._menuOriginalParent&&this._menu&&this._menu.parentNode!==this._menuOriginalParent){const e=this._menuOriginalNextSibling;this._menuOriginalParent.insertBefore(this._menu,e?.parentNode===this._menuOriginalParent?e:null)}}async _applyFloatingPosition(e,t,n,i,s="absolute"){if(!t.isConnected)return null;const{x:o,y:a,placement:r}=await computePosition(e,t,{placement:n,middleware:i,strategy:s});return t.isConnected?(Object.assign(t.style,{position:s,left:`${o}px`,top:`${a}px`,margin:"0"}),Manipulator.setDataAttribute(t,"placement",r),r):null}_setupSubmenuListeners(){"hover"!==this._config.submenuTrigger&&"both"!==this._config.submenuTrigger||(EventHandler.on(this._menu,"mouseenter.bs.menu",".submenu > .menu-item",e=>{this._onSubmenuTriggerEnter(e)}),EventHandler.on(this._menu,"mouseleave.bs.menu",".submenu",e=>{this._onSubmenuLeave(e)}),EventHandler.on(this._menu,"mousemove.bs.menu",e=>{this._trackMousePosition(e)})),"both"===this._config.submenuTrigger&&EventHandler.on(this._menu,"pointerover.bs.menu",e=>{this._submenuPointerType=e.pointerType}),["click","hover","both"].includes(this._config.submenuTrigger)&&EventHandler.on(this._menu,"click.bs.menu",".submenu > .menu-item",e=>{("hover"!==this._config.submenuTrigger||this._usesStackedSubmenus())&&this._onSubmenuTriggerClick(e)})}_usesStackedSubmenus(){return"1"===getComputedStyle(this._menu).getPropertyValue("--bs-menu-stack-submenus")}_onSubmenuTriggerEnter(e){if("mouse"!==this._submenuPointerType||this._usesStackedSubmenus())return;const t=e.target.closest(".submenu > .menu-item");if(!t)return;const n=t.closest(".submenu"),i=SelectorEngine.findOne(".menu",n);i&&(this._cancelSubmenuCloseTimeout(i),this._closeSiblingSubmenus(n),this._openSubmenu(t,i,n))}_onSubmenuLeave(e){if("mouse"!==this._submenuPointerType||this._usesStackedSubmenus())return;const t=e.target.closest(".submenu"),n=SelectorEngine.findOne(".menu",t);n&&this._openSubmenus.has(n)&&(this._isMovingTowardSubmenu(e,n)||this._scheduleSubmenuClose(n,t))}_onSubmenuTriggerClick(e){const t=e.target.closest(".submenu > .menu-item");if(!t)return;e.preventDefault(),e.stopPropagation();const n=t.closest(".submenu"),i=SelectorEngine.findOne(".menu",n);i&&(this._openSubmenus.has(i)?this._closeSubmenu(i,n):(this._closeSiblingSubmenus(n),this._openSubmenu(t,i,n),this._usesStackedSubmenus()&&this._getItemsInMenu(i)[0]?.focus()))}_initSubmenuTriggers(){if(this._menu)for(const e of SelectorEngine.find(".submenu > .menu-item",this._menu))SelectorEngine.findOne(".menu",e.parentElement)&&(e.setAttribute("aria-haspopup","true"),e.hasAttribute("aria-expanded")||e.setAttribute("aria-expanded","false"))}_openSubmenu(e,t,n){if(this._openSubmenus.has(t))return;e.setAttribute("aria-expanded","true"),e.setAttribute("aria-haspopup","true"),t.style.opacity="0",t.classList.add("show"),n.classList.add("show");const i=document.createElement(t.matches("ul, ol, menu")?"li":"div");i.className="menu-back";const s=document.createElement("button");s.type="button",s.className="menu-item",s.textContent="Back",s.addEventListener("click",i=>{i.stopPropagation(),this._closeSubmenu(t,n),e.focus()}),i.append(s),t.prepend(i);const o=this._createSubmenuFloating(t,n);this._openSubmenus.set(t,()=>{o(),i.remove()}),EventHandler.on(t,"mouseenter.bs.menu",()=>{this._cancelSubmenuCloseTimeout(t)})}_closeSubmenu(e,t){if(!this._openSubmenus.has(e))return;const n=SelectorEngine.find(".submenu .menu.show",e);for(const e of n){const t=e.closest(".submenu");this._closeSubmenu(e,t)}const i=SelectorEngine.findOne(".submenu > .menu-item",t),s=this._openSubmenus.get(e);s&&s(),this._openSubmenus.delete(e),EventHandler.off(e,"mouseenter.bs.menu"),this._cancelSubmenuCloseTimeout(e),i&&i.setAttribute("aria-expanded","false"),e.classList.remove("show"),t.classList.remove("show"),e.style.opacity=""}_closeAllSubmenus(){for(const[e]of this._openSubmenus){const t=e.closest(".submenu");this._closeSubmenu(e,t)}}_closeSiblingSubmenus(e){const t=e.parentNode,n=SelectorEngine.find(".submenu > .menu.show",t);for(const t of n){const n=t.closest(".submenu");n!==e&&this._closeSubmenu(t,n)}}_createSubmenuFloating(e,t){const n=t,i=resolveLogicalPlacement("end-start"),s=[offset({mainAxis:0,crossAxis:-4}),flip({fallbackPlacements:[resolveLogicalPlacement("start-start"),resolveLogicalPlacement("end-end"),resolveLogicalPlacement("start-end")]}),shift({padding:8})];return autoUpdate(n,e,async()=>{this._usesStackedSubmenus()||await this._applyFloatingPosition(n,e,i,s),e.style.opacity=""})}_scheduleSubmenuClose(e,t){this._cancelSubmenuCloseTimeout(e);const n=setTimeout(()=>{this._closeSubmenu(e,t),this._submenuCloseTimeouts.delete(e)},this._config.submenuDelay);this._submenuCloseTimeouts.set(e,n)}_cancelSubmenuCloseTimeout(e){const t=this._submenuCloseTimeouts.get(e);t&&(clearTimeout(t),this._submenuCloseTimeouts.delete(e))}_clearAllSubmenuTimeouts(){for(const e of this._submenuCloseTimeouts.values())clearTimeout(e);this._submenuCloseTimeouts.clear()}_trackMousePosition(e){this._hoverIntentData={x:e.clientX,y:e.clientY,timestamp:Date.now()}}_isMovingTowardSubmenu(e,t){if(!this._hoverIntentData)return!1;const n=t.getBoundingClientRect(),i={x:e.clientX,y:e.clientY},s={x:this._hoverIntentData.x,y:this._hoverIntentData.y},o=isRTL$1()?n.right:n.left,a={x:o,y:n.top},r={x:o,y:n.bottom};return this._pointInTriangle(i,s,a,r)}_pointInTriangle(e,t,n,i){const s=triangleSign(e,t,n),o=triangleSign(e,n,i),a=triangleSign(e,i,t);return!((s<0||o<0||a<0)&&(s>0||o>0||a>0))}_getItemsInMenu(e){const t=this._usesStackedSubmenus()?`, :scope > .menu-back > ${SELECTOR_VISIBLE_ITEMS$1}`:"";return SelectorEngine.find(`:scope > ${SELECTOR_VISIBLE_ITEMS$1}, :scope > .submenu > ${SELECTOR_VISIBLE_ITEMS$1}${t}`,e).filter(e=>isVisible(e))}_selectMenuItem({key:e,target:t}){const n=t.closest(".menu")||this._menu,i=this._getItemsInMenu(n);if(!i.length)return;const s=getNextActiveElement(i,t,"ArrowDown"===e,!i.includes(t));s.focus(),this._closeUnrelatedSubmenus(n,s)}_handlePortaledTab(e){if(!this._isShown()||this._menu.parentNode===this._menuOriginalParent||e.defaultPrevented)return;const t=SelectorEngine.find(SELECTOR_TAB_STOPS,this._menu).filter(e=>(e.tabIndex>=0||e.isContentEditable&&!e.hasAttribute("tabindex"))&&!e.closest("[inert]")&&isVisible(e)),n=t[0];if(e.target===this._element&&!e.shiftKey&&n)return e.preventDefault(),void n.focus();e.shiftKey&&e.target===n?(e.preventDefault(),this._element.focus()):e.shiftKey||e.target!==t.at(-1)||this._element.focus()}_closeUnrelatedSubmenus(e,t){for(const[n]of this._openSubmenus){const i=n.closest(".submenu");i&&i.parentElement===e&&!i.contains(t)&&this._closeSubmenu(n,i)}}_handleSubmenuKeydown(e){const{key:t,target:n}=e,i=isRTL$1(),s=i?"ArrowLeft":"ArrowRight",o=i?"ArrowRight":"ArrowLeft",a=n.closest(".submenu"),r=n.matches(".submenu > .menu-item");if(("Enter"===t||" "===t||t===s)&&a&&r){e.preventDefault(),e.stopPropagation();const t=SelectorEngine.findOne(".menu",a);return t&&(this._closeSiblingSubmenus(a),this._openSubmenu(n,t,a),requestAnimationFrame(()=>{this._openSubmenus?.has(t)&&(this._usesStackedSubmenus()?this._getItemsInMenu(t)[0]:SelectorEngine.findOne(`${SELECTOR_VISIBLE_ITEMS$1}:not(.menu-back > *)`,t))?.focus()})),!0}if(t===o){const t=n.closest(".menu"),i=t?.closest(".submenu");if(i){e.preventDefault(),e.stopPropagation();const n=SelectorEngine.findOne(".submenu > .menu-item",i);return this._closeSubmenu(t,i),n&&n.focus(),!0}}if("Home"===t||"End"===t){const i=n.closest(".menu");if(!i)return!1;e.preventDefault(),e.stopPropagation();const s=this._getItemsInMenu(i);if(s.length){const e="Home"===t?s[0]:s.at(-1);e.focus(),this._closeUnrelatedSubmenus(i,e)}return!0}return!1}_handleEscape(e){if(!this._isShown())return;e.preventDefault(),e.stopPropagation();const t=e.target.closest(".menu"),n=t?.closest(".submenu");if(t&&n&&this._openSubmenus.has(t))return this._closeSubmenu(t,n),void SelectorEngine.findOne(".submenu > .menu-item",n)?.focus();this.hide(),this._element.focus()}static clearMenus(t){if(2!==t.button&&("keyup"!==t.type||"Tab"===t.key))for(const n of e._openInstances){if(!1===n._config.autoClose)continue;const e=t.composedPath(),i=e.includes(n._menu);if(e.includes(n._element)||"inside"===n._config.autoClose&&!i||"outside"===n._config.autoClose&&i)continue;const s=t.target.closest?.("form"),o=Boolean(s)&&n._menu.contains(s);if(n._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)||o))continue;const a={relatedTarget:n._element};"click"===t.type&&(a.clickEvent=t),n._completeHide(a)}}static _getToggleFromKeydownContext(t,n){if(t.matches(SELECTOR_DATA_TOGGLE$8))return t;for(const t of e._openInstances)if(t._element===n.target||t._menu?.contains(n.target))return t._element;return SelectorEngine.prev(t,SELECTOR_DATA_TOGGLE$8)[0]||SelectorEngine.next(t,SELECTOR_DATA_TOGGLE$8)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$8,n.delegateTarget.parentNode)}static dataApiKeydownHandler(t){if(t.isComposing||229===t.keyCode)return;const{key:n,target:i}=t;if("Escape"!==n&&"Tab"!==n){const e=("Enter"===n||" "===n)&&i.matches(".submenu > .menu-item"),t=i.matches(`${SELECTOR_DATA_TOGGLE$8}, .menu-item`);if(!ITEM_NAVIGATION_KEYS.has(n)&&!e||!t||i.isContentEditable||i.matches("input, select, textarea"))return}const s=e._getToggleFromKeydownContext(this,t);if(!s)return;if("Tab"===n)return void e.getInstance(s)?._handlePortaledTab(t);const o=e.getOrCreateInstance(s);"Escape"===n?o._handleEscape(t):"ArrowUp"===n||"ArrowDown"===n?(t.preventDefault(),t.stopPropagation(),o.show(),o._selectMenuItem(t)):o._handleSubmenuKeydown(t)}};EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$8,Menu.dataApiKeydownHandler),EventHandler.on(document,EVENT_KEYDOWN_DATA_API,".menu",Menu.dataApiKeydownHandler),EventHandler.on(document,EVENT_CLICK_DATA_API$5,Menu.clearMenus),EventHandler.on(document,EVENT_KEYUP_DATA_API,Menu.clearMenus),EventHandler.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_TOGGLE$8,function(e){e.preventDefault(),Menu.getOrCreateInstance(this).toggle()});const NAME$15="combobox",EVENT_KEY$12=".bs.combobox",DATA_API_KEY$7=".data-api",ESCAPE_KEY$1="Escape",TAB_KEY="Tab",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",HOME_KEY$1="Home",END_KEY$1="End",ENTER_KEY="Enter",SPACE_KEY=" ",EVENT_CHANGE$2=`change${EVENT_KEY$12}`,EVENT_CLICK_DATA_API$4=`click${EVENT_KEY$12}.data-api`,CLASS_NAME_SHOW$4="show",CLASS_NAME_SELECTED="selected",CLASS_NAME_PLACEHOLDER="combobox-placeholder",DISMISS_ICON='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg>',SELECTOR_DATA_TOGGLE$7='[data-bs-toggle="combobox"]',SELECTOR_MENU$2=".menu",SELECTOR_MENU_ITEM=".menu-item[data-bs-value]",SELECTOR_VISIBLE_ITEMS=".menu-item[data-bs-value]:not(.disabled):not(:disabled)",SELECTOR_VALUE=".combobox-value",SELECTOR_SEARCH_INPUT=".combobox-search-input",SELECTOR_NO_RESULTS=".combobox-no-results";var ComboboxMenu=class extends Menu{show(e){return this._show(e)}};const Default$14={allowCustom:!1,createOnBlur:!1,maxItems:null,separator:null,boundary:"clippingParents",input:null,multiple:!1,name:null,offset:[0,2],placeholder:"",placement:"bottom-start",search:!1,searchNormalize:!1},DefaultType$14={allowCustom:"boolean",createOnBlur:"boolean",maxItems:"(number|null)",separator:"(string|null)",boundary:"(string|element)",input:"(null|element)",multiple:"boolean",name:"(string|null)",offset:"(array|string|function)",placeholder:"string",placement:"string",search:"boolean",searchNormalize:"boolean"};var Combobox=class extends BaseComponent{constructor(e,t){if(super(e,t),this._editor=this._element.matches("input")?this._element:SelectorEngine.findOne(".combobox-input, .form-ghost",this._element),this._editor===this._element&&this._config.multiple)throw new TypeError("COMBOBOX: Multiple selection requires a wrapping element.");this._toggle=this._editor??this._element;const n=this._editor&&!this._element.matches("input")?this._element:this._toggle;this._menu=SelectorEngine.next(n,".menu")[0],this._ownsMenu=!this._menu&&Boolean(this._editor),this._ownsMenu&&(this._menu=document.createElement("div"),this._menu.className="menu",n.after(this._menu)),this._menuMinWidth=this._menu.style.minWidth,this._valueDisplay=SelectorEngine.findOne(SELECTOR_VALUE,this._toggle),this._searchInput=this._editor??SelectorEngine.findOne(SELECTOR_SEARCH_INPUT,this._menu),this._noResults=SelectorEngine.findOne(SELECTOR_NO_RESULTS,this._menu),this._activeItem=null,this._chips=new Map,this._selectedChips=new Set,this._anchorChip=null,this._focusingChip=!1,this._composing=!1,this._query=null,this._status=null,this._attributes=new Map,this._editor&&this._setupEditor(),this._hiddenInput=null,this._menuInstance=null,this._ownsInput=!1,this._inputDisabled=!1,this._extraInputs=[],this._initialSelection=this._getSelectedItems(),this._form=null,this._menuEventHandlers=new Map,this._changeId=0,this._formObserver=new MutationObserver(e=>{this._readInputDisabled(e),this.update()}),this._submitHandler=()=>this.update(),this._resetTimeouts=new Set,this._resetHandler=e=>{const t=window.setTimeout(()=>{if(this._resetTimeouts.delete(t),!this._element||e.defaultPrevented||e.target!==this._form)return;const n=new Set(this._initialSelection);for(const e of SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu))e.classList.toggle("selected",n.has(e)),setAriaAttribute(e,"aria-selected",n.has(e));this._query=null,this._selectedChips.clear(),this._anchorChip=null,this.update()});this._resetTimeouts.add(t)},this._createHiddenInput(),this._createMenuInstance(),this.update(),this._addEventListeners()}static get Default(){return Default$14}static get DefaultType(){return DefaultType$14}static get NAME(){return NAME$15}toggle(){return this._isShown()?this.hide():this.show()}show(){return this._showMenu()}async hide(){await this._menuInstance.hide()}update(){this._changeId++,this._readInputDisabled(this._formObserver.takeRecords()),this._syncOptionRoles(),this._updateToggleText(),this._updateHiddenInput(),this._observeFormState(),this._editor&&this._activeItem&&!this._getVisibleItems().includes(this._activeItem)&&this._setActiveItem(null)}dispose(){this._resetTimeouts.forEach(e=>clearTimeout(e)),this._readInputDisabled(this._formObserver.takeRecords()),this._formObserver.disconnect(),EventHandler.off(this._form,`reset${EVENT_KEY$12}`,this._resetHandler),EventHandler.off(this._form,`submit${EVENT_KEY$12}`,this._submitHandler);for(const[e,t]of this._menuEventHandlers)EventHandler.off(this._toggle,e,t);this._removeExtraInputs(),this._hiddenInput&&!this._ownsInput&&(this._hiddenInput.disabled=this._inputDisabled),this._menuInstance&&(this._menuInstance.dispose(),this._menuInstance=null),this._hiddenInput&&this._ownsInput&&(this._hiddenInput.remove(),this._hiddenInput=null);for(const e of this._chips.values())e.remove();this._editor&&(this._editor.classList.remove("show"),this._element.classList.remove("show"),this._menu.classList.remove("show"),this._activeItem?.classList.remove("active")),this._status?.remove(),this._menu.style.minWidth=this._menuMinWidth;for(const[e,t]of this._attributes)for(const[n,i]of t)null===i?e.removeAttribute(n):e.setAttribute(n,i);this._ownsMenu&&this._menu.remove(),EventHandler.off(this._menu,EVENT_KEY$12),EventHandler.off(this._toggle,EVENT_KEY$12),EventHandler.off(this._searchInput,EVENT_KEY$12),super.dispose()}getValues(){return this._getSelectedItems().map(e=>e.dataset.bsValue??"")}add(e){if(this._isDisabled()||this._config.multiple&&null!==this._config.maxItems&&this.getValues().length>=this._config.maxItems)return null;let t=SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu).find(t=>t.dataset.bsValue===e);return!t&&this._config.allowCustom&&e.trim()&&(t=document.createElement("button"),t.setAttribute("type","button"),t.className="menu-item",t.dataset.bsValue=e,t.textContent=e,this._menu.append(t)),!t||t.classList.contains("selected")||isDisabled(t)?null:(this._selectItem(t),this._element&&t.classList.contains("selected")?this._chips.get(t)??t:null)}remove(e){const t=this._getSelectedItems().find(t=>"string"==typeof e?t.dataset.bsValue===e:t===e||this._chips.get(t)===e);return!(!t||isDisabled(t)||this._isDisabled())&&this._removeItems([t])}clear(){this._clearSelection(null)}_clearSelection(e){this._removeItems(this._getSelectedItems(),e)}focus(){this._toggle?.focus()}getSelectedValues(){return this._getSelectedItems().filter(e=>this._selectedChips.has(this._chips.get(e))).map(e=>e.dataset.bsValue??"")}selectChip(e,t={}){const n=this._getChipElements();if(this._isDisabled()||!n.includes(e))return;const i=new Set(this._selectedChips),{addToSelection:s=!1,rangeSelect:o=!1}=t;if(o&&this._anchorChip&&n.includes(this._anchorChip)){const t=n.indexOf(this._anchorChip),i=n.indexOf(e);s||this._selectedChips.clear();for(let e=Math.min(t,i);e<=Math.max(t,i);e++)this._selectedChips.add(n[e])}else s?this._selectedChips.has(e)?this._selectedChips.delete(e):(this._selectedChips.add(e),this._anchorChip=e):(this._selectedChips=new Set([e]),this._anchorChip=e);(i.size!==this._selectedChips.size||[...i].some(e=>!this._selectedChips.has(e)))&&this._notifyChipSelection()}clearSelection(){this._anchorChip=null,this._selectedChips.size&&(this._selectedChips.clear(),this._notifyChipSelection())}removeSelected(){const e=this._getChipElements(),t=document.activeElement?.closest(".chip"),n=Math.max(0,e.indexOf(t)),i=this._getSelectedItems().filter(e=>this._selectedChips.has(this._chips.get(e))),s=this._removeItems(i);if(s&&this._element){const e=this._getChipElements(),t=e[Math.min(n,e.length-1)];t?this._focusChip(t):this._editor.focus()}return s}_getChipElements(){return this._getSelectedItems().filter(e=>!isDisabled(e)).map(e=>this._chips.get(e)).filter(e=>Boolean(e))}_syncChipSelection(){for(const e of this._chips.values()){const t=this._selectedChips.has(e);e.classList.toggle("active",t),t?e.setAttribute("aria-description","Selected for removal"):e.removeAttribute("aria-description")}}_notifyChipSelection(){this._syncChipSelection();const e=this._getSelectedItems().filter(e=>this._selectedChips.has(this._chips.get(e))),t=e.map(e=>e.dataset.bsValue??"");this._status&&(this._status.textContent=t.length?`${t.length} chip${1===t.length?"":"s"} selected for removal`:"Chip selection cleared"),EventHandler.trigger(this._element,`select${EVENT_KEY$12}`,{selected:t,items:e})}_focusChip(e,t={}){this.selectChip(e,t),this._element&&(this.hide(),this._element&&this._focusSelectedChip(e))}_focusSelectedChip(e){this._focusingChip=!0;try{e.focus()}finally{this._element&&(this._focusingChip=!1)}}_selectAllChips(){const e=this._getChipElements();e.length&&(this._selectedChips=new Set(e),this._anchorChip??=e[0],this._notifyChipSelection())}_removeItems(e,t=null){if(this._isDisabled()||!e.length)return!1;const n=[],i=this._changeId;for(const t of e){if(isDisabled(t))continue;const e=EventHandler.trigger(this._element,`remove${EVENT_KEY$12}`,{value:t.dataset.bsValue,item:t});if(!this._element||i!==this._changeId)return!1;e.defaultPrevented||n.push(t)}for(const e of n)e.classList.remove("selected"),setAriaAttribute(e,"aria-selected",!1);return n.length&&this._selectionChanged(1===n.length?n[0]:null,t),n.length>0}_isDisabled(){return isDisabled(this._element)||isDisabled(this._toggle)||this._toggle.matches(":disabled")}_setAttribute(e,t,n){this._attributes.has(e)||this._attributes.set(e,new Map);const i=this._attributes.get(e);i.has(t)||i.set(t,e.getAttribute(t)),e.setAttribute(t,n)}_syncOptionRoles(){this._menu.id||this._setAttribute(this._menu,"id",getUID("combobox-")),this._setAttribute(this._toggle,"aria-controls",this._menu.id),this._setAttribute(this._toggle,"aria-haspopup","listbox"),this._setAttribute(this._menu,"role","listbox"),this._config.multiple&&this._setAttribute(this._menu,"aria-multiselectable","true");for(const e of SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu))this._setAttribute(e,"role","option"),this._setAttribute(e,"aria-selected",String(e.classList.contains("selected")))}_setupEditor(){const e=this._editor;this._config.placeholder&&!e.placeholder&&this._setAttribute(e,"placeholder",this._config.placeholder),this._menu.id||this._setAttribute(this._menu,"id",getUID("combobox-")),this._setAttribute(e,"role","combobox"),this._setAttribute(e,"aria-autocomplete","list"),this._setAttribute(e,"aria-expanded","false"),this._setAttribute(e,"aria-controls",this._menu.id),this._setAttribute(e,"autocomplete","off"),this._setAttribute(e,"aria-activedescendant",""),e.removeAttribute("aria-activedescendant"),this._setAttribute(this._menu,"role","listbox"),this._config.multiple&&this._setAttribute(this._menu,"aria-multiselectable","true"),this._status=document.createElement("span"),this._status.className="visually-hidden",this._status.setAttribute("role","status"),this._menu.after(this._status)}_getItemLabel(e){return SelectorEngine.findOne(".menu-item-content > span:first-child",e)?.textContent??e.textContent.trim()}_renderEditor(){const e=this._editor,t=this._getSelectedItems(),n=new Set(t);for(const[e,t]of this._chips)n.has(e)||(t.remove(),this._chips.delete(e),this._selectedChips.delete(t),this._anchorChip===t&&(this._anchorChip=null));for(const e of SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu))e.id||this._setAttribute(e,"id",getUID("combobox-option-")),this._setAttribute(e,"tabindex","-1");if(!this._config.multiple){const n=this._query??(t.length?this._getItemLabel(t[0]):"");return void(e.value!==n&&(e.value=n))}let i=this._hiddenInput?.parentElement===e.parentElement&&this._hiddenInput.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING?this._hiddenInput:e;for(let e=t.length-1;e>=0;e--){const n=t[e];let s=this._chips.get(n);const o=this._getItemLabel(n);if(!s){s=document.createElement("span"),s.className="chip",s.tabIndex=-1;const e=document.createElement("span"),t=document.createElement("button");t.type="button",t.className="chip-dismiss",t.innerHTML=DISMISS_ICON,s.append(e,t),this._chips.set(n,s)}this._updateChipState(n,s,o),s.nextElementSibling!==i&&i.before(s),i=s}this._syncChipSelection();const s=this._query??"";e.value!==s&&(e.value=s),this._menuInstance?.update()}_updateChipState(e,t,n){t.firstElementChild.textContent=n;const i=t.lastElementChild;i.setAttribute("aria-label",`Remove ${n}`),i.disabled=this._isDisabled()||isDisabled(e),t.setAttribute("role","group"),t.setAttribute("aria-label",n),t.classList.toggle("disabled",i.disabled),i.disabled?(t.setAttribute("aria-disabled","true"),this._selectedChips.delete(t),this._anchorChip===t&&(this._anchorChip=null)):t.removeAttribute("aria-disabled")}_setActiveItem(e){this._activeItem?.classList.remove("active"),this._activeItem=e,e?(e.classList.add("active"),this._editor.setAttribute("aria-activedescendant",e.id),e.scrollIntoView({block:"nearest"})):this._editor.removeAttribute("aria-activedescendant")}_addEditorListeners(){const e=this._editor;EventHandler.on(this._menu,`mousedown${EVENT_KEY$12}`,SELECTOR_MENU_ITEM,e=>e.preventDefault()),EventHandler.on(e,`input${EVENT_KEY$12}`,t=>{this._composing||t.isComposing?this._query=e.value:this._isDisabled()||this._handleEditorInput()}),EventHandler.on(e,`compositionstart${EVENT_KEY$12}`,()=>{this._composing=!0}),EventHandler.on(e,`compositionend${EVENT_KEY$12}`,()=>{this._composing=!1,this._element&&!this._isDisabled()&&this._handleEditorInput(document.activeElement===e)}),EventHandler.on(e,`paste${EVENT_KEY$12}`,e=>{const{separator:t,allowCustom:n}=this._config,i=e.clipboardData?.getData("text")??"";if(n&&t&&i.includes(t)&&!this._isDisabled()){e.preventDefault();for(const e of i.split(t))if(this.add(e.trim()),!this._element)return}}),EventHandler.on(e,`blur${EVENT_KEY$12}`,t=>{!this._composing&&this._config.allowCustom&&this._config.createOnBlur&&!t.relatedTarget?.closest(".chip, .menu")&&this.add(e.value.trim())}),EventHandler.on(e,`focus${EVENT_KEY$12}`,()=>this.clearSelection()),EventHandler.on(this._element,`mousedown${EVENT_KEY$12}`,".chip",e=>{e.target.closest(".chip-dismiss")||e.preventDefault()}),EventHandler.on(this._element,`focusin${EVENT_KEY$12}`,".chip",e=>{if(this._focusingChip||this._isDisabled())return;const t=e.target.closest(".chip");this._selectedChips.has(t)||this.selectChip(t),this._element&&this.hide()}),EventHandler.on(this._element,`click${EVENT_KEY$12}`,".chip",e=>{if(e.target.closest(".chip-dismiss")||this._isDisabled())return;e.preventDefault(),e.stopPropagation();const t=e.target.closest(".chip");this._focusChip(t,{addToSelection:e.metaKey||e.ctrlKey,rangeSelect:e.shiftKey})}),EventHandler.on(this._element,`keydown${EVENT_KEY$12}`,".chip",e=>this._handleChipKeydown(e)),EventHandler.on(this._element,`click${EVENT_KEY$12}`,".chip-dismiss",t=>{t.preventDefault(),t.stopPropagation();const n=t.target.closest(".chip");this.remove(n),this._element&&e.focus()})}_handleEditorInput(e=!0){const t=this._editor;let n=t.value;if(this._config.allowCustom&&this._config.separator&&n.includes(this._config.separator)){const e=n.split(this._config.separator);n=e.pop();for(const t of e)if(this.add(t.trim()),!this._element)return}if(!this._config.multiple&&this._getSelectedItems().length){if(this._clearSelection(n),!this._element)return;if(this._getSelectedItems().length)return this._query=null,void this._renderEditor()}this._query=n,t.value!==n&&(t.value=n),this._filterItems(n),this._setActiveItem(null),e&&this._getVisibleItems().length?this.show():this.hide()}_handleEditorKeydown(e){if(this._composing||e.isComposing||229===e.keyCode||this._isDisabled())return;const t=this._editor;if([ARROW_DOWN_KEY$1,ARROW_UP_KEY$1].includes(e.key)){e.preventDefault();const t=this._getVisibleItems();if(t.length){const n=getNextActiveElement(t,this._activeItem,e.key===ARROW_DOWN_KEY$1,!0);this.show(),this._element&&this._setActiveItem(n)}return}if("Enter"!==e.key)return e.key===ESCAPE_KEY$1||"Tab"===e.key?(e.key===ESCAPE_KEY$1&&this._isShown()&&e.preventDefault(),this.hide(),void(this._element&&this._setActiveItem(null))):void this._handleEditorChipFocus(e);this._activeItem&&this._isShown()?(e.preventDefault(),this._selectItem(this._activeItem)):this._config.allowCustom&&t.value.trim()&&(e.preventDefault(),this.add(t.value.trim()))}_handleEditorChipFocus(e){const t=this._editor;if((e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase()&&!t.value){const t=this._getChipElements();return void(t.length&&(e.preventDefault(),this._selectAllChips(),this._element&&(this.hide(),this._element&&this._focusSelectedChip(t.at(-1)))))}if(e.metaKey||e.ctrlKey||e.altKey)return;const n="rtl"===getComputedStyle(t).direction?"ArrowRight":"ArrowLeft",i=["Backspace","Delete"].includes(e.key)&&!t.value,s=e.key===n&&0===t.selectionStart&&0===t.selectionEnd;if(i||s){const t=this._getChipElements().at(-1);t&&(e.preventDefault(),this._focusChip(t,{addToSelection:e.shiftKey}))}}_handleChipKeydown(e){if(this._composing||e.isComposing||229===e.keyCode||this._isDisabled())return;const t=e.target.closest(".chip"),n=this._getChipElements(),i=n.indexOf(t);if(-1===i)return;if((e.metaKey||e.ctrlKey)&&"a"===e.key.toLowerCase())return e.preventDefault(),void this._selectAllChips();if(["Backspace","Delete"].includes(e.key))return e.preventDefault(),void this._deleteChipSelection(t);const s="rtl"===getComputedStyle(this._editor).direction;if(["ArrowLeft","ArrowRight"].includes(e.key)){e.preventDefault();const t=i+("ArrowRight"===e.key===s?-1:1);t>=n.length?(this.clearSelection(),this._element&&this._editor.focus()):this._focusChip(n[Math.max(0,t)],{rangeSelect:e.shiftKey})}else if("Home"===e.key||e.key===END_KEY$1&&e.shiftKey){e.preventDefault();const t="Home"===e.key?n[0]:n.at(-1);this._focusChip(t,{rangeSelect:e.shiftKey})}else[END_KEY$1,ESCAPE_KEY$1].includes(e.key)&&(e.preventDefault(),this.clearSelection(),this._element&&this._editor.focus())}_deleteChipSelection(e){this._selectedChips.has(e)||this.selectChip(e),this._element&&this.removeSelected()}_isShown(){return this._menu.classList.contains("show")}_configAfterMerge(e){if(null!==e.maxItems&&(!Number.isSafeInteger(e.maxItems)||e.maxItems<1))throw new TypeError('COMBOBOX: Option "maxItems" must be a positive integer or null.');if(null!==e.input){const t=getElement(e.input);if(!(t instanceof HTMLInputElement)||"hidden"!==t.type)throw new TypeError('COMBOBOX: Option "input" must reference a hidden input.');e.input=t}return e}_createHiddenInput(){if(this._config.input)return this._hiddenInput=this._config.input,void(this._inputDisabled=this._hiddenInput.disabled);this._config.name&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=this._config.name,(this._editor?this._element:this._toggle).before(this._hiddenInput),this._ownsInput=!0)}_removeExtraInputs(){for(const e of this._extraInputs)e.remove();this._extraInputs=[]}_readInputDisabled(e){!this._ownsInput&&e.some(e=>e.target===this._hiddenInput&&"disabled"===e.attributeName)&&(this._inputDisabled=this._hiddenInput.disabled)}_observeFormState(){this._formObserver.disconnect(),this._element!==this._toggle&&this._formObserver.observe(this._element,{attributes:!0,attributeFilter:["class"]}),this._formObserver.observe(this._toggle,{attributes:!0,attributeFilter:["disabled","class","form"]}),this._hiddenInput&&this._formObserver.observe(this._hiddenInput,{attributes:!0,attributeFilter:["disabled","name","form"]});const e=new Set;for(const t of[this._toggle,this._hiddenInput])for(let n=t?.parentElement;n;n=n.parentElement)n.matches("fieldset")&&e.add(n);for(const t of e)this._formObserver.observe(t,{attributes:!0,attributeFilter:["disabled"]});const t=this._hiddenInput?this._hiddenInput.form:this._toggle instanceof HTMLInputElement||this._toggle instanceof HTMLButtonElement?this._toggle.form:this._toggle.closest("form");t!==this._form&&(EventHandler.off(this._form,`reset${EVENT_KEY$12}`,this._resetHandler),EventHandler.off(this._form,`submit${EVENT_KEY$12}`,this._submitHandler),this._form=t,EventHandler.on(this._form,`reset${EVENT_KEY$12}`,this._resetHandler),EventHandler.on(this._form,`submit${EVENT_KEY$12}`,this._submitHandler))}async _showMenu(e){if(this._isDisabled()||this._isShown()||this._editor&&!this._getVisibleItems().length)return;const t=this._editor||isDisabled(this._searchInput)?null:this._searchInput;await this._menuInstance.show(e??(t?()=>t.focus({preventScroll:!0}):void 0))}_createMenuInstance(){this._menuInstance=new ComboboxMenu(this._toggle,{menu:this._menu,reference:this._editor?this._element:"toggle",autoClose:!this._config.multiple||"outside",boundary:this._config.boundary,offset:this._config.offset,placement:this._config.placement,floatingConfig:this._editor?e=>({...e,middleware:[...e.middleware,{name:"comboboxSize",fn:({elements:e,rects:t})=>(this._element&&(e.floating.style.minWidth=`${t.reference.width}px`),{})}]}):null})}_addEventListeners(){for(const e of["show","shown","hide","hidden"]){const t=Menu.eventName(e),n=t=>{this._element&&("hidden"===e&&this._editor&&this._setActiveItem(null),!EventHandler.trigger(this._element,this.constructor.eventName(e))?.defaultPrevented&&this._element?"show"!==e||t.defaultPrevented||!this._searchInput||this._editor||(this._searchInput.value="",this._filterItems("")):t.preventDefault())};this._menuEventHandlers.set(t,n),EventHandler.on(this._toggle,t,n)}EventHandler.on(this._menu,`click${EVENT_KEY$12}`,SELECTOR_MENU_ITEM,e=>{const t=e.target.closest(SELECTOR_MENU_ITEM);t&&!isDisabled(t)&&(e.preventDefault(),e.stopPropagation(),this._selectItem(t))}),EventHandler.on(this._toggle,`keydown${EVENT_KEY$12}`,e=>{this._editor?this._handleEditorKeydown(e):this._handleToggleKeydown(e)}),EventHandler.on(this._menu,`keydown${EVENT_KEY$12}`,e=>{this._handleMenuKeydown(e)}),this._editor?this._addEditorListeners():this._searchInput&&(EventHandler.on(this._toggle,`mousedown${EVENT_KEY$12}`,e=>{0!==e.button||this._isShown()||this._isDisabled()||isDisabled(this._searchInput)||e.preventDefault()}),EventHandler.on(this._searchInput,`input${EVENT_KEY$12}`,()=>{this._filterItems(this._searchInput.value)}),EventHandler.on(this._searchInput,`keydown${EVENT_KEY$12}`,e=>{if(!e.isComposing&&229!==e.keyCode){if(e.key===ARROW_DOWN_KEY$1){e.preventDefault();const t=this._getVisibleItems();t.length>0&&t[0].focus()}e.key===ESCAPE_KEY$1&&(this.hide(),this._toggle?.focus())}}))}_selectItem(e){if(this._isDisabled()||isDisabled(e)||!this._menu.contains(e))return;const t=this._getSelectedItems();if(this._config.multiple&&!t.includes(e)&&null!==this._config.maxItems&&t.length>=this._config.maxItems)return;if(!this._config.multiple&&1===t.length&&t[0]===e)return;const n=this._changeId,i=this._config.multiple&&t.includes(e)?"remove":"add",s=EventHandler.trigger(this._element,`${i}${EVENT_KEY$12}`,{value:e.dataset.bsValue,item:e});if(this._element&&!s.defaultPrevented&&n===this._changeId&&!this._isDisabled()&&!isDisabled(e)&&this._menu.contains(e)){if(this._config.multiple)e.classList.toggle("selected"),setAriaAttribute(e,"aria-selected",e.classList.contains("selected"));else{for(const e of t)e.classList.remove("selected"),e.setAttribute("aria-selected","false");e.classList.add("selected"),e.setAttribute("aria-selected","true")}this._selectionChanged(e)}}_selectionChanged(e,t=null){this._query=t,this.update();const n=this._changeId,{multiple:i}=this._config,s=this.getValues(),o=i?s:s[0]??"",a=this._hiddenInput??this._element;for(const e of["input","change"])if(EventHandler.trigger(a,e),!this._element||n!==this._changeId)return;EventHandler.trigger(this._element,EVENT_CHANGE$2,{value:o,item:e}),this._element&&n===this._changeId&&(this._editor&&(this._setActiveItem(null),this._filterItems(""),this._status&&(this._status.textContent=`${s.length} selected`)),i||null!==t||(this.hide(),this._toggle?.focus()))}_updateToggleText(){if(this._editor)return void this._renderEditor();const e=this._getSelectedItems();if(0!==e.length)if(this._valueDisplay.classList.remove("combobox-placeholder"),this._config.multiple&&e.length>1)this._valueDisplay.textContent=`${e.length} selected`;else{const t=e[0],n=SelectorEngine.findOne(".menu-item-content > span:first-child",t);this._valueDisplay.textContent=n?n.textContent:t.textContent.trim()}else this._showPlaceholder()}_showPlaceholder(){const{placeholder:e}=this._config;this._valueDisplay.textContent=e,this._valueDisplay.classList.toggle("combobox-placeholder",Boolean(e))}_updateHiddenInput(){const e=this._hiddenInput;if(!e)return;const t=this._getSelectedItems(),n=t.filter(e=>!isDisabled(e)).map(e=>e.dataset.bsValue??""),i=this._config.multiple?n:[n[0]??""],s=this._inputDisabled||this._isDisabled()||t.length>0&&0===n.length;if(this._ownsInput){const t=this._editor?this._element:this._toggle,n=[e,...this._extraInputs];if(n.at(-1).nextElementSibling!==t)for(const e of n)t.before(e);const i=this._toggle.getAttribute("form");null===i?e.removeAttribute("form"):e.setAttribute("form",i)}e.value=i[0]??"",e.disabled=s||0===i.length;for(let t=1;t<i.length;t++){let n=this._extraInputs[t-1];n||(n=document.createElement("input"),n.type="hidden",this._extraInputs.push(n));const o=this._extraInputs[t-2]??e;o.parentNode?n.previousElementSibling!==o&&o.after(n):n.remove(),n.name=e.name,n.value=i[t],n.disabled=s;const a=e.getAttribute("form");null===a?n.removeAttribute("form"):n.setAttribute("form",a)}for(const e of this._extraInputs.splice(Math.max(0,i.length-1)))e.remove();this._formObserver.takeRecords()}_getSelectedItems(){return SelectorEngine.find(`${SELECTOR_MENU_ITEM}.selected`,this._menu)}_getVisibleItems(){return SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(e=>{if(!this._editor)return isVisible(e);for(let t=e;t&&t!==this._menu;t=t.parentElement){const e=getComputedStyle(t);if(t.hidden||"none"===e.display||"hidden"===e.visibility)return!1}return!0})}_filterItems(e){const t=this._normalizeText(e.toLowerCase().trim()),n=SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu);let i=0;for(const e of n){const n=this._normalizeText(e.textContent.toLowerCase().trim()),s=!t||n.includes(t);e.style.display=s?"":"none",s&&i++}this._noResults&&this._noResults.classList.toggle("d-none",i>0)}_normalizeText(e){return this._config.searchNormalize?e.normalize("NFD").replace(/[\u0300-\u036F]/g,""):e}_handleToggleKeydown(e){if(e.isComposing||229===e.keyCode)return;const{key:t}=e;if(t===ARROW_DOWN_KEY$1||t===ARROW_UP_KEY$1){e.preventDefault();const n=()=>{const e=this._getVisibleItems();((t===ARROW_DOWN_KEY$1?e[0]:e.at(-1))??(isDisabled(this._searchInput)?this._toggle:this._searchInput))?.focus()};return void(this._isShown()?n():this._showMenu(n))}if(t===ESCAPE_KEY$1&&this._isShown())return e.preventDefault(),e.stopPropagation(),void this.hide();"Enter"!==t&&" "!==t||this._isShown()||(e.preventDefault(),this.show())}_handleMenuKeydown(e){if(e.isComposing||229===e.keyCode)return;const{key:t,target:n}=e;if(t===ESCAPE_KEY$1)return e.preventDefault(),e.stopPropagation(),this.hide(),void this._toggle?.focus();if("Tab"===t)return void this.hide();const i=n.matches("input");if(t===ARROW_DOWN_KEY$1||t===ARROW_UP_KEY$1){e.preventDefault();const i=this._getVisibleItems();return void(i.length>0&&getNextActiveElement(i,n,t===ARROW_DOWN_KEY$1,!i.includes(n)).focus())}if(("Home"===t||t===END_KEY$1)&&!i){e.preventDefault();const n=this._getVisibleItems();return void(n.length>0&&("Home"===t?n[0]:n.at(-1)).focus())}if(("Enter"===t||" "===t)&&!i){e.preventDefault();const t=n.closest(SELECTOR_MENU_ITEM);t&&!isDisabled(t)&&this._selectItem(t)}}};EventHandler.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_TOGGLE$7,function(e){const t=Combobox.getOrCreateInstance(this);this.matches("input")||this.querySelector(".combobox-input, .form-ghost")?e.target.closest(".chip")||(t.focus(),t.show()):(e.preventDefault(),t.toggle())}),onDocumentReady("DOMContentLoaded",()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_TOGGLE$7))Combobox.getOrCreateInstance(e)});
/*! name: vanilla-calendar-pro v3.4.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
var e=e=>new Date(`${e}T00:00:00`),t=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,n=(n,i)=>n.reduce((n,s)=>{if(s instanceof Date||"number"==typeof s){let e=s instanceof Date?s:new Date(s);n.push(t(e))}else s.match(/^(\d{4}-\d{2}-\d{2})$/g)?n.push(s):s.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(s,o,a)=>{var r;let l=`${o}:${a}`,c=i?i.start.getTime():-1/0,h=null==i||null==(r=i.cursors)?void 0:r.get(l),u=void 0!==h&&h<=c?new Date(h):e(o),d=e(a).setHours(23,59,59,999);if(i){if(d<c)return s;d=Math.min(d,new Date(i.end).setHours(23,59,59,999))}let _=!1;for(let e=u.getTime();e<=d;e=u.setDate(u.getDate()+1))(!i||e>=c)&&(null!=i&&i.cursors&&!_&&(i.cursors.set(l,e),_=!0),n.push(t(u)));return s});return n},[]),a=(e,t)=>{if(t&&t.values.length===e.length){let n=0;for(;n<e.length&&t.values[n]===e[n];)n++;if(n===e.length)return t}return{values:e.slice(),set:new Set(e)}},l=new WeakMap,o=e=>{var t;let i=null!=(t=e.selectedHolidays)&&t[0]?e.selectedHolidays:[],s=JSON.stringify(i.map(e=>e instanceof Date?e.getTime():e)),o=l.get(e);l.set(e,{holidayKey:s,holidays:(null==o?void 0:o.holidayKey)===s?o.holidays:new Set(n(i)),selected:a(e.context.selectedDates,null==o?void 0:o.selected),disabled:a(e.context.disableDates,null==o?void 0:o.disabled),enabled:a(e.context.enableDates,null==o?void 0:o.enabled),min:Date.parse(`${e.context.displayDateMin}T00:00:00`),max:Date.parse(`${e.context.displayDateMax}T00:00:00`),first:Date.parse(`${e.context.selectedDates[0]}T00:00:00`),last:Date.parse(`${e.context.selectedDates[e.context.selectedDates.length-1]}T00:00:00`)})},r=e=>l.get(e),i=["motion","time","annotations","weeks","months"],s=new WeakMap,c={},d=Object.freeze([]),u=e=>{var t;return null==(t=s.get(e))?c:t},m=(e,t=e)=>{if(t.extensions&&t.extensions!==e.extensions&&(new Set(t.extensions).size!==e.extensions.length||t.extensions.some(t=>!e.extensions.includes(t))))throw Error("Calendar extensions are fixed at construction. Create a new Calendar to change them.");let n=u(e),i=(e,t,i)=>{if(e&&!n[t])throw Error(`The "${i}" option requires ${t}. Import { ${t} } from 'vanilla-calendar-pro' and add it to extensions: [${t}].`)};i(t.animation||t.enableSwipe,"motion",t.animation?"animation":"enableSwipe"),i(t.selectionTimeMode,"time","selectionTimeMode"),i(t.popups&&Object.keys(t.popups).length||t.onCreateDateRangeTooltip,"annotations",t.onCreateDateRangeTooltip?"onCreateDateRangeTooltip":"popups"),i("multiple"===t.type,"months","type"),i("week"===t.type||t.enableCollapse||t.enableWeekNumbers||t.onClickWeekDay,"weeks","week"===t.type?"type":t.enableCollapse?"enableCollapse":t.enableWeekNumbers?"enableWeekNumbers":"onClickWeekDay")},p=(e,t,n)=>{var i;return null==(i=u(e).annotations)?void 0:i.tooltip(e,t,n)},h=new WeakMap,v=e=>{let t=h.get(e);return t||(t={lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null,frameId:null},h.set(e,t)),t},y=e=>{e.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},g=(e,t,n)=>{e.context[t]=n},f=(e,t)=>void 0===t||("function"==typeof t?t(e):t),x=e=>f(e,e.enableDateToggle),b=e=>{if(e.length<3||e.includes(void 0))return e.sort((e,t)=>+new Date(e)-new Date(t));let t=e.map(e=>({date:e,time:+new Date(e)}));return t.sort((e,t)=>e.time-t.time),t.forEach((t,n)=>e[n]=t.date),e},D=e=>{var t;let n=h.get(e);n&&(null==(t=n.cleanup)||t.call(n),n.cleanup=void 0,null!==n.timeoutId&&clearTimeout(n.timeoutId),null!==n.frameId&&cancelAnimationFrame(n.frameId),n.lastDateEl=null,n.tooltipEl=null,n.timeoutId=null,n.frameId=null,h.delete(e))},M=(i,s,o=!0)=>{let a=v(i);if(a.lastDateEl=s,y(i),!a.cleanup){let n=i.context.mainElement,s=(n=>i=>{if(!n.context.selectedDates[0]||1!==n.context.selectedDates.length&&!n.onCreateDateRangeTooltip)return;let s=v(n);if(s.isHovering)return;let o=i.target;s.isHovering=!0,s.frameId=requestAnimationFrame(()=>{var i;s.frameId=null,s.isHovering=!1,!n.context.isDestroyed&&n.context.mainElement.contains(o)&&(1===n.context.selectedDates.length?((n,i)=>{var s;let o=v(n);if(n.context.mainElement.hasAttribute("data-vc-dragging")||!i||null==n||null==(s=n.context)||!s.selectedDates[0])return;if(!i.closest('[data-vc="dates"]'))return o.lastDateEl=null,p(n,o.tooltipEl,null),void y(n);let a=i.closest("[data-vc-date]");if(!a||o.lastDateEl===a)return;o.lastDateEl=a,p(n,o.tooltipEl,a),y(n);let r=a.dataset.vcDate,l=e(n.context.selectedDates[0]),c=e(r),[h,u]=l<c?[l,c]:[c,l],[d,_]=l<c?[n.context.selectedDates[0],r]:[r,n.context.selectedDates[0]],m=new Set(n.context.disableDates),g=new Date(h);for(;g<=u&&m.has(t(g));)g.setDate(g.getDate()+1);g<=u&&n.context.mainElement.querySelectorAll("[data-vc-date]").forEach(t=>{let n=t.dataset.vcDate;if(n===d||n===_)t.dataset.vcDateHover=d===_?"first-and-last":n===d?"first":"last";else{let i=e(n);i>=h&&i<=u&&!m.has(n)&&(t.dataset.vcDateHover="")}})})(n,o):n.context.selectedDates[0]&&n.onCreateDateRangeTooltip&&(null==(i=u(n).annotations)||i.hover(n,o)))})})(i),o=()=>(e=>{let t=v(e);null!==t.timeoutId&&clearTimeout(t.timeoutId),t.timeoutId=setTimeout(()=>{t.timeoutId=null,!e.context.isDestroyed&&(t.lastDateEl=null,p(e,t.tooltipEl,null),y(e))},50)})(i),r=e=>((e,t)=>{if("Escape"!==t.key||1!==e.context.selectedDates.length)return;let n=v(e);n.lastDateEl=null,g(e,"selectedDates",[]),p(e,n.tooltipEl,null),y(e)})(i,e);n.addEventListener("mousemove",s),n.addEventListener("mouseleave",o),n.addEventListener("keydown",r),a.cleanup=()=>{n.removeEventListener("mousemove",s),n.removeEventListener("mouseleave",o),n.removeEventListener("keydown",r)}}i.disableDatesGaps&&(a.rangeMin??=i.context.displayDateMin,a.rangeMax??=i.context.displayDateMax),a.tooltipEl=i.onCreateDateRangeTooltip?i.context.mainElement.querySelector("[data-vc-date-range-tooltip]"):null;let r=null==s?void 0:s.dataset.vcDate;if(r){let e=1===i.context.selectedDates.length&&i.context.selectedDates[0].includes(r);g(i,"selectedDates",e&&!x(i)?[r,r]:e&&x(i)?[]:i.context.selectedDates.length>1?[r]:[...i.context.selectedDates,r]),i.context.selectedDates.length>1&&b(i.context.selectedDates)}({set:()=>{i.disableDatesGaps&&(n=>{var i,s;if(null==n||null==(i=n.context)||null==(i=i.selectedDates)||!i[0]||null==(s=n.context.disableDates)||!s[0])return;let o=e(n.context.selectedDates[0]),[a,r]=n.context.disableDates.map(t=>e(t)).reduce(([e,t],n)=>[o>=n?n:e,o<n&&null===t?n:t],[null,null]);a&&g(n,"displayDateMin",t(new Date(a.setDate(a.getDate()+1)))),r&&g(n,"displayDateMax",t(new Date(r.setDate(r.getDate()-1)))),n.disableDatesPast&&!n.disableAllDates&&e(n.context.displayDateMin)<e(n.context.dateToday)&&g(n,"displayDateMin",n.context.dateToday)})(i),p(i,a.tooltipEl,s)},reset:()=>{if(!o)return;let[e,t]=[i.context.selectedDates[0],i.context.selectedDates[i.context.selectedDates.length-1]];g(i,"selectedDates",i.context.selectedDates[0]===i.context.selectedDates[i.context.selectedDates.length-1]?[i.context.selectedDates[0],i.context.selectedDates[0]]:i.enableEdgeDatesOnly?[e,t]:(()=>{let s=new Set(i.context.disableDates);return n([`${e}:${t}`]).filter(e=>!s.has(e))})()),i.disableDatesGaps&&(g(i,"displayDateMin",a.rangeMin),g(i,"displayDateMax",a.rangeMax)),i.onCreateDateRangeTooltip&&p(i,a.tooltipEl,i.context.selectedDates[0]?s:null)}})[1===i.context.selectedDates.length?"set":"reset"]()},w=e=>e.getRootNode?e.getRootNode():document,E=new WeakSet,k="data-vc-prev-tabindex",T=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),A=e=>{if(e.hasAttribute(k))return;let t=e.getAttribute("tabindex");e.setAttribute(k,null==t?"":t)},C=e=>{if(!e.hasAttribute(k))return;let t=e.getAttribute(k);""===t||null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),e.removeAttribute(k)},S=e=>{e.setAttribute("inert",""),e.ariaHidden="true",(e=>{T(e)&&(A(e),e.tabIndex=-1);let t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>T(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){let e=t.currentNode;A(e),e.tabIndex=-1}})(e)},$=e=>{var t;if(H(e),!e.context.isShowInInputMode||!e.context.currentType)return;let n=e.context.mainElement.contains(w(e.context.mainElement).activeElement);e.context.mainElement.dataset.vcCalendarHidden="",g(e,"isShowInInputMode",!1),e.inputMode&&S(e.context.mainElement),null!=(t=e.context.inputElement)&&t.hasAttribute("aria-expanded")&&e.context.inputElement.setAttribute("aria-expanded","false"),e.context.cleanupHandlers[0]&&(e.context.cleanupHandlers.forEach(e=>e()),g(e,"cleanupHandlers",[])),e.inputMode&&e.context.inputElement&&n&&(("function"==typeof e.openOnFocus||!0===e.openOnFocus)&&(e=>{E.add(e)})(e),e.context.inputElement.focus()),e.onHide&&e.onHide(e)};function Y(e){if(null==e||!e.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};let t=e.getBoundingClientRect(),n=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-n.clientTop,left:t.left+window.scrollX-n.clientLeft}}function N(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function I(e,t,n=5){let i={top:!0,bottom:!0,left:!0,right:!0},s=[];if(!t||!e)return{canShow:i,parentPositions:s};let{bottom:o,top:a}=function(e){let{top:t,left:n}={left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0},{top:i,left:s}=Y(e),{vh:o,vw:a}=N(),r=i-t,l=s-n;return{top:r,bottom:o-(r+e.clientHeight),left:l,right:a-(l+e.clientWidth)}}(e),{top:r,left:l}=Y(e),{height:c,width:h}=t.getBoundingClientRect(),{vh:u,vw:d}=N(),_=d/2,m=u/2;return[{condition:r<m,position:"top"},{condition:r>m,position:"bottom"},{condition:l<_,position:"left"},{condition:l>_,position:"right"}].forEach(({condition:e,position:t})=>{e&&s.push(t)}),Object.assign(i,{top:c<=a-n,bottom:c<=o-n,left:h<=l,right:h<=d-l}),{canShow:i,parentPositions:s}}var L=(e,t,n)=>{if(!e)return;let i="auto"===n?function(e,t){let n="left";if(!t||!e)return n;let{canShow:i,parentPositions:s}=I(e,t),o=i.left&&i.right;return(o&&i.bottom?"center":o&&i.top?["top","center"]:Array.isArray(s)?["bottom"===s[0]?"top":"bottom",...s.slice(1)]:s)||n}(e,t):n,s={top:-t.offsetHeight,bottom:e.offsetHeight,left:0,center:e.offsetWidth/2-t.offsetWidth/2,right:e.offsetWidth-t.offsetWidth},o=Array.isArray(i)?i[0]:"bottom",a=Array.isArray(i)?i[1]:i;t.dataset.vcPosition=o;let{top:r,left:l}=Y(e),c=r+s[o],h=l+s[a],{vw:u}=N();if(h+t.clientWidth>u){let e=window.innerWidth-document.body.clientWidth;h=u-t.clientWidth-e}else h<0&&(h=0);Object.assign(t.style,{left:`${h}px`,top:`${c}px`})},W=new WeakMap,H=e=>{clearTimeout(W.get(e)),W.delete(e)},O=e=>{H(e),W.set(e,setTimeout(()=>{W.delete(e),e.context.isDestroyed||q(e)}))},q=e=>{var t,n;if(H(e),e.context.isShowInInputMode||e.context.isDestroyed)return;if(!e.context.currentType)return void e.context.mainElement.click();g(e,"cleanupHandlers",[]),g(e,"isShowInInputMode",!0),e.inputMode&&((n=e.context.mainElement).removeAttribute("inert"),n.removeAttribute("aria-hidden"),(e=>{C(e),e.querySelectorAll(`[${k}]`).forEach(C)})(n)),L(e.context.inputElement,e.context.mainElement,e.positionToInput),e.context.mainElement.removeAttribute("data-vc-calendar-hidden"),null!=(t=e.context.inputElement)&&t.hasAttribute("aria-expanded")&&e.context.inputElement.setAttribute("aria-expanded","true");let i=()=>{L(e.context.inputElement,e.context.mainElement,e.positionToInput)};window.addEventListener("resize",i),e.context.cleanupHandlers.push(()=>window.removeEventListener("resize",i));let s=t=>{"Escape"===t.key&&$(e)};document.addEventListener("keydown",s),e.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",s));let o=t=>{var n;let i=null==(n=t.composedPath()[0])?t.target:n;i===e.context.inputElement||e.context.mainElement.contains(i)||$(e)};document.addEventListener("click",o,{capture:!0}),e.context.cleanupHandlers.push(()=>document.removeEventListener("click",o,{capture:!0})),e.onShow&&e.onShow(e)},F='The calendar has not been initialized, please initialize it using the "init()" method first.',P="You specified an incorrect language label or did not specify the required number of values ​​for «locale.weekdays» or «locale.months».",_=e=>String(e).replace(/[&<>"']/g,e=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e])),R=(e,t)=>`\n <div class="${_(e.styles.header)}" data-vc="header" role="group" aria-label="${_(e.labels.navigation)}">\n${t?` <#ArrowPrev [${t}] />\n`:""} <div class="${_(e.styles.headerContent)}" data-vc-header="content" aria-live="polite" aria-atomic="true">\n <#Month />\n <#Year />\n </div>\n${t?` <#ArrowNext [${t}] />\n`:""} </div>\n`,j=(e,t="month")=>`${R(e,t)} <div class="${_(e.styles.wrapper)}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${_(e.styles.content)}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n <#DateRangeTooltip />\n </div>\n </div>\n <#Collapse />\n <#ControlTime />\n`,z=e=>e,K=new WeakMap,B=e=>{var t;null==(t=K.get(e))||t.observer.disconnect(),K.delete(e)},U=B,X=e=>{var t;return!(e.animation||e.enableCollapse||e.onCreateDateEls||e.onCreateDateRangeTooltip||e.disableDatesGaps||e.popups&&Object.keys(e.popups).length||e.sanitizerHTML!==z||"default"!==e.context.currentType&&"multiple"!==e.context.currentType||e.layouts[e.context.currentType]!==("multiple"===e.context.currentType?null==(t=u(e).months)?void 0:t.layout(e):j(e)))},G=e=>JSON.stringify(Object.entries(e).filter(([e])=>"context"!==e&&"selectedDates"!==e),(e,t)=>"function"==typeof t||t),Z=({context:e})=>JSON.stringify([e.currentType,e.locale,e.dateToday,e.dateMin,e.dateMax,e.displayDateMin,e.displayDateMax,e.selectedYear,e.selectedMonth,e.displayMonthsCount,e.selectedHours,e.selectedMinutes,e.selectedKeeping,e.selectedTime]),V=e=>JSON.stringify([Z(e),e.context.displayYear,e.context.displayWeekDate,e.context.selectedDates,e.context.disableDates,e.context.enableDates]),J=(e,t=!1)=>{let n=K.get(e);if(!n||!t&&!n.fullLayout||n.dirty||n.observer.takeRecords().length||!X(e))return;let i=w(e.context.mainElement).activeElement;if(!i||i===e.context.mainElement||!e.context.mainElement.contains(i)||t&&!i.closest('[data-vc="column"], [data-vc="dates"], [data-vc-week="numbers"]'))try{if(n.options===G(e)&&n.context===V(e)&&n.timezone===(new Intl.DateTimeFormat).resolvedOptions().timeZone)return n}catch(e){}},Q=(e,t=!1)=>{if(B(e),X(e)&&!e.context.isDestroyed)try{let n=G(e),i=V(e);if(n.length+i.length>262144)return;let s=Array.from(e.context.mainElement.querySelectorAll('[data-vc="dates"]'));if(s.length!==e.context.displayMonthsCount)return;let o={observer:new MutationObserver(()=>o.dirty=!0),dirty:!1,fullLayout:t,options:n,context:i,structure:Z(e),timezone:(new Intl.DateTimeFormat).resolvedOptions().timeZone,month:12*e.context.selectedYear+e.context.selectedMonth,count:s.length};o.observer.observe(e.context.mainElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0}),K.set(e,o)}catch(t){B(e)}},ee=(e,t,n,i="")=>{t?e.getAttribute(n)!==i&&e.setAttribute(n,i):e.getAttribute(n)===i&&e.removeAttribute(n)},te=(t,n,i,s,o,a,l)=>{var c;let h=(_=a,Date.parse(`${_}T00:00:00`)),u=r(t),d=u.min>h||u.max<h||u.disabled.set.has(a)||!t.selectionMonthsMode&&"current"!==l||!t.selectionYearsMode&&e(a).getFullYear()!==n;var _;ee(i,d,"data-vc-date-disabled"),s&&ee(s,d,"aria-disabled","true"),s&&d&&ee(s,!0,"tabindex","-1"),s&&s.disabled!==!!d&&(s.disabled=!!d),ee(i,!t.disableToday&&t.context.dateToday===a,"data-vc-date-today"),ee(i,!t.disableToday&&t.context.dateToday===a,"aria-current","date"),ee(i,null==(c=t.selectedWeekends)?void 0:c.includes(o),"data-vc-date-weekend"),ee(i,u.holidays.has(a),"data-vc-date-holiday");let m=u.selected.set.has(a),p=m?"":void 0;m?(ee(i,!0,"aria-selected","true"),t.context.selectedDates.length>1&&"multiple-ranged"===t.selectionDatesMode&&(t.context.selectedDates[0]===a&&t.context.selectedDates[t.context.selectedDates.length-1]===a?p="first-and-last":t.context.selectedDates[0]===a?p="first":t.context.selectedDates[t.context.selectedDates.length-1]===a&&(p="last"),t.context.selectedDates[0]!==a&&t.context.selectedDates[t.context.selectedDates.length-1]!==a&&(p="middle"))):i.hasAttribute("data-vc-date-selected")&&i.removeAttribute("aria-selected"),!u.disabled.set.has(a)&&t.enableEdgeDatesOnly&&t.context.selectedDates.length>1&&"multiple-ranged"===t.selectionDatesMode&&(h>u.first&&h<u.last?p="middle":"middle"===p&&(p=void 0)),void 0===p?i.hasAttribute("data-vc-date-selected")&&i.removeAttribute("data-vc-date-selected"):ee(i,!0,"data-vc-date-selected",p)},ne=new Map,ae=new Map,le=(e,t,n)=>{var i,s;let o=null==(i=e.disableWeekdays)?void 0:i.includes(n),a=e.disableAllDates&&!(null==(s=e.context.enableDates)||!s[0]),l=r(e);if((o||a)&&!l.enabled.set.has(t)&&!l.disabled.set.has(t)){let n=e.context.disableDates;if(l.disabled.set.add(t),e.onCreateDateEls)n.push(t),b(n),l.disabled.values=n.slice();else{let e=+new Date(t),i=0,s=n.length;for(;i<s;){let t=i+s>>>1;+new Date(n[t])<=e?i=t+1:s=t}n.splice(i,0,t),l.disabled.values.splice(i,0,t)}}},oe=(t,n,i,s,a,r)=>{var l;let c,h=e(a).getDay(),d="string"==typeof t.locale&&t.locale.length?t.locale:"en",_=document.createElement("div");_.className=t.styles.date,_.dataset.vcDate=a,_.dataset.vcDateMonth=r,_.dataset.vcDateWeekDay=String(h),_.role="gridcell",("current"===r||t.displayDatesOutside)&&(c=document.createElement("button"),c.className=t.styles.dateBtn,c.type="button",c.dataset.vcDateBtn="",c.ariaLabel=((e,t)=>{let n=`${t}:${e}`,i=ae.get(n);if(void 0!==i)return i;let s=ne.get(t);s||(s=new Intl.DateTimeFormat(t,{dateStyle:"long",timeZone:"UTC"}),ne.size>=8&&ne.delete(ne.keys().next().value),ne.set(t,s));let o=s.format(new Date(`${e}T00:00:00.000Z`));return ae.size>=512&&ae.delete(ae.keys().next().value),ae.set(n,o),o})(a,d),c.innerText=String(s),_.appendChild(c)),t.enableWeekNumbers&&(null==(l=u(t).weeks)||l.date(t,_,a)),le(t,a,h),te(t,n,_,c,h,a,r),i.addDate(_),t.onCreateDateEls&&(t.onCreateDateEls(t,_),o(t))},re=[{container:'[data-vc="dates"]',item:"[data-vc-date-btn]",active:["[data-vc-date-selected] [data-vc-date-btn]","[data-vc-date-today] [data-vc-date-btn]"]},{container:'[data-vc="months"]',item:"[data-vc-months-month]",active:["[data-vc-months-month-selected]"]},{container:'[data-vc="years"]',item:"[data-vc-years-year]",active:["[data-vc-years-year-selected]"]}],ie=e=>!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),se=(e,t,n)=>{if(n&&ie(n))return e.querySelectorAll(`${t.item}:not([tabindex="-1"])`).forEach(e=>{e!==n&&(e.tabIndex=-1)}),void("0"!==n.getAttribute("tabindex")&&(n.tabIndex=0));let i=Array.from(e.querySelectorAll(t.item));if(!i[0])return;let s=((e,t,n)=>{var i;let s=t.active.map(t=>e.querySelector(t)).find(e=>!!e&&ie(e));return null==(i=null==s?n.find(ie):s)?n[0]:i})(e,t,i);i.forEach(e=>{let t=e===s?0:-1;e.getAttribute("tabindex")!==String(t)&&(e.tabIndex=t)})},ce=e=>{let t=e.target,n=re.find(e=>{var n;return null==(n=t.matches)?void 0:n.call(t,e.item)}),i=n?t.closest(n.container):null;n&&i&&se(i,n,t)},de=e=>{re.forEach(t=>{e.context.mainElement.querySelectorAll(t.container).forEach(e=>{e.closest("[data-vc-ghost]")||se(e,t,null)})})},ue=(e,n,i=!0)=>{var s;U(e);let a=new Date(e.context.selectedYear,e.context.selectedMonth,1),r=e.context.mainElement.querySelectorAll('[data-vc="dates"]'),l=u(e).weeks,c=e.enableWeekNumbers?e.context.mainElement.querySelectorAll('[data-vc-week="numbers"]'):[],h=null==(s=u(e).annotations)?void 0:s.prepare(e,r.length);r.forEach((i,s)=>{e.selectionDatesMode||(i.dataset.vcDatesDisabled="");let r=n?12*e.context.selectedYear+e.context.selectedMonth+s-n.month:-1;if(n&&r>=0&&r<n.count)return;if(i.textContent="",o(e),"week"===e.context.currentType)return l?.dates(e,i),h?.(i),void(null==l||l.numbers(e,0,7,c[s],i));let u=new Date(a);u.setMonth(u.getMonth()+s);let d=u.getMonth(),_=u.getFullYear(),m=(new Date(_,d,1).getDay()-e.firstWeekday+7)%7,p=new Date(_,d+1,0).getDate(),g=m+p,E=Math.ceil(g/7),f=7*E-g,v=[];for(let t=0;t<E;t++){let t=document.createElement("div");t.className=e.styles.datesRow,t.setAttribute("data-vc-dates","row"),t.setAttribute("role","row"),v.push(t)}let b=0,T=0,y={addDate:e=>{v[b].appendChild(e),T++,T>=7&&(b++,T=0)}};((e,t,n,i,s)=>{let o=new Date(n,i,0).getDate()-(s-1),a=0===i?n-1:n,r=0===i?12:i<10?`0${i}`:i;for(let i=s;i>0;i--,o++)oe(e,n,t,o,`${a}-${r}-${o}`,"prev")})(e,y,_,d,m),((e,n,i,s,o)=>{for(let a=1;a<=i;a++){let i=new Date(s,o,a);oe(e,s,n,a,t(i),"current")}})(e,y,p,_,d),((e,t,n,i,s)=>{let o=s+1===12?i+1:i,a=s+1===12?"01":s+2<10?`0${s+2}`:s+2;for(let s=1;s<=n;s++){let n=`${o}-${a}-${s<10?`0${s}`:String(s)}`;oe(e,i,t,s,n,"next")}})(e,y,f,_,d);for(let e of v)i.appendChild(e);h?.(i),l?.numbers(e,m,p,c[s],i)}),de(e),i&&Q(e,null==n?void 0:n.fullLayout)},me=(e,t)=>`${R(e,"Years"===t?"year":void 0)} <div class="${_(e.styles.wrapper)}" data-vc="wrapper">\n <div class="${_(e.styles.content)}" data-vc="content">\n <#${t} />\n </div>\n </div>\n`,pe=e=>me(e,"Months"),he=e=>me(e,"Years"),ye=(e,t,n)=>e.labels["arrow"+("prev"===t?"Prev":"Next")][n],ge={ArrowNext:(e,t)=>`<button type="button" class="${_(e.styles.arrowNext)}" data-vc-arrow="next" aria-label="${_(ye(e,"next",t))}"></button>`,ArrowPrev:(e,t)=>`<button type="button" class="${_(e.styles.arrowPrev)}" data-vc-arrow="prev" aria-label="${_(ye(e,"prev",t))}"></button>`,Dates:e=>`<div class="${_(e.styles.dates)}" data-vc="dates" role="rowgroup" aria-label="${_(e.labels.dates)}"></div>`,Month:e=>`<button type="button" class="${_(e.styles.month)}" data-vc="month"></button>`,Months:e=>`<div class="${_(e.styles.months)}" data-vc="months" role="grid" aria-label="${_(e.labels.months)}"></div>`,Week:e=>`<div class="${_(e.styles.week)}" data-vc="week" role="row" aria-label="${_(e.labels.week)}"></div>`,Year:e=>`<button type="button" class="${_(e.styles.year)}" data-vc="year"></button>`,Years:e=>`<div class="${_(e.styles.years)}" data-vc="years" role="grid" aria-label="${_(e.labels.years)}"></div>`},fe=(e,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(t,n)=>{let i=(n.match(/\[(.*?)\]/)||[])[1],s=((e,t)=>{var n,i,s,o;return"Collapse"===t?null==(n=u(e).weeks)?void 0:n.component:"WeekNumbers"===t?null==(i=u(e).weeks)?void 0:i.numbersComponent:"DateRangeTooltip"===t?null==(s=u(e).annotations)?void 0:s.component:"ControlTime"===t?null==(o=u(e).time)?void 0:o.component:Object.prototype.hasOwnProperty.call(ge,t)?ge[t]:void 0})(e,n.replace(/[/\s\n\t]|\[(.*?)\]/g,"")),o=s?s(e,null==i?null:i):"";return e.sanitizerHTML(o)}).replace(/[\n\t]/g,""),xe=(e,t)=>{var n,i,s;let o=u(e),a={default:j,month:pe,year:he,multiple:null==(n=o.months)?void 0:n.layout,week:null==(i=o.weeks)?void 0:i.layout};var r;Object.keys(a).forEach(t=>{var n,i;let s=t;e.layouts[s].length||(e.layouts[s]=null==(n=null==(i=a[s])?void 0:i.call(a,e))?"":n)}),e.context.mainElement.className=e.styles.calendar,e.context.mainElement.dataset.vc="calendar",e.context.mainElement.dataset.vcType=e.context.currentType,e.context.mainElement.toggleAttribute("data-vc-swipe",e.enableSwipe),e.context.mainElement.role=e.inputMode?"dialog":"group",e.context.mainElement.tabIndex=-1,e.context.mainElement.ariaLabel=e.labels.application,null!=(s=o.months)&&s.render(e,t)||(null==(r=o.time)||r.destroy(e),e.context.mainElement.innerHTML=e.sanitizerHTML(fe(e,e.layouts[e.context.currentType]))),(e=>{let t=["multiple","multiple-ranged"].includes(String(e.selectionDatesMode));e.context.mainElement.querySelectorAll('[data-vc="content"][role="grid"]').forEach(e=>{t?e.setAttribute("aria-multiselectable","true"):e.removeAttribute("aria-multiselectable")})})(e)},be=(e,t,n,i)=>{e.style.visibility=n?"hidden":"",t.style.visibility=i?"hidden":""},De=n=>{if("month"===n.context.currentType)return;let i=n.context.mainElement.querySelector('[data-vc-arrow="prev"]'),s=n.context.mainElement.querySelector('[data-vc-arrow="next"]');i&&s&&{default:()=>((n,i,s)=>{let o=e(t(new Date(n.context.selectedYear,n.context.selectedMonth,1))),a=new Date(o.getTime()),r=new Date(o.getTime());a.setMonth(a.getMonth()-n.monthsToSwitch),r.setMonth(r.getMonth()+n.monthsToSwitch);let l=e(n.context.dateMin),c=e(n.context.dateMax);n.selectionYearsMode||(l.setFullYear(o.getFullYear()),c.setFullYear(o.getFullYear())),be(i,s,!n.selectionMonthsMode||a.getFullYear()<l.getFullYear()||a.getFullYear()===l.getFullYear()&&a.getMonth()<l.getMonth(),!n.selectionMonthsMode||r.getFullYear()>c.getFullYear()||r.getFullYear()===c.getFullYear()&&r.getMonth()>c.getMonth()-(n.context.displayMonthsCount-1))})(n,i,s),year:()=>((t,n,i)=>{let s=e(t.context.dateMin),o=e(t.context.dateMax);be(n,i,!!(s.getFullYear()&&t.context.displayYear-7<=s.getFullYear()),!!(o.getFullYear()&&t.context.displayYear+7>=o.getFullYear()))})(n,i,s),week:()=>{var e;return null==(e=u(n).weeks)?void 0:e.arrows(n,i,s)}}["multiple"===n.context.currentType?"default":n.context.currentType]()},Me=(e,t)=>{let n=e.context.mainElement.querySelectorAll('[data-vc="month"]'),i=e.context.mainElement.querySelectorAll('[data-vc="year"]'),s=new Date(e.context.selectedYear,e.context.selectedMonth,1);[n,i].forEach(n=>null==n?void 0:n.forEach((n,i)=>{(!t||t.includes(i))&&((e,t,n,i,s)=>{let o=new Date(i.setFullYear(e.context.selectedYear,e.context.selectedMonth+n)).getFullYear(),a=new Date(i.setMonth(e.context.selectedMonth+n)).getMonth(),r=e.context.locale.months.long[a],l=t.closest('[data-vc="column"]');l&&(l.ariaLabel=`${r} ${o}`);let c={month:{id:a,label:r},year:{id:o,label:o}};t.innerText=String(c[s].label),t.dataset[`vc${s.charAt(0).toUpperCase()+s.slice(1)}`]=String(c[s].id),t.ariaLabel=`${e.labels[s]} ${c[s].label}`;let h={month:e.selectionMonthsMode,year:e.selectionYearsMode},u=!1===h[s]||"only-arrows"===h[s];u&&(t.tabIndex=-1),t.disabled=u})(e,n,i,s,n.dataset.vc)}))},we=(e,t,n,i,s)=>{let o={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};var a,r;s&&(null==(a=e.context.mainElement.querySelectorAll({month:"[data-vc-months-month]",year:"[data-vc-years-year]"}[n]))||a.forEach(e=>{var t;e.removeAttribute(o[n].selected),null==(t=e.parentElement)||t.removeAttribute(o[n].aria)}),g(e,o[n].selectedProperty,Number(t.dataset[o[n].value])),Me(e),"year"===n&&De(e)),i&&(t.setAttribute(o[n].selected,""),null==(r=t.parentElement)||r.setAttribute(o[n].aria,"true"))},Ee=(e,t,n,i,s,o,a,r)=>{let l="month"===t?"months":"years",c=document.createElement("div");c.className=e.styles[`${l}Cell`],c.setAttribute(`data-vc-${l}`,"cell"),c.role="gridcell";let h=n.cloneNode(!1);return h.className=e.styles["month"===t?"monthsMonth":"yearsYear"],h.innerText=a,h.ariaLabel=r,h.setAttribute(`data-vc-${l}-${t}`,String(o)),s&&(h.ariaDisabled="true"),s&&(h.tabIndex=-1),h.disabled=s,c.appendChild(h),we(e,h,t,i===o,!1),c},ke=(e,t)=>{var n,i;return null==(n=null==(i=u(e).months)?void 0:i.column(e,t))?{currentValue:null,columnID:0}:n},Te=(t,n)=>{var i;let s=null==n||null==(i=n.closest('[data-vc="header"]'))?void 0:i.querySelector('[data-vc="year"]'),o=s?Number(s.dataset.vcYear):t.context.selectedYear,a=null!=n&&n.dataset.vcMonth?Number(n.dataset.vcMonth):t.context.selectedMonth;g(t,"currentType","month"),xe(t,n),Me(t);let r=t.context.mainElement.querySelector('[data-vc="months"]');if(!t.selectionMonthsMode||!r)return;let l=t.monthsToSwitch>1?t.context.locale.months.long.map((e,n)=>a-t.monthsToSwitch*n).concat(t.context.locale.months.long.map((e,n)=>a+t.monthsToSwitch*n)).filter(e=>e>=0&&e<=12):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";let h,u=()=>({min:e(t.context.dateMin),max:e(t.context.dateMax),monthCount:t.context.displayMonthsCount-1,columnID:ke(t,"month").columnID}),d=t.onCreateMonthEls?void 0:u();for(let e=0;e<12;e++){e%4==0&&(h=document.createElement("div"),h.className=t.styles.monthsRow,h.dataset.vcMonths="row",h.role="row",r.appendChild(h));let{min:n,max:i,monthCount:s,columnID:_}=null==d?u():d,m=Ee(t,"month",c,a,o<=n.getFullYear()&&e<n.getMonth()+_||o>=i.getFullYear()&&e>i.getMonth()-s+_||o>i.getFullYear()||e!==a&&!l.includes(e),e,t.context.locale.months.short[e],t.context.locale.months.long[e]);h?.appendChild(m),t.onCreateMonthEls&&t.onCreateMonthEls(t,m)}de(t)},Ae=e=>{var t;let n=e.selectedWeekends?[...e.selectedWeekends]:[],i=[...e.context.locale.weekdays.long].map((t,i)=>({id:i,titleShort:e.context.locale.weekdays.short[i],titleLong:t,isWeekend:n.includes(i)})),s=[...i.slice(e.firstWeekday),...i.slice(0,e.firstWeekday)],o=null==(t=u(e).weeks)?void 0:t.weekday(e),a=document.createElement(o?"div":"b");e.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(t=>{s.forEach(n=>{let i=a.cloneNode(!1);i.className=e.styles.weekDay,i.role="columnheader",i.ariaLabel=n.titleLong,i.dataset.vcWeekDay=String(n.id),n.isWeekend&&(i.dataset.vcWeekDayOff=""),o?o(i,n.titleShort,n.titleLong):i.innerText=n.titleShort,t.appendChild(i)})})},Ce=(t,n)=>{let i=null!=n&&n.dataset.vcYear?Number(n.dataset.vcYear):t.context.selectedYear;g(t,"currentType","year"),xe(t,n),Me(t),De(t);let s=t.context.mainElement.querySelector('[data-vc="years"]');if(!t.selectionYearsMode||!s)return;let o="multiple"===t.type?t.context.selectedYear===i?0:1:0,a=document.createElement("button");a.type="button";let r,l=()=>[e(t.context.dateMin).getFullYear(),e(t.context.dateMax).getFullYear()],c=t.onCreateYearEls?void 0:l();for(let e=t.context.displayYear-7;e<t.context.displayYear+8;e++){(e-(t.context.displayYear-7))%5==0&&(r=document.createElement("div"),r.className=t.styles.yearsRow,r.dataset.vcYears="row",r.role="row",s.appendChild(r));let[n,h]=null==c?l():c,u=Ee(t,"year",a,i,e<n+o||e>h,e,String(e),String(e));r?.appendChild(u),t.onCreateYearEls&&t.onCreateYearEls(t,u)}de(t)},Se=new WeakMap,$e=e=>{var t,n;let i="not all"!==window.matchMedia("(prefers-color-scheme)").media;var s,o;if(!i||"system"!==e.selectedTheme)return null==(s=(o=e.context).cleanupSystemTheme)||s.call(o),void(e.context.mainElement.dataset.vcTheme=i?e.selectedTheme:"light");let a=e.themeAttrDetect.length?document.querySelector(e.themeAttrDetect):null,r=e.themeAttrDetect.replace(/^.*\[(.+)\]/g,(e,t)=>t),l=Se.get(e);if((null==l?void 0:l.element)===a&&l.attr===r)return void l.update();null==(t=(n=e.context).cleanupSystemTheme)||t.call(n);let c,h=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{let t=null==a?void 0:a.getAttribute(r),n=!t||"system"===t;e.context.mainElement.dataset.vcTheme=n?h.matches?"dark":"light":t,n&&!c?h.addEventListener?(h.addEventListener("change",u),c=()=>h.removeEventListener("change",u)):(h.addListener(u),c=()=>h.removeListener(u)):!n&&c&&(c(),c=void 0)},d=a?((e,t,n)=>{let i=new MutationObserver(e=>{for(let i=0;i<e.length;i++)if(e[i].attributeName===t){n();break}});return i.observe(e,{attributes:!0,attributeFilter:[t]}),()=>i.disconnect()})(a,r,u):void 0;Se.set(e,{element:a,attr:r,update:u}),g(e,"cleanupSystemTheme",()=>{d?.(),c?.(),Se.delete(e),g(e,"cleanupSystemTheme",void 0)}),u()};function Ye(e){return Ye="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},Ye(e)}function Ne(e,t,n){return(t=function(e){var t=function(e){if("object"!=Ye(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ye(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ye(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ie(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Le(e){for(var t=1;t<arguments.length;t++){var n=null==arguments[t]?{}:arguments[t];t%2?Ie(Object(n),!0).forEach(function(t){Ne(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ie(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var We=new Map,He=(e,t,n)=>{let i=new Intl.DateTimeFormat(e,{[t]:n,timeZone:"UTC"});return Array.from({length:"weekday"===t?7:12},(e,n)=>{return(s=i.format(new Date(Date.UTC(1978,"month"===t?n:0,"weekday"===t?n+1:1)))).charAt(0).toUpperCase()+s.slice(1).replace(/\./,"");var s})},Oe=e=>{if(e.context.locale.weekdays.short[6]&&e.context.locale.weekdays.long[6]&&e.context.locale.months.short[11]&&e.context.locale.months.long[11])return;if("string"!=typeof e.locale){var t,n,i,s;if(!(null!=(t=e.locale)&&null!=(t=t.weekdays)&&t.short[6]&&null!=(n=e.locale)&&null!=(n=n.weekdays)&&n.long[6]&&null!=(i=e.locale)&&null!=(i=i.months)&&i.short[11]&&null!=(s=e.locale)&&null!=(s=s.months)&&s.long[11]))throw Error(P);return void g(e,"locale",Le({},e.locale))}if("string"==typeof e.locale&&!e.locale.length)throw Error(P);let o=We.get(e.locale);o||(o={weekdays:{short:He(e.locale,"weekday","short"),long:He(e.locale,"weekday","long")},months:{short:He(e.locale,"month","short"),long:He(e.locale,"month","long")}},We.size>=8&&We.delete(We.keys().next().value),We.set(e.locale,o));for(let t of["weekdays","months"])for(let n of["short","long"])e.context.locale[t][n].push(...o[t][n])},qe=(e,t=!0)=>{var n;U(e),$e(e),Oe(e),xe(e),Me(e),De(e),null==(n=u(e).time)||n.render(e),{default:()=>{Ae(e),ue(e,void 0,!1)},multiple:()=>{Ae(e),ue(e,void 0,!1)},week:()=>{var t;null==(t=u(e).weeks)||t.init(e),Ae(e),ue(e,void 0,!1)},month:()=>Te(e),year:()=>Ce(e)}[e.context.currentType](),t&&Q(e,!0)},Fe=(t,n=!1)=>{o(t),t.context.mainElement.querySelectorAll("[data-vc-date]").forEach(i=>{let s=i.querySelector("[data-vc-date-btn]"),o=i.dataset.vcDate,a=e(o),r=a.getDay();n&&le(t,o,r);let l=n?i.dataset.vcDateMonth:"current";"prev"===l&&a.setMonth(a.getMonth()+1,1),"next"===l&&a.setMonth(a.getMonth()-1,1),te(t,n?a.getFullYear():t.context.selectedYear,i,s,r,o,l)}),de(t)},Pe=e=>{let t=[{container:'[data-vc="dates"]',row:'[data-vc-dates="row"]',item:"[data-vc-date-btn]"},{container:'[data-vc="months"]',row:'[data-vc-months="row"]',item:"[data-vc-months-month]"},{container:'[data-vc="years"]',row:'[data-vc-years="row"]',item:"[data-vc-years-year]"}],n=e=>!e.disabled&&"true"!==e.getAttribute("aria-disabled"),i=e=>{let i=e.target.closest("button");if(!i||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(e.key))return;let s,o=t.find(e=>i.matches(e.item)),a=o?i.closest(o.container):null;if(o&&a&&!a.closest("[data-vc-ghost]")&&n(i)){if("ArrowUp"===e.key||"ArrowDown"===e.key)s=((e,t,i,s)=>{var o;let a=i.closest(t.row);if(!a)return i;let r=Array.from(e.querySelectorAll(t.row)),l=r.indexOf(a),c=Array.from(a.children).indexOf(i.parentElement),h=r[l+s],u=null==h||null==(o=h.children[c])?void 0:o.querySelector(t.item);return u&&n(u)?u:i})(a,o,i,"ArrowUp"===e.key?-1:1);else{let t=Array.from(a.querySelectorAll(o.item)).filter(n),r=t.indexOf(i);if(-1===r)return;s="ArrowLeft"===e.key?t[Math.max(0,r-1)]:t[Math.min(t.length-1,r+1)]}e.preventDefault(),s?.focus()}};return e.context.mainElement.addEventListener("keydown",i),e.context.mainElement.addEventListener("focusin",ce),()=>{e.context.mainElement.removeEventListener("keydown",i),e.context.mainElement.removeEventListener("focusin",ce)}},_e='[data-vc="dates"]',Re=(e,t)=>"next"===e?t:-t,je=n=>{let i={selector:_e,shift:i=>((n,i)=>{let s=e(t(new Date(n.context.selectedYear,n.context.selectedMonth,1)));s.setMonth(s.getMonth()+Re(i,n.monthsToSwitch)),g(n,"selectedMonth",s.getMonth()),g(n,"selectedYear",s.getFullYear())})(n,i),render:(e,t)=>ue(n,t)};return{default:i,multiple:i,week:{selector:_e,shift:e=>{var t;return null==(t=u(n).weeks)?void 0:t.shift(n,e)},render:()=>ue(n)},year:{selector:'[data-vc="years"]',shift:e=>g(n,"displayYear",n.context.displayYear+Re(e,15)),render:e=>Ce(n,e)},month:null}[n.context.currentType]},ze=(e,t,n)=>{var i;let s=je(e);if(!s)return;let{mainElement:o}=e.context,a=o.contains(w(o).activeElement),r="multiple"===e.context.currentType?J(e,!0):void 0;U(e),s.shift(t);let l=r?null==(i=u(e).months)?void 0:i.rotate(e,r):void 0;l||(r=void 0),Me(e,l),De(e);let c=u(e).motion;c&&e.animation?c.navigate(e,s.selector,t,()=>s.render(n,r)):s.render(n,r),((e,t,n)=>{var i;let{mainElement:s}=e.context;if(!n||s.contains(w(s).activeElement))return;let o=s.querySelector(`[data-vc-arrow="${t}"]`);if(o&&"hidden"!==o.style.visibility)return o.focus();null==(i=Array.from(s.querySelectorAll('[tabindex="0"]')).find(e=>!e.closest("[data-vc-ghost]")))||i.focus()})(e,t,a)},Ke=(e,t,n)=>{let i=t.dataset.vcDate,s=t.closest("[data-vc-date][data-vc-date-selected]"),o=x(e);(!s||o)&&g(e,"selectedDates",s?e.context.selectedDates.filter(e=>e!==i):n?[...e.context.selectedDates,i]:[i])},Be=["month","year"],Ue='[data-vc="column"]',Xe=(e,t,n)=>{let i=u(e).motion;i&&e.animation?i.changeView(e,t,n):n()},Ge=(e,t)=>{var n;let{columnID:i}=ke(e,e.context.currentType);g(e,"currentType",e.type),Xe(e,i,()=>qe(e)),null==(n=e.context.mainElement.querySelector(`[data-vc="${t}"]`))||n.focus()},Ze=e=>{let t=t=>{var n,i;((e,t)=>{let n=t.target,i=n.closest("[data-vc-arrow]");i&&(ze(e,i.dataset.vcArrow,n),e.onClickArrow&&e.onClickArrow(e,t))})(e,t),null==(n=u(e).weeks)||n.click(e,t),((e,t)=>{let n=t.target,i=n.closest("[data-vc-date-btn]");if(!e.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(e.selectionDatesMode)||!i)return;let s=i.closest("[data-vc-date]");({single:()=>Ke(e,s,!1),multiple:()=>Ke(e,s,!0),"multiple-ranged":()=>M(e,s)})[e.selectionDatesMode](),e.context.selectedDates&&b(e.context.selectedDates),e.onClickDate&&e.onClickDate(e,t),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t);let o=n.closest('[data-vc-date-month="prev"]'),a=n.closest('[data-vc-date-month="next"]');({prev:()=>e.enableMonthChangeOnDayClick?ze(e,"prev"):Fe(e),next:()=>e.enableMonthChangeOnDayClick?ze(e,"next"):Fe(e),current:()=>Fe(e)})[o?"prev":a?"next":"current"]()})(e,t),((e,t)=>{let n={month:e.selectionMonthsMode,year:e.selectionYearsMode};Be.forEach(i=>{n[i]&&t.target&&((e,t,n)=>{let i=t.target,s=i.closest(`[data-vc="${n}"]`),o=((e,t)=>{let n=t.closest(Ue);return n?Array.from(e.context.mainElement.querySelectorAll(Ue)).indexOf(n):0})(e,i),a={year:()=>Xe(e,o,()=>Ce(e,i)),month:()=>Xe(e,o,()=>Te(e,i))};if(s&&e.onClickTitle&&e.onClickTitle(e,t),s&&e.context.currentType!==n){let t=i.closest(Ue);return a[n](),((e,t,n)=>{var i;return null==(i=(null==n?e.context.mainElement:n).querySelector(`[data-vc-${t}s-${t}][tabindex="0"]`))?void 0:i.focus()})(e,n,t)}let r=i.closest(`[data-vc-${n}s-${n}]`);if(r)return((e,t,n,i)=>{({year:()=>{var t;if("multiple"===e.type)return null==(t=u(e).months)?void 0:t.select(e,"year",i);g(e,"selectedYear",Number(i.dataset.vcYearsYear))},month:()=>{var t;if("multiple"===e.type)return null==(t=u(e).months)?void 0:t.select(e,"month",i);g(e,"selectedMonth",Number(i.dataset.vcMonthsMonth))}})[n](),{year:()=>{var n;return null==(n=e.onClickYear)?void 0:n.call(e,e,t)},month:()=>{var n;return null==(n=e.onClickMonth)?void 0:n.call(e,e,t)}}[n](),e.context.currentType===e.type?we(e,i,n,!0,!0):Ge(e,n)})(e,t,n,r);let l=i.closest('[data-vc="grid"]'),c=i.closest('[data-vc="column"]');(e.context.currentType===n&&s||"multiple"===e.type&&e.context.currentType===n&&l&&!c)&&Ge(e,n)})(e,t,i)})})(e,t),null==(i=u(e).weeks)||i.collapseClick(e,t)};return e.context.mainElement.addEventListener("click",t),()=>e.context.mainElement.removeEventListener("click",t)},Ve=new WeakMap,Je=(e,t)=>{let i=e[t].map(e=>e instanceof Date?e.getTime():e),s=Ve.get(e),o=null==s?void 0:s[t];if(o&&i.length===o.values.length){let e=0;for(;e<i.length&&i[e]===o.values[e];)e++;if(e===i.length&&o.timezone===(new Intl.DateTimeFormat).resolvedOptions().timeZone)return o.dates.slice()}let a=n(e[t]);if(a.length>1&&b(a),a.length>128&&a.length<=1e4&&i.length<=1e4){let n=null==s?{}:s;n[t]={values:i,dates:a.slice(),timezone:(new Intl.DateTimeFormat).resolvedOptions().timeZone},Ve.set(e,n)}else s&&delete s[t];return a},Qe=(e,t)=>"today"===e?(()=>{let e=new Date;return new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substring(0,10)})():e instanceof Date||"number"==typeof e||"string"==typeof e?n([e])[0]:t,et=(e,t,n)=>{g(e,"selectedMonth",t),g(e,"selectedYear",n),g(e,"displayYear",n)},tt=t=>{var i,s;if(t.enableCollapse&&!["default","week"].includes(t.type))throw Error("The «enableCollapse» parameter is only supported by the «default» and «week» calendar types.");g(t,"currentType",t.type),(e=>{if("multiple"===e.type&&(e.displayMonthsCount<=1||e.displayMonthsCount>12)||"multiple"!==e.type&&e.displayMonthsCount>1)throw Error("For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1.");g(e,"displayMonthsCount",e.displayMonthsCount?e.displayMonthsCount:"multiple"===e.type?2:1)})(t),(t=>{var n,i,s;let o=Qe(t.dateMin,t.dateMin),a=Qe(t.dateMax,t.dateMax),r=Qe(t.displayDateMin,o),l=Qe(t.displayDateMax,a);if(g(t,"dateToday",Qe(t.dateToday,t.dateToday)),g(t,"displayDateMin",r?e(o)>=e(r)?o:r:o),g(t,"displayDateMax",l?e(a)<=e(l)?a:l:a),g(t,"displayDateMin",t.disableDatesPast&&!t.disableAllDates&&e(r)<e(t.context.dateToday)||t.disableAllDates?t.context.dateToday:r),g(t,"displayDateMax",t.disableAllDates?t.context.dateToday:l),g(t,"disableDates",t.disableDates[0]&&!t.disableAllDates?Je(t,"disableDates"):t.disableAllDates?[t.context.displayDateMin]:[]),g(t,"enableDates",t.enableDates[0]?Je(t,"enableDates"):[]),null!=(n=t.context.enableDates)&&n[0]&&null!=(i=t.context.disableDates)&&i[0]){let e=new Set(t.context.enableDates);g(t,"disableDates",t.context.disableDates.filter(t=>!e.has(t)))}null!=(s=t.context.enableDates)&&s[0]&&t.disableAllDates&&(g(t,"displayDateMin",t.context.enableDates[0]),g(t,"displayDateMax",t.context.enableDates[t.context.enableDates.length-1])),g(t,"dateMin",t.displayDisabledDates?o:t.context.displayDateMin),g(t,"dateMax",t.displayDisabledDates?a:t.context.displayDateMax)})(t),(t=>{var i;if(t.enableJumpToSelectedDate&&null!=(i=t.selectedDates)&&i[0]&&void 0===t.selectedMonth&&void 0===t.selectedYear){let i=e(n(t.selectedDates)[0]);return void et(t,i.getMonth(),i.getFullYear())}if((t=>{let i=e=>{let n=new Date(e);et(t,n.getMonth(),n.getFullYear())};return t.displayDateMin&&"today"!==t.displayDateMin&&(s=t.displayDateMin,o=new Date,new Date(s).getTime()>o.getTime())?(i(e(Qe(t.selectedDates.length&&t.selectedDates[0]?n(t.selectedDates)[0]:t.displayDateMin,t.displayDateMin))),!0):!(!t.displayDateMax||"today"===t.displayDateMax||!((e,t)=>new Date(e).getTime()<t.getTime())(t.displayDateMax,new Date)||(i(e(Qe(t.selectedDates.length&&t.selectedDates[0]?n(t.selectedDates)[0]:t.displayDateMax,t.displayDateMax))),0));var s,o})(t))return;let s=void 0!==t.selectedMonth&&Number(t.selectedMonth)>=0&&Number(t.selectedMonth)<12,o=void 0!==t.selectedYear&&Number(t.selectedYear)>=0&&Number(t.selectedYear)<=9999;et(t,s?Number(t.selectedMonth):e(t.context.dateToday).getMonth(),o?Number(t.selectedYear):e(t.context.dateToday).getFullYear())})(t),(e=>{var t;g(e,"selectedDates",null!=(t=e.selectedDates)&&t[0]?n(e.selectedDates):[])})(t),null==(i=u(t).weeks)||i.init(t),null==(s=u(t).time)||s.init(t)},nt=(e,{year:t,month:n,dates:i,time:s,locale:o},a=!0,r)=>{var l,c,h,d;U(e);let _=u(e);null==(l=_.motion)||l.reset(e),null==(c=_.time)||c.destroy(e),null==(h=_.annotations)||h.destroy(e),D(e);let m={year:e.selectedYear,month:e.selectedMonth,dates:e.selectedDates,time:e.selectedTime};var p;e.selectedYear=t?m.year:e.context.selectedYear,e.selectedMonth=n?m.month:e.context.selectedMonth,e.selectedTime=s?m.time:e.context.selectedTime,e.selectedDates="only-first"===i&&null!=(d=e.context.selectedDates)&&d[0]?[e.context.selectedDates[0]]:!0===i?m.dates:e.context.selectedDates,o&&g(e,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),tt(e),a&&(r&&Oe(e),r&&r.structure===Z(e)?($e(e),null==(p=_.time)||p.render(e),Fe(e,!0)):qe(e,!1)),e.selectedYear=m.year,e.selectedMonth=m.month,e.selectedDates=m.dates,e.selectedTime=m.time,"multiple-ranged"===e.selectionDatesMode&&M(e,null,!!i),a&&Q(e,!0)},at=(e,t,n)=>{if(!e.context.isInit)throw Error(F);m(e),nt(e,Le(Le({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(e.inputMode&&!e.context.inputModeInit),n),e.onUpdate&&e.onUpdate(e)},lt=["extensions","context","init","update","destroy","show","hide","set","queryAndMemoize"],ot=(e,t,n=!0)=>{let i=Object.keys(t);for(let s=0;s<i.length;s++){let o=i[s];"__proto__"!==o&&"constructor"!==o&&"prototype"!==o&&(n&&lt.includes(String(o))||("object"!=typeof e[o]||null===e[o]||"object"!=typeof t[o]||null===t[o]||t[o]instanceof Date||Array.isArray(t[o])?void 0!==t[o]&&(e[o]=t[o]):ot(e[o],t[o],!1)))}},rt={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years",week:"Next week"},arrowPrev:{month:"Previous month",year:"Previous list of years",week:"Previous week"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",collapse:"Collapse to a single week",expand:"Expand to the whole month",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},it={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsRow:"vc-months__row",monthsCell:"vc-months__cell",monthsMonth:"vc-months__month",years:"vc-years",yearsRow:"vc-years__row",yearsCell:"vc-years__cell",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekDayBtn:"vc-week__day-btn",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",collapse:"vc-collapse",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"},st=class{constructor(){Ne(this,"type","default"),Ne(this,"inputMode",!1),Ne(this,"openOnFocus",!0),Ne(this,"positionToInput","left"),Ne(this,"animation",!1),Ne(this,"firstWeekday",1),Ne(this,"monthsToSwitch",1),Ne(this,"themeAttrDetect","html[data-theme]"),Ne(this,"locale","en"),Ne(this,"dateToday","today"),Ne(this,"dateMin","1970-01-01"),Ne(this,"dateMax","2470-12-31"),Ne(this,"displayDateMin",void 0),Ne(this,"displayDateMax",void 0),Ne(this,"displayDatesOutside",!0),Ne(this,"displayDisabledDates",!1),Ne(this,"displayMonthsCount",void 0),Ne(this,"disableDates",[]),Ne(this,"disableAllDates",!1),Ne(this,"disableDatesPast",!1),Ne(this,"disableDatesGaps",!1),Ne(this,"disableWeekdays",[]),Ne(this,"disableToday",!1),Ne(this,"enableDates",[]),Ne(this,"enableEdgeDatesOnly",!0),Ne(this,"enableDateToggle",!0),Ne(this,"enableWeekNumbers",!1),Ne(this,"enableMonthChangeOnDayClick",!0),Ne(this,"enableJumpToSelectedDate",!1),Ne(this,"enableCollapse",!1),Ne(this,"enableSwipe",!1),Ne(this,"selectionDatesMode","single"),Ne(this,"selectionMonthsMode",!0),Ne(this,"selectionYearsMode",!0),Ne(this,"selectionTimeMode",!1),Ne(this,"selectedDates",[]),Ne(this,"selectedMonth",void 0),Ne(this,"selectedYear",void 0),Ne(this,"selectedHolidays",[]),Ne(this,"selectedWeekends",[0,6]),Ne(this,"selectedTime",void 0),Ne(this,"selectedTheme","system"),Ne(this,"timeMinHour",0),Ne(this,"timeMaxHour",23),Ne(this,"timeMinMinute",0),Ne(this,"timeMaxMinute",59),Ne(this,"timeControls","all"),Ne(this,"timeStepHour",1),Ne(this,"timeStepMinute",1),Ne(this,"sanitizerHTML",z),Ne(this,"onClickDate",void 0),Ne(this,"onClickWeekDay",void 0),Ne(this,"onClickWeekNumber",void 0),Ne(this,"onClickTitle",void 0),Ne(this,"onClickMonth",void 0),Ne(this,"onClickYear",void 0),Ne(this,"onClickArrow",void 0),Ne(this,"onChangeTime",void 0),Ne(this,"onChangeToInput",void 0),Ne(this,"onCreateDateRangeTooltip",void 0),Ne(this,"onCreateDateEls",void 0),Ne(this,"onCreateMonthEls",void 0),Ne(this,"onCreateYearEls",void 0),Ne(this,"onInit",void 0),Ne(this,"onUpdate",void 0),Ne(this,"onDestroy",void 0),Ne(this,"onShow",void 0),Ne(this,"onHide",void 0),Ne(this,"popups",{}),Ne(this,"labels",Le(Le({},rt),{},{arrowNext:Le({},rt.arrowNext),arrowPrev:Le({},rt.arrowPrev)})),Ne(this,"layouts",{default:"",multiple:"",month:"",year:"",week:""}),Ne(this,"styles",Le({},it))}},pt=(e,t)=>{var n;if("multiple"!==e.type)return{currentValue:null,columnID:0};let i=e.context.mainElement.querySelectorAll('[data-vc="column"]'),s=Array.from(i).findIndex(e=>e.closest(`[data-vc-column="${t}"]`));return{currentValue:s>=0?Number(null==(n=i[s].querySelector(`[data-vc="${t}"]`))?void 0:n.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(s,0)}},ht=(e,t,n)=>{let{currentValue:i,columnID:s}=pt(e,t);return"month"===e.context.currentType&&s>=0?n-s:"year"===e.context.currentType&&e.context.selectedYear!==i?n-1:n},vt=Object.freeze({name:"months",layout:e=>`\n <div class="${_(e.styles.controls)}" data-vc="controls" role="group" aria-label="${_(e.labels.navigation)}">\n <#ArrowPrev [month] />\n <#ArrowNext [month] />\n </div>\n <div class="${_(e.styles.grid)}" data-vc="grid">\n <#Multiple>\n <div class="${_(e.styles.column)}" data-vc="column" role="group">\n <div class="${_(e.styles.header)}" data-vc="header">\n <div class="${_(e.styles.headerContent)}" data-vc-header="content" aria-live="polite" aria-atomic="true">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${_(e.styles.wrapper)}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${_(e.styles.content)}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n <#DateRangeTooltip />\n </div>\n <#ControlTime />\n`,render:(e,t)=>{var n;if("multiple"===e.context.currentType)return null==(n=u(e).time)||n.destroy(e),e.context.mainElement.innerHTML=e.sanitizerHTML(((e,t)=>t.replace(RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(t,n)=>{let i=Array(e.context.displayMonthsCount).fill(n).join("");return e.sanitizerHTML(i)}).replace(/[\n\t]/g,""))(e,fe(e,e.layouts.multiple))),!0;if("multiple"!==e.type||!t)return!1;let i=e.context.mainElement.querySelector('[data-vc="controls"]'),s=e.context.mainElement.querySelector('[data-vc="grid"]'),o=t.closest('[data-vc="column"]');return i&&i.remove(),s&&(s.dataset.vcGrid="hidden"),o&&(o.dataset.vcColumn=e.context.currentType),o&&(o.innerHTML=e.sanitizerHTML(fe(e,e.layouts[e.context.currentType]))),!0},column:pt,select:(t,n,i)=>"month"===n?((t,n)=>{let i=n.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),s=ht(t,"month",Number(n.dataset.vcMonthsMonth)),o=Number(i.dataset.vcYear),a=e(t.context.dateMin),r=e(t.context.dateMax),l=s<a.getMonth()&&o<=a.getFullYear(),c=s>r.getMonth()&&o>=r.getFullYear();g(t,"selectedYear",o),g(t,"selectedMonth",l?a.getMonth():c?r.getMonth():s)})(t,i):((t,n)=>{let i=ht(t,"year",Number(n.dataset.vcYearsYear)),s=e(t.context.dateMin),o=e(t.context.dateMax),a=t.context.displayMonthsCount-1,{columnID:r}=pt(t,"year"),l=t.context.selectedMonth<s.getMonth()&&i<=s.getFullYear(),c=t.context.selectedMonth>o.getMonth()-a+r&&i>=o.getFullYear(),h=i<s.getFullYear(),u=i>o.getFullYear(),d=l||h?s.getFullYear():c||u?o.getFullYear():i,_=l||h?s.getMonth():c||u?o.getMonth()-a+r:t.context.selectedMonth;g(t,"selectedYear",d),g(t,"selectedMonth",_)})(t,i),rotate:(e,t)=>{var n;let i=12*e.context.selectedYear+e.context.selectedMonth-t.month;if(!i||Math.abs(i)>=t.count)return;let s=Array.from(e.context.mainElement.querySelectorAll('[data-vc="column"]')),o=null==(n=s[0])?void 0:n.parentElement;if(!o||s.length!==t.count||s.some(e=>e.parentElement!==o)||Array.from(o.childNodes).some(e=>{var t;return 1===e.nodeType?!s.includes(e):3!==e.nodeType||!(null==(t=e.textContent)||!t.trim())}))return;let a=[];if(i>0){let e=s[s.length-1].nextSibling;for(let n=0;n<i;n++){let r=s[n].nextSibling;3===(null==r?void 0:r.nodeType)&&r!==e&&o.insertBefore(r,e),o.insertBefore(s[n],e),a.push(t.count-i+n)}}else for(let e=t.count+i;e<t.count;e++){let n=s[e].previousSibling;o.insertBefore(s[e],s[0]),3===(null==n?void 0:n.nodeType)&&o.insertBefore(n,s[0]),a.push(e-t.count-i)}return a}}),on=class e extends st{constructor(t,n){var o;super(),Ne(this,"extensions",void 0),Ne(this,"init",()=>(e=>{var t;if(e.context.isInit)throw Error("The calendar has already been initialized, calling init() again is not allowed. Create a new Calendar instance instead.");if(m(e),g(e,"originalElement",e.context.mainElement.cloneNode(!0)),g(e,"isInit",!0),e.inputMode){let t=(e=>{g(e,"inputElement",e.context.mainElement);let t=e.context.inputElement;["input","button","textarea"].includes(t.localName)&&(t.setAttribute("aria-haspopup","dialog"),("button"===t.localName||"combobox"===t.getAttribute("role"))&&t.setAttribute("aria-expanded","false"));let n=()=>{e.context.inputModeInit?O(e):(e=>{var t;let n=document.createElement("div");n.className=e.styles.calendar,n.dataset.vc="calendar",n.dataset.vcInput="",n.dataset.vcCalendarHidden="",Object.assign(n.style,{left:"0",top:"0"}),S(n);let i=w(e.context.mainElement),s=i===document?document.body:i;g(e,"inputModeInit",!0),g(e,"isShowInInputMode",!1),g(e,"mainElement",n),s.appendChild(e.context.mainElement),nt(e,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),O(e),e.onInit&&e.onInit(e),e.context.isDestroyed||(Pe(e),null==(t=u(e).motion)||t.bind(e),Ze(e))})(e)};e.context.inputElement.addEventListener("click",n);let i="function"==typeof e.openOnFocus||!0===e.openOnFocus,s=()=>{(e=>E.has(e))(e)?(e=>{E.delete(e)})(e):(e=>f(e,e.openOnFocus))(e)&&n()};i&&e.context.inputElement.addEventListener("focus",s);let o=t=>{let n="Tab"===t.key&&!t.shiftKey,i=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key);(n||i)&&(t=>{var n;if(!e.context.isShowInInputMode||w(e.context.mainElement).activeElement!==e.context.inputElement)return!1;let i=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),s=null==(n=document.createTreeWalker(e.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>i(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())?i(e.context.mainElement)?e.context.mainElement:null:n;!s||s.tabIndex<0||(t.preventDefault(),s.focus())})(t)};return e.context.inputElement.addEventListener("keydown",o),()=>{t.removeEventListener("click",n),i&&t.removeEventListener("focus",s),t.removeEventListener("keydown",o)}})(e);return g(e,"cleanupInput",t),t}if(tt(e),qe(e),"multiple-ranged"===e.selectionDatesMode&&1===e.context.selectedDates.length&&(M(e,null),Fe(e)),e.onInit&&e.onInit(e),!e.context.isDestroyed)return Pe(e),null==(t=u(e).motion)||t.bind(e),Ze(e)})(this)),Ne(this,"update",e=>at(this,e)),Ne(this,"destroy",()=>{let t=this.inputMode?this.context.inputElement:this.context.mainElement;if((e=>{var t,n,i,s,o,a,r,c;if(!e.context.isInit)throw Error(F);if(e.context.isDestroyed)throw Error("The calendar has already been destroyed, calling destroy() again is not allowed.");B(e);let h=u(e);var d,_,m,p,E;null==(t=h.motion)||t.destroy(e),null==(n=h.time)||n.destroy(e),null==(i=h.annotations)||i.destroy(e),D(e),(e=>{l.delete(e)})(e),H(e),null==(s=(o=e.context).cleanupInput)||s.call(o),g(e,"cleanupInput",void 0),null==(a=e.context.cleanupHandlers)||a.forEach(e=>e()),g(e,"cleanupHandlers",[]),g(e,"isShowInInputMode",!1),null==(r=(c=e.context).cleanupSystemTheme)||r.call(c),e.inputMode?(e.context.mainElement!==e.context.inputElement&&(null==(m=e.context.mainElement.parentElement)||m.removeChild(e.context.mainElement)),null==(d=e.context.inputElement)||null==(_=d.replaceWith)||_.call(d,e.context.originalElement),g(e,"inputElement",void 0)):null==(p=(E=e.context.mainElement).replaceWith)||p.call(E,e.context.originalElement),g(e,"mainElement",e.context.originalElement),g(e,"isDestroyed",!0),e.onDestroy&&e.onDestroy(e)})(this),t)for(let[n,i]of e.memoizedElements)i===t&&e.memoizedElements.delete(n)}),Ne(this,"show",()=>q(this)),Ne(this,"hide",()=>$(this)),Ne(this,"set",(e,t)=>((e,t,n)=>{m(e,t);let i=Object.keys(t);t.extensions&&i.splice(i.indexOf("extensions"),1);let s=1===i.length&&"selectedDates"===i[0]?J(e):void 0;ot(e,t),e.context.isInit&&at(e,n,s)})(this,e,t)),Ne(this,"context",void 0),this.context=Le(Le({},this.context),{},{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),g(this,"mainElement","string"==typeof t?null==(o=e.memoizedElements.get(t))?this.queryAndMemoize(t):o:t);let a=null==n?void 0:n.extensions;this.extensions=null!=a&&a.length?Object.freeze(Array.from(new Set(a))):d,(e=>{if(!e.extensions.length)return;let t={};for(let n of e.extensions){let e=n,s=e.name;if(!i.includes(s))throw Error("Unknown calendar extension.");if(t[s]&&t[s]!==e)throw Error(`Conflicting calendar extension: ${s}.`);Object.assign(t,{[s]:e})}s.set(e,t)})(this),n&&ot(this,n)}queryAndMemoize(t){let n=document.querySelector(t);if(!n)throw Error((e=>`${e} is not found, check the first argument passed to new Calendar. If the element lives inside a Shadow DOM, a string selector can't reach it - resolve the element yourself (e.g. shadowRoot.querySelector(...)) and pass it directly instead.`)(t));return e.memoizedElements.set(t,n),n}};Ne(on,"memoizedElements",new Map);const NAME$14="datepicker",EVENT_KEY$11=".bs.datepicker",DATA_API_KEY$6=".data-api",EVENT_CHANGE$1=`change${EVENT_KEY$11}`,EVENT_SHOW$3=`show${EVENT_KEY$11}`,EVENT_SHOWN$3=`shown${EVENT_KEY$11}`,EVENT_HIDE$3=`hide${EVENT_KEY$11}`,EVENT_HIDDEN$3=`hidden${EVENT_KEY$11}`,EVENT_FOCUSIN$3=`focusin${EVENT_KEY$11}`,EVENT_POINTERDOWN$2=`pointerdown${EVENT_KEY$11}`,EVENT_CLICK$4=`click${EVENT_KEY$11}`,EVENT_CLICK_DATA_API$3=`click${EVENT_KEY$11}.data-api`,EVENT_FOCUSIN_DATA_API=`focusin${EVENT_KEY$11}.data-api`,SELECTOR_DATA_TOGGLE$6='[data-bs-toggle="datepicker"]',EVENT_KEYDOWN$2=`keydown${EVENT_KEY$11}`,FOCUSABLE='a[href], button, input, select, textarea, [tabindex], [contenteditable="true"]',Default$13={datepickerTheme:null,dateMin:null,dateMax:null,dateFormat:null,displayElement:null,displayMonthsCount:1,firstWeekday:1,invalidDateMessage:"Enter a valid date available in the calendar.",inline:!1,showOnFocus:!0,toggleElement:null,locale:"default",positionElement:null,selectedDates:[],selectionMode:"single",rangeEndMessage:"Choose an end date.",placement:"left",vcpOptions:{}},DefaultType$13={datepickerTheme:"(null|string)",dateMin:"(null|string|number|object)",dateMax:"(null|string|number|object)",dateFormat:"(null|object|function)",displayElement:"(null|string|element|boolean)",displayMonthsCount:"number",firstWeekday:"number",inline:"boolean",invalidDateMessage:"string",showOnFocus:"boolean",toggleElement:"(null|string|element)",locale:"string",positionElement:"(null|string|element)",selectedDates:"array",selectionMode:"string",placement:"string",rangeEndMessage:"string",vcpOptions:"object"},formBindings=new WeakMap,bindFormData=(e,t,n)=>{let i=formBindings.get(e);if(!i){const t={controls:new Map,handler(){}};t.handler=e=>{const n=[];for(const[i,s]of e.formData){const e=t.controls.get(i);if(!e){n.push([i,s]);continue}const o=e();o&&n.push(o)}for(const t of new Set(e.formData.keys()))e.formData.delete(t);for(const[t,i]of n)e.formData.append(t,i)},i=t,formBindings.set(e,i),e.addEventListener("formdata",i.handler,!0)}return i.controls.set(t,n),()=>{i.controls.delete(t),0===i.controls.size&&(e.removeEventListener("formdata",i.handler,!0),formBindings.delete(e))}};var Datepicker=class extends BaseComponent{constructor(e,t){super(e,t),this._calendar=null,this._toggleElement=null,this._returnFocusElement=this._element,this._originalToggleAria=new Map,this._popup=null,this._isShown=!1,this._floatingCleanup=null,this._resetTimeouts=new Set,this._suppressFocus=!1,this._positionGeneration=0,this._showGeneration=0,this._inputName=null,this._inputObserver=null,this._form=null,this._formCleanup=null,this._dialog=null,this._initialDates=[],this._rangeDates=[],this._pendingRange=!1,this._rangeStatus=null,this._inputError=null,this._inputErrorMessage="",this._originalInvalid=null,this._eventPending=!1,this._originalAria=new Map(["aria-haspopup","aria-expanded","aria-controls"].map(e=>[e,this._element.getAttribute(e)]));try{this._initCalendar()}catch(e){throw this.dispose(),e}}static get Default(){return Default$13}static get DefaultType(){return DefaultType$13}static get NAME(){return NAME$14}toggle(e){return this._isInline?Promise.resolve():this._isShown?this.hide():this.show(e)}async show(e){if(this._skipFocusTrigger(e))return;if(!this._calendar||this._isInline||this._isShown||this._eventPending||this._suppressFocus||isDisabled(this._element)||this._element.matches(":disabled"))return;if(this._triggerLifecycleEvent(EVENT_SHOW$3).defaultPrevented||!this._calendar||this._isShown)return;this._popup.style.removeProperty("max-inline-size"),this._popup.style.removeProperty("max-block-size"),this._returnFocusElement=e||this._element;const t=++this._showGeneration;this._isShown=!0;const n=this._popup;this._mountPopup(),this._syncDisplayMonths(),this._syncPopupState(this._calendar),n.removeAttribute("data-vc-calendar-closing"),"function"!=typeof n.showPopover||n.matches(":popover-open")||n.showPopover(),this._element.setAttribute("aria-expanded","true"),await this._updatePosition(),this._isCurrentOpening(t)&&(this._floatingCleanup?.(),this._floatingCleanup=autoUpdate(this._positionElement,n,()=>{this._syncDisplayMonths(),this._updatePosition()}),(!this._isInput||e&&e!==this._element)&&this._focusCalendarDate(),await this._queueCallback(()=>{this._isCurrentOpening(t)&&EventHandler.trigger(this._element,EVENT_SHOWN$3)},n,getTransitionDurationFromElement(n)>0))}async hide(){if(!this._calendar||this._isInline||!this._isShown||this._eventPending)return;if(this._triggerLifecycleEvent(EVENT_HIDE$3).defaultPrevented||!this._calendar)return;const e=this._popup,t=getTransitionDurationFromElement(e)>0;this._closePopup(t);const n=this._showGeneration;await this._queueCallback(()=>{this._calendar&&!this._isShown&&n===this._showGeneration&&(this._finishPopupClose(),EventHandler.trigger(this._element,EVENT_HIDDEN$3))},e,t)}_triggerLifecycleEvent(e){this._eventPending=!0;try{return EventHandler.trigger(this._element,e)}finally{this._eventPending=!1}}_closePopup(e=!1){this._showGeneration++,this._isShown=!1,this._positionGeneration++,e?this._popup?.setAttribute("data-vc-calendar-closing",""):this._finishPopupClose(),this._calendar&&(this._cancelPendingRange(),this._syncPopupState(this._calendar)),this._element?.setAttribute("aria-expanded","false")}_finishPopupClose(){this._floatingCleanup?.(),this._floatingCleanup=null,this._popup?.matches(":popover-open")&&this._popup.hidePopover(),this._popup?.removeAttribute("data-vc-calendar-closing")}dispose(){this._syncBoundInput(),this._setInputError(""),this._onInvalid&&this._element.removeEventListener("invalid",this._onInvalid),this._resetTimeouts.forEach(e=>clearTimeout(e)),this._closePopup(),this._themeObserver?.disconnect(),this._inputObserver?.disconnect(),this._formCleanup?.(),this._form&&this._onReset&&EventHandler.off(this._form,`reset${EVENT_KEY$11}`,this._onReset),this._onOutside&&(EventHandler.off(document,EVENT_FOCUSIN$3,this._onOutside),EventHandler.off(document,EVENT_POINTERDOWN$2,this._onOutside)),this._onKeydown&&(EventHandler.off(this._element,EVENT_KEYDOWN$2,this._onKeydown),this._popup?.removeEventListener("keydown",this._onKeydown,!0)),this._toggleElement&&(EventHandler.off(this._toggleElement,EVENT_CLICK$4,this._onToggleClick),EventHandler.off(this._toggleElement,EVENT_KEYDOWN$2,this._onKeydown),this._restoreAria(this._toggleElement,this._originalToggleAria)),this._onTriggerClick&&EventHandler.off(this._positionElement,EVENT_CLICK$4,this._onTriggerClick),this._dialog&&EventHandler.off(this._dialog,"close",this._onDialogClose),this._calendar?.context.isInit?(this._calendar.destroy(),this._calendar.context.mainElement.remove()):this._popup?.remove(),null!==this._inputName&&(this._element.setAttribute("name",this._inputName),this._boundInput?.remove()),this._restoreAria(this._element,this._originalAria),this._calendar=null,super.dispose()}getSelectedDates(){const e="multiple-ranged"===this._config?.selectionMode?this._rangeDates:this._calendar?.context.selectedDates;return e?[...e]:[]}setSelectedDates(e){if(this._calendar){for(const t of e)if("string"==typeof t&&/^\d{4}-\d{2}-\d{2}$/.test(t)&&!this._parseIsoDate(t))throw new TypeError("Invalid ISO date");this._pendingRange=!1,this._calendar.set({selectedDates:e}),this._rangeDates=[...this._calendar.context.selectedDates],this._syncSelectedDates(this.getSelectedDates())}}_getConfig(e){return super._getConfig({vcpOptions:Default$13.vcpOptions,...e})}_isCurrentOpening(e){return Boolean(this._calendar)&&this._isShown&&e===this._showGeneration}_skipFocusTrigger(e){return this._isInput&&e===this._element&&!this._config.showOnFocus}_containsTrigger(e){return this._positionElement.contains(e)||this._element.contains(e)||Boolean(this._toggleElement?.contains(e))}_restoreAria(e,t){for(const[n,i]of t)null===i?e.removeAttribute(n):e.setAttribute(n,i)}_initCalendar(){if(this._isInput="INPUT"===this._element.tagName,this._isInline=this._config.inline,this._isInline&&!this._isInput&&(this._boundInput=this._element.querySelector('input[type="hidden"], input[name]')),this._isInput&&!this._isInline&&this._config.toggleElement){const e=this._element.getRootNode();if(this._toggleElement="string"==typeof this._config.toggleElement?e.querySelector(this._config.toggleElement):this._config.toggleElement,this._toggleElement===this._element)throw new TypeError("The Datepicker toggle must be separate from its input");this._toggleElement&&(this._originalToggleAria=new Map(["aria-haspopup","aria-expanded","aria-controls"].map(e=>[e,this._toggleElement.getAttribute(e)])))}this._positionElement=this._resolvePositionElement(),this._displayElement=this._resolveDisplayElement();const e=this._displayElement;this._displayPlaceholder=e&&this._element.contains(e)&&e.hasAttribute("data-bs-datepicker-display")?e.textContent:"",this._popup=document.createElement("div"),this._isInline?this._element.append(this._popup):(this._popup.id=getUID("bs-datepicker-calendar-"),this._popup.setAttribute("popover","manual"),this._element.setAttribute("aria-haspopup","dialog"),this._element.setAttribute("aria-expanded","false"),this._element.setAttribute("aria-controls",this._popup.id),this._toggleElement&&(this._toggleElement.setAttribute("aria-haspopup","dialog"),this._toggleElement.setAttribute("aria-controls",this._popup.id)),this._mountPopup()),this._calendar=new on(this._popup,this._buildCalendarOptions()),this._calendar.init(),this._rangeDates=[...this._calendar.context.selectedDates],!this._isInput||!this._element.value||this._element.readOnly&&this._rangeDates.length||this._parseInputValue(),this._initialDates=this.getSelectedDates(),this._isInput&&!this._isInline&&(this._createBoundInput(),this._bindInputForm(),EventHandler.on(this._element,`input${EVENT_KEY$11}`,()=>this._parseInputValue()),this._onInvalid=()=>this._showInputError(),EventHandler.on(this._element,`blur${EVENT_KEY$11}`,this._onInvalid),this._element.addEventListener("invalid",this._onInvalid)),this._updateDisplayWithSelectedDates(),this._isInline&&this._boundInput&&this._bindInputForm(),this._setupThemeObserver(),this._setupDismiss()}_createBoundInput(){const e=this._element.getAttribute("name");e&&(this._inputName=e,this._boundInput=document.createElement("input"),this._boundInput.type="hidden",this._boundInput.id=getUID("bs-datepicker-"),this._boundInput.name=this._boundInput.id,this._element.before(this._boundInput),this._element.removeAttribute("name"),this._syncBoundInput(),this._inputObserver=new MutationObserver(()=>{this._syncBoundInput(),this._bindInputForm()}),this._inputObserver.observe(this._element,{attributes:!0,attributeFilter:["name","disabled","form"]}))}_syncBoundInput(){if(null===this._inputName||!this._boundInput)return;const e=this._element.getAttribute("name");null!==e&&(this._inputName=e,this._element.removeAttribute("name"));const t=this._element.getAttribute("form");null===t?this._boundInput.removeAttribute("form"):this._boundInput.setAttribute("form",t),this._boundInput.value=this.getSelectedDates().join(",")}_bindInputForm(){const e=this._isInput?this._element.form:this._boundInput?.form??null;e!==this._form&&(this._formCleanup?.(),this._resetTimeouts.forEach(e=>clearTimeout(e)),this._resetTimeouts.clear(),this._form&&EventHandler.off(this._form,`reset${EVENT_KEY$11}`,this._onReset),this._form=e,e&&(null!==this._inputName&&this._boundInput&&(this._formCleanup=bindFormData(e,this._boundInput.name,()=>(this._syncBoundInput(),this._element.matches(":disabled")||isDisabled(this._element)||!this._inputName?null:[this._inputName,this.getSelectedDates().join(",")]))),this._onReset=e=>{const t=setTimeout(()=>{this._resetTimeouts.delete(t),!e.defaultPrevented&&this._calendar&&e.target===this._form&&this.setSelectedDates(this._initialDates)},0);this._resetTimeouts.add(t)},EventHandler.on(e,`reset${EVENT_KEY$11}`,this._onReset)))}_mountPopup(){let e=this._element,t=null;for(;e&&!t;){t=e.closest("dialog[open]");const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:null}t!==this._dialog&&(this._dialog&&EventHandler.off(this._dialog,"close",this._onDialogClose),this._dialog=t,this._onDialogClose=()=>this._closePopup(),t&&EventHandler.on(t,"close",this._onDialogClose));const n=this._element.getRootNode(),i=n instanceof ShadowRoot?n:t||document.body;this._popup.parentNode!==i&&i.append(this._popup)}async _updatePosition(){const e=this._popup;if(!e||!this._isShown&&!e.hasAttribute("data-vc-calendar-closing"))return;const t=++this._positionGeneration,n="rtl"===e.dir?"-end":"-start",i="rtl"===e.dir?"-start":"-end",s="center"===this._config.placement?"":"right"===this._config.placement?i:n,o=await computePosition(this._positionElement,e,{placement:`bottom${s}`,strategy:"fixed",middleware:[offset(4),flip({padding:8}),shift({padding:8,crossAxis:!0}),size({padding:8,apply:({availableWidth:e,availableHeight:n,elements:i})=>{t===this._positionGeneration&&Object.assign(i.floating.style,{maxInlineSize:`${Math.max(0,e)}px`,maxBlockSize:`${Math.max(0,n)}px`})}})]});t===this._positionGeneration&&(this._isShown||e.hasAttribute("data-vc-calendar-closing"))&&(Object.assign(e.style,{position:o.strategy,left:`${o.x}px`,top:`${o.y}px`}),e.dataset.vcPosition=o.placement.startsWith("top")?"top":"bottom")}_getCalendarLabel(){const e=this._element.getRootNode();return this._element.getAttribute("aria-labelledby")?.trim().split(/\s+/).map(t=>{const n=e.getElementById?.(t);return n?.hasAttribute("data-bs-datepicker-display")?"":n?.textContent.trim()}).filter(Boolean).join(" ")||this._element.getAttribute("aria-label")||(this._isInput?[...this._element.labels||[]].map(e=>e.textContent.trim()).filter(Boolean).join(" "):"")}_getDisplayMonths(){const{displayMonthsCount:e}=this._config;return e>1&&!this._isInline&&window.matchMedia("(width < 576px)").matches?1:e}_syncDisplayMonths(){const e=this._calendar,t=this._getDisplayMonths();if(!e||e.displayMonthsCount===t)return;const n=this._popup.getRootNode(),i=this._popup.contains(n.activeElement);e.set({type:t>1?"multiple":"default",displayMonthsCount:t,selectedDates:[...e.context.selectedDates]},{month:!1,year:!1}),i&&this._focusCalendarDate()}_syncPopupState(e){this._normalizeRangeDates(e);const t=e.context.mainElement;if(!this._isInline){t.dataset.vcInput="",t.role="dialog";const e=this._getCalendarLabel();e&&t.setAttribute("aria-label",e),t.toggleAttribute("data-vc-calendar-hidden",!this._isShown),t.inert=!this._isShown,t.setAttribute("aria-hidden",String(!this._isShown)),this._toggleElement?.setAttribute("aria-expanded",String(this._isShown))}"multiple-ranged"===this._config.selectionMode&&(this._rangeStatus??=document.createElement("span"),t.contains(this._rangeStatus)||(this._rangeStatus.className="visually-hidden",this._rangeStatus.setAttribute("role","status"),t.append(this._rangeStatus)),this._updateRangeStatus()),this._syncThemeAttribute(t)}_updateRangeStatus(){const e=this._pendingRange?this._config.rangeEndMessage:"";this._rangeStatus&&this._rangeStatus.textContent!==e&&(this._rangeStatus.textContent=e)}_updateDisplayWithSelectedDates(){const e=this.getSelectedDates();e.length>0&&this._syncSelectedDates(e)}_syncSelectedDates(e){this._setInputError("");const t=this._formatDateForInput(e);this._isInput&&(this._element.value=t),this._boundInput&&(this._boundInput.value=e.join(","),this._syncBoundInput()),this._syncDisplay(e,t)}_syncDisplay(e,t=this._formatDateForInput(e)){if(this._displayElement){const n=this._displayElement.dataset.bsDatepickerEndPlaceholder,i="multiple-ranged"===this._config.selectionMode&&1===e.length;this._displayElement.textContent=i&&n?`${t} – ${n}`:e.length?t:this._displayPlaceholder}}_resolvePositionElement(){let{positionElement:e}=this._config;if("string"==typeof e&&(e=this._element.getRootNode().querySelector(e)),!e&&this._isInput&&!this._isInline){const t=this._element.closest(".form-adorn");t&&(e=t)}return e||this._element}_resolveDisplayElement(){const{displayElement:e}=this._config;return"string"==typeof e?this._element.getRootNode().querySelector(e):!0===e||null===e&&!this._isInput&&!this._isInline?this._element.querySelector("[data-bs-datepicker-display]")||this._element:e}_getThemeAncestor(){return this._element.closest("[data-bs-theme]")}_getEffectiveTheme(){return this._config.datepickerTheme||this._getThemeAncestor()?.getAttribute("data-bs-theme")||null}_syncThemeAttribute(e){if(!e)return;const t=this._getEffectiveTheme();t?e.setAttribute("data-bs-theme",t):e.removeAttribute("data-bs-theme");const n=getComputedStyle(this._element);e.dir=n.direction;const i=this._config.datepickerTheme;if(e.style.colorScheme="auto"===i?"light dark":"light"===i||"dark"===i?i:n.colorScheme,!this._isInline)for(const t of["","bs-"])for(const i of["base","bg","bg-subtle","bg-muted","fg","fg-emphasis","contrast","border","focus-ring"]){const s=`--${t}theme-${i}`,o=n.getPropertyValue(s);o?e.style.setProperty(s,o):e.style.removeProperty(s)}}_setupThemeObserver(){this._themeObserver=new MutationObserver(e=>{e.some(e=>{if(!(e.target instanceof Element))return!1;let t=this._element;for(;t;){if(e.target.contains(t))return!0;const n=t.getRootNode();t=n instanceof ShadowRoot?n.host:null}return!1})&&this._syncThemeAttribute(this._popup??void 0)});const e=this._element.getRootNode(),t={subtree:!0,attributes:!0,attributeFilter:["data-bs-theme","class","style","dir"]};this._themeObserver.observe(document.documentElement,t),e instanceof ShadowRoot&&this._themeObserver.observe(e,t)}_setupDismiss(){this._onKeydown=e=>this._handleKeydown(e),this._popup?.addEventListener("keydown",this._onKeydown,!0),this._isInline||(this._onTriggerClick=e=>{e.target instanceof Node&&this._toggleElement?.contains(e.target)||(this._isInput?this.show(this._element):this._element.dataset.bsToggle!==NAME$14&&this.toggle())},EventHandler.on(this._positionElement,EVENT_CLICK$4,this._onTriggerClick),this._isInput&&EventHandler.on(this._element,EVENT_FOCUSIN$3,()=>this.show(this._element)),this._onOutside=e=>{this._isShown&&(e.composedPath().some(e=>e instanceof Node&&(this._positionElement.contains(e)||this._element.contains(e)||this._toggleElement?.contains(e)||this._popup?.contains(e)))||this.hide())},EventHandler.on(document,EVENT_FOCUSIN$3,this._onOutside),EventHandler.on(document,EVENT_POINTERDOWN$2,this._onOutside),EventHandler.on(this._element,EVENT_KEYDOWN$2,this._onKeydown),this._toggleElement&&(this._onToggleClick=()=>{isDisabled(this._toggleElement)||this._toggleElement.matches(":disabled")||this.toggle(this._toggleElement)},EventHandler.on(this._toggleElement,EVENT_CLICK$4,this._onToggleClick),EventHandler.on(this._toggleElement,EVENT_KEYDOWN$2,this._onKeydown)))}_focusCalendarDate(){for(const e of["[data-vc-date-selected] [data-vc-date-btn]","[data-vc-date-today] [data-vc-date-btn]",'[data-vc-date-btn][tabindex="0"]',"button"]){const t=[...this._popup?.querySelectorAll(e)||[]].find(e=>!isDisabled(e)&&isVisible(e));if(t)return void t.focus()}}_focusTrigger(){this._element&&(this._suppressFocus=!0,(this._returnFocusElement?.isConnected?this._returnFocusElement:this._element).focus(),this._suppressFocus=!1)}_handleKeydown(e){const{target:t}=e;if(!this._isShown&&!this._isInline||!(t instanceof Node)||!this._containsTrigger(t)&&!this._popup?.contains(t))return;if(this._handleCalendarNavigation(e))return e.preventDefault(),void e.stopPropagation();if(this._isInline)return void this._handleInlineEscape(e);if("Escape"===e.key)return e.preventDefault(),e.stopPropagation(),this.hide(),void(this._isShown||this._focusTrigger());if("Tab"!==e.key)return;const n=[...this._popup.querySelectorAll(FOCUSABLE)].filter(e=>e.tabIndex>=0&&!isDisabled(e)&&isVisible(e));this._containsTrigger(t)?!e.shiftKey&&n[0]?(e.preventDefault(),n[0].focus()):this.hide():t===(e.shiftKey?n[0]:n.at(-1))&&(this.hide(),this._isShown?e.preventDefault():(this._focusTrigger(),e.shiftKey&&e.preventDefault()))}_handleInlineEscape(e){if("Escape"!==e.key||!this._pendingRange)return;e.preventDefault(),e.stopPropagation();const t=e.target.closest("[data-vc-date]")?.dataset.vcDate;this._cancelPendingRange();const n=t&&this._findCalendarDay(t);n?this._focusDay(n):this._focusCalendarDate()}_findCalendarDay(e){return this._popup?.querySelector(`[data-vc-date="${e}"][data-vc-date-month="current"] [data-vc-date-btn]:not(:disabled)`)??null}_focusDay(e){e.closest('[role="grid"]')?.querySelectorAll('[data-vc-date-btn][tabindex="0"]').forEach(e=>{e.tabIndex=-1}),e.tabIndex=0,e.focus()}_handleCalendarNavigation(e){const{target:t}=e;if(!this._calendar||!(t instanceof HTMLElement)||!t.matches("[data-vc-date-btn]")||e.altKey||e.ctrlKey||e.metaKey)return!1;const n=t.closest("[data-vc-date]"),i=this._parseIsoDate(n?.dataset.vcDate||"");if(!i)return!1;const{key:s}=e,o="PageUp"===s||"PageDown"===s,a="Home"===s||"End"===s;if(!o&&!a&&!s.startsWith("Arrow"))return!1;const r=i.getMonth();let l;if(o){l="PageUp"===s?-1:1;const t=i.getDate();i.setDate(1),i.setMonth(r+(e.shiftKey?12:1)*l);const n=new Date(i.getFullYear(),i.getMonth()+1,0).getDate();i.setDate(Math.min(t,n))}else if(a){const e=(i.getDay()-this._config.firstWeekday+7)%7;i.setDate(i.getDate()+("Home"===s?-e:6-e)),l="Home"===s?1:-1}else{const e="rtl"===this._popup?.dir,t={ArrowLeft:e?1:-1,ArrowRight:e?-1:1,ArrowUp:-7,ArrowDown:7}[s];if(!t)return!1;if(i.setDate(i.getDate()+t),i.getMonth()===r&&"current"===n?.dataset.vcDateMonth)return!1;l=Math.sign(t)}return this._focusNavigationDate(i,l,t),!0}_focusNavigationDate(e,t,n){const i=this._calendar,{displayDateMin:s,displayDateMax:o}=i.context;let a=this._toIsoDate(e);a<s?a=s:a>o&&(a=o);const r=(e=this._parseIsoDate(a)||e).getMonth();this._findCalendarDay(a)||r===i.context.selectedMonth&&e.getFullYear()===i.context.selectedYear||i.set({selectedMonth:r,selectedYear:e.getFullYear(),selectedDates:[...i.context.selectedDates]});let l=this._findCalendarDay(a);for(;!l&&e.getMonth()===r;)e.setDate(e.getDate()+t),e.getMonth()===r&&(l=this._findCalendarDay(this._toIsoDate(e)));l?this._focusDay(l):n.isConnected||this._focusCalendarDate()}_buildCalendarOptions(){const e=this._getEffectiveTheme(),t=e&&"auto"!==e?e:"system",n=this._getDisplayMonths(),i={...this._config.vcpOptions,extensions:[vt],inputMode:!1,positionToInput:this._config.placement,firstWeekday:this._config.firstWeekday,locale:this._config.vcpOptions.locale??this._config.locale,selectionDatesMode:this._config.selectionMode,selectedDates:this._config.selectedDates,displayMonthsCount:n,type:n>1?"multiple":"default",selectedTheme:t,themeAttrDetect:"[data-bs-theme]",onClickDate:(e,t)=>this._handleDateClick(e,t),onInit:e=>this._syncPopupState(e),onUpdate:e=>this._syncPopupState(e)};if(this._config.selectedDates.length>0){const e=this._parseIsoDate(this._config.selectedDates[0]);if(!e)throw new TypeError("Invalid ISO date");i.selectedMonth=e.getMonth(),i.selectedYear=e.getFullYear()}return this._config.dateMin&&(i.dateMin=this._config.dateMin),this._config.dateMax&&(i.dateMax=this._config.dateMax),i}_normalizeRangeDates(e){"multiple-ranged"===this._config.selectionMode&&e.context.selectedDates.length&&!e.context.selectedDates[0]&&(e.context.selectedDates.length=0)}_cancelPendingRange(){this._pendingRange&&this._calendar&&(this._pendingRange=!1,this._calendar.set({selectedDates:this._rangeDates},{month:!1,year:!1}),this._syncDisplay(this._rangeDates))}_handleDateClick(e,t){this._normalizeRangeDates(e);const n=[...e.context.selectedDates];if("multiple-ranged"===this._config.selectionMode){if(1===n.length)return this._pendingRange=!0,this._updateRangeStatus(),void this._syncDisplay(n);if(this._pendingRange&&0===n.length)return void this._cancelPendingRange();this._pendingRange=!1,this._rangeDates=n,this._updateRangeStatus()}this._syncSelectedDates(n),EventHandler.trigger(this._element,EVENT_CHANGE$1,{dates:n,event:t}),this._calendar&&this._element&&this._maybeHideAfterSelection(n)}_maybeHideAfterSelection(e){if(!this._isInline&&("single"===this._config.selectionMode&&e.length>0||"multiple-ranged"===this._config.selectionMode&&e.length>=2)){const e=this._popup.getRootNode(),t=this._popup?.contains(e.activeElement);this.hide();const n=e.activeElement;!this._isShown&&this._calendar&&t&&(n===document.body||this._popup?.contains(n))&&this._focusTrigger()}}_parseIsoDate(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;const n=Number(t[1]),i=Number(t[2])-1,s=Number(t[3]),o=new Date(0);return o.setHours(0,0,0,0),o.setFullYear(n,i,s),o.getFullYear()===n&&o.getMonth()===i&&o.getDate()===s?o:null}_parseDate(e){return this._parseIsoDate(e)??new Date(NaN)}_toIsoDate(e){return`${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}_formatDate(e){const t=this._parseDate(e),n="default"===this._config.locale?void 0:this._config.locale,{dateFormat:i}=this._config;return"function"==typeof i?i(t,n):i&&"object"==typeof i?new Intl.DateTimeFormat(n,i).format(t):t.toLocaleDateString(n)}_formatDateForInput(e){if(0===e.length)return"";if(1===e.length)return this._formatDate(e[0]);const t="multiple-ranged"===this._config.selectionMode?" – ":", ";return e.map(e=>this._formatDate(e)).join(t)}_setInputError(e){if(!this._isInput)return;const t=this._element;if(t.validity.customError&&t.validationMessage!==this._inputErrorMessage||t.setCustomValidity(e),this._inputErrorMessage=e,!e&&this._inputError){const e=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==this._inputError.id);e.length?t.setAttribute("aria-describedby",e.join(" ")):t.removeAttribute("aria-describedby"),null===this._originalInvalid?t.removeAttribute("aria-invalid"):t.setAttribute("aria-invalid",this._originalInvalid),this._inputError.remove(),this._inputError=null}}_showInputError(){if(!this._inputErrorMessage||this._inputError)return;const e=document.createElement("div");e.id=getUID("bs-datepicker-error-"),e.className="form-text fg-danger",e.setAttribute("role","status"),this._positionElement.after(e),e.textContent=this._inputErrorMessage,this._inputError=e,this._originalInvalid=this._element.getAttribute("aria-invalid"),this._element.setAttribute("aria-invalid","true");const t=this._element.getAttribute("aria-describedby");this._element.setAttribute("aria-describedby",t?`${t} ${e.id}`:e.id)}_parseInputValue(){this._pendingRange=!1;const e=this._element.value.trim();let t=this._parseIsoDate(e);if(!t&&!/^\d{4}-/.test(e)&&"function"!=typeof this._config.dateFormat){const n=e.match(/\d+/g),i="default"===this._config.locale?void 0:this._config.locale,s=new Intl.DateTimeFormat(i,this._config.dateFormat??void 0).formatToParts(new Date(2e3,0,1)).filter(e=>["year","month","day"].includes(e.type));if(3===n?.length&&3===s.length){const i=Object.fromEntries(s.map((e,t)=>[e.type,n[t]]));if(4===i.year.length){const n=`${i.year}-${i.month.padStart(2,"0")}-${i.day.padStart(2,"0")}`,s=this._parseIsoDate(n);s&&this._formatDate(n)===e&&(t=s)}}}const n=t&&"multiple-ranged"!==this._config.selectionMode?[this._toIsoDate(t)]:[];if(this._calendar?.set({selectedDates:n,...t?{selectedMonth:t.getMonth(),selectedYear:t.getFullYear()}:{}}),n.length&&this._calendar){const e=this._popup?.querySelector(`[data-vc-date="${n[0]}"] [data-vc-date-btn]`);e&&!isDisabled(e)||this._calendar.set({selectedDates:[]})}this._rangeDates=[...this._calendar?.context.selectedDates||[]],this._setInputError(this._element.value&&0===this.getSelectedDates().length?this._config.invalidDateMessage:""),this._syncBoundInput()}};EventHandler.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$6,function(e){"INPUT"!==this.tagName&&"true"!==this.dataset.bsInline&&(e.preventDefault(),Datepicker.getOrCreateInstance(this).toggle(this))}),EventHandler.on(document,EVENT_FOCUSIN_DATA_API,SELECTOR_DATA_TOGGLE$6,function(){"INPUT"===this.tagName&&Datepicker.getOrCreateInstance(this).show(this)}),onDocumentReady(`DOMContentLoaded${EVENT_KEY$11}.data-api`,()=>{const e=[`${SELECTOR_DATA_TOGGLE$6}[data-bs-inline="true"]`,`${SELECTOR_DATA_TOGGLE$6}[data-bs-selected-dates]`,`input${SELECTOR_DATA_TOGGLE$6}[value]:not([value=""])`,`input${SELECTOR_DATA_TOGGLE$6}[data-bs-toggle-element]`].join(", ");for(const t of document.querySelectorAll(e))Datepicker.getOrCreateInstance(t)});const CLASS_NAME_OPEN="dialog-open",SELECTOR_FIXED_CONTENT=".fixed-top, .fixed-bottom, .is-fixed",owners=new Map;let restore=null,observer=null;const getStyleChange=(e,t,n)=>{const i=Number.parseFloat(getComputedStyle(e).getPropertyValue(t))||0;return{element:e,property:t,value:e.style.getPropertyValue(t),priority:e.style.getPropertyPriority(t),adjustedValue:`${i+n}px`}},releaseUnusedLock=()=>{for(const[e,t]of owners)e.isConnected?e.open||owners.delete(e):(owners.delete(e),t&&queueMicrotask(t));0===owners.size&&restore&&(observer?.disconnect(),observer=null,restore(),restore=null)},lockScroll=(e,t)=>{if(releaseUnusedLock(),owners.has(e))return;if(owners.set(e,t),owners.size>1)return;const n=document.documentElement,i=n.classList.contains("dialog-open"),s=n.offsetWidth,o=n.clientWidth,a=n.getBoundingClientRect().left+n.clientLeft+window.scrollX,r=[],l=SelectorEngine.find(SELECTOR_FIXED_CONTENT).filter(e=>!e.closest("dialog")&&"fixed"===getComputedStyle(e).position&&e.clientWidth>=o).map(e=>({element:e,width:e.offsetWidth}));n.classList.add("dialog-open");const c=Math.max(0,n.offsetWidth-s),h=a>n.getBoundingClientRect().left+n.clientLeft+window.scrollX?"left":"right",u=l.map(e=>({element:e.element,width:Math.max(0,e.element.offsetWidth-e.width)}));c>0&&r.push(getStyleChange(n,`padding-${h}`,c));for(const e of u)e.width>0&&r.push(getStyleChange(e.element,`margin-${h}`,e.width));for(const{element:e,property:t,adjustedValue:n}of r)e.style.setProperty(t,n,"important");restore=()=>{for(const{element:e,property:t,value:n,priority:i}of r)n?e.style.setProperty(t,n,i):e.style.removeProperty(t);i||n.classList.remove("dialog-open")},observer=new MutationObserver(releaseUnusedLock),observer.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"]})},unlockScroll=e=>{owners.delete(e),releaseUnusedLock()};var DialogBase=class extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._opening=!1,this._active=Boolean(this._element?.open),this._openedAsModal=Boolean(this._element?.matches(":modal")),this._operation=0,this._returnFocus=null,this._closedBy=void 0,this._cancelTransition=null,this._addDialogListeners()}static get NAME(){return"dialogbase"}toggle(e){return this._element?.open?this.hide():this.show(e)}async show(e){this._canShow(e)&&await this._show(e)}async hide(){this._canHide()&&await this._hide()}_canShow(e){return this._active&&this._element?.isConnected&&!this._element.open&&(unlockScroll(this._element),this._finishHide()),!(!this._element?.isConnected||this._element.open||this._isTransitioning||EventHandler.trigger(this._element,this.constructor.eventName("show"),{relatedTarget:e}).defaultPrevented)}async _show(e,t=e){if(!this._element?.isConnected||this._element.open||this._isTransitioning)return;const n=++this._operation;this._isTransitioning=!0,this._opening=!0,this._active=!0;const i=this._element.ownerDocument.activeElement;this._returnFocus=void 0===t&&i instanceof HTMLElement?i:t??null,this._onBeforeShow();const{modal:s,preventBodyScroll:o}=this._getShowOptions();return this._showElement({modal:s,preventBodyScroll:o}),this._element&&this._operation===n?this._element.open?void await this._queueLifecycle(()=>{this._operation===n&&this._element.open&&this._element.isConnected&&(this._isTransitioning=!1,this._opening=!1,EventHandler.trigger(this._element,this.constructor.eventName("shown"),{relatedTarget:e}))},this._isAnimated()):(this._clearOpenState(),this._active=!1,this._returnFocus=null,this._isTransitioning=!1,void(this._opening=!1)):void 0}_canHide(){return!(!this._element?.open||this._isTransitioning&&!this._opening||EventHandler.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented)}async _hide(e=!0){if(!this._element?.open||this._isTransitioning&&!this._opening)return;const t=++this._operation;this._cancelTransition?.(),this._isTransitioning=!0,this._opening=!1,e||(this._returnFocus=null),this._hideElement(),await this._queueLifecycle(()=>{this._operation===t&&(this._closeAndCleanup(),this._element&&!this._element.open&&this._operation===t&&this._finishHide())},this._shouldDeferClose())}dispose(){this._element&&(this._cancelTransition?.(),this._element.open&&(this._hideChildComponents(),this._closeAndCleanup()),this._element&&(unlockScroll(this._element),this._clearOpenState(),EventHandler.off(this._element,"cancel",this._cancelHandler),EventHandler.off(this._element,"close",this._closeHandler),EventHandler.off(this._element,"toggle",this._toggleHandler),super.dispose()))}_getShowOptions(){return{modal:!0,preventBodyScroll:!0}}_onBeforeShow(){}_onAfterHide(){}_isAnimated(){return!this._element.classList.contains(this._getInstantClassName())}_getInstantClassName(){return"dialog-instant"}_getStaticClassName(){return"dialog-static"}_onCancel(){}_showElement({modal:e=!0,preventBodyScroll:t=!0}={}){if(this._openedAsModal=e,this._closedBy=this._element.getAttribute("closedby"),this._element.setAttribute("closedby",e&&this._config.keyboard?"closerequest":"none"),this._element.classList.toggle("dialog-no-backdrop",!this._config.backdrop),e?this._element.showModal():this._element.show(),t&&this._element?.open){const e=this._element;lockScroll(e,()=>{this._element===e&&this._active&&!e.isConnected&&(this._hideChildComponents(),this._closeAndCleanup(),this._finishHide())})}}_hideElement(){this._hideChildComponents(),this._element.classList.add("hiding")}_closeAndCleanup(){const e=this._element;e.close(),unlockScroll(e)}_clearOpenState(){this._openedAsModal=!1,this._element.classList.remove("hiding","dialog-no-backdrop",this._getStaticClassName()),null===this._closedBy?this._element.removeAttribute("closedby"):void 0!==this._closedBy&&this._element.setAttribute("closedby",this._closedBy),this._closedBy=void 0,this._onAfterHide()}_finishHide(){const e=this._element,t=this._returnFocus,{activeElement:n,body:i}=e.ownerDocument,s=n===i||e.contains(n);this._cancelTransition?.(),this._clearOpenState(),this._active=!1,this._returnFocus=null,this._isTransitioning=!1,this._opening=!1,this._operation++,t&&s&&isVisible(t)&&t.focus({preventScroll:!0}),EventHandler.trigger(e,this.constructor.eventName("hidden"))}_queueLifecycle(e,t){return t?new Promise(t=>{const n=executeAfterTransition(()=>{this._cancelTransition=null,e(),t()},this._element);this._cancelTransition=()=>{n?.(),this._cancelTransition=null,t()}}):(e(),Promise.resolve())}_shouldDeferClose(){return!1}_triggerBackdropTransition(){if(EventHandler.trigger(this._element,this.constructor.eventName("hidePrevented")).defaultPrevented)return;const e=this._getStaticClassName();this._element.classList.add(e),this._queueCallback(()=>{this._element.classList.remove(e)},this._element)}_hideChildComponents(){for(const e of SelectorEngine.find('[data-bs-toggle="tooltip"], [data-bs-toggle="popover"], [data-bs-toggle="datepicker"]',this._element)){const t=data_default.get(e,`bs.${e.getAttribute("data-bs-toggle")}`);t&&"function"==typeof t.hide&&t.hide()}for(const e of SelectorEngine.find(".toast.show",this._element)){const t=data_default.get(e,"bs.toast");t&&"function"==typeof t.hide&&t.hide()}}_addDialogListeners(){if(!this._element)return;const e=this.constructor.EVENT_KEY;this._closeHandler=()=>{this._element.open||(unlockScroll(this._element),this._active&&(this._hideChildComponents(),this._finishHide()))},EventHandler.on(this._element,"close",this._closeHandler),this._toggleHandler=()=>{this._element.open&&!this._active&&(this._active=!0,this._openedAsModal=this._element.matches(":modal"))},EventHandler.on(this._element,"toggle",this._toggleHandler),this._cancelHandler=e=>{e.target===this._element&&(e.preventDefault(),this._config.keyboard?(this._onCancel(),this.hide()):this._triggerBackdropTransition())},EventHandler.on(this._element,"cancel",this._cancelHandler),EventHandler.on(this._element,`keydown${e}`,e=>{"Escape"===e.key&&!e.defaultPrevented&&this._element.open&&e.target.closest("dialog")===this._element&&(this._openedAsModal&&this._config.keyboard||(e.preventDefault(),this._config.keyboard?(this._onCancel(),this.hide()):this._openedAsModal&&this._triggerBackdropTransition()))});const t=e=>{const{left:t,right:n,top:i,bottom:s}=this._element.getBoundingClientRect();return e.clientX<t||e.clientX>=n||e.clientY<i||e.clientY>=s};let n=!1;EventHandler.on(this._element,`pointerdown${e}`,e=>{n=0===e.button&&e.target===this._element&&t(e)}),EventHandler.on(this._element,`pointercancel${e}`,()=>{n=!1}),EventHandler.on(this._element,`click${e}`,e=>{const i=n;n=!1,i&&e.detail&&e.target===this._element&&this._openedAsModal&&t(e)&&!1!==this._config.backdrop&&("static"!==this._config.backdrop?this.hide():this._triggerBackdropTransition())})}};const NAME$13="dialog",EVENT_KEY$10=".bs.dialog",DATA_API_KEY$5=".data-api",EVENT_CANCEL="cancel.bs.dialog",EVENT_CLICK_DATA_API$2="click.bs.dialog.data-api",CLASS_NAME_NONMODAL="dialog-nonmodal",CLASS_NAME_INSTANT$1="dialog-instant",CLASS_NAME_SWAP_IN="dialog-swap-in",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="dialog"]',Default$12={backdrop:!0,keyboard:!0,modal:!0},DefaultType$12={backdrop:"(boolean|string)",keyboard:"boolean",modal:"boolean"};var Dialog=class e extends DialogBase{constructor(e,t){super(e,t)}static get Default(){return Default$12}static get DefaultType(){return DefaultType$12}static get NAME(){return NAME$13}static{EventHandler.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$5,function(t){e._handleDataApiClick(this,t)})}static _handleDataApiClick(t,n){const i=SelectorEngine.getElementFromSelector(t);if(!(i instanceof HTMLDialogElement)||isDisabled(t))return;["A","AREA"].includes(t.tagName)&&n.preventDefault();const s=Manipulator.getDataAttributes(t),o=t.closest("dialog.dialog[open]");if(o===i)return;if(!o||o===i)return void e.getOrCreateInstance(i,s).toggle(t);if(o.classList.contains("dialog-swap-in"))return;const a=e.getOrCreateInstance(i,s),r=e.getOrCreateInstance(o);if(!a._canShow(t)||!r._canHide())return;const l=r._returnFocus,c=o.classList.contains("dialog-instant");i.classList.add("dialog-swap-in"),a._show(t,l).finally(()=>{i.classList.remove("dialog-swap-in")}),i.open&&(o.classList.add("dialog-instant"),r._hide(!1).finally(()=>{c||o.classList.remove("dialog-instant")}))}handleUpdate(){}_getShowOptions(){return{modal:this._config.modal,preventBodyScroll:this._config.modal}}_onBeforeShow(){this._config.modal||this._element.classList.add("dialog-nonmodal")}_onAfterHide(){this._element.classList.remove("dialog-nonmodal")}_shouldDeferClose(){return this._isAnimated()}_onCancel(){EventHandler.trigger(this._element,EVENT_CANCEL)}};enableDismissTrigger(Dialog);const ARIA_ATTRIBUTE_PATTERN=/^aria-[\w-]*$/i,DefaultAllowlist={"*":["class","dir","id","lang","role",ARIA_ATTRIBUTE_PATTERN],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},DefaultIconAllowlist={"*":["class","role",ARIA_ATTRIBUTE_PATTERN],svg:["xmlns","width","height","viewbox","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","focusable"],path:["d","fill","stroke","stroke-width","fill-rule","clip-rule"],line:["x1","y1","x2","y2","stroke","stroke-width","stroke-linecap"],circle:["cx","cy","r","fill","stroke","stroke-width"],rect:["x","y","width","height","rx","ry","fill","stroke","stroke-width"],polyline:["points","fill","stroke","stroke-width"],polygon:["points","fill","stroke","stroke-width"],g:["fill","stroke","stroke-width","transform"],span:[],i:[]},uriAttributes=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),SAFE_URL_PATTERN=/^(?!(?:javascript|data|vbscript):)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,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,allowedAttribute=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!uriAttributes.has(n)||Boolean(SAFE_URL_PATTERN.test(e.nodeValue)||DATA_URL_PATTERN.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function sanitizeHtml(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),s=[...i.body.querySelectorAll("*")];for(const e of s){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const i=[...e.attributes],s=[...t["*"]||[],...t[n]||[]];for(const t of i)allowedAttribute(t,s)||e.removeAttribute(t.nodeName)}return i.body.innerHTML}const NAME$12="navoverflow",EVENT_KEY$9=".bs.navoverflow",EVENT_UPDATE=`update${EVENT_KEY$9}`,EVENT_OVERFLOW=`overflow${EVENT_KEY$9}`,EVENT_RESIZE$2=`resize${EVENT_KEY$9}`,CLASS_NAME_OVERFLOW="nav-overflow",CLASS_NAME_OVERFLOW_MENU="nav-overflow-menu",CLASS_NAME_HIDDEN="d-none",CLASS_NAME_KEEP="nav-overflow-keep",CLASS_NAME_INITIALIZED="nav-overflow-initialized",CLASS_NAME_SUBMENU="submenu",CLASS_NAME_SHOW$3="show",SELECTOR_NAV=".nav",SELECTOR_NAV_ITEM=".nav-item",SELECTOR_NAV_LINK=".nav-link",SELECTOR_OVERFLOW_TOGGLE=".nav-overflow-toggle",SELECTOR_OVERFLOW_MENU=".nav-overflow-menu",SELECTOR_CUSTOM_ICON="[data-bs-overflow-icon]",SELECTOR_MENU$1=".menu",SELECTOR_MENU_TOGGLE$2='[data-bs-toggle="menu"]',DEFAULT_TEXT="More",Default$11={collapseBelow:0,iconPlacement:"start",menuPlacement:"bottom-end",menuStrategy:"absolute",moreText:"More",moreIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/></svg>',threshold:0},DefaultType$11={collapseBelow:"(number|string)",iconPlacement:"string",menuPlacement:"string",menuStrategy:"string",moreText:"(string|boolean)",moreIcon:"string",threshold:"number"};var NavOverflow=class extends BaseComponent{constructor(e,t){super(e,t);const n=SelectorEngine.findOne(".nav",this._element);if(!n)throw new TypeError(`${this._element.outerHTML} has no child .nav to collapse`);this._nav=n,this._items=[],this._overflowItems=[],this._overflowMenu=null,this._overflowToggle=null,this._resizeObserver=null,this._resizeHandler=null,this._collapseBelow=0,this._itemMenus=new Map,this._relocatedMenus=new Map,this._init()}static get Default(){return Default$11}static get DefaultType(){return DefaultType$11}static get NAME(){return NAME$12}update(){this._calculateOverflow(),EventHandler.trigger(this._element,EVENT_UPDATE)}dispose(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&EventHandler.off(window,EVENT_RESIZE$2,this._resizeHandler),this._restoreItems(),this._overflowToggle&&this._overflowToggle.parentElement&&this._overflowToggle.parentElement.remove(),super.dispose()}_init(){this._element.classList.add("nav-overflow"),this._items=SelectorEngine.find(".nav-item",this._nav).filter(e=>!e.querySelector(".nav-overflow-toggle"));for(const[e,t]of this._items.entries()){t.dataset.bsNavOrder=e;const n=SelectorEngine.findOne(".nav-link",t);n?.matches(SELECTOR_MENU_TOGGLE$2)&&this._findItemMenu(t,n)}this._collapseBelow=this._resolveCollapseBelow(),this._createOverflowMenu(),this._setupResizeObserver(),this._calculateOverflow(),this._element.classList.add(CLASS_NAME_INITIALIZED)}_createOverflowMenu(){if(this._overflowToggle=SelectorEngine.findOne(".nav-overflow-toggle",this._element),this._overflowToggle)return void(this._overflowMenu=SelectorEngine.findOne(".nav-overflow-menu",this._element));const{moreText:e}=this._config,t="string"==typeof e?e:"",n=document.createElement("li");n.className="nav-item nav-overflow-item";const i=document.createElement("button");i.type="button",i.className="nav-link nav-overflow-toggle",i.setAttribute("data-bs-toggle","menu"),i.setAttribute("data-bs-placement",this._config.menuPlacement),i.setAttribute("data-bs-strategy",this._config.menuStrategy),i.setAttribute("aria-expanded","false"),""===t&&i.setAttribute("aria-label","More");const s=document.createElement("span");if(s.className="nav-overflow-icon",s.innerHTML=sanitizeHtml(this._resolveIcon(),DefaultIconAllowlist),""===t)i.append(s);else{const e=document.createElement("span");e.className="nav-overflow-text",e.textContent=t,"end"===this._config.iconPlacement?i.append(e,s):i.append(s,e)}const o=document.createElement("div");o.className="nav-overflow-menu menu",n.append(i,o),this._nav.append(n),this._overflowToggle=i,this._overflowMenu=o}_resolveIcon(){const e=SelectorEngine.findOne(SELECTOR_CUSTOM_ICON,this._element);if(!e)return this._config.moreIcon;const t=e.cloneNode(!0);t.removeAttribute("data-bs-overflow-icon");const n=t.outerHTML;return e.remove(),n}_resolveCollapseBelow(){const e=this._config.collapseBelow;if("number"==typeof e)return e;if("string"==typeof e&&""!==e){const t=getComputedStyle(document.documentElement).getPropertyValue(`--bs-breakpoint-${e}`);return Number.parseFloat(t)||0}return 0}_setupResizeObserver(){if("undefined"==typeof ResizeObserver)return this._resizeHandler=()=>this._calculateOverflow(),void EventHandler.on(window,EVENT_RESIZE$2,this._resizeHandler);this._resizeObserver=new ResizeObserver(()=>{this._calculateOverflow()}),this._resizeObserver.observe(this._element)}_availableWidth(){const{paddingInlineStart:e,paddingInlineEnd:t}=getComputedStyle(this._element),n=(Number.parseFloat(e)||0)+(Number.parseFloat(t)||0);return this._element.clientWidth-n}_navGap(){return Number.parseFloat(getComputedStyle(this._nav).columnGap)||0}_calculateOverflow(){this._restoreItems();const e=this._availableWidth(),t=this._overflowToggle?.closest(".nav-item")??null,n=this._items.filter(e=>!e.classList.contains(CLASS_NAME_KEEP));if(this._collapseBelow>0&&e<this._collapseBelow)return void this._applyOverflow(n,t);const i=this._navGap(),s=e=>e.reduce((e,t)=>e+t.offsetWidth+i,0),o=e-s(this._items.filter(e=>e.classList.contains(CLASS_NAME_KEEP)))+i;if(s(n)<=o+1)return void this._applyOverflow([],t);const a=o-(t?t.offsetWidth+i:0);let r=0,l=[];for(const e of n)r+=e.offsetWidth+i,r>a+1&&l.push(e);this._items.length-l.length<this._config.threshold&&this._items.length>this._config.threshold&&(l=this._items.slice(this._config.threshold).filter(e=>!e.classList.contains(CLASS_NAME_KEEP))),this._applyOverflow(l,t)}_applyOverflow(e,t){this._moveToOverflow(e),t?.classList.toggle("d-none",0===e.length),e.length>0&&EventHandler.trigger(this._element,EVENT_OVERFLOW,{overflowCount:e.length,visibleCount:this._items.length-e.length})}_moveToOverflow(e){if(this._overflowMenu){this._overflowMenu.replaceChildren(),this._overflowItems=[];for(const t of e){const e=SelectorEngine.findOne(".nav-link",t);if(!e)continue;const n=this._findItemMenu(t,e);n&&e.matches(SELECTOR_MENU_TOGGLE$2)?this._overflowMenu.append(this._relocateAsSubmenu(t,e,n)):this._overflowMenu.append(this._cloneAsMenuItem(e)),t.classList.add("d-none"),t.dataset.bsNavOverflow="true",this._overflowItems.push(t)}}}_relocateAsSubmenu(e,t,n){this._resetMenu(t,n),e.classList.remove("show"),this._relocatedMenus.set(e,{menu:n,parent:n.parentNode,nextSibling:n.nextSibling});const i=document.createElement("div");return i.className="submenu",i.append(this._cloneAsMenuItem(t,!0),n),i}_cloneAsMenuItem(e,t=!1){const n=e.cloneNode(!0);if(n.className="menu-item",n.removeAttribute("id"),e.classList.contains("active")&&n.classList.add("active"),(e.classList.contains("disabled")||e.hasAttribute("disabled"))&&n.classList.add("disabled"),t){for(const e of n.getAttributeNames())e.startsWith("data-bs-")&&"data-bs-theme"!==e&&n.removeAttribute(e);n.removeAttribute("href"),n.setAttribute("aria-haspopup","true"),n.setAttribute("aria-expanded","false"),"A"===n.tagName&&(n.setAttribute("role","button"),n.hasAttribute("tabindex")||n.setAttribute("tabindex","0"))}return n}_findItemMenu(e,t){const n=SelectorEngine.next(t,".menu")[0];if(n&&!n.classList.contains("nav-overflow-menu"))return this._itemMenus.set(e,n),n;const i=SelectorEngine.findOne(".menu",e);if(i&&!i.classList.contains("nav-overflow-menu"))return this._itemMenus.set(e,i),i;const s=this._itemMenus.get(e);return s?.isConnected?s:(this._itemMenus.delete(e),null)}_resetMenu(e,t){Menu.getInstance(e)?.dispose(),e.classList.remove("show"),e.setAttribute("aria-expanded","false"),e.parentElement?.classList.remove("show"),t.classList.remove("show")}_restoreRelocatedMenus(){for(const{menu:e,parent:t,nextSibling:n}of this._relocatedMenus.values())n?n.before(e):t.append(e);this._relocatedMenus.clear()}_restoreItems(){this._overflowToggle&&this._overflowMenu&&(this._resetMenu(this._overflowToggle,this._overflowMenu),this._overflowToggle.closest(".nav-item")?.classList.remove("show")),this._restoreRelocatedMenus();for(const e of this._items)e.classList.remove("d-none"),delete e.dataset.bsNavOverflow;this._overflowToggle?.closest(".nav-item")?.classList.remove("d-none"),this._overflowMenu?.replaceChildren(),this._overflowItems=[]}};onDocumentReady("DOMContentLoaded",()=>{for(const e of SelectorEngine.find('[data-bs-toggle="nav-overflow"]'))NavOverflow.getOrCreateInstance(e)});const NAME$11="swipe",EVENT_KEY$8=".bs.swipe",EVENT_TOUCHSTART="touchstart.bs.swipe",EVENT_TOUCHMOVE="touchmove.bs.swipe",EVENT_TOUCHEND="touchend.bs.swipe",EVENT_TOUCHCANCEL="touchcancel.bs.swipe",EVENT_POINTERDOWN$1="pointerdown.bs.swipe",EVENT_POINTERUP$1="pointerup.bs.swipe",EVENT_POINTERCANCEL="pointercancel.bs.swipe",POINTER_TYPE_TOUCH="touch",POINTER_TYPE_PEN="pen",CLASS_NAME_POINTER_EVENT="pointer-event",SWIPE_THRESHOLD=40,Default$10={endCallback:null,leftCallback:null,rightCallback:null,upCallback:null,downCallback:null},DefaultType$10={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)",upCallback:"(function|null)",downCallback:"(function|null)"};var Swipe=class e extends Config{constructor(t,n){super(),this._element=t,t&&e.isSupported()&&(this._config=this._getConfig(n),this._deltaX=0,this._deltaY=0,this._pointerId=null,this._touchStart=null,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Default$10}static get DefaultType(){return DefaultType$10}static get NAME(){return"swipe"}dispose(){EventHandler.off(this._element,".bs.swipe"),this._element?.classList.remove("pointer-event")}_start(e){if(!this._supportPointerEvents)return this._touchStart=1===e.touches.length?e.touches[0]:null,this._deltaX=0,void(this._deltaY=0);this._eventIsPointerPenTouch(e)&&(this._pointerId=e.pointerId,this._deltaX=e.clientX,this._deltaY=e.clientY)}_end(e){if(this._supportPointerEvents){if(!this._eventIsPointerPenTouch(e)||this._pointerId!==e.pointerId)return;this._pointerId=null,this._deltaX=e.clientX-this._deltaX,this._deltaY=e.clientY-this._deltaY}else if(!this._touchStart)return;this._touchStart=null,this._handleSwipe(),execute(this._config.endCallback)}_move(e){1!==e.touches.length&&(this._touchStart=null),this._touchStart&&(this._deltaX=e.touches[0].clientX-this._touchStart.clientX,this._deltaY=e.touches[0].clientY-this._touchStart.clientY)}_handleSwipe(){const e=Math.abs(this._deltaX),t=Math.abs(this._deltaY);if(t>e&&t>40){const e=this._deltaY>0?"down":"up";return this._deltaX=0,this._deltaY=0,void execute("down"===e?this._config.downCallback:this._config.upCallback)}if(e>40){const t=e/this._deltaX;if(this._deltaX=0,this._deltaY=0,!t)return;return void execute(t>0?this._config.rightCallback:this._config.leftCallback)}this._deltaX=0,this._deltaY=0}_initEvents(){this._supportPointerEvents?(EventHandler.on(this._element,EVENT_POINTERDOWN$1,e=>this._start(e)),EventHandler.on(this._element,EVENT_POINTERUP$1,e=>this._end(e)),EventHandler.on(this._element,EVENT_POINTERCANCEL,e=>{this._pointerId===e.pointerId&&(this._pointerId=null)}),this._element.classList.add("pointer-event")):(EventHandler.on(this._element,EVENT_TOUCHSTART,e=>this._start(e)),EventHandler.on(this._element,EVENT_TOUCHMOVE,e=>this._move(e)),EventHandler.on(this._element,EVENT_TOUCHEND,e=>this._end(e)),EventHandler.on(this._element,EVENT_TOUCHCANCEL,()=>{this._touchStart=null}))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}};const NAME$10="drawer",EVENT_KEY$7=".bs.drawer",DATA_API_KEY$4=".data-api",EVENT_LOAD_DATA_API$2=`load${EVENT_KEY$7}.data-api`,EVENT_RESIZE$1=`resize${EVENT_KEY$7}`,EVENT_CLICK_DATA_API$1=`click${EVENT_KEY$7}.data-api`,SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="drawer"]',SELECTOR_RESPONSIVE='dialog[class*="\\:drawer"]',SELECTOR_OPEN='dialog.drawer[open], dialog[open][class*="\\:drawer"]',SELECTOR_RESIZE=`${SELECTOR_OPEN}, ${SELECTOR_RESPONSIVE}`,inlineAttributes=new WeakMap,drawerIsInline=e=>e.matches(SELECTOR_RESPONSIVE)&&"1"===getComputedStyle(e).getPropertyValue("--drawer-inline").trim(),syncInlineSemantics=(e,t)=>{const n=inlineAttributes.get(e);if(t&&!n){const t=new Map;for(const n of["role","aria-label","aria-labelledby","aria-describedby","aria-modal"])t.set(n,e.getAttribute(n)),e.removeAttribute(n);e.setAttribute("role","presentation"),inlineAttributes.set(e,t)}else if(!t&&n){for(const[t,i]of n)null===i?e.removeAttribute(t):e.setAttribute(t,i);inlineAttributes.delete(e)}},Default$9={backdrop:!0,keyboard:!0,scroll:!1},DefaultType$9={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};var Drawer=class e extends DialogBase{constructor(e,t){super(e,t),this._swipeHelper=null,this._resizeObserver=null,this._resizeFrame=null,this._initResizeObserver()}static get Default(){return Default$9}static get DefaultType(){return DefaultType$9}static get NAME(){return NAME$10}static{EventHandler.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$4,function(t){const n=SelectorEngine.getElementFromSelector(this);n instanceof HTMLDialogElement&&!isDisabled(this)&&(["A","AREA"].includes(this.tagName)&&t.preventDefault(),e._toggleDrawer(n,this))})}static _toggleDrawer(t,n){const i=e.getOrCreateInstance(t,Manipulator.getDataAttributes(n));if(t.open)return void i.hide();const s=SelectorEngine.findOne(SELECTOR_OPEN);if(!s)return void i.show(n);const o=e.getOrCreateInstance(s);if(!i._canShow(n)||!o._canHide())return;const a=s.contains(n)?o._returnFocus:n;i._show(n,a),t.open&&o._hide(!1)}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),this._resizeObserver&&this._resizeObserver.disconnect(),null!==this._resizeFrame&&cancelAnimationFrame(this._resizeFrame),super.dispose()}_getShowOptions(){return{modal:Boolean(this._config.backdrop)||!this._config.scroll,preventBodyScroll:!this._config.scroll}}_onBeforeShow(){this._swipeHelper?.dispose(),this._swipeHelper=null,this._initSwipe()}_canShow(e){return!this._isInline()&&super._canShow(e)}async _show(e,t=e){this._isInline()||(await super._show(e,t),this._element?.open&&this._isInline()&&await this.hide())}_onAfterHide(){syncInlineSemantics(this._element,this._isInline())}_isInline(){return Boolean(this._element&&drawerIsInline(this._element))}_getInstantClassName(){return"drawer-instant"}_getStaticClassName(){return"drawer-static"}_shouldDeferClose(){return this._isAnimated()}_initResizeObserver(){const e=this._element?.closest(".navbar");e&&"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{null!==this._resizeFrame&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,this._element.open&&"fixed"!==getComputedStyle(this._element).position&&this.hide()})}),this._resizeObserver.observe(e))}_initSwipe(){if(this._swipeHelper||!Swipe.isSupported())return;const e={},t=this._element,n=t.matches(":dir(rtl)");t.classList.contains("drawer-bottom")?e.downCallback=()=>this.hide():t.classList.contains("drawer-top")?e.upCallback=()=>this.hide():t.classList.contains("drawer-end")?n?e.leftCallback=()=>this.hide():e.rightCallback=()=>this.hide():n?e.rightCallback=()=>this.hide():e.leftCallback=()=>this.hide(),this._swipeHelper=new Swipe(SelectorEngine.findOne(".drawer-header",t)||t,e)}};EventHandler.on(window,EVENT_LOAD_DATA_API$2,()=>{for(const e of SelectorEngine.find(SELECTOR_OPEN))Drawer.getOrCreateInstance(e)}),onDocumentReady(`DOMContentLoaded${EVENT_KEY$7}.data-api`,()=>{for(const e of SelectorEngine.find(SELECTOR_RESPONSIVE))syncInlineSemantics(e,!e.open&&drawerIsInline(e))}),document.addEventListener("beforetoggle",e=>{e.target instanceof HTMLDialogElement&&"open"===e.newState&&syncInlineSemantics(e.target,!1)},!0),document.addEventListener("close",e=>{e.target instanceof HTMLDialogElement&&e.target.matches(SELECTOR_RESPONSIVE)&&syncInlineSemantics(e.target,!e.target.open&&drawerIsInline(e.target))},!0),EventHandler.on(window,EVENT_RESIZE$1,()=>{for(const e of SelectorEngine.find(SELECTOR_RESIZE)){const t=drawerIsInline(e);syncInlineSemantics(e,!e.open&&t),e.open&&(t||"fixed"!==getComputedStyle(e).position)&&Drawer.getOrCreateInstance(e).hide()}}),enableDismissTrigger(Drawer);const NAME$9="strength",EVENT_KEY$6=".bs.strength",DATA_API_KEY$3=".data-api",EVENT_STRENGTH_CHANGE=`strengthChange${EVENT_KEY$6}`,SELECTOR_DATA_STRENGTH="[data-bs-strength]",STRENGTH_LEVELS=["weak","fair","good","strong"],Default$8={input:null,minLength:8,messages:{weak:"Weak",fair:"Fair",good:"Good",strong:"Strong"},weights:{minLength:1,extraLength:1,lowercase:1,uppercase:1,numbers:1,special:1,multipleSpecial:1,longPassword:1},thresholds:[2,4,6],scorer:null},DefaultType$8={input:"(string|element|null)",minLength:"number",messages:"object",weights:"object",thresholds:"array",scorer:"(function|null)"};var Strength=class extends BaseComponent{constructor(e,t){super(e,t),this._input=this._getInput(),this._segments=SelectorEngine.find(".strength-segment",this._element),this._textElement=SelectorEngine.findOne(".strength-text",this._element.parentElement),this._currentStrength=null,this._input&&(this._addEventListeners(),this._evaluate())}static get Default(){return Default$8}static get DefaultType(){return DefaultType$8}static get NAME(){return NAME$9}getStrength(){return this._currentStrength}evaluate(){this._evaluate()}dispose(){EventHandler.off(this._input,EVENT_KEY$6),super.dispose()}_getInput(){if(this._config.input)return"string"==typeof this._config.input?SelectorEngine.findOne(this._config.input):this._config.input;const e=this._element.parentElement;return SelectorEngine.findOne('input[type="password"]',e)}_addEventListeners(){EventHandler.on(this._input,`input${EVENT_KEY$6}`,()=>this._evaluate()),EventHandler.on(this._input,`change${EVENT_KEY$6}`,()=>this._evaluate())}_evaluate(){const e=this._input.value,t=this._calculateScore(e),n=this._scoreToStrength(t);n!==this._currentStrength&&(this._currentStrength=n,this._updateUI(n),EventHandler.trigger(this._element,EVENT_STRENGTH_CHANGE,{strength:n,score:t,password:e.length>0?"***":""}))}_calculateScore(e){if(!e)return 0;if("function"==typeof this._config.scorer)return this._config.scorer(e);const{weights:t}=this._config;let n=0;e.length>=this._config.minLength&&(n+=t.minLength),e.length>=this._config.minLength+4&&(n+=t.extraLength),/[a-z]/.test(e)&&(n+=t.lowercase),/[A-Z]/.test(e)&&(n+=t.uppercase),/\d/.test(e)&&(n+=t.numbers);const i=e.match(/[ \p{P}\p{S}]/gu)?.length??0;return i>=1&&(n+=t.special),i>=2&&(n+=t.multipleSpecial),e.length>=16&&(n+=t.longPassword),n}_scoreToStrength(e){if(0===e)return null;const[t,n,i]=this._config.thresholds;return e<=t?"weak":e<=n?"fair":e<=i?"good":"strong"}_updateUI(e){e?this._element.dataset.bsStrength=e:delete this._element.dataset.bsStrength;const t=e?STRENGTH_LEVELS.indexOf(e):-1;for(const[e,n]of this._segments.entries())e<=t?n.classList.add("active"):n.classList.remove("active");this._textElement&&(e&&this._config.messages[e]?(this._textElement.textContent=this._config.messages[e],this._textElement.dataset.bsStrength=e):(this._textElement.textContent="",delete this._textElement.dataset.bsStrength))}};onDocumentReady(`DOMContentLoaded${EVENT_KEY$6}.data-api`,()=>{for(const e of SelectorEngine.find("[data-bs-strength]"))Strength.getOrCreateInstance(e)});const NAME$8="otpInput",EVENT_KEY$5=".bs.otpInput",DATA_API_KEY$2=".data-api",EVENT_COMPLETE=`complete${EVENT_KEY$5}`,EVENT_INPUT$1=`input${EVENT_KEY$5}`,EVENT_DOMCONTENT_LOADED=`DOMContentLoaded${EVENT_KEY$5}.data-api`,SELECTOR_DATA_OTP="[data-bs-otp]",SELECTOR_INPUT$1="input",CLASS_NAME_INPUT="otp-input",CLASS_NAME_RENDERED="otp-rendered",CLASS_NAME_SLOTS="otp-slots",CLASS_NAME_SLOT="otp-slot",CLASS_NAME_SLOT_FILLED="otp-slot-filled",CLASS_NAME_SLOT_ACTIVE="otp-slot-active",CLASS_NAME_SLOT_SELECTED="otp-slot-selected",CLASS_NAME_SEPARATOR="otp-separator",MASK_CHARACTER="•",TYPES={numeric:{inputmode:"numeric",pattern:"[0-9]*",filter:/[^0-9]/g},alphanumeric:{inputmode:"text",pattern:"[A-Za-z0-9]*",filter:/[^A-Za-z0-9]/g},alpha:{inputmode:"text",pattern:"[A-Za-z]*",filter:/[^A-Za-z]/g}},Default$7={groups:null,length:null,mask:!1,pasteTransformer:null,separator:"·",type:"numeric"},DefaultType$7={groups:"(array|null)",length:"(number|null)",mask:"boolean",pasteTransformer:"(function|null)",separator:"string",type:"string"};var OtpInput=class extends BaseComponent{constructor(e,t){super(e,t);const n=SelectorEngine.findOne("input",this._element);n&&(this._input=n,this._type=TYPES[this._config.type]||TYPES.numeric,this._length=this._resolveLength(),this._slots=[],this._pointerActive=!1,this._pointerIndex=0,this._touchPointer=!1,this._setupInput(),this._lastCompleteValue=null,this._renderSlots(),this._addEventListeners(),this._render())}static get Default(){return Default$7}static get DefaultType(){return DefaultType$7}static get NAME(){return NAME$8}getValue(){return this._input.value}setValue(e){this._input.value=this._sanitize(String(e)),this._render(),this._checkComplete()}clear(){this._input.value="",this._lastCompleteValue=null,this._render(),this._input.focus()}focus(){this._input.focus(),this._selectSlot(this._firstEmptyIndex()),this._render()}dispose(){for(const[e,t]of Object.entries(this._inputListeners??{}))EventHandler.off(this._input,e,t);EventHandler.off(document,"selectionchange",this._onSelectionChange),document.removeEventListener("reset",this._onReset,!0);for(const[e,t]of this._inputDefaults??[])this._input.getAttribute(e)===t&&this._input.removeAttribute(e);this._slotsContainer?.remove(),this._element.classList.remove("otp-rendered"),super.dispose()}_resolveLength(){if(this._config.length)return this._config.length;const e=Number.parseInt(this._input.getAttribute("maxlength"),10);return Number.isNaN(e)||e<1?6:e}_setupInput(){const e=this._input;"number"!==e.type&&"password"!==e.type||(e.type="text"),e.classList.add("otp-input"),e.setAttribute("maxlength",String(this._length)),this._inputDefaults=new Map;const t=e.minLength>0?`${this._type.pattern.slice(0,-1)}{${e.minLength},}`:this._type.pattern,n={inputmode:this._type.inputmode,pattern:t,spellcheck:"false"};for(const[t,i]of Object.entries(n))e.hasAttribute(t)||(e.setAttribute(t,i),this._inputDefaults.set(t,i));e.getAttribute("autocomplete")||e.setAttribute("autocomplete","one-time-code"),e.value&&(e.value=this._sanitize(e.value))}_renderSlots(){const e=document.createElement("div");e.className="otp-slots",e.setAttribute("aria-hidden","true");const{groups:t}=this._config;let n=0,i=0;for(let s=0;s<this._length;s++){const o=document.createElement("div");if(o.className="otp-slot",e.append(o),this._slots.push(o),Array.isArray(t)&&t.length>0&&(i++,i===t[n]&&s<this._length-1)){const s=document.createElement("div");s.className="otp-separator",s.textContent=this._config.separator,e.append(s),n=Math.min(n+1,t.length-1),i=0}}this._slotsContainer=e,this._element.append(e),this._element.classList.add("otp-rendered")}_addEventListeners(){this._inputListeners={input:e=>this._handleInput(e),compositionend:()=>this._handleInput(),beforeinput:e=>this._handleBeforeInput(e),keydown:e=>this._handleKeydown(e),paste:e=>this._handlePaste(e),pointerdown:e=>this._handlePointerDown(e),pointercancel:()=>{this._touchPointer=!1},click:e=>this._handleClick(e)},this._inputListeners.focus=()=>{if(this._pointerActive)return this._pointerActive=!1,this._selectSlot(this._pointerIndex),void this._render();this._selectSlot(this._firstEmptyIndex()),this._render()};const e=()=>this._render();this._onSelectionChange=()=>{document.activeElement===this._input&&this._render()};for(const t of["blur","keyup","select"])this._inputListeners[t]=e;for(const[e,t]of Object.entries(this._inputListeners))EventHandler.on(this._input,e,t);EventHandler.on(document,"selectionchange",this._onSelectionChange),this._onReset=e=>{e.target===this._input.form&&setTimeout(()=>{if(e.defaultPrevented||e.target!==this._input?.form)return;const t=this._sanitize(this._input.value);t!==this._input.value&&(this._input.value=t),this._lastCompleteValue=null,this._render()})},document.addEventListener("reset",this._onReset,!0)}_handleInput(e){if(e?.isComposing)return;const{value:t,selectionStart:n}=this._input,i=this._sanitize(t);if(i!==t&&(this._input.value=i),document.activeElement===this._input){const s=e?.inputType;if("insertText"===s||s?.startsWith("delete")){const e=n??i.length;this._selectSlot(this._sanitize(t.slice(0,e)).length)}else s&&"insertReplacementText"!==s||this._selectSlot(this._firstEmptyIndex())}this._afterValueChange()}_handlePaste(e){const t=e.clipboardData?.getData("text");if(!t||!this._isEditable())return;const n=this._config.pasteTransformer?.(t)??t,i=this._sanitize(n);let s=this._input.selectionStart??this._input.value.length,o=this._input.selectionEnd??s;i.length===this._length&&(s=0,o=this._input.value.length);const a=i.slice(0,this._length-this._input.value.length+o-s);if(s===this._input.selectionStart&&o===this._input.selectionEnd&&a===t)return;if(e.preventDefault(),!a)return;const r=this._input;r.matches(":focus")&&(r.setSelectionRange(s,o),r.ownerDocument.execCommand("insertText",!1,a))||(r.setRangeText(a,s,o,"end"),r.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0,inputType:"insertFromPaste",data:a})))}_handleBeforeInput(e){const{inputType:t,data:n,isComposing:i}=e;"insertText"===t&&!i&&1===n?.length&&this._isEditable()&&(this._sanitize(n)?this._input.selectionStart===this._input.selectionEnd&&this._selectSlot(this._input.selectionStart??0):e.preventDefault())}_handleKeydown(e){const{key:t,altKey:n,ctrlKey:i,metaKey:s,shiftKey:o,isComposing:a,defaultPrevented:r}=e;if(r||a||n||i||s||o||"ArrowLeft"!==t&&"ArrowRight"!==t)return;if("rtl"!==getComputedStyle(this._slotsContainer).direction)return;const l=this._input.selectionStart??0,c=this._input.selectionEnd??l,h="ArrowRight"===t,u=c-l>1?h?l:c:l+(h?-1:1);e.preventDefault(),this._selectSlot(Math.min(u,this._firstEmptyIndex())),this._render()}_handleClick(e){if(!this._touchPointer)return;this._touchPointer=!1;const t=this._slotIndexFromPoint(e.clientX);null!==t&&requestAnimationFrame(()=>{this._input&&document.activeElement===this._input&&(this._selectSlot(Math.min(t,this._firstEmptyIndex())),this._render())})}_handlePointerDown(e){if(0!==e.button||this._input.matches(":disabled"))return;this._touchPointer="touch"===e.pointerType;const t=this._slotIndexFromPoint(e.clientX);if(null===t)return;const n=Math.min(t,this._firstEmptyIndex());document.activeElement!==this._input?(this._pointerActive=!0,this._pointerIndex=n):this._touchPointer||(e.preventDefault(),this._selectSlot(n),this._render())}_slotIndexFromPoint(e){const t="rtl"===getComputedStyle(this._slotsContainer).direction;for(const[n,i]of this._slots.entries()){const{left:s,right:o}=i.getBoundingClientRect();if((t?e>=s:e<=o)||n===this._slots.length-1)return n}return null}_afterValueChange(){this._render(),EventHandler.trigger(this._element,EVENT_INPUT$1,{value:this._input.value}),this._input&&this._checkComplete()}_firstEmptyIndex(){return Math.min(this._input.value.length,this._length-1)}_isEditable(){return!this._input.readOnly&&!this._input.matches(":disabled")}_selectSlot(e){const t=Math.max(0,Math.min(e,this._length-1)),n=t<this._input.value.length?t+1:t;this._input.setSelectionRange(t,n)}_sanitize(e){return e.replace(this._type.filter,"").slice(0,this._length)}_render(){const{value:e}=this._input,t=document.activeElement===this._input,n=this._input.selectionStart??e.length,i=this._input.selectionEnd??n,s=Math.min(n,this._length-1);for(const[o,a]of this._slots.entries()){const r=e[o]??"",l=e?"":this._input.placeholder[o]??"",c=r&&this._config.mask?"•":r||l;a.textContent!==c&&(a.textContent=c),a.classList.toggle("otp-slot-filled",Boolean(r)),a.classList.toggle("otp-slot-active",t&&o===s),a.classList.toggle("otp-slot-selected",t&&i-n>1&&o>=n&&o<i)}}_checkComplete(){const{value:e}=this._input,t=e.length===this._length?e:null,n=t!==this._lastCompleteValue;this._lastCompleteValue=t,t&&n&&EventHandler.trigger(this._element,EVENT_COMPLETE,{value:e})}};onDocumentReady(EVENT_DOMCONTENT_LOADED,()=>{for(const e of SelectorEngine.find("[data-bs-otp]"))OtpInput.getOrCreateInstance(e)});const NAME$7="TemplateFactory",Default$6={allowList:DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},DefaultType$6={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},DefaultContentType={entry:"(string|element|function|null)",selector:"(string|element)"};var TemplateFactory=class extends Config{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Default$6}static get DefaultType(){return DefaultType$6}static get NAME(){return NAME$7}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},DefaultContentType)}_setContent(e,t,n){const i=SelectorEngine.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?isElement$1(t)?this._putElementInTemplate(getElement(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?sanitizeHtml(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return execute(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}};const NAME$6="tooltip",DISALLOWED_ATTRIBUTES$1=new Set(["sanitize","allowList","sanitizeFn"]),ESCAPE_KEY="Escape",CLASS_NAME_SHOW$2="show",SELECTOR_TOOLTIP_INNER=".tooltip-inner",SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="tooltip"]',TRIGGER_HOVER="hover",TRIGGER_FOCUS="focus",TRIGGER_CLICK="click",TRIGGER_MANUAL="manual",EVENT_HIDE$2="hide",EVENT_HIDDEN$2="hidden",EVENT_SHOW$2="show",EVENT_SHOWN$2="shown",EVENT_INSERTED="inserted",EVENT_CLICK$3="click",EVENT_FOCUSIN$2="focusin",EVENT_FOCUSOUT$1="focusout",EVENT_MOUSEENTER$1="mouseenter",EVENT_MOUSELEAVE="mouseleave",EVENT_POINTERDOWN="pointerdown",EVENT_POINTERUP="pointerup",EVENT_KEYDOWN$1="keydown",AttachmentMap={AUTO:"auto",TOP:"top",RIGHT:isRTL$1()?"left":"right",BOTTOM:"bottom",LEFT:isRTL$1()?"right":"left"},Default$5={allowList:DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",floatingConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},DefaultType$5={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",floatingConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};var Tooltip=class extends BaseComponent{constructor(e,t){super(e,t),this._isEnabled=!0,this._timeout=0,this._resolveTimeout=null,this._isHovered=null,this._activeTrigger={},this._floatingCleanup=null,this._keydownHandler=null,this._tipEventOut=null,this._outsidePointerHandler=null,this._tipPointerUpHandler=null,this._tipPointerDown=!1,this._templateFactory=null,this._newContent=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this.tip=null,this._parseResponsivePlacements(),this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Default$5}static get DefaultType(){return DefaultType$5}static get NAME(){return NAME$6}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){return this._isEnabled?this._isShown()?this._leave():this._enter():Promise.resolve()}dispose(){this._clearTimeout(),this._removeEscapeListener(),this._removeFocusOutsideListener(),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposeFloating(),this._disposeMediaQueryListeners(),super.dispose()}async show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=EventHandler.trigger(this._element,this.constructor.eventName("show")),t=(findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return void(this._isHovered=!1);this._disposeFloating();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));let{container:i}=this._config;const s=this._element.closest("dialog[open]");if(s&&i===document.body&&(i=s),this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),EventHandler.trigger(this._element,this.constructor.eventName("inserted")),this._setTipListeners(n)),await this._createFloating(n),n.classList.add("show"),this._setEscapeListener(),this._setFocusOutsideListener(),"ontouchstart"in document.documentElement)for(const e of document.body.children)EventHandler.on(e,"mouseover",noop);await this._queueCallback(()=>{EventHandler.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=null},this.tip,this._isAnimated())}async hide(){if(this._isShown()&&!EventHandler.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._removeEscapeListener(),this._removeFocusOutsideListener(),this._getTipElement().classList.remove("show"),"ontouchstart"in document.documentElement)for(const e of document.body.children)EventHandler.off(e,"mouseover",noop);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null,await this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposeFloating(),this._element.removeAttribute("aria-describedby"),EventHandler.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._floatingCleanup&&this.tip&&this._updateFloatingPosition()}_isWithContent(){return Boolean(this._getTitle())||this._hasNewContent()}_hasNewContent(){return Boolean(this._newContent)&&Object.values(this._newContent).some(Boolean)}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();t.classList.remove("show"),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=getUID(this.constructor.NAME).toString();return t.setAttribute("id",n),this._config.animation||t.classList.add(this._getInstantClassName()),this._setFocusTipListeners(t),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposeFloating(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new TemplateFactory({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[SELECTOR_TOOLTIP_INNER]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_getInstantClassName(){return`${this.constructor.NAME}-instant`}_isAnimated(){return getTransitionDurationFromElement(this.tip)>0}_isShown(){return this.tip&&this.tip.classList.contains("show")}_getPlacement(e){if(this._responsivePlacements){const e=getResponsivePlacement(this._responsivePlacements,"top");return AttachmentMap[e.toUpperCase()]||e}const t=execute(this._config.placement,[this,e,this._element]);return AttachmentMap[t.toUpperCase()]||t}_parseResponsivePlacements(){"string"==typeof this._config.placement?(this._responsivePlacements=parseResponsivePlacement(this._config.placement,"top"),this._responsivePlacements&&this._setupMediaQueryListeners()):this._responsivePlacements=null}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=createBreakpointListeners(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){disposeBreakpointListeners(this._mediaQueryListeners),this._mediaQueryListeners=[]}async _createFloating(e){const t=this._getPlacement(e),n=e.querySelector(`.${this.constructor.NAME}-arrow`);await this._updateFloatingPosition(e,t,n),this._floatingCleanup=autoUpdate(this._element,e,()=>this._updateFloatingPosition(e,null,n))}async _updateFloatingPosition(e=this.tip,t=null,n=null){if(!e)return;t||(t=this._getPlacement(e)),n||(n=e.querySelector(`.${this.constructor.NAME}-arrow`));const i=this._getFloatingMiddleware(n),s=this._getFloatingConfig(t,i),{x:o,y:a,placement:r,middlewareData:l}=await computePosition(this._element,e,s);if(Object.assign(e.style,{position:"absolute",left:`${o}px`,top:`${a}px`}),n&&(n.style.position="absolute"),Manipulator.setDataAttribute(e,"placement",r),n&&l.arrow){const{x:e,y:t}=l.arrow,i=r.startsWith("top")||r.startsWith("bottom");Object.assign(n.style,{left:i&&void 0!==e?`${e}px`:"",top:i||void 0===t?"":`${t}px`,right:"",bottom:""})}}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?({placement:t,rects:n})=>toFloatingOffset(e({placement:t,reference:n.reference,floating:n.floating},this._element)):e}_resolvePossibleFunction(e){return execute(e,[this._element,this._element])}_getFloatingMiddleware(e){const t=this._getOffset(),n=[offset("function"==typeof t?t:toFloatingOffset(t)),flip({fallbackPlacements:this._config.fallbackPlacements}),shift({boundary:"clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary})];return e&&n.push(arrow({element:e})),n}_getFloatingConfig(e,t){const n={placement:e,middleware:t};return{...n,...execute(this._config.floatingConfig,[void 0,n])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)EventHandler.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger.click=!(t._isShown()&&t._activeTrigger.click),t.toggle()});else if("manual"!==t){const[e,n]=this._getTriggerEvents(t);EventHandler.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?"focus":"hover"]=!0,t._enter()}),EventHandler.on(this._element,n,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);"focusout"===e.type?t._activeTrigger.focus=t._isInside(e.relatedTarget)||t._tipPointerDown:t._activeTrigger.hover=t._isInside(e.relatedTarget),t._leave()})}}_setTipListeners(e){const t=this._getTrigger();if("manual"!==t&&!t.includes("click")){this._tipEventOut=e=>{this._activeTrigger["focusout"===e.type?"focus":"hover"]=this._isInside(e.relatedTarget),this._leave()};for(const n of t.split(" "))if("hover"===n||"focus"===n){const[,t]=this._getTriggerEvents(n);EventHandler.on(e,t,this._tipEventOut)}}}_removeTipListeners(e){if(!this._tipEventOut)return;const t=this._getTrigger();for(const n of t.split(" "))if("hover"===n||"focus"===n){const[,t]=this._getTriggerEvents(n);EventHandler.off(e,t,this._tipEventOut)}this._tipEventOut=null}_isInside(e){return e instanceof Node&&(this._element.contains(e)||Boolean(this.tip?.contains(e)))}_getTrigger(){return this._config._trigger}_getTriggerEvents(e){return{[TRIGGER_HOVER]:[this.constructor.eventName("mouseenter"),this.constructor.eventName("mouseleave")],[TRIGGER_FOCUS]:[this.constructor.eventName("focusin"),this.constructor.eventName("focusout")]}[e]}_hasFocusTrigger(){return this._getTrigger().split(" ").includes("focus")}_setFocusTipListeners(e){this._hasFocusTrigger()&&(EventHandler.on(e,this.constructor.eventName("pointerdown"),()=>{this._tipPointerDown=!0,this._activeTrigger.focus=!0}),EventHandler.on(e,this.constructor.eventName("focusin"),()=>{this._activeTrigger.focus=!0}),EventHandler.on(e,this.constructor.eventName("focusout"),e=>{this._activeTrigger.focus=this._isInside(e.relatedTarget)||this._tipPointerDown,this._leave()}))}_setFocusOutsideListener(){if(this._outsidePointerHandler||!this._hasFocusTrigger())return;this._tipPointerUpHandler=()=>{this._tipPointerDown=!1},this._outsidePointerHandler=e=>{this._isShown()&&!this._isInside(e.target)&&(this._activeTrigger.focus=!1,this.hide())};const e=this._element.ownerDocument;e.addEventListener("pointerup",this._tipPointerUpHandler,!0),e.addEventListener("pointerdown",this._outsidePointerHandler,!0)}_removeFocusOutsideListener(){const e=this._element?.ownerDocument;this._tipPointerUpHandler&&e&&e.removeEventListener("pointerup",this._tipPointerUpHandler,!0),this._outsidePointerHandler&&e&&e.removeEventListener("pointerdown",this._outsidePointerHandler,!0),this._tipPointerUpHandler=null,this._outsidePointerHandler=null,this._tipPointerDown=!1}_setEscapeListener(){this._keydownHandler||(this._keydownHandler=e=>{"Escape"===e.key&&this._isShown()&&this.tip.isConnected&&(e.preventDefault(),e.stopPropagation(),this.hide())},this._element.ownerDocument.addEventListener("keydown",this._keydownHandler,!0))}_removeEscapeListener(){this._keydownHandler&&(this._element.ownerDocument.removeEventListener("keydown",this._keydownHandler,!0),this._keydownHandler=null)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){return this._isShown()||this._isHovered?(this._isHovered=!0,Promise.resolve()):(this._isHovered=!0,this._setTimeout(()=>this._isHovered?this.show():void 0,this._config.delay.show))}_leave(){return this._isWithActiveTrigger()?Promise.resolve():(this._isHovered=!1,this._setTimeout(()=>this._isHovered?void 0:this.hide(),this._config.delay.hide))}_setTimeout(e,t){return this._clearTimeout(),new Promise(n=>{this._resolveTimeout=n,this._timeout=setTimeout(()=>{this._resolveTimeout=null,n(e())},t)})}_clearTimeout(){clearTimeout(this._timeout),this._resolveTimeout&&(this._resolveTimeout(),this._resolveTimeout=null)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=Manipulator.getDataAttributes(this._element);for(const e of Object.keys(t))DISALLOWED_ATTRIBUTES$1.has(e)&&delete t[e];return null!==this._element.getAttribute("data-bs-title")&&(t.title=this._element.getAttribute("data-bs-title")),null!==this._element.getAttribute("data-bs-content")&&(t.content=this._element.getAttribute("data-bs-content")),e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:getElement(e.container),e._trigger=e._trigger||e.trigger,"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),null===e.title?e.title="":"number"!=typeof e.title&&"boolean"!=typeof e.title||(e.title=e.title.toString()),null===e.content?e.content="":"number"!=typeof e.content&&"boolean"!=typeof e.content||(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null),this.tip&&(this._removeTipListeners(this.tip),EventHandler.off(this.tip,this.constructor.EVENT_KEY),this.tip.remove(),this.tip=null)}};const initTooltip=e=>{const t=e.target.closest(SELECTOR_DATA_TOGGLE$3);t&&Tooltip.getOrCreateInstance(t)};EventHandler.on(document,"focusin",SELECTOR_DATA_TOGGLE$3,initTooltip),EventHandler.on(document,"mouseenter",SELECTOR_DATA_TOGGLE$3,initTooltip);const NAME$5="popover",SELECTOR_TITLE=".popover-header",SELECTOR_CONTENT=".popover-body",SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="popover"]',EVENT_CLICK$2="click",EVENT_FOCUSIN$1="focusin",EVENT_MOUSEENTER="mouseenter",Default$4={...Tooltip.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},DefaultType$4={...Tooltip.DefaultType,content:"(null|string|element|function)"};var Popover=class extends Tooltip{constructor(e,t){super(e,t)}static get Default(){return Default$4}static get DefaultType(){return DefaultType$4}static get NAME(){return NAME$5}_isWithContent(){return Boolean(this._getTitle()||this._getContent())||this._hasNewContent()}_getContentForTemplate(){return{[SELECTOR_TITLE]:this._getTitle(),[SELECTOR_CONTENT]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}};const initPopover=e=>{const t=e.target.closest(SELECTOR_DATA_TOGGLE$2);if(!t)return;const n=Popover.getOrCreateInstance(t);"click"===e.type&&n._getTrigger().split(" ").includes("click")&&e.preventDefault()};EventHandler.on(document,"click",SELECTOR_DATA_TOGGLE$2,initPopover),EventHandler.on(document,"focusin",SELECTOR_DATA_TOGGLE$2,initPopover),EventHandler.on(document,"mouseenter",SELECTOR_DATA_TOGGLE$2,initPopover);const NAME$4="range",EVENT_KEY$4=".bs.range",DATA_API_KEY$1=".data-api",EVENT_CHANGED="changed.bs.range",EVENT_DOM_CONTENT_LOADED="DOMContentLoaded.bs.range.data-api",EVENT_INPUT="input",EVENT_CHANGE="change",EVENT_RESET="reset",SELECTOR_RANGE=".form-range",SELECTOR_INPUT=".form-range-input",CLASS_NAME_BUBBLE="form-range-bubble",CLASS_NAME_TICKS="form-range-ticks",CLASS_NAME_TICK="form-range-tick",CLASS_NAME_TICK_LABEL="form-range-tick-label",PROPERTY_FILL="--bs-range-fill",Default$3={bubble:!1,formatter:null},DefaultType$3={bubble:"(boolean|null)",formatter:"(function|null)"};var Range=class extends BaseComponent{constructor(e,t){super(e,t),this._element&&(this._input=SelectorEngine.findOne(SELECTOR_INPUT,this._element),this._input&&(this._bubble=null,this._bubbleText=null,this._ticks=null,this._updateHandler=()=>this._update(),this._initialConfig={...t},this._form=null,this._resetTimeouts=new Set,this._resetHandler=e=>{const t=window.setTimeout(()=>{this._resetTimeouts.delete(t),e.defaultPrevented||this._update()},0);this._resetTimeouts.add(t)},this._syncBubble(),this._syncForm(),this._createTicks(),this._addEventListeners(),this._update()))}static get Default(){return Default$3}static get DefaultType(){return DefaultType$3}static get NAME(){return NAME$4}update(){this._input&&(this._config=this._getConfig(this._initialConfig),this._syncBubble(),this._ticks?.remove(),this._ticks=null,this._createTicks(),this._syncForm(),this._update())}dispose(){EventHandler.off(this._input,"input",this._updateHandler),EventHandler.off(this._input,"change",this._updateHandler),EventHandler.off(this._form,"reset",this._resetHandler),this._resetTimeouts?.forEach(e=>clearTimeout(e)),this._bubble?.remove(),this._ticks?.remove(),super.dispose()}_configAfterMerge(e){return null===e.bubble&&(e.bubble=!0),e}_syncBubble(){this._config.bubble?this._bubble||this._createBubble():(this._bubble?.remove(),this._bubble=null,this._bubbleText=null)}_syncForm(){const{form:e}=this._input;e!==this._form&&(EventHandler.off(this._form,"reset",this._resetHandler),this._resetTimeouts.forEach(e=>clearTimeout(e)),this._resetTimeouts.clear(),this._form=e,EventHandler.on(this._form,"reset",this._resetHandler))}_addEventListeners(){EventHandler.on(this._input,"input",this._updateHandler),EventHandler.on(this._input,"change",this._updateHandler)}_min(){return""===this._input.min?0:Number.parseFloat(this._input.min)}_max(){return""===this._input.max?100:Number.parseFloat(this._input.max)}_value(){return Number.parseFloat(this._input.value)}_ratio(){const e=this._max()-this._min();return e>0?(this._value()-this._min())/e:0}_update(){this._element.style.setProperty(PROPERTY_FILL,`${this._ratio()}`),this._bubbleText&&(this._bubbleText.textContent=this._format(this._value())),EventHandler.trigger(this._input,EVENT_CHANGED,{value:this._value()})}_format(e){return"function"==typeof this._config.formatter?this._config.formatter(e):String(e)}_createBubble(){this._bubble=document.createElement("div"),this._bubble.className=`${CLASS_NAME_BUBBLE} tooltip bs-tooltip-top show`,this._bubble.setAttribute("aria-hidden","true");const e=document.createElement("div");e.className="tooltip-arrow",this._bubbleText=document.createElement("div"),this._bubbleText.className="tooltip-inner",this._bubble.append(e,this._bubbleText),this._input.insertAdjacentElement("afterend",this._bubble)}_createTicks(){const e=this._input.getAttribute("list"),t=e?document.getElementById(e):null;if(!t)return;const n=this._min(),i=this._max()-n||1,s=[];for(const e of SelectorEngine.find("option",t)){const t=Number.parseFloat(e.value);if(!Number.isNaN(t)){const o=Math.min(Math.max((t-n)/i,0),1);s.push({ratio:o,label:e.label})}}if(0===s.length)return;s.sort((e,t)=>e.ratio-t.ratio),this._ticks=document.createElement("div"),this._ticks.className=CLASS_NAME_TICKS,this._ticks.setAttribute("aria-hidden","true");const o=[0,...s.map(e=>e.ratio),1];this._ticks.style.gridTemplateColumns=o.slice(1).map((e,t)=>e-o[t]+"fr").join(" ");for(const[e,t]of s.entries()){const n=document.createElement("span");if(n.className=CLASS_NAME_TICK,n.style.gridColumnStart=`${e+2}`,t.label){const e=document.createElement("span");e.className=CLASS_NAME_TICK_LABEL,e.textContent=t.label,n.append(e)}this._ticks.append(n)}this._element.append(this._ticks)}};onDocumentReady(EVENT_DOM_CONTENT_LOADED,()=>{for(const e of SelectorEngine.find(".form-range"))Range.getOrCreateInstance(e)});const NAME$3="scrollspy",EVENT_KEY$3=".bs.scrollspy",DATA_API_KEY=".data-api",EVENT_ACTIVATE=`activate${EVENT_KEY$3}`,EVENT_CLICK$1=`click${EVENT_KEY$3}`,EVENT_SCROLL=`scroll${EVENT_KEY$3}`,EVENT_SCROLLEND=`scrollend${EVENT_KEY$3}`,EVENT_RESIZE=`resize${EVENT_KEY$3}`,EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$3}.data-api`,CLASS_NAME_MENU_ITEM="menu-item",CLASS_NAME_ACTIVE$1="active",SELECTOR_DATA_SPY='[data-bs-spy="scroll"]',SELECTOR_TARGET_LINKS="[href]",SELECTOR_NAV_LIST_GROUP=".nav, .list-group",SELECTOR_NAV_LINKS=".nav-link",SELECTOR_LINK_ITEMS=".nav-link, .nav-item > .nav-link, .list-group-item",SELECTOR_MENU_TOGGLE$1='[data-bs-toggle="menu"]',SCROLL_IDLE_TIMEOUT=100,RESIZE_DEBOUNCE=100,Default$2={rootMargin:null,smoothScroll:!1,target:null,threshold:[0],topMargin:"12%"},DefaultType$2={rootMargin:"(string|null)",smoothScroll:"boolean",target:"element",threshold:"array",topMargin:"string"};var ScrollSpy=class extends BaseComponent{constructor(e,t){super(e,t),this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map,this._intersecting=new Set,this._activeTarget=null,this._lastActive=null,this._atBottom=!1,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._observer=null,this._sentinel=null,this._sentinelObserver=null,this._pendingNavigation=null,this._settleTimeout=null,this._settleHandler=null,this._scrollIdleHandler=null,this._resizeHandler=null,this._resizeTimeout=null,this.refresh()}static get Default(){return Default$2}static get DefaultType(){return DefaultType$2}static get NAME(){return NAME$3}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(const e of this._sections)this._observer.observe(e);this._setUpSentinel(),this._maybeAddResizeListener()}dispose(){this._observer?.disconnect(),this._teardownSentinel(),this._disarmSettle(),this._removeResizeListener(),EventHandler.off(this._config.target,EVENT_CLICK$1),super.dispose()}_configAfterMerge(e){return e.target=getElement(e.target)||document.body,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin??this._getDerivedRootMargin()};return new IntersectionObserver(e=>this._onIntersect(e),e)}_onIntersect(e){for(const t of e)t.isIntersecting?this._intersecting.add(t.target):this._intersecting.delete(t.target);this._computeActive()}_computeActive(){if(!this._element?.isConnected||0===this._sections.length)return;let e=null;if(this._atBottom)e=this._sections.at(-1);else{for(const t of this._sections)this._intersecting.has(t)&&(e=t);e||=this._lastActive??this._sections.at(0)}if(!e)return;this._lastActive=e;const t=this._linkBySection.get(e);t&&this._process(t)}_parseTopMargin(){const e=String(this._config.topMargin);return{value:Number.parseFloat(e)||0,unit:e.endsWith("%")?"%":"px"}}_getDerivedRootMargin(){const{value:e,unit:t}=this._parseTopMargin();let n=e;if("px"===t){const t=this._rootElement?this._rootElement.clientHeight:document.documentElement.clientHeight||window.innerHeight;n=t?e/t*100:12}return`0px 0px -${Math.min(Math.max(100-n,0),100)}% 0px`}_usesPixelMargin(){return!this._config.rootMargin&&"px"===this._parseTopMargin().unit}_setUpSentinel(){if(this._teardownSentinel(),0===this._sections.length)return;const e=document.createElement("div");e.setAttribute("aria-hidden","true"),e.style.cssText="position:relative;width:0;height:0;margin:0;padding:0;border:0;visibility:hidden;",this._element.append(e),this._sentinel=e,this._sentinelObserver=new IntersectionObserver(e=>this._onSentinel(e),{root:this._rootElement,threshold:[0]}),this._sentinelObserver.observe(e)}_onSentinel(e){const t=e.at(-1);this._atBottom=Boolean(t?.isIntersecting)&&this._isOverflowing(),this._computeActive()}_isOverflowing(){const e=this._rootElement||document.scrollingElement||document.documentElement;return e.scrollHeight>e.clientHeight}_teardownSentinel(){this._sentinelObserver?.disconnect(),this._sentinelObserver=null,this._sentinel?.remove(),this._sentinel=null,this._atBottom=!1}_maybeAddResizeListener(){this._removeResizeListener(),this._usesPixelMargin()&&(this._resizeHandler=()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(()=>this._rebuildObserver(),100)},EventHandler.on(window,EVENT_RESIZE,this._resizeHandler))}_removeResizeListener(){clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeHandler&&(EventHandler.off(window,EVENT_RESIZE,this._resizeHandler),this._resizeHandler=null)}_rebuildObserver(){if(this._observer){this._observer.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(const e of this._sections)this._observer.observe(e)}}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(EventHandler.off(this._config.target,EVENT_CLICK$1),EventHandler.on(this._config.target,EVENT_CLICK$1,"[href]",e=>{const t=e.target.closest("[href]"),n=t&&this._sectionByLink.get(t);if(!n||!this._element)return;e.preventDefault();const i=this._rootElement||window,s=n.offsetTop-this._element.offsetTop,o=this._rootElement?this._rootElement.scrollTop:window.scrollY??window.pageYOffset;if(matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(o-s)<=2)return i.scrollTo?i.scrollTo({top:s,behavior:"auto"}):i.scrollTop=s,void this._settleNavigation(t.hash,n);this._pendingNavigation={hash:t.hash,section:n},this._armSettle(),i.scrollTo?i.scrollTo({top:s,behavior:"smooth"}):i.scrollTop=s}))}_armSettle(){this._disarmSettle();const e=this._getSettleTarget();this._settleHandler=()=>this._onSettle(),this._scrollIdleHandler=()=>{clearTimeout(this._settleTimeout),this._settleTimeout=setTimeout(()=>this._onSettle(),100)},EventHandler.on(e,EVENT_SCROLLEND,this._settleHandler),EventHandler.on(e,EVENT_SCROLL,this._scrollIdleHandler)}_disarmSettle(){clearTimeout(this._settleTimeout),this._settleTimeout=null;const e=this._getSettleTarget();this._settleHandler&&(EventHandler.off(e,EVENT_SCROLLEND,this._settleHandler),this._settleHandler=null),this._scrollIdleHandler&&(EventHandler.off(e,EVENT_SCROLL,this._scrollIdleHandler),this._scrollIdleHandler=null)}_getSettleTarget(){return this._rootElement||document}_onSettle(){if(this._disarmSettle(),!this._pendingNavigation)return;const{hash:e,section:t}=this._pendingNavigation;this._settleNavigation(e,t)}_settleNavigation(e,t){this._pendingNavigation=null,window.history?.replaceState&&window.history.replaceState(null,"",e),t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})}_initializeTargetsAndObservables(){this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map;const e=SelectorEngine.find("[href]",this._config.target),t=new Set;for(const n of e){if(!n.hash||isDisabled(n))continue;const e=decodeFragment(n.hash.slice(1));if(!e)continue;const i=document.getElementById(e);i&&this._element.contains(i)&&isVisible(i)&&(this._sectionByLink.set(n,i),this._linkBySection.set(i,n),t.has(i)||(t.add(i),this._sections.push(i)))}this._sections.sort((e,t)=>e.getBoundingClientRect().top-t.getBoundingClientRect().top)}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add("active"),this._activateParents(e),EventHandler.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("menu-item")){const t=e.closest(".menu")?.previousElementSibling;return void(t?.matches(SELECTOR_MENU_TOGGLE$1)&&t.classList.add("active"))}for(const t of SelectorEngine.parents(e,".nav, .list-group"))for(const e of SelectorEngine.prev(t,SELECTOR_LINK_ITEMS))e.classList.add("active")}_clearActiveClass(e){e.classList.remove("active");const t=SelectorEngine.find("[href].active",e);for(const e of t)e.classList.remove("active")}};function decodeFragment(e){try{return decodeURIComponent(e)}catch{return e}}EventHandler.on(window,EVENT_LOAD_DATA_API$1,()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_SPY))ScrollSpy.getOrCreateInstance(e)});const NAME$2="tab",EVENT_KEY$2=".bs.tab",EVENT_HIDE$1="hide.bs.tab",EVENT_HIDDEN$1="hidden.bs.tab",EVENT_SHOW$1="show.bs.tab",EVENT_SHOWN$1="shown.bs.tab",EVENT_CLICK_DATA_API="click.bs.tab",EVENT_KEYDOWN="keydown.bs.tab",EVENT_LOAD_DATA_API="load.bs.tab",ARROW_LEFT_KEY="ArrowLeft",ARROW_RIGHT_KEY="ArrowRight",ARROW_UP_KEY="ArrowUp",ARROW_DOWN_KEY="ArrowDown",HOME_KEY="Home",END_KEY="End",CLASS_NAME_ACTIVE="active",CLASS_NAME_SHOW$1="show",SELECTOR_MENU_TOGGLE='[data-bs-toggle="menu"]',SELECTOR_MENU=".menu",NOT_SELECTOR_MENU_TOGGLE=`:not(${SELECTOR_MENU_TOGGLE})`,SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]',SELECTOR_OUTER=".nav-item, .list-group-item",SELECTOR_INNER=`.nav-link${NOT_SELECTOR_MENU_TOGGLE}, .list-group-item${NOT_SELECTOR_MENU_TOGGLE}, [role="tab"]${NOT_SELECTOR_MENU_TOGGLE}`,SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="tab"]',SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE$1}`,SELECTOR_DATA_TOGGLE_ACTIVE='.active[data-bs-toggle="tab"]',activationIds=new WeakMap;var Tab=class e extends BaseComponent{constructor(e){if(super(e),this._parent=this._element.closest(SELECTOR_TAB_PANEL),!this._parent)throw new TypeError(`${this._element.outerHTML} has no valid parent ${SELECTOR_TAB_PANEL}`);this._setInitialAttributes(this._parent,this._getChildren()),EventHandler.on(this._element,EVENT_KEYDOWN,e=>this._keydown(e))}static get NAME(){return"tab"}async show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?EventHandler.trigger(t,EVENT_HIDE$1,{relatedTarget:e}):null;if(EventHandler.trigger(e,EVENT_SHOW$1,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented)return;const i=(activationIds.get(this._parent)||0)+1;activationIds.set(this._parent,i),this._deactivate(t,e),await this._activate(e,t,i)}async _activate(e,t,n){if(!e)return;if(e.classList.add("active"),"tab"!==e.getAttribute("role"))return void e.classList.add("show");const i=SelectorEngine.getElementFromSelector(e);this._activate(i),await this._queueCallback(()=>{n===activationIds.get(this._parent)&&this._elemIsActive(e)&&(e.removeAttribute("tabindex"),setAriaAttribute(e,"aria-selected",!0),this._toggleMenu(e,!0),EventHandler.trigger(e,EVENT_SHOWN$1,{relatedTarget:t}))},i??e,getTransitionDurationFromElement(i)>0)}async _deactivate(e,t){e&&(e.classList.remove("active"),e.blur(),"tab"===e.getAttribute("role")?(this._deactivate(SelectorEngine.getElementFromSelector(e)),await this._queueCallback(()=>{setAriaAttribute(e,"aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleMenu(e,!1),EventHandler.trigger(e,EVENT_HIDDEN$1,{relatedTarget:t})},e,!1)):e.classList.remove("show"))}_keydown(t){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,HOME_KEY,END_KEY].includes(t.key))return;if(t.altKey||t.ctrlKey||t.metaKey)return;t.stopPropagation(),t.preventDefault();const n=this._getChildren().filter(e=>!isDisabled(e));let i;if([HOME_KEY,END_KEY].includes(t.key))i=t.key===HOME_KEY?n[0]:n.at(-1);else{const e=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(t.key);i=getNextActiveElement(n,t.target,e,!0)}i&&(i.focus({preventScroll:!0}),e.getOrCreateInstance(i).show())}_getChildren(){return SelectorEngine.find(SELECTOR_INNER_ELEM,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);setAriaAttribute(e,"aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=SelectorEngine.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleMenu(e,t){const n=this._getOuterElement(e),i=SelectorEngine.findOne(SELECTOR_MENU_TOGGLE,n);if(!i)return;const s=SelectorEngine.findOne(".menu",n);i.classList.toggle("active",t),s&&s.classList.toggle("show",t),setAriaAttribute(i,"aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains("active")}_getInnerElement(e){return e.matches(SELECTOR_INNER_ELEM)?e:SelectorEngine.findOne(SELECTOR_INNER_ELEM,e)}_getOuterElement(e){return e.closest(SELECTOR_OUTER)||e}};EventHandler.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE$1,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this)||Tab.getOrCreateInstance(this).show()}),EventHandler.on(window,"load.bs.tab",()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE))Tab.getOrCreateInstance(e)});const getTabTriggerFromPane=e=>{const t=e.getAttribute("aria-labelledby");if(t){const e=document.getElementById(t);if(e?.matches(SELECTOR_DATA_TOGGLE$1))return e}const{id:n}=e;if(!n)return null;const i=CSS.escape(n);return SelectorEngine.findOne(`${SELECTOR_DATA_TOGGLE$1}[data-bs-target="#${i}"], ${SELECTOR_DATA_TOGGLE$1}[href="#${i}"]`)};enableHashTarget(".bs.tab.data-api",{matches:e=>Boolean(getTabTriggerFromPane(e)),getAnchor:getTabTriggerFromPane,async open(e,t){const n=getTabTriggerFromPane(e);n&&(n.classList.contains("active")?t():(await Tab.getOrCreateInstance(n).show(),n.classList.contains("active")&&t()))}});const NAME$1="toast",EVENT_KEY$1=".bs.toast",EVENT_MOUSEOVER="mouseover.bs.toast",EVENT_MOUSEOUT="mouseout.bs.toast",EVENT_FOCUSIN="focusin.bs.toast",EVENT_FOCUSOUT="focusout.bs.toast",EVENT_HIDE="hide.bs.toast",EVENT_HIDDEN="hidden.bs.toast",EVENT_SHOW="show.bs.toast",EVENT_SHOWN="shown.bs.toast",CLASS_NAME_INSTANT="toast-instant",CLASS_NAME_SHOW="show",DefaultType$1={autohide:"boolean",delay:"number"},Default$1={autohide:!0,delay:5e3};var Toast=class extends BaseComponent{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Default$1}static get DefaultType(){return DefaultType$1}static get NAME(){return NAME$1}async show(){EventHandler.trigger(this._element,EVENT_SHOW).defaultPrevented||(this._clearTimeout(),this._element.classList.add("show"),await this._queueCallback(()=>{EventHandler.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide()},this._element,this._isAnimated()))}async hide(){this.isShown()&&(EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented||(this._element.classList.remove("show"),await this._queueCallback(()=>{EventHandler.trigger(this._element,EVENT_HIDDEN)},this._element,this._isAnimated())))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove("show"),super.dispose()}isShown(){return this._element.classList.contains("show")}_isAnimated(){return!this._element.classList.contains("toast-instant")}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){EventHandler.on(this._element,EVENT_MOUSEOVER,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_MOUSEOUT,e=>this._onInteraction(e,!1)),EventHandler.on(this._element,EVENT_FOCUSIN,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_FOCUSOUT,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}};enableDismissTrigger(Toast);const NAME="toggler",EVENT_KEY=".bs.toggler",EVENT_TOGGLE=`toggle${EVENT_KEY}`,EVENT_TOGGLED=`toggled${EVENT_KEY}`,EVENT_CLICK="click",SELECTOR_DATA_TOGGLE='[data-bs-toggle="toggler"]',EVENT_HANDLER_PATTERN=/^on/i,DISALLOWED_ATTRIBUTES=new Set(["action","background","data","formaction","href","id","poster","src","srcdoc","srcset","style","xlink:href"]),DefaultType={attribute:"string",value:"(string|number|boolean|null)"},Default={attribute:"class",value:null};var Toggler=class extends BaseComponent{static get Default(){return Default}static get DefaultType(){return DefaultType}static get NAME(){return NAME}toggle(){EventHandler.trigger(this._element,EVENT_TOGGLE).defaultPrevented||(this._execute(),EventHandler.trigger(this._element,EVENT_TOGGLED))}_execute(){const{attribute:e,value:t}=this._config;EVENT_HANDLER_PATTERN.test(e)||DISALLOWED_ATTRIBUTES.has(e.toLowerCase())||null!=t&&("class"!==e?this._element.getAttribute(e)!==String(t)?this._element.setAttribute(e,t):this._element.removeAttribute(e):this._element.classList.toggle(t))}};eventActionOnPlugin(Toggler,"click",SELECTOR_DATA_TOGGLE,"toggle");export{Alert,Button,Carousel,Collapse,Combobox,Datepicker,Dialog,Drawer,Menu,NavOverflow,OtpInput,Popover,Range,ScrollSpy,Strength,Tab,Toast,Toggler,Tooltip};
//# sourceMappingURL=bootstrap.bundle.min.js.map