/home/moonrcjl/template.moontelict.com/testorest/assets/js/coreui.bundle.min.js
/*!
* CoreUI v5.19.0 (https://coreui.io)
* Copyright 2025 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():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).coreui=t()}(this,function(){"use strict";const e=new Map,t={set(t,i,n){e.has(t)||e.set(t,new Map);const s=e.get(t);s.has(i)||0===s.size?s.set(i,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(s.keys())[0]}.`)},get:(t,i)=>e.has(t)&&e.get(t).get(i)||null,remove(t,i){if(!e.has(t))return;const n=e.get(t);n.delete(i),0===n.size&&e.delete(t)}},i="transitionend",n=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),s=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),a=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},o=e=>{e.dispatchEvent(new Event(i))},r=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),l=e=>r(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(n(e)):null,c=e=>{if(!r(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},h=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),d=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?d(e.parentNode):null},u=()=>{},_=e=>{e.offsetHeight},p=()=>window.jQuery&&!document.body.hasAttribute("data-coreui-no-jquery")?window.jQuery:null,f=[],g=()=>"rtl"===document.documentElement.dir,m=e=>{var t;t=()=>{const t=p();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)}},"loading"===document.readyState?(f.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of f)e()}),f.push(t)):t()},b=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,v=(e,t,n=!0)=>{if(!n)return void b(e);const s=(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})(t)+5;let a=!1;const r=({target:n})=>{n===t&&(a=!0,t.removeEventListener(i,r),b(e))};t.addEventListener(i,r),setTimeout(()=>{a||o(t)},s)},y=(e,t,i,n)=>{const s=e.length;let a=e.indexOf(t);return-1===a?!i&&n?e[s-1]:e[0]:(a+=i?1:-1,n&&(a=(a+s)%s),e[Math.max(0,Math.min(a,s-1))])},w=/[^.]*(?=\..*)\.|.*/,D=/\..*/,E=/::\d+$/,k={};let L=1;const A={mouseenter:"mouseover",mouseleave:"mouseout"},T=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 C(e,t){return t&&`${t}::${L++}`||e.uidEvent||L++}function O(e){const t=C(e);return e.uidEvent=t,k[t]=k[t]||{},k[t]}function x(e,t,i=null){return Object.values(e).find(e=>e.callable===t&&e.delegationSelector===i)}function S(e,t,i){const n="string"==typeof t,s=n?i:t||i;let a=P(e);return T.has(a)||(a=e),[n,s,a]}function $(e,t,i,n,s){if("string"!=typeof t||!e)return;let[a,o,r]=S(t,i,n);if(t in A){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};o=e(o)}const l=O(e),c=l[r]||(l[r]={}),h=x(c,o,a?i:null);if(h)return void(h.oneOff=h.oneOff&&s);const d=C(o,t.replace(w,"")),u=a?function(e,t,i){return function n(s){const a=e.querySelectorAll(t);for(let{target:o}=s;o&&o!==this;o=o.parentNode)for(const r of a)if(r===o)return B(s,{delegateTarget:o}),n.oneOff&&M.off(e,s.type,t,i),i.apply(o,[s])}}(e,i,o):function(e,t){return function i(n){return B(n,{delegateTarget:e}),i.oneOff&&M.off(e,n.type,t),t.apply(e,[n])}}(e,o);u.delegationSelector=a?i:null,u.callable=o,u.oneOff=s,u.uidEvent=d,c[d]=u,e.addEventListener(r,u,a)}function I(e,t,i,n,s){const a=x(t[i],n,s);a&&(e.removeEventListener(i,a,Boolean(s)),delete t[i][a.uidEvent])}function N(e,t,i,n){const s=t[i]||{};for(const[a,o]of Object.entries(s))a.includes(n)&&I(e,t,i,o.callable,o.delegationSelector)}function P(e){return e=e.replace(D,""),A[e]||e}const M={on(e,t,i,n){$(e,t,i,n,!1)},one(e,t,i,n){$(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,a,o]=S(t,i,n),r=o!==t,l=O(e),c=l[o]||{},h=t.startsWith(".");if(void 0===a){if(h)for(const i of Object.keys(l))N(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(E,"");r&&!t.includes(s)||I(e,l,o,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;I(e,l,o,a,s?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=p();let s=null,a=!0,o=!0,r=!1;t!==P(t)&&n&&(s=n.Event(t,i),n(e).trigger(s),a=!s.isPropagationStopped(),o=!s.isImmediatePropagationStopped(),r=s.isDefaultPrevented());const l=B(new Event(t,{bubbles:a,cancelable:!0}),i);return r&&l.preventDefault(),o&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function B(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 j(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 H(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const F={setDataAttribute(e,t,i){e.setAttribute(`data-coreui-${H(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-coreui-${H(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter(e=>e.startsWith("coreui")&&!e.startsWith("coreuiConfig"));for(const n of i){let i=n.replace(/^coreui/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=j(e.dataset[n])}return t},getDataAttribute:(e,t)=>j(e.getAttribute(`data-coreui-${H(t)}`))};class z{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=r(t)?F.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...r(t)?F.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],a=r(t)?"element":s(t);if(!new RegExp(n).test(a))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${a}" but expected type "${n}".`)}}}class V extends z{constructor(e,i){super(),(e=l(e))&&(this._element=e,this._config=this._getConfig(i),t.set(this._element,this.constructor.DATA_KEY,this))}dispose(){t.remove(this._element,this.constructor.DATA_KEY),M.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){v(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return t.get(l(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.19.0"}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 R=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=>n(e)).join(","):null},W={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=>!h(e)&&c(e))},getSelectorFromElement(e){const t=R(e);return t&&W.findOne(t)?t:null},getElementFromSelector(e){const t=R(e);return t?W.findOne(t):null},getMultipleElementsFromSelector(e){const t=R(e);return t?W.find(t):[]}},q=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;M.on(document,i,`[data-coreui-dismiss="${n}"]`,function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),h(this))return;const s=W.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()})},Y=".coreui.alert",U=`close${Y}`,G=`closed${Y}`;class Q extends V{static get NAME(){return"alert"}close(){if(M.trigger(this._element,U).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(),M.trigger(this._element,G),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=Q.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(Q,"close"),m(Q);var K="top",X="bottom",J="right",Z="left",ee="auto",te=[K,X,J,Z],ie="start",ne="end",se="clippingParents",ae="viewport",oe="popper",re="reference",le=te.reduce(function(e,t){return e.concat([t+"-"+ie,t+"-"+ne])},[]),ce=[].concat(te,[ee]).reduce(function(e,t){return e.concat([t,t+"-"+ie,t+"-"+ne])},[]),he="beforeRead",de="read",ue="afterRead",_e="beforeMain",pe="main",fe="afterMain",ge="beforeWrite",me="write",be="afterWrite",ve=[he,de,ue,_e,pe,fe,ge,me,be];function ye(e){return e?(e.nodeName||"").toLowerCase():null}function we(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function De(e){return e instanceof we(e).Element||e instanceof Element}function Ee(e){return e instanceof we(e).HTMLElement||e instanceof HTMLElement}function ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof we(e).ShadowRoot||e instanceof ShadowRoot)}const Le={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach(function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},s=t.elements[e];Ee(s)&&ye(s)&&(Object.assign(s.style,i),Object.keys(n).forEach(function(e){var t=n[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)}))})},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(e){var n=t.elements[e],s=t.attributes[e]||{},a=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce(function(e,t){return e[t]="",e},{});Ee(n)&&ye(n)&&(Object.assign(n.style,a),Object.keys(s).forEach(function(e){n.removeAttribute(e)}))})}},requires:["computeStyles"]};function Ae(e){return e.split("-")[0]}var Te=Math.max,Ce=Math.min,Oe=Math.round;function xe(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Se(){return!/^((?!chrome|android).)*safari/i.test(xe())}function $e(e,t,i){void 0===t&&(t=!1),void 0===i&&(i=!1);var n=e.getBoundingClientRect(),s=1,a=1;t&&Ee(e)&&(s=e.offsetWidth>0&&Oe(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Oe(n.height)/e.offsetHeight||1);var o=(De(e)?we(e):window).visualViewport,r=!Se()&&i,l=(n.left+(r&&o?o.offsetLeft:0))/s,c=(n.top+(r&&o?o.offsetTop:0))/a,h=n.width/s,d=n.height/a;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l,x:l,y:c}}function Ie(e){var t=$e(e),i=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:n}}function Ne(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ke(i)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Pe(e){return we(e).getComputedStyle(e)}function Me(e){return["table","td","th"].indexOf(ye(e))>=0}function Be(e){return((De(e)?e.ownerDocument:e.document)||window.document).documentElement}function je(e){return"html"===ye(e)?e:e.assignedSlot||e.parentNode||(ke(e)?e.host:null)||Be(e)}function He(e){return Ee(e)&&"fixed"!==Pe(e).position?e.offsetParent:null}function Fe(e){for(var t=we(e),i=He(e);i&&Me(i)&&"static"===Pe(i).position;)i=He(i);return i&&("html"===ye(i)||"body"===ye(i)&&"static"===Pe(i).position)?t:i||function(e){var t=/firefox/i.test(xe());if(/Trident/i.test(xe())&&Ee(e)&&"fixed"===Pe(e).position)return null;var i=je(e);for(ke(i)&&(i=i.host);Ee(i)&&["html","body"].indexOf(ye(i))<0;){var n=Pe(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}function ze(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ve(e,t,i){return Te(e,Ce(t,i))}function Re(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function We(e,t){return t.reduce(function(t,i){return t[i]=e,t},{})}const qe={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,s=e.options,a=i.elements.arrow,o=i.modifiersData.popperOffsets,r=Ae(i.placement),l=ze(r),c=[Z,J].indexOf(r)>=0?"height":"width";if(a&&o){var h=function(e,t){return Re("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:We(e,te))}(s.padding,i),d=Ie(a),u="y"===l?K:Z,_="y"===l?X:J,p=i.rects.reference[c]+i.rects.reference[l]-o[l]-i.rects.popper[c],f=o[l]-i.rects.reference[l],g=Fe(a),m=g?"y"===l?g.clientHeight||0:g.clientWidth||0:0,b=p/2-f/2,v=h[u],y=m-d[c]-h[_],w=m/2-d[c]/2+b,D=Ve(v,w,y),E=l;i.modifiersData[n]=((t={})[E]=D,t.centerOffset=D-w,t)}},effect:function(e){var t=e.state,i=e.options.element,n=void 0===i?"[data-popper-arrow]":i;null!=n&&("string"!=typeof n||(n=t.elements.popper.querySelector(n)))&&Ne(t.elements.popper,n)&&(t.elements.arrow=n)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ye(e){return e.split("-")[1]}var Ue={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ge(e){var t,i=e.popper,n=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,r=e.position,l=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,d=e.isFixed,u=o.x,_=void 0===u?0:u,p=o.y,f=void 0===p?0:p,g="function"==typeof h?h({x:_,y:f}):{x:_,y:f};_=g.x,f=g.y;var m=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),v=Z,y=K,w=window;if(c){var D=Fe(i),E="clientHeight",k="clientWidth";D===we(i)&&"static"!==Pe(D=Be(i)).position&&"absolute"===r&&(E="scrollHeight",k="scrollWidth"),(s===K||(s===Z||s===J)&&a===ne)&&(y=X,f-=(d&&D===w&&w.visualViewport?w.visualViewport.height:D[E])-n.height,f*=l?1:-1),s!==Z&&(s!==K&&s!==X||a!==ne)||(v=J,_-=(d&&D===w&&w.visualViewport?w.visualViewport.width:D[k])-n.width,_*=l?1:-1)}var L,A=Object.assign({position:r},c&&Ue),T=!0===h?function(e,t){var i=e.x,n=e.y,s=t.devicePixelRatio||1;return{x:Oe(i*s)/s||0,y:Oe(n*s)/s||0}}({x:_,y:f},we(i)):{x:_,y:f};return _=T.x,f=T.y,l?Object.assign({},A,((L={})[y]=b?"0":"",L[v]=m?"0":"",L.transform=(w.devicePixelRatio||1)<=1?"translate("+_+"px, "+f+"px)":"translate3d("+_+"px, "+f+"px, 0)",L)):Object.assign({},A,((t={})[y]=b?f+"px":"",t[v]=m?_+"px":"",t.transform="",t))}const Qe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,i=e.options,n=i.gpuAcceleration,s=void 0===n||n,a=i.adaptive,o=void 0===a||a,r=i.roundOffsets,l=void 0===r||r,c={placement:Ae(t.placement),variation:Ye(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:s,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ge(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:o,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ge(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}};var Ke={passive:!0};const Xe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,n=e.options,s=n.scroll,a=void 0===s||s,o=n.resize,r=void 0===o||o,l=we(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(e){e.addEventListener("scroll",i.update,Ke)}),r&&l.addEventListener("resize",i.update,Ke),function(){a&&c.forEach(function(e){e.removeEventListener("scroll",i.update,Ke)}),r&&l.removeEventListener("resize",i.update,Ke)}},data:{}};var Je={left:"right",right:"left",bottom:"top",top:"bottom"};function Ze(e){return e.replace(/left|right|bottom|top/g,function(e){return Je[e]})}var et={start:"end",end:"start"};function tt(e){return e.replace(/start|end/g,function(e){return et[e]})}function it(e){var t=we(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nt(e){return $e(Be(e)).left+it(e).scrollLeft}function st(e){var t=Pe(e),i=t.overflow,n=t.overflowX,s=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+s+n)}function at(e){return["html","body","#document"].indexOf(ye(e))>=0?e.ownerDocument.body:Ee(e)&&st(e)?e:at(je(e))}function ot(e,t){var i;void 0===t&&(t=[]);var n=at(e),s=n===(null==(i=e.ownerDocument)?void 0:i.body),a=we(n),o=s?[a].concat(a.visualViewport||[],st(n)?n:[]):n,r=t.concat(o);return s?r:r.concat(ot(je(o)))}function rt(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function lt(e,t,i){return t===ae?rt(function(e,t){var i=we(e),n=Be(e),s=i.visualViewport,a=n.clientWidth,o=n.clientHeight,r=0,l=0;if(s){a=s.width,o=s.height;var c=Se();(c||!c&&"fixed"===t)&&(r=s.offsetLeft,l=s.offsetTop)}return{width:a,height:o,x:r+nt(e),y:l}}(e,i)):De(t)?function(e,t){var i=$e(e,!1,"fixed"===t);return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}(t,i):rt(function(e){var t,i=Be(e),n=it(e),s=null==(t=e.ownerDocument)?void 0:t.body,a=Te(i.scrollWidth,i.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),o=Te(i.scrollHeight,i.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),r=-n.scrollLeft+nt(e),l=-n.scrollTop;return"rtl"===Pe(s||i).direction&&(r+=Te(i.clientWidth,s?s.clientWidth:0)-a),{width:a,height:o,x:r,y:l}}(Be(e)))}function ct(e){var t,i=e.reference,n=e.element,s=e.placement,a=s?Ae(s):null,o=s?Ye(s):null,r=i.x+i.width/2-n.width/2,l=i.y+i.height/2-n.height/2;switch(a){case K:t={x:r,y:i.y-n.height};break;case X:t={x:r,y:i.y+i.height};break;case J:t={x:i.x+i.width,y:l};break;case Z:t={x:i.x-n.width,y:l};break;default:t={x:i.x,y:i.y}}var c=a?ze(a):null;if(null!=c){var h="y"===c?"height":"width";switch(o){case ie:t[c]=t[c]-(i[h]/2-n[h]/2);break;case ne:t[c]=t[c]+(i[h]/2-n[h]/2)}}return t}function ht(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=void 0===n?e.placement:n,a=i.strategy,o=void 0===a?e.strategy:a,r=i.boundary,l=void 0===r?se:r,c=i.rootBoundary,h=void 0===c?ae:c,d=i.elementContext,u=void 0===d?oe:d,_=i.altBoundary,p=void 0!==_&&_,f=i.padding,g=void 0===f?0:f,m=Re("number"!=typeof g?g:We(g,te)),b=u===oe?re:oe,v=e.rects.popper,y=e.elements[p?b:u],w=function(e,t,i,n){var s="clippingParents"===t?function(e){var t=ot(je(e)),i=["absolute","fixed"].indexOf(Pe(e).position)>=0&&Ee(e)?Fe(e):e;return De(i)?t.filter(function(e){return De(e)&&Ne(e,i)&&"body"!==ye(e)}):[]}(e):[].concat(t),a=[].concat(s,[i]),o=a[0],r=a.reduce(function(t,i){var s=lt(e,i,n);return t.top=Te(s.top,t.top),t.right=Ce(s.right,t.right),t.bottom=Ce(s.bottom,t.bottom),t.left=Te(s.left,t.left),t},lt(e,o,n));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}(De(y)?y:y.contextElement||Be(e.elements.popper),l,h,o),D=$e(e.elements.reference),E=ct({reference:D,element:v,placement:s}),k=rt(Object.assign({},v,E)),L=u===oe?k:D,A={top:w.top-L.top+m.top,bottom:L.bottom-w.bottom+m.bottom,left:w.left-L.left+m.left,right:L.right-w.right+m.right},T=e.modifiersData.offset;if(u===oe&&T){var C=T[s];Object.keys(A).forEach(function(e){var t=[J,X].indexOf(e)>=0?1:-1,i=[K,X].indexOf(e)>=0?"y":"x";A[e]+=C[i]*t})}return A}function dt(e,t){void 0===t&&(t={});var i=t,n=i.placement,s=i.boundary,a=i.rootBoundary,o=i.padding,r=i.flipVariations,l=i.allowedAutoPlacements,c=void 0===l?ce:l,h=Ye(n),d=h?r?le:le.filter(function(e){return Ye(e)===h}):te,u=d.filter(function(e){return c.indexOf(e)>=0});0===u.length&&(u=d);var _=u.reduce(function(t,i){return t[i]=ht(e,{placement:i,boundary:s,rootBoundary:a,padding:o})[Ae(i)],t},{});return Object.keys(_).sort(function(e,t){return _[e]-_[t]})}const ut={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0===o||o,l=i.fallbackPlacements,c=i.padding,h=i.boundary,d=i.rootBoundary,u=i.altBoundary,_=i.flipVariations,p=void 0===_||_,f=i.allowedAutoPlacements,g=t.options.placement,m=Ae(g),b=l||(m!==g&&p?function(e){if(Ae(e)===ee)return[];var t=Ze(e);return[tt(e),t,tt(t)]}(g):[Ze(g)]),v=[g].concat(b).reduce(function(e,i){return e.concat(Ae(i)===ee?dt(t,{placement:i,boundary:h,rootBoundary:d,padding:c,flipVariations:p,allowedAutoPlacements:f}):i)},[]),y=t.rects.reference,w=t.rects.popper,D=new Map,E=!0,k=v[0],L=0;L<v.length;L++){var A=v[L],T=Ae(A),C=Ye(A)===ie,O=[K,X].indexOf(T)>=0,x=O?"width":"height",S=ht(t,{placement:A,boundary:h,rootBoundary:d,altBoundary:u,padding:c}),$=O?C?J:Z:C?X:K;y[x]>w[x]&&($=Ze($));var I=Ze($),N=[];if(a&&N.push(S[T]<=0),r&&N.push(S[$]<=0,S[I]<=0),N.every(function(e){return e})){k=A,E=!1;break}D.set(A,N)}if(E)for(var P=function(e){var t=v.find(function(t){var i=D.get(t);if(i)return i.slice(0,e).every(function(e){return e})});if(t)return k=t,"break"},M=p?3:1;M>0&&"break"!==P(M);M--);t.placement!==k&&(t.modifiersData[n]._skip=!0,t.placement=k,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _t(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function pt(e){return[K,J,X,Z].some(function(t){return e[t]>=0})}const ft={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,s=t.rects.popper,a=t.modifiersData.preventOverflow,o=ht(t,{elementContext:"reference"}),r=ht(t,{altBoundary:!0}),l=_t(o,n),c=_t(r,s,a),h=pt(l),d=pt(c);t.modifiersData[i]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":d})}},gt={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,s=i.offset,a=void 0===s?[0,0]:s,o=ce.reduce(function(e,i){return e[i]=function(e,t,i){var n=Ae(e),s=[Z,K].indexOf(n)>=0?-1:1,a="function"==typeof i?i(Object.assign({},t,{placement:e})):i,o=a[0],r=a[1];return o=o||0,r=(r||0)*s,[Z,J].indexOf(n)>=0?{x:r,y:o}:{x:o,y:r}}(i,t.rects,a),e},{}),r=o[t.placement],l=r.x,c=r.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[n]=o}},mt={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=ct({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})},data:{}},bt={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,s=i.mainAxis,a=void 0===s||s,o=i.altAxis,r=void 0!==o&&o,l=i.boundary,c=i.rootBoundary,h=i.altBoundary,d=i.padding,u=i.tether,_=void 0===u||u,p=i.tetherOffset,f=void 0===p?0:p,g=ht(t,{boundary:l,rootBoundary:c,padding:d,altBoundary:h}),m=Ae(t.placement),b=Ye(t.placement),v=!b,y=ze(m),w="x"===y?"y":"x",D=t.modifiersData.popperOffsets,E=t.rects.reference,k=t.rects.popper,L="function"==typeof f?f(Object.assign({},t.rects,{placement:t.placement})):f,A="number"==typeof L?{mainAxis:L,altAxis:L}:Object.assign({mainAxis:0,altAxis:0},L),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,C={x:0,y:0};if(D){if(a){var O,x="y"===y?K:Z,S="y"===y?X:J,$="y"===y?"height":"width",I=D[y],N=I+g[x],P=I-g[S],M=_?-k[$]/2:0,B=b===ie?E[$]:k[$],j=b===ie?-k[$]:-E[$],H=t.elements.arrow,F=_&&H?Ie(H):{width:0,height:0},z=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},V=z[x],R=z[S],W=Ve(0,E[$],F[$]),q=v?E[$]/2-M-W-V-A.mainAxis:B-W-V-A.mainAxis,Y=v?-E[$]/2+M+W+R+A.mainAxis:j+W+R+A.mainAxis,U=t.elements.arrow&&Fe(t.elements.arrow),G=U?"y"===y?U.clientTop||0:U.clientLeft||0:0,Q=null!=(O=null==T?void 0:T[y])?O:0,ee=I+Y-Q,te=Ve(_?Ce(N,I+q-Q-G):N,I,_?Te(P,ee):P);D[y]=te,C[y]=te-I}if(r){var ne,se="x"===y?K:Z,ae="x"===y?X:J,oe=D[w],re="y"===w?"height":"width",le=oe+g[se],ce=oe-g[ae],he=-1!==[K,Z].indexOf(m),de=null!=(ne=null==T?void 0:T[w])?ne:0,ue=he?le:oe-E[re]-k[re]-de+A.altAxis,_e=he?oe+E[re]+k[re]-de-A.altAxis:ce,pe=_&&he?function(e,t,i){var n=Ve(e,t,i);return n>i?i:n}(ue,oe,_e):Ve(_?ue:le,oe,_?_e:ce);D[w]=pe,C[w]=pe-oe}t.modifiersData[n]=C}},requiresIfExists:["offset"]};function vt(e,t,i){void 0===i&&(i=!1);var n,s,a=Ee(t),o=Ee(t)&&function(e){var t=e.getBoundingClientRect(),i=Oe(t.width)/e.offsetWidth||1,n=Oe(t.height)/e.offsetHeight||1;return 1!==i||1!==n}(t),r=Be(t),l=$e(e,o,i),c={scrollLeft:0,scrollTop:0},h={x:0,y:0};return(a||!a&&!i)&&(("body"!==ye(t)||st(r))&&(c=(n=t)!==we(n)&&Ee(n)?{scrollLeft:(s=n).scrollLeft,scrollTop:s.scrollTop}:it(n)),Ee(t)?((h=$e(t,!0)).x+=t.clientLeft,h.y+=t.clientTop):r&&(h.x=nt(r))),{x:l.left+c.scrollLeft-h.x,y:l.top+c.scrollTop-h.y,width:l.width,height:l.height}}function yt(e){var t=new Map,i=new Set,n=[];function s(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach(function(e){if(!i.has(e)){var n=t.get(e);n&&s(n)}}),n.push(e)}return e.forEach(function(e){t.set(e.name,e)}),e.forEach(function(e){i.has(e.name)||s(e)}),n}var wt={placement:"bottom",modifiers:[],strategy:"absolute"};function Dt(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(e){return!(e&&"function"==typeof e.getBoundingClientRect)})}function Et(e){void 0===e&&(e={});var t=e,i=t.defaultModifiers,n=void 0===i?[]:i,s=t.defaultOptions,a=void 0===s?wt:s;return function(e,t,i){void 0===i&&(i=a);var s,o,r={placement:"bottom",orderedModifiers:[],options:Object.assign({},wt,a),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},l=[],c=!1,h={state:r,setOptions:function(i){var s="function"==typeof i?i(r.options):i;d(),r.options=Object.assign({},a,r.options,s),r.scrollParents={reference:De(e)?ot(e):e.contextElement?ot(e.contextElement):[],popper:ot(t)};var o,c,u=function(e){var t=yt(e);return ve.reduce(function(e,i){return e.concat(t.filter(function(e){return e.phase===i}))},[])}((o=[].concat(n,r.options.modifiers),c=o.reduce(function(e,t){var i=e[t.name];return e[t.name]=i?Object.assign({},i,t,{options:Object.assign({},i.options,t.options),data:Object.assign({},i.data,t.data)}):t,e},{}),Object.keys(c).map(function(e){return c[e]})));return r.orderedModifiers=u.filter(function(e){return e.enabled}),r.orderedModifiers.forEach(function(e){var t=e.name,i=e.options,n=void 0===i?{}:i,s=e.effect;if("function"==typeof s){var a=s({state:r,name:t,instance:h,options:n});l.push(a||function(){})}}),h.update()},forceUpdate:function(){if(!c){var e=r.elements,t=e.reference,i=e.popper;if(Dt(t,i)){r.rects={reference:vt(t,Fe(i),"fixed"===r.options.strategy),popper:Ie(i)},r.reset=!1,r.placement=r.options.placement,r.orderedModifiers.forEach(function(e){return r.modifiersData[e.name]=Object.assign({},e.data)});for(var n=0;n<r.orderedModifiers.length;n++)if(!0!==r.reset){var s=r.orderedModifiers[n],a=s.fn,o=s.options,l=void 0===o?{}:o,d=s.name;"function"==typeof a&&(r=a({state:r,options:l,name:d,instance:h})||r)}else r.reset=!1,n=-1}}},update:(s=function(){return new Promise(function(e){h.forceUpdate(),e(r)})},function(){return o||(o=new Promise(function(e){Promise.resolve().then(function(){o=void 0,e(s())})})),o}),destroy:function(){d(),c=!0}};if(!Dt(e,t))return h;function d(){l.forEach(function(e){return e()}),l=[]}return h.setOptions(i).then(function(e){!c&&i.onFirstUpdate&&i.onFirstUpdate(e)}),h}}var kt=Et(),Lt=Et({defaultModifiers:[Xe,mt,Qe,Le]}),At=Et({defaultModifiers:[Xe,mt,Qe,Le,gt,ut,bt,qe,ft]});const Tt=Object.freeze(Object.defineProperty({__proto__:null,afterMain:fe,afterRead:ue,afterWrite:be,applyStyles:Le,arrow:qe,auto:ee,basePlacements:te,beforeMain:_e,beforeRead:he,beforeWrite:ge,bottom:X,clippingParents:se,computeStyles:Qe,createPopper:At,createPopperBase:kt,createPopperLite:Lt,detectOverflow:ht,end:ne,eventListeners:Xe,flip:ut,hide:ft,left:Z,main:pe,modifierPhases:ve,offset:gt,placements:ce,popper:oe,popperGenerator:Et,popperOffsets:mt,preventOverflow:bt,read:de,reference:re,right:J,start:ie,top:K,variationPlacements:le,viewport:ae,write:me},Symbol.toStringTag,{value:"Module"})),Ct={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Ot=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),xt=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,St=(e,t)=>{const i=e.nodeName.toLowerCase();return t.includes(i)?!Ot.has(i)||Boolean(xt.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(i))};function $t(e,t,i){if(!e.length)return e;if(i&&"function"==typeof i)return i(e);const n=(new window.DOMParser).parseFromString(e,"text/html"),s=[].concat(...n.body.querySelectorAll("*"));for(const e of s){const i=e.nodeName.toLowerCase();if(!Object.keys(t).includes(i)){e.remove();continue}const n=[].concat(...e.attributes),s=[].concat(t["*"]||[],t[i]||[]);for(const t of n)St(t,s)||e.removeAttribute(t.nodeName)}return n.body.innerHTML}const It="coreui.autocomplete",Nt=`.${It}`,Pt=".data-api",Mt="ArrowUp",Bt="ArrowDown",jt="Backspace",Ht="Delete",Ft="Enter",zt="Tab",Vt=`blur${Nt}`,Rt=`changed${Nt}`,Wt=`click${Nt}`,qt=`hide${Nt}`,Yt=`hidden${Nt}`,Ut=`input${Nt}`,Gt=`keydown${Nt}`,Qt=`keyup${Nt}`,Kt=`show${Nt}`,Xt=`shown${Nt}`,Jt=`click${Nt}${Pt}`,Zt=`keyup${Nt}${Pt}`,ei=`load${Nt}${Pt}`,ti="disabled",ii="autocomplete-input",ni="autocomplete-option",si="selected",ai="show",oi=`.autocomplete:not(.disabled).${ai}`,ri=".autocomplete-option",li=".autocomplete-options-empty",ci={allowList:Ct,allowOnlyDefinedOptions:!1,ariaCleanerLabel:"Clear selection",ariaIndicatorLabel:"Toggle visibility of options menu",cleaner:!1,clearSearchOnSelect:!0,container:!1,disabled:!1,highlightOptionsOnSearch:!1,id:null,indicator:!1,invalid:!1,name:null,options:!1,optionsGroupsTemplate:null,optionsMaxHeight:"auto",optionsTemplate:null,placeholder:null,required:!1,sanitize:!0,sanitizeFn:null,search:null,searchNoResultsLabel:!1,showHints:!1,valid:!1,value:null},hi={allowList:"object",allowOnlyDefinedOptions:"boolean",ariaCleanerLabel:"string",ariaIndicatorLabel:"string",cleaner:"boolean",clearSearchOnSelect:"boolean",container:"(string|element|boolean)",disabled:"boolean",highlightOptionsOnSearch:"boolean",id:"(string|null)",indicator:"boolean",invalid:"boolean",name:"(string|null)",options:"(array|null)",optionsGroupsTemplate:"(function|null)",optionsMaxHeight:"(number|string)",optionsTemplate:"(function|null)",placeholder:"(string|null)",required:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",search:"(array|string|null)",searchNoResultsLabel:"boolean|string",showHints:"boolean",valid:"boolean",value:"(number|string|null)"};class di extends V{constructor(e,i){var n;super(e,i),this._uniqueId=null!=(n=this._config.id)?n:a(`${this.constructor.NAME}`),this._indicatorElement=null,this._inputElement=null,this._inputHintElement=null,this._togglerElement=null,this._optionsElement=null,this._menu=null,this._selected=[],this._options=this._getOptionsFromConfig(),this._popper=null,this._search="",this._createAutocomplete(),this._addEventListeners(),t.set(this._element,It,this)}static get Default(){return ci}static get DefaultType(){return hi}static get NAME(){return"autocomplete"}toggle(){return this._isShown()?this.hide():this.show()}show(){this._config.disabled||this._isShown()||(this._config.searchNoResultsLabel||0!==this._flattenOptions().filter(e=>e.label.toLowerCase().includes(this._search.toLowerCase())).length)&&(M.trigger(this._element,Kt),this._element.classList.add(ai),this._inputElement.setAttribute("aria-expanded","true"),this._config.container&&(this._menu.style.minWidth=`${this._element.offsetWidth}px`,this._menu.classList.add(ai)),M.trigger(this._element,Xt),this._createPopper())}hide(){M.trigger(this._element,qt),this._popper&&this._popper.destroy(),this._element.classList.remove(ai),this._inputElement.setAttribute("aria-expanded","false"),this._config.container&&this._menu.classList.remove(ai),this._inputHintElement&&(this._inputHintElement.value=""),M.trigger(this._element,Yt)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}clear(){this.deselectAll(),this.search(""),this._filterOptionsList(),this._inputElement.value="",M.trigger(this._element,Rt,{value:this._selected})}search(e){this._search=e.length>0?e.toLowerCase():"",this._isExternalSearch()||this._filterOptionsList(),M.trigger(this._element,Ut,{value:e})}update(e){e.value&&this.deselectAll(),this._config={...this._config,...this._configAfterMerge(e)},this._options=this._getOptionsFromConfig(),this._optionsElement.innerHTML="",this._createOptions(this._optionsElement,this._options)}deselectAll(e=this._selected){if(0!==this._selected.length)for(const t of e)t.disabled||(Array.isArray(t.options)?this.deselectAll(t.options):(this._deselectOption(t.value),this._updateCleaner()))}_flattenOptions(e=this._options,t=[]){for(const i of e)i&&Array.isArray(i.options)?this._flattenOptions(i.options,t):t.push(i);return t}_getClassNames(){return this._element.classList.value.split(" ")}_highlightOption(e){const t=new RegExp(this._search,"gi");return e.replace(t,e=>`<strong>${e}</strong>`)}_isExternalSearch(){return Array.isArray(this._config.search)&&this._config.search.includes("external")}_isGlobalSearch(){return Array.isArray(this._config.search)&&this._config.search.includes("global")}_isVisible(e){return"none"!==window.getComputedStyle(e).display}_isShown(){return this._element.classList.contains(ai)}_addEventListeners(){M.on(this._element,Wt,e=>{this._config.disabled||e.target.closest(".autocomplete-indicator")||this.show()}),M.on(this._element,Gt,e=>{if("Escape"===e.key)return this.hide(),void(this._config.allowOnlyDefinedOptions&&0===this._selected.length&&(this.search(""),this._inputElement.value=""));!this._isGlobalSearch()||1!==e.key.length&&e.key!==jt&&e.key!==Ht||this._inputElement.focus()}),M.on(this._menu,Gt,e=>{!this._isGlobalSearch()||1!==e.key.length&&e.key!==jt&&e.key!==Ht||this._inputElement.focus()}),M.on(this._togglerElement,Gt,e=>{if(!this._isShown()&&(e.key===Ft||e.key===Bt))return e.preventDefault(),void this.show();this._isShown()&&e.key===Bt&&(e.preventDefault(),this._selectMenuItem(e))}),M.on(this._indicatorElement,Wt,e=>{e.preventDefault(),this.toggle()}),M.on(this._inputElement,Vt,()=>{const e=this._flattenOptions().filter(e=>e.label.toLowerCase().startsWith(this._inputElement.value.toLowerCase()));this._config.allowOnlyDefinedOptions&&0===this._selected.length&&0===e.length&&this.clear()}),M.on(this._inputElement,Gt,e=>{if(this._isShown()||e.key===zt||this.show(),e.key!==Bt||this._inputElement.value.length!==this._inputElement.selectionStart){if(e.key===zt&&this._config.showHints&&this._inputElement.value.length>0){this._inputHintElement.value&&(e.preventDefault(),e.stopPropagation());const t=this._flattenOptions().filter(e=>e.label.toLowerCase().startsWith(this._inputElement.value.toLowerCase()));t.length>0&&this._selectOption(t[0])}if(e.key===Ft){if(e.preventDefault(),e.stopPropagation(),0===this._inputElement.value.length)return;const t=this._flattenOptions().filter(e=>e.label.toLowerCase()===this._inputElement.value.toLowerCase());t.length>0&&this._selectOption(t[0]),0!==t.length||this._config.allowOnlyDefinedOptions||(M.trigger(this._element,Rt,{value:this._inputElement.value}),this.hide(),this._config.clearSearchOnSelect&&this.search(""))}}else this._selectMenuItem(e)}),M.on(this._inputElement,Qt,e=>{if(1===e.key.length||e.key===jt||e.key===Ht){const{value:t}=e.target;if(this.search(t),this._config.showHints){const e=t?this._flattenOptions().filter(e=>e.label.toLowerCase().startsWith(t.toLowerCase())):[];this._inputHintElement.value=e.length>0?`${t}${e[0].label.slice(t.length)}`:""}this._selected.length>0&&(this.deselectAll(),M.trigger(this._element,Rt,{value:this._selected}))}}),M.on(this._optionsElement,Wt,e=>{e.preventDefault(),e.stopPropagation(),this._onOptionsClick(e.target)}),M.on(this._cleanerElement,Wt,e=>{this._config.disabled||(e.preventDefault(),e.stopPropagation(),this.clear())}),M.on(this._optionsElement,Gt,e=>{e.key===Ft&&this._onOptionsClick(e.target),[Mt,Bt].includes(e.key)&&(e.preventDefault(),this._selectMenuItem(e))})}_getOptionsFromConfig(e=this._config.options){if(!e||!Array.isArray(e))return[];const t=[];for(const n of e){var i;if(n.options&&Array.isArray(n.options)){const e={...n};delete e.label,delete e.options,t.push({...e,label:n.label,options:this._getOptionsFromConfig(n.options)});continue}const e="string"==typeof n?n:n.label,s=null!=(i=n.value)?i:"string"==typeof n?n:n.label,a=n.selected||this._config.value&&this._config.value===s,o="object"==typeof n?{...n}:{};delete o.label,delete o.value,delete o.selected,delete o.disabled,t.push({...o,label:e,value:String(s),...a&&{selected:!0},...n.disabled&&{disabled:!0}}),a&&this._selected.push({label:n.label,value:String(s)})}return t}_createAutocomplete(){this._element.classList.add("autocomplete"),this._element.classList.toggle("is-invalid",this._config.invalid),this._element.classList.toggle("is-valid",this._config.valid),this._config.disabled&&this._element.classList.add(ti);for(const e of this._getClassNames())this._element.classList.add(e);this._createInputGroup(),this._createButtons(),this._createOptionsContainer(),this._updateOptionsList()}_createInputGroup(){var e;const t=document.createElement("div");if(t.classList.add("autocomplete-input-group"),this._togglerElement=t,this._config.search||this._config.disabled||(t.tabIndex=-1),!this._config.disabled&&this._config.showHints){const e=document.createElement("input");e.classList.add(ii,"autocomplete-input-hint"),e.setAttribute("name",(this._config.name||`${this._uniqueId}-hint`).toString()),e.autocomplete="off",e.readOnly=!0,e.tabIndex=-1,e.setAttribute("aria-hidden",!0),t.append(e),this._inputHintElement=e}const i=document.createElement("input");i.classList.add(ii),i.id=this._uniqueId,i.setAttribute("name",(this._config.name||this._uniqueId).toString()),i.autocomplete="off",i.placeholder=null!=(e=this._config.placeholder)?e:"",i.role="combobox",i.setAttribute("aria-autocomplete","list"),i.setAttribute("aria-expanded","false"),i.setAttribute("aria-haspopup","listbox"),this._config.disabled&&(i.setAttribute("disabled",!0),i.tabIndex=-1),this._config.required&&i.setAttribute("required",!0),t.append(i),this._inputElement=i,this._element.append(t)}_createButtons(){if(!this._config.cleaner&&!this._config.indicator)return;const e=document.createElement("div");if(e.classList.add("autocomplete-buttons"),!this._config.disabled&&this._config.cleaner){const t=document.createElement("button");t.type="button",t.classList.add("autocomplete-cleaner"),t.style.display="none",t.setAttribute("aria-label",this._config.ariaCleanerLabel),e.append(t),this._cleanerElement=t}if(this._config.indicator){const t=document.createElement("button");t.type="button",t.classList.add("autocomplete-indicator"),t.setAttribute("aria-label",this._config.ariaIndicatorLabel),this._config.disabled&&(t.tabIndex=-1),e.append(t),this._indicatorElement=t,this._indicatorElement=t}this._togglerElement.append(e),this._updateCleaner()}_createPopper(){if(void 0===Tt)throw new TypeError("CoreUI's Auto Complete component require Popper (https://popper.js.org)");const e={modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents"}},{name:"offset",options:{offset:[0,2]}}],placement:g()?"bottom-end":"bottom-start"};this._popper=At(this._togglerElement,this._menu,e)}_createOptionsContainer(){const e=document.createElement("div");e.classList.add("autocomplete-dropdown"),e.role="listbox",e.setAttribute("aria-labelledby",this._uniqueId),e.setAttribute("id",`${this._uniqueId}-listbox`);const t=document.createElement("div");t.classList.add("autocomplete-options"),"auto"!==this._config.optionsMaxHeight&&(t.style.maxHeight=`${this._config.optionsMaxHeight}px`,t.style.overflow="auto"),e.append(t);const{container:i}=this._config;i?(this._inputElement.setAttribute("aria-owns",`${this._uniqueId}-listbox`),e.id=`${this._uniqueId}-listbox`,i.append(e)):this._element.append(e),this._createOptions(t,this._options),this._optionsElement=t,this._menu=e}_createOptions(e,t){for(const i of t){if(Array.isArray(i.options)){const t=document.createElement("div");t.classList.add("autocomplete-optgroup"),t.setAttribute("role","group");const n=document.createElement("div");this._config.optionsGroupsTemplate&&"function"==typeof this._config.optionsGroupsTemplate?n.innerHTML=this._config.sanitize?$t(this._config.optionsGroupsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsGroupsTemplate(i):n.textContent=i.label,n.classList.add("autocomplete-optgroup-label"),t.append(n),this._createOptions(t,i.options),e.append(t);continue}const t=document.createElement("div");t.classList.add(ni),i.disabled&&(t.classList.add(ti),t.setAttribute("aria-disabled","true")),t.dataset.value=i.value,t.tabIndex=0,this._isExternalSearch()&&this._config.highlightOptionsOnSearch&&this._search?t.innerHTML=this._highlightOption(i.label):this._config.optionsTemplate&&"function"==typeof this._config.optionsTemplate?t.innerHTML=this._config.sanitize?$t(this._config.optionsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsTemplate(i):t.textContent=i.label,e.append(t)}}_onOptionsClick(e){if(e.classList.contains("label"))return;if(!e.classList.contains(ni)&&!(e=e.closest(ri)))return;const{value:t}=e.dataset,i=this._findOptionByValue(t);i&&(this._selectOption(i),this._inputElement.focus())}_findOptionByValue(e,t=this._options){for(const i of t){if(i.value===e)return i;if(i.options&&Array.isArray(i.options)){const t=this._findOptionByValue(e,i.options);if(t)return t}}return null}_selectOption(e){this.deselectAll(),0===this._selected.filter(t=>t.value===e.value).length&&this._selected.push(e);const t=W.findOne(`[data-value="${e.value}"]`,this._optionsElement);t&&(t.classList.add(si),t.setAttribute("aria-selected",!0)),M.trigger(this._element,Rt,{value:e}),this._inputElement.value=e.label,this._config.showHints&&(this._inputHintElement.value=""),this.hide(),this._config.clearSearchOnSelect&&this.search(""),this._updateCleaner()}_deselectOption(e){this._selected=this._selected.filter(t=>t.value!==e);const t=W.findOne(`[data-value="${e}"]`,this._optionsElement);t&&(t.classList.remove(si),t.setAttribute("aria-selected",!1))}_updateCleaner(){this._config.cleaner&&null!==this._cleanerElement&&(this._selected.length>0?this._cleanerElement.style.removeProperty("display"):this._cleanerElement.style.display="none")}_updateOptionsList(e=this._options){for(const t of e)Array.isArray(t.options)?this._updateOptionsList(t.options):t.selected&&this._selectOption(t)}_filterOptionsList(){const e=W.find(ri,this._menu);let t=0;for(const i of e){-1===i.textContent.toLowerCase().indexOf(this._search)?i.style.display="none":(this._config.highlightOptionsOnSearch&&!this._config.optionsTemplate&&(i.innerHTML=this._highlightOption(i.textContent)),i.style.removeProperty("display"),t++);const e=i.closest(".autocomplete-optgroup");e&&(W.children(e,ri).filter(e=>this._isVisible(e)).length>0?e.style.removeProperty("display"):e.style.display="none")}if(t>0)W.findOne(li,this._menu)&&W.findOne(li,this._menu).remove();else if(0===t){if(this._config.searchNoResultsLabel){const e=document.createElement("div");return e.classList.add("autocomplete-options-empty"),e.innerHTML=this._config.searchNoResultsLabel,void(W.findOne(li,this._menu)||W.findOne(".autocomplete-options",this._menu).append(e))}this.hide()}}_selectMenuItem({key:e,target:t}){const i=W.find(".autocomplete-options .autocomplete-option:not(.disabled):not(:disabled)",this._menu).filter(e=>c(e));i.length&&y(i,t,e===Bt,!i.includes(t)).focus()}_configAfterMerge(e){return!0===e.container&&(e.container=document.body),"object"!=typeof e.container&&"string"!=typeof e.container||(e.container=l(e.container)),"string"==typeof e.options&&(e.options=e.options.split(/,\s*/).map(String)),"string"==typeof e.search&&(e.search=e.search.split(/,\s*/).map(String)),e}static autocompleteInterface(e,t){const i=di.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(){di.autocompleteInterface(this,e)})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&e.key!==zt)return;const t=W.find(oi);for(const i of t){const t=di.getInstance(i);t&&(e.composedPath().includes(t._element)||(t._element,e.type,t.hide(),t.search(""),t._config.allowOnlyDefinedOptions&&0===t._selected.length&&(t._inputElement.value="")))}}}M.on(window,ei,()=>{for(const e of W.find('[data-coreui-toggle="autocomplete"]:not(.disabled)'))di.autocompleteInterface(e)}),M.on(document,Jt,di.clearMenus),M.on(document,Zt,di.clearMenus),m(di);const ui='[data-coreui-toggle="button"]';class _i extends V{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=_i.getOrCreateInstance(this);"toggle"===e&&t[e]()})}}M.on(document,"click.coreui.button.data-api",ui,e=>{e.preventDefault();const t=e.target.closest(ui);_i.getOrCreateInstance(t).toggle()}),m(_i);let pi,fi,gi,mi,bi,vi,yi,wi=e=>e;const Di=(e,t)=>{const i=(e=>{const t=new Date(e,0,4),i=t.getDay(),n=0===i?6:i-1,s=new Date(t);return s.setDate(t.getDate()-n),s})(e),n=new Date(i);return n.setDate(i.getDate()+7*(t-1)),n},Ei=e=>12*e.getFullYear()+e.getMonth(),ki=(e,t,i)=>null!==t&&e<t||null!==i&&e>i,Li=(e,t)=>{let i=e.replaceAll(/[.*+?^${}()|[\\]\\]/g,"\\$&");return i=i.replace("2013",String.raw(fi||(fi=wi`(?<year>\d{2,4})`))).replace("12",String.raw(gi||(gi=wi`(?<month>\d{1,2})`))).replace("31",String.raw(mi||(mi=wi`(?<day>\d{1,2})`))),t&&(i=i.replaceAll(/17|5/g,String.raw(bi||(bi=wi`(?<hour>\d{1,2})`))).replace("19",String.raw(vi||(vi=wi`(?<minute>\d{1,2})`))).replace("22",String.raw(yi||(yi=wi`(?<second>\d{1,2})`))).replaceAll(/AM|PM/gi,"(?<ampm>[APap][Mm])")),i},Ai=(e,t)=>{const i=Number.parseInt(e,10)-1,n=Number.parseInt(t,10);return i>=0&&i<=11&&n>=1&&n<=31},Ti=(e,t,i)=>{const n=((e,t)=>{const i=new Date(2013,11,31,17,19,22),n=[];try{const s=t?i.toLocaleString(e):i.toLocaleDateString(e);n.push(s)}catch(e){const s=t?i.toLocaleString("en-US"):i.toLocaleDateString("en-US");n.push(s)}const s=["/","-","."," "],a=n[0];let o="/";a.includes("/")?o="/":a.includes("-")?o="-":a.includes(".")&&(o=".");for(const e of s)if(e!==o){const t=o.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw(pi||(pi=wi`\$&`))),i=a.replaceAll(new RegExp(t,"g"),e);n.push(i)}return n})(t,i),s=((e,t,i)=>{for(const n of t){const t=Li(n,i),s=new RegExp(`^${t}$`),a=e.trim().match(s);if(null!=a&&a.groups)return a.groups}return null})(e,n,i);if(!s){const t=e.trim(),i=/[-/.:]/.test(t),n=t.split(/[-/.\s:]+/).filter(e=>e.length>0).length>=2;return i&&n?Ci(e):null}if(!("month"in s)||!("day"in s))return null;{const{month:e,day:t}=s;if(!Ai(e,t))return null}return i?(e=>{const{year:t,month:i,day:n,hour:s,minute:a,second:o,ampm:r}=e,l=Vi(t),c=Number.parseInt(i,10)-1,h=Number.parseInt(n,10),d=((e,t)=>{const i=Number.parseInt(e,10);if(!t)return i;const n="pm"===t.toLowerCase();return n&&12!==i?i+12:n||12!==i?i:0})(s,r),u=Number.parseInt(null!=a?a:"0",10)||0,_=Number.parseInt(null!=o?o:"0",10)||0;return((e,t,i)=>e>=0&&e<=23&&t>=0&&t<=59&&i>=0&&i<=59)(d,u,_)?new Date(l,c,h,d,u,_):null})(s):(e=>{const{year:t,month:i,day:n}=e;if(!Ai(i,n))return null;const s=Vi(t),a=Number.parseInt(i,10)-1,o=Number.parseInt(n,10);return new Date(s,a,o)})(s)},Ci=e=>{const t=new Date(Date.parse(e));return Number.isNaN(t.getTime())?null:t},Oi=(e,t,i="en-US",n=!1)=>{if(null===e)return null;if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;const s=e;switch(t){case"week":return(e=>{const t=[/^(\d{4})-W(\d{1,2})$/,/^(\d{4})W(\d{1,2})$/,/^(\d{4})\s+W(\d{1,2})$/];for(const i of t){const t=e.trim().match(i);if(t){const e=Vi(t[1]),i=Number.parseInt(t[2],10);return Di(e,i)}}return(e=>{const[t,i]=e.split(/[Ww]/),n=Vi(t),s=Number.parseInt(i,10);return Di(n,s)})(e)})(s);case"month":return(e=>{const t=[/^(\d{2,4})[-/.\s](\d{1,2})$/,/^(\d{1,2})[-/.\s](\d{2,4})$/];for(const i of t){const t=e.trim().match(i);if(t){const e=t[1],i=t[2],n=Number.parseInt(e,10),s=Number.parseInt(i,10);let a,o;if(e.length>=3||n>=100?(a=Vi(e),o=s-1):i.length>=3||s>=100?(a=Vi(i),o=n-1):s>=1&&s<=12&&(n>12||n<1)?(a=Vi(e),o=s-1):(a=Vi(i),o=n-1),o>=0&&o<=11)return new Date(a,o,1)}}return null})(s);case"year":return(e=>{const t=String(e),i=t.trim().match(/^(\d{2,4})$/);if(i){const e={year:i[1]};return Ri(e)}return Ci(t)})(s);default:return Ti(s,i,n)}},xi=(e,t)=>{const i=Math.ceil(e.length/t);return Array.from({length:t}).fill("").map((t,n)=>e.slice(n*i,(n+1)*i))},Si=(e,t)=>{if(null===e)return null;if("week"===t){const{year:t,weekNumber:i}=$i(e);return`${t}W${i.toString().padStart(2,"0")}`}if("month"===t){const t=`0${e.getMonth()+1}`.slice(-2);return`${e.getFullYear()}-${t}`}return"year"===t?`${e.getFullYear()}`:e},$i=e=>{const t=new Date(e);t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);const i=new Date(t.getFullYear(),0,4);return{weekNumber:1+Math.round((t.getTime()-i.getTime())/6048e5),year:t.getFullYear()}},Ii=(e,t,i,n)=>{if(t&&e<t)return!0;if(i&&e>i)return!0;if(void 0===n)return!1;if("function"==typeof n)return n(e);if(n instanceof Date&&ji(e,n))return!0;if(Array.isArray(n)&&n)for(const t of n){if("function"==typeof t&&t(e))return!0;if(Array.isArray(t)&&Ni(e,t[0],t[1]))return!0;if(t instanceof Date&&ji(e,t))return!0}return!1},Ni=(e,t,i)=>{const n=Fi(e),s=t?Fi(t):null,a=i?Fi(i):null;return Boolean(s&&a&&s<=n&&n<=a)},Pi=(e,t,i)=>!(null===t||!ji(t,e))||!(null===i||!ji(i,e)),Mi=(e,t,i)=>{if(e&&t){const n=new Date(e);let s=!1;for(;n<t;)if(n.setDate(n.getDate()+1),Ii(n,null,null,i)){s=!0;break}return s}return!1},Bi=(e,t,i)=>{const n=t?Ei(t):null,s=i?Ei(i):null,a=Ei(e);return Boolean(n&&s&&n<=a&&a<=s)},ji=(e,t)=>e instanceof Date&&t instanceof Date?e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear():null===e&&null===t,Hi=(e,t,i)=>{const n=e.getFullYear(),s=t?t.getFullYear():null,a=i?i.getFullYear():null;return Boolean(s&&a&&s<=n&&n<=a)},Fi=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},zi=(e,t)=>{if(null===e)return null;if(!(t instanceof Date))return e;const i=new Date(e);return i.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),i},Vi=e=>{let t=Number.parseInt(e,10);if(t<100){const e=(new Date).getFullYear();t=100*Math.floor(e/100)+t,t>e+50&&(t-=100)}return t},Ri=e=>{const{year:t}=e,i=Vi(t);return new Date(i,0,1)},Wi=".coreui.calendar",qi=".data-api",Yi="ArrowUp",Ui="ArrowRight",Gi="ArrowDown",Qi="ArrowLeft",Ki=`blur${Wi}`,Xi=`calendarDateChange${Wi}`,Ji=`calendarMouseleave${Wi}`,Zi=`cellHover${Wi}`,en=`endDateChange${Wi}`,tn=`focus${Wi}`,nn=`keydown${Wi}`,sn=`selectEndChange${Wi}`,an=`startDateChange${Wi}`,on=`mouseenter${Wi}`,rn=`mouseleave${Wi}`,ln=`load${Wi}${qi}`,cn=`click${Wi}${qi}`,hn="calendar-cell",dn="calendar-cell-inner",un="calendar-row",_n=".btn-double-next",pn=".btn-double-prev",fn=".btn-month",gn=".btn-next",mn=".btn-prev",bn=".btn-year",vn=".calendar-cell",yn=`${vn}[tabindex="0"]`,wn=".calendar-row",Dn=`${wn}[tabindex="0"]`,En={ariaNavNextMonthLabel:"Next month",ariaNavNextYearLabel:"Next year",ariaNavPrevMonthLabel:"Previous month",ariaNavPrevYearLabel:"Previous year",calendarDate:null,calendars:1,disabledDates:null,endDate:null,firstDayOfWeek:1,locale:"default",maxDate:null,minDate:null,range:!1,selectAdjacementDays:!1,selectEndDate:!1,selectionType:"day",showAdjacementDays:!0,showWeekNumber:!1,startDate:null,weekdayFormat:2,weekNumbersLabel:null},kn={ariaNavNextMonthLabel:"string",ariaNavNextYearLabel:"string",ariaNavPrevMonthLabel:"string",ariaNavPrevYearLabel:"string",calendarDate:"(date|number|string|null)",calendars:"number",disabledDates:"(array|date|function|null)",endDate:"(date|number|string|null)",firstDayOfWeek:"number",locale:"string",maxDate:"(date|number|string|null)",minDate:"(date|number|string|null)",range:"boolean",selectAdjacementDays:"boolean",selectEndDate:"boolean",selectionType:"string",showAdjacementDays:"boolean",showWeekNumber:"boolean",startDate:"(date|number|string|null)",weekdayFormat:"(number|string)",weekNumbersLabel:"(string|null)"};class Ln extends V{constructor(e,t){super(e),this._config=this._getConfig(t),this._initializeDates(),this._initializeView(),this._createCalendar(),this._addEventListeners()}static get Default(){return En}static get DefaultType(){return kn}static get NAME(){return"calendar"}update(e){this._config=this._getConfig(e),this._initializeDates(),this._initializeView(),this._element.innerHTML="",this._createCalendar()}_focusOnFirstAvailableCell(){const e=W.findOne(yn,this._element);e&&e.focus()}_getDate(e){if("week"===this._config.selectionType){const t=W.findOne(vn,e.closest(wn));return new Date(F.getDataAttribute(t,"date"))}return new Date(F.getDataAttribute(e,"date"))}_handleCalendarClick(e){const t=e.target.classList.contains(dn)?e.target.parentElement:e.target,i=this._getDate(t),n=new Date(i),s=F.getDataAttribute(t.closest(".calendar"),"calendar-index");return"days"===this._view&&this._setCalendarDate(s?new Date(n.setMonth(n.getMonth()-s)):i),"months"===this._view&&"month"!==this._config.selectionType?(this._setCalendarDate(s?new Date(n.setMonth(n.getMonth()-s)):i),this._view="days",void this._updateCalendar(this._focusOnFirstAvailableCell.bind(this))):"years"===this._view&&"year"!==this._config.selectionType?(this._setCalendarDate(s?new Date(n.setFullYear(n.getFullYear()-s)):i),this._view="months",void this._updateCalendar(this._focusOnFirstAvailableCell.bind(this))):void(Ii(i,this._minDate,this._maxDate,this._config.disabledDates)||(this._hoverDate=null,this._selectDate(i),this._updateClassNamesAndAriaLabels()))}_handleCalendarKeydown(e){const t=this._getDate(e.target);if("Space"!==e.code&&"Enter"!==e.key||(e.preventDefault(),this._handleCalendarClick(e)),e.key===Ui||e.key===Qi||e.key===Yi||e.key===Gi){if(e.preventDefault(),this._maxDate&&t>=Oi(this._maxDate,this._config.selectionType)&&(e.key===Ui||e.key===Gi))return;if(this._minDate&&t<=Oi(this._minDate,this._config.selectionType)&&(e.key===Qi||e.key===Yi))return;let i=e.target;"week"===this._config.selectionType&&-1===i.tabIndex&&(i=i.closest(Dn));const n=W.find("week"===this._config.selectionType?Dn:yn,this._element),s=n.indexOf(i),a=0===s,o=s===n.length-1,r={start:s,end:n.length-(s+1)},l={ArrowRight:1,ArrowLeft:-1,ArrowUp:"week"===this._config.selectionType&&"days"===this._view?-1:"days"===this._view?-7:-3,ArrowDown:"week"===this._config.selectionType&&"days"===this._view?1:"days"===this._view?7:3};if(e.key===Ui&&o||e.key===Gi&&r.end<l.ArrowDown||e.key===Qi&&a||e.key===Yi&&r.start<Math.abs(l.ArrowUp)){const t=e=>{const t=W.find(`${yn}, ${Dn}`,this._element);t.length&&e===Ui&&t[0].focus(),t.length&&e===Qi&&t[t.length-1].focus(),t.length&&e===Gi&&t[l.ArrowDown-(n.length-s)].focus(),t.length&&e===Yi&&t[t.length-(Math.abs(l.ArrowUp)+1-(s+1))].focus()};return"days"===this._view&&this._modifyCalendarDate(0,e.key===Ui||e.key===Gi?1:-1,t.bind(this,e.key)),"months"===this._view&&this._modifyCalendarDate(e.key===Ui||e.key===Gi?1:-1,0,t.bind(this,e.key)),void("years"===this._view&&this._modifyCalendarDate(e.key===Ui||e.key===Gi?10:-10,0,t.bind(this,e.key)))}if(0===n[s+l[e.key]].tabIndex)return void n[s+l[e.key]].focus();for(let t=s;t<n.length;e.key===Ui||e.key===Gi?t++:t--)if(0===n[t+l[e.key]].tabIndex){n[t+l[e.key]].focus();break}}}_handleCalendarMouseEnter(e){const t=e.target.classList.contains(dn)?e.target.parentElement:e.target,i=this._getDate(t);Ii(i,this._minDate,this._maxDate,this._config.disabledDates)||(this._hoverDate=zi(i,this._selectEndDate?this._endDate:this._startDate),M.trigger(this._element,Zi,{date:Si(this._hoverDate,this._config.selectionType)}),this._updateClassNamesAndAriaLabels())}_handleCalendarMouseLeave(){this._hoverDate=null,M.trigger(this._element,Zi,{date:null}),this._updateClassNamesAndAriaLabels()}_addEventListeners(){M.on(this._element,cn,yn,e=>{this._handleCalendarClick(e)}),M.on(this._element,nn,yn,e=>{this._handleCalendarKeydown(e)}),M.on(this._element,on,yn,e=>{this._handleCalendarMouseEnter(e)}),M.on(this._element,rn,yn,()=>{this._handleCalendarMouseLeave()}),M.on(this._element,tn,yn,e=>{this._handleCalendarMouseEnter(e)}),M.on(this._element,Ki,yn,()=>{this._handleCalendarMouseLeave()}),M.on(this._element,cn,Dn,e=>{this._handleCalendarClick(e)}),M.on(this._element,nn,Dn,e=>{this._handleCalendarKeydown(e)}),M.on(this._element,on,Dn,e=>{this._handleCalendarMouseEnter(e)}),M.on(this._element,rn,Dn,()=>{this._handleCalendarMouseLeave()}),M.on(this._element,tn,Dn,e=>{this._handleCalendarMouseEnter(e)}),M.on(this._element,Ki,Dn,()=>{this._handleCalendarMouseLeave()}),this._addNavigationEventListeners(),M.on(this._element,rn,"table",()=>{M.trigger(this._element,Ji)})}_addNavigationEventListeners(){const e={[mn]:()=>this._modifyCalendarDate(0,-1),[pn]:()=>this._modifyCalendarDate("years"===this._view?-10:-1),[gn]:()=>this._modifyCalendarDate(0,1),[_n]:()=>this._modifyCalendarDate("years"===this._view?10:1),[fn]:()=>{this._view="months",this._updateCalendar()},[bn]:()=>{this._view="years",this._updateCalendar()}};for(const[t,i]of Object.entries(e))M.on(this._element,cn,t,e=>{e.preventDefault();const n=W.find(t,this._element).indexOf(e.target.closest(t));i();const s=W.find(t,this._element);s&&s[n]&&s[n].focus()})}_setCalendarDate(e){this._calendarDate=e,M.trigger(this._element,Xi,{date:e})}_modifyCalendarDate(e,t=0,i){const n=this._calendarDate.getFullYear(),s=this._calendarDate.getMonth(),a=new Date(n,s,1);e&&a.setFullYear(a.getFullYear()+e),t&&a.setMonth(a.getMonth()+t),this._calendarDate=a,"days"===this._view&&M.trigger(this._element,Xi,{date:a}),this._updateCalendar(i)}_setEndDate(e){this._endDate=zi(e,this._endDate),M.trigger(this._element,en,{date:Si(this._endDate,this._config.selectionType)})}_setStartDate(e){this._startDate=zi(e,this._startDate),M.trigger(this._element,an,{date:Si(this._startDate,this._config.selectionType)})}_setSelectEndDate(e){this._selectEndDate=e,M.trigger(this._element,sn,{value:e})}_selectDate(e){if(!Ii(e,this._minDate,this._maxDate,this._config.disabledDates))return this._config.range?this._selectEndDate?(this._setSelectEndDate(!1),this._startDate&&this._startDate>e||Mi(this._startDate,e,this._config.disabledDates)?(this._setStartDate(null),void this._setEndDate(null)):void this._setEndDate(e)):this._endDate&&this._endDate<e||Mi(e,this._endDate,this._config.disabledDates)?(this._setStartDate(null),void this._setEndDate(null)):(this._setSelectEndDate(!0),void this._setStartDate(e)):void this._setStartDate(e)}_createCalendarPanel(e){var t;const i=((e,t,i)=>0!==t&&"days"===i?new Date(e.getFullYear(),e.getMonth()+t,1):0!==t&&"months"===i?new Date(e.getFullYear()+t,e.getMonth(),1):0!==t&&"years"===i?new Date(e.getFullYear()+12*t,e.getMonth(),1):e)(this._calendarDate,e,this._view),n=i.getFullYear(),s=i.getMonth(),a=document.createElement("div");a.classList.add("calendar"),F.setDataAttribute(a,"calendar-index",e);const o=document.createElement("div");o.classList.add("calendar-nav"),o.innerHTML=`\n <div class="calendar-nav-prev">\n <button class="calendar-nav-btn btn-double-prev" aria-label="${this._config.ariaNavPrevYearLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-double-prev"></span>\n </button>\n ${"days"===this._view?`<button class="calendar-nav-btn btn-prev" aria-label="${this._config.ariaNavPrevMonthLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-prev"></span>\n </button>`:""}\n </div>\n <div class="calendar-nav-date" aria-live="polite">\n ${"days"===this._view?`<button class="calendar-nav-btn btn-sm btn-month">\n ${i.toLocaleDateString(this._config.locale,{month:"long"})}\n </button>`:""}\n <button class="calendar-nav-btn btn-year">\n ${i.toLocaleDateString(this._config.locale,{year:"numeric"})}\n </button>\n </div>\n <div class="calendar-nav-next">\n ${"days"===this._view?`<button class="calendar-nav-btn btn-next" aria-label="${this._config.ariaNavNextMonthLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-next"></span>\n </button>`:""}\n <button class="calendar-nav-btn btn-double-next" aria-label="${this._config.ariaNavNextYearLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-double-next"></span>\n </button>\n </div>\n `;const r=((e,t,i)=>{const n=((e,t,i)=>{const n=[],s=new Date(e,t),a=s.getFullYear(),o=s.getMonth();let r=6-(6-new Date(a,o,1).getDay())-i;i&&(r=r<0?7+r:r);for(let e=-1*r;e<0;e++)n.push({date:new Date(a,o,e+1),month:"previous"});return n})(e,t,i),s=((e,t)=>{const i=[],n=new Date(e,t+1,0).getDate();for(let s=1;s<=n;s++)i.push({date:new Date(e,t,s),month:"current"});return i})(e,t),a=((e,t,i,n)=>{const s=[],a=42-(i.length+n.length);for(let i=1;i<=a;i++)s.push({date:new Date(e,t+1,i),month:"next"});return s})(e,t,n,s),o=[...n,...s,...a],r=[];for(const[e,t]of o.entries()){if(e%7!=0&&0!==r.length||r.push({week:{number:0,year:0},days:[]}),(e+1)%7==0){const{weekNumber:e,year:i}=$i(t.date),n=r.at(-1);n&&(n.week={number:e,year:i})}const i=r.at(-1);i&&i.days.push(t)}return r})(n,s,this._config.firstDayOfWeek),l=xi(((e,t="short")=>Array.from({length:12},(i,n)=>new Date(2e3,n,1).toLocaleString(e,{month:t})))(this._config.locale),4),c=xi(((e,t=6)=>Array.from({length:2*t},(i,n)=>e-t+n))(i.getFullYear()),4),h=r[0].days,d=document.createElement("table");return d.innerHTML=`\n ${"days"===this._view?`\n <thead>\n <tr>\n ${this._config.showWeekNumber?`<th class="${hn}">\n <div class="calendar-header-cell-inner">\n ${null!=(t=this._config.weekNumbersLabel)?t:""}\n </div>\n </th>`:""}\n ${h.map(({date:e})=>`<th class="${hn}" abbr="${e.toLocaleDateString(this._config.locale,{weekday:"long"})}">\n <div class="calendar-header-cell-inner">\n ${"string"==typeof this._config.weekdayFormat?e.toLocaleDateString(this._config.locale,{weekday:this._config.weekdayFormat}):e.toLocaleDateString(this._config.locale,{weekday:"long"}).slice(0,this._config.weekdayFormat)}\n </div>\n </th>`).join("")}\n </tr>\n </thead>`:""}\n <tbody>\n ${"days"===this._view?r.map(({week:e,days:t})=>{const{date:i}=t[0],n=this._rowWeekAttributes(i);return`<tr \n class="${n.className}"\n tabindex="${n.tabIndex}"\n ${n.ariaSelected?'aria-selected="true"':""}\n >\n ${this._config.showWeekNumber?`<th class="calendar-cell-week-number">${e.number}</td>`:""}\n ${t.map(({date:e,month:t})=>{const i=this._cellDayAttributes(e,t);return"current"===t||this._config.showAdjacementDays?`<td \n class="${i.className}"\n tabindex="${i.tabIndex}"\n ${i.ariaSelected?'aria-selected="true"':""}\n data-coreui-date="${e}"\n >\n <div class="calendar-cell-inner day">\n ${e.toLocaleDateString(this._config.locale,{day:"numeric"})}\n </div>\n </td>`:"<td></td>"}).join("")}</tr>`}).join(""):""}\n ${"months"===this._view?l.map((e,t)=>`<tr>\n ${e.map((e,n)=>{const s=new Date(i.getFullYear(),3*t+n,1),a=this._cellMonthAttributes(s);return`<td\n class="${a.className}"\n tabindex="${a.tabIndex}"\n ${a.ariaSelected?'aria-selected="true"':""}\n data-coreui-date="${s.toDateString()}"\n >\n <div class="calendar-cell-inner month">\n ${e}\n </div>\n </td>`}).join("")}\n </tr>`).join(""):""}\n ${"years"===this._view?c.map(e=>`<tr>\n ${e.map(e=>{const t=new Date(e,0,1),i=this._cellYearAttributes(t);return`<td\n class="${i.className}"\n tabindex="${i.tabIndex}"\n ${i.ariaSelected?'aria-selected="true"':""}\n data-coreui-date="${t.toDateString()}"\n >\n <div class="calendar-cell-inner year">\n ${e}\n </div>\n </td>`}).join("")}\n </tr>`).join(""):""}\n </tbody>\n `,a.append(o,d),a}_createCalendar(){this._config.selectionType&&"days"===this._view&&this._element.classList.add(`select-${this._config.selectionType}`),this._config.showWeekNumber&&this._element.classList.add("show-week-numbers");for(const[e,t]of Array.from({length:this._config.calendars}).entries())this._element.append(this._createCalendarPanel(e));this._element.classList.add("calendars")}_initializeDates(){this._calendarDate=Oi(this._config.calendarDate||this._config.startDate||this._config.endDate,this._config.selectionType)||new Date,this._startDate=Oi(this._config.startDate,this._config.selectionType),this._endDate=Oi(this._config.endDate,this._config.selectionType),this._minDate=Oi(this._config.minDate,this._config.selectionType),this._maxDate=Oi(this._config.maxDate,this._config.selectionType),this._hoverDate=null,this._selectEndDate=this._config.selectEndDate}_initializeView(){this._view={day:"days",week:"days",month:"months",year:"years"}[this._config.selectionType]||"days"}_updateCalendar(e){this._element.innerHTML="",this._createCalendar(),e&&setTimeout(e,1)}_updateClassNamesAndAriaLabels(){if("week"===this._config.selectionType){const e=W.find(wn,this._element);for(const t of e){const e=W.findOne(vn,t),i=new Date(F.getDataAttribute(e,"date")),n=this._rowWeekAttributes(i);t.className=n.className,t.tabIndex=n.tabIndex,n.ariaSelected?t.setAttribute("aria-selected",!0):t.removeAttribute("aria-selected")}return}const e=W.find(yn,this._element);for(const t of e){const e=new Date(F.getDataAttribute(t,"date"));let i;i="days"===this._view?this._cellDayAttributes(e,"current"):"months"===this._view?this._cellMonthAttributes(e):this._cellYearAttributes(e),t.className=i.className,t.tabIndex=i.tabIndex,i.ariaSelected?t.setAttribute("aria-selected",!0):t.removeAttribute("aria-selected")}}_classNames(e){return Object.entries(e).filter(([e,t])=>Boolean(t)).map(([e])=>e).join(" ")}_cellDayAttributes(e,t){const i="current"===t,n=Ii(e,this._minDate,this._maxDate,this._config.disabledDates),s=Pi(e,this._startDate,this._endDate),a=(e=>{const t=new Date;return ji(e,t)})(e);if("day"!==this._config.selectionType||"days"!==this._view)return{className:this._classNames({[hn]:!0,today:a,[t]:!0}),tabIndex:-1,ariaSelected:!1};const o=i&&Ni(e,this._startDate,this._endDate),r=i&&this._hoverDate&&(this._selectEndDate?Ni(e,this._startDate,this._hoverDate):Ni(e,this._hoverDate,this._endDate));return{className:this._classNames({[hn]:!0,clickable:!i&&this._config.selectAdjacementDays,disabled:n,range:o,"range-hover":r,selected:s,today:a,[t]:!0}),tabIndex:!i&&!this._config.selectAdjacementDays||n?-1:0,ariaSelected:s}}_cellMonthAttributes(e){const t=((e,t,i,n)=>{const s=Ei(e),a=t?Ei(t):null,o=i?Ei(i):null;if(ki(s,a,o))return!0;if(void 0===n)return!1;const r=t?Math.max(e.getTime(),t.getTime()):e.getTime(),l=i?Math.min(e.getTime(),i.getTime()):new Date((new Date).getFullYear(),11,31).getTime();for(const e=new Date(r);e.getTime()<=l;e.setDate(e.getDate()+1))if(!Ii(e,t,i,n))return!1;return!1})(e,this._minDate,this._maxDate,this._config.disabledDates),i=((e,t,i)=>{const n=e.getFullYear(),s=e.getMonth();return null!==t&&n===t.getFullYear()&&s===t.getMonth()||null!==i&&n===i.getFullYear()&&s===i.getMonth()})(e,this._startDate,this._endDate),n=Bi(e,this._startDate,this._endDate),s="month"===this._config.selectionType&&this._hoverDate&&(this._selectEndDate?Bi(e,this._startDate,this._hoverDate):Bi(e,this._hoverDate,this._endDate));return{className:this._classNames({[hn]:!0,disabled:t,"range-hover":s,range:n,selected:i}),tabIndex:t?-1:0,ariaSelected:i}}_cellYearAttributes(e){const t=((e,t,i,n)=>{const s=e.getFullYear(),a=t?t.getFullYear():null,o=i?i.getFullYear():null;if(ki(s,a,o))return!0;if(void 0===n)return!1;const r=t?Math.max(e.getTime(),t.getTime()):e.getTime(),l=i?Math.min(e.getTime(),i.getTime()):new Date((new Date).getFullYear(),11,31).getTime();for(const e=new Date(r);e.getTime()<=l;e.setDate(e.getDate()+1))if(!Ii(e,t,i,n))return!1;return!1})(e,this._minDate,this._maxDate,this._config.disabledDates),i=((e,t,i)=>{const n=e.getFullYear();return null!==t&&n===t.getFullYear()||null!==i&&n===i.getFullYear()})(e,this._startDate,this._endDate),n=Hi(e,this._startDate,this._endDate),s="year"===this._config.selectionType&&this._hoverDate&&(this._selectEndDate?Hi(e,this._startDate,this._hoverDate):Hi(e,this._hoverDate,this._endDate));return{className:this._classNames({[hn]:!0,disabled:t,"range-hover":s,range:n,selected:i}),tabIndex:t?-1:0,ariaSelected:i}}_rowWeekAttributes(e){if("week"!==this._config.selectionType)return{className:this._classNames({[un]:!0}),tabIndex:-1,ariaSelected:!1};const t=Ii(e,this._minDate,this._maxDate,this._config.disabledDates),i=Pi(e,this._startDate,this._endDate),n=Ni(e,this._startDate,this._endDate),s=this._hoverDate&&(this._selectEndDate?Hi(e,this._startDate,this._hoverDate):Hi(e,this._hoverDate,this._endDate));return{className:this._classNames({[un]:!0,disabled:t,range:n,"range-hover":s,selected:i}),tabIndex:t?-1:0,ariaSelected:i}}static calendarInterface(e,t){const i=Ln.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=Ln.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}M.on(window,ln,()=>{for(const e of Array.from(document.querySelectorAll('[data-coreui-toggle="calendar"]')))Ln.calendarInterface(e)}),m(Ln);const An=".coreui.swipe",Tn=`touchstart${An}`,Cn=`touchmove${An}`,On=`touchend${An}`,xn=`pointerdown${An}`,Sn=`pointerup${An}`,$n={endCallback:null,leftCallback:null,rightCallback:null},In={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Nn extends z{constructor(e,t){super(),this._element=e,e&&Nn.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return $n}static get DefaultType(){return In}static get NAME(){return"swipe"}dispose(){M.off(this._element,An)}_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(),b(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&&b(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(M.on(this._element,xn,e=>this._start(e)),M.on(this._element,Sn,e=>this._end(e)),this._element.classList.add("pointer-event")):(M.on(this._element,Tn,e=>this._start(e)),M.on(this._element,Cn,e=>this._move(e)),M.on(this._element,On,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 Pn=".coreui.carousel",Mn=".data-api",Bn="ArrowLeft",jn="ArrowRight",Hn="next",Fn="prev",zn="left",Vn="right",Rn=`slide${Pn}`,Wn=`slid${Pn}`,qn=`keydown${Pn}`,Yn=`mouseenter${Pn}`,Un=`mouseleave${Pn}`,Gn=`dragstart${Pn}`,Qn=`load${Pn}${Mn}`,Kn=`click${Pn}${Mn}`,Xn="carousel",Jn="active",Zn=".active",es=".carousel-item",ts=Zn+es,is={[Bn]:Vn,[jn]:zn},ns={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},ss={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class as extends V{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=W.findOne(".carousel-indicators",this._element),this._addEventListeners(),this._config.ride===Xn&&this.cycle()}static get Default(){return ns}static get DefaultType(){return ss}static get NAME(){return"carousel"}next(){this._slide(Hn)}nextWhenVisible(){!document.hidden&&c(this._element)&&this.next()}prev(){this._slide(Fn)}pause(){this._isSliding&&o(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?M.one(this._element,Wn,()=>this.cycle()):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void M.one(this._element,Wn,()=>this.to(e));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?Hn:Fn;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&&M.on(this._element,qn,e=>this._keydown(e)),"hover"===this._config.pause&&(M.on(this._element,Yn,()=>this.pause()),M.on(this._element,Un,()=>this._maybeEnableCycle())),this._config.touch&&Nn.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of W.find(".carousel-item img",this._element))M.on(e,Gn,e=>e.preventDefault());const e={leftCallback:()=>this._slide(this._directionToOrder(zn)),rightCallback:()=>this._slide(this._directionToOrder(Vn)),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),500+this._config.interval))}};this._swipeHelper=new Nn(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=is[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=W.findOne(Zn,this._indicatorsElement);t.classList.remove(Jn),t.removeAttribute("aria-current");const i=W.findOne(`[data-coreui-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add(Jn),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(),n=e===Hn,s=t||y(this._getItems(),i,n,this._config.wrap);if(s===i)return;const a=this._getItemIndex(s),o=t=>M.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:a});if(o(Rn).defaultPrevented)return;if(!i||!s)return;const r=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=s;const l=n?"carousel-item-start":"carousel-item-end",c=n?"carousel-item-next":"carousel-item-prev";s.classList.add(c),_(s),i.classList.add(l),s.classList.add(l),this._queueCallback(()=>{s.classList.remove(l,c),s.classList.add(Jn),i.classList.remove(Jn,c,l),this._isSliding=!1,o(Wn)},i,this._isAnimated()),r&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return W.findOne(ts,this._element)}_getItems(){return W.find(es,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return g()?e===zn?Fn:Hn:e===zn?Hn:Fn}_orderToDirection(e){return g()?e===Fn?zn:Vn:e===Fn?Vn:zn}static jQueryInterface(e){return this.each(function(){const t=as.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)})}}M.on(document,Kn,"[data-coreui-slide], [data-coreui-slide-to]",function(e){const t=W.getElementFromSelector(this);if(!t||!t.classList.contains(Xn))return;e.preventDefault();const i=as.getOrCreateInstance(t),n=this.getAttribute("data-coreui-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===F.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())}),M.on(window,Qn,()=>{const e=W.find('[data-coreui-ride="carousel"]');for(const t of e)as.getOrCreateInstance(t)}),m(as);const os=".coreui.collapse",rs=`show${os}`,ls=`shown${os}`,cs=`hide${os}`,hs=`hidden${os}`,ds=`click${os}.data-api`,us="show",_s="collapse",ps="collapsing",fs=`:scope .${_s} .${_s}`,gs='[data-coreui-toggle="collapse"]',ms={parent:null,toggle:!0},bs={parent:"(null|element)",toggle:"boolean"};class vs extends V{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=W.find(gs);for(const e of i){const t=W.getSelectorFromElement(e),i=W.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 ms}static get DefaultType(){return bs}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=>vs.getOrCreateInstance(e,{toggle:!1}))),e.length&&e[0]._isTransitioning)return;if(M.trigger(this._element,rs).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove(_s),this._element.classList.add(ps),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(ps),this._element.classList.add(_s,us),this._element.style[t]="",M.trigger(this._element,ls)},this._element,!0),this._element.style[t]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(M.trigger(this._element,cs).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,_(this._element),this._element.classList.add(ps),this._element.classList.remove(_s,us);for(const e of this._triggerArray){const t=W.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(ps),this._element.classList.add(_s),M.trigger(this._element,hs)},this._element,!0)}_isShown(e=this._element){return e.classList.contains(us)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=l(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(gs);for(const t of e){const e=W.getElementFromSelector(t);e&&this._addAriaAndCollapsedClass([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=W.find(fs,this._config.parent);return W.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=vs.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e]()}})}}M.on(document,ds,gs,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of W.getMultipleElementsFromSelector(this))vs.getOrCreateInstance(e,{toggle:!1}).toggle()}),m(vs);const ys=(e,t)=>e.toLocaleTimeString(t).includes("AM")?"am":e.toLocaleTimeString(t).includes("PM")||e.getHours()>=12?"pm":"am",ws=(e,t,i)=>{const n=new Date,s=Es(t),a=new Intl.DateTimeFormat(t,{hour:s?"2-digit":"numeric",minute:"2-digit",second:"2-digit"});return e.map(e=>{var t;return"hour"===i&&n.setHours(e),"minute"===i&&n.setMinutes(e),"second"===i&&n.setSeconds(e),{value:e,label:(null==(t=a.formatToParts(n).find(e=>e.type===i))?void 0:t.value)||""}})},Ds=e=>["am","AM","pm","PM"].some(t=>(new Date).toLocaleString(e).includes(t)),Es=e=>new Date(2020,0,1,7,5,7).toLocaleTimeString(e).startsWith("0"),ks=".coreui.time-picker",Ls=".data-api",As="Enter",Ts=`click${ks}`,Cs=`hide${ks}`,Os=`hidden${ks}`,xs=`keydown${ks}`,Ss=`show${ks}`,$s=`shown${ks}`,Is=`timeChange${ks}`,Ns=`click${ks}${Ls}`,Ps=`keyup${ks}${Ls}`,Ms=`load${ks}${Ls}`,Bs="is-invalid",js="is-valid",Hs="selected",Fs="show",zs="time-picker",Vs='[data-coreui-toggle="time-picker"]:not(.disabled):not(:disabled)',Rs=`${Vs}.${Fs}`,Ws={cancelButton:"Cancel",cancelButtonClasses:["btn","btn-sm","btn-ghost-primary"],cleaner:!0,confirmButton:"OK",confirmButtonClasses:["btn","btn-sm","btn-primary"],container:!1,disabled:!1,footer:!0,hours:null,indicator:!0,inputOnChangeDelay:750,inputReadOnly:!1,invalid:!1,locale:"default",minutes:!0,name:null,placeholder:"Select time",required:!0,seconds:!0,size:null,time:null,type:"dropdown",valid:!1,variant:"roll"},qs={cancelButton:"(boolean|string)",cancelButtonClasses:"(array|string)",cleaner:"boolean",confirmButton:"(boolean|string)",confirmButtonClasses:"(array|string)",container:"(string|element|boolean)",disabled:"boolean",footer:"boolean",hours:"(array|function|null)",indicator:"boolean",inputOnChangeDelay:"number",inputReadOnly:"boolean",invalid:"boolean",locale:"string",minutes:"(array|boolean|function)",name:"(string|null)",placeholder:"string",required:"boolean",seconds:"(array|boolean|function)",size:"(string|null)",time:"(date|string|null)",type:"string",valid:"boolean",variant:"string"};class Ys extends V{constructor(e,t){super(e),this._handleTimeChange=(e,t)=>{const i=this._date||new Date("1970-01-01");var n,s;"toggle"===e&&("am"===t&&(this._ampm="am",i.setHours(i.getHours()-12)),"pm"===t&&(this._ampm="pm",i.setHours(i.getHours()+12))),"hours"===e&&(Ds(this._config.locale)?i.setHours((n=this._ampm,s=Number.parseInt(t,10),"am"===n&&12===s?0:"am"===n?s:"pm"===n&&12===s?12:s+12)):i.setHours(Number.parseInt(t,10))),"minutes"===e&&i.setMinutes(Number.parseInt(t,10)),"seconds"===e&&i.setSeconds(Number.parseInt(t,10)),this._date=new Date(i),this._input&&(this._setInputValue(i),this._input.dispatchEvent(new Event("change"))),M.trigger(this._element,Is,{timeString:i.toTimeString(),localeTimeString:i.toLocaleTimeString(),date:i})},this._config=this._getConfig(t),this._date=this._convertStringToDate(this._config.time),this._initialDate=null,this._ampm=this._date?ys(new Date(this._date),this._config.locale):"am",this._popper=null,this._indicatorElement=null,this._input=null,this._menu=null,this._timePickerBody=null,this._inputTimeout=null,this._localizedTimePartials=((e,t="auto",i=[],n=[],s=[])=>{const a="auto"===t&&Ds(e)||!0===t,o=Array.isArray(i)&&i.length>0?i:"function"==typeof i?Array.from({length:a?12:24},(e,t)=>a?t+1:t).filter(e=>i(e)):Array.from({length:a?12:24},(e,t)=>a?t+1:t),r=Array.isArray(n)&&n.length>0?n:"function"==typeof n?Array.from({length:60},(e,t)=>t).filter(e=>n(e)):Array.from({length:60},(e,t)=>t),l=Array.isArray(s)&&s.length>0?s:"function"==typeof s?Array.from({length:60},(e,t)=>t).filter(e=>s(e)):Array.from({length:60},(e,t)=>t);return{listOfHours:ws(o,e,"hour"),listOfMinutes:ws(r,e,"minute"),listOfSeconds:ws(l,e,"second"),hour12:a}})(this._config.locale,this.ampm,this._config.hours,this._config.minutes,this._config.seconds),this._createTimePicker(),this._createTimePickerSelection(),this._addEventListeners(),this._setUpSelects()}static get Default(){return Ws}static get DefaultType(){return qs}static get NAME(){return"time-picker"}toggle(){return this._isShown()?this.hide():this.show()}show(){this._config.disabled||this._isShown()||(this._initialDate=new Date(this._date),M.trigger(this._element,Ss),this._element.classList.add(Fs),this._element.setAttribute("aria-expanded",!0),this._config.container&&this._menu.classList.add(Fs),M.trigger(this._element,$s),this._createPopper())}hide(){M.trigger(this._element,Cs),this._popper&&this._popper.destroy(),this._element.classList.remove(Fs),this._element.setAttribute("aria-expanded","false"),this._config.container&&this._menu.classList.remove(Fs),M.trigger(this._element,Os)}dispose(){this._popper&&this._popper.destroy(),this._inputTimeout&&clearTimeout(this._inputTimeout),super.dispose()}cancel(){this._date=this._initialDate,this._setInputValue(this._initialDate||""),this._timePickerBody.innerHTML="",this.hide(),this._createTimePickerSelection(),this._emitChangeEvent(this._date)}clear(){this._date=null,this._setInputValue(""),this._timePickerBody.innerHTML="",this._createTimePickerSelection(),this._emitChangeEvent(this._date)}reset(){this._date=this._convertStringToDate(this._config.time),this._setInputValue(this._config.time),this._timePickerBody.innerHTML="",this._createTimePickerSelection(),this._emitChangeEvent(this._date)}update(e){this._config=this._getConfig(e),this._date=this._convertStringToDate(this._config.time),this._ampm=this._date?ys(new Date(this._date),this._config.locale):"am",this._timePickerBody.innerHTML="",this._createTimePickerSelection(),this._setUpSelects()}_addEventListeners(){M.on(this._indicatorElement,Ts,()=>{this._config.disabled||this.toggle()}),M.on(this._indicatorElement,xs,e=>{this._config.disabled||e.key!==As||this.toggle()}),M.on(this._togglerElement,Ts,e=>{this._config.disabled||e.target===this._indicatorElement||(this.show(),"roll"===this._config.variant&&this._setUpRolls(!0),"select"===this._config.variant&&this._setUpSelects())}),M.on(this._element,xs,e=>{"Escape"===e.key&&this.hide()}),M.on(this._element,"timeChange.coreui.time-picker",()=>{"roll"===this._config.variant&&this._setUpRolls(),"select"===this._config.variant&&this._setUpSelects()}),M.on(this._element,"onCancelClick.coreui.picker",()=>{this.cancel()}),M.on(this._input,"input",e=>{this._inputTimeout&&clearTimeout(this._inputTimeout),this._inputTimeout=setTimeout(()=>{(e=>{const t=new Date(`1970-01-01 ${e}`);return t instanceof Date&&!Number.isNaN(t.getTime())})(e.target.value)&&(this._date=this._convertStringToDate(e.target.value),M.trigger(this._element,Is,{timeString:this._date?this._date.toTimeString():null,localeTimeString:this._date?this._date.toLocaleTimeString():null,date:this._date}))},this._config.inputOnChangeDelay)}),"dropdown"===this._config.type&&M.on(this._input.form,"submit",()=>{if(this._input.form.classList.contains("was-validated")){if(Number.isNaN(Date.parse(`1970-01-01 ${this._input.value}`)))return this._element.classList.add(Bs);if(this._date instanceof Date)return this._element.classList.add(js);this._element.classList.add(Bs)}})}_createTimePicker(){if(this._element.classList.add(zs),F.setDataAttribute(this._element,"toggle",zs),this._config.size&&this._element.classList.add(`time-picker-${this._config.size}`),this._element.classList.toggle(js,this._config.valid),this._config.disabled&&this._element.classList.add("disabled"),this._element.classList.toggle(Bs,this._config.invalid),"dropdown"===this._config.type){this._element.append(this._createTimePickerInputGroup());const e=document.createElement("div");e.classList.add("time-picker-dropdown"),e.append(this._createTimePickerBody()),(this._config.footer||this._config.timepicker)&&e.append(this._createTimePickerFooter());const{container:t}=this._config;t?t.append(e):this._element.append(e),this._menu=e}"inline"===this._config.type&&this._element.append(this._createTimePickerBody())}_createTimePickerInputGroup(){const e=document.createElement("div");e.classList.add("time-picker-input-group");const t=document.createElement("input");t.classList.add("time-picker-input"),t.autocomplete="off",t.disabled=this._config.disabled,t.placeholder=this._config.placeholder,t.readOnly=this._config.inputReadOnly,t.required=this._config.required,t.type="text",this._setInputValue(this._date||"",t),(this._config.name||this._element.id)&&(t.name=this._config.name||`time-picker-${this._element.id}`);const i=["change","keyup","paste"];for(const e of i)t.addEventListener(e,({target:e})=>{if(e.closest("form.was-validated")){if(Number.isNaN(Date.parse(`1970-01-01 ${e.value}`)))return this._element.classList.add(Bs),void this._element.classList.remove(js);if(this._date instanceof Date)return this._element.classList.add(js),void this._element.classList.remove(Bs);this._element.classList.add(Bs),this._element.classList.remove(js)}});if(e.append(t),this._config.indicator){const t=document.createElement("div");t.classList.add("time-picker-indicator"),this._config.disabled||(t.tabIndex=0),e.append(t),this._indicatorElement=t}if(this._config.cleaner){const t=document.createElement("div");t.classList.add("time-picker-cleaner"),t.addEventListener("click",e=>{e.stopPropagation(),this.clear()}),e.append(t)}return this._input=t,this._togglerElement=e,e}_createTimePickerSelection(){"roll"===this._config.variant&&this._createTimePickerRoll(),"select"===this._config.variant&&this._createTimePickerInlineSelects()}_createTimePickerBody(){const e=document.createElement("div");return e.classList.add("time-picker-body"),"roll"===this._config.variant&&e.classList.add("time-picker-roll"),this._timePickerBody=e,e}_createTimePickerInlineSelect(e,t){const i=document.createElement("select");i.classList.add("time-picker-inline-select",e),i.disabled=this._config.disabled,i.addEventListener("change",t=>this._handleTimeChange(e,t.target.value));for(const e of t){const t=document.createElement("option");t.value=e.value,t.innerHTML=e.label,i.append(t)}return i}_createTimePickerInlineSelects(){const e=document.createElement("div");e.innerHTML=":",this._timePickerBody.innerHTML='<span class="time-picker-inline-icon"></span>',this._timePickerBody.append(this._createTimePickerInlineSelect("hours",this._localizedTimePartials.listOfHours)),this._config.minutes&&this._timePickerBody.append(e.cloneNode(!0),this._createTimePickerInlineSelect("minutes",this._localizedTimePartials.listOfMinutes)),this._config.seconds&&this._timePickerBody.append(e,this._createTimePickerInlineSelect("seconds",this._localizedTimePartials.listOfSeconds)),this._localizedTimePartials.hour12&&this._timePickerBody.append(this._createTimePickerInlineSelect("toggle",[{value:"am",label:"AM"},{value:"pm",label:"PM"}],"_selectAmPm",this._ampm))}_createTimePickerRoll(){this._timePickerBody.append(this._createTimePickerRollCol(this._localizedTimePartials.listOfHours,"hours")),this._config.minutes&&this._timePickerBody.append(this._createTimePickerRollCol(this._localizedTimePartials.listOfMinutes,"minutes")),this._config.seconds&&this._timePickerBody.append(this._createTimePickerRollCol(this._localizedTimePartials.listOfSeconds,"seconds")),this._localizedTimePartials.hour12&&this._timePickerBody.append(this._createTimePickerRollCol([{value:"am",label:"AM"},{value:"pm",label:"PM"}],"toggle",this._ampm))}_createTimePickerRollCol(e,t){const i=document.createElement("div");i.classList.add("time-picker-roll-col");for(const n of e){const e=document.createElement("div");e.classList.add("time-picker-roll-cell"),e.setAttribute("role","button"),e.tabIndex=0,e.innerHTML=n.label,e.addEventListener("click",()=>{this._handleTimeChange(t,n.value)}),e.addEventListener("keydown",e=>{"Space"!==e.code&&e.key!==As||(e.preventDefault(),this._handleTimeChange(t,n.value))}),F.setDataAttribute(e,t,n.value),i.append(e)}return i}_createTimePickerFooter(){const e=document.createElement("div");if(e.classList.add("time-picker-footer"),this._config.cancelButton){const t=document.createElement("button");t.classList.add(...this._getButtonClasses(this._config.cancelButtonClasses)),t.type="button",t.innerHTML=this._config.cancelButton,t.addEventListener("click",()=>{this.cancel()}),e.append(t)}if(this._config.confirmButton){const t=document.createElement("button");t.classList.add(...this._getButtonClasses(this._config.confirmButtonClasses)),t.type="button",t.innerHTML=this._config.confirmButton,t.addEventListener("click",()=>{this.hide()}),e.append(t)}return e}_emitChangeEvent(e){this._input.dispatchEvent(new Event("change")),M.trigger(this._element,Is,{timeString:null===e?null:e.toTimeString(),localeTimeString:null===e?null:e.toLocaleTimeString(),date:e})}_setUpRolls(e=!1){for(const t of Array.from(["hours","minutes","seconds","toggle"]))for(const i of W.find(`[data-coreui-${t}]`,this._element))if(this._getPartOfTime(t)===F.getDataAttribute(i,t)){i.classList.add(Hs),this._scrollTo(i.parentElement,i,e);for(const e of i.parentElement.children)e!==i&&e.classList.remove(Hs)}}_setInputValue(e,t=this._input){t.value=e instanceof Date?e.toLocaleTimeString(this._config.locale,{hour12:this._localizedTimePartials.hour12,hour:"numeric",...this._config.minutes&&{minute:"numeric"},...this._config.seconds&&{second:"numeric"}}):e}_setUpSelects(){for(const e of Array.from(["hours","minutes","seconds","toggle"]))for(const t of W.find(`select.${e}`,this._element))this._getPartOfTime(e)&&(t.value=this._getPartOfTime(e))}_updateTimePicker(){this._element.innerHTML="",this._createTimePicker()}_convertStringToDate(e){return e?e instanceof Date?e:new Date(`1970-01-01 ${e}`):null}_createPopper(){if(void 0===Tt)throw new TypeError("CoreUI's time picker require Popper (https://popper.js.org)");const e={modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents"}},{name:"offset",options:{offset:[0,2]}}],placement:g()?"bottom-end":"bottom-start"};this._popper=At(this._togglerElement,this._menu,e)}_getButtonClasses(e){return"string"==typeof e?e.split(" "):e}_getPartOfTime(e){return null===this._date?null:"hours"===e?Ds(this._config.locale)?this._date.getHours()%12||12:this._date.getHours():"minutes"===e?this._date.getMinutes():"seconds"===e?this._date.getSeconds():"toggle"===e?ys(new Date(this._date),this._config.locale):void 0}_isShown(){return this._element.classList.contains(Fs)}_scrollTo(e,t,i=!1){e.scrollTo({top:t.offsetTop,behavior:i?"instant":"smooth"})}_configAfterMerge(e){return"dropdown"!==e.container&&"inline"!==e.container||(e.type=e.container),!0===e.container&&(e.container=document.body),("object"==typeof e.container||"string"==typeof e.container&&"dropdown"===e.container&&"inline"===e.container)&&(e.container=l(e.container)),e}static timePickerInterface(e,t){const i=Ys.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=Ys.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=W.find(Rs);for(const i of t){const t=Ys.getInstance(i);t&&(e.composedPath().includes(t._element)||(t._element,e.type,t.hide()))}}}M.on(window,Ms,()=>{const e=W.find(Vs);for(let t=0,i=e.length;t<i;t++)Ys.timePickerInterface(e[t])}),M.on(document,Ns,Ys.clearMenus),M.on(document,Ps,Ys.clearMenus),m(Ys);const Us=".coreui.focustrap",Gs=`focusin${Us}`,Qs=`keydown.tab${Us}`,Ks="backward",Xs={additionalElement:null,autofocus:!0,trapElement:null},Js={additionalElement:"(element|null|undefined)",autofocus:"boolean",trapElement:"element"};class Zs extends z{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return Xs}static get DefaultType(){return Js}static get NAME(){return"focustrap"}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),M.off(document,Us),M.on(document,Gs,e=>this._handleFocusin(e)),M.on(document,Qs,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,M.off(document,Us))}_handleFocusin(e){const{additionalElement:t,trapElement:i}=this._config;if(e.target===document||e.target===i||i.contains(e.target))return;if(t&&(e.target===t||t.contains(e.target)))return;const n=W.focusableChildren(i);0===n.length?i.focus():this._lastTabNavDirection===Ks?n[n.length-1].focus():n[0].focus()}_handleKeydown(e){if("Tab"!==e.key)return;this._lastTabNavDirection=e.shiftKey?Ks:"forward";const{additionalElement:t,trapElement:i}=this._config;if(!t)return;const n=W.focusableChildren(i),s=W.focusableChildren(t);0!==n.length&&0!==s.length&&(e.preventDefault(),n.indexOf(e.target)!==n.length-1||e.shiftKey?0===n.indexOf(e.target)&&e.shiftKey?s[s.length-1].focus():s.indexOf(e.target)!==s.length-1||e.shiftKey?0===s.indexOf(e.target)&&e.shiftKey&&n[n.length-1].focus():n[0].focus():s[0].focus())}}const ea=".coreui.date-range-picker",ta=".data-api",ia=`click${ea}`,na=`endDateChange${ea}`,sa=`hide${ea}`,aa=`hidden${ea}`,oa="input",ra=`keydown${ea}`,la=`show${ea}`,ca=`shown${ea}`,ha=`startDateChange${ea}`,da=`click${ea}${ta}`,ua=`keyup${ea}${ta}`,_a=`load${ea}${ta}`,pa="date-picker",fa="date-picker-input",ga="is-invalid",ma="is-valid",ba="show",va="time-picker",ya='[data-coreui-toggle="date-range-picker"]:not(.disabled):not(:disabled)',wa=`${ya}.${ba}`,Da={ariaNavNextMonthLabel:"Next month",ariaNavNextYearLabel:"Next year",ariaNavPrevMonthLabel:"Previous month",ariaNavPrevYearLabel:"Previous year",calendarDate:null,calendars:2,cancelButton:"Cancel",cancelButtonClasses:["btn","btn-sm","btn-ghost-primary"],confirmButton:"OK",confirmButtonClasses:["btn","btn-sm","btn-primary"],cleaner:!0,container:!1,date:null,disabled:!1,disabledDates:null,endDate:null,endName:null,firstDayOfWeek:1,footer:!1,inputDateFormat:null,inputDateParse:null,inputOnChangeDelay:750,inputReadOnly:!1,invalid:!1,indicator:!0,locale:"default",maxDate:null,minDate:null,name:null,placeholder:["Start date","End date"],previewDateOnHover:!0,range:!0,ranges:{},rangesButtonsClasses:["btn","btn-ghost-secondary"],required:!0,separator:!0,size:null,startDate:null,startName:null,selectAdjacementDays:!1,selectEndDate:!1,selectionType:"day",showAdjacementDays:!0,showWeekNumber:!1,timepicker:!1,todayButton:"Today",todayButtonClasses:["btn","btn-sm","btn-primary","me-auto"],valid:!1,weekdayFormat:2,weekNumbersLabel:null},Ea={ariaNavNextMonthLabel:"string",ariaNavNextYearLabel:"string",ariaNavPrevMonthLabel:"string",ariaNavPrevYearLabel:"string",calendarDate:"(date|number|string|null)",calendars:"number",cancelButton:"(boolean|string)",cancelButtonClasses:"(array|string)",cleaner:"boolean",confirmButton:"(boolean|string)",confirmButtonClasses:"(array|string)",container:"(string|element|boolean)",date:"(date|number|string|null)",disabledDates:"(array|date|function|null)",disabled:"boolean",endDate:"(date|number|string|null)",endName:"(string|null)",firstDayOfWeek:"number",footer:"boolean",indicator:"boolean",inputDateFormat:"(function|null)",inputDateParse:"(function|null)",inputOnChangeDelay:"number",inputReadOnly:"boolean",invalid:"boolean",locale:"string",maxDate:"(date|number|string|null)",minDate:"(date|number|string|null)",name:"(string|null)",placeholder:"(array|string)",previewDateOnHover:"boolean",range:"boolean",ranges:"object",rangesButtonsClasses:"(array|string)",required:"boolean",separator:"boolean",size:"(string|null)",startDate:"(date|number|string|null)",startName:"(string|null)",selectAdjacementDays:"boolean",selectEndDate:"boolean",selectionType:"string",showAdjacementDays:"boolean",showWeekNumber:"boolean",timepicker:"boolean",todayButton:"(boolean|string)",todayButtonClasses:"(array|string)",valid:"boolean",weekdayFormat:"(number|string)",weekNumbersLabel:"(string|null)"};class ka extends V{constructor(e,t){super(e),this._config=this._getConfig(t),this._calendarDate=this._config.calendarDate,this._startDate=this._config.date||this._config.startDate,this._endDate=this._config.endDate,this._initialStartDate=null,this._initialEndDate=null,this._mobile=window.innerWidth<768,this._popper=null,this._selectEndDate=this._config.selectEndDate,this._calendar=null,this._calendars=null,this._endInput=null,this._endInputTimeout=null,this._endPreviewInput=null,this._indicatorElement=null,this._menu=null,this._startInput=null,this._startInputTimeout=null,this._startPreviewInput=null,this._timepickers=null,this._timePickerEnd=null,this._timePickerStart=null,this._togglerElement=null,this._createDateRangePicker(),this._createDateRangePickerCalendars(),this._addEventListeners(),this._addCalendarEventListeners(),this._focustrap=this._initializeFocusTrap()}static get Default(){return Da}static get DefaultType(){return Ea}static get NAME(){return"date-range-picker"}toggle(){return this._isShown()?this.hide():this.show()}show(){this._config.disabled||this._isShown()||(this._initialStartDate=this._startDate?new Date(this._startDate):null,this._initialEndDate=this._endDate?new Date(this._endDate):null,M.trigger(this._element,la),this._element.classList.add(ba),this._element.setAttribute("aria-expanded",!0),this._config.container&&this._menu.classList.add(ba),this._focustrap.activate(),M.trigger(this._element,ca),this._createPopper())}hide(){M.trigger(this._element,sa),this._popper&&this._popper.destroy(),this._element.classList.remove(ba),this._element.setAttribute("aria-expanded","false"),this._config.container&&this._menu.classList.remove(ba),this._focustrap.deactivate(),M.trigger(this._element,aa)}dispose(){this._popper&&this._popper.destroy(),this._startInputTimeout&&clearTimeout(this._startInputTimeout),this._endInputTimeout&&clearTimeout(this._endInputTimeout),this._focustrap.deactivate(),super.dispose()}cancel(){this.hide(),this._initialStartDate&&this._changeStartDate(this._initialStartDate),this._config.range&&this._initialEndDate&&this._changeEndDate(this._initialEndDate),(this._initialStartDate||this._initialEndDate)&&this._calendar.update(this._getCalendarConfig)}clear(){this._changeStartDate(null),this._changeEndDate(null),this._calendar.update(this._getCalendarConfig())}reset(){this._changeStartDate(this._config.startDate),this._changeEndDate(this._config.endDate),this._calendar.update(this._getCalendarConfig())}update(e){this._config=this._getConfig(e),this._calendarDate=this._config.calendarDate,this._startDate=this._config.date||this._config.startDate,this._endDate=this._config.endDate,this._selectEndDate=this._config.selectEndDate,this._element.innerHTML="",this._createDateRangePicker(),this._createDateRangePickerCalendars(),this._addEventListeners(),this._addCalendarEventListeners()}_initializeFocusTrap(){return new Zs({additionalElement:this._config.container?this._menu:null,trapElement:this._element})}_addEventListeners(){M.on(this._indicatorElement,ia,()=>{this._config.disabled||this.toggle()}),M.on(this._indicatorElement,ra,e=>{this._config.disabled||"Enter"!==e.key||this.toggle()}),M.on(this._togglerElement,ia,e=>{this._config.disabled||e.target===this._indicatorElement||this.show()}),M.on(this._element,ra,e=>{"Escape"===e.key&&(this.hide(),this._startInput.focus())}),M.on(this._startInput,ia,()=>{this._selectEndDate=!1,this._calendar.update(this._getCalendarConfig())}),M.on(this._startInput,oa,e=>{this._startInputTimeout&&clearTimeout(this._startInputTimeout),this._startInputTimeout=setTimeout(()=>{const t=this._parseDate(e.target.value);let i=t;if(t instanceof Date&&t.getTime()){if(Ii(t,this._config.minDate,this._config.maxDate,this._config.disabledDates))return;"day"!==this._config.selectionType&&(i=Si(t,this._config.selectionType)),this._calendarDate=i,this._startInput.value=this._setInputValue(i)}this._startDate=i,this._calendar.update(this._getCalendarConfig()),M.trigger(this._element,ha,{date:i})},this._config.inputOnChangeDelay)}),M.on(this._startInput.form,"submit",()=>{if(this._startInput.form.classList.contains("was-validated")){if(this._config.range&&(Number.isNaN(Date.parse(this._startInput.value))||Number.isNaN(Date.parse(this._endInput.value))))return this._element.classList.add(ga);if(this._config.range&&this._startDate instanceof Date&&this._endDate instanceof Date)return this._element.classList.add(ma);if(!this._config.range&&Number.isNaN(Date.parse(this._startInput.value)))return this._element.classList.add(ga);if(!this._config.range&&this._startDate instanceof Date)return this._element.classList.add(ma);this._element.classList.add(ga)}}),M.on(this._endInput,ia,()=>{this._selectEndDate=!0,this._calendar.update(this._getCalendarConfig())}),M.on(this._endInput,oa,e=>{this._endInputTimeout&&clearTimeout(this._endInputTimeout),this._endInputTimeout=setTimeout(()=>{const t=this._parseDate(e.target.value);let i=t;if(t instanceof Date&&t.getTime()){if(t&&Ii(t,this._config.minDate,this._config.maxDate,this._config.disabledDates))return;"day"!==this._config.selectionType&&(i=Si(t,this._config.selectionType)),this._calendarDate=i,this._endInput.value=this._setInputValue(i)}this._endDate=i,this._calendar.update(this._getCalendarConfig()),M.trigger(this._element,na,{date:i})},this._config.inputOnChangeDelay)}),M.on(window,"resize",()=>{this._mobile=window.innerWidth<768})}_addCalendarEventListeners(){for(const e of W.find(".calendars",this._menu))M.on(e,"startDateChange.coreui.calendar",e=>{this._changeStartDate(e.date),this._config.range||this._config.footer||this._config.timepicker||this.hide()}),M.on(e,"endDateChange.coreui.calendar",e=>{this._changeEndDate(e.date),!this._startDate||this._config.footer||this._config.timepicker||this.hide()}),this._config.previewDateOnHover&&!this._config.disabled&&M.on(e,"cellHover.coreui.calendar",e=>{if(this._selectEndDate){const t=e.date?this._setInputValue(e.date):this._setInputValue(this._endDate);return void this._updatePreviewInputVisibility(this._endPreviewInput,e.date?t:"")}const t=e.date?this._setInputValue(e.date):this._setInputValue(this._startDate);this._updatePreviewInputVisibility(this._startPreviewInput,e.date?t:"")}),M.on(e,"selectEndChange.coreui.calendar",e=>{this._selectEndDate=e.value})}_changeStartDate(e,t=!1){this._startDate=e,this._startInput.value=this._setInputValue(e),this._startInput.dispatchEvent(new Event("change")),M.trigger(this._element,ha,{date:e}),this._timePickerStart&&!t&&this._timePickerStart.update(this._getTimePickerConfig(!0))}_changeEndDate(e,t=!1){this._endDate=e,this._endInput.value=this._setInputValue(e),this._endInput.dispatchEvent(new Event("change")),M.trigger(this._element,na,{date:e}),this._timePickerEnd&&!t&&this._timePickerEnd.update(this._getTimePickerConfig(!1))}_getCalendarConfig(){return{ariaNavNextMonthLabel:this._config.ariaNavNextMonthLabel,ariaNavNextYearLabel:this._config.ariaNavNextYearLabel,ariaNavPrevMonthLabel:this._config.ariaNavPrevMonthLabel,ariaNavPrevYearLabel:this._config.ariaNavPrevYearLabel,calendarDate:this._calendarDate,calendars:this._mobile?1:this._config.calendars,disabledDates:this._config.disabledDates,endDate:this._endDate,firstDayOfWeek:this._config.firstDayOfWeek,locale:this._config.locale,maxDate:this._config.maxDate,minDate:this._config.minDate,range:this._config.range,selectAdjacementDays:this._config.selectAdjacementDays,selectEndDate:this._selectEndDate,selectionType:this._config.selectionType,showAdjacementDays:this._config.showAdjacementDays,showWeekNumber:this._config.showWeekNumber,startDate:this._startDate,weekdayFormat:this._config.weekdayFormat,weekNumbersLabel:this._config.weekNumbersLabel}}_getTimePickerConfig(e){return{disabled:e?!this._startDate:!this._endDate,locale:this._config.locale,time:e?this._startDate&&new Date(this._startDate):this._endDate&&new Date(this._endDate),type:"inline",variant:"select"}}_createDateRangePicker(){this._element.classList.add(pa),F.setDataAttribute(this._element,"toggle",this._config.range?"date-range-picker":pa),this._config.size&&this._element.classList.add(`date-picker-${this._config.size}`),this._config.disabled&&this._element.classList.add("disabled"),this._element.classList.toggle(ga,this._config.invalid),this._element.classList.toggle(ma,this._config.valid),this._element.append(this._createDateRangePickerInputGroup());const e=document.createElement("div");e.classList.add("date-picker-dropdown"),e.append(this._createDateRangePickerBody()),(this._config.footer||this._config.timepicker)&&e.append(this._createDateRangeFooter());const{container:t}=this._config;t?t.append(e):this._element.append(e),this._menu=e}_updatePreviewInputVisibility(e,t){e&&(t&&""!==t.trim()?(e.style.display="block",e.value=t):(e.style.display="none",e.value=""))}_createInputWrapper(e,t=!0){if(!this._config.previewDateOnHover||this._config.disabled)return e;const i=document.createElement("div");i.classList.add("date-picker-input-wrapper"),i.append(e);const n=document.createElement("input");return n.classList.add(fa,"date-picker-input-preview"),n.type="text",n.readOnly=!0,n.tabIndex=-1,n.style.display="none",t?this._startPreviewInput=n:this._endPreviewInput=n,i.append(n),i}_createDateRangePickerInputGroup(){const e=document.createElement("div");e.classList.add("date-picker-input-group");let t=null;(this._config.name||this._config.startName||this._element.id)&&(t=this._config.name||this._config.startName||(this._config.range?`date-range-picker-start-date-${this._element.id}`:`date-picker-${this._element.id}`));const i=this._createInput(t,this._getPlaceholder()[0],this._setInputValue(this._startDate));let n=null;(this._config.endName||this._element.id)&&(n=this._config.endName||`date-range-picker-end-date-${this._element.id}`);const s=this._createInput(n,this._getPlaceholder()[1],this._setInputValue(this._endDate)),a=document.createElement("div");a.classList.add("date-picker-separator"),this._startInput=i,this._endInput=s;const o=this._createInputWrapper(i,!0);if(e.append(o),this._config.separator&&e.append(a),this._config.range){const t=this._createInputWrapper(s,!1);e.append(t)}if(this._config.indicator){const t=document.createElement("div");t.classList.add("date-picker-indicator"),this._config.disabled||(t.tabIndex=0),e.append(t),this._indicatorElement=t}if(this._config.cleaner){const t=document.createElement("div");t.classList.add("date-picker-cleaner"),t.addEventListener("click",e=>{e.stopPropagation(),this.clear()}),e.append(t)}return this._togglerElement=e,e}_createDateRangePickerBody(){const e=document.createElement("div");if(e.classList.add("date-picker-body"),Object.keys(this._config.ranges).length){const t=document.createElement("div");t.classList.add("date-picker-ranges");for(const e of Object.keys(this._config.ranges)){const i=document.createElement("button");i.classList.add(...this._getButtonClasses(this._config.rangesButtonsClasses)),i.role="button",i.addEventListener("click",()=>{this._changeStartDate(this._config.ranges[e][0]),this._changeEndDate(this._config.ranges[e][1]),this._calendar.update(this._getCalendarConfig())}),i.innerHTML=e,t.append(i)}e.append(t)}const t=document.createElement("div");if(t.classList.add("date-picker-calendars"),this._calendars=t,e.append(t),this._config.timepicker){const t=document.createElement("div");t.classList.add("date-picker-timepickers"),this._timepickers=t,e.append(t)}return e}_createDateRangePickerCalendars(){const e=document.createElement("div");if(e.classList.add("date-picker-calendar"),this._calendars.append(e),this._calendar=new Ln(e,this._getCalendarConfig()),M.on(e,"calendarDateChange.coreui.calendar",e=>{this._calendarDate=e.date}),M.on(e,"calendarMouseleave.coreui.calendar",()=>{this._updatePreviewInputVisibility(this._startPreviewInput,""),this._updatePreviewInputVisibility(this._endPreviewInput,"")}),this._config.timepicker)if(this._mobile&&this._config.range||this._config.range&&1===this._config.calendars){const e=document.createElement("div");e.classList.add(va),this._timePickerStart=new Ys(e,this._getTimePickerConfig(!0)),this._timepickers.append(e),M.on(e,"timeChange.coreui.time-picker",e=>{this._changeStartDate(e.date,!0),this._calendar.update(this._getCalendarConfig())});const t=document.createElement("div");t.classList.add(va),this._timePickerEnd=new Ys(t,this._getTimePickerConfig(!1)),this._timepickers.append(t),M.on(t,"timeChange.coreui.time-picker",e=>{this._changeEndDate(e.date,!0),this._calendar.update(this._getCalendarConfig())})}else for(const[e,t]of Array.from({length:this._config.calendars}).entries()){const t=document.createElement("div");t.classList.add(va);const i=new Ys(t,this._getTimePickerConfig(0===e));0===e?this._timePickerStart=i:this._timePickerEnd=i,this._timepickers.append(t),M.on(t,"timeChange.coreui.time-picker",t=>{0===e?this._changeStartDate(t.date,!0):this._changeEndDate(t.date,!0),this._calendar.update(this._getCalendarConfig())})}}_createDateRangeFooter(){const e=document.createElement("div");if(e.classList.add("date-picker-footer"),this._config.todayButton){const t=document.createElement("button");t.classList.add(...this._getButtonClasses(this._config.todayButtonClasses)),t.type="button",t.innerHTML=this._config.todayButton,t.addEventListener("click",()=>{const e=new Date;this._calendarDate=e,this._changeStartDate(e),this._config.range&&this._changeEndDate(e),this._calendar.update(this._getCalendarConfig())}),e.append(t)}if(this._config.cancelButton){const t=document.createElement("button");t.classList.add(...this._getButtonClasses(this._config.cancelButtonClasses)),t.type="button",t.innerHTML=this._config.cancelButton,t.addEventListener("click",()=>{this.cancel()}),e.append(t)}if(this._config.confirmButton){const t=document.createElement("button");t.classList.add(...this._getButtonClasses(this._config.confirmButtonClasses)),t.type="button",t.innerHTML=this._config.confirmButton,t.addEventListener("click",()=>{this.hide()}),e.append(t)}return e}_createInput(e,t,i){const n=document.createElement("input");n.classList.add(fa),n.autocomplete="off",n.disabled=this._config.disabled,n.placeholder=t,n.readOnly=this._config.inputReadOnly,n.required=this._config.required,n.type="text",n.value=i,e&&(n.name=e);const s=["change","keyup","paste"];for(const e of s)n.addEventListener(e,({target:e})=>{if(e.closest("form.was-validated")){const e=W.find(".date-picker-input",this._element);for(const t of e)if(Number.isNaN(Date.parse(t.value)))return this._element.classList.add(ga),void this._element.classList.remove(ma);if(this._config.range&&this._startDate instanceof Date&&this._endDate instanceof Date)return this._element.classList.add(ma),void this._element.classList.remove(ga);if(!this._config.range&&this._startDate instanceof Date)return this._element.classList.add(ma),void this._element.classList.remove(ga);this._element.classList.add(ga),this._element.classList.remove(ma)}});return n}_createPopper(){if(void 0===Tt)throw new TypeError("CoreUI's date picker require Popper (https://popper.js.org)");const e={modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents"}},{name:"offset",options:{offset:[0,2]}}],placement:g()?"bottom-end":"bottom-start"};this._popper=At(this._togglerElement,this._menu,e)}_parseDate(e){return e?this._config.inputDateParse?this._config.inputDateParse(e):"day"===this._config.selectionType?((e,t="en-US",i=!1,n="day")=>e&&"string"==typeof e?Oi(e,n,t,i):null)(e,this._config.locale,this._config.timepicker):Oi(e,this._config.selectionType):null}_formatDate(e){if(!e)return"";if(this._config.inputDateFormat)return this._config.inputDateFormat(e instanceof Date?new Date(e):Oi(e,this._config.selectionType));if("day"!==this._config.selectionType)return e;const t=new Date(e);return this._config.timepicker?t.toLocaleString(this._config.locale):t.toLocaleDateString(this._config.locale)}_getButtonClasses(e){return"string"==typeof e?e.split(" "):e}_getPlaceholder(){const{placeholder:e}=this._config;return"string"==typeof e?e.split(","):e}_isShown(){return this._element.classList.contains(ba)}_setInputValue(e){return e?this._formatDate(e):""}_configAfterMerge(e){return!0===e.container&&(e.container=document.body),"object"!=typeof e.container&&"string"!=typeof e.container||(e.container=l(e.container)),e}static dateRangePickerInterface(e,t){const i=ka.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=ka.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=W.find(wa);for(const i of t){const t=ka.getInstance(i);if(!t)continue;const n=e.composedPath();n.includes(t._element)||n.includes(t._menu)||(t._element,e.type,t.hide())}}}M.on(window,_a,()=>{const e=W.find(ya);for(let t=0,i=e.length;t<i;t++)ka.dateRangePickerInterface(e[t])}),M.on(document,da,ka.clearMenus),M.on(document,ua,ka.clearMenus),m(ka);const La=".coreui.date-picker",Aa=".data-api",Ta=`dateChange${La}`,Ca=`hide${La}`,Oa=`hidden${La}`,xa=`show${La}`,Sa=`shown${La}`,$a=`click${La}${Aa}`,Ia=`keyup${La}${Aa}`,Na=`load${La}${Aa}`,Pa='[data-coreui-toggle="date-picker"]:not(.disabled):not(:disabled)',Ma=`${Pa}.show`,Ba={...ka.Default,calendars:1,placeholder:["Select date"],range:!1,separator:!1},ja={...ka.DefaultType,date:"(date|number|string|null)"};class Ha extends ka{static get Default(){return Ba}static get DefaultType(){return ja}static get NAME(){return"date-picker"}_addEventListeners(){super._addEventListeners(),M.on(this._element,"startDateChange.coreui.date-range-picker",e=>{M.trigger(this._element,Ta,{date:e.date})}),M.on(this._element,"show.coreui.date-range-picker",()=>{M.trigger(this._element,xa)}),M.on(this._element,"shown.coreui.date-range-picker",()=>{M.trigger(this._element,Sa)}),M.on(this._element,"hide.coreui.date-range-picker",()=>{M.trigger(this._element,Ca)}),M.on(this._element,"hidden.coreui.date-range-picker",()=>{M.trigger(this._element,Oa)})}static datePickerInterface(e,t){const i=Ha.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=Ha.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}static clearMenus(e){if(2===e.button||"keyup"===e.type&&"Tab"!==e.key)return;const t=W.find(Ma);for(const i of t){const t=Ha.getInstance(i);if(!t)continue;const n=e.composedPath();n.includes(t._element)||n.includes(t._menu)||(t._element,e.type,t.hide())}}}M.on(window,Na,()=>{const e=W.find(Pa);for(let t=0,i=e.length;t<i;t++)Ha.datePickerInterface(e[t])}),M.on(document,$a,Ha.clearMenus),M.on(document,Ia,Ha.clearMenus),m(Ha);const Fa="dropdown",za=".coreui.dropdown",Va=".data-api",Ra="ArrowUp",Wa="ArrowDown",qa=`hide${za}`,Ya=`hidden${za}`,Ua=`show${za}`,Ga=`shown${za}`,Qa=`click${za}${Va}`,Ka=`keydown${za}${Va}`,Xa=`keyup${za}${Va}`,Ja="show",Za='[data-coreui-toggle="dropdown"]:not(.disabled):not(:disabled)',eo=`${Za}.${Ja}`,to=".dropdown-menu",io=g()?"top-end":"top-start",no=g()?"top-start":"top-end",so=g()?"bottom-end":"bottom-start",ao=g()?"bottom-start":"bottom-end",oo=g()?"left-start":"right-start",ro=g()?"right-start":"left-start",lo={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},co={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ho extends V{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=W.next(this._element,to)[0]||W.prev(this._element,to)[0]||W.findOne(to,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return lo}static get DefaultType(){return co}static get NAME(){return Fa}toggle(){return this._isShown()?this.hide():this.show()}show(){if(h(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!M.trigger(this._element,Ua,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of[].concat(...document.body.children))M.on(e,"mouseover",u);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(Ja),this._element.classList.add(Ja),M.trigger(this._element,Ga,e)}}hide(){if(h(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(!M.trigger(this._element,qa,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))M.off(e,"mouseover",u);this._popper&&this._popper.destroy(),this._menu.classList.remove(Ja),this._element.classList.remove(Ja),this._element.setAttribute("aria-expanded","false"),F.removeDataAttribute(this._menu,"popper"),M.trigger(this._element,Ya,e)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!r(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${Fa.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(void 0===Tt)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:r(this._config.reference)?e=l(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=At(e,this._menu,t)}_isShown(){return this._menu.classList.contains(Ja)}_getPlacement(){const e=this._parent;if(e.classList.contains("dropend"))return oo;if(e.classList.contains("dropstart"))return ro;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?no:io:t?ao:so}_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)&&(F.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),{...e,...b(this._config.popperConfig,[void 0,e])}}_selectMenuItem({key:e,target:t}){const i=W.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter(e=>c(e));i.length&&y(i,t,e===Wa,!i.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=ho.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=W.find(eo);for(const i of t){const t=ho.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 a={relatedTarget:t._element};"click"===e.type&&(a.clickEvent=e),t._completeHide(a)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,n=[Ra,Wa].includes(e.key);if(!n&&!i)return;if(t&&!i)return;e.preventDefault();const s=this.matches(Za)?this:W.prev(this,Za)[0]||W.next(this,Za)[0]||W.findOne(Za,e.delegateTarget.parentNode),a=ho.getOrCreateInstance(s);if(n)return e.stopPropagation(),a.show(),void a._selectMenuItem(e);a._isShown()&&(e.stopPropagation(),a.hide(),s.focus())}}M.on(document,Ka,Za,ho.dataApiKeydownHandler),M.on(document,Ka,to,ho.dataApiKeydownHandler),M.on(document,Qa,ho.clearMenus),M.on(document,Xa,ho.clearMenus),M.on(document,Qa,Za,function(e){e.preventDefault(),ho.getOrCreateInstance(this).toggle()}),m(ho);const uo="coreui.loading-button",_o=`.${uo}`,po=`start${_o}`,fo=`stop${_o}`,go=`click${_o}.data-api`,mo="is-loading",bo='[data-coreui-toggle="loading-button"]',vo={disabledOnLoading:!1,spinner:!0,spinnerType:"border",timeout:!1},yo={disabledOnLoading:"boolean",spinner:"boolean",spinnerType:"string",timeout:"(boolean|number)"};class wo extends V{constructor(e,i){super(e),this._config=this._getConfig(i),this._timeout=this._config.timeout,this._spinner=null,this._state="idle",this._element&&t.set(e,uo,this),this._createButton()}static get Default(){return vo}static get DefaultType(){return yo}static get NAME(){return"loading-button"}start(){"loading"!==this._state&&(this._createSpinner(),this._state="loading",setTimeout(()=>{this._element.classList.add(mo),M.trigger(this._element,po),this._config.disabledOnLoading&&this._element.setAttribute("disabled",!0)},1),this._config.timeout&&setTimeout(()=>{this.stop()},this._config.timeout))}stop(){this._element.classList.remove(mo);const e=()=>{this._removeSpinner(),this._state="idle",this._config.disabledOnLoading&&this._element.removeAttribute("disabled"),M.trigger(this._element,fo)};this._spinner?this._queueCallback(e,this._spinner,!0):e()}_createButton(){this._element.classList.add("btn-loading")}_createSpinner(){if(this._config.spinner){const e=document.createElement("span"),t=this._config.spinnerType;e.classList.add("btn-loading-spinner",`spinner-${t}`,`spinner-${t}-sm`),e.setAttribute("role","status"),e.setAttribute("aria-hidden","true"),this._element.insertBefore(e,this._element.firstChild),this._spinner=e}}_removeSpinner(){this._config.spinner&&(this._spinner.remove(),this._spinner=null)}static loadingButtonInterface(e,t){const i=wo.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(){wo.loadingButtonInterface(this,e)})}}M.on(document,go,bo,e=>{e.preventDefault();const t=e.target.closest(bo);wo.getOrCreateInstance(t).start()}),m(wo);const Do="backdrop",Eo="show",ko=`mousedown.coreui.${Do}`,Lo={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ao={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class To extends z{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return Lo}static get DefaultType(){return Ao}static get NAME(){return Do}show(e){if(!this._config.isVisible)return void b(e);this._append();const t=this._getElement();this._config.isAnimated&&_(t),t.classList.add(Eo),this._emulateAnimation(()=>{b(e)})}hide(e){this._config.isVisible?(this._getElement().classList.remove(Eo),this._emulateAnimation(()=>{this.dispose(),b(e)})):b(e)}dispose(){this._isAppended&&(M.off(this._element,ko),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=l(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),M.on(e,ko,()=>{b(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){v(e,this._getElement(),this._config.isAnimated)}}const Co=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Oo=".sticky-top",xo="padding-right",So="margin-right";class $o{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,xo,t=>t+e),this._setElementAttributes(Co,xo,t=>t+e),this._setElementAttributes(Oo,So,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,xo),this._resetElementAttributes(Co,xo),this._resetElementAttributes(Oo,So)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,i){const n=this.getWidth();this._applyManipulationCallback(e,e=>{if(e!==this._element&&window.innerWidth>e.clientWidth+n)return;this._saveInitialAttribute(e,t);const s=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,`${i(Number.parseFloat(s))}px`)})}_saveInitialAttribute(e,t){const i=e.style.getPropertyValue(t);i&&F.setDataAttribute(e,t,i)}_resetElementAttributes(e,t){this._applyManipulationCallback(e,e=>{const i=F.getDataAttribute(e,t);null!==i?(F.removeDataAttribute(e,t),e.style.setProperty(t,i)):e.style.removeProperty(t)})}_applyManipulationCallback(e,t){if(r(e))t(e);else for(const i of W.find(e,this._element))t(i)}}const Io=".coreui.modal",No=`hide${Io}`,Po=`hidePrevented${Io}`,Mo=`hidden${Io}`,Bo=`show${Io}`,jo=`shown${Io}`,Ho=`resize${Io}`,Fo=`click.dismiss${Io}`,zo=`mousedown.dismiss${Io}`,Vo=`keydown.dismiss${Io}`,Ro=`click${Io}.data-api`,Wo="modal-open",qo="show",Yo="modal-static",Uo={backdrop:!0,focus:!0,keyboard:!0},Go={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class Qo extends V{constructor(e,t){super(e,t),this._dialog=W.findOne(".modal-dialog",this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new $o,this._addEventListeners()}static get Default(){return Uo}static get DefaultType(){return Go}static get NAME(){return"modal"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||M.trigger(this._element,Bo,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Wo),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){this._isShown&&!this._isTransitioning&&(M.trigger(this._element,No).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(qo),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated())))}dispose(){M.off(window,Io),M.off(this._dialog,Io),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new To({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new Zs({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=W.findOne(".modal-body",this._dialog);t&&(t.scrollTop=0),_(this._element),this._element.classList.add(qo),this._queueCallback(()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,M.trigger(this._element,jo,{relatedTarget:e})},this._dialog,this._isAnimated())}_addEventListeners(){M.on(this._element,Vo,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():this._triggerBackdropTransition())}),M.on(window,Ho,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),M.on(this._element,zo,e=>{M.one(this._element,Fo,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(Wo),this._resetAdjustments(),this._scrollBar.reset(),M.trigger(this._element,Mo)})}_isAnimated(){return this._element.classList.contains("fade")}_triggerBackdropTransition(){if(M.trigger(this._element,Po).defaultPrevented)return;const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._element.style.overflowY;"hidden"===t||this._element.classList.contains(Yo)||(e||(this._element.style.overflowY="hidden"),this._element.classList.add(Yo),this._queueCallback(()=>{this._element.classList.remove(Yo),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=g()?"paddingLeft":"paddingRight";this._element.style[e]=`${t}px`}if(!i&&e){const e=g()?"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=Qo.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError(`No method named "${e}"`);i[e](t)}})}}M.on(document,Ro,'[data-coreui-toggle="modal"]',function(e){const t=W.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),M.one(t,Bo,e=>{e.defaultPrevented||M.one(t,Mo,()=>{c(this)&&this.focus()})});const i=W.findOne(".modal.show");i&&Qo.getInstance(i).hide(),Qo.getOrCreateInstance(t).toggle(this)}),q(Qo),m(Qo);const Ko="coreui.multi-select",Xo=`.${Ko}`,Jo=".data-api",Zo="ArrowUp",er="ArrowDown",tr="Backspace",ir="Delete",nr="Enter",sr=".form-multi-select-option",ar=".form-multi-select-options-empty",or=".form-multi-select-search",rr=".form-multi-select",lr=`changed${Xo}`,cr=`click${Xo}`,hr=`hide${Xo}`,dr=`hidden${Xo}`,ur=`keydown${Xo}`,_r=`keyup${Xo}`,pr=`search${Xo}`,fr=`show${Xo}`,gr=`shown${Xo}`,mr=`click${Xo}${Jo}`,br=`keyup${Xo}${Jo}`,vr=`load${Xo}${Jo}`,yr="disabled",wr="form-multi-select",Dr="form-multi-select-option",Er="form-multi-selected",kr="show",Lr={allowList:Ct,ariaCleanerLabel:"Clear all selections",ariaIndicatorLabel:"Toggle visibility of options menu",cleaner:!0,clearSearchOnSelect:!1,container:!1,disabled:!1,id:null,invalid:!1,multiple:!0,name:null,options:!1,optionsGroupsTemplate:null,optionsMaxHeight:"auto",optionsStyle:"checkbox",optionsTemplate:null,placeholder:"Select...",required:!1,sanitize:!0,sanitizeFn:null,search:!1,searchNoResultsLabel:"No results found",selectAll:!0,selectAllLabel:"Select all options",selectionType:"tags",selectionTypeCounterText:"item(s) selected",valid:!1,value:null},Ar={allowList:"object",ariaCleanerLabel:"string",ariaIndicatorLabel:"string",cleaner:"boolean",clearSearchOnSelect:"boolean",container:"(string|element|boolean)",disabled:"boolean",id:"(string|null)",invalid:"boolean",multiple:"boolean",name:"(string|null)",options:"(boolean|array)",optionsGroupsTemplate:"(function|null)",optionsMaxHeight:"(number|string)",optionsStyle:"string",optionsTemplate:"(function|null)",placeholder:"string",required:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",search:"(boolean|string)",searchNoResultsLabel:"string",selectAll:"boolean",selectAllLabel:"string",selectionType:"string",selectionTypeCounterText:"string",valid:"boolean",value:"(string|array|null)"};class Tr extends V{constructor(e,i){super(e,i),this._uniqueId=this._config.id||this._element.id||a(`${this.constructor.NAME}`),this._uniqueName=this._config.name||this._element.name||this._uniqueId,this._configureNativeSelect(),this._indicatorElement=null,this._selectAllElement=null,this._selectionElement=null,this._selectionCleanerElement=null,this._searchElement=null,this._togglerElement=null,this._optionsElement=null,this._clone=null,this._menu=null,this._selected=[],this._options=this._getOptions(),this._popper=null,this._search="",this._config.options.length>0&&this._createNativeOptions(this._element,this._config.options),this._createSelect(),this._addEventListeners(),t.set(this._element,Ko,this)}static get Default(){return Lr}static get DefaultType(){return Ar}static get NAME(){return"multi-select"}toggle(){return this._isShown()?this.hide():this.show()}show(){this._config.disabled||this._isShown()||(M.trigger(this._element,fr),this._clone.classList.add(kr),this._clone.setAttribute("aria-expanded",!0),this._config.container&&(this._menu.style.minWidth=`${this._clone.offsetWidth}px`,this._menu.classList.add(kr)),M.trigger(this._element,gr),this._createPopper(),this._config.search&&W.findOne(or,this._clone).focus())}hide(){M.trigger(this._element,hr),this._popper&&this._popper.destroy(),this._config.search&&(this._searchElement.value=""),this._onSearchChange(this._searchElement),this._clone.classList.remove(kr),this._clone.setAttribute("aria-expanded","false"),this._config.container&&this._menu.classList.remove(kr),M.trigger(this._element,dr)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}search(e){this._search=e.length>0?e.toLowerCase():e,this._filterOptionsList(),M.trigger(this._element,pr)}update(e){e.value&&this.deselectAll(),this._config={...this._config,...this._configAfterMerge(e)},this._selected=[],this._options=this._getOptions(),this._menu.remove(),this._clone.remove(),this._element.innerHTML="",this._createNativeOptions(this._element,this._options),this._createSelect(),this._addEventListeners()}selectAll(e=this._options){for(const t of e)t.disabled||(t.label?this.selectAll(t.options):this._selectOption(t.value,t.text))}deselectAll(e=this._options){for(const t of e)t.disabled||(t.label?this.deselectAll(t.options):this._deselectOption(t.value))}getValue(){return this._selected}_addEventListeners(){M.on(this._clone,cr,()=>{this._config.disabled||this.show()}),M.on(this._clone,ur,e=>{"Escape"!==e.key?"global"!==this._config.search||1!==e.key.length&&e.key!==tr&&e.key!==ir||this._searchElement.focus():this.hide()}),M.on(this._menu,ur,e=>{"global"!==this._config.search||1!==e.key.length&&e.key!==tr&&e.key!==ir||this._searchElement.focus()}),M.on(this._togglerElement,ur,e=>{if(!this._isShown()&&(e.key===nr||e.key===er))return e.preventDefault(),void this.show();this._isShown()&&e.key===er&&(e.preventDefault(),this._selectMenuItem(e))}),M.on(this._indicatorElement,cr,e=>{e.preventDefault(),e.stopPropagation(),this.toggle()}),M.on(this._searchElement,_r,()=>{this._onSearchChange(this._searchElement)}),M.on(this._searchElement,ur,e=>{this._isShown()||this.show(),e.key!==er||this._searchElement.value.length!==this._searchElement.selectionStart?(e.key!==tr&&e.key!==ir||0!==e.target.value.length||this._deselectLastOption(),this._searchElement.focus()):this._selectMenuItem(e)}),M.on(this._selectAllElement,cr,e=>{e.preventDefault(),e.stopPropagation(),this.selectAll()}),M.on(this._optionsElement,cr,e=>{e.preventDefault(),e.stopPropagation(),this._onOptionsClick(e.target)}),M.on(this._selectionCleanerElement,cr,e=>{this._config.disabled||(e.preventDefault(),e.stopPropagation(),this.deselectAll())}),M.on(this._optionsElement,ur,e=>{e.key===nr&&this._onOptionsClick(e.target),[Zo,er].includes(e.key)&&(e.preventDefault(),this._selectMenuItem(e))})}_getClassNames(){return this._element.classList.value.split(" ")}_getOptions(){return this._config.options?this._getOptionsFromConfig():this._getOptionsFromElement()}_getOptionsFromConfig(e=this._config.options){const t=[];for(const i of e){if(i.options&&Array.isArray(i.options)){const e={...i};delete e.label,delete e.options,t.push({...e,label:i.label,options:this._getOptionsFromConfig(i.options)});continue}const e=String(i.value),n=i.selected||this._config.value&&this._config.value.includes(e),s="object"==typeof i?{...i}:{};delete s.value,delete s.selected,delete s.disabled,t.push({...s,value:e,...n&&{selected:!0},...i.disabled&&{disabled:!0}}),n&&this._selected.push({value:String(i.value),text:i.text})}return t}_getOptionsFromElement(e=this._element){const t=Array.from(e.childNodes).filter(e=>"OPTION"===e.nodeName||"OPTGROUP"===e.nodeName),i=[];for(const e of t){if("OPTION"===e.nodeName&&e.value){const t=String(e.value),n=e.innerHTML,s=e.selected||this._config.value&&this._config.value.includes(e.value);i.push({value:t,text:n,selected:s,disabled:e.disabled}),(e.selected||s)&&this._selected.push({value:t,text:e.innerHTML,...e.disabled&&{disabled:!0}})}"OPTGROUP"===e.nodeName&&i.push({label:e.label,options:this._getOptionsFromElement(e)})}return i}_configureNativeSelect(){this._element.classList.add(wr),this._config.multiple&&this._element.setAttribute("multiple",!0),this._config.required&&this._element.setAttribute("required",!0)}_createNativeOptions(e,t){for(const i of t)if(void 0===i.options){const t=document.createElement("OPTION");t.value=i.value,!0===i.disabled&&t.setAttribute("disabled","disabled"),!0===i.selected&&t.setAttribute("selected","selected"),t.innerHTML=i.text,e.append(t)}else{const t=document.createElement("optgroup");t.label=i.label,this._createNativeOptions(t,i.options),e.append(t)}}_hideNativeSelect(){this._element.tabIndex="-1",this._element.style.display="none"}_createSelect(){const e=document.createElement("div");e.classList.add(wr),e.classList.toggle("is-invalid",this._config.invalid),e.classList.toggle("is-valid",this._config.valid),e.role="combobox",e.setAttribute("aria-expanded","false"),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",`${this._uniqueId}-listbox`),this._config.disabled&&this._element.classList.add(yr);for(const t of this._getClassNames())e.classList.add(t);this._clone=e,this._element.parentNode.insertBefore(e,this._element.nextSibling),this._createSelection(),this._createButtons(),this._config.search&&(this._createSearchInput(),this._updateSearch()),this._element.setAttribute("id",this._uniqueId),this._element.setAttribute("name",this._uniqueName),this._createOptionsContainer(),this._hideNativeSelect(),this._updateOptionsList()}_createSelection(){const e=document.createElement("div");e.classList.add("form-multi-select-input-group"),this._togglerElement=e,this._config.search||this._config.disabled||(e.tabIndex=0);const t=document.createElement("div");t.classList.add("form-multi-select-selection"),this._config.multiple&&"tags"===this._config.selectionType&&t.classList.add("form-multi-select-selection-tags"),e.append(t),this._clone.append(e),this._updateSelection(),this._selectionElement=t}_createButtons(){const e=document.createElement("div");if(e.classList.add("form-multi-select-buttons"),!this._config.disabled&&this._config.cleaner&&this._config.multiple){const t=document.createElement("button");t.type="button",t.classList.add("form-multi-select-cleaner"),t.style.display="none",t.setAttribute("aria-label",this._config.ariaCleanerLabel),e.append(t),this._selectionCleanerElement=t}const t=document.createElement("button");t.type="button",t.classList.add("form-multi-select-indicator"),t.setAttribute("aria-label",this._config.ariaIndicatorLabel),this._config.disabled&&(t.tabIndex=-1),e.append(t),this._indicatorElement=t,this._togglerElement.append(e),this._updateSelectionCleaner()}_createPopper(){if(void 0===Tt)throw new TypeError("CoreUI's multi select require Popper (https://popper.js.org)");const e={modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents"}},{name:"offset",options:{offset:[0,2]}}],placement:g()?"bottom-end":"bottom-start"};this._popper=At(this._togglerElement,this._menu,e)}_createSearchInput(){const e=document.createElement("input");e.classList.add("form-multi-select-search"),this._config.disabled&&(e.disabled=!0),e.setAttribute("id",`search-${this._uniqueId}`),e.setAttribute("name",`search-${this._uniqueName}`),this._searchElement=e,this._updateSearchSize(),this._selectionElement.append(e)}_createOptionsContainer(){const e=document.createElement("div");if(e.classList.add("form-multi-select-dropdown"),e.role="listbox",e.setAttribute("id",`${this._uniqueId}-listbox`),this._config.multiple&&e.setAttribute("aria-multiselectable","true"),this._config.selectAll&&this._config.multiple){const t=document.createElement("button");t.type="button",t.classList.add("form-multi-select-all"),t.innerHTML=this._config.selectAllLabel,this._selectAllElement=t,e.append(t)}const t=document.createElement("div");t.classList.add("form-multi-select-options"),"auto"!==this._config.optionsMaxHeight&&(t.style.maxHeight=`${this._config.optionsMaxHeight}px`,t.style.overflow="auto"),e.append(t);const{container:i}=this._config;i?i.append(e):this._clone.append(e),this._createOptions(t,this._options),this._optionsElement=t,this._menu=e}_createOptions(e,t){for(const i of t){if(void 0!==i.value){const t=document.createElement("div");t.classList.add(Dr),i.disabled&&t.classList.add(yr),"checkbox"===this._config.optionsStyle&&t.classList.add("form-multi-select-option-with-checkbox"),t.dataset.value=String(i.value),t.tabIndex=0,t.role="option",this._config.optionsTemplate&&"function"==typeof this._config.optionsTemplate?t.innerHTML=this._config.sanitize?$t(this._config.optionsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsTemplate(i):t.textContent=i.text,e.append(t)}if(void 0!==i.label){const t=document.createElement("div");t.classList.add("form-multi-select-optgroup");const n=document.createElement("div");this._config.optionsGroupsTemplate&&"function"==typeof this._config.optionsGroupsTemplate?n.innerHTML=this._config.sanitize?$t(this._config.optionsGroupsTemplate(i),this._config.allowList,this._config.sanitizeFn):this._config.optionsGroupsTemplate(i):n.textContent=i.label,n.classList.add("form-multi-select-optgroup-label"),t.append(n),this._createOptions(t,i.options),e.append(t)}}}_createTag(e,t,i){const n=document.createElement("div");if(n.classList.add("form-multi-select-tag"),n.dataset.value=e,n.innerHTML=t,!this._config.disabled&&!0!==i){const t=document.createElement("button");t.type="button",t.classList.add("form-multi-select-tag-delete"),t.setAttribute("aria-label","Close"),M.on(t,cr,t=>{t.preventDefault(),t.stopPropagation(),n.remove(),this._deselectOption(e)}),n.append(t)}return n}_onOptionsClick(e){if(e.classList.contains("label"))return;if(!e.classList.contains(Dr)&&!(e=e.closest(sr)))return;const t=String(e.dataset.value),{text:i}=this._findOptionByValue(t);this._config.multiple&&e.classList.contains(Er)?this._deselectOption(t):this._config.multiple&&!e.classList.contains(Er)?this._selectOption(t,i):this._config.multiple||this._selectOption(t,i),this._config.multiple||(this.hide(),this.search(""),this._searchElement.value=null),this._config.clearSearchOnSelect&&this._config.search&&(this.search(""),this._searchElement.value=null,this._searchElement.focus())}_findOptionByValue(e,t=this._options){for(const i of t){if(String(i.value)===e)return i;if(i.options&&Array.isArray(i.options)){const t=this._findOptionByValue(e,i.options);if(t)return t}}return null}_selectOption(e,t){this._config.multiple||this.deselectAll(),0===this._selected.filter(t=>t.value===String(e)).length&&this._selected.push({value:String(e),text:t});const i=W.findOne(`option[value="${e}"]`,this._element);i&&(i.selected=!0);const n=W.findOne(`[data-value="${e}"]`,this._optionsElement);n&&(n.classList.add(Er),n.setAttribute("aria-selected","true")),M.trigger(this._element,lr,{value:this._selected}),this._updateSelection(),this._updateSelectionCleaner(),this._updateSearch(),this._updateSearchSize()}_deselectOption(e){this._selected=this._selected.filter(t=>t.value!==String(e)),W.findOne(`option[value="${e}"]`,this._element).selected=!1;const t=W.findOne(`[data-value="${e}"]`,this._optionsElement);t&&(t.classList.remove(Er),t.setAttribute("aria-selected","false")),M.trigger(this._element,lr,{value:this._selected}),this._updateSelection(),this._updateSelectionCleaner(),this._updateSearch(),this._updateSearchSize()}_deselectLastOption(){if(this._selected.length>0){const e=this._selected.findLast(e=>!0!==e.disabled);e&&this._deselectOption(e.value)}}_updateSelection(){const e=W.findOne(".form-multi-select-selection",this._clone),t=W.findOne(or,this._clone);if(0!==this._selected.length||this._config.search){if(this._config.multiple&&"counter"===this._config.selectionType&&!this._config.search&&(e.innerHTML=`${this._selected.length} ${this._config.selectionTypeCounterText}`),this._config.multiple&&"tags"===this._config.selectionType){e.innerHTML="";for(const t of this._selected)e.append(this._createTag(t.value,t.text,t.disabled))}this._config.multiple&&"text"===this._config.selectionType&&(e.innerHTML=this._selected.map((e,t)=>`<span>${e.text}${t===this._selected.length-1?"":","} </span>`).join("")),!this._config.multiple&&this._selected.length>0&&!this._config.search&&(e.innerHTML=this._selected[0].text),t&&e.append(t),this._popper&&this._popper.update()}else e.innerHTML=`<span class="form-multi-select-placeholder">${this._config.placeholder}</span>`}_updateSelectionCleaner(){if(!this._config.cleaner||null===this._selectionCleanerElement)return;const e=W.findOne(".form-multi-select-cleaner",this._clone);this._selected.length>0?e.style.removeProperty("display"):e.style.display="none"}_updateSearch(){this._config.search&&(!this._config.multiple&&this._selected.length>0?this._searchElement.placeholder=this._selected[0].text:this._config.multiple||0!==this._selected.length?this._config.multiple&&this._selected.length>0&&"counter"!==this._config.selectionType?this._searchElement.removeAttribute("placeholder"):this._config.multiple&&0===this._selected.length?this._searchElement.placeholder=this._config.placeholder:this._config.multiple&&"counter"===this._config.selectionType&&(this._searchElement.placeholder=`${this._selected.length} ${this._config.selectionTypeCounterText}`):this._searchElement.placeholder=this._config.placeholder)}_updateSearchSize(e=2){this._searchElement&&this._config.multiple&&(this._selected.length>0&&("tags"===this._config.selectionType||"text"===this._config.selectionType)?this._searchElement.size=e:0!==this._selected.length||"tags"!==this._config.selectionType&&"text"!==this._config.selectionType||this._searchElement.removeAttribute("size"))}_onSearchChange(e){e&&(this.search(e.value),this._updateSearchSize(e.value.length+1))}_updateOptionsList(e=this._options){for(const t of e)t.label?this._updateOptionsList(t.options):t.selected&&this._selectOption(t.value,t.text)}_isVisible(e){return"none"!==window.getComputedStyle(e).display}_isShown(){return this._clone.classList.contains(kr)}_filterOptionsList(){const e=W.find(sr,this._menu);let t=0;for(const i of e){-1===i.textContent.toLowerCase().indexOf(this._search)?i.style.display="none":(i.style.removeProperty("display"),t++);const e=i.closest(".form-multi-select-optgroup");e&&(W.children(e,sr).filter(e=>this._isVisible(e)).length>0?e.style.removeProperty("display"):e.style.display="none")}if(t>0)W.findOne(ar,this._menu)&&W.findOne(ar,this._menu).remove();else if(0===t){const e=document.createElement("div");e.classList.add("form-multi-select-options-empty"),e.innerHTML=this._config.searchNoResultsLabel,W.findOne(ar,this._menu)||W.findOne(".form-multi-select-options",this._menu).append(e)}}_selectMenuItem({key:e,target:t}){const i=W.find(".form-multi-select-options .form-multi-select-option:not(.disabled):not(:disabled)",this._menu).filter(e=>c(e));i.length&&y(i,t,e===er,!i.includes(t)).focus()}_configAfterMerge(e){return!0===e.container&&(e.container=document.body),"object"!=typeof e.container&&"string"!=typeof e.container||(e.container=l(e.container)),"number"==typeof e.value&&(e.value=[String(e.value)]),"string"==typeof e.value&&(e.value=e.value.split(/,\s*/).map(String)),e}static multiSelectInterface(e,t){const i=Tr.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(){Tr.multiSelectInterface(this,e)})}static clearMenus(e){if(e&&(2===e.button||"keyup"===e.type&&"Tab"!==e.key))return;const i=W.find(rr);for(let n=0,s=i.length;n<s;n++){const s=t.get(i[n],Ko);i[n],e&&e.type,s&&s._clone.classList.contains(kr)&&(s._clone.contains(e.target)||(s.hide(),M.trigger(s._element,dr)))}}}M.on(window,vr,()=>{for(const e of W.find(rr))-1!==e.tabIndex&&Tr.multiSelectInterface(e)}),M.on(document,mr,Tr.clearMenus),M.on(document,br,Tr.clearMenus),m(Tr);const Cr="coreui.navigation",Or=`.${Cr}`,xr=".data-api",Sr={activeLinksExact:!0,groupsAutoCollapse:!0},$r={activeLinksExact:"boolean",groupsAutoCollapse:"(string|boolean)"},Ir="active",Nr="show",Pr="nav-group-toggle",Mr=`click${Or}${xr}`,Br=`load${Or}${xr}`,jr=".nav-group",Hr=".nav-group-items",Fr=".nav-group-toggle";class zr extends V{constructor(e,i){super(e),this._config=this._getConfig(i),this._setActiveLink(),this._addEventListeners(),t.set(e,Cr,this)}static get Default(){return Sr}static get DATA_KEY(){return Cr}static get DefaultType(){return $r}static get NAME(){return"navigation"}_setActiveLink(){for(const e of Array.from(this._element.querySelectorAll(".nav-link"))){if(e.classList.contains(Pr))continue;let t=String(window.location);const i=/\?./,n=/#./;(/\?.*=/.test(t)||i.test(t))&&(t=t.split("?")[0]),n.test(t)&&(t=t.split("#")[0]),this._config.activeLinksExact&&e.href===t&&(e.classList.add(Ir),Array.from(this._getParents(e,jr)).forEach(e=>{e.classList.add(Nr),e.setAttribute("aria-expanded",!0)})),!this._config.activeLinksExact&&t.startsWith(e.href)&&(e.classList.add(Ir),Array.from(this._getParents(e,jr)).forEach(e=>{e.classList.add(Nr),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(t)}_slideDown(e){e.style.height="auto";const t=e.clientHeight;e.style.height="0px",setTimeout(()=>{e.style.height=`${t}px`},0),this._queueCallback(()=>{e.style.height="auto"},e,!0)}_slideUp(e,t){const i=e.clientHeight;e.style.height=`${i}px`,setTimeout(()=>{e.style.height="0px"},0),this._queueCallback(()=>{"function"==typeof t&&t()},e,!0)}_toggleGroupItems(e){let t=e.target;t.classList.contains(Pr)||(t=t.closest(Fr));const i=e=>Boolean(e.classList.contains("nav-group")&&e.classList.contains(Nr));if(!0===this._config.groupsAutoCollapse)for(const e of this._getSiblings(t.parentNode,i))this._slideUp(W.findOne(Hr,e),()=>{e.classList.remove(Nr),e.setAttribute("aria-expanded",!1)});t.parentNode.classList.contains(Nr)?this._slideUp(W.findOne(Hr,t.parentNode),()=>{t.parentNode.classList.remove(Nr),t.parentNode.setAttribute("aria-expanded",!1)}):(t.parentNode.classList.add(Nr),t.parentNode.setAttribute("aria-expanded",!0),this._slideDown(W.findOne(Hr,t.parentNode)))}_addEventListeners(){M.on(this._element,Mr,Fr,e=>{e.preventDefault(),this._toggleGroupItems(e,this)})}static navigationInterface(e,t){const i=zr.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(){zr.navigationInterface(this,e)})}}M.on(window,Br,()=>{for(const e of Array.from(document.querySelectorAll('[data-coreui="navigation"]')))zr.navigationInterface(e)}),m(zr);const Vr=".coreui.offcanvas",Rr=".data-api",Wr=`load${Vr}${Rr}`,qr="show",Yr="showing",Ur="hiding",Gr=".offcanvas.show",Qr=`show${Vr}`,Kr=`shown${Vr}`,Xr=`hide${Vr}`,Jr=`hidePrevented${Vr}`,Zr=`hidden${Vr}`,el=`resize${Vr}`,tl=`click${Vr}${Rr}`,il=`keydown.dismiss${Vr}`,nl={backdrop:!0,keyboard:!0,scroll:!1},sl={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class al extends V{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return nl}static get DefaultType(){return sl}static get NAME(){return"offcanvas"}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||M.trigger(this._element,Qr,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._backdrop.show(),this._config.scroll||(new $o).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Yr),this._queueCallback(()=>{this._config.scroll&&!this._config.backdrop||this._focustrap.activate(),this._element.classList.add(qr),this._element.classList.remove(Yr),M.trigger(this._element,Kr,{relatedTarget:e})},this._element,!0))}hide(){this._isShown&&(M.trigger(this._element,Xr).defaultPrevented||(this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Ur),this._backdrop.hide(),this._queueCallback(()=>{this._element.classList.remove(qr,Ur),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||(new $o).reset(),M.trigger(this._element,Zr)},this._element,!0)))}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=Boolean(this._config.backdrop);return new To({className:"offcanvas-backdrop",isVisible:e,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:e?()=>{"static"!==this._config.backdrop?this.hide():M.trigger(this._element,Jr)}:null})}_initializeFocusTrap(){return new Zs({trapElement:this._element})}_addEventListeners(){M.on(this._element,il,e=>{"Escape"===e.key&&(this._config.keyboard?this.hide():M.trigger(this._element,Jr))})}static jQueryInterface(e){return this.each(function(){const t=al.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}M.on(document,tl,'[data-coreui-toggle="offcanvas"]',function(e){const t=W.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),h(this))return;M.one(t,Zr,()=>{c(this)&&this.focus()});const i=W.findOne(Gr);i&&i!==t&&al.getInstance(i).hide(),al.getOrCreateInstance(t).toggle(this)}),M.on(window,Wr,()=>{for(const e of W.find(Gr))al.getOrCreateInstance(e).show()}),M.on(window,el,()=>{for(const e of W.find("[aria-modal][class*=show][class*=offcanvas-]"))"fixed"!==getComputedStyle(e).position&&al.getOrCreateInstance(e).hide()}),q(al),m(al);const ol=".form-control",rl=`${ol}:not([disabled]) ~ [data-coreui-toggle="password"]`;class ll extends V{static get NAME(){return"password-input"}toggle(){this._element.type="password"===this._element.type?"text":"password"}static jQueryInterface(e){return this.each(function(){ll.getOrCreateInstance(this)[e](this)})}}M.on(document,"click.coreui.password-input.data-api",rl,e=>{e.preventDefault();const t=e.target.closest(rl);ll.getOrCreateInstance(W.findOne(ol,t.parentNode)).toggle()}),m(ll);const cl={allowList:Ct,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},hl={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},dl={entry:"(string|element|function|null)",selector:"(string|element)"};class ul extends z{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return cl}static get DefaultType(){return hl}static get NAME(){return"TemplateFactory"}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,i]of Object.entries(this._config.content))this._setContent(e,i,t);const t=e.children[0],i=this._resolvePossibleFunction(this._config.extraClass);return i&&t.classList.add(...i.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,i]of Object.entries(e))super._typeCheckConfig({selector:t,entry:i},dl)}_setContent(e,t,i){const n=W.findOne(i,e);n&&((t=this._resolvePossibleFunction(t))?r(t)?this._putElementInTemplate(l(t),n):this._config.html?n.innerHTML=this._maybeSanitize(t):n.textContent=t:n.remove())}_maybeSanitize(e){return this._config.sanitize?$t(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return b(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}}const _l=new Set(["sanitize","allowList","sanitizeFn"]),pl="fade",fl="show",gl=".tooltip-inner",ml=".modal",bl="hide.coreui.modal",vl="hover",yl="focus",wl="click",Dl={AUTO:"auto",TOP:"top",RIGHT:g()?"left":"right",BOTTOM:"bottom",LEFT:g()?"right":"left"},El={allowList:Ct,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},kl={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class Ll extends V{constructor(e,t){if(void 0===Tt)throw new TypeError("CoreUI's dropdowns require Popper (https://popper.js.org/docs/v2/)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return El}static get DefaultType(){return kl}static get NAME(){return"tooltip"}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),M.off(this._element.closest(ml),bl,this._hideModalHandler),this._element.getAttribute("data-coreui-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-coreui-original-title")),this._disposePopper(),super.dispose()}show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=M.trigger(this._element,this.constructor.eventName("show")),t=(d(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return;this._disposePopper();const i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));const{container:n}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(n.append(i),M.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(fl),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))M.on(e,"mouseover",u);this._queueCallback(()=>{M.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!M.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(fl),"ontouchstart"in document.documentElement)for(const e of[].concat(...document.body.children))M.off(e,"mouseover",u);this._activeTrigger[wl]=!1,this._activeTrigger[yl]=!1,this._activeTrigger[vl]=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),M.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(pl,fl),t.classList.add(`bs-${this.constructor.NAME}-auto`);const i=a(this.constructor.NAME).toString();return t.setAttribute("id",i),this._isAnimated()&&t.classList.add(pl),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new ul({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[gl]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-coreui-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(pl)}_isShown(){return this.tip&&this.tip.classList.contains(fl)}_createPopper(e){const t=b(this._config.placement,[this,e,this._element]),i=Dl[t.toUpperCase()];return At(this._element,e,this._getPopperConfig(i))}_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}_resolvePossibleFunction(e){return b(e,[this._element,this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:e=>{this._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return{...t,...b(this._config.popperConfig,[void 0,t])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)M.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger[wl]=!(t._isShown()&&t._activeTrigger[wl]),t.toggle()});else if("manual"!==t){const e=t===vl?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),i=t===vl?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");M.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?yl:vl]=!0,t._enter()}),M.on(this._element,i,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?yl:vl]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},M.on(this._element.closest(ml),bl,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-coreui-original-title",e),this._element.removeAttribute("title"))}_enter(){this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show))}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=F.getDataAttributes(this._element);for(const e of Object.keys(t))_l.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=!1===e.container?document.body:l(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"==typeof e.title&&(e.title=e.title.toString()),"number"==typeof e.content&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,i]of Object.entries(this._config))this.constructor.Default[t]!==i&&(e[t]=i);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=Ll.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}m(Ll);const Al=".popover-header",Tl=".popover-body",Cl={...Ll.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},Ol={...Ll.DefaultType,content:"(null|string|element|function)"};class xl extends Ll{static get Default(){return Cl}static get DefaultType(){return Ol}static get NAME(){return"popover"}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Al]:this._getTitle(),[Tl]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=xl.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}})}}m(xl);const Sl=".coreui.range-slider",$l=`change${Sl}`,Il=`load${Sl}.data-api`,Nl=`mousedown${Sl}`,Pl=`mousemove${Sl}`,Ml=`mouseup${Sl}`,Bl=`resize${Sl}`,jl="range-slider-track",Hl=".range-slider-input",Fl=".range-slider-label",zl={clickableLabels:!0,disabled:!1,distance:0,labels:!1,max:100,min:0,name:null,step:1,tooltips:!0,tooltipsFormat:null,track:"fill",value:0,vertical:!1},Vl={clickableLabels:"boolean",disabled:"boolean",distance:"number",labels:"(array|boolean|string)",max:"number",min:"number",name:"(array|string|null)",step:"(number|string)",tooltips:"boolean",tooltipsFormat:"(function|null)",track:"(boolean|string)",value:"(array|number)",vertical:"boolean"};class Rl extends V{constructor(e,t){super(e),this._config=this._getConfig(t),this._currentValue=this._config.value,this._dragIndex=0,this._inputs=[],this._isDragging=!1,this._sliderTrack=null,this._thumbSize=null,this._tooltips=[],this._initializeRangeSlider()}static get Default(){return zl}static get DefaultType(){return Vl}static get NAME(){return"range-slider"}update(e){this._config=this._getConfig(e),this._currentValue=this._config.value,this._element.innerHTML="",this._initializeRangeSlider()}_addEventListeners(){this._config.disabled||(M.on(this._element,"input",Hl,e=>{const{target:t}=e;this._isDragging=!1;const i=W.children(t.parentElement,Hl),n=Array.from(i).indexOf(t);this._updateValue(t.value,n)}),M.on(this._element,Nl,Fl,e=>{if(!this._config.clickableLabels||0!==e.button)return;const t=F.getDataAttribute(e.target,"value");this._updateNearestValue(t)}),M.on(this._element,Nl,".range-slider-inputs-container",e=>{if(0!==e.button)return;if(!(e.target instanceof HTMLInputElement||e.target.className.includes(jl)))return;this._isDragging=!0;const t=this._calculateClickValue(e);this._dragIndex=this._getNearestValueIndex(t),this._updateNearestValue(t)}),M.on(document.documentElement,Ml,()=>{this._isDragging=!1}),M.on(document.documentElement,Pl,e=>{if(!this._isDragging)return;const t=this._calculateMoveValue(e);this._updateValue(t,this._dragIndex)}),M.on(window,Bl,()=>{this._updateLabelsContainerSize()}))}_initializeRangeSlider(){this._element.classList.add("range-slider"),this._config.vertical&&this._element.classList.add("range-slider-vertical"),this._config.disabled&&this._element.classList.add("disabled"),this._sliderTrack=this._createSliderTrack(),this._createInputs(),this._createLabels(),this._updateLabelsContainerSize(),this._createTooltips(),this._updateGradient(),this._addEventListeners()}_createSliderTrack(){return this._createElement("div",jl)}_createInputs(){const e=this._createElement("div","range-slider-inputs-container");for(const[t,i]of this._currentValue.entries()){const n=this._createInput(t,i);e.append(n),this._inputs[t]=n}e.append(this._sliderTrack),this._element.append(e)}_createInput(e,t){const i=this._createElement("input","range-slider-input");return i.type="range",i.min=this._config.min,i.max=this._config.max,i.step=this._config.step,i.value=t,i.name=Array.isArray(this._config.name)?`${this._config.name[e]}`:`${this._config.name||""}-${e}`,i.disabled=this._config.disabled,i.setAttribute("role","slider"),i.setAttribute("aria-valuemin",this._config.min),i.setAttribute("aria-valuemax",this._config.max),i.setAttribute("aria-valuenow",t),i.setAttribute("aria-orientation",this._config.vertical?"vertical":"horizontal"),i}_createLabels(){const{clickableLabels:e,disabled:t,labels:i,min:n,max:s,vertical:a}=this._config;if(!i||!Array.isArray(i)||0===i.length)return;const o=this._createElement("div","range-slider-labels-container");for(const[r,l]of this._config.labels.entries()){const c=this._createElement("div","range-slider-label");if(e&&!t&&c.classList.add("clickable"),l.class){const e=Array.isArray(l.class)?l.class:[l.class];c.classList.add(...e)}l.style&&"object"==typeof l.style&&Object.assign(c.style,l.style);const h=1===i.length?0:r/(i.length-1)*100,d="object"==typeof l?l.value:n+h/100*(s-n);F.setDataAttribute(c,"value",d),c.textContent="object"==typeof l?l.label:l;const u=this._calculateLabelPosition(l,r,h);a?c.style.bottom=u:c.style[g()?"right":"left"]=u,o.append(c)}this._element.append(o)}_calculateLabelPosition(e,t){return"object"==typeof e&&void 0!==e.value?(e.value-this._config.min)/(this._config.max-this._config.min)*100+"%":t/(this._config.labels.length-1)*100+"%"}_updateLabelsContainerSize(){const e=W.findOne(".range-slider-labels-container",this._element);if(!this._config.labels||!e)return;const t=W.find(Fl,this._element);if(0===t.length)return;const i=Math.max(...t.map(e=>this._config.vertical?e.offsetWidth:e.offsetHeight));e.style[this._config.vertical?"width":"height"]=`${i}px`}_createTooltips(){if(!this._config.tooltips)return;const e=W.find(Hl,this._element);this._thumbSize=this._getThumbSize();for(const t of e){const e=this._createElement("div","range-slider-tooltip"),i=this._createElement("div","range-slider-tooltip-inner"),n=this._createElement("div","range-slider-tooltip-arrow");i.innerHTML=this._config.tooltipsFormat?this._config.tooltipsFormat(t.value):t.value,e.append(i,n),t.parentNode.insertBefore(e,t.nextSibling),this._positionTooltip(e,t),this._tooltips.push(e)}}_getThumbSize(){const e=window.getComputedStyle(this._element,null).getPropertyValue(this._config.vertical?"--cui-range-slider-thumb-height":"--cui-range-slider-thumb-width").match(/^(\d+\.?\d*)([%a-z]*)$/i);return e?{value:Number.parseFloat(e[1]),unit:e[2]||null}:"1rem"}_positionTooltip(e,t){const i=this._thumbSize,n=(t.value-this._config.min)/(this._config.max-this._config.min),s=n>.5?`-${(n-.5)*i.value}${i.unit}`:`${(.5-n)*i.value}${i.unit}`;this._config.vertical?Object.assign(e.style,{bottom:100*n+"%",marginBottom:s}):Object.assign(e.style,{insetInlineStart:100*n+"%",marginInlineStart:s})}_updateTooltip(e,t){if(this._config.tooltips&&this._tooltips[e]){this._tooltips[e].children[0].innerHTML=this._config.tooltipsFormat?this._config.tooltipsFormat(t):t;const i=W.find(Hl,this._element)[e];this._positionTooltip(this._tooltips[e],i)}}_calculateClickValue(e){const t=this._getClickPosition(e),i=this._config.min+t*(this._config.max-this._config.min);return this._roundToStep(i,this._config.step)}_calculateMoveValue(e){const t=this._sliderTrack.getBoundingClientRect(),i=this._config.vertical?this._calculateVerticalPosition(e.clientY,t):this._calculateHorizontalPosition(e.clientX,t);if("string"==typeof i)return"max"===i?this._config.max:this._config.min;const n=this._config.min+i*(this._config.max-this._config.min);return this._roundToStep(n,this._config.step)}_calculateVerticalPosition(e,t){return e<t.top?"max":e>t.bottom?"min":Math.min(Math.max((t.bottom-e)/t.height,0),1)}_calculateHorizontalPosition(e,t){if(e<t.left)return g()?"max":"min";if(e>t.right)return g()?"min":"max";const i=g()?t.right-e:e-t.left;return Math.min(Math.max(i/t.width,0),1)}_createElement(e,t){const i=document.createElement(e);return i.classList.add(t),i}_getClickPosition(e){const{offsetX:t,offsetY:i}=e,{offsetWidth:n,offsetHeight:s}=this._sliderTrack;return this._config.vertical?1-i/s:g()?1-t/n:t/n}_getNearestValueIndex(e){const t=this._currentValue,i=t.length;if(e<t[0])return 0;if(e>t[i-1])return i-1;const n=t.map(t=>Math.abs(t-e)),s=Math.min(...n),a=n.indexOf(s);return e<t[a]?a:n.lastIndexOf(s)}_updateGradient(){if(!this._config.track)return;const[e,t]=[Math.min(...this._currentValue),Math.max(...this._currentValue)],i=(e-this._config.min)/(this._config.max-this._config.min)*100,n=(t-this._config.min)/(this._config.max-this._config.min)*100,s=this._config.vertical?"to top":g()?"to left":"to right";1!==this._currentValue.length?this._sliderTrack.style.backgroundImage=`linear-gradient(\n ${s},\n transparent 0%,\n transparent ${i}%,\n var(--cui-range-slider-track-in-range-bg) ${i}%,\n var(--cui-range-slider-track-in-range-bg) ${n}%,\n transparent ${n}%,\n transparent 100%\n )`:this._sliderTrack.style.backgroundImage=`linear-gradient(\n ${s},\n var(--cui-range-slider-track-in-range-bg) 0%,\n var(--cui-range-slider-track-in-range-bg) ${n}%,\n transparent ${n}%,\n transparent 100%\n )`}_updateNearestValue(e){const t=this._getNearestValueIndex(e);this._updateValue(e,t)}_updateValue(e,t){const i=this._validateValue(e,t);this._currentValue[t]=i,this._updateInput(t,i),this._updateGradient(),this._updateTooltip(t,i),M.trigger(this._element,$l,{value:this._currentValue})}_updateInput(e,t){const i=this._inputs[e];i.value=t,i.setAttribute("aria-valuenow",t),setTimeout(()=>{i.focus()})}_validateValue(e,t){const{distance:i}=this._config,{length:n}=this._currentValue;if(1===n)return e;const s=t>0?this._currentValue[t-1]:void 0,a=t<n-1?this._currentValue[t+1]:void 0;if(0===t&&void 0!==a)return Math.min(e,a-i);if(t===n-1&&void 0!==s)return Math.max(e,s+i);if(void 0!==s&&void 0!==a){const t=s+i,n=a-i;return Math.min(Math.max(e,t),n)}return e}_roundToStep(e,t){const i=0===t?1:t;return Math.round(e/i)*i}_configAfterMerge(e){return"string"==typeof e.labels&&(e.labels=e.labels.split(/,\s*/)),"string"==typeof e.name&&(e.name=e.name.split(/,\s*/)),"number"==typeof e.value&&(e.value=[e.value]),"string"==typeof e.value&&(e.value=e.value.split(/,\s*/).map(Number)),e}_getConfig(e){return e={...F.getDataAttributes(this._element),..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static rangeSliderInterface(e,t){const i=Rl.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=Rl.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)}})}}M.on(window,Il,()=>{const e=W.find('[data-coreui-toggle="range-slider"]');for(let t=0,i=e.length;t<i;t++)Rl.rangeSliderInterface(e[t])}),m(Rl);const Wl=".coreui.rating",ql=new Set(["sanitize","allowList","sanitizeFn"]),Yl=`change${Wl}`,Ul=`click${Wl}`,Gl=`focusin${Wl}`,Ql=`focusout${Wl}`,Kl=`hover${Wl}`,Xl=`load${Wl}.data-api`,Jl=`mouseenter${Wl}`,Zl=`mouseleave${Wl}`,ec="active",tc=".rating-item-input",ic=".rating-item-label",nc={activeIcon:null,allowClear:!1,allowList:{...Ct,svg:["xmlns","version","baseprofile","width","height","viewbox","preserveaspectratio","aria-hidden","role","focusable"],g:["id","class","transform","style"],path:["id","class","d","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-dasharray","stroke-dashoffset","stroke-opacity"],circle:["id","class","cx","cy","r","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],rect:["id","class","x","y","width","height","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],ellipse:["id","class","cx","cy","rx","ry","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],line:["id","class","x1","y1","x2","y2","stroke","stroke-width","stroke-opacity"],polygon:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],polyline:["id","class","points","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],text:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],tspan:["id","class","x","y","dx","dy","text-anchor","font-family","font-size","font-weight","fill","fill-opacity","stroke","stroke-width","stroke-opacity"],defs:[],symbol:["id","class","viewbox","preserveaspectratio"],use:["id","class","x","y","width","height","href"],image:["id","class","x","y","width","height","href","preserveaspectratio","xlink:href"],pattern:["id","class","x","y","width","height","patternunits","patterncontentunits","patterntransform","preserveaspectratio"],lineargradient:["id","class","gradientunits","x1","y1","x2","y2","spreadmethod","gradienttransform"],radialgradient:["id","class","gradientunits","cx","cy","r","fx","fy","spreadmethod","gradienttransform"],mask:["id","class","x","y","width","height","maskunits","maskcontentunits","masktransform"],clippath:["id","class","clippathunits"],marker:["id","class","markerunits","markerwidth","markerheight","orient","preserveaspectratio","viewbox","refx","refy"],title:[],desc:[]},disabled:!1,highlightOnlySelected:!1,icon:null,itemCount:5,name:null,precision:1,readOnly:!1,sanitize:!0,sanitizeFn:null,size:null,tooltips:!1,value:null},sc={activeIcon:"(object|string|null)",allowClear:"boolean",allowList:"object",disabled:"boolean",highlightOnlySelected:"boolean",icon:"(object|string|null)",itemCount:"number",name:"(string|null)",precision:"number",readOnly:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",size:"(string|null)",tooltips:"(array|boolean|object)",value:"(number|null)"};class ac extends V{constructor(e,t){super(e),this._config=this._getConfig(t),this._currentValue=this._config.value,this._name=this._config.name||a(`${this.constructor.NAME}-name-`).toString(),this._tooltip=null,this._createRating(),this._addEventListeners()}static get Default(){return nc}static get DefaultType(){return sc}static get NAME(){return"rating"}update(e){this._config=this._getConfig(e),this._currentValue=this._config.value,this._element.innerHTML="",this._createRating(),this._addEventListeners()}reset(e=null){this._currentValue=e,this._element.innerHTML="",this._createRating(),this._addEventListeners(),M.trigger(this._element,Yl,{value:e})}_addEventListeners(){M.on(this._element,Ul,tc,({target:e})=>{this._config.disabled||this._config.readOnly||this._config.allowClear&&this._currentValue==e.value&&(this._currentValue=null,e.checked=!1,this._resetLabels(),M.trigger(this._element,Yl,{value:null}))}),M.on(this._element,Yl,tc,({target:e})=>{if(this._config.disabled||this._config.readOnly)return;this._currentValue=e.value,M.trigger(this._element,Yl,{value:e.value});const t=W.find(tc,this._element);if(this._resetLabels(),this._config.highlightOnlySelected)W.findOne(ic,e.parentElement).classList.add(ec);else for(const i of t)if(W.findOne(ic,i.parentElement).classList.add(ec),i===e)break}),M.on(this._element,Jl,ic,({target:e})=>{if(this._config.disabled||this._config.readOnly)return;const t=e.closest(ic),i=W.find(ic,this._element);this._resetLabels();const n=W.findOne(tc,t.parentElement);if(M.trigger(this._element,Kl,{value:n.value}),this._createTooltip(t.parentElement,n.value),this._config.highlightOnlySelected)t.classList.add(ec);else for(const e of i)if(e.classList.add(ec),e===t)break}),M.on(this._element,Zl,ic,()=>{if(this._config.disabled||this._config.readOnly)return;this._tooltip&&this._tooltip.hide();const e=W.findOne(`${tc}[value="${this._currentValue}"]`,this._element);if(this._resetLabels(),M.trigger(this._element,Kl,{value:null}),e&&this._config.highlightOnlySelected)W.findOne(ic,e.parentElement).classList.add(ec);else if(e){const t=W.find(tc,this._element);this._resetLabels();for(const i of t)if(W.findOne(ic,i.parentElement).classList.add(ec),i===e)break}}),M.on(this._element,Gl,tc,({target:e})=>{M.trigger(this._element,Kl,{value:e.value}),this._createTooltip(e.parentElement,e.value)}),M.on(this._element,Ql,tc,()=>{M.trigger(this._element,Kl,{value:null}),this._tooltip&&this._tooltip.hide()})}_createTooltip(e,t){if(!1===this._config.tooltips)return;let i;this._tooltip&&this._tooltip.hide(),"boolean"==typeof this._config.tooltips&&(i=t),"object"==typeof this._config.tooltips&&(i=this._config.tooltips[t]),Array.isArray(this._config.tooltips)&&(i=this._config.tooltips[t-1]),this._tooltip=new Ll(e,{title:i})}_configAfterMerge(e){return"string"==typeof e.tooltips&&(e.tooltips=e.tooltips.split(",")),e}_resetLabels(){const e=W.find(ic,this._element);for(const t of e)t.classList.remove(ec)}_createRating(){this._element.classList.add("rating"),this._config.size&&this._element.classList.add(`rating-${this._config.size}`),this._config.disabled&&this._element.classList.add("disabled"),this._config.readOnly&&this._element.classList.add("readonly"),this._element.setAttribute("role","radiogroup"),Array.from({length:this._config.itemCount},(e,t)=>this._createRatingItem(t))}_createRatingItem(e){const t=document.createElement("div");t.classList.add("rating-item");const i=1/this._config.precision;Array.from({length:i},(n,s)=>{const o=a(`${this.constructor.NAME}${e}`).toString(),r=s+1<i,l=1===i?e+1:(s+1)*Number(this._config.precision)+e,c=document.createElement("label");if(c.classList.add("rating-item-label"),c.setAttribute("for",o),this._config.highlightOnlySelected&&this._currentValue==l&&c.classList.add(ec),!this._config.highlightOnlySelected&&this._currentValue>=l&&c.classList.add(ec),r&&(c.style.zIndex=1/this._config.precision-s,c.style.position="absolute",c.style.width=this._config.precision*(s+1)*100+"%",c.style.overflow="hidden",c.style.opacity=0),this._config.icon){const t=document.createElement("div");t.classList.add("rating-item-custom-icon"),t.innerHTML=this._sanitizeIcon("object"==typeof this._config.icon?this._config.icon[e+1]:this._config.icon),c.append(t)}else{const e=document.createElement("div");e.classList.add("rating-item-icon"),c.append(e)}if(this._config.icon&&this._config.activeIcon){const t=document.createElement("div");t.classList.add("rating-item-custom-icon-active"),t.innerHTML=this._sanitizeIcon("object"==typeof this._config.activeIcon?this._config.activeIcon[e+1]:this._config.activeIcon),c.append(t)}const h=document.createElement("input");if(h.classList.add("rating-item-input"),h.id=o,h.type="radio",h.value=l,h.name=this._name,(this._config.disabled||this._config.readOnly)&&h.setAttribute("disabled",!0),this._currentValue===l&&(h.checked=!0),1===this._config.precision)t.append(c),t.append(h);else{const e=document.createElement("div");e.append(c),e.append(h),t.append(e)}}),this._element.append(t)}_sanitizeIcon(e){return this._config.sanitize?$t(e,this._config.allowList,this._config.sanitizeFn):e}_getConfig(e){const t=F.getDataAttributes(this._element);for(const e of Object.keys(t))ql.has(e)&&delete t[e];return e={...t,..."object"==typeof e&&e?e:{}},e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static ratingInterface(e,t){const i=ac.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=ac.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}})}}M.on(window,Xl,()=>{const e=W.find('[data-coreui-toggle="rating"]');for(let t=0,i=e.length;t<i;t++)ac.ratingInterface(e[t])}),m(ac);const oc=".coreui.scrollspy",rc=`activate${oc}`,lc=`click${oc}`,cc=`load${oc}.data-api`,hc="active",dc="[href]",uc=".nav-link",_c=`${uc}, .nav-item > ${uc}, .list-group-item`,pc={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},fc={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class gc extends V{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return pc}static get DefaultType(){return fc}static get NAME(){return"scrollspy"}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=l(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(M.off(this._config.target,lc),M.on(this._config.target,lc,dc,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const i=this._rootElement||window,n=t.offsetTop-this._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:n,behavior:"smooth"});i.scrollTop=n}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(e=>this._observerCallback(e),e)}_observerCallback(e){const t=e=>this._targetLinks.get(`#${e.target.id}`),i=e=>{this._previousScrollData.visibleEntryTop=e.target.offsetTop,this._process(t(e))},n=(this._rootElement||document.documentElement).scrollTop,s=n>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=n;for(const a of e){if(!a.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(a));continue}const e=a.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(s&&e){if(i(a),!n)return}else s||e||i(a)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=W.find(dc,this._config.target);for(const t of e){if(!t.hash||h(t))continue;const e=W.findOne(decodeURI(t.hash),this._element);c(e)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,e))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(hc),this._activateParents(e),M.trigger(this._element,rc,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("dropdown-item"))W.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(hc);else for(const t of W.parents(e,".nav, .list-group"))for(const e of W.prev(t,_c))e.classList.add(hc)}_clearActiveClass(e){e.classList.remove(hc);const t=W.find(`${dc}.${hc}`,e);for(const e of t)e.classList.remove(hc)}static jQueryInterface(e){return this.each(function(){const t=gc.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}M.on(window,cc,()=>{for(const e of W.find('[data-coreui-spy="scroll"]'))gc.getOrCreateInstance(e)}),m(gc);const mc=".coreui.sidebar",bc=".data-api",vc={},yc={},wc="hide",Dc="show",Ec="sidebar-narrow",kc="sidebar-narrow-unfoldable",Lc=`hide${mc}`,Ac=`hidden${mc}`,Tc=`show${mc}`,Cc=`shown${mc}`,Oc=`click${mc}${bc}`,xc=`load${mc}${bc}`,Sc=".sidebar";class $c extends V{constructor(e,t){super(e),this._config=this._getConfig(t),this._show=this._isVisible(),this._mobile=this._isMobile(),this._overlaid=this._isOverlaid(),this._narrow=this._isNarrow(),this._unfoldable=this._isUnfoldable(),this._backdrop=this._initializeBackDrop(),this._addEventListeners()}static get Default(){return vc}static get DefaultType(){return yc}static get NAME(){return"sidebar"}show(){M.trigger(this._element,Tc),this._element.classList.contains(wc)&&this._element.classList.remove(wc),this._overlaid&&this._element.classList.add(Dc),this._isMobile()&&(this._element.classList.add(Dc),this._backdrop.show(),(new $o).hide()),this._queueCallback(()=>{!0===this._isVisible()&&(this._show=!0,(this._isMobile()||this._isOverlaid())&&this._addClickOutListener(),M.trigger(this._element,Cc))},this._element,!0)}hide(){M.trigger(this._element,Lc),this._element.classList.contains(Dc)&&this._element.classList.remove(Dc),this._isMobile()&&(this._backdrop.hide(),(new $o).reset()),this._isMobile()||this._overlaid||this._element.classList.add(wc),this._queueCallback(()=>{!1===this._isVisible()&&(this._show=!1,(this._isMobile()||this._isOverlaid())&&this._removeClickOutListener(),M.trigger(this._element,Ac))},this._element,!0)}toggle(){this._isVisible()?this.hide():this.show()}narrow(){this._isMobile()||(this._addClassName(Ec),this._narrow=!0)}unfoldable(){this._isMobile()||(this._addClassName(kc),this._unfoldable=!0)}reset(){this._isMobile()||(this._narrow&&(this._element.classList.remove(Ec),this._narrow=!1),this._unfoldable&&(this._element.classList.remove(kc),this._unfoldable=!1))}toggleNarrow(){this._narrow?this.reset():this.narrow()}toggleUnfoldable(){this._unfoldable?this.reset():this.unfoldable()}_initializeBackDrop(){return new To({className:"sidebar-backdrop",isVisible:this._isMobile(),isAnimated:!0,rootElement:this._element.parentNode,clickCallback:()=>this.hide()})}_isMobile(){return Boolean(window.getComputedStyle(this._element,null).getPropertyValue("--cui-is-mobile"))}_isNarrow(){return this._element.classList.contains(Ec)}_isOverlaid(){return this._element.classList.contains("sidebar-overlaid")}_isUnfoldable(){return this._element.classList.contains(kc)}_isVisible(){const e=this._element.getBoundingClientRect();return e.top>=0&&e.left>=0&&Math.floor(e.bottom)<=(window.innerHeight||document.documentElement.clientHeight)&&Math.floor(e.right)<=(window.innerWidth||document.documentElement.clientWidth)}_addClassName(e){this._element.classList.add(e)}_clickOutListener(e,t){null===e.target.closest(Sc)&&(e.preventDefault(),e.stopPropagation(),t.hide())}_addClickOutListener(){M.on(document,Oc,e=>{this._clickOutListener(e,this)})}_removeClickOutListener(){M.off(document,Oc)}_addEventListeners(){this._mobile&&this._show&&this._addClickOutListener(),this._overlaid&&this._show&&this._addClickOutListener(),M.on(this._element,Oc,"[data-coreui-toggle]",e=>{e.preventDefault();const t=F.getDataAttribute(e.target,"toggle");"narrow"===t&&this.toggleNarrow(),"unfoldable"===t&&this.toggleUnfoldable()}),M.on(this._element,Oc,'[data-coreui-close="sidebar"]',e=>{e.preventDefault(),this.hide()}),M.on(window,"resize",()=>{this._isMobile()&&this._isVisible()&&(this.hide(),this._backdrop=this._initializeBackDrop())})}static sidebarInterface(e,t){const i=$c.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(){$c.sidebarInterface(this,e)})}}M.on(window,xc,()=>{for(const e of Array.from(document.querySelectorAll(Sc)))$c.sidebarInterface(e)}),m($c);const Ic=".coreui.stepper",Nc=`finish${Ic}`,Pc=`reset${Ic}`,Mc=`stepChange${Ic}`,Bc=`stepValidationComplete${Ic}`,jc=`click${Ic}`,Hc=`keydown${Ic}`,Fc=`load${Ic}`,zc="active",Vc="complete",Rc="show",Wc="stepper-step-connector",qc=".stepper",Yc=".stepper-step",Uc=".stepper-step-button",Gc=".stepper-step-content",Qc=".stepper-step-indicator",Kc=".stepper-step-indicator-icon",Xc=".stepper-pane",Jc="ArrowLeft",Zc="ArrowRight",eh="ArrowUp",th="ArrowDown",ih="Home",nh="End",sh={linear:!0,skipValidation:!1},ah={linear:"boolean",skipValidation:"boolean"};class oh extends V{constructor(e,t){super(e,t),this._stepButtons=this._getStepButtons(),this._activeStepButton=this._getActiveElem(),this._initialStepButton=this._activeStepButton,this._isFinished=!1,this._addStepperConnector(),this._resetPanes(this._getTargetPane(this._activeStepButton)),this._wrapIndicatorText(),this._setInitialComplete(),this._updateStepButtonsDisabledState(),this._setupAccessibilityAttributes(),M.on(this._element,Hc,e=>this._keydown(e))}static get Default(){return sh}static get DefaultType(){return ah}static get NAME(){return"stepper"}showStep(e){let t=e;if("number"==typeof e&&(t=this._stepButtons[e-1]),!t)return;const i=this._getActiveElem();if(i&&!this._isCurrentStepValid(i))return;if(this._elemIsActive(t))return;if(this._config.linear){const e=this._getEnabledStepButtons();if(e.indexOf(t)>e.indexOf(i)+1)return}const n=this._stepButtons.indexOf(t)+1;M.trigger(this._element,Mc,{index:n}),this._activeStepButton=t,this._deactivate(i),this._activate(t),this._updateStepButtonsDisabledState(),this._complete(t)}next(){if(this._isFinished)return;if(!this._isCurrentStepValid(this._getActiveElem()))return;const e=this._getEnabledStepButtons(),t=this._getActiveElem(),i=e.indexOf(t),n=e[i+1];n&&this.showStep(n)}prev(){if(this._isFinished)return;const e=this._getEnabledStepButtons(),t=this._getActiveElem(),i=e.indexOf(t),n=e[i-1];n&&this.showStep(n)}finish(){if(this._isFinished)return;if(!this._isCurrentStepValid(this._getActiveElem()))return;const e=this._getEnabledStepButtons(),t=this._getActiveElem(),i=e.indexOf(t);if(i!==e.length-1){const t=e[i+1];return void(t&&this.showStep(t))}const n=()=>{t.classList.remove(zc),this._markAsComplete(t),M.trigger(this._element,Nc),this._isFinished=!0,this._disableStepButtons()},s=this._getTargetPane(t),a=t.parentNode.querySelector(Gc);s?(s.classList.remove(zc,Rc),n()):a?this._animateHeight(a,!1,n):n()}reset(){const e=this._getEnabledStepButtons();if(!e.length)return;for(const e of W.find(Xc,this._element))e.classList.remove(zc,Rc),e.setAttribute("aria-hidden","true");for(const e of W.find(Gc,this._element))e.classList.remove(zc,Rc),e.setAttribute("aria-hidden","true");for(const t of e)t.classList.remove(zc,Vc),this._removeIndicatorIcon(t),t.disabled=!1;for(const e of this._element.querySelectorAll(`${Xc} form, ${Gc} form`))e.reset();const t=this._initialStepButton||e[0];t.classList.add(zc);const i=this._getTargetPane(t);if(i)i.classList.add(zc,Rc),i.setAttribute("aria-hidden","false");else{const e=t.parentNode.querySelector(Gc);e&&(e.classList.add(zc,Rc),e.setAttribute("aria-hidden","false"))}this._updateCompleteStates(this._stepButtons.indexOf(t)),this._activeStepButton=t,this._isFinished=!1,this._updateStepButtonsDisabledState(),M.trigger(this._element,Pc)}_getStepButtons(){return W.find(Uc,this._element)}_getEnabledStepButtons(){return this._getStepButtons().filter(e=>!h(e))}_getActiveElem(){return this._stepButtons.find(e=>this._elemIsActive(e))||null}_getTargetPane(e){return W.getElementFromSelector(e)}_elemIsActive(e){return e.classList.contains(zc)}_isCurrentStepValid(e){if(this._config.skipValidation)return!0;const t=this._getTargetPane(e),i=null!=t?t:e.parentNode.querySelector(Gc);if(!i)return!0;const n=i.querySelector("form");if(!n)return!0;const s=n.checkValidity();return M.trigger(this._element,Bc,{stepIndex:this._stepButtons.indexOf(e)+1,isValid:s}),!!s||(n.noValidate?n.classList.add("was-validated"):n.reportValidity(),!1)}_activate(e){if(!e)return;e.classList.add(zc),e.setAttribute("aria-selected","true"),e.setAttribute("tabIndex","0");const t=this._getTargetPane(e);t&&(t.classList.add(zc,Rc),t.setAttribute("aria-hidden","false"));const i=W.findOne(Gc,e.parentNode);i&&this._animateHeight(i,!0)}_deactivate(e){if(this._resetPanes(),!e)return;e.setAttribute("aria-selected","false"),e.setAttribute("tabIndex","-1");const t=W.findOne(Gc,e.parentNode);t?this._animateHeight(t,!1,()=>e.classList.remove(zc)):e.classList.remove(zc)}_complete(e){const t=e.closest(".stepper-steps")||document,i=W.find(Yc,t).indexOf(e.parentNode);-1!==i&&this._updateCompleteStates(i)}_markAsComplete(e){const t=e.closest(Yc);if(t){const e=W.findOne(Uc,t);e&&(e.classList.add(Vc),this._appendIndicatorIcon(e))}}_updateCompleteStates(e){for(const[t,i]of this._stepButtons.entries()){const n=t<e;i.classList.toggle(Vc,n),n?this._appendIndicatorIcon(i):this._removeIndicatorIcon(i)}}_setInitialComplete(){const e=W.find(Yc,this._element),t=this._getActiveElem();if(!t)return;const i=e.indexOf(t.closest(Yc));-1!==i&&this._updateCompleteStates(i)}_appendIndicatorIcon(e){const t=W.findOne(Qc,e);if(t&&!W.findOne(Kc,t)){const e=document.createElement("span");e.classList.add("stepper-step-indicator-icon"),t.append(e)}}_removeIndicatorIcon(e){const t=W.findOne(Qc,e);if(!t)return;const i=W.findOne(Kc,t);i&&i.remove()}_updateStepButtonsDisabledState(){const e=this._stepButtons.indexOf(this._activeStepButton);for(const[t,i]of this._stepButtons.entries())i.disabled=this._config.linear&&t>e+1}_disableStepButtons(){for(const e of this._stepButtons)e.disabled=!0}_animateHeight(e,t,i){const n=t?0:e.scrollHeight,s=t?e.scrollHeight:0;e.style.height=`${n}px`,e.style.overflow="hidden",e.offsetHeight,requestAnimationFrame(()=>{e.style.height=`${s}px`,this._queueCallback(()=>{e.style.overflow="initial",t&&(e.style.height="auto"),null==i||i()},e,!0)})}_resetPanes(e=null){for(const t of W.find(Xc,this._element)){const i=t===e;t.classList.toggle(zc,i),t.classList.toggle(Rc,i),t.setAttribute("aria-hidden",!i)}}_addStepperConnector(){for(const[e,t]of this._stepButtons.entries())if(e<this._stepButtons.length-1){const e=t.nextElementSibling;if(!e||!e.classList.contains(Wc)){const e=document.createElement("div");e.classList.add(Wc),t.after(e)}}}_wrapIndicatorText(){for(const e of this._stepButtons){const t=W.findOne(Qc,e);if(!t)continue;const i=Array.from(t.childNodes).filter(e=>e.nodeType===Node.TEXT_NODE?""!==e.textContent.trim():e.nodeType===Node.ELEMENT_NODE);if(1!==i.length||i[0].nodeType!==Node.TEXT_NODE)continue;const n=i[0],s=document.createElement("span");s.classList.add("stepper-step-indicator-text"),s.textContent=n.textContent.trim(),n.replaceWith(s)}}_setupAccessibilityAttributes(){const e=a(this.constructor.NAME).toString();for(const[t,i]of this._stepButtons.entries()){const n=i.closest(Yc);n&&n.setAttribute("role","presentation"),i.setAttribute("role","tab"),i.id||(i.id=`${e}${t+1}`);const s=W.getElementFromSelector(i);s&&(i.setAttribute("aria-controls",s.id),s.setAttribute("role","tabpanel"),s.setAttribute("aria-labelledby",i.id),s.setAttribute("aria-live","polite"),s.setAttribute("aria-hidden",!this._elemIsActive(i))),this._elemIsActive(i)?(i.setAttribute("aria-selected","true"),i.setAttribute("tabIndex","0")):(i.setAttribute("aria-selected","false"),i.setAttribute("tabIndex","-1"))}}_keydown(e){var t;if(![Jc,Zc,eh,th,ih,nh].includes(e.key))return;e.stopPropagation(),e.preventDefault();const i=this._getEnabledStepButtons();let n;switch(e.key){case ih:n=i[0];break;case nh:n=i[i.length-1];break;case Zc:case th:n=y(i,e.target,!0,!0);break;case Jc:case eh:n=y(i,e.target,!1,!0)}null==(t=n)||t.focus({preventScroll:!0})}static jQueryInterface(e){return this.each(function(){const t=oh.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}M.on(document,jc,Uc,function(e){if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),h(this))return;const t=this.closest(qc);t&&oh.getOrCreateInstance(t).showStep(this)}),M.on(document,jc,"[data-coreui-stepper-action]",function(){const e=F.getDataAttribute(this,"stepper-action"),t=this.closest(qc);if(!t)return;const i=oh.getOrCreateInstance(t);i&&"function"==typeof i[e]&&i[e]()}),M.on(window,Fc,()=>{for(const e of W.find('[data-coreui-toggle="stepper"]'))oh.getOrCreateInstance(e)}),m(oh);const rh=".coreui.tab",lh=`hide${rh}`,ch=`hidden${rh}`,hh=`show${rh}`,dh=`shown${rh}`,uh=`click${rh}`,_h=`keydown${rh}`,ph=`load${rh}`,fh="ArrowLeft",gh="ArrowRight",mh="ArrowUp",bh="ArrowDown",vh="Home",yh="End",wh="active",Dh="fade",Eh="show",kh=".dropdown-toggle",Lh=`:not(${kh})`,Ah='[data-coreui-toggle="tab"], [data-coreui-toggle="pill"], [data-coreui-toggle="list"]',Th=`.nav-link${Lh}, .list-group-item${Lh}, [role="tab"]${Lh}, ${Ah}`,Ch=`.${wh}[data-coreui-toggle="tab"], .${wh}[data-coreui-toggle="pill"], .${wh}[data-coreui-toggle="list"]`;class Oh extends V{constructor(e){super(e),this._parent=this._element.closest('.list-group, .nav, [role="tablist"]'),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),M.on(this._element,_h,e=>this._keydown(e)))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),i=t?M.trigger(t,lh,{relatedTarget:e}):null;M.trigger(e,hh,{relatedTarget:t}).defaultPrevented||i&&i.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add(wh),this._activate(W.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),M.trigger(e,dh,{relatedTarget:t})):e.classList.add(Eh)},e,e.classList.contains(Dh)))}_deactivate(e,t){e&&(e.classList.remove(wh),e.blur(),this._deactivate(W.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),M.trigger(e,ch,{relatedTarget:t})):e.classList.remove(Eh)},e,e.classList.contains(Dh)))}_keydown(e){if(![fh,gh,mh,bh,vh,yh].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(e=>!h(e));let i;if([vh,yh].includes(e.key))i=t[e.key===vh?0:t.length-1];else{const n=[gh,bh].includes(e.key);i=y(t,e.target,n,!0)}i&&(i.focus({preventScroll:!0}),Oh.getOrCreateInstance(i).show())}_getChildren(){return W.find(Th,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),i=this._getOuterElement(e);e.setAttribute("aria-selected",t),i!==e&&this._setAttributeIfNotExists(i,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=W.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const i=this._getOuterElement(e);if(!i.classList.contains("dropdown"))return;const n=(e,n)=>{const s=W.findOne(e,i);s&&s.classList.toggle(n,t)};n(kh,wh),n(".dropdown-menu",Eh),i.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,i){e.hasAttribute(t)||e.setAttribute(t,i)}_elemIsActive(e){return e.classList.contains(wh)}_getInnerElement(e){return e.matches(Th)?e:W.findOne(Th,e)}_getOuterElement(e){return e.closest(".nav-item, .list-group-item")||e}static jQueryInterface(e){return this.each(function(){const t=Oh.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}})}}M.on(document,uh,Ah,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),h(this)||Oh.getOrCreateInstance(this).show()}),M.on(window,ph,()=>{for(const e of W.find(Ch))Oh.getOrCreateInstance(e)}),m(Oh);const xh=".coreui.toast",Sh=`mouseover${xh}`,$h=`mouseout${xh}`,Ih=`focusin${xh}`,Nh=`focusout${xh}`,Ph=`hide${xh}`,Mh=`hidden${xh}`,Bh=`show${xh}`,jh=`shown${xh}`,Hh="hide",Fh="show",zh="showing",Vh={animation:"boolean",autohide:"boolean",delay:"number"},Rh={animation:!0,autohide:!0,delay:5e3};class Wh extends V{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Rh}static get DefaultType(){return Vh}static get NAME(){return"toast"}show(){M.trigger(this._element,Bh).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove(Hh),_(this._element),this._element.classList.add(Fh,zh),this._queueCallback(()=>{this._element.classList.remove(zh),M.trigger(this._element,jh),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(M.trigger(this._element,Ph).defaultPrevented||(this._element.classList.add(zh),this._queueCallback(()=>{this._element.classList.add(Hh),this._element.classList.remove(zh,Fh),M.trigger(this._element,Mh)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Fh),super.dispose()}isShown(){return this._element.classList.contains(Fh)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const i=e.relatedTarget;this._element===i||this._element.contains(i)||this._maybeScheduleHide()}_setListeners(){M.on(this._element,Sh,e=>this._onInteraction(e,!0)),M.on(this._element,$h,e=>this._onInteraction(e,!1)),M.on(this._element,Ih,e=>this._onInteraction(e,!0)),M.on(this._element,Nh,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Wh.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e](this)}})}}return q(Wh),m(Wh),{Alert:Q,Autocomplete:di,Button:_i,Calendar:Ln,Carousel:as,Collapse:vs,DatePicker:Ha,DateRangePicker:ka,Dropdown:ho,LoadingButton:wo,Modal:Qo,MultiSelect:Tr,Navigation:zr,OffCanvas:al,PasswordInput:ll,Popover:xl,RangeSlider:Rl,Rating:ac,ScrollSpy:gc,Sidebar:$c,Stepper:oh,Tab:Oh,TimePicker:Ys,Toast:Wh,Tooltip:Ll}});
//# sourceMappingURL=coreui.bundle.min.js.map