@expressivecss/expressive 0.11.0 → 0.13.1
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.
- package/CHANGELOG.md +392 -7
- package/README.md +37 -1
- package/dist/css/expressive.css +5440 -234
- package/dist/css/expressive.css.map +1 -1
- package/dist/css/expressive.min.css +1 -1
- package/dist/css/expressive.min.css.map +1 -1
- package/dist/fonts/material-symbols-outlined.woff2 +0 -0
- package/dist/fonts/material-symbols-rounded.woff2 +0 -0
- package/dist/fonts/material-symbols-sharp.woff2 +0 -0
- package/dist/js/chunks/{chunk-AYYYWUJ4.mjs → chunk-3CLXLPYS.mjs} +17 -11
- package/dist/js/chunks/chunk-3CLXLPYS.mjs.map +7 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs +105 -0
- package/dist/js/chunks/chunk-3DHK5CZU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-IMUPRRI6.mjs → chunk-3VOK6J7U.mjs} +3 -3
- package/dist/js/chunks/chunk-4PWAPV6F.mjs +7 -0
- package/dist/js/chunks/chunk-4PWAPV6F.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XFJ452AZ.mjs → chunk-55IA2XUC.mjs} +5 -6
- package/dist/js/chunks/{chunk-XFJ452AZ.mjs.map → chunk-55IA2XUC.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-XDB3G6RL.mjs → chunk-6N2XAEFK.mjs} +15 -4
- package/dist/js/chunks/{chunk-XDB3G6RL.mjs.map → chunk-6N2XAEFK.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-MISGHDUU.mjs → chunk-6OMRGML6.mjs} +9 -7
- package/dist/js/chunks/{chunk-MISGHDUU.mjs.map → chunk-6OMRGML6.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-A3BJA7V4.mjs → chunk-6WLSDZ4O.mjs} +2 -2
- package/dist/js/chunks/chunk-CCWDV5CR.mjs +292 -0
- package/dist/js/chunks/chunk-CCWDV5CR.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JODJAGFS.mjs → chunk-CKQP6P76.mjs} +31 -8
- package/dist/js/chunks/chunk-CKQP6P76.mjs.map +7 -0
- package/dist/js/chunks/{chunk-KR44BSYQ.mjs → chunk-DLWYKFEI.mjs} +3 -3
- package/dist/js/chunks/chunk-DTKR54I6.mjs +270 -0
- package/dist/js/chunks/chunk-DTKR54I6.mjs.map +7 -0
- package/dist/js/chunks/{chunk-SLFNPY5M.mjs → chunk-EC63CHXU.mjs} +2 -2
- package/dist/js/chunks/chunk-GVGT6MIU.mjs +47 -0
- package/dist/js/chunks/chunk-GVGT6MIU.mjs.map +7 -0
- package/dist/js/chunks/{chunk-LZVBJ33S.mjs → chunk-GZWPXXY6.mjs} +15 -8
- package/dist/js/chunks/chunk-GZWPXXY6.mjs.map +7 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs +48 -0
- package/dist/js/chunks/chunk-HKT2S7VM.mjs.map +7 -0
- package/dist/js/chunks/{chunk-D4UZ4HFN.mjs → chunk-IFXVDDDH.mjs} +23 -11
- package/dist/js/chunks/chunk-IFXVDDDH.mjs.map +7 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs +262 -0
- package/dist/js/chunks/chunk-K4CJCRGE.mjs.map +7 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs +163 -0
- package/dist/js/chunks/chunk-LNCCYGPC.mjs.map +7 -0
- package/dist/js/chunks/{chunk-QSQ24FYT.mjs → chunk-LTWPGFBR.mjs} +2 -2
- package/dist/js/chunks/{chunk-QSQ24FYT.mjs.map → chunk-LTWPGFBR.mjs.map} +2 -2
- package/dist/js/chunks/{chunk-I5KR22BY.mjs → chunk-LWBQIX5J.mjs} +15 -15
- package/dist/js/chunks/chunk-LWBQIX5J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-GY2Z5CJ2.mjs → chunk-NNYP33NB.mjs} +67 -32
- package/dist/js/chunks/chunk-NNYP33NB.mjs.map +7 -0
- package/dist/js/chunks/chunk-NQLC3YMW.mjs +1 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs +406 -0
- package/dist/js/chunks/chunk-O5XPWXIQ.mjs.map +7 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs +166 -0
- package/dist/js/chunks/chunk-P3G3QHII.mjs.map +7 -0
- package/dist/js/chunks/{chunk-VAS6JQ6P.mjs → chunk-PIJ2TAR3.mjs} +3 -3
- package/dist/js/chunks/{chunk-74N6U5JJ.mjs → chunk-PLYXLSH3.mjs} +38 -37
- package/dist/js/chunks/chunk-PLYXLSH3.mjs.map +7 -0
- package/dist/js/chunks/{chunk-PIIAEYAJ.mjs → chunk-QDAL4IYN.mjs} +2 -2
- package/dist/js/chunks/chunk-QKWPQK5N.mjs +179 -0
- package/dist/js/chunks/chunk-QKWPQK5N.mjs.map +7 -0
- package/dist/js/chunks/{chunk-FRB7TOCS.mjs → chunk-QV2JAWIZ.mjs} +2 -2
- package/dist/js/chunks/{chunk-N3UHGN3N.mjs → chunk-QVVEWBOF.mjs} +3 -3
- package/dist/js/chunks/chunk-RHRQKTTX.mjs +139 -0
- package/dist/js/chunks/chunk-RHRQKTTX.mjs.map +7 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs +59 -0
- package/dist/js/chunks/chunk-SPETGK25.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TK6PX2GC.mjs → chunk-U2OTHOTI.mjs} +131 -19
- package/dist/js/chunks/chunk-U2OTHOTI.mjs.map +7 -0
- package/dist/js/chunks/{chunk-TYM6U5DY.mjs → chunk-UAEAQBRC.mjs} +2 -2
- package/dist/js/chunks/{chunk-7UXHSYIA.mjs → chunk-UBLRRJ7N.mjs} +3 -3
- package/dist/js/chunks/{chunk-EP3CVKB5.mjs → chunk-UEZUJQ66.mjs} +8 -5
- package/dist/js/chunks/chunk-UEZUJQ66.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JNPIWFJT.mjs → chunk-UNEMYWEW.mjs} +3 -3
- package/dist/js/chunks/chunk-VTLBW7QS.mjs +124 -0
- package/dist/js/chunks/chunk-VTLBW7QS.mjs.map +7 -0
- package/dist/js/chunks/{chunk-JKNPQQWY.mjs → chunk-WJXDBPXQ.mjs} +28 -12
- package/dist/js/chunks/chunk-WJXDBPXQ.mjs.map +7 -0
- package/dist/js/chunks/{chunk-CDW6WIRT.mjs → chunk-XGHORT7J.mjs} +18 -11
- package/dist/js/chunks/chunk-XGHORT7J.mjs.map +7 -0
- package/dist/js/chunks/{chunk-7GKXUG4B.mjs → chunk-XH6BEEMY.mjs} +78 -25
- package/dist/js/chunks/chunk-XH6BEEMY.mjs.map +7 -0
- package/dist/js/chunks/{chunk-XO5WX3TK.mjs → chunk-YDCS5S3J.mjs} +2 -2
- package/dist/js/expressive.cjs +2540 -233
- package/dist/js/expressive.cjs.map +4 -4
- package/dist/js/expressive.js +2540 -233
- package/dist/js/expressive.js.map +4 -4
- package/dist/js/expressive.min.js +10 -10
- package/dist/js/expressive.min.js.map +4 -4
- package/dist/js/expressive.mjs +86 -38
- package/dist/js/expressive.mjs.map +1 -1
- package/dist/js/internal/behaviors/bottomSheets.mjs +3 -3
- package/dist/js/internal/behaviors/dialogs.mjs +2 -2
- package/dist/js/internal/behaviors/forms.mjs +2 -2
- package/dist/js/internal/behaviors/sheetDrag.mjs +2 -2
- package/dist/js/internal/behaviors/sideSheets.mjs +3 -3
- package/dist/js/internal/components/appBar.mjs +2 -2
- package/dist/js/internal/components/autocomplete.mjs +4 -4
- package/dist/js/internal/components/barChart.mjs +10 -0
- package/dist/js/internal/components/barChart.mjs.map +7 -0
- package/dist/js/internal/components/buttonGroup.mjs +2 -2
- package/dist/js/internal/components/buttons.mjs +3 -3
- package/dist/js/internal/components/cards.mjs +3 -3
- package/dist/js/internal/components/carousel.mjs +3 -3
- package/dist/js/internal/components/characterCounter.mjs +2 -2
- package/dist/js/internal/components/chips.mjs +5 -5
- package/dist/js/internal/components/columnChart.mjs +9 -0
- package/dist/js/internal/components/columnChart.mjs.map +7 -0
- package/dist/js/internal/components/commandPalette.mjs +9 -0
- package/dist/js/internal/components/commandPalette.mjs.map +7 -0
- package/dist/js/internal/components/datepicker.mjs +6 -6
- package/dist/js/internal/components/expandingCard.mjs +3 -3
- package/dist/js/internal/components/heatmapChart.mjs +9 -0
- package/dist/js/internal/components/heatmapChart.mjs.map +7 -0
- package/dist/js/internal/components/index.mjs +79 -31
- package/dist/js/internal/components/lightbox.mjs +3 -3
- package/dist/js/internal/components/lineChart.mjs +12 -0
- package/dist/js/internal/components/lineChart.mjs.map +7 -0
- package/dist/js/internal/components/menu.mjs +3 -3
- package/dist/js/internal/components/messageScroller.mjs +9 -0
- package/dist/js/internal/components/messageScroller.mjs.map +7 -0
- package/dist/js/internal/components/mixedChart.mjs +10 -0
- package/dist/js/internal/components/mixedChart.mjs.map +7 -0
- package/dist/js/internal/components/navigationRail.mjs +2 -2
- package/dist/js/internal/components/pieChart.mjs +9 -0
- package/dist/js/internal/components/pieChart.mjs.map +7 -0
- package/dist/js/internal/components/questionnaire.mjs +9 -0
- package/dist/js/internal/components/questionnaire.mjs.map +7 -0
- package/dist/js/internal/components/radarChart.mjs +9 -0
- package/dist/js/internal/components/radarChart.mjs.map +7 -0
- package/dist/js/internal/components/radialChart.mjs +9 -0
- package/dist/js/internal/components/radialChart.mjs.map +7 -0
- package/dist/js/internal/components/registry.mjs +37 -25
- package/dist/js/internal/components/richTextEditor.mjs +9 -0
- package/dist/js/internal/components/richTextEditor.mjs.map +7 -0
- package/dist/js/internal/components/scrollspy.mjs +2 -2
- package/dist/js/internal/components/select.mjs +4 -4
- package/dist/js/internal/components/slider.mjs +3 -3
- package/dist/js/internal/components/snackbar.mjs +2 -2
- package/dist/js/internal/components/tabs.mjs +4 -4
- package/dist/js/internal/components/timepicker.mjs +4 -4
- package/dist/js/internal/components/tooltip.mjs +3 -3
- package/dist/js/internal/core/component.mjs +1 -1
- package/dist/js/internal/core/utils.mjs +1 -1
- package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
- package/dist/js/modular.mjs +86 -38
- package/dist/types/behaviors/forms.d.ts +22 -0
- package/dist/types/components/appBar.d.ts +1 -1
- package/dist/types/components/barChart.d.ts +24 -0
- package/dist/types/components/columnChart.d.ts +21 -0
- package/dist/types/components/commandPalette.d.ts +96 -0
- package/dist/types/components/datepicker.d.ts +5 -2
- package/dist/types/components/heatmapChart.d.ts +49 -0
- package/dist/types/components/index.d.ts +12 -0
- package/dist/types/components/lineChart.d.ts +134 -0
- package/dist/types/components/menu.d.ts +32 -0
- package/dist/types/components/messageScroller.d.ts +111 -0
- package/dist/types/components/mixedChart.d.ts +25 -0
- package/dist/types/components/pieChart.d.ts +40 -0
- package/dist/types/components/questionnaire.d.ts +96 -0
- package/dist/types/components/radarChart.d.ts +39 -0
- package/dist/types/components/radialChart.d.ts +45 -0
- package/dist/types/components/registry.d.ts +44 -0
- package/dist/types/components/richTextEditor.d.ts +71 -0
- package/dist/types/components/slider.d.ts +1 -0
- package/dist/types/components/snackbar.d.ts +6 -0
- package/dist/types/components/timepicker.d.ts +4 -1
- package/dist/types/components/tooltip.d.ts +2 -1
- package/dist/types/modular.d.ts +10 -1
- package/package.json +4 -1
- package/src/sass/README.md +3 -6
- package/src/sass/abstracts/_index.scss +1 -1
- package/src/sass/abstracts/_mixins.scss +226 -0
- package/src/sass/abstracts/_variables.scss +14 -0
- package/src/sass/base/_typography.scss +45 -0
- package/src/sass/components/_accordion.scss +161 -0
- package/src/sass/components/_aura.scss +119 -0
- package/src/sass/components/_avatar.scss +86 -0
- package/src/sass/components/_bar-chart.scss +285 -0
- package/src/sass/components/_bottom-sheet.scss +1 -0
- package/src/sass/components/_button-groups.scss +13 -3
- package/src/sass/components/_cards.scss +16 -13
- package/src/sass/components/_carousel.scss +9 -7
- package/src/sass/components/_column-chart.scss +134 -0
- package/src/sass/components/_command-palette.scss +140 -0
- package/src/sass/components/_countdown.scss +89 -0
- package/src/sass/components/_data-table.scss +188 -0
- package/src/sass/components/_dialog.scss +1 -0
- package/src/sass/components/_empty-state.scss +78 -0
- package/src/sass/components/_expanding-card.scss +3 -0
- package/src/sass/components/_heatmap-chart.scss +156 -0
- package/src/sass/components/_index.scss +27 -0
- package/src/sass/components/_kpi.scss +162 -0
- package/src/sass/components/_line-chart.scss +102 -0
- package/src/sass/components/_marquee.scss +111 -0
- package/src/sass/components/_menu.scss +10 -0
- package/src/sass/components/_message-scroller.scss +66 -0
- package/src/sass/components/_message.scss +202 -0
- package/src/sass/components/_mixed-chart.scss +157 -0
- package/src/sass/components/_navbar.scss +11 -6
- package/src/sass/components/_navigation-bar.scss +1 -0
- package/src/sass/components/_navigation-rail.scss +9 -0
- package/src/sass/components/_page-footer.scss +0 -11
- package/src/sass/components/_pie-chart.scss +203 -0
- package/src/sass/components/_popover.scss +112 -0
- package/src/sass/components/_progress.scss +25 -6
- package/src/sass/components/_questionnaire.scss +144 -0
- package/src/sass/components/_radar-chart.scss +205 -0
- package/src/sass/components/_radial-chart.scss +174 -0
- package/src/sass/components/_rich-text-editor.scss +99 -0
- package/src/sass/components/_search.scss +1 -0
- package/src/sass/components/_side-sheet.scss +1 -0
- package/src/sass/components/_skeleton.scss +81 -0
- package/src/sass/components/_snackbar.scss +2 -1
- package/src/sass/components/_stat.scss +86 -0
- package/src/sass/components/_stepper.scss +190 -0
- package/src/sass/components/_timeline.scss +114 -0
- package/src/sass/components/_timepicker.scss +2 -2
- package/src/sass/components/_toolbar.scss +2 -1
- package/src/sass/components/_tooltip.scss +2 -0
- package/src/sass/components/_tree.scss +139 -0
- package/src/sass/components/forms/_checkboxes.scss +2 -2
- package/src/sass/components/forms/_drop-zone.scss +128 -0
- package/src/sass/components/forms/_index.scss +2 -0
- package/src/sass/components/forms/_input-fields.scss +166 -15
- package/src/sass/components/forms/_radio-buttons.scss +2 -2
- package/src/sass/components/forms/_rating.scss +165 -0
- package/src/sass/components/forms/_slider.scss +51 -29
- package/src/sass/components/forms/_switches.scss +3 -3
- package/src/sass/tokens/_reference.scss +3 -15
- package/src/sass/utilities/_helpers.scss +14 -0
- package/src/sass/utilities/_index.scss +2 -0
- package/src/sass/utilities/_scroll-area.scss +35 -0
- package/src/sass/utilities/_shapes.scss +164 -0
- package/src/sass/utilities/_spacing.scss +29 -23
- package/src/sass/utilities/_visibility.scss +3 -2
- package/dist/js/chunks/chunk-74N6U5JJ.mjs.map +0 -7
- package/dist/js/chunks/chunk-7GKXUG4B.mjs.map +0 -7
- package/dist/js/chunks/chunk-AYYYWUJ4.mjs.map +0 -7
- package/dist/js/chunks/chunk-CDW6WIRT.mjs.map +0 -7
- package/dist/js/chunks/chunk-D4UZ4HFN.mjs.map +0 -7
- package/dist/js/chunks/chunk-EP3CVKB5.mjs.map +0 -7
- package/dist/js/chunks/chunk-GY2Z5CJ2.mjs.map +0 -7
- package/dist/js/chunks/chunk-I5KR22BY.mjs.map +0 -7
- package/dist/js/chunks/chunk-JKNPQQWY.mjs.map +0 -7
- package/dist/js/chunks/chunk-JODJAGFS.mjs.map +0 -7
- package/dist/js/chunks/chunk-JR24UB4X.mjs +0 -100
- package/dist/js/chunks/chunk-JR24UB4X.mjs.map +0 -7
- package/dist/js/chunks/chunk-LZVBJ33S.mjs.map +0 -7
- package/dist/js/chunks/chunk-PMBPAFAS.mjs +0 -7
- package/dist/js/chunks/chunk-PMBPAFAS.mjs.map +0 -7
- package/dist/js/chunks/chunk-TK6PX2GC.mjs.map +0 -7
- package/dist/js/chunks/chunk-WWPAPHMA.mjs +0 -1
- /package/dist/js/chunks/{chunk-IMUPRRI6.mjs.map → chunk-3VOK6J7U.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-A3BJA7V4.mjs.map → chunk-6WLSDZ4O.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-KR44BSYQ.mjs.map → chunk-DLWYKFEI.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-SLFNPY5M.mjs.map → chunk-EC63CHXU.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-WWPAPHMA.mjs.map → chunk-NQLC3YMW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-VAS6JQ6P.mjs.map → chunk-PIJ2TAR3.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-PIIAEYAJ.mjs.map → chunk-QDAL4IYN.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-FRB7TOCS.mjs.map → chunk-QV2JAWIZ.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-N3UHGN3N.mjs.map → chunk-QVVEWBOF.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-TYM6U5DY.mjs.map → chunk-UAEAQBRC.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-7UXHSYIA.mjs.map → chunk-UBLRRJ7N.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-JNPIWFJT.mjs.map → chunk-UNEMYWEW.mjs.map} +0 -0
- /package/dist/js/chunks/{chunk-XO5WX3TK.mjs.map → chunk-YDCS5S3J.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var Expressive=(()=>{var dt=Object.defineProperty;var Wt=Object.getOwnPropertyDescriptor;var Ft=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var qt=(d,o)=>{for(var t in o)dt(d,t,{get:o[t],enumerable:!0})},$t=(d,o,t,e)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of Ft(o))!Vt.call(d,i)&&i!==t&&dt(d,i,{get:()=>o[i],enumerable:!(e=Wt(o,i))||e.enumerable});return d};var Kt=d=>$t(dt({},"__esModule",{value:!0}),d);var be={};qt(be,{AppBar:()=>Y,AutoInit:()=>wt,Autocomplete:()=>B,BottomSheets:()=>K,ButtonGroup:()=>X,Cards:()=>R,Carousel:()=>W,CharacterCounter:()=>rt,Chips:()=>N,Datepicker:()=>Z,Dialogs:()=>$,ExpandingCard:()=>P,FloatingActionButton:()=>G,FormSelect:()=>k,Forms:()=>U,Lightbox:()=>Q,Menu:()=>O,NavigationRail:()=>tt,Range:()=>V,ScrollSpy:()=>J,SideSheets:()=>z,Slider:()=>V,Snackbar:()=>lt,Tabs:()=>et,Timepicker:()=>it,Tooltip:()=>st,version:()=>ye});var S=class S{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,c=o.scrollTop,h=t.left-a,l=t.top-c;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),(l<s.top+e||l<e)&&(i.top=!0),(l+t.height>n-e||l+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(),c=Math.min(a.height,window.innerHeight),h=Math.min(a.width,window.innerWidth),l=o.getBoundingClientRect(),r=t.scrollLeft,m=t.scrollTop,p=e.left-r,v=e.top-m,E=e.top+l.height-m;return s.spaceOnRight=n?window.innerWidth-(l.left+e.width):h-(p+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=n?l.right-e.width:p-e.width+l.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=n?window.innerHeight-(l.top+e.height+i):c-(v+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=n?l.bottom-(e.height+i):E-(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(),c=t-(a-s);c<=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},c))}}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===S.keys.ENTER&&s(a)})),o.append(n)}static _setAbsolutePosition(o,t,e,i,s,n="center"){let a=o.offsetHeight,c=o.offsetWidth,h=t.offsetHeight,l=t.offsetWidth,r=o.getBoundingClientRect(),m=0,p=0,v=r.top+S.getDocumentScrollTop(),E=r.left+S.getDocumentScrollLeft();e==="top"?(v+=-h-i,n==="center"&&(E+=c/2-l/2),p=-s):e==="right"?(v+=a/2-h/2,E=c+i,m=s):e==="left"?(v+=a/2-h/2,E=-l-i,m=-s):(v+=a+i,n==="center"&&(E+=c/2-l/2),p=s),n==="right"&&(E+=c-l-i);let b=S._repositionWithinScreen(E,v,l,h,i,s,n);return t.style.top=b.y+"px",t.style.left=b.x+"px",{x:m,y:p}}static _repositionWithinScreen(o,t,e,i,s,n,a){let c=S.getDocumentScrollLeft(),h=S.getDocumentScrollTop(),l=o-c,r=t-h,m={left:l,top:r,width:e,height:i},p;a==="left"||a=="center"?p=s+n:a==="right"&&(p=s-n);let v=S.checkWithinContainer(document.body,m,p);return v.left?l=p:v.right&&(l-=l+e-window.innerWidth),v.top?r=p:v.bottom&&(r-=r+i-window.innerHeight),{x:l+c,y:r+h}}};S.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var u=S;var _=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 zt={onOpen:null,onClose:null},pt='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',ut="card-reveal-initialized";function Ut(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function _t(d,o,t){return d.closest("article")===o&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&Ut(d)}function mt(d){if(d.tagName!=="ARTICLE")return!1;let o=d.querySelectorAll(":scope > aside");return o.length!==1||!o[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>_t(t,d,o[0]))}var R=class d extends _{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,n=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(a=>_t(a,this.el,s)):[];this.cardReveal=s?.id&&n.length>0?s:null,this._activators=this.cardReveal?n:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(ut),this.el.classList.add(ut),this._activators.forEach(a=>{this._initialAriaControls.set(a,a.getAttribute("aria-controls")),a.ariaExpanded="false",a.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return zt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(ut)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(pt)).filter(mt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Yt={onOpen:null,onClose:null},ft="article.expanding-card:has(> dialog.expanding-card-dialog)",P=class d extends _{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;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===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,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.closeGeneration++,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;let t=++this.closeGeneration;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 e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(n=>n.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(n=>n.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.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 Yt}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(ft).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var Et=112,Gt=280,Xt={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},vt=" ",H=class H extends _{constructor(t,e){super(t,e,H);this._pendingTimers=new Set;this._transition=0;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)||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{(t.key===vt||t.key===u.keys.ENTER||t.key===u.keys.ARROW_DOWN||t.key===u.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=>{if(!this.isOpen||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",s=i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT,n=i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT;[s,n,u.keys.ARROW_UP,u.keys.ARROW_DOWN,u.keys.ESC,u.keys.TAB].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery());let a=t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP;if(t.key===u.keys.TAB)t.preventDefault(),this.close();else if(t.key===s){let h=this._focusedRow(t);if(h?.querySelector(":scope > menu")&&!h.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),h.classList.add("open"),this._alignSubmenu(h),this._syncSubmenuAria(h,!0);let l=Array.from(h.querySelector(":scope > menu").children).find(r=>r instanceof HTMLElement&&r.tabIndex!==-1);l&&this._focusRow(l)}}else if(t.key===n){let h=this._containingSubmenu(t);if(h){t.preventDefault();let l=h.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),this._focusRow(l)}}else if(a&&this.isOpen){t.preventDefault();let h=t.key===u.keys.ARROW_DOWN?1:-1,l=this._focusedRow(t),r=l?Array.from(e.children).indexOf(l):this.focusedIndex,m=!1;do if(r=r+h,e.children[r]&&e.children[r].tabIndex!==-1){m=!0;break}while(r<e.children.length&&r>=0);if(m){this.focusedIndex>=0&&e.children[this.focusedIndex]?.classList.remove("active");let p=e.children[r];p.classList.add("active"),this._focusRow(p)}}else if((t.key===u.keys.ENTER||t.key===vt)&&this.isOpen){let h=this._focusedRow(t);if(t.preventDefault(),h?.matches('.disabled, [aria-disabled="true"]'))return;if(h?.querySelector(":scope > menu")){this._toggleSubmenu(h);return}let l=h??this.menuEl.children[this.focusedIndex],r=l?.querySelector(":scope > a, :scope > button");r?r.click():l instanceof HTMLElement&&l.click()}else if(t.key===u.keys.ESC&&this.isOpen){t.preventDefault();let h=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];h?(h.classList.remove("open","submenu-start"),this._syncSubmenuAria(h,!1),this._focusRow(h)):this.close()}let c=t.key.toLowerCase();if(t.key.length===1&&t.key!==vt&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.isComposing){this.filterQuery.push(c);let h=this.filterQuery.join(""),l=Array.from(e.querySelectorAll(":scope > li")).find(r=>r.tabIndex!==-1&&!r.matches('.disabled, [aria-disabled="true"]')&&Array.from(r.childNodes).filter(m=>!(m instanceof Element&&m.matches("menu"))).map(m=>m.textContent).join("").trim().toLowerCase().startsWith(h));l&&this._focusRow(l),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this.el.ariaExpanded="true")};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;this.isOpen=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition&&(this._animateOut(),this._removeTemporaryEventHandlers(),this.el.ariaExpanded="false",this.options.autoFocus&&(e.activeElement===i||!e.activeElement||e.activeElement===document.body)&&this.el.focus())};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,H._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this._originalInert=this.menuEl?.getAttribute("inert")??null,this.options={...H.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 Xt}static init(t,e={}){return super.init(t,e,H)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this.el.ariaExpanded="false",clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=H._menus.indexOf(this);t>=0&&H._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");let i=e.getBoundingClientRect();(i.left<8||i.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}_restoreInert(){this._originalInert===null?this.menuEl?.removeAttribute("inert"):this.menuEl?.setAttribute("inert",this._originalInert)}_focusRow(t){this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_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,c=e.top-i.top,h={left:a,top:c,height:s,width:n},l=u.checkPossibleAlignments(this.el,t,h,this.options.coverTrigger?0:e.height),r="top",m=this.options.alignment;if(c+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,l.top||(l.bottom?(r="bottom",this.options.coverTrigger||(c-=e.height)):(this.isScrollable=!0,s-=20,l.spaceOnTop>l.spaceOnBottom?(r="bottom",s+=l.spaceOnTop,c-=this.options.coverTrigger?l.spaceOnTop-20:l.spaceOnTop-20+e.height):s+=l.spaceOnBottom)),!l[m]){let p=m==="left"?"right":"left";l[p]?m=p:l.spaceOnLeft>l.spaceOnRight?(m="right",n+=l.spaceOnLeft,a-=l.spaceOnLeft):(m="left",n+=l.spaceOnRight)}return r==="bottom"&&(c=c-i.height+(this.options.coverTrigger?e.height:0)),m==="right"&&(a=a-i.width+e.width),{x:a,y:c,verticalAlignment:r,horizontalAlignment:m,height:s,width:n}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_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)",this._schedule(()=>{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>=Et?i:Math.min(Gt,Math.max(Et,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%"}`}};H._menus=[];var O=H;var jt={i18n:{loading:"Loading results.",noResults:"No results.",results:d=>`${d} ${d===1?"result":"results"} available.`,selected:d=>`${d} ${d===1?"item":"items"} selected.`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,o)=>{let t=d.toLocaleLowerCase(),e=o.options.data;o.setMenuItems(e.filter(i=>i.id.toString().toLocaleLowerCase().includes(t)||i.text?.toLocaleLowerCase().includes(t))),o.options.data=e},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},I=class I extends _{constructor(t,e){super(t,e,I);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=()=>{I._keydown=!1};this._handleInput=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(t)};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{!this.options.isMultiSelect&&this.selectedValues.length&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id))&&(this.selectedValues=[]),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=>{if(I._keydown=!0,t.key===u.keys.ESC||t.key==="Tab"){this.close(),this._resetCurrentElementPosition();return}let e=this.container.querySelectorAll("li").length;if(t.key===u.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===u.keys.ARROW_UP||t.key===u.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===u.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===u.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._announce(this.menuItems.length?this.options.i18n.results(this.menuItems.length):this.options.i18n.noResults)),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._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...I.defaults,...e,i18n:{...I.defaults.i18n,...e?.i18n}},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(s=>s.id===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 jt}static init(t,e={}){return super.init(t,e,I)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!I._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 Ot=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var pe=Object.prototype.hasOwnProperty;var me=(d,n)=>{for(var t in n)Ot(d,t,{get:n[t],enumerable:!0})},fe=(d,n,t,e)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of ue(n))!pe.call(d,i)&&i!==t&&Ot(d,i,{get:()=>n[i],enumerable:!(e=de(n,i))||e.enumerable});return d};var ve=d=>fe(Ot({},"__esModule",{value:!0}),d);var li={};me(li,{AppBar:()=>tt,AutoInit:()=>ee,Autocomplete:()=>F,BarChart:()=>ot,BottomSheets:()=>Q,ButtonGroup:()=>it,Cards:()=>V,Carousel:()=>K,CharacterCounter:()=>Ct,Chips:()=>z,ColumnChart:()=>N,CommandPalette:()=>st,Datepicker:()=>ut,Dialogs:()=>X,ExpandingCard:()=>q,FloatingActionButton:()=>et,FormSelect:()=>O,Forms:()=>J,HeatmapChart:()=>at,Lightbox:()=>mt,LineChart:()=>S,Menu:()=>B,MessageScroller:()=>pt,MixedChart:()=>ht,NavigationRail:()=>vt,PieChart:()=>rt,Questionnaire:()=>nt,RadarChart:()=>lt,RadialChart:()=>ct,Range:()=>Y,RichTextEditor:()=>At,ScrollSpy:()=>ft,SideSheets:()=>Z,Slider:()=>Y,Snackbar:()=>St,Tabs:()=>gt,Timepicker:()=>_t,Tooltip:()=>Et,version:()=>ai});var D=class D{static onDocumentReady(n){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",n,{once:!0}):n())}static guid(){return globalThis.crypto?.randomUUID?.()??`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}static portalRoot(n){let t=n.getRootNode();return t.host?t:document.body}static getElementById(n,t){let e=n.getRootNode();return e.getElementById?e.getElementById(t):document.getElementById(t)}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,r=n.scrollLeft,a=n.scrollTop,h=t.left-r,l=t.top-a;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),(l<s.top+e||l<e)&&(i.top=!0),(l+t.height>o-e||l+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",r=t.getBoundingClientRect(),a=Math.min(r.height,window.innerHeight),h=Math.min(r.width,window.innerWidth),l=n.getBoundingClientRect(),c=t.scrollLeft,m=t.scrollTop,f=e.left-c,p=e.top-m,v=e.top+l.height-m;return s.spaceOnRight=o?window.innerWidth-(l.left+e.width):h-(f+e.width),s.spaceOnRight<0&&(s.left=!1),s.spaceOnLeft=o?l.right-e.width:f-e.width+l.width,s.spaceOnLeft<0&&(s.right=!1),s.spaceOnBottom=o?window.innerHeight-(l.top+e.height+i):a-(p+e.height+i),s.spaceOnBottom<0&&(s.top=!1),s.spaceOnTop=o?l.bottom-(e.height+i):v-(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}static getDocumentScrollLeft(){return window.scrollX}static throttle(n,t){let e=null,i=null,s=0;return(...o)=>{let r=Date.now(),a=t-(r-s);a<=0?(clearTimeout(e),e=null,s=r,i=null,n(...o)):e?i=o:(i=o,e=setTimeout(()=>{s=Date.now(),e=null,n(...i??[]),i=null},a))}}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(["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),n.append(o)}static _setAbsolutePosition(n,t,e,i,s,o="center"){let r=n.offsetHeight,a=n.offsetWidth,h=t.offsetHeight,l=t.offsetWidth,c=n.getBoundingClientRect(),m=0,f=0,p=c.top+D.getDocumentScrollTop(),v=c.left+D.getDocumentScrollLeft();e==="top"?(p+=-h-i,o==="center"&&(v+=a/2-l/2),f=-s):e==="right"?(p+=r/2-h/2,v=a+i,m=s):e==="left"?(p+=r/2-h/2,v=-l-i,m=-s):(p+=r+i,o==="center"&&(v+=a/2-l/2),f=s),o==="right"&&(v+=a-l-i);let g=D._repositionWithinScreen(v,p,l,h,i,s,o),E=t.offsetParent;if(E&&(E!==document.body||getComputedStyle(E).position!=="static")){let L=E.getBoundingClientRect(),x=E===document.scrollingElement;g.x-=L.left+D.getDocumentScrollLeft()+E.clientLeft-(x?0:E.scrollLeft),g.y-=L.top+D.getDocumentScrollTop()+E.clientTop-(x?0:E.scrollTop)}return t.style.top=g.y+"px",t.style.left=g.x+"px",{x:m,y:f}}static _repositionWithinScreen(n,t,e,i,s,o,r){let a=D.getDocumentScrollLeft(),h=D.getDocumentScrollTop(),l=n-a,c=t-h,m={left:l,top:c,width:e,height:i},f;r==="left"||r=="center"?f=s+o:r==="right"&&(f=s-o);let p=D.checkWithinContainer(document.body,m,f);return p.left?l=f:p.right&&(l-=l+e-window.innerWidth),p.top?c=f:p.bottom&&(c-=c+i-window.innerHeight),{x:l+a,y:c+h}}};D.keys={TAB:"Tab",ENTER:"Enter",ESC:"Escape",BACKSPACE:"Backspace",ARROW_UP:"ArrowUp",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",DELETE:"Delete"};var u=D;var b=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){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 ge={onOpen:null,onClose:null},Rt='article:has(> aside[id]:not([id=""])):not(:has(> aside ~ aside)):has(> button.card-reveal-trigger[type="button"], > :not(aside) button.card-reveal-trigger[type="button"])',Dt="card-reveal-initialized";function _e(d){if(d.getAttribute("aria-label")?.trim())return!0;let t=d.getAttribute("aria-labelledby");if(t&&t.trim().split(/\s+/).map(s=>d.ownerDocument.getElementById(s)?.textContent??"").join(" ").trim())return!0;let e=d.cloneNode(!0);return e.querySelectorAll('[aria-hidden="true"]').forEach(i=>i.remove()),!!e.textContent?.trim()}function Ft(d,n,t){return d.closest("article")===n&&!t.contains(d)&&!d.disabled&&d.getAttribute("aria-disabled")!=="true"&&_e(d)}function Pt(d){if(d.tagName!=="ARTICLE")return!1;let n=d.querySelectorAll(":scope > aside");return n.length!==1||!n[0].id?!1:Array.from(d.querySelectorAll('button.card-reveal-trigger[type="button"]')).some(t=>Ft(t,d,n[0]))}var V=class d extends b{constructor(t,e={}){super(t,e,d);this.isOpen=!1;this._ownsRevealInitializedClass=!1;this._initialAriaControls=new Map;this._lastActivator=null;this._setupEventHandlers=()=>{this._activators.forEach(t=>{t.addEventListener("click",this._handleClickInteraction)}),this.el.addEventListener("keydown",this._handleKeydownEvent)};this._removeEventHandlers=()=>{this._activators.forEach(t=>{t.removeEventListener("click",this._handleClickInteraction)}),this.el.removeEventListener("keydown",this._handleKeydownEvent)};this._handleClickInteraction=t=>{this._lastActivator=t.currentTarget,this._handleRevealEvent()};this._handleKeydownEvent=t=>{(t.target instanceof Element?t.target.closest("article"):null)!==this.el||t.key!=="Escape"||!this.isOpen||(t.preventDefault(),this.close())};this._handleRevealEvent=()=>{this.isOpen?this.close():this.open()};this.open=()=>{this.isOpen||!this.cardReveal||(this.isOpen=!0,this.cardReveal.classList.add("open"),this.cardReveal.inert=!1,this._activators.forEach(t=>t.ariaExpanded="true"),typeof this.options.onOpen=="function"&&this.options.onOpen.call(this,this.el))};this.close=()=>{if(!this.isOpen||!this.cardReveal)return;let t=this.cardReveal.contains(document.activeElement);this.isOpen=!1,this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._activators.forEach(e=>e.ariaExpanded="false"),typeof this.options.onClose=="function"&&this.options.onClose.call(this,this.el),t&&(this._lastActivator??this._activators[0])?.focus()};this.el.Expressive_Cards=this,this.options={...d.defaults,...e};let i=this.el.querySelectorAll(":scope > aside"),s=i.length===1?i[0]:null,o=s?Array.from(this.el.querySelectorAll('button.card-reveal-trigger[type="button"]')).filter(r=>Ft(r,this.el,s)):[];this.cardReveal=s?.id&&o.length>0?s:null,this._activators=this.cardReveal?o:[],this.cardReveal&&(this._ownsRevealInitializedClass=!this.el.classList.contains(Dt),this.el.classList.add(Dt),this._activators.forEach(r=>{this._initialAriaControls.set(r,r.getAttribute("aria-controls")),r.ariaExpanded="false",r.setAttribute("aria-controls",this.cardReveal.id)}),this.cardReveal.classList.remove("open"),this.cardReveal.inert=!0,this._setupEventHandlers())}static get defaults(){return ge}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Cards}destroy(){this._removeEventHandlers(),this.cardReveal&&(this.cardReveal.classList.remove("open"),this.cardReveal.inert=!1,this._ownsRevealInitializedClass&&this.el.classList.remove(Dt)),this._activators.forEach(t=>{t.removeAttribute("aria-expanded");let e=this._initialAriaControls.get(t);e===null?t.removeAttribute("aria-controls"):e!==void 0&&t.setAttribute("aria-controls",e)}),this.isOpen=!1,this._activators=[],this._initialAriaControls.clear(),this._lastActivator=null,this.el.Expressive_Cards=void 0}static Init(){u.onDocumentReady(()=>{Array.from(document.querySelectorAll(Rt)).filter(Pt).forEach(e=>{e&&e.Expressive_Cards==null&&this.init(e)})})}};var Ee={onOpen:null,onClose:null},Bt="article.expanding-card:has(> dialog.expanding-card-dialog)",q=class d extends b{constructor(t,e){super(t,e,d);this.isOpen=!1;this.closeGeneration=0;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===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this.open())};this._handleCancel=t=>{t.preventDefault(),this.close()};this._handleNativeClose=()=>{this.dialog.open||(this.closeGeneration++,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.closeGeneration++,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;let t=++this.closeGeneration;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 e=()=>{t!==this.closeGeneration||this.isOpen||!this.dialog.open||(this.dialog.close(),this.dialog.isConnected&&this.trigger.isConnected&&this.trigger.focus())},s=window.matchMedia("(prefers-reduced-motion: reduce)").matches?[]:(this.dialog.getAnimations?.()??[]).filter(o=>o.transitionProperty==="clip-path");s.length===0?e():Promise.allSettled(s.map(o=>o.finished)).then(e)};this.el.Expressive_ExpandingCard=this,this.options={...d.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 Ee}static init(t,e){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ExpandingCard}destroy(){this._removeEventHandlers(),this.closeGeneration++,this.isOpen=!1,this.trigger&&(this.trigger.ariaExpanded="false"),this.dialog&&(this.dialog.ariaExpanded="false"),this.dialog?.classList.remove("expanded"),this.dialog?.open&&this.dialog.close(),this.el.Expressive_ExpandingCard=void 0}static Init(){u.onDocumentReady(()=>{document.querySelectorAll(Bt).forEach(t=>{t&&t.Expressive_ExpandingCard==null&&this.init(t)})})}};var Wt=112,be=280,ye={alignment:"left",autoFocus:!0,constrainWidth:!0,container:null,coverTrigger:!1,closeOnClick:!0,hover:!1,contextMenu:!1,inDuration:150,outDuration:250,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null,onItemClick:null},Nt=" ",P=class P extends b{constructor(t,e){super(t,e,P);this._pendingTimers=new Set;this._transition=0;this._menuClickTargets=new WeakMap;this._contextPoint=null;this._contextReturn=null;this._handleContextMenu=t=>{if(t.defaultPrevented){this.close();return}let e=t.composedPath();if(P._menus.some(o=>o!==this&&o.isOpen&&e.includes(o.menuEl)))return;if(t.preventDefault(),!this.isOpen){let o=this.el.getRootNode();this._contextReturn=o.activeElement instanceof HTMLElement?o.activeElement:null}let i=this.el.getBoundingClientRect(),s=(t.clientX!==0||t.clientY!==0)&&t.clientX>=i.left&&t.clientX<=i.right&&t.clientY>=i.top&&t.clientY<=i.bottom;this._contextPoint=s?{x:t.clientX,y:t.clientY}:null,this.isOpen?this.recalculateDimensions():this.open()};this._handleDocumentContextMenu=t=>{let e=t.composedPath();if(e.includes(this.menuEl)){t.preventDefault();return}e.includes(this.el)||this.close()};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.composedPath(),i=this._menuClickTargets.get(t);this._menuClickTargets.delete(t);let s=i??(e[0]||t.target),o=!!i||e.includes(this.menuEl)||this.menuEl?.contains(s);this._isSubmenuTriggerClick(s)||(this.options.closeOnClick&&o&&!this.isTouchMoving?this.close():o||this._schedule(()=>{this.isOpen&&this.close()},0),this.isTouchMoving=!1)};this._handleTriggerKeydown=t=>{if(this.options.contextMenu)return;(t.key===Nt||t.key===u.keys.ENTER||t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP)&&!this.isOpen&&(t.preventDefault(),this.open())};this._handleDocumentTouchmove=t=>{let e=t.target;(t.composedPath().includes(this.menuEl)||this.menuEl?.contains(e))&&(this.isTouchMoving=!0)};this._handleMenuClick=t=>{let e=t.target;this._menuClickTargets.set(t,e);let 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=>{if(!this.isOpen||t.ctrlKey||t.metaKey||t.altKey||t.isComposing)return;let e=this._containingSubmenu(t)??this.menuEl,i=getComputedStyle(e).direction==="rtl",s=i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT,o=i?u.keys.ARROW_RIGHT:u.keys.ARROW_LEFT;[s,o,u.keys.ARROW_UP,u.keys.ARROW_DOWN,u.keys.ESC,u.keys.TAB].includes(t.key)&&(clearTimeout(this.filterTimeout),this._resetFilterQuery());let r=t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP;if(t.key===u.keys.TAB)t.preventDefault(),this.close();else if(t.key===s){let h=this._focusedRow(t);if(h?.querySelector(":scope > menu")&&!h.matches('.disabled, [aria-disabled="true"]')){t.preventDefault(),h.classList.add("open"),this._alignSubmenu(h),this._syncSubmenuAria(h,!0);let l=Array.from(h.querySelector(":scope > menu").children).find(c=>c instanceof HTMLElement&&c.tabIndex!==-1);l&&this._focusRow(l)}}else if(t.key===o){let h=this._containingSubmenu(t);if(h){t.preventDefault();let l=h.parentElement;l.classList.remove("open","submenu-start"),this._syncSubmenuAria(l,!1),this._focusRow(l)}}else if(r&&this.isOpen){t.preventDefault();let h=t.key===u.keys.ARROW_DOWN?1:-1,l=this._focusedRow(t),c=l?Array.from(e.children).indexOf(l):this.focusedIndex,m=!1;do if(c=c+h,e.children[c]&&e.children[c].tabIndex!==-1){m=!0;break}while(c<e.children.length&&c>=0);if(m){this.focusedIndex>=0&&e.children[this.focusedIndex]?.classList.remove("active");let f=e.children[c];f.classList.add("active"),this._focusRow(f)}}else if((t.key===u.keys.ENTER||t.key===Nt)&&this.isOpen){let h=this._focusedRow(t);if(t.preventDefault(),h?.matches('.disabled, [aria-disabled="true"]'))return;if(h?.querySelector(":scope > menu")){this._toggleSubmenu(h);return}let l=h??this.menuEl.children[this.focusedIndex],c=l?.querySelector(":scope > a, :scope > button");c?c.click():l instanceof HTMLElement&&l.click()}else if(t.key===u.keys.ESC&&this.isOpen){t.preventDefault();let h=this._containingSubmenu(t)?.parentElement??Array.from(this.menuEl.querySelectorAll("li.open")).reverse()[0];h?(h.classList.remove("open","submenu-start"),this._syncSubmenuAria(h,!1),this._focusRow(h)):this.close()}let a=t.key.toLowerCase();if(t.key.length===1&&t.key!==Nt&&!t.ctrlKey&&!t.metaKey&&!t.altKey&&!t.isComposing){this.filterQuery.push(a);let h=this.filterQuery.join(""),l=Array.from(e.querySelectorAll(":scope > li")).find(c=>c.tabIndex!==-1&&!c.matches('.disabled, [aria-disabled="true"]')&&Array.from(c.childNodes).filter(m=>!(m instanceof Element&&m.matches("menu"))).map(m=>m.textContent).join("").trim().toLowerCase().startsWith(h));l&&this._focusRow(l),clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(this._resetFilterQuery,1e3)}};this._handleWindowResize=()=>{this.el.offsetParent&&this.recalculateDimensions()};this._resetFilterQuery=()=>{this.filterQuery=[]};this.open=()=>{if(this.isOpen||this.el.Expressive_Menu!==this)return;let t=this._clearPendingTimers();this.isOpen=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t===this._transition&&(this._resetMenuStyles(),this.menuEl.style.display="block",this._restoreInert(),this._placeMenu(),this._schedule(()=>this._setupTemporaryEventHandlers(),0),this._animateIn(),this._setExpanded(!0))};this.close=()=>{if(!this.isOpen)return;let t=this._clearPendingTimers(),e=this.menuEl.getRootNode(),i=e.activeElement;if(this.isOpen=!1,this.menuEl.setAttribute("inert",""),clearTimeout(this.filterTimeout),this._resetFilterQuery(),this.focusedIndex=-1,this._closeSubmenus(),typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._transition){if(this._animateOut(),this._removeTemporaryEventHandlers(),this._setExpanded(!1),this.options.autoFocus&&this.menuEl.contains(i)&&(e.activeElement===i||this.el.ownerDocument.activeElement===this.el.ownerDocument.body)){let s=this._contextReturn;(s?.isConnected&&s!==this.el.ownerDocument.body?s:this.el).focus()}this._contextReturn=null,this._contextPoint=null}};this.recalculateDimensions=()=>{this.isOpen&&(this._resetMenuPositioningStyles(),this._placeMenu())};this.el.Expressive_Menu=this,P._menus.push(this),this.id=u.getIdFromTrigger(t),this.menuEl=u.getElementById(t,this.id),this._originalInert=this.menuEl?.getAttribute("inert")??null,this.options={...P.defaults,contextMenu:t.hasAttribute("data-context-menu"),...e},this.isOpen=!1,this.isScrollable=!1,this.isTouchMoving=!1,this.focusedIndex=-1,this.filterQuery=[],this.options.contextMenu||(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 ye}static init(t,e={}){return super.init(t,e,P)}static getInstance(t){return t.Expressive_Menu}destroy(){this._clearPendingTimers(),this.isOpen=!1,this._setExpanded(!1),clearTimeout(this.filterTimeout),this._resetMenuStyles(),this._restoreInert(),this._removeEventHandlers(),this._removeTemporaryEventHandlers();let t=P._menus.indexOf(this);t>=0&&P._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.contextMenu?this.el.addEventListener("contextmenu",this._handleContextMenu):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.contextMenu?this.el.removeEventListener("contextmenu",this._handleContextMenu):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),this.menuEl?.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),document.body.addEventListener("touchmove",this._handleDocumentTouchmove,{passive:!0}),this.menuEl?.addEventListener("keydown",this._handleMenuKeydown),window.addEventListener("resize",this._handleWindowResize),this.options.contextMenu&&document.addEventListener("contextmenu",this._handleDocumentContextMenu)}_removeTemporaryEventHandlers(){document.body.removeEventListener("click",this._handleDocumentClick),this.menuEl?.removeEventListener("touchmove",this._handleDocumentTouchmove),document.body.removeEventListener("touchmove",this._handleDocumentTouchmove),this.menuEl?.removeEventListener("keydown",this._handleMenuKeydown),window.removeEventListener("resize",this._handleWindowResize),document.removeEventListener("contextmenu",this._handleDocumentContextMenu)}_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");let i=e.getBoundingClientRect();(i.left<8||i.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}_restoreInert(){this._originalInert===null?this.menuEl?.removeAttribute("inert"):this.menuEl?.setAttribute("inert",this._originalInert)}_focusRow(t){this.focusedIndex=Array.from(t.parentElement.children).indexOf(t),t.focus({preventScroll:!0}),t.scrollIntoView({block:"nearest",inline:"nearest"})}_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,o=i.width,r=e.left-i.left,a=e.top-i.top,h={left:r,top:a,height:s,width:o},l=u.checkPossibleAlignments(this.el,t,h,this.options.coverTrigger?0:e.height),c="top",m=this.options.alignment;if(a+=this.options.coverTrigger?0:e.height,this.isScrollable=!1,l.top||(l.bottom?(c="bottom",this.options.coverTrigger||(a-=e.height)):(this.isScrollable=!0,s-=20,l.spaceOnTop>l.spaceOnBottom?(c="bottom",s+=l.spaceOnTop,a-=this.options.coverTrigger?l.spaceOnTop-20:l.spaceOnTop-20+e.height):s+=l.spaceOnBottom)),!l[m]){let f=m==="left"?"right":"left";l[f]?m=f:l.spaceOnLeft>l.spaceOnRight?(m="right",o+=l.spaceOnLeft,r-=l.spaceOnLeft):(m="left",o+=l.spaceOnRight)}return c==="bottom"&&(a=a-i.height+(this.options.coverTrigger?e.height:0)),m==="right"&&(r=r-i.width+e.width),{x:r,y:a,verticalAlignment:c,horizontalAlignment:m,height:s,width:o}}_schedule(t,e){let i=setTimeout(()=>{this._pendingTimers.delete(i),t()},e);this._pendingTimers.add(i)}_clearPendingTimers(){for(let t of this._pendingTimers)clearTimeout(t);return this._pendingTimers.clear(),++this._transition}_animateIn(){let t=this._transition,e=this.options.inDuration;this.menuEl.style.transition="none",this.menuEl.style.opacity="0",this.menuEl.style.transform="scale(0.85)",this._schedule(()=>{this.menuEl.style.transition=`opacity ${e}ms ease, transform ${e}ms ease`,this.menuEl.style.opacity="1",this.menuEl.style.transform="scale(1)"},1),this._schedule(()=>{this._focusInitialItem(),t===this._transition&&typeof this.options.onOpenEnd=="function"&&this.options.onOpenEnd.call(this,this.el)},e)}_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)",this._schedule(()=>{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,r=>!["HTML","BODY"].includes(r.tagName)&&getComputedStyle(r).overflow!=="visible");if(!t){let r=this.menuEl.offsetParent?this.menuEl.offsetParent:this.menuEl.parentNode;t=r.host??r}getComputedStyle(t).position==="static"&&(t.style.position="relative");let e=this.menuEl.getBoundingClientRect().width,i=this.el.getBoundingClientRect().width,s=this.options.constrainWidth&&!this.options.contextMenu&&i>=Wt?i:Math.min(be,Math.max(Wt,e));if(this.menuEl.style.width=s+"px",this.options.contextMenu){this._placeMenuAtPoint(this._contextPoint??this._regionCorner(),t);return}let o=this._getMenuPosition(t);this.menuEl.style.left=o.x+"px",this.menuEl.style.top=o.y+"px",this.menuEl.style.height=o.height+"px",this.menuEl.style.width=o.width+"px",this.menuEl.style.transformOrigin=`${o.horizontalAlignment==="left"?"0":"100%"} ${o.verticalAlignment==="top"?"0":"100%"}`}_regionCorner(){let t=this.el.getBoundingClientRect();return{x:getComputedStyle(this.el).direction==="rtl"?t.right:t.left,y:t.bottom}}_placeMenuAtPoint({x:t,y:e},i){let{transform:s,transition:o}=this.menuEl.style;this.menuEl.style.transition="none",this.menuEl.style.transform="none";let r=this.menuEl.getBoundingClientRect();this.menuEl.style.transform=s,this.menuEl.style.transition=o;let a={left:0,top:0,right:window.innerWidth,bottom:window.innerHeight};if(i&&getComputedStyle(i).overflow!=="visible"){let x=i.getBoundingClientRect();a={left:Math.max(a.left,x.left),top:Math.max(a.top,x.top),right:Math.min(a.right,x.right),bottom:Math.min(a.bottom,x.bottom)}}let h=r.width,l=Math.min(r.height,a.bottom-a.top);this.isScrollable=l<r.height,this.isScrollable&&(this.menuEl.style.height=l+"px");let c=getComputedStyle(this.el).direction==="rtl",m=t+h<=a.right,f=t-h>=a.left,p=c?f||!m:!m&&f,v=e+l>a.bottom&&e-l>=a.top,g=(x,T,j)=>Math.max(T,Math.min(x,j)),E=g(p?t-h:t,a.left,a.right-h),L=g(v?e-l:e,a.top,a.bottom-l);this.menuEl.style.left=E-r.left+"px",this.menuEl.style.top=L-r.top+"px",this.menuEl.style.transformOrigin=`${p?"100%":"0"} ${v?"100%":"0"}`}_setExpanded(t){this.options.contextMenu||(this.el.ariaExpanded=String(t))}};P._menus=[];var B=P;var Le={i18n:{loading:"Loading results.",noResults:"No results.",results:d=>`${d} ${d===1?"result":"results"} available.`,selected:d=>`${d} ${d===1?"item":"items"} selected.`},data:[],onAutocomplete:null,menuOptions:{autoFocus:!1,closeOnClick:!1,coverTrigger:!1},minLength:1,isMultiSelect:!1,onSearch:(d,n)=>{let t=d.toLocaleLowerCase(),e=n.options.data;n.setMenuItems(e.filter(i=>i.id.toString().toLocaleLowerCase().includes(t)||i.text?.toLocaleLowerCase().includes(t))),n.options.data=e},maxMenuHeight:"300px",allowUnsafeHTML:!1,selected:[]},H=class H extends b{constructor(t,e){super(t,e,H);this._handleInputBlur=()=>{this._pointerDown||(this.close(),this._resetAutocomplete())};this._handleInputKeyup=()=>{H._keydown=!1};this._handleInput=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this.oldVal!==t&&this.el.matches(":focus-visible")&&this.open(),this._inputChangeDetection(t)};this._handleInputFocus=()=>{this.count=0;let t=this.el.value.toLocaleLowerCase();this._inputChangeDetection(t)};this._inputChangeDetection=t=>{!this.options.isMultiSelect&&this.selectedValues.length&&this.el.value!==(this.selectedValues[0].text||String(this.selectedValues[0].id))&&(this.selectedValues=[]),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=>{if(H._keydown=!0,t.key===u.keys.ESC||t.key==="Tab"){this.close(),this._resetCurrentElementPosition();return}let e=this.container.querySelectorAll("li").length;if(t.key===u.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===u.keys.ARROW_UP||t.key===u.keys.ARROW_DOWN)&&(t.preventDefault(),t.key===u.keys.ARROW_UP&&this.activeIndex>0&&this.activeIndex--,t.key===u.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._renderMenu(),this._announce(this.menuItems.length?this.options.i18n.results(this.menuItems.length):this.options.i18n.noResults)),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._announcer&&(this._announcer.textContent=""),this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this.isOpen=!1,this.menu.close()};this.el.Expressive_Autocomplete=this,this.options={...H.defaults,...e,i18n:{...H.defaults.i18n,...e?.i18n}},this.isOpen=!1,this.count=0,this.activeIndex=-1,this.oldVal="",this.selectedValues=this.options.selected.map(i=>this.options.data.find(s=>s.id===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 Le}static init(t,e={}){return super.init(t,e,H)}static getInstance(t){return t.Expressive_Autocomplete}static _loadingIndicator(){if(!H._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>`,I._loadingTemplate=t.content.firstElementChild}return I._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this.menu.destroy(),this._removeMenu(),this._statusInfo.remove(),this._announcer.remove(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("input",this._handleInput),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("input",this._handleInput),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-${u.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={...I.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),this.el.setAttribute("aria-haspopup","listbox");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("aria-hidden","true"),s.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(s),this._statusInfo=s,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),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-${u.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.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=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let r=document.createElement("input");r.type="checkbox",r.tabIndex=-1,r.checked=i;let m=document.createElement("span");m.style.paddingLeft="21px",l.append(r,m),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}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 l=document.createElement("span");l.textContent=n[1],l.classList.add("highlight"),a.appendChild(l),a.appendChild(document.createTextNode(n[2]))}let c=document.createElement("div");if(c.classList.add("item-text"),c.setAttribute("style","padding:5px;overflow:hidden;"),e.appendChild(c),e.querySelector(".item-text").appendChild(a),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,e.querySelector(".item-text").appendChild(l)}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._statusInfo;t&&t.replaceChildren(I._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_updateSelectedInfo(){let t=this._statusInfo;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){if(this.el.Expressive_Autocomplete!==this)return;let s=t.length;this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(n=>e.indexOf(n.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?s?this.options.i18n.results(s):this.options.i18n.noResults:""),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.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};I._loadingTemplate=null;var B=I;var Zt={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 _{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,"input"):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===u.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===u.keys.BACKSPACE||t.key===u.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 Zt}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),this.el.addEventListener("keydown",C._handleChipsKeydown),this.el.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),this.el.removeEventListener("keydown",C._handleChipsKeydown),this.el.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===u.keys.BACKSPACE||t.key===u.keys.DELETE){let a=n._chips.indexOf(t.target.closest(".chip"));if(a<0)return;t.preventDefault(),n._deleteChip(a,"previous")}else if(t.key===u.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===u.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=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",u.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.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder();let s=[],n=this.el.getRootNode();for(;n;)s.push({root:n,element:n.activeElement}),n="host"in n?n.host.getRootNode():null;typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,i),!(!e||s.some(({root:a,element:c})=>a.activeElement!==c)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}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(){u.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 N=C;var Qt={},V=class d extends _{constructor(t,e){super(t,e,d);this._resizeObserver=null;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=t=>{(t.type==="input"||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={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el))}static get defaults(){return Qt}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._resizeObserver?.disconnect(),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),i=Number.isNaN(e)?100:e,s=parseFloat(t.min)||0,n=parseFloat(t.value)||0;return i===s?0:(n-s)/(i-s)}_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,c=getComputedStyle(this.el),h=c.direction==="rtl",l=this._isVertical(),r=parseFloat(c.getPropertyValue("--md-comp-slider-handle-width"))||4,m=l?a:n,p=r/2+t*(m-r);this.el.style.setProperty("--md-comp-slider-active-fraction",e),this.el.style.setProperty("--md-comp-slider-active-position",`${p}px`);let v=this._host(),E=v?.querySelectorAll('input[type="range"]');if(v&&E&&E.length===2){let b=Array.from(E).map(w=>this._fraction(w));v.style.setProperty("--md-comp-slider-start-fraction",`${Math.min(...b)*100}%`),v.style.setProperty("--md-comp-slider-end-fraction",`${Math.max(...b)*100}%`),v.style.setProperty("--md-comp-slider-start-position",`${r/2+Math.min(...b)*(m-r)}px`),v.style.setProperty("--md-comp-slider-end-position",`${r/2+Math.max(...b)*(m-r)}px`)}if(v?.classList.contains("stops")){let b=parseFloat(this.el.max),w=Number.isNaN(b)?100:b,D=parseFloat(this.el.min)||0,F=parseFloat(this.el.step);if(F>0&&Number.isFinite(F)){let M=Math.round((w-D)/F)+1;v.style.setProperty("--md-comp-slider-stop-count",String(Math.max(2,M)))}}this.value.textContent=this.el.value,l?(this.thumb.style.left=`${i+n/2}px`,this.thumb.style.top=`${s+a-p}px`):(this.thumb.style.left=`${i+(h?n-p:p)}px`,this.thumb.style.top=`${s}px`)}static Init(){u.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var T=class T{static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",T._onPointerDown,{passive:!0}),document.addEventListener("pointerup",T._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",T._onPointerCancel,{passive:!0})})}static _onPointerDown(o){if(!T._isPrimaryPress(o)){T._down=null;return}let t=T._backdropDialog(o);if(!t||!T._lightDismissible(t)||!T._outside(o,t)){T._down=null;return}T._down={dialog:t,pointerId:o.pointerId}}static _onPointerUp(o){let t=T._down;T._down=null,!(!t||t.pointerId!==o.pointerId)&&o.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||T._lightDismissible(t.dialog)&&T._backdropDialog(o)===t.dialog&&T._outside(o,t.dialog)&&t.dialog.close())}static _onPointerCancel(){T._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=T._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}};T._down=null;var $=T;var yt=96,bt=.5,Jt=4;function at(d){let o=l=>d.axis==="x"?l.clientX:l.clientY,t,e=null,i=l=>{if(!(l instanceof Element))return null;let r=l.closest(d.selector);return r instanceof HTMLDialogElement?r:null},s=l=>{l.style.transition="",l.style.setProperty(d.property,"0px")},n=l=>{if(!l.isPrimary||l.pointerType==="mouse"&&l.button!==0)return;h(),d.onPress?.();let r=i(l.target);if(!r?.open){e=null;return}if(!d.inHandle(l,r)){e=null;return}r.style.transition="none",e={dialog:r,pointerId:l.pointerId,direction:d.direction(r),start:o(l),last:o(l),lastT:Date.now(),shift:0},t.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0})},a=l=>{if(!e||e.pointerId!==l.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){h();return}let r=o(l)-e.start;e.shift=e.direction===1?Math.max(0,r):Math.min(0,r),e.last=o(l),e.lastT=Date.now(),e.dialog.style.setProperty(d.property,`${e.shift}px`)},c=l=>{let r=e;if(!r||r.pointerId!==l.pointerId)return;if(!r.dialog.open||!r.dialog.isConnected){h();return}e=null,t.disconnect(),r.dialog.style.transition="";let m=Math.max(1,Date.now()-r.lastT),p=(o(l)-r.last)/m;d.onRelease?.(Math.abs(r.shift)>Jt),(r.direction===1?r.shift>yt||p>bt:r.shift<-yt||p<-bt)&&r.dialog.open&&r.dialog.close(),r.dialog.style.setProperty(d.property,"0px")},h=l=>{if(l&&e?.pointerId!==l.pointerId)return;t.disconnect(),d.onRelease?.(!1);let r=e;e=null,r&&s(r.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(l=>{let r=e?.dialog;r&&(!r.open||!r.isConnected||l.some(m=>m.type==="attributes"&&m.target===r&&m.oldValue===null||[...m.removedNodes].some(p=>p.contains(r))))&&h()}),document.addEventListener("pointerdown",n,{passive:!0}),document.addEventListener("pointermove",a,{passive:!0}),document.addEventListener("pointerup",c,{passive:!0}),document.addEventListener("pointercancel",h,{passive:!0})})}var Lt="dialog.bottom-sheet, dialog.bottom",q=class q{static Init(){at({selector:Lt,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:()=>{q._dragged=!1},onRelease:o=>{q._dragged=o}}),u.onDocumentReady(()=>{document.addEventListener("click",q._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&&q._dragged)return;let i=e.closest(Lt);i instanceof HTMLDialogElement&&i.open&&i.close()}};q._dragged=!1;var K=q;var te=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),Tt=d=>te(d)!==(getComputedStyle(d).direction==="rtl"),z=class{static Init(){at({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:o=>Tt(o)?-1:1,inHandle:(o,t)=>{let e=o.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return Tt(t)?o.clientX>=i.right-24&&o.clientX<=i.right:o.clientX>=i.left&&o.clientX<=i.left+24}})}};var U=class d{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(){u.onDocumentReady(()=>{document.addEventListener("change",o=>{let t=o.target;t instanceof HTMLInputElement&&d.validateField(t)}),document.addEventListener("keyup",o=>{let t=o.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&o.key===u.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.querySelectorAll(".expressive-textarea").forEach(o=>{d.InitTextarea(o)}),document.querySelectorAll('.file-field input[type="file"]').forEach(o=>{d.InitFileInputPath(o)})})}static InitTextarea(o){o.setAttribute("original-height",o.getBoundingClientRect().height.toString()),d.textareaAutoResize(o),o.addEventListener("input",t=>d.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 ee={},Y=class d extends _{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._searchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting)};this._onSearchViewClose=()=>{this._searchOpen=this._view.open};this._onSearchFocus=()=>{if(!(!this._view||this._searchOpen)){if(this._view instanceof HTMLDialogElement){this._searchOpen=!0,this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return ee}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._input?.removeEventListener("click",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;width:100%;height:1px;margin-top:-1px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("beforebegin",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._input.addEventListener("click",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var ie={},G=class d extends _{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),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=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===u.keys.ESC&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.el.Expressive_FloatingActionButton=this,this.options={...d.defaults,...e},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&(this._anchor.tabIndex<0&&(this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown)),this.el.addEventListener("click",this._handleFABClick)}static get defaults(){return ie}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown),this.el.Expressive_FloatingActionButton=void 0}_toggle(){this.isOpen?this.close():this.open()}};var se={},ne=new Set(["single","multiple"]),Mt="button-group-pressed",oe=.15,X=class d extends _{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(n=>n.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(n=>{this._rememberPressed(n),n.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Mt),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return se}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return ne.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Mt),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(p=>p.getBoundingClientRect()),n=s[i].width;if(n<=0)return;let a=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),c=Number.isFinite(a)?a:.15,h=n*c,l=[i-1,i+1].filter(p=>p>=0&&p<e.length),r=new Map;if(l.length===1){let p=l[0];r.set(p,Math.min(h,this._compressionCapacity(e[p],s[p])))}else{let p=h/2;for(let E of l)r.set(E,Math.min(p,this._compressionCapacity(e[E],s[E])));let v=h-[...r.values()].reduce((E,b)=>E+b,0);for(let E of l){if(v<=0)break;let b=this._compressionCapacity(e[E],s[E])-r.get(E),w=Math.min(v,b);r.set(E,r.get(E)+w),v-=w}}let m=[...r.values()].reduce((p,v)=>p+v,0);m<=0||(e.forEach((p,v)=>{this._pressedStyles.set(p,{width:p.style.width,baseWidth:s[v].width}),p.style.width=`${s[v].width}px`}),this.el.offsetWidth,e.forEach((p,v)=>{let E=v===i?m:-(r.get(v)||0);p.style.width=`${s[v].width+E}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-oe):e.height;return Math.max(0,e.width-i)}};var ae={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"}},x=class x extends _{constructor(t,e){super(t,e,x);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=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._motion=window.matchMedia("(prefers-reduced-motion: reduce)");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=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,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=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};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._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{if(this._handleNativeScroll(),!(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._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};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=>{let e=t.target;if(e.isContentEditable||e.closest("input, textarea, select"))return;let i=getComputedStyle(this._scroller).direction==="rtl",s=this._vertical?t.key==="ArrowDown":t.key===(i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT),n=this._vertical?t.key==="ArrowUp":t.key===(i?u.keys.ARROW_RIGHT:u.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)):s?(t.preventDefault(),this.next(),this._focusItem(this.center)):n&&(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._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this.el.Expressive_Carousel=this,this.options={...x.defaults,...e},e?.i18n&&(this.options.i18n={...x.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"),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(s=>{this._itemA11yOriginal.set(s,{ariaHidden:s.getAttribute("aria-hidden"),tabIndex:s.getAttribute("tabindex")}),s.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(s)}),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,this.images.forEach(s=>s.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 i=Math.max(0,this.images.findIndex(s=>s.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return ae}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")}_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,c=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",a?`${a}, ${c}`:c),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._motion.addEventListener("change",this._handleMotionChange),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&&(x._live.add(this),x._resizeListening||(window.addEventListener("resize",x._onResize,{passive:!0}),x._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0}),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),this._scroller.addEventListener("transitionend",this._handleItemResize)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._motion.removeEventListener("change",this._handleMotionChange),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("wheel",this._handleNativeScroll),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._scroller.removeEventListener("transitionend",this._handleItemResize),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(x._live.delete(this),x._live.size===0&&x._resizeListening&&(window.removeEventListener("resize",x._onResize),x._resizeListening=!1))}_teardown(){this._started=!1,this._removeEventHandlers(),this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),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&&!this._motion.matches&&!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,l)=>{this._authoredItemSizes.has(h)||(h.setAttribute("data-carousel-size",l),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 l=this.images[t-1];l&&e(l,"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 l=this.images[t+h];l&&e(l,"large")}let a=this.images[t+n],c=this.images[t+n+1];a&&e(a,"medium"),c&&e(c,"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,c=Math.max(-1,Math.min(1,(a-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${c*-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=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",s=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,n=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,a=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-n,c=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,h=this.center,l=1/0;return this.images.forEach((r,m)=>{let p=this._vertical?r.offsetTop:r.offsetLeft,v=this._vertical?r.offsetHeight:r.offsetWidth,E=t?p-(n-v)/2:p+(i?v-n+c:-c),b=Math.max(i?-a:0,Math.min(i?0:a,E)),w=Math.abs(b-s);(w<l||w===l&&m===this.center)&&(l=w,h=m)}),h}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let s=this.el.classList.contains("center-aligned"),n=getComputedStyle(this._scroller),a=Number.parseFloat(n.paddingInlineStart)||0,c=Number.parseFloat(n.paddingBlockStart)||0,h=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:n.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+a:i.offsetLeft-a,l=i.offsetTop-c;this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:h,top:this._vertical?l:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,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)}};x._live=new Set,x._resizeListening=!1,x._onResize=u.throttle(()=>{x._live.forEach(t=>t._handleResize())},200);var W=x;var re=Object.freeze({}),rt=class d extends _{constructor(t,e){super(t,{},d);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={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return re}static init(t,e={}){return super.init(t,e,d)}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 le={classes:"",menuOptions:{}},k=class d extends _{constructor(t,e){super(t,e,d);this._originalLabels=new Map;this._validationMessage=null;this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{d.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this._handleSelectChange(),this._clearValidationError())},0)};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={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return le}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),e&&(this._values.find(i=>i.el===e)?.optionEl??this.input).focus())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.el.addEventListener("invalid",this._handleInvalid),this.el.addEventListener("focus",this._handleNativeFocus),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.el.removeEventListener("invalid",this._handleInvalid),this.el.removeEventListener("focus",this._handleNativeFocus),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus),this._form?.removeEventListener("reset",this._handleReset),clearTimeout(this._resetTimer)}_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)})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_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(!this.el.matches(":disabled")){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(a=>a.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._handleSelectChange();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,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${u.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._labelPlaceholder&&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"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),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.input.disabled=this.el.matches(":disabled"),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._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),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.matches(":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-"+u.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(c=>c.tagName==="OPTION").forEach(c=>{let h=this._createAndAppendOptionWithIcon(c,"optgroup-option");n.push(h.id),this._addOptionToValues(c,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._originalLabels.forEach((e,i)=>{for(let s of["for","id"])e[s]===null?i.removeAttribute(s):i.setAttribute(s,e[s])}),this._labelPlaceholder?.replaceWith(this.labelEl),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-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let s=this.el.matches(":disabled")||t.matches(":disabled");s&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let n=t.textContent,a=document.createElement("span");if(this.isMultiple&&!s){let r=document.createElement("label"),m=document.createElement("input");m.type="checkbox",m.tabIndex=-1;let p=document.createElement("span");p.textContent=n,r.append(m,p),a.appendChild(r)}else a.textContent=n;i.appendChild(a);let c=t.getAttribute("data-icon"),h;if(c)try{let r=new URL(c,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(r.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(r.href))&&(h=r)}catch{}let l=t.getAttribute("class")?.split(" ").filter(Boolean);if(h){let r=document.createElement("img");l?.length&&r.classList.add(...l),r.src=h.href,r.ariaHidden="true",i.prepend(r)}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(){this.input.value=this._getSelectedOptions().map(t=>t.textContent.trim()).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 he={margin:5,transition:10,duration:250,align:"left"},j=class d{constructor(o,t,e){this._handleDocumentClick=o=>{this.visible&&!o.composedPath().includes(this.el)&&!o.composedPath().includes(this.container)&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let o=u._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>`,H._loadingTemplate=t.content.firstElementChild}return H._loadingTemplate.cloneNode(!0)}destroy(){this._openTimer!==void 0&&(clearTimeout(this._openTimer),this._openTimer=void 0),this._removeEventHandlers(),this.menu.destroy(),this.isOpen=!1,this._removeMenu(),this._statusInfo.remove(),this._announcer.remove(),this.el.Expressive_Autocomplete=void 0}_setupEventHandlers(){this.el.addEventListener("blur",this._handleInputBlur),this.el.addEventListener("input",this._handleInput),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("input",this._handleInput),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-${u.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(a=>{let h=this._createMenuItem(a);this.container.append(h)}),this.el.parentElement.appendChild(this.container);let t={...H.defaults.menuOptions,...this.options.menuOptions},e=t.onOpenStart,i=t.onCloseStart;t.onOpenStart=a=>{this.isOpen=!0,typeof e=="function"&&e.call(this.menu,a)},t.onCloseStart=a=>{this.isOpen=!1,typeof i=="function"&&i.call(this.menu,a)};let s=t.onItemClick;t.onItemClick=a=>{if(!a)return;let h=a.getAttribute("data-id");this.selectOption(h),typeof s=="function"&&s.call(this.menu,a)},this.menu=B.init(this.el,t),this.el.setAttribute("aria-haspopup","listbox");let o=this.el.parentElement.querySelector("label");o&&this.el.after(o),this.el.removeEventListener("click",this.menu._handleClick),this.options.isMultiSelect||this._refreshInputText(),this.el.value&&this.selectOption(this.el.value);let r=document.createElement("div");r.classList.add("status-info"),r.setAttribute("aria-hidden","true"),r.setAttribute("style","position: absolute;right:0;top:0;"),this.el.parentElement.appendChild(r),this._statusInfo=r,this._announcer=document.createElement("div"),this._announcer.classList.add("autocomplete-status"),this._announcer.setAttribute("role","status"),this._announcer.setAttribute("aria-live","polite"),this._announcer.setAttribute("aria-atomic","true"),this.el.parentElement.appendChild(this._announcer),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._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-${u.guid()}`,e.setAttribute("role","option");let i=this.selectedValues.some(l=>l.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=-1,this.options.isMultiSelect){let l=document.createElement("div");l.classList.add("item-selection"),l.style.textAlign="center";let c=document.createElement("input");c.type="checkbox",c.tabIndex=-1,c.checked=i;let m=document.createElement("span");m.style.paddingLeft="21px",l.append(c,m),e.appendChild(l)}if(t.image){let l=document.createElement("img");l.classList.add("circle"),l.src=t.image,e.appendChild(l)}let s=this.el.value.toLocaleLowerCase(),o=this._highlightPartialText(s,(t.text||t.id).toString()),r=document.createElement("div");if(r.setAttribute("style","line-height:1.2;font-weight:500;"),this.options.allowUnsafeHTML)r.innerHTML=o[0]+'<span class="highlight">'+o[1]+"</span>"+o[2];else if(r.appendChild(document.createTextNode(o[0])),o[1]){let l=document.createElement("span");l.textContent=o[1],l.classList.add("highlight"),r.appendChild(l),r.appendChild(document.createTextNode(o[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(r),typeof t.description=="string"||typeof t.description=="number"&&!isNaN(t.description)){let l=document.createElement("small");l.setAttribute("style","line-height:1.3;color:grey;white-space:nowrap;text-overflow:ellipsis;display:block;width:90%;overflow:hidden;"),l.innerText=t.description,e.querySelector(".item-text").appendChild(l)}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._statusInfo;t&&t.replaceChildren(H._loadingIndicator()),this._announce(this.options.i18n.loading)}_announce(t){if(!this._announcer)return;let e=this.el.matches(":focus")&&this.el.value.length>=this.options.minLength?t:"";this._announcer.textContent!==e&&(this._announcer.textContent=e)}_updateSelectedInfo(){let t=this._statusInfo;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",{bubbles:!0,cancelable:!0,composed:!0})),typeof this.options.onAutocomplete=="function"&&this.options.onAutocomplete.call(this,this.selectedValues)}setMenuItems(t,e=null,i=!0){if(this.el.Expressive_Autocomplete!==this)return;let s=t.length;this.menuItems=t,this.options.data=t,e&&(this.selectedValues=this.menuItems.filter(o=>e.indexOf(o.id)!==-1)),this.options.isMultiSelect?this._renderMenu():this._refreshInputText(),i&&this.open(),this._updateSelectedInfo(),this._announce(i?s?this.options.i18n.results(s):this.options.i18n.noResults:""),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.options.isMultiSelect&&this._announce(this.options.i18n.selected(this.selectedValues.length)),this._triggerChanged())}};H._loadingTemplate=null;var F=H;var Te={data:[],placeholder:"",secondaryPlaceholder:"",closeIconClass:"material-symbols",autocompleteOptions:{},autocompleteOnly:!1,limit:1/0,allowUserInput:!1,i18n:{remove:"Remove"},onChipAdd:null,onChipSelect:null,onChipDelete:null},A=class A extends b{constructor(t,e){super(t,e,A);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,"input"):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(A._keydown=!0,t.key===u.keys.ENTER){if(this.hasAutocomplete&&this.autocomplete?.isOpen&&this.autocomplete.container.querySelector('[role="option"]'))return;t.preventDefault(),(!this.hasAutocomplete||this.hasAutocomplete&&!this.options.autocompleteOnly)&&this.addChip({id:this._input.value}),this._input.value=""}else(t.key===u.keys.BACKSPACE||t.key===u.keys.ARROW_LEFT)&&this._input.value===""&&this.chipsData.length&&(t.preventDefault(),this.selectChip(this.chipsData.length-1))};this.el.Expressive_Chips=this,this.options={...A.defaults,...e},e?.i18n&&(this.options.i18n={...A.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 Te}static init(t,e={}){return super.init(t,e,A)}static getInstance(t){return t.Expressive_Chips}getData(){return this.chipsData}destroy(){this.autocomplete&&F.getInstance(this._input)===this.autocomplete&&this.autocomplete.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),this.el.addEventListener("keydown",A._handleChipsKeydown),this.el.addEventListener("keyup",A._handleChipsKeyup),this.el.addEventListener("blur",A._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),this.el.removeEventListener("keydown",A._handleChipsKeydown),this.el.removeEventListener("keyup",A._handleChipsKeyup),this.el.removeEventListener("blur",A._handleChipsBlur,!0),this._input.removeEventListener("focus",this._handleInputFocus),this._input.removeEventListener("blur",this._handleInputBlur),this._input.removeEventListener("keydown",this._handleInputKeydown)}static _handleChipsKeydown(t){A._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(t.key===u.keys.BACKSPACE||t.key===u.keys.DELETE){let r=o._chips.indexOf(t.target.closest(".chip"));if(r<0)return;t.preventDefault(),o._deleteChip(r,"previous")}else if(t.key===u.keys.ARROW_LEFT){if(o._selectedChip){let r=o._chips.indexOf(o._selectedChip)-1;if(r<0)return;o.selectChip(r)}}else if(t.key===u.keys.ARROW_RIGHT&&o._selectedChip){let r=o._chips.indexOf(o._selectedChip)+1;r>=o.chipsData.length?(o._setSelected(null),o._input.focus()):o.selectChip(r)}}}static _handleChipsKeyup(){A._keydown=!1}static _handleChipsBlur(t){if(!A._keydown&&document.hidden){let i=t.target.closest(".chips")?.Expressive_Chips;i&&i._setSelected(null)}}_renderChip(t){if(!t.id&&t.id!==0)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 o=document.createElement("span");o.classList.add(this.options.closeIconClass),o.setAttribute("aria-hidden","true"),o.innerText="close",s.appendChild(o),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=>{A.getInstance(this.el)===this&&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=F.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",u.guid())}_setupLabel(){this._label=this.el.querySelector("label"),this._label&&this._input&&this._label.setAttribute("for",this._input.getAttribute("id"))}_setPlaceholder(){this._input&&(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||t.id===0,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?this._input.before(e):this.el.append(e),this._setPlaceholder(),typeof this.options.onChipAdd=="function"&&this.options.onChipAdd(this.el,e)}deleteChip(t){let e=this.el.getRootNode();this._deleteChip(t,this._chips[t]?.contains(e.activeElement)?"input":null)}_deleteChip(t,e){let i=this._chips[t];if(!i)return;this._selectedChip===i&&this._setSelected(null),i.remove(),this._chips.splice(t,1),this.chipsData.splice(t,1),this._setPlaceholder();let s=[],o=this.el.getRootNode();for(;o;)s.push({root:o,element:o.activeElement}),o="host"in o?o.host.getRootNode():null;typeof this.options.onChipDelete=="function"&&this.options.onChipDelete(this.el,i),!(!e||s.some(({root:r,element:a})=>r.activeElement!==a)||this.el.Expressive_Chips!==this)&&(e==="previous"&&this._chips.length?this.selectChip(Math.max(t-1,0)):(this._setSelected(null),this._input?.focus()))}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(){u.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()}})})})}};A._keydown=!1;var z=A;var xe={},Tt=new WeakMap,Y=class d extends b{constructor(t,e){super(t,e,d);this._resizeObserver=null;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=t=>{(t.type==="input"||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={...d.defaults,...e},this._pointerDown=!1,this._setupThumb(),this._sync(),this._setupEventHandlers(),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>this._sync()),this._resizeObserver.observe(this.el))}static get defaults(){return xe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Slider}destroy(){this._resizeObserver?.disconnect(),this._removeEventHandlers(),this._removeThumb(),this.el.Expressive_Slider=void 0;let t=this._host();for(let e of[this.el,t]){for(let i in Tt.get(e))e.style.setProperty(i,Tt.get(e)[i]);Tt.delete(e)}t?.querySelectorAll('input[type="range"]').forEach(e=>e.Expressive_Slider?._sync())}_set(t,e,i){let s=Tt.get(t)??{};Tt.set(t,s),s[e]??(s[e]=t.style.getPropertyValue(e)),t.style.setProperty(e,i)}_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),i=Number.isNaN(e)?100:e,s=parseFloat(t.min)||0,o=parseFloat(t.value)||0;return i===s?0:(o-s)/(i-s)}_sync(){let t=this._fraction(this.el),e=`${t*100}%`,i=this.el.offsetLeft,s=this.el.offsetTop,o=this.el.offsetWidth,r=this.el.offsetHeight,a=getComputedStyle(this.el),h=a.direction==="rtl",l=this._isVertical(),c=parseFloat(a.getPropertyValue("--md-comp-slider-handle-width"))||4,m=l?r:o,f=c/2+t*(m-c);this._set(this.el,"--md-comp-slider-active-fraction",e),this._set(this.el,"--md-comp-slider-active-position",`${f}px`);let p=this._host(),v=p?.querySelectorAll('input[type="range"]');if(p&&v&&v.length===2){let g=Array.from(v).map(E=>this._fraction(E));this._set(p,"--md-comp-slider-start-fraction",`${Math.min(...g)*100}%`),this._set(p,"--md-comp-slider-end-fraction",`${Math.max(...g)*100}%`),this._set(p,"--md-comp-slider-start-position",`${c/2+Math.min(...g)*(m-c)}px`),this._set(p,"--md-comp-slider-end-position",`${c/2+Math.max(...g)*(m-c)}px`)}if(p?.classList.contains("stops")){let g=parseFloat(this.el.max),E=Number.isNaN(g)?100:g,L=parseFloat(this.el.min)||0,x=parseFloat(this.el.step),T=x>0&&Number.isFinite(x)&&E>L;this._set(p,"--md-comp-slider-stop-count",T?String(Math.floor((E-L)/x+1e-9)+1):""),this._set(p,"--md-comp-slider-stop-spacing",T?`${(m-c)*x/(E-L)}px`:""),v?.length===1&&(this._set(p,"--md-comp-slider-active-position",`${f}px`),this._set(p,"--md-comp-slider-track-center",`${s+r/2}px`))}this.value.textContent=this.el.value,l?(this.thumb.style.left=`${i+o/2}px`,this.thumb.style.top=`${s+r-f}px`):(this.thumb.style.left=`${i+(h?o-f:f)}px`,this.thumb.style.top=`${s}px`)}static Init(){u.onDocumentReady(()=>{d.init(document.querySelectorAll("input[type=range]"),{})})}};var w=class w{static Init(){u.onDocumentReady(()=>{document.addEventListener("pointerdown",w._onPointerDown,{passive:!0}),document.addEventListener("pointerup",w._onPointerUp,{passive:!0}),document.addEventListener("pointercancel",w._onPointerCancel,{passive:!0})})}static _onPointerDown(n){if(!w._isPrimaryPress(n)){w._down=null;return}let t=w._backdropDialog(n);if(!t||!w._lightDismissible(t)||!w._outside(n,t)){w._down=null;return}w._down={dialog:t,pointerId:n.pointerId}}static _onPointerUp(n){let t=w._down;w._down=null,!(!t||t.pointerId!==n.pointerId)&&n.isPrimary&&(!t.dialog.isConnected||!t.dialog.open||w._lightDismissible(t.dialog)&&w._backdropDialog(n)===t.dialog&&w._outside(n,t.dialog)&&t.dialog.close())}static _onPointerCancel(){w._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=w._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}};w._down=null;var X=w;var $t=96,Vt=.5,Me=100,Ce=4;function Mt(d){let n=l=>d.axis==="x"?l.clientX:l.clientY,t,e=null,i=l=>{if(!(l instanceof Element))return null;let c=l.closest(d.selector);return c instanceof HTMLDialogElement?c:null},s=l=>{l.style.transition="",l.style.setProperty(d.property,"0px")},o=l=>{if(!l.isPrimary||l.pointerType==="mouse"&&l.button!==0)return;h(),d.onPress?.();let c=i(l.target);if(!c?.open){e=null;return}if(!d.inHandle(l,c)){e=null;return}c.style.transition="none",e={dialog:c,pointerId:l.pointerId,direction:d.direction(c),start:n(l),last:n(l),lastT:Date.now(),velocity:0,shift:0},t.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open"],attributeOldValue:!0})},r=l=>{if(!e||e.pointerId!==l.pointerId)return;if(!e.dialog.open||!e.dialog.isConnected){h();return}let c=n(l)-e.start;if(e.shift=e.direction===1?Math.max(0,c):Math.min(0,c),n(l)!==e.last){let m=Date.now();e.velocity=(n(l)-e.last)/Math.max(1,m-e.lastT),e.last=n(l),e.lastT=m}e.dialog.style.setProperty(d.property,`${e.shift}px`)},a=l=>{let c=e;if(!c||c.pointerId!==l.pointerId)return;if(!c.dialog.open||!c.dialog.isConnected){h();return}r(l),e=null,t.disconnect(),c.dialog.style.transition="";let m=Date.now()-c.lastT<Me?c.velocity:0,f=Math.abs(c.shift)>Ce;d.onRelease?.(f),f&&(c.direction===1?c.shift>$t||m>Vt:c.shift<-$t||m<-Vt)&&c.dialog.open&&c.dialog.close(),c.dialog.style.setProperty(d.property,"0px")},h=l=>{if(l&&e?.pointerId!==l.pointerId)return;t.disconnect(),d.onRelease?.(!1);let c=e;e=null,c&&s(c.dialog)};u.onDocumentReady(()=>{t=new MutationObserver(l=>{let c=e?.dialog;c&&(!c.open||!c.isConnected||l.some(m=>m.type==="attributes"&&m.target===c&&m.oldValue===null||[...m.removedNodes].some(f=>f.contains(c))))&&h()}),document.addEventListener("pointerdown",o,{passive:!0}),document.addEventListener("pointermove",r,{passive:!0}),document.addEventListener("pointerup",a,{passive:!0}),document.addEventListener("pointercancel",h,{passive:!0})})}var qt="dialog.bottom-sheet, dialog.bottom",G=class G{static Init(){Mt({selector:qt,axis:"y",property:"--md-comp-bottom-sheet-shift",direction:()=>1,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},onPress:()=>{G._dragged=!1},onRelease:n=>{G._dragged=n}}),u.onDocumentReady(()=>{document.addEventListener("click",G._onClick)})}static _onClick(n){let t=n.target;if(!(t instanceof Element))return;let e=t.closest(".handle, .drag-handle");if(!(e instanceof HTMLButtonElement)||n.detail!==0&&G._dragged)return;let i=e.closest(qt);i instanceof HTMLDialogElement&&i.open&&i.close()}};G._dragged=!1;var Q=G;var we=d=>d.classList.contains("left")||d.classList.contains("left-sheet")||d.classList.contains("start"),zt=d=>we(d)!==(getComputedStyle(d).direction==="rtl"),Z=class{static Init(){Mt({selector:"dialog.side-sheet, dialog.right, dialog.right-sheet, dialog.left, dialog.left-sheet",axis:"x",property:"--md-comp-side-sheet-shift",direction:n=>zt(n)?-1:1,inHandle:(n,t)=>{let e=n.target;if(e instanceof Element&&e.closest("header"))return!0;let i=t.getBoundingClientRect();return zt(t)?n.clientX>=i.right-24&&n.clientX<=i.right:n.clientX>=i.left&&n.clientX<=i.left+24}})}};var J=class d{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(){u.onDocumentReady(()=>{document.addEventListener("change",n=>{let t=n.target;if(t instanceof HTMLInputElement&&t.type==="file"){let e=t.closest(".drop-zone");e&&d.listDropZoneFiles(e,t)}t instanceof HTMLInputElement&&d.validateField(t)}),document.addEventListener("keyup",n=>{let t=n.target;t instanceof HTMLInputElement&&["radio","checkbox"].includes(t.type)&&n.key===u.keys.TAB&&(t.classList.add("tabbed"),t.addEventListener("blur",()=>t.classList.remove("tabbed"),{once:!0}))}),document.addEventListener("click",d.togglePassword),document.addEventListener("submit",d.resetFormExtras,!0),document.addEventListener("reset",d.resetFormExtras,!0);for(let n of["dragenter","dragover","dragleave","drop"])document.addEventListener(n,d.markDropZone);document.querySelectorAll(".expressive-textarea").forEach(n=>{d.InitTextarea(n)}),document.querySelectorAll('.file-field input[type="file"]').forEach(n=>{d.InitFileInputPath(n)})})}static togglePassword(n){let t=n.target.closest?.(".password-toggle"),e=t?.closest(".field")?.querySelector('input[type="password"], input[data-password]');if(!e)return;let i=e.type==="password";e.toggleAttribute("data-password",i),e.type=i?"text":"password",t.setAttribute("aria-pressed",String(i))}static resetFormExtras(n){let t=n.target;t instanceof HTMLFormElement&&(t.querySelectorAll("input[data-password]").forEach(e=>{e.removeAttribute("data-password"),e.type="password",e.closest(".field")?.querySelector(".password-toggle")?.setAttribute("aria-pressed","false")}),n.type==="reset"&&(t.querySelectorAll(".drop-zone-files").forEach(e=>e.replaceChildren()),t.querySelectorAll(".drop-zone.dragover").forEach(e=>e.classList.remove("dragover"))))}static markDropZone(n){let t=n.target;if(!(t instanceof HTMLInputElement)||t.type!=="file")return;let e=t.closest(".drop-zone");if(!e)return;let i=n.type==="dragenter"||n.type==="dragover";e.classList.toggle("dragover",i&&!t.disabled)}static listDropZoneFiles(n,t){let e=n.querySelector(".drop-zone-files");if(!e)return;let i=s=>{let[o,r]=s>=1e6?[s/1e6,"megabyte"]:s>=1e3?[s/1e3,"kilobyte"]:[s,"byte"];return new Intl.NumberFormat(void 0,{style:"unit",unit:r,maximumFractionDigits:1}).format(o)};e.replaceChildren(...Array.from(t.files??[],s=>{let o=document.createElement("li"),r=document.createElement("span"),a=document.createElement("span");return r.textContent=s.name,a.textContent=i(s.size),o.append(r,a),o}))}static InitTextarea(n){n.setAttribute("original-height",n.getBoundingClientRect().height.toString()),d.textareaAutoResize(n),n.addEventListener("input",t=>d.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 Ie={},tt=class d extends b{constructor(t,e){super(t,e,d);this._observer=null;this._sentinel=null;this._input=null;this._view=null;this._searchOpen=!1;this._onIntersect=t=>{let e=t[0];e&&this.el.classList.toggle("collapsed",!e.isIntersecting&&e.boundingClientRect.top<this.el.getBoundingClientRect().top)};this._onSearchViewClose=()=>{this._searchOpen=this._view.open};this._onSearchFocus=()=>{if(!(!this._view||this._searchOpen)){if(this._view instanceof HTMLDialogElement){this._searchOpen=!0,this._view.open||this._view.showModal();return}this._view.hidden=!1,this._input?.setAttribute("aria-expanded","true")}};this.el.Expressive_AppBar=this,this.options={...d.defaults,...e},this._setupCollapse(),this._setupSearch()}static get defaults(){return Ie}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_AppBar}destroy(){this._observer?.disconnect(),this._observer=null,this._sentinel?.remove(),this._sentinel=null,this._input?.removeEventListener("focus",this._onSearchFocus),this._input?.removeEventListener("click",this._onSearchFocus),this._view?.removeEventListener("close",this._onSearchViewClose),this.el.classList.remove("collapsed"),this.el.Expressive_AppBar=void 0}_setupCollapse(){!this.el.classList.contains("medium")&&!this.el.classList.contains("large")||typeof IntersectionObserver>"u"||(this._sentinel=document.createElement("span"),this._sentinel.setAttribute("aria-hidden","true"),this._sentinel.style.cssText="display:block;height:0;position:relative;top:-64px;pointer-events:none;visibility:hidden",this.el.insertAdjacentElement("afterend",this._sentinel),this._observer=new IntersectionObserver(this._onIntersect),this._observer.observe(this._sentinel))}_setupSearch(){if(this._input=this.el.querySelector('input[type="search"]'),!this._input)return;let t=this._input.getAttribute("aria-controls");t&&(this._view=document.getElementById(t)),this._view||(this._view=this.el.querySelector(".search-view")),this._view&&(this._input.addEventListener("focus",this._onSearchFocus),this._input.addEventListener("click",this._onSearchFocus),this._view instanceof HTMLDialogElement&&this._view.addEventListener("close",this._onSearchViewClose))}};var Ae={},et=class d extends b{constructor(t,e){super(t,e,d);this.open=()=>{this.isOpen||(this.isOpen=!0,this._list&&(this._list.inert=!1),this.el.classList.add("active"),this._anchor?.setAttribute("aria-expanded","true"),document.addEventListener("click",this._handleDocumentClick),document.addEventListener("keydown",this._handleDocumentKeydown))};this.close=()=>{if(!this.isOpen)return;let t=this.el.getRootNode().activeElement;t&&this._list?.contains(t)&&this._anchor?.focus(),this._list&&(this._list.inert=!0),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=>{let e=t.target;if(!(e instanceof Element))return;let i=e.closest("a, button");!i||i.matches(':disabled, [aria-disabled="true"]')||(i===this._anchor?this._toggle():this._list?.contains(i)&&this.close())};this._handleAnchorKeydown=t=>{(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._toggle())};this._handleDocumentKeydown=t=>{t.key===u.keys.ESC&&!t.defaultPrevented&&this.close()};this._handleDocumentClick=t=>{t.composedPath().includes(this.el)||this.close()};this.el.Expressive_FloatingActionButton=this,this.options={...d.defaults,...e},this.isOpen=!1,this._anchor=this.el.querySelector(":scope > a, :scope > button"),this._list=this.el.querySelector(":scope > ul, :scope > menu"),this._listWasInert=this._list?.inert??!1,this.el.classList.remove("active"),this._list&&(this._list.inert=!0),this._anchor?.setAttribute("aria-expanded","false"),this._anchor instanceof HTMLAnchorElement&&!this._anchor.hasAttribute("href")&&(this._anchor.tabIndex<0&&(this._anchor.tabIndex=0),this._anchor.addEventListener("keydown",this._handleAnchorKeydown)),this.el.addEventListener("click",this._handleFABClick)}static get defaults(){return Ae}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FloatingActionButton}destroy(){this.close(),this._list&&(this._list.inert=this._listWasInert),this.el.removeEventListener("click",this._handleFABClick),this._anchor?.removeEventListener("keydown",this._handleAnchorKeydown),this.el.Expressive_FloatingActionButton=void 0}_toggle(){this.isOpen?this.close():this.open()}};var Se={},ke=new Set(["single","multiple"]),Kt="button-group-pressed",He=.15,it=class d extends b{constructor(t,e={}){super(t,e,d);this._pressedStyles=new Map;this._releaseStyles=new Map;this._releaseTimer=null;this._originalPressed=new Map;this._activeItem=null;this._handleClick=t=>{if(!this._selectionMode)return;let e=this._itemFromEvent(t);if(!(e instanceof HTMLButtonElement)||this._isDisabled(e))return;this._rememberPressed(e);let i=e.getAttribute("aria-pressed")!=="true",s=this._toggleItems.filter(o=>o.getAttribute("aria-pressed")==="true").length;!i&&this.el.hasAttribute("data-selection-required")&&s===1||(this._selectionMode==="single"&&i&&this._toggleItems.forEach(o=>{this._rememberPressed(o),o.setAttribute("aria-pressed","false")}),e.setAttribute("aria-pressed",i?"true":"false"))};this._handlePointerDown=t=>{if(t.button!==0)return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyDown=t=>{if(t.repeat||t.key!==" "&&t.key!=="Enter")return;let e=this._itemFromEvent(t);e&&!this._isDisabled(e)&&this._startPress(e)};this._handleKeyUp=t=>{(t.key===" "||t.key==="Enter")&&this._resetPress()};this._handleFocusOut=t=>{t.target===this._activeItem&&this._resetPress()};this._resetPress=()=>{if(this._activeItem?.classList.remove(Kt),this._activeItem=null,!!this._pressedStyles.size){this._finishRelease(),this._releaseStyles=new Map(this._pressedStyles);for(let[t,e]of this._releaseStyles)t.style.width=`${e.baseWidth}px`;this._pressedStyles.clear(),this._releaseTimer=window.setTimeout(this._finishRelease,200)}};this._finishRelease=()=>{this._releaseTimer!==null&&window.clearTimeout(this._releaseTimer),this._releaseTimer=null;for(let[t,e]of this._releaseStyles)t.style.width=e.width;this._releaseStyles.clear()};this.el.Expressive_ButtonGroup=this,this.options={...d.defaults,...e},this._selectionMode&&(this._normalizeSelection(),this.el.addEventListener("click",this._handleClick,!0)),this.el.addEventListener("pointerdown",this._handlePointerDown),this.el.addEventListener("keydown",this._handleKeyDown),this.el.addEventListener("focusout",this._handleFocusOut),document.addEventListener("pointerup",this._resetPress),document.addEventListener("pointercancel",this._resetPress),document.addEventListener("keyup",this._handleKeyUp),window.addEventListener("blur",this._resetPress)}static get defaults(){return Se}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_ButtonGroup}destroy(){this._resetPress(),this._finishRelease(),this.el.removeEventListener("click",this._handleClick,!0),this.el.removeEventListener("pointerdown",this._handlePointerDown),this.el.removeEventListener("keydown",this._handleKeyDown),this.el.removeEventListener("focusout",this._handleFocusOut),document.removeEventListener("pointerup",this._resetPress),document.removeEventListener("pointercancel",this._resetPress),document.removeEventListener("keyup",this._handleKeyUp),window.removeEventListener("blur",this._resetPress);for(let[t,e]of this._originalPressed)e===null?t.removeAttribute("aria-pressed"):t.setAttribute("aria-pressed",e);this._originalPressed.clear(),this.el.Expressive_ButtonGroup=void 0}get _selectionMode(){let t=this.el.dataset.selection;return ke.has(t)?t:null}get _items(){return Array.from(this.el.children).filter(t=>t instanceof HTMLButtonElement||t instanceof HTMLAnchorElement&&t.classList.contains("button"))}get _toggleItems(){return this._items.filter(t=>t instanceof HTMLButtonElement)}_normalizeSelection(){let t=this._toggleItems;t.forEach(e=>{this._rememberPressed(e),["true","false"].includes(e.getAttribute("aria-pressed")||"")||e.setAttribute("aria-pressed","false")}),this._selectionMode==="single"&&t.filter(i=>i.getAttribute("aria-pressed")==="true").slice(1).forEach(i=>i.setAttribute("aria-pressed","false")),this.el.hasAttribute("data-selection-required")&&!t.some(e=>e.getAttribute("aria-pressed")==="true")&&t.find(e=>!this._isDisabled(e))?.setAttribute("aria-pressed","true")}_itemFromEvent(t){if(!(t.target instanceof Element))return null;let e=t.target.closest("button, a.button");return e instanceof HTMLElement&&e.parentElement===this.el?e:null}_isDisabled(t){return t instanceof HTMLButtonElement&&t.disabled||t.getAttribute("aria-disabled")==="true"||t.classList.contains("disabled")}_rememberPressed(t){this._originalPressed.has(t)||this._originalPressed.set(t,t.getAttribute("aria-pressed"))}_startPress(t){if(this._activeItem)return;this._finishRelease();let e=this._items,i=e.indexOf(t);if(i<0||(this._activeItem=t,t.classList.add(Kt),this.el.classList.contains("connected")||e.length<2))return;let s=e.map(f=>f.getBoundingClientRect()),o=s[i].width;if(o<=0)return;let r=Number.parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-button-group-pressed-item-width-multiplier")),a=Number.isFinite(r)?r:.15,h=o*a,l=[i-1,i+1].filter(f=>f>=0&&f<e.length),c=new Map;if(l.length===1){let f=l[0];c.set(f,Math.min(h,this._compressionCapacity(e[f],s[f])))}else{let f=h/2;for(let v of l)c.set(v,Math.min(f,this._compressionCapacity(e[v],s[v])));let p=h-[...c.values()].reduce((v,g)=>v+g,0);for(let v of l){if(p<=0)break;let g=this._compressionCapacity(e[v],s[v])-c.get(v),E=Math.min(p,g);c.set(v,c.get(v)+E),p-=E}}let m=[...c.values()].reduce((f,p)=>f+p,0);m<=0||(e.forEach((f,p)=>{this._pressedStyles.set(f,{width:f.style.width,baseWidth:s[p].width}),f.style.width=`${s[p].width}px`}),this.el.offsetWidth,e.forEach((f,p)=>{let v=p===i?m:-(c.get(p)||0);f.style.width=`${s[p].width+v}px`}))}_compressionCapacity(t,e){let i=t.classList.contains("icon-button")?e.width*(1-He):e.height;return Math.max(0,e.width-i)}};var Oe={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"}},I=class I extends b{constructor(t,e){super(t,e,I);this.center=0;this._ownIndicators=!1;this._trackEl=null;this._ignoreScroll=!1;this._alignAfterResize=!1;this._trackRaf=null;this._started=!1;this._vertical=!1;this._resizeObserver=null;this._resizeTimeout=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._motion=window.matchMedia("(prefers-reduced-motion: reduce)");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=()=>{!this._started||this._resizeTimeout!==null||(this._handleResize(),this._resizeTimeout=setTimeout(()=>{this._resizeTimeout=null,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=this.el.contains(t.relatedTarget)),this._syncAutoAdvance()};this._handleMotionChange=()=>{this._syncAutoAdvance(),this._motion.matches&&this._scrollToIndex(this.center,!1),this._updateParallax()};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._handleNativeScroll=()=>{this._alignAfterResize=!1,this._finishScroll()};this._handleTrackPointerDown=t=>{this._handleNativeScroll(),!(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)};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,o=this._vertical?e:i;if(!this.dragged){if(Math.abs(s)<6||Math.abs(s)<=Math.abs(o))return;this.dragged=!0,this.el.classList.add("dragging");try{this._scroller.setPointerCapture(t.pointerId)}catch{}}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("a, img, picture, video")&&t.preventDefault()};this._handleItemResize=t=>{this._alignAfterResize&&!this.pressed&&t.propertyName==="flex-basis"&&this.images.includes(t.target)&&this._scrollToIndex(this.center,!1)};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=>{let e=t.target;if(e.isContentEditable||e.closest("input, textarea, select"))return;let i=getComputedStyle(this._scroller).direction==="rtl",s=this._vertical?t.key==="ArrowDown":t.key===(i?u.keys.ARROW_LEFT:u.keys.ARROW_RIGHT),o=this._vertical?t.key==="ArrowUp":t.key===(i?u.keys.ARROW_RIGHT:u.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)):s?(t.preventDefault(),this.next(),this._focusItem(this.center)):o&&(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._started||!this.images.length||(this._syncAdaptiveMode(),this._syncLayoutRoles(this.center),this.pressed||this._scrollToIndex(this.center,!1),this._updateParallax())};this._finishScroll=()=>{this._ignoreScroll=!1,clearTimeout(this._scrollEndTimeout),this._scroller.removeEventListener("scrollend",this._handleScrollEnd)};this._handleScrollEnd=()=>{this._nearestIndex()===this.center&&!this.images.some(t=>t.getAnimations().some(e=>e.playState==="running"))&&this._finishScroll()};if(this.el.Expressive_Carousel=this,this.options={...I.defaults,...e},e?.i18n&&(this.options.i18n={...I.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"),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(s=>{this._itemA11yOriginal.set(s,{ariaHidden:s.getAttribute("aria-hidden"),tabIndex:s.getAttribute("tabindex")}),s.hasAttribute("data-carousel-size")&&this._authoredItemSizes.add(s)}),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,this.images.forEach(s=>s.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 i=Math.max(0,this.images.findIndex(s=>s.classList.contains("active")));this.center=i,this._syncActive(i,!1),this._updateParallax(),this._scrollToIndex(i,!1),this._syncAutoAdvance()}get _scroller(){return this._trackEl??this.el}static get defaults(){return Oe}static init(t,e={}){return super.init(t,e,I)}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(),o=e.textContent?.replace(/\s+/g," ").trim(),r=s||o,a=`${this.options.i18n.item} ${i+1} ${this.options.i18n.of} ${this.count}`;e.setAttribute("aria-label",r?`${r}, ${a}`:a),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._motion.addEventListener("change",this._handleMotionChange),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&&(I._live.add(this),I._resizeListening||(window.addEventListener("resize",I._onResize,{passive:!0}),I._resizeListening=!0)),this._scroller.addEventListener("scroll",this._handleTrackScroll,{passive:!0}),this._scroller.addEventListener("pointerdown",this._handleTrackPointerDown),this._scroller.addEventListener("wheel",this._handleNativeScroll,{passive:!0}),document.addEventListener("pointermove",this._handleTrackPointerMove),document.addEventListener("pointerup",this._handleTrackPointerUp),document.addEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.addEventListener("click",this._handleTrackClick,!0),this._scroller.addEventListener("dragstart",this._handleTrackDragStart),this._scroller.addEventListener("transitionend",this._handleItemResize)}_removeEventHandlers(){this.el.removeEventListener("keydown",this._handleKeydown),this._motion.removeEventListener("change",this._handleMotionChange),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("wheel",this._handleNativeScroll),document.removeEventListener("pointermove",this._handleTrackPointerMove),document.removeEventListener("pointerup",this._handleTrackPointerUp),document.removeEventListener("pointercancel",this._handleTrackPointerUp),this._scroller.removeEventListener("click",this._handleTrackClick,!0),this._scroller.removeEventListener("dragstart",this._handleTrackDragStart),this._scroller.removeEventListener("transitionend",this._handleItemResize),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._usesWindowResize&&(I._live.delete(this),I._live.size===0&&I._resizeListening&&(window.removeEventListener("resize",I._onResize),I._resizeListening=!1))}_teardown(){this._started=!1,this._removeEventHandlers(),this._finishScroll(),this._autoAdvances=!1,this._syncAutoAdvance(),this._trackRaf!==null&&cancelAnimationFrame(this._trackRaf),window.clearTimeout(this.scrollingTimeout),window.clearTimeout(this._suppressClickTimeout),clearTimeout(this._resizeTimeout),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&&!this._motion.matches&&!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 o=s===e;i.classList.toggle("active",o),o?i.setAttribute("aria-current","true"):i.removeAttribute("aria-current")})}_syncActive(t,e){let i=this.center;this.center=t,this.images.forEach((o,r)=>o.classList.toggle("active",r===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,l)=>{this._authoredItemSizes.has(h)||(h.setAttribute("data-carousel-size",l),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 l=this.images[t-1];l&&e(l,"small")}return}let i=this.el.clientWidth,s=i>=1600?4:i>=1200?3:i>=600?2:1,o=Math.min(s,Math.max(1,this.count-2));this.el.classList.remove("multi-wide","multi-large","multi-extra-large"),o===2?this.el.classList.add("multi-wide"):o===3?this.el.classList.add("multi-large"):o>=4&&this.el.classList.add("multi-extra-large"),this._generatedWideLayout=this._generatedWideLayout||o>1;for(let h=1;h<o;h+=1){let l=this.images[t+h];l&&e(l,"large")}let r=this.images[t+o],a=this.images[t+o+1];r&&e(r,"medium"),a&&e(a,"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 o=s.getBoundingClientRect(),r=this._vertical?o.top+o.height/2:o.left+o.width/2,a=Math.max(-1,Math.min(1,(r-e)/i));s.style.setProperty("--md-comp-carousel-item-parallax",`${a*-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=getComputedStyle(this._scroller),i=!this._vertical&&e.direction==="rtl",s=this._vertical?this._scroller.scrollTop:this._scroller.scrollLeft,o=this._vertical?this._scroller.clientHeight:this._scroller.clientWidth,r=(this._vertical?this._scroller.scrollHeight:this._scroller.scrollWidth)-o,a=parseFloat(this._vertical?e.paddingBlockStart:e.paddingInlineStart)||0,h=this.center,l=1/0;return this.images.forEach((c,m)=>{let f=this._vertical?c.offsetTop:c.offsetLeft,p=this._vertical?c.offsetHeight:c.offsetWidth,v=t?f-(o-p)/2:f+(i?p-o+a:-a),g=Math.max(i?-r:0,Math.min(i?0:r,v)),E=Math.abs(g-s);(E<l||E===l&&m===this.center)&&(l=E,h=m)}),h}_scrollToIndex(t,e=!0){let i=this.images[t];if(!i)return;this._finishScroll();let s=this.el.classList.contains("center-aligned"),o=getComputedStyle(this._scroller),r=Number.parseFloat(o.paddingInlineStart)||0,a=Number.parseFloat(o.paddingBlockStart)||0,h=s?i.offsetLeft-(this._scroller.clientWidth-i.offsetWidth)/2:o.direction==="rtl"?i.offsetLeft+i.offsetWidth-this._scroller.clientWidth+r:i.offsetLeft-r,l=i.offsetTop-a;this._ignoreScroll=!0,this._scroller.scrollTo({left:this._vertical?0:h,top:this._vertical?l:0,behavior:e&&!this._motion.matches?"smooth":"instant"}),this._scroller.addEventListener("scrollend",this._handleScrollEnd),this._scrollEndTimeout=setTimeout(this._finishScroll,this.options.duration+350)}_cycleTo(t,e=null){this._alignAfterResize=!0,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)}};I._live=new Set,I._resizeListening=!1,I._onResize=u.throttle(()=>{I._live.forEach(t=>t._handleResize())},200);var K=I;var De=Object.freeze({}),Ct=class d extends b{constructor(t,e){super(t,{},d);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={...d.defaults,...e},this.isInvalid=!1,this.isValidLength=!1,this._setupCounter(),this._setupEventHandlers()}static get defaults(){return De}static init(t,e={}){return super.init(t,e,d)}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 Re={shortcut:"k",closeOnRun:!0},Pe=typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform),Ut=d=>d.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLowerCase(),st=class d extends b{constructor(t,e){super(t,e,d);this._active=null;this._generatedIds=[];this._observer=null;this.open=()=>{this.el.open||this.el.showModal(),this.input?.focus()};this.close=()=>{this.el.open&&this.el.close()};this._handleInput=()=>this._filter();this._handleKeydown=t=>{t.key===u.keys.ARROW_DOWN||t.key===u.keys.ARROW_UP?(t.preventDefault(),this._move(t.key===u.keys.ARROW_DOWN?1:-1)):t.key===u.keys.ENTER&&!t.isComposing&&t.keyCode!==229&&this._active&&(t.preventDefault(),this._run(this._active))};this._handleListClick=t=>{let e=t.target.closest('[role="option"]');if(!e||!this.list.contains(e)||e.getAttribute("aria-disabled")==="true")return;let i=this._action(e);if(i&&!i.contains(t.target)){i.click();return}this.options.closeOnRun&&this.close()};this._handlePointerMove=t=>{let e=t.target.closest('[role="option"]');e&&this.list.contains(e)&&e.getAttribute("aria-disabled")!=="true"&&this._setActive(e)};this._handleClose=()=>{this.el.open||(this.input.value="",this._filter())};this._handleShortcut=t=>{let{shortcut:e}=this.options;if(!e||t.defaultPrevented||t.altKey||t.shiftKey||!(Pe?t.metaKey&&!t.ctrlKey:t.ctrlKey&&!t.metaKey))return;let i=e.toLowerCase(),s=/^[a-z]$/i.test(t.key);(t.key.toLowerCase()===i||!s&&/^[a-z]$/.test(i)&&t.code===`Key${i.toUpperCase()}`)&&(t.preventDefault(),this.el.open?this.close():this.open())};this.el.Expressive_CommandPalette=this;let i=t.dataset.shortcut;if(this.options={...d.defaults,...i!==void 0?{shortcut:i||null}:{},...e},this.input=t.querySelector(":scope > input"),this.list=t.querySelector(":scope > :is(ul, ol)"),!this.input||!this.list){console.error("CommandPalette needs an <input> and a <ul> as children of the dialog.");return}this._setupAccessibility(),this._filter(),this._observer=new MutationObserver(()=>this._filter(!0)),this._observer.observe(this.list,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["hidden","disabled"]}),this.input.addEventListener("input",this._handleInput),this.input.addEventListener("keydown",this._handleKeydown),this.list.addEventListener("click",this._handleListClick),this.list.addEventListener("pointermove",this._handlePointerMove),this.el.addEventListener("close",this._handleClose),document.addEventListener("keydown",this._handleShortcut)}static get defaults(){return Re}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_CommandPalette}get isOpen(){return this.el.open}destroy(){if(this._observer?.disconnect(),document.removeEventListener("keydown",this._handleShortcut),this.el.removeEventListener("close",this._handleClose),this.input&&this.list){this.input.removeEventListener("input",this._handleInput),this.input.removeEventListener("keydown",this._handleKeydown),this.list.removeEventListener("click",this._handleListClick),this.list.removeEventListener("pointermove",this._handlePointerMove);for(let e of["role","aria-controls","aria-expanded","aria-autocomplete","aria-activedescendant"])this.input.removeAttribute(e);this.list.removeAttribute("role");for(let e of this._items()){for(let i of["role","aria-selected","aria-disabled","data-filtered"])e.removeAttribute(i);e.classList.remove("active"),this._action(e)?.removeAttribute("tabindex")}for(let e of this._labels())e.removeAttribute("role"),e.removeAttribute("data-filtered");for(let e of this._generatedIds)e.removeAttribute("id");let t=this._empty();t&&(t.hidden=!1)}this.el.Expressive_CommandPalette=void 0}_items(){return Array.from(this.list.children).filter(t=>t instanceof HTMLElement&&!t.classList.contains("label"))}_labels(){return Array.from(this.list.querySelectorAll(":scope > .label"))}_empty(){return this.el.querySelector(":scope > .command-palette-empty")}_action(t){return t.querySelector(":scope > :is(a[href], button)")}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_setupAccessibility(){this.list.setAttribute("role","listbox"),this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-controls",this._ensureId(this.list,"command-palette-list")),this.input.setAttribute("aria-expanded","true"),this.input.setAttribute("aria-autocomplete","list")}_wireItems(){for(let t of this._items())t.getAttribute("role")!=="option"&&(t.setAttribute("role","option"),this._ensureId(t,"command-palette-option"),this._action(t)?.setAttribute("tabindex","-1"));for(let t of this._labels())t.setAttribute("role","none")}_shown(){return this._items().filter(t=>!t.hidden&&!t.hasAttribute("data-filtered"))}_visible(){return this._shown().filter(t=>t.getAttribute("aria-disabled")!=="true")}_isDisabled(t){let e=this._action(t);return!!e&&(e.matches(":disabled")||e.getAttribute("aria-disabled")==="true")}_setActive(t){this._active!==t&&(this._active?.classList.remove("active"),this._active?.removeAttribute("aria-selected"),this._active=t,t?(t.classList.add("active"),t.setAttribute("aria-selected","true"),this.input.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"})):this.input.removeAttribute("aria-activedescendant"))}_filter(t=!1){this._wireItems();let e=Ut(this.input.value).split(/\s+/).filter(Boolean);for(let o of this._items()){let r=o.dataset.keywords??this._action(o)?.dataset.keywords??"",a=Ut(`${o.textContent} ${r}`);o.toggleAttribute("data-filtered",!e.every(h=>a.includes(h))),this._isDisabled(o)?o.setAttribute("aria-disabled","true"):o.removeAttribute("aria-disabled")}for(let o of this._labels()){let r=o.nextElementSibling,a=!1;for(;r&&!r.classList.contains("label");)!r.hidden&&!r.hasAttribute("data-filtered")&&(a=!0),r=r.nextElementSibling;o.toggleAttribute("data-filtered",!a)}let i=this._visible(),s=this._empty();s&&(s.hidden=this._shown().length>0),this._setActive(t&&i.includes(this._active)?this._active:i[0]??null)}_move(t){let e=this._visible();if(!e.length)return;let i=e.indexOf(this._active);this._setActive(e[(i+t+e.length)%e.length])}_run(t){(this._action(t)??t).click()}};var Be={progressLabel:"Question {current} of {total}",requiredMessage:"Choose an answer to continue."},Yt=["previous","skip","next"],nt=class d extends b{constructor(t,e){super(t,e,d);this._active=null;this._generated=[];this._generatedIds=[];this._reporting=!1;this.goTo=t=>{let e=this.items[t];if(!e)return;this._active=e,this._render();let i=this._controls(e).filter(s=>!s.disabled);(i.find(s=>s.checked)??i[0])?.focus()};this.next=()=>{this._validate(this._active)&&this.goTo(this.index+1)};this.previous=()=>this.goTo(this.index-1);this.skip=()=>{if(this._active){for(let t of this._controls(this._active)){let e=t instanceof HTMLInputElement&&(t.type==="radio"||t.type==="checkbox");(e?!t.checked:!t.value)||(e?t.checked=!1:t.value="",t.dispatchEvent(new Event("change",{bubbles:!0})))}this.goTo(this.index+1)}};this._handleClick=t=>{let e=t.target.closest?.("button");if(!(!e||!this._buttons().includes(e))){if(Yt.includes(e.value)){t.preventDefault(),this[e.value]();return}this._syncRequired()}};this._handleKeydown=t=>{t.key!=="Enter"||t.defaultPrevented||t.isComposing||!(t.target instanceof HTMLInputElement)||this.index>=this.items.length-1||(t.preventDefault(),this.next())};this._handleInvalid=t=>{let e=this.items.find(i=>i.contains(t.target));e&&(t.preventDefault(),!this._reporting&&(this._reporting=!0,setTimeout(()=>this._reporting=!1),this._active=e,this._render(),this._validate(e)))};this._handleInput=t=>{this._syncRequired();let e=t.target.closest?.("fieldset");e instanceof HTMLFieldSetElement&&e.classList.contains("invalid")&&this._setInvalid(e,!1)};this.el.Expressive_Questionnaire=this;let i=t.dataset.progressLabel;this.options={...d.defaults,...i?{progressLabel:i}:{},...e},this._progress=document.createElement("div"),this._progress.className="questionnaire-progress",this._progressText=document.createElement("span"),this._progressText.id=`questionnaire-progress-${u.guid()}`,this._progressBar=document.createElement("progress"),this._progressBar.className="progress",this._progressBar.setAttribute("aria-labelledby",this._progressText.id),this._progress.append(this._progressText,this._progressBar),this.el.prepend(this._progress);for(let s of this._fieldsets()){let o=Array.from(s.querySelectorAll(":scope > p:not(.questionnaire-error)")).map(r=>this._ensureId(r,"questionnaire-description"));o.length&&!s.hasAttribute("aria-describedby")&&(s.setAttribute("aria-describedby",o.join(" ")),this._generatedIds.push(s))}this._active=this.items[0]??null,this._syncRequired(),this._render(),this._observer=new MutationObserver(()=>{this._syncRequired(),this._render()}),this._observer.observe(this.el,{attributes:!0,subtree:!0,attributeFilter:["disabled"]}),this.el.addEventListener("click",this._handleClick),this.el.addEventListener("keydown",this._handleKeydown),this.el.addEventListener("input",this._handleInput),this.el.addEventListener("invalid",this._handleInvalid,!0)}static get defaults(){return Be}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Questionnaire}get items(){return this._fieldsets().filter(t=>!t.disabled)}get index(){return this.items.indexOf(this._active)}destroy(){this._observer.disconnect(),this.el.removeEventListener("click",this._handleClick),this.el.removeEventListener("keydown",this._handleKeydown),this.el.removeEventListener("input",this._handleInput),this.el.removeEventListener("invalid",this._handleInvalid,!0);for(let t of this._fieldsets()){if(t.hasAttribute("data-required"))for(let e of this._controls(t))e.setCustomValidity("");t.hidden=!1,this._setInvalid(t,!1)}for(let t of this._buttons())t.hidden=!1;this._progress.remove();for(let t of this._generated)t.remove();for(let t of this._generatedIds)t.removeAttribute(t instanceof HTMLFieldSetElement?"aria-describedby":"id");this.el.Expressive_Questionnaire=void 0}_fieldsets(){return Array.from(this.el.querySelectorAll(":scope > fieldset"))}_buttons(){return Array.from(this.el.querySelectorAll(":scope > footer > button")).filter(t=>Yt.includes(t.value)||t.type==="submit")}_controls(t){return Array.from(t.elements).filter(e=>e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement||e instanceof HTMLInputElement&&e.type!=="button"&&e.type!=="submit")}_required(t){return t.hasAttribute("data-required")||this._controls(t).some(e=>e.required)}_ensureId(t,e){return t.id||(t.id=`${e}-${u.guid()}`,this._generatedIds.push(t)),t.id}_render(){let t=this.items;if(!t.includes(this._active)){let s=this._fieldsets(),o=s.slice(s.indexOf(this._active)+1).find(r=>!r.disabled);this._active=o??t[t.length-1]??null}let e=t.indexOf(this._active),i=e===t.length-1;for(let s of this._fieldsets())s.hidden=s!==this._active;for(let s of this._buttons())s.value==="previous"?s.hidden=e<=0:s.value==="skip"?s.hidden=i||!this._active||this._required(this._active):s.value==="next"?s.hidden=i:s.hidden=!i;this._progressText.textContent=this.options.progressLabel.replace("{current}",String(e+1)).replace("{total}",String(t.length)),this._progressBar.max=Math.max(t.length,1),this._progressBar.value=e+1}_syncRequired(){for(let t of this._fieldsets()){if(!t.hasAttribute("data-required"))continue;let e=this._controls(t).filter(s=>s instanceof HTMLInputElement&&s.type==="checkbox"),i=e.filter(s=>!s.disabled);for(let s of e)s.setCustomValidity("");if(i.length&&!i.some(s=>s.checked)){let s=t.querySelector(":scope > .questionnaire-error:not([data-generated])");i[0].setCustomValidity(s?.textContent.trim()||this.options.requiredMessage)}}}_invalidControl(t){return this._controls(t).find(e=>e.willValidate&&!e.validity.valid)}_validate(t){this._syncRequired();let e=t&&this._invalidControl(t);if(!e)return!0;let i=t.querySelector(":scope > .questionnaire-error");return i||(i=document.createElement("p"),i.className="questionnaire-error",i.dataset.generated="",i.textContent=e.validationMessage||this.options.requiredMessage,t.append(i),this._generated.push(i)),this._setInvalid(t,!0),e.focus(),!1}_setInvalid(t,e){t.classList.toggle("invalid",e);let i=t.querySelector(":scope > .questionnaire-error"),s=(t.getAttribute("aria-describedby")??"").split(" ").filter(o=>o&&o!==i?.id);e&&i&&s.push(this._ensureId(i,"questionnaire-error")),s.length?t.setAttribute("aria-describedby",s.join(" ")):t.removeAttribute("aria-describedby");for(let o of this._controls(t))e?o.setAttribute("aria-invalid","true"):o.removeAttribute("aria-invalid");!e&&this._generated.includes(i)&&(i.remove(),this._generated.splice(this._generated.indexOf(i),1))}};var Ne={min:null,max:null},U="http://www.w3.org/2000/svg",W=4;function k(d,n={}){let t=document.createElementNS(U,d);for(let e in n)t.setAttribute(e,n[e]);return t}var Fe=0;function We(d){if(!d)return null;let t=(d.dataset.value??d.textContent).replace(/\u2212/g,"-").replace(/[\s%\p{Sc}]/gu,"");return!/^[+-]?(\d{1,3}(,\d{3})+|\d+)?(\.\d+)?(e[+-]?\d+)?$/i.test(t)||!/\d/.test(t)?null:parseFloat(t.replace(/,/g,""))}function Gt(d){let n=d.length;if(n===0)return"";if(n===1)return`M${d[0][0]},${d[0][1]}h0`;let t=[];for(let s=0;s<n-1;s++)t.push((d[s+1][1]-d[s][1])/(d[s+1][0]-d[s][0]));let e=d.map((s,o)=>{if(o===0)return t[0];if(o===n-1)return t[n-2];let[r,a]=[t[o-1],t[o]];return r*a<=0?0:2/(1/r+1/a)}),i=`M${d[0][0]},${d[0][1]}`;for(let s=0;s<n-1;s++){let[[o,r],[a,h]]=[d[s],d[s+1]],l=(a-o)/3;i+=`C${o+l},${r+e[s]*l} ${a-l},${h-e[s+1]*l} ${a},${h}`}return i}var S=class extends b{constructor(t,e){super(t,e,new.target);this.labels=[];this.series=[];this.activeIndex=-1;this._generated=[];this._header=[];this._rows=[];this._reversed=!1;this._onPointerMove=t=>{this.show(this._indexAt(t))};this._onFocus=()=>{this.activeIndex<0&&this._plot.matches(":focus-visible")&&this.show(0)};this._onLeave=t=>{t.pointerType==="touch"||this._plot.matches(":focus-visible")||this.show(-1)};this._onCancel=()=>{this.show(-1)};this._onKeyDown=t=>{let e=this._keyTarget(t.key);e!==void 0&&(t.preventDefault(),this.show(e))};this.el[this._key]=this,this.options={...new.target.defaults,...e},this._read(),!(!this.labels.length||!this.series.length)&&(this._reversed=!this._horizontal&&getComputedStyle(this.el).direction==="rtl",this._render(),this.el.classList.contains("sparkline")||(this._plot.tabIndex=0,this._plot.addEventListener("pointerdown",this._onPointerMove),this._plot.addEventListener("pointermove",this._onPointerMove),this._plot.addEventListener("pointerleave",this._onLeave),this._plot.addEventListener("pointercancel",this._onCancel),this._plot.addEventListener("keydown",this._onKeyDown),this._plot.addEventListener("focus",this._onFocus),this._plot.addEventListener("blur",this._onLeave)))}get _type(){return"line-chart"}get _fromZero(){return!1}get _horizontal(){return!1}get _circular(){return!1}get _points(){return!0}get _key(){return"Expressive_LineChart"}static get defaults(){return Ne}static init(t,e={}){return super.init(t,e,this)}static getInstance(t){return t.Expressive_LineChart}destroy(){this._generated.forEach(t=>t.remove()),this._generated=[],this.el[this._key]=void 0}show(t){if(!this._tooltip||t===this.activeIndex)return;this.activeIndex=t;let e=t<0||t>=this.labels.length;if(this._cursor.hidden=this._tooltip.hidden=e,e)return;this._cursor.replaceChildren();let i=document.createElement("strong");i.textContent=this.labels[t],this._tooltip.replaceChildren(i),this.series.forEach((s,o)=>{if(s.values[t]===null)return;let a=String(o%W+1),h=s.tops[t];if(h!==null&&this._points){let m=document.createElement("span");m.className=s.className,m.dataset.series=a,m.style.top=`${s.y(h)}%`,this._cursor.append(m)}let l=document.createElement("span");l.dataset.series=a,l.textContent=s.name;let c=document.createElement("span");c.textContent=s.text[t],this._tooltip.append(l,c)}),this._place(t)}_place(t){let e=this._x(t),i=this._horizontal?"top":"left";this._cursor.style[i]=this._tooltip.style[i]=`${e}%`,this._tooltip.classList.toggle("end",e>50)}_read(){let t=this.el.querySelector(":scope > table");if(!t)return;let e=t.tHead?.rows[0]??t.rows[0],i=Array.from(e?.cells??[]),s=Array.from(t.tBodies).flatMap(a=>Array.from(a.rows)).filter(a=>a!==e);if([this._header,this._rows]=[i,s],this.labels=s.map(a=>a.cells[0]?.textContent.trim()??""),this.series=i.slice(1).map((a,h)=>{let l=s.map(c=>We(c.cells[h+1]));return{name:a.textContent.trim(),className:a.className,text:s.map(c=>c.cells[h+1]?.textContent.trim()??""),values:l,tops:l,y:void 0}}),this.el.classList.contains("stacked")){let a=this.labels.map(()=>0);for(let h of this.series)h.base=[...a],h.tops=h.values.map((l,c)=>a[c]=l===null||a[c]===null?null:a[c]+l)}this.series.every(a=>a.tops.every(h=>h===null))&&(this.series=[]);let r=a=>this._number(a)??this.options[a];this._y=this._scale(this.series,r("min"),r("max"))}_number(t){let e=parseFloat(this.el.dataset[t]??"");return Number.isFinite(e)?e:null}_scale(t,e,i,s=this._fromZero){let o=this.el.classList.contains("stacked"),[r,a]=[1/0,-1/0];for(let{tops:l}of t)for(let c of l)c!==null&&(r=Math.min(r,c),a=Math.max(a,c));if(r>a&&(r=a=0),s){let[l,c]=[Math.min(0,r),Math.max(0,a)],m=(c-(e??l))*.1||1;e??(e=l<0?l-m:0),i??(i=c+m)}else{let l=(a-r)*.1||1;e??(e=o?Math.min(0,r):r-l),i??(i=a+(o?(a-e)*.1||1:l))}let h=l=>100-(l-e)/(i-e||1)*100;for(let l of t)l.y=h;return h}_x(t){let e=(t+.5)/this.labels.length*100;return this._reversed?100-e:e}_render(){let t=this._type;this._plot=document.createElement("div"),this._plot.className=`${t}-plot`;let e=this.el.querySelector(":scope > figcaption")?.textContent.trim();this._plot.setAttribute("role","group"),this._plot.setAttribute("aria-roledescription",t.replace(/-/g," ")),e&&this._plot.setAttribute("aria-label",e),this._cursor=document.createElement("div"),this._cursor.className=`${t}-cursor`,this._cursor.hidden=!0,this._tooltip=document.createElement("div"),this._tooltip.className=`${t}-tooltip`,this._tooltip.hidden=!0,this._tooltip.setAttribute("aria-live","polite"),this._plot.append(this._draw(),this._cursor,this._tooltip),this._generated=[this._plot,...this._guides()],this.el.append(...this._generated)}_total(t){let e=this.el.querySelector(":scope > table")?.tFoot?.rows[0];if(!e)return null;let i=document.createElement("div");i.className=t;let[s,o]=[document.createElement("span"),document.createElement("strong")];return s.textContent=e.cells[0]?.textContent.trim()??"",o.textContent=e.cells[1]?.textContent.trim()??"",i.append(o,s),i}_guides(){let t=document.createElement("ol");t.className=`${this._type}-labels`,t.setAttribute("aria-hidden","true");for(let e of this.labels){let i=document.createElement("li");i.textContent=e,t.append(i)}return[t,...this._legend()]}_legend(){if(this.series.length<2)return[];let t=document.createElement("ul");return t.className=`${this._type}-legend`,t.setAttribute("aria-hidden","true"),t.append(...this.series.map((e,i)=>{let s=document.createElement("li");return s.dataset.series=String(i%W+1),s.textContent=e.name,s})),[t]}_draw(t=this.series){let e=document.createElementNS(U,"svg");e.setAttribute("viewBox","0 0 100 100"),e.setAttribute("preserveAspectRatio","none"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false");for(let i of t){let s=document.createElementNS(U,"g");s.setAttribute("class",`${this._type}-series ${i.className}`.trim()),s.dataset.series=String(this.series.indexOf(i)%W+1);let o=[[]];i.tops.forEach((p,v)=>{p===null?o.push([]):o[o.length-1].push(v)});let r=o.filter(p=>p.length),a=(p,v)=>p.map(g=>[this._x(g),i.y(v[g])]),h=r.map(p=>Gt(a(p,i.tops))),l=`line-chart-gradient-${++Fe}`,c=document.createElementNS(U,"linearGradient");c.id=l,c.setAttribute("x2","0"),c.setAttribute("y2","1"),c.append(document.createElementNS(U,"stop"),document.createElementNS(U,"stop")),c.lastElementChild.setAttribute("offset","1");let m=document.createElementNS(U,"path");m.setAttribute("class",`${this._type}-area`),m.setAttribute("fill",`url(#${l})`),m.setAttribute("d",r.map((p,v)=>{if(!i.base)return`${h[v]}V100H${this._x(p[0])}Z`;let g=a(p,i.base).map(([E,L])=>[E,Math.min(100,L)]);return`${h[v]}L${Gt(g.reverse()).slice(1)}Z`}).join(""));let f=document.createElementNS(U,"path");f.setAttribute("class",`${this._type}-line`),f.setAttribute("d",h.join("")),s.append(c,m,f),e.append(s)}return e}_indexAt(t){let e=this._plot.getBoundingClientRect(),i=this._horizontal?(t.clientY-e.top)/e.height:(t.clientX-e.left)/e.width,s=Math.floor((this._reversed?1-i:i)*this.labels.length);return Math.min(this.labels.length-1,Math.max(0,s))}_polarAt(t){let e=this._plot.getBoundingClientRect(),[i,s]=[t.clientX-e.left-e.width/2,t.clientY-e.top-e.height/2];return[(Math.atan2(i,-s)/(2*Math.PI)+1)%1,Math.hypot(i,s)/e.width]}get _arrows(){return this._circular?[["ArrowRight","ArrowDown"],["ArrowLeft","ArrowUp"]]:this._horizontal?[["ArrowDown"],["ArrowUp"]]:this._reversed?[["ArrowLeft"],["ArrowRight"]]:[["ArrowRight"],["ArrowLeft"]]}_keyTarget(t){let e=this.labels.length-1,[i,s]=this._arrows,o=r=>this._circular?this.activeIndex<0?r>0?0:e:(this.activeIndex+r+e+1)%(e+1):Math.min(e,Math.max(0,this.activeIndex+r));return t==="Escape"?this.activeIndex<0?void 0:-1:i.includes(t)?o(1):s.includes(t)?o(-1):{Home:0,End:e}[t]}};var N=class extends S{get _type(){return"column-chart"}get _key(){return"Expressive_ColumnChart"}get _fromZero(){return!0}get _points(){return!1}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_ColumnChart}_draw(n=this.series){let t=document.createElement("div");t.className="column-chart-columns",t.setAttribute("aria-hidden","true");let e=(i,s=n[0]?.y??this._y)=>Math.min(100,Math.max(0,s(i)));return t.style.setProperty("--zero",`${e(0)}%`),this._plot.style.setProperty("--rows",String(this.labels.length)),this.labels.forEach((i,s)=>{let o=document.createElement("div");n.forEach(r=>{let a=r.tops[s],h=r.base?.[s]??0;if(r.base&&(a===null||h===null))return;let l=document.createElement("span");a!==null&&(l.className=r.className,l.dataset.series=String(this.series.indexOf(r)%W+1),l.classList.toggle("negative",!r.base&&a<h),l.style.setProperty("--top",`${e(Math.max(h,a),r.y)}%`),l.style.setProperty("--bottom",`${100-e(Math.min(h,a),r.y)}%`),this._horizontal&&(l.dataset.text=r.text[s])),o.append(l)}),t.append(o)}),t}};var ot=class extends N{get _type(){return"bar-chart"}get _key(){return"Expressive_BarChart"}get _horizontal(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_BarChart}_draw(){let n=super._draw();if(n.className="bar-chart-bars",n.classList.toggle("rtl",getComputedStyle(this.el).direction==="rtl"),!this.el.classList.contains("values"))return n;let t=n.cloneNode(!0);t.classList.replace("bar-chart-bars","bar-chart-values"),t.querySelectorAll("span[data-text]").forEach(i=>{i.textContent=i.dataset.text});let e=document.createElement("div");return e.className="bar-chart-layers",e.append(n,t),e}};var jt=6,$=46,$e=1.06,Ve=.05,qe=0,rt=class extends S{get _type(){return"pie-chart"}get _key(){return"Expressive_PieChart"}get _points(){return!1}get _circular(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_PieChart}show(n){if(!this._tooltip||n===this.activeIndex||(super.show(n),this._slices.forEach((s,o)=>s?.classList.toggle("active",o===n)),this._tooltip.hidden))return;let t=this._colors[n];this._tooltip.querySelectorAll("[data-series]").forEach(s=>{t?s.dataset.series=t:delete s.dataset.series});let e=this._share(n),i=this._tooltip.querySelector("span:nth-of-type(2)");e&&i&&(i.textContent+=` (${e})`)}_place(n){let t=(this._turns[n][0]+this._turns[n][1])/2;this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t<.5)}_share(n){let[t,e]=this._turns[n];if(e<=t)return"";let i=e-t,s={style:"percent",maximumFractionDigits:i<.1?1:0};try{return i.toLocaleString(this.el.closest("[lang]")?.lang||void 0,s)}catch{return i.toLocaleString(void 0,s)}}_guides(){let n=document.createElement("ul");n.className="pie-chart-legend",n.setAttribute("aria-hidden","true");let t=this.series[0].text;return n.append(...this.labels.map((e,i)=>{let s=document.createElement("li");this._colors[i]&&(s.dataset.series=this._colors[i]);let[o,r,a]=[e,t[i],this._share(i)].map(h=>{let l=document.createElement("span");return l.textContent=h,l});return s.append(o,r,a),s})),[n]}_indexAt(n){let[t,e]=this._polarAt(n),i=e*100,s=this.el.classList.contains("donut")&&parseFloat(getComputedStyle(this.el).getPropertyValue("--md-comp-pie-chart-hole"))||0;if(i<$*s)return-1;let o=this._turns.findIndex(([r,a])=>r<=t&&t<a);return i>$*(o===this.activeIndex?$e:1)?-1:o}_draw(){let n=this.series[0].values.map(g=>Math.max(0,g??0)),t=n.reduce((g,E)=>g+E,0),e=0;this._turns=n.map(g=>[e,e+=t?g/t:0]);let i=this._turns.filter(([g,E])=>E>g).length,s=0;this._colors=this._turns.map(([g,E])=>{if(E<=g)return;let L=s++;return String(L===i-1&&L>0&&L%jt===0?2:L%jt+1)});let o=(g,E=$)=>{let L=g*2*Math.PI;return`${(E*Math.sin(L)).toFixed(3)},${(-E*Math.cos(L)).toFixed(3)}`},r=document.createElement("div");r.className="pie-chart-pie",r.setAttribute("aria-hidden","true");let a=k("svg",{viewBox:"-50 -50 100 100",focusable:"false"}),h=`pie-chart-mask-${++qe}`,l={x:"-50",y:"-50",width:"100",height:"100"},c=k("mask",{id:h,maskUnits:"userSpaceOnUse",...l}),m=this._turns.filter(([g,E])=>E>g);c.append(k("rect",{...l,fill:"white"}),k("path",{class:"pie-chart-gaps",stroke:"black",d:m.length>1?m.map(([g])=>`M0,0L${o(g,50)}`).join(""):""}),k("circle",{class:"pie-chart-hole",r:String($),fill:"black"}));let f=k("g",{mask:`url(#${h})`}),p=`A${$},${$} 0`;if(this._slices=this._turns.map(([g,E],L)=>{if(E<=g)return null;let x=k("path",{class:"pie-chart-slice","data-series":this._colors[L],d:E-g>=1?`M0,${-$}${p} 1 1 0,${$}${p} 1 1 0,${-$}Z`:`M0,0L${o(g)}${p} ${E-g>.5?1:0} 1 ${o(E)}Z`});return f.append(x),x}),a.append(c,f),r.append(a),this.el.classList.contains("values")){let g=document.createElement("div");g.className="pie-chart-values",this._turns.forEach(([E,L],x)=>{if(L-E<Ve)return;let T=document.createElement("span");T.dataset.series=this._colors[x],T.style.setProperty("--turn",String((E+L)/2)),T.textContent=this._share(x),g.append(T)}),r.append(g)}let v=this._total("pie-chart-total");return v&&r.append(v),r}};var at=class extends S{get _type(){return"heatmap-chart"}get _key(){return"Expressive_HeatmapChart"}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_HeatmapChart}show(n){if(!this._tooltip||n===this.activeIndex)return;this._cells[this.activeIndex]?.classList.remove("active"),this.activeIndex=n;let t=this._cells[n];if(this._tooltip.hidden=!t,!t)return;t.classList.add("active");let e=this.series.length,[i,s]=[Math.floor(n/e),this.series[n%e]],o=document.createElement("strong");o.textContent=this.labels[i];let[r,a]=[document.createElement("span"),document.createElement("span")];r.textContent=s.name,this._levels[n]===null?r.className="gap":r.style.setProperty("--level",String(this._levels[n])),a.textContent=s.text[i],this._tooltip.replaceChildren(o,r,a);let h=t.offsetLeft+t.offsetWidth/2>this._plot.clientWidth/2;this._tooltip.classList.toggle("end",h),this._tooltip.style.left=`${t.offsetLeft+(h?0:t.offsetWidth)}px`,this._tooltip.style.top=`${t.offsetTop}px`}_keyTarget(n){if(n==="Escape")return this.activeIndex<0?void 0:-1;let[t,e]=[this.series.length,this.labels.length-1],i=Math.max(0,this.activeIndex),[s,o]=[Math.floor(i/t),i%t],[r,a]=this._reversed?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],h={[r]:[s,o+1],[a]:[s,o-1],ArrowDown:[s+1,o],ArrowUp:[s-1,o],Home:[s,0],End:[s,t-1]}[n];if(!h)return;if(this.activeIndex<0)return 0;let l=(c,m)=>Math.min(m,Math.max(0,c));return l(h[0],e)*t+l(h[1],t-1)}_indexAt(n){let[t,e]=[this.series.length,this.labels.length],i=this._cells[0].getBoundingClientRect(),s=this._cells[this._cells.length-1].getBoundingClientRect(),[o,r]=[Math.min(i.left,s.left),Math.max(i.right,s.right)],[a,h]=[n.clientX,n.clientY];if(a<o||a>r||h<i.top||h>s.bottom)return-1;let l=(m,f,p)=>Math.min(p-1,Math.floor(m/(f||1)*p)),c=l(a-o,r-o,t);return l(h-i.top,s.bottom-i.top,e)*t+(this._reversed?t-1-c:c)}_guides(){let n=document.createElement("div");n.className="heatmap-chart-legend",n.setAttribute("aria-hidden","true");let[t,e,i]=["span","span","span"].map(s=>document.createElement(s));return[t.textContent,i.textContent]=this._ends,e.className="heatmap-chart-scale",this._reversed&&e.style.setProperty("--heatmap-chart-to","left"),e.style.setProperty("--low",String(this._endLevels[0])),e.style.setProperty("--high",String(this._endLevels[1])),n.append(t,e,i),[n]}_draw(){let n=this.series.length,[t,e]=[1/0,-1/0];this._ends=["",""],this.series.forEach(f=>f.values.forEach((p,v)=>{p!==null&&(p<t&&([t,this._ends[0]]=[p,f.text[v]]),p>e&&([e,this._ends[1]]=[p,f.text[v]]))}));let i=f=>{let p=parseFloat(this.el.dataset[f]??"");return Number.isFinite(p)?p:this.options[f]},[s,o]=[i("min")??t,i("max")??e],r=f=>Math.min(1,Math.max(0,(f-s)/(o-s||1)));this._endLevels=[r(t),r(e)];let a=document.createElement("div");a.className="heatmap-chart-grid",a.setAttribute("aria-hidden","true"),a.style.setProperty("--columns",String(n)),a.style.setProperty("--rows",String(this.labels.length));let h=(f,p="")=>{let v=document.createElement("span");return v.className=f,v.textContent=p,v},l=f=>f?.dataset.label??f?.textContent.trim()??"",c=this.el.classList.contains("values");this._cells=[],this._levels=[],this.labels.forEach((f,p)=>{a.append(h("heatmap-chart-row",l(this._rows[p].cells[0]))),this.series.forEach(v=>{let g=v.values[p],E=g===null?null:r(g),L=h("heatmap-chart-cell",c?v.text[p]:"");E===null?L.classList.add("gap"):L.style.setProperty("--level",String(E)),this._cells.push(L),this._levels.push(E),a.append(L)})});let m=this._header.slice(1,n+1).map(l);return m.forEach((f,p)=>{if(!f)return;let v=p+1;for(;v<n&&!m[v];)v++;let g=h("heatmap-chart-column",f);g.classList.toggle("run",v>p+1),g.style.gridArea=`${this.labels.length+1} / ${p+2} / auto / ${v+2}`,a.append(g)}),a}};var Xt=4,lt=class extends S{get _type(){return"radar-chart"}get _key(){return"Expressive_RadarChart"}get _fromZero(){return!0}get _circular(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_RadarChart}_place(n){for(let e of this._cursor.children)e.style.top=`${Math.min(100,Math.max(0,parseFloat(e.style.top)))}%`;let t=this._turn(n);this._cursor.style.setProperty("--turn",String(t)),this._tooltip.style.setProperty("--turn",String(t)),this._tooltip.classList.toggle("end",t>0&&t<.5)}_turn(n){return n/this.labels.length}_guides(){return this._legend()}_indexAt(n){let[t]=this._polarAt(n);return Math.round(t*this.labels.length)%this.labels.length}_draw(){let n=(h,l)=>{let c=this._turn(h)*2*Math.PI;return`${(50*l*Math.sin(c)).toFixed(3)},${(-50*l*Math.cos(c)).toFixed(3)}`},t=h=>Math.min(1,Math.max(0,1-this._y(h)/100)),e=this.labels.map((h,l)=>l),i=h=>`M${e.map(l=>n(l,h)).join("L")}Z`,s=k("svg",{viewBox:"-50 -50 100 100","aria-hidden":"true",focusable:"false"});s.append(k("path",{class:"radar-chart-grid",d:Array.from({length:Xt},(h,l)=>i((l+1)/Xt)).join("")+e.map(h=>`M0,0L${n(h,1)}`).join("")}));let o=this.el.classList.contains("points");this.series.forEach((h,l)=>{let c=k("g",{class:`radar-chart-series ${h.className}`.trim(),"data-series":String(l%W+1)}),f=e.filter(p=>h.values[p]!==null).map(p=>n(p,t(h.values[p])));c.append(k("path",{class:"radar-chart-shape",d:f.length?`M${f.join("L")}Z`:""})),o&&c.append(k("path",{class:"radar-chart-points",d:f.map(p=>`M${p}h0`).join("")})),s.append(c)});let r=document.createElement("ol");r.className="radar-chart-axes",r.setAttribute("aria-hidden","true"),this.labels.forEach((h,l)=>{let c=document.createElement("li");c.textContent=h,c.style.setProperty("--turn",String(this._turn(l))),r.append(c)});let a=document.createElement("div");return a.className="radar-chart-web",a.append(s,r),a}};var Qt=46,ze=.8,ct=class extends S{get _type(){return"radial-chart"}get _key(){return"Expressive_RadialChart"}get _points(){return!1}get _circular(){return!0}get _gauge(){return this.el.classList.contains("gauge")}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_RadialChart}show(n){if(!this._tooltip||n===this.activeIndex||(super.show(n),this._rings.forEach((e,i)=>e.classList.toggle("active",i===n)),this._tooltip.hidden))return;let t=this._color(n);this._tooltip.querySelectorAll("[data-series]").forEach(e=>{e.dataset.series=t})}_place(n){let t=this._turn(this._fractions[n]),e=this._radii[n],[i,s]=[e*Math.sin(t*2*Math.PI),-e*Math.cos(t*2*Math.PI)];this._tooltip.style.left=`${50+i}%`,this._tooltip.style.top=`${(50+s)/(this._gauge?50:100)*100}%`,this._tooltip.classList.toggle("end",i>0)}_color(n){return String(n%W+1)}_turn(n){return this._gauge?n/2-.25:n}_guides(){if(this.labels.length<2)return[];let n=document.createElement("ul");n.className="radial-chart-legend",n.setAttribute("aria-hidden","true");let t=this.series[0].text;return n.append(...this.labels.map((e,i)=>{let s=document.createElement("li");s.dataset.series=this._color(i);let[o,r]=[e,t[i]].map(a=>{let h=document.createElement("span");return h.textContent=a,h});return s.append(o,r),s})),[n]}_indexAt(n){let t=this._plot.getBoundingClientRect(),[e,i]=[n.clientX-t.left-t.width/2,n.clientY-t.top-t.width/2];if(this._gauge&&i>0)return-1;let s=Math.hypot(e,i)/t.width*100,o=this._radii.length>1?this._radii[0]-this._radii[1]:this._width;return this._radii.findIndex(r=>Math.abs(s-r)<=o/2)}_draw(){let n=getComputedStyle(this.el),t=(p,v)=>{let g=parseFloat(n.getPropertyValue(`--md-comp-radial-chart-${p}`));return Number.isFinite(g)?g:v},e=this.labels.length,[i,s]=[Math.max(0,t("thickness",8)),Math.max(0,t("gap",2))],o=Math.min(1,Qt*ze/(e*i+(e-1)*s||1));[i,s]=[i*o,s*o],this._width=i,this._radii=this.labels.map((p,v)=>Qt-i/2-v*(i+s));let r=[parseFloat(this.el.dataset.max??""),this.options.max??NaN,100].find(p=>p>0);this._fractions=this.series[0].values.map(p=>Math.min(1,Math.max(0,(p??0)/r)));let a=this._gauge,h=k("svg",{viewBox:a?"-50 -50 100 50":"-50 -50 100 100",focusable:"false"}),l=a?"rotate(180)":"rotate(-90)",c=a?.5:1;this._rings=this._radii.map((p,v)=>{let g=2*Math.PI*p,E=(x,T,j)=>{let bt=k("circle",{class:x,r:p.toFixed(3),transform:l,"stroke-width":i.toFixed(3)}),xt=Math.max(.001,T*c*g-(j?i:0));return bt.style.setProperty("--radial-chart-dash",`${xt.toFixed(3)} ${g.toFixed(3)}`),j&&bt.style.setProperty("--radial-chart-offset",(-i/2).toFixed(3)),bt},L=E("radial-chart-ring",this._fractions[v],!0);return L.dataset.series=this._color(v),this._fractions[v]||L.classList.add("empty"),h.append(E("radial-chart-track",1,a),L),L});let m=document.createElement("div");m.className="radial-chart-rings",m.setAttribute("aria-hidden","true"),m.style.setProperty("--radial-chart-middle",`${(this._radii[e-1]-this._width/2)*2}%`),m.append(h);let f=this._total("radial-chart-total");return f&&m.append(f),m}};var wt=(d,n)=>d.className.split(/\s+/).includes(n),ht=class extends N{get _type(){return"mixed-chart"}get _key(){return"Expressive_MixedChart"}get _points(){return!0}static init(n,t={}){return super.init(n,t)}static getInstance(n){return n.Expressive_MixedChart}_scale(n,t,e){let i=n.filter(r=>wt(r,"end")),s=n.filter(r=>!i.includes(r)),o=r=>r.some(a=>wt(a,"column"));return super._scale(i,this._number("endMin"),this._number("endMax"),o(i)),super._scale(s,t,e,o(s))}_draw(){let n=document.createElement("div");n.className="mixed-chart-marks";let t=super._draw(this.series.filter(e=>wt(e,"column")));return t.className="mixed-chart-columns",n.append(t,S.prototype._draw.call(this,this.series.filter(e=>!wt(e,"column")))),n}};var Ke={classes:"",menuOptions:{}},O=class d extends b{constructor(t,e){super(t,e,d);this._originalLabels=new Map;this._validationMessage=null;this._handleSelectChange=()=>{this._setValueToInput(),this._setSelectedStates(),this._syncValidationError()};this._handleInvalid=t=>{t.defaultPrevented||(this._validationMessage||(this._validationMessage=document.createElement("small"),this._validationMessage.id=this.input.id+"-error",this._validationMessage.className="supporting-text",this._validationMessage.style.color="var(--md-sys-color-error)",this.wrapper.append(this._validationMessage),this.input.setAttribute("aria-describedby",[this.input.getAttribute("aria-describedby"),this._validationMessage.id].filter(Boolean).join(" "))),this.input.ariaInvalid="true",this._syncValidationError())};this._handleNativeFocus=()=>queueMicrotask(()=>{d.getInstance(this.el)===this&&this.el.matches(":focus")&&this.input.focus()});this._handleReset=t=>{clearTimeout(this._resetTimer),this._resetTimer=setTimeout(()=>{t.defaultPrevented||(this._handleSelectChange(),this._clearValidationError())},0)};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={...d.defaults,...e},this.isMultiple=this.el.multiple,this.nativeTabIndex=this.el.tabIndex??-1,this.el.tabIndex=-1,this._values=[],this._createdWrapper=!1,this._setupMenu(),this._setupEventHandlers())}static get defaults(){return Ke}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_FormSelect}destroy(){this._removeEventHandlers(),this._clearValidationError(),this.menu?.destroy(),this._removeMenu(),this.el.tabIndex=this.nativeTabIndex,this.el.Expressive_FormSelect=void 0}refresh(){if(!this.menuEl)return;this._bindForm();let t=this.menuEl.getRootNode(),e=this._values.find(i=>i.optionEl.contains(t.activeElement))?.el;this.input.disabled=this.el.matches(":disabled"),this.wrapper.classList.toggle("disabled",this.input.disabled),this.input.disabled?this.menu?.close():this.menu||this._initMenu(),this.input.removeAttribute("aria-activedescendant"),this._rebuildOptions(),this._handleSelectChange(),this.menu&&(this.menu.focusedIndex=-1),this.menu?.isOpen&&(this.menu.recalculateDimensions(),e&&(this._values.find(i=>i.el===e)?.optionEl??this.input).focus())}_setupEventHandlers(){this._setupOptionHandlers(),this.el.addEventListener("change",this._handleSelectChange),this.el.addEventListener("invalid",this._handleInvalid),this.el.addEventListener("focus",this._handleNativeFocus),this.input.addEventListener("click",this._handleInputClick),this.menuEl.addEventListener("focusin",this._handleOptionFocus),this._bindForm()}_bindForm(){this._form?.removeEventListener("reset",this._handleReset),this._form=this.el.form,this._form?.addEventListener("reset",this._handleReset)}_removeEventHandlers(){this._removeOptionHandlers(),this.el.removeEventListener("change",this._handleSelectChange),this.el.removeEventListener("invalid",this._handleInvalid),this.el.removeEventListener("focus",this._handleNativeFocus),this.input?.removeEventListener("click",this._handleInputClick),this.menuEl?.removeEventListener("focusin",this._handleOptionFocus),this._form?.removeEventListener("reset",this._handleReset),clearTimeout(this._resetTimer)}_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)})}_syncValidationError(){this._validationMessage&&(this.el.willValidate&&!this.el.validity.valid?this._validationMessage.textContent=this.el.validationMessage:this._clearValidationError())}_clearValidationError(){if(!this._validationMessage)return;let t=this.input.getAttribute("aria-describedby")?.split(/\s+/).filter(e=>e!==this._validationMessage.id).join(" ");t?this.input.setAttribute("aria-describedby",t):this.input.removeAttribute("aria-describedby"),this.input.ariaInvalid=this.el.ariaInvalid,this._validationMessage.remove(),this._validationMessage=null}_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(!this.el.matches(":disabled")){if(!t.classList.contains("disabled")&&!t.classList.contains("optgroup")){let e=this._values.find(r=>r.optionEl===t);if(!e||e.el.matches(":disabled"))return;let i=this.getSelectedValues();this.isMultiple?this._toggleEntryFromArray(e):(this._deselectAll(),this._selectValue(e)),this._handleSelectChange();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,Array.from(this.el.labels??[]).forEach(t=>{this._originalLabels.set(t,{for:t.getAttribute("for"),id:t.getAttribute("id")})}),this.labelEl&&!this.el.closest("label")&&(this._labelPlaceholder=document.createComment(""),this.labelEl.before(this._labelPlaceholder)),this._setupWrapper(),this._hideNativeSelect(),this.el.matches(":disabled")&&this.wrapper.classList.add("disabled"),this.menuEl=document.createElement("menu"),this.menuEl.id=`select-options-${u.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._labelPlaceholder&&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"),t.ariaHidden="true",this.el.before(t),t.appendChild(this.el),this._createdWrapper&&this.wrapper.append(t)}_buildInput(){this.input=document.createElement("input"),this.input.id="select-input-"+u.guid(),this.input.classList.add("menu-trigger","no-autoinit"),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.input.disabled=this.el.matches(":disabled"),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._originalLabels.forEach((e,i)=>{i.htmlFor=this.input.id}),this._labelPlaceholder&&this._originalLabels.size>1&&!this.input.getAttribute("aria-label")&&!this.input.getAttribute("aria-labelledby")&&this.input.setAttribute("aria-labelledby",Array.from(this._originalLabels.keys(),(e,i)=>(e.id||(e.id=`${this.input.id}-label-${i}`),e.id)).join(" ")),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.matches(":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 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=B.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-"+u.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(a=>a.tagName==="OPTION").forEach(a=>{let h=this._createAndAppendOptionWithIcon(a,"optgroup-option");o.push(h.id),this._addOptionToValues(a,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._originalLabels.forEach((e,i)=>{for(let s of["for","id"])e[s]===null?i.removeAttribute(s):i.setAttribute(s,e[s])}),this._labelPlaceholder?.replaceWith(this.labelEl),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-"+u.guid(),i.setAttribute("role","option"),i.tabIndex=0;let s=this.el.matches(":disabled")||t.matches(":disabled");s&&(i.classList.add("disabled"),i.ariaDisabled="true",i.tabIndex=-1),e==="optgroup-option"&&i.classList.add(e);let o=t.textContent,r=document.createElement("span");if(this.isMultiple&&!s){let c=document.createElement("label"),m=document.createElement("input");m.type="checkbox",m.tabIndex=-1;let f=document.createElement("span");f.textContent=o,c.append(m,f),r.appendChild(c)}else r.textContent=o;i.appendChild(r);let a=t.getAttribute("data-icon"),h;if(a)try{let c=new URL(a,this.el.ownerDocument.baseURI);(["http:","https:","blob:"].includes(c.protocol)||/^data:image\/(?:avif|bmp|gif|jpeg|png|svg\+xml|webp|x-icon)(?:;|,)/i.test(c.href))&&(h=c)}catch{}let l=t.getAttribute("class")?.split(" ").filter(Boolean);if(h){let c=document.createElement("img");l?.length&&c.classList.add(...l),c.src=h.href,c.ariaHidden="true",i.prepend(c)}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 t.el.selected}_toggleEntryFromArray(t){this._isValueSelected(t)?this._deselectValue(t):this._selectValue(t)}_getSelectedOptions(){return Array.prototype.filter.call(this.el.selectedOptions,t=>t)}_setValueToInput(){this.input.value=this._getSelectedOptions().map(t=>t.textContent.trim()).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 Ue={margin:5,transition:10,duration:250,align:"left"},dt=class d{constructor(n,t,e){this._handleDocumentClick=n=>{this.visible&&!n.composedPath().includes(this.el)&&!n.composedPath().includes(this.container)&&this.hide()};this.destroy=()=>{document.removeEventListener("click",this._handleDocumentClick),this.container.remove()};this.show=()=>{if(this.visible)return;this.visible=!0;let n=u._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(${
|
|
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=`
|
|
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=o,this.options={...he,...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 d(o,t,e)}};var ce={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 _{constructor(t,e){super(t,e,f);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=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===u.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||t.altKey||t.ctrlKey||t.metaKey)return;let i=this._dayDate(e),s=(i.getDay()-this.options.firstDay+7)%7,n={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-s,End:6-s};if(Object.hasOwn(n,t.key))i.setDate(i.getDate()+n[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let p=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let v=new Date(i.getTime());v.setMonth(v.getMonth()+1,0),i.setDate(Math.min(p,v.getDate()))}else return;t.preventDefault();let{minDate:a,maxDate:c,minYear:h,maxYear:l,minMonth:r,maxMonth:m}=this.options;a&&i<a&&i.setTime(a.getTime()),c&&i>c&&i.setTime(c.getTime()),!(i.getFullYear()<h||i.getFullYear()>l||i.getFullYear()===h&&i.getMonth()<(r??0)||i.getFullYear()===l&&i.getMonth()>(m??11))&&(this._focusedDate=i,this.gotoDate(i))};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")&&!e.parentElement.classList.contains("is-selection-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.dates?.splice(0),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;if(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=f._parseDate(t.target.value),f._isDate(e))){if(i==this.endDateEl&&e<this.date)return this.setInputValue(i,this.endDate);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=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=f._parseDate(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.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ce}static init(t,e={}){return super.init(t,e,f)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}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.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&k.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&k.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"))),u.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||u.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=f._parseDate(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&&(f._setToStartOfDay(n),this.options.isMultipleSelection?s||this.setMultiDate(n):this.setSingleDate(n,i),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=f._parseDate(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(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(f._isDate(e)?t.type=="date"?(this.setDataDate(t,e),t.value=this.formatDate(e,"yyyy-mm-dd")):t.value=this.toString(e):(t.value="",t.type==="date"&&t.setAttribute("data-date","")),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),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=f._getDaysInMonth(t,e),a=[],c=new Date(t,e,1).getDay(),h=[];f._setToStartOfDay(s),this.options.firstDay>0&&(c-=this.options.firstDay,c<0&&(c+=7));let l=e===0?11:e-1,r=e===11?0:e+1,m=e===0?t-1:t,p=e===11?t+1:t,v=f._getDaysInMonth(m,l),E=n+c,b=E;for(;b>7;)b-=7;E+=7-b;let w=!1;for(let D=0,F=0;D<E;D++){let M=new Date(t,e,1+(D-c)),It=f._compareDates(M,s),Dt=this.options.events.indexOf(M.toDateString())!==-1,gt=D<c||D>=n+c,kt=this.options.startRange&&f._compareDates(this.options.startRange,M),At=this.options.endRange&&f._compareDates(this.options.endRange,M),St=this.options.startRange&&this.options.endRange&&this.options.startRange<M&&M<this.options.endRange,Ot=this.options.minDate&&M<this.options.minDate||this.options.maxDate&&M>this.options.maxDate||this.options.disableWeekends&&f._isWeekend(M)||this.options.disableDayFn&&this.options.disableDayFn(M),Ht=this.options.isDateRange&&this.date&&this.endDate&&f._compareDates(this.date,M),Rt=this.options.isDateRange&&this.endDate&&f._compareDates(this.endDate,M),Pt=this.options.isDateRange&&f._isDate(this.endDate)&&f._compareWithinRange(M,this.date,this.endDate),nt=1+(D-c),ht=e,ct=t,ot=!1;f._isDate(this.date)&&(ot=f._compareDates(M,this.date)),!ot&&f._isDate(this.endDate)&&(ot=f._compareDates(M,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(Nt=>Nt.getTime()===M.getTime())&&(ot=!0),gt&&(D<c?(nt=v+nt,ht=l,ct=m):(nt=nt-n,ht=r,ct=p));let Bt={day:nt,month:ht,year:ct,hasEvent:Dt,isSelected:ot,isToday:It,isDisabled:Ot,isEmpty:gt,isStartRange:kt,isEndRange:At,isInRange:St,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:Ht,isDateRangeEnd:Rt,isDateRange:Pt};h.push(this.renderDay(Bt)),++F===7&&(a.push(this.renderRow(h,this.options.isRTL,w)),h=[],F=0,w=!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(h=>!!(t.hasOwnProperty(h)&&t[h]===!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[h,l]of Object.entries(e))t.hasOwnProperty(h)&&t[h]&&s.push(l);let n=f._escape(t.day),a=f._escape(t.month),c=f._escape(t.year);return`<td data-day="${n}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${c}" data-month="${a}" data-day="${n}">${n}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+f._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+f._escape(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)),n=f._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>"+f._calendarMarkup(t.join(""),"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},n=(a,c)=>{if(a.nodeType===Node.TEXT_NODE){if((c==="tbody"||c==="tr")&&a.textContent.trim())throw new TypeError("Unsupported calendar row content");return f._escape(a.textContent)}if(!(a instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let h=a.localName==="tr"?"tr":a.localName==="td"?"td":a.localName==="button"?"button":null;if(!h||!(c==="tbody"&&h==="tr"||c==="tr"&&h==="td"||c==="td"&&h==="button"))throw new TypeError("Unsupported calendar row element");if([...a.attributes].some(r=>!s[h].includes(r.name)))throw new TypeError("Unsupported calendar row attribute");if(h==="button"&&a.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let l=s[h].filter(r=>a.hasAttribute(r)).map(r=>` ${r}="${f._escape(a.getAttribute(r))}"`).join("");return`<${h}${l}>${[...a.childNodes].map(r=>n(r,h)).join("")}</${h}>`};return[...i.content.childNodes].map(a=>n(a,e)).join("")}_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 c=this.options,h=i===c.minYear,l=i===c.maxYear,r,m,p=[],v='<div id="'+f._escape(a)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:E,next:b}=this._arrowState(i,s);for(r=0;r<12;r++)p.push('<option value="'+(i===n?r-e:12+r-e)+'"'+(r===s?' selected="selected"':"")+(h&&r<c.minMonth||l&&r>c.maxMonth?'disabled="disabled"':"")+">"+f._escape(c.i18n.months[r])+"</option>");let w='<select class="datepicker-select orig-select-month" tabindex="-1">'+p.join("")+"</select>";for(Array.isArray(c.yearRange)?(r=c.yearRange[0],m=c.yearRange[1]+1):(r=i-c.yearRange,m=1+i+c.yearRange),p=[];r<m&&r<=c.maxYear;r++)r>=c.minYear&&p.push(`<option value="${r}" ${r===i?'selected="selected"':""}>${r}</option>`);c.yearRangeReverse&&p.reverse();let D=`<select class="datepicker-select orig-select-year" tabindex="-1">${p.join("")}</select>`;return v+=`<button class="month-prev${E?"":" 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>`,v+='<div class="selects-container">',c.showMonthAfterYear?v+=D+w:v+=w+D,v+="</div>",v+=`<button class="month-next${b?"":" 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>`,v+="</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.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,s=this.options,n=s.minYear,a=s.maxYear,c=s.minMonth,h=s.maxMonth;this._y<=n&&(this._y=n,!isNaN(c)&&this._m<c&&(this._m=c)),this._y>=a&&(this._y=a,!isNaN(h)&&this._m>h&&(this._m=h));let l=this.calendars[0].year,r=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let m=this._controlsCacheKey(l);m===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(l,r):(this._controlsKey=m,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(l,r)),this._renderCalendarTable(l,r),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),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");k.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),k.init(s,{classes:"select-month",menuOptions:{container:u.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(),k.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.endDateEl?.addEventListener("click",this._handleInputClick),this.endDateEl?.addEventListener("keydown",this._handleInputKeydown),this.endDateEl?.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus)}_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(){for(let t of this.dateEls??[this.el])this._removeInputEventHandlers(t);this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.calendarEl.removeEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.removeEventListener("focusin",this._handleCalendarFocus),this.options.isDateRange&&this.endDateEl&&this._removeInputEventHandlers(this.endDateEl)}_removeInputEventHandlers(t){t.removeEventListener("click",this._handleInputClick),t.removeEventListener("keydown",this._handleInputKeydown),t.removeEventListener("change",this._handleInputChange)}_removeDateInput(t){let e=t.getRootNode().activeElement===t;this._removeInputEventHandlers(t),t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),f._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(a=>!a.parentElement.classList.contains("is-selection-disabled")),s=this._focusedDate||this.date||new Date,n=i.find(a=>f._compareDates(this._dayDate(a),s))||i.find(a=>a.parentElement.classList.contains("is-selected"))||i.find(a=>!a.parentElement.classList.contains("is-disabled"))||i[0];for(let a of e)a.tabIndex=a===n?0:-1,a.setAttribute("aria-disabled",String(a.parentElement.matches(".is-disabled, .is-selection-disabled")));n&&(this._focusedDate=this._dayDate(n),t&&n.focus())}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("keydown",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=n,this.options={...Ue,...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 d(n,t,e)}};var Ye={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},_=class _ extends b{constructor(t,e){super(t,e,_);this.multiple=!1;this._drawDepth=0;this._drawDirty=!1;this._controlsKey=null;this._randId=null;this._focusedDate=null;this._handleInputClick=t=>{t.target.type=="date"&&(this.options.openByDefault||this.options.container)&&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===u.keys.ENTER&&(t.preventDefault(),this._batchDraws(()=>{this.setDateFromInput(t.target),this._focusedDate=t.target===this.endDateEl?this.endDate:this.date,this.draw()}),this.displayPlugin&&this.displayPlugin.show(),this._syncCalendarFocus(!0),this.options.onInputInteraction&&this.options.onInputInteraction.call(this))};this._handleCalendarFocus=t=>{let e=t.target;e.matches(".datepicker-day-button")&&(this._focusedDate=this._dayDate(e),this._syncCalendarFocus())};this._handleCalendarKeydown=t=>{let e=t.target;if(!e.matches(".datepicker-day-button")||t.altKey||t.ctrlKey||t.metaKey)return;let i=this._dayDate(e),s=(i.getDay()-this.options.firstDay+7)%7,o={ArrowLeft:this.options.isRTL?1:-1,ArrowRight:this.options.isRTL?-1:1,ArrowUp:-7,ArrowDown:7,Home:-s,End:6-s};if(Object.hasOwn(o,t.key))i.setDate(i.getDate()+o[t.key]);else if(t.key==="PageUp"||t.key==="PageDown"){let f=i.getDate();i.setDate(1),i.setMonth(i.getMonth()+(t.key==="PageUp"?-1:1)*(t.shiftKey?12:1));let p=new Date(i.getTime());p.setMonth(p.getMonth()+1,0),i.setDate(Math.min(f,p.getDate()))}else return;t.preventDefault();let{minDate:r,maxDate:a,minYear:h,maxYear:l,minMonth:c,maxMonth:m}=this.options;r&&i<r&&i.setTime(r.getTime()),a&&i>a&&i.setTime(a.getTime()),!(i.getFullYear()<h||i.getFullYear()>l||i.getFullYear()===h&&i.getMonth()<(c??0)||i.getFullYear()===l&&i.getMonth()>(m??11))&&(this._focusedDate=i,this.gotoDate(i))};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")&&!e.parentElement.classList.contains("is-selection-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||!_._compareDates(t,this.endDate)){if(_._isDate(this.date)&&_._comparePastDate(t,this.date))return;this.setDate(t,!1,_._isDate(this.date));return}this._clearDates(),this.draw()};this._handleClearClick=()=>{this._clearDates(),this.setInputValues()};this._clearDates=()=>{this.date=null,this.endDate=null,this.dates?.splice(0),this.draw()};this._handleMonthChange=t=>{this.gotoMonth(t.target.value)};this._handleYearChange=t=>{this.gotoYear(t.target.value)};this._handleInputChange=t=>{t.detail?.firedBy!==this&&this.setDateFromInput(t.target)};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={..._.defaults,...e},e&&e.hasOwnProperty("i18n")&&typeof e.i18n=="object"&&(this.options.i18n={..._.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=u.guid(),this.options.isMultipleSelection&&(this.multiple=!0,this.dates=[],this.dateEls=[t]),this._setupVariables(),this._insertHTMLIntoDOM(),this._setupEventHandlers(),this.options.defaultDate||(this.options.defaultDate=this._parseInput(this.el.value));let i=this.options.defaultDate;if(_._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;_._isDate(s)&&this.options.setDefaultEndDate&&(this.setDate(s,!0,!0),this.setInputValue(this.endDateEl,s))}this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=dt.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return Ye}static init(t,e={}){return super.init(t,e,_)}static _escape(t){return String(t??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}static _isDate(t){return/Date/.test(Object.prototype.toString.call(t))&&!isNaN(t.getTime())}static _parseDate(t){if(t=t.trim(),!/^\d{4}-\d{2}-\d{2}$/.test(t))return new Date(Date.parse(t));let e=new Date(t+"T00:00:00");return e.getDate()===Number(t.slice(-2))?e:new Date(NaN)}_parseInput(t){return!t.trim()||!this.options.parse?_._parseDate(t):this.options.parse(t,typeof this.options.format=="string"?this.options.format:"")}static _isWeekend(t){let e=t.getDay();return e===0||e===6}static _setToStartOfDay(t){_._isDate(t)&&t.setHours(0,0,0,0)}static _getDaysInMonth(t,e){return[31,_._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.dateEls?.slice(1).forEach(t=>this._removeDateInput(t)),!this.options.dateRangeEndEl&&this.endDateEl&&this._removeDateInput(this.endDateEl),this.displayPlugin?.destroy(),this.containerEl.remove(),this.destroySelects(),this.el.Expressive_Datepicker=void 0}destroySelects(){let t=this.calendarEl.querySelector(".orig-select-year");t&&O.getInstance(t).destroy();let e=this.calendarEl.querySelector(".orig-select-month");e&&O.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"))),u.createButton(this.footer,this.options.i18n.clear,["datepicker-clear"],this.options.showClearBtn,this._handleClearClick),this.options.autoSubmit||u.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):_._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){if(t.type==="date"&&this.setDataDate(t,_._parseDate(t.value)),(this.options.isDateRange||!this.options.isMultipleSelection)&&!t.value.trim()){this.setSingleDate(null,t===this.endDateEl),this.draw();return}let e=this._parseInput(t.value);if(!_._isDate(e))return;let i=new Date(e.getTime());_._setToStartOfDay(i);let s=t===this.endDateEl;if(this.options.isDateRange&&(s?this.date&&i<this.date:this.endDate&&i>this.endDate)){this.setInputValue(t,s?this.endDate:this.date);return}this.setDate(i,!1,s,!0)}setDate(t=null,e=!1,i=!1,s=!1){let o=this.validateDate(t);o&&(_._setToStartOfDay(o),this.options.isMultipleSelection?s||this.setMultiDate(o):this.setSingleDate(o,i),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=_._parseDate(t)),!_._isDate(t))return;let e=this.options.minDate,i=this.options.maxDate;return _._isDate(e)&&t<e?t=e:_._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",_._isDate(e)?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(){let t=Math.max(1,this.dates.length);for(let e of this.dateEls.splice(t))this._removeDateInput(e);for(;this.dateEls.length<t;)this.dateEls.push(this.createDateInput());this.dateEls.forEach((e,i)=>this.setInputValue(e,this.dates[i]??null))}setInputValue(t,e){t&&(t.type=="date"&&this.setDataDate(t,e),_._isDate(e)?t.type=="date"?t.value=this.formatDate(e,"yyyy-mm-dd"):t.value=this.toString(e):t.value="",t.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{firedBy:this}})))}_renderDateDisplay(t,e=null){let i=_._isDate(t)?t:new Date;if(!this.options.isDateRange)this.dateTextEl.textContent=this.formatDate(i,"ddd, mmm d");else{let s=_._isDate(e)?e:new Date;this.dateTextEl.textContent=`${this.formatDate(i,"mmm d")} - ${this.formatDate(s,"mmm d")}`}}gotoDate(t){let e=!0;if(_._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=_._getDaysInMonth(t,e),r=[],a=new Date(t,e,1).getDay(),h=[];_._setToStartOfDay(s),this.options.firstDay>0&&(a-=this.options.firstDay,a<0&&(a+=7));let l=e===0?11:e-1,c=e===11?0:e+1,m=e===0?t-1:t,f=e===11?t+1:t,p=_._getDaysInMonth(m,l),v=o+a,g=v;for(;g>7;)g-=7;v+=7-g;let E=!1;for(let L=0,x=0;L<v;L++){let T=new Date(t,e,1+(L-a)),j=_._compareDates(T,s),bt=this.options.events.indexOf(T.toDateString())!==-1,xt=L<a||L>=o+a,ie=this.options.startRange&&_._compareDates(this.options.startRange,T),se=this.options.endRange&&_._compareDates(this.options.endRange,T),ne=this.options.startRange&&this.options.endRange&&this.options.startRange<T&&T<this.options.endRange,oe=this.options.minDate&&T<this.options.minDate||this.options.maxDate&&T>this.options.maxDate||this.options.disableWeekends&&_._isWeekend(T)||this.options.disableDayFn&&this.options.disableDayFn(T),re=this.options.isDateRange&&this.date&&this.endDate&&_._compareDates(this.date,T),ae=this.options.isDateRange&&this.endDate&&_._compareDates(this.endDate,T),le=this.options.isDateRange&&_._isDate(this.date)&&_._isDate(this.endDate)&&_._compareWithinRange(T,this.date,this.endDate),yt=1+(L-a),kt=e,Ht=t,Lt=!1;_._isDate(this.date)&&(Lt=_._compareDates(T,this.date)),!Lt&&_._isDate(this.endDate)&&(Lt=_._compareDates(T,this.endDate)),this.options.isMultipleSelection&&this.dates?.some(he=>he.getTime()===T.getTime())&&(Lt=!0),xt&&(L<a?(yt=p+yt,kt=l,Ht=m):(yt=yt-o,kt=c,Ht=f));let ce={day:yt,month:kt,year:Ht,hasEvent:bt,isSelected:Lt,isToday:j,isDisabled:oe,isEmpty:xt,isStartRange:ie,isEndRange:se,isInRange:ne,showDaysInNextAndPreviousMonths:this.options.showDaysInNextAndPreviousMonths,isDateRangeStart:re,isDateRangeEnd:ae,isDateRange:le};h.push(this.renderDay(ce)),++x===7&&(r.push(this.renderRow(h,this.options.isRTL,E)),h=[],x=0,E=!1)}return this.renderTable(this.options,r,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(h=>!!(t.hasOwnProperty(h)&&t[h]===!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[h,l]of Object.entries(e))t.hasOwnProperty(h)&&t[h]&&s.push(l);let o=_._escape(t.day),r=_._escape(t.month),a=_._escape(t.year);return`<td data-day="${o}" class="${s.join(" ")}" aria-selected="${i}"><button class="datepicker-day-button" type="button" data-year="${a}" data-month="${r}" data-day="${o}">${o}</button></td>`}renderRow(t,e,i){return'<tr class="datepicker-row'+(i?" is-selected":"")+'">'+_._calendarMarkup((e?t.reverse():t).join(""),"tr")+"</tr>"}renderTable(t,e,i){return'<div class="datepicker-table-wrapper"><table cellpadding="0" cellspacing="0" class="datepicker-table" role="grid" aria-labelledby="'+_._escape(i)+'">'+this.renderHead(t)+this.renderBody(e)+"</table></div>"}renderHead(t){let e=[],i;for(i=0;i<7;i++){let s=_._escape(this.renderDayName(t,i)),o=_._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>"+_._calendarMarkup(t.join(""),"tbody")+"</tbody>"}static _calendarMarkup(t,e){let i=document.createElement("template");i.innerHTML=t;let s={tr:["class"],td:["class","data-day","aria-selected"],button:["class","type","data-year","data-month","data-day","aria-label","disabled","tabindex"]},o=(r,a)=>{if(r.nodeType===Node.TEXT_NODE){if((a==="tbody"||a==="tr")&&r.textContent.trim())throw new TypeError("Unsupported calendar row content");return _._escape(r.textContent)}if(!(r instanceof HTMLElement))throw new TypeError("Unsupported calendar row content");let h=r.localName==="tr"?"tr":r.localName==="td"?"td":r.localName==="button"?"button":null;if(!h||!(a==="tbody"&&h==="tr"||a==="tr"&&h==="td"||a==="td"&&h==="button"))throw new TypeError("Unsupported calendar row element");if([...r.attributes].some(c=>!s[h].includes(c.name)))throw new TypeError("Unsupported calendar row attribute");if(h==="button"&&r.getAttribute("type")!=="button")throw new TypeError('Calendar day buttons require type="button"');let l=s[h].filter(c=>r.hasAttribute(c)).map(c=>` ${c}="${_._escape(r.getAttribute(c))}"`).join("");return`<${h}${l}>${[...r.childNodes].map(c=>o(c,h)).join("")}</${h}>`};return[...i.content.childNodes].map(r=>o(r,e)).join("")}_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,r){let a=this.options,h=i===a.minYear,l=i===a.maxYear,c,m,f=[],p='<div id="'+_._escape(r)+'" class="datepicker-controls" role="heading" aria-live="assertive">',{prev:v,next:g}=this._arrowState(i,s);for(c=0;c<12;c++)f.push('<option value="'+(i===o?c-e:12+c-e)+'"'+(c===s?' selected="selected"':"")+(h&&c<a.minMonth||l&&c>a.maxMonth?'disabled="disabled"':"")+">"+_._escape(a.i18n.months[c])+"</option>");let E='<select class="datepicker-select orig-select-month" tabindex="-1">'+f.join("")+"</select>";for(Array.isArray(a.yearRange)?(c=a.yearRange[0],m=a.yearRange[1]+1):(c=i-a.yearRange,m=1+i+a.yearRange),f=[];c<m&&c<=a.maxYear;c++)c>=a.minYear&&f.push(`<option value="${c}" ${c===i?'selected="selected"':""}>${c}</option>`);a.yearRangeReverse&&f.reverse();let L=`<select class="datepicker-select orig-select-year" tabindex="-1">${f.join("")}</select>`;return p+=`<button class="month-prev${v?"":" 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>`,p+='<div class="selects-container">',a.showMonthAfterYear?p+=L+E:p+=E+L,p+="</div>",p+=`<button class="month-next${g?"":" 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>`,p+="</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.calendarEl.getRootNode().activeElement,e=t?.matches(".datepicker-day-button")&&this.calendarEl.contains(t),i=this.calendarEl.contains(t)&&t?.matches(".month-prev, .month-next")?t.classList.contains("month-prev")?".month-prev":".month-next":null,s=this.options,o=s.minYear,r=s.maxYear,a=s.minMonth,h=s.maxMonth;this._y<=o&&(this._y=o,!isNaN(a)&&this._m<a&&(this._m=a)),this._y>=r&&(this._y=r,!isNaN(h)&&this._m>h&&(this._m=h));let l=this.calendars[0].year,c=this.calendars[0].month;this.options.isDateRange?this._renderDateDisplay(this.date,this.endDate):this._renderDateDisplay(this.date);let m=this._controlsCacheKey(l);m===this._controlsKey&&this.calendarEl.querySelector(".datepicker-controls")?this._reuseControls(l,c):(this._controlsKey=m,this._randId="datepicker-title-"+u.guid(),this._rebuildControls(l,c)),this._renderCalendarTable(l,c),this._syncCalendarFocus(!!e),i&&this.calendarEl.querySelector(i)?.focus(),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");O.init(i,{classes:"select-year",menuOptions:{container:u.portalRoot(this.el),constrainWidth:!1}}),O.init(s,{classes:"select-month",menuOptions:{container:u.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(),O.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.endDateEl?.addEventListener("click",this._handleInputClick),this.endDateEl?.addEventListener("keydown",this._handleInputKeydown),this.endDateEl?.addEventListener("change",this._handleInputChange),this.calendarEl.addEventListener("click",this._handleCalendarClick),this.calendarEl.addEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.addEventListener("focusin",this._handleCalendarFocus)}_setupVariables(){let t=document.createElement("template");t.innerHTML=_._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(){for(let t of this.dateEls??[this.el])this._removeInputEventHandlers(t);this.calendarEl.removeEventListener("click",this._handleCalendarClick),this.calendarEl.removeEventListener("keydown",this._handleCalendarKeydown),this.calendarEl.removeEventListener("focusin",this._handleCalendarFocus),this.options.isDateRange&&this.endDateEl&&this._removeInputEventHandlers(this.endDateEl)}_removeInputEventHandlers(t){t.removeEventListener("click",this._handleInputClick),t.removeEventListener("keydown",this._handleInputKeydown),t.removeEventListener("change",this._handleInputChange)}_removeDateInput(t){let e=t.getRootNode().activeElement===t;this._removeInputEventHandlers(t),t.remove(),e&&document.activeElement===document.body&&this.el.focus()}_dayDate(t){let e=new Date(0);return e.setFullYear(Number(t.dataset.year),Number(t.dataset.month),Number(t.dataset.day)),_._setToStartOfDay(e),e}_syncCalendarFocus(t=!1){let e=[...this.calendarEl.querySelectorAll(".datepicker-day-button")],i=e.filter(r=>!r.parentElement.classList.contains("is-selection-disabled")),s=this._focusedDate||this.date||new Date,o=i.find(r=>_._compareDates(this._dayDate(r),s))||i.find(r=>r.parentElement.classList.contains("is-selected"))||i.find(r=>!r.parentElement.classList.contains("is-disabled"))||i[0];for(let r of e)r.tabIndex=r===o?0:-1,r.setAttribute("aria-disabled",String(r.parentElement.matches(".is-disabled, .is-selection-disabled")));o&&(this._focusedDate=this._dayDate(o),t&&o.focus())}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.classList.add("no-autoinit"),t.addEventListener("click",this._handleInputClick),t.addEventListener("keydown",this._handleInputKeydown),t.addEventListener("change",this._handleInputChange),this.el.parentElement.appendChild(t),t}};_._template=`
|
|
10
10
|
<div class="datepicker-container">
|
|
11
11
|
<div class="datepicker-date-display">
|
|
12
12
|
<span class="year-text"></span>
|
|
@@ -16,7 +16,7 @@ var Expressive=(()=>{var dt=Object.defineProperty;var Wt=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 de={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},A=class A extends _{constructor(t,e){super(t,e,A);this._changedAncestorList=[];this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===u.keys.ESC&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;let t=this._cancel();this.overlayActive&&this._reset(),this._isOpen=!0,this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t!==this._revision)return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.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 s=this.originalWidth/this.windowWidth,n=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,s>n){let a=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*a}else{let a=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*a,this.newHeight=this.windowHeight*.9}window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._revision&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay&&this._removeOverlay(),this._photoCaption&&this._removeCaption(),this._animateImageOut())};this.el.Expressive_Lightbox=this,this.options={...A.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._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return de}static init(t,e={}){return super.init(t,e,A)}static getInstance(t){return t.Expressive_Lightbox}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode(),e=t.activeElement===this.el;this._removeEventHandlers(),this._cancel(),this._reset(),this.placeholder.replaceWith(this.el);let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;e&&(i===document.body||i===t.host)&&this._trigger.focus(),this._tabindex===null?this.el.removeAttribute("tabindex"):this.el.setAttribute("tabindex",this._tabindex),this.el.Expressive_Lightbox=void 0}_reset(){window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay?.remove(),this._photoCaption?.remove();for(let t of this._changedAncestorList){let e=A._overflow.get(t);--e.count===0&&(t.style.setProperty("overflow",e.value,e.priority),A._overflow.delete(t))}this._changedAncestorList=[],this.attrWidth!==null&&this.attrWidth!==void 0&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!==null&&this.attrHeight!==void 0&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),this.originInlineStyles===null?this.el.removeAttribute("style"):this.el.setAttribute("style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){this._motion.addEventListener("change",this._handleMotionChange),this._trigger.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keydown",this._handleLightboxKeypress)}_removeEventHandlers(){this._motion.removeEventListener("change",this._handleMotionChange),this._trigger.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keydown",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;if(e.style&&(e.style.overflow!=="visible"||A._overflow.has(e))){let i=A._overflow.get(e)??{count:0,value:e.style.overflow,priority:e.style.getPropertyPriority("overflow")};i.count++,A._overflow.set(e,i),this._changedAncestorList.push(e),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._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{let e=this._offset(this.placeholder);this.el.style.transition=`height ${t}ms ease,
|
|
19
|
+
</div>`;var ut=_;var Ge={autoScroll:!0,defaultScrollPosition:"end",peek:64},It=2,je=new Set(["ArrowUp","PageUp","Home"]),Zt=["pointerup","pointercancel","touchend","touchcancel"],pt=class d extends b{constructor(t,e){super(t,e,d);this._opened=!1;this._following=!1;this._holding=!1;this._lastTop=0;this._target=null;this._distance=1/0;this._ref=null;this._refOffset=0;this._anchor=null;this._spacer=0;this._last=null;this._resizeObserver=null;this._mutationObserver=null;this._handleScroll=()=>{if(this._target!==null){let t=Math.abs(this.viewport.scrollTop-this._resolve(this._target));if(t>It&&t<this._distance){this._distance=t;return}this._target=null}this._settle()};this._handleUserScroll=t=>{t.type==="wheel"&&t.deltaY>=0||t.type==="keydown"&&!je.has(t.key)||(this._target=null,t.type==="pointerdown"||t.type==="touchstart"?this._holding=!0:this._following=!1)};this._handleRelease=()=>{this._holding&&(this._holding=!1,this._following&&(this.viewport.scrollTop=this.viewport.scrollHeight),this._sync())};this._handleButtonClick=()=>this.scrollToEnd();this._handleMutations=t=>{for(let i of t)i.addedNodes.forEach(s=>{s instanceof Element&&this._resizeObserver?.observe(s)}),i.removedNodes.forEach(s=>{s instanceof Element&&this._resizeObserver?.unobserve(s)});let e=this._last;if(this._last=this.viewport.lastElementChild,!!this._opened&&(!this._following&&this._target===null&&this._restore(),!!this.options.autoScroll&&!(e&&e.parentElement!==this.viewport))){for(let i=this._last;i&&i!==e;i=i.previousElementSibling)if(i.hasAttribute("data-scroll-anchor")){this._anchor=i,this._updateSpacer(),this._following=!0,this._scrollTo(this._top(i)-this.options.peek);return}}};this._handleResize=()=>{if(!this._opened){this.viewport.clientHeight>0&&this._open();return}this._updateSpacer();let t=this.viewport;this._target==="end"?this._scrollTo("end"):this._target===null&&(this._following&&!this._holding?t.scrollTop=t.scrollHeight:this._restore()),this._sync()};if(this.el.Expressive_MessageScroller=this,this.options={...d.defaults,...e},this.viewport=t.querySelector(":scope > .message-scroller-viewport"),this.button=t.querySelector(":scope > .message-scroller-button"),!this.viewport){console.error("MessageScroller needs a .message-scroller-viewport child.");return}if(this._last=this.viewport.lastElementChild,this.viewport.clientHeight>0&&this._open(),typeof ResizeObserver<"u"){this._resizeObserver=new ResizeObserver(this._handleResize),this._resizeObserver.observe(this.viewport,{box:"border-box"});for(let i of Array.from(this.viewport.children))this._resizeObserver.observe(i)}this._mutationObserver=new MutationObserver(this._handleMutations),this._mutationObserver.observe(this.viewport,{childList:!0}),this.viewport.addEventListener("scroll",this._handleScroll,{passive:!0});for(let i of["wheel","touchstart","pointerdown","keydown"])this.viewport.addEventListener(i,this._handleUserScroll,{passive:!0});for(let i of Zt)document.addEventListener(i,this._handleRelease);this.button?.addEventListener("click",this._handleButtonClick)}static get defaults(){return Ge}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_MessageScroller}destroy(){if(this.el.Expressive_MessageScroller=void 0,!!this.viewport){this._resizeObserver?.disconnect(),this._mutationObserver?.disconnect(),this.viewport.removeEventListener("scroll",this._handleScroll);for(let t of["wheel","touchstart","pointerdown","keydown"])this.viewport.removeEventListener(t,this._handleUserScroll);for(let t of Zt)document.removeEventListener(t,this._handleRelease);this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"),this.button&&(this.button.removeEventListener("click",this._handleButtonClick),this.button.inert=!1)}}scrollToEnd(){this._following=this.options.autoScroll,this._scrollTo("end")}scrollToStart(){this._following=!1,this._scrollTo(0)}scrollToMessage(t){let e=u.getElementById(this.viewport,t);return!e||!this.viewport.contains(e)?!1:(this._following=!1,this._scrollTo(this._top(e)-this.options.peek),!0)}_open(){this._opened=!0;let t=this.viewport,e=this.options.defaultScrollPosition,i=t.querySelectorAll(":scope > [data-scroll-anchor]"),s=e==="last-anchor"?i[i.length-1]:null;e==="start"?t.scrollTop=0:s&&this._contentEnd()-this._top(s)+this.options.peek>t.clientHeight?t.scrollTop=this._top(s)-this.options.peek:t.scrollTop=t.scrollHeight,this._settle()}_settle(){let t=this.viewport.scrollTop,e=this._following&&t>=this._lastTop-It;this._following=this.options.autoScroll&&(e||this._atEnd()),this._lastTop=t,this._capture(),this._sync()}_scrollTo(t){let e=this.viewport;if(Math.abs(e.scrollTop-this._resolve(t))<=It){this._target=null,this._settle();return}this._target=t,this._distance=1/0;let i=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches;e.scrollTo({top:t==="end"?e.scrollHeight:t,behavior:i?"auto":"smooth"})}_resolve(t){let e=this.viewport.scrollHeight-this.viewport.clientHeight;return t==="end"?e:Math.max(0,Math.min(t,e))}_atEnd(){let t=this.viewport;return t.scrollHeight-t.scrollTop-t.clientHeight<=It}_top(t){let e=this.viewport;return t.getBoundingClientRect().top-e.getBoundingClientRect().top-e.clientTop+e.scrollTop}_contentEnd(){let t=this.viewport.lastElementChild;if(!t)return 0;let e=parseFloat(getComputedStyle(this.viewport).paddingBlockEnd)-this._spacer;return this._top(t)+t.getBoundingClientRect().height+e}_capture(){let t=this.viewport.children,e=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,i=0,s=t.length-1;for(;i<s;){let o=i+s>>1;t[o].getBoundingClientRect().bottom>e?s=o:i=o+1}this._ref=t[i]??null,this._refOffset=this._ref?this._ref.getBoundingClientRect().top-e:0}_restore(){if(this._ref?.parentElement!==this.viewport){this._capture();return}let t=this.viewport.getBoundingClientRect().top+this.viewport.clientTop,e=this._ref.getBoundingClientRect().top-t-this._refOffset;Math.abs(e)>=1&&(this.viewport.scrollTop+=e)}_updateSpacer(){let t=0;if(this._anchor?.parentElement===this.viewport){let e=this._top(this._anchor)-this.options.peek+this.viewport.clientHeight;t=Math.max(0,Math.ceil(e-this._contentEnd()))}else this._anchor=null;t!==this._spacer&&(this._spacer=t,t?this.viewport.style.setProperty("--md-comp-message-scroller-spacer",`${t}px`):this.viewport.style.removeProperty("--md-comp-message-scroller-spacer"))}_sync(){if(!this.button)return;let t=this._atEnd(),e=this.button.getRootNode();t&&e.activeElement===this.button&&this.viewport.focus({preventScroll:!0}),this.button.inert=t}};var Xe={Editor:null,extensions:[]},Qe=["aria-label","aria-labelledby","aria-describedby"],At=class d extends b{constructor(t,e){super(t,e,d);this.editor=null;this.content=null;this._actions=new Map;this._label=null;this._handleClick=t=>{let e=t.target.closest("button[data-command]"),i=this._actions.get(e);i&&!e.disabled&&this.editor.chain().focus()[i.command](i.attributes).run()};this._handleLabelClick=()=>{this.editor.chain().focus().run()};this._handleUpdate=()=>{this.textarea.value=this.editor.isEmpty?"":this.editor.getHTML(),this.textarea.dispatchEvent(new Event("input",{bubbles:!0}))};this._handleTransaction=()=>{let t=this.editor.isEditable&&this.editor.can();for(let[e,{command:i,attributes:s,active:o}]of this._actions){if(e.disabled=!t||!(i in this.editor.commands)||!t[i](s),!o)continue;let r=this.editor.isActive(o,s);e.setAttribute("aria-pressed",String(r)),e.classList.toggle("active",r)}};if(this.el.Expressive_RichTextEditor=this,this.options={...d.defaults,...e},this.textarea=t.querySelector(":scope > textarea"),!this.textarea||!this.options.Editor){console.error("RichTextEditor needs a <textarea> child and the Tiptap Editor class in options.Editor.");return}for(let s of t.querySelectorAll("button[data-command]")){let o=s.dataset.command,r=s.dataset.attributes?JSON.parse(s.dataset.attributes):void 0,a=o.startsWith("toggle")?o[6].toLowerCase()+o.slice(7):void 0;this._actions.set(s,{command:o,attributes:r,active:a})}let i={role:"textbox","aria-multiline":"true"};for(let s of Qe){let o=this.textarea.getAttribute(s);o&&(i[s]=o)}this._label=this.textarea.labels?.[0]??null,this._label&&!i["aria-labelledby"]&&(this._label.id||(this._label.id=`rich-text-editor-label-${u.guid()}`),i["aria-labelledby"]=this._label.id,this._label.addEventListener("click",this._handleLabelClick)),this.content=document.createElement("div"),this.content.className="rich-text-editor-content",this.textarea.after(this.content),this.textarea.hidden=!0,this.editor=new this.options.Editor({element:this.content,extensions:this.options.extensions,content:this.textarea.value,editable:!(this.textarea.disabled||this.textarea.readOnly),editorProps:{attributes:i}}),this.editor.on("update",this._handleUpdate),this.editor.on("transaction",this._handleTransaction),this._handleTransaction(),t.addEventListener("click",this._handleClick)}static get defaults(){return Xe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_RichTextEditor}destroy(){if(this.el.Expressive_RichTextEditor=void 0,!!this.editor){this.el.removeEventListener("click",this._handleClick),this._label?.removeEventListener("click",this._handleLabelClick),this.editor.off("update",this._handleUpdate),this.editor.off("transaction",this._handleTransaction),this.editor.destroy(),this.editor=null,this.content.remove(),this.textarea.hidden=!1;for(let t of this._actions.keys())t.disabled=!1,t.classList.remove("active"),t.removeAttribute("aria-pressed")}}};var Ze={inDuration:275,outDuration:200,onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},R=class R extends b{constructor(t,e){super(t,e,R);this._changedAncestorList=[];this._timers=new Map;this._motion=window.matchMedia("(prefers-reduced-motion: reduce)");this._isOpen=!1;this._destroyed=!1;this._revision=0;this._handleMotionChange=()=>{if(!this._motion.matches)return;let t=[...this._timers.values()],e=this._cancel();for(let i of t){if(e!==this._revision)break;i()}if(this.overlayActive)for(let i of[this.el,this._overlay,this._photoCaption])i&&(i.style.transition="none")};this._handleLightboxClick=()=>{this._handleLightboxToggle()};this._handleLightboxKeypress=t=>{this._trigger===this.el&&(t.key===u.keys.ENTER||t.key===" ")&&(t.preventDefault(),this._handleLightboxToggle())};this._handleLightboxToggle=()=>{this._isOpen?this.close():this.open()};this._handleWindowScroll=()=>{this.overlayActive&&this.close()};this._handleWindowResize=()=>{this.overlayActive&&this.close()};this._handleWindowEscape=t=>{t.key===u.keys.ESC&&this.close()};this.open=()=>{if(this._destroyed||this._isOpen)return;let t=this._cancel();this.overlayActive&&this._reset(),this._isOpen=!0,this._updateVars();let e=this.el.getBoundingClientRect(),i=this.placeholder.getBoundingClientRect();if(this.originalWidth=e.width,this.originalHeight=e.height,this.doneAnimating=!1,this.el.classList.add("active"),this.overlayActive=!0,typeof this.options.onOpenStart=="function"&&this.options.onOpenStart.call(this,this.el),t!==this._revision)return;this.placeholder.style.width=i.width+"px",this.placeholder.style.height=i.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 s=this.originalWidth/this.windowWidth,o=this.originalHeight/this.windowHeight;if(this.newWidth=0,this.newHeight=0,s>o){let r=this.originalHeight/this.originalWidth;this.newWidth=this.windowWidth*.9,this.newHeight=this.windowWidth*.9*r}else{let r=this.originalWidth/this.originalHeight;this.newWidth=this.windowHeight*.9*r,this.newHeight=this.windowHeight*.9}window.addEventListener("scroll",this._handleWindowScroll,{passive:!0}),window.addEventListener("resize",this._handleWindowResize,{passive:!0}),window.addEventListener("keyup",this._handleWindowEscape),this._animateImageIn()};this.close=()=>{if(this._destroyed||!this._isOpen)return;let t=this._cancel();this._isOpen=!1,this.doneAnimating=!1,typeof this.options.onCloseStart=="function"&&this.options.onCloseStart.call(this,this.el),t===this._revision&&(window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay&&this._removeOverlay(),this._photoCaption&&this._removeCaption(),this._animateImageOut())};this.el.Expressive_Lightbox=this,this.options={...R.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._tabindex=this.el.getAttribute("tabindex"),this._trigger=this.el.closest("button")??this.el,this.el.tabIndex=this._trigger===this.el?0:-1,this.el.before(this.placeholder),this.placeholder.append(this.el),this._setupEventHandlers()}static get defaults(){return Ze}static init(t,e={}){return super.init(t,e,R)}static getInstance(t){return t.Expressive_Lightbox}destroy(){if(this._destroyed)return;this._destroyed=!0;let t=this.el.getRootNode(),e=t.activeElement===this.el;this._removeEventHandlers(),this._cancel(),this._reset(),this.placeholder.replaceWith(this.el);let i=document.activeElement;for(;i?.shadowRoot?.activeElement;)i=i.shadowRoot.activeElement;e&&(i===document.body||i===t.host)&&this._trigger.focus(),this._tabindex===null?this.el.removeAttribute("tabindex"):this.el.setAttribute("tabindex",this._tabindex),this.el.Expressive_Lightbox=void 0}_reset(){window.removeEventListener("scroll",this._handleWindowScroll),window.removeEventListener("resize",this._handleWindowResize),window.removeEventListener("keyup",this._handleWindowEscape),this._overlay?.remove(),this._photoCaption?.remove();for(let t of this._changedAncestorList){let e=R._overflow.get(t);--e.count===0&&(t.style.setProperty("overflow",e.value,e.priority),R._overflow.delete(t))}this._changedAncestorList=[],this.attrWidth!==null&&this.attrWidth!==void 0&&this.el.setAttribute("width",this.attrWidth),this.attrHeight!==null&&this.attrHeight!==void 0&&this.el.setAttribute("height",this.attrHeight),this.el.classList.remove("active"),this.placeholder.removeAttribute("style"),this.originInlineStyles===null?this.el.removeAttribute("style"):this.el.setAttribute("style",this.originInlineStyles),this.overlayActive=!1,this._isOpen=!1,this.doneAnimating=!0}_cancel(){for(let t of this._timers.keys())clearTimeout(t);return this._timers.clear(),++this._revision}_schedule(t,e){if(this._motion.matches){t();return}let i=setTimeout(()=>{this._timers.delete(i),t()},e);this._timers.set(i,t)}_setupEventHandlers(){this._motion.addEventListener("change",this._handleMotionChange),this._trigger.addEventListener("click",this._handleLightboxClick),this.el.addEventListener("keydown",this._handleLightboxKeypress)}_removeEventHandlers(){this._motion.removeEventListener("change",this._handleMotionChange),this._trigger.removeEventListener("click",this._handleLightboxClick),this.el.removeEventListener("keydown",this._handleLightboxKeypress)}_makeAncestorsOverflowVisible(){this._changedAncestorList=[];let t=this.placeholder.parentNode;for(;t!=null&&t!==document;){let e=t;if(e.style&&(e.style.overflow!=="visible"||R._overflow.has(e))){let i=R._overflow.get(e)??{count:0,value:e.style.overflow,priority:e.style.getPropertyPriority("overflow")};i.count++,R._overflow.set(e,i),this._changedAncestorList.push(e),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._motion.matches?0:this.options.inDuration;this.el.style.transition="none",this.el.style.height=this.originalHeight+"px",this.el.style.width=this.originalWidth+"px",this._schedule(()=>{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
|
|
@@ -24,9 +24,9 @@ var Expressive=(()=>{var dt=Object.defineProperty;var Wt=Object.getOwnPropertyDe
|
|
|
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",this._schedule(()=>{this._reset(),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,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this._motion.matches?0:this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0"}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",i=>{i.stopPropagation(),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._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this._motion.matches?0:this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0"}};A._overflow=new WeakMap;var Q=A;var xt=d=>`a[href="#${d}"]`,ue={scrollOffset:200,activeClass:"active",getActiveElement:xt,keepTopElementActive:!1},y=class y extends _{constructor(t,e){super(t,e,y);this._ratio=0;this._link=null;this.el.Expressive_ScrollSpy=this,this.options={...y.defaults,...e},this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),y._elements.push(this),typeof IntersectionObserver<"u"&&(this._observer=new IntersectionObserver(i=>{if(y.getInstance(this.el)===this){for(let s of i)this._ratio=s.isIntersecting?s.intersectionRatio:0;y._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el))}static get defaults(){return ue}static init(t,e={}){return super.init(t,e,y)}static getInstance(t){return t.Expressive_ScrollSpy}destroy(){let t=y._elements.indexOf(this);if(t<0)return;y._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;y._active.get(e)===this&&y._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),this.el.Expressive_ScrollSpy=void 0,y._syncActive(e)}static _syncActive(t){let e=y._elements.filter(c=>c.options.getActiveElement===t),i=null,s=0;for(let c of e){let h=c._ratio;h>s&&(s=h,i=c)}if(!i){let c=e.filter(h=>h.options.keepTopElementActive);i=y._nearestAbove(c)??c[0]}let n=i?y._linkFor(i.el.id,i.options):null,a=y._active.get(t);a===i&&a?._link===n||(y._clearActive(t),n&&(n.classList.add(i.options.activeClass),n.setAttribute("aria-current","true"),i._link=n,y._active.set(t,i)))}static _nearestAbove(t){let e=null,i=-1/0;for(let s of t){let n=s.el.getBoundingClientRect().top;n<=0&&n>=i&&(i=n,e=s)}return e}static _clearActive(t){let e=y._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,y._active.delete(t))}static _linkFor(t,e){if(!t)return null;if(e.getActiveElement!==xt)try{return document.querySelector(e.getActiveElement(t))}catch{return null}let i=`#${t}`,s=document.querySelectorAll('a[href^="#"]');for(let n=0;n<s.length;n++)if(s[n].getAttribute("href")===i)return s[n];return null}};y._elements=[],y._active=new Map;var J=y;var pe={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},me="(width < 600px)",tt=class d extends _{constructor(t,e){super(t,e,d);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={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(me),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return pe}static init(t,e={}){return super.init(t,e,d)}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 fe={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},et=class d extends _{constructor(t,e){var i;super(t,e,d);this._originalPanels=new Map;this._originalLinks=new Map;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;if(this.options.swipeable){let h=i.hash&&document.getElementById(i.hash.slice(1)),l=this._tabsCarousel.images.indexOf(h);l>=0&&this._tabsCarousel.set(l),t.preventDefault();return}let a=this._content;this._tabLinks=this._queryTabLinks();let c=this._index;this._setActiveTabLink(i),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(c),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._tabLinks.forEach(s=>{if(this._originalLinks.set(s,{active:s.classList.contains("active"),current:s.getAttribute("aria-current")}),s.hasAttribute("target"))return;let n=s.hash&&document.getElementById(s.hash.slice(1));n&&this._originalPanels.set(n,{display:n.style.display,priority:n.style.getPropertyPriority("display"),active:n.classList.contains("active"),carousel:n.classList.contains("carousel-item")})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return fe}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.remove(),this.options.swipeable&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.classList.toggle("carousel-item",t.carousel),e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),t.current===null?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t.current)}),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"),this._index=Array.from(this._tabLinks).indexOf(t),this._content=t.hasAttribute("target")?null:document.getElementById(t.hash.slice(1))}_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._originalPanels.forEach((t,e)=>e.classList.toggle("active",e===this._content))}_setupSwipeableTabs(){let t=[];this._tabLinks.forEach(i=>{if(i.hash&&!i.hasAttribute("target")){let s=document.getElementById(i.hash.slice(1));if(!s)return;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=>{let s=document.createComment("");i.before(s),this._originalPanels.get(i).marker=s,e.appendChild(i),i.style.display=""}),this._tabsCarousel=W.init(e,{fullWidth:!0,noWrap:!0,duration:this.options.duration,onCycleTo:i=>{let s=this._index;this._setActiveTabLink(Array.from(this._tabLinks).find(n=>!n.hasAttribute("target")&&n.hash==="#"+i.id)),this._setTabsAndTabWidth(),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}})}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(!(t===this._activeTabLink||t.hasAttribute("target"))&&t.hash){let e=document.getElementById(t.hash.slice(1));e&&(e.style.display="none")}})}_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",this._schedule(()=>{this._reset(),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,u.portalRoot(this.el).append(this._photoCaption),this._photoCaption.style.display="inline",this._photoCaption.style.transition="none",this._photoCaption.style.opacity="0";let t=this._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="1"},1)}_removeCaption(){let t=this._motion.matches?0:this.options.outDuration;this._photoCaption.style.transition=`opacity ${t}ms ease`,this._photoCaption.style.opacity="0"}_addOverlay(){this._overlay=document.createElement("div"),this._overlay.id="lightbox-overlay",this._overlay.addEventListener("click",i=>{i.stopPropagation(),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._motion.matches?0:this.options.inDuration;this._schedule(()=>{this._overlay.style.transition=`opacity ${e}ms ease`,this._overlay.style.opacity="1"},1)}_removeOverlay(){let t=this._motion.matches?0:this.options.outDuration;this._overlay.style.transition=`opacity ${t}ms ease`,this._overlay.style.opacity="0"}};R._overflow=new WeakMap;var mt=R;var Jt=d=>`a[href="#${d}"]`,Je={scrollOffset:200,activeClass:"active",getActiveElement:Jt,keepTopElementActive:!1},M=class M extends b{constructor(t,e){super(t,e,M);this._ratio=0;this._link=null;this.el.Expressive_ScrollSpy=this,this.options={...M.defaults,...e},this._offset=this.el.style.getPropertyValue("--md-comp-scrollspy-offset"),this._offsetPriority=this.el.style.getPropertyPriority("--md-comp-scrollspy-offset"),this.el.style.setProperty("--md-comp-scrollspy-offset",`${this.options.scrollOffset}px`),M._elements.push(this),typeof IntersectionObserver<"u"&&(this._observer=new IntersectionObserver(i=>{if(M.getInstance(this.el)===this){for(let s of i)this._ratio=s.isIntersecting?s.intersectionRatio:0;M._syncActive(this.options.getActiveElement)}},{rootMargin:`-${this.options.scrollOffset}px 0px -45% 0px`,threshold:[0,.1,.25,.5,.75,1]}),this._observer.observe(this.el))}static get defaults(){return Je}static init(t,e={}){return super.init(t,e,M)}static getInstance(t){return t.Expressive_ScrollSpy}destroy(){let t=M._elements.indexOf(this);if(t<0)return;M._elements.splice(t,1),this._observer?.disconnect();let e=this.options.getActiveElement;M._active.get(e)===this&&M._clearActive(e),this.el.style.setProperty("--md-comp-scrollspy-offset",this._offset,this._offsetPriority),this.el.Expressive_ScrollSpy=void 0,M._syncActive(e)}static _syncActive(t){let e=M._elements.filter(a=>a.options.getActiveElement===t),i=null,s=0;for(let a of e){let h=a._ratio;h>s&&(s=h,i=a)}if(!i){let a=e.filter(h=>h.options.keepTopElementActive);i=M._nearestAbove(a)??a[0]}let o=i?M._linkFor(i.el.id,i.options):null,r=M._active.get(t);r===i&&r?._link===o||(M._clearActive(t),o&&(o.classList.add(i.options.activeClass),o.setAttribute("aria-current","true"),i._link=o,M._active.set(t,i)))}static _nearestAbove(t){let e=null,i=-1/0;for(let s of t){let o=s.el.getBoundingClientRect().top;o<=0&&o>=i&&(i=o,e=s)}return e}static _clearActive(t){let e=M._active.get(t);e&&(e._link?.classList.remove(e.options.activeClass),e._link?.removeAttribute("aria-current"),e._link=null,M._active.delete(t))}static _linkFor(t,e){if(!t)return null;if(e.getActiveElement!==Jt)try{return document.querySelector(e.getActiveElement(t))}catch{return null}let i=`#${t}`,s=document.querySelectorAll('a[href^="#"]');for(let o=0;o<s.length;o++)if(s[o].getAttribute("href")===i)return s[o];return null}};M._elements=[],M._active=new Map;var ft=M;var ti={onOpenStart:null,onOpenEnd:null,onCloseStart:null,onCloseEnd:null},ei="(width < 600px)",vt=class d extends b{constructor(t,e){super(t,e,d);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=>{if(!(t.key!=="Escape"||t.defaultPrevented)&&this.isExpanded&&this._isModal()){let e=this.el.getRootNode(),i=this.el.contains(e.activeElement),s=e.activeElement;for(;s?.shadowRoot?.activeElement;)s=s.shadowRoot.activeElement;this.collapse();let o=e.activeElement;for(;o?.shadowRoot?.activeElement;)o=o.shadowRoot.activeElement;!this.isExpanded&&i&&o===s&&this._toggle?.focus()}};this.el.Expressive_NavigationRail=this,this.options={...d.defaults,...e},this._toggle=this._findToggle(),this._mql=window.matchMedia(ei),this.isExpanded=this.el.classList.contains("expanded"),this._sync(),this.el.addEventListener("click",this._onClick),document.addEventListener("keydown",this._onKeyDown)}static get defaults(){return ti}static init(t,e={}){return super.init(t,e,d)}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 ii={duration:300,onShow:null,swipeable:!1,responsiveThreshold:1/0},gt=class d extends b{constructor(t,e){var i;super(t,e,d);this._originalPanels=new Map;this._originalLinks=new Map;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;if(this.options.swipeable){let h=i.hash&&document.getElementById(i.hash.slice(1)),l=this._tabsCarousel.images.indexOf(h);l>=0&&this._tabsCarousel.set(l),t.preventDefault();return}let r=this._content;this._tabLinks=this._queryTabLinks();let a=this._index;this._setActiveTabLink(i),this._content&&(this._content.style.display="block",this._content.classList.add("active"),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content),r&&r!==this._content&&(r.style.display="none",r.classList.remove("active"))),this._setTabsAndTabWidth(),this._animateIndicator(a),t.preventDefault()};this.el.Expressive_Tabs=this,this.options={...d.defaults,...e},this._tabLinks=this._queryTabLinks(),this._tabLinks.forEach(s=>{if(this._originalLinks.set(s,{active:s.classList.contains("active"),current:s.getAttribute("aria-current")}),s.hasAttribute("target"))return;let o=s.hash&&document.getElementById(s.hash.slice(1));o&&this._originalPanels.set(o,{display:o.style.display,priority:o.style.getPropertyPriority("display"),active:o.classList.contains("active"),carousel:o.classList.contains("carousel-item")})}),(i=this.options).swipeable&&(i.swipeable=window.innerWidth<=this.options.responsiveThreshold),this._index=0,this._setupActiveTabLink(),this.options.swipeable?this._setupSwipeableTabs():this._setupNormalTabs(),this._setTabsAndTabWidth(),this._createIndicator(),this._setupEventHandlers()}static get defaults(){return ii}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tabs}destroy(){this._removeEventHandlers(),this._indicator.remove(),this.options.swipeable&&this._teardownSwipeableTabs(),this._originalPanels.forEach((t,e)=>{e.style.setProperty("display",t.display,t.priority),e.classList.toggle("active",t.active),e.classList.toggle("carousel-item",t.carousel),e.className||e.removeAttribute("class")}),this._originalLinks.forEach((t,e)=>{e.classList.toggle("active",t.active),t.current===null?e.removeAttribute("aria-current"):e.setAttribute("aria-current",t.current)}),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"),this._index=Array.from(this._tabLinks).indexOf(t),this._content=t.hasAttribute("target")?null:document.getElementById(t.hash.slice(1))}_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._originalPanels.forEach((t,e)=>e.classList.toggle("active",e===this._content))}_setupSwipeableTabs(){let t=[];this._tabLinks.forEach(i=>{if(i.hash&&!i.hasAttribute("target")){let s=document.getElementById(i.hash.slice(1));if(!s)return;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=>{let s=document.createComment("");i.before(s),this._originalPanels.get(i).marker=s,e.appendChild(i),i.style.display=""}),this._tabsCarousel=K.init(e,{fullWidth:!0,noWrap:!0,duration:this.options.duration,onCycleTo:i=>{let s=this._index;this._setActiveTabLink(Array.from(this._tabLinks).find(o=>!o.hasAttribute("target")&&o.hash==="#"+i.id)),this._setTabsAndTabWidth(),this._animateIndicator(s),typeof this.options.onShow=="function"&&this.options.onShow.call(this,this._content)}})}_teardownSwipeableTabs(){let t=this._tabsCarousel.el;this._tabsCarousel.destroy(),this._originalPanels.forEach((e,i)=>e.marker?.replaceWith(i)),t.remove()}_setupNormalTabs(){Array.from(this._tabLinks).forEach(t=>{if(!(t===this._activeTabLink||t.hasAttribute("target"))&&t.hash){let e=document.getElementById(t.hash.slice(1));e&&(e.style.display="none")}})}_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 ve={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",hours:"Hours",minutes:"Minutes"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},L=class L extends _{constructor(t,e){super(t,e,L);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this))};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._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=t=>{let e=t.target,i=e===this.inputHours;if(!i&&e!==this.inputMinutes)return;let s=Number(e.value),n=i&&this.options.twelveHour?1:0,a=i?this.options.twelveHour?12:23:59;!e.value.trim()||!Number.isInteger(s)||s<n||s>a||(this[i?"hours":"minutes"]=s,this.drawClockFromTimeInput(s,i))};this.done=(t=null)=>{let e=this.el.value,i=t?"":L._addLeadingZero(this.hours)+":"+L._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={...L.defaults,...e,i18n:{...L.defaults.i18n,...e?.i18n}},this.id=u.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=j.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return ve}static init(t,e={}){return super.init(t,e,L)}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("input",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.digitalClock.removeEventListener("input",this._inputFromTextField),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=L._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.inputHours.setAttribute("aria-label",this.options.i18n.hours),this.inputMinutes.setAttribute("aria-label",this.options.i18n.minutes),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){u.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||u.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("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),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=L._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let n=L._createSVGEl("g");n.setAttribute("transform","translate("+t+","+t+")");let a=L._createSVGEl("circle");a.setAttribute("class","timepicker-canvas-bearing"),a.setAttribute("cx","0"),a.setAttribute("cy","0"),a.setAttribute("r","4");let c=L._createSVGEl("line");c.setAttribute("x1","0"),c.setAttribute("y1","0");let h=L._createSVGEl("circle");h.setAttribute("class","timepicker-canvas-bg"),h.setAttribute("r",e.toString()),n.appendChild(c),n.appendChild(h),n.appendChild(a),s.appendChild(n),this._canvas.appendChild(s),this.hand=c,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=L._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),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||"")+"").trim().toUpperCase().split(":"),e=t[1]?.match(/AM|PM/)?.[0];if(t[1]=t[1]?.replace(/AM|PM/,""),t[0]==="NOW"){let i=new Date(+new Date+this.options.fromNow);t=[i.getHours().toString(),i.getMinutes().toString()]}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.options.twelveHour&&(this.amOrPm=e==="AM"||e==="PM"?e:this.hours>=12?"PM":"AM",this.hours=this.hours%12||12),this.inputHours.value=L._addLeadingZero(this.hours),this.inputMinutes.value=L._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,c=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,h=Math.sin(a)*c,l=-Math.cos(a)*c;t?(this._canvas?.classList.add("timepicker-canvas-out"),setTimeout(()=>{this._canvas?.classList.remove("timepicker-canvas-out"),this.setHand(h,l)},t)):this.setHand(h,l)}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),c=s&&a<(this.options.outerRadius+this.options.innerRadius)/2,h=Math.atan2(t,-e),l=c?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(l=this.options.outerRadius),h<0&&(h=Math.PI*2+h);let r=Math.round(h/n);h=r*n,this.options.twelveHour?s?r===0&&(r=12):(i&&(r*=5),r===60&&(r=0)):s?(r===12&&(r=0),r=c?r===0?12:r:r===0?0:r+12):(i&&(r*=5),r===60&&(r=0)),this[this.currentView]!==r&&this.canVibrate&&this.options.vibrate&&(this.vibrateTimer||(navigator.vibrate(10),this.vibrateTimer=setTimeout(()=>{this.vibrateTimer=null},100))),this[this.currentView]=r,s?this.inputHours.value=L._addLeadingZero(r):this.inputMinutes.value=L._addLeadingZero(r),this.setClockAttributes(h,l)}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=L._addLeadingZero(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=L._addLeadingZero(this.minutes)}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}};L._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 si={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",hours:"Hours",minutes:"Minutes"},twelveHour:!0,vibrate:!0,onSelect:null,onInputInteraction:null,onDone:null,onCancel:null,displayPlugin:null,displayPluginOptions:null},C=class C extends b{constructor(t,e){super(t,e,C);this._dragPointerId=null;this._clockBuilt=!1;this._handleInputClick=()=>{this._updateTimeFromInput(),this._ensureClockBuilt(),this.displayPlugin&&this.displayPlugin.show(),this.inputHours.focus(),typeof this.options.onInputInteraction=="function"&&this.options.onInputInteraction.call(this)};this._handleInputKeydown=t=>{t.key===u.keys.ENTER&&(t.preventDefault(),this._handleInputClick())};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)):(clearTimeout(this._autoSubmitTimer),this._autoSubmitTimer=setTimeout(()=>{this._autoSubmitTimer=null,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._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,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=t=>{let e=t.target,i=e===this.inputHours;if(!i&&e!==this.inputMinutes)return;this._cancelClockReset();let s=Number(e.value),o=i&&this.options.twelveHour?1:0,r=i?this.options.twelveHour?12:23:59;!e.value.trim()||!Number.isInteger(s)||s<o||s>r||(this[i?"hours":"minutes"]=s,this.drawClockFromTimeInput(s,i))};this.done=(t=null)=>{let e=this.el.value,i=t?"":C._addLeadingZero(this.hours)+":"+C._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={...C.defaults,...e,i18n:{...C.defaults.i18n,...e?.i18n}},this.id=u.guid(),this._insertHTMLIntoDOM(),this._setupVariables(),this._setupEventHandlers(),this._pickerSetup(),this.options.displayPlugin&&this.options.displayPlugin==="docked"&&(this.displayPlugin=dt.init(this.el,this.containerEl,this.options.displayPluginOptions))}static get defaults(){return si}static init(t,e={}){return super.init(t,e,C)}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(){clearTimeout(this._autoSubmitTimer),clearTimeout(this.toggleViewTimer),clearTimeout(this.vibrateTimer),this._cancelClockReset(),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("input",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.digitalClock.removeEventListener("input",this._inputFromTextField),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=C._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.inputHours.setAttribute("aria-label",this.options.i18n.hours),this.inputMinutes.setAttribute("aria-label",this.options.i18n.minutes),this.spanAmPm=this.containerEl.querySelector(".timepicker-span-am-pm"),this.footer=this.containerEl.querySelector(".timepicker-footer"),this.amOrPm="PM"}_pickerSetup(){u.createButton(this.footer,this.options.i18n.clear,["timepicker-clear"],this.options.showClearBtn,this.clear),this.options.autoSubmit||u.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("button"),this._amBtn.type="button",this._amBtn.classList.add("am-btn"),this._amBtn.innerText="AM",this._amBtn.addEventListener("click",this._handleAmPmClick),this.spanAmPm.appendChild(this._amBtn),this._pmBtn=document.createElement("button"),this._pmBtn.type="button",this._pmBtn.classList.add("pm-btn"),this._pmBtn.innerText="PM",this._pmBtn.addEventListener("click",this._handleAmPmClick),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=C._createSVGEl("svg");s.setAttribute("class","timepicker-svg"),s.setAttribute("width",i.toString()),s.setAttribute("height",i.toString());let o=C._createSVGEl("g");o.setAttribute("transform","translate("+t+","+t+")");let r=C._createSVGEl("circle");r.setAttribute("class","timepicker-canvas-bearing"),r.setAttribute("cx","0"),r.setAttribute("cy","0"),r.setAttribute("r","4");let a=C._createSVGEl("line");a.setAttribute("x1","0"),a.setAttribute("y1","0");let h=C._createSVGEl("circle");h.setAttribute("class","timepicker-canvas-bg"),h.setAttribute("r",e.toString()),o.appendChild(a),o.appendChild(h),o.appendChild(r),s.appendChild(o),this._canvas.appendChild(s),this.hand=a,this.bg=h,this.bearing=r,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=C._addLeadingZero(e),this.minutesView.appendChild(i)}}_updateAmPmView(){!this._amBtn||!this._pmBtn||(this._amBtn.setAttribute("aria-pressed",String(this.amOrPm==="AM")),this._pmBtn.setAttribute("aria-pressed",String(this.amOrPm==="PM")),this._amBtn.classList.toggle("outlined",this.amOrPm!=="AM"),this._pmBtn.classList.toggle("outlined",this.amOrPm!=="PM"),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(){this._cancelClockReset();let t=((this.el.value||this.options.defaultTime||"")+"").trim().toUpperCase().split(":"),e=t[1]?.match(/AM|PM/)?.[0];if(t[1]=t[1]?.replace(/AM|PM/,""),t[0]==="NOW"){let i=new Date(+new Date+this.options.fromNow);t=[i.getHours().toString(),i.getMinutes().toString()]}this.hours=+t[0]||0,this.minutes=+t[1]||0,this.options.twelveHour&&(this.amOrPm=e==="AM"||e==="PM"?e:this.hours>=12?"PM":"AM",this.hours=this.hours%12||12),this.inputHours.value=C._addLeadingZero(this.hours),this.inputMinutes.value=C._addLeadingZero(this.minutes),this._updateAmPmView()}_cancelClockReset(){clearTimeout(this._clockResetTimer),this._clockResetTimer=null,this._canvas?.classList.remove("timepicker-canvas-out")}resetClock(t){this._cancelClockReset();let e=this.currentView,i=this[e],s=e==="hours",o=Math.PI/(s?6:30),r=i*o,a=s&&i>0&&i<13?this.options.innerRadius:this.options.outerRadius,h=Math.sin(r)*a,l=-Math.cos(r)*a;t?(this._canvas?.classList.add("timepicker-canvas-out"),this._clockResetTimer=setTimeout(()=>{this.setHand(h,l)},t)):this.setHand(h,l)}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){this._cancelClockReset();let s=this.currentView==="hours",o=Math.PI/(s||i?6:30),r=Math.sqrt(t*t+e*e),a=s&&r<(this.options.outerRadius+this.options.innerRadius)/2,h=Math.atan2(t,-e),l=a?this.options.innerRadius:this.options.outerRadius;this.options.twelveHour&&(l=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=a?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=C._addLeadingZero(c):this.inputMinutes.value=C._addLeadingZero(c),this.setClockAttributes(h,l)}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,r=-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",r.toString())}formatHours(){this.inputHours.value==""&&this.setHoursDefault(),this.inputHours.value=C._addLeadingZero(this.hours)}formatMinutes(){this.inputMinutes.value==""&&(this.minutes=new Date().getMinutes()),this.inputMinutes.value=C._addLeadingZero(this.minutes)}setHoursDefault(){this.hours=new Date().getHours(),this.options.twelveHour&&(this.hours=this.hours%12||12),this.inputHours.value=this.hours.toString()}};C._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,10 +53,10 @@ var Expressive=(()=>{var dt=Object.defineProperty;var Wt=Object.getOwnPropertyDe
|
|
|
53
53
|
</div>
|
|
54
54
|
<div class="timepicker-footer"></div>
|
|
55
55
|
</div>
|
|
56
|
-
</div>`;var
|
|
56
|
+
</div>`;var _t=C;var ni={text:"",action:"",onAction:null,dismissible:!1,displayLength:4e3,inDuration:300,outDuration:375,classes:"",completeCallback:null,activationPercent:.8,root:null},y=class y{constructor(n={}){this._dismissed=!1;this._returnFocus=null;this._restoreElement=null;for(this.options={...y.defaults,...n},n.displayLength===void 0&&this.options.action&&(this.options.displayLength=1/0),n.dismissible===void 0&&this.options.action&&(this.options.dismissible=!0),this.message=this.options.text,this.panning=!1,this.timeRemaining=this.options.displayLength;y._snackbars.length>0;){let i=y._snackbars.shift();i._dismissed=!0,i._restoreFocus(!0)}let t=document.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;this._returnFocus=t instanceof HTMLElement?t:null,this.el=this._createSnackbar();let e=u.portalRoot(this.options.root??document.body);(!y._container||!y._container.isConnected||y._container.parentNode!==e)&&(y._container&&y._removeContainer(),y._createContainer(e)),y._container.appendChild(this.el),this.el.Expressive_Snackbar=this,y._snackbars.push(this),this._animateIn(),this._setTimer()}static get defaults(){return ni}static getInstance(n){return n.Expressive_Snackbar}static _createContainer(n=document.body){let t=document.createElement("div");t.setAttribute("id","snackbar-container"),t.addEventListener("pointerdown",y._onDragStart),document.addEventListener("pointermove",y._onDragMove),document.addEventListener("pointerup",y._onDragEnd),document.addEventListener("pointercancel",y._onDragCancel),n.appendChild(t),y._container=t}static _removeContainer(){document.removeEventListener("pointermove",y._onDragMove),document.removeEventListener("pointerup",y._onDragEnd),document.removeEventListener("pointercancel",y._onDragCancel),y._container.remove(),y._container=null}static _onDragStart(n){if(!n.isPrimary||n.pointerType==="mouse"&&n.button!==0)return;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(),y._draggedSnackbar=i,i.el.classList.add("panning"),i.el.style.transition="",y._dragPointerId=n.pointerId,i.startingXPos=n.clientX,i.velocityX=0,i.time=Date.now(),i.xPos=n.clientX}}static _onDragMove(n){if(y._dragPointerId===n.pointerId&&y._draggedSnackbar){n.preventDefault();let t=y._draggedSnackbar;t.deltaX=Math.abs(t.xPos-n.clientX),t.xPos=n.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(n){if(y._dragPointerId===n.pointerId&&(y._dragPointerId=null,y._draggedSnackbar)){let t=y._draggedSnackbar;t.panning=!1,t.el.classList.remove("panning");let e=t.xPos-t.startingXPos,i=t.el.offsetWidth*t.options.activationPercent,s=Date.now()-t.time<100?t.velocityX:0;Math.abs(e)>i||s>1?(t.wasSwiped=!0,t.dismiss()):(t.el.style.transition="transform .2s, opacity .2s",t.el.style.transform="",t.el.style.opacity="",t._resumeTimer()),y._draggedSnackbar=null}}static _onDragCancel(n){if(y._dragPointerId!==n.pointerId)return;y._dragPointerId=null;let t=y._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(),y._draggedSnackbar=null)}static dismissAll(){for(let n of[...y._snackbars])n.dismiss()}_createSnackbar(){let n=this.options.snackbarId?u.getElementById(this.options.root??document.body,this.options.snackbarId):document.createElement("div");if(n instanceof HTMLTemplateElement)n=n.content.cloneNode(!0).firstElementChild;else if(n&&this.options.snackbarId){let e=document.createComment("");n.before(e);let i=[...n.childNodes],s=["class","style","role","aria-live","aria-atomic","inert"].map(o=>[o,n.getAttribute(o)]);this._restoreElement=()=>{n.replaceChildren(...i);for(let[o,r]of s)r===null?n.removeAttribute(o):n.setAttribute(o,r);e.replaceWith(n)}}if(!n)throw new Error("Snackbar body not found");this._events=new(n.ownerDocument.defaultView??window).AbortController;let t={signal:this._events.signal};if(n.classList.add("snackbar"),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.inert=!1,n.addEventListener("focusin",e=>{e.relatedTarget instanceof HTMLElement&&!n.contains(e.relatedTarget)&&(this._returnFocus=e.relatedTarget),this._pauseTimer()},t),n.addEventListener("keydown",e=>{e.key!=="Escape"||e.defaultPrevented||this._dismissed||(e.preventDefault(),e.stopPropagation(),this.dismiss())},t),n.addEventListener("focusout",()=>{clearTimeout(this._focusTimer),this._focusTimer=setTimeout(()=>this._resumeTimer(),0)},t),n.addEventListener("pointerenter",()=>this._pauseTimer(),t),n.addEventListener("pointerleave",()=>this._resumeTimer(),t),this.options.classes.length>0&&n.classList.add(...this.options.classes.split(" ").filter(Boolean)),this.message){let e=document.createElement("p");e.textContent=this.message,n.replaceChildren(e)}if(this.options.action){let e=document.createElement("button");e.type="button",e.textContent=this.options.action,e.addEventListener("click",i=>{if(i.stopPropagation(),!this._dismissed)try{typeof this.options.onAction=="function"&&this.options.onAction()}finally{this.dismiss()}},t),n.appendChild(e)}if(this.options.dismissible){let e=document.createElement("button");e.type="button",e.className="circle",e.setAttribute("aria-label","Dismiss");let i=document.createElement("i");i.className="material-symbols",i.setAttribute("aria-hidden","true"),i.textContent="close",e.appendChild(i),e.addEventListener("click",s=>{s.stopPropagation(),this.dismiss()},t),n.appendChild(e)}return n}_remove(){if(this._events.signal.aborted)return;this._events.abort(),clearTimeout(this.counterTimeout),clearTimeout(this._transitionTimer),clearTimeout(this._dismissTimer),clearTimeout(this._focusTimer),this.counterTimeout=null,y._draggedSnackbar===this&&(y._draggedSnackbar=null,y._dragPointerId=null),this.el.Expressive_Snackbar=void 0,this._restoreElement?this._restoreElement():this.el.remove();let n=y._snackbars.indexOf(this);n>=0&&y._snackbars.splice(n,1),!y._snackbars.length&&y._container?.childElementCount===0&&y._removeContainer()}_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._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(){let
|
|
59
|
+
`,this._transitionTimer=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._dismissed||this.panning||this.el.matches(":hover, :focus-within")||this.counterTimeout!=null||this._setTimer()}_restoreFocus(n=!1){let t=this.el.getRootNode().activeElement,e=t&&this.el.contains(t)?this._returnFocus:null;this.el.inert=!0,n&&this._remove(),e?.isConnected&&e.focus({preventScroll:!0})}dismiss(){if(this._dismissed||(this._dismissed=!0,clearTimeout(this.counterTimeout),this.counterTimeout=null,this._restoreFocus(),this._events.signal.aborted))return;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=`
|
|
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(()=>{
|
|
61
|
+
opacity ${this.options.outDuration}ms ease`,clearTimeout(this._transitionTimer),this._transitionTimer=setTimeout(()=>{this.el.style.opacity="0",this.el.style.marginTop="-40px"},1),this._dismissTimer=setTimeout(()=>{this._remove(),typeof this.options.completeCallback=="function"&&this.options.completeCallback()},this.options.outDuration)}};y._dragPointerId=null,y._snackbars=[],y._container=null,y._draggedSnackbar=null;var St=y;var oi={exitDelay:200,enterDelay:0,text:"",margin:4,inDuration:250,outDuration:200,position:"bottom",transitionMovement:10,opacity:1},Et=class d extends b{constructor(t,e){super(t,e,d);this.open=(t=!0)=>{this.isOpen||(clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),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,clearTimeout(this._enterDelayTimeout),this._setExitDelayTimeout())};this._handleMouseEnter=()=>{this.isHovered=!0,this.open(!1)};this._handleMouseLeave=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isHovered=!1,this.isFocused||this.close())};this._handleKeydown=t=>{t.key!=="Escape"||!this.isOpen||(t.preventDefault(),t.stopPropagation(),this.close(),clearTimeout(this._exitDelayTimeout),this._animateOut())};this._handleFocus=t=>{t.target.matches(":focus-visible")&&(this.isFocused=!0,this.open(!1))};this._handleBlur=t=>{let e=t.relatedTarget;e&&(this.el.contains(e)||this.tooltipEl.contains(e))||(this.isFocused=!1,this.isHovered||this.close())};this.el.Expressive_Tooltip=this,this.options={...d.defaults,...this._getAttributeOptions(),...e},this.isOpen=!1,this.isHovered=!1,this.isFocused=!1,this._appendTooltipEl(),this._setupEventHandlers()}static get defaults(){return oi}static init(t,e={}){return super.init(t,e,d)}static getInstance(t){return t.Expressive_Tooltip}destroy(){clearTimeout(this._enterDelayTimeout),clearTimeout(this._exitDelayTimeout),clearTimeout(this._animationTimeout),this.isOpen=!1,this.isHovered=!1,this.isFocused=!1;let t=this.el.getAttribute("aria-describedby")?.split(/\s+/);if(t?.includes(this.tooltipEl.id)){let e=t.filter(i=>i&&i!==this.tooltipEl.id).join(" ");e?this.el.setAttribute("aria-describedby",e):this.el.removeAttribute("aria-describedby")}if(this._originalContent){let{el:e,marker:i,display:s,priority:o,hidden:r,contentClass:a}=this._originalContent;e.style.setProperty("display",s,o),r===null?e.removeAttribute("hidden"):e.setAttribute("hidden",r),e.classList.toggle("tooltip-content",a),e.className||e.removeAttribute("class"),i.replaceWith(e),this._originalContent=null}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-${u.guid()}`,this.tooltipEl.setAttribute("role","tooltip"),this.el.setAttribute("aria-describedby",[this.el.getAttribute("aria-describedby"),this.tooltipEl.id].filter(Boolean).join(" "));let t=this.options.tooltipId?u.getElementById(this.el,this.options.tooltipId):document.createElement("div");if(this.options.tooltipId){this.tooltipEl.classList.add("rich");let e=document.createComment("");t.before(e),this._originalContent={el:t,marker:e,display:t.style.display,priority:t.style.getPropertyPriority("display"),hidden:t.getAttribute("hidden"),contentClass:t.classList.contains("tooltip-content")},t.removeAttribute("hidden")}t.style.display="",t.classList.add("tooltip-content"),this._setTooltipContent(t),this.tooltipEl.appendChild(t),u.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(){for(let t of[this.el,this.tooltipEl])t.addEventListener("mouseenter",this._handleMouseEnter),t.addEventListener("mouseleave",this._handleMouseLeave),t.addEventListener("focus",this._handleFocus,!0),t.addEventListener("blur",this._handleBlur,!0);this.el.ownerDocument.addEventListener("keydown",this._handleKeydown,!0)}_removeEventHandlers(){for(let t of[this.el,this.tooltipEl])t.removeEventListener("mouseenter",this._handleMouseEnter),t.removeEventListener("mouseleave",this._handleMouseLeave),t.removeEventListener("focus",this._handleFocus,!0),t.removeEventListener("blur",this._handleBlur,!0);this.el.ownerDocument.removeEventListener("keydown",this._handleKeydown,!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,r=t.offsetWidth,a=this.options.margin;this.xMovement=0,this.yMovement=0;let h=e.getBoundingClientRect(),l=h.top+u.getDocumentScrollTop(),c=h.left+u.getDocumentScrollLeft();this.options.position==="top"?(l+=-o-a,c+=s/2-r/2,this.yMovement=-this.options.transitionMovement):this.options.position==="right"?(l+=i/2-o/2,c+=s+a,this.xMovement=this.options.transitionMovement):this.options.position==="left"?(l+=i/2-o/2,c+=-r-a,this.xMovement=-this.options.transitionMovement):(l+=i+a,c+=s/2-r/2,this.yMovement=this.options.transitionMovement);let m=this._repositionWithinScreen(c,l,r,o);t.style.setProperty("--md-comp-tooltip-anchor-gap",`${Math.max(0,a)+Math.abs(this.options.transitionMovement)}px`),t.style.top=m.y+"px",t.style.left=m.x+"px"}_repositionWithinScreen(t,e,i,s){return u._repositionWithinScreen(t,e,i,s,this.options.margin,this.options.transitionMovement,"center")}_animateIn(){this._animate(!0)}_animateOut(){this._animate(!1)}_animate(t){let e=this.tooltipEl.style,i=this.el.ownerDocument.defaultView.matchMedia("(prefers-reduced-motion: reduce)").matches,s=i?0:t?this.options.inDuration:this.options.outDuration;t&&(this._positionTooltip(),e.visibility="visible",e.overflow="visible"),e.transition=`transform ${s}ms ease-out, opacity ${s}ms ease-out`,clearTimeout(this._animationTimeout),this._animationTimeout=setTimeout(()=>{e.transform=t&&!i?`translateX(${this.xMovement}px) translateY(${this.yMovement}px)`:"none",e.opacity=t?(this.options.opacity||1).toString():"0",t||(this._animationTimeout=setTimeout(()=>{e.visibility="hidden",e.overflow=""},s))},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 te={AppBar:{component:tt,selector:"header.medium, header.large, header:has(> :is(nav:not(.tabs, .navigation-bar, .navigation-rail), .bar) > :is(.search-bar, .searchbar))"},Autocomplete:{component:F,selector:".autocomplete"},ButtonGroup:{component:it,selector:".button-group"},Cards:{component:V,selector:Rt,filter:Pt},ExpandingCard:{component:q,selector:Bt},Carousel:{component:K,selector:".carousel"},Chips:{component:z,selector:".chips"},ColumnChart:{component:N,selector:".column-chart"},BarChart:{component:ot,selector:".bar-chart"},PieChart:{component:rt,selector:".pie-chart"},HeatmapChart:{component:at,selector:".heatmap-chart"},RadarChart:{component:lt,selector:".radar-chart"},RadialChart:{component:ct,selector:".radial-chart"},MixedChart:{component:ht,selector:".mixed-chart"},CommandPalette:{component:st,selector:"dialog.command-palette"},Questionnaire:{component:nt,selector:"form.questionnaire"},Datepicker:{component:ut,selector:".datepicker, .date-picker"},LineChart:{component:S,selector:".line-chart"},Menu:{component:B,selector:".menu-trigger"},MessageScroller:{component:pt,selector:".message-scroller"},Lightbox:{component:mt,selector:".lightboxed"},ScrollSpy:{component:ft,selector:".scrollspy"},FormSelect:{component:O,selector:"select"},NavigationRail:{component:vt,selector:".navigation-rail"},Tabs:{component:gt,selector:".tabs"},Timepicker:{component:_t,selector:".timepicker, .time-picker"},Tooltip:{component:Et,selector:".tooltipped"},FloatingActionButton:{component:et,selector:".fab-menu"}};function ee(d=document.body,n){for(let t of Object.keys(te)){let{component:e,selector:i,filter:s}=te[t],o=d.querySelectorAll(`:is(${i}):not(.no-autoinit)`);s?o.forEach(r=>{s(r)&&e.init(r,n?.[t]??{})}):e.init(o,n?.[t]??{})}}var ai="0.13.1";J.Init();z.Init();Y.Init();V.Init();q.Init();X.Init();Q.Init();Z.Init();return ve(li);})();
|
|
62
62
|
//# sourceMappingURL=expressive.min.js.map
|