material-inspired-component-library 9.0.2 → 9.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -201,6 +201,9 @@ The library currently consists of the following components:
|
|
|
201
201
|
|
|
202
202
|
## Change Log ↪️
|
|
203
203
|
|
|
204
|
+
### 9.1.0 (05.09.2026)
|
|
205
|
+
- **Navigation rail**: Dropped the JavaScript.
|
|
206
|
+
|
|
204
207
|
### 9.0.0 (20.07.2026)
|
|
205
208
|
- **BREAKING**: Renamed all CSS custom properties from --md-sys- to --md-comp-.
|
|
206
209
|
- **BREAKING**: Renamed the layout class `micl-body` and its `micl-body--*` modifiers to `micl-panes`/`micl-panes--*`, aligning with the M3 Expressive layout terminology.
|
|
@@ -8,12 +8,12 @@ To create a simple navigation rail, use a `<nav>` element with the `micl-navigat
|
|
|
8
8
|
|
|
9
9
|
```HTML
|
|
10
10
|
<nav id="mynavigationrail" class="micl-navigationrail">
|
|
11
|
-
<div class="micl-navigationrail__content"
|
|
12
|
-
<a href="#" class="micl-navigationrail__item"
|
|
11
|
+
<div class="micl-navigationrail__content">
|
|
12
|
+
<a href="#" class="micl-navigationrail__item" aria-current="page">
|
|
13
13
|
<span class="micl-navigationrail__icon material-symbols-outlined" aria-hidden="true">inbox</span>
|
|
14
14
|
<span class="micl-navigationrail__text">Inbox</span>
|
|
15
15
|
</a>
|
|
16
|
-
<a href="#" class="micl-navigationrail__item"
|
|
16
|
+
<a href="#" class="micl-navigationrail__item">
|
|
17
17
|
<span class="micl-navigationrail__icon material-symbols-outlined" aria-hidden="true">outbox</span>
|
|
18
18
|
<span class="micl-navigationrail__text">Outbox</span>
|
|
19
19
|
</a>
|
|
@@ -35,11 +35,12 @@ Or import all MICL styles:
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
### JavaScript
|
|
38
|
-
|
|
38
|
+
No custom JavaScript is required for the core functionality of this component.
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
> [!NOTE]
|
|
41
|
+
> Opening and closing a modal navigation rail is handled natively by the `<dialog>` element and its invoker buttons, and the navigation items are ordinary links, activated with `Enter` like any other link.
|
|
42
|
+
>
|
|
43
|
+
> Marking the current destination is left to the application: give the item for the current page the `aria-current="page"` attribute.
|
|
43
44
|
|
|
44
45
|
### Live Demo
|
|
45
46
|
A live example of the [Navigation rail component](https://henkpb.github.io/micl/navigationrail.html) is available to interact with.
|
|
@@ -62,7 +63,7 @@ The basic example creates a **collapsed** navigation rail. Add a menu button to
|
|
|
62
63
|
aria-label="Toggle navigation rail"
|
|
63
64
|
></button>
|
|
64
65
|
</div>
|
|
65
|
-
<div class="micl-navigationrail__content"
|
|
66
|
+
<div class="micl-navigationrail__content">
|
|
66
67
|
...
|
|
67
68
|
</div>
|
|
68
69
|
</nav>
|
|
@@ -86,7 +87,7 @@ A **modal** navigation rail is hidden until the user clicks a menu button. When
|
|
|
86
87
|
autofocus
|
|
87
88
|
>menu_open</button>
|
|
88
89
|
</div>
|
|
89
|
-
<div class="micl-navigationrail__content"
|
|
90
|
+
<div class="micl-navigationrail__content">
|
|
90
91
|
...
|
|
91
92
|
</div>
|
|
92
93
|
</dialog>
|
package/dist/micl.d.ts
CHANGED
package/dist/micl.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var a=0;a<n.length;){var i=n[a++],r=n[a++];e.o(t,i)?0===r&&a++:0===r?Object.defineProperty(t,i,{enumerable:!0,value:n[a++]}):Object.defineProperty(t,i,{enumerable:!0,get:r})}else for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{default:()=>Fe});const n=globalThis.__miclRegistry??={map:{},rippled:new WeakSet,activated:!1},a=()=>Object.keys(n.map).join(","),i=e=>Object.entries(n.map).find(([t,{type:n}])=>e.matches(t)&&e instanceof n)?.[1],r=e=>{const t=i(e);t&&"function"==typeof t.component.initialize&&t.component.initialize(e)},l=e=>{const t=a();t&&e.querySelectorAll(t).forEach(r),e.querySelectorAll('[class*="micl-"], [class*="micl-"] > summary').forEach(e=>{n.rippled.has(e)||"1"===window.getComputedStyle(e).getPropertyValue("--micl-ripple")&&(e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;t.stopPropagation();const n=e.getBoundingClientRect();e.style.setProperty("--micl-x",(t.clientX-n.left)/n.width*100+"%"),e.style.setProperty("--micl-y",(t.clientY-n.top)/n.height*100+"%"),e.classList.remove("micl-rippling"),e.offsetWidth,e.classList.add("micl-rippling");const a=t=>{"micl-ripple"===t.animationName&&(e.classList.remove("micl-rippling"),e.style.removeProperty("--micl-x"),e.style.removeProperty("--micl-y"),e.removeEventListener("animationend",a))};e.addEventListener("animationend",a)}),n.rippled.add(e))}),document.documentElement.style.setProperty("--md-sys-scrollbar-thumb-color",window.getComputedStyle(document.body).getPropertyValue("--md-sys-color-outline").trim())},o=e=>{const t=i(e);t&&"function"==typeof t.component.cleanup&&t.component.cleanup(e)},s=e=>{const t=a();t&&e.querySelectorAll(t).forEach(o)},c=e=>{const t=a();if(!t)return;const n=e.target.closest(t);if(!(n instanceof HTMLElement))return;const r=i(n),l=e.type;r&&"function"==typeof r.component[l]&&r.component[l]?.(e)},d=()=>{n.activated||(n.activated=!0,new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{if(e instanceof HTMLElement){const t=a();t&&e.matches(t)&&r(e),t&&e.querySelectorAll(t).forEach(r)}}),e.removedNodes.forEach(e=>{if(e instanceof HTMLElement){const t=a();t&&e.matches(t)&&o(e),s(e)}}))})}).observe(document.body,{childList:!0,subtree:!0}),l(document),document.addEventListener("change",c),document.addEventListener("input",c),document.addEventListener("keydown",c))},m=(e,t,a)=>(n.map[e]={component:t,type:a},n.activated&&document.querySelectorAll(e).forEach(r),t),u=()=>{document.removeEventListener("DOMContentLoaded",u),d()};"loading"!==document.readyState?d():document.addEventListener("DOMContentLoaded",u);const p={initialize:()=>l(document),cleanup:()=>s(document)},h="dialog.micl-bottomsheet",g=e=>{let t=parseInt(e.dataset.miclfitheight||"0",10);t<1&&(t=e.getBoundingClientRect().height,e.dataset.miclfitheight=`${t}`);let n=parseInt(window.getComputedStyle(e).getPropertyValue("max-block-size"),10),a=(e.dataset.miclsnapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>=0&&e<=n);return[...new Set(a.concat([Math.min(t,n)]).sort((e,t)=>e-t))]},f=(e,t)=>{let n=e.getBoundingClientRect().height,a=g(e);return a.filter(e=>e>n+4)[0]||a[t?a.length-1:0]},y=(e,t)=>{t<1?(delete e.dataset.miclfitheight,e.style.removeProperty("--md-comp-bottomsheet-height"),e[e.popover?"hidePopover":"close"]()):e.style.setProperty("--md-comp-bottomsheet-height",`${t}px`)},v=(m(h,{initialize:e=>{if(!e.matches(h)||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=e.querySelector(".micl-bottomsheet__headline");if(!t)return;const n=t.querySelector(".micl-bottomsheet__draghandle");let a,i,r=!1,l=!1,o=!1;function s(t){const n=t.clientY;if(r&&Math.abs(a-n)>4&&(r=!1,l=!0,e.classList.add("micl-bottomsheet--resizing")),l){const t=Math.max(1,i+a-n),r=g(e).find(e=>e>0&&Math.abs(e-t)<=12);y(e,r||t)}}function c(t){r=!1,e.classList.remove("micl-bottomsheet--resizing"),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",c),l&&(l=!1,o=!0,t.clientY<a?y(e,f(e,!0)):e.getBoundingClientRect().height<48?y(e,0):y(e,(e=>{let t=e.getBoundingClientRect().height,n=g(e).filter(e=>e>0),a=n.filter(e=>e<t-4);return a[a.length-1]||n[0]})(e)))}n?.addEventListener("click",()=>{o||y(e,f(e,!1))}),t.addEventListener("pointerdown",l=>{l.target!==t&&l.target!==n||(r=!0,o=!1,l.preventDefault(),a=l.clientY,i=e.getBoundingClientRect().height,document.addEventListener("pointermove",s),document.addEventListener("pointerup",c))})},cleanup:e=>{e.matches(h)&&(e.classList.remove("micl-bottomsheet--resizing"),delete e.dataset.miclinitialized,delete e.dataset.miclfitheight)}},HTMLDialogElement),".micl-button--toggle"),E=e=>{const t=e.querySelector(".micl-button__icon")??e,n="true"===e.getAttribute("aria-pressed");t.dataset.micliconselected&&t.classList.toggle(t.dataset.micliconselected,n),t.dataset.miclicon&&t.classList.toggle(t.dataset.miclicon,!n)},L=(m(v,{command:e=>{const t=e.target;t.matches(v)&&!t.disabled&&"--micl-toggle"===e.command&&(t.classList.add("micl-button--toggled"),t.setAttribute("aria-pressed",String("true"!==t.getAttribute("aria-pressed"))),E(t))},initialize:function(e){e.matches(v)&&!e.dataset.miclinitialized&&(e.dataset.miclinitialized="1",E(e),e.addEventListener("command",this.command))},cleanup:function(e){e.matches(v)&&(e.removeEventListener("command",this.command),delete e.dataset.miclinitialized)}},HTMLButtonElement),".micl-checkbox-group"),b=e=>{const t=e.querySelector(".micl-checkbox__parent");return t?.closest(L)===e?t:null},w=e=>{const t=b(e);if(!t)return!1;let n=0,a=0;return e.querySelectorAll('input[type="checkbox"].micl-checkbox').forEach(i=>{if(i!==t){const t=i.closest(L);t===e?(n++,i.checked&&!i.indeterminate&&a++):i.classList.contains("micl-checkbox__parent")&&t?.parentElement?.closest(L)===e&&(n++,w(t)&&a++)}}),0===a?(t.checked=!1,t.indeterminate=!1):a===n?(t.checked=!0,t.indeterminate=!1):(t.checked=!0,t.indeterminate=!0),a===n},S=(e,t)=>{e.querySelectorAll('input[type="checkbox"].micl-checkbox').forEach(n=>{const a=n.closest(L);a===e?n.checked=t:n.classList.contains("micl-checkbox__parent")&&a?.parentElement?.closest(L)===e&&(n.checked=t,S(a,t))})},k=(e,t)=>{const n=b(e);if(!n)return;t===n&&S(e,t.checked);let a,i=e;do{a=i,i=i.parentElement?.closest(L)}while(i);w(a)},x=(m(L,{initialize:e=>{e.matches(L)&&!e.dataset.miclinitialized&&(e.dataset.miclinitialized="1",e.addEventListener("change",t=>{const n=t.target;n.classList.contains("micl-checkbox")&&(t.stopPropagation(),k(e,n))}),k(e,null))}},HTMLElement),"dialog.micl-dialog.micl-datepicker"),$="micl-datepicker__",D="micl-no-transition",T=new WeakMap,M=(new Intl.DateTimeFormat).resolvedOptions().locale,A={input:new Intl.DateTimeFormat(M,{year:"numeric",month:"2-digit",day:"2-digit"}),header:new Intl.DateTimeFormat(M,{weekday:"short",day:"numeric",month:"short"}),monthLong:new Intl.DateTimeFormat(void 0,{month:"long"}),monthShort:new Intl.DateTimeFormat(M,{month:"short"}),weekdayNarrow:new Intl.DateTimeFormat(M,{weekday:"narrow"}),weekdayLong:new Intl.DateTimeFormat(M,{weekday:"long"})},C=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},q=e=>{const t=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0");return`${e.getFullYear()}-${t}-${n}`},_=()=>A.input.formatToParts(new Date(2025,0,15)).map(e=>{switch(e.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";case"literal":return e.value;default:return""}}).join("").trim(),I=(()=>{try{const e=new Intl.Locale(M).getWeekInfo?.();if(e)return 7===e.firstDay?0:e.firstDay}catch{}return/US|CA|MX/i.test(M)?0:1})(),H=e=>!isNaN(e.getTime()),P=e=>"date"===e.type&&e.valueAsDate?e.valueAsDate:e.value?new Date(e.value):null,z=(e,t,n)=>{e.value=t,e instanceof HTMLInputElement?(e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0}))):e.textContent=n},N=(e,t)=>{if(e)if(e.firstElementChild){let n=e.firstChild;for(;n;){if(n.nodeType===Node.TEXT_NODE)return void(n.nodeValue=t);n=n.nextSibling}e.appendChild(document.createTextNode(t))}else e.textContent=t},F=(e,t)=>{const n=new Date(e,t,1).getDay(),a=new Date(e,t,1-(n-I+7)%7);return Array.from({length:42},(e,n)=>{const i=new Date(a);return i.setDate(a.getDate()+n),{date:i,val:q(i),isCurrentMonth:i.getMonth()===t}})},Y=(e,t,n,a=!1)=>{if(a){const n=(()=>{const e=new Date,t=e.getDay()-I;e.setDate(e.getDate()-t);const n=document.createDocumentFragment();for(let t=0;t<7;t++){const a=document.createElement("span");a.style.gridArea=`1 / ${t+1}`,a.textContent=A.weekdayNarrow.format(e),a.title=A.weekdayLong.format(e),n.appendChild(a),e.setDate(e.getDate()+1)}return n})();t.forEach((e,t)=>{const a=document.createElement("time"),i=Math.floor(t/7)+2,r=t%7+1;a.style.gridArea=`${i} / ${r}`,n.appendChild(a)}),e.appendChild(n)}const i=C(new Date),r=n.selected.getTime(),l=n.selectedEnd?.getTime();e.querySelectorAll("time").forEach((e,n)=>{const a=t[n];e.dateTime=a.val,e.textContent=a.date.getDate().toString();const o=a.date.getTime(),s=o===r||o===l,c=o===i.getTime();e.className="",a.isCurrentMonth||e.classList.add(`${$}outside`),s&&e.classList.add(`${$}selected`),c&&e.classList.add(`${$}today`),void 0!==l&&l!==r&&(o===r?e.classList.add(`${$}range-start`):o===l?e.classList.add(`${$}range-end`):o>r&&o<l&&e.classList.add(`${$}inrange`))})},O=(e,t,n=0)=>{const a=e.querySelector(".micl-dialog__content"),i=a?.querySelector(`.${$}calendars`);if(!i)return;const r="micl-startleft",l="micl-startright",o="micl-moveleft",s="micl-moveright";if(i.classList.remove(o,s,r,l),i.offsetWidth,0!==n){const e=i.querySelector(`.${$}calendar`);if(!e)return;const a=document.createElement("div"),c=document.createElement("div");a.className=`${$}calendar`,c.className=`${$}calendar-inner`;const d=F(t.viewDate.getFullYear(),t.viewDate.getMonth());Y(c,d,t,!0);const m=n>0,u=m?r:l,p=m?o:s;a.appendChild(c),m?i.appendChild(a):i.prepend(a),i.classList.add(D,u),i.offsetWidth,requestAnimationFrame(()=>{i.classList.remove(D,u),i.classList.add(p)});const h=()=>{i.removeEventListener("transitionend",h),setTimeout(()=>{i.classList.remove(p),e.parentElement===i&&e.remove(),i.classList.add(D,r),i.offsetWidth,i.classList.remove(D,r)},0)};i.addEventListener("transitionend",h)}else{let e=i.querySelector(`.${$}calendar`);e||(e=document.createElement("div"),e.className=`${$}calendar`,e=i.appendChild(e));let n=e.querySelector(`.${$}calendar-inner`);n||(n=document.createElement("div"),n.className=`${$}calendar-inner`,e.appendChild(n));const a=F(t.viewDate.getFullYear(),t.viewDate.getMonth());Y(n,a,t,0===n.querySelectorAll("time").length)}a?.querySelectorAll(`.${$}input input`).forEach((e,n)=>{const a=0===n?t.selected:t.selectedEnd;e.value=a?A.input.format(a):"",e.value?e.dataset.miclvalue="1":delete e.dataset.miclvalue,e.dataset.micldateformat||(e.dataset.micldateformat=_())}),N(e.querySelector("h1, h2, h3, h4, h5, h6, .micl-heading"),t.range?`${A.header.format(t.selected)} – ${t.selectedEnd?A.header.format(t.selectedEnd):""}`:A.header.format(t.selected)),N(e.querySelector(`.${$}month`),A.monthShort.format(t.viewDate)),N(e.querySelector(`.${$}year`),t.viewDate.toLocaleDateString(M,e.classList.contains("micl-dialog--docked")?{year:"numeric"}:{month:"long",year:"numeric"}));const c=e.querySelector(`.${$}months input[value="${t.viewDate.getMonth()}"]`);c&&(c.checked=!0);const d=e.querySelector(`.${$}years input[value="${t.viewDate.getFullYear()}"]`);d&&(d.checked=!0)},B=(e,t)=>{"months"!==t&&"years"!==t||e.querySelector(`.${$}${t}.${$}view-hidden`)||(t="calendars"),["calendars","input","month-selector","year-selector"].forEach(n=>{let a="input"===t;"calendars"!==n&&"input"!==n||(a=t!==n),e.querySelector(`.${$}${n}`)?.classList.toggle(`${$}view-hidden`,a)});const n=e.querySelector(".micl-dialog__content");if(!n)return;const a=parseInt(window.getComputedStyle(n).getPropertyValue("max-block-size"),10);["months","years"].forEach(e=>{const i=n.querySelector(`.${$}${e}`);if(!i)return;const r=i.querySelector("input:checked");let l=!1;if(r&&e===t){const e=window.getComputedStyle(i).getPropertyValue("transition-duration"),t=parseFloat(e)*(e.includes("ms")?1:1e3),o=i.scrollHeight-a,s=(a-48)/2;if(r.offsetTop>s){let e=r.offsetTop-s-24;e>o&&(e=o);const a=performance.now(),c=i=>{const r=Math.min((i-a)/t,1);n.scrollTop=e*r,r<1&&requestAnimationFrame(c)};i.classList.remove(`${$}view-hidden`),requestAnimationFrame(c),l=null,i.addEventListener("transitionend",function t(a){"height"!==a.propertyName&&"block-size"!==a.propertyName||(n.scrollTop=e,i.removeEventListener("transitionend",t))})}}else l=!0;null!==l&&i.classList.toggle(`${$}view-hidden`,l)})},V=(e,t,n)=>{const a=T.get(e);if(!a)return;const i=new Date(a.viewDate);"month"===n?i.setMonth(i.getMonth()+t):i.setFullYear(i.getFullYear()+t);const r=a.min&&i<a.min,l=a.max&&i>a.max;r||l?e.querySelector(`.${$}calendars`)?.animate([{transform:"translateX(0)"},{transform:`translateX(${r?8:-8}px)`},{transform:"translateX(0)"}],{duration:500,easing:"ease-in-out"}):(a.viewDate=i,O(e,a,"month"===n?t:0))},R=(m(x,{keydown:e=>{if(!(e instanceof KeyboardEvent&&e.target instanceof Element))return;const t=e.target.closest(x);if(t)switch(e.key){case"Enter":case" ":e.target instanceof HTMLInputElement&&"date"===e.target.type&&e.preventDefault();break;case"M":B(t,"months");break;case"Y":B(t,"years");break;case"PageUp":case"PageDown":V(t,"PageUp"===e.key?1:-1,e.shiftKey?"year":"month")}},initialize:e=>{if(e.dataset.miclinitialized)return;const t=e.querySelector("form"),n=e.querySelector(".micl-dialog__content");t&&n&&(e.dataset.miclinitialized="1",e.addEventListener("click",t=>{const n=t.target,a=n.closest("button");if(a){const t=a.parentElement?.classList.contains(`${$}month-selector`),n=a.classList.contains(`${$}next`),i=a.classList.contains(`${$}previous`);if(n||i)return void V(e,n?1:-1,t?"month":"year")}n.closest(`.${$}month`)&&B(e,"months"),n.closest(`.${$}year`)&&B(e,"years"),n.closest(`.${$}inputmode`)&&B(e,e.querySelector(`.${$}input.${$}view-hidden`)?"input":"calendars");const i=n.closest("time");if(i&&i.dateTime&&((e,t)=>{const n=T.get(e);if(!n)return;const a=t.split("-").map(Number);if(3===a.length){const t=new Date(a[0],a[1]-1,a[2]);n.range?n.selectedEnd||t<n.selected?(n.selected=t,n.selectedEnd=null):n.selectedEnd=t:n.selected=t,n.viewDate=new Date(t),O(e,n)}})(e,i.dateTime),n instanceof HTMLInputElement&&("miclmonth"===n.name||"miclyear"===n.name)){const t=T.get(e);if(t){const a=parseInt(n.value,10);"miclmonth"===n.name?t.viewDate.setMonth(a):t.viewDate.setFullYear(a),t.viewDate<t.min?t.viewDate=t.min:t.viewDate>t.max&&(t.viewDate=t.max),O(e,t),B(e,"calendars")}}}),e.addEventListener("focusout",t=>{const n=t.target;if(!(n instanceof HTMLInputElement&&n.closest(`.${$}input`)))return;const a=e.querySelectorAll(`.${$}input input`);((e,t,n)=>{const a=T.get(e);if(!a)return;const i=(e=>{const t=_();if(e.length!==t.length)return null;let n="",a="",i="";for(let r=0;r<t.length;r++)switch(t[r]){case"D":n+=e[r];break;case"M":a+=e[r];break;case"Y":i+=e[r]}const r=new Date(parseInt(i,10),parseInt(a,10)-1,parseInt(n,10));return H(r)?r:null})(n);i&&(a.range&&t>0?a.selectedEnd=i:a.selected=i,a.selectedEnd&&a.selectedEnd<a.selected&&([a.selected,a.selectedEnd]=[a.selectedEnd,a.selected]),a.viewDate=new Date(a.selected)),O(e,a)})(e,Array.prototype.indexOf.call(a,n),n.value)}),e.addEventListener("beforetoggle",t=>{if("open"!==t.newState)return;const n=e=>e instanceof HTMLInputElement||e instanceof HTMLButtonElement;let a=document.activeElement;if((!n(a)||a.dataset.datepicker!==e.id&&a.popoverTargetElement!==e&&a.commandForElement!==e)&&(a=document.querySelector(`[data-datepicker="${e.id}"],[popovertarget="${e.id}"],[commandfor="${e.id}"]`)),!n(a))return;const i=e.classList.contains("micl-datepicker--range");let r=a,l=null;if(i&&a instanceof HTMLInputElement)if(a.dataset.miclrangeto){const e=document.getElementById(a.dataset.miclrangeto);l=e instanceof HTMLInputElement?e:null}else if(a.id){const e=document.querySelector(`input[data-miclrangeto="${a.id}"]`);e&&(l=a,r=e)}let o=new Date,s=null,c=new Date(1900,0,1),d=new Date(2099,11,31);if(r instanceof HTMLInputElement)o=P(r)||o,r.min&&(c=new Date(r.min)),r.max&&(d=new Date(r.max));else{const[e,t]=(r.value||r.textContent||"").split("/"),n=new Date(e);H(n)&&(o=n),i&&t&&(s=new Date(t))}l&&(s=P(l),l.max&&(d=new Date(l.max))),H(o)||(o=new Date),o=C(o),s&&H(s)?(s=C(s),s<o&&([o,s]=[s,o])):s=null;const m={invoker:r,invokerEnd:l,selected:o,selectedEnd:i?s:null,range:i,viewDate:new Date(o),min:c,max:d};T.set(e,m),((e,t,n)=>{const a=t.getFullYear(),i=n.getFullYear();["months","years"].forEach(r=>{const l=e.querySelector(`.${$}${r}`);if(!l)return;l.innerHTML="";const o=document.createDocumentFragment(),s=n.getMonth();if("months"===r){const e=[];let a=new Date(t.getFullYear(),t.getMonth(),1);for(;a<=n||a.getMonth()===s&&a.getFullYear()===i;)e.push(a.getMonth()),a.setMonth(a.getMonth()+1);[...new Set(e.sort((e,t)=>e-t))].forEach(e=>{const t=document.createElement("label");t.innerHTML=`<span class="material-symbols-outlined">check</span><input type="radio" name="miclmonth" value="${e}"> ${A.monthLong.format(new Date(2e3,e,1))}`,o.appendChild(t)})}else for(let e=a;e<=i;e++){const t=document.createElement("label");t.innerHTML=`<input type="radio" name="miclyear" value="${e}"> ${e}`,o.appendChild(t)}const c=document.createElement("div");c.className=`${$}${r}-inner`,l.appendChild(c).appendChild(o)})})(e,c,d),B(e,"calendars"),O(e,m)}),e.addEventListener("close",()=>{const t=T.get(e);if(!t?.invoker||""===e.returnValue)return;const n=t.selectedEnd||t.selected;t.range&&!t.invokerEnd?z(t.invoker,`${q(t.selected)}/${q(n)}`,`${t.selected.toLocaleDateString()} – ${n.toLocaleDateString()}`):(z(t.invoker,q(t.selected),t.selected.toLocaleDateString()),t.invokerEnd&&z(t.invokerEnd,q(n),n.toLocaleDateString()))}))}},HTMLDialogElement),e=>e?.matches(":has(input[type=checkbox]:checked)")),j=(m(".micl-list",{keydown(e){const t=e.target;if(!(e instanceof KeyboardEvent&&t?.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const n=t.parentElement;if(!n)return;const a=n instanceof HTMLDetailsElement;let i=[];if(a?i=Array.from(n.parentElement?.children||[]).map(e=>e.querySelector(":scope > summary")).filter(Boolean):["UL","OL"].includes(n.tagName)&&(i=Array.from(n.children).filter(e=>e instanceof HTMLLIElement&&"separator"!==e.getAttribute("role"))),i=i.filter(e=>!(e=>e?.classList.contains("micl-list-item--disabled"))(e)),!i.length)return;const r=i.indexOf(t);if(-1===r)return;let l=r;switch(e.key){case"ArrowDown":e.preventDefault(),l=(r+1)%i.length;break;case"ArrowUp":e.preventDefault(),l=(r-1+i.length)%i.length;break;case"Tab":if(!a){const e=i.findIndex(R);l=-1===e?0:e}break;case" ":case"Enter":if(a)break;" "===e.key&&e.preventDefault();const n=t.querySelector("input[type=checkbox], a[href], button");n instanceof HTMLInputElement?(n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))):n?.click()}l!==r&&(a||(t.setAttribute("tabindex","-1"),i[l].setAttribute("tabindex","0")),i[l].focus())},initialize(e){e.dataset.miclinitialized||(e.dataset.miclinitialized="1",e.querySelectorAll(":scope > details > summary.micl-list-item--disabled").forEach(e=>e.setAttribute("tabindex","-1")),e.querySelector('li[tabindex="0"]')&&e.querySelectorAll('li:not([role="separator"])').forEach(e=>{"0"!==e.getAttribute("tabindex")&&e.setAttribute("tabindex","-1"),e.querySelectorAll("a, button, input").forEach(e=>e.setAttribute("tabindex","-1")),(e=>e?.matches(":has(input[type=checkbox])"))(e)&&(e.setAttribute("role","option"),e.parentElement?.setAttribute("role","listbox"))}))}},HTMLElement),e=>Array.from(e.children).filter(e=>e instanceof HTMLLIElement&&"separator"!==e.getAttribute("role")&&!e.classList.contains("micl-list-item--disabled")&&e.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three"))),U=(m(".micl-menu[popover]",{initialize:e=>{if(!e.matches(".micl-menu[popover]")||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=document.querySelector(`[popovertarget="${e.id}"]`);t&&e.addEventListener("beforetoggle",n=>{if("open"!==n.newState)return;const a=n.source||t;requestAnimationFrame(()=>{e.matches(":popover-open")&&(e.style.transformOrigin=((e,t)=>{const n=e.getBoundingClientRect(),a=t.getBoundingClientRect();return(n.x+n.width/2>a.x+a.width/2?"right ":"left ")+(n.y+n.height/2>a.y+a.height/2?"bottom":"top")})(a,e))})}),e.addEventListener("keydown",t=>{if("ArrowDown"!==t.key&&"ArrowUp"!==t.key)return;const n=t.target;if(!(n instanceof HTMLElement&&n.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const a=n.parentElement;if(!a?.matches("ul.micl-list"))return;if(a.parentElement!==e)return;const i=Array.from(e.querySelectorAll(":scope > ul.micl-list"));if(i.length<2)return;const r=i.indexOf(a),l=j(a),o=l.indexOf(n);if(-1===o)return;let s;if("ArrowDown"===t.key&&o===l.length-1){const e=(r+1)%i.length;s=j(i[e])[0]}else if("ArrowUp"===t.key&&0===o){const e=(r-1+i.length)%i.length,t=j(i[e]);s=t[t.length-1]}s&&(t.preventDefault(),t.stopPropagation(),n.setAttribute("tabindex","-1"),s.setAttribute("tabindex","0"),s.focus())},!0),e.querySelectorAll(":scope > ul.micl-list > li > button[popovertarget]").forEach(e=>{if(e.popoverTargetElement?.matches(".micl-menu[popover]")){const t=e.popoverTargetElement,n=`--${t.id}`;let a;e.style.setProperty("anchor-name",n),t.style.insetBlockStart=`anchor(${n} start)`,t.style.insetInlineStart=`anchor(${n} end)`;const i=()=>{clearTimeout(a),a=setTimeout(()=>{e.matches(":hover")||t.matches(":hover")||t.hidePopover()},300)};e.addEventListener("mouseenter",()=>{clearTimeout(a),t.showPopover()}),e.addEventListener("mouseleave",i),t.addEventListener("mouseenter",()=>{clearTimeout(a)}),t.addEventListener("mouseleave",i)}})}},HTMLElement),".micl-navigationrail"),W=new WeakMap,X=(m(U,{initialize:e=>{if(!e.matches(U)||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=t=>{const n=t.target.closest("a.micl-navigationrail__item");n&&(e.querySelectorAll("a.micl-navigationrail__item").forEach(e=>e.removeAttribute("aria-current")),n.setAttribute("aria-current","page"))};W.set(e,{boundHandleClick:t}),e.addEventListener("click",t)},keydown:e=>{e instanceof KeyboardEvent&&e.target instanceof HTMLElement&&e.target.matches(".micl-navigationrail__item")&&(32!==e.keyCode&&" "!==e.key||(e.preventDefault(),e.target.click()))},cleanup:e=>{const t=W.get(e);t&&e.removeEventListener("click",t.boundHandleClick),delete e.dataset.miclinitialized}},HTMLElement),"input[type=range][class*=micl-slider-]"),K=String.fromCharCode(8226),J=String.fromCharCode(8201),G=e=>e.parentElement?.classList.contains("micl-slider__container")?e.parentElement:null,Q=(e,t)=>{e.dataset.miclsliderticks=t},Z=e=>{let t=JSON.stringify(e.value+""),n=G(e);n&&(n.style.setProperty("--micl-slider-value",e.value),n.style.setProperty("--micl-slider-tip",t)),e.style.setProperty("--micl-slider-value",e.value),e.style.setProperty("--micl-slider-tip",t)},ee=(m(X,{initialize:e=>{if(!e.matches(X))return;(e=>{let t=e.max||"100";G(e)?.style.setProperty("--micl-slider-max",t),e.style.setProperty("--micl-slider-max",t)})(e),(e=>{let t=e.min||"0";G(e)?.style.setProperty("--micl-slider-min",t),e.style.setProperty("--micl-slider-min",t)})(e),Z(e),(e=>{let t=G(e);if(t){const n=window.getComputedStyle(e);["--_handle-height","--_track-height"].forEach(e=>{t.style.setProperty(e,n.getPropertyValue(e))})}})(e);const t=parseFloat(e.max),n=parseFloat(e.min),a=e.getBoundingClientRect(),i=((e,t,n)=>{const a=[];return e.list&&t>n&&e.list.querySelectorAll("option[value]").forEach(e=>{let i=parseFloat(e.value);!isNaN(i)&&i>=n&&i<=t&&a.push(i)}),a})(e,t,n).sort((e,t)=>e-t).map(e=>Math.round(100*(e-n)/(t-n)));if(i.length>0){const t=document.createElement("canvas"),n=t.getContext("2d");if(n){n.font=window.getComputedStyle(e).getPropertyValue("font");let t=n.measureText(J).width,r=n.measureText(K).width,l=a.width-10,o=0,s="";i.forEach(e=>{let n=l*e/100,a=Math.round((n-o)/t)-1;for(let e=0;e<a;e++)s+=J,o+=t;s+=K,o+=r}),Q(e,s)}t.remove()}else Q(e,K)},input:e=>{e.target.matches(X)&&e.target instanceof HTMLInputElement&&!e.target.disabled&&Z(e.target)}},HTMLInputElement),".micl-snackbar"),te=new WeakMap,ne=e=>{const t=te.get(e);t&&t.timeoutid&&(clearTimeout(t.timeoutid),t.timeoutid=void 0)},ae=e=>{ne(e);const t=te.get(e);t&&(t.timeoutid=window.setTimeout(()=>{e.isConnected&&e.matches(":popover-open")&&e.hidePopover()},t.delay))},ie=(m(ee,{initialize:e=>{if(!e.matches(ee)||e.dataset.miclinitialized)return;const t=e.dataset.micldelay,n=t?parseInt(t,10):0;if(isNaN(n)||n<=0)return;e.dataset.miclinitialized="1";const a=()=>ne(e),i=t=>{"open"===t.newState?ae(e):ne(e)},r=()=>{e.matches(":popover-open")&&ae(e)};te.set(e,{delay:n,boundHandleToggle:i,boundClearTimer:a,boundHandleMouseLeave:r}),e.addEventListener("toggle",i),e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",r)},cleanup:e=>{const t=te.get(e);t&&(ne(e),e.removeEventListener("toggle",t.boundHandleToggle),e.removeEventListener("mouseenter",t.boundClearTimer),e.removeEventListener("mouseleave",t.boundHandleMouseLeave),te.delete(e)),delete e.dataset.miclinitialized}},HTMLElement),e=>"willValidate"in e),re=e=>{const t=e.target;ie(t)&&t.setCustomValidity("")},le=e=>{const t=e.dataset.miclvalidateMessage||"";if(t&&e.matches("[data-miclvalidate-checkboxes-name]")){const n=e.dataset.miclvalidateCheckboxesName||"",a=e.dataset.miclvalidateCheckboxesCountEqual||"",i=e.dataset.miclvalidateCheckboxesCountMax||"",r=e.dataset.miclvalidateCheckboxesCountMin||"";if(n&&(a||i||r)){const l=e.querySelectorAll(`input[type="checkbox"][name="${n}"]:checked`).length,o=parseInt(a,10),s=parseInt(i,10),c=parseInt(r,10);let d=!isNaN(o)&&l!=o||!isNaN(s)&&l>s||!isNaN(c)&&l<c;e.setCustomValidity(d?t:"");const m=e.querySelector(`input[type="checkbox"][name="${n}"]`);m&&(m.setCustomValidity(d?t:""),d?m.addEventListener("change",re):m.removeEventListener("change",re))}}},oe=(e,t)=>{let n=!1;return e.querySelectorAll("fieldset").forEach(le),Array.from(e.elements).forEach(e=>{if(ie(e)&&e.willValidate){e.checkValidity()||(n=!0);let a=(e=>{if(!e.parentElement||!ie(e))return!1;let t=!1;return e instanceof HTMLInputElement&&"checkbox"===e.type&&e.classList.contains("micl-checkbox")?t=(e=>(e.classList.toggle("micl-checkbox--error",!!e.validationMessage),!1))(e):(e.parentElement.classList.contains("micl-textfield-outlined")||e.parentElement.classList.contains("micl-textfield-filled"))&&(t=((e,t)=>{e.classList.toggle("micl-textfield--error",!!t);const n=e.querySelector(".micl-textfield__supporting-text");return n&&(t?(n.dataset.micltext||(n.dataset.micltext=n.textContent),n.textContent=t):"micltext"in n.dataset&&(n.textContent=n.dataset.micltext||"")),!!t&&!!n})(e.parentElement,e.validationMessage)),t})(e);!a&&t&&e.reportValidity()}}),!n},se=".micl-stepper",ce=".micl-stepper__action-back,.micl-stepper__action-next",de=".micl-stepper__header button[role=tab][aria-controls]",me="micl-stepper__step",ue="."+me,pe=e=>e.querySelector(`${ue}[aria-current=step]`)||ge(e,e.querySelector(ue)),he=(e,t)=>Array.from(e.querySelectorAll(ue)).indexOf(t)+1,ge=(e,t)=>{if(!t)return null;let n=0;e.querySelectorAll(ue).forEach((e,a)=>{e.setAttribute("aria-current",e===t?"step":"false"),e===t&&(n=a)});const a=e.querySelectorAll(de).item(n);return e.querySelectorAll(de).forEach(e=>{e.setAttribute("aria-selected",e===a?"true":"false")}),ve(e,t),t},fe=e=>{const t=e.currentTarget;"transform"===e.propertyName&&t&&(t.classList.remove("micl-stepper__step--fromselected","micl-stepper__step--toselected"),t.removeEventListener("transitionend",fe))},ye=e=>e.classList.contains("micl-stepper__action-back"),ve=(e,t)=>{((e,t)=>{Array.from(e.querySelectorAll(ce)).forEach(e=>{const n=ye(e)?"previousElementSibling":"nextElementSibling",a=t[n]?.classList.contains(me);e.classList.toggle("micl-stepper__action--hidden",!a)})})(e,t),((e,t)=>{const n=e.querySelectorAll(ue).length,a=he(e,t);e.querySelectorAll("[data-step]").forEach(e=>{const t=parseInt(e.dataset.step||"0",10);e.classList.toggle("micl-stepper__step--hidden",t>0?t!=a:n+t+1!=a)})})(e,t),((e,t)=>{const n=he(e,t),a=e.querySelectorAll(ue).length,i=!e.classList.contains("micl-stepper--nonlinear"),r=(t,n)=>{e.querySelectorAll(t).forEach(e=>{e.textContent=n})};r(".micl-stepper__progress-current",`${n}`),r(".micl-stepper__progress-total",`${a}`),e.querySelectorAll(".micl-stepper__progress-dots").forEach(e=>{const t=document.createDocumentFragment();e.innerHTML="";for(let e=1;e<=a;e++){let a=document.createElement("span");a.classList.add("micl-stepper__progress-dot"),(i&&e<=n||!i&&e===n)&&a.classList.add("micl-stepper__progress--done"),t.appendChild(a)}e.appendChild(t)}),e.querySelectorAll(de).forEach((e,t)=>{e.classList.toggle("micl-stepper__progress--done",i?t+1<=n:t+1===n)})})(e,t)},Ee=(m(se,{initialize:e=>{if(!e.matches(se)||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=pe(e),n=e.querySelector(".micl-stepper__header");t&&(ve(e,t),n?.querySelectorAll("button[role=tab][aria-controls]").forEach((t,n)=>{t.style.setProperty("--micl-stepper-anchor",`--micl-step-${n}`),n>0&&t.style.setProperty("--micl-stepper-prev","--micl-step-"+(n-1)),t.addEventListener("click",()=>{if("ariaControlsElements"in Element.prototype&&t.ariaControlsElements)ge(e,t.ariaControlsElements[0]);else{const n=t.getAttribute("aria-controls");n&&ge(e,document.getElementById(n))}})})),Array.from(e.querySelectorAll(ce)).forEach(t=>{t.addEventListener("click",function(t){const n=ye(this),a=pe(e);if(!a||!n&&a instanceof HTMLFieldSetElement&&(r=!0,le(i=a),!oe(i,r)))return void(n||t.stopImmediatePropagation());var i,r;const l=a[n?"previousElementSibling":"nextElementSibling"];l?.classList.contains(me)&&((e,t,n)=>{t.addEventListener("transitionend",fe),t.classList.add("micl-stepper__step--fromselected"),t.offsetHeight,n.addEventListener("transitionend",fe),n.classList.add("micl-stepper__step--toselected"),n.offsetHeight,ge(e,n)})(e,a,l)},!0)}),e instanceof HTMLFormElement&&e.addEventListener("submit",t=>{t.submitter?.classList.contains("micl-form--dosubmit")||t.preventDefault(),oe(e,!0)||t.stopImmediatePropagation()},!0)}},HTMLElement),".micl-textfield-outlined > input,.micl-textfield-filled > input"),Le=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",be=".micl-textfield-filled > select,.micl-textfield-outlined > select",we=`${Ee},${be},${Le}`,Se=e=>{if(!e.parentElement||e instanceof HTMLSelectElement||!e.maxLength)return;const t=e.parentElement.querySelector(".micl-textfield__character-counter");t&&(t.textContent=`${e.value.length}/${e.maxLength}`)},ke=e=>{e.target.matches(we)&&e.target.dataset.miclinitialized&&!e.target.disabled&&(e.target instanceof HTMLInputElement&&e.target.dataset.micldateformat&&((e,t)=>{const n=(e.dataset.micldateformat||"").match(/([DMY]{2,4})([^DMY])?([DMY]{2,4})([^DMY])?([DMY]{2,4})/);if(!n)return;const a=[{type:n[1],length:n[1].length,separator:n[2]||""},{type:n[3],length:n[3].length,separator:n[4]||""},{type:n[5],length:n[5].length,separator:""}];e.maxLength=a.reduce((e,t)=>e+t.length+(t.separator?1:0),0);let i=e.value.replace(/\D/g,""),r="",l=0,o=e.selectionStart||0;for(let e=0;e<a.length;e++){const t=a[e];if(i.length<l)break;const n=i.substring(l,l+t.length);r+=n,l+=n.length,n.length===t.length&&t.separator&&(r+=t.separator)}const s=e.value.length;e.value=r.substring(0,e.maxLength);const c=e.value.length;t?.startsWith("deleteContent")?o>0&&e.setSelectionRange(o,o):c>s&&c>o?e.setSelectionRange(c,c):e.setSelectionRange(o,o)})(e.target,e.inputType),e.target.value?e.target.dataset.miclvalue="1":delete e.target.dataset.miclvalue,Se(e.target))},xe={initialize:e=>{if(!e.dataset.miclinitialized){if(e.dataset.miclinitialized="1",e.value&&(e.dataset.miclvalue="1"),e instanceof HTMLSelectElement&&e.multiple&&!CSS.supports("appearance","base-select")&&e.addEventListener("mousedown",t=>{const n=t.target instanceof Element&&t.target.closest("option");if(n&&!n.disabled&&!t.shiftKey){t.preventDefault();const a=e.scrollTop;n.selected=!n.selected,e.focus(),e.scrollTop=a,e.dispatchEvent(new Event("change",{bubbles:!0}))}}),e instanceof HTMLSelectElement&&!e.multiple){const t=()=>{const t=e.getBoundingClientRect(),n=t.top,a=window.innerHeight-t.bottom;!e.matches(":open")&&e.style.setProperty("--micl-select-picker-origin",n>a?"bottom":"top")};e.addEventListener("mousedown",t),e.addEventListener("keydown",t)}if(e.matches("input[type=time][data-timepicker],input[type=date][data-datepicker]")){const t=document.getElementById(e.dataset.timepicker||e.dataset.datepicker||"");if(t instanceof HTMLDialogElement){const n=e=>{e.preventDefault(),t.showModal()};e.addEventListener("click",n),e.addEventListener("keydown",e=>{const t=e.key;"Enter"!==t&&" "!==t||n(e)})}}Se(e)}},change:ke,input:ke};m(Ee,xe,HTMLInputElement),m(Le,xe,HTMLTextAreaElement),m(be,xe,HTMLSelectElement);const $e="micl-timepicker__",De="micl-timepicker__dial--hidden",Te="micl-timepicker--selected",Me=(()=>{try{const e=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions().hourCycle;return"h11"===e||"h12"===e}catch(e){return!1}})(),Ae=(e,t)=>e.querySelector(t),Ce=e=>e instanceof HTMLInputElement||e instanceof HTMLButtonElement,qe=e=>!!e&&!e.classList.contains(De),_e=(e,t)=>{e.classList.toggle(Te,t)},Ie=e=>document.querySelector(`[data-timepicker="${e.id}"],[popovertarget="${e.id}"],[commandfor="${e.id}"]`),He=e=>"hour"===e?{min:Me?1:0,max:Me?12:23}:{min:0,max:59},Pe=(e,t,n)=>{e.querySelectorAll("data").forEach(e=>e.classList.remove(`${$e}time--selected`));const a=e.querySelector(`data[data-${t}][value="${n}"]`);let i="";a?(i=window.getComputedStyle(a).getPropertyValue("--micl-angle"),a.classList.add(`${$e}time--selected`)):"minute"===t&&(i=`${Math.round(360*parseInt(n,10)/60-90)}deg`),i&&e.style.setProperty("--micl-angle",i)},ze=(e,t,n,a,i=!0)=>{let r=parseInt(n||"0",10);if(isNaN(r))return;const l=Ae(e,`input[name=${t}]`);if(l){if("hour"===t&&a&&Me){const t=e.querySelector(`.${$e}am`),n=e.querySelector(`.${$e}pm`);r>=12?(n&&(n.checked=!0),r>12&&(r-=12)):(t&&(t.checked=!0),0===r&&(r=12))}if(l.value=`${r}`.padStart(2,"0"),i){const n=Ae(e,`.${$e}dial`);if(!n)return;Pe(n,t,l.value)}}},Ne=(e,t,n)=>{if("ArrowDown"!==n.key&&"ArrowUp"!==n.key)return;n.preventDefault();const{max:a,min:i}=He(t.name);let r=parseInt(t.value,10)||0;if(r+="ArrowUp"===n.key?1:-1,(r<i||r>a)&&(r=r<i?a:i,"hour"===t.name&&Me)){const t=e.querySelector("input[name=period]:not(:checked)");t?.click()}ze(e,t.name,`${r}`)},Fe=(m("dialog.micl-dialog.micl-timepicker",{initialize:e=>{if(e.dataset.miclinitialized)return;const t=Ae(e,"form"),n=Ae(e,`.${$e}inputmode`),a=Ae(e,`.${$e}dial`),i=[Ae(e,"input[name=hour]"),Ae(e,"input[name=minute]")].filter(e=>null!==e);if(!t||i.length<2)return;e.dataset.miclinitialized="1",i.forEach((t,n)=>{(e=>{const{min:t,max:n}=He(e.name);let a;a="hour"===e.name?Me?"(0[1-9]|1[0-2])":"(0[0-9]|1[0-9]|2[0-3])":"(0[0-9]|[1-5][0-9])";const i={maxlength:"2",pattern:a,inputmode:"numeric",autocomplete:"off",role:"spinbutton",min:String(t),max:String(n)};for(const t in i)e.setAttribute(t,i[t])})(t),a&&t.toggleAttribute("readonly",qe(a)),t.addEventListener("keydown",Ne.bind(null,e,t)),t.addEventListener("focus",()=>{_e(i[0===n?1:0],!1),_e(t,!0),a&&(((e,t)=>{e.querySelectorAll("data").forEach(e=>{e.dataset[t]&&(e.textContent=e.dataset[t],e.value=e.dataset[t].padStart(2,"0")),e.classList.contains(`${$e}dial-inner`)&&e.classList["hour"===t?"remove":"add"](De)})})(a,t.name),Pe(a,t.name,t.value))}),t.addEventListener("blur",()=>{qe(a)||((e=>{const{max:t,min:n}=He(e.name);let a=parseInt(e.value,10);isNaN(a)&&(a=n),a>t&&(a=t),a<0&&(a=n),e.value=String(a).padStart(2,"0")})(t),_e(t,!1))})});const r=e.querySelector(`.${$e}period`);if(r&&Me&&(["am","pm"].forEach(e=>{let t=document.createElement("input");t.type="radio",t.name="period",t.className=`${$e}${e}`,t.value=e,t.ariaLabel=e.toUpperCase(),r.appendChild(t)}),r.classList.toggle(De,!Me)),n?.addEventListener("click",()=>{a?.classList.toggle(De),i.forEach(e=>{e.toggleAttribute("readonly",qe(a))}),qe(a)&&i[0].focus()}),a){(e=>{let t=Me?300:270;for(let n=Me?1:0;n<=(Me?12:23);n++){const a=document.createElement("data");a.value=`${n}`.padStart(2,"0"),a.textContent=`${n}`,a.dataset.hour=`${n}`,a.style.setProperty("--micl-angle",`${t}deg`),!Me&&n>=12?a.classList.add(`${$e}dial-inner`):a.dataset.minute=""+5*n%60,e.appendChild(a),t=(t+30)%360}const n=document.createElement("span");n.className=`${$e}track`,e.appendChild(n)})(a);const t=(t,n)=>{const a=document.elementFromPoint(t,n);a&&"DATA"===a.tagName&&ze(e,e.querySelector(`input[name=hour].${Te}`)?"hour":"minute",a.value)};a.addEventListener("pointerdown",e=>{a.classList.add(`${$e}dial--dragging`),t(e.clientX,e.clientY),a.setPointerCapture(e.pointerId)}),a.addEventListener("pointermove",e=>{a.classList.contains(`${$e}dial--dragging`)&&t(e.clientX,e.clientY)});const n=e=>{a.classList.remove(`${$e}dial--dragging`),a.releasePointerCapture(e.pointerId)};a.addEventListener("pointerup",n),a.addEventListener("pointercancel",n)}e.addEventListener("beforetoggle",t=>{if("open"===t.oldState)return;let n=document.activeElement;if((!Ce(n)||n.dataset.timepicker!==e.id&&n.popoverTargetElement!==e&&n.commandForElement!==e)&&(n=Ie(e)),!Ce(n))return;e._miclInvoker=n;const a=(n.value||n.textContent).split(":");2===a.length&&(ze(e,"hour",a[0],!0),ze(e,"minute",a[1],!1,!1))}),e.addEventListener("close",()=>{if(!e.returnValue)return;let n=e._miclInvoker;if(n||(n=Ie(e)),!Ce(n))return;const a=t.elements;let i=parseInt(a.namedItem("hour")?.value||"0",10);if(isNaN(i))return;Me&&(i%=12,"pm"===a.namedItem("period")?.value&&(i+=12));const r=parseInt(a.namedItem("minute")?.value||"0",10);if(isNaN(r))return;const l=`${i}`.padStart(2,"0")+":"+`${r}`.padStart(2,"0");n.value=l,n instanceof HTMLInputElement?(n.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("input",{bubbles:!0}))):n.textContent=l})}},HTMLDialogElement),p);return t})());
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";const e={d:(t,n)=>{if(Array.isArray(n))for(var a=0;a<n.length;){var i=n[a++],r=n[a++];e.o(t,i)?0===r&&a++:0===r?Object.defineProperty(t,i,{enumerable:!0,value:n[a++]}):Object.defineProperty(t,i,{enumerable:!0,get:r})}else for(var i in n)e.o(n,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:n[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}};let t={};e.r(t),e.d(t,{default:()=>Ne});const n=globalThis.__miclRegistry??={map:{},rippled:new WeakSet,activated:!1},a=()=>Object.keys(n.map).join(","),i=e=>Object.entries(n.map).find(([t,{type:n}])=>e.matches(t)&&e instanceof n)?.[1],r=e=>{const t=i(e);t&&"function"==typeof t.component.initialize&&t.component.initialize(e)},l=e=>{const t=a();t&&e.querySelectorAll(t).forEach(r),e.querySelectorAll('[class*="micl-"], [class*="micl-"] > summary').forEach(e=>{n.rippled.has(e)||"1"===window.getComputedStyle(e).getPropertyValue("--micl-ripple")&&(e.addEventListener("pointerdown",t=>{if(t.currentTarget.classList.contains("micl-card--nonactionable"))return;t.stopPropagation();const n=e.getBoundingClientRect();e.style.setProperty("--micl-x",(t.clientX-n.left)/n.width*100+"%"),e.style.setProperty("--micl-y",(t.clientY-n.top)/n.height*100+"%"),e.classList.remove("micl-rippling"),e.offsetWidth,e.classList.add("micl-rippling");const a=t=>{"micl-ripple"===t.animationName&&(e.classList.remove("micl-rippling"),e.style.removeProperty("--micl-x"),e.style.removeProperty("--micl-y"),e.removeEventListener("animationend",a))};e.addEventListener("animationend",a)}),n.rippled.add(e))}),document.documentElement.style.setProperty("--md-sys-scrollbar-thumb-color",window.getComputedStyle(document.body).getPropertyValue("--md-sys-color-outline").trim())},o=e=>{const t=i(e);t&&"function"==typeof t.component.cleanup&&t.component.cleanup(e)},s=e=>{const t=a();t&&e.querySelectorAll(t).forEach(o)},c=e=>{const t=a();if(!t)return;const n=e.target.closest(t);if(!(n instanceof HTMLElement))return;const r=i(n),l=e.type;r&&"function"==typeof r.component[l]&&r.component[l]?.(e)},d=()=>{n.activated||(n.activated=!0,new MutationObserver(e=>{e.forEach(e=>{"childList"===e.type&&(e.addedNodes.forEach(e=>{if(e instanceof HTMLElement){const t=a();t&&e.matches(t)&&r(e),t&&e.querySelectorAll(t).forEach(r)}}),e.removedNodes.forEach(e=>{if(e instanceof HTMLElement){const t=a();t&&e.matches(t)&&o(e),s(e)}}))})}).observe(document.body,{childList:!0,subtree:!0}),l(document),document.addEventListener("change",c),document.addEventListener("input",c),document.addEventListener("keydown",c))},m=(e,t,a)=>(n.map[e]={component:t,type:a},n.activated&&document.querySelectorAll(e).forEach(r),t),u=()=>{document.removeEventListener("DOMContentLoaded",u),d()};"loading"!==document.readyState?d():document.addEventListener("DOMContentLoaded",u);const p={initialize:()=>l(document),cleanup:()=>s(document)},h="dialog.micl-bottomsheet",g=e=>{let t=parseInt(e.dataset.miclfitheight||"0",10);t<1&&(t=e.getBoundingClientRect().height,e.dataset.miclfitheight=`${t}`);let n=parseInt(window.getComputedStyle(e).getPropertyValue("max-block-size"),10),a=(e.dataset.miclsnapheights||"").split(",").map(Number).filter(e=>!isNaN(e)&&e>=0&&e<=n);return[...new Set(a.concat([Math.min(t,n)]).sort((e,t)=>e-t))]},f=(e,t)=>{let n=e.getBoundingClientRect().height,a=g(e);return a.filter(e=>e>n+4)[0]||a[t?a.length-1:0]},y=(e,t)=>{t<1?(delete e.dataset.miclfitheight,e.style.removeProperty("--md-comp-bottomsheet-height"),e[e.popover?"hidePopover":"close"]()):e.style.setProperty("--md-comp-bottomsheet-height",`${t}px`)},v=(m(h,{initialize:e=>{if(!e.matches(h)||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=e.querySelector(".micl-bottomsheet__headline");if(!t)return;const n=t.querySelector(".micl-bottomsheet__draghandle");let a,i,r=!1,l=!1,o=!1;function s(t){const n=t.clientY;if(r&&Math.abs(a-n)>4&&(r=!1,l=!0,e.classList.add("micl-bottomsheet--resizing")),l){const t=Math.max(1,i+a-n),r=g(e).find(e=>e>0&&Math.abs(e-t)<=12);y(e,r||t)}}function c(t){r=!1,e.classList.remove("micl-bottomsheet--resizing"),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",c),l&&(l=!1,o=!0,t.clientY<a?y(e,f(e,!0)):e.getBoundingClientRect().height<48?y(e,0):y(e,(e=>{let t=e.getBoundingClientRect().height,n=g(e).filter(e=>e>0),a=n.filter(e=>e<t-4);return a[a.length-1]||n[0]})(e)))}n?.addEventListener("click",()=>{o||y(e,f(e,!1))}),t.addEventListener("pointerdown",l=>{l.target!==t&&l.target!==n||(r=!0,o=!1,l.preventDefault(),a=l.clientY,i=e.getBoundingClientRect().height,document.addEventListener("pointermove",s),document.addEventListener("pointerup",c))})},cleanup:e=>{e.matches(h)&&(e.classList.remove("micl-bottomsheet--resizing"),delete e.dataset.miclinitialized,delete e.dataset.miclfitheight)}},HTMLDialogElement),".micl-button--toggle"),E=e=>{const t=e.querySelector(".micl-button__icon")??e,n="true"===e.getAttribute("aria-pressed");t.dataset.micliconselected&&t.classList.toggle(t.dataset.micliconselected,n),t.dataset.miclicon&&t.classList.toggle(t.dataset.miclicon,!n)},L=(m(v,{command:e=>{const t=e.target;t.matches(v)&&!t.disabled&&"--micl-toggle"===e.command&&(t.classList.add("micl-button--toggled"),t.setAttribute("aria-pressed",String("true"!==t.getAttribute("aria-pressed"))),E(t))},initialize:function(e){e.matches(v)&&!e.dataset.miclinitialized&&(e.dataset.miclinitialized="1",E(e),e.addEventListener("command",this.command))},cleanup:function(e){e.matches(v)&&(e.removeEventListener("command",this.command),delete e.dataset.miclinitialized)}},HTMLButtonElement),".micl-checkbox-group"),b=e=>{const t=e.querySelector(".micl-checkbox__parent");return t?.closest(L)===e?t:null},w=e=>{const t=b(e);if(!t)return!1;let n=0,a=0;return e.querySelectorAll('input[type="checkbox"].micl-checkbox').forEach(i=>{if(i!==t){const t=i.closest(L);t===e?(n++,i.checked&&!i.indeterminate&&a++):i.classList.contains("micl-checkbox__parent")&&t?.parentElement?.closest(L)===e&&(n++,w(t)&&a++)}}),0===a?(t.checked=!1,t.indeterminate=!1):a===n?(t.checked=!0,t.indeterminate=!1):(t.checked=!0,t.indeterminate=!0),a===n},S=(e,t)=>{e.querySelectorAll('input[type="checkbox"].micl-checkbox').forEach(n=>{const a=n.closest(L);a===e?n.checked=t:n.classList.contains("micl-checkbox__parent")&&a?.parentElement?.closest(L)===e&&(n.checked=t,S(a,t))})},k=(e,t)=>{const n=b(e);if(!n)return;t===n&&S(e,t.checked);let a,i=e;do{a=i,i=i.parentElement?.closest(L)}while(i);w(a)},x=(m(L,{initialize:e=>{e.matches(L)&&!e.dataset.miclinitialized&&(e.dataset.miclinitialized="1",e.addEventListener("change",t=>{const n=t.target;n.classList.contains("micl-checkbox")&&(t.stopPropagation(),k(e,n))}),k(e,null))}},HTMLElement),"dialog.micl-dialog.micl-datepicker"),$="micl-datepicker__",D="micl-no-transition",T=new WeakMap,M=(new Intl.DateTimeFormat).resolvedOptions().locale,A={input:new Intl.DateTimeFormat(M,{year:"numeric",month:"2-digit",day:"2-digit"}),header:new Intl.DateTimeFormat(M,{weekday:"short",day:"numeric",month:"short"}),monthLong:new Intl.DateTimeFormat(void 0,{month:"long"}),monthShort:new Intl.DateTimeFormat(M,{month:"short"}),weekdayNarrow:new Intl.DateTimeFormat(M,{weekday:"narrow"}),weekdayLong:new Intl.DateTimeFormat(M,{weekday:"long"})},q=e=>{const t=new Date(e);return t.setHours(0,0,0,0),t},C=e=>{const t=(e.getMonth()+1).toString().padStart(2,"0"),n=e.getDate().toString().padStart(2,"0");return`${e.getFullYear()}-${t}-${n}`},_=()=>A.input.formatToParts(new Date(2025,0,15)).map(e=>{switch(e.type){case"day":return"DD";case"month":return"MM";case"year":return"YYYY";case"literal":return e.value;default:return""}}).join("").trim(),I=(()=>{try{const e=new Intl.Locale(M).getWeekInfo?.();if(e)return 7===e.firstDay?0:e.firstDay}catch{}return/US|CA|MX/i.test(M)?0:1})(),H=e=>!isNaN(e.getTime()),P=e=>"date"===e.type&&e.valueAsDate?e.valueAsDate:e.value?new Date(e.value):null,N=(e,t,n)=>{e.value=t,e instanceof HTMLInputElement?(e.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new Event("input",{bubbles:!0}))):e.textContent=n},z=(e,t)=>{if(e)if(e.firstElementChild){let n=e.firstChild;for(;n;){if(n.nodeType===Node.TEXT_NODE)return void(n.nodeValue=t);n=n.nextSibling}e.appendChild(document.createTextNode(t))}else e.textContent=t},F=(e,t)=>{const n=new Date(e,t,1).getDay(),a=new Date(e,t,1-(n-I+7)%7);return Array.from({length:42},(e,n)=>{const i=new Date(a);return i.setDate(a.getDate()+n),{date:i,val:C(i),isCurrentMonth:i.getMonth()===t}})},Y=(e,t,n,a=!1)=>{if(a){const n=(()=>{const e=new Date,t=e.getDay()-I;e.setDate(e.getDate()-t);const n=document.createDocumentFragment();for(let t=0;t<7;t++){const a=document.createElement("span");a.style.gridArea=`1 / ${t+1}`,a.textContent=A.weekdayNarrow.format(e),a.title=A.weekdayLong.format(e),n.appendChild(a),e.setDate(e.getDate()+1)}return n})();t.forEach((e,t)=>{const a=document.createElement("time"),i=Math.floor(t/7)+2,r=t%7+1;a.style.gridArea=`${i} / ${r}`,n.appendChild(a)}),e.appendChild(n)}const i=q(new Date),r=n.selected.getTime(),l=n.selectedEnd?.getTime();e.querySelectorAll("time").forEach((e,n)=>{const a=t[n];e.dateTime=a.val,e.textContent=a.date.getDate().toString();const o=a.date.getTime(),s=o===r||o===l,c=o===i.getTime();e.className="",a.isCurrentMonth||e.classList.add(`${$}outside`),s&&e.classList.add(`${$}selected`),c&&e.classList.add(`${$}today`),void 0!==l&&l!==r&&(o===r?e.classList.add(`${$}range-start`):o===l?e.classList.add(`${$}range-end`):o>r&&o<l&&e.classList.add(`${$}inrange`))})},O=(e,t,n=0)=>{const a=e.querySelector(".micl-dialog__content"),i=a?.querySelector(`.${$}calendars`);if(!i)return;const r="micl-startleft",l="micl-startright",o="micl-moveleft",s="micl-moveright";if(i.classList.remove(o,s,r,l),i.offsetWidth,0!==n){const e=i.querySelector(`.${$}calendar`);if(!e)return;const a=document.createElement("div"),c=document.createElement("div");a.className=`${$}calendar`,c.className=`${$}calendar-inner`;const d=F(t.viewDate.getFullYear(),t.viewDate.getMonth());Y(c,d,t,!0);const m=n>0,u=m?r:l,p=m?o:s;a.appendChild(c),m?i.appendChild(a):i.prepend(a),i.classList.add(D,u),i.offsetWidth,requestAnimationFrame(()=>{i.classList.remove(D,u),i.classList.add(p)});const h=()=>{i.removeEventListener("transitionend",h),setTimeout(()=>{i.classList.remove(p),e.parentElement===i&&e.remove(),i.classList.add(D,r),i.offsetWidth,i.classList.remove(D,r)},0)};i.addEventListener("transitionend",h)}else{let e=i.querySelector(`.${$}calendar`);e||(e=document.createElement("div"),e.className=`${$}calendar`,e=i.appendChild(e));let n=e.querySelector(`.${$}calendar-inner`);n||(n=document.createElement("div"),n.className=`${$}calendar-inner`,e.appendChild(n));const a=F(t.viewDate.getFullYear(),t.viewDate.getMonth());Y(n,a,t,0===n.querySelectorAll("time").length)}a?.querySelectorAll(`.${$}input input`).forEach((e,n)=>{const a=0===n?t.selected:t.selectedEnd;e.value=a?A.input.format(a):"",e.value?e.dataset.miclvalue="1":delete e.dataset.miclvalue,e.dataset.micldateformat||(e.dataset.micldateformat=_())}),z(e.querySelector("h1, h2, h3, h4, h5, h6, .micl-heading"),t.range?`${A.header.format(t.selected)} – ${t.selectedEnd?A.header.format(t.selectedEnd):""}`:A.header.format(t.selected)),z(e.querySelector(`.${$}month`),A.monthShort.format(t.viewDate)),z(e.querySelector(`.${$}year`),t.viewDate.toLocaleDateString(M,e.classList.contains("micl-dialog--docked")?{year:"numeric"}:{month:"long",year:"numeric"}));const c=e.querySelector(`.${$}months input[value="${t.viewDate.getMonth()}"]`);c&&(c.checked=!0);const d=e.querySelector(`.${$}years input[value="${t.viewDate.getFullYear()}"]`);d&&(d.checked=!0)},B=(e,t)=>{"months"!==t&&"years"!==t||e.querySelector(`.${$}${t}.${$}view-hidden`)||(t="calendars"),["calendars","input","month-selector","year-selector"].forEach(n=>{let a="input"===t;"calendars"!==n&&"input"!==n||(a=t!==n),e.querySelector(`.${$}${n}`)?.classList.toggle(`${$}view-hidden`,a)});const n=e.querySelector(".micl-dialog__content");if(!n)return;const a=parseInt(window.getComputedStyle(n).getPropertyValue("max-block-size"),10);["months","years"].forEach(e=>{const i=n.querySelector(`.${$}${e}`);if(!i)return;const r=i.querySelector("input:checked");let l=!1;if(r&&e===t){const e=window.getComputedStyle(i).getPropertyValue("transition-duration"),t=parseFloat(e)*(e.includes("ms")?1:1e3),o=i.scrollHeight-a,s=(a-48)/2;if(r.offsetTop>s){let e=r.offsetTop-s-24;e>o&&(e=o);const a=performance.now(),c=i=>{const r=Math.min((i-a)/t,1);n.scrollTop=e*r,r<1&&requestAnimationFrame(c)};i.classList.remove(`${$}view-hidden`),requestAnimationFrame(c),l=null,i.addEventListener("transitionend",function t(a){"height"!==a.propertyName&&"block-size"!==a.propertyName||(n.scrollTop=e,i.removeEventListener("transitionend",t))})}}else l=!0;null!==l&&i.classList.toggle(`${$}view-hidden`,l)})},V=(e,t,n)=>{const a=T.get(e);if(!a)return;const i=new Date(a.viewDate);"month"===n?i.setMonth(i.getMonth()+t):i.setFullYear(i.getFullYear()+t);const r=a.min&&i<a.min,l=a.max&&i>a.max;r||l?e.querySelector(`.${$}calendars`)?.animate([{transform:"translateX(0)"},{transform:`translateX(${r?8:-8}px)`},{transform:"translateX(0)"}],{duration:500,easing:"ease-in-out"}):(a.viewDate=i,O(e,a,"month"===n?t:0))},R=(m(x,{keydown:e=>{if(!(e instanceof KeyboardEvent&&e.target instanceof Element))return;const t=e.target.closest(x);if(t)switch(e.key){case"Enter":case" ":e.target instanceof HTMLInputElement&&"date"===e.target.type&&e.preventDefault();break;case"M":B(t,"months");break;case"Y":B(t,"years");break;case"PageUp":case"PageDown":V(t,"PageUp"===e.key?1:-1,e.shiftKey?"year":"month")}},initialize:e=>{if(e.dataset.miclinitialized)return;const t=e.querySelector("form"),n=e.querySelector(".micl-dialog__content");t&&n&&(e.dataset.miclinitialized="1",e.addEventListener("click",t=>{const n=t.target,a=n.closest("button");if(a){const t=a.parentElement?.classList.contains(`${$}month-selector`),n=a.classList.contains(`${$}next`),i=a.classList.contains(`${$}previous`);if(n||i)return void V(e,n?1:-1,t?"month":"year")}n.closest(`.${$}month`)&&B(e,"months"),n.closest(`.${$}year`)&&B(e,"years"),n.closest(`.${$}inputmode`)&&B(e,e.querySelector(`.${$}input.${$}view-hidden`)?"input":"calendars");const i=n.closest("time");if(i&&i.dateTime&&((e,t)=>{const n=T.get(e);if(!n)return;const a=t.split("-").map(Number);if(3===a.length){const t=new Date(a[0],a[1]-1,a[2]);n.range?n.selectedEnd||t<n.selected?(n.selected=t,n.selectedEnd=null):n.selectedEnd=t:n.selected=t,n.viewDate=new Date(t),O(e,n)}})(e,i.dateTime),n instanceof HTMLInputElement&&("miclmonth"===n.name||"miclyear"===n.name)){const t=T.get(e);if(t){const a=parseInt(n.value,10);"miclmonth"===n.name?t.viewDate.setMonth(a):t.viewDate.setFullYear(a),t.viewDate<t.min?t.viewDate=t.min:t.viewDate>t.max&&(t.viewDate=t.max),O(e,t),B(e,"calendars")}}}),e.addEventListener("focusout",t=>{const n=t.target;if(!(n instanceof HTMLInputElement&&n.closest(`.${$}input`)))return;const a=e.querySelectorAll(`.${$}input input`);((e,t,n)=>{const a=T.get(e);if(!a)return;const i=(e=>{const t=_();if(e.length!==t.length)return null;let n="",a="",i="";for(let r=0;r<t.length;r++)switch(t[r]){case"D":n+=e[r];break;case"M":a+=e[r];break;case"Y":i+=e[r]}const r=new Date(parseInt(i,10),parseInt(a,10)-1,parseInt(n,10));return H(r)?r:null})(n);i&&(a.range&&t>0?a.selectedEnd=i:a.selected=i,a.selectedEnd&&a.selectedEnd<a.selected&&([a.selected,a.selectedEnd]=[a.selectedEnd,a.selected]),a.viewDate=new Date(a.selected)),O(e,a)})(e,Array.prototype.indexOf.call(a,n),n.value)}),e.addEventListener("beforetoggle",t=>{if("open"!==t.newState)return;const n=e=>e instanceof HTMLInputElement||e instanceof HTMLButtonElement;let a=document.activeElement;if((!n(a)||a.dataset.datepicker!==e.id&&a.popoverTargetElement!==e&&a.commandForElement!==e)&&(a=document.querySelector(`[data-datepicker="${e.id}"],[popovertarget="${e.id}"],[commandfor="${e.id}"]`)),!n(a))return;const i=e.classList.contains("micl-datepicker--range");let r=a,l=null;if(i&&a instanceof HTMLInputElement)if(a.dataset.miclrangeto){const e=document.getElementById(a.dataset.miclrangeto);l=e instanceof HTMLInputElement?e:null}else if(a.id){const e=document.querySelector(`input[data-miclrangeto="${a.id}"]`);e&&(l=a,r=e)}let o=new Date,s=null,c=new Date(1900,0,1),d=new Date(2099,11,31);if(r instanceof HTMLInputElement)o=P(r)||o,r.min&&(c=new Date(r.min)),r.max&&(d=new Date(r.max));else{const[e,t]=(r.value||r.textContent||"").split("/"),n=new Date(e);H(n)&&(o=n),i&&t&&(s=new Date(t))}l&&(s=P(l),l.max&&(d=new Date(l.max))),H(o)||(o=new Date),o=q(o),s&&H(s)?(s=q(s),s<o&&([o,s]=[s,o])):s=null;const m={invoker:r,invokerEnd:l,selected:o,selectedEnd:i?s:null,range:i,viewDate:new Date(o),min:c,max:d};T.set(e,m),((e,t,n)=>{const a=t.getFullYear(),i=n.getFullYear();["months","years"].forEach(r=>{const l=e.querySelector(`.${$}${r}`);if(!l)return;l.innerHTML="";const o=document.createDocumentFragment(),s=n.getMonth();if("months"===r){const e=[];let a=new Date(t.getFullYear(),t.getMonth(),1);for(;a<=n||a.getMonth()===s&&a.getFullYear()===i;)e.push(a.getMonth()),a.setMonth(a.getMonth()+1);[...new Set(e.sort((e,t)=>e-t))].forEach(e=>{const t=document.createElement("label");t.innerHTML=`<span class="material-symbols-outlined">check</span><input type="radio" name="miclmonth" value="${e}"> ${A.monthLong.format(new Date(2e3,e,1))}`,o.appendChild(t)})}else for(let e=a;e<=i;e++){const t=document.createElement("label");t.innerHTML=`<input type="radio" name="miclyear" value="${e}"> ${e}`,o.appendChild(t)}const c=document.createElement("div");c.className=`${$}${r}-inner`,l.appendChild(c).appendChild(o)})})(e,c,d),B(e,"calendars"),O(e,m)}),e.addEventListener("close",()=>{const t=T.get(e);if(!t?.invoker||""===e.returnValue)return;const n=t.selectedEnd||t.selected;t.range&&!t.invokerEnd?N(t.invoker,`${C(t.selected)}/${C(n)}`,`${t.selected.toLocaleDateString()} – ${n.toLocaleDateString()}`):(N(t.invoker,C(t.selected),t.selected.toLocaleDateString()),t.invokerEnd&&N(t.invokerEnd,C(n),n.toLocaleDateString()))}))}},HTMLDialogElement),e=>e?.matches(":has(input[type=checkbox]:checked)")),j=(m(".micl-list",{keydown(e){const t=e.target;if(!(e instanceof KeyboardEvent&&t?.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const n=t.parentElement;if(!n)return;const a=n instanceof HTMLDetailsElement;let i=[];if(a?i=Array.from(n.parentElement?.children||[]).map(e=>e.querySelector(":scope > summary")).filter(Boolean):["UL","OL"].includes(n.tagName)&&(i=Array.from(n.children).filter(e=>e instanceof HTMLLIElement&&"separator"!==e.getAttribute("role"))),i=i.filter(e=>!(e=>e?.classList.contains("micl-list-item--disabled"))(e)),!i.length)return;const r=i.indexOf(t);if(-1===r)return;let l=r;switch(e.key){case"ArrowDown":e.preventDefault(),l=(r+1)%i.length;break;case"ArrowUp":e.preventDefault(),l=(r-1+i.length)%i.length;break;case"Tab":if(!a){const e=i.findIndex(R);l=-1===e?0:e}break;case" ":case"Enter":if(a)break;" "===e.key&&e.preventDefault();const n=t.querySelector("input[type=checkbox], a[href], button");n instanceof HTMLInputElement?(n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))):n?.click()}l!==r&&(a||(t.setAttribute("tabindex","-1"),i[l].setAttribute("tabindex","0")),i[l].focus())},initialize(e){e.dataset.miclinitialized||(e.dataset.miclinitialized="1",e.querySelectorAll(":scope > details > summary.micl-list-item--disabled").forEach(e=>e.setAttribute("tabindex","-1")),e.querySelector('li[tabindex="0"]')&&e.querySelectorAll('li:not([role="separator"])').forEach(e=>{"0"!==e.getAttribute("tabindex")&&e.setAttribute("tabindex","-1"),e.querySelectorAll("a, button, input").forEach(e=>e.setAttribute("tabindex","-1")),(e=>e?.matches(":has(input[type=checkbox])"))(e)&&(e.setAttribute("role","option"),e.parentElement?.setAttribute("role","listbox"))}))}},HTMLElement),e=>Array.from(e.children).filter(e=>e instanceof HTMLLIElement&&"separator"!==e.getAttribute("role")&&!e.classList.contains("micl-list-item--disabled")&&e.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three"))),U=(m(".micl-menu[popover]",{initialize:e=>{if(!e.matches(".micl-menu[popover]")||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=document.querySelector(`[popovertarget="${e.id}"]`);t&&e.addEventListener("beforetoggle",n=>{if("open"!==n.newState)return;const a=n.source||t;requestAnimationFrame(()=>{e.matches(":popover-open")&&(e.style.transformOrigin=((e,t)=>{const n=e.getBoundingClientRect(),a=t.getBoundingClientRect();return(n.x+n.width/2>a.x+a.width/2?"right ":"left ")+(n.y+n.height/2>a.y+a.height/2?"bottom":"top")})(a,e))})}),e.addEventListener("keydown",t=>{if("ArrowDown"!==t.key&&"ArrowUp"!==t.key)return;const n=t.target;if(!(n instanceof HTMLElement&&n.matches(".micl-list-item-one,.micl-list-item-two,.micl-list-item-three")))return;const a=n.parentElement;if(!a?.matches("ul.micl-list"))return;if(a.parentElement!==e)return;const i=Array.from(e.querySelectorAll(":scope > ul.micl-list"));if(i.length<2)return;const r=i.indexOf(a),l=j(a),o=l.indexOf(n);if(-1===o)return;let s;if("ArrowDown"===t.key&&o===l.length-1){const e=(r+1)%i.length;s=j(i[e])[0]}else if("ArrowUp"===t.key&&0===o){const e=(r-1+i.length)%i.length,t=j(i[e]);s=t[t.length-1]}s&&(t.preventDefault(),t.stopPropagation(),n.setAttribute("tabindex","-1"),s.setAttribute("tabindex","0"),s.focus())},!0),e.querySelectorAll(":scope > ul.micl-list > li > button[popovertarget]").forEach(e=>{if(e.popoverTargetElement?.matches(".micl-menu[popover]")){const t=e.popoverTargetElement,n=`--${t.id}`;let a;e.style.setProperty("anchor-name",n),t.style.insetBlockStart=`anchor(${n} start)`,t.style.insetInlineStart=`anchor(${n} end)`;const i=()=>{clearTimeout(a),a=setTimeout(()=>{e.matches(":hover")||t.matches(":hover")||t.hidePopover()},300)};e.addEventListener("mouseenter",()=>{clearTimeout(a),t.showPopover()}),e.addEventListener("mouseleave",i),t.addEventListener("mouseenter",()=>{clearTimeout(a)}),t.addEventListener("mouseleave",i)}})}},HTMLElement),"input[type=range][class*=micl-slider-]"),W=String.fromCharCode(8226),X=String.fromCharCode(8201),K=e=>e.parentElement?.classList.contains("micl-slider__container")?e.parentElement:null,J=(e,t)=>{e.dataset.miclsliderticks=t},G=e=>{let t=JSON.stringify(e.value+""),n=K(e);n&&(n.style.setProperty("--micl-slider-value",e.value),n.style.setProperty("--micl-slider-tip",t)),e.style.setProperty("--micl-slider-value",e.value),e.style.setProperty("--micl-slider-tip",t)},Q=(m(U,{initialize:e=>{if(!e.matches(U))return;(e=>{let t=e.max||"100";K(e)?.style.setProperty("--micl-slider-max",t),e.style.setProperty("--micl-slider-max",t)})(e),(e=>{let t=e.min||"0";K(e)?.style.setProperty("--micl-slider-min",t),e.style.setProperty("--micl-slider-min",t)})(e),G(e),(e=>{let t=K(e);if(t){const n=window.getComputedStyle(e);["--_handle-height","--_track-height"].forEach(e=>{t.style.setProperty(e,n.getPropertyValue(e))})}})(e);const t=parseFloat(e.max),n=parseFloat(e.min),a=e.getBoundingClientRect(),i=((e,t,n)=>{const a=[];return e.list&&t>n&&e.list.querySelectorAll("option[value]").forEach(e=>{let i=parseFloat(e.value);!isNaN(i)&&i>=n&&i<=t&&a.push(i)}),a})(e,t,n).sort((e,t)=>e-t).map(e=>Math.round(100*(e-n)/(t-n)));if(i.length>0){const t=document.createElement("canvas"),n=t.getContext("2d");if(n){n.font=window.getComputedStyle(e).getPropertyValue("font");let t=n.measureText(X).width,r=n.measureText(W).width,l=a.width-10,o=0,s="";i.forEach(e=>{let n=l*e/100,a=Math.round((n-o)/t)-1;for(let e=0;e<a;e++)s+=X,o+=t;s+=W,o+=r}),J(e,s)}t.remove()}else J(e,W)},input:e=>{e.target.matches(U)&&e.target instanceof HTMLInputElement&&!e.target.disabled&&G(e.target)}},HTMLInputElement),".micl-snackbar"),Z=new WeakMap,ee=e=>{const t=Z.get(e);t&&t.timeoutid&&(clearTimeout(t.timeoutid),t.timeoutid=void 0)},te=e=>{ee(e);const t=Z.get(e);t&&(t.timeoutid=window.setTimeout(()=>{e.isConnected&&e.matches(":popover-open")&&e.hidePopover()},t.delay))},ne=(m(Q,{initialize:e=>{if(!e.matches(Q)||e.dataset.miclinitialized)return;const t=e.dataset.micldelay,n=t?parseInt(t,10):0;if(isNaN(n)||n<=0)return;e.dataset.miclinitialized="1";const a=()=>ee(e),i=t=>{"open"===t.newState?te(e):ee(e)},r=()=>{e.matches(":popover-open")&&te(e)};Z.set(e,{delay:n,boundHandleToggle:i,boundClearTimer:a,boundHandleMouseLeave:r}),e.addEventListener("toggle",i),e.addEventListener("mouseenter",a),e.addEventListener("mouseleave",r)},cleanup:e=>{const t=Z.get(e);t&&(ee(e),e.removeEventListener("toggle",t.boundHandleToggle),e.removeEventListener("mouseenter",t.boundClearTimer),e.removeEventListener("mouseleave",t.boundHandleMouseLeave),Z.delete(e)),delete e.dataset.miclinitialized}},HTMLElement),e=>"willValidate"in e),ae=e=>{const t=e.target;ne(t)&&t.setCustomValidity("")},ie=e=>{const t=e.dataset.miclvalidateMessage||"";if(t&&e.matches("[data-miclvalidate-checkboxes-name]")){const n=e.dataset.miclvalidateCheckboxesName||"",a=e.dataset.miclvalidateCheckboxesCountEqual||"",i=e.dataset.miclvalidateCheckboxesCountMax||"",r=e.dataset.miclvalidateCheckboxesCountMin||"";if(n&&(a||i||r)){const l=e.querySelectorAll(`input[type="checkbox"][name="${n}"]:checked`).length,o=parseInt(a,10),s=parseInt(i,10),c=parseInt(r,10);let d=!isNaN(o)&&l!=o||!isNaN(s)&&l>s||!isNaN(c)&&l<c;e.setCustomValidity(d?t:"");const m=e.querySelector(`input[type="checkbox"][name="${n}"]`);m&&(m.setCustomValidity(d?t:""),d?m.addEventListener("change",ae):m.removeEventListener("change",ae))}}},re=(e,t)=>{let n=!1;return e.querySelectorAll("fieldset").forEach(ie),Array.from(e.elements).forEach(e=>{if(ne(e)&&e.willValidate){e.checkValidity()||(n=!0);let a=(e=>{if(!e.parentElement||!ne(e))return!1;let t=!1;return e instanceof HTMLInputElement&&"checkbox"===e.type&&e.classList.contains("micl-checkbox")?t=(e=>(e.classList.toggle("micl-checkbox--error",!!e.validationMessage),!1))(e):(e.parentElement.classList.contains("micl-textfield-outlined")||e.parentElement.classList.contains("micl-textfield-filled"))&&(t=((e,t)=>{e.classList.toggle("micl-textfield--error",!!t);const n=e.querySelector(".micl-textfield__supporting-text");return n&&(t?(n.dataset.micltext||(n.dataset.micltext=n.textContent),n.textContent=t):"micltext"in n.dataset&&(n.textContent=n.dataset.micltext||"")),!!t&&!!n})(e.parentElement,e.validationMessage)),t})(e);!a&&t&&e.reportValidity()}}),!n},le=".micl-stepper",oe=".micl-stepper__action-back,.micl-stepper__action-next",se=".micl-stepper__header button[role=tab][aria-controls]",ce="micl-stepper__step",de="."+ce,me=e=>e.querySelector(`${de}[aria-current=step]`)||pe(e,e.querySelector(de)),ue=(e,t)=>Array.from(e.querySelectorAll(de)).indexOf(t)+1,pe=(e,t)=>{if(!t)return null;let n=0;e.querySelectorAll(de).forEach((e,a)=>{e.setAttribute("aria-current",e===t?"step":"false"),e===t&&(n=a)});const a=e.querySelectorAll(se).item(n);return e.querySelectorAll(se).forEach(e=>{e.setAttribute("aria-selected",e===a?"true":"false")}),fe(e,t),t},he=e=>{const t=e.currentTarget;"transform"===e.propertyName&&t&&(t.classList.remove("micl-stepper__step--fromselected","micl-stepper__step--toselected"),t.removeEventListener("transitionend",he))},ge=e=>e.classList.contains("micl-stepper__action-back"),fe=(e,t)=>{((e,t)=>{Array.from(e.querySelectorAll(oe)).forEach(e=>{const n=ge(e)?"previousElementSibling":"nextElementSibling",a=t[n]?.classList.contains(ce);e.classList.toggle("micl-stepper__action--hidden",!a)})})(e,t),((e,t)=>{const n=e.querySelectorAll(de).length,a=ue(e,t);e.querySelectorAll("[data-step]").forEach(e=>{const t=parseInt(e.dataset.step||"0",10);e.classList.toggle("micl-stepper__step--hidden",t>0?t!=a:n+t+1!=a)})})(e,t),((e,t)=>{const n=ue(e,t),a=e.querySelectorAll(de).length,i=!e.classList.contains("micl-stepper--nonlinear"),r=(t,n)=>{e.querySelectorAll(t).forEach(e=>{e.textContent=n})};r(".micl-stepper__progress-current",`${n}`),r(".micl-stepper__progress-total",`${a}`),e.querySelectorAll(".micl-stepper__progress-dots").forEach(e=>{const t=document.createDocumentFragment();e.innerHTML="";for(let e=1;e<=a;e++){let a=document.createElement("span");a.classList.add("micl-stepper__progress-dot"),(i&&e<=n||!i&&e===n)&&a.classList.add("micl-stepper__progress--done"),t.appendChild(a)}e.appendChild(t)}),e.querySelectorAll(se).forEach((e,t)=>{e.classList.toggle("micl-stepper__progress--done",i?t+1<=n:t+1===n)})})(e,t)},ye=(m(le,{initialize:e=>{if(!e.matches(le)||e.dataset.miclinitialized)return;e.dataset.miclinitialized="1";const t=me(e),n=e.querySelector(".micl-stepper__header");t&&(fe(e,t),n?.querySelectorAll("button[role=tab][aria-controls]").forEach((t,n)=>{t.style.setProperty("--micl-stepper-anchor",`--micl-step-${n}`),n>0&&t.style.setProperty("--micl-stepper-prev","--micl-step-"+(n-1)),t.addEventListener("click",()=>{if("ariaControlsElements"in Element.prototype&&t.ariaControlsElements)pe(e,t.ariaControlsElements[0]);else{const n=t.getAttribute("aria-controls");n&&pe(e,document.getElementById(n))}})})),Array.from(e.querySelectorAll(oe)).forEach(t=>{t.addEventListener("click",function(t){const n=ge(this),a=me(e);if(!a||!n&&a instanceof HTMLFieldSetElement&&(r=!0,ie(i=a),!re(i,r)))return void(n||t.stopImmediatePropagation());var i,r;const l=a[n?"previousElementSibling":"nextElementSibling"];l?.classList.contains(ce)&&((e,t,n)=>{t.addEventListener("transitionend",he),t.classList.add("micl-stepper__step--fromselected"),t.offsetHeight,n.addEventListener("transitionend",he),n.classList.add("micl-stepper__step--toselected"),n.offsetHeight,pe(e,n)})(e,a,l)},!0)}),e instanceof HTMLFormElement&&e.addEventListener("submit",t=>{t.submitter?.classList.contains("micl-form--dosubmit")||t.preventDefault(),re(e,!0)||t.stopImmediatePropagation()},!0)}},HTMLElement),".micl-textfield-outlined > input,.micl-textfield-filled > input"),ve=".micl-textfield-outlined > textarea,.micl-textfield-filled > textarea",Ee=".micl-textfield-filled > select,.micl-textfield-outlined > select",Le=`${ye},${Ee},${ve}`,be=e=>{if(!e.parentElement||e instanceof HTMLSelectElement||!e.maxLength)return;const t=e.parentElement.querySelector(".micl-textfield__character-counter");t&&(t.textContent=`${e.value.length}/${e.maxLength}`)},we=e=>{e.target.matches(Le)&&e.target.dataset.miclinitialized&&!e.target.disabled&&(e.target instanceof HTMLInputElement&&e.target.dataset.micldateformat&&((e,t)=>{const n=(e.dataset.micldateformat||"").match(/([DMY]{2,4})([^DMY])?([DMY]{2,4})([^DMY])?([DMY]{2,4})/);if(!n)return;const a=[{type:n[1],length:n[1].length,separator:n[2]||""},{type:n[3],length:n[3].length,separator:n[4]||""},{type:n[5],length:n[5].length,separator:""}];e.maxLength=a.reduce((e,t)=>e+t.length+(t.separator?1:0),0);let i=e.value.replace(/\D/g,""),r="",l=0,o=e.selectionStart||0;for(let e=0;e<a.length;e++){const t=a[e];if(i.length<l)break;const n=i.substring(l,l+t.length);r+=n,l+=n.length,n.length===t.length&&t.separator&&(r+=t.separator)}const s=e.value.length;e.value=r.substring(0,e.maxLength);const c=e.value.length;t?.startsWith("deleteContent")?o>0&&e.setSelectionRange(o,o):c>s&&c>o?e.setSelectionRange(c,c):e.setSelectionRange(o,o)})(e.target,e.inputType),e.target.value?e.target.dataset.miclvalue="1":delete e.target.dataset.miclvalue,be(e.target))},Se={initialize:e=>{if(!e.dataset.miclinitialized){if(e.dataset.miclinitialized="1",e.value&&(e.dataset.miclvalue="1"),e instanceof HTMLSelectElement&&e.multiple&&!CSS.supports("appearance","base-select")&&e.addEventListener("mousedown",t=>{const n=t.target instanceof Element&&t.target.closest("option");if(n&&!n.disabled&&!t.shiftKey){t.preventDefault();const a=e.scrollTop;n.selected=!n.selected,e.focus(),e.scrollTop=a,e.dispatchEvent(new Event("change",{bubbles:!0}))}}),e instanceof HTMLSelectElement&&!e.multiple){const t=()=>{const t=e.getBoundingClientRect(),n=t.top,a=window.innerHeight-t.bottom;!e.matches(":open")&&e.style.setProperty("--micl-select-picker-origin",n>a?"bottom":"top")};e.addEventListener("mousedown",t),e.addEventListener("keydown",t)}if(e.matches("input[type=time][data-timepicker],input[type=date][data-datepicker]")){const t=document.getElementById(e.dataset.timepicker||e.dataset.datepicker||"");if(t instanceof HTMLDialogElement){const n=e=>{e.preventDefault(),t.showModal()};e.addEventListener("click",n),e.addEventListener("keydown",e=>{const t=e.key;"Enter"!==t&&" "!==t||n(e)})}}be(e)}},change:we,input:we};m(ye,Se,HTMLInputElement),m(ve,Se,HTMLTextAreaElement),m(Ee,Se,HTMLSelectElement);const ke="micl-timepicker__",xe="micl-timepicker__dial--hidden",$e="micl-timepicker--selected",De=(()=>{try{const e=new Intl.DateTimeFormat(void 0,{hour:"numeric"}).resolvedOptions().hourCycle;return"h11"===e||"h12"===e}catch(e){return!1}})(),Te=(e,t)=>e.querySelector(t),Me=e=>e instanceof HTMLInputElement||e instanceof HTMLButtonElement,Ae=e=>!!e&&!e.classList.contains(xe),qe=(e,t)=>{e.classList.toggle($e,t)},Ce=e=>document.querySelector(`[data-timepicker="${e.id}"],[popovertarget="${e.id}"],[commandfor="${e.id}"]`),_e=e=>"hour"===e?{min:De?1:0,max:De?12:23}:{min:0,max:59},Ie=(e,t,n)=>{e.querySelectorAll("data").forEach(e=>e.classList.remove(`${ke}time--selected`));const a=e.querySelector(`data[data-${t}][value="${n}"]`);let i="";a?(i=window.getComputedStyle(a).getPropertyValue("--micl-angle"),a.classList.add(`${ke}time--selected`)):"minute"===t&&(i=`${Math.round(360*parseInt(n,10)/60-90)}deg`),i&&e.style.setProperty("--micl-angle",i)},He=(e,t,n,a,i=!0)=>{let r=parseInt(n||"0",10);if(isNaN(r))return;const l=Te(e,`input[name=${t}]`);if(l){if("hour"===t&&a&&De){const t=e.querySelector(`.${ke}am`),n=e.querySelector(`.${ke}pm`);r>=12?(n&&(n.checked=!0),r>12&&(r-=12)):(t&&(t.checked=!0),0===r&&(r=12))}if(l.value=`${r}`.padStart(2,"0"),i){const n=Te(e,`.${ke}dial`);if(!n)return;Ie(n,t,l.value)}}},Pe=(e,t,n)=>{if("ArrowDown"!==n.key&&"ArrowUp"!==n.key)return;n.preventDefault();const{max:a,min:i}=_e(t.name);let r=parseInt(t.value,10)||0;if(r+="ArrowUp"===n.key?1:-1,(r<i||r>a)&&(r=r<i?a:i,"hour"===t.name&&De)){const t=e.querySelector("input[name=period]:not(:checked)");t?.click()}He(e,t.name,`${r}`)},Ne=(m("dialog.micl-dialog.micl-timepicker",{initialize:e=>{if(e.dataset.miclinitialized)return;const t=Te(e,"form"),n=Te(e,`.${ke}inputmode`),a=Te(e,`.${ke}dial`),i=[Te(e,"input[name=hour]"),Te(e,"input[name=minute]")].filter(e=>null!==e);if(!t||i.length<2)return;e.dataset.miclinitialized="1",i.forEach((t,n)=>{(e=>{const{min:t,max:n}=_e(e.name);let a;a="hour"===e.name?De?"(0[1-9]|1[0-2])":"(0[0-9]|1[0-9]|2[0-3])":"(0[0-9]|[1-5][0-9])";const i={maxlength:"2",pattern:a,inputmode:"numeric",autocomplete:"off",role:"spinbutton",min:String(t),max:String(n)};for(const t in i)e.setAttribute(t,i[t])})(t),a&&t.toggleAttribute("readonly",Ae(a)),t.addEventListener("keydown",Pe.bind(null,e,t)),t.addEventListener("focus",()=>{qe(i[0===n?1:0],!1),qe(t,!0),a&&(((e,t)=>{e.querySelectorAll("data").forEach(e=>{e.dataset[t]&&(e.textContent=e.dataset[t],e.value=e.dataset[t].padStart(2,"0")),e.classList.contains(`${ke}dial-inner`)&&e.classList["hour"===t?"remove":"add"](xe)})})(a,t.name),Ie(a,t.name,t.value))}),t.addEventListener("blur",()=>{Ae(a)||((e=>{const{max:t,min:n}=_e(e.name);let a=parseInt(e.value,10);isNaN(a)&&(a=n),a>t&&(a=t),a<0&&(a=n),e.value=String(a).padStart(2,"0")})(t),qe(t,!1))})});const r=e.querySelector(`.${ke}period`);if(r&&De&&(["am","pm"].forEach(e=>{let t=document.createElement("input");t.type="radio",t.name="period",t.className=`${ke}${e}`,t.value=e,t.ariaLabel=e.toUpperCase(),r.appendChild(t)}),r.classList.toggle(xe,!De)),n?.addEventListener("click",()=>{a?.classList.toggle(xe),i.forEach(e=>{e.toggleAttribute("readonly",Ae(a))}),Ae(a)&&i[0].focus()}),a){(e=>{let t=De?300:270;for(let n=De?1:0;n<=(De?12:23);n++){const a=document.createElement("data");a.value=`${n}`.padStart(2,"0"),a.textContent=`${n}`,a.dataset.hour=`${n}`,a.style.setProperty("--micl-angle",`${t}deg`),!De&&n>=12?a.classList.add(`${ke}dial-inner`):a.dataset.minute=""+5*n%60,e.appendChild(a),t=(t+30)%360}const n=document.createElement("span");n.className=`${ke}track`,e.appendChild(n)})(a);const t=(t,n)=>{const a=document.elementFromPoint(t,n);a&&"DATA"===a.tagName&&He(e,e.querySelector(`input[name=hour].${$e}`)?"hour":"minute",a.value)};a.addEventListener("pointerdown",e=>{a.classList.add(`${ke}dial--dragging`),t(e.clientX,e.clientY),a.setPointerCapture(e.pointerId)}),a.addEventListener("pointermove",e=>{a.classList.contains(`${ke}dial--dragging`)&&t(e.clientX,e.clientY)});const n=e=>{a.classList.remove(`${ke}dial--dragging`),a.releasePointerCapture(e.pointerId)};a.addEventListener("pointerup",n),a.addEventListener("pointercancel",n)}e.addEventListener("beforetoggle",t=>{if("open"===t.oldState)return;let n=document.activeElement;if((!Me(n)||n.dataset.timepicker!==e.id&&n.popoverTargetElement!==e&&n.commandForElement!==e)&&(n=Ce(e)),!Me(n))return;e._miclInvoker=n;const a=(n.value||n.textContent).split(":");2===a.length&&(He(e,"hour",a[0],!0),He(e,"minute",a[1],!1,!1))}),e.addEventListener("close",()=>{if(!e.returnValue)return;let n=e._miclInvoker;if(n||(n=Ce(e)),!Me(n))return;const a=t.elements;let i=parseInt(a.namedItem("hour")?.value||"0",10);if(isNaN(i))return;De&&(i%=12,"pm"===a.namedItem("period")?.value&&(i+=12));const r=parseInt(a.namedItem("minute")?.value||"0",10);if(isNaN(r))return;const l=`${i}`.padStart(2,"0")+":"+`${r}`.padStart(2,"0");n.value=l,n instanceof HTMLInputElement?(n.dispatchEvent(new Event("change",{bubbles:!0})),n.dispatchEvent(new Event("input",{bubbles:!0}))):n.textContent=l})}},HTMLDialogElement),p);return t})());
|
package/dist/navigationrail.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.micl=t():e.micl=t()}(self,()=>(()=>{"use strict";let e={};return(e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e),e})());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "material-inspired-component-library",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"description": "The Material-Inspired Component Library (MICL) offers a collection of beautifully crafted components leveraging native HTML markup, designed to align with the Material Design 3 guidelines.",
|
|
5
5
|
"author": "MICL Hermana <micl.hermana@proton.me> (https://github.com/henkpb/micl)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"type": "git",
|
|
50
50
|
"url": "https://github.com/henkpb/micl"
|
|
51
51
|
},
|
|
52
|
-
"homepage": "https://github.
|
|
52
|
+
"homepage": "https://henkpb.github.io/micl",
|
|
53
53
|
"bugs": {
|
|
54
54
|
"url": "https://github.com/henkpb/micl/issues"
|
|
55
55
|
},
|