@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 • 80.3 kB
JavaScript
/*!
* 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)
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).coreui=t(e.Popper)}(this,function(e){"use strict";function t(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const i in e)if("default"!==i){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}return t.default=e,Object.freeze(t)}const i=t(e),s=new Map,n={set(e,t,i){s.has(e)||s.set(e,new Map);const n=s.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)=>s.has(e)&&s.get(e).get(t)||null,remove(e,t){if(!s.has(e))return;const i=s.get(e);i.delete(t),0===i.size&&s.delete(e)}},o="transitionend",r=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),a=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),l=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},c=e=>{e.dispatchEvent(new Event(o))},h=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),d=e=>h(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(r(e)):null,u=e=>{if(!h(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},_=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),g=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?g(e.parentNode):null},p=()=>{},m=e=>{e.offsetHeight},f=()=>window.jQuery&&!document.body.hasAttribute("data-coreui-no-jquery")?window.jQuery:null,b=[],v=()=>"rtl"===document.documentElement.dir,y=e=>{var t;t=()=>{const t=f();if(t){const i=e.NAME,s=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=s,e.jQueryInterface)}},"loading"===document.readyState?(b.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of b)e()}),b.push(t)):t()},w=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,C=(e,t,i=!0)=>{if(!i)return void w(e);const s=(e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const s=Number.parseFloat(t),n=Number.parseFloat(i);return s||n?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0})(t)+5;let n=!1;const r=({target:i})=>{i===t&&(n=!0,t.removeEventListener(o,r),w(e))};t.addEventListener(o,r),setTimeout(()=>{n||c(t)},s)},E=(e,t,i,s)=>{const n=e.length;let o=e.indexOf(t);return-1===o?!i&&s?e[n-1]:e[0]:(o+=i?1:-1,s&&(o=(o+n)%n),e[Math.max(0,Math.min(o,n-1))])},A=/[^.]*(?=\..*)\.|.*/,T=/\..*/,k=/::\d+$/,L={};let I=1;const S={mouseenter:"mouseover",mouseleave:"mouseout"},$=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 O(e,t){return t&&`${t}::${I++}`||e.uidEvent||I++}function N(e){const t=O(e);return e.uidEvent=t,L[t]=L[t]||{},L[t]}function D(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function x(e,t,i){const s="string"==typeof t,n=s?i:t||i;let o=F(e);return $.has(o)||(o=e),[s,n,o]}function M(e,t,i,s,n){if("string"!=typeof t||!e)return;let[o,r,a]=x(t,i,s);if(t in S){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=N(e),c=l[a]||(l[a]={}),h=D(c,r,o?i:null);if(h)return void(h.oneOff=h.oneOff&&n);const d=O(r,t.replace(A,"")),u=o?function(e,t,i){return function s(n){const o=e.querySelectorAll(t);for(let{target:r}=n;r&&r!==this;r=r.parentNode)for(const a of o)if(a===r)return B(n,{delegateTarget:r}),s.oneOff&&z.off(e,n.type,t,i),i.apply(r,[n])}}(e,i,r):function(e,t){return function i(s){return B(s,{delegateTarget:e}),i.oneOff&&z.off(e,s.type,t),t.apply(e,[s])}}(e,r);u.delegationSelector=o?i:null,u.callable=r,u.oneOff=n,u.uidEvent=d,c[d]=u,e.addEventListener(a,u,o)}function P(e,t,i,s,n){const o=D(t[i],s,n);o&&(e.removeEventListener(i,o,Boolean(n)),delete t[i][o.uidEvent])}function j(e,t,i,s){const n=t[i]||{};for(const[o,r]of Object.entries(n))o.includes(s)&&P(e,t,i,r.callable,r.delegationSelector)}function F(e){return e=e.replace(T,""),S[e]||e}const z={on(e,t,i,s){M(e,t,i,s,!1)},one(e,t,i,s){M(e,t,i,s,!0)},off(e,t,i,s){if("string"!=typeof t||!e)return;const[n,o,r]=x(t,i,s),a=r!==t,l=N(e),c=l[r]||{},h=t.startsWith(".");if(void 0===o){if(h)for(const i of Object.keys(l))j(e,l,i,t.slice(1));for(const[i,s]of Object.entries(c)){const n=i.replace(k,"");a&&!t.includes(n)||P(e,l,r,s.callable,s.delegationSelector)}}else{if(!Object.keys(c).length)return;P(e,l,r,o,n?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const s=f();let n=null,o=!0,r=!0,a=!1;t!==F(t)&&s&&(n=s.Event(t,i),s(e).trigger(n),o=!n.isPropagationStopped(),r=!n.isImmediatePropagationStopped(),a=n.isDefaultPrevented());const l=B(new Event(t,{bubbles:o,cancelable:!0}),i);return a&&l.preventDefault(),r&&e.dispatchEvent(l),l.defaultPrevented&&n&&n.preventDefault(),l}};function B(e,t={}){for(const[i,s]of Object.entries(t))try{e[i]=s}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>s})}return e}function H(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 V(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const q={setDataAttribute(e,t,i){e.setAttribute(`data-coreui-${V(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-coreui-${V(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("coreui")&&!e.startsWith("coreuiConfig"));for(const s of i){let i=s.replace(/^coreui/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=H(e.dataset[s])}return t},getDataAttribute:(e,t)=>H(e.getAttribute(`data-coreui-${V(t)}`))};class R{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=h(t)?q.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...h(t)?q.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,s]of Object.entries(t)){const t=e[i],n=h(t)?"element":a(t);if(!new RegExp(s).test(n))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${n}" but expected type "${s}".`)}}}class W extends R{constructor(e,t){super(),(e=d(e))&&(this._element=e,this._config=this._getConfig(t),n.set(this._element,this.constructor.DATA_KEY,this))}dispose(){n.remove(this._element,this.constructor.DATA_KEY),z.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){C(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return n.get(d(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`coreui.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const K=e=>{let t=e.getAttribute("data-coreui-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=>r(e)).join(","):null},U={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 s=e.parentNode.closest(t);for(;s;)i.push(s),s=s.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=>!_(e)&&u(e))},getSelectorFromElement(e){const t=K(e);return t&&U.findOne(t)?t:null},getElementFromSelector(e){const t=K(e);return t?U.findOne(t):null},getMultipleElementsFromSelector(e){const t=K(e);return t?U.find(t):[]}},Q=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,s=e.NAME;z.on(document,i,`[data-coreui-dismiss="${s}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),_(this))return;const n=U.getElementFromSelector(this)||this.closest(`.${s}`);e.getOrCreateInstance(n)[t]()})},Y=".coreui.alert",X=`close${Y}`,G=`closed${Y}`;class J extends W{static get NAME(){return"alert"}close(){if(z.trigger(this._element,X).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(),z.trigger(this._element,G),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=J.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)}})}}Q(J,"close"),y(J);const Z='[data-coreui-toggle="button"]';class ee extends W{static get NAME(){return"button"}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each(function(){const t=ee.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}z.on(document,"click.coreui.button.data-api",Z,e=>{e.preventDefault();const t=e.target.closest(Z);ee.getOrCreateInstance(t).toggle()}),y(ee);const te=".coreui.swipe",ie=`touchstart${te}`,se=`touchmove${te}`,ne=`touchend${te}`,oe=`pointerdown${te}`,re=`pointerup${te}`,ae={endCallback:null,leftCallback:null,rightCallback:null},le={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class ce extends R{constructor(e,t){super(),this._element=e,e&&ce.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return ae}static get DefaultType(){return le}static get NAME(){return"swipe"}dispose(){z.off(this._element,te)}_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(),w(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&&w(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(z.on(this._element,oe,e=>this._start(e)),z.on(this._element,re,e=>this._end(e)),this._element.classList.add("pointer-event")):(z.on(this._element,ie,e=>this._start(e)),z.on(this._element,se,e=>this._move(e)),z.on(this._element,ne,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 he=".coreui.carousel",de=".data-api",ue="ArrowLeft",_e="ArrowRight",ge="next",pe="prev",me="left",fe="right",be=`slide${he}`,ve=`slid${he}`,ye=`keydown${he}`,we=`mouseenter${he}`,Ce=`mouseleave${he}`,Ee=`dragstart${he}`,Ae=`load${he}${de}`,Te=`click${he}${de}`,ke="carousel",Le="active",Ie=".active",Se=".carousel-item",$e=Ie+Se,Oe={[ue]:fe,[_e]:me},Ne={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},De={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class xe extends W{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=U.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===ke&&this.cycle()}static get Default(){return Ne}static get DefaultType(){return De}static get NAME(){return"carousel"}next(){this._slide(ge)}nextWhenVisible(){!document.hidden&&u(this._element)&&this.next()}prev(){this._slide(pe)}pause(){this._isSliding&&c(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?z.one(this._element,ve,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void z.one(this._element,ve,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const s=e>i?ge:pe;this._slide(s,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&z.on(this._element,ye,e=>this._keydown(e)),"hover"===this._config.pause&&(z.on(this._element,we,()=>this.pause()),z.on(this._element,Ce,()=>this._maybeEnableCycle())),this._config.touch&&ce.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of U.find(".carousel-item img",this._element))z.on(e,Ee,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(me)),rightCallback:()=>this._slide(this._directionToOrder(fe)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new ce(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=Oe[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=U.findOne(Ie,this._indicatorsElement);t.classList.remove(Le),t.removeAttribute("aria-current");const i=U.findOne(`[data-coreui-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(Le),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-coreui-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),s=e===ge,n=t||E(this._getItems(),i,s,this._config.wrap);if(n===i)return;const o=this._getItemIndex(n),r=t=>z.trigger(this._element,t,{relatedTarget:n,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:o});if(r(be).defaultPrevented)return;if(!i||!n)return;const a=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(o),this._activeElement=n;const l=s?"carousel-item-start":"carousel-item-end",c=s?"carousel-item-next":"carousel-item-prev";n.classList.add(c),m(n),i.classList.add(l),n.classList.add(l),this._queueCallback(()=>{n.classList.remove(l,c),n.classList.add(Le),i.classList.remove(Le,c,l),this._isSliding=!1,r(ve)},i,this._isAnimated()),a&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return U.findOne($e,this._element)}_getItems(){return U.find(Se,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return v()?e===me?pe:ge:e===me?ge:pe}_orderToDirection(e){return v()?e===pe?me:fe:e===pe?fe:me}static jQueryInterface(e){return this.each(function(){const t=xe.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)})}}z.on(document,Te,"[data-coreui-slide], [data-coreui-slide-to]",function(e){const t=U.getElementFromSelector(this);if(!t||!t.classList.contains(ke))return;e.preventDefault();const i=xe.getOrCreateInstance(t),s=this.getAttribute("data-coreui-slide-to");return s?(i.to(s),void i._maybeEnableCycle()):"next"===q.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),z.on(window,Ae,()=>{const e=U.find('[data-coreui-ride="carousel"]');for(const t of e)xe.getOrCreateInstance(t)}),y(xe);const Me=".coreui.chip",Pe=`remove${Me}`,je=`removed${Me}`,Fe=`select${Me}`,ze=`selected${Me}`,Be=`deselect${Me}`,He=`deselected${Me}`,Ve=".chip-remove",qe=".chip:not(.disabled)",Re="active",We="disabled",Ke={ariaRemoveLabel:"Remove",disabled:!1,removable:!1,removeIcon:'<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>',selectable:!1,selected:!1},Ue={ariaRemoveLabel:"string",disabled:"boolean",removable:"boolean",removeIcon:"string",selectable:"boolean",selected:"boolean"};class Qe extends W{constructor(e,t){super(e,t),this._disabled=this._config.disabled||this._element.classList.contains(We),this._selected=this._config.selected||this._element.classList.contains(Re),this._ensureRemoveButton(),this._applyState(),(this._config.selectable||this._config.removable)&&this._makeFocusable(),this._addEventListeners()}static get Default(){return Ke}static get DefaultType(){return Ue}static get NAME(){return"chip"}remove(){z.trigger(this._element,Pe).defaultPrevented||this._destroyElement()}toggle(){this._config.selectable&&(this._selected?this.deselect():this.select())}select(){this._config.selectable&&(this._selected||z.trigger(this._element,Fe).defaultPrevented||(this._selected=!0,this._applyState(),z.trigger(this._element,ze)))}deselect(){this._config.selectable&&this._selected&&(z.trigger(this._element,Be).defaultPrevented||(this._selected=!1,this._applyState(),z.trigger(this._element,He)))}_addEventListeners(){z.on(this._element,"keydown",e=>this._handleKeydown(e)),z.on(this._element,"click",e=>{this._disabled||e.target.closest(Ve)||this.toggle()}),z.on(this._element,"click",Ve,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(We),this._element.setAttribute("aria-disabled","true")):(this._element.classList.remove(We),"true"===this._element.getAttribute("aria-disabled")&&this._element.setAttribute("aria-disabled","false")),this._config.selectable?(this._element.classList.toggle(Re,this._selected),this._element.setAttribute("aria-selected",this._selected?"true":"false")):(this._element.classList.remove(Re),"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&&(U.findOne(Ve,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=U.find(qe,this._element.parentElement),i=E(t,this._element,e,!t.includes(this._element));return i===this._element?null:i}_navigateToEdge(e){const t=U.find(qe,this._element.parentElement);if(0===t.length)return;const i=t.at(e);null==i||i.focus()}_destroyElement(){z.trigger(this._element,je),this._element.remove(),this.dispose()}static chipInterface(e,t){const i=Qe.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=Qe.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)}})}}z.on(document,`DOMContentLoaded${Me}.data-api`,()=>{for(const e of U.find("[data-coreui-chip]"))Qe.chipInterface(e)}),y(Qe);const Ye=".coreui.chip-input",Xe=`add${Ye}`,Ge=`remove${Ye}`,Je=`change${Ye}`,Ze=`select${Ye}`,et=`input${Ye}`,tt=".chip",it=`${tt}.active`,st=".chip-remove",nt="disabled",ot={chipClassName:null,createOnBlur:!0,disabled:!1,id:null,maxChips:null,name:null,placeholder:"",readonly:!1,removable:!0,removeIcon:'<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>',selectable:!1,separator:","},rt={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 at extends W{constructor(e,t){var i;super(e,t),this._uniqueId=null!=(i=this._config.id)?i:l(`${this.constructor.NAME}`),this._disabled=this._config.disabled||this._element.classList.contains(nt),this._readonly=this._config.readonly,this._chips=[],this._input=U.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 ot}static get DefaultType(){return rt}static get NAME(){return"chip-input"}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(z.trigger(this._element,Xe,{value:t,relatedTarget:this._input}).defaultPrevented)return null;const i=this._createChip(t);this._element.insertBefore(i,this._input),this._chips.push(t);const s=this.getValues();return this._hiddenInput.value=s.join(","),z.trigger(this._element,Je,{values:s}),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(z.trigger(this._element,Ge,{value:i,chip:t,relatedTarget:this._input}).defaultPrevented)return!1;const s=Qe.getInstance(t);return s?s.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=U.find(tt,this._element);for(const t of e)this.remove(t)}clearSelection(){for(const t of this._getSelectedChipElements()){var e;null==(e=Qe.getInstance(t))||e.deselect()}z.trigger(this._element,Ze,{selected:[]})}selectChip(e){if(!this._getChipElements().includes(e))return;const t=Qe.getInstance(e);t&&t.select()}focus(){var e;null==(e=this._input)||e.focus()}_emitSelectionChange(){z.trigger(this._element,Ze,{selected:this.getSelectedValues()})}_getChipElements(){return U.find(tt,this._element)}_getSelectedChipElements(){return U.find(it,this._element)}_createInput(){const e=document.createElement("input"),t=U.findOne(".chip-input-label",this._element),i=null==t?void 0:t.getAttribute("for"),s=i||l(`${this.constructor.NAME}-input`);e.type="text",e.className="chip-input-field",e.id=s,this._config.placeholder&&(e.placeholder=this._config.placeholder),t&&!i&&t.setAttribute("for",s),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.coreuiChipValue=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.coreuiChipValue)return e.dataset.coreuiChipValue;const i=e.cloneNode(!0),s=U.findOne(st,i);return s&&s.remove(),(null==(t=i.textContent)?void 0:t.trim())||""}_initializeExistingChips(){const e=U.find(tt,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){Qe.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=U.findOne(st,e);t&&(t.disabled=this._disabled||this._readonly)}_applyInteractionState(){this._element.classList.toggle(nt,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(){z.on(this._element,"keydown",e=>{e.target!==this._input&&1===e.key.length&&this._input.focus()}),z.on(this._input,"keydown",e=>this._handleInputKeydown(e)),z.on(this._input,"input",e=>this._handleInput(e)),z.on(this._input,"paste",e=>this._handlePaste(e)),z.on(this._input,"focus",()=>this.clearSelection()),this._config.createOnBlur&&z.on(this._input,"blur",e=>{var t;null!=(t=e.relatedTarget)&&t.closest(tt)||this._createChipFromInput()}),z.on(this._element,"selected.coreui.chip",tt,()=>{this._emitSelectionChange()}),z.on(this._element,"deselected.coreui.chip",tt,()=>{this._emitSelectionChange()}),z.on(this._element,"remove.coreui.chip",tt,e=>{(this._disabled||this._readonly)&&e.preventDefault()}),z.on(this._element,"removed.coreui.chip",tt,e=>{const t=e.target.closest(tt);var i;t&&(this._handleChipRemoved(t),U.find(".chip:not(.disabled)",this._element).length>0&&(null==(i=this._input)||i.focus()),this._emitSelectionChange())}),z.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),s=this._chips.indexOf(i);-1!==s&&this._chips.splice(s,1);const n=this.getValues();this._hiddenInput.value=n.join(","),z.trigger(this._element,Je,{values:n})}_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(),z.trigger(this._element,et,{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 s=i.split(t);for(const e of s)this.add(e.trim())}}_setInputSize(){this._input&&(this._input.size=Math.max(this._input.placeholder.length,this._input.value.length)||1)}}z.on(document,`DOMContentLoaded${Ye}.data-api`,()=>{for(const e of U.find("[data-coreui-chip-input]"))at.getOrCreateInstance(e)});const lt=".coreui.collapse",ct=`show${lt}`,ht=`shown${lt}`,dt=`hide${lt}`,ut=`hidden${lt}`,_t=`click${lt}.data-api`,gt="show",pt="collapse",mt="collapsing",ft=`:scope .${pt} .${pt}`,bt='[data-coreui-toggle="collapse"]',vt={parent:null,toggle:!0},yt={parent:"(null|element)",toggle:"boolean"};class wt extends W{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=U.find(bt);for(const e of i){const t=U.getSelectorFromElement(e),i=U.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 vt}static get DefaultType(){return yt}static get NAME(){return"collapse"}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter(e=>e!==this._element).map(e=>wt.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(z.trigger(this._element,ct).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(pt),this._element.classList.add(mt),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(mt),this._element.classList.add(pt,gt),this._element.style[t]="",z.trigger(this._element,ht)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(z.trigger(this._element,dt).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,m(this._element),this._element.classList.add(mt),this._element.classList.remove(pt,gt);for(const e of this._triggerArray){const t=U.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(mt),this._element.classList.add(pt),z.trigger(this._element,ut)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(gt)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=d(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(bt);for(const t of e){const e=U.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=U.find(ft,this._config.parent);return U.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=wt.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}z.on(document,_t,bt,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of U.getMultipleElementsFromSelector(this))wt.getOrCreateInstance(e,{toggle:!1}).toggle()}),y(wt);const Ct="dropdown",Et=".coreui.dropdown",At=".data-api",Tt="ArrowUp",kt="ArrowDown",Lt=`hide${Et}`,It=`hidden${Et}`,St=`show${Et}`,$t=`shown${Et}`,Ot=`click${Et}${At}`,Nt=`keydown${Et}${At}`,Dt=`keyup${Et}${At}`,xt="show",Mt='[data-coreui-toggle="dropdown"]:not(.disabled):not(:disabled)',Pt=`${Mt}.${xt}`,jt=".dropdown-menu",Ft=v()?"top-end":"top-start",zt=v()?"top-start":"top-end",Bt=v()?"bottom-end":"bottom-start",Ht=v()?"bottom-start":"bottom-end",Vt=v()?"left-start":"right-start",qt=v()?"right-start":"left-start",Rt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},Wt={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class Kt extends W{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=U.next(this._element,jt)[0]||U.prev(this._element,jt)[0]||U.findOne(jt,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return Rt}static get DefaultType(){return Wt}static get NAME(){return Ct}toggle(){return this._isShown()?this.hide():this.show()}show(){if(_(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!z.trigger(this._element,St,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))z.on(e,"mouseover",p);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(xt),this._element.classList.add(xt),z.trigger(this._element,$t,e)}}hide(){if(_(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(!z.trigger(this._element,Lt,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))z.off(e,"mouseover",p);this._popper&&this._popper.destroy(),this._menu.classList.remove(xt),this._element.classList.remove(xt),this._element.setAttribute("aria-expanded","false"),q.removeDataAttribute(this._menu,"popper"),z.trigger(this._element,It,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!h(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Ct.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===i)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:h(this._config.reference)?e=d(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=i.createPopper(e,this._menu,t)}_isShown(){return this._menu.classList.contains(xt)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return Vt;if(e.classList.contains("dropstart"))return qt;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";const t="end"===getComputedStyle(this._menu).getPropertyValue("--cui-position").trim();return e.classList.contains("dropup")?t?zt:Ft:t?Ht:Bt}_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)&&(q.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...w(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=U.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>u(e));i.length&&E(i,t,e===kt,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=Kt.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=U.find(Pt);for(const i of t){const t=Kt.getInstance(i);if(!t||!1===t._config.autoClose)continue;const s=e.composedPath(),n=s.includes(t._menu);if(s.includes(t._element)||"inside"===t._config.autoClose&&!n||"outside"===t._config.autoClose&&n)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,s=[Tt,kt].includes(e.key);if(!s&&!i)return;if(t&&!i)return;e.preventDefault();const n=this.matches(Mt)?this:U.prev(this,Mt)[0]||U.next(this,Mt)[0]||U.findOne(Mt,e.delegateTarget.parentNode),o=Kt.getOrCreateInstance(n);if(s)return e.stopPropagation(),o.show(),void o._selectMenuItem(e);o._isShown()&&(e.stopPropagation(),o.hide(),n.focus())}}z.on(document,Nt,Mt,Kt.dataApiKeydownHandler),z.on(document,Nt,jt,Kt.dataApiKeydownHandler),z.on(document,Ot,Kt.clearMenus),z.on(document,Dt,Kt.clearMenus),z.on(document,Ot,Mt,function(e){e.preventDefault(),Kt.getOrCreateInstance(this).toggle()}),y(Kt);const Ut="backdrop",Qt="show",Yt=`mousedown.coreui.${Ut}`,Xt={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Gt={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Jt extends R{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Xt}static get DefaultType(){return Gt}static get NAME(){return Ut}show(e){if(!this._config.isVisible)return void w(e);this._append();const t=this._getElement();this._config.isAnimated&&m(t),t.classList.add(Qt),this._emulateAnimation(()=>{w(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(Qt),this._emulateAnimation(()=>{this.dispose(),w(e)})):w(e)}dispose(){this._isAppended&&(z.off(this._element,Yt),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=d(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),z.on(e,Yt,()=>{w(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){C(e,this._getElement(),this._config.isAnimated)}}const Zt=".coreui.focustrap",ei=`focusin${Zt}`,ti=`keydown.tab${Zt}`,ii="backward",si={autofocus:!0,trapElement:null},ni={autofocus:"boolean",trapElement:"element"};class oi extends R{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return si}static get DefaultType(){return ni}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),z.off(document,Zt),z.on(document,ei,e=>this._handleFocusin(e)),z.on(document,ti,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,z.off(document,Zt))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const i=U.focusableChildren(t);0===i.length?t.focus():this._lastTabNavDirection===ii?i[i.length-1].focus():i[0].focus()}_handleKeydown(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?ii:"forward")}}const ri=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",ai=".sticky-top",li="padding-right",ci="margin-right";class hi{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,li,t=>t+e),this._setElementAttributes(ri,li,t=>t+e),this._setElementAttributes(ai,ci,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,li),this._resetElementAttributes(ri,li),this._resetElementAttributes(ai,ci)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const s=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+s)return;this._saveInitialAttribute(e,t);const n=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(n))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&q.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=q.getDataAttribute(e,t);null!==i?(q.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(h(e))t(e);else for(const i of U.find(e,this._element))t(i)}}const di=".coreui.modal",ui=`hide${di}`,_i=`hidePrevented${di}`,gi=`hidden${di}`,pi=`show${di}`,mi=`shown${di}`,fi=`resize${di}`,bi=`click.dismiss${di}`,vi=`mousedown.dismiss${di}`,yi=`keydown.dismiss${di}`,wi=`click${di}.data-api`,Ci="modal-open",Ei="show",Ai="modal-static",Ti={backdrop:!0,focus:!0,keyboard:!0},ki={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Li extends W{constructor(e,t){super(e,t),this._dialog=U.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new hi,this._addEventListeners()}static get Default(){return Ti}static get DefaultType(){return ki}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||z.trigger(this._element,pi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ci),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(z.trigger(this._element,ui).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ei),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){z.off(window,di),z.off(this._dialog,di),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Jt({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new oi({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=U.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),m(this._element),this._element.classList.add(Ei),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,z.trigger(this._element,mi,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){z.on(this._element,yi,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),z.on(window,fi,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),z.on(this._element,vi,e=>{z.one(this._element,bi,t=>{this._element===e.target&&this._element===t.target&&("static"!==this._config.backdrop?this._config.backdrop&&this.hide():this._triggerBackdropTransition())})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(Ci),this._resetAdjustments(),this._scrollBar.reset(),z.trigger(this._element,gi)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(z.trigger(this._element,_i).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Ai)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Ai),this._queueCallback(()=>{this._element.classList.remove(Ai),this._queueCallback(()=>{this._element.style.overflowY=t},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),i=t>0;if(i&&!e){const e=v()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=v()?"paddingRight":"paddingLeft";this._element.style[e]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const i=Li.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}z.on(document,wi,'[data-coreui-toggle="modal"]',function(e){const t=U.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),z.one(t,pi,e=>{e.defaultPrevented||z.one(t,gi,()=>{u(this)&&this.focus()})});const i=U.findOne(".modal.show");i&&Li.getInstance(i).hide(),Li.getOrCreateInstance(t).toggle(this)}),Q(Li),y(Li);const Ii="coreui.navigation",Si=`.${Ii}`,$i=".data-api",Oi={activeLinksExact:!0,groupsAutoCollapse:!0},Ni={activeLinksExact:"boolean",groupsAutoCollapse:"(string|boolean)"},Di="active",xi="show",Mi="nav-group-toggle",Pi=`click${Si}${$i}`,ji=`load${Si}${$i}`,Fi=".nav-group",zi=".nav-group-items",Bi=".nav-group-toggle";class Hi extends W{constructor(e,t){super(e),this._config=this._getConfig(t),this._setActiveLink(),this._addEventListeners(),n.set(e,Ii,this)}static get Default(){return Oi}static get DATA_KEY(){return Ii}static get DefaultType(){return Ni}static get NAME(){return"navigation"}_setActiveLink(){for(const e of Array.from(this._element.querySelectorAll(".nav-link"))){if(e.classList.contains(Mi))continue;let t=String(window.location);const i=/\?./,s=/#./;(/\?.*=/.test(t)||i.test(t))&&(t=t.split("?")[0]),s.test(t)&&(t=t.split("#")[0]),this._config.activeLinksExact&&e.href===t&&(e.classList.add(Di),Array.from(this._getParents(e,Fi)).forEach(e=>{e.classList.add(xi),e.setAttribute("aria-expanded",!0)})),!this._config.activeLinksExact&&t.startsWith(e.href)&&(e.classList.add(Di),Array.from(this._getParents(e,Fi)).forEach(e=>{e.classList.add(xi),e.setAttribute("aria-expanded",!0)}))}}_getParents(e,t){const i=[];for(;e&&e!==document;e=e.parentNode)t?e.matches(t)&&i.push(e):i.push(e);return i}_getAllSiblings(e,t){const i=[];e=e.parentNode.firstChild;do{3!==e.nodeType&&8!==e.nodeType&&(t&&!t(e)||i.push(e))}while(e=e.nextSibling);return i}_getChildren(e,t){const i=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&i.push(e);return i}_getSiblings(e,t){return this._getChildren(e.parentNode.firstChild,e).filter(