UNPKG

@coreui/coreui

Version:

The most popular front-end framework for developing responsive, mobile-first projects on the web rewritten and maintained by the CoreUI Team

6 lines 97 kB
/*! * CoreUI v5.6.1 (https://coreui.io) * Copyright 2026 The CoreUI Team (https://github.com/orgs/coreui/people) * Licensed under MIT (https://github.com/coreui/coreui/blob/main/LICENSE) */ import*as Popper from"@popperjs/core";const elementMap=new Map,Data={set(e,t,i){elementMap.has(e)||elementMap.set(e,new Map);const n=elementMap.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>elementMap.has(e)&&elementMap.get(e).get(t)||null,remove(e,t){if(!elementMap.has(e))return;const i=elementMap.get(e);i.delete(t),0===i.size&&elementMap.delete(e)}},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:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),s=Number.parseFloat(i);return n||s?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END))},isElement=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),getElement=e=>isElement(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(parseSelector(e)):null,isVisible=e=>{if(!isElement(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},isDisabled=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),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=()=>{},reflow=e=>{e.offsetHeight},getjQuery=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,DOMContentLoadedCallbacks=[],onDOMContentLoaded=e=>{"loading"===document.readyState?(DOMContentLoadedCallbacks.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of DOMContentLoadedCallbacks)e()}),DOMContentLoadedCallbacks.push(e)):e()},isRTL=()=>"rtl"===document.documentElement.dir,defineJQueryPlugin=e=>{onDOMContentLoaded(()=>{const t=getjQuery();if(t){const i=e.NAME,n=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=n,e.jQueryInterface)}})},execute=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,executeAfterTransition=(e,t,i=!0)=>{if(!i)return void execute(e);const n=getTransitionDurationFromElement(t)+5;let s=!1;const o=({target:i})=>{i===t&&(s=!0,t.removeEventListener(TRANSITION_END,o),execute(e))};t.addEventListener(TRANSITION_END,o),setTimeout(()=>{s||triggerTransitionEnd(t)},n)},getNextActiveElement=(e,t,i,n)=>{const s=e.length;let o=e.indexOf(t);return-1===o?!i&&n?e[s-1]:e[0]:(o+=i?1:-1,n&&(o=(o+s)%s),e[Math.max(0,Math.min(o,s-1))])},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","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function 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 bootstrapHandler(e,t){return function i(n){return hydrateObj(n,{delegateTarget:e}),i.oneOff&&EventHandler.off(e,n.type,t),t.apply(e,[n])}}function bootstrapDelegationHandler(e,t,i){return function n(s){const o=e.querySelectorAll(t);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return hydrateObj(s,{delegateTarget:r}),n.oneOff&&EventHandler.off(e,s.type,t,i),i.apply(r,[s])}}function findHandler(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function normalizeParameters(e,t,i){const n="string"==typeof t,s=n?i:t||i;let o=getTypeEvent(e);return nativeEvents.has(o)||(o=e),[n,s,o]}function addHandler(e,t,i,n,s){if("string"!=typeof t||!e)return;let[o,r,a]=normalizeParameters(t,i,n);if(t in customEvents){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=getElementEvents(e),c=l[a]||(l[a]={}),_=findHandler(c,r,o?i:null);if(_)return void(_.oneOff=_.oneOff&&s);const h=makeEventUid(r,t.replace(namespaceRegex,"")),E=o?bootstrapDelegationHandler(e,i,r):bootstrapHandler(e,r);E.delegationSelector=o?i:null,E.callable=r,E.oneOff=s,E.uidEvent=h,c[h]=E,e.addEventListener(a,E,o)}function removeHandler(e,t,i,n,s){const o=findHandler(t[i],n,s);o&&(e.removeEventListener(i,o,Boolean(s)),delete t[i][o.uidEvent])}function removeNamespacedHandlers(e,t,i,n){const s=t[i]||{};for(const[o,r]of Object.entries(s))o.includes(n)&&removeHandler(e,t,i,r.callable,r.delegationSelector)}function getTypeEvent(e){return e=e.replace(stripNameRegex,""),customEvents[e]||e}const EventHandler={on(e,t,i,n){addHandler(e,t,i,n,!1)},one(e,t,i,n){addHandler(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,o,r]=normalizeParameters(t,i,n),a=r!==t,l=getElementEvents(e),c=l[r]||{},_=t.startsWith(".");if(void 0===o){if(_)for(const i of Object.keys(l))removeNamespacedHandlers(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(stripUidRegex,"");a&&!t.includes(s)||removeHandler(e,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;removeHandler(e,l,r,o,s?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=getjQuery();let s=null,o=!0,r=!0,a=!1;t!==getTypeEvent(t)&&n&&(s=n.Event(t,i),n(e).trigger(s),o=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),a=s.isDefaultPrevented());const l=hydrateObj(new Event(t,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function hydrateObj(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}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(t){return e}}function normalizeDataKey(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Manipulator={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${normalizeDataKey(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${normalizeDataKey(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=normalizeData(e.dataset[n])}return t},getDataAttribute:(e,t)=>normalizeData(e.getAttribute(`data-bs-${normalizeDataKey(t)}`))};class Config{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 i=isElement(t)?Manipulator.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...isElement(t)?Manipulator.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],s=isElement(t)?"element":toType(t);if(!new RegExp(n).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${n}".`)}}}const VERSION="5.6.1";class BaseComponent extends Config{constructor(e,t){super(),(e=getElement(e))&&(this._element=e,this._config=this._getConfig(t),Data.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Data.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,i=!0){executeAfterTransition(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Data.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"5.6.1"}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 i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map(e=>parseSelector(e)).join(","):null},SelectorEngine={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter(e=>e.matches(t)),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(e=>`${e}:not([tabindex^="-"])`).join(",");return this.find(t,e).filter(e=>!isDisabled(e)&&isVisible(e))},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 i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;EventHandler.on(document,i,`[data-bs-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),isDisabled(this))return;const s=SelectorEngine.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()})},NAME$j="alert",DATA_KEY$e="bs.alert",EVENT_KEY$f=".bs.alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert",CLASS_NAME_FADE$5="fade",CLASS_NAME_SHOW$a="show";class Alert extends BaseComponent{static get NAME(){return NAME$j}close(){if(EventHandler.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback(()=>this._destroyElement(),this._element,e)}_destroyElement(){this._element.remove(),EventHandler.trigger(this._element,EVENT_CLOSED),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Alert.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}enableDismissTrigger(Alert,"close"),defineJQueryPlugin(Alert);const NAME$i="button",DATA_KEY$d="bs.button",EVENT_KEY$e=`.${DATA_KEY$d}`,DATA_API_KEY$a=".data-api",CLASS_NAME_ACTIVE$5="active",SELECTOR_DATA_TOGGLE$6='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$8=`click${EVENT_KEY$e}.data-api`;class Button extends BaseComponent{static get NAME(){return NAME$i}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=Button.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}EventHandler.on(document,EVENT_CLICK_DATA_API$8,SELECTOR_DATA_TOGGLE$6,e=>{e.preventDefault();const t=e.target.closest(SELECTOR_DATA_TOGGLE$6);Button.getOrCreateInstance(t).toggle()}),defineJQueryPlugin(Button);const NAME$h="swipe",EVENT_KEY$d=".bs.swipe",EVENT_TOUCHSTART="touchstart.bs.swipe",EVENT_TOUCHMOVE="touchmove.bs.swipe",EVENT_TOUCHEND="touchend.bs.swipe",EVENT_POINTERDOWN="pointerdown.bs.swipe",EVENT_POINTERUP="pointerup.bs.swipe",POINTER_TYPE_TOUCH="touch",POINTER_TYPE_PEN="pen",CLASS_NAME_POINTER_EVENT="pointer-event",SWIPE_THRESHOLD=40,Default$g={endCallback:null,leftCallback:null,rightCallback:null},DefaultType$g={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Swipe extends Config{constructor(e,t){super(),this._element=e,e&&Swipe.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Default$g}static get DefaultType(){return DefaultType$g}static get NAME(){return NAME$h}dispose(){EventHandler.off(this._element,".bs.swipe")}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),execute(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&execute(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(EventHandler.on(this._element,EVENT_POINTERDOWN,e=>this._start(e)),EventHandler.on(this._element,EVENT_POINTERUP,e=>this._end(e)),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)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const NAME$g="carousel",DATA_KEY$c="bs.carousel",EVENT_KEY$c=`.${DATA_KEY$c}`,DATA_API_KEY$9=".data-api",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",TOUCHEVENT_COMPAT_WAIT=500,ORDER_NEXT="next",ORDER_PREV="prev",DIRECTION_LEFT="left",DIRECTION_RIGHT="right",EVENT_SLIDE=`slide${EVENT_KEY$c}`,EVENT_SLID=`slid${EVENT_KEY$c}`,EVENT_KEYDOWN$1=`keydown${EVENT_KEY$c}`,EVENT_MOUSEENTER$1=`mouseenter${EVENT_KEY$c}`,EVENT_MOUSELEAVE$1=`mouseleave${EVENT_KEY$c}`,EVENT_DRAG_START=`dragstart${EVENT_KEY$c}`,EVENT_LOAD_DATA_API$5=`load${EVENT_KEY$c}.data-api`,EVENT_CLICK_DATA_API$7=`click${EVENT_KEY$c}.data-api`,CLASS_NAME_CAROUSEL="carousel",CLASS_NAME_ACTIVE$4="active",CLASS_NAME_SLIDE="slide",CLASS_NAME_END="carousel-item-end",CLASS_NAME_START="carousel-item-start",CLASS_NAME_NEXT="carousel-item-next",CLASS_NAME_PREV="carousel-item-prev",SELECTOR_ACTIVE=".active",SELECTOR_ITEM=".carousel-item",SELECTOR_ACTIVE_ITEM=".active.carousel-item",SELECTOR_ITEM_IMG=".carousel-item img",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]',KEY_TO_DIRECTION={[ARROW_LEFT_KEY$1]:"right",[ARROW_RIGHT_KEY$1]:"left"},Default$f={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},DefaultType$f={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Carousel extends BaseComponent{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element),this._addEventListeners(),"carousel"===this._config.ride&&this.cycle()}static get Default(){return Default$f}static get DefaultType(){return DefaultType$f}static get NAME(){return NAME$g}next(){this._slide("next")}nextWhenVisible(){!document.hidden&&isVisible(this._element)&&this.next()}prev(){this._slide("prev")}pause(){this._isSliding&&triggerTransitionEnd(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?EventHandler.one(this._element,EVENT_SLID,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void EventHandler.one(this._element,EVENT_SLID,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?"next":"prev";this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&EventHandler.on(this._element,EVENT_KEYDOWN$1,e=>this._keydown(e)),"hover"===this._config.pause&&(EventHandler.on(this._element,EVENT_MOUSEENTER$1,()=>this.pause()),EventHandler.on(this._element,EVENT_MOUSELEAVE$1,()=>this._maybeEnableCycle())),this._config.touch&&Swipe.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of SelectorEngine.find(SELECTOR_ITEM_IMG,this._element))EventHandler.on(e,EVENT_DRAG_START,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder("left")),rightCallback:()=>this._slide(this._directionToOrder("right")),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Swipe(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine.findOne(".active",this._indicatorsElement);t.classList.remove("active"),t.removeAttribute("aria-current");const i=SelectorEngine.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add("active"),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n="next"===e,s=t||getNextActiveElement(this._getItems(),i,n,this._config.wrap);if(s===i)return;const o=this._getItemIndex(s),r=t=>EventHandler.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:o});if(r(EVENT_SLIDE).defaultPrevented)return;if(!i||!s)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=s;const l=n?CLASS_NAME_START:CLASS_NAME_END,c=n?CLASS_NAME_NEXT:CLASS_NAME_PREV;s.classList.add(c),reflow(s),i.classList.add(l),s.classList.add(l),this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add("active"),i.classList.remove("active",c,l),this._isSliding=!1,r(EVENT_SLID)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element)}_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return isRTL()?"left"===e?"prev":"next":"left"===e?"next":"prev"}_orderToDirection(e){return isRTL()?"prev"===e?"left":"right":"prev"===e?"right":"left"}static jQueryInterface(e){return this.each(function(){const t=Carousel.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)})}}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 i=Carousel.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===Manipulator.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),EventHandler.on(window,EVENT_LOAD_DATA_API$5,()=>{const e=SelectorEngine.find(SELECTOR_DATA_RIDE);for(const t of e)Carousel.getOrCreateInstance(t)}),defineJQueryPlugin(Carousel);const NAME$f="chip",DATA_KEY$b="bs.chip",EVENT_KEY$b=".bs.chip",DATA_API_KEY$8=".data-api",EVENT_REMOVE$1="remove.bs.chip",EVENT_REMOVED="removed.bs.chip",EVENT_SELECT$1="select.bs.chip",EVENT_SELECTED="selected.bs.chip",EVENT_DESELECT="deselect.bs.chip",EVENT_DESELECTED="deselected.bs.chip",SELECTOR_CHIP_REMOVE$1=".chip-remove",SELECTOR_DATA_CHIP="[data-bs-chip]",SELECTOR_FOCUSABLE_ITEMS$1=".chip:not(.disabled)",CLASS_NAME_CHIP_CLICKABLE="chip-clickable",CLASS_NAME_CHIP_REMOVE="chip-remove",CLASS_NAME_ACTIVE$3="active",CLASS_NAME_DISABLED$1="disabled",DEFAULT_REMOVE_ICON$1='<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"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg>',Default$e={ariaRemoveLabel:"Remove",disabled:!1,removable:!1,removeIcon:DEFAULT_REMOVE_ICON$1,selectable:!1,selected:!1},DefaultType$e={ariaRemoveLabel:"string",disabled:"boolean",removable:"boolean",removeIcon:"string",selectable:"boolean",selected:"boolean"};class Chip extends BaseComponent{constructor(e,t){super(e,t),this._disabled=this._config.disabled||this._element.classList.contains("disabled"),this._selected=this._config.selected||this._element.classList.contains("active"),this._ensureRemoveButton(),this._applyState(),(this._config.selectable||this._config.removable)&&this._makeFocusable(),this._addEventListeners()}static get Default(){return Default$e}static get DefaultType(){return DefaultType$e}static get NAME(){return"chip"}remove(){EventHandler.trigger(this._element,EVENT_REMOVE$1).defaultPrevented||this._destroyElement()}toggle(){this._config.selectable&&(this._selected?this.deselect():this.select())}select(){this._config.selectable&&(this._selected||EventHandler.trigger(this._element,EVENT_SELECT$1).defaultPrevented||(this._selected=!0,this._applyState(),EventHandler.trigger(this._element,EVENT_SELECTED)))}deselect(){this._config.selectable&&this._selected&&(EventHandler.trigger(this._element,EVENT_DESELECT).defaultPrevented||(this._selected=!1,this._applyState(),EventHandler.trigger(this._element,EVENT_DESELECTED)))}_addEventListeners(){EventHandler.on(this._element,"keydown",e=>this._handleKeydown(e)),EventHandler.on(this._element,"click",e=>{this._disabled||e.target.closest(".chip-remove")||this.toggle()}),EventHandler.on(this._element,"click",".chip-remove",e=>{e.stopPropagation(),this.remove()})}_applyState(){this._disabled||!this._config.clickable&&!this._config.selectable||this._element.classList.add("chip-clickable"),this._disabled?(this._element.classList.add("disabled"),this._element.setAttribute("aria-disabled","true")):(this._element.classList.remove("disabled"),"true"===this._element.getAttribute("aria-disabled")&&this._element.setAttribute("aria-disabled","false")),this._config.selectable?(this._element.classList.toggle("active",this._selected),this._element.setAttribute("aria-selected",this._selected?"true":"false")):(this._element.classList.remove("active"),"true"===this._element.getAttribute("aria-selected")&&this._element.setAttribute("aria-selected","false"))}_createRemoveButton(){const e=document.createElement("button");return e.type="button",e.className="chip-remove",e.setAttribute("aria-label",this._config.ariaRemoveLabel),e.setAttribute("tabindex","-1"),e.innerHTML=this._config.removeIcon,e}_ensureRemoveButton(){this._config.removable&&(SelectorEngine.findOne(".chip-remove",this._element)||this._element.append(this._createRemoveButton()))}_makeFocusable(){this._element.hasAttribute("tabindex")||this._disabled||this._element.setAttribute("tabindex","0")}_handleKeydown(e){const{key:t}=e;if(!this._disabled)switch(t){case"Enter":case" ":case"Spacebar":if(!this._config.selectable)return;e.preventDefault(),this.toggle();break;case"Backspace":case"Delete":if(this._config.removable){e.preventDefault();const t=this._getFocusableSibling(!1)||this._getFocusableSibling(!0);null==t||t.focus(),this.remove()}break;case"ArrowLeft":{e.preventDefault();const t=this._getFocusableSibling(!1);null==t||t.focus();break}case"ArrowRight":{e.preventDefault();const t=this._getFocusableSibling(!0);null==t||t.focus();break}case"Home":e.preventDefault(),this._navigateToEdge(0);break;case"End":e.preventDefault(),this._navigateToEdge(-1)}}_getFocusableSibling(e){const t=SelectorEngine.find(".chip:not(.disabled)",this._element.parentElement),i=getNextActiveElement(t,this._element,e,!t.includes(this._element));return i===this._element?null:i}_navigateToEdge(e){const t=SelectorEngine.find(".chip:not(.disabled)",this._element.parentElement);if(0===t.length)return;const i=t.at(e);null==i||i.focus()}_destroyElement(){EventHandler.trigger(this._element,EVENT_REMOVED),this._element.remove(),this.dispose()}static chipInterface(e,t){const i=Chip.getOrCreateInstance(e,t);if("string"==typeof t){if(void 0===i[t])throw new TypeError(`No method named "${t}"`);i[t]()}}static jQueryInterface(e){return this.each(function(){const t=Chip.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}EventHandler.on(document,"DOMContentLoaded.bs.chip.data-api",()=>{for(const e of SelectorEngine.find("[data-bs-chip]"))Chip.chipInterface(e)}),defineJQueryPlugin(Chip);const NAME$e="chip-input",DATA_KEY$a="bs.chip-input",EVENT_KEY$a=`.${DATA_KEY$a}`,DATA_API_KEY$7=".data-api",EVENT_ADD=`add${EVENT_KEY$a}`,EVENT_REMOVE=`remove${EVENT_KEY$a}`,EVENT_CHANGE=`change${EVENT_KEY$a}`,EVENT_SELECT=`select${EVENT_KEY$a}`,EVENT_INPUT=`input${EVENT_KEY$a}`,SELECTOR_DATA_CHIP_INPUT="[data-bs-chip-input]",SELECTOR_CHIP=".chip",SELECTOR_CHIP_ACTIVE=".chip.active",SELECTOR_CHIP_INPUT_LABEL=".chip-input-label",SELECTOR_CHIP_REMOVE=".chip-remove",SELECTOR_FOCUSABLE_ITEMS=".chip:not(.disabled)",CLASS_NAME_CHIP="chip",CLASS_NAME_DISABLED="disabled",CLASS_NAME_CHIP_INPUT_FIELD="chip-input-field",DEFAULT_REMOVE_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"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg>',Default$d={chipClassName:null,createOnBlur:!0,disabled:!1,id:null,maxChips:null,name:null,placeholder:"",readonly:!1,removable:!0,removeIcon:DEFAULT_REMOVE_ICON,selectable:!1,separator:","},DefaultType$d={chipClassName:"(string|function|null)",createOnBlur:"boolean",disabled:"boolean",maxChips:"(number|null)",id:"(string|null)",name:"(string|null)",placeholder:"string",readonly:"boolean",removable:"boolean",removeIcon:"string",selectable:"boolean",separator:"(string|null)"};class ChipInput extends BaseComponent{constructor(e,t){var i;super(e,t),this._uniqueId=null!=(i=this._config.id)?i:getUID(`${this.constructor.NAME}`),this._disabled=this._config.disabled||this._element.classList.contains("disabled"),this._readonly=this._config.readonly,this._chips=[],this._input=SelectorEngine.findOne("input",this._element),this._hiddenInput=null,this._input?this._setInputSize():this._createInput(),this._applyInteractionState(),this._initializeExistingChips(),this._createHiddenInput(),this._addEventListeners()}static get Default(){return Default$d}static get DefaultType(){return DefaultType$d}static get NAME(){return NAME$e}add(e){if(this._disabled||this._readonly)return null;const t=String(e).trim();if(!t)return null;if(this._chips.includes(t))return null;if(null!==this._config.maxChips&&this._chips.length>=this._config.maxChips)return null;if(EventHandler.trigger(this._element,EVENT_ADD,{value:t,relatedTarget:this._input}).defaultPrevented)return null;const i=this._createChip(t);this._element.insertBefore(i,this._input),this._chips.push(t);const n=this.getValues();return this._hiddenInput.value=n.join(","),EventHandler.trigger(this._element,EVENT_CHANGE,{values:n}),i}remove(e){if(this._disabled||this._readonly)return!1;let t,i;if("string"==typeof e?(i=e,t=this._findChipByValue(i)):(t=e,i=this._getChipValue(t)),!t||!i)return!1;if(EventHandler.trigger(this._element,EVENT_REMOVE,{value:i,chip:t,relatedTarget:this._input}).defaultPrevented)return!1;const n=Chip.getInstance(t);return n?n.remove():(t.remove(),this._handleChipRemoved(t,i)),!t.isConnected}removeSelected(){var e;const t=this._getSelectedChipElements();for(const e of t)this.remove(e);null==(e=this._input)||e.focus()}getValues(){return[...this._chips]}getSelectedValues(){return this._getSelectedChipElements().map(e=>this._getChipValue(e))}clear(){const e=SelectorEngine.find(".chip",this._element);for(const t of e)this.remove(t)}clearSelection(){for(const t of this._getSelectedChipElements()){var e;null==(e=Chip.getInstance(t))||e.deselect()}EventHandler.trigger(this._element,EVENT_SELECT,{selected:[]})}selectChip(e){if(!this._getChipElements().includes(e))return;const t=Chip.getInstance(e);t&&t.select()}focus(){var e;null==(e=this._input)||e.focus()}_emitSelectionChange(){EventHandler.trigger(this._element,EVENT_SELECT,{selected:this.getSelectedValues()})}_getChipElements(){return SelectorEngine.find(".chip",this._element)}_getSelectedChipElements(){return SelectorEngine.find(".chip.active",this._element)}_createInput(){const e=document.createElement("input"),t=SelectorEngine.findOne(".chip-input-label",this._element),i=null==t?void 0:t.getAttribute("for"),n=i||getUID(`${this.constructor.NAME}-input`);e.type="text",e.className="chip-input-field",e.id=n,this._config.placeholder&&(e.placeholder=this._config.placeholder),t&&!i&&t.setAttribute("for",n),this._input=e,this._setInputSize(),this._element.append(e)}_createHiddenInput(){const e=document.createElement("input");e.type="hidden",e.id=this._uniqueId,e.name=this._config.name||this._uniqueId,this._element.append(e),this._hiddenInput=e,this._hiddenInput.value=this.getValues().join(",")}_createChip(e){const t=document.createElement("span");return t.className="chip",t.dataset.bsChipValue=e,t.append(document.createTextNode(e)),this._applyChipClassName(t,e),this._setupChip(t),t}_createChipFromInput(){if(this._disabled||this._readonly)return;const e=this._input.value.trim();e&&(this.add(e),this._input.value="",this._setInputSize())}_findChipByValue(e){return this._getChipElements().find(t=>this._getChipValue(t)===e)}_getChipValue(e){var t;if(e.dataset.bsChipValue)return e.dataset.bsChipValue;const i=e.cloneNode(!0),n=SelectorEngine.findOne(".chip-remove",i);return n&&n.remove(),(null==(t=i.textContent)?void 0:t.trim())||""}_initializeExistingChips(){const e=SelectorEngine.find(".chip",this._element);for(const t of e){const e=this._getChipValue(t);e&&(this._chips.push(e),this._applyChipClassName(t,e),this._setupChip(t))}}_applyChipClassName(e,t){const i=this._resolveChipClassName(t);i&&e.classList.add(...i.split(/\s+/).filter(Boolean))}_resolveChipClassName(e){const{chipClassName:t}=this._config;if(!t)return"";if("function"==typeof t){const i=t(e);return"string"==typeof i?i:""}return"string"==typeof t?t:""}_setupChip(e){Chip.getOrCreateInstance(e,{ariaRemoveLabel:`Remove ${this._getChipValue(e)}`,disabled:this._disabled,removable:this._config.removable&&!this._readonly&&!this._disabled,removeIcon:this._config.removeIcon,selectable:this._config.selectable});const t=SelectorEngine.findOne(".chip-remove",e);t&&(t.disabled=this._disabled||this._readonly)}_applyInteractionState(){this._element.classList.toggle("disabled",this._disabled),this._input.disabled=this._disabled,this._input.readOnly=!this._disabled&&this._readonly,this._element.setAttribute("aria-disabled",this._disabled?"true":"false"),this._element.setAttribute("aria-readonly",this._readonly?"true":"false")}_addEventListeners(){EventHandler.on(this._element,"keydown",e=>{e.target!==this._input&&1===e.key.length&&this._input.focus()}),EventHandler.on(this._input,"keydown",e=>this._handleInputKeydown(e)),EventHandler.on(this._input,"input",e=>this._handleInput(e)),EventHandler.on(this._input,"paste",e=>this._handlePaste(e)),EventHandler.on(this._input,"focus",()=>this.clearSelection()),this._config.createOnBlur&&EventHandler.on(this._input,"blur",e=>{var t;null!=(t=e.relatedTarget)&&t.closest(".chip")||this._createChipFromInput()}),EventHandler.on(this._element,"selected.bs.chip",".chip",()=>{this._emitSelectionChange()}),EventHandler.on(this._element,"deselected.bs.chip",".chip",()=>{this._emitSelectionChange()}),EventHandler.on(this._element,"remove.bs.chip",".chip",e=>{(this._disabled||this._readonly)&&e.preventDefault()}),EventHandler.on(this._element,"removed.bs.chip",".chip",e=>{const t=e.target.closest(".chip");var i;t&&(this._handleChipRemoved(t),SelectorEngine.find(".chip:not(.disabled)",this._element).length>0&&(null==(i=this._input)||i.focus()),this._emitSelectionChange())}),EventHandler.on(this._element,"click",e=>{var t;e.target===this._element&&(null==(t=this._input)||t.focus())})}_handleInputKeydown(e){const{key:t}=e;switch(t){case"Enter":e.preventDefault(),this._createChipFromInput();break;case"Backspace":case"Delete":if(""===this._input.value){e.preventDefault();const t=this._getChipElements();t.length>0&&t.at(-1).focus()}break;case"ArrowLeft":if(0===this._input.selectionStart&&0===this._input.selectionEnd){e.preventDefault();const t=this._getChipElements();t.length>0&&t.at(-1).focus()}break;case"Escape":this._input.value="",this._input.blur()}}_handleChipRemoved(e,t=null){const i=t||this._getChipValue(e),n=this._chips.indexOf(i);-1!==n&&this._chips.splice(n,1);const s=this.getValues();this._hiddenInput.value=s.join(","),EventHandler.trigger(this._element,EVENT_CHANGE,{values:s})}_handleInput(e){if(this._disabled||this._readonly)return;const{value:t}=e.target,{separator:i}=this._config;if(i&&t.includes(i)){const e=t.split(i);for(const t of e.slice(0,-1))this.add(t.trim());this._input.value=e.at(-1)}this._setInputSize(),EventHandler.trigger(this._element,EVENT_INPUT,{value:this._input.value,relatedTarget:this._input})}_handlePaste(e){if(this._disabled||this._readonly)return;const{separator:t}=this._config;if(!t)return;const i=(e.clipboardData||window.clipboardData).getData("text");if(i.includes(t)){e.preventDefault();const n=i.split(t);for(const e of n)this.add(e.trim())}}_setInputSize(){this._input&&(this._input.size=Math.max(this._input.placeholder.length,this._input.value.length)||1)}}EventHandler.on(document,`DOMContentLoaded${EVENT_KEY$a}.data-api`,()=>{for(const e of SelectorEngine.find("[data-bs-chip-input]"))ChipInput.getOrCreateInstance(e)});const NAME$d="collapse",DATA_KEY$9="bs.collapse",EVENT_KEY$9=`.${DATA_KEY$9}`,DATA_API_KEY$6=".data-api",EVENT_SHOW$7=`show${EVENT_KEY$9}`,EVENT_SHOWN$7=`shown${EVENT_KEY$9}`,EVENT_HIDE$7=`hide${EVENT_KEY$9}`,EVENT_HIDDEN$7=`hidden${EVENT_KEY$9}`,EVENT_CLICK_DATA_API$6=`click${EVENT_KEY$9}.data-api`,CLASS_NAME_SHOW$9="show",CLASS_NAME_COLLAPSE="collapse",CLASS_NAME_COLLAPSING="collapsing",CLASS_NAME_COLLAPSED="collapsed",CLASS_NAME_DEEPER_CHILDREN=":scope .collapse .collapse",CLASS_NAME_HORIZONTAL="collapse-horizontal",WIDTH="width",HEIGHT="height",SELECTOR_ACTIVES=".collapse.show, .collapse.collapsing",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="collapse"]',Default$c={parent:null,toggle:!0},DefaultType$c={parent:"(null|element)",toggle:"boolean"};class Collapse extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=SelectorEngine.find(SELECTOR_DATA_TOGGLE$5);for(const e of i){const t=SelectorEngine.getSelectorFromElement(e),i=SelectorEngine.find(t).filter(e=>e===this._element);null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Default$c}static get DefaultType(){return DefaultType$c}static get NAME(){return NAME$d}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(e=>e!==this._element).map(e=>Collapse.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(EventHandler.trigger(this._element,EVENT_SHOW$7).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[t]="",EventHandler.trigger(this._element,EVENT_SHOWN$7)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(EventHandler.trigger(this._element,EVENT_HIDE$7).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,reflow(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");for(const e of this._triggerArray){const t=SelectorEngine.getElementFromSelector(e);t&&!this._isShown(t)&&this._addAriaAndCollapsedClass([e],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),EventHandler.trigger(this._element,EVENT_HIDDEN$7)},this._element,!0)}_isShown(e=this._element){return e.classList.contains("show")}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=getElement(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?WIDTH:HEIGHT}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$5);for(const t of e){const e=SelectorEngine.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([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))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const i of e)i.classList.toggle("collapsed",!t),i.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const i=Collapse.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}EventHandler.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_DATA_TOGGLE$5,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:!1}).toggle()}),defineJQueryPlugin(Collapse);const NAME$c="dropdown",DATA_KEY$8="bs.dropdown",EVENT_KEY$8=`.${DATA_KEY$8}`,DATA_API_KEY$5=".data-api",ESCAPE_KEY$2="Escape",TAB_KEY$1="Tab",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",RIGHT_MOUSE_BUTTON=2,EVENT_HIDE$6=`hide${EVENT_KEY$8}`,EVENT_HIDDEN$6=`hidden${EVENT_KEY$8}`,EVENT_SHOW$6=`show${EVENT_KEY$8}`,EVENT_SHOWN$6=`shown${EVENT_KEY$8}`,EVENT_CLICK_DATA_API$5=`click${EVENT_KEY$8}.data-api`,EVENT_KEYDOWN_DATA_API=`keydown${EVENT_KEY$8}.data-api`,EVENT_KEYUP_DATA_API=`keyup${EVENT_KEY$8}.data-api`,CLASS_NAME_SHOW$8="show",CLASS_NAME_DROPUP="dropup",CLASS_NAME_DROPEND="dropend",CLASS_NAME_DROPSTART="dropstart",CLASS_NAME_DROPUP_CENTER="dropup-center",CLASS_NAME_DROPDOWN_CENTER="dropdown-center",SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',SELECTOR_DATA_TOGGLE_SHOWN=`${SELECTOR_DATA_TOGGLE$4}.show`,SELECTOR_MENU=".dropdown-menu",SELECTOR_NAVBAR=".navbar",SELECTOR_NAVBAR_NAV=".navbar-nav",SELECTOR_VISIBLE_ITEMS=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",PLACEMENT_TOP=isRTL()?"top-end":"top-start",PLACEMENT_TOPEND=isRTL()?"top-start":"top-end",PLACEMENT_BOTTOM=isRTL()?"bottom-end":"bottom-start",PLACEMENT_BOTTOMEND=isRTL()?"bottom-start":"bottom-end",PLACEMENT_RIGHT=isRTL()?"left-start":"right-start",PLACEMENT_LEFT=isRTL()?"right-start":"left-start",PLACEMENT_TOPCENTER="top",PLACEMENT_BOTTOMCENTER="bottom",Default$b={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},DefaultType$b={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Dropdown extends BaseComponent{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=SelectorEngine.next(this._element,SELECTOR_MENU)[0]||SelectorEngine.prev(this._element,SELECTOR_MENU)[0]||SelectorEngine.findOne(SELECTOR_MENU,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Default$b}static get DefaultType(){return DefaultType$b}static get NAME(){return NAME$c}toggle(){return this._isShown()?this.hide():this.show()}show(){if(isDisabled(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!EventHandler.trigger(this._element,EVENT_SHOW$6,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))EventHandler.on(e,"mouseover",noop);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add("show"),this._element.classList.add("show"),EventHandler.trigger(this._element,EVENT_SHOWN$6,e)}}hide(){if(isDisabled(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!EventHandler.trigger(this._element,EVENT_HIDE$6,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))EventHandler.off(e,"mouseover",noop);this._popper&&this._popper.destroy(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),Manipulator.removeDataAttribute(this._menu,"popper"),EventHandler.trigger(this._element,EVENT_HIDDEN$6,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!isElement(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${NAME$c.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Popper)throw new TypeError("CoreUI's dropdowns require Popper (https://popper.js.org/docs/v2/)");let e=this._element;"parent"===this._config.reference?e=this._parent:isElement(this._config.reference)?e=getElement(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Popper.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains("show")}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return PLACEMENT_RIGHT;if(e.classList.contains("dropstart"))return PLACEMENT_LEFT;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?PLACEMENT_TOPEND:PLACEMENT_TOP:t?PLACEMENT_BOTTOMEND:PLACEMENT_BOTTOM}_detectNavbar(){return null!==this._element.closest(".navbar")}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(Manipulator.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...execute(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(e=>isVisible(e));i.length&&getNextActiveElement(i,t,e===ARROW_DOWN_KEY$1,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Dropdown.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=SelectorEngine.find(SELECTOR_DATA_TOGGLE_SHOWN);for(const i of t){const t=Dropdown.getInstance(i);if(!t||!1===t._config.autoClose)continue;const n=e.composedPath(),s=n.includes(t._menu);if(n.includes(t._element)||"inside"===t._config.autoClose&&!s||"outside"===t._config.autoClose&&s)continue;if(t._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const o={relatedTarget:t._element};"click"===e.type&&(o.clickEvent=e),t._completeHide(o)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[ARROW_UP_KEY$1,ARROW_DOWN_KEY$1].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const s=this.matches(SELECTOR_DATA_TOGGLE$4)?this:SelectorEngine.prev(this,SELECTOR_DATA_TOGGLE$4)[0]||SelectorEngine.next(this,SELECTOR_DATA_TOGGLE$4)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$4,e.delegateTarget.parentNode),o=Dropdown.getOrCreateInstance(s);if(n)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),s.focus())}}EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$4,Dropdown.dataApiKeydownHandler),EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_MENU,Dropdown.dataApiKeydownHandler),EventHandler.on(document,EVENT_CLICK_DATA_API$5,Dropdown.clearMenus),EventHandler.on(document,EVENT_KEYUP_DATA_API,Dropdown.clearMenus),EventHandler.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_TOGGLE$4,function(e){e.preventDefault(),Dropdown.getOrCreateInstance(this).toggle()}),defineJQueryPlugin(Dropdown);const NAME$b="backdrop",CLASS_NAME_FADE$4="fade",CLASS_NAME_SHOW$7="show",EVENT_MOUSEDOWN=`mousedown.bs.${NAME$b}`,Default$a={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},DefaultType$a={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Backdrop extends Config{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Default$a}static get DefaultType(){return DefaultType$a}static get NAME(){return NAME$b}show(e){if(!this._config.isVisible)return void execute(e);this._append();const t=this._getElement();this._config.isAnimated&&reflow(t),t.classList.add("show"),this._emulateAnimation(()=>{execute(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove("show"),this._emulateAnimation(()=>{this.dispose(),execute(e)})):execute(e)}dispose(){this._isAppended&&(EventHandler.off(this._element,EVENT_MOUSEDOWN),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=getElement(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),EventHandler.on(e,EVENT_MOUSEDOWN,()=>{execute(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){executeAfterTransition(e,this._getElement(),this._config.isAnimated)}}const NAME$a="focustrap",DATA_KEY$7="bs.focustrap",EVENT_KEY$7=`.${DATA_KEY$7}`,EVENT_FOCUSIN$2=`focusin${EVENT_KEY$7}`,EVENT_KEYDOWN_TAB=`keydown.tab${EVENT_KEY$7}`,TAB_KEY="Tab",TAB_NAV_FORWARD="forward",TAB_NAV_BACKWARD="backward"