drive 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +6 -0
  3. data/CLAUDE.md +690 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +77 -0
  6. data/Rakefile +32 -0
  7. data/STYLE.md +435 -0
  8. data/app/controllers/recourses_controller.rb +96 -0
  9. data/app/javascript/recourse/phone_controller.js +33 -0
  10. data/app/views/layouts/application.html.erb +69 -0
  11. data/app/views/recourses/_breadcrumb.html.erb +18 -0
  12. data/app/views/recourses/_combobox.html.erb +23 -0
  13. data/app/views/recourses/_fields.html.erb +3 -0
  14. data/app/views/recourses/_flash.html.erb +13 -0
  15. data/app/views/recourses/_form.html.erb +9 -0
  16. data/app/views/recourses/_none.html.erb +1 -0
  17. data/app/views/recourses/_row.html.erb +4 -0
  18. data/app/views/recourses/_sidebar.html.erb +10 -0
  19. data/app/views/recourses/_table.html.erb +30 -0
  20. data/app/views/recourses/edit.html.erb +3 -0
  21. data/app/views/recourses/index.html.erb +14 -0
  22. data/app/views/recourses/new.html.erb +3 -0
  23. data/lib/drive.rb +3 -0
  24. data/lib/recourse/controllers.rb +13 -0
  25. data/lib/recourse/engine.rb +27 -0
  26. data/lib/recourse/helpers/cells.rb +44 -0
  27. data/lib/recourse/helpers/comboboxes.rb +33 -0
  28. data/lib/recourse/helpers/constraints.rb +94 -0
  29. data/lib/recourse/helpers/examples.rb +35 -0
  30. data/lib/recourse/helpers/fields.rb +54 -0
  31. data/lib/recourse/helpers/navigation.rb +68 -0
  32. data/lib/recourse/helpers/references.rb +89 -0
  33. data/lib/recourse/helpers.rb +60 -0
  34. data/lib/recourse/icons.rb +21 -0
  35. data/lib/recourse/recoursive.rb +19 -0
  36. data/lib/recourse/routes.rb +14 -0
  37. data/lib/recourse/version.rb +4 -0
  38. data/lib/recourse.rb +31 -0
  39. data/vendor/recourse/bootstrap-icons.min.css +5 -0
  40. data/vendor/recourse/bootstrap.bundle.min.js +9 -0
  41. data/vendor/recourse/bootstrap.min.css +2 -0
  42. data/vendor/recourse/fonts/bootstrap-icons.woff +0 -0
  43. data/vendor/recourse/fonts/bootstrap-icons.woff2 +0 -0
  44. data/vendor/recourse/stimulus.js +2563 -0
  45. metadata +144 -0
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Bootstrap v6.0.0-alpha1 (https://getbootstrap.com/)
3
+ * Copyright 2011-2026 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
+ * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
+ */
6
+ const elementMap=new Map;var data_default={set(e,t,n){elementMap.has(e)||elementMap.set(e,new Map);const i=elementMap.get(e);i.has(t)||0===i.size?i.set(t,n):console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${[...i.keys()][0]}.`)},get:(e,t)=>e&&elementMap.has(e)&&elementMap.get(e).get(t)||null,getAny:e=>e&&elementMap.has(e)&&elementMap.get(e).values().next().value||null,remove(e,t){if(!elementMap.has(e))return;const n=elementMap.get(e);n.delete(t),0===n.size&&elementMap.delete(e)}};const namespaceRegex=/[^.]*(?=\..*)\.|.*/,stripNameRegex=/\..*/,stripUidRegex=/::\d+$/,eventRegistry={};let uidEvent=1;const customEvents={mouseenter:"mouseover",mouseleave:"mouseout"},nativeEvents=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","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","scrollend"]);function makeEventUid(e,t){return t&&`${t}::${uidEvent++}`||e.uidEvent||uidEvent++}function getElementEvents(e){const t=makeEventUid(e);return e.uidEvent=t,eventRegistry[t]=eventRegistry[t]||{},eventRegistry[t]}function isMouseEventWithinTarget(e){const{delegateTarget:t,relatedTarget:n}=e;return Boolean(n&&t.contains(n))}function bootstrapHandler(e,t,n){const i=n in customEvents;return function s(o){const a=hydrateObj(o,{delegateTarget:e});if(!i||!isMouseEventWithinTarget(a))return s.oneOff&&EventHandler.off(e,n,t),t.apply(e,[a])}}function bootstrapDelegationHandler(e,t,n,i){const s=i in customEvents;return function o(a){const l=e.querySelectorAll(t);for(let{target:r}=a;r&&r!==this;r=r.parentNode)for(const c of l){if(c!==r)continue;const l=hydrateObj(a,{delegateTarget:r});if(s&&isMouseEventWithinTarget(l))return;return o.oneOff&&EventHandler.off(e,i,t,n),n.apply(r,[l])}}}function findHandler(e,t,n,i=null){return Object.values(e).find(e=>e.callable===t&&e.handlerTypeEvent===n&&e.delegationSelector===i)}function normalizeParameters(e,t,n){const i="string"==typeof t,s=i?n:t||n,o=e.replace(stripNameRegex,"");let a=customEvents[o]||o;return nativeEvents.has(a)||(a=e),{isDelegated:i,callable:s,typeEvent:a,handlerTypeEvent:o in customEvents?o:a}}function addHandler(e,t,n,i,s){if("string"!=typeof t||!e)return;const{isDelegated:o,callable:a,typeEvent:l,handlerTypeEvent:r}=normalizeParameters(t,n,i),c=getElementEvents(e),d=c[l]||(c[l]={}),u=findHandler(d,a,r,o?n:null);if(u)return void(u.oneOff=u.oneOff&&s);const h=makeEventUid(a,t.replace(namespaceRegex,"")),_=o?bootstrapDelegationHandler(e,n,a,r):bootstrapHandler(e,a,r);_.delegationSelector=o?n:null,_.callable=a,_.handlerTypeEvent=r,_.oneOff=s,_.uidEvent=h,d[h]=_,e.addEventListener(l,_,o)}function removeHandler(e,t,n,i){e.removeEventListener(n,i,Boolean(i.delegationSelector)),delete t[n][i.uidEvent]}function removeNamespacedHandlers(e,t,n,i){const s=t[n]||{};for(const[o,a]of Object.entries(s))o.includes(i)&&removeHandler(e,t,n,a)}function trigger(e,t,n){if("string"!=typeof t||!e)return null;const i=hydrateObj(new Event(t,{bubbles:!0,cancelable:!0}),n);return e.dispatchEvent(i),i}const EventHandler={on(e,t,n,i){addHandler(e,t,n,i,!1)},one(e,t,n,i){addHandler(e,t,n,i,!0)},off(e,t,n,i){if("string"!=typeof t||!e)return;const{isDelegated:s,callable:o,typeEvent:a,handlerTypeEvent:l}=normalizeParameters(t,n,i),r=a!==t&&l!==t,c=getElementEvents(e),d=c[a]||{},u=t.startsWith(".");if(void 0!==o){if(!Object.keys(d).length)return;const t=findHandler(d,o,l,s?n:null);return void(t&&removeHandler(e,c,a,t))}if(u)for(const n of Object.keys(c))removeNamespacedHandlers(e,c,n,t.slice(1));for(const[n,i]of Object.entries(d)){const s=n.replace(stripUidRegex,"");i.handlerTypeEvent!==l||r&&!t.includes(s)||removeHandler(e,c,a,i)}},trigger:trigger};function hydrateObj(e,t={}){for(const[n,i]of Object.entries(t))try{e[n]=i}catch{Object.defineProperty(e,n,{configurable:!0,get:()=>i})}return e}function normalizeData(e){if("true"===e)return!0;if("false"===e)return!1;if(e===Number(e).toString())return Number(e);if(""===e||"null"===e)return null;if("string"!=typeof e)return e;try{return JSON.parse(decodeURIComponent(e))}catch{return e}}function normalizeDataKey(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const Manipulator={setDataAttribute(e,t,n){e.setAttribute(`data-bs-${normalizeDataKey(t)}`,n)},removeDataAttribute(e,t){e.removeAttribute(`data-bs-${normalizeDataKey(t)}`)},getDataAttributes(e){if(!e)return{};const t={},n=Object.keys(e.dataset).filter(e=>e.startsWith("bs")&&!e.startsWith("bsConfig"));for(const i of n){let n=i.replace(/^bs/,"");n=n.charAt(0).toLowerCase()+n.slice(1),t[n]=normalizeData(e.dataset[i])}return t},getDataAttribute:(e,t)=>normalizeData(e.getAttribute(`data-bs-${normalizeDataKey(t)}`))},MAX_UID=1e6,MILLISECONDS_MULTIPLIER=1e3,TRANSITION_END="transitionend",parseSelector=e=>(e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),e),toType=e=>null==e?`${e}`:Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase(),getUID=e=>{do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e},getTransitionDurationFromElement=e=>{if(!e)return 0;let{transitionDuration:t,transitionDelay:n}=window.getComputedStyle(e);return Number.parseFloat(t)||Number.parseFloat(n)?(t=t.split(",")[0],n=n.split(",")[0],1e3*(Number.parseFloat(t)+Number.parseFloat(n))):0},triggerTransitionEnd=e=>{e.dispatchEvent(new Event(TRANSITION_END))},isElement$1=e=>!(!e||"object"!=typeof e)&&void 0!==e.nodeType,getElement=e=>isElement$1(e)?e:"string"==typeof e&&e.length>0?document.querySelector(parseSelector(e)):null,isVisible=e=>{if(!isElement$1(e)||0===e.getClientRects().length)return!1;const t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){const t=e.closest("summary");if(t&&t.parentNode!==n)return!1;if(null===t)return!1}return t},isDisabled=e=>{if(!e||e.nodeType!==Node.ELEMENT_NODE)return!0;if(e.classList.contains("disabled"))return!0;const t=e;return void 0!==t.disabled?t.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")},setAriaAttribute=(e,t,n)=>{e.setAttribute(t,String(n))},findShadowRoot=e=>{if(!document.documentElement.attachShadow)return null;if("function"==typeof e.getRootNode){const t=e.getRootNode();return t instanceof ShadowRoot?t:null}return e instanceof ShadowRoot?e:e.parentNode?findShadowRoot(e.parentNode):null},noop=()=>{},reflow=e=>{e.offsetHeight},isRTL$1=()=>"rtl"===document.documentElement.dir,execute=(e,t=[],n=e)=>"function"==typeof e?e.call(...t):n,executeAfterTransition=(e,t,n=!0)=>{if(!n)return void execute(e);const i=getTransitionDurationFromElement(t)+5;let s=!1;const o=({target:n})=>{n===t&&(s=!0,t.removeEventListener(TRANSITION_END,o),execute(e))};t.addEventListener(TRANSITION_END,o),setTimeout(()=>{s||triggerTransitionEnd(t)},i)},getNextActiveElement=(e,t,n,i)=>{const s=e.length;let o=e.indexOf(t);return-1===o?!n&&i?e[s-1]:e[0]:(o+=n?1:-1,i&&(o=(o+s)%s),e[Math.max(0,Math.min(o,s-1))])};var Config=class{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const n=isElement$1(t)?Manipulator.getDataAttribute(t,"config"):{};return{...this.constructor.Default,..."object"==typeof n?n:{},...isElement$1(t)?Manipulator.getDataAttributes(t):{},..."object"==typeof e?e:{}}}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[n,i]of Object.entries(t)){const t=e[n],s=isElement$1(t)?"element":toType(t);if(!new RegExp(i).test(s))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${n}" provided type "${s}" but expected type "${i}".`)}}};const VERSION="6.0.0-alpha1";var BaseComponent=class extends Config{constructor(e,t){if(super(),!(e=getElement(e)))return;this._element=e,this._config=this._getConfig(t);const n=data_default.get(this._element,this.constructor.DATA_KEY);n&&n.dispose(),data_default.set(this._element,this.constructor.DATA_KEY,this)}dispose(){data_default.remove(this._element,this.constructor.DATA_KEY),EventHandler.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,n=!0){executeAfterTransition(()=>{this._element&&e()},t,n)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return data_default.get(getElement(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,"object"==typeof t?t:null)}static get VERSION(){return VERSION}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}};const getSelector=e=>{let t=e.getAttribute("data-bs-target");if(!t||"#"===t){let n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n=`#${n.split("#")[1]}`),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map(e=>parseSelector(e)).join(","):null},SelectorEngine={find:(e,t=document.documentElement)=>[...Element.prototype.querySelectorAll.call(t,e)],findOne:(e,t=document.documentElement)=>Element.prototype.querySelector.call(t,e),children:(e,t)=>[...e.children].filter(e=>e.matches(t)),parents(e,t){const n=[];let i=e.parentNode.closest(t);for(;i;)n.push(i),i=i.parentNode.closest(t);return n},closest:(e,t)=>Element.prototype.closest.call(e,t),prev(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},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 n=`click.dismiss${e.EVENT_KEY}`,i=e.NAME;EventHandler.on(document,n,`[data-bs-dismiss="${i}"]`,function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),isDisabled(this))return;const s=SelectorEngine.getElementFromSelector(this)||this.closest(`.${i}`);e.getOrCreateInstance(s)[t]()})},eventActionOnPlugin=(e,t,n,i,s=null)=>{eventAction(`${t}.${e.NAME}`,n,t=>{const n=t.targets.filter(Boolean).map(t=>e.getOrCreateInstance(t));"function"==typeof s&&s({...t,instances:n});for(const e of n)e[i]()})},eventAction=(e,t,n)=>{const i=`${t}:not(.disabled):not(:disabled)`;EventHandler.on(document,e,i,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault();const t=SelectorEngine.getSelectorFromElement(this);n({targets:t?SelectorEngine.find(t):[this],event:e})})},NAME$21="alert",EVENT_KEY$18=".bs.alert",EVENT_CLOSE="close.bs.alert",EVENT_CLOSED="closed.bs.alert",CLASS_NAME_FADE$4="fade",CLASS_NAME_SHOW$6="show";var Alert=class extends BaseComponent{static get NAME(){return"alert"}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()}};enableDismissTrigger(Alert,"close");const NAME$20="button",EVENT_KEY$17=".bs.button",DATA_API_KEY$12=".data-api",CLASS_NAME_ACTIVE$4="active",SELECTOR_DATA_TOGGLE$10='[data-bs-toggle="button"]',EVENT_CLICK_DATA_API$8="click.bs.button.data-api";var Button=class extends BaseComponent{static get NAME(){return NAME$20}toggle(){setAriaAttribute(this._element,"aria-pressed",this._element.classList.toggle("active"))}};EventHandler.on(document,EVENT_CLICK_DATA_API$8,SELECTOR_DATA_TOGGLE$10,e=>{e.preventDefault();const t=e.target.closest(SELECTOR_DATA_TOGGLE$10);Button.getOrCreateInstance(t).toggle()});const NAME$19="carousel",EVENT_KEY$16=".bs.carousel",DATA_API_KEY$11=".data-api",ARROW_LEFT_KEY$2="ArrowLeft",ARROW_RIGHT_KEY$2="ArrowRight",DIRECTION_LEFT="left",DIRECTION_RIGHT="right",EVENT_SLIDE=`slide${EVENT_KEY$16}`,EVENT_SLID=`slid${EVENT_KEY$16}`,EVENT_KEYDOWN$2=`keydown${EVENT_KEY$16}`,EVENT_MOUSEENTER$2=`mouseenter${EVENT_KEY$16}`,EVENT_MOUSELEAVE$1=`mouseleave${EVENT_KEY$16}`,EVENT_POINTERDOWN$1=`pointerdown${EVENT_KEY$16}`,EVENT_LOAD_DATA_API$3=`load${EVENT_KEY$16}.data-api`,EVENT_CLICK_DATA_API$7=`click${EVENT_KEY$16}.data-api`,CLASS_NAME_CAROUSEL="carousel",CLASS_NAME_ACTIVE$3="active",CLASS_NAME_FADE$3="carousel-fade",CLASS_NAME_CENTER="carousel-center",CLASS_NAME_AUTO="carousel-auto",CLASS_NAME_CLONE="carousel-item-clone",CLASS_NAME_PAUSED="paused",CLASS_NAME_PLAYING="carousel-playing",PROPERTY_INTERVAL="--bs-carousel-interval",SCROLL_DURATION=300,ACTIVE_RATIO_TOLERANCE=.05,SELECTOR_ACTIVE=".active",SELECTOR_ITEM=`.carousel-item:not(.${CLASS_NAME_CLONE})`,SELECTOR_ACTIVE_ITEM=".active"+SELECTOR_ITEM,SELECTOR_INNER$1=".carousel-inner",SELECTOR_INDICATORS=".carousel-indicators",SELECTOR_PLAY_PAUSE=".carousel-control-play-pause",SELECTOR_DATA_SLIDE="[data-bs-slide], [data-bs-slide-to]",SELECTOR_DATA_SLIDE_PREV='[data-bs-slide="prev"]',SELECTOR_DATA_SLIDE_NEXT='[data-bs-slide="next"]',SELECTOR_DATA_AUTOPLAY='[data-bs-autoplay="true"]',KEY_TO_DIRECTION={[ARROW_LEFT_KEY$2]:"right",[ARROW_RIGHT_KEY$2]:"left"},ENDS_STOP="stop",ENDS_WRAP="wrap",ENDS_LOOP="loop",Default$18={autoplay:!1,ends:ENDS_LOOP,interval:5e3,keyboard:!0,pause:"hover"},DefaultType$18={autoplay:"boolean",ends:"string",interval:"number",keyboard:"boolean",pause:"(string|boolean)"},easeInOutCubic=e=>e<.5?4*e*e*e:1-(-2*e+2)**3/2;var Carousel=class extends BaseComponent{constructor(e,t){super(e,t),this._viewport=SelectorEngine.findOne(SELECTOR_INNER$1,this._element)||this._element,this._indicatorsElement=SelectorEngine.findOne(SELECTOR_INDICATORS,this._element),this._playPauseElement=SelectorEngine.findOne(SELECTOR_PLAY_PAUSE,this._element),this._prevControls=SelectorEngine.find('[data-bs-slide="prev"]',this._element),this._nextControls=SelectorEngine.find('[data-bs-slide="next"]',this._element),this._interval=null,this._observer=null,this._scrollFrame=null,this._looping=!1,this._visibility=new Map,this._playing=this._config.autoplay,this._activeIndex=this._initialActiveIndex(),this._addEventListeners(),this._observeItems(),this._refreshActiveState(),this._playing&&this.cycle(),this._updatePlayPauseControl()}static get Default(){return Default$18}static get DefaultType(){return DefaultType$18}static get NAME(){return NAME$19}next(){this.to(this._navIndex()+1)}nextWhenVisible(){"visible"===document.visibilityState&&isVisible(this._element)&&this.next()}prev(){this.to(this._navIndex()-1)}pause(){this._clearInterval(),this._element.classList.remove("carousel-playing")}cycle(){this._clearInterval(),this._scheduleAutoplay(),this._element.classList.add("carousel-playing")}to(e){if(this._looping)return;const t=this._getItems(),n=Number.parseInt(e,10);if(this._config.ends===ENDS_LOOP&&!this._prefersReducedMotion()&&this._canLoop()){if(n>t.length-1)return void this._loopTransition(!0);if(n<0)return void this._loopTransition(!1)}const i=this._normalizeIndex(n,t.length),s=this._navIndex();null!==i&&i!==s&&(EventHandler.trigger(this._element,EVENT_SLIDE,{relatedTarget:t[i],direction:this._direction(s,i),from:s,to:i}).defaultPrevented||(this._isFade()?this._fadeTo(i):this._scrollToIndex(i)))}dispose(){this._clearInterval(),this._observer&&this._observer.disconnect(),null!==this._scrollFrame&&cancelAnimationFrame(this._scrollFrame);for(const e of SelectorEngine.find(`.${CLASS_NAME_CLONE}`,this._viewport))e.remove();this._viewport.style.scrollSnapType="",EventHandler.off(this._viewport,EVENT_KEY$16),super.dispose()}_configAfterMerge(e){return[ENDS_STOP,ENDS_WRAP,ENDS_LOOP].includes(e.ends)||(e.ends=Default$18.ends),e}_initialActiveIndex(){const e=SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM,this._element),t=e?this._getItems().indexOf(e):0;return Math.max(t,0)}_addEventListeners(){this._config.keyboard&&EventHandler.on(this._element,EVENT_KEYDOWN$2,e=>this._keydown(e)),"hover"===this._config.pause&&(EventHandler.on(this._element,EVENT_MOUSEENTER$2,()=>this.pause()),EventHandler.on(this._element,EVENT_MOUSELEAVE$1,()=>this._maybeEnableCycle())),EventHandler.on(this._viewport,EVENT_POINTERDOWN$1,()=>this._pauseFromInteraction())}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=KEY_TO_DIRECTION[e.key];t&&(e.preventDefault(),this._pauseFromInteraction(),"right"===t?this.prev():this.next())}_observeItems(){if(!this._isFade()&&"undefined"!=typeof IntersectionObserver){this._observer=new IntersectionObserver(e=>this._handleIntersection(e),{root:this._viewport,threshold:[0,.25,.5,.75,1]});for(const e of this._getItems())this._observer.observe(e)}}_handleIntersection(e){if(this._looping)return;for(const t of e)this._visibility.set(t.target,t.isIntersecting?t.intersectionRatio:0);const t=this._getItems().map(e=>this._visibility.get(e)??0),n=Math.max(...t);let i=this._activeIndex;n>0&&(i=t.findIndex(e=>e>=n-.05)),this._setActive(i),this._updateEndControls()}_navIndex(){if(this._isFade()||this._viewport.scrollWidth-this._viewport.clientWidth<=0)return this._activeIndex;let e=this._activeIndex,t=Number.POSITIVE_INFINITY;for(const[n,i]of this._getItems().entries()){const s=Math.abs(this._scrollDelta(i));s<t&&(t=s,e=n)}return e}_scrollToIndex(e){const t=this._getItems()[e];if(!t)return;const n=this._scrollDelta(t);if(Math.abs(n)<1)return;const i=this._viewport.scrollLeft+n;this._viewport.style.scrollSnapType="none",this._animateScroll(i,()=>{this._viewport.style.scrollSnapType="",this._observer||this._setActive(e),this._updateEndControls()})}_animateScroll(e,t){null!==this._scrollFrame&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null);const n=this._viewport.scrollLeft,i=e-n;if(this._prefersReducedMotion()||"undefined"==typeof requestAnimationFrame)return this._viewport.scrollTo({left:e,behavior:"instant"}),void t();let s=null;const o=a=>{null===s&&(s=a);const l=Math.min((a-s)/300,1);this._viewport.scrollTo({left:n+i*easeInOutCubic(l),behavior:"instant"}),l<1?this._scrollFrame=requestAnimationFrame(o):(this._viewport.scrollTo({left:e,behavior:"instant"}),this._scrollFrame=null,t())};this._scrollFrame=requestAnimationFrame(o)}_scrollDelta(e){const t=this._viewport.getBoundingClientRect(),n=e.getBoundingClientRect();if(this._element.classList.contains("carousel-center"))return n.left+n.width/2-(t.left+t.width/2);const i=Number.parseFloat(getComputedStyle(this._viewport).scrollPaddingInlineStart)||0;return isRTL$1()?n.right-(t.right-i):n.left-(t.left+i)}_loopTransition(e){const t=this._getItems(),n=t.length-1,i=this._activeIndex,s=e?0:n,o=this._loopDirection(e);if(EventHandler.trigger(this._element,EVENT_SLIDE,{relatedTarget:t[s],direction:o,from:i,to:s}).defaultPrevented)return;this._looping=!0;const a=(e?t[0]:t[n]).cloneNode(!0);a.classList.add(CLASS_NAME_CLONE),a.classList.remove("active"),a.removeAttribute("id");for(const e of SelectorEngine.find("[id]",a))e.removeAttribute("id");a.setAttribute("aria-hidden","true"),a.inert=!0,this._viewport.style.scrollSnapType="none",e?this._viewport.append(a):(this._viewport.prepend(a),this._jumpScroll(this._scrollDelta(t[i]))),this._animateScroll(this._viewport.scrollLeft+this._scrollDelta(a),()=>{a.remove(),this._jumpScroll(this._scrollDelta(t[s])),this._activeIndex=s,this._refreshActiveState(),EventHandler.trigger(this._element,EVENT_SLID,{relatedTarget:t[s],direction:o,from:i,to:s}),this._viewport.style.scrollSnapType="",this._looping=!1})}_loopDirection(e){return isRTL$1()?e?"right":"left":e?"left":"right"}_jumpScroll(e){this._viewport.style.scrollSnapType="none",this._viewport.scrollBy({left:e,top:0,behavior:"instant"})}_fadeTo(e){this._setActive(e)}_setActive(e){const t=this._getItems();if(e===this._activeIndex||!t[e])return;const n=this._activeIndex;this._activeIndex=e,this._refreshActiveState(),EventHandler.trigger(this._element,EVENT_SLID,{relatedTarget:t[e],direction:this._direction(n,e),from:n,to:e})}_refreshActiveState(){const e=this._getItems();for(const[t,n]of e.entries())n.classList.toggle("active",t===this._activeIndex);this._setActiveIndicatorElement(this._activeIndex),this._updateEndControls()}_updateEndControls(){if(this._config.ends!==ENDS_STOP)return;const e=this._viewport,t=e.scrollWidth-e.clientWidth;let n,i;if(t>0){const s=Math.abs(e.scrollLeft);n=s<=1,i=s>=t-1}else{const e=this._getItems().length-1;n=this._activeIndex<=0,i=this._activeIndex>=e}this._setControlsDisabled(this._prevControls,n),this._setControlsDisabled(this._nextControls,i)}_setControlsDisabled(e,t){for(const n of e)t&&n===document.activeElement&&((e===this._prevControls?this._nextControls:this._prevControls)[0]??this._viewport).focus({preventScroll:!0}),n.disabled=t}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=SelectorEngine.findOne(".active",this._indicatorsElement);t&&(t.classList.remove("active"),t.removeAttribute("aria-current"));const n=SelectorEngine.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);n&&(n.classList.add("active"),n.setAttribute("aria-current","true"))}_normalizeIndex(e,t){return Number.isNaN(e)||0===t?null:e<0?this._wrapsAround()?t-1:null:e>t-1?this._wrapsAround()?0:null:e}_wrapsAround(){return this._config.ends===ENDS_WRAP||this._config.ends===ENDS_LOOP}_canLoop(){if(this._isFade()||this._getItems().length<2)return!1;const e=getComputedStyle(this._element),t=t=>Number.parseFloat(e.getPropertyValue(t))||0;return 1===(t("--bs-carousel-items")||1)&&0===t("--bs-carousel-items-peek")&&!this._element.classList.contains("carousel-center")&&!this._element.classList.contains("carousel-auto")}_direction(e,t){const n=t>e;return isRTL$1()?n?"right":"left":n?"left":"right"}_scheduleAutoplay(e=this._activeIndex){const t=this._itemInterval(e);this._element.style.setProperty(PROPERTY_INTERVAL,`${t}ms`),this._interval=setTimeout(()=>{const e=this._upcomingIndex();this.nextWhenVisible(),null!==e?this._scheduleAutoplay(e):this.pause()},t)}_upcomingIndex(){return this._normalizeIndex(this._navIndex()+1,this._getItems().length)}_itemInterval(e=this._activeIndex){const t=this._getItems()[e],n=t?Number.parseInt(t.getAttribute("data-bs-interval"),10):NaN;return Number.isNaN(n)?this._config.interval:n}_maybeEnableCycle(){this._playing&&this.cycle()}_pauseFromInteraction(){this._playing=!1,this.pause(),this._updatePlayPauseControl()}_togglePlayPause(){this._playing?this._pauseFromInteraction():(this._playing=!0,this.cycle(),this._updatePlayPauseControl())}_updatePlayPauseControl(){if(!this._playPauseElement)return;this._playPauseElement.classList.toggle("paused",!this._playing);const e=this._playPauseElement.getAttribute(this._playing?"data-bs-pause-label":"data-bs-play-label");e&&this._playPauseElement.setAttribute("aria-label",e)}_isFade(){return this._element.classList.contains("carousel-fade")}_prefersReducedMotion(){return"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}_getItems(){return SelectorEngine.find(SELECTOR_ITEM,this._element)}_clearInterval(){this._interval&&(clearTimeout(this._interval),this._interval=null)}};EventHandler.on(document,EVENT_CLICK_DATA_API$7,SELECTOR_DATA_SLIDE,function(e){const t=SelectorEngine.getElementFromSelector(this);if(!t||!t.classList.contains("carousel"))return;e.preventDefault();const n=Carousel.getOrCreateInstance(t);n._pauseFromInteraction();const i=this.getAttribute("data-bs-slide-to");i?n.to(i):"next"!==Manipulator.getDataAttribute(this,"slide")?n.prev():n.next()}),EventHandler.on(document,EVENT_CLICK_DATA_API$7,SELECTOR_PLAY_PAUSE,function(e){const t=SelectorEngine.getElementFromSelector(this);t&&t.classList.contains("carousel")&&(e.preventDefault(),Carousel.getOrCreateInstance(t)._togglePlayPause())}),EventHandler.on(window,EVENT_LOAD_DATA_API$3,()=>{const e=SelectorEngine.find(SELECTOR_DATA_AUTOPLAY);for(const t of e)Carousel.getOrCreateInstance(t)});const NAME$18="collapse",EVENT_KEY$15=".bs.collapse",DATA_API_KEY$10=".data-api",EVENT_SHOW$7=`show${EVENT_KEY$15}`,EVENT_SHOWN$6=`shown${EVENT_KEY$15}`,EVENT_HIDE$6=`hide${EVENT_KEY$15}`,EVENT_HIDDEN$8=`hidden${EVENT_KEY$15}`,EVENT_CLICK_DATA_API$6=`click${EVENT_KEY$15}.data-api`,CLASS_NAME_SHOW$5="show",CLASS_NAME_COLLAPSE="collapse",CLASS_NAME_COLLAPSING="collapsing",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$9='[data-bs-toggle="collapse"]',Default$17={parent:null,toggle:!0},DefaultType$17={parent:"(null|element)",toggle:"boolean"};var Collapse=class e extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const n=SelectorEngine.find(SELECTOR_DATA_TOGGLE$9);for(const e of n){const t=SelectorEngine.getSelectorFromElement(e),n=SelectorEngine.find(t).filter(e=>e===this._element);null!==t&&n.length&&this._triggerArray.push(e)}this._initializeChildren(),this._config.parent||this._setAriaExpanded(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Default$17}static get DefaultType(){return DefaultType$17}static get NAME(){return NAME$18}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(SELECTOR_ACTIVES).filter(e=>e!==this._element).map(t=>e.getOrCreateInstance(t,{toggle:!1}))),t.length&&t[0]._isTransitioning)return;if(EventHandler.trigger(this._element,EVENT_SHOW$7).defaultPrevented)return;for(const e of t)e.hide();const n=this._getDimension();this._element.classList.remove("collapse"),this._element.classList.add("collapsing"),this._element.style[n]=0,this._setAriaExpanded(this._triggerArray,!0),this._isTransitioning=!0;const i=`scroll${n[0].toUpperCase()+n.slice(1)}`;this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse","show"),this._element.style[n]="",EventHandler.trigger(this._element,EVENT_SHOWN$6)},this._element,!0),this._element.style[n]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown())return;if(EventHandler.trigger(this._element,EVENT_HIDE$6).defaultPrevented)return;const e=this._getDimension();this._element.style[e]=`${this._element.getBoundingClientRect()[e]}px`,reflow(this._element),this._element.classList.add("collapsing"),this._element.classList.remove("collapse","show");for(const e of this._triggerArray){const t=SelectorEngine.getElementFromSelector(e);t&&!this._isShown(t)&&this._setAriaExpanded([e],!1)}this._isTransitioning=!0,this._element.style[e]="",this._queueCallback(()=>{this._isTransitioning=!1,this._element.classList.remove("collapsing"),this._element.classList.add("collapse"),EventHandler.trigger(this._element,EVENT_HIDDEN$8)},this._element,!0)}_isShown(e=this._element){return e.classList.contains("show")}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=getElement(e.parent),e}_getDimension(){return this._element.classList.contains("collapse-horizontal")?WIDTH:HEIGHT}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(SELECTOR_DATA_TOGGLE$9);for(const t of e){const e=SelectorEngine.getElementFromSelector(t);e&&this._setAriaExpanded([t],this._isShown(e))}}_getFirstLevelChildren(e){const t=SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN,this._config.parent);return SelectorEngine.find(e,this._config.parent).filter(e=>!t.includes(e))}_setAriaExpanded(e,t){if(e.length)for(const n of e)setAriaAttribute(n,"aria-expanded",t)}};EventHandler.on(document,EVENT_CLICK_DATA_API$6,SELECTOR_DATA_TOGGLE$9,function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();for(const e of SelectorEngine.getMultipleElementsFromSelector(this))Collapse.getOrCreateInstance(e,{toggle:!1}).toggle()});const min=Math.min,max=Math.max,round=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"};function clamp(e,t,n){return max(e,min(t,n))}function evaluate(e,t){return"function"==typeof e?e(t):e}function getSide(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return"x"===e?"y":"x"}function getAxisLength(e){return"y"===e?"height":"width"}function getSideAxis(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){void 0===n&&(n=!1);const i=getAlignment(e),s=getAlignmentAxis(e),o=getAxisLength(s);let a="x"===s?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=getOppositePlacement(a)),[a,getOppositePlacement(a)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,i){const s=getAlignment(e);let o=getSideList(getSide(e),"start"===n,i);return s&&(o=o.map(e=>e+"-"+s),t&&(o=o.concat(o.map(getOppositeAlignmentPlacement)))),o}function getOppositePlacement(e){const t=getSide(e);return oppositeSideMap[t]+e.slice(t.length)}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return"number"!=typeof e?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:i,height:s}=e;return{width:i,height:s,top:n,left:t,right:t+i,bottom:n+s,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:i,floating:s}=e;const o=getSideAxis(t),a=getAlignmentAxis(t),l=getAxisLength(a),r=getSide(t),c="y"===o,d=i.x+i.width/2-s.width/2,u=i.y+i.height/2-s.height/2,h=i[l]/2-s[l]/2;let _;switch(r){case"top":_={x:d,y:i.y-s.height};break;case"bottom":_={x:d,y:i.y+i.height};break;case"right":_={x:i.x+i.width,y:u};break;case"left":_={x:i.x-s.width,y:u};break;default:_={x:i.x,y:i.y}}switch(getAlignment(t)){case"start":_[a]-=h*(n&&c?-1:1);break;case"end":_[a]+=h*(n&&c?-1:1)}return _}async function detectOverflow(e,t){var n;void 0===t&&(t={});const{x:i,y:s,platform:o,rects:a,elements:l,strategy:r}=e,{boundary:c="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:h=!1,padding:_=0}=evaluate(t,e),m=getPaddingObject(_),g=l[h?"floating"===u?"reference":"floating":u],p=rectToClientRect(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:c,rootBoundary:d,strategy:r})),E="floating"===u?{x:i,y:s,width:a.floating.width,height:a.floating.height}:a.reference,f=await(null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),v=await(null==o.isElement?void 0:o.isElement(f))&&await(null==o.getScale?void 0:o.getScale(f))||{x:1,y:1},b=rectToClientRect(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:E,offsetParent:f,strategy:r}):E);return{top:(p.top-b.top+m.top)/v.y,bottom:(b.bottom-p.bottom+m.bottom)/v.y,left:(p.left-b.left+m.left)/v.x,right:(b.right-p.right+m.right)/v.x}}const MAX_RESET_COUNT=50,computePosition$1=async(e,t,n)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=n,l=a.detectOverflow?a:{...a,detectOverflow:detectOverflow},r=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:u}=computeCoordsFromPlacement(c,i,r),h=i,_=0;const m={};for(let n=0;n<o.length;n++){const g=o[n];if(!g)continue;const{name:p,fn:E}=g,{x:f,y:v,data:b,reset:T}=await E({x:d,y:u,initialPlacement:i,placement:h,strategy:s,middlewareData:m,rects:c,platform:l,elements:{reference:e,floating:t}});d=null!=f?f:d,u=null!=v?v:u,m[p]={...m[p],...b},T&&_<50&&(_++,"object"==typeof T&&(T.placement&&(h=T.placement),T.rects&&(c=!0===T.rects?await a.getElementRects({reference:e,floating:t,strategy:s}):T.rects),({x:d,y:u}=computeCoordsFromPlacement(c,h,r))),n=-1)}return{x:d,y:u,placement:h,strategy:s,middlewareData:m}},arrow$1=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:s,rects:o,platform:a,elements:l,middlewareData:r}=t,{element:c,padding:d=0}=evaluate(e,t)||{};if(null==c)return{};const u=getPaddingObject(d),h={x:n,y:i},_=getAlignmentAxis(s),m=getAxisLength(_),g=await a.getDimensions(c),p="y"===_,E=p?"top":"left",f=p?"bottom":"right",v=p?"clientHeight":"clientWidth",b=o.reference[m]+o.reference[_]-h[_]-o.floating[m],T=h[_]-o.reference[_],y=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let A=y?y[v]:0;A&&await(null==a.isElement?void 0:a.isElement(y))||(A=l.floating[v]||o.floating[m]);const S=b/2-T/2,D=A/2-g[m]/2-1,C=min(u[E],D),w=min(u[f],D),N=C,x=A-g[m]-w,L=A/2-g[m]/2+S,M=clamp(N,L,x),O=!r.arrow&&null!=getAlignment(s)&&L!==M&&o.reference[m]/2-(L<N?C:w)-g[m]/2<0,I=O?L<N?L-N:L-x:0;return{[_]:h[_]+I,data:{[_]:M,centerOffset:L-M-I,...O&&{alignmentOffset:I}},reset:O}}}),flip$1=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:l,platform:r,elements:c}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:_="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...p}=evaluate(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const E=getSide(s),f=getSideAxis(l),v=getSide(l)===l,b=await(null==r.isRTL?void 0:r.isRTL(c.floating)),T=h||(v||!g?[getOppositePlacement(l)]:getExpandedPlacements(l)),y="none"!==m;!h&&y&&T.push(...getOppositeAxisPlacements(l,g,m,b));const A=[l,...T],S=await r.detectOverflow(t,p),D=[];let C=(null==(i=o.flip)?void 0:i.overflows)||[];if(d&&D.push(S[E]),u){const e=getAlignmentSides(s,a,b);D.push(S[e[0]],S[e[1]])}if(C=[...C,{placement:s,overflows:D}],!D.every(e=>e<=0)){var w,N;const e=((null==(w=o.flip)?void 0:w.index)||0)+1,t=A[e];if(t&&("alignment"!==u||f===getSideAxis(t)||C.every(e=>getSideAxis(e.placement)!==f||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}};let n=null==(N=C.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:N.placement;if(!n)switch(_){case"bestFit":{var x;const e=null==(x=C.filter(e=>{if(y){const t=getSideAxis(e.placement);return t===f||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:x[0];e&&(n=e);break}case"initialPlacement":n=l}if(s!==n)return{reset:{placement:n}}}return{}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:i,elements:s}=e,o=await(null==i.isRTL?void 0:i.isRTL(s.floating)),a=getSide(n),l=getAlignment(n),r="y"===getSideAxis(n),c=originSides.has(a)?-1:1,d=o&&r?-1:1,u=evaluate(t,e);let{mainAxis:h,crossAxis:_,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&"number"==typeof m&&(_="end"===l?-1*m:m),r?{x:_*d,y:h*c}:{x:h*c,y:_*d}}const offset$1=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:s,y:o,placement:a,middlewareData:l}=t,r=await convertValueToCoords(t,e);return a===(null==(n=l.offset)?void 0:n.placement)&&null!=(i=l.arrow)&&i.alignmentOffset?{}:{x:s+r.x,y:o+r.y,data:{...r,placement:a}}}}},shift$1=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:s,platform:o}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:r={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=evaluate(e,t),d={x:n,y:i},u=await o.detectOverflow(t,c),h=getSideAxis(getSide(s)),_=getOppositeAxis(h);let m=d[_],g=d[h];if(a){const e="y"===_?"bottom":"right";m=clamp(m+u["y"===_?"top":"left"],m,m-u[e])}if(l){const e="y"===h?"bottom":"right";g=clamp(g+u["y"===h?"top":"left"],g,g-u[e])}const p=r.fn({...t,[_]:m,[h]:g});return{...p,data:{x:p.x-n,y:p.y-i,enabled:{[_]:a,[h]:l}}}}}};function hasWindow(){return"undefined"!=typeof window}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return null==(t=(isNode(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function isNode(e){return!!hasWindow()&&(e instanceof Node||e instanceof getWindow(e).Node)}function isElement(e){return!!hasWindow()&&(e instanceof Element||e instanceof getWindow(e).Element)}function isHTMLElement(e){return!!hasWindow()&&(e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement)}function isShadowRoot(e){return!(!hasWindow()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot)}function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:i,display:s}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&"inline"!==s&&"contents"!==s}function isTableElement(e){return/^(table|td|th)$/.test(getNodeName(e))}function isTopLayer(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const willChangeRe=/transform|translate|scale|rotate|perspective|filter/,containRe=/paint|layout|strict|content/,isNotNone=e=>!!e&&"none"!==e;let isWebKitValue;function isContainingBlock(e){const t=isElement(e)?getComputedStyle$1(e):e;return isNotNone(t.transform)||isNotNone(t.translate)||isNotNone(t.scale)||isNotNone(t.rotate)||isNotNone(t.perspective)||!isWebKit()&&(isNotNone(t.backdropFilter)||isNotNone(t.filter))||willChangeRe.test(t.willChange||"")||containRe.test(t.contain||"")}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return null==isWebKitValue&&(isWebKitValue="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),isWebKitValue}function isLastTraversableNode(e){return/^(html|body|#document)$/.test(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if("html"===getNodeName(e))return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const s=getNearestOverflowAncestor(e),o=s===(null==(i=e.ownerDocument)?void 0:i.body),a=getWindow(s);if(o){const e=getFrameElement(a);return t.concat(a,a.visualViewport||[],isOverflowElement(s)?s:[],e&&n?getOverflowAncestors(e):[])}return t.concat(s,getOverflowAncestors(s,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=isHTMLElement(e),o=s?e.offsetWidth:n,a=s?e.offsetHeight:i,l=round(n)!==o||round(i)!==a;return l&&(n=o,i=a),{width:n,height:i,$:l}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:i,height:s,$:o}=getCssDimensions(t);let a=(o?round(n.width):n.width)/i,l=(o?round(n.height):n.height)/s;return a&&Number.isFinite(a)||(a=1),l&&Number.isFinite(l)||(l=1),{x:a,y:l}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return isWebKit()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:noOffsets}function shouldAddVisualOffsets(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==getWindow(e))&&t}function getBoundingClientRect(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const s=e.getBoundingClientRect(),o=unwrapElement(e);let a=createCoords(1);t&&(i?isElement(i)&&(a=getScale(i)):a=getScale(e));const l=shouldAddVisualOffsets(o,n,i)?getVisualOffsets(o):createCoords(0);let r=(s.left+l.x)/a.x,c=(s.top+l.y)/a.y,d=s.width/a.x,u=s.height/a.y;if(o){const e=getWindow(o),t=i&&isElement(i)?getWindow(i):i;let n=e,s=getFrameElement(n);for(;s&&i&&t!==n;){const e=getScale(s),t=s.getBoundingClientRect(),i=getComputedStyle$1(s),o=t.left+(s.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(s.clientTop+parseFloat(i.paddingTop))*e.y;r*=e.x,c*=e.y,d*=e.x,u*=e.y,r+=o,c+=a,n=getWindow(s),s=getFrameElement(n)}}return rectToClientRect({width:d,height:u,x:r,y:c})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-getWindowScrollBarX(e,n),y:n.top+t.scrollTop}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:i,strategy:s}=e;const o="fixed"===s,a=getDocumentElement(i),l=!!t&&isTopLayer(t.floating);if(i===a||l&&o)return n;let r={scrollLeft:0,scrollTop:0},c=createCoords(1);const d=createCoords(0),u=isHTMLElement(i);if((u||!u&&!o)&&(("body"!==getNodeName(i)||isOverflowElement(a))&&(r=getNodeScroll(i)),u)){const e=getBoundingClientRect(i);c=getScale(i),d.x=e.x+i.clientLeft,d.y=e.y+i.clientTop}const h=!a||u||o?createCoords(0):getHTMLOffset(a,r);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-r.scrollLeft*c.x+d.x+h.x,y:n.y*c.y-r.scrollTop*c.y+d.y+h.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),i=e.ownerDocument.body,s=max(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=max(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+getWindowScrollBarX(e);const l=-n.scrollTop;return"rtl"===getComputedStyle$1(i).direction&&(a+=max(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:l}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),i=getDocumentElement(e),s=n.visualViewport;let o=i.clientWidth,a=i.clientHeight,l=0,r=0;if(s){o=s.width,a=s.height;const e=isWebKit();(!e||e&&"fixed"===t)&&(l=s.offsetLeft,r=s.offsetTop)}const c=getWindowScrollBarX(i);if(c<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),s="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(i.clientWidth-t.clientWidth-s);a<=25&&(o-=a)}else c<=25&&(o+=c);return{width:o,height:a,x:l,y:r}}function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,"fixed"===t),i=n.top+e.clientTop,s=n.left+e.clientLeft,o=isHTMLElement(e)?getScale(e):createCoords(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:s*o.x,y:i*o.y}}function getClientRectFromClippingAncestor(e,t,n){let i;if("viewport"===t)i=getViewportRect(e,n);else if("document"===t)i=getDocumentRect(getDocumentElement(e));else if(isElement(t))i=getInnerBoundingClientRect(t,n);else{const n=getVisualOffsets(e);i={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return rectToClientRect(i)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return!(n===t||!isElement(n)||isLastTraversableNode(n))&&("fixed"===getComputedStyle$1(n).position||hasFixedPositionAncestor(n,t))}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let i=getOverflowAncestors(e,[],!1).filter(e=>isElement(e)&&"body"!==getNodeName(e)),s=null;const o="fixed"===getComputedStyle$1(e).position;let a=o?getParentNode(e):e;for(;isElement(a)&&!isLastTraversableNode(a);){const t=getComputedStyle$1(a),n=isContainingBlock(a);n||"fixed"!==t.position||(s=null),(o?!n&&!s:!n&&"static"===t.position&&s&&("absolute"===s.position||"fixed"===s.position)||isOverflowElement(a)&&!n&&hasFixedPositionAncestor(e,a))?i=i.filter(e=>e!==a):s=t,a=getParentNode(a)}return t.set(e,i),i}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:i,strategy:s}=e;const o=[..."clippingAncestors"===n?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),i],a=getClientRectFromClippingAncestor(t,o[0],s);let l=a.top,r=a.right,c=a.bottom,d=a.left;for(let e=1;e<o.length;e++){const n=getClientRectFromClippingAncestor(t,o[e],s);l=max(n.top,l),r=min(n.right,r),c=min(n.bottom,c),d=max(n.left,d)}return{width:r-d,height:c-l,x:d,y:l}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const i=isHTMLElement(t),s=getDocumentElement(t),o="fixed"===n,a=getBoundingClientRect(e,!0,o,t);let l={scrollLeft:0,scrollTop:0};const r=createCoords(0);function c(){r.x=getWindowScrollBarX(s)}if(i||!i&&!o)if(("body"!==getNodeName(t)||isOverflowElement(s))&&(l=getNodeScroll(t)),i){const e=getBoundingClientRect(t,!0,o,t);r.x=e.x+t.clientLeft,r.y=e.y+t.clientTop}else s&&c();o&&!i&&s&&c();const d=!s||i||o?createCoords(0):getHTMLOffset(s,l);return{x:a.left+l.scrollLeft-r.x-d.x,y:a.top+l.scrollTop-r.y-d.y,width:a.width,height:a.height}}function isStaticPositioned(e){return"static"===getComputedStyle$1(e).position}function getTrueOffsetParent(e,t){if(!isHTMLElement(e)||"fixed"===getComputedStyle$1(e).position)return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement(e)){let t=getParentNode(e);for(;t&&!isLastTraversableNode(t);){if(isElement(t)&&!isStaticPositioned(t))return t;t=getParentNode(t)}return n}let i=getTrueOffsetParent(e,t);for(;i&&isTableElement(i)&&isStaticPositioned(i);)i=getTrueOffsetParent(i,t);return i&&isLastTraversableNode(i)&&isStaticPositioned(i)&&!isContainingBlock(i)?n:i||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,i=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function isRTL(e){return"rtl"===getComputedStyle$1(e).direction}const platform={convertOffsetParentRelativeRectToViewportRelativeRect:convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement:getDocumentElement,getClippingRect:getClippingRect,getOffsetParent:getOffsetParent,getElementRects:getElementRects,getClientRects:getClientRects,getDimensions:getDimensions,getScale:getScale,isElement:isElement,isRTL:isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n,i=null;const s=getDocumentElement(e);function o(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null}return function a(l,r){void 0===l&&(l=!1),void 0===r&&(r=1),o();const c=e.getBoundingClientRect(),{left:d,top:u,width:h,height:_}=c;if(l||t(),!h||!_)return;const m={rootMargin:-floor(u)+"px "+-floor(s.clientWidth-(d+h))+"px "+-floor(s.clientHeight-(u+_))+"px "+-floor(d)+"px",threshold:max(0,min(1,r))||1};let g=!0;function p(t){const i=t[0].intersectionRatio;if(i!==r){if(!g)return a();i?a(!1,i):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==i||rectsAreEqual(c,e.getBoundingClientRect())||a(),g=!1}try{i=new IntersectionObserver(p,{...m,root:s.ownerDocument})}catch(e){i=new IntersectionObserver(p,m)}i.observe(e)}(!0),o}function autoUpdate(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:r=!1}=i,c=unwrapElement(e),d=s||o?[...c?getOverflowAncestors(c):[],...t?getOverflowAncestors(t):[]]:[];d.forEach(e=>{s&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const u=c&&l?observeMove(c,n):null;let h,_=-1,m=null;a&&(m=new ResizeObserver(e=>{let[i]=e;i&&i.target===c&&m&&t&&(m.unobserve(t),cancelAnimationFrame(_),_=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),c&&!r&&m.observe(c),t&&m.observe(t));let g=r?getBoundingClientRect(e):null;return r&&function t(){const i=getBoundingClientRect(e);g&&!rectsAreEqual(g,i)&&n(),g=i,h=requestAnimationFrame(t)}(),n(),()=>{var e;d.forEach(e=>{s&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),u?.(),null==(e=m)||e.disconnect(),m=null,r&&cancelAnimationFrame(h)}}const offset=offset$1,shift=shift$1,flip=flip$1,arrow=arrow$1,computePosition=(e,t,n)=>{const i=new Map,s={platform:platform,...n},o={...s.platform,_c:i};return computePosition$1(e,t,{...s,platform:o})},BREAKPOINTS={sm:576,md:768,lg:1024,xl:1280,"2xl":1536},parseResponsivePlacement=(e,t="bottom")=>{if(!e||!e.includes(":"))return null;const n=e.split(/\s+/),i={xs:t};for(const e of n)if(e.includes(":")){const[t,n]=e.split(":");void 0!==BREAKPOINTS[t]&&(i[t]=n)}else i.xs=e;return i},getResponsivePlacement=(e,t="bottom")=>{if(!e)return t;const n=window.innerWidth;let i=e.xs||t;for(const t of["sm","md","lg","xl","2xl"])n>=BREAKPOINTS[t]&&e[t]&&(i=e[t]);return i},createBreakpointListeners=e=>{const t=[];for(const n of Object.keys(BREAKPOINTS)){const i=BREAKPOINTS[n],s=window.matchMedia(`(min-width: ${i}px)`);s.addEventListener("change",e),t.push({mql:s,handler:e})}return t},disposeBreakpointListeners=e=>{for(const{mql:t,handler:n}of e)t.removeEventListener("change",n)},toFloatingOffset=e=>Array.isArray(e)?{mainAxis:e[1]||0,crossAxis:e[0]||0}:e,NAME$17="menu",EVENT_KEY$14=".bs.menu",DATA_API_KEY$9=".data-api",ESCAPE_KEY$2="Escape",TAB_KEY$1="Tab",ARROW_UP_KEY$2="ArrowUp",ARROW_DOWN_KEY$2="ArrowDown",ARROW_LEFT_KEY$1="ArrowLeft",ARROW_RIGHT_KEY$1="ArrowRight",HOME_KEY$2="Home",END_KEY$2="End",ENTER_KEY$1="Enter",SPACE_KEY$1=" ",RIGHT_MOUSE_BUTTON=2,SUBMENU_CLOSE_DELAY=100,EVENT_HIDE$5="hide.bs.menu",EVENT_HIDDEN$7="hidden.bs.menu",EVENT_SHOW$6="show.bs.menu",EVENT_SHOWN$5="shown.bs.menu",EVENT_CLICK_DATA_API$5="click.bs.menu.data-api",EVENT_KEYDOWN_DATA_API="keydown.bs.menu.data-api",EVENT_KEYUP_DATA_API="keyup.bs.menu.data-api",CLASS_NAME_SHOW$4="show",SELECTOR_DATA_TOGGLE$8='[data-bs-toggle="menu"]:not(.disabled):not(:disabled)',SELECTOR_MENU$2=".menu",SELECTOR_SUBMENU=".submenu",SELECTOR_SUBMENU_TOGGLE=".submenu > .menu-item",SELECTOR_NAVBAR_NAV=".navbar-nav",SELECTOR_VISIBLE_ITEMS$1=".menu-item:not(.disabled):not(:disabled)",DEFAULT_PLACEMENT="bottom-start",SUBMENU_PLACEMENT="end-start",resolveLogicalPlacement=e=>isRTL$1()?e.replace(/^start(?=-|$)/,"right").replace(/^end(?=-|$)/,"left"):e.replace(/^start(?=-|$)/,"left").replace(/^end(?=-|$)/,"right"),triangleSign=(e,t,n)=>(e.x-n.x)*(t.y-n.y)-(t.x-n.x)*(e.y-n.y),Default$16={autoClose:!0,boundary:"clippingParents",container:!1,display:"dynamic",offset:[0,2],floatingConfig:null,menu:null,placement:"bottom-start",reference:"toggle",strategy:"absolute",submenuTrigger:"both",submenuDelay:100},DefaultType$16={autoClose:"(boolean|string)",boundary:"(string|element)",container:"(string|element|boolean)",display:"string",offset:"(array|string|function)",floatingConfig:"(null|object|function)",menu:"(null|element)",placement:"string",reference:"(string|element|object)",strategy:"string",submenuTrigger:"string",submenuDelay:"number"};var Menu=class e extends BaseComponent{static _openInstances=new Set;constructor(e,t){super(e,t),this._floatingCleanup=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this._parent=this._element.parentNode,this._openSubmenus=new Map,this._submenuCloseTimeouts=new Map,this._hoverIntentData=null,this._menu=this._config.menu||this._findMenu(),!this._config.menu&&this._menu&&(this._parent=this._findWrapper(this._menu)),this._isSubmenu=this._parent.classList?.contains("submenu"),this._menuOriginalParent=this._menu?.parentNode,this._parseResponsivePlacements(),this._setupSubmenuListeners()}static get Default(){return Default$16}static get DefaultType(){return DefaultType$16}static get NAME(){return"menu"}toggle(){return this._isShown()?this.hide():this.show()}show(){if(isDisabled(this._element)||this._isShown())return;const t={relatedTarget:this._element};if(!EventHandler.trigger(this._element,EVENT_SHOW$6,t).defaultPrevented){if(this._moveMenuToContainer(),this._createFloating(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav"))for(const e of document.body.children)EventHandler.on(e,"mouseover",noop);this._element.focus({focusVisible:!1}),this._element.setAttribute("aria-expanded","true"),this._menu.classList.add("show"),this._element.classList.add("show"),this._parent&&this._parent.classList.add("show"),e._openInstances.add(this),EventHandler.trigger(this._element,EVENT_SHOWN$5,t)}}hide(){if(isDisabled(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._disposeFloating(),this._restoreMenuToOriginalParent(),this._disposeMediaQueryListeners(),this._closeAllSubmenus(),this._clearAllSubmenuTimeouts(),e._openInstances.delete(this),super.dispose()}update(){this._floatingCleanup&&this._updateFloatingPosition()}_findMenu(){const e=SelectorEngine.closest(this._element,":has(.menu)");return SelectorEngine.next(this._element,".menu")[0]||SelectorEngine.prev(this._element,".menu")[0]||SelectorEngine.findOne(".menu",e||this._parent)}_findWrapper(e){let t=this._element.parentNode;for(;t instanceof Element&&!t.contains(e);)t=t.parentNode;return t instanceof Element?t:this._element.parentNode}_completeHide(t){if(!EventHandler.trigger(this._element,EVENT_HIDE$5,t).defaultPrevented){if(this._closeAllSubmenus(),"ontouchstart"in document.documentElement)for(const e of document.body.children)EventHandler.off(e,"mouseover",noop);this._disposeFloating(),this._restoreMenuToOriginalParent(),this._menu.classList.remove("show"),this._element.classList.remove("show"),this._parent&&this._parent.classList.remove("show"),this._element.setAttribute("aria-expanded","false"),Manipulator.removeDataAttribute(this._menu,"placement"),Manipulator.removeDataAttribute(this._menu,"display"),e._openInstances.delete(this),EventHandler.trigger(this._element,EVENT_HIDDEN$7,t)}}_getConfig(e){if("object"==typeof(e=super._getConfig(e)).reference&&!isElement$1(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError(`${"menu".toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createFloating(){if("static"===this._config.display)return void Manipulator.setDataAttribute(this._menu,"display","static");let e=this._element;"parent"===this._config.reference?e=this._parent:isElement$1(this._config.reference)?e=getElement(this._config.reference):"object"==typeof this._config.reference&&(e=this._config.reference),this._updateFloatingPosition(e),this._floatingCleanup=autoUpdate(e,this._menu,()=>this._updateFloatingPosition(e))}async _updateFloatingPosition(e=null){if(!this._menu)return;e||(e="parent"===this._config.reference?this._parent:isElement$1(this._config.reference)?getElement(this._config.reference):"object"==typeof this._config.reference?this._config.reference:this._element);const t=this._getPlacement(),n=this._getFloatingMiddleware(),i=this._getFloatingConfig(t,n);await this._applyFloatingPosition(e,this._menu,i.placement,i.middleware,i.strategy)}_isShown(){return this._menu.classList.contains("show")}_getPlacement(){const e=this._responsivePlacements?getResponsivePlacement(this._responsivePlacements,"bottom-start"):this._config.placement;return resolveLogicalPlacement(e)}_parseResponsivePlacements(){this._responsivePlacements=parseResponsivePlacement(this._config.placement,"bottom-start"),this._responsivePlacements&&this._setupMediaQueryListeners()}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=createBreakpointListeners(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){disposeBreakpointListeners(this._mediaQueryListeners),this._mediaQueryListeners=[]}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?({placement:t,rects:n})=>toFloatingOffset(e({placement:t,reference:n.reference,floating:n.floating},this._element)):e}_getFloatingMiddleware(){const e=this._getOffset();return[offset("function"==typeof e?e:toFloatingOffset(e)),flip({fallbackPlacements:this._getFallbackPlacements(),fallbackStrategy:"initialPlacement"}),shift({boundary:"clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary})]}_getFallbackPlacements(){return{bottom:["top","bottom-start","bottom-end","top-start","top-end"],"bottom-start":["top-start","bottom-end","top-end"],"bottom-end":["top-end","bottom-start","top-start"],top:["bottom","top-start","top-end","bottom-start","bottom-end"],"top-start":["bottom-start","top-end","bottom-end"],"top-end":["bottom-end","top-start","bottom-start"],right:["left","right-start","right-end","left-start","left-end"],"right-start":["left-start","right-end","left-end","top-start","bottom-start"],"right-end":["left-end","right-start","left-start","top-end","bottom-end"],left:["right","left-start","left-end","right-start","right-end"],"left-start":["right-start","left-end","right-end","top-start","bottom-start"],"left-end":["right-end","left-start","right-start","top-end","bottom-end"]}[this._getPlacement()]||["top","bottom","right","left"]}_getFloatingConfig(e,t){const n={placement:e,middleware:t,strategy:this._config.strategy};return{...n,...execute(this._config.floatingConfig,[void 0,n])}}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null)}_getContainer(){const{container:e}=this._config;return!1===e?null:!0===e?document.body:getElement(e)}_moveMenuToContainer(){const e=this._getContainer();e&&this._menu&&this._menu.parentNode!==e&&e.append(this._menu)}_restoreMenuToOriginalParent(){this._menuOriginalParent&&this._menu&&this._menu.parentNode!==this._menuOriginalParent&&this._menuOriginalParent.append(this._menu)}async _applyFloatingPosition(e,t,n,i,s="absolute"){if(!t.isConnected)return null;const{x:o,y:a,placement:l}=await computePosition(e,t,{placement:n,middleware:i,strategy:s});return t.isConnected?(Object.assign(t.style,{position:s,left:`${o}px`,top:`${a}px`,margin:"0"}),Manipulator.setDataAttribute(t,"placement",l),l):null}_setupSubmenuListeners(){"hover"!==this._config.submenuTrigger&&"both"!==this._config.submenuTrigger||(EventHandler.on(this._menu,"mouseenter",".submenu > .menu-item",e=>{this._onSubmenuTriggerEnter(e)}),EventHandler.on(this._menu,"mouseleave",".submenu",e=>{this._onSubmenuLeave(e)}),EventHandler.on(this._menu,"mousemove",e=>{this._trackMousePosition(e)})),"click"!==this._config.submenuTrigger&&"both"!==this._config.submenuTrigger||EventHandler.on(this._menu,"click",".submenu > .menu-item",e=>{this._onSubmenuTriggerClick(e)})}_onSubmenuTriggerEnter(e){const t=e.target.closest(".submenu > .menu-item");if(!t)return;const n=t.closest(".submenu"),i=SelectorEngine.findOne(".menu",n);i&&(this._cancelSubmenuCloseTimeout(i),this._closeSiblingSubmenus(n),this._openSubmenu(t,i,n))}_onSubmenuLeave(e){const t=e.target.closest(".submenu"),n=SelectorEngine.findOne(".menu",t);n&&this._openSubmenus.has(n)&&(this._isMovingTowardSubmenu(e,n)||this._scheduleSubmenuClose(n,t))}_onSubmenuTriggerClick(e){const t=e.target.closest(".submenu > .menu-item");if(!t)return;e.preventDefault(),e.stopPropagation();const n=t.closest(".submenu"),i=SelectorEngine.findOne(".menu",n);i&&(this._openSubmenus.has(i)?this._closeSubmenu(i,n):(this._closeSiblingSubmenus(n),this._openSubmenu(t,i,n)))}_openSubmenu(e,t,n){if(this._openSubmenus.has(t))return;e.setAttribute("aria-expanded","true"),e.setAttribute("aria-haspopup","true"),t.style.opacity="0",t.classList.add("show"),n.classList.add("show");const i=this._createSubmenuFloating(e,t,n);this._openSubmenus.set(t,i),EventHandler.on(t,"mouseenter",()=>{this._cancelSubmenuCloseTimeout(t)})}_closeSubmenu(e,t){if(!this._openSubmenus.has(e))return;const n=SelectorEngine.find(".submenu .menu.show",e);for(const e of n){const t=e.closest(".submenu");this._closeSubmenu(e,t)}const i=SelectorEngine.findOne(".submenu > .menu-item",t),s=this._openSubmenus.get(e);s&&s(),this._openSubmenus.delete(e),EventHandler.off(e,"mouseenter"),i&&i.setAttribute("aria-expanded","false"),e.classList.remove("show"),t.classList.remove("show"),e.style.opacity=""}_closeAllSubmenus(){for(const[e]of this._openSubmenus){const t=e.closest(".submenu");this._closeSubmenu(e,t)}}_closeSiblingSubmenus(e){const t=e.parentNode,n=SelectorEngine.find(".submenu > .menu.show",t);for(const t of n){const n=t.closest(".submenu");n!==e&&this._closeSubmenu(t,n)}}_createSubmenuFloating(e,t,n){const i=n,s=resolveLogicalPlacement("end-start"),o=[offset({mainAxis:0,crossAxis:-4}),flip({fallbackPlacements:[resolveLogicalPlacement("start-start"),resolveLogicalPlacement("end-end"),resolveLogicalPlacement("start-end")]}),shift({padding:8})],a=()=>this._applyFloatingPosition(i,t,s,o).then(e=>(t.style.opacity="",e));return a(),autoUpdate(i,t,a)}_scheduleSubmenuClose(e,t){this._cancelSubmenuCloseTimeout(e);const n=setTimeout(()=>{this._closeSubmenu(e,t),this._submenuCloseTimeouts.delete(e)},this._config.submenuDelay);this._submenuCloseTimeouts.set(e,n)}_cancelSubmenuCloseTimeout(e){const t=this._submenuCloseTimeouts.get(e);t&&(clearTimeout(t),this._submenuCloseTimeouts.delete(e))}_clearAllSubmenuTimeouts(){for(const e of this._submenuCloseTimeouts.values())clearTimeout(e);this._submenuCloseTimeouts.clear()}_trackMousePosition(e){this._hoverIntentData={x:e.clientX,y:e.clientY,timestamp:Date.now()}}_isMovingTowardSubmenu(e,t){if(!this._hoverIntentData)return!1;const n=t.getBoundingClientRect(),i={x:e.clientX,y:e.clientY},s={x:this._hoverIntentData.x,y:this._hoverIntentData.y},o=isRTL$1()?n.right:n.left,a={x:o,y:n.top},l={x:o,y:n.bottom};return this._pointInTriangle(i,s,a,l)}_pointInTriangle(e,t,n,i){const s=triangleSign(e,t,n),o=triangleSign(e,n,i),a=triangleSign(e,i,t);return!((s<0||o<0||a<0)&&(s>0||o>0||a>0))}_selectMenuItem({key:e,target:t}){const n=t.closest(".menu")||this._menu,i=SelectorEngine.find(`:scope > ${SELECTOR_VISIBLE_ITEMS$1}`,n).filter(e=>isVisible(e));i.length&&getNextActiveElement(i,t,e===ARROW_DOWN_KEY$2,!i.includes(t)).focus()}_handleSubmenuKeydown(e){const{key:t,target:n}=e,i=isRTL$1(),s=i?ARROW_LEFT_KEY$1:ARROW_RIGHT_KEY$1,o=i?ARROW_RIGHT_KEY$1:ARROW_LEFT_KEY$1,a=n.closest(".submenu"),l=n.matches(".submenu > .menu-item");if((t===ENTER_KEY$1||t===SPACE_KEY$1)&&a&&l){e.preventDefault(),e.stopPropagation();const t=SelectorEngine.findOne(".menu",a);return t&&(this._closeSiblingSubmenus(a),this._openSubmenu(n,t,a),requestAnimationFrame(()=>{const e=SelectorEngine.findOne(SELECTOR_VISIBLE_ITEMS$1,t);e&&e.focus()})),!0}if(t===s&&a&&l){e.preventDefault(),e.stopPropagation();const t=SelectorEngine.findOne(".menu",a);return t&&(this._closeSiblingSubmenus(a),this._openSubmenu(n,t,a),requestAnimationFrame(()=>{const e=SelectorEngine.findOne(SELECTOR_VISIBLE_ITEMS$1,t);e&&e.focus()})),!0}if(t===o){const t=n.closest(".menu"),i=t?.closest(".submenu");if(i){e.preventDefault(),e.stopPropagation();const n=SelectorEngine.findOne(".submenu > .menu-item",i);return this._closeSubmenu(t,i),n&&n.focus(),!0}}if(t===HOME_KEY$2||t===END_KEY$2){e.preventDefault(),e.stopPropagation();const i=n.closest(".menu"),s=SelectorEngine.find(`:scope > ${SELECTOR_VISIBLE_ITEMS$1}`,i).filter(e=>isVisible(e));return s.length&&(t===HOME_KEY$2?s[0]:s.at(-1)).focus(),!0}return!1}static clearMenus(t){if(2!==t.button&&("keyup"!==t.type||"Tab"===t.key))for(const n of e._openInstances){if(!1===n._config.autoClose)continue;const e=t.composedPath(),i=e.includes(n._menu);if(e.includes(n._element)||"inside"===n._config.autoClose&&!i||"outside"===n._config.autoClose&&i)continue;const s=t.target.closest?.("form"),o=Boolean(s)&&n._menu.contains(s);if(n._menu.contains(t.target)&&("keyup"===t.type&&"Tab"===t.key||/input|select|option|textarea|form/i.test(t.target.tagName)||o))continue;const a={relatedTarget:n._element};"click"===t.type&&(a.clickEvent=t),n._completeHide(a)}}static dataApiKeydownHandler(t){const n=/input|textarea/i.test(t.target.tagName)||t.target.isContentEditable,i="Escape"===t.key,s=[ARROW_UP_KEY$2,ARROW_DOWN_KEY$2].includes(t.key),o=[ARROW_LEFT_KEY$1,ARROW_RIGHT_KEY$1].includes(t.key),a=[HOME_KEY$2,END_KEY$2].includes(t.key),l=[ENTER_KEY$1,SPACE_KEY$1].includes(t.key),r=t.target.matches(".submenu > .menu-item");if(!(s||i||o||a||l&&r))return;if(n&&!i)return;const c=this.matches(SELECTOR_DATA_TOGGLE$8)?this:SelectorEngine.prev(this,SELECTOR_DATA_TOGGLE$8)[0]||SelectorEngine.next(this,SELECTOR_DATA_TOGGLE$8)[0]||SelectorEngine.findOne(SELECTOR_DATA_TOGGLE$8,t.delegateTarget.parentNode);if(!c)return;const d=e.getOrCreateInstance(c);if(!(o||a||l&&r)||!d._handleSubmenuKeydown(t)){if(s)return t.preventDefault(),t.stopPropagation(),d.show(),void d._selectMenuItem(t);if(i&&d._isShown()){t.preventDefault(),t.stopPropagation();const e=t.target.closest(".menu"),n=e?.closest(".submenu");if(n&&d._openSubmenus.size>0){const t=SelectorEngine.findOne(".submenu > .menu-item",n);return d._closeSubmenu(e,n),void(t&&t.focus())}d.hide(),c.focus()}}}};EventHandler.on(document,EVENT_KEYDOWN_DATA_API,SELECTOR_DATA_TOGGLE$8,Menu.dataApiKeydownHandler),EventHandler.on(document,EVENT_KEYDOWN_DATA_API,".menu",Menu.dataApiKeydownHandler),EventHandler.on(document,EVENT_CLICK_DATA_API$5,Menu.clearMenus),EventHandler.on(document,EVENT_KEYUP_DATA_API,Menu.clearMenus),EventHandler.on(document,EVENT_CLICK_DATA_API$5,SELECTOR_DATA_TOGGLE$8,function(e){e.preventDefault(),Menu.getOrCreateInstance(this).toggle()});const NAME$16="combobox",EVENT_KEY$13=".bs.combobox",DATA_API_KEY$8=".data-api",ESCAPE_KEY$1="Escape",TAB_KEY="Tab",ARROW_UP_KEY$1="ArrowUp",ARROW_DOWN_KEY$1="ArrowDown",HOME_KEY$1="Home",END_KEY$1="End",ENTER_KEY="Enter",SPACE_KEY=" ",EVENT_CHANGE$3=`change${EVENT_KEY$13}`,EVENT_SHOW$5=`show${EVENT_KEY$13}`,EVENT_SHOWN$4=`shown${EVENT_KEY$13}`,EVENT_HIDE$4=`hide${EVENT_KEY$13}`,EVENT_HIDDEN$6=`hidden${EVENT_KEY$13}`,EVENT_CLICK_DATA_API$4=`click${EVENT_KEY$13}.data-api`,CLASS_NAME_SHOW$3="show",CLASS_NAME_SELECTED="selected",CLASS_NAME_PLACEHOLDER="combobox-placeholder",SELECTOR_DATA_TOGGLE$7='[data-bs-toggle="combobox"]',SELECTOR_MENU$1=".menu",SELECTOR_MENU_ITEM=".menu-item[data-bs-value]",SELECTOR_VISIBLE_ITEMS=".menu-item[data-bs-value]:not(.disabled):not(:disabled)",SELECTOR_VALUE=".combobox-value",SELECTOR_SEARCH_INPUT=".combobox-search-input",SELECTOR_NO_RESULTS=".combobox-no-results",Default$15={boundary:"clippingParents",multiple:!1,name:null,offset:[0,2],placeholder:"",placement:"bottom-start",search:!1,searchNormalize:!1},DefaultType$15={boundary:"(string|element)",multiple:"boolean",name:"(string|null)",offset:"(array|string|function)",placeholder:"string",placement:"string",search:"boolean",searchNormalize:"boolean"};var Combobox=class extends BaseComponent{constructor(e,t){super(e,t),this._toggle=this._element,this._menu=SelectorEngine.next(this._toggle,".menu")[0],this._valueDisplay=SelectorEngine.findOne(SELECTOR_VALUE,this._toggle),this._searchInput=SelectorEngine.findOne(SELECTOR_SEARCH_INPUT,this._menu),this._noResults=SelectorEngine.findOne(SELECTOR_NO_RESULTS,this._menu),this._hiddenInput=null,this._menuInstance=null,this._createHiddenInput(),this._createMenuInstance(),this._syncInitialSelection(),this._addEventListeners()}static get Default(){return Default$15}static get DefaultType(){return DefaultType$15}static get NAME(){return NAME$16}toggle(){return this._isShown()?this.hide():this.show()}show(){isDisabled(this._toggle)||this._isShown()||EventHandler.trigger(this._toggle,EVENT_SHOW$5).defaultPrevented||(this._menuInstance.show(),this._searchInput&&(this._searchInput.value="",this._filterItems(""),requestAnimationFrame(()=>this._searchInput.focus())),EventHandler.trigger(this._toggle,EVENT_SHOWN$4))}hide(){this._isShown()&&(EventHandler.trigger(this._toggle,EVENT_HIDE$4).defaultPrevented||(this._menuInstance.hide(),EventHandler.trigger(this._toggle,EVENT_HIDDEN$6)))}dispose(){this._menuInstance&&(this._menuInstance.dispose(),this._menuInstance=null),this._hiddenInput&&(this._hiddenInput.remove(),this._hiddenInput=null),EventHandler.off(this._menu,EVENT_KEY$13),EventHandler.off(this._toggle,EVENT_KEY$13),super.dispose()}_isShown(){return this._menu.classList.contains("show")}_createHiddenInput(){const{name:e}=this._config;e&&(this._hiddenInput=document.createElement("input"),this._hiddenInput.type="hidden",this._hiddenInput.name=e,this._hiddenInput.value="",this._toggle.parentNode.insertBefore(this._hiddenInput,this._toggle))}_createMenuInstance(){this._menuInstance=new Menu(this._toggle,{menu:this._menu,autoClose:!this._config.multiple||"outside",boundary:this._config.boundary,offset:this._config.offset,placement:this._config.placement})}_syncInitialSelection(){this._getSelectedItems().length>0?(this._updateToggleText(),this._updateHiddenInput()):this._showPlaceholder()}_addEventListeners(){EventHandler.on(this._menu,"click",SELECTOR_MENU_ITEM,e=>{const t=e.target.closest(SELECTOR_MENU_ITEM);t&&!isDisabled(t)&&(e.preventDefault(),e.stopPropagation(),this._selectItem(t))}),EventHandler.on(this._toggle,"keydown",e=>{this._handleToggleKeydown(e)}),EventHandler.on(this._menu,"keydown",e=>{this._handleMenuKeydown(e)}),this._searchInput&&(EventHandler.on(this._searchInput,"input",()=>{this._filterItems(this._searchInput.value)}),EventHandler.on(this._searchInput,"keydown",e=>{if("ArrowDown"===e.key){e.preventDefault();const t=this._getVisibleItems();t.length>0&&t[0].focus()}"Escape"===e.key&&(this.hide(),this._toggle.focus())}))}_selectItem(e){if(this._config.multiple)e.classList.toggle("selected"),setAriaAttribute(e,"aria-selected",e.classList.contains("selected"));else{const t=SelectorEngine.find(".selected",this._menu);for(const e of t)e.classList.remove("selected"),e.setAttribute("aria-selected","false");e.classList.add("selected"),e.setAttribute("aria-selected","true")}this._updateToggleText(),this._updateHiddenInput();const t=this._config.multiple?this._getSelectedItems().map(e=>e.dataset.bsValue):e.dataset.bsValue;EventHandler.trigger(this._toggle,EVENT_CHANGE$3,{value:t,item:e}),this._config.multiple||(this.hide(),this._toggle.focus())}_updateToggleText(){const e=this._getSelectedItems();if(0!==e.length)if(this._valueDisplay.classList.remove("combobox-placeholder"),this._config.multiple&&e.length>1)this._valueDisplay.textContent=`${e.length} selected`;else{const t=e[0],n=SelectorEngine.findOne(".menu-item-content > span:first-child",t);this._valueDisplay.textContent=n?n.textContent:t.textContent.trim()}else this._showPlaceholder()}_showPlaceholder(){const{placeholder:e}=this._config;e&&(this._valueDisplay.textContent=e,this._valueDisplay.classList.add("combobox-placeholder"))}_updateHiddenInput(){if(!this._hiddenInput)return;const e=this._getSelectedItems().map(e=>e.dataset.bsValue);this._hiddenInput.value=this._config.multiple?e.join(","):e[0]||""}_getSelectedItems(){return SelectorEngine.find(".selected",this._menu)}_getVisibleItems(){return SelectorEngine.find(SELECTOR_VISIBLE_ITEMS,this._menu).filter(e=>isVisible(e))}_filterItems(e){const t=this._normalizeText(e.toLowerCase().trim()),n=SelectorEngine.find(SELECTOR_MENU_ITEM,this._menu);let i=0;for(const e of n){const n=this._normalizeText(e.textContent.toLowerCase().trim()),s=!t||n.includes(t);e.style.display=s?"":"none",s&&i++}this._noResults&&this._noResults.classList.toggle("d-none",i>0)}_normalizeText(e){return this._config.searchNormalize?e.normalize("NFD").replace(/[\u0300-\u036F]/g,""):e}_handleToggleKeydown(e){const{key:t}=e;if("ArrowDown"===t||"ArrowUp"===t){e.preventDefault(),this._isShown()||this.show();const n=this._getVisibleItems();return void(n.length>0&&("ArrowDown"===t?n[0]:n.at(-1)).focus())}"Enter"!==t&&" "!==t||this._isShown()||(e.preventDefault(),this.show())}_handleMenuKeydown(e){const{key:t,target:n}=e;if("Escape"===t)return e.preventDefault(),e.stopPropagation(),this.hide(),void this._toggle.focus();if("Tab"===t)return void this.hide();const i=n.matches("input");if("ArrowDown"===t||"ArrowUp"===t){e.preventDefault();const i=this._getVisibleItems();return void(i.length>0&&getNextActiveElement(i,n,"ArrowDown"===t,!i.includes(n)).focus())}if("Home"===t||"End"===t){e.preventDefault();const n=this._getVisibleItems();return void(n.length>0&&("Home"===t?n[0]:n.at(-1)).focus())}if(("Enter"===t||" "===t)&&!i){e.preventDefault();const t=n.closest(SELECTOR_MENU_ITEM);t&&!isDisabled(t)&&this._selectItem(t)}}};EventHandler.on(document,EVENT_CLICK_DATA_API$4,SELECTOR_DATA_TOGGLE$7,function(e){e.preventDefault(),Combobox.getOrCreateInstance(this).toggle()}),EventHandler.on(document,"DOMContentLoaded",()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_TOGGLE$7))Combobox.getOrCreateInstance(e)});
7
+ /*! name: vanilla-calendar-pro v3.1.0 | url: https://github.com/uvarov-frontend/vanilla-calendar-pro */
8
+ var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,n)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,__spreadValues=(e,t)=>{for(var n in t||(t={}))__hasOwnProp.call(t,n)&&__defNormalProp(e,n,t[n]);if(__getOwnPropSymbols)for(var n of __getOwnPropSymbols(t))__propIsEnum.call(t,n)&&__defNormalProp(e,n,t[n]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__publicField=(e,t,n)=>(__defNormalProp(e,"symbol"!=typeof t?t+"":t,n),n);const errorMessages={notFoundSelector:e=>`${e} is not found, check the first argument passed to new Calendar.`,notInit:'The calendar has not been initialized, please initialize it using the "init()" method first.',notLocale:"You specified an incorrect language label or did not specify the required number of values ​​for «locale.weekdays» or «locale.months».",incorrectTime:"The value of the time property can be: false, 12 or 24.",incorrectMonthsCount:"For the «multiple» calendar type, the «displayMonthsCount» parameter can have a value from 2 to 12, and for all others it cannot be greater than 1."},setContext=(e,t,n)=>{e.context[t]=n},destroy=e=>{var t,n,i,s,o;if(!e.context.isInit)throw new Error(errorMessages.notInit);e.inputMode?(null==(t=e.context.mainElement.parentElement)||t.removeChild(e.context.mainElement),null==(i=null==(n=e.context.inputElement)?void 0:n.replaceWith)||i.call(n,e.context.originalElement),setContext(e,"inputElement",void 0)):null==(o=(s=e.context.mainElement).replaceWith)||o.call(s,e.context.originalElement),setContext(e,"mainElement",e.context.originalElement),e.onDestroy&&e.onDestroy(e)},skipOpenOnFocus=new WeakSet,shouldSkipOpenOnFocus=e=>skipOpenOnFocus.has(e),setSkipOpenOnFocus=e=>{skipOpenOnFocus.add(e)},clearSkipOpenOnFocus=e=>{skipOpenOnFocus.delete(e)},PREV_TABINDEX_ATTR="data-vc-prev-tabindex",isFocusable=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),storePrevTabIndex=e=>{if(e.hasAttribute(PREV_TABINDEX_ATTR))return;const t=e.getAttribute("tabindex");e.setAttribute(PREV_TABINDEX_ATTR,null!=t?t:"")},restorePrevTabIndex=e=>{if(!e.hasAttribute(PREV_TABINDEX_ATTR))return;const t=e.getAttribute(PREV_TABINDEX_ATTR);""===t||null===t?e.removeAttribute("tabindex"):e.setAttribute("tabindex",t),e.removeAttribute(PREV_TABINDEX_ATTR)},disableTabbing=e=>{isFocusable(e)&&(storePrevTabIndex(e),e.tabIndex=-1);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>isFocusable(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;t.nextNode();){const e=t.currentNode;storePrevTabIndex(e),e.tabIndex=-1}},restoreTabbing=e=>{restorePrevTabIndex(e),e.querySelectorAll(`[${PREV_TABINDEX_ATTR}]`).forEach(restorePrevTabIndex)},hide=e=>{e.context.isShowInInputMode&&e.context.currentType&&(e.context.mainElement.dataset.vcCalendarHidden="",setContext(e,"isShowInInputMode",!1),e.inputMode&&disableTabbing(e.context.mainElement),e.context.cleanupHandlers[0]&&(e.context.cleanupHandlers.forEach(e=>e()),setContext(e,"cleanupHandlers",[])),e.inputMode&&e.context.inputElement&&e.context.mainElement.contains(document.activeElement)&&(("function"==typeof e.openOnFocus||!0===e.openOnFocus)&&setSkipOpenOnFocus(e),e.context.inputElement.focus()),e.onHide&&e.onHide(e))};function getOffset(e){if(!e||!e.getBoundingClientRect)return{top:0,bottom:0,left:0,right:0};const t=e.getBoundingClientRect(),n=document.documentElement;return{bottom:t.bottom,right:t.right,top:t.top+window.scrollY-n.clientTop,left:t.left+window.scrollX-n.clientLeft}}function getViewportDimensions(){return{vw:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),vh:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}}function getWindowScrollPosition(){return{left:window.scrollX||document.documentElement.scrollLeft||0,top:window.scrollY||document.documentElement.scrollTop||0}}function calculateAvailableSpace(e){const{top:t,left:n}=getWindowScrollPosition(),{top:i,left:s}=getOffset(e),{vh:o,vw:a}=getViewportDimensions(),l=i-t,r=s-n;return{top:l,bottom:o-(l+e.clientHeight),left:r,right:a-(r+e.clientWidth)}}function getAvailablePosition(e,t,n=5){const i={top:!0,bottom:!0,left:!0,right:!0},s=[];if(!t||!e)return{canShow:i,parentPositions:s};const{bottom:o,top:a}=calculateAvailableSpace(e),{top:l,left:r}=getOffset(e),{height:c,width:d}=t.getBoundingClientRect(),{vh:u,vw:h}=getViewportDimensions(),_=h/2,m=u/2;return[{condition:l<m,position:"top"},{condition:l>m,position:"bottom"},{condition:r<_,position:"left"},{condition:r>_,position:"right"}].forEach(({condition:e,position:t})=>{e&&s.push(t)}),Object.assign(i,{top:c<=a-n,bottom:c<=o-n,left:d<=r,right:d<=h-r}),{canShow:i,parentPositions:s}}const handleDay=(e,t,n,i)=>{var s;const o=i.querySelector(`[data-vc-date="${t}"]`),a=null==o?void 0:o.querySelector("[data-vc-date-btn]");if(!o||!a)return;if(null!=n&&n.modifier&&a.classList.add(...n.modifier.trim().split(" ")),!(null==n?void 0:n.html))return;const l=document.createElement("div");l.className=e.styles.datePopup,l.dataset.vcDatePopup="",l.innerHTML=e.sanitizerHTML(n.html),a.ariaExpanded="true",a.ariaLabel=`${a.ariaLabel}, ${null==(s=null==l?void 0:l.textContent)?void 0:s.replace(/^\s+|\s+(?=\s)|\s+$/g,"").replace(/&nbsp;/g," ")}`,o.appendChild(l),requestAnimationFrame(()=>{if(!l)return;const{canShow:e}=getAvailablePosition(o,l),t=e.bottom?o.offsetHeight:-l.offsetHeight,n=e.left&&!e.right?o.offsetWidth-l.offsetWidth/2:!e.left&&e.right?l.offsetWidth/2:0;Object.assign(l.style,{left:`${n}px`,top:`${t}px`})})},createDatePopup=(e,t)=>{var n;e.popups&&(null==(n=Object.entries(e.popups))||n.forEach(([n,i])=>handleDay(e,n,i,t)))},getDate=e=>new Date(`${e}T00:00:00`),getDateString=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,parseDates=e=>e.reduce((e,t)=>{if(t instanceof Date||"number"==typeof t){const n=t instanceof Date?t:new Date(t);e.push(n.toISOString().substring(0,10))}else t.match(/^(\d{4}-\d{2}-\d{2})$/g)?e.push(t):t.replace(/(\d{4}-\d{2}-\d{2}).*?(\d{4}-\d{2}-\d{2})/g,(t,n,i)=>{const s=getDate(n),o=getDate(i),a=new Date(s.getTime());for(;a<=o;a.setDate(a.getDate()+1))e.push(getDateString(a));return t});return e},[]),updateAttribute=(e,t,n,i="")=>{t?e.setAttribute(n,i):e.getAttribute(n)===i&&e.removeAttribute(n)},setDateModifier=(e,t,n,i,s,o,a)=>{var l,r,c,d;const u=getDate(e.context.displayDateMin)>getDate(o)||getDate(e.context.displayDateMax)<getDate(o)||(null==(l=e.context.disableDates)?void 0:l.includes(o))||!e.selectionMonthsMode&&"current"!==a||!e.selectionYearsMode&&getDate(o).getFullYear()!==t;updateAttribute(n,u,"data-vc-date-disabled"),i&&updateAttribute(i,u,"aria-disabled","true"),i&&updateAttribute(i,u,"tabindex","-1"),updateAttribute(n,!e.disableToday&&e.context.dateToday===o,"data-vc-date-today"),updateAttribute(n,!e.disableToday&&e.context.dateToday===o,"aria-current","date"),updateAttribute(n,null==(r=e.selectedWeekends)?void 0:r.includes(s),"data-vc-date-weekend");const h=(null==(c=e.selectedHolidays)?void 0:c[0])?parseDates(e.selectedHolidays):[];if(updateAttribute(n,h.includes(o),"data-vc-date-holiday"),(null==(d=e.context.selectedDates)?void 0:d.includes(o))?(n.setAttribute("data-vc-date-selected",""),i&&i.setAttribute("aria-selected","true"),e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode&&(e.context.selectedDates[0]===o&&e.context.selectedDates[e.context.selectedDates.length-1]===o?n.setAttribute("data-vc-date-selected","first-and-last"):e.context.selectedDates[0]===o?n.setAttribute("data-vc-date-selected","first"):e.context.selectedDates[e.context.selectedDates.length-1]===o&&n.setAttribute("data-vc-date-selected","last"),e.context.selectedDates[0]!==o&&e.context.selectedDates[e.context.selectedDates.length-1]!==o&&n.setAttribute("data-vc-date-selected","middle"))):n.hasAttribute("data-vc-date-selected")&&(n.removeAttribute("data-vc-date-selected"),i&&i.removeAttribute("aria-selected")),!e.context.disableDates.includes(o)&&e.enableEdgeDatesOnly&&e.context.selectedDates.length>1&&"multiple-ranged"===e.selectionDatesMode){const t=getDate(e.context.selectedDates[0]),i=getDate(e.context.selectedDates[e.context.selectedDates.length-1]),s=getDate(o);updateAttribute(n,s>t&&s<i,"data-vc-date-selected","middle")}},getLocaleString=(e,t,n)=>new Date(`${e}T00:00:00.000Z`).toLocaleString(t,n),getWeekNumber=(e,t)=>{const n=getDate(e),i=(n.getDay()-t+7)%7;n.setDate(n.getDate()+4-i);const s=new Date(n.getFullYear(),0,1),o=Math.ceil(((+n-+s)/864e5+1)/7);return{year:n.getFullYear(),week:o}},addWeekNumberForDate=(e,t,n)=>{const i=getWeekNumber(n,e.firstWeekday);i&&(t.dataset.vcDateWeekNumber=String(i.week))},setDaysAsDisabled=(e,t,n)=>{var i,s,o,a,l;const r=null==(i=e.disableWeekdays)?void 0:i.includes(n),c=e.disableAllDates&&!!(null==(s=e.context.enableDates)?void 0:s[0]);!r&&!c||null!=(o=e.context.enableDates)&&o.includes(t)||null!=(a=e.context.disableDates)&&a.includes(t)||(e.context.disableDates.push(t),null==(l=e.context.disableDates)||l.sort((e,t)=>+new Date(e)-+new Date(t)))},createDate=(e,t,n,i,s,o)=>{const a=getDate(s).getDay(),l="string"==typeof e.locale&&e.locale.length?e.locale:"en",r=document.createElement("div");let c;r.className=e.styles.date,r.dataset.vcDate=s,r.dataset.vcDateMonth=o,r.dataset.vcDateWeekDay=String(a),r.role="gridcell",("current"===o||e.displayDatesOutside)&&(c=document.createElement("button"),c.className=e.styles.dateBtn,c.type="button",c.ariaLabel=getLocaleString(s,l,{dateStyle:"long",timeZone:"UTC"}),c.dataset.vcDateBtn="",c.innerText=String(i),r.appendChild(c)),e.enableWeekNumbers&&addWeekNumberForDate(e,r,s),setDaysAsDisabled(e,s,a),setDateModifier(e,t,r,c,a,s,o),n.addDate(r),e.onCreateDateEls&&e.onCreateDateEls(e,r)},createDatesFromCurrentMonth=(e,t,n,i,s)=>{for(let o=1;o<=n;o++){const n=new Date(i,s,o);createDate(e,i,t,o,getDateString(n),"current")}},createDatesFromNextMonth=(e,t,n,i,s)=>{const o=s+1===12?i+1:i,a=s+1===12?"01":s+2<10?`0${s+2}`:s+2;for(let s=1;s<=n;s++){const n=s<10?`0${s}`:String(s);createDate(e,i,t,s,`${o}-${a}-${n}`,"next")}},createDatesFromPrevMonth=(e,t,n,i,s)=>{let o=new Date(n,i,0).getDate()-(s-1);const a=0===i?n-1:n,l=0===i?12:i<10?`0${i}`:i;for(let i=s;i>0;i--,o++)createDate(e,n,t,o,`${a}-${l}-${o}`,"prev")},createWeekNumbers=(e,t,n,i,s)=>{if(!e.enableWeekNumbers)return;i.textContent="";const o=document.createElement("b");o.className=e.styles.weekNumbersTitle,o.innerText="#",o.dataset.vcWeekNumbers="title",i.appendChild(o);const a=document.createElement("div");a.className=e.styles.weekNumbersContent,a.dataset.vcWeekNumbers="content",i.appendChild(a);const l=document.createElement("button");l.type="button",l.className=e.styles.weekNumber;const r=s.querySelectorAll("[data-vc-date]"),c=Math.ceil((t+n)/7);for(let t=0;t<c;t++){const n=r[0===t?6:7*t].dataset.vcDate,i=getWeekNumber(n,e.firstWeekday);if(!i)return;const s=l.cloneNode(!0);s.innerText=String(i.week),s.dataset.vcWeekNumber=String(i.week),s.dataset.vcWeekYear=String(i.year),s.role="rowheader",s.ariaLabel=`${i.week}`,a.appendChild(s)}},createDates=e=>{const t=new Date(e.context.selectedYear,e.context.selectedMonth,1),n=e.context.mainElement.querySelectorAll('[data-vc="dates"]'),i=e.context.mainElement.querySelectorAll('[data-vc-week="numbers"]');n.forEach((n,s)=>{e.selectionDatesMode||(n.dataset.vcDatesDisabled=""),n.textContent="";const o=new Date(t);o.setMonth(o.getMonth()+s);const a=o.getMonth(),l=o.getFullYear(),r=(new Date(l,a,1).getDay()-e.firstWeekday+7)%7,c=new Date(l,a+1,0).getDate(),d=r+c,u=Math.ceil(d/7),h=7*u-d,_=[];for(let t=0;t<u;t++){const t=document.createElement("div");t.className=e.styles.datesRow,t.setAttribute("data-vc-dates","row"),t.setAttribute("role","row"),_.push(t)}let m=0,g=0;const p={addDate:e=>{_[m].appendChild(e),g++,g>=7&&(m++,g=0)}};createDatesFromPrevMonth(e,p,l,a,r),createDatesFromCurrentMonth(e,p,c,l,a),createDatesFromNextMonth(e,p,h,l,a);for(const e of _)n.appendChild(e);createDatePopup(e,n),createWeekNumbers(e,r,c,i[s],n)})},layoutDefault=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n <#DateRangeTooltip />\n </div>\n </div>\n <#ControlTime />\n`,layoutMonths=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Months />\n </div>\n </div>\n`,layoutMultiple=e=>`\n <div class="${e.styles.controls}" data-vc="controls" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [month] />\n <#ArrowNext [month] />\n </div>\n <div class="${e.styles.grid}" data-vc="grid">\n <#Multiple>\n <div class="${e.styles.column}" data-vc="column" role="region">\n <div class="${e.styles.header}" data-vc="header">\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <#WeekNumbers />\n <div class="${e.styles.content}" data-vc="content" role="grid">\n <#Week />\n <#Dates />\n </div>\n </div>\n </div>\n <#/Multiple>\n <#DateRangeTooltip />\n </div>\n <#ControlTime />\n`,layoutYears=e=>`\n <div class="${e.styles.header}" data-vc="header" role="toolbar" aria-label="${e.labels.navigation}">\n <#ArrowPrev [year] />\n <div class="${e.styles.headerContent}" data-vc-header="content">\n <#Month />\n <#Year />\n </div>\n <#ArrowNext [year] />\n </div>\n <div class="${e.styles.wrapper}" data-vc="wrapper">\n <div class="${e.styles.content}" data-vc="content">\n <#Years />\n </div>\n </div>\n`,ArrowNext=(e,t)=>`<button type="button" class="${e.styles.arrowNext}" data-vc-arrow="next" aria-label="${e.labels.arrowNext[t]}"></button>`,ArrowPrev=(e,t)=>`<button type="button" class="${e.styles.arrowPrev}" data-vc-arrow="prev" aria-label="${e.labels.arrowPrev[t]}"></button>`,ControlTime=e=>e.selectionTimeMode?`<div class="${e.styles.time}" data-vc="time" role="group" aria-label="${e.labels.selectingTime}"></div>`:"",DateRangeTooltip=e=>e.onCreateDateRangeTooltip?`<div class="${e.styles.dateRangeTooltip}" data-vc-date-range-tooltip="hidden"></div>`:"",Dates=e=>`<div class="${e.styles.dates}" data-vc="dates" aria-live="assertive" aria-label="${e.labels.dates}" ${"multiple"===e.type?"aria-multiselectable":""}></div>`,Month=e=>`<button type="button" class="${e.styles.month}" data-vc="month"></button>`,Months=e=>`<div class="${e.styles.months}" data-vc="months" role="grid" aria-live="assertive" aria-label="${e.labels.months}"></div>`,Week=e=>`<div class="${e.styles.week}" data-vc="week" role="row" aria-label="${e.labels.week}"></div>`,WeekNumbers=e=>e.enableWeekNumbers?`<div class="${e.styles.weekNumbers}" data-vc-week="numbers" role="row" aria-label="${e.labels.weekNumber}"></div>`:"",Year=e=>`<button type="button" class="${e.styles.year}" data-vc="year"></button>`,Years=e=>`<div class="${e.styles.years}" data-vc="years" role="grid" aria-live="assertive" aria-label="${e.labels.years}"></div>`,components={ArrowNext:ArrowNext,ArrowPrev:ArrowPrev,ControlTime:ControlTime,Dates:Dates,DateRangeTooltip:DateRangeTooltip,Month:Month,Months:Months,Week:Week,WeekNumbers:WeekNumbers,Year:Year,Years:Years},getComponent=e=>components[e],parseLayout=(e,t)=>t.replace(/[\n\t]/g,"").replace(/<#(?!\/?Multiple)(.*?)>/g,(t,n)=>{const i=(n.match(/\[(.*?)\]/)||[])[1],s=n.replace(/[/\s\n\t]|\[(.*?)\]/g,""),o=getComponent(s),a=o?o(e,null!=i?i:null):"";return e.sanitizerHTML(a)}).replace(/[\n\t]/g,""),parseMultipleLayout=(e,t)=>t.replace(new RegExp("<#Multiple>(.*?)<#\\/Multiple>","gs"),(t,n)=>{const i=Array(e.context.displayMonthsCount).fill(n).join("");return e.sanitizerHTML(i)}).replace(/[\n\t]/g,""),createLayouts=(e,t)=>{const n={default:layoutDefault,month:layoutMonths,year:layoutYears,multiple:layoutMultiple};if(Object.keys(n).forEach(t=>{const i=t;e.layouts[i].length||(e.layouts[i]=n[i](e))}),e.context.mainElement.className=e.styles.calendar,e.context.mainElement.dataset.vc="calendar",e.context.mainElement.dataset.vcType=e.context.currentType,e.context.mainElement.role="application",e.context.mainElement.tabIndex=0,e.context.mainElement.ariaLabel=e.labels.application,"multiple"!==e.context.currentType){if("multiple"===e.type&&t){const n=e.context.mainElement.querySelector('[data-vc="controls"]'),i=e.context.mainElement.querySelector('[data-vc="grid"]'),s=t.closest('[data-vc="column"]');return n&&n.remove(),i&&(i.dataset.vcGrid="hidden"),s&&(s.dataset.vcColumn=e.context.currentType),void(s&&(s.innerHTML=e.sanitizerHTML(parseLayout(e,e.layouts[e.context.currentType]))))}e.context.mainElement.innerHTML=e.sanitizerHTML(parseLayout(e,e.layouts[e.context.currentType]))}else e.context.mainElement.innerHTML=e.sanitizerHTML(parseMultipleLayout(e,parseLayout(e,e.layouts[e.context.currentType])))},setVisibilityArrows=(e,t,n,i)=>{e.style.visibility=n?"hidden":"",t.style.visibility=i?"hidden":""},handleDefaultType=(e,t,n)=>{const i=getDate(getDateString(new Date(e.context.selectedYear,e.context.selectedMonth,1))),s=new Date(i.getTime()),o=new Date(i.getTime());s.setMonth(s.getMonth()-e.monthsToSwitch),o.setMonth(o.getMonth()+e.monthsToSwitch);const a=getDate(e.context.dateMin),l=getDate(e.context.dateMax);e.selectionYearsMode||(a.setFullYear(i.getFullYear()),l.setFullYear(i.getFullYear()));const r=!e.selectionMonthsMode||s.getFullYear()<a.getFullYear()||s.getFullYear()===a.getFullYear()&&s.getMonth()<a.getMonth(),c=!e.selectionMonthsMode||o.getFullYear()>l.getFullYear()||o.getFullYear()===l.getFullYear()&&o.getMonth()>l.getMonth()-(e.context.displayMonthsCount-1);setVisibilityArrows(t,n,r,c)},handleYearType=(e,t,n)=>{const i=getDate(e.context.dateMin),s=getDate(e.context.dateMax),o=!!(i.getFullYear()&&e.context.displayYear-7<=i.getFullYear()),a=!!(s.getFullYear()&&e.context.displayYear+7>=s.getFullYear());setVisibilityArrows(t,n,o,a)},visibilityArrows=e=>{if("month"===e.context.currentType)return;const t=e.context.mainElement.querySelector('[data-vc-arrow="prev"]'),n=e.context.mainElement.querySelector('[data-vc-arrow="next"]');t&&n&&{default:()=>handleDefaultType(e,t,n),year:()=>handleYearType(e,t,n)}["multiple"===e.context.currentType?"default":e.context.currentType]()},visibilityHandler=(e,t,n,i,s)=>{const o=new Date(i.setFullYear(e.context.selectedYear,e.context.selectedMonth+n)).getFullYear(),a=new Date(i.setMonth(e.context.selectedMonth+n)).getMonth(),l=e.context.locale.months.long[a],r=t.closest('[data-vc="column"]');r&&(r.ariaLabel=`${l} ${o}`);const c={month:{id:a,label:l},year:{id:o,label:o}};t.innerText=String(c[s].label),t.dataset[`vc${s.charAt(0).toUpperCase()+s.slice(1)}`]=String(c[s].id),t.ariaLabel=`${e.labels[s]} ${c[s].label}`;const d={month:e.selectionMonthsMode,year:e.selectionYearsMode},u=!1===d[s]||"only-arrows"===d[s];u&&(t.tabIndex=-1),t.disabled=u},visibilityTitle=e=>{const t=e.context.mainElement.querySelectorAll('[data-vc="month"]'),n=e.context.mainElement.querySelectorAll('[data-vc="year"]'),i=new Date(e.context.selectedYear,e.context.selectedMonth,1);[t,n].forEach(t=>null==t?void 0:t.forEach((t,n)=>visibilityHandler(e,t,n,i,t.dataset.vc)))},setYearModifier=(e,t,n,i,s)=>{var o;const a={month:{selected:"data-vc-months-month-selected",aria:"aria-selected",value:"vcMonthsMonth",selectedProperty:"selectedMonth"},year:{selected:"data-vc-years-year-selected",aria:"aria-selected",value:"vcYearsYear",selectedProperty:"selectedYear"}};s&&(null==(o=e.context.mainElement.querySelectorAll({month:"[data-vc-months-month]",year:"[data-vc-years-year]"}[n]))||o.forEach(e=>{e.removeAttribute(a[n].selected),e.removeAttribute(a[n].aria)}),setContext(e,a[n].selectedProperty,Number(t.dataset[a[n].value])),visibilityTitle(e),"year"===n&&visibilityArrows(e)),i&&(t.setAttribute(a[n].selected,""),t.setAttribute(a[n].aria,"true"))},getColumnID=(e,t)=>{var n;if("multiple"!==e.type)return{currentValue:null,columnID:0};const i=e.context.mainElement.querySelectorAll('[data-vc="column"]'),s=Array.from(i).findIndex(e=>e.closest(`[data-vc-column="${t}"]`));return{currentValue:s>=0?Number(null==(n=i[s].querySelector(`[data-vc="${t}"]`))?void 0:n.getAttribute(`data-vc-${t}`)):null,columnID:Math.max(s,0)}},createMonthEl=(e,t,n,i,s,o,a)=>{const l=t.cloneNode(!1);return l.className=e.styles.monthsMonth,l.innerText=i,l.ariaLabel=s,l.role="gridcell",l.dataset.vcMonthsMonth=`${a}`,o&&(l.ariaDisabled="true"),o&&(l.tabIndex=-1),l.disabled=o,setYearModifier(e,l,"month",n===a,!1),l},createMonths=(e,t)=>{var n,i;const s=null==(n=null==t?void 0:t.closest('[data-vc="header"]'))?void 0:n.querySelector('[data-vc="year"]'),o=s?Number(s.dataset.vcYear):e.context.selectedYear,a=(null==t?void 0:t.dataset.vcMonth)?Number(t.dataset.vcMonth):e.context.selectedMonth;setContext(e,"currentType","month"),createLayouts(e,t),visibilityTitle(e);const l=e.context.mainElement.querySelector('[data-vc="months"]');if(!e.selectionMonthsMode||!l)return;const r=e.monthsToSwitch>1?e.context.locale.months.long.map((t,n)=>a-e.monthsToSwitch*n).concat(e.context.locale.months.long.map((t,n)=>a+e.monthsToSwitch*n)).filter(e=>e>=0&&e<=12):Array.from(Array(12).keys()),c=document.createElement("button");c.type="button";for(let t=0;t<12;t++){const n=getDate(e.context.dateMin),i=getDate(e.context.dateMax),s=e.context.displayMonthsCount-1,{columnID:d}=getColumnID(e,"month"),u=o<=n.getFullYear()&&t<n.getMonth()+d||o>=i.getFullYear()&&t>i.getMonth()-s+d||o>i.getFullYear()||t!==a&&!r.includes(t),h=createMonthEl(e,c,a,e.context.locale.months.short[t],e.context.locale.months.long[t],u,t);l.appendChild(h),e.onCreateMonthEls&&e.onCreateMonthEls(e,h)}null==(i=e.context.mainElement.querySelector("[data-vc-months-month]:not([disabled])"))||i.focus()},TimeInput=(e,t,n,i,s)=>`\n <label class="${t}" data-vc-time-input="${e}">\n <input type="text" name="${e}" maxlength="2" aria-label="${n[`input${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${i}" ${s?"disabled":""}>\n </label>\n`,TimeRange=(e,t,n,i,s,o,a)=>`\n <label class="${t}" data-vc-time-range="${e}">\n <input type="range" name="${e}" min="${i}" max="${s}" step="${o}" aria-label="${n[`range${e.charAt(0).toUpperCase()+e.slice(1)}`]}" value="${a}">\n </label>\n`,handleActions=(e,t,n,i)=>{({hour:()=>setContext(e,"selectedHours",n),minute:()=>setContext(e,"selectedMinutes",n)})[i](),setContext(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${e.context.selectedKeeping?` ${e.context.selectedKeeping}`:""}`),e.onChangeTime&&e.onChangeTime(e,t,!1),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t)},transformTime24=(e,t)=>{var n;return(null==(n={0:{AM:"00",PM:"12"},1:{AM:"01",PM:"13"},2:{AM:"02",PM:"14"},3:{AM:"03",PM:"15"},4:{AM:"04",PM:"16"},5:{AM:"05",PM:"17"},6:{AM:"06",PM:"18"},7:{AM:"07",PM:"19"},8:{AM:"08",PM:"20"},9:{AM:"09",PM:"21"},10:{AM:"10",PM:"22"},11:{AM:"11",PM:"23"},12:{AM:"00",PM:"12"}}[Number(e)])?void 0:n[t])||String(e)},handleClickKeepingTime=(e,t,n,i,s)=>{const o=o=>{const a="AM"===e.context.selectedKeeping?"PM":"AM",l=transformTime24(e.context.selectedHours,a);Number(l)<=i&&Number(l)>=s?(setContext(e,"selectedKeeping",a),n.value=l,handleActions(e,o,e.context.selectedHours,"hour"),t.ariaLabel=`${e.labels.btnKeeping} ${e.context.selectedKeeping}`,t.innerText=e.context.selectedKeeping):e.onChangeTime&&e.onChangeTime(e,o,!0)};return t.addEventListener("click",o),()=>{t.removeEventListener("click",o)}},transformTime12=e=>({0:"12",13:"01",14:"02",15:"03",16:"04",17:"05",18:"06",19:"07",20:"08",21:"09",22:"10",23:"11"}[Number(e)]||String(e)),updateInputAndRange=(e,t,n,i)=>{e.value=n,t.value=i},updateKeepingTime$1=(e,t,n)=>{t&&n&&(setContext(e,"selectedKeeping",n),t.innerText=n)},handleInput$1=(e,t,n,i,s,o,a)=>{const l={hour:(l,r,c)=>{e.selectionTimeMode&&{12:()=>{if(!e.context.selectedKeeping)return;const d=Number(transformTime24(r,e.context.selectedKeeping));if(!(d<=o&&d>=a))return updateInputAndRange(n,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));updateInputAndRange(n,t,transformTime12(r),transformTime24(r,e.context.selectedKeeping)),l>12&&updateKeepingTime$1(e,i,"PM"),handleActions(e,c,transformTime12(r),s)},24:()=>{if(!(l<=o&&l>=a))return updateInputAndRange(n,t,e.context.selectedHours,e.context.selectedHours),void(e.onChangeTime&&e.onChangeTime(e,c,!0));updateInputAndRange(n,t,r,r),handleActions(e,c,r,s)}}[e.selectionTimeMode]()},minute:(i,l,r)=>{if(!(i<=o&&i>=a))return n.value=e.context.selectedMinutes,void(e.onChangeTime&&e.onChangeTime(e,r,!0));n.value=l,t.value=l,handleActions(e,r,l,s)}},r=e=>{const t=Number(n.value),i=n.value.padStart(2,"0");l[s]&&l[s](t,i,e)};return n.addEventListener("change",r),()=>{n.removeEventListener("change",r)}},updateInputAndTime=(e,t,n,i,s)=>{t.value=s,handleActions(e,n,s,i)},updateKeepingTime=(e,t,n)=>{t&&(setContext(e,"selectedKeeping",n),t.innerText=n)},handleRange=(e,t,n,i,s)=>{const o=o=>{const a=Number(t.value),l=t.value.padStart(2,"0"),r="hour"===s,c=24===e.selectionTimeMode,d=a>0&&a<12;r&&!c&&updateKeepingTime(e,i,0===a||d?"AM":"PM"),updateInputAndTime(e,n,o,s,!r||c||d?l:transformTime12(t.value))};return t.addEventListener("input",o),()=>{t.removeEventListener("input",o)}},handleMouseOver=e=>e.setAttribute("data-vc-input-focus",""),handleMouseOut=e=>e.removeAttribute("data-vc-input-focus"),handleTime=(e,t)=>{const n=t.querySelector('[data-vc-time-range="hour"] input[name="hour"]'),i=t.querySelector('[data-vc-time-range="minute"] input[name="minute"]'),s=t.querySelector('[data-vc-time-input="hour"] input[name="hour"]'),o=t.querySelector('[data-vc-time-input="minute"] input[name="minute"]'),a=t.querySelector('[data-vc-time="keeping"]');if(!(n&&i&&s&&o))return;const l=e=>{e.target===n&&handleMouseOver(s),e.target===i&&handleMouseOver(o)},r=e=>{e.target===n&&handleMouseOut(s),e.target===i&&handleMouseOut(o)};return t.addEventListener("mouseover",l),t.addEventListener("mouseout",r),handleInput$1(e,n,s,a,"hour",e.timeMaxHour,e.timeMinHour),handleInput$1(e,i,o,a,"minute",e.timeMaxMinute,e.timeMinMinute),handleRange(e,n,s,a,"hour"),handleRange(e,i,o,a,"minute"),a&&handleClickKeepingTime(e,a,n,e.timeMaxHour,e.timeMinHour),()=>{t.removeEventListener("mouseover",l),t.removeEventListener("mouseout",r)}},createTime=e=>{const t=e.context.mainElement.querySelector('[data-vc="time"]');if(!e.selectionTimeMode||!t)return;const[n,i]=[e.timeMinHour,e.timeMaxHour],[s,o]=[e.timeMinMinute,e.timeMaxMinute],a=e.context.selectedKeeping?transformTime24(e.context.selectedHours,e.context.selectedKeeping):e.context.selectedHours,l="range"===e.timeControls;var r;t.innerHTML=e.sanitizerHTML(`\n <div class="${e.styles.timeContent}" data-vc-time="content">\n ${TimeInput("hour",e.styles.timeHour,e.labels,e.context.selectedHours,l)}\n ${TimeInput("minute",e.styles.timeMinute,e.labels,e.context.selectedMinutes,l)}\n ${12===e.selectionTimeMode?(r=e.context.selectedKeeping,`<button type="button" class="${e.styles.timeKeeping}" aria-label="${e.labels.btnKeeping} ${r}" data-vc-time="keeping" ${l?"disabled":""}>${r}</button>`):""}\n </div>\n <div class="${e.styles.timeRanges}" data-vc-time="ranges">\n ${TimeRange("hour",e.styles.timeRange,e.labels,n,i,e.timeStepHour,a)}\n ${TimeRange("minute",e.styles.timeRange,e.labels,s,o,e.timeStepMinute,e.context.selectedMinutes)}\n </div>\n `),handleTime(e,t)},createWeek=e=>{const t=e.selectedWeekends?[...e.selectedWeekends]:[],n=[...e.context.locale.weekdays.long].reduce((n,i,s)=>[...n,{id:s,titleShort:e.context.locale.weekdays.short[s],titleLong:i,isWeekend:t.includes(s)}],[]),i=[...n.slice(e.firstWeekday),...n.slice(0,e.firstWeekday)];e.context.mainElement.querySelectorAll('[data-vc="week"]').forEach(t=>{const n=e.onClickWeekDay?document.createElement("button"):document.createElement("b");e.onClickWeekDay&&(n.type="button"),i.forEach(i=>{const s=n.cloneNode(!0);s.innerText=i.titleShort,s.className=e.styles.weekDay,s.role="columnheader",s.ariaLabel=i.titleLong,s.dataset.vcWeekDay=String(i.id),i.isWeekend&&(s.dataset.vcWeekDayOff=""),t.appendChild(s)})})},createYearEl=(e,t,n,i,s)=>{const o=t.cloneNode(!1);return o.className=e.styles.yearsYear,o.innerText=String(s),o.ariaLabel=String(s),o.role="gridcell",o.dataset.vcYearsYear=`${s}`,i&&(o.ariaDisabled="true"),i&&(o.tabIndex=-1),o.disabled=i,setYearModifier(e,o,"year",n===s,!1),o},createYears=(e,t)=>{var n;const i=(null==t?void 0:t.dataset.vcYear)?Number(t.dataset.vcYear):e.context.selectedYear;setContext(e,"currentType","year"),createLayouts(e,t),visibilityTitle(e),visibilityArrows(e);const s=e.context.mainElement.querySelector('[data-vc="years"]');if(!e.selectionYearsMode||!s)return;const o="multiple"!==e.type||e.context.selectedYear===i?0:1,a=document.createElement("button");a.type="button";for(let t=e.context.displayYear-7;t<e.context.displayYear+8;t++){const n=t<getDate(e.context.dateMin).getFullYear()+o||t>getDate(e.context.dateMax).getFullYear(),l=createYearEl(e,a,i,n,t);s.appendChild(l),e.onCreateYearEls&&e.onCreateYearEls(e,l)}null==(n=e.context.mainElement.querySelector("[data-vc-years-year]:not([disabled])"))||n.focus()},trackChangesHTMLElement=(e,t,n)=>{new MutationObserver(e=>{for(let i=0;i<e.length;i++)if(e[i].attributeName===t){n();break}}).observe(e,{attributes:!0})},haveListener={value:!1,set:()=>haveListener.value=!0,check:()=>haveListener.value},setTheme=(e,t)=>e.dataset.vcTheme=t,trackChangesThemeInSystemSettings=(e,t)=>{if(setTheme(e.context.mainElement,t.matches?"dark":"light"),"system"!==e.selectedTheme||haveListener.check())return;const n=e=>{document.querySelectorAll('[data-vc="calendar"]')?.forEach(t=>setTheme(t,e.matches?"dark":"light"))};t.addEventListener?t.addEventListener("change",n):t.addListener(n),haveListener.set()},detectTheme=(e,t)=>{const n=e.themeAttrDetect.length?document.querySelector(e.themeAttrDetect):null,i=e.themeAttrDetect.replace(/^.*\[(.+)\]/g,(e,t)=>t);if(!n||"system"===n.getAttribute(i))return void trackChangesThemeInSystemSettings(e,t);const s=n.getAttribute(i);s?(setTheme(e.context.mainElement,s),trackChangesHTMLElement(n,i,()=>{const t=n.getAttribute(i);t&&setTheme(e.context.mainElement,t)})):trackChangesThemeInSystemSettings(e,t)},handleTheme=e=>{"not all"!==window.matchMedia("(prefers-color-scheme)").media?"system"===e.selectedTheme?detectTheme(e,window.matchMedia("(prefers-color-scheme: dark)")):setTheme(e.context.mainElement,e.selectedTheme):setTheme(e.context.mainElement,"light")},capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1).replace(/\./,""),getLocaleWeekday=(e,t,n)=>{const i=new Date(`1978-01-0${t+1}T00:00:00.000Z`),s=i.toLocaleString(n,{weekday:"short",timeZone:"UTC"}),o=i.toLocaleString(n,{weekday:"long",timeZone:"UTC"});e.context.locale.weekdays.short.push(capitalizeFirstLetter(s)),e.context.locale.weekdays.long.push(capitalizeFirstLetter(o))},getLocaleMonth=(e,t,n)=>{const i=new Date(`1978-${String(t+1).padStart(2,"0")}-01T00:00:00.000Z`),s=i.toLocaleString(n,{month:"short",timeZone:"UTC"}),o=i.toLocaleString(n,{month:"long",timeZone:"UTC"});e.context.locale.months.short.push(capitalizeFirstLetter(s)),e.context.locale.months.long.push(capitalizeFirstLetter(o))},getLocale=e=>{var t,n,i,s,o,a,l,r;if(!(e.context.locale.weekdays.short[6]&&e.context.locale.weekdays.long[6]&&e.context.locale.months.short[11]&&e.context.locale.months.long[11]))if("string"==typeof e.locale){if("string"==typeof e.locale&&!e.locale.length)throw new Error(errorMessages.notLocale);Array.from({length:7},(t,n)=>getLocaleWeekday(e,n,e.locale)),Array.from({length:12},(t,n)=>getLocaleMonth(e,n,e.locale))}else{if(!((null==(n=null==(t=e.locale)?void 0:t.weekdays)?void 0:n.short[6])&&(null==(s=null==(i=e.locale)?void 0:i.weekdays)?void 0:s.long[6])&&(null==(a=null==(o=e.locale)?void 0:o.months)?void 0:a.short[11])&&(null==(r=null==(l=e.locale)?void 0:l.months)?void 0:r.long[11])))throw new Error(errorMessages.notLocale);setContext(e,"locale",__spreadValues({},e.locale))}},create=e=>{handleTheme(e),getLocale(e),createLayouts(e),visibilityTitle(e),visibilityArrows(e),createTime(e),{default:()=>{createWeek(e),createDates(e)},multiple:()=>{createWeek(e),createDates(e)},month:()=>createMonths(e),year:()=>createYears(e)}[e.context.currentType]()},handleArrowKeys=e=>{const t=t=>{var n;const i=t.target;if(!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key)||"button"!==i.localName)return;const s=Array.from(e.context.mainElement.querySelectorAll('[data-vc="calendar"] button')),o=s.indexOf(i);if(-1===o)return;const a=(l=s[o]).hasAttribute("data-vc-date-btn")?7:l.hasAttribute("data-vc-months-month")?4:l.hasAttribute("data-vc-years-year")?5:1;var l;null==(n=s[(0,{ArrowUp:()=>Math.max(0,o-a),ArrowDown:()=>Math.min(s.length-1,o+a),ArrowLeft:()=>Math.max(0,o-1),ArrowRight:()=>Math.min(s.length-1,o+1)}[t.key])()])||n.focus()};return e.context.mainElement.addEventListener("keydown",t),()=>e.context.mainElement.removeEventListener("keydown",t)},handleMonth=(e,t)=>{const n=getDate(getDateString(new Date(e.context.selectedYear,e.context.selectedMonth,1)));({prev:()=>n.setMonth(n.getMonth()-e.monthsToSwitch),next:()=>n.setMonth(n.getMonth()+e.monthsToSwitch)})[t](),setContext(e,"selectedMonth",n.getMonth()),setContext(e,"selectedYear",n.getFullYear()),visibilityTitle(e),visibilityArrows(e),createDates(e)},handleClickArrow=(e,t)=>{const n=t.target.closest("[data-vc-arrow]");if(n){if(["default","multiple"].includes(e.context.currentType))handleMonth(e,n.dataset.vcArrow);else if("year"===e.context.currentType&&void 0!==e.context.displayYear){const i={prev:-15,next:15}[n.dataset.vcArrow];setContext(e,"displayYear",e.context.displayYear+i),createYears(e,t.target)}e.onClickArrow&&e.onClickArrow(e,t)}},resolveToggle=(e,t)=>void 0===t||("function"==typeof t?t(e):t),canToggleSelection=e=>resolveToggle(e,e.enableDateToggle),handleSelectDate=(e,t,n)=>{const i=t.dataset.vcDate,s=t.closest("[data-vc-date][data-vc-date-selected]"),o=canToggleSelection(e);if(s&&!o)return;const a=s?e.context.selectedDates.filter(e=>e!==i):n?[...e.context.selectedDates,i]:[i];setContext(e,"selectedDates",a)},createDateRangeTooltip=(e,t,n)=>{if(!t)return;if(!n)return t.dataset.vcDateRangeTooltip="hidden",void(t.textContent="");const i=e.context.mainElement.getBoundingClientRect(),s=n.getBoundingClientRect();t.style.left=s.left-i.left+s.width/2+"px",t.style.top=s.bottom-i.top-s.height+"px",t.dataset.vcDateRangeTooltip="visible",t.innerHTML=e.sanitizerHTML(e.onCreateDateRangeTooltip(e,n,t,s,i))},state={self:null,lastDateEl:null,isHovering:!1,rangeMin:void 0,rangeMax:void 0,tooltipEl:null,timeoutId:null},addHoverEffect=(e,t,n)=>{var i,s,o;if(!(null==(s=null==(i=state.self)?void 0:i.context)?void 0:s.selectedDates[0]))return;const a=getDateString(e);null!=(o=state.self.context.disableDates)&&o.includes(a)||(state.self.context.mainElement.querySelectorAll(`[data-vc-date="${a}"]`).forEach(e=>e.dataset.vcDateHover=""),t.forEach(e=>e.dataset.vcDateHover="first"),n.forEach(e=>{"first"===e.dataset.vcDateHover?e.dataset.vcDateHover="first-and-last":e.dataset.vcDateHover="last"}))},removeHoverEffect=()=>{var e,t;(null==(t=null==(e=state.self)?void 0:e.context)?void 0:t.mainElement)&&state.self.context.mainElement.querySelectorAll("[data-vc-date-hover]").forEach(e=>e.removeAttribute("data-vc-date-hover"))},handleHoverDatesEvent=e=>{var t,n;if(!e||!(null==(n=null==(t=state.self)?void 0:t.context)?void 0:n.selectedDates[0]))return;if(!e.closest('[data-vc="dates"]'))return state.lastDateEl=null,createDateRangeTooltip(state.self,state.tooltipEl,null),void removeHoverEffect();const i=e.closest("[data-vc-date]");if(!i||state.lastDateEl===i)return;state.lastDateEl=i,createDateRangeTooltip(state.self,state.tooltipEl,i),removeHoverEffect();const s=i.dataset.vcDate,o=getDate(state.self.context.selectedDates[0]),a=getDate(s),l=state.self.context.mainElement.querySelectorAll(`[data-vc-date="${state.self.context.selectedDates[0]}"]`),r=state.self.context.mainElement.querySelectorAll(`[data-vc-date="${s}"]`),[c,d]=o<a?[l,r]:[r,l],[u,h]=o<a?[o,a]:[a,o];for(let e=new Date(u);e<=h;e.setDate(e.getDate()+1))addHoverEffect(e,c,d)},handleHoverSelectedDatesRangeEvent=e=>{const t=null==e?void 0:e.closest("[data-vc-date-selected]");if(!t&&state.lastDateEl)return state.lastDateEl=null,void createDateRangeTooltip(state.self,state.tooltipEl,null);t&&state.lastDateEl!==t&&(state.lastDateEl=t,createDateRangeTooltip(state.self,state.tooltipEl,t))},optimizedHoverHandler=e=>t=>{const n=t.target;state.isHovering||(state.isHovering=!0,requestAnimationFrame(()=>{e(n),state.isHovering=!1}))},optimizedHandleHoverDatesEvent=optimizedHoverHandler(handleHoverDatesEvent),optimizedHandleHoverSelectedDatesRangeEvent=optimizedHoverHandler(handleHoverSelectedDatesRangeEvent),handleCancelSelectionDates=e=>{state.self&&"Escape"===e.key&&(state.lastDateEl=null,setContext(state.self,"selectedDates",[]),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),createDateRangeTooltip(state.self,state.tooltipEl,null),removeHoverEffect())},handleMouseLeave=()=>{null!==state.timeoutId&&clearTimeout(state.timeoutId),state.timeoutId=setTimeout(()=>{state.lastDateEl=null,createDateRangeTooltip(state.self,state.tooltipEl,null),removeHoverEffect()},50)},updateDisabledDates=()=>{var e,t,n,i;if(!(null==(n=null==(t=null==(e=state.self)?void 0:e.context)?void 0:t.selectedDates)?void 0:n[0])||!(null==(i=state.self.context.disableDates)?void 0:i[0]))return;const s=getDate(state.self.context.selectedDates[0]),[o,a]=state.self.context.disableDates.map(e=>getDate(e)).reduce(([e,t],n)=>[s>=n?n:e,s<n&&null===t?n:t],[null,null]);o&&setContext(state.self,"displayDateMin",getDateString(new Date(o.setDate(o.getDate()+1)))),a&&setContext(state.self,"displayDateMax",getDateString(new Date(a.setDate(a.getDate()-1)))),state.self.disableDatesPast&&!state.self.disableAllDates&&getDate(state.self.context.displayDateMin)<getDate(state.self.context.dateToday)&&setContext(state.self,"displayDateMin",state.self.context.dateToday)},handleSelectDateRange=(e,t)=>{state.self=e,state.lastDateEl=t,removeHoverEffect(),e.disableDatesGaps&&(state.rangeMin=state.rangeMin?state.rangeMin:e.context.displayDateMin,state.rangeMax=state.rangeMax?state.rangeMax:e.context.displayDateMax),e.onCreateDateRangeTooltip&&(state.tooltipEl=e.context.mainElement.querySelector("[data-vc-date-range-tooltip]"));const n=null==t?void 0:t.dataset.vcDate;if(n){const t=1===e.context.selectedDates.length&&e.context.selectedDates[0].includes(n),i=t&&!canToggleSelection(e)?[n,n]:t&&canToggleSelection(e)?[]:e.context.selectedDates.length>1?[n]:[...e.context.selectedDates,n];setContext(e,"selectedDates",i),e.context.selectedDates.length>1&&e.context.selectedDates.sort((e,t)=>+new Date(e)-+new Date(t))}({set:()=>(e.disableDatesGaps&&updateDisabledDates(),createDateRangeTooltip(state.self,state.tooltipEl,t),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),state.self.context.mainElement.addEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.addEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.addEventListener("keydown",handleCancelSelectionDates),()=>{state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates)}),reset:()=>{const[n,i]=[e.context.selectedDates[0],e.context.selectedDates[e.context.selectedDates.length-1]],s=e.context.selectedDates[0]!==e.context.selectedDates[e.context.selectedDates.length-1],o=parseDates([`${n}:${i}`]).filter(t=>!e.context.disableDates.includes(t)),a=s?e.enableEdgeDatesOnly?[n,i]:o:[e.context.selectedDates[0],e.context.selectedDates[0]];if(setContext(e,"selectedDates",a),e.disableDatesGaps&&(setContext(e,"displayDateMin",state.rangeMin),setContext(e,"displayDateMax",state.rangeMax)),state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverDatesEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),state.self.context.mainElement.removeEventListener("keydown",handleCancelSelectionDates),e.onCreateDateRangeTooltip)return e.context.selectedDates[0]||(state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave),createDateRangeTooltip(state.self,state.tooltipEl,null)),e.context.selectedDates[0]&&(state.self.context.mainElement.addEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.addEventListener("mouseleave",handleMouseLeave),createDateRangeTooltip(state.self,state.tooltipEl,t)),()=>{state.self.context.mainElement.removeEventListener("mousemove",optimizedHandleHoverSelectedDatesRangeEvent),state.self.context.mainElement.removeEventListener("mouseleave",handleMouseLeave)}}})[1===e.context.selectedDates.length?"set":"reset"]()},updateDateModifier=e=>{e.context.mainElement.querySelectorAll("[data-vc-date]").forEach(t=>{const n=t.querySelector("[data-vc-date-btn]"),i=t.dataset.vcDate,s=getDate(i).getDay();setDateModifier(e,e.context.selectedYear,t,n,s,i,"current")})},handleClickDate=(e,t)=>{var n;const i=t.target,s=i.closest("[data-vc-date-btn]");if(!e.selectionDatesMode||!["single","multiple","multiple-ranged"].includes(e.selectionDatesMode)||!s)return;const o=s.closest("[data-vc-date]");({single:()=>handleSelectDate(e,o,!1),multiple:()=>handleSelectDate(e,o,!0),"multiple-ranged":()=>handleSelectDateRange(e,o)})[e.selectionDatesMode](),null==(n=e.context.selectedDates)||n.sort((e,t)=>+new Date(e)-+new Date(t)),e.onClickDate&&e.onClickDate(e,t),e.inputMode&&e.context.inputElement&&e.context.mainElement&&e.onChangeToInput&&e.onChangeToInput(e,t);const a=i.closest('[data-vc-date-month="prev"]'),l=i.closest('[data-vc-date-month="next"]');({prev:()=>e.enableMonthChangeOnDayClick?handleMonth(e,"prev"):updateDateModifier(e),next:()=>e.enableMonthChangeOnDayClick?handleMonth(e,"next"):updateDateModifier(e),current:()=>updateDateModifier(e)})[a?"prev":l?"next":"current"]()},typeClick=["month","year"],getValue=(e,t,n)=>{const{currentValue:i,columnID:s}=getColumnID(e,t);return"month"===e.context.currentType&&s>=0?n-s:"year"===e.context.currentType&&e.context.selectedYear!==i?n-1:n},handleMultipleYearSelection=(e,t)=>{const n=getValue(e,"year",Number(t.dataset.vcYearsYear)),i=getDate(e.context.dateMin),s=getDate(e.context.dateMax),o=e.context.displayMonthsCount-1,{columnID:a}=getColumnID(e,"year"),l=e.context.selectedMonth<i.getMonth()&&n<=i.getFullYear(),r=e.context.selectedMonth>s.getMonth()-o+a&&n>=s.getFullYear(),c=n<i.getFullYear(),d=n>s.getFullYear(),u=l||c?i.getFullYear():r||d?s.getFullYear():n,h=l||c?i.getMonth():r||d?s.getMonth()-o+a:e.context.selectedMonth;setContext(e,"selectedYear",u),setContext(e,"selectedMonth",h)},handleMultipleMonthSelection=(e,t)=>{const n=t.closest('[data-vc-column="month"]').querySelector('[data-vc="year"]'),i=getValue(e,"month",Number(t.dataset.vcMonthsMonth)),s=Number(n.dataset.vcYear),o=getDate(e.context.dateMin),a=getDate(e.context.dateMax),l=i<o.getMonth()&&s<=o.getFullYear(),r=i>a.getMonth()&&s>=a.getFullYear();setContext(e,"selectedYear",s),setContext(e,"selectedMonth",l?o.getMonth():r?a.getMonth():i)},handleItemClick=(e,t,n,i)=>{var s;({year:()=>{if("multiple"===e.type)return handleMultipleYearSelection(e,i);setContext(e,"selectedYear",Number(i.dataset.vcYearsYear))},month:()=>{if("multiple"===e.type)return handleMultipleMonthSelection(e,i);setContext(e,"selectedMonth",Number(i.dataset.vcMonthsMonth))}})[n](),{year:()=>{var n;return null==(n=e.onClickYear)?void 0:n.call(e,e,t)},month:()=>{var n;return null==(n=e.onClickMonth)?void 0:n.call(e,e,t)}}[n](),e.context.currentType!==e.type?(setContext(e,"currentType",e.type),create(e),null==(s=e.context.mainElement.querySelector(`[data-vc="${n}"]`))||s.focus()):setYearModifier(e,i,n,!0,!0)},handleClickType=(e,t,n)=>{var i;const s=t.target,o=s.closest(`[data-vc="${n}"]`),a={year:()=>createYears(e,s),month:()=>createMonths(e,s)};if(o&&e.onClickTitle&&e.onClickTitle(e,t),o&&e.context.currentType!==n)return a[n]();const l=s.closest(`[data-vc-${n}s-${n}]`);if(l)return handleItemClick(e,t,n,l);const r=s.closest('[data-vc="grid"]'),c=s.closest('[data-vc="column"]');(e.context.currentType===n&&o||"multiple"===e.type&&e.context.currentType===n&&r&&!c)&&(setContext(e,"currentType",e.type),create(e),null==(i=e.context.mainElement.querySelector(`[data-vc="${n}"]`))||i.focus())},handleClickMonthOrYear=(e,t)=>{const n={month:e.selectionMonthsMode,year:e.selectionYearsMode};typeClick.forEach(i=>{n[i]&&t.target&&handleClickType(e,t,i)})},handleClickWeekNumber=(e,t)=>{if(!e.enableWeekNumbers||!e.onClickWeekNumber)return;const n=t.target.closest("[data-vc-week-number]"),i=e.context.mainElement.querySelectorAll("[data-vc-date-week-number]");if(!n||!i[0])return;const s=Number(n.innerText),o=Number(n.dataset.vcWeekYear),a=Array.from(i).filter(e=>Number(e.dataset.vcDateWeekNumber)===s);e.onClickWeekNumber(e,s,o,a,t)},handleClickWeekDay=(e,t)=>{if(!e.onClickWeekDay)return;const n=t.target.closest("[data-vc-week-day]"),i=t.target.closest('[data-vc="column"]'),s=i?i.querySelectorAll("[data-vc-date-week-day]"):e.context.mainElement.querySelectorAll("[data-vc-date-week-day]");if(!n||!s[0])return;const o=Number(n.dataset.vcWeekDay),a=Array.from(s).filter(e=>Number(e.dataset.vcDateWeekDay)===o);e.onClickWeekDay(e,o,a,t)},handleClick=e=>{const t=t=>{handleClickArrow(e,t),handleClickWeekDay(e,t),handleClickWeekNumber(e,t),handleClickDate(e,t),handleClickMonthOrYear(e,t)};return e.context.mainElement.addEventListener("click",t),()=>e.context.mainElement.removeEventListener("click",t)},initMonthsCount=e=>{if("multiple"===e.type&&(e.displayMonthsCount<=1||e.displayMonthsCount>12))throw new Error(errorMessages.incorrectMonthsCount);if("multiple"!==e.type&&e.displayMonthsCount>1)throw new Error(errorMessages.incorrectMonthsCount);setContext(e,"displayMonthsCount",e.displayMonthsCount?e.displayMonthsCount:"multiple"===e.type?2:1)},getLocalDate=()=>{const e=new Date;return new Date(e.getTime()-6e4*e.getTimezoneOffset()).toISOString().substring(0,10)},resolveDate=(e,t)=>"today"===e?getLocalDate():e instanceof Date||"number"==typeof e||"string"==typeof e?parseDates([e])[0]:t,initRange=e=>{var t,n,i;const s=resolveDate(e.dateMin,e.dateMin),o=resolveDate(e.dateMax,e.dateMax),a=resolveDate(e.displayDateMin,s),l=resolveDate(e.displayDateMax,o);setContext(e,"dateToday",resolveDate(e.dateToday,e.dateToday)),setContext(e,"displayDateMin",a?getDate(s)>=getDate(a)?s:a:s),setContext(e,"displayDateMax",l?getDate(o)<=getDate(l)?o:l:o);const r=e.disableDatesPast&&!e.disableAllDates&&getDate(a)<getDate(e.context.dateToday);setContext(e,"displayDateMin",r||e.disableAllDates?e.context.dateToday:a),setContext(e,"displayDateMax",e.disableAllDates?e.context.dateToday:l),setContext(e,"disableDates",e.disableDates[0]&&!e.disableAllDates?parseDates(e.disableDates):e.disableAllDates?[e.context.displayDateMin]:[]),e.context.disableDates.length>1&&e.context.disableDates.sort((e,t)=>+new Date(e)-+new Date(t)),setContext(e,"enableDates",e.enableDates[0]?parseDates(e.enableDates):[]),null!=(t=e.context.enableDates)&&t[0]&&null!=(n=e.context.disableDates)&&n[0]&&setContext(e,"disableDates",e.context.disableDates.filter(t=>!e.context.enableDates.includes(t))),e.context.enableDates.length>1&&e.context.enableDates.sort((e,t)=>+new Date(e)-+new Date(t)),null!=(i=e.context.enableDates)&&i[0]&&e.disableAllDates&&(setContext(e,"displayDateMin",e.context.enableDates[0]),setContext(e,"displayDateMax",e.context.enableDates[e.context.enableDates.length-1])),setContext(e,"dateMin",e.displayDisabledDates?s:e.context.displayDateMin),setContext(e,"dateMax",e.displayDisabledDates?o:e.context.displayDateMax)},initSelectedDates=e=>{var t;setContext(e,"selectedDates",(null==(t=e.selectedDates)?void 0:t[0])?parseDates(e.selectedDates):[])},displayClosestValidDate=e=>{const t=t=>{const n=new Date(t);setInitialContext(e,n.getMonth(),n.getFullYear())};if(e.displayDateMin&&"today"!==e.displayDateMin&&(n=e.displayDateMin,i=new Date,new Date(n).getTime()>i.getTime())){const n=e.selectedDates.length&&e.selectedDates[0]?parseDates(e.selectedDates)[0]:e.displayDateMin;return t(getDate(resolveDate(n,e.displayDateMin))),!0}var n,i;if(e.displayDateMax&&"today"!==e.displayDateMax&&((e,t)=>new Date(e).getTime()<t.getTime())(e.displayDateMax,new Date)){const n=e.selectedDates.length&&e.selectedDates[0]?parseDates(e.selectedDates)[0]:e.displayDateMax;return t(getDate(resolveDate(n,e.displayDateMax))),!0}return!1},setInitialContext=(e,t,n)=>{setContext(e,"selectedMonth",t),setContext(e,"selectedYear",n),setContext(e,"displayYear",n)},initSelectedMonthYear=e=>{var t;if(e.enableJumpToSelectedDate&&(null==(t=e.selectedDates)?void 0:t[0])&&void 0===e.selectedMonth&&void 0===e.selectedYear){const t=getDate(parseDates(e.selectedDates)[0]);return void setInitialContext(e,t.getMonth(),t.getFullYear())}if(displayClosestValidDate(e))return;const n=void 0!==e.selectedMonth&&Number(e.selectedMonth)>=0&&Number(e.selectedMonth)<12,i=void 0!==e.selectedYear&&Number(e.selectedYear)>=0&&Number(e.selectedYear)<=9999;setInitialContext(e,n?Number(e.selectedMonth):getDate(e.context.dateToday).getMonth(),i?Number(e.selectedYear):getDate(e.context.dateToday).getFullYear())},initTime=e=>{var t,n,i;if(!e.selectionTimeMode)return;if(![12,24].includes(e.selectionTimeMode))throw new Error(errorMessages.incorrectTime);const s=12===e.selectionTimeMode,o=s?/^(0[1-9]|1[0-2]):([0-5][0-9]) ?(AM|PM)?$/i:/^([0-1]?[0-9]|2[0-3]):([0-5][0-9])$/;let[a,l,r]=null!=(i=null==(n=null==(t=e.selectedTime)?void 0:t.match(o))?void 0:n.slice(1))?i:[];a?s&&!r&&(r="AM"):(a=s?transformTime12(String(e.timeMinHour)):String(e.timeMinHour),l=String(e.timeMinMinute),r=s?Number(transformTime12(String(e.timeMinHour)))>=12?"PM":"AM":null),setContext(e,"selectedHours",a.padStart(2,"0")),setContext(e,"selectedMinutes",l.padStart(2,"0")),setContext(e,"selectedKeeping",r),setContext(e,"selectedTime",`${e.context.selectedHours}:${e.context.selectedMinutes}${r?` ${r}`:""}`)},initAllVariables=e=>{setContext(e,"currentType",e.type),initMonthsCount(e),initRange(e),initSelectedMonthYear(e),initSelectedDates(e),initTime(e)},reset=(e,{year:t,month:n,dates:i,time:s,locale:o},a=!0)=>{var l;const r={year:e.selectedYear,month:e.selectedMonth,dates:e.selectedDates,time:e.selectedTime};e.selectedYear=t?r.year:e.context.selectedYear,e.selectedMonth=n?r.month:e.context.selectedMonth,e.selectedTime=s?r.time:e.context.selectedTime,e.selectedDates="only-first"===i&&(null==(l=e.context.selectedDates)?void 0:l[0])?[e.context.selectedDates[0]]:!0===i?r.dates:e.context.selectedDates,o&&setContext(e,"locale",{months:{short:[],long:[]},weekdays:{short:[],long:[]}}),initAllVariables(e),a&&create(e),e.selectedYear=r.year,e.selectedMonth=r.month,e.selectedDates=r.dates,e.selectedTime=r.time,"multiple-ranged"===e.selectionDatesMode&&i&&handleSelectDateRange(e,null)},createToInput=e=>{const t=document.createElement("div");return t.className=e.styles.calendar,t.dataset.vc="calendar",t.dataset.vcInput="",t.dataset.vcCalendarHidden="",setContext(e,"inputModeInit",!0),setContext(e,"isShowInInputMode",!1),setContext(e,"mainElement",t),document.body.appendChild(e.context.mainElement),reset(e,{year:!0,month:!0,dates:!0,time:!0,locale:!0}),setTimeout(()=>show(e)),e.onInit&&e.onInit(e),handleArrowKeys(e),handleClick(e)},canOpenOnFocus=e=>resolveToggle(e,e.openOnFocus),handleInput=e=>{setContext(e,"inputElement",e.context.mainElement);const t=()=>{e.context.inputModeInit?setTimeout(()=>show(e)):createToInput(e)};e.context.inputElement.addEventListener("click",t);const n="function"==typeof e.openOnFocus||!0===e.openOnFocus,i=()=>{shouldSkipOpenOnFocus(e)?clearSkipOpenOnFocus(e):canOpenOnFocus(e)&&t()};n&&e.context.inputElement.addEventListener("focus",i);const s=t=>{const n="Tab"===t.key&&!t.shiftKey,i=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(t.key);(n||i)&&(t=>{var n;if(!e.context.isShowInInputMode)return!1;if(document.activeElement!==e.context.inputElement)return!1;const i=e=>e.tabIndex>=0&&!e.hasAttribute("disabled")&&"true"!==e.getAttribute("aria-disabled"),s=null!=(n=document.createTreeWalker(e.context.mainElement,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>i(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}).nextNode())?n:i(e.context.mainElement)?e.context.mainElement:null;!s||s.tabIndex<0||(t.preventDefault(),s.focus())})(t)};return e.context.inputElement.addEventListener("keydown",s),()=>{e.context.inputElement.removeEventListener("click",t),n&&e.context.inputElement.removeEventListener("focus",i),e.context.inputElement.removeEventListener("keydown",s)}},init=e=>(setContext(e,"originalElement",e.context.mainElement.cloneNode(!0)),setContext(e,"isInit",!0),e.inputMode?handleInput(e):(initAllVariables(e),create(e),e.onInit&&e.onInit(e),handleArrowKeys(e),handleClick(e))),update=(e,t)=>{if(!e.context.isInit)throw new Error(errorMessages.notInit);reset(e,__spreadValues(__spreadValues({},{year:!0,month:!0,dates:!0,time:!0,locale:!0}),t),!(e.inputMode&&!e.context.inputModeInit)),e.onUpdate&&e.onUpdate(e)},replaceProperties=(e,t)=>{const n=Object.keys(t);for(let i=0;i<n.length;i++){const s=n[i];"object"!=typeof e[s]||"object"!=typeof t[s]||t[s]instanceof Date||Array.isArray(t[s])?void 0!==t[s]&&(e[s]=t[s]):replaceProperties(e[s],t[s])}},set=(e,t,n)=>{replaceProperties(e,t),e.context.isInit&&update(e,n)};function findBestPickerPosition(e,t){const n="left";if(!t||!e)return n;const{canShow:i,parentPositions:s}=getAvailablePosition(e,t),o=i.left&&i.right;return(o&&i.bottom?"center":o&&i.top?["top","center"]:Array.isArray(s)?["bottom"===s[0]?"top":"bottom",...s.slice(1)]:s)||n}const setPosition=(e,t,n)=>{if(!e)return;const i="auto"===n?findBestPickerPosition(e,t):n,s={top:-t.offsetHeight,bottom:e.offsetHeight,left:0,center:e.offsetWidth/2-t.offsetWidth/2,right:e.offsetWidth-t.offsetWidth},o=Array.isArray(i)?i[0]:"bottom",a=Array.isArray(i)?i[1]:i;t.dataset.vcPosition=o;const{top:l,left:r}=getOffset(e),c=l+s[o];let d=r+s[a];const{vw:u}=getViewportDimensions();if(d+t.clientWidth>u){const e=window.innerWidth-document.body.clientWidth;d=u-t.clientWidth-e}else d<0&&(d=0);Object.assign(t.style,{left:`${d}px`,top:`${c}px`})},show=e=>{if(e.context.isShowInInputMode)return;if(!e.context.currentType)return void e.context.mainElement.click();setContext(e,"cleanupHandlers",[]),setContext(e,"isShowInInputMode",!0),e.inputMode&&restoreTabbing(e.context.mainElement),setPosition(e.context.inputElement,e.context.mainElement,e.positionToInput),e.context.mainElement.removeAttribute("data-vc-calendar-hidden");const t=()=>{setPosition(e.context.inputElement,e.context.mainElement,e.positionToInput)};window.addEventListener("resize",t),e.context.cleanupHandlers.push(()=>window.removeEventListener("resize",t));const n=t=>{"Escape"===t.key&&hide(e)};document.addEventListener("keydown",n),e.context.cleanupHandlers.push(()=>document.removeEventListener("keydown",n));const i=t=>{t.target===e.context.inputElement||e.context.mainElement.contains(t.target)||hide(e)};document.addEventListener("click",i,{capture:!0}),e.context.cleanupHandlers.push(()=>document.removeEventListener("click",i,{capture:!0})),e.onShow&&e.onShow(e)},labels={application:"Calendar",navigation:"Calendar Navigation",arrowNext:{month:"Next month",year:"Next list of years"},arrowPrev:{month:"Previous month",year:"Previous list of years"},month:"Select month, current selected month:",months:"List of months",year:"Select year, current selected year:",years:"List of years",week:"Days of the week",weekNumber:"Numbers of weeks in a year",dates:"Dates in the current month",selectingTime:"Selecting a time ",inputHour:"Hours",inputMinute:"Minutes",rangeHour:"Slider for selecting hours",rangeMinute:"Slider for selecting minutes",btnKeeping:"Switch AM/PM, current position:"},styles={calendar:"vc",controls:"vc-controls",grid:"vc-grid",column:"vc-column",header:"vc-header",headerContent:"vc-header__content",month:"vc-month",year:"vc-year",arrowPrev:"vc-arrow vc-arrow_prev",arrowNext:"vc-arrow vc-arrow_next",wrapper:"vc-wrapper",content:"vc-content",months:"vc-months",monthsMonth:"vc-months__month",years:"vc-years",yearsYear:"vc-years__year",week:"vc-week",weekDay:"vc-week__day",weekNumbers:"vc-week-numbers",weekNumbersTitle:"vc-week-numbers__title",weekNumbersContent:"vc-week-numbers__content",weekNumber:"vc-week-number",dates:"vc-dates",datesRow:"vc-dates__row",date:"vc-date",dateBtn:"vc-date__btn",datePopup:"vc-date__popup",dateRangeTooltip:"vc-date-range-tooltip",time:"vc-time",timeContent:"vc-time__content",timeHour:"vc-time__hour",timeMinute:"vc-time__minute",timeKeeping:"vc-time__keeping",timeRanges:"vc-time__ranges",timeRange:"vc-time__range"};var OptionsCalendar=class{constructor(){__publicField(this,"type","default"),__publicField(this,"inputMode",!1),__publicField(this,"openOnFocus",!0),__publicField(this,"positionToInput","left"),__publicField(this,"firstWeekday",1),__publicField(this,"monthsToSwitch",1),__publicField(this,"themeAttrDetect","html[data-theme]"),__publicField(this,"locale","en"),__publicField(this,"dateToday","today"),__publicField(this,"dateMin","1970-01-01"),__publicField(this,"dateMax","2470-12-31"),__publicField(this,"displayDateMin"),__publicField(this,"displayDateMax"),__publicField(this,"displayDatesOutside",!0),__publicField(this,"displayDisabledDates",!1),__publicField(this,"displayMonthsCount"),__publicField(this,"disableDates",[]),__publicField(this,"disableAllDates",!1),__publicField(this,"disableDatesPast",!1),__publicField(this,"disableDatesGaps",!1),__publicField(this,"disableWeekdays",[]),__publicField(this,"disableToday",!1),__publicField(this,"enableDates",[]),__publicField(this,"enableEdgeDatesOnly",!0),__publicField(this,"enableDateToggle",!0),__publicField(this,"enableWeekNumbers",!1),__publicField(this,"enableMonthChangeOnDayClick",!0),__publicField(this,"enableJumpToSelectedDate",!1),__publicField(this,"selectionDatesMode","single"),__publicField(this,"selectionMonthsMode",!0),__publicField(this,"selectionYearsMode",!0),__publicField(this,"selectionTimeMode",!1),__publicField(this,"selectedDates",[]),__publicField(this,"selectedMonth"),__publicField(this,"selectedYear"),__publicField(this,"selectedHolidays",[]),__publicField(this,"selectedWeekends",[0,6]),__publicField(this,"selectedTime"),__publicField(this,"selectedTheme","system"),__publicField(this,"timeMinHour",0),__publicField(this,"timeMaxHour",23),__publicField(this,"timeMinMinute",0),__publicField(this,"timeMaxMinute",59),__publicField(this,"timeControls","all"),__publicField(this,"timeStepHour",1),__publicField(this,"timeStepMinute",1),__publicField(this,"sanitizerHTML",e=>e),__publicField(this,"onClickDate"),__publicField(this,"onClickWeekDay"),__publicField(this,"onClickWeekNumber"),__publicField(this,"onClickTitle"),__publicField(this,"onClickMonth"),__publicField(this,"onClickYear"),__publicField(this,"onClickArrow"),__publicField(this,"onChangeTime"),__publicField(this,"onChangeToInput"),__publicField(this,"onCreateDateRangeTooltip"),__publicField(this,"onCreateDateEls"),__publicField(this,"onCreateMonthEls"),__publicField(this,"onCreateYearEls"),__publicField(this,"onInit"),__publicField(this,"onUpdate"),__publicField(this,"onDestroy"),__publicField(this,"onShow"),__publicField(this,"onHide"),__publicField(this,"popups",{}),__publicField(this,"labels",__spreadValues({},labels)),__publicField(this,"layouts",{default:"",multiple:"",month:"",year:""}),__publicField(this,"styles",__spreadValues({},styles))}};const _Calendar=class e extends OptionsCalendar{constructor(t,n){var i;super(),__publicField(this,"init",()=>init(this)),__publicField(this,"update",e=>update(this,e)),__publicField(this,"destroy",()=>destroy(this)),__publicField(this,"show",()=>show(this)),__publicField(this,"hide",()=>hide(this)),__publicField(this,"set",(e,t)=>set(this,e,t)),__publicField(this,"context"),this.context=__spreadProps(__spreadValues({},this.context),{locale:{months:{short:[],long:[]},weekdays:{short:[],long:[]}}}),setContext(this,"mainElement","string"==typeof t?null!=(i=e.memoizedElements.get(t))?i:this.queryAndMemoize(t):t),n&&replaceProperties(this,n)}queryAndMemoize(t){const n=document.querySelector(t);if(!n)throw new Error(errorMessages.notFoundSelector(t));return e.memoizedElements.set(t,n),n}};__publicField(_Calendar,"memoizedElements",new Map);let Calendar=_Calendar;const NAME$15="datepicker",EVENT_KEY$12=".bs.datepicker",DATA_API_KEY$7=".data-api",EVENT_CHANGE$2=`change${EVENT_KEY$12}`,EVENT_SHOW$4=`show${EVENT_KEY$12}`,EVENT_SHOWN$3=`shown${EVENT_KEY$12}`,EVENT_HIDE$3=`hide${EVENT_KEY$12}`,EVENT_HIDDEN$5=`hidden${EVENT_KEY$12}`,EVENT_CLICK_DATA_API$3=`click${EVENT_KEY$12}.data-api`,EVENT_FOCUSIN_DATA_API=`focusin${EVENT_KEY$12}.data-api`,SELECTOR_DATA_TOGGLE$6='[data-bs-toggle="datepicker"]',HIDE_DELAY=100,Default$14={datepickerTheme:null,dateMin:null,dateMax:null,dateFormat:null,displayElement:null,displayMonthsCount:1,firstWeekday:1,inline:!1,locale:"default",positionElement:null,selectedDates:[],selectionMode:"single",placement:"left",vcpOptions:{}},DefaultType$14={datepickerTheme:"(null|string)",dateMin:"(null|string|number|object)",dateMax:"(null|string|number|object)",dateFormat:"(null|object|function)",displayElement:"(null|string|element|boolean)",displayMonthsCount:"number",firstWeekday:"number",inline:"boolean",locale:"string",positionElement:"(null|string|element)",selectedDates:"array",selectionMode:"string",placement:"string",vcpOptions:"object"};var Datepicker=class extends BaseComponent{constructor(e,t){super(e,t),this._calendar=null,this._isShown=!1,this._initCalendar()}static get Default(){return Default$14}static get DefaultType(){return DefaultType$14}static get NAME(){return NAME$15}toggle(){if(!this._config.inline)return this._isShown?this.hide():this.show()}show(){this._config.inline||!this._calendar||isDisabled(this._element)||this._isShown||EventHandler.trigger(this._element,EVENT_SHOW$4).defaultPrevented||(this._calendar.show(),this._isShown=!0,EventHandler.trigger(this._element,EVENT_SHOWN$3))}hide(){this._config.inline||this._calendar&&this._isShown&&(EventHandler.trigger(this._element,EVENT_HIDE$3).defaultPrevented||(this._calendar.hide(),this._isShown=!1,EventHandler.trigger(this._element,EVENT_HIDDEN$5)))}dispose(){this._themeObserver&&(this._themeObserver.disconnect(),this._themeObserver=null),this._calendar&&this._calendar.destroy(),this._calendar=null,super.dispose()}getSelectedDates(){const e=this._calendar?.context?.selectedDates;return e?[...e]:[]}setSelectedDates(e){this._calendar&&this._calendar.set({selectedDates:e})}_initCalendar(){this._isInput="INPUT"===this._element.tagName,this._isInline=this._config.inline,this._isInline&&!this._isInput&&(this._boundInput=this._element.querySelector('input[type="hidden"], input[name]')),this._positionElement=this._resolvePositionElement(),this._displayElement=this._resolveDisplayElement();const e=this._buildCalendarOptions();this._calendar=new Calendar(this._positionElement,e),this._calendar.init(),this._setupThemeObserver(),this._isInput&&this._element.value&&this._parseInputValue(),this._updateDisplayWithSelectedDates()}_updateDisplayWithSelectedDates(){const{selectedDates:e}=this._config;if(!e||0===e.length)return;const t=this._formatDateForInput(e);this._isInput&&(this._element.value=t),this._boundInput&&(this._boundInput.value=e.join(",")),this._displayElement&&(this._displayElement.textContent=t)}_resolvePositionElement(){let{positionElement:e}=this._config;if("string"==typeof e&&(e=document.querySelector(e)),!e&&this._isInput&&!this._isInline){const t=this._element.closest(".form-adorn");t&&(e=t)}return e||this._element}_resolveDisplayElement(){const{displayElement:e}=this._config;return"string"==typeof e?document.querySelector(e):!0===e||null===e&&!this._isInput&&!this._isInline?this._element.querySelector("[data-bs-datepicker-display]")||this._element:e}_getThemeAncestor(){return this._element.closest("[data-bs-theme]")}_getEffectiveTheme(){const{datepickerTheme:e}=this._config;return e||this._getThemeAncestor()?.getAttribute("data-bs-theme")||null}_syncThemeAttribute(e){if(!e)return;const t=this._getEffectiveTheme();t?e.setAttribute("data-bs-theme",t):e.removeAttribute("data-bs-theme")}_setupThemeObserver(){const e=this._getThemeAncestor();e&&!this._config.datepickerTheme&&(this._themeObserver=new MutationObserver(()=>{this._syncThemeAttribute(this._calendar?.context?.mainElement)}),this._themeObserver.observe(e,{attributes:!0,attributeFilter:["data-bs-theme"]}))}_buildCalendarOptions(){const e=this._getEffectiveTheme(),t=e&&"auto"!==e?e:"system",n={...this._config.vcpOptions,inputMode:!this._isInline,positionToInput:this._config.placement,firstWeekday:this._config.firstWeekday,locale:this._config.locale,selectionDatesMode:this._config.selectionMode,selectedDates:this._config.selectedDates,displayMonthsCount:this._config.displayMonthsCount,type:this._config.displayMonthsCount>1?"multiple":"default",selectedTheme:t,themeAttrDetect:"[data-bs-theme]",onClickDate:(e,t)=>this._handleDateClick(e,t),onInit:e=>{this._syncThemeAttribute(e.context.mainElement)},onShow:()=>{this._isShown=!0,this._syncThemeAttribute(this._calendar.context.mainElement)},onHide:()=>{this._isShown=!1}};if(this._config.selectedDates.length>0){const e=this._parseDate(this._config.selectedDates[0]);n.selectedMonth=e.getMonth(),n.selectedYear=e.getFullYear()}return this._config.dateMin&&(n.dateMin=this._config.dateMin),this._config.dateMax&&(n.dateMax=this._config.dateMax),n}_handleDateClick(e,t){const n=[...e.context.selectedDates];if(n.length>0){const e=this._formatDateForInput(n);this._isInput&&(this._element.value=e),this._boundInput&&(this._boundInput.value=n.join(",")),this._displayElement&&(this._displayElement.textContent=e)}EventHandler.trigger(this._element,EVENT_CHANGE$2,{dates:n,event:t}),this._maybeHideAfterSelection(n)}_maybeHideAfterSelection(e){this._isInline||("single"===this._config.selectionMode&&e.length>0||"multiple-ranged"===this._config.selectionMode&&e.length>=2)&&setTimeout(()=>this.hide(),100)}_parseDate(e){const[t,n,i]=e.split("-");return new Date(t,n-1,i)}_formatDate(e){const t=this._parseDate(e),n="default"===this._config.locale?void 0:this._config.locale,{dateFormat:i}=this._config;return"function"==typeof i?i(t,n):i&&"object"==typeof i?new Intl.DateTimeFormat(n,i).format(t):t.toLocaleDateString(n)}_formatDateForInput(e){if(0===e.length)return"";if(1===e.length)return this._formatDate(e[0]);const t="multiple-ranged"===this._config.selectionMode?" – ":", ";return e.map(e=>this._formatDate(e)).join(t)}_parseInputValue(){const e=this._element.value.trim();if(!e)return;const t=new Date(e);if(!Number.isNaN(t.getTime())){const e=`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`;this._calendar.set({selectedDates:[e]})}}};EventHandler.on(document,EVENT_CLICK_DATA_API$3,SELECTOR_DATA_TOGGLE$6,function(e){"INPUT"!==this.tagName&&"true"!==this.dataset.bsInline&&(e.preventDefault(),Datepicker.getOrCreateInstance(this).toggle())}),EventHandler.on(document,EVENT_FOCUSIN_DATA_API,SELECTOR_DATA_TOGGLE$6,function(){"INPUT"===this.tagName&&Datepicker.getOrCreateInstance(this).show()}),EventHandler.on(document,`DOMContentLoaded${EVENT_KEY$12}.data-api`,()=>{const e=`${SELECTOR_DATA_TOGGLE$6}[data-bs-inline="true"], ${SELECTOR_DATA_TOGGLE$6}[data-bs-selected-dates]`;for(const t of document.querySelectorAll(e))Datepicker.getOrCreateInstance(t)});const CLASS_NAME_OPEN="dialog-open";var DialogBase=class extends BaseComponent{constructor(e,t){super(e,t),this._isTransitioning=!1,this._openedAsModal=!1,this._addDialogListeners()}static get NAME(){return"dialogbase"}toggle(e){return this._element.open?this.hide():this.show(e)}show(e){if(this._element.open||this._isTransitioning)return;if(EventHandler.trigger(this._element,this.constructor.eventName("show"),{relatedTarget:e}).defaultPrevented)return;this._isTransitioning=!0,this._onBeforeShow();const{modal:t,preventBodyScroll:n}=this._getShowOptions();this._showElement({modal:t,preventBodyScroll:n}),this._queueCallback(()=>{this._isTransitioning=!1,EventHandler.trigger(this._element,this.constructor.eventName("shown"),{relatedTarget:e})},this._element,this._isAnimated())}hide(){this._element.open&&!this._isTransitioning&&(EventHandler.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented||(this._isTransitioning=!0,this._hideElement(),this._queueCallback(()=>{this._element.open&&this._closeAndCleanup(),this._element.classList.remove("hiding"),this._onAfterHide(),this._isTransitioning=!1,EventHandler.trigger(this._element,this.constructor.eventName("hidden"))},this._element,this._isAnimated())))}dispose(){this._element.open&&this._closeAndCleanup(),EventHandler.off(this._element,"cancel",this._cancelHandler),super.dispose()}_getShowOptions(){return{modal:!0,preventBodyScroll:!0}}_onBeforeShow(){}_onAfterHide(){}_isAnimated(){return!this._element.classList.contains(this._getInstantClassName())}_getInstantClassName(){return"dialog-instant"}_getStaticClassName(){return"dialog-static"}_onCancel(){}_showElement({modal:e=!0,preventBodyScroll:t=!0}={}){this._openedAsModal=e,e?this._element.showModal():this._element.show(),t&&document.documentElement.classList.add("dialog-open")}_hideElement(){this._hideChildComponents(),this._element.classList.add("hiding"),this._shouldDeferClose()||this._closeAndCleanup()}_closeAndCleanup(){this._element.close(),this._openedAsModal=!1,document.querySelector("dialog[open]:modal")||document.documentElement.classList.remove("dialog-open")}_shouldDeferClose(){return!1}_triggerBackdropTransition(){if(EventHandler.trigger(this._element,this.constructor.eventName("hidePrevented")).defaultPrevented)return;const e=this._getStaticClassName();this._element.classList.add(e),this._queueCallback(()=>{this._element.classList.remove(e)},this._element)}_hideChildComponents(){for(const e of SelectorEngine.find('[data-bs-toggle="tooltip"], [data-bs-toggle="popover"]',this._element)){const t=data_default.getAny(e);t&&"function"==typeof t.hide&&t.hide()}for(const e of SelectorEngine.find(".toast.show",this._element)){const t=data_default.getAny(e);t&&"function"==typeof t.hide&&t.hide()}}_addDialogListeners(){const e=this.constructor.EVENT_KEY;this._cancelHandler=e=>{e.preventDefault(),this._config.keyboard?(this._onCancel(),this.hide()):this._triggerBackdropTransition()},EventHandler.on(this._element,"cancel",this._cancelHandler),EventHandler.on(this._element,`keydown${e}`,e=>{"Escape"!==e.key||this._openedAsModal||(e.preventDefault(),this._config.keyboard&&(this._onCancel(),this.hide()))}),EventHandler.on(this._element,`click${e}`,e=>{e.target===this._element&&this._openedAsModal&&("static"!==this._config.backdrop?this.hide():this._triggerBackdropTransition())})}};const NAME$14="dialog",EVENT_KEY$11=".bs.dialog",DATA_API_KEY$6=".data-api",EVENT_SHOW$3="show.bs.dialog",EVENT_HIDDEN$4="hidden.bs.dialog",EVENT_CANCEL="cancel.bs.dialog",EVENT_CLICK_DATA_API$2="click.bs.dialog.data-api",CLASS_NAME_NONMODAL="dialog-nonmodal",CLASS_NAME_INSTANT="dialog-instant",CLASS_NAME_SWAP_IN="dialog-swap-in",SELECTOR_DATA_TOGGLE$5='[data-bs-toggle="dialog"]',Default$13={backdrop:!0,keyboard:!0,modal:!0},DefaultType$13={backdrop:"(boolean|string)",keyboard:"boolean",modal:"boolean"};var Dialog=class extends DialogBase{constructor(e,t){super(e,t)}static get Default(){return Default$13}static get DefaultType(){return DefaultType$13}static get NAME(){return NAME$14}handleUpdate(){}_getShowOptions(){return{modal:this._config.modal,preventBodyScroll:this._config.modal}}_onBeforeShow(){this._config.modal||this._element.classList.add("dialog-nonmodal")}_onAfterHide(){this._element.classList.remove("dialog-nonmodal")}_shouldDeferClose(){return this._isAnimated()}_onCancel(){EventHandler.trigger(this._element,EVENT_CANCEL)}};EventHandler.on(document,EVENT_CLICK_DATA_API$2,SELECTOR_DATA_TOGGLE$5,function(e){const t=SelectorEngine.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),EventHandler.one(t,EVENT_SHOW$3,e=>{e.defaultPrevented||EventHandler.one(t,EVENT_HIDDEN$4,()=>{isVisible(this)&&this.focus({preventScroll:!0})})});const n=Manipulator.getDataAttributes(this),i=this.closest("dialog[open]");if(i&&i!==t){const e=Dialog.getOrCreateInstance(t,n);t.classList.add("dialog-swap-in"),e.show(this),EventHandler.one(t,"shown.bs.dialog",()=>{t.classList.remove("dialog-swap-in")});const s=Dialog.getInstance(i);return void(s&&(i.classList.add("dialog-instant"),EventHandler.one(i,EVENT_HIDDEN$4,()=>{i.classList.remove("dialog-instant")}),s.hide()))}Dialog.getOrCreateInstance(t,n).toggle(this)}),enableDismissTrigger(Dialog);const NAME$13="navoverflow",EVENT_KEY$10=".bs.navoverflow",EVENT_UPDATE=`update${EVENT_KEY$10}`,EVENT_OVERFLOW=`overflow${EVENT_KEY$10}`,EVENT_RESIZE$2=`resize${EVENT_KEY$10}`,CLASS_NAME_OVERFLOW="nav-overflow",CLASS_NAME_OVERFLOW_MENU="nav-overflow-menu",CLASS_NAME_HIDDEN="d-none",SELECTOR_NAV_ITEM=".nav-item",SELECTOR_NAV_LINK=".nav-link",SELECTOR_OVERFLOW_TOGGLE=".nav-overflow-toggle",SELECTOR_OVERFLOW_MENU=".nav-overflow-menu",SELECTOR_CUSTOM_ICON="[data-bs-overflow-icon]",CLASS_NAME_KEEP="nav-overflow-keep",Default$12={collapseBelow:0,iconPlacement:"start",menuPlacement:"bottom-end",moreText:"More",moreIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16"><path d="M3 9.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3m5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3"/></svg>',threshold:0},DefaultType$12={collapseBelow:"(number|string)",iconPlacement:"string",menuPlacement:"string",moreText:"string",moreIcon:"string",threshold:"number"};var NavOverflow=class extends BaseComponent{constructor(e,t){super(e,t),this._items=[],this._overflowItems=[],this._overflowMenu=null,this._overflowToggle=null,this._resizeObserver=null,this._resizeHandler=null,this._collapseBelow=0,this._init()}static get Default(){return Default$12}static get DefaultType(){return DefaultType$12}static get NAME(){return NAME$13}update(){this._calculateOverflow(),EventHandler.trigger(this._element,EVENT_UPDATE)}dispose(){this._resizeObserver&&this._resizeObserver.disconnect(),this._resizeHandler&&EventHandler.off(window,EVENT_RESIZE$2,this._resizeHandler),this._restoreItems(),this._overflowToggle&&this._overflowToggle.parentElement&&this._overflowToggle.parentElement.remove(),super.dispose()}_init(){this._element.classList.add("nav-overflow"),this._items=[...SelectorEngine.find(".nav-item",this._element)];for(const[e,t]of this._items.entries())t.dataset.bsNavOrder=e;this._collapseBelow=this._resolveCollapseBelow(),this._createOverflowMenu(),this._setupResizeObserver(),this._calculateOverflow()}_createOverflowMenu(){if(this._overflowToggle=SelectorEngine.findOne(".nav-overflow-toggle",this._element),this._overflowToggle)return void(this._overflowMenu=SelectorEngine.findOne(".nav-overflow-menu",this._element));const e=`<span class="nav-overflow-icon">${this._resolveIcon()}</span>`,t=`<span class="nav-overflow-text">${this._config.moreText}</span>`,n="end"===this._config.iconPlacement?`${t}${e}`:`${e}${t}`,i=document.createElement("li");i.className="nav-item nav-overflow-item",i.innerHTML=`\n <button class="nav-link nav-overflow-toggle" type="button" data-bs-toggle="menu" data-bs-placement="${this._config.menuPlacement}" aria-expanded="false">\n ${n}\n </button>\n <div class="nav-overflow-menu menu"></div>\n `,this._element.append(i),this._overflowToggle=i.querySelector(".nav-overflow-toggle"),this._overflowMenu=i.querySelector(".nav-overflow-menu")}_resolveIcon(){const e=SelectorEngine.findOne(SELECTOR_CUSTOM_ICON,this._element);if(!e)return this._config.moreIcon;const t=e.cloneNode(!0);t.removeAttribute("data-bs-overflow-icon");const n=t.outerHTML;return e.remove(),n}_resolveCollapseBelow(){const e=this._config.collapseBelow;if("number"==typeof e)return e;if("string"==typeof e&&""!==e){const t=getComputedStyle(document.documentElement).getPropertyValue(`--bs-breakpoint-${e}`);return Number.parseFloat(t)||0}return 0}_setupResizeObserver(){if("undefined"==typeof ResizeObserver)return this._resizeHandler=()=>this._calculateOverflow(),void EventHandler.on(window,EVENT_RESIZE$2,this._resizeHandler);this._resizeObserver=new ResizeObserver(()=>{this._calculateOverflow()}),this._resizeObserver.observe(this._element)}_calculateOverflow(){this._restoreItems();const e=this._element.offsetWidth,t=this._overflowToggle?.closest(".nav-item");if(this._collapseBelow>0&&e<this._collapseBelow){const e=this._items.filter(e=>!e.classList.contains(CLASS_NAME_KEEP));return this._moveToOverflow(e),t&&(e.length>0?t.classList.remove("d-none"):t.classList.add("d-none")),void(e.length>0&&EventHandler.trigger(this._element,EVENT_OVERFLOW,{overflowCount:e.length,visibleCount:this._items.length-e.length}))}let n=0;const i=[],s=e-(t?.offsetWidth||0)-this._items.filter(e=>e.classList.contains(CLASS_NAME_KEEP)).reduce((e,t)=>e+t.offsetWidth,0)-10;for(const e of this._items)e.classList.contains(CLASS_NAME_KEEP)||(n+=e.offsetWidth,n>s&&i.push(e));if(this._items.length-i.length<this._config.threshold&&this._items.length>this._config.threshold){const e=this._items.slice(this._config.threshold).filter(e=>!e.classList.contains(CLASS_NAME_KEEP));i.length=0,i.push(...e)}this._moveToOverflow(i),t&&(i.length>0?t.classList.remove("d-none"):t.classList.add("d-none")),i.length>0&&EventHandler.trigger(this._element,EVENT_OVERFLOW,{overflowCount:i.length,visibleCount:this._items.length-i.length})}_moveToOverflow(e){if(this._overflowMenu){this._overflowMenu.innerHTML="",this._overflowItems=[];for(const t of e){const e=SelectorEngine.findOne(".nav-link",t);if(!e)continue;const n=e.cloneNode(!0);n.className="menu-item",e.classList.contains("active")&&n.classList.add("active"),(e.classList.contains("disabled")||e.hasAttribute("disabled"))&&n.classList.add("disabled"),this._overflowMenu.append(n),t.classList.add("d-none"),t.dataset.bsNavOverflow="true",this._overflowItems.push(t)}}}_restoreItems(){for(const e of this._items)e.classList.remove("d-none"),delete e.dataset.bsNavOverflow;this._overflowMenu&&(this._overflowMenu.innerHTML=""),this._overflowItems=[]}};EventHandler.on(document,"DOMContentLoaded",()=>{for(const e of SelectorEngine.find('[data-bs-toggle="nav-overflow"]'))NavOverflow.getOrCreateInstance(e)});const NAME$12="swipe",EVENT_KEY$9=".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$11={endCallback:null,leftCallback:null,rightCallback:null,upCallback:null,downCallback:null},DefaultType$11={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)",upCallback:"(function|null)",downCallback:"(function|null)"};var Swipe=class e extends Config{constructor(t,n){super(),this._element=t,t&&e.isSupported()&&(this._config=this._getConfig(n),this._deltaX=0,this._deltaY=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return Default$11}static get DefaultType(){return DefaultType$11}static get NAME(){return"swipe"}dispose(){EventHandler.off(this._element,".bs.swipe")}_start(e){if(!this._supportPointerEvents)return this._deltaX=e.touches[0].clientX,void(this._deltaY=e.touches[0].clientY);this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX,this._deltaY=e.clientY)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX,this._deltaY=e.clientY-this._deltaY),this._handleSwipe(),execute(this._config.endCallback)}_move(e){if(e.touches&&e.touches.length>1)return this._deltaX=0,void(this._deltaY=0);this._deltaX=e.touches[0].clientX-this._deltaX,this._deltaY=e.touches[0].clientY-this._deltaY}_handleSwipe(){const e=Math.abs(this._deltaX),t=Math.abs(this._deltaY);if(t>e&&t>40){const e=this._deltaY>0?"down":"up";return this._deltaX=0,this._deltaY=0,void execute("down"===e?this._config.downCallback:this._config.upCallback)}if(e>40){const t=e/this._deltaX;if(this._deltaX=0,this._deltaY=0,!t)return;return void execute(t>0?this._config.rightCallback:this._config.leftCallback)}this._deltaX=0,this._deltaY=0}_initEvents(){this._supportPointerEvents?(EventHandler.on(this._element,EVENT_POINTERDOWN,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$11="drawer",EVENT_KEY$8=".bs.drawer",DATA_API_KEY$5=".data-api",EVENT_LOAD_DATA_API$2=`load${EVENT_KEY$8}.data-api`,EVENT_HIDDEN$3=`hidden${EVENT_KEY$8}`,EVENT_RESIZE$1=`resize${EVENT_KEY$8}`,EVENT_CLICK_DATA_API$1=`click${EVENT_KEY$8}.data-api`,SELECTOR_DATA_TOGGLE$4='[data-bs-toggle="drawer"]',Default$10={backdrop:!0,keyboard:!0,scroll:!1},DefaultType$10={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};var Drawer=class extends DialogBase{constructor(e,t){super(e,t),this._swipeHelper=null}static get Default(){return Default$10}static get DefaultType(){return DefaultType$10}static get NAME(){return NAME$11}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_getShowOptions(){return{modal:Boolean(this._config.backdrop)||!this._config.scroll,preventBodyScroll:!this._config.scroll}}_onBeforeShow(){this._initSwipe()}_getInstantClassName(){return"drawer-instant"}_getStaticClassName(){return"drawer-static"}_initSwipe(){if(this._swipeHelper||!Swipe.isSupported())return;const e={},t=this._element;t.classList.contains("drawer-bottom")?e.downCallback=()=>this.hide():t.classList.contains("drawer-top")?e.upCallback=()=>this.hide():t.classList.contains("drawer-end")?isRTL$1()?e.leftCallback=()=>this.hide():e.rightCallback=()=>this.hide():isRTL$1()?e.rightCallback=()=>this.hide():e.leftCallback=()=>this.hide(),this._swipeHelper=new Swipe(t,e)}};EventHandler.on(document,EVENT_CLICK_DATA_API$1,SELECTOR_DATA_TOGGLE$4,function(e){const t=SelectorEngine.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this))return;EventHandler.one(t,EVENT_HIDDEN$3,()=>{isVisible(this)&&this.focus({preventScroll:!0})});const n=SelectorEngine.findOne("dialog.drawer[open]");n&&n!==t&&Drawer.getInstance(n).hide(),Drawer.getOrCreateInstance(t).toggle(this)}),EventHandler.on(window,EVENT_LOAD_DATA_API$2,()=>{for(const e of SelectorEngine.find("dialog.drawer[open]"))Drawer.getOrCreateInstance(e).show()}),EventHandler.on(window,EVENT_RESIZE$1,()=>{for(const e of SelectorEngine.find('dialog[open][class*="\\:drawer"]'))"fixed"!==getComputedStyle(e).position&&Drawer.getOrCreateInstance(e).hide()}),enableDismissTrigger(Drawer);const NAME$10="strength",EVENT_KEY$7=".bs.strength",DATA_API_KEY$4=".data-api",EVENT_STRENGTH_CHANGE=`strengthChange${EVENT_KEY$7}`,SELECTOR_DATA_STRENGTH="[data-bs-strength]",STRENGTH_LEVELS=["weak","fair","good","strong"],Default$9={input:null,minLength:8,messages:{weak:"Weak",fair:"Fair",good:"Good",strong:"Strong"},weights:{minLength:1,extraLength:1,lowercase:1,uppercase:1,numbers:1,special:1,multipleSpecial:1,longPassword:1},thresholds:[2,4,6],scorer:null},DefaultType$9={input:"(string|element|null)",minLength:"number",messages:"object",weights:"object",thresholds:"array",scorer:"(function|null)"};var Strength=class extends BaseComponent{constructor(e,t){super(e,t),this._input=this._getInput(),this._segments=SelectorEngine.find(".strength-segment",this._element),this._textElement=SelectorEngine.findOne(".strength-text",this._element.parentElement),this._currentStrength=null,this._input&&(this._addEventListeners(),this._evaluate())}static get Default(){return Default$9}static get DefaultType(){return DefaultType$9}static get NAME(){return NAME$10}getStrength(){return this._currentStrength}evaluate(){this._evaluate()}_getInput(){if(this._config.input)return"string"==typeof this._config.input?SelectorEngine.findOne(this._config.input):this._config.input;const e=this._element.parentElement;return SelectorEngine.findOne('input[type="password"]',e)}_addEventListeners(){EventHandler.on(this._input,"input",()=>this._evaluate()),EventHandler.on(this._input,"change",()=>this._evaluate())}_evaluate(){const e=this._input.value,t=this._calculateScore(e),n=this._scoreToStrength(t);n!==this._currentStrength&&(this._currentStrength=n,this._updateUI(n),EventHandler.trigger(this._element,EVENT_STRENGTH_CHANGE,{strength:n,score:t,password:e.length>0?"***":""}))}_calculateScore(e){if(!e)return 0;if("function"==typeof this._config.scorer)return this._config.scorer(e);const{weights:t}=this._config;let n=0;return e.length>=this._config.minLength&&(n+=t.minLength),e.length>=this._config.minLength+4&&(n+=t.extraLength),/[a-z]/.test(e)&&(n+=t.lowercase),/[A-Z]/.test(e)&&(n+=t.uppercase),/\d/.test(e)&&(n+=t.numbers),/[!@#$%^&*(),.?":{}|<>]/.test(e)&&(n+=t.special),/[!@#$%^&*(),.?":{}|<>].*[!@#$%^&*(),.?":{}|<>]/.test(e)&&(n+=t.multipleSpecial),e.length>=16&&(n+=t.longPassword),n}_scoreToStrength(e){if(0===e)return null;const[t,n,i]=this._config.thresholds;return e<=t?"weak":e<=n?"fair":e<=i?"good":"strong"}_updateUI(e){e?this._element.dataset.bsStrength=e:delete this._element.dataset.bsStrength;const t=e?STRENGTH_LEVELS.indexOf(e):-1;for(const[e,n]of this._segments.entries())e<=t?n.classList.add("active"):n.classList.remove("active");this._textElement&&(e&&this._config.messages[e]?(this._textElement.textContent=this._config.messages[e],this._textElement.dataset.bsStrength=e,this._textElement.style.setProperty("--strength-color",`var(--${{weak:"danger",fair:"warning",good:"info",strong:"success"}[e]}-text)`)):(this._textElement.textContent="",delete this._textElement.dataset.bsStrength))}};EventHandler.on(document,`DOMContentLoaded${EVENT_KEY$7}.data-api`,()=>{for(const e of SelectorEngine.find("[data-bs-strength]"))Strength.getOrCreateInstance(e)});const NAME$9="otpInput",EVENT_KEY$6=".bs.otpInput",DATA_API_KEY$3=".data-api",EVENT_COMPLETE=`complete${EVENT_KEY$6}`,EVENT_INPUT$1=`input${EVENT_KEY$6}`,EVENT_DOMCONTENT_LOADED=`DOMContentLoaded${EVENT_KEY$6}.data-api`,SELECTOR_DATA_OTP="[data-bs-otp]",SELECTOR_INPUT$1="input",SYNC_EVENTS=["blur","keyup","select"],CLASS_NAME_INPUT="otp-input",CLASS_NAME_RENDERED="otp-rendered",CLASS_NAME_SLOTS="otp-slots",CLASS_NAME_SLOT="otp-slot",CLASS_NAME_SLOT_FILLED="otp-slot-filled",CLASS_NAME_SLOT_ACTIVE="otp-slot-active",CLASS_NAME_SEPARATOR="otp-separator",MASK_CHARACTER="•",TYPES={numeric:{inputmode:"numeric",pattern:"[0-9]*",filter:/[^0-9]/g},alphanumeric:{inputmode:"text",pattern:"[A-Za-z0-9]*",filter:/[^A-Za-z0-9]/g},alpha:{inputmode:"text",pattern:"[A-Za-z]*",filter:/[^A-Za-z]/g}},Default$8={groups:null,length:null,mask:!1,separator:"·",type:"numeric"},DefaultType$8={groups:"(array|null)",length:"(number|null)",mask:"boolean",separator:"string",type:"string"};var OtpInput=class extends BaseComponent{constructor(e,t){super(e,t);const n=SelectorEngine.findOne("input",this._element);n&&(this._input=n,this._type=TYPES[this._config.type]||TYPES.numeric,this._length=this._resolveLength(),this._slots=[],this._pointerActive=!1,this._pointerIndex=0,this._setupInput(),this._renderSlots(),this._addEventListeners(),this._render())}static get Default(){return Default$8}static get DefaultType(){return DefaultType$8}static get NAME(){return NAME$9}getValue(){return this._input.value}setValue(e){this._input.value=this._sanitize(String(e)),this._render(),this._checkComplete()}clear(){this._input.value="",this._render(),this._input.focus()}focus(){this._input.focus(),this._selectSlot(this._firstEmptyIndex()),this._render()}dispose(){EventHandler.off(this._input,"input",this._onInput),EventHandler.off(this._input,"beforeinput",this._onBeforeInput),EventHandler.off(this._input,"focus",this._onFocus),EventHandler.off(this._input,"pointerdown",this._onPointerDown),EventHandler.off(document,"selectionchange",this._onSelectionChange);for(const e of SYNC_EVENTS)EventHandler.off(this._input,e,this._onSync);this._slotsContainer?.remove(),this._element.classList.remove("otp-rendered"),super.dispose()}_resolveLength(){if(this._config.length)return this._config.length;const e=Number.parseInt(this._input.getAttribute("maxlength"),10);return Number.isNaN(e)||e<1?6:e}_setupInput(){const e=this._input;"number"!==e.type&&"password"!==e.type||(e.type="text"),e.classList.add("otp-input"),e.setAttribute("maxlength",String(this._length)),e.setAttribute("inputmode",this._type.inputmode),e.setAttribute("pattern",this._type.pattern),e.getAttribute("autocomplete")||e.setAttribute("autocomplete","one-time-code"),e.value&&(e.value=this._sanitize(e.value))}_renderSlots(){const e=document.createElement("div");e.className="otp-slots",e.setAttribute("aria-hidden","true");const{groups:t}=this._config;let n=0,i=0;for(let s=0;s<this._length;s++){const o=document.createElement("div");if(o.className="otp-slot",e.append(o),this._slots.push(o),Array.isArray(t)&&t.length>0&&(i++,i===t[n]&&s<this._length-1)){const s=document.createElement("div");s.className="otp-separator",s.textContent=this._config.separator,e.append(s),n=Math.min(n+1,t.length-1),i=0}}this._slotsContainer=e,this._element.append(e),this._element.classList.add("otp-rendered")}_addEventListeners(){this._onInput=()=>this._handleInput(),this._onBeforeInput=e=>this._handleBeforeInput(e),this._onPointerDown=e=>this._handlePointerDown(e),this._onFocus=()=>{if(this._pointerActive)return this._pointerActive=!1,this._selectSlot(this._pointerIndex),void this._render();this._selectSlot(this._firstEmptyIndex()),this._render()},this._onSync=()=>this._render(),this._onSelectionChange=()=>{document.activeElement===this._input&&this._render()},EventHandler.on(this._input,"input",this._onInput),EventHandler.on(this._input,"beforeinput",this._onBeforeInput),EventHandler.on(this._input,"focus",this._onFocus),EventHandler.on(this._input,"pointerdown",this._onPointerDown),EventHandler.on(document,"selectionchange",this._onSelectionChange);for(const e of SYNC_EVENTS)EventHandler.on(this._input,e,this._onSync)}_handleInput(){const e=this._sanitize(this._input.value);e!==this._input.value&&(this._input.value=e),document.activeElement===this._input&&this._selectSlot(this._firstEmptyIndex()),this._afterValueChange()}_handleBeforeInput(e){const{inputType:t,data:n}=e;if("insertText"===t&&n&&1===n.length){e.preventDefault();const t=this._sanitize(n);if(!t)return;const i=Math.min(this._input.selectionStart??0,this._length-1),s=[...this._input.value];return s[i]=t,this._input.value=s.join("").slice(0,this._length),this._selectSlot(i+1),void this._afterValueChange()}if("deleteContentBackward"===t){e.preventDefault();const t=this._input.selectionStart??0,n=this._input.selectionEnd??t,i=[...this._input.value];n>t?(i.splice(t,n-t),this._input.value=i.join(""),this._selectSlot(t)):t>0&&(i.splice(t-1,1),this._input.value=i.join(""),this._selectSlot(t-1)),this._afterValueChange()}}_handlePointerDown(e){const t=this._slotIndexFromPoint(e.clientX);if(null===t)return;const n=Math.min(t,this._firstEmptyIndex());if(document.activeElement===this._input)return e.preventDefault(),this._selectSlot(n),void this._render();this._pointerActive=!0,this._pointerIndex=n}_slotIndexFromPoint(e){for(const[t,n]of this._slots.entries())if(e<=n.getBoundingClientRect().right||t===this._slots.length-1)return t;return null}_afterValueChange(){this._render(),EventHandler.trigger(this._element,EVENT_INPUT$1,{value:this._input.value}),this._checkComplete()}_firstEmptyIndex(){return Math.min(this._input.value.length,this._length-1)}_selectSlot(e){const t=Math.max(0,Math.min(e,this._length-1)),n=t<this._input.value.length?t+1:t;this._input.setSelectionRange(t,n)}_sanitize(e){return e.replace(this._type.filter,"").slice(0,this._length)}_render(){const{value:e}=this._input,t=document.activeElement===this._input,n=Math.min(this._input.selectionStart??e.length,this._length-1);for(const[i,s]of this._slots.entries()){const o=e[i]??"";s.textContent=o&&this._config.mask?"•":o,s.classList.toggle("otp-slot-filled",Boolean(o)),s.classList.toggle("otp-slot-active",t&&i===n)}}_checkComplete(){const{value:e}=this._input;e.length===this._length&&EventHandler.trigger(this._element,EVENT_COMPLETE,{value:e})}};EventHandler.on(document,EVENT_DOMCONTENT_LOADED,()=>{for(const e of SelectorEngine.find("[data-bs-otp]"))OtpInput.getOrCreateInstance(e)});const NAME$8="chips",EVENT_KEY$5=".bs.chips",DATA_API_KEY$2=".data-api",EVENT_ADD="add.bs.chips",EVENT_REMOVE="remove.bs.chips",EVENT_CHANGE$1="change.bs.chips",EVENT_SELECT="select.bs.chips",SELECTOR_DATA_CHIPS="[data-bs-chips]",SELECTOR_GHOST_INPUT=".form-ghost",SELECTOR_CHIP=".chip",SELECTOR_CHIP_DISMISS=".chip-dismiss",CLASS_NAME_CHIP="chip",CLASS_NAME_CHIP_DISMISS="chip-dismiss",CLASS_NAME_ACTIVE$2="active",Default$7={separator:",",allowDuplicates:!1,maxChips:null,placeholder:"",dismissible:!0,dismissIcon:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg>',createOnBlur:!0},DefaultType$7={separator:"(string|null)",allowDuplicates:"boolean",maxChips:"(number|null)",placeholder:"string",dismissible:"boolean",dismissIcon:"string",createOnBlur:"boolean"};var Chips=class extends BaseComponent{constructor(e,t){super(e,t);const n=SelectorEngine.findOne(".form-ghost",this._element);this._chips=[],this._selectedChips=new Set,this._anchorChip=null,n?this._input=n:this._createInput(),this._initializeExistingChips(),this._addEventListeners()}static get Default(){return Default$7}static get DefaultType(){return DefaultType$7}static get NAME(){return NAME$8}add(e){const t=String(e).trim();if(!t)return null;if(!this._config.allowDuplicates&&this._chips.includes(t))return null;if(null!==this._config.maxChips&&this._chips.length>=this._config.maxChips)return null;if(EventHandler.trigger(this._element,EVENT_ADD,{value:t,relatedTarget:this._input}).defaultPrevented)return null;const n=this._createChip(t);return this._element.insertBefore(n,this._input),this._chips.push(t),EventHandler.trigger(this._element,EVENT_CHANGE$1,{values:this.getValues()}),n}remove(e){let t,n;return"string"==typeof e?(n=e,t=this._findChipByValue(n)):(t=e,n=this._getChipValue(t)),!(!t||!n||EventHandler.trigger(this._element,EVENT_REMOVE,{value:n,chip:t,relatedTarget:this._input}).defaultPrevented||(this._selectedChips.delete(t),this._anchorChip===t&&(this._anchorChip=null),t.remove(),this._chips=this._getChipElements().map(e=>this._getChipValue(e)).filter(Boolean),EventHandler.trigger(this._element,EVENT_CHANGE$1,{values:this.getValues()}),0))}removeSelected(){const e=[...this._selectedChips];for(const t of e)this.remove(t);this._input?.focus()}getValues(){return[...this._chips]}getSelectedValues(){return[...this._selectedChips].map(e=>this._getChipValue(e))}clear(){const e=SelectorEngine.find(".chip",this._element);for(const t of e)t.remove();this._chips=[],this._selectedChips.clear(),this._anchorChip=null,EventHandler.trigger(this._element,EVENT_CHANGE$1,{values:[]})}clearSelection(){for(const e of this._selectedChips)e.classList.remove("active");this._selectedChips.clear(),this._anchorChip=null,EventHandler.trigger(this._element,EVENT_SELECT,{selected:[]})}selectChip(e,t={}){const{addToSelection:n=!1,rangeSelect:i=!1}=t,s=this._getChipElements();if(s.includes(e)){if(i&&this._anchorChip){const t=s.indexOf(this._anchorChip),i=s.indexOf(e),o=Math.min(t,i),a=Math.max(t,i);n||this.clearSelection();for(let e=o;e<=a;e++)this._selectedChips.add(s[e]),s[e].classList.add("active")}else n?this._selectedChips.has(e)?(this._selectedChips.delete(e),e.classList.remove("active")):(this._selectedChips.add(e),e.classList.add("active"),this._anchorChip=e):(this.clearSelection(),this._selectedChips.add(e),e.classList.add("active"),this._anchorChip=e);EventHandler.trigger(this._element,EVENT_SELECT,{selected:this.getSelectedValues()})}}focus(){this._input?.focus()}_getChipElements(){return SelectorEngine.find(".chip",this._element)}_createInput(){const e=document.createElement("input");e.type="text",e.className="form-ghost",this._config.placeholder&&(e.placeholder=this._config.placeholder),this._element.append(e),this._input=e}_initializeExistingChips(){const e=SelectorEngine.find(".chip",this._element);for(const t of e){const e=this._getChipValue(t);e&&(this._chips.push(e),this._setupChip(t))}}_setupChip(e){e.setAttribute("tabindex","0"),this._config.dismissible&&!SelectorEngine.findOne(".chip-dismiss",e)&&e.append(this._createDismissButton())}_createChip(e){const t=document.createElement("span");return t.className="chip",t.dataset.bsChipValue=e,t.append(document.createTextNode(e)),this._setupChip(t),t}_createDismissButton(){const e=document.createElement("button");return e.type="button",e.className="chip-dismiss",e.setAttribute("aria-label","Remove"),e.setAttribute("tabindex","-1"),e.innerHTML=this._config.dismissIcon,e}_findChipByValue(e){return this._getChipElements().find(t=>this._getChipValue(t)===e)}_getChipValue(e){if(e.dataset.bsChipValue)return e.dataset.bsChipValue;const t=e.cloneNode(!0),n=SelectorEngine.findOne(".chip-dismiss",t);return n&&n.remove(),t.textContent?.trim()||""}_addEventListeners(){EventHandler.on(this._input,"keydown",e=>this._handleInputKeydown(e)),EventHandler.on(this._input,"input",e=>this._handleInput(e)),EventHandler.on(this._input,"paste",e=>this._handlePaste(e)),EventHandler.on(this._input,"focus",()=>this.clearSelection()),this._config.createOnBlur&&EventHandler.on(this._input,"blur",e=>{e.relatedTarget?.closest(".chip")||this._createChipFromInput()}),EventHandler.on(this._element,"click",".chip",e=>{if(e.target.closest(".chip-dismiss"))return;const t=e.target.closest(".chip");t&&(e.preventDefault(),this.selectChip(t,{addToSelection:e.metaKey||e.ctrlKey,rangeSelect:e.shiftKey}),t.focus())}),EventHandler.on(this._element,"click",".chip-dismiss",e=>{e.stopPropagation();const t=e.target.closest(".chip");t&&(this.remove(t),this._input?.focus())}),EventHandler.on(this._element,"keydown",".chip",e=>{this._handleChipKeydown(e)}),EventHandler.on(this._element,"click",e=>{e.target===this._element&&(this.clearSelection(),this._input?.focus())})}_handleInputKeydown(e){const{key:t}=e;switch(t){case"Enter":e.preventDefault(),this._createChipFromInput();break;case"Backspace":case"Delete":if(""===this._input.value){e.preventDefault();const t=this._getChipElements();if(t.length>0){const e=t.at(-1);this.selectChip(e),e.focus()}}break;case"ArrowLeft":if(0===this._input.selectionStart&&0===this._input.selectionEnd){e.preventDefault();const t=this._getChipElements();if(t.length>0){const n=t.at(-1);e.shiftKey?this.selectChip(n,{addToSelection:!0}):this.selectChip(n),n.focus()}}break;case"Escape":this._input.value="",this.clearSelection(),this._input.blur()}}_handleChipKeydown(e){const{key:t}=e,n=e.target.closest(".chip");if(!n)return;const i=this._getChipElements(),s=i.indexOf(n);switch(t){case"Backspace":case"Delete":e.preventDefault(),this._handleChipDelete(s,i);break;case"ArrowLeft":e.preventDefault(),this._navigateChip(i,s,-1,e.shiftKey);break;case"ArrowRight":e.preventDefault(),this._navigateChip(i,s,1,e.shiftKey);break;case"Home":e.preventDefault(),this._navigateToEdge(i,0,e.shiftKey);break;case"End":case"Escape":e.preventDefault(),this.clearSelection(),this._input?.focus();break;case"a":this._handleSelectAll(e,i)}}_handleChipDelete(e,t){if(0===this._selectedChips.size)return;const n=Math.min(e,t.length-this._selectedChips.size-1);this.removeSelected();const i=this._getChipElements();if(i.length>0){const e=Math.max(0,Math.min(n,i.length-1));i[e].focus(),this.selectChip(i[e])}else this._input?.focus()}_navigateChip(e,t,n,i){const s=t+n;if(n<0&&s>=0){const t=e[s];this.selectChip(t,i?{addToSelection:!0,rangeSelect:!0}:{}),t.focus()}else if(n>0&&s<e.length){const t=e[s];this.selectChip(t,i?{addToSelection:!0,rangeSelect:!0}:{}),t.focus()}else n>0&&(this.clearSelection(),this._input?.focus())}_navigateToEdge(e,t,n){if(0===e.length)return;const i=e[t];this.selectChip(i,n?{rangeSelect:!0}:{}),i.focus()}_handleSelectAll(e,t){if(e.metaKey||e.ctrlKey){e.preventDefault();for(const e of t)this._selectedChips.add(e),e.classList.add("active");EventHandler.trigger(this._element,EVENT_SELECT,{selected:this.getSelectedValues()})}}_handleInput(e){const{value:t}=e.target,{separator:n}=this._config;if(n&&t.includes(n)){const e=t.split(n);for(const t of e.slice(0,-1))this.add(t.trim());this._input.value=e.at(-1)}}_handlePaste(e){const{separator:t}=this._config;if(!t)return;const n=(e.clipboardData||window.clipboardData).getData("text");if(n.includes(t)){e.preventDefault();const i=n.split(t);for(const e of i)this.add(e.trim())}}_createChipFromInput(){const e=this._input.value.trim();e&&(this.add(e),this._input.value="")}};EventHandler.on(document,"DOMContentLoaded.bs.chips.data-api",()=>{for(const e of SelectorEngine.find("[data-bs-chips]"))Chips.getOrCreateInstance(e)});const DefaultAllowlist={"*":["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:[]},uriAttributes=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),SAFE_URL_PATTERN=/^(?!(?:javascript|data|vbscript):)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,DATA_URL_PATTERN=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z=]+$/i,allowedAttribute=(e,t)=>{const n=e.nodeName.toLowerCase();return t.includes(n)?!uriAttributes.has(n)||Boolean(SAFE_URL_PATTERN.test(e.nodeValue)||DATA_URL_PATTERN.test(e.nodeValue)):t.filter(e=>e instanceof RegExp).some(e=>e.test(n))};function sanitizeHtml(e,t,n){if(!e.length)return e;if(n&&"function"==typeof n)return n(e);const i=(new window.DOMParser).parseFromString(e,"text/html"),s=[...i.body.querySelectorAll("*")];for(const e of s){const n=e.nodeName.toLowerCase();if(!Object.keys(t).includes(n)){e.remove();continue}const i=[...e.attributes],s=[...t["*"]||[],...t[n]||[]];for(const t of i)allowedAttribute(t,s)||e.removeAttribute(t.nodeName)}return i.body.innerHTML}const NAME$7="TemplateFactory",Default$6={allowList:DefaultAllowlist,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},DefaultType$6={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},DefaultContentType={entry:"(string|element|function|null)",selector:"(string|element)"};var TemplateFactory=class extends Config{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return Default$6}static get DefaultType(){return DefaultType$6}static get NAME(){return NAME$7}getContent(){return Object.values(this._config.content).map(e=>this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content={...this._config.content,...e},this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[t,n]of Object.entries(this._config.content))this._setContent(e,n,t);const t=e.children[0],n=this._resolvePossibleFunction(this._config.extraClass);return n&&t.classList.add(...n.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,n]of Object.entries(e))super._typeCheckConfig({selector:t,entry:n},DefaultContentType)}_setContent(e,t,n){const i=SelectorEngine.findOne(n,e);i&&((t=this._resolvePossibleFunction(t))?isElement$1(t)?this._putElementInTemplate(getElement(t),i):this._config.html?i.innerHTML=this._maybeSanitize(t):i.textContent=t:i.remove())}_maybeSanitize(e){return this._config.sanitize?sanitizeHtml(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return execute(e,[void 0,this])}_putElementInTemplate(e,t){if(this._config.html)return t.innerHTML="",void t.append(e);t.textContent=e.textContent}};const NAME$6="tooltip",DISALLOWED_ATTRIBUTES=new Set(["sanitize","allowList","sanitizeFn"]),ESCAPE_KEY="Escape",CLASS_NAME_FADE$2="fade",CLASS_NAME_MODAL="modal",CLASS_NAME_SHOW$2="show",SELECTOR_TOOLTIP_INNER=".tooltip-inner",SELECTOR_MODAL=".modal",SELECTOR_DATA_TOGGLE$3='[data-bs-toggle="tooltip"]',EVENT_MODAL_HIDE="hide.bs.modal",TRIGGER_HOVER="hover",TRIGGER_FOCUS="focus",TRIGGER_CLICK="click",TRIGGER_MANUAL="manual",EVENT_HIDE$2="hide",EVENT_HIDDEN$2="hidden",EVENT_SHOW$2="show",EVENT_SHOWN$2="shown",EVENT_INSERTED="inserted",EVENT_CLICK$3="click",EVENT_FOCUSIN$2="focusin",EVENT_FOCUSOUT$1="focusout",EVENT_MOUSEENTER$1="mouseenter",EVENT_MOUSELEAVE="mouseleave",EVENT_KEYDOWN$1="keydown",AttachmentMap={AUTO:"auto",TOP:"top",RIGHT:isRTL$1()?"left":"right",BOTTOM:"bottom",LEFT:isRTL$1()?"right":"left"},Default$5={allowList:DefaultAllowlist,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",floatingConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},DefaultType$5={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",floatingConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};var Tooltip=class extends BaseComponent{constructor(e,t){super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._floatingCleanup=null,this._keydownHandler=null,this._templateFactory=null,this._newContent=null,this._mediaQueryListeners=[],this._responsivePlacements=null,this.tip=null,this._parseResponsivePlacements(),this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return Default$5}static get DefaultType(){return DefaultType$5}static get NAME(){return NAME$6}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){this._isEnabled&&(this._isShown()?this._leave():this._enter())}dispose(){clearTimeout(this._timeout),this._removeEscapeListener(),EventHandler.off(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposeFloating(),this._disposeMediaQueryListeners(),super.dispose()}async show(){if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(!this._isWithContent()||!this._isEnabled)return;const e=EventHandler.trigger(this._element,this.constructor.eventName("show")),t=(findShadowRoot(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!t)return void(this._isHovered=!1);this._disposeFloating();const n=this._getTipElement();this._element.setAttribute("aria-describedby",n.getAttribute("id"));let{container:i}=this._config;const s=this._element.closest("dialog[open]");if(s&&i===document.body&&(i=s),this._element.ownerDocument.documentElement.contains(this.tip)||(i.append(n),EventHandler.trigger(this._element,this.constructor.eventName("inserted"))),await this._createFloating(n),n.classList.add("show"),this._setEscapeListener(),"ontouchstart"in document.documentElement)for(const e of document.body.children)EventHandler.on(e,"mouseover",noop);this._queueCallback(()=>{EventHandler.trigger(this._element,this.constructor.eventName("shown")),!1===this._isHovered&&this._leave(),this._isHovered=!1},this.tip,this._isAnimated())}hide(){if(this._isShown()&&!EventHandler.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._removeEscapeListener(),this._getTipElement().classList.remove("show"),"ontouchstart"in document.documentElement)for(const e of document.body.children)EventHandler.off(e,"mouseover",noop);this._activeTrigger.click=!1,this._activeTrigger.focus=!1,this._activeTrigger.hover=!1,this._isHovered=null,this._queueCallback(()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposeFloating(),this._element.removeAttribute("aria-describedby"),EventHandler.trigger(this._element,this.constructor.eventName("hidden")))},this.tip,this._isAnimated())}}update(){this._floatingCleanup&&this.tip&&this._updateFloatingPosition()}_isWithContent(){return Boolean(this._getTitle())||this._hasNewContent()}_hasNewContent(){return Boolean(this._newContent)&&Object.values(this._newContent).some(Boolean)}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();t.classList.remove("fade","show"),t.classList.add(`bs-${this.constructor.NAME}-auto`);const n=getUID(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add("fade"),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposeFloating(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new TemplateFactory({...this._config,content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)}),this._templateFactory}_getContentForTemplate(){return{[SELECTOR_TOOLTIP_INNER]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains("fade")}_isShown(){return this.tip&&this.tip.classList.contains("show")}_getPlacement(e){if(this._responsivePlacements){const e=getResponsivePlacement(this._responsivePlacements,"top");return AttachmentMap[e.toUpperCase()]||e}const t=execute(this._config.placement,[this,e,this._element]);return AttachmentMap[t.toUpperCase()]||t}_parseResponsivePlacements(){"string"==typeof this._config.placement?(this._responsivePlacements=parseResponsivePlacement(this._config.placement,"top"),this._responsivePlacements&&this._setupMediaQueryListeners()):this._responsivePlacements=null}_setupMediaQueryListeners(){this._disposeMediaQueryListeners(),this._mediaQueryListeners=createBreakpointListeners(()=>{this._isShown()&&this._updateFloatingPosition()})}_disposeMediaQueryListeners(){disposeBreakpointListeners(this._mediaQueryListeners),this._mediaQueryListeners=[]}async _createFloating(e){const t=this._getPlacement(e),n=e.querySelector(`.${this.constructor.NAME}-arrow`);await this._updateFloatingPosition(e,t,n),this._floatingCleanup=autoUpdate(this._element,e,()=>this._updateFloatingPosition(e,null,n))}async _updateFloatingPosition(e=this.tip,t=null,n=null){if(!e)return;t||(t=this._getPlacement(e)),n||(n=e.querySelector(`.${this.constructor.NAME}-arrow`));const i=this._getFloatingMiddleware(n),s=this._getFloatingConfig(t,i),{x:o,y:a,placement:l,middlewareData:r}=await computePosition(this._element,e,s);if(Object.assign(e.style,{position:"absolute",left:`${o}px`,top:`${a}px`}),n&&(n.style.position="absolute"),Manipulator.setDataAttribute(e,"placement",l),n&&r.arrow){const{x:e,y:t}=r.arrow,i=l.startsWith("top")||l.startsWith("bottom");Object.assign(n.style,{left:i&&void 0!==e?`${e}px`:"",top:i||void 0===t?"":`${t}px`,right:"",bottom:""})}}_getOffset(){const{offset:e}=this._config;return"string"==typeof e?e.split(",").map(e=>Number.parseInt(e,10)):"function"==typeof e?({placement:t,rects:n})=>toFloatingOffset(e({placement:t,reference:n.reference,floating:n.floating},this._element)):e}_resolvePossibleFunction(e){return execute(e,[this._element,this._element])}_getFloatingMiddleware(e){const t=this._getOffset(),n=[offset("function"==typeof t?t:toFloatingOffset(t)),flip({fallbackPlacements:this._config.fallbackPlacements}),shift({boundary:"clippingParents"===this._config.boundary?"clippingAncestors":this._config.boundary})];return e&&n.push(arrow({element:e})),n}_getFloatingConfig(e,t){const n={placement:e,middleware:t};return{...n,...execute(this._config.floatingConfig,[void 0,n])}}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if("click"===t)EventHandler.on(this._element,this.constructor.eventName("click"),this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger.click=!(t._isShown()&&t._activeTrigger.click),t.toggle()});else if("manual"!==t){const e="hover"===t?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),n="hover"===t?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");EventHandler.on(this._element,e,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusin"===e.type?"focus":"hover"]=!0,t._enter()}),EventHandler.on(this._element,n,this._config.selector,e=>{const t=this._initializeOnDelegatedTarget(e);t._activeTrigger["focusout"===e.type?"focus":"hover"]=t._element.contains(e.relatedTarget),t._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},EventHandler.on(this._element.closest(".modal"),"hide.bs.modal",this._hideModalHandler)}_setEscapeListener(){this._keydownHandler||(this._keydownHandler=e=>{"Escape"===e.key&&this._isShown()&&this.tip.isConnected&&(e.preventDefault(),e.stopPropagation(),this.hide())},this._element.ownerDocument.addEventListener("keydown",this._keydownHandler,!0))}_removeEscapeListener(){this._keydownHandler&&(this._element.ownerDocument.removeEventListener("keydown",this._keydownHandler,!0),this._keydownHandler=null)}_fixTitle(){const e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){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=Manipulator.getDataAttributes(this._element);for(const e of Object.keys(t))DISALLOWED_ATTRIBUTES.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:getElement(e.container),"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),"number"!=typeof e.title&&"boolean"!=typeof e.title||(e.title=e.title.toString()),"number"!=typeof e.content&&"boolean"!=typeof e.content||(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,n]of Object.entries(this._config))this.constructor.Default[t]!==n&&(e[t]=n);return e.selector=!1,e.trigger="manual",e}_disposeFloating(){this._floatingCleanup&&(this._floatingCleanup(),this._floatingCleanup=null),this.tip&&(this.tip.remove(),this.tip=null)}};const initTooltip=e=>{const t=e.target.closest(SELECTOR_DATA_TOGGLE$3);t&&Tooltip.getOrCreateInstance(t)};EventHandler.on(document,"focusin",SELECTOR_DATA_TOGGLE$3,initTooltip),EventHandler.on(document,"mouseenter",SELECTOR_DATA_TOGGLE$3,initTooltip);const NAME$5="popover",SELECTOR_TITLE=".popover-header",SELECTOR_CONTENT=".popover-body",SELECTOR_DATA_TOGGLE$2='[data-bs-toggle="popover"]',EVENT_CLICK$2="click",EVENT_FOCUSIN$1="focusin",EVENT_MOUSEENTER="mouseenter",Default$4={...Tooltip.Default,content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"},DefaultType$4={...Tooltip.DefaultType,content:"(null|string|element|function)"};var Popover=class extends Tooltip{constructor(e,t){super(e,t)}static get Default(){return Default$4}static get DefaultType(){return DefaultType$4}static get NAME(){return NAME$5}_isWithContent(){return Boolean(this._getTitle()||this._getContent())||this._hasNewContent()}_getContentForTemplate(){return{[SELECTOR_TITLE]:this._getTitle(),[SELECTOR_CONTENT]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}};const initPopover=e=>{const t=e.target.closest(SELECTOR_DATA_TOGGLE$2);t&&("click"===e.type&&e.preventDefault(),Popover.getOrCreateInstance(t))};EventHandler.on(document,"click",SELECTOR_DATA_TOGGLE$2,initPopover),EventHandler.on(document,"focusin",SELECTOR_DATA_TOGGLE$2,initPopover),EventHandler.on(document,"mouseenter",SELECTOR_DATA_TOGGLE$2,initPopover);const NAME$4="range",EVENT_KEY$4=".bs.range",DATA_API_KEY$1=".data-api",EVENT_CHANGED="changed.bs.range",EVENT_DOM_CONTENT_LOADED="DOMContentLoaded.bs.range.data-api",EVENT_INPUT="input",EVENT_CHANGE="change",SELECTOR_RANGE=".form-range",SELECTOR_INPUT=".form-range-input",CLASS_NAME_BUBBLE="form-range-bubble",CLASS_NAME_TICKS="form-range-ticks",CLASS_NAME_TICK="form-range-tick",CLASS_NAME_TICK_LABEL="form-range-tick-label",PROPERTY_FILL="--bs-range-fill",Default$3={bubble:!1,formatter:null},DefaultType$3={bubble:"(boolean|null)",formatter:"(function|null)"};var Range=class extends BaseComponent{constructor(e,t){super(e,t),this._element&&(this._input=SelectorEngine.findOne(SELECTOR_INPUT,this._element),this._input&&(this._bubble=null,this._bubbleText=null,this._ticks=null,this._updateHandler=()=>this._update(),this._config.bubble&&this._createBubble(),this._createTicks(),this._addEventListeners(),this._update()))}static get Default(){return Default$3}static get DefaultType(){return DefaultType$3}static get NAME(){return NAME$4}update(){this._update()}dispose(){EventHandler.off(this._input,"input",this._updateHandler),EventHandler.off(this._input,"change",this._updateHandler),this._bubble?.remove(),this._ticks?.remove(),super.dispose()}_configAfterMerge(e){return null===e.bubble&&(e.bubble=!0),e}_addEventListeners(){EventHandler.on(this._input,"input",this._updateHandler),EventHandler.on(this._input,"change",this._updateHandler)}_min(){return""===this._input.min?0:Number.parseFloat(this._input.min)}_max(){return""===this._input.max?100:Number.parseFloat(this._input.max)}_value(){return Number.parseFloat(this._input.value)}_ratio(){const e=this._max()-this._min();return e>0?(this._value()-this._min())/e:0}_update(){this._element.style.setProperty(PROPERTY_FILL,`${this._ratio()}`),this._bubbleText&&(this._bubbleText.textContent=this._format(this._value())),EventHandler.trigger(this._input,EVENT_CHANGED,{value:this._value()})}_format(e){return"function"==typeof this._config.formatter?this._config.formatter(e):String(e)}_createBubble(){this._bubble=document.createElement("output"),this._bubble.className=`${CLASS_NAME_BUBBLE} tooltip bs-tooltip-top show`,this._bubble.setAttribute("aria-hidden","true");const e=document.createElement("div");e.className="tooltip-arrow",this._bubbleText=document.createElement("div"),this._bubbleText.className="tooltip-inner",this._bubble.append(e,this._bubbleText),this._input.insertAdjacentElement("afterend",this._bubble)}_createTicks(){const e=this._input.getAttribute("list"),t=e?document.getElementById(e):null;if(!t)return;const n=this._min(),i=this._max()-n||1,s=[];for(const e of SelectorEngine.find("option",t)){const t=Number.parseFloat(e.value);if(!Number.isNaN(t)){const o=Math.min(Math.max((t-n)/i,0),1);s.push({ratio:o,label:e.label})}}if(0===s.length)return;s.sort((e,t)=>e.ratio-t.ratio),this._ticks=document.createElement("div"),this._ticks.className=CLASS_NAME_TICKS,this._ticks.setAttribute("aria-hidden","true");const o=[0,...s.map(e=>e.ratio),1];this._ticks.style.gridTemplateColumns=o.slice(1).map((e,t)=>e-o[t]+"fr").join(" ");for(const[e,t]of s.entries()){const n=document.createElement("span");if(n.className=CLASS_NAME_TICK,n.style.gridColumnStart=`${e+2}`,t.label){const e=document.createElement("span");e.className=CLASS_NAME_TICK_LABEL,e.textContent=t.label,n.append(e)}this._ticks.append(n)}this._element.append(this._ticks)}};EventHandler.on(document,EVENT_DOM_CONTENT_LOADED,()=>{for(const e of SelectorEngine.find(".form-range"))Range.getOrCreateInstance(e)});const NAME$3="scrollspy",EVENT_KEY$3=".bs.scrollspy",DATA_API_KEY=".data-api",EVENT_ACTIVATE=`activate${EVENT_KEY$3}`,EVENT_CLICK$1=`click${EVENT_KEY$3}`,EVENT_SCROLL=`scroll${EVENT_KEY$3}`,EVENT_SCROLLEND=`scrollend${EVENT_KEY$3}`,EVENT_RESIZE=`resize${EVENT_KEY$3}`,EVENT_LOAD_DATA_API$1=`load${EVENT_KEY$3}.data-api`,CLASS_NAME_MENU_ITEM="menu-item",CLASS_NAME_ACTIVE$1="active",SELECTOR_DATA_SPY='[data-bs-spy="scroll"]',SELECTOR_TARGET_LINKS="[href]",SELECTOR_NAV_LIST_GROUP=".nav, .list-group",SELECTOR_NAV_LINKS=".nav-link",SELECTOR_LINK_ITEMS=".nav-link, .nav-item > .nav-link, .list-group-item",SELECTOR_MENU_TOGGLE$1='[data-bs-toggle="menu"]',SCROLL_IDLE_TIMEOUT=100,RESIZE_DEBOUNCE=100,Default$2={rootMargin:null,smoothScroll:!1,target:null,threshold:[0],topMargin:"12%"},DefaultType$2={rootMargin:"(string|null)",smoothScroll:"boolean",target:"element",threshold:"array",topMargin:"string"};var ScrollSpy=class extends BaseComponent{constructor(e,t){super(e,t),this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map,this._intersecting=new Set,this._activeTarget=null,this._lastActive=null,this._atBottom=!1,this._rootElement="visible"===getComputedStyle(this._element).overflowY?null:this._element,this._observer=null,this._sentinel=null,this._sentinelObserver=null,this._pendingNavigation=null,this._settleTimeout=null,this._settleHandler=null,this._scrollIdleHandler=null,this._resizeHandler=null,this._resizeTimeout=null,this.refresh()}static get Default(){return Default$2}static get DefaultType(){return DefaultType$2}static get NAME(){return NAME$3}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(const e of this._sections)this._observer.observe(e);this._setUpSentinel(),this._maybeAddResizeListener()}dispose(){this._observer?.disconnect(),this._teardownSentinel(),this._disarmSettle(),this._removeResizeListener(),EventHandler.off(this._config.target,EVENT_CLICK$1),super.dispose()}_configAfterMerge(e){return e.target=getElement(e.target)||document.body,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map(e=>Number.parseFloat(e))),e}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin??this._getDerivedRootMargin()};return new IntersectionObserver(e=>this._onIntersect(e),e)}_onIntersect(e){for(const t of e)t.isIntersecting?this._intersecting.add(t.target):this._intersecting.delete(t.target);this._computeActive()}_computeActive(){if(!this._element?.isConnected||0===this._sections.length)return;let e=null;if(this._atBottom)e=this._sections.at(-1);else{for(const t of this._sections)this._intersecting.has(t)&&(e=t);e||=this._lastActive??this._sections.at(0)}if(!e)return;this._lastActive=e;const t=this._linkBySection.get(e);t&&this._process(t)}_parseTopMargin(){const e=String(this._config.topMargin);return{value:Number.parseFloat(e)||0,unit:e.endsWith("%")?"%":"px"}}_getDerivedRootMargin(){const{value:e,unit:t}=this._parseTopMargin();let n=e;if("px"===t){const t=this._rootElement?this._rootElement.clientHeight:document.documentElement.clientHeight||window.innerHeight;n=t?e/t*100:12}return`0px 0px -${Math.min(Math.max(100-n,0),100)}% 0px`}_usesPixelMargin(){return!this._config.rootMargin&&"px"===this._parseTopMargin().unit}_setUpSentinel(){if(this._teardownSentinel(),0===this._sections.length)return;const e=document.createElement("div");e.setAttribute("aria-hidden","true"),e.style.cssText="position:relative;width:0;height:0;margin:0;padding:0;border:0;visibility:hidden;",this._element.append(e),this._sentinel=e,this._sentinelObserver=new IntersectionObserver(e=>this._onSentinel(e),{root:this._rootElement,threshold:[0]}),this._sentinelObserver.observe(e)}_onSentinel(e){const t=e.at(-1);this._atBottom=Boolean(t?.isIntersecting)&&this._isOverflowing(),this._computeActive()}_isOverflowing(){const e=this._rootElement||document.scrollingElement||document.documentElement;return e.scrollHeight>e.clientHeight}_teardownSentinel(){this._sentinelObserver?.disconnect(),this._sentinelObserver=null,this._sentinel?.remove(),this._sentinel=null,this._atBottom=!1}_maybeAddResizeListener(){this._removeResizeListener(),this._usesPixelMargin()&&(this._resizeHandler=()=>{clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(()=>this._rebuildObserver(),100)},EventHandler.on(window,EVENT_RESIZE,this._resizeHandler))}_removeResizeListener(){clearTimeout(this._resizeTimeout),this._resizeTimeout=null,this._resizeHandler&&(EventHandler.off(window,EVENT_RESIZE,this._resizeHandler),this._resizeHandler=null)}_rebuildObserver(){if(this._observer){this._observer.disconnect(),this._intersecting.clear(),this._observer=this._getNewObserver();for(const e of this._sections)this._observer.observe(e)}}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(EventHandler.off(this._config.target,EVENT_CLICK$1),EventHandler.on(this._config.target,EVENT_CLICK$1,"[href]",e=>{const t=e.target.closest("[href]"),n=t&&this._sectionByLink.get(t);if(!n||!this._element)return;e.preventDefault();const i=this._rootElement||window,s=n.offsetTop-this._element.offsetTop,o=this._rootElement?this._rootElement.scrollTop:window.scrollY??window.pageYOffset;if(matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(o-s)<=2)return i.scrollTo?i.scrollTo({top:s,behavior:"auto"}):i.scrollTop=s,void this._settleNavigation(t.hash,n);this._pendingNavigation={hash:t.hash,section:n},this._armSettle(),i.scrollTo?i.scrollTo({top:s,behavior:"smooth"}):i.scrollTop=s}))}_armSettle(){this._disarmSettle();const e=this._getSettleTarget();this._settleHandler=()=>this._onSettle(),this._scrollIdleHandler=()=>{clearTimeout(this._settleTimeout),this._settleTimeout=setTimeout(()=>this._onSettle(),100)},EventHandler.on(e,EVENT_SCROLLEND,this._settleHandler),EventHandler.on(e,EVENT_SCROLL,this._scrollIdleHandler)}_disarmSettle(){clearTimeout(this._settleTimeout),this._settleTimeout=null;const e=this._getSettleTarget();this._settleHandler&&(EventHandler.off(e,EVENT_SCROLLEND,this._settleHandler),this._settleHandler=null),this._scrollIdleHandler&&(EventHandler.off(e,EVENT_SCROLL,this._scrollIdleHandler),this._scrollIdleHandler=null)}_getSettleTarget(){return this._rootElement||document}_onSettle(){if(this._disarmSettle(),!this._pendingNavigation)return;const{hash:e,section:t}=this._pendingNavigation;this._settleNavigation(e,t)}_settleNavigation(e,t){this._pendingNavigation=null,window.history?.replaceState&&window.history.replaceState(null,"",e),t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),t.focus({preventScroll:!0})}_initializeTargetsAndObservables(){this._sections=[],this._linkBySection=new Map,this._sectionByLink=new Map;const e=SelectorEngine.find("[href]",this._config.target),t=new Set;for(const n of e){if(!n.hash||isDisabled(n))continue;const e=decodeFragment(n.hash.slice(1));if(!e)continue;const i=document.getElementById(e);i&&this._element.contains(i)&&isVisible(i)&&(this._sectionByLink.set(n,i),this._linkBySection.set(i,n),t.has(i)||(t.add(i),this._sections.push(i)))}this._sections.sort((e,t)=>e.getBoundingClientRect().top-t.getBoundingClientRect().top)}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add("active"),this._activateParents(e),EventHandler.trigger(this._element,EVENT_ACTIVATE,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains("menu-item")){const t=e.closest(".menu")?.previousElementSibling;return void(t?.matches(SELECTOR_MENU_TOGGLE$1)&&t.classList.add("active"))}for(const t of SelectorEngine.parents(e,".nav, .list-group"))for(const e of SelectorEngine.prev(t,SELECTOR_LINK_ITEMS))e.classList.add("active")}_clearActiveClass(e){e.classList.remove("active");const t=SelectorEngine.find("[href].active",e);for(const e of t)e.classList.remove("active")}};function decodeFragment(e){try{return decodeURIComponent(e)}catch{return e}}EventHandler.on(window,EVENT_LOAD_DATA_API$1,()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_SPY))ScrollSpy.getOrCreateInstance(e)});const NAME$2="tab",EVENT_KEY$2=".bs.tab",EVENT_HIDE$1="hide.bs.tab",EVENT_HIDDEN$1="hidden.bs.tab",EVENT_SHOW$1="show.bs.tab",EVENT_SHOWN$1="shown.bs.tab",EVENT_CLICK_DATA_API="click.bs.tab",EVENT_KEYDOWN="keydown.bs.tab",EVENT_LOAD_DATA_API="load.bs.tab",ARROW_LEFT_KEY="ArrowLeft",ARROW_RIGHT_KEY="ArrowRight",ARROW_UP_KEY="ArrowUp",ARROW_DOWN_KEY="ArrowDown",HOME_KEY="Home",END_KEY="End",CLASS_NAME_ACTIVE="active",CLASS_NAME_FADE$1="fade",CLASS_NAME_SHOW$1="show",SELECTOR_MENU_TOGGLE='[data-bs-toggle="menu"]',SELECTOR_MENU=".menu",NOT_SELECTOR_MENU_TOGGLE=`:not(${SELECTOR_MENU_TOGGLE})`,SELECTOR_TAB_PANEL='.list-group, .nav, [role="tablist"]',SELECTOR_OUTER=".nav-item, .list-group-item",SELECTOR_INNER=`.nav-link${NOT_SELECTOR_MENU_TOGGLE}, .list-group-item${NOT_SELECTOR_MENU_TOGGLE}, [role="tab"]${NOT_SELECTOR_MENU_TOGGLE}`,SELECTOR_DATA_TOGGLE$1='[data-bs-toggle="tab"]',SELECTOR_INNER_ELEM=`${SELECTOR_INNER}, ${SELECTOR_DATA_TOGGLE$1}`,SELECTOR_DATA_TOGGLE_ACTIVE='.active[data-bs-toggle="tab"]';var Tab=class e extends BaseComponent{constructor(e){if(super(e),this._parent=this._element.closest(SELECTOR_TAB_PANEL),!this._parent)throw new TypeError(`${this._element.outerHTML} has no valid parent ${SELECTOR_TAB_PANEL}`);this._setInitialAttributes(this._parent,this._getChildren()),EventHandler.on(this._element,EVENT_KEYDOWN,e=>this._keydown(e))}static get NAME(){return"tab"}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),n=t?EventHandler.trigger(t,EVENT_HIDE$1,{relatedTarget:e}):null;EventHandler.trigger(e,EVENT_SHOW$1,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){e&&(e.classList.add("active"),this._activate(SelectorEngine.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),setAriaAttribute(e,"aria-selected",!0),this._toggleMenu(e,!0),EventHandler.trigger(e,EVENT_SHOWN$1,{relatedTarget:t})):e.classList.add("show")},e,e.classList.contains("fade")))}_deactivate(e,t){e&&(e.classList.remove("active"),e.blur(),this._deactivate(SelectorEngine.getElementFromSelector(e)),this._queueCallback(()=>{"tab"===e.getAttribute("role")?(setAriaAttribute(e,"aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleMenu(e,!1),EventHandler.trigger(e,EVENT_HIDDEN$1,{relatedTarget:t})):e.classList.remove("show")},e,e.classList.contains("fade")))}_keydown(t){if(![ARROW_LEFT_KEY,ARROW_RIGHT_KEY,ARROW_UP_KEY,ARROW_DOWN_KEY,HOME_KEY,END_KEY].includes(t.key))return;if(t.altKey||t.ctrlKey||t.metaKey)return;t.stopPropagation(),t.preventDefault();const n=this._getChildren().filter(e=>!isDisabled(e));let i;if([HOME_KEY,END_KEY].includes(t.key))i=t.key===HOME_KEY?n[0]:n.at(-1);else{const e=[ARROW_RIGHT_KEY,ARROW_DOWN_KEY].includes(t.key);i=getNextActiveElement(n,t.target,e,!0)}i&&(i.focus({preventScroll:!0}),e.getOrCreateInstance(i).show())}_getChildren(){return SelectorEngine.find(SELECTOR_INNER_ELEM,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const e of t)this._setInitialAttributesOnChild(e)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),n=this._getOuterElement(e);setAriaAttribute(e,"aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=SelectorEngine.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleMenu(e,t){const n=this._getOuterElement(e),i=SelectorEngine.findOne(SELECTOR_MENU_TOGGLE,n);if(!i)return;const s=SelectorEngine.findOne(".menu",n);i.classList.toggle("active",t),s&&s.classList.toggle("show",t),setAriaAttribute(i,"aria-expanded",t)}_setAttributeIfNotExists(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}_elemIsActive(e){return e.classList.contains("active")}_getInnerElement(e){return e.matches(SELECTOR_INNER_ELEM)?e:SelectorEngine.findOne(SELECTOR_INNER_ELEM,e)}_getOuterElement(e){return e.closest(SELECTOR_OUTER)||e}};EventHandler.on(document,"click.bs.tab",SELECTOR_DATA_TOGGLE$1,function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),isDisabled(this)||Tab.getOrCreateInstance(this).show()}),EventHandler.on(window,"load.bs.tab",()=>{for(const e of SelectorEngine.find(SELECTOR_DATA_TOGGLE_ACTIVE))Tab.getOrCreateInstance(e)});const NAME$1="toast",EVENT_KEY$1=".bs.toast",EVENT_MOUSEOVER="mouseover.bs.toast",EVENT_MOUSEOUT="mouseout.bs.toast",EVENT_FOCUSIN="focusin.bs.toast",EVENT_FOCUSOUT="focusout.bs.toast",EVENT_HIDE="hide.bs.toast",EVENT_HIDDEN="hidden.bs.toast",EVENT_SHOW="show.bs.toast",EVENT_SHOWN="shown.bs.toast",CLASS_NAME_FADE="fade",CLASS_NAME_HIDE="hide",CLASS_NAME_SHOW="show",CLASS_NAME_SHOWING="showing",DefaultType$1={animation:"boolean",autohide:"boolean",delay:"number"},Default$1={animation:!0,autohide:!0,delay:5e3};var Toast=class extends BaseComponent{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return Default$1}static get DefaultType(){return DefaultType$1}static get NAME(){return NAME$1}show(){EventHandler.trigger(this._element,EVENT_SHOW).defaultPrevented||(this._clearTimeout(),this._config.animation&&this._element.classList.add("fade"),this._element.classList.remove("hide"),reflow(this._element),this._element.classList.add("show","showing"),this._queueCallback(()=>{this._element.classList.remove("showing"),EventHandler.trigger(this._element,EVENT_SHOWN),this._maybeScheduleHide()},this._element,this._config.animation))}hide(){this.isShown()&&(EventHandler.trigger(this._element,EVENT_HIDE).defaultPrevented||(this._element.classList.add("showing"),this._queueCallback(()=>{this._element.classList.add("hide"),this._element.classList.remove("showing","show"),EventHandler.trigger(this._element,EVENT_HIDDEN)},this._element,this._config.animation)))}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove("show"),super.dispose()}isShown(){return this._element.classList.contains("show")}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)return void this._clearTimeout();const n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}_setListeners(){EventHandler.on(this._element,EVENT_MOUSEOVER,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_MOUSEOUT,e=>this._onInteraction(e,!1)),EventHandler.on(this._element,EVENT_FOCUSIN,e=>this._onInteraction(e,!0)),EventHandler.on(this._element,EVENT_FOCUSOUT,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}};enableDismissTrigger(Toast);const NAME="toggler",EVENT_KEY=".bs.toggler",EVENT_TOGGLE=`toggle${EVENT_KEY}`,EVENT_TOGGLED=`toggled${EVENT_KEY}`,EVENT_CLICK="click",SELECTOR_DATA_TOGGLE='[data-bs-toggle="toggler"]',DefaultType={attribute:"string",value:"(string|number|boolean)"},Default={attribute:"class",value:null};var Toggler=class extends BaseComponent{static get Default(){return Default}static get DefaultType(){return DefaultType}static get NAME(){return NAME}toggle(){EventHandler.trigger(this._element,EVENT_TOGGLE).defaultPrevented||(this._execute(),EventHandler.trigger(this._element,EVENT_TOGGLED))}_execute(){const{attribute:e,value:t}=this._config;"id"!==e&&("class"!==e?this._element.getAttribute(e)!==String(t)?this._element.setAttribute(e,t):this._element.removeAttribute(e):this._element.classList.toggle(t))}};eventActionOnPlugin(Toggler,"click",SELECTOR_DATA_TOGGLE,"toggle");export{Alert,Button,Carousel,Chips,Collapse,Combobox,Datepicker,Dialog,Drawer,Menu,NavOverflow,OtpInput,Popover,Range,ScrollSpy,Strength,Tab,Toast,Toggler,Tooltip};
9
+ //# sourceMappingURL=bootstrap.bundle.min.js.map