@coreui/coreui-pro
Version:
The most popular front-end framework for developing responsive, mobile-first projects on the web rewritten by the CoreUI Team
6 lines • 206 kB
JavaScript
/*!
* CoreUI v5.14.2 (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)
*/
import*as Popper from"@popperjs/core";const elementMap=new Map,Data={set(e,t,i){elementMap.has(e)||elementMap.set(e,new Map);const n=elementMap.get(e);n.has(t)||0===n.size?n.set(t,i):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(n.keys())[0]}.`)},get:(e,t)=>elementMap.has(e)&&elementMap.get(e).get(t)||null,remove(e,t){if(!elementMap.has(e))return;const i=elementMap.get(e);i.delete(t),0===i.size&&elementMap.delete(e)}},MAX_UID=1e6,MILLISECONDS_MULTIPLIER=1e3,TRANSITION_END="transitionend",parseSelector=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,((e,t)=>`#${CSS.escape(t)}`))),e),toType=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},getTransitionDurationFromElement=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:i}=window.getComputedStyle(e);const n=Number.parseFloat(t),s=Number.parseFloat(i);return n||s?(t=t.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(i))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END))},isElement=e=>!(!e||"object"!=typeof e)&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType),getElement=e=>isElement(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(parseSelector(e)):null,isVisible=e=>{if(!isElement(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),i=e.closest("details:not([open])");if(!i)return t;if(i!==e){const t=e.closest("summary");if(t&&t.parentNode!==i)return!1;if(null===t)return!1}return t},isDisabled=e=>!e||e.nodeType!==Node.ELEMENT_NODE||!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")),findShadowRoot=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?findShadowRoot(e.parentNode):null},noop=()=>{},reflow=e=>{e.offsetHeight},getjQuery=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,DOMContentLoadedCallbacks=[],onDOMContentLoaded=e=>{"loading"===document.readyState?(DOMContentLoadedCallbacks.length||document.addEventListener("DOMContentLoaded",(()=>{for(const e of DOMContentLoadedCallbacks)e()})),DOMContentLoadedCallbacks.push(e)):e()},isRTL=()=>"rtl"===document.documentElement.dir,defineJQueryPlugin=e=>{onDOMContentLoaded((()=>{const t=getjQuery();if(t){const i=e.NAME,n=t.fn[i];t.fn[i]=e.jQueryInterface,t.fn[i].Constructor=e,t.fn[i].noConflict=()=>(t.fn[i]=n,e.jQueryInterface)}}))},execute=(e,t=[],i=e)=>"function"==typeof e?e.call(...t):i,executeAfterTransition=(e,t,i=!0)=>{if(!i)return void execute(e);const n=getTransitionDurationFromElement(t)+5;let s=!1;const a=({target:i})=>{i===t&&(s=!0,t.removeEventListener(TRANSITION_END,a),execute(e))};t.addEventListener(TRANSITION_END,a),setTimeout((()=>{s||triggerTransitionEnd(t)}),n)},getNextActiveElement=(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))])},namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function makeEventUid(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getElementEvents(e){const t=makeEventUid(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function bootstrapHandler(e,t){return function i(n){return hydrateObj(n,{delegateTarget:e}),i.oneOff&&EventHandler.off(e,n.type,t),t.apply(e,[n])}}function bootstrapDelegationHandler(e,t,i){return function n(s){const a=e.querySelectorAll(t);for(let{target:r}=s;r&&r!==this;r=r.parentNode)for(const o of a)if(o===r)return hydrateObj(s,{delegateTarget:r}),n.oneOff&&EventHandler.off(e,s.type,t,i),i.apply(r,[s])}}function findHandler(e,t,i=null){return Object.values(e).find((e=>e.callable===t&&e.delegationSelector===i))}function normalizeParameters(e,t,i){const n="string"==typeof t,s=n?i:t||i;let a=getTypeEvent(e);return nativeEvents.has(a)||(a=e),[n,s,a]}function addHandler(e,t,i,n,s){if("string"!=typeof t||!e)return;let[a,r,o]=normalizeParameters(t,i,n);if(t in customEvents){const e=e=>function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)};r=e(r)}const l=getElementEvents(e),c=l[o]||(l[o]={}),_=findHandler(c,r,a?i:null);if(_)return void(_.oneOff=_.oneOff&&s);const d=makeEventUid(r,t.replace(namespaceRegex,"")),h=a?bootstrapDelegationHandler(e,i,r):bootstrapHandler(e,r);h.delegationSelector=a?i:null,h.callable=r,h.oneOff=s,h.uidEvent=d,c[d]=h,e.addEventListener(o,h,a)}function removeHandler(e,t,i,n,s){const a=findHandler(t[i],n,s);a&&(e.removeEventListener(i,a,Boolean(s)),delete t[i][a.uidEvent])}function removeNamespacedHandlers(e,t,i,n){const s=t[i]||{};for(const[a,r]of Object.entries(s))a.includes(n)&&removeHandler(e,t,i,r.callable,r.delegationSelector)}function getTypeEvent(e){return e=e.replace(stripNameRegex,""),customEvents[e]||e}const EventHandler={on(e,t,i,n){addHandler(e,t,i,n,!1)},one(e,t,i,n){addHandler(e,t,i,n,!0)},off(e,t,i,n){if("string"!=typeof t||!e)return;const[s,a,r]=normalizeParameters(t,i,n),o=r!==t,l=getElementEvents(e),c=l[r]||{},_=t.startsWith(".");if(void 0===a){if(_)for(const i of Object.keys(l))removeNamespacedHandlers(e,l,i,t.slice(1));for(const[i,n]of Object.entries(c)){const s=i.replace(stripUidRegex,"");o&&!t.includes(s)||removeHandler(e,l,r,n.callable,n.delegationSelector)}}else{if(!Object.keys(c).length)return;removeHandler(e,l,r,a,s?i:null)}},trigger(e,t,i){if("string"!=typeof t||!e)return null;const n=getjQuery();let s=null,a=!0,r=!0,o=!1;t!==getTypeEvent(t)&&n&&(s=n.Event(t,i),n(e).trigger(s),a=!s.isPropagationStopped(),r=!s.isImmediatePropagationStopped(),o=s.isDefaultPrevented());const l=hydrateObj(new Event(t,{bubbles:a,cancelable:!0}),i);return o&&l.preventDefault(),r&&e.dispatchEvent(l),l.defaultPrevented&&s&&s.preventDefault(),l}};function hydrateObj(e,t={}){for(const[i,n]of Object.entries(t))try{e[i]=n}catch(t){Object.defineProperty(e,i,{configurable:!0,get:()=>n})}return e}function normalizeData(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch(t){return e}}function normalizeDataKey(e){return e.replace(/[A-Z]/g,(e=>`-${e.toLowerCase()}`))}const Manipulator={setDataAttribute(e,t,i){e.setAttribute(`data-bs-${normalizeDataKey(t)}`,i)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${normalizeDataKey(t)}`)},getDataAttributes(e){if(!e)return{};const t={},i=Object.keys(e.dataset).filter((e=>e.startsWith("bs")&&!e.startsWith("bsConfig")));for(const n of i){let i=n.replace(/^bs/,"");i=i.charAt(0).toLowerCase()+i.slice(1),t[i]=normalizeData(e.dataset[n])}return t},getDataAttribute:(e,t)=>normalizeData(e.getAttribute(`data-bs-${normalizeDataKey(t)}`))};class Config{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const i=isElement(t)?Manipulator.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof i?i:{},...isElement(t)?Manipulator.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[i,n]of Object.entries(t)){const t=e[i],s=isElement(t)?"element":toType(t);if(!new RegExp(n).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${i}" provided type "${s}" but expected type "${n}".`)}}}const VERSION="5.14.2";class BaseComponent extends Config{constructor(e,t){super(),(e=getElement(e))&&(this._element=e,this._config=this._getConfig(t),Data.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Data.remove(this._element,this.constructor.DATA_KEY),EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,i=!0){executeAfterTransition(e,t,i)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Data.get(getElement(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return VERSION}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const getSelector=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let i=e.getAttribute("href");if(!i||!i.includes("#")&&!i.startsWith("."))return null;i.includes("#")&&!i.startsWith("#")&&(i=`#${i.split("#")[1]}`),t=i&&"#"!==i?i.trim():null}return t?t.split(",").map((e=>parseSelector(e))).join(","):null},SelectorEngine={find:(e,t=document.documentElement)=>[].concat(...Element.prototype.querySelectorAll.call(t,e)),findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[].concat(...e.children).filter((e=>e.matches(t))),parents(e,t){const i=[];let n=e.parentNode.closest(t);for(;n;)i.push(n),n=n.parentNode.closest(t);return i},prev(e,t){let i=e.previousElementSibling;for(;i;){if(i.matches(t))return[i];i=i.previousElementSibling}return[]},next(e,t){let i=e.nextElementSibling;for(;i;){if(i.matches(t))return[i];i=i.nextElementSibling}return[]},focusableChildren(e){const t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((e=>`${e}:not([tabindex^="-"])`)).join(",");return this.find(t,e).filter((e=>!isDisabled(e)&&isVisible(e)))},getSelectorFromElement(e){const t=getSelector(e);return t&&SelectorEngine.findOne(t)?t:null},getElementFromSelector(e){const t=getSelector(e);return t?SelectorEngine.findOne(t):null},getMultipleElementsFromSelector(e){const t=getSelector(e);return t?SelectorEngine.find(t):[]}},enableDismissTrigger=(e,t="hide")=>{const i=`click.dismiss${e.EVENT_KEY}`,n=e.NAME;EventHandler.on(document,i,`[data-bs-dismiss="${n}"]`,(function(i){if(["A","AREA"].includes(this.tagName)&&i.preventDefault(),isDisabled(this))return;const s=SelectorEngine.getElementFromSelector(this)||this.closest(`.${n}`);e.getOrCreateInstance(s)[t]()}))},NAME$r="alert",DATA_KEY$m="bs.alert",EVENT_KEY$n=".bs.alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert",CLASS_NAME_FADE$5="fade",CLASS_NAME_SHOW$f="show";class Alert extends BaseComponent{static get NAME(){return NAME$r}close(){if(EventHandler.trigger(this._element,EVENT_CLOSE).defaultPrevented)return;this._element.classList.remove("show");const e=this._element.classList.contains("fade");this._queueCallback((()=>this._destroyElement()),this._element,e)}_destroyElement(){this._element.remove(),EventHandler.trigger(this._element,EVENT_CLOSED),this.dispose()}static jQueryInterface(e){return this.each((function(){const t=Alert.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e](this)}}))}}enableDismissTrigger(Alert,"close"),defineJQueryPlugin(Alert);const NAME$q="button",DATA_KEY$l="bs.button",EVENT_KEY$m=`.${DATA_KEY$l}`,DATA_API_KEY$h=".data-api",CLASS_NAME_ACTIVE$6="active",SELECTOR_DATA_TOGGLE$f='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$g=`click${EVENT_KEY$m}.data-api`;class Button extends BaseComponent{static get NAME(){return NAME$q}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}static jQueryInterface(e){return this.each((function(){const t=Button.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}EventHandler.on(document,EVENT_CLICK_DATA_API$g,SELECTOR_DATA_TOGGLE$f,(e=>{e.preventDefault();const t=e.target.closest(SELECTOR_DATA_TOGGLE$f);Button.getOrCreateInstance(t).toggle()})),defineJQueryPlugin(Button);const convertIsoWeekToDate=e=>{const[t,i]=e.split(/[Ww]/),n=new Date(Number(t),0,4);return n.setDate(n.getDate()-(n.getDay()||7)+1+7*(Number(i)-1)),n},convertToDateObject=(e,t)=>{if(null===e)return null;if(e instanceof Date)return e;if("week"===t)return convertIsoWeekToDate(e);if("month"===t||"year"===t){const t=new Date(Date.parse(e)),i=6e4*t.getTimezoneOffset();return new Date(t.getTime()+i)}return new Date(Date.parse(e))},createGroupsInArray=(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)))},getCalendarDate=(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,getDateBySelectionType=(e,t)=>{if(null===e)return null;if("week"===t)return`${e.getFullYear()}W${getWeekNumber(e)}`;if("month"===t){const t=`0${e.getMonth()+1}`.slice(-2);return`${e.getFullYear()}-${t}`}return"year"===t?`${e.getFullYear()}`:e},getMonthsNames=(e,t="short")=>Array.from({length:12},((i,n)=>new Date(2e3,n,1).toLocaleString(e,{month:t}))),getYears=(e,t=6)=>Array.from({length:2*t},((i,n)=>e-t+n)),getLeadingDays=(e,t,i)=>{const n=[],s=new Date(e,t),a=s.getFullYear(),r=s.getMonth();let o=6-(6-new Date(a,r,1).getDay())-i;i&&(o=o<0?7+o:o);for(let e=-1*o;e<0;e++)n.push({date:new Date(a,r,e+1),month:"previous"});return n},getMonthDays=(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},getTrailingDays=(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},getWeekNumber=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 1+Math.round((t.getTime()-i.getTime())/864e5/7)},getMonthDetails=(e,t,i)=>{const n=getLeadingDays(e,t,i),s=getMonthDays(e,t),a=getTrailingDays(e,t,n,s),r=[...n,...s,...a],o=[];for(const[e,t]of r.entries())e%7!=0&&0!==o.length||o.push({days:[]}),(e+1)%7==0&&(o[o.length-1].weekNumber=getWeekNumber(t.date)),o[o.length-1].days.push(t);return o},isDateDisabled=(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&&isSameDateAs(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)&&isDateInRange(e,t[0],t[1]))return!0;if(t instanceof Date&&isSameDateAs(e,t))return!0}return!1},isDateInRange=(e,t,i)=>{const n=removeTimeFromDate(e),s=t?removeTimeFromDate(t):null,a=i?removeTimeFromDate(i):null;return Boolean(s&&a&&s<=n&&n<=a)},isDateSelected=(e,t,i)=>!(null===t||!isSameDateAs(t,e))||!(null===i||!isSameDateAs(i,e)),isDisableDateInRange=(e,t,i)=>{if(e&&t){const n=new Date(e);let s=!1;for(;n<t;)if(n.setDate(n.getDate()+1),isDateDisabled(n,null,null,i)){s=!0;break}return s}return!1},isMonthDisabled=(e,t,i,n)=>{const s=12*e.getFullYear()+e.getMonth(),a=t?12*t.getFullYear()+t.getMonth():null,r=i?12*i.getFullYear()+i.getMonth():null;if(a&&s<a)return!0;if(r&&s>r)return!0;if(void 0===n)return!1;const o=t?Math.max(e.getTime(),t.getTime()):e,l=i?Math.min(e.getTime(),i.getTime()):new Date((new Date).getFullYear(),11,31);for(const e=new Date(o);e<=l;e.setDate(e.getDate()+1))if(!isDateDisabled(e,t,i,n))return!1;return!1},isMonthSelected=(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()},isMonthInRange=(e,t,i)=>{const n=e.getFullYear(),s=e.getMonth(),a=t?12*t.getFullYear()+t.getMonth():null,r=i?12*i.getFullYear()+i.getMonth():null,o=12*n+s;return Boolean(a&&r&&a<=o&&o<=r)},isSameDateAs=(e,t)=>e instanceof Date&&t instanceof Date?e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear():null===e&&null===t,isToday=e=>{const t=new Date;return isSameDateAs(e,t)},isYearDisabled=(e,t,i,n)=>{const s=e.getFullYear(),a=t?t.getFullYear():null,r=i?i.getFullYear():null;if(a&&s<a)return!0;if(r&&s>r)return!0;if(void 0===n)return!1;const o=t?Math.max(e.getTime(),t.getTime()):e,l=i?Math.min(e.getTime(),i.getTime()):new Date((new Date).getFullYear(),11,31);for(const e=new Date(o);e<=l;e.setDate(e.getDate()+1))if(!isDateDisabled(e,t,i,n))return!1;return!1},isYearSelected=(e,t,i)=>{const n=e.getFullYear();return null!==t&&n===t.getFullYear()||null!==i&&n===i.getFullYear()},isYearInRange=(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)},removeTimeFromDate=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},setTimeFromDate=(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},NAME$p="calendar",DATA_KEY$k="bs.calendar",EVENT_KEY$l=`.${DATA_KEY$k}`,DATA_API_KEY$g=".data-api",ARROW_UP_KEY$4="ArrowUp",ARROW_RIGHT_KEY$3="ArrowRight",ARROW_DOWN_KEY$4="ArrowDown",ARROW_LEFT_KEY$3="ArrowLeft",ENTER_KEY$3="Enter",SPACE_KEY$1="Space",EVENT_BLUR=`blur${EVENT_KEY$l}`,EVENT_CALENDAR_DATE_CHANGE=`calendarDateChange${EVENT_KEY$l}`,EVENT_CALENDAR_MOUSE_LEAVE=`calendarMouseleave${EVENT_KEY$l}`,EVENT_CELL_HOVER=`cellHover${EVENT_KEY$l}`,EVENT_END_DATE_CHANGE$1=`endDateChange${EVENT_KEY$l}`,EVENT_FOCUS=`focus${EVENT_KEY$l}`,EVENT_KEYDOWN$6=`keydown${EVENT_KEY$l}`,EVENT_SELECT_END_CHANGE=`selectEndChange${EVENT_KEY$l}`,EVENT_START_DATE_CHANGE$1=`startDateChange${EVENT_KEY$l}`,EVENT_MOUSEENTER$3=`mouseenter${EVENT_KEY$l}`,EVENT_MOUSELEAVE$3=`mouseleave${EVENT_KEY$l}`,EVENT_LOAD_DATA_API$d=`load${EVENT_KEY$l}.data-api`,EVENT_CLICK_DATA_API$f=`click${EVENT_KEY$l}.data-api`,CLASS_NAME_CALENDAR_CELL="calendar-cell",CLASS_NAME_CALENDAR_CELL_INNER="calendar-cell-inner",CLASS_NAME_CALENDAR_ROW="calendar-row",CLASS_NAME_CALENDARS$1="calendars",CLASS_NAME_SHOW_WEEK_NUMBERS="show-week-numbers",SELECTOR_BTN_DOUBLE_NEXT=".btn-double-next",SELECTOR_BTN_DOUBLE_PREV=".btn-double-prev",SELECTOR_BTN_MONTH=".btn-month",SELECTOR_BTN_NEXT=".btn-next",SELECTOR_BTN_PREV=".btn-prev",SELECTOR_BTN_YEAR=".btn-year",SELECTOR_CALENDAR$1=".calendar",SELECTOR_CALENDAR_CELL=".calendar-cell",SELECTOR_CALENDAR_CELL_CLICKABLE='.calendar-cell[tabindex="0"]',SELECTOR_CALENDAR_ROW=".calendar-row",SELECTOR_CALENDAR_ROW_CLICKABLE='.calendar-row[tabindex="0"]',SELECTOR_DATA_TOGGLE$e='[data-bs-toggle="calendar"]',Default$n={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},DefaultType$n={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 Calendar extends BaseComponent{constructor(e,t){super(e),this._config=this._getConfig(t),this._initializeDates(),this._initializeView(),this._createCalendar(),this._addEventListeners()}static get Default(){return Default$n}static get DefaultType(){return DefaultType$n}static get NAME(){return NAME$p}update(e){this._config=this._getConfig(e),this._initializeDates(),this._initializeView(),this._element.innerHTML="",this._createCalendar()}_focusOnFirstAvailableCell(){const e=SelectorEngine.findOne('.calendar-cell[tabindex="0"]',this._element);e&&e.focus()}_getDate(e){if("week"===this._config.selectionType){const t=SelectorEngine.findOne(".calendar-cell",e.closest(".calendar-row"));return new Date(Manipulator.getDataAttribute(t,"date"))}return new Date(Manipulator.getDataAttribute(e,"date"))}_handleCalendarClick(e){const t=e.target.classList.contains("calendar-cell-inner")?e.target.parentElement:e.target,i=this._getDate(t),n=new Date(i),s=Manipulator.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(isDateDisabled(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)),"ArrowRight"===e.key||"ArrowLeft"===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key){if(e.preventDefault(),this._maxDate&&t>=convertToDateObject(this._maxDate,this._config.selectionType)&&("ArrowRight"===e.key||"ArrowDown"===e.key))return;if(this._minDate&&t<=convertToDateObject(this._minDate,this._config.selectionType)&&("ArrowLeft"===e.key||"ArrowUp"===e.key))return;let i=e.target;"week"===this._config.selectionType&&-1===i.tabIndex&&(i=i.closest('.calendar-row[tabindex="0"]'));const n=SelectorEngine.find("week"===this._config.selectionType?'.calendar-row[tabindex="0"]':'.calendar-cell[tabindex="0"]',this._element),s=n.indexOf(i),a=0===s,r=s===n.length-1,o={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("ArrowRight"===e.key&&r||"ArrowDown"===e.key&&o.end<l.ArrowDown||"ArrowLeft"===e.key&&a||"ArrowUp"===e.key&&o.start<Math.abs(l.ArrowUp)){const t=e=>{const t=SelectorEngine.find('.calendar-cell[tabindex="0"], .calendar-row[tabindex="0"]',this._element);t.length&&"ArrowRight"===e&&t[0].focus(),t.length&&"ArrowLeft"===e&&t[t.length-1].focus(),t.length&&"ArrowDown"===e&&t[l.ArrowDown-(n.length-s)].focus(),t.length&&"ArrowUp"===e&&t[t.length-(Math.abs(l.ArrowUp)+1-(s+1))].focus()};return"days"===this._view&&this._modifyCalendarDate(0,"ArrowRight"===e.key||"ArrowDown"===e.key?1:-1,t.bind(this,e.key)),"months"===this._view&&this._modifyCalendarDate("ArrowRight"===e.key||"ArrowDown"===e.key?1:-1,0,t.bind(this,e.key)),void("years"===this._view&&this._modifyCalendarDate("ArrowRight"===e.key||"ArrowDown"===e.key?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;"ArrowRight"===e.key||"ArrowDown"===e.key?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("calendar-cell-inner")?e.target.parentElement:e.target,i=this._getDate(t);isDateDisabled(i,this._minDate,this._maxDate,this._config.disabledDates)||(this._hoverDate=setTimeFromDate(i,this._selectEndDate?this._endDate:this._startDate),EventHandler.trigger(this._element,EVENT_CELL_HOVER,{date:getDateBySelectionType(this._hoverDate,this._config.selectionType)}),this._updateClassNamesAndAriaLabels())}_handleCalendarMouseLeave(){this._hoverDate=null,EventHandler.trigger(this._element,EVENT_CELL_HOVER,{date:null}),this._updateClassNamesAndAriaLabels()}_addEventListeners(){EventHandler.on(this._element,EVENT_CLICK_DATA_API$f,'.calendar-cell[tabindex="0"]',(e=>{this._handleCalendarClick(e)})),EventHandler.on(this._element,EVENT_KEYDOWN$6,'.calendar-cell[tabindex="0"]',(e=>{this._handleCalendarKeydown(e)})),EventHandler.on(this._element,EVENT_MOUSEENTER$3,'.calendar-cell[tabindex="0"]',(e=>{this._handleCalendarMouseEnter(e)})),EventHandler.on(this._element,EVENT_MOUSELEAVE$3,'.calendar-cell[tabindex="0"]',(()=>{this._handleCalendarMouseLeave()})),EventHandler.on(this._element,EVENT_FOCUS,'.calendar-cell[tabindex="0"]',(e=>{this._handleCalendarMouseEnter(e)})),EventHandler.on(this._element,EVENT_BLUR,'.calendar-cell[tabindex="0"]',(()=>{this._handleCalendarMouseLeave()})),EventHandler.on(this._element,EVENT_CLICK_DATA_API$f,'.calendar-row[tabindex="0"]',(e=>{this._handleCalendarClick(e)})),EventHandler.on(this._element,EVENT_KEYDOWN$6,'.calendar-row[tabindex="0"]',(e=>{this._handleCalendarKeydown(e)})),EventHandler.on(this._element,EVENT_MOUSEENTER$3,'.calendar-row[tabindex="0"]',(e=>{this._handleCalendarMouseEnter(e)})),EventHandler.on(this._element,EVENT_MOUSELEAVE$3,'.calendar-row[tabindex="0"]',(()=>{this._handleCalendarMouseLeave()})),EventHandler.on(this._element,EVENT_FOCUS,'.calendar-row[tabindex="0"]',(e=>{this._handleCalendarMouseEnter(e)})),EventHandler.on(this._element,EVENT_BLUR,'.calendar-row[tabindex="0"]',(()=>{this._handleCalendarMouseLeave()})),this._addNavigationEventListeners(),EventHandler.on(this._element,EVENT_MOUSELEAVE$3,"table",(()=>{EventHandler.trigger(this._element,EVENT_CALENDAR_MOUSE_LEAVE)}))}_addNavigationEventListeners(){const e={[SELECTOR_BTN_PREV]:()=>this._modifyCalendarDate(0,-1),[SELECTOR_BTN_DOUBLE_PREV]:()=>this._modifyCalendarDate("years"===this._view?-10:-1),[SELECTOR_BTN_NEXT]:()=>this._modifyCalendarDate(0,1),[SELECTOR_BTN_DOUBLE_NEXT]:()=>this._modifyCalendarDate("years"===this._view?10:1),[SELECTOR_BTN_MONTH]:()=>{this._view="months",this._updateCalendar()},[SELECTOR_BTN_YEAR]:()=>{this._view="years",this._updateCalendar()}};for(const[t,i]of Object.entries(e))EventHandler.on(this._element,EVENT_CLICK_DATA_API$f,t,(e=>{e.preventDefault();const n=SelectorEngine.find(t,this._element).indexOf(e.target.closest(t));i();const s=SelectorEngine.find(t,this._element);s&&s[n]&&s[n].focus()}))}_setCalendarDate(e){this._calendarDate=e,EventHandler.trigger(this._element,EVENT_CALENDAR_DATE_CHANGE,{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&&EventHandler.trigger(this._element,EVENT_CALENDAR_DATE_CHANGE,{date:a}),this._updateCalendar(i)}_setEndDate(e){this._endDate=setTimeFromDate(e,this._endDate),EventHandler.trigger(this._element,EVENT_END_DATE_CHANGE$1,{date:getDateBySelectionType(this._endDate,this._config.selectionType)})}_setStartDate(e){this._startDate=setTimeFromDate(e,this._startDate),EventHandler.trigger(this._element,EVENT_START_DATE_CHANGE$1,{date:getDateBySelectionType(this._startDate,this._config.selectionType)})}_setSelectEndDate(e){this._selectEndDate=e,EventHandler.trigger(this._element,EVENT_SELECT_END_CHANGE,{value:e})}_selectDate(e){if(!isDateDisabled(e,this._minDate,this._maxDate,this._config.disabledDates))return this._config.range?this._selectEndDate?(this._setSelectEndDate(!1),this._startDate&&this._startDate>e||isDisableDateInRange(this._startDate,e,this._config.disabledDates)?(this._setStartDate(null),void this._setEndDate(null)):void this._setEndDate(e)):this._endDate&&this._endDate<e||isDisableDateInRange(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=getCalendarDate(this._calendarDate,e,this._view),n=i.getFullYear(),s=i.getMonth(),a=document.createElement("div");a.classList.add("calendar"),Manipulator.setDataAttribute(a,"calendar-index",e);const r=document.createElement("div");r.classList.add("calendar-nav"),r.innerHTML=`\n <div class="calendar-nav-prev">\n <button class="btn btn-transparent btn-sm 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="btn btn-transparent btn-sm 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="btn btn-transparent btn-sm btn-month">\n ${i.toLocaleDateString(this._config.locale,{month:"long"})}\n </button>`:""}\n <button class="btn btn-transparent btn-sm 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="btn btn-transparent btn-sm btn-next" aria-label="${this._config.ariaNavNextMonthLabel}">\n <span class="calendar-nav-icon calendar-nav-icon-next"></span>\n </button>`:""}\n <button class="btn btn-transparent btn-sm 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 o=getMonthDetails(n,s,this._config.firstDayOfWeek),l=createGroupsInArray(getMonthsNames(this._config.locale),4),c=createGroupsInArray(getYears(i.getFullYear()),4),_=o[0].days,d=document.createElement("table");return d.innerHTML=`\n ${"days"===this._view?`\n <thead>\n <tr>\n ${this._config.showWeekNumber?`<th class="calendar-cell">\n <div class="calendar-header-cell-inner">\n ${null!=(t=this._config.weekNumbersLabel)?t:""}\n </div>\n </th>`:""}\n ${_.map((({date:e})=>`<th class="calendar-cell" 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?o.map((e=>{const t=convertToDateObject(0===e.weekNumber?`${i.getFullYear()}W53`:`${i.getFullYear()}W${e.weekNumber}`,this._config.selectionType),n=this._rowWeekAttributes(t);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">${0===e.weekNumber?53:e.weekNumber}</td>`:""}\n ${e.days.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-bs-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-bs-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-bs-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(r,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=convertToDateObject(this._config.calendarDate||this._config.startDate||this._config.endDate||new Date,this._config.selectionType),this._startDate=convertToDateObject(this._config.startDate,this._config.selectionType),this._endDate=convertToDateObject(this._config.endDate,this._config.selectionType),this._minDate=convertToDateObject(this._config.minDate,this._config.selectionType),this._maxDate=convertToDateObject(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=SelectorEngine.find(".calendar-row",this._element);for(const t of e){const e=SelectorEngine.findOne(".calendar-cell",t),i=new Date(Manipulator.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=SelectorEngine.find('.calendar-cell[tabindex="0"]',this._element);for(const t of e){const e=new Date(Manipulator.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=isDateDisabled(e,this._minDate,this._maxDate,this._config.disabledDates),s=isDateSelected(e,this._startDate,this._endDate);return{className:this._classNames({[CLASS_NAME_CALENDAR_CELL]:!0,..."day"===this._config.selectionType&&"days"===this._view&&{clickable:!i&&this._config.selectAdjacementDays,disabled:n,range:i&&isDateInRange(e,this._startDate,this._endDate),"range-hover":i&&(this._hoverDate&&this._selectEndDate?isDateInRange(e,this._startDate,this._hoverDate):isDateInRange(e,this._hoverDate,this._endDate)),selected:s},today:isToday(e),[t]:!0}),tabIndex:"day"!==this._config.selectionType||!i&&!this._config.selectAdjacementDays||n?-1:0,ariaSelected:s}}_cellMonthAttributes(e){const t=isMonthDisabled(e,this._minDate,this._maxDate,this._config.disabledDates),i=isMonthSelected(e,this._startDate,this._endDate);return{className:this._classNames({[CLASS_NAME_CALENDAR_CELL]:!0,disabled:t,"range-hover":"month"===this._config.selectionType&&(this._hoverDate&&this._selectEndDate?isMonthInRange(e,this._startDate,this._hoverDate):isMonthInRange(e,this._hoverDate,this._endDate)),range:isMonthInRange(e,this._startDate,this._endDate),selected:i}),tabIndex:t?-1:0,ariaSelected:i}}_cellYearAttributes(e){const t=isYearDisabled(e,this._minDate,this._maxDate,this._config.disabledDates),i=isYearSelected(e,this._startDate,this._endDate);return{className:this._classNames({[CLASS_NAME_CALENDAR_CELL]:!0,disabled:t,"range-hover":"year"===this._config.selectionType&&(this._hoverDate&&this._selectEndDate?isYearInRange(e,this._startDate,this._hoverDate):isYearInRange(e,this._hoverDate,this._endDate)),range:isYearInRange(e,this._startDate,this._endDate),selected:i}),tabIndex:t?-1:0,ariaSelected:i}}_rowWeekAttributes(e){const t=isDateDisabled(e,this._minDate,this._maxDate,this._config.disabledDates),i=isDateSelected(e,this._startDate,this._endDate);return{className:this._classNames({[CLASS_NAME_CALENDAR_ROW]:!0,disabled:t,range:"week"===this._config.selectionType&&isDateInRange(e,this._startDate,this._endDate),"range-hover":"week"===this._config.selectionType&&(this._hoverDate&&this._selectEndDate?isYearInRange(e,this._startDate,this._hoverDate):isYearInRange(e,this._hoverDate,this._endDate)),selected:i}),tabIndex:"week"!==this._config.selectionType||t?-1:0,ariaSelected:i}}static calendarInterface(e,t){const i=Calendar.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=Calendar.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError(`No method named "${e}"`);t[e]()}}))}}EventHandler.on(window,EVENT_LOAD_DATA_API$d,(()=>{for(const e of Array.from(document.querySelectorAll(SELECTOR_DATA_TOGGLE$e)))Calendar.calendarInterface(e)})),defineJQueryPlugin(Calendar);const NAME$o="swipe",EVENT_KEY$k=".bs.swipe",EVENT_TOUCHSTART="touchstart.bs.swipe",EVENT_TOUCHMOVE="touchmove.bs.swipe",EVENT_TOUCHEND="touchend.bs.swipe",EVENT_POINTERDOWN="pointerdown.bs.swipe",EVENT_POINTERUP="pointerup.bs.swipe",POINTER_TYPE_TOUCH="touch",POINTER_TYPE_PEN="pen",CLASS_NAME_POINTER_EVENT="pointer-event",SWIPE_THRESHOLD=40,Default$m={endCallback:null,leftCallback:null,rightCallback:null},DefaultType$m={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Swipe extends Config{constructor(e,t){super(),this._element=e,e&&Swipe.isSupported()&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Default$m}static get DefaultType(){return DefaultType$m}static get NAME(){return NAME$o}dispose(){EventHandler.off(this._element,".bs.swipe")}_start(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),execute(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=40)return;const t=e/this._deltaX;this._deltaX=0,t&&execute(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(EventHandler.on(this._element,EVENT_POINTERDOWN,(e=>this._start(e))),EventHandler.on(this._element,EVENT_POINTERUP,(e=>this._end(e))),this._element.classList.add("pointer-event")):(EventHandler.on(this._element,EVENT_TOUCHSTART,(e=>this._start(e))),EventHandler.on(this._element,EVENT_TOUCHMOVE,(e=>this._move(e))),EventHandler.on(this._element,EVENT_TOUCHEND,(e=>this._end(e))))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const NAME$n="carousel",DATA_KEY$j="bs.carousel",EVENT_KEY$j=`.${DATA_KEY$j}`,DATA_API_KEY$f=".data-api",ARROW_LEFT_KEY$2="ArrowLeft",ARROW_RIGHT_KEY$2="ArrowRight",TOUCHEVENT_COMPAT_WAIT=500,ORDER_NEXT="next",ORDER_PREV="prev",DIRECTION_LEFT="left",DIRECTION_RIGHT="right",EVENT_SLIDE=`slide${EVENT_KEY$j}`,EVENT_SLID=`slid${EVENT_KEY$j}`,EVENT_KEYDOWN$5=`keydown${EVENT_KEY$j}`,EVENT_MOUSEENTER$2=`mouseenter${EVENT_KEY$j}`,EVENT_MOUSELEAVE$2=`mouseleave${EVENT_KEY$j}`,EVENT_DRAG_START=`dragstart${EVENT_KEY$j}`,EVENT_LOAD_DATA_API$c=`load${EVENT_KEY$j}.data-api`,EVENT_CLICK_DATA_API$e=`click${EVENT_KEY$j}.data-api`,CLASS_NAME_CAROUSEL="carousel",CLASS_NAME_ACTIVE$5="active",CLASS_NAME_SLIDE="slide",CLASS_NAME_END="carousel-item-end",CLASS_NAME_START="carousel-item-start",CLASS_NAME_NEXT="carousel-item-next",CLASS_NAME_PREV="carousel-item-prev",SELECTOR_ACTIVE=".active",SELECTOR_ITEM=".carousel-item",SELECTOR_ACTIVE_ITEM=".active.carousel-item",SELECTOR_ITEM_IMG=".carousel-item img",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_RIDE='[data-bs-ride="carousel"]',KEY_TO_DIRECTION={[ARROW_LEFT_KEY$2]:"right",[ARROW_RIGHT_KEY$2]:"left"},Default$l={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},DefaultType$l={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class Carousel extends BaseComponent{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element),this._addEventListeners(),"carousel"===this._config.ride&&this.cycle()}static get Default(){return Default$l}static get DefaultType(){return DefaultType$l}static get NAME(){return NAME$n}next(){this._slide("next")}nextWhenVisible(){!document.hidden&&isVisible(this._element)&&this.next()}prev(){this._slide("prev")}pause(){this._isSliding&&triggerTransitionEnd(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval((()=>this.nextWhenVisible()),this._config.interval)}_maybeEnableCycle(){this._config.ride&&(this._isSliding?EventHandler.one(this._element,EVENT_SLID,(()=>this.cycle())):this.cycle())}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding)return void EventHandler.one(this._element,EVENT_SLID,(()=>this.to(e)));const i=this._getItemIndex(this._getActive());if(i===e)return;const n=e>i?"next":"prev";this._slide(n,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&EventHandler.on(this._element,EVENT_KEYDOWN$5,(e=>this._keydown(e))),"hover"===this._config.pause&&(EventHandler.on(this._element,EVENT_MOUSEENTER$2,(()=>this.pause())),EventHandler.on(this._element,EVENT_MOUSELEAVE$2,(()=>this._maybeEnableCycle()))),this._config.touch&&Swipe.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const e of SelectorEngine.find(SELECTOR_ITEM_IMG,this._element))EventHandler.on(e,EVENT_DRAG_START,(e=>e.preventDefault()));const e={leftCallback:()=>this._slide(this._directionToOrder("left")),rightCallback:()=>this._slide(this._directionToOrder("right")),endCallback:()=>{"hover"===this._config.pause&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout((()=>this._maybeEnableCycle()),500+this._config.interval))}};this._swipeHelper=new Swipe(this._element,e)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine.findOne(".active",this._indicatorsElement);t.classList.remove("active"),t.removeAttribute("aria-current");const i=SelectorEngine.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);i&&(i.classList.add("active"),i.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const i=this._getActive(),n="next"===e,s=t||getNextActiveElement(this._getItems(),i,n,this._config.wrap);if(s===i)return;const a=this._getItemIndex(s),r=t=>EventHandler.trigger(this._element,t,{relatedTarget:s,direction:this._orderToDirection(e),from:this._getItemIndex(i),to:a});if(r(EVENT_SLIDE).defaultPrevented)return;if(!i||!s)return;const o=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=s;const l=n?CLASS_NAME_START:CLASS_NAME_END,c=n?CLASS_NAME_NEXT:CLASS_NAME_PREV;s.classList.add(c),reflow(s),i.classList.add(l),s.classList.add(l),this._queueCallback((()=>{s.classList.remove(l,c),s.classList.add("active"),i.classList.remove("active",c,l),this._isSliding=!1,r(EVENT_SLID)}),i,this._isAnimated()),o&&this.cycle()}_isAnimated(){return this._element.classList.contains("slide")}_getActive(){return SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element)}_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return isRTL()?"left"===e?"prev":"next":"left"===e?"next":"prev"}_orderToDirection(e){return isRTL()?"prev"===e?"left":"right":"prev"===e?"right":"left"}static jQueryInterface(e){return this.each((function(){const t=Carousel.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError(`No method named "${e}"`);t[e]()}}else t.to(e)}))}}EventHandler.on(document,EVENT_CLICK_DATA_API$e,SELECTOR_DATA_SLIDE,(function(e){const t=SelectorEngine.getElementFromSelector(this);if(!t||!t.classList.contains("carousel"))return;e.preventDefault();const i=Carousel.getOrCreateInstance(t),n=this.getAttribute("data-bs-slide-to");return n?(i.to(n),void i._maybeEnableCycle()):"next"===Manipulator.getDataAttribute(this,"slide")?(i.next(),void i._maybeEnableCycle()):(i.prev(),void i._maybeEnableCycle())})),EventHandler.on(window,EVENT_LOAD_DATA_API$c,(()=>{const e=SelectorEngine.find(SELECTOR_DATA_RIDE);for(const t of e)Carousel.getOrCreateInstance(t)})),defineJQueryPlugin(Carousel);const NAME$m="collapse",DATA_KEY$i="bs.collapse",EVENT_KEY$i=`.${DATA_KEY$i}`,DATA_API_KEY$e=".data-api",EVENT_SHOW$b=`show${EVENT_KEY$i}`,EVENT_SHOWN$b=`shown${EVENT_KEY$i}`,EVENT_HIDE$b=`hide${EVENT_KEY$i}`,EVENT_HIDDEN$b=`hidden${EVENT_KEY$i}`,EVENT_CLICK_DATA_API$d=`click${EVENT_KEY$i}.data-api`,CLASS_NAME_SHOW$e="show",CLASS_NAME_COLLAPSE="collapse",CLASS_NAME_COLLAPSING="collapsing",CLASS_NAME_COLLAPSED="collapsed",CLASS_NAME_DEEPER_CHILDREN=":scope .collapse .collapse",CLASS_NAME_HORIZONTAL="collapse-horizontal",WIDTH="width",HEIGHT="height",SELECTOR_ACTIVES=".collapse.show, .collapse.collapsing",SELECTOR_DATA_TOGGLE$d='[data-bs-toggle="collapse"]',Default$k={parent:null,toggle:!0},DefaultType$k={parent:"(null|element)",toggle:"boolean"};class Collapse extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const i=SelectorEngine.find(SELECTOR_DATA_TOGGLE$d);for(const e of i){const t=SelectorEngine.getSelectorFromElement(e),i=SelectorEngine.find(t).filter((e=>e===this._element));null!==t&&i.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Default$k}static get DefaultType(){return DefaultType$k}static get NAME(){return NAME$m}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter((e=>e!==this._element)).map((e=>Collapse.getOrCreateInstance(e,{toggle:!1})))),e.length&&e[0]._isTransitioning)return;if(EventHandler.trigger(this._element,EVENT_SHOW$b).defaultPrevented)return;for(const t of e)t.hide();const t=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[t]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${t[0].toUpperCase()+t.slice(1)}`;this._queueCallback((()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[t]="",EventHandler.trigger(this._element,EVENT_SHOWN$b)}),this._element,!0),this._element.style[t]=`${this._element[i]}px`}h