@expressivecss/expressive 0.7.0-rc.0 → 0.8.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 (105) hide show
  1. package/CHANGELOG.md +1311 -1
  2. package/README.md +14 -11
  3. package/dist/css/expressive.css +4215 -1668
  4. package/dist/css/expressive.css.map +1 -1
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -1
  7. package/dist/js/expressive.cjs +1231 -1253
  8. package/dist/js/expressive.cjs.map +4 -4
  9. package/dist/js/expressive.js +1231 -1253
  10. package/dist/js/expressive.js.map +4 -4
  11. package/dist/js/expressive.min.js +12 -12
  12. package/dist/js/expressive.min.js.map +4 -4
  13. package/dist/js/expressive.mjs +1231 -1253
  14. package/dist/js/expressive.mjs.map +4 -4
  15. package/dist/types/behaviors/bottomSheets.d.ts +19 -11
  16. package/dist/types/behaviors/sheetDrag.d.ts +40 -0
  17. package/dist/types/behaviors/sideSheets.d.ts +2 -9
  18. package/dist/types/components/autocomplete.d.ts +15 -3
  19. package/dist/types/components/buttons.d.ts +5 -1
  20. package/dist/types/components/carousel.d.ts +87 -53
  21. package/dist/types/components/chips.d.ts +21 -1
  22. package/dist/types/components/expandingCard.d.ts +31 -0
  23. package/dist/types/components/index.d.ts +21 -20
  24. package/dist/types/components/lightbox.d.ts +1 -0
  25. package/dist/types/components/menu.d.ts +7 -1
  26. package/dist/types/components/{sidenav.d.ts → navigationDrawer.d.ts} +16 -16
  27. package/dist/types/components/registry.d.ts +8 -8
  28. package/dist/types/components/slider.d.ts +26 -85
  29. package/dist/types/components/snackbar.d.ts +20 -5
  30. package/dist/types/components/tabs.d.ts +12 -0
  31. package/dist/types/components/timepicker.d.ts +12 -9
  32. package/dist/types/core/utils.d.ts +64 -53
  33. package/dist/types/index.d.ts +8 -9
  34. package/package.json +15 -1
  35. package/src/sass/README.md +61 -11
  36. package/src/sass/abstracts/_breakpoints.scss +17 -19
  37. package/src/sass/abstracts/_mixins.scss +103 -21
  38. package/src/sass/abstracts/_variables.scss +50 -5
  39. package/src/sass/base/_global.scss +6 -24
  40. package/src/sass/base/_grid.scss +15 -12
  41. package/src/sass/base/_normalize.scss +34 -38
  42. package/src/sass/base/_typography.scss +4 -18
  43. package/src/sass/components/_badges.scss +2 -3
  44. package/src/sass/components/_banners.scss +298 -0
  45. package/src/sass/components/_bottom-app-bar.scss +180 -0
  46. package/src/sass/components/_bottom-sheet.scss +12 -4
  47. package/src/sass/components/_button-groups.scss +186 -0
  48. package/src/sass/components/_buttons.scss +245 -92
  49. package/src/sass/components/_cards.scss +494 -73
  50. package/src/sass/components/_carousel.scss +562 -68
  51. package/src/sass/components/_chips.scss +64 -5
  52. package/src/sass/components/_datepicker.scss +24 -24
  53. package/src/sass/components/_dialog.scss +17 -11
  54. package/src/sass/components/_drag-handle.scss +130 -0
  55. package/src/sass/components/_expanding-card.scss +260 -0
  56. package/src/sass/components/_fab-menu.scss +232 -0
  57. package/src/sass/components/_floating-sheet.scss +86 -0
  58. package/src/sass/components/_icon-buttons.scss +194 -0
  59. package/src/sass/components/_icons-material-design.scss +16 -4
  60. package/src/sass/components/_index.scss +22 -6
  61. package/src/sass/components/_list.scss +16 -13
  62. package/src/sass/components/_loading-indicator.scss +106 -0
  63. package/src/sass/components/_menu.scss +335 -61
  64. package/src/sass/components/_navbar.scss +71 -24
  65. package/src/sass/components/_navigation-bar.scss +13 -10
  66. package/src/sass/components/{_sidenav.scss → _navigation-drawer.scss} +123 -33
  67. package/src/sass/components/_navigation-rail.scss +22 -22
  68. package/src/sass/components/_page-footer.scss +19 -16
  69. package/src/sass/components/_pagination.scss +24 -6
  70. package/src/sass/components/_panes.scss +52 -11
  71. package/src/sass/components/{_preloader.scss → _progress.scss} +11 -3
  72. package/src/sass/components/_scrim.scss +37 -0
  73. package/src/sass/components/_search.scss +259 -0
  74. package/src/sass/components/_segmented-buttons.scss +188 -0
  75. package/src/sass/components/_side-sheet.scss +2 -2
  76. package/src/sass/components/_snackbar.scss +20 -15
  77. package/src/sass/components/_split-button.scss +196 -0
  78. package/src/sass/components/_tabs.scss +7 -8
  79. package/src/sass/components/_timepicker.scss +67 -58
  80. package/src/sass/components/_toolbar.scss +206 -80
  81. package/src/sass/components/forms/_checkboxes.scss +49 -12
  82. package/src/sass/components/forms/_fieldset.scss +4 -4
  83. package/src/sass/components/forms/_file-input.scss +8 -1
  84. package/src/sass/components/forms/_index.scss +1 -1
  85. package/src/sass/components/forms/_input-fields.scss +50 -44
  86. package/src/sass/components/forms/_radio-buttons.scss +42 -10
  87. package/src/sass/components/forms/_select.scss +0 -1
  88. package/src/sass/components/forms/{_range.scss → _slider.scss} +8 -9
  89. package/src/sass/components/forms/_switches.scss +6 -7
  90. package/src/sass/tokens/_index.scss +4 -1
  91. package/src/sass/tokens/_reference.scss +70 -61
  92. package/src/sass/tokens/_state.scss +24 -0
  93. package/src/sass/tokens/_theme.scss +6 -3
  94. package/src/sass/tokens/_vibrant.scss +76 -0
  95. package/src/sass/utilities/_colors.scss +14 -1
  96. package/src/sass/utilities/_helpers.scss +5 -5
  97. package/src/sass/utilities/_visibility.scss +48 -26
  98. package/dist/types/behaviors/waves.d.ts +0 -15
  99. package/dist/types/components/parallax.d.ts +0 -16
  100. package/dist/types/components/range.d.ts +0 -43
  101. package/dist/types/core/bounding.d.ts +0 -6
  102. package/dist/types/core/edges.d.ts +0 -6
  103. package/src/sass/components/_parallax.scss +0 -104
  104. package/src/sass/components/_pulse.scss +0 -37
  105. package/src/sass/components/_slider.scss +0 -129
@@ -1,12 +1,12 @@
1
- var Expressive=(()=>{var ut=Object.defineProperty;var It=Object.getOwnPropertyDescriptor;var Dt=Object.getOwnPropertyNames;var Ot=Object.prototype.hasOwnProperty;var Ht=(u,n)=>{for(var t in n)ut(u,t,{get:n[t],enumerable:!0})},St=(u,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of Dt(n))!Ot.call(u,i)&&i!==t&&ut(u,i,{get:()=>n[i],enumerable:!(e=It(n,i))||e.enumerable});return u};var At=u=>St(ut({},"__esModule",{value:!0}),u);var ae={};Ht(ae,{AutoInit:()=>gt,Autocomplete:()=>B,BottomSheets:()=>q,Cards:()=>P,Carousel:()=>F,CharacterCounter:()=>at,Chips:()=>W,Datepicker:()=>z,Dialogs:()=>N,FloatingActionButton:()=>X,FormSelect:()=>H,Forms:()=>K,Lightbox:()=>j,Menu:()=>A,NavigationRail:()=>J,Parallax:()=>G,Range:()=>V,ScrollSpy:()=>Z,SideSheets:()=>$,Sidenav:()=>Q,Slider:()=>lt,Snackbar:()=>rt,Tabs:()=>tt,Timepicker:()=>et,Tooltip:()=>it,Waves:()=>Y,version:()=>oe});var b=class b{static docHandleKeydown(n){b.keyDown=!0,b._navigationKeys.has(n.key)&&(b.tabPressed=!0)}static docHandleKeyup(n){b.keyDown=!1,b._navigationKeys.has(n.key)&&(b.tabPressed=!1)}static docHandleFocus(n){b.keyDown&&document.body.classList.add("keyboard-focused")}static docHandleBlur(n){document.body.classList.remove("keyboard-focused")}static onDocumentReady(n){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n())}static guid(){let n=()=>Math.floor((1+Math.random())*65536).toString(16).substring(1);return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()}static checkWithinContainer(n,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=n.getBoundingClientRect(),o=n===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,a=n.scrollLeft,l=n.scrollTop,h=t.left-a,d=t.top-l;return(h<s.left+e||h<e)&&(i.left=!0),(h+t.width>s.right-e||h+t.width>window.innerWidth-e)&&(i.right=!0),(d<s.top+e||d<e)&&(i.top=!0),(d+t.height>o-e||d+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(n,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},o=getComputedStyle(t).overflow==="visible",a=t.getBoundingClientRect(),l=Math.min(a.height,window.innerHeight),h=Math.min(a.width,window.innerWidth),d=n.getBoundingClientRect(),c=t.scrollLeft,p=t.scrollTop,E=e.left-c,_=e.top-p,M=e.top+d.height-p;return s.spaceOnRight=o?window.innerWidth-(d.left+e.width):h-(E+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=o?d.right-e.width:E-e.width+d.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=o?window.innerHeight-(d.top+e.height+i):l-(_+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=o?d.bottom-(e.height+i):M-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(n){let t=n.dataset.target;return t||(t=n.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY||document.documentElement.scrollTop||document.body.scrollTop||0}static getDocumentScrollLeft(){return window.scrollX||document.documentElement.scrollLeft||document.body.scrollLeft||0}static throttle(n,t,e={}){let i=null,s,o=null,a=0,l=()=>{a=e?.leading===!1?0:Date.now(),o=null,s=n(...i??[]),i=null};return(...h)=>{let d=Date.now();!a&&e?.leading===!1&&(a=d);let c=t-(d-a);return i=h,c<=0?(clearTimeout(o),o=null,a=d,i=null,s=n(...h)):!o&&e?.trailing!==!1&&(o=setTimeout(l,c)),s}}static createConfirmationContainer(n,t,e,i,s){let o=document.createElement("div");o.classList.add("confirmation-btns"),n.append(o),this.createButton(o,e,["btn-cancel"],!0,s),this.createButton(o,t,["btn-confirm"],!0,i)}static createButton(n,t,e=[],i=!0,s=null){e=e.concat(["waves-effect","text"]);let o=document.createElement("button");o.className=e.join(" "),o.style.visibility=i?"visible":"hidden",o.type="button",o.tabIndex=i?0:-1,o.innerText=t,typeof s=="function"&&(o.addEventListener("click",s),o.addEventListener("keypress",a=>{b.keys.ENTER.includes(a.key)&&s(a)})),n.append(o)}static _setAbsolutePosition(n,t,e,i,s,o="center"){let a=n.offsetHeight,l=n.offsetWidth,h=t.offsetHeight,d=t.offsetWidth,c=n.getBoundingClientRect(),p=0,E=0,_=c.top+b.getDocumentScrollTop(),M=c.left+b.getDocumentScrollLeft();e==="top"?(_+=-h-i,o==="center"&&(M+=l/2-d/2),E=-s):e==="right"?(_+=a/2-h/2,M=l+i,p=s):e==="left"?(_+=a/2-h/2,M=-d-i,p=-s):(_+=a+i,o==="center"&&(M+=l/2-d/2),E=s),o==="right"&&(M+=l-d-i);let O=b._repositionWithinScreen(M,_,d,h,i,s,o);return t.style.top=O.y+"px",t.style.left=O.x+"px",{x:p,y:E}}static _repositionWithinScreen(n,t,e,i,s,o,a){let l=b.getDocumentScrollLeft(),h=b.getDocumentScrollTop(),d=n-l,c=t-h,p={left:d,top:c,width:e,height:i},E;a==="left"||a=="center"?E=s+o:a==="right"&&(E=s-o);let _=b.checkWithinContainer(document.body,p,E);return _.left?d=E:_.right&&(d-=d+e-window.innerWidth),_.top?c=E:_.bottom&&(c-=c+i-window.innerHeight),{x:d+l,y:c+h}}};b.tabPressed=!1,b.keyDown=!1,b.keys={TAB:["Tab"],ENTER:["Enter"],ESC:["Escape","Esc"],BACKSPACE:["Backspace"],ARROW_UP:["ArrowUp","Up"],ARROW_DOWN:["ArrowDown","Down"],ARROW_LEFT:["ArrowLeft","Left"],ARROW_RIGHT:["ArrowRight","Right"],DELETE:["Delete","Del"]},b._navigationKeys=new Set([...b.keys.TAB,...b.keys.ARROW_DOWN,...b.keys.ARROW_UP]);var r=b;var g=class{constructor(n,t,e){n instanceof HTMLElement||console.error(Error(n+" is not an HTML Element"));let i=e.getInstance(n);i&&i.destroy(),this.el=n}static init(n,t,e){let i=null;if(n instanceof Element)i=new e(n,t);else if(n&&n.length){i=[];for(let s=0;s<n.length;s++)i.push(new e(n[s],t))}return i}static get defaults(){return{}}static getInstance(n){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var Rt={onOpen:null,onClose:null},pt="article:has(> aside)",P=class u extends g{constructor(t,e){super(t,e,u);this.isOpen=!1;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction),t.addEventListener("keypress",this._handleKeypressEvent)})};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction),t.removeEventListener("keypress",this._handleKeypressEvent)})};this._handleClickInteraction=()=>{this._handleRevealEvent()};this._handleKeypressEvent=t=>{r.keys.ENTER.includes(t.key)&&this._handleRevealEvent()};this._handleRevealEvent=()=>{this._activators.forEach(t=>t.tabIndex=-1),this.open()};this._setupRevealCloseEventHandlers=()=>{this.cardRevealClose.addEventListener("click",this.close),this.cardRevealClose.addEventListener("keypress",this._handleKeypressCloseEvent)};this._removeRevealCloseEventHandlers=()=>{this.cardRevealClose.removeEventListener("click",this.close),this.cardRevealClose.removeEventListener("keypress",this._handleKeypressCloseEvent)};this._handleKeypressCloseEvent=t=>{r.keys.ENTER.includes(t.key)&&this.close()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.ariaExpanded="true",this.cardRevealClose&&(this.cardRevealClose.tabIndex=0),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this),this.cardRevealClose&&this._setupRevealCloseEventHandlers())};this.close=()=>{!this.isOpen||!this.cardReveal||(this.isOpen=!1,this.cardReveal.ariaExpanded="false",this._activators.forEach(t=>t.tabIndex=0),this.cardRevealClose&&(this.cardRevealClose.tabIndex=-1),typeof this.options.onClose=="function"&&this.options.onClose.call(this),this.cardRevealClose&&this._removeRevealCloseEventHandlers())};this.el.Expressive_Cards=this,this.options={...u.defaults,...e},this._activators=[],this.cardReveal=this.el.querySelector(":scope > aside"),this.cardReveal&&(this._activators=Array.from(this.el.querySelectorAll(".activator")),this._activators.forEach(i=>{i&&(i.tabIndex=0)}),this.cardRevealClose=this.cardReveal.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)"),this.cardRevealClose&&(this.cardRevealClose.tabIndex=-1),this.cardReveal.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Rt}static init(t,e){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardRevealClose&&this._removeRevealCloseEventHandlers(),this._activators=[],this.el.Expressive_Cards=void 0}static Init(){r.onDocumentReady(()=>{document.querySelectorAll(pt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Pt={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},R=class R extends g{constructor(t,e){super(t,e,R);this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,o=e.closest(".menu-trigger");o&&o.Expressive_Menu&&o.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.target;this._isSubmenuTriggerClick(e)||(this.options.closeOnClick&&this.menuEl?.contains(e)&&!this.isTouchMoving?this.close():this.menuEl?.contains(e)||setTimeout(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(r.keys.ARROW_DOWN.includes(t.key)||r.keys.ENTER.includes(t.key))&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;this.menuEl?.contains(e)&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target,i=e.closest("li");if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{let e=r.keys.ARROW_DOWN.includes(t.key)||r.keys.ARROW_UP.includes(t.key);if(r.keys.TAB.includes(t.key))t.preventDefault(),this.close();else if(r.keys.ARROW_RIGHT.includes(t.key)&&this.isOpen){let a=this._focusedRow(t);a?.querySelector(":scope > menu")&&(t.preventDefault(),a.classList.add("open"),this._alignSubmenu(a),this._syncSubmenuAria(a,!0),a.querySelector(":scope > menu > li")?.focus())}else if(r.keys.ARROW_LEFT.includes(t.key)&&this.isOpen){let a=this._containingSubmenu(t);if(a){t.preventDefault();let l=a.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),l.focus()}}else if(e&&this.isOpen){t.preventDefault();let a=r.keys.ARROW_DOWN.includes(t.key)?1:-1,l=this._containingSubmenu(t)??this.menuEl,h=this.focusedIndex,d=!1;do if(h=h+a,l.children[h]&&l.children[h].tabIndex!==-1){d=!0;break}while(h<l.children.length&&h>=0);if(d){this.focusedIndex>=0&&l.children[this.focusedIndex]?.classList.remove("active"),this.focusedIndex=h;let c=l.children[this.focusedIndex];c.classList.add("active"),c.focus({preventScroll:!0})}}else if(r.keys.ENTER.includes(t.key)&&this.isOpen){let a=this._focusedRow(t);if(a?.querySelector(":scope > menu")){t.preventDefault(),this._toggleSubmenu(a);return}let l=a??this.menuEl.children[this.focusedIndex],h=l?.querySelector("a, button");h?h.click():l instanceof HTMLElement&&l.click()}else if(r.keys.ESC.includes(t.key)&&this.isOpen){t.preventDefault();let a=this.menuEl.querySelector("li.open");a?(a.classList.remove("open","submenu-start"),this._syncSubmenuAria(a,!1),a.focus()):this.close()}let i=t.key.toLowerCase(),s=/[a-zA-Z0-9-_]/.test(i),o=[...r.keys.ARROW_DOWN,...r.keys.ARROW_UP,...r.keys.ENTER,...r.keys.ESC,...r.keys.TAB];if(s&&!o.includes(t.key)){this.filterQuery.push(i);let a=this.filterQuery.join(""),l=this._containingSubmenu(t)??this.menuEl,h=Array.from(l.querySelectorAll(":scope > li")).find(d=>d.textContent.trim().toLowerCase().indexOf(a)===0);h&&(this.focusedIndex=[...h.parentNode.children].indexOf(h),this._focusFocusedItem())}clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{this.isOpen||(this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this._resetMenuStyles(),this.menuEl.style.display="block",this._placeMenu(),this._animateIn(),setTimeout(()=>this._setupTemporaryEventHandlers(),0),this.el.ariaExpanded="true")};this.close=()=>{this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus(),this.el.ariaExpanded="false")};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,R._menus.push(this),this.id=r.getIdFromTrigger(t),this.menuEl=document.getElementById(this.id),this.options={...R.defaults,...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.el.ariaExpanded="false",this._moveMenuToElement(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return Pt}static init(t,e={}){return super.init(t,e,R)}static getInstance(t){return t.Expressive_Menu}destroy(){clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=R._menus.indexOf(this);t>=0&&R._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize)}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start"),e.getBoundingClientRect().right>window.innerWidth-8&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_resetMenuStyles(){this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity=""}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=0,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,o=i.width,a=e.left-i.left,l=e.top-i.top,h={left:a,top:l,height:s,width:o},d=r.checkPossibleAlignments(this.el,t,h,this.options.coverTrigger?0:e.height),c="top",p=this.options.alignment;if(l+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,d.top||(d.bottom?(c="bottom",this.options.coverTrigger||(l-=e.height)):(this.isScrollable=!0,s-=20,d.spaceOnTop>d.spaceOnBottom?(c="bottom",s+=d.spaceOnTop,l-=this.options.coverTrigger?d.spaceOnTop-20:d.spaceOnTop-20+e.height):s+=d.spaceOnBottom)),!d[p]){let E=p==="left"?"right":"left";d[E]?p=E:d.spaceOnLeft>d.spaceOnRight?(p="right",o+=d.spaceOnLeft,a-=d.spaceOnLeft):(p="left",o+=d.spaceOnRight)}return c==="bottom"&&(l=l-i.height+(this.options.coverTrigger?e.height:0)),p==="right"&&(a=a-i.width+e.width),{x:a,y:l,verticalAlignment:c,horizontalAlignment:p,height:s,width:o}}_animateIn(){let t=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",setTimeout(()=>{this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),setTimeout(()=>{this.options.autoFocus&&this.menuEl.focus(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",setTimeout(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!==null&&i!==document;){if(e(i))return i;i=i.parentElement}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,o=>!["HTML","BODY"].includes(o.tagName)&&getComputedStyle(o).overflow!=="visible");t||(t=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode),getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.options.constrainWidth?this.el.getBoundingClientRect().width:Math.min(280,Math.max(112,e));this.menuEl.style.width=i+"px";let s=this._getMenuPosition(t);this.menuEl.style.left=s.x+"px",this.menuEl.style.top=s.y+"px",this.menuEl.style.height=s.height+"px",this.menuEl.style.width=s.width+"px",this.menuEl.style.transformOrigin=`${s.horizontalAlignment==="left"?"0":"100%"} ${s.verticalAlignment==="top"?"0":"100%"}`}};R._menus=[];var A=R;var Bt={data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(u,n)=>{let t=u.toLocaleLowerCase();n.setMenuItems(n.options.data.filter(e=>e.id.toString().toLocaleLowerCase().includes(t)||e.text?.toLocaleLowerCase().includes(t)))},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},D=class D extends g{constructor(t,e){super(t,e,D);this._handleInputBlur=()=>{this._mousedown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=t=>{t.type==="keyup"&&(D._keydown=!1),this.count=0;let e=this.el.value.toLocaleLowerCase();r.keys.ENTER.includes(t.key)||r.keys.ARROW_UP.includes(t.key)||r.keys.ARROW_DOWN.includes(t.key)||(this.oldVal!==e&&r.tabPressed&&this.open(),this._inputChangeDetection(e))};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{D._keydown=!0;let e=this.container.querySelectorAll("li").length;if(r.keys.ENTER.includes(t.key)&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(r.keys.ARROW_UP.includes(t.key)||r.keys.ARROW_DOWN.includes(t.key))&&(t.preventDefault(),r.keys.ARROW_UP.includes(t.key)&&this.activeIndex>0&&this.activeIndex--,r.keys.ARROW_DOWN.includes(t.key)&&this.activeIndex<e-1&&this.activeIndex++,this.$active?.classList.remove("active"),this.activeIndex>=0&&(this.$active=this.container.querySelectorAll("li")[this.activeIndex],this.$active?.classList.add("active"),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerMousedownAndTouchstart=()=>{this._mousedown=!0};this._handleContainerMouseupAndTouchend=()=>{this._mousedown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this.isOpen=!0,this._renderMenu()),this.menu.isOpen?this.menu.recalculateDimensions():setTimeout(()=>{this.menu.open()},0)};this.close=()=>{this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...D.defaults,...e},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.selectedValues||this.options.selected.map(i=>({id:i}))||[],this.menuItems=this.options.data||[],this.$active=null,this._mousedown=!1,this._setupMenu(),this._setupEventHandlers()}static get defaults(){return Bt}static init(t,e={}){return super.init(t,e,D)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!D._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
1
+ var Expressive=(()=>{var ct=Object.defineProperty;var At=Object.getOwnPropertyDescriptor;var Rt=Object.getOwnPropertyNames;var Pt=Object.prototype.hasOwnProperty;var Bt=(u,o)=>{for(var t in o)ct(u,t,{get:o[t],enumerable:!0})},Nt=(u,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Rt(o))!Pt.call(u,i)&&i!==t&&ct(u,i,{get:()=>o[i],enumerable:!(e=At(o,i))||e.enumerable});return u};var Wt=u=>Nt(ct({},"__esModule",{value:!0}),u);var pe={};Bt(pe,{AutoInit:()=>Lt,Autocomplete:()=>P,BottomSheets:()=>$,Cards:()=>A,Carousel:()=>N,CharacterCounter:()=>ot,Chips:()=>B,Datepicker:()=>X,Dialogs:()=>q,ExpandingCard:()=>R,FloatingActionButton:()=>U,FormSelect:()=>w,Forms:()=>z,Lightbox:()=>j,Menu:()=>O,NavigationDrawer:()=>V,NavigationRail:()=>Z,Range:()=>W,ScrollSpy:()=>G,SideSheets:()=>K,Sidenav:()=>V,Slider:()=>W,Snackbar:()=>at,Tabs:()=>Q,Timepicker:()=>J,Tooltip:()=>tt,version:()=>ue});var k=class k{static onDocumentReady(o){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",o,{once:!0}):o())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(o){let t=o.getRootNode();return t.host?t:document.body}static getElementById(o,t){let e=o.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}static checkWithinContainer(o,t,e){let i={top:!1,right:!1,bottom:!1,left:!1},s=o.getBoundingClientRect(),n=o===document.body?Math.max(s.bottom,window.innerHeight):s.bottom,a=o.scrollLeft,l=o.scrollTop,h=t.left-a,r=t.top-l;return(h<s.left+e||h<e)&&(i.left=!0),(h+t.width>s.right-e||h+t.width>window.innerWidth-e)&&(i.right=!0),(r<s.top+e||r<e)&&(i.top=!0),(r+t.height>n-e||r+t.height>window.innerHeight-e)&&(i.bottom=!0),i}static checkPossibleAlignments(o,t,e,i){let s={top:!0,right:!0,bottom:!0,left:!0,spaceOnTop:null,spaceOnRight:null,spaceOnBottom:null,spaceOnLeft:null},n=getComputedStyle(t).overflow==="visible",a=t.getBoundingClientRect(),l=Math.min(a.height,window.innerHeight),h=Math.min(a.width,window.innerWidth),r=o.getBoundingClientRect(),d=t.scrollLeft,f=t.scrollTop,E=e.left-d,_=e.top-f,x=e.top+r.height-f;return s.spaceOnRight=n?window.innerWidth-(r.left+e.width):h-(E+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=n?r.right-e.width:E-e.width+r.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=n?window.innerHeight-(r.top+e.height+i):l-(_+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=n?r.bottom-(e.height+i):x-(e.height-i),s.spaceOnTop<0&&(s.bottom=!1),s}static getIdFromTrigger(o){let t=o.dataset.target;return t||(t=o.getAttribute("href"),t?t.slice(1):"")}static getDocumentScrollTop(){return window.scrollY}static getDocumentScrollLeft(){return window.scrollX}static throttle(o,t){let e=null,i=null,s=0;return(...n)=>{let a=Date.now(),l=t-(a-s);l<=0?(clearTimeout(e),e=null,s=a,i=null,o(...n)):e?i=n:(i=n,e=setTimeout(()=>{s=Date.now(),e=null,o(...i??[]),i=null},l))}}static createConfirmationContainer(o,t,e,i,s){let n=document.createElement("div");n.classList.add("confirmation-btns"),o.append(n),this.createButton(n,e,["btn-cancel"],!0,s),this.createButton(n,t,["btn-confirm"],!0,i)}static createButton(o,t,e=[],i=!0,s=null){e=e.concat(["text"]);let n=document.createElement("button");n.className=e.join(" "),n.style.visibility=i?"visible":"hidden",n.type="button",n.tabIndex=i?0:-1,n.innerText=t,typeof s=="function"&&(n.addEventListener("click",s),n.addEventListener("keypress",a=>{a.key===k.keys.ENTER&&s(a)})),o.append(n)}static _setAbsolutePosition(o,t,e,i,s,n="center"){let a=o.offsetHeight,l=o.offsetWidth,h=t.offsetHeight,r=t.offsetWidth,d=o.getBoundingClientRect(),f=0,E=0,_=d.top+k.getDocumentScrollTop(),x=d.left+k.getDocumentScrollLeft();e==="top"?(_+=-h-i,n==="center"&&(x+=l/2-r/2),E=-s):e==="right"?(_+=a/2-h/2,x=l+i,f=s):e==="left"?(_+=a/2-h/2,x=-r-i,f=-s):(_+=a+i,n==="center"&&(x+=l/2-r/2),E=s),n==="right"&&(x+=l-r-i);let H=k._repositionWithinScreen(x,_,r,h,i,s,n);return t.style.top=H.y+"px",t.style.left=H.x+"px",{x:f,y:E}}static _repositionWithinScreen(o,t,e,i,s,n,a){let l=k.getDocumentScrollLeft(),h=k.getDocumentScrollTop(),r=o-l,d=t-h,f={left:r,top:d,width:e,height:i},E;a==="left"||a=="center"?E=s+n:a==="right"&&(E=s-n);let _=k.checkWithinContainer(document.body,f,E);return _.left?r=E:_.right&&(r-=r+e-window.innerWidth),_.top?d=E:_.bottom&&(d-=d+i-window.innerHeight),{x:r+l,y:d+h}}};k.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var c=k;var v=class{constructor(o,t,e){o instanceof HTMLElement||console.error(Error(o+" is not an HTML Element"));let i=e.getInstance(o);i&&i.destroy(),this.el=o}static init(o,t,e){let i=null;if(o instanceof Element)i=new e(o,t);else if(o&&o.length){i=[];for(let s=0;s<o.length;s++)i.push(new e(o[s],t))}return i}static get defaults(){return{}}static getInstance(o){throw new Error("This method must be implemented.")}destroy(){throw new Error("This method must be implemented.")}};var Ft={onOpen:null,onClose:null},dt="article:has(> aside)",A=class u extends v{constructor(t,e){super(t,e,u);this.isOpen=!1;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction),t.addEventListener("keypress",this._handleKeypressEvent)})};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction),t.removeEventListener("keypress",this._handleKeypressEvent)})};this._handleClickInteraction=()=>{this._handleRevealEvent()};this._handleKeypressEvent=t=>{(t.key===c.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleRevealEvent())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this._setupRevealCloseEventHandlers=()=>{this.cardRevealClose.addEventListener("click",this.close),this.cardRevealClose.addEventListener("keypress",this._handleKeypressCloseEvent)};this._removeRevealCloseEventHandlers=()=>{this.cardRevealClose.removeEventListener("click",this.close),this.cardRevealClose.removeEventListener("keypress",this._handleKeypressCloseEvent)};this._handleKeypressCloseEvent=t=>{t.key===c.keys.ENTER&&this.close()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.ariaExpanded="true",this._activators.forEach(t=>t.ariaExpanded="true"),this.cardRevealClose&&(this.cardRevealClose.tabIndex=0),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this),this.cardRevealClose&&this._setupRevealCloseEventHandlers())};this.close=()=>{!this.isOpen||!this.cardReveal||(this.isOpen=!1,this.cardReveal.ariaExpanded="false",this._activators.forEach(t=>t.ariaExpanded="false"),this.cardRevealClose&&(this.cardRevealClose.tabIndex=-1),typeof this.options.onClose=="function"&&this.options.onClose.call(this),this.cardRevealClose&&this._removeRevealCloseEventHandlers())};this.el.Expressive_Cards=this,this.options={...u.defaults,...e},this._activators=[],this.cardReveal=this.el.querySelector(":scope > aside"),this.cardReveal&&(this._activators=Array.from(this.el.querySelectorAll(".activator")).filter(i=>!this.cardReveal.contains(i)),this._activators.forEach(i=>{i&&(i.tabIndex=0,i.ariaExpanded="false",i.matches("a[href], button, input, select, textarea")||i.setAttribute("role","button"))}),this.cardRevealClose=this.cardReveal.querySelector(":scope > :is(h1, h2, h3, h4, h5, h6)"),this.cardRevealClose&&(this.cardRevealClose.tabIndex=-1),this.cardReveal.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Ft}static init(t,e){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardRevealClose&&this._removeRevealCloseEventHandlers(),this._activators=[],this.el.Expressive_Cards=void 0}static Init(){c.onDocumentReady(()=>{document.querySelectorAll(dt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Vt={onOpen:null,onClose:null},qt=500,ut="article.expanding-card:has(> dialog.expanding-card-dialog)",R=class u extends v{constructor(t,e){super(t,e,u);this.isOpen=!1;this.closeTimer=null;this._setupEventHandlers=()=>{this.trigger?.addEventListener("click",this.open),this.trigger?.addEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.addEventListener("click",this.close),this.dialog?.addEventListener("cancel",this._handleCancel),this.dialog?.addEventListener("close",this._handleNativeClose)};this._removeEventHandlers=()=>{this.trigger?.removeEventListener("click",this.open),this.trigger?.removeEventListener("keypress",this._handleTriggerKeypress),this.closeButton?.removeEventListener("click",this.close),this.dialog?.removeEventListener("cancel",this._handleCancel),this.dialog?.removeEventListener("close",this._handleNativeClose)};this._handleTriggerKeypress=t=>{(t.key===c.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.isOpen&&(this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"))};this._setTransitionOrigin=()=>{if(!this.dialog)return;let t=this.el.getBoundingClientRect(),i=this.el.querySelector(":scope > figure, :scope > img")?.getBoundingClientRect();this.dialog.style.setProperty("--md-comp-expanding-card-from-top",`${Math.max(0,t.top)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-right",`${Math.max(0,window.innerWidth-t.right)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-bottom",`${Math.max(0,window.innerHeight-t.bottom)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-left",`${Math.max(0,t.left)}px`),this.dialog.style.setProperty("--md-comp-expanding-card-from-media-height",`${Math.max(0,i?.height??0)}px`)};this.open=()=>{this.isOpen||!this.dialog||!this.trigger||(this.closeTimer!==null&&(window.clearTimeout(this.closeTimer),this.closeTimer=null),this._setTransitionOrigin(),this.isOpen=!0,this.trigger.ariaExpanded="true",this.dialog.ariaExpanded="true",this.dialog.showModal(),this.dialog.offsetWidth,this.dialog.classList.add("expanded"),this.closeButton?.focus(),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.dialog||!this.trigger)return;this._setTransitionOrigin(),this.isOpen=!1,this.trigger.ariaExpanded="false",this.dialog.ariaExpanded="false",this.dialog.classList.remove("expanded"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el);let t=()=>{this.closeTimer=null,this.dialog.open&&this.dialog.close(),this.trigger.focus()};window.matchMedia("(prefers-reduced-motion: reduce)").matches?t():this.closeTimer=window.setTimeout(t,qt)};this.el.Expressive_ExpandingCard=this,this.options={...u.defaults,...e},this.dialog=this.el.querySelector(":scope > dialog.expanding-card-dialog"),this.trigger=this.el.querySelector(":scope > .expanding-card-trigger, :scope > figure > .expanding-card-trigger"),this.closeButton=this.dialog?.querySelector(".expanding-card-close")??null,this.trigger&&this.dialog&&(this.trigger.ariaExpanded="false",this.dialog.id&&this.trigger.setAttribute("aria-controls",this.dialog.id),this.trigger.matches("a[href], button, input, select, textarea")||(this.trigger.tabIndex=0,this.trigger.setAttribute("role","button")),this.dialog.ariaExpanded="false",this._setupEventHandlers())}static get defaults(){return Vt}static init(t,e){return super.init(t,e,u)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeTimer!==null&&window.clearTimeout(this.closeTimer),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){c.onDocumentReady(()=>{document.querySelectorAll(ut).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var ft=112,$t=280,Kt={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},pt=" ",S=class S extends v{constructor(t,e){super(t,e,S);this._handleClick=t=>{t.preventDefault(),this.isOpen?this.close():this.open()};this._handleMouseEnter=()=>{this.open()};this._handleMouseLeave=t=>{let e=t.relatedTarget;if(!e){this.close();return}let i=!!(this.menuEl&&e&&this.menuEl.contains(e)),s=!1,n=e.closest(".menu-trigger");n&&n.Expressive_Menu&&n.Expressive_Menu.isOpen&&(s=!0),!s&&!i&&this.close()};this._handleDocumentClick=t=>{let e=t.target;this._isSubmenuTriggerClick(e)||(this.options.closeOnClick&&this.menuEl?.contains(e)&&!this.isTouchMoving?this.close():this.menuEl?.contains(e)||setTimeout(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(t.key===pt||t.key===c.keys.ENTER||t.key===c.keys.ARROW_DOWN||t.key===c.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;this.menuEl?.contains(e)&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target,i=e.closest("li");if(i?.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),t.stopPropagation();return}if(i&&this._isSubmenuTriggerClick(e)){t.preventDefault(),t.stopPropagation(),this._toggleSubmenu(i);return}i&&typeof this.options.onItemClick=="function"&&this.options.onItemClick.call(this,i)};this._handleSubmenuAlign=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("li");i?.querySelector(":scope > menu")&&this.menuEl?.contains(i)&&this._alignSubmenu(i)};this._handleMenuKeydown=t=>{let e=t.key===c.keys.ARROW_DOWN||t.key===c.keys.ARROW_UP;if(t.key===c.keys.TAB)t.preventDefault(),this.close();else if(t.key===c.keys.ARROW_RIGHT&&this.isOpen){let a=this._focusedRow(t);a?.querySelector(":scope > menu")&&(t.preventDefault(),a.classList.add("open"),this._alignSubmenu(a),this._syncSubmenuAria(a,!0),a.querySelector(":scope > menu > li")?.focus())}else if(t.key===c.keys.ARROW_LEFT&&this.isOpen){let a=this._containingSubmenu(t);if(a){t.preventDefault();let l=a.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),l.focus()}}else if(e&&this.isOpen){t.preventDefault();let a=t.key===c.keys.ARROW_DOWN?1:-1,l=this._containingSubmenu(t)??this.menuEl,h=this.focusedIndex,r=!1;do if(h=h+a,l.children[h]&&l.children[h].tabIndex!==-1){r=!0;break}while(h<l.children.length&&h>=0);if(r){this.focusedIndex>=0&&l.children[this.focusedIndex]?.classList.remove("active"),this.focusedIndex=h;let d=l.children[this.focusedIndex];d.classList.add("active"),d.focus({preventScroll:!0})}}else if((t.key===c.keys.ENTER||t.key===pt)&&this.isOpen){let a=this._focusedRow(t);if(t.preventDefault(),a?.matches('.disabled, [aria-disabled="true"]'))return;if(a?.querySelector(":scope > menu")){this._toggleSubmenu(a);return}let l=a??this.menuEl.children[this.focusedIndex],h=l?.querySelector("a, button");h?h.click():l instanceof HTMLElement&&l.click()}else if(t.key===c.keys.ESC&&this.isOpen){t.preventDefault();let a=this.menuEl.querySelector("li.open");a?(a.classList.remove("open","submenu-start"),this._syncSubmenuAria(a,!1),a.focus()):this.close()}let i=t.key.toLowerCase(),s=/[a-zA-Z0-9-_]/.test(i),n=[c.keys.ARROW_DOWN,c.keys.ARROW_UP,c.keys.ENTER,c.keys.ESC,c.keys.TAB,pt];if(s&&!n.includes(t.key)){this.filterQuery.push(i);let a=this.filterQuery.join(""),l=this._containingSubmenu(t)??this.menuEl,h=Array.from(l.querySelectorAll(":scope > li")).find(r=>r.textContent.trim().toLowerCase().indexOf(a)===0);h&&(this.focusedIndex=[...h.parentNode.children].indexOf(h),this._focusFocusedItem())}clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{this.isOpen||(this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this._resetMenuStyles(),this.menuEl.style.display="block",this._placeMenu(),this._animateIn(),setTimeout(()=>this._setupTemporaryEventHandlers(),0),this.el.ariaExpanded="true")};this.close=()=>{this.isOpen&&(this.isOpen=!1,this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this._animateOut(),this._removeTemporaryEventHandlers(),this.options.autoFocus&&this.el.focus(),this.el.ariaExpanded="false")};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,S._menus.push(this),this.id=c.getIdFromTrigger(t),this.menuEl=c.getElementById(t,this.id),this.options={...S.defaults,...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.el.ariaExpanded="false",this.el.hasAttribute("aria-haspopup")||this.el.setAttribute("aria-haspopup","menu"),this.id&&!this.el.hasAttribute("aria-controls")&&this.el.setAttribute("aria-controls",this.id),this._moveMenuToElement(),this._setupAccessibility(),this._makeMenuFocusable(),this._setupSubmenus(),this._setupEventHandlers()}static get defaults(){return Kt}static init(t,e={}){return super.init(t,e,S)}static getInstance(t){return t.Expressive_Menu}destroy(){clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=S._menus.indexOf(this);t>=0&&S._menus.splice(t,1),this.el.Expressive_Menu=void 0}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.addEventListener("click",this._handleMenuClick),this.menuEl?.querySelector(":scope > li > menu")&&this.menuEl.addEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.menuEl.addEventListener("mouseleave",this._handleMouseLeave)):this.el.addEventListener("click",this._handleClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleTriggerKeydown),this.menuEl?.removeEventListener("click",this._handleMenuClick),this.menuEl?.removeEventListener("mouseover",this._handleSubmenuAlign),this.options.hover?(this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.menuEl?.removeEventListener("mouseleave",this._handleMouseLeave)):this.el.removeEventListener("click",this._handleClick)}_setupTemporaryEventHandlers(){document.body.addEventListener("click",this._handleDocumentClick),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize)}_setupAccessibility(){if(!this.menuEl)return;this.menuEl.hasAttribute("role")||this.menuEl.setAttribute("role","menu"),[this.menuEl,...this.menuEl.querySelectorAll("menu")].forEach(e=>{e.hasAttribute("role")||e.setAttribute("role","menu"),e.getAttribute("role")==="menu"&&e.querySelectorAll(":scope > li").forEach(i=>{if(i.classList.contains("divider")){i.hasAttribute("role")||i.setAttribute("role","separator");return}if(i.classList.contains("gap")){i.setAttribute("aria-hidden","true");return}if(i.classList.contains("label")||i.classList.contains("optgroup")){i.hasAttribute("role")||i.setAttribute("role","presentation");return}i.hasAttribute("role")||i.setAttribute("role","menuitem"),i.classList.contains("disabled")&&!i.hasAttribute("aria-disabled")&&i.setAttribute("aria-disabled","true")})})}_isSubmenuTriggerClick(t){if(!this.menuEl)return!1;let e=t.closest("li");if(!e||!this.menuEl.contains(e))return!1;let i=e.querySelector(":scope > menu");return i?!i.contains(t):!1}_setupSubmenus(){this.menuEl?.querySelectorAll("li").forEach(t=>{if(!t.querySelector(":scope > menu"))return;let e=t.querySelector(":scope > a, :scope > button, :scope > span")??t;e.setAttribute("aria-haspopup","menu"),e.setAttribute("aria-expanded","false")})}_toggleSubmenu(t){let e=!t.classList.contains("open");t.parentElement?.querySelectorAll(":scope > li.open").forEach(i=>{i!==t&&(i.classList.remove("open","submenu-start"),this._syncSubmenuAria(i,!1))}),t.classList.toggle("open",e),e&&this._alignSubmenu(t),this._syncSubmenuAria(t,e)}_syncSubmenuAria(t,e){(t.querySelector(":scope > a, :scope > button, :scope > span")??t).setAttribute("aria-expanded",e?"true":"false")}_alignSubmenu(t){let e=t.querySelector(":scope > menu");if(!e)return;t.classList.remove("submenu-start"),e.getBoundingClientRect().right>window.innerWidth-8&&t.classList.add("submenu-start")}_closeSubmenus(){this.menuEl?.querySelectorAll("li.open").forEach(t=>{t.classList.remove("open","submenu-start"),this._syncSubmenuAria(t,!1)})}_containingSubmenu(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li > menu");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_focusedRow(t){let e=t.target;if(!(e instanceof Element))return null;let i=e.closest("li");return i instanceof HTMLElement&&this.menuEl?.contains(i)?i:null}_resetMenuStyles(){this.menuEl.style.display="",this._resetMenuPositioningStyles(),this.menuEl.style.transform="",this.menuEl.style.opacity=""}_resetMenuPositioningStyles(){this.menuEl.style.width="",this.menuEl.style.height="",this.menuEl.style.left="",this.menuEl.style.top="",this.menuEl.style.transformOrigin=""}_moveMenuToElement(t=null){if(this.options.container){this.options.container.append(this.menuEl);return}if(t){t.contains(this.menuEl)||t.append(this.menuEl);return}this.el.after(this.menuEl)}_makeMenuFocusable(){this.menuEl&&(this.menuEl.popover="",this.menuEl.tabIndex=-1,this.menuEl.querySelectorAll(":scope li, :scope > hr").forEach(t=>{if(t instanceof HTMLHRElement||t.classList.contains("divider")||t.classList.contains("gap")||t.classList.contains("label")||t.classList.contains("optgroup")){t.setAttribute("tabindex","-1");return}t.getAttribute("tabindex")||t.setAttribute("tabindex","0")}))}_focusInitialItem(){if(!this.menuEl||!this.options.autoFocus)return;let t=Array.from(this.menuEl.children).find(e=>e instanceof HTMLElement&&e.tabIndex!==-1);t&&(this.focusedIndex=Array.from(this.menuEl.children).indexOf(t),t.focus({preventScroll:!0}))}_focusFocusedItem(){this.focusedIndex>=0&&this.focusedIndex<this.menuEl.children.length&&this.options.autoFocus&&(this.menuEl.children[this.focusedIndex].focus({preventScroll:!0}),this.menuEl.children[this.focusedIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))}_getMenuPosition(t){let e=this.el.getBoundingClientRect(),i=this.menuEl.getBoundingClientRect(),s=i.height,n=i.width,a=e.left-i.left,l=e.top-i.top,h={left:a,top:l,height:s,width:n},r=c.checkPossibleAlignments(this.el,t,h,this.options.coverTrigger?0:e.height),d="top",f=this.options.alignment;if(l+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,r.top||(r.bottom?(d="bottom",this.options.coverTrigger||(l-=e.height)):(this.isScrollable=!0,s-=20,r.spaceOnTop>r.spaceOnBottom?(d="bottom",s+=r.spaceOnTop,l-=this.options.coverTrigger?r.spaceOnTop-20:r.spaceOnTop-20+e.height):s+=r.spaceOnBottom)),!r[f]){let E=f==="left"?"right":"left";r[E]?f=E:r.spaceOnLeft>r.spaceOnRight?(f="right",n+=r.spaceOnLeft,a-=r.spaceOnLeft):(f="left",n+=r.spaceOnRight)}return d==="bottom"&&(l=l-i.height+(this.options.coverTrigger?e.height:0)),f==="right"&&(a=a-i.width+e.width),{x:a,y:l,verticalAlignment:d,horizontalAlignment:f,height:s,width:n}}_animateIn(){let t=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",setTimeout(()=>{this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),setTimeout(()=>{this._focusInitialItem(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateOut(){let t=this.options.outDuration;this.menuEl.style.transition=`opacity ${t}ms ease, transform ${t}ms ease`,this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",setTimeout(()=>{this._resetMenuStyles(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_getClosestAncestor(t,e){let i=t.parentNode;for(;i!=null&&i!==document;){if(i.nodeType===Node.ELEMENT_NODE&&e(i))return i;i=i.parentNode??i.host}return null}_placeMenu(){let t=this._getClosestAncestor(this.menuEl,a=>!["HTML","BODY"].includes(a.tagName)&&getComputedStyle(a).overflow!=="visible");if(!t){let a=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=a.host??a}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&i>=ft?i:Math.min($t,Math.max(ft,e));this.menuEl.style.width=s+"px";let n=this._getMenuPosition(t);this.menuEl.style.left=n.x+"px",this.menuEl.style.top=n.y+"px",this.menuEl.style.height=n.height+"px",this.menuEl.style.width=n.width+"px",this.menuEl.style.transformOrigin=`${n.horizontalAlignment==="left"?"0":"100%"} ${n.verticalAlignment==="top"?"0":"100%"}`}};S._menus=[];var O=S;var zt={data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(u,o)=>{let t=u.toLocaleLowerCase();o.setMenuItems(o.options.data.filter(e=>e.id.toString().toLocaleLowerCase().includes(t)||e.text?.toLocaleLowerCase().includes(t)))},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},D=class D extends v{constructor(t,e){super(t,e,D);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=t=>{t.type==="keyup"&&(D._keydown=!1),this.count=0;let e=this.el.value.toLocaleLowerCase();t.key===c.keys.ENTER||t.key===c.keys.ARROW_UP||t.key===c.keys.ARROW_DOWN||(this.oldVal!==e&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(e))};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{this.oldVal!==t&&(this._setStatusLoading(),this.options.onSearch(this.el.value,this)),!this.options.isMultiSelect&&this.el.value.length===0&&(this.selectedValues=[],this._triggerChanged()),this.oldVal=t};this._handleInputKeydown=t=>{D._keydown=!0;let e=this.container.querySelectorAll("li").length;if(t.key===c.keys.ENTER&&this.activeIndex>=0){let i=this.container.querySelectorAll("li")[this.activeIndex];i&&(this.selectOption(i.getAttribute("data-id")),t.preventDefault());return}(t.key===c.keys.ARROW_UP||t.key===c.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===c.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===c.keys.ARROW_DOWN&&this.activeIndex<e-1&&this.activeIndex++,this._setActive(null),this.activeIndex>=0&&(this._setActive(this.container.querySelectorAll("li")[this.activeIndex]),this.container.children[this.activeIndex].scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})))};this._handleInputClick=()=>{this.open()};this._handleContainerPointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0))};this._handleContainerPointerUp=()=>{this._pointerDown=!1};this.open=()=>{let t=this.el.value.toLocaleLowerCase();this._resetAutocomplete(),t.length>=this.options.minLength&&(this.isOpen=!0,this._renderMenu()),this.menu.isOpen?this.menu.recalculateDimensions():(this._openTimer!==void 0&&clearTimeout(this._openTimer),this._openTimer=setTimeout(()=>{this._openTimer=void 0,this.menu.open()},0))};this.close=()=>{this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...D.defaults,...e},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.selectedValues||this.options.selected.map(i=>({id:i}))||[],this.menuItems=this.options.data||[],this.$active=null,this._pointerDown=!1,this._setupMenu(),this._setupEventHandlers()}_setActive(t){this.$active?.classList.remove("active"),this.$active=t,t?(t.classList.add("active"),this.el.setAttribute("aria-activedescendant",t.id)):this.el.removeAttribute("aria-activedescendant")}static get defaults(){return zt}static init(t,e={}){return super.init(t,e,D)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!D._loadingTemplate){let t=document.createElement("template");t.innerHTML=`<div style="height:100%;width:50px;"><svg version="1.1" id="L4" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 0 0" xml:space="preserve">
2
2
  <circle fill="#888c" stroke="none" cx="6" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.1"/></circle>
3
3
  <circle fill="#888c" stroke="none" cx="26" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.2"/></circle>
4
4
  <circle fill="#888c" stroke="none" cx="46" cy="50" r="6"><animate attributeName="opacity" dur="1s" values="0;1;0" repeatCount="indefinite" begin="0.3"/></circle>
5
- </svg></div>`,D._loadingTemplate=t.content.firstElementChild}return D._loadingTemplate.cloneNode(!0)}destroy(){this._removeEventHandlers(),this._removeMenu(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("mousedown",this._handleContainerMousedownAndTouchstart),this.container.addEventListener("mouseup",this._handleContainerMouseupAndTouchend),typeof window.ontouchstart<"u"&&(this.container.addEventListener("touchstart",this._handleContainerMousedownAndTouchstart),this.container.addEventListener("touchend",this._handleContainerMouseupAndTouchend))}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("mousedown",this._handleContainerMousedownAndTouchstart),this.container.removeEventListener("mouseup",this._handleContainerMouseupAndTouchend),typeof window.ontouchstart<"u"&&(this.container.removeEventListener("touchstart",this._handleContainerMousedownAndTouchstart),this.container.removeEventListener("touchend",this._handleContainerMouseupAndTouchend))}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${r.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(o=>{let a=this._createMenuItem(o);this.container.append(a)}),this.el.parentElement.appendChild(this.container);let t={...D.defaults.menuOptions,...this.options.menuOptions},e=t.onItemClick;t.onItemClick=o=>{if(!o)return;let a=o.getAttribute("data-id");this.selectOption(a),typeof e=="function"&&e.call(this.menu,o)},this.menu=A.init(this.el,t);let i=this.el.parentElement.querySelector("label");if(i&&this.el.after(i),this.el.removeEventListener("click",this.menu._handleClick),!this.options.isMultiSelect&&this.options.selected.length!==0){let o=this.menuItems.filter(a=>a.id===this.selectedValues[0].id);this.el.value=o[0].text}this.el.value&&this.selectOption(this.el.value);let s=document.createElement("div");s.classList.add("status-info"),s.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(s),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this.$active?.classList.remove("active")}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this.isOpen=!1,this._mousedown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");if(e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=0,this.options.isMultiSelect){let h=document.createElement("div");h.classList.add("item-selection"),h.style.textAlign="center";let d=document.createElement("input");d.type="checkbox",d.checked=this.selectedValues.some(p=>p.id===t.id);let c=document.createElement("span");c.style.paddingLeft="21px",h.append(d,c),e.appendChild(h)}if(t.image){let h=document.createElement("img");h.classList.add("circle"),h.src=t.image,e.appendChild(h)}let i=this.el.value.toLocaleLowerCase(),s=this._highlightPartialText(i,(t.text||t.id).toString()),o=document.createElement("div");if(o.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)o.innerHTML=s[0]+'<span class="highlight">'+s[1]+"</span>"+s[2];else if(o.appendChild(document.createTextNode(s[0])),s[1]){let h=document.createElement("span");h.textContent=s[1],h.classList.add("highlight"),o.appendChild(h),o.appendChild(document.createTextNode(s[2]))}let a=document.createElement("div");if(a.classList.add("item-text"),a.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(a),e.querySelector(".item-text").appendChild(o),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let h=document.createElement("small");h.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),h.innerText=t.description,e.querySelector(".item-text").appendChild(h)}let l=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=l(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this.el.parentElement.querySelector(".status-info");t&&t.replaceChildren(D._loadingIndicator())}_updateSelectedInfo(){let t=this.el.parentElement.querySelector(".status-info");t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change")),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(s=>e.indexOf(s.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this._triggerChanged())}};D._loadingTemplate=null;var B=D;var Wt={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,onChipAdd:null,onChipSelect:null,onChipDelete:null},k=class k extends g{constructor(t,e){super(t,e,k);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=t.target.classList.contains("close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?(this.deleteChip(s),this._input.focus()):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(k._keydown=!0,r.keys.ENTER.includes(t.key)){if(this.hasAutocomplete&&this.autocomplete&&this.autocomplete.isOpen)return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(r.keys.BACKSPACE.includes(t.key)||r.keys.ARROW_LEFT.includes(t.key))&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...k.defaults,...e},this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}static get defaults(){return Wt}static init(t,e={}){return super.init(t,e,k)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),document.addEventListener("keydown",k._handleChipsKeydown),document.addEventListener("keyup",k._handleChipsKeyup),this.el.addEventListener("blur",k._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),document.removeEventListener("keydown",k._handleChipsKeydown),document.removeEventListener("keyup",k._handleChipsKeyup),this.el.removeEventListener("blur",k._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){k._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let o=e.Expressive_Chips;if(o){if(r.keys.BACKSPACE.includes(t.key)||r.keys.DELETE.includes(t.key)){t.preventDefault();let a=o.chipsData.length;if(o._selectedChip){let l=o._chips.indexOf(o._selectedChip);o.deleteChip(l),o._selectedChip=null,a=Math.max(l-1,0)}o.chipsData.length?o.selectChip(a):o._input.focus()}else if(r.keys.ARROW_LEFT.includes(t.key)){if(o._selectedChip){let a=o._chips.indexOf(o._selectedChip)-1;if(a<0)return;o.selectChip(a)}}else if(r.keys.ARROW_RIGHT.includes(t.key)&&o._selectedChip){let a=o._chips.indexOf(o._selectedChip)+1;a>=o.chipsData.length?o._input.focus():o.selectChip(a)}}}static _handleChipsKeyup(){k._keydown=!1}static _handleChipsBlur(t){if(!k._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&(i._selectedChip=null)}}_renderChip(t){if(!t.id)return;let e=document.createElement("div");if(e.classList.add("chip"),e.innerText=t.text||t.id,t.image){let i=document.createElement("img");i.setAttribute("src",t.image),e.insertBefore(i,e.firstChild)}if(this.options.allowUserInput){e.setAttribute("tabindex","0");let i=document.createElement("i");i.classList.add(this.options.closeIconClass,"close"),i.innerText="close",e.appendChild(i)}return e}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{t.length>0&&this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus()},this.autocomplete=B.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",r.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder)}_isValidAndNotExist(t){let e=!!t.id,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input.before(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this._chips[t];e&&(e.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,e))}selectChip(t){let e=this._chips[t];e&&(this._selectedChip=e,e.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){r.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.classList.contains("close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};k._keydown=!1;var W=k;var Ft={},V=class u extends g{constructor(t,e){super(t,e,u);this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangeMousedownTouchstart=t=>{this._mousedown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),t.type!=="input"&&this.thumb.classList.add("active")};this._handleRangeInputMousemoveTouchmove=()=>{this._mousedown&&(this._clampDual(),this._sync(),this.thumb.classList.add("active"))};this._handleRangeMouseupTouchend=()=>{this._mousedown=!1,this.el.classList.remove("active")};this._handleRangeBlurMouseoutTouchleave=()=>{this._mousedown||this.thumb.classList.remove("active")};this.el.Expressive_Range=this,this.options={...u.defaults,...e},this._mousedown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers()}static get defaults(){return Ft}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Range}destroy(){this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Range=void 0}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("mousedown",this._handleRangeMousedownTouchstart),this.el.addEventListener("touchstart",this._handleRangeMousedownTouchstart),this.el.addEventListener("input",this._handleRangeInputMousemoveTouchmove),this.el.addEventListener("mousemove",this._handleRangeInputMousemoveTouchmove),this.el.addEventListener("touchmove",this._handleRangeInputMousemoveTouchmove,{passive:!0}),this.el.addEventListener("mouseup",this._handleRangeMouseupTouchend),this.el.addEventListener("touchend",this._handleRangeMouseupTouchend),this.el.addEventListener("blur",this._handleRangeBlurMouseoutTouchleave),this.el.addEventListener("mouseout",this._handleRangeBlurMouseoutTouchleave),this.el.addEventListener("touchleave",this._handleRangeBlurMouseoutTouchleave)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("mousedown",this._handleRangeMousedownTouchstart),this.el.removeEventListener("touchstart",this._handleRangeMousedownTouchstart),this.el.removeEventListener("input",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("mousemove",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("touchmove",this._handleRangeInputMousemoveTouchmove),this.el.removeEventListener("mouseup",this._handleRangeMouseupTouchend),this.el.removeEventListener("touchend",this._handleRangeMouseupTouchend),this.el.removeEventListener("blur",this._handleRangeBlurMouseoutTouchleave),this.el.removeEventListener("mouseout",this._handleRangeBlurMouseoutTouchleave),this.el.removeEventListener("touchleave",this._handleRangeBlurMouseoutTouchleave)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max)||100,i=parseFloat(t.min)||0,s=parseFloat(t.value)||0;return e===i?0:(s-i)/(e-i)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,o=this.el.offsetWidth,a=this.el.offsetHeight;this.el.style.setProperty("--md-comp-slider-active-fraction",e);let l=this._host(),h=l?.querySelectorAll('input[type="range"]');if(l&&h&&h.length===2){let d=Array.from(h).map(c=>this._fraction(c));l.style.setProperty("--md-comp-slider-start-fraction",`${Math.min(...d)*100}%`),l.style.setProperty("--md-comp-slider-end-fraction",`${Math.max(...d)*100}%`)}if(l?.classList.contains("stops")){let d=parseFloat(this.el.max)||100,c=parseFloat(this.el.min)||0,p=parseFloat(this.el.step);if(p>0&&Number.isFinite(p)){let E=Math.round((d-c)/p)+1;l.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,E)))}}this.value.textContent=this.el.value,this._isVertical()?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${s+(1-t)*a}px`):(this.thumb.style.left=`${i+t*o}px`,this.thumb.style.top=`${s}px`)}static Init(){r.onDocumentReady(()=>{u.init(document.querySelectorAll("input[type=range]"),{})})}};var L=class L{static Init(){r.onDocumentReady(()=>{document.addEventListener("pointerdown",L._onPointerDown,{passive:!0}),document.addEventListener("pointerup",L._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",L._onPointerCancel,{passive:!0})})}static _onPointerDown(n){if(!L._isPrimaryPress(n)){L._down=null;return}let t=L._backdropDialog(n);if(!t||!L._lightDismissible(t)||!L._outside(n,t)){L._down=null;return}L._down={dialog:t,pointerId:n.pointerId}}static _onPointerUp(n){let t=L._down;L._down=null,!(!t||t.pointerId!==n.pointerId)&&n.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||L._lightDismissible(t.dialog)&&L._backdropDialog(n)===t.dialog&&L._outside(n,t.dialog)&&t.dialog.close())}static _onPointerCancel(){L._down=null}static _backdropDialog(n){let t=n.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(n,t){let e=t.getBoundingClientRect();return n.clientX<e.left||n.clientX>e.right||n.clientY<e.top||n.clientY>e.bottom}static _isPrimaryPress(n){return n.isPrimary?n.pointerType!=="mouse"||n.button===0:!1}static _lightDismissible(n){let t=L._closedBy(n);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(n){let t=n.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};L._down=null;var N=L;var w=class w{static Init(){r.onDocumentReady(()=>{document.addEventListener("pointerdown",w._onDown,{passive:!0}),document.addEventListener("pointermove",w._onMove,{passive:!0}),document.addEventListener("pointerup",w._onUp,{passive:!0}),document.addEventListener("pointercancel",w._onCancel,{passive:!0})})}static _onDown(n){if(!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;let t=w._sheet(n.target);if(!t?.open){w._drag=null;return}if(!w._inHandle(n,t)){w._drag=null;return}t.style.transition="none",w._drag={dialog:t,pointerId:n.pointerId,startY:n.clientY,lastY:n.clientY,lastT:Date.now(),shift:0}}static _onMove(n){let t=w._drag;if(!t||t.pointerId!==n.pointerId)return;let e=Math.max(0,n.clientY-t.startY);t.shift=e,t.lastY=n.clientY,t.lastT=Date.now(),t.dialog.style.setProperty("--md-comp-bottom-sheet-shift",`${e}px`)}static _onUp(n){let t=w._drag;if(w._drag=null,!t||t.pointerId!==n.pointerId)return;let e=t.dialog;e.style.transition="";let i=Math.max(1,Date.now()-t.lastT),s=(n.clientY-t.lastY)/i;(t.shift>96||s>.5)&&e.open&&e.close(),e.style.setProperty("--md-comp-bottom-sheet-shift","0px")}static _onCancel(){let n=w._drag;w._drag=null,n&&(n.dialog.style.transition="",n.dialog.style.setProperty("--md-comp-bottom-sheet-shift","0px"))}static _sheet(n){if(!(n instanceof Element))return null;let t=n.closest("dialog.bottom-sheet, dialog.bottom");return t instanceof HTMLDialogElement?t:null}static _inHandle(n,t){let e=n.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return n.clientY>=i.top&&n.clientY<=i.top+48}};w._drag=null;var q=w;var T=class T{static Init(){r.onDocumentReady(()=>{document.addEventListener("pointerdown",T._onDown,{passive:!0}),document.addEventListener("pointermove",T._onMove,{passive:!0}),document.addEventListener("pointerup",T._onUp,{passive:!0}),document.addEventListener("pointercancel",T._onCancel,{passive:!0})})}static _onDown(n){if(!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;let t=T._sheet(n.target);if(!t?.open){T._drag=null;return}if(!T._inHandle(n,t)){T._drag=null;return}t.style.transition="none",T._drag={dialog:t,pointerId:n.pointerId,startX:n.clientX,lastX:n.clientX,lastT:Date.now(),shift:0,startDocked:T._startDocked(t)}}static _onMove(n){let t=T._drag;if(!t||t.pointerId!==n.pointerId)return;let e=n.clientX-t.startX,i=t.startDocked?Math.min(0,e):Math.max(0,e);t.shift=i,t.lastX=n.clientX,t.lastT=Date.now(),t.dialog.style.setProperty("--md-comp-side-sheet-shift",`${i}px`)}static _onUp(n){let t=T._drag;if(T._drag=null,!t||t.pointerId!==n.pointerId)return;let e=t.dialog;e.style.transition="";let i=Math.max(1,Date.now()-t.lastT),s=(n.clientX-t.lastX)/i;(t.startDocked?t.shift<-96||s<-.5:t.shift>96||s>.5)&&e.open&&e.close(),e.style.setProperty("--md-comp-side-sheet-shift","0px")}static _onCancel(){let n=T._drag;T._drag=null,n&&(n.dialog.style.transition="",n.dialog.style.setProperty("--md-comp-side-sheet-shift","0px"))}static _sheet(n){if(!(n instanceof Element))return null;let t=n.closest("dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet");return t instanceof HTMLDialogElement?t:null}static _startDocked(n){return n.classList.contains("left")||n.classList.contains("left-sheet")||n.classList.contains("start")}static _inHandle(n,t){let e=n.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return T._startDocked(t)?n.clientX>=i.right-24&&n.clientX<=i.right:n.clientX>=i.left&&n.clientX<=i.left+24}};T._drag=null;var $=T;var K=class u{static validateField(n){if(!n){console.error("No text field element found");return}let t=n.getAttribute("data-length")!==null,e=parseInt(n.getAttribute("data-length")),i=n.value.length;i===0&&n.validity.badInput===!1&&!n.required&&n.classList.contains("validate")?n.classList.remove("invalid"):n.classList.contains("validate")&&(n.validity.valid&&t&&i<=e||n.validity.valid&&!t?n.classList.remove("invalid"):n.classList.add("invalid"))}static textareaAutoResize(n){let t=n;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){r.onDocumentReady(()=>{document.addEventListener("change",n=>{let t=n.target;t instanceof HTMLInputElement&&u.validateField(t)}),document.addEventListener("keyup",n=>{let t=n.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&r.keys.TAB.includes(n.key)&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(n=>{u.InitTextarea(n)}),document.querySelectorAll('.file-field input[type="file"]').forEach(n=>{u.InitFileInputPath(n)})})}static InitTextarea(n){n.setAttribute("original-height",n.getBoundingClientRect().height.toString()),u.textareaAutoResize(n),n.addEventListener("input",t=>u.textareaAutoResize(t.target))}static InitFileInputPath(n){n.addEventListener("change",()=>{let e=n.closest(".file-field").querySelector("input.file-path"),i=n.files,s=[];for(let o=0;o<i.length;o++)s.push(i[o].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};var Y=class u{static _offset(n){let t=n.getBoundingClientRect(),e=document.documentElement;return{top:t.top+window.pageYOffset-e.clientTop,left:t.left+window.pageXOffset-e.clientLeft}}static renderWaveEffect(n,t=null,e=null){let i=t===null,s=500,o,a,l=function(h){a||(a=h);let d=h-a;if(d<s){let c=d/s*(2-d/s),p=i?"circle at 50% 50%":`circle at ${t.x}px ${t.y}px`,E=`rgba(${e?.r||0}, ${e?.g||0}, ${e?.b||0}, ${.3*(1-c)})`,_=90*c+"%";n.style.backgroundImage="radial-gradient("+p+", "+E+" "+_+", transparent "+_+")",o=window.requestAnimationFrame(l)}else n.style.backgroundImage="none",window.cancelAnimationFrame(o)};o=window.requestAnimationFrame(l)}static Init(){r.onDocumentReady(()=>{document.body.addEventListener("click",n=>{let t=n.target,e=t.closest(".waves-effect");if(e&&e.contains(t)){let i=e.classList.contains("waves-circle"),s=u._offset(e),o=n.pageX-s.left,a=n.pageY-s.top,l=null;e.classList.contains("waves-light")&&(l={r:255,g:255,b:255}),u.renderWaveEffect(e,i?null:{x:o,y:a},l)}})})}};var Vt={direction:"top",hoverEnabled:!0,toolbarEnabled:!1},X=class u extends g{constructor(t,e){super(t,e,u);this.open=()=>{this.isOpen||(this.isOpen=!0,this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{this.isOpen&&(this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown))};this._handleFABClick=t=>{t.stopPropagation(),this._toggle()};this._handleAnchorKeydown=t=>{(r.keys.ENTER.includes(t.key)||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{r.keys.ESC.includes(t.key)&&this.close()};this._handleDocumentClick=t=>{let e=t.target;!(e instanceof Node)||this.el.contains(e)||this.close()};this.el.Expressive_FloatingActionButton=this;let i=this._directionFromClass(),s=t.classList.contains("toolbar")||e.toolbarEnabled===!0,o=t.classList.contains("click-to-toggle")||e.hoverEnabled===!1;this.options={...u.defaults,...e,direction:e.direction??i??u.defaults.direction,hoverEnabled:!o,toolbarEnabled:s},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._menu=this.el.querySelector("ul, menu"),this.el.classList.add(`direction-${this.options.direction}`),o&&this.el.classList.add("click-to-toggle"),s&&this.el.classList.add("toolbar"),this._anchor&&(this._anchor.setAttribute("aria-haspopup","menu"),this._anchor.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.tabIndex<0&&(this._anchor.tabIndex=0)),this._menu&&this._menu.setAttribute("role","menu"),this._setupEventHandlers()}static get defaults(){return Vt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._removeEventHandlers(),this.el.Expressive_FloatingActionButton=void 0}_directionFromClass(){let e=[...this.el.classList].find(i=>i.startsWith("direction-"))?.slice(10);return e==="top"||e==="right"||e==="bottom"||e==="left"?e:null}_setupEventHandlers(){this.el.addEventListener("click",this._handleFABClick),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.addEventListener("keydown",this._handleAnchorKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown)}_toggle(){this.isOpen?this.close():this.open()}};var Nt={duration:200,dist:-100,shift:0,padding:0,numVisible:5,fullWidth:!1,indicators:!1,noWrap:!1,onCycleTo:null},x=class x extends g{constructor(t,e){super(t,e,x);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._trackRaf=null;this._started=!1;this._handleThrottledResize=r.throttle(()=>this._handleResize(),200);this._handleCarouselTap=t=>{if(t.pointerType==="mouse"&&t.button!==0)return;t.target instanceof HTMLElement&&t.target.tagName==="IMG"&&t.preventDefault(),this.pressed=!0,this.dragged=!1,this.verticalDragged=!1,this.reference=t.clientX,this.referenceY=t.clientY,this.velocity=this.amplitude=0,this.frame=this.offset,this.timestamp=Date.now();try{this.el.setPointerCapture(t.pointerId)}catch{}this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf);let e=()=>{this._track(),this.pressed?this._trackRaf=requestAnimationFrame(e):this._trackRaf=null};this._trackRaf=requestAnimationFrame(e)};this._handleCarouselDrag=t=>{if(!this.pressed)return;let e=this.reference-t.clientX;Math.abs(this.referenceY-t.clientY)<30&&!this.verticalDragged?(e>2||e<-2)&&(this.dragged=!0,this.reference=t.clientX,this._scroll(this.offset+e)):this.dragged?t.preventDefault():this.verticalDragged=!0,this.dragged&&t.preventDefault()};this._handleCarouselRelease=t=>{if(this.pressed){this.pressed=!1,this._trackRaf!==null&&(cancelAnimationFrame(this._trackRaf),this._trackRaf=null);try{this.el.releasePointerCapture(t.pointerId)}catch{}this.target=this.offset,(this.velocity>10||this.velocity<-10)&&(this.amplitude=.9*this.velocity,this.target=this.offset+this.amplitude),this.target=Math.round(this.target/this.dim)*this.dim,this.noWrap&&(this.target>=this.dim*(this.count-1)?this.target=this.dim*(this.count-1):this.target<0&&(this.target=0)),this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScroll),this.dragged&&t.preventDefault()}};this._handleCarouselClick=t=>{if(this.dragged){t.preventDefault(),t.stopPropagation();return}let e=t.target.closest(".carousel-item");if(!e||!this.el.contains(e))return;let i=this.images.indexOf(e);this._wrap(this.center)-i!==0&&(t.preventDefault(),t.stopPropagation()),i<0?t.clientX-t.target.getBoundingClientRect().left>this.el.clientWidth/2?this.next():this.prev():this._cycleTo(i)};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{t.target.closest('input, textarea, select, [contenteditable="true"]')||(r.keys.ARROW_RIGHT.includes(t.key)?(t.preventDefault(),this.next()):r.keys.ARROW_LEFT.includes(t.key)&&(t.preventDefault(),this.prev()))};this._handleFlatScroll=()=>{if(this._ignoreScroll)return;let t=this._nearestIndex();t!==this.center&&this._syncActive(t,this.dragged)};this._handleResize=()=>{if(this.images.length){if(this._flat){this._scrollToIndex(this.center,!1);return}if(this.options.fullWidth){let t=this.images[0];if(!t)return;this.itemWidth=t.clientWidth,this.dim=this.itemWidth*2+this.options.padding,this.offset=this.center*2*this.itemWidth,this.target=this.offset}else this._scroll()}};this._track=()=>{let t=Date.now(),e=t-this.timestamp,s=1e3*(this.offset-this.frame)/(1+e);this.timestamp=t,this.frame=this.offset,this.velocity=.8*s+.2*this.velocity};this._autoScroll=()=>{if(!this.amplitude)return;let t=Date.now()-this.timestamp,e=this.amplitude*Math.exp(-t/this.options.duration);e>2||e<-2?(this._scroll(this.target-e),requestAnimationFrame(this._autoScroll)):this._scroll(this.target)};if(this.el.Expressive_Carousel=this,this.options={...x.defaults,...e},this._flat=this.options.fullWidth||this.el.classList.contains("flat"),this._flat&&(this.el.classList.add("flat"),this.options.fullWidth=!0,this.options.dist=0),window.matchMedia("(prefers-reduced-motion: reduce)").matches&&(this.options.duration=1,this._flat||(this.options.dist=0)),this.pressed=!1,this.dragged=!1,this.offset=this.target=0,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.noWrap=this.options.noWrap||!this.hasMultipleSlides||this._flat,this.count=this.images.length,this.options.numVisible=Math.min(this.count,this.options.numVisible),this.images.forEach(s=>s.classList.add("carousel-item")),this._flat&&this._wrapTrack();let i=this.images[0];if(this.itemWidth=i.clientWidth||this.el.clientWidth||1,this.itemHeight=i.clientHeight||this.el.clientHeight||1,this.dim=this.itemWidth*2+this.options.padding||1,this.showIndicators&&this._setupIndicators(),this.el.tabIndex=this.el.tabIndex>=0?this.el.tabIndex:0,this.el.setAttribute("aria-roledescription","carousel"),this._setupEventHandlers(),this._started=!0,this._flat){let s=Math.max(0,this.images.findIndex(o=>o.classList.contains("active")));this.center=s,this._syncActive(s,!1),this._scrollToIndex(s,!1)}else this._scroll(this.offset)}get _scroller(){return this._trackEl??this.el}static get defaults(){return Nt}static init(t,e={}){return super.init(t,e,x)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label","Slides"),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`Slide ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this._flat&&this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){if(this.el.addEventListener("keydown",this._handleKeydown),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),x._live.add(this),x._resizeListening||(window.addEventListener("resize",x._onResize,{passive:!0}),x._resizeListening=!0),this._flat){this._scroller.addEventListener("scroll",this._handleFlatScroll,{passive:!0});return}this.el.addEventListener("pointerdown",this._handleCarouselTap),this.el.addEventListener("pointermove",this._handleCarouselDrag),this.el.addEventListener("pointerup",this._handleCarouselRelease),this.el.addEventListener("pointercancel",this._handleCarouselRelease),this.el.addEventListener("click",this._handleCarouselClick)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleFlatScroll),this.el.removeEventListener("pointerdown",this._handleCarouselTap),this.el.removeEventListener("pointermove",this._handleCarouselDrag),this.el.removeEventListener("pointerup",this._handleCarouselRelease),this.el.removeEventListener("pointercancel",this._handleCarouselRelease),this.el.removeEventListener("click",this._handleCarouselClick),x._live.delete(this),x._live.size===0&&x._resizeListening&&(window.removeEventListener("resize",x._onResize),x._resizeListening=!1)}_teardown(){this._removeEventHandlers(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.transform="",t.style.zIndex="",t.style.opacity="",t.style.visibility=""})}_xpos(t){return"clientX"in t?t.clientX:0}_ypos(t){return"clientY"in t?t.clientY:0}_wrap(t){return t>=this.count?t%this.count:t<0?this._wrap(this.count+t%this.count):t}_scroll(t=0){this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>{this.el.classList.remove("scrolling")},this.options.duration),this.offset=typeof t=="number"?t:this.offset,this.center=Math.floor((this.offset+this.dim/2)/this.dim);let e=this.count>>1,i=this.offset-this.center*this.dim,s=i<0?1:-1,o=-s*i*2/this.dim,a=this.center,l=1/this.options.numVisible,h,d;if(this.options.fullWidth?(h="translateX(0)",d=1):(h="translateX("+(this.el.clientWidth-this.itemWidth)/2+"px) ",h+="translateY("+(this.el.clientHeight-this.itemHeight)/2+"px)",d=1-l*o),this._paintIndicators(this.center),!this.noWrap||this.center>=0&&this.center<this.count){let p=this.images[this._wrap(this.center)];p&&!p.classList.contains("active")&&(this.el.querySelector(".carousel-item.active")?.classList.remove("active"),p.classList.add("active"))}for(let p=1;p<=e;++p){let E,_;if(this.options.fullWidth?(E=this.options.dist,_=p===e&&i<0?1-o:1):(E=this.options.dist*(p*2+o*s),_=1-l*(p*2+o*s)),!this.noWrap||this.center+p<this.count){let M=this.images[this._wrap(this.center+p)],O=`${h} translateX(${this.options.shift+(this.dim*p-i)/2}px) translateZ(${E}px)`;this._updateItemStyle(M,_,-p,O)}if(this.options.fullWidth?(E=this.options.dist,_=p===e&&i>0?1-o:1):(E=this.options.dist*(p*2-o*s),_=1-l*(p*2-o*s)),!this.noWrap||this.center-p>=0){let M=this.images[this._wrap(this.center-p)],O=`${h} translateX(${-this.options.shift+(-this.dim*p-i)/2}px) translateZ(${E}px)`;this._updateItemStyle(M,_,-p,O)}}if(!this.noWrap||this.center>=0&&this.center<this.count){let p=this.images[this._wrap(this.center)],E=`${h} translateX(${-i/2}px) translateX(${s*this.options.shift*o}px) translateZ(${this.options.dist*o}px)`;this._updateItemStyle(p,d,0,E)}let c=this.images[this._wrap(this.center)];this._syncA11y(this._wrap(this.center)),a!==this.center&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,c,this.dragged),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,c,this.dragged),this.oneTimeCallback=null)}_updateItemStyle(t,e,i,s){t&&(t.style.transform=s,t.style.zIndex=i.toString(),t.style.opacity=e.toString(),t.style.visibility="visible")}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let o=s===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncA11y(t){this.images.forEach((e,i)=>{i===t?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden","true")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((o,a)=>o.classList.toggle("active",a===t)),this._paintIndicators(t),this._syncA11y(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this._scroller.scrollLeft,e=0,i=1/0;return this.images.forEach((s,o)=>{let a=Math.abs(s.offsetLeft-t);a<i&&(i=a,e=o)}),e}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;let s=i.offsetLeft;if(Math.abs(this._scroller.scrollLeft-s)<1){this._syncActive(t,!1);return}this._ignoreScroll=!0,this._scroller.scrollTo({left:s,behavior:e?"smooth":"auto"});let o=()=>{this._ignoreScroll=!1};this._scroller.addEventListener("scrollend",o,{once:!0}),window.setTimeout(o,this.options.duration+350)}_cycleTo(t,e=null){if(this._flat){typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t);return}let i=this.center%this.count-t;this.noWrap||(i<0?Math.abs(i+this.count)<Math.abs(i)&&(i+=this.count):i>0&&Math.abs(i-this.count)<i&&(i-=this.count)),this.target=this.dim*Math.round(this.offset/this.dim),i<0?this.target+=this.dim*Math.abs(i):i>0&&(this.target-=this.dim*i),typeof e=="function"&&(this.oneTimeCallback=e),this.offset!==this.target&&(this.amplitude=this.target-this.offset,this.timestamp=Date.now(),requestAnimationFrame(this._autoScroll))}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;if(e>=this.count||e<0){if(this.noWrap)return;e=this._wrap(e)}this._cycleTo(e)}set(t,e){if((t===void 0||isNaN(t))&&(t=0),t>this.count||t<0){if(this.noWrap)return;t=this._wrap(t)}this._cycleTo(t,e)}};x._live=new Set,x._resizeListening=!1,x._onResize=r.throttle(()=>{x._live.forEach(t=>t._handleResize())},200);var F=x;var qt=Object.freeze({}),at=class u extends g{constructor(t,e){super(t,{},u);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...u.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return qt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var $t={classes:"",menuOptions:{}},H=class u extends g{constructor(t,e){super(t,e,u);this._handleSelectChange=()=>{this._setValueToInput()};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...u.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._originalLabelFor=null,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return $t}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){this.menuEl&&(this._rebuildOptions(),this._setValueToInput(),this._setSelectedStates())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(a=>a.optionEl===t);if(!e)return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._setValueToInput();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,this._setupWrapper(),this._hideNativeSelect(),this.el.disabled&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${r.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this.labelEl&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),this.el.before(t),t.appendChild(this.el),this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+r.guid(),this.input.classList.add("menu-trigger"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.el.disabled&&(this.input.disabled=!0),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this.labelEl&&(this._originalLabelFor=this.labelEl.htmlFor,this.labelEl.htmlFor=this.input.id),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.disabled)return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(r.keyDown=!0,this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),r.keyDown=!1,this.menu.isScrollable){let o=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;o-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=o}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=A.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+r.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let o=[];Array.from(t.children).filter(l=>l.tagName==="OPTION").forEach(l=>{let h=this._createAndAppendOptionWithIcon(l,"optgroup-option");o.push(h.id),this._addOptionToValues(l,h)}),i.setAttribute("aria-owns",o.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this.labelEl&&this._originalLabelFor!==null&&(this.labelEl.htmlFor=this._originalLabelFor),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+r.guid(),i.setAttribute("role","option"),i.tabIndex=0,t.disabled&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let s=t.textContent,o=document.createElement("span");if(this.isMultiple&&!t.disabled){let h=document.createElement("label"),d=document.createElement("input");d.type="checkbox",d.tabIndex=-1;let c=document.createElement("span");c.textContent=s,h.append(d,c),o.appendChild(h)}else o.textContent=s;i.appendChild(o);let a=t.getAttribute("data-icon"),l=t.getAttribute("class")?.split(" ").filter(Boolean);if(a){let h=document.createElement("img");l?.length&&h.classList.add(...l),h.src=a,h.ariaHidden="true",i.prepend(h)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return this.getSelectedValues().some(i=>i===t.el.value)}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){let t=this._getSelectedOptions(),s=this._values.filter(o=>t.indexOf(o.el)>=0).filter(o=>!o.el.disabled).map(o=>o.optionEl.querySelector("span").textContent.trim());if(s.length===0){let o=this.el.querySelector("option:disabled");if(o&&o.value===""){this.input.value=o.textContent;return}}this.input.value=s.join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var Kt={margin:5,transition:10,duration:250,align:"left"},U=class u{constructor(n,t,e){this._handleDocumentClick=n=>{this.visible&&this.el!==n.target&&!n.target.closest(".display-docked")&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let n=r._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
5
+ </svg></div>`,D._loadingTemplate=t.content.firstElementChild}return D._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this._removeMenu(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("keyup",this._handleInputKeyup),this.el.addEventListener("focus",this._handleInputFocus),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("click",this._handleInputClick),this.container.addEventListener("pointerdown",this._handleContainerPointerDown),this.container.addEventListener("pointerup",this._handleContainerPointerUp),this.container.addEventListener("pointercancel",this._handleContainerPointerUp)}_removeEventHandlers(){this.el.removeEventListener("blur",this._handleInputBlur),this.el.removeEventListener("keyup",this._handleInputKeyup),this.el.removeEventListener("focus",this._handleInputFocus),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("click",this._handleInputClick),this.container.removeEventListener("pointerdown",this._handleContainerPointerDown),this.container.removeEventListener("pointerup",this._handleContainerPointerUp),this.container.removeEventListener("pointercancel",this._handleContainerPointerUp)}_setupMenu(){this.container=document.createElement("menu"),this.container.style.maxHeight=this.options.maxMenuHeight,this.container.id=`autocomplete-options-${c.guid()}`,this.container.classList.add("autocomplete-content"),this.container.ariaExpanded="true",this.container.setAttribute("role","listbox"),this.el.setAttribute("role","combobox"),this.el.setAttribute("aria-autocomplete","list"),this.el.setAttribute("aria-controls",this.container.id),this.el.setAttribute("data-target",this.container.id),this.menuItems.forEach(n=>{let a=this._createMenuItem(n);this.container.append(a)}),this.el.parentElement.appendChild(this.container);let t={...D.defaults.menuOptions,...this.options.menuOptions},e=t.onItemClick;t.onItemClick=n=>{if(!n)return;let a=n.getAttribute("data-id");this.selectOption(a),typeof e=="function"&&e.call(this.menu,n)},this.menu=O.init(this.el,t);let i=this.el.parentElement.querySelector("label");if(i&&this.el.after(i),this.el.removeEventListener("click",this.menu._handleClick),!this.options.isMultiSelect&&this.options.selected.length!==0){let n=this.menuItems.filter(a=>a.id===this.selectedValues[0].id);this.el.value=n[0].text}this.el.value&&this.selectOption(this.el.value);let s=document.createElement("div");s.classList.add("status-info"),s.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(s),this._updateSelectedInfo()}_removeMenu(){this.container.ariaExpanded="false",this.container.parentNode.removeChild(this.container)}_resetCurrentElementPosition(){this.activeIndex=-1,this._setActive(null)}_resetAutocomplete(){this.container.replaceChildren(),this._resetCurrentElementPosition(),this.oldVal=null,this.isOpen=!1,this._pointerDown=!1}_highlightPartialText(t,e){let i=e.toLocaleLowerCase().indexOf(""+t.toLocaleLowerCase()),s=i+t.length-1;return i==-1||s==-1?[e,"",""]:[e.slice(0,i),e.slice(i,s+1),e.slice(s+1)]}_createMenuItem(t){let e=document.createElement("li");e.id=`autocomplete-option-${c.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(r=>r.id===t.id);if(e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("data-id",t.id),e.setAttribute("style","display:grid; grid-auto-flow: column; user-select: none; align-items: center;"),e.tabIndex=0,this.options.isMultiSelect){let r=document.createElement("div");r.classList.add("item-selection"),r.style.textAlign="center";let d=document.createElement("input");d.type="checkbox",d.checked=i;let f=document.createElement("span");f.style.paddingLeft="21px",r.append(d,f),e.appendChild(r)}if(t.image){let r=document.createElement("img");r.classList.add("circle"),r.src=t.image,e.appendChild(r)}let s=this.el.value.toLocaleLowerCase(),n=this._highlightPartialText(s,(t.text||t.id).toString()),a=document.createElement("div");if(a.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)a.innerHTML=n[0]+'<span class="highlight">'+n[1]+"</span>"+n[2];else if(a.appendChild(document.createTextNode(n[0])),n[1]){let r=document.createElement("span");r.textContent=n[1],r.classList.add("highlight"),a.appendChild(r),a.appendChild(document.createTextNode(n[2]))}let l=document.createElement("div");if(l.classList.add("item-text"),l.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(l),e.querySelector(".item-text").appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let r=document.createElement("small");r.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),r.innerText=t.description,e.querySelector(".item-text").appendChild(r)}let h=()=>this.options.isMultiSelect?t.image?"40px min-content auto":"40px auto":t.image?"min-content auto":"auto";return e.style.gridTemplateColumns=h(),e}_renderMenu(){this._resetAutocomplete(),this.menuItems.length===0&&(this.menuItems=this.selectedValues);for(let t=0;t<this.menuItems.length;t++){let e=this._createMenuItem(this.menuItems[t]);this.container.append(e)}}_setStatusLoading(){let t=this.el.parentElement.querySelector(".status-info");t&&t.replaceChildren(D._loadingIndicator())}_updateSelectedInfo(){let t=this.el.parentElement.querySelector(".status-info");t&&(this.options.isMultiSelect?t.textContent=this.selectedValues.length.toString():t.replaceChildren())}_refreshInputText(){if(this.selectedValues.length===1){let t=this.selectedValues[0];this.el.value=t.text||t.id}}_triggerChanged(){this.el.dispatchEvent(new Event("change")),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(s=>e.indexOf(s.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._triggerChanged()}selectOption(t){let e=this.menuItems.find(i=>i.id==t);e&&(this.options.isMultiSelect?(this.selectedValues.filter(i=>i.id===e.id).length>=1?this.selectedValues=this.selectedValues.filter(i=>i.id!==e.id):this.selectedValues.push(e),this._renderMenu(),this.el.focus()):(this.selectedValues=[e],this._refreshInputText(),this._resetAutocomplete(),this.close()),this._updateSelectedInfo(),this._triggerChanged())}};D._loadingTemplate=null;var P=D;var Ut={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},C=class C extends v{constructor(t,e){super(t,e,C);this._handleChipClick=t=>{let e=t.target.closest(".chip"),i=!!t.target.closest(".close");if(e){let s=this._chips.indexOf(e);if(s<0)return;i?(this.deleteChip(s),this._input.focus()):this.selectChip(s)}else this._input.focus()};this._handleInputFocus=()=>{this.el.classList.add("focus")};this._handleInputBlur=()=>{this.el.classList.remove("focus")};this._handleInputKeydown=t=>{if(C._keydown=!0,t.key===c.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete&&this.autocomplete.isOpen)return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===c.keys.BACKSPACE||t.key===c.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...C.defaults,...e},e?.i18n&&(this.options.i18n={...C.defaults.i18n,...e.i18n}),this.el.classList.add("chips"),this.chipsData=[],this._chips=[],this.options.data.length&&(this.chipsData=this.options.data,this._renderChips()),this.options.allowUserInput&&(this.el.classList.add("field"),this._setupInput(),this._setupEventHandlers(),this.el.append(this._input)),this._setupLabel()}_setSelected(t){this._selectedChip?.classList.remove("selected"),this._selectedChip=t,t?.classList.add("selected")}static get defaults(){return Ut}static init(t,e={}){return super.init(t,e,C)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.options.allowUserInput&&this._removeEventHandlers(),this._chips.forEach(t=>t.remove()),this._chips=[],this.el.Expressive_Chips=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleChipClick),document.addEventListener("keydown",C._handleChipsKeydown),document.addEventListener("keyup",C._handleChipsKeyup),this.el.addEventListener("blur",C._handleChipsBlur,!0),this._input.addEventListener("focus",this._handleInputFocus),this._input.addEventListener("blur",this._handleInputBlur),this._input.addEventListener("keydown",this._handleInputKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleChipClick),document.removeEventListener("keydown",C._handleChipsKeydown),document.removeEventListener("keyup",C._handleChipsKeyup),this.el.removeEventListener("blur",C._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){C._keydown=!0;let e=t.target.closest(".chips"),i=t.target&&e,s=t.target.tagName;if(s==="INPUT"||s==="TEXTAREA"||!i)return;let n=e.Expressive_Chips;if(n){if(t.key===c.keys.BACKSPACE||t.key===c.keys.DELETE){t.preventDefault();let a=n.chipsData.length;if(n._selectedChip){let l=n._chips.indexOf(n._selectedChip);n.deleteChip(l),n._setSelected(null),a=Math.max(l-1,0)}n.chipsData.length?n.selectChip(a):n._input.focus()}else if(t.key===c.keys.ARROW_LEFT){if(n._selectedChip){let a=n._chips.indexOf(n._selectedChip)-1;if(a<0)return;n.selectChip(a)}}else if(t.key===c.keys.ARROW_RIGHT&&n._selectedChip){let a=n._chips.indexOf(n._selectedChip)+1;a>=n.chipsData.length?(n._setSelected(null),n._input.focus()):n.selectChip(a)}}}static _handleChipsKeyup(){C._keydown=!1}static _handleChipsBlur(t){if(!C._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id)return;let e=t.text||t.id,i=document.createElement("span");if(i.classList.add("chip"),i.innerText=e,t.image){let s=document.createElement("img");s.setAttribute("src",t.image),i.insertBefore(s,i.firstChild)}if(this.options.allowUserInput){let s=document.createElement("button");s.type="button",s.classList.add("close"),s.setAttribute("aria-label",`${this.options.i18n.remove} ${e}`);let n=document.createElement("span");n.classList.add(this.options.closeIconClass),n.setAttribute("aria-hidden","true"),n.innerText="close",s.appendChild(n),i.appendChild(s)}return i}_renderChips(){this._chips=[];for(let t=0;t<this.chipsData.length;t++){let e=this._renderChip(this.chipsData[t]);this.el.appendChild(e),this._chips.push(e)}}_setupAutocomplete(){this.options.autocompleteOptions.onAutocomplete=t=>{t.length>0&&this.addChip({id:t[0].id,text:t[0].text,image:t[0].image}),this._input.value="",this._input.focus()},this.autocomplete=P.init(this._input,this.options.autocompleteOptions)}_setupInput(){this._input=this.el.querySelector("input"),this._input||(this._input=document.createElement("input"),this.el.append(this._input)),this._input.classList.add("input"),this.hasAutocomplete=Object.keys(this.options.autocompleteOptions).length>0,this.hasAutocomplete&&this._setupAutocomplete(),this._setPlaceholder(),this._input.getAttribute("id")||this._input.setAttribute("id",c.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this.chipsData!==void 0&&!this.chipsData.length&&this.options.placeholder?this._input.placeholder=this.options.placeholder:(this.chipsData===void 0||this.chipsData.length)&&this.options.secondaryPlaceholder&&(this._input.placeholder=this.options.secondaryPlaceholder)}_isValidAndNotExist(t){let e=!!t.id,i=!this.chipsData.some(s=>s.id==t.id);return e&&i}addChip(t){if(!this._isValidAndNotExist(t)||this.chipsData.length>=this.options.limit)return;let e=this._renderChip(t);this._chips.push(e),this.chipsData.push(t),this._input.before(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this._chips[t];e&&(this._selectedChip===e&&this._setSelected(null),e.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder(),typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,e))}selectChip(t){let e=this._chips[t];e&&(this._setSelected(e),e.querySelector(".close")?.focus(),typeof this.options.onChipSelect=="function"&&this.options.onChipSelect(this.el,e))}static Init(){c.onDocumentReady(()=>{document.querySelectorAll(".chips").forEach(e=>{e.addEventListener("click",i=>{if(!e.Expressive_Chips&&i.target.closest(".close")){let s=i.target.closest(".chip");s&&s.remove()}})})})}};C._keydown=!1;var B=C;var Yt={},W=class u extends v{constructor(t,e){super(t,e,u);this._handleRangeChange=()=>{this._clampDual(),this._sync(),this.thumb.classList.add("active")};this._handleRangePointerDown=t=>{t.isPrimary&&(t.pointerType==="mouse"&&t.button!==0||(this._pointerDown=!0,this.el.classList.add("active"),this._clampDual(),this._sync(),this.thumb.classList.add("active")))};this._handleRangeInputOrMove=()=>{this._pointerDown&&(this._clampDual(),this._sync(),this.thumb.classList.add("active"))};this._handleRangePointerUp=t=>{t.isPrimary&&(this._pointerDown=!1,this.el.classList.remove("active"))};this._handleRangeRelease=()=>{this._pointerDown||this.thumb.classList.remove("active")};this.el.Expressive_Slider=this,this.options={...u.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers()}static get defaults(){return Yt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Slider}destroy(){this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0}_setupEventHandlers(){this.el.addEventListener("change",this._handleRangeChange),this.el.addEventListener("pointerdown",this._handleRangePointerDown),this.el.addEventListener("input",this._handleRangeInputOrMove),this.el.addEventListener("pointermove",this._handleRangeInputOrMove,{passive:!0}),this.el.addEventListener("pointerup",this._handleRangePointerUp),this.el.addEventListener("pointercancel",this._handleRangePointerUp),this.el.addEventListener("blur",this._handleRangeRelease),this.el.addEventListener("mouseout",this._handleRangeRelease)}_removeEventHandlers(){this.el.removeEventListener("change",this._handleRangeChange),this.el.removeEventListener("pointerdown",this._handleRangePointerDown),this.el.removeEventListener("input",this._handleRangeInputOrMove),this.el.removeEventListener("pointermove",this._handleRangeInputOrMove),this.el.removeEventListener("pointerup",this._handleRangePointerUp),this.el.removeEventListener("pointercancel",this._handleRangePointerUp),this.el.removeEventListener("blur",this._handleRangeRelease),this.el.removeEventListener("mouseout",this._handleRangeRelease)}_setupThumb(){this.thumb=document.createElement("span"),this.value=document.createElement("span"),this.thumb.classList.add("thumb"),this.value.classList.add("value"),this.thumb.append(this.value),this.el.after(this.thumb)}_removeThumb(){this.thumb.remove()}_isVertical(){return!!this.el.closest(".vertical")}_host(){return this.el.closest(".slider, .range, .range-field, label")}_clampDual(){let e=this._host()?.querySelectorAll('input[type="range"]');if(!e||e.length!==2)return;let i=e[0],s=e[1];this.el===i&&+i.value>+s.value&&(i.value=s.value),this.el===s&&+s.value<+i.value&&(s.value=i.value)}_fraction(t){let e=parseFloat(t.max)||100,i=parseFloat(t.min)||0,s=parseFloat(t.value)||0;return e===i?0:(s-i)/(e-i)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,n=this.el.offsetWidth,a=this.el.offsetHeight;this.el.style.setProperty("--md-comp-slider-active-fraction",e);let l=this._host(),h=l?.querySelectorAll('input[type="range"]');if(l&&h&&h.length===2){let r=Array.from(h).map(d=>this._fraction(d));l.style.setProperty("--md-comp-slider-start-fraction",`${Math.min(...r)*100}%`),l.style.setProperty("--md-comp-slider-end-fraction",`${Math.max(...r)*100}%`)}if(l?.classList.contains("stops")){let r=parseFloat(this.el.max)||100,d=parseFloat(this.el.min)||0,f=parseFloat(this.el.step);if(f>0&&Number.isFinite(f)){let E=Math.round((r-d)/f)+1;l.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,E)))}}this.value.textContent=this.el.value,this._isVertical()?(this.thumb.style.left=`${i+n/2}px`,this.thumb.style.top=`${s+(1-t)*a}px`):(this.thumb.style.left=`${i+t*n}px`,this.thumb.style.top=`${s}px`)}static Init(){c.onDocumentReady(()=>{u.init(document.querySelectorAll("input[type=range]"),{})})}};var b=class b{static Init(){c.onDocumentReady(()=>{document.addEventListener("pointerdown",b._onPointerDown,{passive:!0}),document.addEventListener("pointerup",b._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",b._onPointerCancel,{passive:!0})})}static _onPointerDown(o){if(!b._isPrimaryPress(o)){b._down=null;return}let t=b._backdropDialog(o);if(!t||!b._lightDismissible(t)||!b._outside(o,t)){b._down=null;return}b._down={dialog:t,pointerId:o.pointerId}}static _onPointerUp(o){let t=b._down;b._down=null,!(!t||t.pointerId!==o.pointerId)&&o.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||b._lightDismissible(t.dialog)&&b._backdropDialog(o)===t.dialog&&b._outside(o,t.dialog)&&t.dialog.close())}static _onPointerCancel(){b._down=null}static _backdropDialog(o){let t=o.target;return!(t instanceof HTMLDialogElement)||!t.open?null:t}static _outside(o,t){let e=t.getBoundingClientRect();return o.clientX<e.left||o.clientX>e.right||o.clientY<e.top||o.clientY>e.bottom}static _isPrimaryPress(o){return o.isPrimary?o.pointerType!=="mouse"||o.button===0:!1}static _lightDismissible(o){let t=b._closedBy(o);return!(t==="none"||t==="closerequest"||t==="any"&&"closedBy"in HTMLDialogElement.prototype)}static _closedBy(o){let t=o.getAttribute("closedby");return t==="any"||t==="closerequest"||t==="none"?t:null}};b._down=null;var q=b;var gt=96,vt=.5,Xt=4;function nt(u){let o=h=>u.axis==="x"?h.clientX:h.clientY,t=null,e=h=>{if(!(h instanceof Element))return null;let r=h.closest(u.selector);return r instanceof HTMLDialogElement?r:null},i=h=>{h.style.transition="",h.style.setProperty(u.property,"0px")},s=h=>{if(u.onPress?.(),!h.isPrimary||h.pointerType==="mouse"&&h.button!==0)return;let r=e(h.target);if(!r?.open){t=null;return}if(!u.inHandle(h,r)){t=null;return}r.style.transition="none",t={dialog:r,pointerId:h.pointerId,direction:u.direction(r),start:o(h),last:o(h),lastT:Date.now(),shift:0}},n=h=>{if(!t||t.pointerId!==h.pointerId)return;let r=o(h)-t.start;t.shift=t.direction===1?Math.max(0,r):Math.min(0,r),t.last=o(h),t.lastT=Date.now(),t.dialog.style.setProperty(u.property,`${t.shift}px`)},a=h=>{let r=t;if(!r||r.pointerId!==h.pointerId)return;t=null,r.dialog.style.transition="";let d=Math.max(1,Date.now()-r.lastT),f=(o(h)-r.last)/d;u.onRelease?.(Math.abs(r.shift)>Xt),(r.direction===1?r.shift>gt||f>vt:r.shift<-gt||f<-vt)&&r.dialog.open&&r.dialog.close(),r.dialog.style.setProperty(u.property,"0px")},l=()=>{u.onRelease?.(!1);let h=t;t=null,h&&i(h.dialog)};c.onDocumentReady(()=>{document.addEventListener("pointerdown",s,{passive:!0}),document.addEventListener("pointermove",n,{passive:!0}),document.addEventListener("pointerup",a,{passive:!0}),document.addEventListener("pointercancel",l,{passive:!0})})}var Et="dialog.bottom-sheet, dialog.bottom",F=class F{static Init(){nt({selector:Et,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest(".handle"))return!0;let i=t.getBoundingClientRect();return o.clientY>=i.top&&o.clientY<=i.top+48},onPress:()=>{F._dragged=!1},onRelease:o=>{F._dragged=o}}),c.onDocumentReady(()=>{document.addEventListener("click",F._onClick)})}static _onClick(o){let t=o.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||o.detail!==0&&F._dragged)return;let i=e.closest(Et);i instanceof HTMLDialogElement&&i.open&&i.close()}};F._dragged=!1;var $=F;var _t=u=>u.classList.contains("left")||u.classList.contains("left-sheet")||u.classList.contains("start"),K=class{static Init(){nt({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:o=>_t(o)?-1:1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return _t(t)?o.clientX>=i.right-24&&o.clientX<=i.right:o.clientX>=i.left&&o.clientX<=i.left+24}})}};var z=class u{static validateField(o){if(!o){console.error("No text field element found");return}let t=o.getAttribute("data-length")!==null,e=parseInt(o.getAttribute("data-length")),i=o.value.length;i===0&&o.validity.badInput===!1&&!o.required&&o.classList.contains("validate")?o.classList.remove("invalid"):o.classList.contains("validate")&&(o.validity.valid&&t&&i<=e||o.validity.valid&&!t?o.classList.remove("invalid"):o.classList.add("invalid"))}static textareaAutoResize(o){let t=o;if(!t)return;t.hasAttribute("original-height")||t.setAttribute("original-height",t.getBoundingClientRect().height.toString());let e=parseInt(t.getAttribute("original-height"));if(isNaN(e))return;t.style.height="auto";let i=t.offsetHeight-t.clientHeight,s=t.scrollHeight+i;t.style.height=Math.max(e,s)+"px"}static Init(){c.onDocumentReady(()=>{document.addEventListener("change",o=>{let t=o.target;t instanceof HTMLInputElement&&u.validateField(t)}),document.addEventListener("keyup",o=>{let t=o.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&o.key===c.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(o=>{u.InitTextarea(o)}),document.querySelectorAll('.file-field input[type="file"]').forEach(o=>{u.InitFileInputPath(o)})})}static InitTextarea(o){o.setAttribute("original-height",o.getBoundingClientRect().height.toString()),u.textareaAutoResize(o),o.addEventListener("input",t=>u.textareaAutoResize(t.target))}static InitFileInputPath(o){o.addEventListener("change",()=>{let e=o.closest(".file-field").querySelector("input.file-path"),i=o.files,s=[];for(let n=0;n<i.length;n++)s.push(i[n].name);e.value=s.join(", "),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))})}};var jt={direction:"top",hoverEnabled:!0,toolbarEnabled:!1},U=class u extends v{constructor(t,e){super(t,e,u);this.open=()=>{this.isOpen||(this.isOpen=!0,this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{this.isOpen&&(this.isOpen=!1,this.el.classList.remove("active"),this._anchor?.setAttribute("aria-expanded","false"),document.removeEventListener("click",this._handleDocumentClick),document.removeEventListener("keydown",this._handleDocumentKeydown))};this._handleFABClick=t=>{t.stopPropagation(),this._toggle()};this._handleAnchorKeydown=t=>{(t.key===c.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===c.keys.ESC&&this.close()};this._handleDocumentClick=t=>{let e=t.target;!(e instanceof Node)||this.el.contains(e)||this.close()};this.el.Expressive_FloatingActionButton=this;let i=this._directionFromClass(),s=t.classList.contains("toolbar")||e.toolbarEnabled===!0,n=t.classList.contains("click-to-toggle")||e.hoverEnabled===!1;this.options={...u.defaults,...e,direction:e.direction??i??u.defaults.direction,hoverEnabled:!n,toolbarEnabled:s},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this.el.classList.add(`direction-${this.options.direction}`),n&&this.el.classList.add("click-to-toggle"),s&&this.el.classList.add("toolbar"),this._anchor&&(this._anchor.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.tabIndex<0&&(this._anchor.tabIndex=0)),this._setupEventHandlers()}static get defaults(){return jt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._removeEventHandlers(),this.el.Expressive_FloatingActionButton=void 0}_directionFromClass(){let e=[...this.el.classList].find(i=>i.startsWith("direction-"))?.slice(10);return e==="top"||e==="right"||e==="bottom"||e==="left"?e:null}_setupEventHandlers(){this.el.addEventListener("click",this._handleFABClick),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&this._anchor.addEventListener("keydown",this._handleAnchorKeydown)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown)}_toggle(){this.isOpen?this.close():this.open()}};var Gt={duration:200,fullWidth:!1,indicators:!1,noWrap:!1,interval:0,height:null,onCycleTo:null,i18n:{carousel:"Carousel",item:"Item",of:"of",indicators:"Slides",slide:"Slide"}},L=class L extends v{constructor(t,e){super(t,e,L);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._usesWindowResize=!1;this._dragPointerId=null;this._dragStartX=0;this._dragStartY=0;this._dragStartScroll=0;this._suppressClick=!1;this._suppressClickTimeout=null;this._generatedContainerRole=!1;this._generatedContainerLabel=!1;this._generatedContainerDescription=!1;this._generatedWideLayout=!1;this._generatedFixedHeight=!1;this._authoredInlineHeight=null;this._autoAdvanceTimer=null;this._autoAdvances=!1;this._autoPaused=!1;this._hovered=!1;this._focused=!1;this._generatedItemTabIndexes=new Set;this._generatedItemLabels=new Set;this._generatedItemDescriptions=new Set;this._generatedItemSizes=new Set;this._authoredItemSizes=new Set;this._itemA11yOriginal=new Map;this._handleThrottledResize=c.throttle(()=>this._handleResize(),200);this._handleAutoAdvanceState=t=>{t.type==="mouseenter"?this._hovered=!0:t.type==="mouseleave"?this._hovered=!1:t.type==="focusin"?this._focused=!0:t.type==="focusout"&&(this._focused=!1),this._syncAutoAdvance()};this._tick=()=>{this._autoAdvanceTimer=null,this._advance(),this._syncAutoAdvance()};this._advance=()=>{let t=this.center+1;if(t<this.count){this.set(t);return}if(this.options.noWrap){this._autoAdvances=!1,this._syncAutoAdvance();return}this.set(0)};this._handleTrackPointerDown=t=>{if(!(t.pointerType!=="mouse"||t.button!==0)){this.pressed=!0,this.dragged=!1,this._suppressClick=!1,this._dragPointerId=t.pointerId,this._dragStartX=t.clientX,this._dragStartY=t.clientY,this._dragStartScroll=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft;try{this._scroller.setPointerCapture(t.pointerId)}catch{}}};this._handleTrackPointerMove=t=>{if(!this.pressed||t.pointerId!==this._dragPointerId)return;let e=t.clientX-this._dragStartX,i=t.clientY-this._dragStartY,s=this._vertical?i:e,n=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(n))return;this.dragged=!0,this.el.classList.add("dragging")}this._vertical?this._scroller.scrollTop=this._dragStartScroll-i:this._scroller.scrollLeft=this._dragStartScroll-e,t.preventDefault()};this._handleTrackPointerUp=t=>{if(!(!this.pressed||t.pointerId!==this._dragPointerId)){this.pressed=!1,this._dragPointerId=null,this.el.classList.remove("dragging");try{this._scroller.releasePointerCapture(t.pointerId)}catch{}this.dragged&&(this._suppressClick=!0,window.clearTimeout(this._suppressClickTimeout),this._suppressClickTimeout=setTimeout(()=>{this._suppressClick=!1},0),this._syncActive(this._nearestIndex(),!0))}};this._handleTrackClick=t=>{this._suppressClick&&(this._suppressClick=!1,t.preventDefault(),t.stopImmediatePropagation())};this._handleTrackDragStart=t=>{t.target.closest("img, picture, video")&&t.preventDefault()};this._handleIndicatorClick=t=>{t.stopPropagation();let e=t.target.closest(".indicator-item");if(!e||!this._indicators.contains(e))return;let i=[...this._indicators.children].indexOf(e);i<0||this._cycleTo(i)};this._handleKeydown=t=>{if(t.target.closest('input, textarea, select, [contenteditable="true"]'))return;let i=this._vertical?t.key==="ArrowDown":t.key===c.keys.ARROW_RIGHT,s=this._vertical?t.key==="ArrowUp":t.key===c.keys.ARROW_LEFT;t.key==="Home"?(t.preventDefault(),this.set(0),this._focusItem(0)):t.key==="End"?(t.preventDefault(),this.set(this.count-1),this._focusItem(this.count-1)):i?(t.preventDefault(),this.next(),this._focusItem(this.center)):s&&(t.preventDefault(),this.prev(),this._focusItem(this.center))};this._handleTrackScroll=()=>{this.el.classList.contains("scrolling")||this.el.classList.add("scrolling"),window.clearTimeout(this.scrollingTimeout),this.scrollingTimeout=setTimeout(()=>this.el.classList.remove("scrolling"),120),this._trackRaf===null&&(this._trackRaf=requestAnimationFrame(()=>{if(this._trackRaf=null,this._updateParallax(),this._ignoreScroll)return;let t=this._nearestIndex();t!==this.center&&this._syncActive(t,this.dragged)}))};this._handleResize=()=>{this.images.length&&(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this._scrollToIndex(this.center,!1),this._updateParallax())};this.el.Expressive_Carousel=this,this.options={...L.defaults,...e},e?.i18n&&(this.options.i18n={...L.defaults.i18n,...e.i18n}),(this.options.fullWidth||this.el.classList.contains("flat"))&&(this.el.classList.add("flat"),this.options.fullWidth=!0),this._vertical=this.el.classList.contains("full-screen");let i=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(i&&(this.options.duration=1),this.pressed=!1,this.dragged=!1,this.images=this._collectItems(),!this.images.length){console.error("Carousel: no .carousel-item elements to show");return}this.images.forEach(n=>{this._itemA11yOriginal.set(n,{ariaHidden:n.getAttribute("aria-hidden"),tabIndex:n.getAttribute("tabindex")}),n.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(n)}),this.hasMultipleSlides=this.images.length>1,this.showIndicators=this.options.indicators&&this.hasMultipleSlides,this.count=this.images.length,this._autoAdvances=this.options.interval>0&&this.hasMultipleSlides&&!i,this.images.forEach(n=>n.classList.add("carousel-item")),this.options.height!==null&&(this._generatedFixedHeight=!this.el.classList.contains("fixed-height"),this._authoredInlineHeight=this.el.style.getPropertyValue("--carousel-height")||null,this.el.classList.add("fixed-height"),this.el.style.setProperty("--carousel-height",`${this.options.height}px`)),this._wrapTrack(),this._syncAdaptiveMode(),this.showIndicators&&this._setupIndicators(),this._setupAccessibility(),this._setupEventHandlers(),this._started=!0;let s=Math.max(0,this.images.findIndex(n=>n.classList.contains("active")));this.center=s,this._syncActive(s,!1),this._updateParallax(),this._scrollToIndex(s,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return Gt}static init(t,e={}){return super.init(t,e,L)}static getInstance(t){return t.Expressive_Carousel}destroy(){this._started&&this._teardown(),this.el.Expressive_Carousel=void 0}_collectItems(){let t=Array.from(this.el.children).filter(e=>e instanceof HTMLElement&&e.classList.contains("carousel-item"));return t.length?t:Array.from(this.el.children).filter(e=>!(e instanceof HTMLElement)||e.classList.contains("indicators")||e.classList.contains("carousel-fixed-item")?!1:e.tagName!=="NAV")}_setupAccessibility(){this.el.hasAttribute("role")||(this.el.setAttribute("role","region"),this._generatedContainerRole=!0),!this.el.hasAttribute("aria-label")&&!this.el.hasAttribute("aria-labelledby")&&(this.el.setAttribute("aria-label",this.options.i18n.carousel),this._generatedContainerLabel=!0),this.el.hasAttribute("aria-roledescription")||(this.el.setAttribute("aria-roledescription","carousel"),this._generatedContainerDescription=!0);let t='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';this.images.forEach((e,i)=>{if(e.hasAttribute("aria-roledescription")||(e.setAttribute("aria-roledescription","slide"),this._generatedItemDescriptions.add(e)),!e.hasAttribute("aria-label")&&!e.hasAttribute("aria-labelledby")){let s=e.querySelector("img[alt]")?.getAttribute("alt")?.trim(),n=e.textContent?.replace(/\s+/g," ").trim(),a=s||n,l=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",a?`${a}, ${l}`:l),this._generatedItemLabels.add(e)}!e.matches(t)&&!e.querySelector(t)&&(e.tabIndex=0,this._generatedItemTabIndexes.add(e))})}_setupIndicators(){let t=Array.from(this.el.children).find(e=>e instanceof HTMLElement&&e.classList.contains("indicators"));this._indicators=t??document.createElement("nav"),this._ownIndicators=!t,this._indicators.classList.add("indicators"),this._indicators.setAttribute("aria-label",this.options.i18n.indicators),this._indicators.replaceChildren(),this.images.forEach((e,i)=>{let s=document.createElement("button");s.type="button",s.classList.add("indicator-item"),i===0&&(s.classList.add("active"),s.setAttribute("aria-current","true")),s.setAttribute("aria-label",`${this.options.i18n.slide} ${i+1}`),this._indicators.appendChild(s)}),this._ownIndicators&&this.el.appendChild(this._indicators),this.el.querySelector(".carousel-fixed-item")?.classList.add("with-indicators")}_setupEventHandlers(){this.el.addEventListener("keydown",this._handleKeydown),this._autoAdvances&&(this.el.addEventListener("mouseenter",this._handleAutoAdvanceState),this.el.addEventListener("mouseleave",this._handleAutoAdvanceState),this.el.addEventListener("focusin",this._handleAutoAdvanceState),this.el.addEventListener("focusout",this._handleAutoAdvanceState),document.addEventListener("visibilitychange",this._handleAutoAdvanceState)),this.showIndicators&&this._indicators&&this._indicators.addEventListener("click",this._handleIndicatorClick),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._handleThrottledResize()),this._resizeObserver.observe(this.el)),this._usesWindowResize=!this._resizeObserver||this.el.classList.contains("full-screen"),this._usesWindowResize&&(L._live.add(this),L._resizeListening||(window.addEventListener("resize",L._onResize,{passive:!0}),L._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("pointermove",this._handleTrackPointerMove),this._scroller.addEventListener("pointerup",this._handleTrackPointerUp),this._scroller.addEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this.el.removeEventListener("mouseenter",this._handleAutoAdvanceState),this.el.removeEventListener("mouseleave",this._handleAutoAdvanceState),this.el.removeEventListener("focusin",this._handleAutoAdvanceState),this.el.removeEventListener("focusout",this._handleAutoAdvanceState),document.removeEventListener("visibilitychange",this._handleAutoAdvanceState),this._indicators&&this._indicators.removeEventListener("click",this._handleIndicatorClick),this._scroller.removeEventListener("scroll",this._handleTrackScroll),this._scroller.removeEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.removeEventListener("pointermove",this._handleTrackPointerMove),this._scroller.removeEventListener("pointerup",this._handleTrackPointerUp),this._scroller.removeEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(L._live.delete(this),L._live.size===0&&L._resizeListening&&(window.removeEventListener("resize",L._onResize),L._resizeListening=!1))}_teardown(){this._removeEventHandlers(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),this._ownIndicators&&this._indicators?.remove(),this._unwrapTrack(),this.images.forEach(t=>{t.style.removeProperty("--md-comp-carousel-item-parallax"),this._generatedItemLabels.has(t)&&t.removeAttribute("aria-label"),this._generatedItemDescriptions.has(t)&&t.removeAttribute("aria-roledescription"),this._generatedItemSizes.has(t)&&t.removeAttribute("data-carousel-size");let e=this._itemA11yOriginal.get(t);e?.ariaHidden===null?t.removeAttribute("aria-hidden"):e&&t.setAttribute("aria-hidden",e.ariaHidden),e?.tabIndex===null?t.removeAttribute("tabindex"):e&&t.setAttribute("tabindex",e.tabIndex)}),this._generatedContainerRole&&this.el.removeAttribute("role"),this._generatedContainerLabel&&this.el.removeAttribute("aria-label"),this._generatedContainerDescription&&this.el.removeAttribute("aria-roledescription"),this._generatedFixedHeight&&this.el.classList.remove("fixed-height"),this.options.height!==null&&(this._authoredInlineHeight===null?this.el.style.removeProperty("--carousel-height"):this.el.style.setProperty("--carousel-height",this._authoredInlineHeight)),this._generatedWideLayout&&this.el.classList.remove("multi-wide","multi-large","multi-extra-large","full-screen-horizontal")}_syncAutoAdvance(){let t=this._autoAdvances&&!this._autoPaused&&!this._hovered&&!this._focused&&!document.hidden;t&&this._autoAdvanceTimer===null?this._autoAdvanceTimer=setTimeout(this._tick,this.options.duration+this.options.interval):!t&&this._autoAdvanceTimer!==null&&(clearTimeout(this._autoAdvanceTimer),this._autoAdvanceTimer=null)}_paintIndicators(t){if(!this.showIndicators||!this._indicators)return;let e=(t%this.count+this.count)%this.count;this._indicators.querySelectorAll(".indicator-item").forEach((i,s)=>{let n=s===e;i.classList.toggle("active",n),n?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((n,a)=>n.classList.toggle("active",a===t)),this._paintIndicators(t),this._syncLayoutRoles(t);let s=this.images[t];i!==t&&typeof this.options.onCycleTo=="function"&&this.options.onCycleTo.call(this,s,e),typeof this.oneTimeCallback=="function"&&(this.oneTimeCallback.call(this,s,e),this.oneTimeCallback=null)}_syncLayoutRoles(t){let e=(h,r)=>{this._authoredItemSizes.has(h)||(h.setAttribute("data-carousel-size",r),this._generatedItemSizes.add(h))};if(this.images.forEach(h=>e(h,"large")),this.el.classList.contains("flat")||this.el.classList.contains("uncontained")||this.el.classList.contains("full-screen")&&this._vertical)return;if(this.el.classList.contains("hero")||this.el.classList.contains("full-screen-horizontal")){let h=this.images[t+1];if(h&&e(h,"small"),this.el.classList.contains("center-aligned")){let r=this.images[t-1];r&&e(r,"small")}return}let i=this.el.clientWidth,s=i>=1600?4:i>=1200?3:i>=600?2:1,n=Math.min(s,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),n===2?this.el.classList.add("multi-wide"):n===3?this.el.classList.add("multi-large"):n>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||n>1;for(let h=1;h<n;h+=1){let r=this.images[t+h];r&&e(r,"large")}let a=this.images[t+n],l=this.images[t+n+1];a&&e(a,"medium"),l&&e(l,"small")}_syncAdaptiveMode(){if(!this.el.classList.contains("full-screen"))return;let t=window.matchMedia("(orientation: landscape)").matches,e=this.el.clientWidth>=840||t,i=this._vertical;this._vertical=!e,this.el.classList.toggle("full-screen-horizontal",e),this._generatedWideLayout=this._generatedWideLayout||e,this._started&&i!==this._vertical&&this._scroller.scrollTo({left:0,top:0,behavior:"auto"})}_focusItem(t){let e=this.images[t];if(!e)return;((e.matches('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')?e:e.querySelector('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??e).focus({preventScroll:!0})}_updateParallax(){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){this.images.forEach(s=>s.style.setProperty("--md-comp-carousel-item-parallax","0px"));return}let t=this._scroller.getBoundingClientRect(),e=this._vertical?t.top+t.height/2:t.left+t.width/2,i=Math.max(1,this._vertical?t.height:t.width);this.images.forEach(s=>{let n=s.getBoundingClientRect(),a=this._vertical?n.top+n.height/2:n.left+n.width/2,l=Math.max(-1,Math.min(1,(a-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${l*-24}px`)})}_wrapTrack(){let t=document.createElement("div");t.className="carousel-track",this.images[0].before(t),this.images.forEach(e=>t.appendChild(e)),this._trackEl=t}_unwrapTrack(){this._trackEl&&(this.images.forEach(t=>this.el.insertBefore(t,this._trackEl)),this._trackEl.remove(),this._trackEl=null)}_nearestIndex(){let t=this.el.classList.contains("center-aligned"),e=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,i=e+(this._vertical?this._scroller.clientHeight:this._scroller.clientWidth)/2,s=0,n=1/0;return this.images.forEach((a,l)=>{let h=this._vertical?a.offsetTop:a.offsetLeft,r=this._vertical?a.offsetHeight:a.offsetWidth,d=t?h+r/2:h,f=Math.abs(d-(t?i:e));f<n&&(n=f,s=l)}),s}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;let s=this.el.classList.contains("center-aligned"),n=getComputedStyle(this._scroller),a=Number.parseFloat(n.paddingInlineStart)||0,l=Number.parseFloat(n.paddingBlockStart)||0,h=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:i.offsetLeft-a,r=i.offsetTop-l,d=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,f=this._vertical?r:h;if(Math.abs(d-f)<1){this._syncActive(t,!1);return}this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:h,top:this._vertical?r:0,behavior:e?"smooth":"auto"});let E=()=>{this._ignoreScroll=!1};this._scroller.addEventListener("scrollend",E,{once:!0}),window.setTimeout(E,this.options.duration+350)}_cycleTo(t,e=null){typeof e=="function"&&(this.oneTimeCallback=e),this._syncActive(t,!1),this._scrollToIndex(t)}pause(){this._autoPaused=!0,this._syncAutoAdvance()}start(){this._autoPaused=!1,this._syncAutoAdvance()}next(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center+t;e>=this.count||e<0||this._cycleTo(e)}prev(t=1){(t===void 0||isNaN(t))&&(t=1);let e=this.center-t;e>=this.count||e<0||this._cycleTo(e)}set(t,e){(t===void 0||isNaN(t))&&(t=0),!(t>=this.count||t<0)&&this._cycleTo(t,e)}};L._live=new Set,L._resizeListening=!1,L._onResize=c.throttle(()=>{L._live.forEach(t=>t._handleResize())},200);var N=L;var Zt=Object.freeze({}),ot=class u extends v{constructor(t,e){super(t,{},u);this.updateCounter=()=>{let t=parseInt(this.el.getAttribute("maxlength")),e=this.el.value.length;this.isValidLength=e<=t;let i=e.toString();t&&(i+="/"+t,this._validateInput()),this.counterEl.textContent=i};this.el.Expressive_CharacterCounter=this,this.options={...u.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return Zt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_CharacterCounter}destroy(){this._removeEventHandlers(),this.el.Expressive_CharacterCounter=void 0,this._removeCounter()}_setupEventHandlers(){this.el.addEventListener("focus",this.updateCounter,!0),this.el.addEventListener("input",this.updateCounter,!0)}_removeEventHandlers(){this.el.removeEventListener("focus",this.updateCounter,!0),this.el.removeEventListener("input",this.updateCounter,!0)}_setupCounter(){this.counterEl=document.createElement("span"),this.counterEl.classList.add("character-counter"),this.counterEl.setAttribute("aria-live","polite"),this.counterEl.setAttribute("aria-atomic","true"),this.counterEl.style.float="right",this.counterEl.style.fontSize="12px",this.counterEl.style.height="1",this.el.parentElement.appendChild(this.counterEl)}_removeCounter(){this.counterEl.remove()}_validateInput(){this.isValidLength&&this.isInvalid?(this.isInvalid=!1,this.el.classList.remove("invalid")):!this.isValidLength&&!this.isInvalid&&(this.isInvalid=!0,this.el.classList.remove("valid"),this.el.classList.add("invalid"))}};var Qt={classes:"",menuOptions:{}},w=class u extends v{constructor(t,e){super(t,e,u);this._handleSelectChange=()=>{this._setValueToInput()};this._handleOptionKeydown=t=>{(t.key===" "||t.key==="Enter")&&this._handleOptionClick(t)};this._handleOptionClick=t=>{t.preventDefault();let e=t.target.closest("li");this._selectOptionElement(e),t.stopPropagation()};this._handleOptionFocus=t=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest('li[role="option"]');i?.id&&this.input.setAttribute("aria-activedescendant",i.id)};this._handleInputClick=()=>{this.menu&&this.menu.isOpen&&(this._setValueToInput(),this._setSelectedStates())};!this.el.classList.contains("browser-default")&&(this.el.Expressive_FormSelect=this,this.options={...u.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._originalLabelFor=null,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return Qt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){this.menuEl&&(this._rebuildOptions(),this._setValueToInput(),this._setSelectedStates())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus)}_setupOptionHandlers(){this.menuEl.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.addEventListener("click",this._handleOptionClick),t.addEventListener("keydown",this._handleOptionKeydown)})}_removeOptionHandlers(){this.menuEl?.querySelectorAll("li:not(.optgroup)").forEach(t=>{t.removeEventListener("click",this._handleOptionClick),t.removeEventListener("keydown",this._handleOptionKeydown)})}_arraysEqual(t,e){if(t===e)return!0;if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}_selectOptionElement(t){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(a=>a.optionEl===t);if(!e)return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._setValueToInput();let s=this.getSelectedValues();!this._arraysEqual(i,s)&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))}this.isMultiple||this.menu?.close()}_setupMenu(){this.labelEl=this.el.labels?.[0]??null,this._setupWrapper(),this._hideNativeSelect(),this.el.disabled&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${c.guid()}`,this.menuEl.setAttribute("popover","auto"),this.menuEl.setAttribute("role","listbox"),this.menuEl.ariaMultiSelectable=this.isMultiple.toString(),this.isMultiple&&this.menuEl.classList.add("multiple-select-menu"),this._buildOptions(),this.wrapper.append(this.menuEl),this._buildInput(),this._buildCaret(),this._initMenu(),this._setSelectedStates(),this.labelEl&&this.input.after(this.labelEl)}_setupWrapper(){let t=this.el.parentElement;t&&t.matches(".field")&&!t.querySelector(":scope > .hide-select")&&!t.querySelector(":scope > input, :scope > textarea")?(this.wrapper=t,this._createdWrapper=!1):(this.wrapper=document.createElement("div"),this.wrapper.classList.add("field"),this._createdWrapper=!0,this.el.before(this.wrapper)),this.options.classes.length>0&&this.wrapper.classList.add(...this.options.classes.split(" ").filter(Boolean))}_hideNativeSelect(){let t=document.createElement("div");t.classList.add("hide-select"),this.el.before(t),t.appendChild(this.el),this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+c.guid(),this.input.classList.add("menu-trigger"),this.input.type="text",this.input.readOnly=!0,this.input.setAttribute("data-target",this.menuEl.id),this.input.ariaReadOnly="true",this.input.ariaRequired=this.el.hasAttribute("required").toString(),this.el.disabled&&(this.input.disabled=!0),this.input.setAttribute("tabindex",this.nativeTabIndex.toString());let t=this.el.attributes;for(let e=0;e<t.length;++e){let i=t[e];i.name.startsWith("aria-")&&this.input.setAttribute(i.name,i.value)}this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-haspopup","listbox"),this.input.ariaExpanded="false",this.input.setAttribute("aria-controls",this.menuEl.id),this.input.placeholder=" ",this.labelEl&&(this._originalLabelFor=this.labelEl.htmlFor,this.labelEl.htmlFor=this.input.id),this.wrapper.prepend(this.input),this._setValueToInput()}_buildCaret(){let t=document.createElement("span");t.classList.add("caret"),t.setAttribute("aria-hidden","true"),this.wrapper.prepend(t)}_initMenu(){if(this.el.disabled)return;let t={...this.options.menuOptions};t.coverTrigger=!1;let e=t.onOpenEnd,i=t.onCloseEnd;t.onOpenEnd=()=>{let s=this.menuEl.querySelector(".selected");if(s){if(this.menu.focusedIndex=[...s.parentNode.children].indexOf(s),this.menu._focusFocusedItem(),this.menu.isScrollable){let n=s.getBoundingClientRect().top-this.menuEl.getBoundingClientRect().top;n-=this.menuEl.clientHeight/2,this.menuEl.scrollTop=n}s.id&&this.input.setAttribute("aria-activedescendant",s.id)}this.input.ariaExpanded="true",e&&typeof e=="function"&&e.call(this.menu,this.el)},t.onCloseEnd=()=>{this.input.ariaExpanded="false",this.input.removeAttribute("aria-activedescendant"),i&&typeof i=="function"&&i.call(this.menu,this.el)},t.closeOnClick=!1,this.menu=O.init(this.input,t)}_nativeOptions(){return Array.from(this.el.children).filter(t=>["OPTION","OPTGROUP"].includes(t.tagName))}_buildOptions(){this.selectOptions=this._nativeOptions(),this._values=[],this.selectOptions.forEach(t=>{if(t.tagName==="OPTION"){let e=this._createAndAppendOptionWithIcon(t,this.isMultiple?"multiple":void 0);this._addOptionToValues(t,e)}else if(t.tagName==="OPTGROUP"){let e="opt-group-"+c.guid(),i=document.createElement("li");i.classList.add("optgroup"),i.tabIndex=-1,i.setAttribute("role","group"),i.setAttribute("aria-labelledby",e);let s=document.createElement("span");s.id=e,s.setAttribute("role","presentation"),s.textContent=t.getAttribute("label")??"",i.replaceChildren(s),this.menuEl.append(i);let n=[];Array.from(t.children).filter(l=>l.tagName==="OPTION").forEach(l=>{let h=this._createAndAppendOptionWithIcon(l,"optgroup-option");n.push(h.id),this._addOptionToValues(l,h)}),i.setAttribute("aria-owns",n.join(" "))}})}_rebuildOptions(){this._removeOptionHandlers(),this.menuEl.replaceChildren(),this._buildOptions(),this._setupOptionHandlers(),this.menu?._makeMenuFocusable()}_addOptionToValues(t,e){this._values.push({el:t,optionEl:e})}_removeMenu(){this.wrapper?.querySelector(":scope > .caret")?.remove(),this.input?.remove(),this.menuEl?.remove();let t=this.el.parentElement;t?.classList.contains("hide-select")&&t.replaceWith(this.el),this.labelEl&&this._originalLabelFor!==null&&(this.labelEl.htmlFor=this._originalLabelFor),this.wrapper&&(this._createdWrapper?this.wrapper.replaceWith(this.el):(this.wrapper.classList.remove("disabled"),this.options.classes.length>0&&this.wrapper.classList.remove(...this.options.classes.split(" ").filter(Boolean))))}_createAndAppendOptionWithIcon(t,e){let i=document.createElement("li");i.id="select-option-"+c.guid(),i.setAttribute("role","option"),i.tabIndex=0,t.disabled&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let s=t.textContent,n=document.createElement("span");if(this.isMultiple&&!t.disabled){let h=document.createElement("label"),r=document.createElement("input");r.type="checkbox",r.tabIndex=-1;let d=document.createElement("span");d.textContent=s,h.append(r,d),n.appendChild(h)}else n.textContent=s;i.appendChild(n);let a=t.getAttribute("data-icon"),l=t.getAttribute("class")?.split(" ").filter(Boolean);if(a){let h=document.createElement("img");l?.length&&h.classList.add(...l),h.src=a,h.ariaHidden="true",i.prepend(h)}return this.menuEl.append(i),i}_selectValue(t){t.el.selected=!0,t.optionEl.classList.add("selected"),t.optionEl.ariaSelected="true";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!0)}_deselectValue(t){t.el.selected=!1,t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false";let e=t.optionEl.querySelector('input[type="checkbox"]');e&&(e.checked=!1)}_deselectAll(){this._values.forEach(t=>this._deselectValue(t))}_isValueSelected(t){return this.getSelectedValues().some(i=>i===t.el.value)}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){let t=this._getSelectedOptions(),s=this._values.filter(n=>t.indexOf(n.el)>=0).filter(n=>!n.el.disabled).map(n=>n.optionEl.querySelector("span").textContent.trim());if(s.length===0){let n=this.el.querySelector("option:disabled");if(n&&n.value===""){this.input.value=n.textContent;return}}this.input.value=s.join(", ")}_setSelectedStates(){this._values.forEach(t=>{let e=t.el.selected,i=t.optionEl.querySelector('input[type="checkbox"]');i&&(i.checked=e),e?this._activateOption(this.menuEl,t.optionEl):(t.optionEl.classList.remove("selected"),t.optionEl.ariaSelected="false")})}_activateOption(t,e){e&&(this.isMultiple||t.querySelectorAll("li.selected").forEach(i=>i.classList.remove("selected")),e.classList.add("selected"),e.ariaSelected="true")}getSelectedValues(){return this._getSelectedOptions().map(t=>t.value)}};var Jt={margin:5,transition:10,duration:250,align:"left"},Y=class u{constructor(o,t,e){this._handleDocumentClick=o=>{this.visible&&this.el!==o.target&&!o.target.closest(".display-docked")&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let o=c._setAbsolutePosition(this.el,this.container,"bottom",this.options.margin,this.options.transition,this.options.align);this.container.style.visibility="visible",this.container.style.transition=`
6
6
  transform ${this.options.duration}ms ease-out,
7
- opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${n.x}px) translateY(${n.y}px)`,this.container.style.opacity="1"},1)};this.hide=()=>{this.visible&&(this.visible=!1,this.container.removeAttribute("style"),this.container.style.transition=`
7
+ opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform=`translateX(${o.x}px) translateY(${o.y}px)`,this.container.style.opacity="1"},1)};this.hide=()=>{this.visible&&(this.visible=!1,this.container.removeAttribute("style"),this.container.style.transition=`
8
8
  transform ${this.options.duration}ms ease-out,
9
- opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=n,this.options={...Kt,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),n.parentElement.append(this.container),document.addEventListener("click",this._handleDocumentClick)}static init(n,t,e){return new u(n,t,e)}};var Yt={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},f=class f extends g{constructor(t,e){super(t,e,f);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._handleInputClick=t=>{t.type=="date"&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{r.keys.ENTER.includes(t.key)&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!f._compareDates(t,this.endDate)){if(f._isDate(this.date)&&f._comparePastDate(t,this.date))return;this.setDate(t,!1,f._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{let e,i=t.target;t.detail?.firedBy!==this&&(i==this.endDateEl&&!this.date||(this.options.parse?e=this.options.parse(t.target.value,typeof this.options.format=="function"?this.options.format(new Date(this.el.value)):this.options.format):e=new Date(Date.parse(t.target.value)),f._isDate(e)&&(this.setDate(e,!1,i==this.endDateEl,!0),t.type=="date"&&(this.setDataDate(t,e),this.setInputValues()))))};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={...f.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...f.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=r.guid(),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=new Date(Date.parse(this.el.value)));let i=this.options.defaultDate;if(f._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;f._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[],this.dateEls.push(t)),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=U.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return Yt}static init(t,e={}){return super.init(t,e,f)}static _escape(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){f._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,f._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&H.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&H.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),r.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||r.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):f._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){let e=new Date(Date.parse(t.value));this.setDate(e,!1,t==this.endDateEl,!0)}setDate(t=null,e=!1,i=!1,s=!1){let o=this.validateDate(t);o&&(this.options.isMultipleSelection?s||this.setMultiDate(o):this.setSingleDate(o,i),f._setToStartOfDay(o),this.gotoDate(o),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,o))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!f._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return f._isDate(e)&&t<e?t=e:f._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",this.toString(e))}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){Array.from(this.dateEls).filter((e,i)=>{if(i>this.dates.length-1)return e}).forEach(e=>{e.remove()}),this.dates.forEach((e,i)=>{if(Array.from(this.dateEls)[i]){this.setInputValue(this.dateEls[i],e);return}let s=this.createDateInput();this.setInputValue(s,e),this.dateEls.push(s)})}setInputValue(t,e){t.type=="date"?(this.setDataDate(t,e),t.value=this.formatDate(e,"yyyy-mm-dd")):t.value=this.toString(e),this.el.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}}))}_renderDateDisplay(t,e=null){let i=f._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=f._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(f._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),o=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=o<i.getTime()||s.getTime()<o}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,o=f._getDaysInMonth(t,e),a=[],l=new Date(t,e,1).getDay(),h=[];f._setToStartOfDay(s),this.options.firstDay>0&&(l-=this.options.firstDay,l<0&&(l+=7));let d=e===0?11:e-1,c=e===11?0:e+1,p=e===0?t-1:t,E=e===11?t+1:t,_=f._getDaysInMonth(p,d),M=o+l,O=M;for(;O>7;)O-=7;M+=7-O;let st=!1;for(let S=0,ht=0;S<M;S++){let C=new Date(t,e,1+(S-l)),Et=f._compareDates(C,s),_t=this.options.events.indexOf(C.toDateString())!==-1,mt=S<l||S>=o+l,yt=this.options.startRange&&f._compareDates(this.options.startRange,C),bt=this.options.endRange&&f._compareDates(this.options.endRange,C),Lt=this.options.startRange&&this.options.endRange&&this.options.startRange<C&&C<this.options.endRange,Tt=this.options.minDate&&C<this.options.minDate||this.options.maxDate&&C>this.options.maxDate||this.options.disableWeekends&&f._isWeekend(C)||this.options.disableDayFn&&this.options.disableDayFn(C),Mt=this.options.isDateRange&&this.date&&this.endDate&&f._compareDates(this.date,C),xt=this.options.isDateRange&&this.endDate&&f._compareDates(this.endDate,C),Ct=this.options.isDateRange&&f._isDate(this.endDate)&&f._compareWithinRange(C,this.date,this.endDate),nt=1+(S-l),ct=e,dt=t,ot=!1;f._isDate(this.date)&&(ot=f._compareDates(C,this.date)),!ot&&f._isDate(this.endDate)&&(ot=f._compareDates(C,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(kt=>kt.getTime()===C.getTime())&&(ot=!0),mt&&(S<l?(nt=_+nt,ct=d,dt=p):(nt=nt-o,ct=c,dt=E));let wt={day:nt,month:ct,year:dt,hasEvent:_t,isSelected:ot,isToday:Et,isDisabled:Tt,isEmpty:mt,isStartRange:yt,isEndRange:bt,isInRange:Lt,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:Mt,isDateRangeEnd:xt,isDateRange:Ct};h.push(this.renderDay(wt)),++ht===7&&(a.push(this.renderRow(h,this.options.isRTL,st)),h=[],ht=0,st=!1)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(o=>!!(t.hasOwnProperty(o)&&t[o]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[o,a]of Object.entries(e))t.hasOwnProperty(o)&&t[o]&&s.push(a);return`<td data-day="${t.day}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${t.year}" data-month="${t.month}" data-day="${t.day}">${t.day}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+i+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=f._escape(this.renderDayName(t,i)),o=f._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${o}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){return"<tbody>"+t.join("")+"</tbody>"}_arrowState(t,e){let i=this.options,s=t===i.minYear,o=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(o&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,o,a){let l=this.options,h=i===l.minYear,d=i===l.maxYear,c,p,E=[],_='<div id="'+a+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:M,next:O}=this._arrowState(i,s);for(c=0;c<12;c++)E.push('<option value="'+(i===o?c-e:12+c-e)+'"'+(c===s?' selected="selected"':"")+(h&&c<l.minMonth||d&&c>l.maxMonth?'disabled="disabled"':"")+">"+f._escape(l.i18n.months[c])+"</option>");let st='<select class="datepicker-select orig-select-month" tabindex="-1">'+E.join("")+"</select>";for(Array.isArray(l.yearRange)?(c=l.yearRange[0],p=l.yearRange[1]+1):(c=i-l.yearRange,p=1+i+l.yearRange),E=[];c<p&&c<=l.maxYear;c++)c>=l.minYear&&E.push(`<option value="${c}" ${c===i?'selected="selected"':""}>${c}</option>`);l.yearRangeReverse&&E.reverse();let S=`<select class="datepicker-select orig-select-year" tabindex="-1">${E.join("")}</select>`;return _+=`<button class="month-prev${M?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,_+='<div class="selects-container">',l.showMonthAfterYear?_+=S+st:_+=st+S,_+="</div>",_+=`<button class="month-next${O?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,_+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.options,e=t.minYear,i=t.maxYear,s=t.minMonth,o=t.maxMonth;this._y<=e&&(this._y=e,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=i&&(this._y=i,!isNaN(o)&&this._m>o&&(this._m=o));let a=this.calendars[0].year,l=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let h=this._controlsCacheKey(a);h===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(a,l):(this._controlsKey=h,this._randId="datepicker-title-"+r.guid(),this._rebuildControls(a,l)),this._renderCalendarTable(a,l),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");H.init(i,{classes:"select-year",menuOptions:{container:document.body,constrainWidth:!1}}),H.init(s,{classes:"select-month",menuOptions:{container:document.body,constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),H.getInstance(i)?.refresh());let{prev:s,next:o}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!o)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick)}_setupVariables(){let t=document.createElement("template");t.innerHTML=f._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("change",this._handleInputChange),this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.options.isDateRange&&this.endDateEl&&(this.endDateEl.removeEventListener("click",this._handleInputClick),this.endDateEl.removeEventListener("keypress",this._handleInputKeydown),this.endDateEl.removeEventListener("change",this._handleInputChange))}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keypress",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};f._template=`
9
+ opacity ${this.options.duration}ms ease-out`,setTimeout(()=>{this.container.style.transform="translateX(0px) translateY(0px)",this.container.style.opacity="0"},1))};this.el=o,this.options={...Jt,...e},this.container=document.createElement("div"),this.container.classList.add("display-docked"),this.container.append(t),o.parentElement.append(this.container),document.addEventListener("click",this._handleDocumentClick)}static init(o,t,e){return new u(o,t,e)}};var te={format:"mmm dd, yyyy",parse:null,isDateRange:!1,dateRangeEndEl:null,isMultipleSelection:!1,defaultDate:null,defaultEndDate:null,setDefaultDate:!1,setDefaultEndDate:!1,disableWeekends:!1,disableDayFn:null,firstDay:0,minDate:null,maxDate:null,yearRange:10,minYear:0,maxYear:9999,minMonth:void 0,maxMonth:void 0,startRange:null,endRange:null,isRTL:!1,yearRangeReverse:!1,showMonthAfterYear:!1,showDaysInNextAndPreviousMonths:!1,openByDefault:!1,container:null,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok",previousMonth:"\u2039",nextMonth:"\u203A",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysAbbrev:["S","M","T","W","T","F","S"]},events:[],onSelect:null,onDraw:null,onInputInteraction:null,displayPlugin:null,displayPluginOptions:null,onConfirm:null,onCancel:null},g=class g extends v{constructor(t,e){super(t,e,g);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._handleInputClick=t=>{t.type=="date"&&t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw(),this.gotoDate(t.target===this.el?this.date:this.endDate)}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===c.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarClick=t=>{let e=t.target;e.classList.contains("is-disabled")||this._batchDraws(()=>{if(e.classList.contains("datepicker-day-button")&&!e.classList.contains("is-empty")&&!e.parentElement.classList.contains("is-disabled")){let i=new Date(t.target.getAttribute("data-year"),t.target.getAttribute("data-month"),t.target.getAttribute("data-day"));(!this.multiple||this.multiple&&this.options.isMultipleSelection)&&this.setDate(i),this.options.isDateRange&&this._handleDateRangeCalendarClick(i),this.options.autoSubmit&&this._finishSelection()}else e.closest(".month-prev")?this.prevMonth():e.closest(".month-next")&&this.nextMonth()})};this._handleDateRangeCalendarClick=t=>{if(this.endDate==null||!g._compareDates(t,this.endDate)){if(g._isDate(this.date)&&g._comparePastDate(t,this.date))return;this.setDate(t,!1,g._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{let e,i=t.target;t.detail?.firedBy!==this&&(i==this.endDateEl&&!this.date||(this.options.parse?e=this.options.parse(t.target.value,typeof this.options.format=="function"?this.options.format(new Date(this.el.value)):this.options.format):e=new Date(Date.parse(t.target.value)),g._isDate(e)&&(this.setDate(e,!1,i==this.endDateEl,!0),t.type=="date"&&(this.setDataDate(t,e),this.setInputValues()))))};this._finishSelection=()=>{this.setInputValues()};this._confirm=()=>{this._finishSelection(),typeof this.options.onConfirm=="function"&&this.options.onConfirm.call(this)};this._cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.el.Expressive_Datepicker=this,this.options={...g.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={...g.defaults.i18n,...e.i18n}),this.options.minDate&&this.options.minDate.setHours(0,0,0,0),this.options.maxDate&&this.options.maxDate.setHours(0,0,0,0),this.id=c.guid(),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=new Date(Date.parse(this.el.value)));let i=this.options.defaultDate;if(g._isDate(i)?this.options.setDefaultDate?(this.setDate(i,!0),this.setInputValue(this.el,i)):this.gotoDate(i):this.gotoDate(new Date),this.options.isDateRange){this.multiple=!0;let s=this.options.defaultEndDate;g._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[],this.dateEls.push(t)),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=Y.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return te}static init(t,e={}){return super.init(t,e,g)}static _escape(t){return String(t??"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){g._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,g._isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}static _isLeapYear(t){return t%4===0&&t%100!==0||t%400===0}static _compareDates(t,e){return t.getTime()===e.getTime()}static _compareWithinRange(t,e,i){return t.getTime()>e.getTime()&&t.getTime()<i.getTime()}static _comparePastDate(t,e){return t.getTime()<e.getTime()}static getInstance(t){return t.Expressive_Datepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&w.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&w.getInstance(e).destroy()}_insertHTMLIntoDOM(){if(this.el.type=="date"&&this.el.classList.add("datepicker-date-input"),this._renderDateInputFormat(this.el),this.options.isDateRange&&(this.containerEl.classList.add("daterange"),this.options.dateRangeEndEl?(this.endDateEl=document.querySelector(this.options.dateRangeEndEl),this.endDateEl?this._renderDateInputFormat(this.endDateEl):console.warn("Specified date range end input element in dateRangeEndEl not found")):(this.endDateEl=this.createDateInput(),this.endDateEl.classList.add("datepicker-end-date"))),c.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||c.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this._confirm,this._cancel),this.options.container){let t=this.options.container;this.options.container=t instanceof HTMLElement?t:document.querySelector(t),this.options.container.append(this.containerEl)}else{let t=this.endDateEl?this.endDateEl:this.el;this.options.openByDefault||this.containerEl.setAttribute("style","display: none; visibility: hidden;"),t.parentElement.after(this.containerEl)}}_renderDateInputFormat(t){let e=t.parentElement?.querySelector(".datepicker-format");e&&(e.textContent=typeof this.options.format=="function"?"":String(this.options.format))}toString(t=this.date,e=null){return e=e||this.options.format,typeof e=="function"?e(t):g._isDate(t)?this.formatDate(t,e):""}formatDate(t,e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g).map(s=>this.formats[s]?this.formats[s](t):s).join("")}setDateFromInput(t){let e=new Date(Date.parse(t.value));this.setDate(e,!1,t==this.endDateEl,!0)}setDate(t=null,e=!1,i=!1,s=!1){let n=this.validateDate(t);n&&(this.options.isMultipleSelection?s||this.setMultiDate(n):this.setSingleDate(n,i),g._setToStartOfDay(n),this.gotoDate(n),!e&&typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,n))}validateDate(t){if(!t)return this._renderDateDisplay(t),this.draw();if(typeof t=="string"&&(t=new Date(Date.parse(t))),!g._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return g._isDate(e)&&t<e?t=e:g._isDate(i)&&t>i&&(t=i),new Date(t.getTime())}setSingleDate(t,e){e?e&&(this.endDate=t):this.date=t}setMultiDate(t){let e=this.dates?.find(i=>i.getTime()===t.getTime()?i:!1);e?this.dates.splice(this.dates.indexOf(e),1):this.dates.push(t),this.dates.sort((i,s)=>i.getTime()<s.getTime()?-1:0)}setDataDate(t,e){t.setAttribute("data-date",this.toString(e))}setInputValues(){if(!this.options?.isMultipleSelection){this.setInputValue(this.el,this.date),this.options?.isDateRange&&this.setInputValue(this.endDateEl,this.endDate);return}this.setMultipleSelectionInputValues()}setMultipleSelectionInputValues(){Array.from(this.dateEls).filter((e,i)=>{if(i>this.dates.length-1)return e}).forEach(e=>{e.remove()}),this.dates.forEach((e,i)=>{if(Array.from(this.dateEls)[i]){this.setInputValue(this.dateEls[i],e);return}let s=this.createDateInput();this.setInputValue(s,e),this.dateEls.push(s)})}setInputValue(t,e){t.type=="date"?(this.setDataDate(t,e),t.value=this.formatDate(e,"yyyy-mm-dd")):t.value=this.toString(e),this.el.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}}))}_renderDateDisplay(t,e=null){let i=g._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=g._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(g._isDate(t)){if(this.calendars){let i=new Date(this.calendars[0].year,this.calendars[0].month,1),s=new Date(this.calendars[this.calendars.length-1].year,this.calendars[this.calendars.length-1].month,1),n=t.getTime();s.setMonth(s.getMonth()+1),s.setDate(s.getDate()-1),e=n<i.getTime()||s.getTime()<n}e&&(this.calendars=[{month:t.getMonth(),year:t.getFullYear()}]),this.adjustCalendars()}}adjustCalendars(){this.calendars[0]=this.adjustCalendar(this.calendars[0]),this.draw()}adjustCalendar(t){return t.month<0&&(t.year-=Math.ceil(Math.abs(t.month)/12),t.month+=12),t.month>11&&(t.year+=Math.floor(Math.abs(t.month)/12),t.month-=12),t}nextMonth(){this.calendars[0].month++,this.adjustCalendars()}prevMonth(){this.calendars[0].month--,this.adjustCalendars()}render(t,e,i){let s=new Date,n=g._getDaysInMonth(t,e),a=[],l=new Date(t,e,1).getDay(),h=[];g._setToStartOfDay(s),this.options.firstDay>0&&(l-=this.options.firstDay,l<0&&(l+=7));let r=e===0?11:e-1,d=e===11?0:e+1,f=e===0?t-1:t,E=e===11?t+1:t,_=g._getDaysInMonth(f,r),x=n+l,H=x;for(;H>7;)H-=7;x+=7-H;let et=!1;for(let I=0,rt=0;I<x;I++){let T=new Date(t,e,1+(I-l)),Tt=g._compareDates(T,s),Ct=this.options.events.indexOf(T.toDateString())!==-1,mt=I<l||I>=n+l,xt=this.options.startRange&&g._compareDates(this.options.startRange,T),Mt=this.options.endRange&&g._compareDates(this.options.endRange,T),Dt=this.options.startRange&&this.options.endRange&&this.options.startRange<T&&T<this.options.endRange,wt=this.options.minDate&&T<this.options.minDate||this.options.maxDate&&T>this.options.maxDate||this.options.disableWeekends&&g._isWeekend(T)||this.options.disableDayFn&&this.options.disableDayFn(T),It=this.options.isDateRange&&this.date&&this.endDate&&g._compareDates(this.date,T),kt=this.options.isDateRange&&this.endDate&&g._compareDates(this.endDate,T),Ot=this.options.isDateRange&&g._isDate(this.endDate)&&g._compareWithinRange(T,this.date,this.endDate),it=1+(I-l),lt=e,ht=t,st=!1;g._isDate(this.date)&&(st=g._compareDates(T,this.date)),!st&&g._isDate(this.endDate)&&(st=g._compareDates(T,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Ht=>Ht.getTime()===T.getTime())&&(st=!0),mt&&(I<l?(it=_+it,lt=r,ht=f):(it=it-n,lt=d,ht=E));let St={day:it,month:lt,year:ht,hasEvent:Ct,isSelected:st,isToday:Tt,isDisabled:wt,isEmpty:mt,isStartRange:xt,isEndRange:Mt,isInRange:Dt,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:It,isDateRangeEnd:kt,isDateRange:Ot};h.push(this.renderDay(St)),++rt===7&&(a.push(this.renderRow(h,this.options.isRTL,et)),h=[],rt=0,et=!1)}return this.renderTable(this.options,a,i)}renderDay(t){let e={isDisabled:"is-disabled",isToday:"is-today",isSelected:"is-selected",hasEvent:"has-event",isInRange:"is-inrange",isStartRange:"is-startrange",isEndRange:"is-endrange",isDateRangeStart:"is-daterange-start",isDateRangeEnd:"is-daterange-end",isDateRange:"is-daterange"},i=["isSelected","isDateRange"].filter(n=>!!(t.hasOwnProperty(n)&&t[n]===!0)).length!==0,s=["datepicker-day"];if(t.isEmpty)if(t.showDaysInNextAndPreviousMonths)s.push("is-outside-current-month"),s.push("is-selection-disabled");else return'<td class="is-empty"></td>';for(let[n,a]of Object.entries(e))t.hasOwnProperty(n)&&t[n]&&s.push(a);return`<td data-day="${t.day}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${t.year}" data-month="${t.month}" data-day="${t.day}">${t.day}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+(e?t.reverse():t).join("")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+i+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=g._escape(this.renderDayName(t,i)),n=g._escape(this.renderDayName(t,i,!0));e.push(`<th scope="col"><abbr title="${s}">${n}</abbr></th>`)}return"<thead><tr>"+(t.isRTL?e.reverse():e).join("")+"</tr></thead>"}renderBody(t){return"<tbody>"+t.join("")+"</tbody>"}_arrowState(t,e){let i=this.options,s=t===i.minYear,n=t===i.maxYear;return{prev:!(s&&(e===0||i.minMonth>=e)),next:!(n&&(e===11||i.maxMonth<=e))}}_controlsCacheKey(t){let e=this.options;return[t,e.minYear,e.maxYear,e.minMonth,e.maxMonth,Array.isArray(e.yearRange)?e.yearRange.join("-"):e.yearRange,e.yearRangeReverse,e.showMonthAfterYear].join("|")}renderTitle(t,e,i,s,n,a){let l=this.options,h=i===l.minYear,r=i===l.maxYear,d,f,E=[],_='<div id="'+a+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:x,next:H}=this._arrowState(i,s);for(d=0;d<12;d++)E.push('<option value="'+(i===n?d-e:12+d-e)+'"'+(d===s?' selected="selected"':"")+(h&&d<l.minMonth||r&&d>l.maxMonth?'disabled="disabled"':"")+">"+g._escape(l.i18n.months[d])+"</option>");let et='<select class="datepicker-select orig-select-month" tabindex="-1">'+E.join("")+"</select>";for(Array.isArray(l.yearRange)?(d=l.yearRange[0],f=l.yearRange[1]+1):(d=i-l.yearRange,f=1+i+l.yearRange),E=[];d<f&&d<=l.maxYear;d++)d>=l.minYear&&E.push(`<option value="${d}" ${d===i?'selected="selected"':""}>${d}</option>`);l.yearRangeReverse&&E.reverse();let I=`<select class="datepicker-select orig-select-year" tabindex="-1">${E.join("")}</select>`;return _+=`<button class="month-prev${x?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg></button>`,_+='<div class="selects-container">',l.showMonthAfterYear?_+=I+et:_+=et+I,_+="</div>",_+=`<button class="month-next${H?"":" is-disabled"}" type="button"><svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"/><path d="M0-.25h24v24H0z" fill="none"/></svg></button>`,_+="</div>"}_batchDraws(t){this._drawDepth++;try{t()}finally{this._drawDepth--,this._drawDepth===0&&this._drawDirty&&(this._drawDirty=!1,this.draw())}}draw(){if(this._drawDepth>0){this._drawDirty=!0;return}let t=this.options,e=t.minYear,i=t.maxYear,s=t.minMonth,n=t.maxMonth;this._y<=e&&(this._y=e,!isNaN(s)&&this._m<s&&(this._m=s)),this._y>=i&&(this._y=i,!isNaN(n)&&this._m>n&&(this._m=n));let a=this.calendars[0].year,l=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let h=this._controlsCacheKey(a);h===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(a,l):(this._controlsKey=h,this._randId="datepicker-title-"+c.guid(),this._rebuildControls(a,l)),this._renderCalendarTable(a,l),typeof this.options.onDraw=="function"&&this.options.onDraw.call(this)}_rebuildControls(t,e){this.destroySelects(),this.calendarEl.innerHTML=this.renderTitle(this,0,t,e,t,this._randId);let i=this.calendarEl.querySelector(".orig-select-year"),s=this.calendarEl.querySelector(".orig-select-month");w.init(i,{classes:"select-year",menuOptions:{container:c.portalRoot(this.el),constrainWidth:!1}}),w.init(s,{classes:"select-month",menuOptions:{container:c.portalRoot(this.el),constrainWidth:!1}}),i.addEventListener("change",this._handleYearChange),s.addEventListener("change",this._handleMonthChange)}_reuseControls(t,e){let i=this.calendarEl.querySelector(".orig-select-month");i&&i.value!==e.toString()&&(i.value=e.toString(),w.getInstance(i)?.refresh());let{prev:s,next:n}=this._arrowState(t,e);this.calendarEl.querySelector(".month-prev")?.classList.toggle("is-disabled",!s),this.calendarEl.querySelector(".month-next")?.classList.toggle("is-disabled",!n)}_renderCalendarTable(t,e){let i=this.render(t,e,this._randId),s=this.calendarEl.querySelector(".datepicker-table-wrapper");s?s.outerHTML=i:this.calendarEl.insertAdjacentHTML("beforeend",i)}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.el.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick)}_setupVariables(){let t=document.createElement("template");t.innerHTML=g._template.trim(),this.containerEl=t.content.firstChild,this.calendarEl=this.containerEl.querySelector(".datepicker-calendar"),this.yearTextEl=this.containerEl.querySelector(".year-text"),this.dateTextEl=this.containerEl.querySelector(".date-text"),this.footer=this.containerEl.querySelector(".datepicker-footer"),this.formats={d:e=>e.getDate(),dd:e=>{let i=e.getDate();return(i<10?"0":"")+i},ddd:e=>this.options.i18n.weekdaysShort[e.getDay()],dddd:e=>this.options.i18n.weekdays[e.getDay()],m:e=>e.getMonth()+1,mm:e=>{let i=e.getMonth()+1;return(i<10?"0":"")+i},mmm:e=>this.options.i18n.monthsShort[e.getMonth()],mmmm:e=>this.options.i18n.months[e.getMonth()],yy:e=>(""+e.getFullYear()).slice(2),yyyy:e=>e.getFullYear()}}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),this.el.removeEventListener("change",this._handleInputChange),this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.options.isDateRange&&this.endDateEl&&(this.endDateEl.removeEventListener("click",this._handleInputClick),this.endDateEl.removeEventListener("keypress",this._handleInputKeydown),this.endDateEl.removeEventListener("change",this._handleInputChange))}gotoMonth(t){isNaN(t)||(this.calendars[0].month=parseInt(t,10),this.adjustCalendars())}gotoYear(t){isNaN(t)||(this.calendars[0].year=parseInt(t,10),this.adjustCalendars())}renderDayName(t,e,i=!1){for(e+=t.firstDay;e>=7;)e-=7;return i?t.i18n.weekdaysAbbrev[e]:t.i18n.weekdays[e]}createDateInput(){let t=this.el.cloneNode(!0);return t.removeAttribute("id"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keypress",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};g._template=`
10
10
  <div class="datepicker-container">
11
11
  <div class="datepicker-date-display">
12
12
  <span class="year-text"></span>
@@ -16,17 +16,17 @@ var Expressive=(()=>{var ut=Object.defineProperty;var It=Object.getOwnPropertyDe
16
16
  <div class="datepicker-calendar"></div>
17
17
  <div class="datepicker-footer"></div>
18
18
  </div>
19
- </div>`;var z=f;var Xt={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},j=class u extends g{constructor(t,e){super(t,e,u);this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{r.keys.ENTER.includes(t.key)&&this._handleLightboxToggle()};this._handleLightboxToggle=()=>{this.doneAnimating===!1||this.overlayActive&&this.doneAnimating?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{r.keys.ESC.includes(t.key)&&this.doneAnimating&&this.overlayActive&&this.close()};this.open=()=>{this._updateVars();let t=this.el.getBoundingClientRect(),e=this.placeholder.getBoundingClientRect();this.originalWidth=t.width,this.originalHeight=t.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.placeholder.style.width=e.width+"px",this.placeholder.style.height=e.height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this.caption!==""&&this._addCaption();let i=this.originalWidth/this.windowWidth,s=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,i>s){let o=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*o}else{let o=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*o,this.newHeight=this.windowHeight*.9}this._animateImageIn(),window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape)};this.close=()=>{this._updateVars(),this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._removeOverlay(),this._animateImageOut(),this.caption!==""&&this._removeCaption()};this.el.Expressive_Lightbox=this,this.options={...u.defaults,...e},this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this.el.tabIndex=0,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return Xt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Lightbox}destroy(){this._removeEventHandlers(),this.el.Expressive_Lightbox=void 0,this.placeholder.remove(),this.el.removeAttribute("style")}_setupEventHandlers(){this.el.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keypress",this._handleLightboxKeypress)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keypress",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!==null&&t!==document;){let e=t;e.style.overflow!=="visible"&&(e.style.overflow="visible",this._changedAncestorList.push(e)),t=t.parentNode}}_offset(t){let e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.scrollY-i.clientTop,left:e.left+window.scrollX-i.clientLeft}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let t=this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",setTimeout(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
19
+ </div>`;var X=g;var ee={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},j=class u extends v{constructor(t,e){super(t,e,u);this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{t.key===c.keys.ENTER&&this._handleLightboxToggle()};this._handleLightboxToggle=()=>{this.doneAnimating===!1||this.overlayActive&&this.doneAnimating?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===c.keys.ESC&&this.doneAnimating&&this.overlayActive&&this.close()};this.open=()=>{this._updateVars();let t=this.el.getBoundingClientRect(),e=this.placeholder.getBoundingClientRect();this.originalWidth=t.width,this.originalHeight=t.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.placeholder.style.width=e.width+"px",this.placeholder.style.height=e.height+"px",this.placeholder.style.position="relative",this.placeholder.style.top="0",this.placeholder.style.left="0",this._makeAncestorsOverflowVisible(),this.el.style.position="absolute",this.el.style.zIndex="1000",this.el.style.willChange="left, top, width, height",this.attrWidth=this.el.getAttribute("width"),this.attrHeight=this.el.getAttribute("height"),this.attrWidth&&(this.el.style.width=this.attrWidth+"px",this.el.removeAttribute("width")),this.attrHeight&&(this.el.style.height=this.attrHeight+"px",this.el.removeAttribute("height")),this._addOverlay(),this.caption!==""&&this._addCaption();let i=this.originalWidth/this.windowWidth,s=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,i>s){let n=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*n}else{let n=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*n,this.newHeight=this.windowHeight*.9}this._animateImageIn(),window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape)};this.close=()=>{this._updateVars(),this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._removeOverlay(),this._animateImageOut(),this.caption!==""&&this._removeCaption()};this.el.Expressive_Lightbox=this,this.options={...u.defaults,...e},this.overlayActive=!1,this.doneAnimating=!0,this.placeholder=document.createElement("div"),this.placeholder.classList.add("material-placeholder"),this.originalWidth=0,this.originalHeight=0,this.originInlineStyles=this.el.getAttribute("style"),this.caption=this.el.getAttribute("data-caption")||"",this.el.tabIndex=0,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return ee}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Lightbox}destroy(){this._removeEventHandlers(),this.el.Expressive_Lightbox=void 0,this.placeholder.remove(),this.el.removeAttribute("style")}_setupEventHandlers(){this.el.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keypress",this._handleLightboxKeypress)}_removeEventHandlers(){this.el.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keypress",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;e.style&&e.style.overflow!=="visible"&&(this._changedAncestorList.push([e,e.style.overflow]),e.style.overflow="visible"),t=t.parentNode??t.host}}_offset(t){let e=t.getBoundingClientRect(),i=document.documentElement;return{top:e.top+window.scrollY-i.clientTop,left:e.left+window.scrollX-i.clientLeft}}_updateVars(){this.windowWidth=window.innerWidth,this.windowHeight=window.innerHeight,this.caption=this.el.getAttribute("data-caption")||""}_animateImageIn(){this.el.style.maxHeight=this.newHeight.toString()+"px",this.el.style.maxWidth=this.newWidth.toString()+"px";let t=this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",setTimeout(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
20
20
  width ${t}ms ease,
21
21
  left ${t}ms ease,
22
22
  top ${t}ms ease
23
- `,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=r.getDocumentScrollLeft()+this.windowWidth/2-e.left-this.newWidth/2+"px",this.el.style.top=r.getDocumentScrollTop()+this.windowHeight/2-e.top-this.newHeight/2+"px"},1),setTimeout(()=>{this.doneAnimating=!0,typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateImageOut(){let t=this.options.outDuration;this.el.style.transition=`height ${t}ms ease,
23
+ `,this.el.style.height=this.newHeight+"px",this.el.style.width=this.newWidth+"px",this.el.style.left=c.getDocumentScrollLeft()+this.windowWidth/2-e.left-this.newWidth/2+"px",this.el.style.top=c.getDocumentScrollTop()+this.windowHeight/2-e.top-this.newHeight/2+"px"},1),setTimeout(()=>{this.doneAnimating=!0,typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},t)}_animateImageOut(){let t=this.options.outDuration;this.el.style.transition=`height ${t}ms ease,
24
24
  width ${t}ms ease,
25
25
  left ${t}ms ease,
26
26
  top ${t}ms ease
27
- `,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",setTimeout(()=>{this.placeholder.style.height="",this.placeholder.style.width="",this.placeholder.style.position="",this.placeholder.style.top="",this.placeholder.style.left="",this.attrWidth&&this.el.setAttribute("width",this.attrWidth.toString()),this.attrHeight&&this.el.setAttribute("height",this.attrHeight.toString()),this.el.removeAttribute("style"),this.originInlineStyles&&this.el.setAttribute("style",this.originInlineStyles),this.el.classList.remove("active"),this.doneAnimating=!0,this._changedAncestorList.forEach(e=>e.style.overflow=""),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,document.body.append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this.options.inDuration;setTimeout(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0",setTimeout(()=>{this._photoCaption.remove()},t)}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",()=>{this.doneAnimating&&this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this.options.inDuration;setTimeout(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0",setTimeout(()=>{this.overlayActive=!1,this._overlay.remove()},t)}};var Ut={},G=class u extends g{constructor(n,t){super(n,t,u),this.el.Expressive_Parallax=this,this.options={...u.defaults,...t},this.el.querySelector("img, video")||console.error("Parallax: no <img> or <video> to move inside the .parallax element")}static get defaults(){return Ut}static init(n,t={}){return super.init(n,t,u)}static getInstance(n){return n.Expressive_Parallax}destroy(){this.el.Expressive_Parallax=void 0}};var ft=u=>`a[href="#${u}"]`,zt={scrollOffset:200,activeClass:"active",getActiveElement:ft,keepTopElementActive:!1},m=class m extends g{constructor(n,t){super(n,t,m),this.el.Expressive_ScrollSpy=this,this.options={...m.defaults,...t},this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),m._elements.push(this),m._ensureObserver(this.options.scrollOffset),m._observer?.observe(this.el)}static get defaults(){return zt}static init(n,t={}){return super.init(n,t,m)}static getInstance(n){return n.Expressive_ScrollSpy}destroy(){let n=m._elements.indexOf(this);n>=0&&m._elements.splice(n,1),m._ratios.delete(this.el),m._observer?.unobserve(this.el);let t=m._linkFor(this.el.id,this.options);t&&t===m._active?m._clearActive(this.options):(t?.classList.remove(this.options.activeClass),t?.removeAttribute("aria-current")),m._elements.length===0?(m._observer?.disconnect(),m._observer=null,m._ratios.clear(),m._active=null):m._syncActive(),this.el.Expressive_ScrollSpy=void 0}static _ensureObserver(n){m._observer||typeof IntersectionObserver>"u"||(m._observer=new IntersectionObserver(m._onIntersect,{rootMargin:`-${n}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}))}static _syncActive(){if(!m._elements.length)return;let n=m._elements[0].options,t=null,e=0;for(let s of m._elements){let o=m._ratios.get(s.el)??0;o>e&&(e=o,t=s)}if(!t)if(n.keepTopElementActive)t=m._nearestAbove()??m._elements[0];else{m._clearActive(n);return}let i=m._linkFor(t.el.id,t.options);i!==m._active&&(m._clearActive(n),i&&(i.classList.add(t.options.activeClass),i.setAttribute("aria-current","true"),m._active=i))}static _nearestAbove(){let n=null,t=-1/0;for(let e of m._elements){let i=e.el.getBoundingClientRect().top;i<=0&&i>=t&&(t=i,n=e)}return n}static _clearActive(n){m._active&&(m._active.classList.remove(n.activeClass),m._active.removeAttribute("aria-current"),m._active=null)}static _linkFor(n,t){if(!n)return null;if(t.getActiveElement!==ft)try{return document.querySelector(t.getActiveElement(n))}catch{return null}let e=`#${n}`,i=document.querySelectorAll('a[href^="#"]');for(let s=0;s<i.length;s++)if(i[s].getAttribute("href")===e)return i[s];return null}};m._elements=[],m._observer=null,m._ratios=new Map,m._active=null,m._onIntersect=n=>{for(let t of n)t.isIntersecting&&t.intersectionRatio>0?m._ratios.set(t.target,t.intersectionRatio):m._ratios.delete(t.target);m._syncActive()};var Z=m;var jt={edge:"left",draggable:!0,dragTargetWidth:"10px",onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Gt="(width >= 993px)",I=class I extends g{constructor(t,e){super(t,e,I);this.open=()=>{if(!(this._isCurrentlyFixed()||this.isOpen||!this._dialog)){if(I._sidenavs.forEach(t=>{t!==this&&t.isOpen&&t.close()}),typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isOpen=!0,this._dialog.classList.remove("dragging"),this._clearShift(),!this._dialog.open)try{this._dialog.showModal()}catch{}this._syncTriggers(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)}};this.close=()=>{this._isCurrentlyFixed()||!this.isOpen||(this._beginClose(),this._dialog?.open?(this._closing=!0,this._dialog.close()):this._finishClose())};this._onDialogClose=()=>{if(this.isOpen){this._beginClose(),this._finishClose();return}this._closing&&(this._closing=!1,this._finishClose())};this._onBreakpointChange=()=>{this._isCurrentlyFixed()&&this.isOpen&&this.close()};this._handleCloseTriggerClick=t=>{let e=t.target;if(!(e instanceof Element))return;e.closest(".sidenav-close")&&!this._isCurrentlyFixed()&&this.close()};this._handleDragTargetDrag=t=>{if(!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?e:-e,s=Math.min(this._width,Math.max(0,i)),o=this._width?s/this._width:0;this._applyShift(s-this._width,o)};this._handleDragTargetRelease=()=>{this.isDragged&&(this._dialog?.classList.remove("dragging"),this.percentOpen>.2?this.open():this._dialog?.open&&!this.isOpen&&(this._clearShift(),this._dialog.close()),this.isDragged=!1,this._verticallyScrolling=!1)};this._handleCloseDrag=t=>{if(!this.isOpen||!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?-e:e,s=Math.min(this._width,Math.max(0,i)),o=this._width?1-s/this._width:1;this._applyShift(-s,o)};this._handleCloseRelease=()=>{!this.isOpen||!this.isDragged||(this._dialog?.classList.remove("dragging"),this.percentOpen>.8?this._clearShift():this.close(),this.isDragged=!1,this._verticallyScrolling=!1)};this.el.Expressive_Sidenav=this,this.options={...I.defaults,...e},this.id=this.el.id,this.isOpen=!1,this.isFixed=this.el.classList.contains("sidenav-fixed"),this.isDragged=!1,this.dragTarget=null,this._dialog=null,this._createdDialog=!1,this._closing=!1,this.percentOpen=0,this._startingXpos=0,this._xPos=0,this._width=0,this._initialScrollTop=0,this._verticallyScrolling=!1,this._mql=window.matchMedia(Gt),this._setupDialog(),this._createDragTarget(),this._setupClasses(),this._setupEventHandlers(),this._syncTriggers(),I._sidenavs.push(this)}static get defaults(){return jt}static init(t,e={}){return super.init(t,e,I)}static getInstance(t){return t.Expressive_Sidenav}destroy(){if(this._removeEventHandlers(),this._dialog?.open)try{this._dialog.close()}catch{}this._clearShift(),this._unwrapDialog(),this._removeDragTarget(),this.el.Expressive_Sidenav=void 0;let t=I._sidenavs.indexOf(this);t>=0&&I._sidenavs.splice(t,1)}_beginClose(){this.isOpen=!1,this._dialog?.classList.remove("dragging"),this._clearShift(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this._syncTriggers()}_finishClose(){typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)}_setupDialog(){if(this.el instanceof HTMLDialogElement){this._dialog=this.el,this._createdDialog=!1;return}let t=this.el.parentElement;if(t instanceof HTMLDialogElement&&t.classList.contains("sidenav-overlay")){this._dialog=t,this._createdDialog=!1;return}let e=document.createElement("dialog");e.classList.add("sidenav-overlay"),this.el.replaceWith(e),e.appendChild(this.el),this._dialog=e,this._createdDialog=!0}_unwrapDialog(){!this._createdDialog||!this._dialog||(this._dialog.replaceWith(this.el),this._dialog=null,this._createdDialog=!1)}_createDragTarget(){if(!this.options.draggable)return;let t=document.createElement("div");t.classList.add("drag-target"),t.style.width=this.options.dragTargetWidth,this.isFixed&&(t.dataset.fixed=""),document.body.appendChild(t),this.dragTarget=t}_removeDragTarget(){this.dragTarget?.remove(),this.dragTarget=null}_setupClasses(){this.options.edge==="right"&&(this.el.classList.add("right-aligned"),this._dialog?.classList.add("right-aligned"),this.dragTarget?.classList.add("right-aligned"))}_setupEventHandlers(){I._sidenavs.length===0&&document.body.addEventListener("click",I._handleTriggerClick);let t={passive:!0};this.dragTarget?.addEventListener("touchmove",this._handleDragTargetDrag,t),this.dragTarget?.addEventListener("touchend",this._handleDragTargetRelease),this._dialog?.addEventListener("touchmove",this._handleCloseDrag,t),this._dialog?.addEventListener("touchend",this._handleCloseRelease),this._dialog?.addEventListener("close",this._onDialogClose),this.el.addEventListener("click",this._handleCloseTriggerClick),this._mql.addEventListener("change",this._onBreakpointChange)}_removeEventHandlers(){I._sidenavs.length===1&&document.body.removeEventListener("click",I._handleTriggerClick),this.dragTarget?.removeEventListener("touchmove",this._handleDragTargetDrag),this.dragTarget?.removeEventListener("touchend",this._handleDragTargetRelease),this._dialog?.removeEventListener("touchmove",this._handleCloseDrag),this._dialog?.removeEventListener("touchend",this._handleCloseRelease),this._dialog?.removeEventListener("close",this._onDialogClose),this.el.removeEventListener("click",this._handleCloseTriggerClick),this._mql.removeEventListener("change",this._onBreakpointChange)}static _handleTriggerClick(t){let e=t.target;if(!(e instanceof Element))return;let i=e.closest(".sidenav-trigger");if(!i||!(i instanceof HTMLElement))return;let s=r.getIdFromTrigger(i),o=document.getElementById(s)?.Expressive_Sidenav;o&&(o.open(),t.preventDefault())}_isDraggable(){return this.options.draggable&&!this._isCurrentlyFixed()&&!this._verticallyScrolling}_isCurrentlyFixed(){return this.isFixed&&this._mql.matches}_startDrag(t){let e=t.targetTouches[0].clientX;if(this.isDragged=!0,this._startingXpos=e,this._xPos=e,this._width=this._dialog?.getBoundingClientRect().width||this.el.getBoundingClientRect().width,this._initialScrollTop=this.isOpen?this.el.scrollTop:r.getDocumentScrollTop(),this._verticallyScrolling=!1,this._dialog?.classList.add("dragging"),this._dialog&&!this._dialog.open)try{this._dialog.showModal()}catch{}}_dragMoveUpdate(t){let e=t.targetTouches[0].clientX,i=this.isOpen?this.el.scrollTop:r.getDocumentScrollTop();this._xPos=e,this._initialScrollTop!==i&&(this._verticallyScrolling=!0)}_rawDelta(t){return this.isDragged||this._startDrag(t),this._dragMoveUpdate(t),this._xPos-this._startingXpos}_applyShift(t,e){this.percentOpen=e;let i=this._dialog??this.el;i.style.setProperty("--md-comp-nav-drawer-shift",`${t}px`),i.style.setProperty("--md-comp-nav-drawer-open",String(e))}_clearShift(){let t=this._dialog??this.el;t.style.removeProperty("--md-comp-nav-drawer-shift"),t.style.removeProperty("--md-comp-nav-drawer-open")}_syncTriggers(){this.id&&document.querySelectorAll(".sidenav-trigger").forEach(t=>{t instanceof HTMLElement&&r.getIdFromTrigger(t)===this.id&&(t.setAttribute("aria-expanded",this.isOpen?"true":"false"),t.setAttribute("aria-controls",this.id))})}};I._sidenavs=[];var Q=I;var Zt={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},Qt="(width < 601px)",J=class u extends g{constructor(t,e){super(t,e,u);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{t.key==="Escape"&&this.isExpanded&&this._isModal()&&this.collapse()};this.el.Expressive_NavigationRail=this,this.options={...u.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(Qt),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return Zt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var Jt={indicators:!0,height:400,duration:500,interval:6e3,pauseOnFocus:!0,pauseOnHover:!0,indicatorLabelFunc:null},lt=class u extends g{constructor(t,e){super(t,e,u);this._handleVisibilityChange=()=>{document.hidden?this.interval!=null&&this._pause(!0):this.eventPause&&!(this.options.pauseOnHover&&this._hovered)&&!(this.options.pauseOnFocus&&this._focused)&&this.start()};this._handleIndicatorClick=t=>{let e=t.target.parentElement,i=[...e.parentNode.children].indexOf(e);this._focusCurrent=!0,this.set(i)};this._handleAutoPauseHover=()=>{this._hovered=!0,this.interval!=null&&this._pause(!0)};this._handleAutoPauseFocus=()=>{this._focused=!0,this.interval!=null&&this._pause(!0)};this._handleAutoStartHover=()=>{this._hovered=!1,!(this.options.pauseOnFocus&&this._focused)&&this.eventPause&&this.start()};this._handleAutoStartFocus=()=>{this._focused=!1,!(this.options.pauseOnHover&&this._hovered)&&this.eventPause&&this.start()};this._handleInterval=()=>{let t=this._slider.querySelector(".active"),e=[...t.parentNode.children].indexOf(t);this._slides.length===e+1?e=0:e+=1,this.set(e)};this.pause=()=>{this._pause(!1)};this.start=()=>{clearInterval(this.interval),this.interval=setInterval(this._handleInterval,this.options.duration+this.options.interval),this.eventPause=!1};this.next=()=>{let t=this.activeIndex+1;t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.set(t)};this.prev=()=>{let t=this.activeIndex-1;t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.set(t)};this.el.Expressive_Slider=this,this.options={...u.defaults,...e},this.interval=null,this.eventPause=!1,this._hovered=!1,this._focused=!1,this._focusCurrent=!1,this._slider=this.el.querySelector(".slides"),this._slides=Array.from(this._slider.querySelectorAll("li")),this.activeIndex=this._slides.findIndex(s=>s.classList.contains("active")),this.activeIndex!==-1&&(this._activeSlide=this._slides[this.activeIndex]),this._setSliderHeight(),this._slider.hasAttribute("id")?this._sliderId=this._slider.getAttribute("id"):(this._sliderId="slider-"+r.guid(),this._slider.setAttribute("id",this._sliderId));let i="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";this._slides.forEach(s=>{let o=s.querySelector("img");o&&o.src!==i&&(o.style.backgroundImage="url("+o.src+")",o.src=i),s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.style.visibility="hidden"}),this._setupIndicators(),this._activeSlide?(this._activeSlide.style.display="block",this._activeSlide.style.visibility="visible"):(this.activeIndex=0,this._slides[0].classList.add("active"),this._slides[0].style.visibility="visible",this._activeSlide=this._slides[0],this._animateSlide(this._slides[0],!0),this.options.indicators&&this._indicators[this.activeIndex].children[0].classList.add("active")),this._setupEventHandlers(),this.start()}static get defaults(){return Jt}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Slider}destroy(){this.pause(),this._removeIndicators(),this._removeEventHandlers(),this.el.Expressive_Slider=void 0}_setupEventHandlers(){this.options.pauseOnFocus&&(this.el.addEventListener("focusin",this._handleAutoPauseFocus),this.el.addEventListener("focusout",this._handleAutoStartFocus)),this.options.pauseOnHover&&(this.el.addEventListener("mouseenter",this._handleAutoPauseHover),this.el.addEventListener("mouseleave",this._handleAutoStartHover)),this.options.indicators&&this._indicators.forEach(t=>{t.addEventListener("click",this._handleIndicatorClick)}),document.addEventListener("visibilitychange",this._handleVisibilityChange)}_removeEventHandlers(){this.options.pauseOnFocus&&(this.el.removeEventListener("focusin",this._handleAutoPauseFocus),this.el.removeEventListener("focusout",this._handleAutoStartFocus)),this.options.pauseOnHover&&(this.el.removeEventListener("mouseenter",this._handleAutoPauseHover),this.el.removeEventListener("mouseleave",this._handleAutoStartHover)),this.options.indicators&&this._indicators.forEach(t=>{t.removeEventListener("click",this._handleIndicatorClick)}),document.removeEventListener("visibilitychange",this._handleVisibilityChange)}_animateSlide(t,e){let i=0,s=0;t.style.opacity=e?"0":"1",setTimeout(()=>{t.style.transition=`opacity ${this.options.duration}ms ease`,t.style.opacity=e?"1":"0"},1);let o=t.querySelector(".caption");o&&(o.classList.contains("center-align")?s=-100:o.classList.contains("right-align")?i=100:o.classList.contains("left-align")&&(i=-100),o.style.opacity=e?"0":"1",o.style.transform=e?`translate(${i}px, ${s}px)`:"translate(0, 0)",setTimeout(()=>{o.style.transition=`opacity ${this.options.duration}ms ease, transform ${this.options.duration}ms ease`,o.style.opacity=e?"1":"0",o.style.transform=e?"translate(0, 0)":`translate(${i}px, ${s}px)`},this.options.duration))}_setSliderHeight(){this.el.classList.contains("fullscreen")||(this.options.indicators?this.el.style.height=this.options.height+40+"px":this.el.style.height=this.options.height+"px",this._slider.style.height=this.options.height+"px")}_setupIndicators(){if(this.options.indicators){let t=document.createElement("ul");t.classList.add("indicators");let e=[];this._slides.forEach((i,s)=>{let o=this.options.indicatorLabelFunc?this.options.indicatorLabelFunc.call(this,s+1,s===0):`${s+1}`,a=document.createElement("li");a.classList.add("indicator-item");let l=document.createElement("button");l.type="button",l.classList.add("indicator-item-btn"),l.setAttribute("aria-label",o),l.setAttribute("aria-controls",this._sliderId),a.appendChild(l),e.push(a),t.append(a)}),this.el.append(t),this._indicators=e}}_removeIndicators(){this.el.querySelector("ul.indicators").remove()}set(t){if(t>=this._slides.length?t=0:t<0&&(t=this._slides.length-1),this.activeIndex===t)return;this._activeSlide=this._slides[this.activeIndex];let e=this._activeSlide.querySelector(".caption");if(this._activeSlide.classList.remove("active"),this._slides.forEach(i=>i.style.visibility="visible"),this._activeSlide.style.opacity="0",setTimeout(()=>{this._slides.forEach(i=>{i.classList.contains("active")||(i.style.opacity="0",i.style.transform="translate(0, 0)",i.style.visibility="hidden")})},this.options.duration),e&&(e.style.opacity="0"),this.options.indicators){let i=this._indicators[this.activeIndex].children[0],s=this._indicators[t].children[0];i.classList.remove("active"),s.classList.add("active"),typeof this.options.indicatorLabelFunc=="function"&&(i.ariaLabel=this.options.indicatorLabelFunc.call(this,this.activeIndex,!1),s.ariaLabel=this.options.indicatorLabelFunc.call(this,t,!0))}this._animateSlide(this._slides[t],!0),this._slides[t].classList.add("active"),this.activeIndex=t,this.interval!=null&&this.start()}_pause(t){clearInterval(this.interval),this.eventPause=t,this.interval=null}};var te={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},tt=class u extends g{constructor(t,e){super(t,e,u);this._handleWindowResize=()=>{this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;this._activeTabLink.classList.remove("active");let a=this._content;this._activeTabLink=i,i.hash&&(this._content=document.querySelector(i.hash)),this._tabLinks=this._queryTabLinks(),this._activeTabLink.classList.add("active");let l=this._index;this._index=Math.max(Array.from(this._tabLinks).indexOf(i),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this._index,()=>{typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}):this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),a&&a!==this._content&&(a.style.display="none",a.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(l),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...u.defaults,...e},this._tabLinks=this._queryTabLinks(),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return te}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}Array.from(this._tabLinks).forEach(t=>t.classList.remove("active")),this._activeTabLink.classList.add("active"),this._index=Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink),0),this._activeTabLink&&this._activeTabLink.hash&&(this._content=document.querySelector(this._activeTabLink.hash),this._content&&this._content.classList.add("active"))}_setupSwipeableTabs(){window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);let t=[];this._tabLinks.forEach(i=>{if(i.hash){let s=document.querySelector(i.hash);s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{e.appendChild(i),i.style.display=""}),this._tabsCarousel=F.init(e,{fullWidth:!0,noWrap:!0,onCycleTo:i=>{let s=this._index;this._index=Array.from(i.parentNode.children).indexOf(i),this._activeTabLink.classList.remove("active"),this._activeTabLink=Array.from(this._tabLinks)[this._index],this._activeTabLink.classList.add("active"),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}}),this._tabsCarousel.set(this._index)}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),t.append(t.parentElement),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(t!==this._activeTabLink&&t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="none")}})}_teardownNormalTabs(){this._tabLinks.forEach(t=>{if(t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
27
+ `,this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this.el.style.left="0",this.el.style.top="0",setTimeout(()=>{this.placeholder.style.height="",this.placeholder.style.width="",this.placeholder.style.position="",this.placeholder.style.top="",this.placeholder.style.left="",this.attrWidth&&this.el.setAttribute("width",this.attrWidth.toString()),this.attrHeight&&this.el.setAttribute("height",this.attrHeight.toString()),this.el.removeAttribute("style"),this.originInlineStyles&&this.el.setAttribute("style",this.originInlineStyles),this.el.classList.remove("active"),this.doneAnimating=!0,this._changedAncestorList.forEach(([e,i])=>e.style.overflow=i),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)},t)}_addCaption(){this._photoCaption=document.createElement("div"),this._photoCaption.classList.add("lightbox-caption"),this._photoCaption.innerText=this.caption,c.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this.options.inDuration;setTimeout(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0",setTimeout(()=>{this._photoCaption.remove()},t)}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",()=>{this.doneAnimating&&this.close()},{once:!0}),this.el.before(this._overlay);let t=this._overlay.getBoundingClientRect();this._overlay.style.width=this.windowWidth+"px",this._overlay.style.height=this.windowHeight+"px",this._overlay.style.left=-1*t.left+"px",this._overlay.style.top=-1*t.top+"px",this._overlay.style.transition="none",this._overlay.style.opacity="0";let e=this.options.inDuration;setTimeout(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0",setTimeout(()=>{this.overlayActive=!1,this._overlay.remove()},t)}};var yt=u=>`a[href="#${u}"]`,ie={scrollOffset:200,activeClass:"active",getActiveElement:yt,keepTopElementActive:!1},m=class m extends v{constructor(o,t){super(o,t,m),this.el.Expressive_ScrollSpy=this,this.options={...m.defaults,...t},this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),m._elements.push(this),m._ensureObserver(this.options.scrollOffset),m._observer?.observe(this.el)}static get defaults(){return ie}static init(o,t={}){return super.init(o,t,m)}static getInstance(o){return o.Expressive_ScrollSpy}destroy(){let o=m._elements.indexOf(this);o>=0&&m._elements.splice(o,1),m._ratios.delete(this.el),m._observer?.unobserve(this.el);let t=m._linkFor(this.el.id,this.options);t&&t===m._active?m._clearActive(this.options):(t?.classList.remove(this.options.activeClass),t?.removeAttribute("aria-current")),m._elements.length===0?(m._observer?.disconnect(),m._observer=null,m._ratios.clear(),m._active=null):m._syncActive(),this.el.Expressive_ScrollSpy=void 0}static _ensureObserver(o){m._observer||typeof IntersectionObserver>"u"||(m._observer=new IntersectionObserver(m._onIntersect,{rootMargin:`-${o}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}))}static _syncActive(){if(!m._elements.length)return;let o=m._elements[0].options,t=null,e=0;for(let s of m._elements){let n=m._ratios.get(s.el)??0;n>e&&(e=n,t=s)}if(!t)if(o.keepTopElementActive)t=m._nearestAbove()??m._elements[0];else{m._clearActive(o);return}let i=m._linkFor(t.el.id,t.options);i!==m._active&&(m._clearActive(o),i&&(i.classList.add(t.options.activeClass),i.setAttribute("aria-current","true"),m._active=i))}static _nearestAbove(){let o=null,t=-1/0;for(let e of m._elements){let i=e.el.getBoundingClientRect().top;i<=0&&i>=t&&(t=i,o=e)}return o}static _clearActive(o){m._active&&(m._active.classList.remove(o.activeClass),m._active.removeAttribute("aria-current"),m._active=null)}static _linkFor(o,t){if(!o)return null;if(t.getActiveElement!==yt)try{return document.querySelector(t.getActiveElement(o))}catch{return null}let e=`#${o}`,i=document.querySelectorAll('a[href^="#"]');for(let s=0;s<i.length;s++)if(i[s].getAttribute("href")===e)return i[s];return null}};m._elements=[],m._observer=null,m._ratios=new Map,m._active=null,m._onIntersect=o=>{for(let t of o)t.isIntersecting&&t.intersectionRatio>0?m._ratios.set(t.target,t.intersectionRatio):m._ratios.delete(t.target);m._syncActive()};var G=m;var se={edge:"left",draggable:!0,dragTargetWidth:"10px",onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},ne="(width >= 840px)",M=class M extends v{constructor(t,e){super(t,e,M);this.open=()=>{if(!(this._isCurrentlyFixed()||this.isOpen||!this._dialog)){if(M._sidenavs.forEach(t=>{t!==this&&t.isOpen&&t.close()}),typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isOpen=!0,this._dialog.classList.remove("dragging"),this._clearShift(),!this._dialog.open)try{this._dialog.showModal()}catch{}this._syncTriggers(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)}};this.close=()=>{this._isCurrentlyFixed()||!this.isOpen||(this._beginClose(),this._dialog?.open?(this._closing=!0,this._dialog.close()):this._finishClose())};this._onDialogClose=()=>{if(this.isOpen){this._beginClose(),this._finishClose();return}this._closing&&(this._closing=!1,this._finishClose())};this._onBreakpointChange=()=>{this._isCurrentlyFixed()&&this.isOpen&&this.close()};this._handleCloseTriggerClick=t=>{let e=t.target;if(!(e instanceof Element))return;e.closest(".sidenav-close, .navigation-drawer-close")&&!this._isCurrentlyFixed()&&this.close()};this._handleDragTargetDrag=t=>{if(!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?e:-e,s=Math.min(this._width,Math.max(0,i)),n=this._width?s/this._width:0;this._applyShift(s-this._width,n)};this._handleDragTargetRelease=()=>{this.isDragged&&(this._dialog?.classList.remove("dragging"),this.percentOpen>.2?this.open():this._dialog?.open&&!this.isOpen&&(this._clearShift(),this._dialog.close()),this.isDragged=!1,this._verticallyScrolling=!1)};this._handleCloseDrag=t=>{if(!this.isOpen||!this._isDraggable())return;let e=this._rawDelta(t),i=this.options.edge==="left"?-e:e,s=Math.min(this._width,Math.max(0,i)),n=this._width?1-s/this._width:1;this._applyShift(-s,n)};this._handleCloseRelease=()=>{!this.isOpen||!this.isDragged||(this._dialog?.classList.remove("dragging"),this.percentOpen>.8?this._clearShift():this.close(),this.isDragged=!1,this._verticallyScrolling=!1)};this.el.Expressive_NavigationDrawer=this,this.options={...M.defaults,...e},this.id=this.el.id,this.isOpen=!1,this.isFixed=this.el.classList.contains("navigation-drawer-fixed")||this.el.classList.contains("sidenav-fixed"),this.isDragged=!1,this.dragTarget=null,this._dialog=null,this._createdDialog=!1,this._closing=!1,this.percentOpen=0,this._startingXpos=0,this._xPos=0,this._width=0,this._initialScrollTop=0,this._verticallyScrolling=!1,this._mql=window.matchMedia(ne),this._setupDialog(),this._createDragTarget(),this._setupClasses(),this._setupEventHandlers(),this._syncTriggers(),M._sidenavs.push(this)}static get defaults(){return se}static init(t,e={}){return super.init(t,e,M)}static getInstance(t){return t.Expressive_NavigationDrawer}destroy(){if(this._removeEventHandlers(),this._dialog?.open)try{this._dialog.close()}catch{}this._clearShift(),this._unwrapDialog(),this._removeDragTarget(),this.el.Expressive_NavigationDrawer=void 0;let t=M._sidenavs.indexOf(this);t>=0&&M._sidenavs.splice(t,1)}_beginClose(){this.isOpen=!1,this._dialog?.classList.remove("dragging"),this._clearShift(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this._syncTriggers()}_finishClose(){typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el)}_setupDialog(){if(this.el instanceof HTMLDialogElement){this._dialog=this.el,this._createdDialog=!1;return}let t=this.el.parentElement;if(t instanceof HTMLDialogElement&&t.classList.contains("sidenav-overlay")){this._dialog=t,this._createdDialog=!1;return}let e=document.createElement("dialog");e.classList.add("sidenav-overlay");let i=this.el.closest("[aria-label], [aria-labelledby]")??this.el,s=i.getAttribute("aria-label"),n=i.getAttribute("aria-labelledby");s?e.setAttribute("aria-label",s):n&&e.setAttribute("aria-labelledby",n),this.el.replaceWith(e),e.appendChild(this.el),this._dialog=e,this._createdDialog=!0}_unwrapDialog(){!this._createdDialog||!this._dialog||(this._dialog.replaceWith(this.el),this._dialog=null,this._createdDialog=!1)}_createDragTarget(){if(!this.options.draggable)return;let t=document.createElement("div");t.classList.add("drag-target"),t.style.width=this.options.dragTargetWidth,this.isFixed&&(t.dataset.fixed=""),c.portalRoot(this.el).appendChild(t),this.dragTarget=t}_removeDragTarget(){this.dragTarget?.remove(),this.dragTarget=null}_setupClasses(){this.options.edge==="right"&&(this.el.classList.add("right-aligned"),this._dialog?.classList.add("right-aligned"),this.dragTarget?.classList.add("right-aligned"))}_setupEventHandlers(){M._sidenavs.length===0&&document.body.addEventListener("click",M._handleTriggerClick);let t={passive:!0};this.dragTarget?.addEventListener("touchmove",this._handleDragTargetDrag,t),this.dragTarget?.addEventListener("touchend",this._handleDragTargetRelease),this._dialog?.addEventListener("touchmove",this._handleCloseDrag,t),this._dialog?.addEventListener("touchend",this._handleCloseRelease),this._dialog?.addEventListener("close",this._onDialogClose),this.el.addEventListener("click",this._handleCloseTriggerClick),this._mql.addEventListener("change",this._onBreakpointChange)}_removeEventHandlers(){M._sidenavs.length===1&&document.body.removeEventListener("click",M._handleTriggerClick),this.dragTarget?.removeEventListener("touchmove",this._handleDragTargetDrag),this.dragTarget?.removeEventListener("touchend",this._handleDragTargetRelease),this._dialog?.removeEventListener("touchmove",this._handleCloseDrag),this._dialog?.removeEventListener("touchend",this._handleCloseRelease),this._dialog?.removeEventListener("close",this._onDialogClose),this.el.removeEventListener("click",this._handleCloseTriggerClick),this._mql.removeEventListener("change",this._onBreakpointChange)}static _handleTriggerClick(t){let e=t.target;if(!(e instanceof Element))return;let i=e.closest(".sidenav-trigger, .navigation-drawer-trigger");if(!i||!(i instanceof HTMLElement))return;let s=c.getIdFromTrigger(i),n=c.getElementById(i,s)?.Expressive_NavigationDrawer;n&&(n.open(),t.preventDefault())}_isDraggable(){return this.options.draggable&&!this._isCurrentlyFixed()&&!this._verticallyScrolling}_isCurrentlyFixed(){return this.isFixed&&this._mql.matches}_startDrag(t){let e=t.targetTouches[0].clientX;if(this.isDragged=!0,this._startingXpos=e,this._xPos=e,this._width=this._dialog?.getBoundingClientRect().width||this.el.getBoundingClientRect().width,this._initialScrollTop=this.isOpen?this.el.scrollTop:c.getDocumentScrollTop(),this._verticallyScrolling=!1,this._dialog?.classList.add("dragging"),this._dialog&&!this._dialog.open)try{this._dialog.showModal()}catch{}}_dragMoveUpdate(t){let e=t.targetTouches[0].clientX,i=this.isOpen?this.el.scrollTop:c.getDocumentScrollTop();this._xPos=e,this._initialScrollTop!==i&&(this._verticallyScrolling=!0)}_rawDelta(t){return this.isDragged||this._startDrag(t),this._dragMoveUpdate(t),this._xPos-this._startingXpos}_applyShift(t,e){this.percentOpen=e;let i=this._dialog??this.el;i.style.setProperty("--md-comp-nav-drawer-shift",`${t}px`),i.style.setProperty("--md-comp-nav-drawer-open",String(e))}_clearShift(){let t=this._dialog??this.el;t.style.removeProperty("--md-comp-nav-drawer-shift"),t.style.removeProperty("--md-comp-nav-drawer-open")}_syncTriggers(){this.id&&document.querySelectorAll(".sidenav-trigger, .navigation-drawer-trigger").forEach(t=>{t instanceof HTMLElement&&c.getIdFromTrigger(t)===this.id&&(t.setAttribute("aria-expanded",this.isOpen?"true":"false"),t.setAttribute("aria-controls",this.id))})}};M._sidenavs=[];var V=M;var oe={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},ae="(width < 600px)",Z=class u extends v{constructor(t,e){super(t,e,u);this.expand=()=>{this.isExpanded||(typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),this.isExpanded=!0,this.el.classList.add("expanded"),this._sync(),typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el))};this.collapse=()=>{this.isExpanded&&(typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),this.isExpanded=!1,this.el.classList.remove("expanded"),this._sync(),typeof this.options.onCloseEnd=="function"&&this.options.onCloseEnd.call(this,this.el))};this.toggle=()=>{this.isExpanded?this.collapse():this.expand()};this._onClick=t=>{let e=t.target;if(e instanceof Node){if(this._toggle&&(e===this._toggle||this._toggle.contains(e))){this.toggle(),t.preventDefault();return}e===this.el&&this.isExpanded&&this._isModal()&&this.collapse()}};this._onKeyDown=t=>{t.key==="Escape"&&this.isExpanded&&this._isModal()&&this.collapse()};this.el.Expressive_NavigationRail=this,this.options={...u.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(ae),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return oe}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_NavigationRail}destroy(){this.el.removeEventListener("click",this._onClick),document.removeEventListener("keydown",this._onKeyDown),this.el.Expressive_NavigationRail=void 0}_findToggle(){let t=this.el.querySelector(":scope > button:not(.button)");return t instanceof HTMLButtonElement?t:null}_isCompact(){return this._mql.matches}_isModal(){return this.el.classList.contains("modal")||this._isCompact()}_sync(){this.el.setAttribute("aria-expanded",this.isExpanded?"true":"false"),this._toggle?.setAttribute("aria-expanded",this.isExpanded?"true":"false")}};var re={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},Q=class u extends v{constructor(t,e){super(t,e,u);this._handleWindowResize=()=>{this._setTabsAndTabWidth(),this._tabWidth!==0&&this._tabsWidth!==0&&(this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px")};this._handleTabClick=t=>{let e=t.target;if(!e)return;let i=e.closest("a");if(!i||!Array.from(this._tabLinks).includes(i))return;let s=i.parentElement;if(i.classList.contains("disabled")||i.getAttribute("aria-disabled")==="true"||s?.classList.contains("disabled")){t.preventDefault();return}if(i.hasAttribute("target"))return;let a=this._content;i.hash&&(this._content=document.querySelector(i.hash)),this._tabLinks=this._queryTabLinks(),this._setActiveTabLink(i);let l=this._index;this._index=Math.max(Array.from(this._tabLinks).indexOf(i),0),this.options.swipeable?this._tabsCarousel&&this._tabsCarousel.set(this._index,()=>{typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}):this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),a&&a!==this._content&&(a.style.display="none",a.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(l),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...u.defaults,...e},this._tabLinks=this._queryTabLinks(),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return re}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.parentNode.removeChild(this._indicator),this.options.swipeable?this._teardownSwipeableTabs():this._teardownNormalTabs(),this.el.Expressive_Tabs=void 0}get index(){return this._index}_setupEventHandlers(){window.addEventListener("resize",this._handleWindowResize),this.el.addEventListener("click",this._handleTabClick)}_removeEventHandlers(){window.removeEventListener("resize",this._handleWindowResize),this.el.removeEventListener("click",this._handleTabClick)}_queryTabLinks(){return this.el.querySelectorAll(":scope > a, :scope > .tab > a")}_createIndicator(){let t=this.el.tagName==="UL"||this.el.tagName==="OL"?"li":"span",e=document.createElement(t);e.classList.add("indicator"),this.el.appendChild(e),this._indicator=e,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}_setActiveTabLink(t){Array.from(this._tabLinks).forEach(e=>{e.classList.remove("active"),e.removeAttribute("aria-current")}),this._activeTabLink=t,t.classList.add("active"),t.setAttribute("aria-current","page")}_setupActiveTabLink(){if(this._activeTabLink=Array.from(this._tabLinks).find(t=>t.getAttribute("href")===location.hash),!this._activeTabLink){let t=this.el.querySelector("a.active");t||(t=this._tabLinks[0]),this._activeTabLink=t}this._setActiveTabLink(this._activeTabLink),this._index=Math.max(Array.from(this._tabLinks).indexOf(this._activeTabLink),0),this._activeTabLink&&this._activeTabLink.hash&&(this._content=document.querySelector(this._activeTabLink.hash),this._content&&this._content.classList.add("active"))}_setupSwipeableTabs(){window.innerWidth>this.options.responsiveThreshold&&(this.options.swipeable=!1);let t=[];this._tabLinks.forEach(i=>{if(i.hash){let s=document.querySelector(i.hash);s.classList.add("carousel-item"),t.push(s)}});let e=document.createElement("div");e.classList.add("tabs-content","carousel","flat"),t[0].parentElement.insertBefore(e,t[0]),t.forEach(i=>{e.appendChild(i),i.style.display=""}),this._tabsCarousel=N.init(e,{fullWidth:!0,noWrap:!0,onCycleTo:i=>{let s=this._index;this._index=Array.from(i.parentNode.children).indexOf(i),this._activeTabLink.classList.remove("active"),this._activeTabLink=Array.from(this._tabLinks)[this._index],this._activeTabLink.classList.add("active"),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}}),this._tabsCarousel.set(this._index)}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),t.append(t.parentElement),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(t!==this._activeTabLink&&t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="none")}})}_teardownNormalTabs(){this._tabLinks.forEach(t=>{if(t.hash){let e=document.querySelector(t.hash);e&&(e.style.display="")}})}_setTabsAndTabWidth(){this._tabsWidth=this.el.getBoundingClientRect().width,this._tabWidth=Math.max(this._tabsWidth,this.el.scrollWidth)/this._tabLinks.length}_calcRightPos(t){return Math.ceil(this._tabsWidth-t.offsetLeft-t.getBoundingClientRect().width)}_calcLeftPos(t){return Math.floor(t.offsetLeft)}updateTabIndicator(){this._setTabsAndTabWidth(),this._animateIndicator(this._index)}_animateIndicator(t){let e=0,i=0;this._index-t>=0?e=90:i=90,this._indicator.style.transition=`
28
28
  left ${this.options.duration}ms ease-out ${e}ms,
29
- right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var ee={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},y=class y extends g{constructor(t,e){super(t,e,y);this._clockBuilt=!1;this._handleInputClick=()=>{this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show()};this._handleInputKeydown=t=>{r.keys.ENTER.includes(t.key)&&(t.preventDefault(),this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show())};this._handleTimeInputEnterKey=t=>{r.keys.ENTER.includes(t.key)&&(t.preventDefault(),this._inputFromTextField())};this._handleClockClickStart=t=>{t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1;let s=y._Pos(t);this.dx=s.x-this.x0,this.dy=s.y-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("mousemove",this._handleDocumentClickMove),document.addEventListener("touchmove",this._handleDocumentClickMove),document.addEventListener("mouseup",this._handleDocumentClickEnd),document.addEventListener("touchend",this._handleDocumentClickEnd)};this._handleDocumentClickMove=t=>{t.preventDefault();let e=y._Pos(t),i=e.x-this.x0,s=e.y-this.y0;this.moved=!0,this.setHand(i,s,!1)};this._handleDocumentClickEnd=t=>{t.preventDefault(),document.removeEventListener("mouseup",this._handleDocumentClickEnd),document.removeEventListener("touchend",this._handleDocumentClickEnd);let e=y._Pos(t),i=e.x-this.x0,s=e.y-this.y0;this.moved&&i===this.dx&&s===this.dy&&this.setHand(i,s),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):setTimeout(()=>{this.options.autoSubmit&&this.done()},this.options.duration/2),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("mousemove",this._handleDocumentClickMove),document.removeEventListener("touchmove",this._handleDocumentClickMove)};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmKeypress=t=>{r.keys.ENTER.includes(t.key)&&this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt(),t==="minutes"&&getComputedStyle(this.hoursView).visibility;let i=t==="hours",s=i?this.hoursView:this.minutesView,o=i?this.minutesView:this.hoursView;this.currentView=t,o.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{o.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=()=>{let t=this.currentView==="hours";if(t&&this.inputHours.value!==""){let e=parseInt(this.inputHours.value);e>0&&e<(this.options.twelveHour?13:24)?this.hours=e:this.setHoursDefault(),this.drawClockFromTimeInput(this.hours,t)}else if(!t&&this.inputMinutes.value!==""){let e=parseInt(this.inputMinutes.value);e>=0&&e<60?this.minutes=e:(this.minutes=new Date().getMinutes(),this.inputMinutes.value=this.minutes.toString()),this.drawClockFromTimeInput(this.minutes,t)}};this.done=(t=null)=>{let e=this.el.value,i=t?"":y._addLeadingZero(this.hours)+":"+y._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...y.defaults,...e},this.id=r.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=U.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ee}static init(t,e={}){return super.init(t,e,y)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static _Pos(t){return t.type.startsWith("touch")&&t.targetTouches.length>=1?{x:t.targetTouches[0].clientX,y:t.targetTouches[0].clientY}:{x:t.clientX,y:t.clientY}}static getInstance(t){return t.Expressive_Timepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("mousedown",this._handleClockClickStart),this.plate.addEventListener("touchstart",this._handleClockClickStart),this.digitalClock.addEventListener("keyup",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("mousemove",this._handleDocumentClickMove),document.removeEventListener("touchmove",this._handleDocumentClickMove),document.removeEventListener("mouseup",this._handleDocumentClickEnd),document.removeEventListener("touchend",this._handleDocumentClickEnd)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=y._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){r.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||r.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("div"),this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.tabIndex=0,this._amBtn.addEventListener("click",this._handleAmPmClick),this._amBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("div"),this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.tabIndex=0,this._pmBtn.addEventListener("click",this._handleAmPmClick),this._pmBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=y._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let o=y._createSVGEl("g");o.setAttribute("transform","translate("+t+","+t+")");let a=y._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let l=y._createSVGEl("line");l.setAttribute("x1","0"),l.setAttribute("y1","0");let h=y._createSVGEl("circle");h.setAttribute("class","timepicker-canvas-bg"),h.setAttribute("r",e.toString()),o.appendChild(l),o.appendChild(h),o.appendChild(a),s.appendChild(o),this._canvas.appendChild(s),this.hand=l,this.bg=h,this.bearing=a,this.g=o}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=y._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled")))}_updateTimeFromInput(){let t=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&!(typeof t[1]>"u")&&(t[1].toUpperCase().indexOf("AM")>0?this.amOrPm="AM":this.amOrPm="PM",t[1]=t[1].replace("AM","").replace("PM","")),t[0]==="now"){let e=new Date(+new Date+this.options.fromNow);t=[e.getHours().toString(),e.getMinutes().toString()],this.options.twelveHour&&(this.amOrPm=parseInt(t[0])>=12&&parseInt(t[0])<24?"PM":"AM")}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.inputHours.value=y._addLeadingZero(this.hours),this.inputMinutes.value=y._addLeadingZero(this.minutes),this._updateAmPmView()}resetClock(t){let e=this.currentView,i=this[e],s=e==="hours",o=Math.PI/(s?6:30),a=i*o,l=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,h=Math.sin(a)*l,d=-Math.cos(a)*l;t?(this._canvas?.classList.add("timepicker-canvas-out"),setTimeout(()=>{this._canvas?.classList.remove("timepicker-canvas-out"),this.setHand(h,d)},t)):this.setHand(h,d)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,o;this.options.twelveHour?o=this.options.outerRadius:o=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,o)}setHand(t,e,i=!1){let s=this.currentView==="hours",o=Math.PI/(s||i?6:30),a=Math.sqrt(t*t+e*e),l=s&&a<(this.options.outerRadius+this.options.innerRadius)/2,h=Math.atan2(t,-e),d=l?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(d=this.options.outerRadius),h<0&&(h=Math.PI*2+h);let c=Math.round(h/o);h=c*o,this.options.twelveHour?s?c===0&&(c=12):(i&&(c*=5),c===60&&(c=0)):s?(c===12&&(c=0),c=l?c===0?12:c:c===0?0:c+12):(i&&(c*=5),c===60&&(c=0)),this[this.currentView]!==c&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=c,s?this.inputHours.value=y._addLeadingZero(c):this.inputMinutes.value=y._addLeadingZero(c),this.setClockAttributes(h,d)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),o=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",o.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=y._addLeadingZero(Number(this.inputHours.value))}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=y._addLeadingZero(Number(this.inputMinutes.value))}setHoursDefault(){this.hours=new Date().getHours(),this.inputHours.value=(this.hours%(this.options.twelveHour?12:24)).toString()}};y._template=`<div class="timepicker-container">
29
+ right ${this.options.duration}ms ease-out ${i}ms`,this._indicator.style.left=this._calcLeftPos(this._activeTabLink)+"px",this._indicator.style.right=this._calcRightPos(this._activeTabLink)+"px"}select(t){let e=Array.from(this._tabLinks).find(i=>i.getAttribute("href")==="#"+t);e&&e.click()}};var le={dialRadius:135,outerRadius:105,innerRadius:70,tickRadius:20,duration:350,container:null,defaultTime:"now",fromNow:0,showClearBtn:!1,autoSubmit:!0,i18n:{cancel:"Cancel",clear:"Clear",done:"Ok"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},y=class y extends v{constructor(t,e){super(t,e,y);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show()};this._handleInputKeydown=t=>{t.key===c.keys.ENTER&&(t.preventDefault(),this._ensureClockBuilt(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this),this.displayPlugin&&this.displayPlugin.show())};this._handleTimeInputEnterKey=t=>{t.key===c.keys.ENTER&&(t.preventDefault(),this._inputFromTextField())};this._handleClockClickStart=t=>{if(!t.isPrimary||t.pointerType==="mouse"&&t.button!==0)return;t.preventDefault(),this._ensureClockBuilt();let e=this.plate.getBoundingClientRect(),i={x:e.left,y:e.top};this.x0=i.x+this.options.dialRadius,this.y0=i.y+this.options.dialRadius,this.moved=!1,this._dragPointerId=t.pointerId,this.dx=t.clientX-this.x0,this.dy=t.clientY-this.y0,this.setHand(this.dx,this.dy,!1),document.addEventListener("pointermove",this._handleDocumentClickMove),document.addEventListener("pointerup",this._handleDocumentClickEnd),document.addEventListener("pointercancel",this._handleDocumentClickCancel)};this._handleDocumentClickMove=t=>{if(t.pointerId!==this._dragPointerId)return;t.preventDefault();let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved=!0,this.setHand(e,i,!1)};this._handleDocumentClickEnd=t=>{if(t.pointerId!==this._dragPointerId)return;this._dragPointerId=null,t.preventDefault(),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel);let e=t.clientX-this.x0,i=t.clientY-this.y0;this.moved&&e===this.dx&&i===this.dy&&this.setHand(e,i),this.currentView==="hours"?(this.inputMinutes.focus(),this.showView("minutes",this.options.duration/2)):setTimeout(()=>{this.options.autoSubmit&&this.done()},this.options.duration/2),typeof this.options.onSelect=="function"&&this.options.onSelect.call(this,this.hours,this.minutes),document.removeEventListener("pointermove",this._handleDocumentClickMove)};this._handleDocumentClickCancel=t=>{t.pointerId===this._dragPointerId&&(this._dragPointerId=null,this.moved=!1,document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel))};this._handleAmPmClick=t=>{this._handleAmPmInteraction(t.target)};this._handleAmPmKeypress=t=>{t.key===c.keys.ENTER&&this._handleAmPmInteraction(t.target)};this._handleAmPmInteraction=t=>{this.amOrPm=t.classList.contains("am-btn")?"AM":"PM",this._updateAmPmView()};this.showView=(t,e=null)=>{this._ensureClockBuilt();let i=t==="hours",s=i?this.hoursView:this.minutesView,n=i?this.minutesView:this.hoursView;this.currentView=t,n.classList.add("timepicker-dial-out"),s.style.visibility="visible",s.classList.remove("timepicker-dial-out"),this.resetClock(e),clearTimeout(this.toggleViewTimer),this.toggleViewTimer=setTimeout(()=>{n.style.visibility="hidden"},this.options.duration)};this._inputFromTextField=()=>{let t=this.currentView==="hours";if(t&&this.inputHours.value!==""){let e=parseInt(this.inputHours.value);e>0&&e<(this.options.twelveHour?13:24)?this.hours=e:this.setHoursDefault(),this.drawClockFromTimeInput(this.hours,t)}else if(!t&&this.inputMinutes.value!==""){let e=parseInt(this.inputMinutes.value);e>=0&&e<60?this.minutes=e:(this.minutes=new Date().getMinutes(),this.inputMinutes.value=this.minutes.toString()),this.drawClockFromTimeInput(this.minutes,t)}};this.done=(t=null)=>{let e=this.el.value,i=t?"":y._addLeadingZero(this.hours)+":"+y._addLeadingZero(this.minutes);this.time=i,!t&&this.options.twelveHour&&(i=`${i} ${this.amOrPm}`),this.el.value=i,i!==e&&this.el.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0,composed:!0}))};this.confirm=()=>{this.done(),typeof this.options.onDone=="function"&&this.options.onDone.call(this)};this.cancel=()=>{typeof this.options.onCancel=="function"&&this.options.onCancel.call(this)};this.clear=()=>{this.done(!0)};this.el.Expressive_Timepicker=this,this.options={...y.defaults,...e},this.id=c.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=Y.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return le}static init(t,e={}){return super.init(t,e,y)}static _addLeadingZero(t){return(t<10?"0":"")+t}static _createSVGEl(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}static getInstance(t){return t.Expressive_Timepicker}destroy(){this._removeEventHandlers(),this.displayPlugin?.destroy(),this.containerEl.remove(),this.el.Expressive_Timepicker=void 0}_setupEventHandlers(){this.el.addEventListener("click",this._handleInputClick),this.el.addEventListener("keydown",this._handleInputKeydown),this.plate.addEventListener("pointerdown",this._handleClockClickStart),this.digitalClock.addEventListener("keyup",this._inputFromTextField),this.inputHours.addEventListener("focus",()=>this.showView("hours")),this.inputHours.addEventListener("focusout",()=>this.formatHours()),this.inputMinutes.addEventListener("focus",()=>this.showView("minutes")),this.inputMinutes.addEventListener("focusout",()=>this.formatMinutes())}_removeEventHandlers(){this.el.removeEventListener("click",this._handleInputClick),this.el.removeEventListener("keydown",this._handleInputKeydown),document.removeEventListener("pointermove",this._handleDocumentClickMove),document.removeEventListener("pointerup",this._handleDocumentClickEnd),document.removeEventListener("pointercancel",this._handleDocumentClickCancel)}_insertHTMLIntoDOM(){let t=document.createElement("template");t.innerHTML=y._template.trim(),this.containerEl=t.content.firstChild,this.containerEl.id="container-"+this.id;let e=this.options.container,i=e instanceof HTMLElement?e:document.querySelector(e);this.options.container&&i?i.append(this.containerEl):this.el.parentElement.appendChild(this.containerEl)}_setupVariables(){this.currentView="hours",this.canVibrate=typeof navigator.vibrate=="function",this._canvas=this.containerEl.querySelector(".timepicker-canvas"),this.plate=this.containerEl.querySelector(".timepicker-plate"),this.digitalClock=this.containerEl.querySelector(".timepicker-display-column"),this.hoursView=this.containerEl.querySelector(".timepicker-hours"),this.minutesView=this.containerEl.querySelector(".timepicker-minutes"),this.inputHours=this.containerEl.querySelector(".timepicker-input-hours"),this.inputMinutes=this.containerEl.querySelector(".timepicker-input-minutes"),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){c.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||c.createConfirmationContainer(this.footer,this.options.i18n.done,this.options.i18n.cancel,this.confirm,this.cancel),this._updateTimeFromInput(),this.options.displayPlugin||this.showView("hours")}_ensureClockBuilt(){this._clockBuilt||(this._clockBuilt=!0,this._clockSetup(),this._updateAmPmView())}_clockSetup(){this.options.twelveHour&&(this._amBtn=document.createElement("div"),this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.tabIndex=0,this._amBtn.addEventListener("click",this._handleAmPmClick),this._amBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("div"),this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.tabIndex=0,this._pmBtn.addEventListener("click",this._handleAmPmClick),this._pmBtn.addEventListener("keypress",this._handleAmPmKeypress),this.spanAmPm.appendChild(this._pmBtn)),this._buildHoursView(),this._buildMinutesView(),this._buildSVGClock()}_buildSVGClock(){let t=this.options.dialRadius,e=this.options.tickRadius,i=t*2,s=y._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=y._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let a=y._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let l=y._createSVGEl("line");l.setAttribute("x1","0"),l.setAttribute("y1","0");let h=y._createSVGEl("circle");h.setAttribute("class","timepicker-canvas-bg"),h.setAttribute("r",e.toString()),n.appendChild(l),n.appendChild(h),n.appendChild(a),s.appendChild(n),this._canvas.appendChild(s),this.hand=l,this.bg=h,this.bearing=a,this.g=n}_buildHoursView(){if(this.options.twelveHour)for(let t=1;t<13;t+=1){let e=t/6*Math.PI,i=this.options.outerRadius;this._buildHoursTick(t,e,i)}else for(let t=0;t<24;t+=1){let e=t/6*Math.PI,s=t>0&&t<13?this.options.innerRadius:this.options.outerRadius;this._buildHoursTick(t,e,s)}}_buildHoursTick(t,e,i){let s=document.createElement("div");s.classList.add("timepicker-tick"),s.style.left=this.options.dialRadius+Math.sin(e)*i-this.options.tickRadius+"px",s.style.top=this.options.dialRadius-Math.cos(e)*i-this.options.tickRadius+"px",s.textContent=t===0?"00":t.toString(),this.hoursView.appendChild(s)}_buildMinutesView(){let t=document.createElement("div");t.classList.add("timepicker-tick");for(let e=0;e<60;e+=5){let i=t.cloneNode(!0),s=e/30*Math.PI;i.style.left=this.options.dialRadius+Math.sin(s)*this.options.outerRadius-this.options.tickRadius+"px",i.style.top=this.options.dialRadius-Math.cos(s)*this.options.outerRadius-this.options.tickRadius+"px",i.textContent=y._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||this.options.twelveHour&&(this.amOrPm==="PM"?(this._amBtn.classList.remove("filled"),this._pmBtn.classList.add("filled")):this.amOrPm==="AM"&&(this._amBtn.classList.add("filled"),this._pmBtn.classList.remove("filled")))}_updateTimeFromInput(){let t=((this.el.value||this.options.defaultTime||"")+"").split(":");if(this.options.twelveHour&&!(typeof t[1]>"u")&&(t[1].toUpperCase().indexOf("AM")>0?this.amOrPm="AM":this.amOrPm="PM",t[1]=t[1].replace("AM","").replace("PM","")),t[0]==="now"){let e=new Date(+new Date+this.options.fromNow);t=[e.getHours().toString(),e.getMinutes().toString()],this.options.twelveHour&&(this.amOrPm=parseInt(t[0])>=12&&parseInt(t[0])<24?"PM":"AM")}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.inputHours.value=y._addLeadingZero(this.hours),this.inputMinutes.value=y._addLeadingZero(this.minutes),this._updateAmPmView()}resetClock(t){let e=this.currentView,i=this[e],s=e==="hours",n=Math.PI/(s?6:30),a=i*n,l=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,h=Math.sin(a)*l,r=-Math.cos(a)*l;t?(this._canvas?.classList.add("timepicker-canvas-out"),setTimeout(()=>{this._canvas?.classList.remove("timepicker-canvas-out"),this.setHand(h,r)},t)):this.setHand(h,r)}drawClockFromTimeInput(t,e){let i=Math.PI/(e?6:30),s=t*i,n;this.options.twelveHour?n=this.options.outerRadius:n=e&&t>0&&t<13?this.options.innerRadius:this.options.outerRadius,this.setClockAttributes(s,n)}setHand(t,e,i=!1){let s=this.currentView==="hours",n=Math.PI/(s||i?6:30),a=Math.sqrt(t*t+e*e),l=s&&a<(this.options.outerRadius+this.options.innerRadius)/2,h=Math.atan2(t,-e),r=l?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(r=this.options.outerRadius),h<0&&(h=Math.PI*2+h);let d=Math.round(h/n);h=d*n,this.options.twelveHour?s?d===0&&(d=12):(i&&(d*=5),d===60&&(d=0)):s?(d===12&&(d=0),d=l?d===0?12:d:d===0?0:d+12):(i&&(d*=5),d===60&&(d=0)),this[this.currentView]!==d&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=d,s?this.inputHours.value=y._addLeadingZero(d):this.inputMinutes.value=y._addLeadingZero(d),this.setClockAttributes(h,r)}setClockAttributes(t,e){if(!this.hand||!this.bg)return;let i=Math.sin(t)*(e-this.options.tickRadius),s=-Math.cos(t)*(e-this.options.tickRadius),n=Math.sin(t)*e,a=-Math.cos(t)*e;this.hand.setAttribute("x2",i.toString()),this.hand.setAttribute("y2",s.toString()),this.bg.setAttribute("cx",n.toString()),this.bg.setAttribute("cy",a.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=y._addLeadingZero(Number(this.inputHours.value))}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=y._addLeadingZero(Number(this.inputMinutes.value))}setHoursDefault(){this.hours=new Date().getHours(),this.inputHours.value=(this.hours%(this.options.twelveHour?12:24)).toString()}};y._template=`<div class="timepicker-container">
30
30
  <div class="timepicker-digital-display">
31
31
  <div class="timepicker-text-container">
32
32
  <div class="timepicker-display-column timepicker-display-digital-clock">
@@ -53,14 +53,14 @@ var Expressive=(()=>{var ut=Object.defineProperty;var It=Object.getOwnPropertyDe
53
53
  </div>
54
54
  <div class="timepicker-footer"></div>
55
55
  </div>
56
- </div>`;var et=y;var ie={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8},v=class v{constructor(n={}){this._dismissed=!1;if(this.options={...v.defaults,...n},n.displayLength===void 0&&this.options.action&&(this.options.displayLength=1e4),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength,v._snackbars.length>0){for(let e of[...v._snackbars])e._dismissed=!0,clearTimeout(e.counterTimeout),e.el.remove();v._snackbars.length=0}(!v._container||!v._container.isConnected)&&v._createContainer(),v._snackbars.push(this);let t=this._createSnackbar();t.Expressive_Snackbar=this,this.el=t,this._animateIn(),this._setTimer()}static get defaults(){return ie}static getInstance(n){return n.Expressive_Snackbar}static _createContainer(){let n=document.createElement("div");n.setAttribute("id","snackbar-container"),n.addEventListener("touchstart",v._onDragStart),n.addEventListener("touchmove",v._onDragMove),n.addEventListener("touchend",v._onDragEnd),n.addEventListener("mousedown",v._onDragStart),document.addEventListener("mousemove",v._onDragMove),document.addEventListener("mouseup",v._onDragEnd),document.body.appendChild(n),v._container=n}static _removeContainer(){document.removeEventListener("mousemove",v._onDragMove),document.removeEventListener("mouseup",v._onDragEnd),v._container.remove(),v._container=null}static _onDragStart(n){let t=n.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let i=t.closest(".snackbar").Expressive_Snackbar;if(!i)return;i.panning=!0,i._pauseTimer(),v._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",i.startingXPos=v._xPos(n),i.time=Date.now(),i.xPos=v._xPos(n)}}static _onDragMove(n){if(v._draggedSnackbar){n.preventDefault();let t=v._draggedSnackbar;t.deltaX=Math.abs(t.xPos-v._xPos(n)),t.xPos=v._xPos(n),t.velocityX=t.deltaX/(Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(){if(v._draggedSnackbar){let n=v._draggedSnackbar;n.panning=!1,n.el.classList.remove("panning");let t=n.xPos-n.startingXPos,e=n.el.offsetWidth*n.options.activationPercent;Math.abs(t)>e||n.velocityX>1?(n.wasSwiped=!0,n.dismiss()):(n.el.style.transition="transform .2s, opacity .2s",n.el.style.transform="",n.el.style.opacity="",n._resumeTimer()),v._draggedSnackbar=null}}static _xPos(n){return n.type.startsWith("touch")&&n.targetTouches.length>=1?n.targetTouches[0].clientX:n.clientX}static dismissAll(){for(let n of[...v._snackbars])n.dismiss()}_createSnackbar(){let n=this.options.snackbarId?document.getElementById(this.options.snackbarId):document.createElement("div");if(n instanceof HTMLTemplateElement&&(n=n.content.cloneNode(!0).firstElementChild),n.classList.add("snackbar"),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),this.options.classes.length>0&&n.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let t=document.createElement("p");t.textContent=this.message,n.replaceChildren(t)}if(this.options.action){let t=document.createElement("button");t.type="button",t.textContent=this.options.action,t.addEventListener("click",e=>{e.stopPropagation(),typeof this.options.onAction=="function"&&this.options.onAction(),this.dismiss()}),n.appendChild(t)}if(this.options.dismissible){let t=document.createElement("button");t.type="button",t.className="circle",t.setAttribute("aria-label","Dismiss");let e=document.createElement("i");e.className="material-symbols",e.setAttribute("aria-hidden","true"),e.textContent="close",t.appendChild(e),t.addEventListener("click",i=>{i.stopPropagation(),this.dismiss()}),n.appendChild(t)}return v._container.appendChild(n),n}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
56
+ </div>`;var J=y;var he={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null},p=class p{constructor(o={}){this._dismissed=!1;if(this.options={...p.defaults,...o},o.displayLength===void 0&&this.options.action&&(this.options.displayLength=1e4),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength,p._snackbars.length>0){for(let i of[...p._snackbars])i._dismissed=!0,clearTimeout(i.counterTimeout),i.el.remove();p._snackbars.length=0}let t=c.portalRoot(this.options.root??document.body);(!p._container||!p._container.isConnected||p._container.parentNode!==t)&&(p._container&&p._removeContainer(),p._createContainer(t)),p._snackbars.push(this);let e=this._createSnackbar();e.Expressive_Snackbar=this,this.el=e,this._animateIn(),this._setTimer()}static get defaults(){return he}static getInstance(o){return o.Expressive_Snackbar}static _createContainer(o=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",p._onDragStart),document.addEventListener("pointermove",p._onDragMove),document.addEventListener("pointerup",p._onDragEnd),document.addEventListener("pointercancel",p._onDragCancel),o.appendChild(t),p._container=t}static _removeContainer(){document.removeEventListener("pointermove",p._onDragMove),document.removeEventListener("pointerup",p._onDragEnd),document.removeEventListener("pointercancel",p._onDragCancel),p._container.remove(),p._container=null}static _onDragStart(o){if(!o.isPrimary||o.pointerType==="mouse"&&o.button!==0)return;let t=o.target;if(t&&!t.closest("button, a")&&t.closest(".snackbar")){let i=t.closest(".snackbar").Expressive_Snackbar;if(!i)return;i.panning=!0,i._pauseTimer(),p._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",p._dragPointerId=o.pointerId,i.startingXPos=o.clientX,i.time=Date.now(),i.xPos=o.clientX}}static _onDragMove(o){if(p._dragPointerId===o.pointerId&&p._draggedSnackbar){o.preventDefault();let t=p._draggedSnackbar;t.deltaX=Math.abs(t.xPos-o.clientX),t.xPos=o.clientX,t.velocityX=t.deltaX/(Date.now()-t.time),t.time=Date.now();let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent;t.el.style.transform=`translateX(${e}px)`,t.el.style.opacity=(1-Math.abs(e/i)).toString()}}static _onDragEnd(o){if(p._dragPointerId===o.pointerId&&(p._dragPointerId=null,p._draggedSnackbar)){let t=p._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent;Math.abs(e)>i||t.velocityX>1?(t.wasSwiped=!0,t.dismiss()):(t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer()),p._draggedSnackbar=null}}static _onDragCancel(o){if(p._dragPointerId!==o.pointerId)return;p._dragPointerId=null;let t=p._draggedSnackbar;t&&(t.panning=!1,t.el.classList.remove("panning"),t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer(),p._draggedSnackbar=null)}static dismissAll(){for(let o of[...p._snackbars])o.dismiss()}_createSnackbar(){let o=this.options.snackbarId?c.getElementById(this.options.root??document.body,this.options.snackbarId):document.createElement("div");if(o instanceof HTMLTemplateElement&&(o=o.content.cloneNode(!0).firstElementChild),o.classList.add("snackbar"),o.setAttribute("role","status"),o.setAttribute("aria-live","polite"),o.setAttribute("aria-atomic","true"),this.options.classes.length>0&&o.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let t=document.createElement("p");t.textContent=this.message,o.replaceChildren(t)}if(this.options.action){let t=document.createElement("button");t.type="button",t.textContent=this.options.action,t.addEventListener("click",e=>{e.stopPropagation(),typeof this.options.onAction=="function"&&this.options.onAction(),this.dismiss()}),o.appendChild(t)}if(this.options.dismissible){let t=document.createElement("button");t.type="button",t.className="circle",t.setAttribute("aria-label","Dismiss");let e=document.createElement("i");e.className="material-symbols",e.setAttribute("aria-hidden","true"),e.textContent="close",t.appendChild(e),t.addEventListener("click",i=>{i.stopPropagation(),this.dismiss()}),o.appendChild(t)}return p._container.appendChild(o),o}_animateIn(){this.el.style.display="",this.el.style.opacity="0",this.el.style.transform="translateY(24px)",this.el.style.transition=`
57
57
  transform ${this.options.inDuration}ms ease,
58
58
  opacity ${this.options.inDuration}ms ease
59
- `,setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this.counterTimeout==null&&this._setTimer()}dismiss(){if(this._dismissed)return;this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null;let n=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform=`translateX(${n}px)`,this.el.style.opacity="0"),this.el.style.transition=`
59
+ `,setTimeout(()=>{this.el.style.transform="",this.el.style.opacity="1"},1)}_setTimer(){this.timeRemaining!==1/0&&(this._deadline=Date.now()+this.timeRemaining,this.counterTimeout=setTimeout(()=>this.dismiss(),this.timeRemaining))}_pauseTimer(){this.counterTimeout!=null&&(clearTimeout(this.counterTimeout),this.counterTimeout=null,this.timeRemaining=Math.max(0,this._deadline-Date.now()))}_resumeTimer(){this.counterTimeout==null&&this._setTimer()}dismiss(){if(this._dismissed)return;this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null;let o=this.el.offsetWidth*this.options.activationPercent;this.wasSwiped&&(this.el.style.transition="transform .05s, opacity .05s",this.el.style.transform=`translateX(${o}px)`,this.el.style.opacity="0"),this.el.style.transition=`
60
60
  margin ${this.options.outDuration}ms ease,
61
- opacity ${this.options.outDuration}ms ease`,setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),setTimeout(()=>{if(typeof this.options.completeCallback=="function"&&this.options.completeCallback(),this.el.id!=this.options.snackbarId){this.el.remove();let t=v._snackbars.indexOf(this);t>=0&&v._snackbars.splice(t,1),v._snackbars.length===0&&v._container&&v._container.childElementCount===0&&v._removeContainer()}},this.options.outDuration)}};v._snackbars=[],v._container=null,v._draggedSnackbar=null;var rt=v;var se={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},it=class u extends g{constructor(t,e){super(t,e,u);this.open=t=>{this.isOpen||(t=t===void 0?!0:void 0,this.isOpen=!0,this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t))};this.close=()=>{this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.isFocused=!1,this.open(!1)};this._handleMouseLeave=()=>{this.isHovered=!1,this.isFocused=!1,this.close()};this._handleFocus=()=>{r.tabPressed&&(this.isFocused=!0,this.open(!1))};this._handleBlur=()=>{this.isFocused=!1,this.close()};this.el.Expressive_Tooltip=this,this.options={...u.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return se}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Tooltip}destroy(){this.el.getAttribute("aria-describedby")===this.tooltipEl.id&&this.el.removeAttribute("aria-describedby"),this.tooltipEl.remove(),this._removeEventHandlers(),this.el.Expressive_Tooltip=void 0}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${r.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",this.tooltipEl.id);let t=this.options.tooltipId?document.getElementById(this.options.tooltipId):document.createElement("div");this.options.tooltipId&&this.tooltipEl.classList.add("rich"),t.style.display="",t.classList.add("tooltip-content"),this._setTooltipContent(t),this.tooltipEl.appendChild(t),document.body.appendChild(this.tooltipEl)}_setTooltipContent(t){this.options.tooltipId||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.el.addEventListener("focus",this._handleFocus,!0),this.el.addEventListener("blur",this._handleBlur,!0)}_removeEventHandlers(){this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.el.removeEventListener("focus",this._handleFocus,!0),this.el.removeEventListener("blur",this._handleBlur,!0)}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,s=e.offsetWidth,o=t.offsetHeight,a=t.offsetWidth,l=this.options.margin;this.xMovement=0,this.yMovement=0;let h=e.getBoundingClientRect(),d=h.top+r.getDocumentScrollTop(),c=h.left+r.getDocumentScrollLeft();this.options.position==="top"?(d+=-o-l,c+=s/2-a/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(d+=i/2-o/2,c+=s+l,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(d+=i/2-o/2,c+=-a-l,this.xMovement=-this.options.transitionMovement):(d+=i+l,c+=s/2-a/2,this.yMovement=this.options.transitionMovement);let p=this._repositionWithinScreen(c,d,a,o);t.style.top=p.y+"px",t.style.left=p.x+"px"}_repositionWithinScreen(t,e,i,s){let o=r.getDocumentScrollLeft(),a=r.getDocumentScrollTop(),l=t-o,h=e-a,d={left:l,top:h,width:i,height:s},c=this.options.margin+this.options.transitionMovement,p=r.checkWithinContainer(document.body,d,c);return p.left?l=c:p.right&&(l-=l+i-window.innerWidth),p.top?h=c:p.bottom&&(h-=h+s-window.innerHeight),{x:l+o,y:h+a}}_animateIn(){this._positionTooltip(),this.tooltipEl.style.visibility="visible";let t=this.options.inDuration;this.tooltipEl.style.transition=`
61
+ opacity ${this.options.outDuration}ms ease`,setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),setTimeout(()=>{if(typeof this.options.completeCallback=="function"&&this.options.completeCallback(),this.el.id!=this.options.snackbarId){this.el.remove();let t=p._snackbars.indexOf(this);t>=0&&p._snackbars.splice(t,1),p._snackbars.length===0&&p._container&&p._container.childElementCount===0&&p._removeContainer()}},this.options.outDuration)}};p._dragPointerId=null,p._snackbars=[],p._container=null,p._draggedSnackbar=null;var at=p;var ce={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},tt=class u extends v{constructor(t,e){super(t,e,u);this.open=t=>{this.isOpen||(t=t===void 0?!0:void 0,this.isOpen=!0,this.options={...this.options,...this._getAttributeOptions()},this._updateTooltipContent(),this._setEnterDelayTimeout(t))};this.close=()=>{this.isOpen&&(this.isHovered=!1,this.isFocused=!1,this.isOpen=!1,this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.isFocused=!1,this.open(!1)};this._handleMouseLeave=()=>{this.isHovered=!1,this.isFocused=!1,this.close()};this._handleFocus=()=>{this.el.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=()=>{this.isFocused=!1,this.close()};this.el.Expressive_Tooltip=this,this.options={...u.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return ce}static init(t,e={}){return super.init(t,e,u)}static getInstance(t){return t.Expressive_Tooltip}destroy(){this.el.getAttribute("aria-describedby")===this.tooltipEl.id&&this.el.removeAttribute("aria-describedby"),this.tooltipEl.remove(),this._removeEventHandlers(),this.el.Expressive_Tooltip=void 0}_appendTooltipEl(){this.tooltipEl=document.createElement("div"),this.tooltipEl.classList.add("tooltip"),this.tooltipEl.id=`tooltip-${c.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",this.tooltipEl.id);let t=this.options.tooltipId?c.getElementById(this.el,this.options.tooltipId):document.createElement("div");this.options.tooltipId&&this.tooltipEl.classList.add("rich"),t.style.display="",t.classList.add("tooltip-content"),this._setTooltipContent(t),this.tooltipEl.appendChild(t),c.portalRoot(this.el).appendChild(this.tooltipEl)}_setTooltipContent(t){this.options.tooltipId||(t.innerText=this.options.text)}_updateTooltipContent(){this._setTooltipContent(this.tooltipEl.querySelector(".tooltip-content"))}_setupEventHandlers(){this.el.addEventListener("mouseenter",this._handleMouseEnter),this.el.addEventListener("mouseleave",this._handleMouseLeave),this.el.addEventListener("focus",this._handleFocus,!0),this.el.addEventListener("blur",this._handleBlur,!0)}_removeEventHandlers(){this.el.removeEventListener("mouseenter",this._handleMouseEnter),this.el.removeEventListener("mouseleave",this._handleMouseLeave),this.el.removeEventListener("focus",this._handleFocus,!0),this.el.removeEventListener("blur",this._handleBlur,!0)}_setExitDelayTimeout(){clearTimeout(this._exitDelayTimeout),this._exitDelayTimeout=setTimeout(()=>{this.isHovered||this.isFocused||this._animateOut()},this.options.exitDelay)}_setEnterDelayTimeout(t){clearTimeout(this._enterDelayTimeout),this._enterDelayTimeout=setTimeout(()=>{!this.isHovered&&!this.isFocused&&!t||this._animateIn()},this.options.enterDelay)}_positionTooltip(){let t=this.tooltipEl,e=this.el,i=e.offsetHeight,s=e.offsetWidth,n=t.offsetHeight,a=t.offsetWidth,l=this.options.margin;this.xMovement=0,this.yMovement=0;let h=e.getBoundingClientRect(),r=h.top+c.getDocumentScrollTop(),d=h.left+c.getDocumentScrollLeft();this.options.position==="top"?(r+=-n-l,d+=s/2-a/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(r+=i/2-n/2,d+=s+l,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(r+=i/2-n/2,d+=-a-l,this.xMovement=-this.options.transitionMovement):(r+=i+l,d+=s/2-a/2,this.yMovement=this.options.transitionMovement);let f=this._repositionWithinScreen(d,r,a,n);t.style.top=f.y+"px",t.style.left=f.x+"px"}_repositionWithinScreen(t,e,i,s){let n=c.getDocumentScrollLeft(),a=c.getDocumentScrollTop(),l=t-n,h=e-a,r={left:l,top:h,width:i,height:s},d=this.options.margin+this.options.transitionMovement,f=c.checkWithinContainer(document.body,r,d);return f.left?l=d:f.right&&(l-=l+i-window.innerWidth),f.top?h=d:f.bottom&&(h-=h+s-window.innerHeight),{x:l+n,y:h+a}}_animateIn(){this._positionTooltip(),this.tooltipEl.style.visibility="visible";let t=this.options.inDuration;this.tooltipEl.style.transition=`
62
62
  transform ${t}ms ease-out,
63
63
  opacity ${t}ms ease-out`,setTimeout(()=>{this.tooltipEl.style.transform=`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`,this.tooltipEl.style.opacity=(this.options.opacity||1).toString()},1)}_animateOut(){let t=this.options.outDuration;this.tooltipEl.style.transition=`
64
64
  transform ${t}ms ease-out,
65
- opacity ${t}ms ease-out`,setTimeout(()=>{this.tooltipEl.style.transform="translateX(0px) translateY(0px)",this.tooltipEl.style.opacity="0"},1)}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),s=this.el.getAttribute("data-position");return e&&(t.text=e),s&&(t.position=s),i&&(t.tooltipId=i),t}};var vt={Autocomplete:{component:B,selector:".autocomplete"},Cards:{component:P,selector:pt},Carousel:{component:F,selector:".carousel"},Chips:{component:W,selector:".chips"},Datepicker:{component:z,selector:".datepicker"},Menu:{component:A,selector:".menu-trigger"},Lightbox:{component:j,selector:".lightboxed"},Parallax:{component:G,selector:".parallax"},ScrollSpy:{component:Z,selector:".scrollspy"},FormSelect:{component:H,selector:"select"},Sidenav:{component:Q,selector:".sidenav"},NavigationRail:{component:J,selector:".navigation-rail"},Tabs:{component:tt,selector:".tabs"},Timepicker:{component:et,selector:".timepicker"},Tooltip:{component:it,selector:".tooltipped"},FloatingActionButton:{component:X,selector:".fixed-action-btn"}};function gt(u=document.body,n){for(let t of Object.keys(vt)){let{component:e,selector:i}=vt[t],s=u.querySelectorAll(`:is(${i}):not(.no-autoinit)`);e.init(s,n?.[t]??{})}}var oe="0.7.0-rc.0";typeof document<"u"&&(document.addEventListener("keydown",r.docHandleKeydown,!0),document.addEventListener("keyup",r.docHandleKeyup,!0),document.addEventListener("focus",r.docHandleFocus,!0),document.addEventListener("blur",r.docHandleBlur,!0));K.Init();W.Init();Y.Init();V.Init();P.Init();N.Init();q.Init();$.Init();return At(ae);})();
65
+ opacity ${t}ms ease-out`,setTimeout(()=>{this.tooltipEl.style.transform="translateX(0px) translateY(0px)",this.tooltipEl.style.opacity="0"},1)}_getAttributeOptions(){let t={},e=this.el.getAttribute("data-tooltip"),i=this.el.getAttribute("data-tooltip-id"),s=this.el.getAttribute("data-position");return e&&(t.text=e),s&&(t.position=s),i&&(t.tooltipId=i),t}};var bt={Autocomplete:{component:P,selector:".autocomplete"},Cards:{component:A,selector:dt},ExpandingCard:{component:R,selector:ut},Carousel:{component:N,selector:".carousel"},Chips:{component:B,selector:".chips"},Datepicker:{component:X,selector:".datepicker, .date-picker"},Menu:{component:O,selector:".menu-trigger"},Lightbox:{component:j,selector:".lightboxed"},ScrollSpy:{component:G,selector:".scrollspy"},FormSelect:{component:w,selector:"select"},NavigationDrawer:{component:V,selector:".sidenav, .navigation-drawer"},NavigationRail:{component:Z,selector:".navigation-rail"},Tabs:{component:Q,selector:".tabs"},Timepicker:{component:J,selector:".timepicker, .time-picker"},Tooltip:{component:tt,selector:".tooltipped"},FloatingActionButton:{component:U,selector:".fab, .fixed-action-btn, .fab-menu"}};function Lt(u=document.body,o){for(let t of Object.keys(bt)){let{component:e,selector:i}=bt[t],s=u.querySelectorAll(`:is(${i}):not(.no-autoinit)`);e.init(s,o?.[t]??{})}}var ue="0.8.0";z.Init();B.Init();W.Init();A.Init();R.Init();q.Init();$.Init();K.Init();return Wt(pe);})();
66
66
  //# sourceMappingURL=expressive.min.js.map