mtrl 0.8.0-next.21 → 0.8.0-next.23

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/dist/index.cjs CHANGED
@@ -1,33 +1,33 @@
1
1
  /**
2
- * mtrl v0.8.0-next.21
2
+ * mtrl v0.8.0-next.23
3
3
  * A functional TypeScript component library based on Material Design 3
4
4
  * @license MIT
5
5
  */
6
- var Vf=Object.create;var{getPrototypeOf:Ff,defineProperty:Mn,getOwnPropertyNames:Ya,getOwnPropertyDescriptor:Uf}=Object,bi=Object.prototype.hasOwnProperty;function Xa(e){return this[e]}var Gf,zf,Wf=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?Gf??=new WeakMap:zf??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?Vf(Ff(e)):{};let a=t||!e||!e.__esModule||!bi.call(e,"default")?Mn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let o of Ya(e))if(!bi.call(a,o))Mn(a,o,{get:Xa.bind(e,o),enumerable:!0})}if(r)i.set(e,a);return a},Kf=(e)=>{var t=(Ka??=new WeakMap).get(e),n;if(t)return t;if(t=Mn({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of Ya(e))if(!bi.call(t,r))Mn(t,r,{get:Xa.bind(e,r),enumerable:!(n=Uf(e,r))||n.enumerable})}return Ka.set(e,t),t},Ka;var Yf=(e)=>e;function Xf(e,t){this[e]=Yf.bind(null,t)}var qf=(e,t)=>{for(var n in t)Mn(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Xf.bind(t,n)})};var K=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};var M=(...e)=>(t)=>e.reduce((n,r)=>r(n),t),qa=(...e)=>(t)=>e.reduceRight((n,r)=>r(n),t),ja=(...e)=>(t,n={})=>e.reduce((r,i)=>({...r,...i(r,n)}),t);var Za=(e={})=>({element:null,config:e,setup(){return this}});var On=(e,t={})=>{if(!t)return e;let n=Object.keys(t);if(n.length===1){let r=t[n[0]];if(r!=null)e.setAttribute(n[0],String(r));return e}for(let r in t){let i=t[r];if(i!=null)e.setAttribute(r,String(i))}return e},Qa=(e,t=[])=>{for(let n=0;n<t.length;n++)e.removeAttribute(t[n]);return e},Ja=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.action==="set"&&r.value!=null)e.setAttribute(r.key,String(r.value));else if(r.action==="remove")e.removeAttribute(r.key)}return e},eo=(e,t)=>e.hasAttribute(t),to=(e,t,n="")=>e.getAttribute(t)??n;var Y="mtrl",no=(e)=>`mtrl-${e}`,ro=(e,t)=>`${e}--${t}`,io=(e,t)=>`${e}-${t}`,vi,Ti,so;var rt=K(()=>{((s)=>{s.BUTTON="button";s.TEXTFIELD="textfield";s.CONTAINER="container";s.SNACKBAR="snackbar";s.SWITCH="switch"})(vi||={});((s)=>{s.DISABLED="disabled";s.FOCUSED="focused";s.ACTIVE="active";s.LOADING="loading";s.ERROR="error"})(Ti||={});so={bem:(e,t,n)=>{let r=e;if(t)r+=`-${t}`;if(n)r+=`--${n}`;return r},join:(...e)=>e.filter(Boolean).join(" ")}});var xe,gr,jf=500,Zt=(...e)=>{if(e.length===0)return[];if(e.length===1&&typeof e[0]==="string"){let r=e[0];if(!r)return[];if(!r.includes(" "))return[r];if(gr.has(r))return gr.get(r)}let t=new Set,n=[];for(let r of e)if(typeof r==="string"&&r)if(!r.includes(" ")){if(!t.has(r))t.add(r),n.push(r)}else r.split(" ").forEach((i)=>{let s=i.trim();if(s&&!t.has(s))t.add(s),n.push(s)});else if(Array.isArray(r))r.forEach((i)=>{if(typeof i==="string"&&i)i.split(" ").forEach((s)=>{let a=s.trim();if(a&&!t.has(a))t.add(a),n.push(a)})});if(e.length===1&&typeof e[0]==="string"&&n.length<=10){if(gr.size<jf)gr.set(e[0],n)}return n},te=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return te(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.add(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.add(a)});else e.classList.add(i)}return e},he=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return he(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.remove(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.remove(a)});else e.classList.remove(i)}return e},hr=(e,...t)=>{if(t.length===1&&Array.isArray(t[0]))return hr(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.toggle(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.toggle(a)});else e.classList.toggle(i)}return e},it=(e,...t)=>{if(t.length===0)return!0;if(t.length===1&&Array.isArray(t[0]))return it(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.contains(i)}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" ")){let s=i.split(" ").map((a)=>a.trim()).filter(Boolean);for(let a of s)if(!e.classList.contains(a))return!1}else if(!e.classList.contains(i))return!1}return!0};var Rn=K(()=>{rt();xe=`${Y}-`,gr=new Map});class oo{pools=new Map;maxSize=20;acquire(e="div"){let t=this.pools.get(e);if(t?.length){let n=t.pop();return n.className="",n.innerHTML="",n.removeAttribute("id"),Object.keys(n.dataset).forEach((r)=>delete n.dataset[r]),n}return document.createElement(e)}release(e){let t=e.tagName.toLowerCase(),n=this.pools.get(t);if(!n)n=[],this.pools.set(t,n);if(n.length<this.maxSize)this.cleanElement(e),n.push(e)}cleanElement(e){let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}e.className="",e.innerHTML="",e.removeAttribute("id"),Object.keys(e.dataset).forEach((n)=>delete e.dataset[n]),e.parentNode?.removeChild(e)}}var Zf,ao=(e,t,n)=>{if(!t||!n?.emit&&!n?.on)return;e.__eventHandlers={};for(let r in t){let i=t[r],s=(o)=>{let l=!0;if(typeof i==="function")try{l=i({...n,element:e},o)}catch(d){console.warn(`Error in event condition for ${r}:`,d),l=!1}else l=Boolean(i);if(l&&n.emit)n.emit(r,{event:o,element:e,originalEvent:o})};e.__eventHandlers[r]=s;let a=Zf.has(r)?{passive:!0}:void 0;e.addEventListener(r,s,a)}},XC,H=(e={})=>{if(!e||Object.keys(e).length===0)return document.createElement("div");if(typeof e==="string")return document.createElement(e);let t=document.createElement(e.tag||"div");if(e.html)t.innerHTML=e.html;else if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.name)t.setAttribute("name",e.name);if(e.title)t.title=e.title;if(e.tabIndex!==void 0)t.tabIndex=e.tabIndex;if(e.style)if(typeof e.style==="string")t.setAttribute("style",e.style);else Object.assign(t.style,e.style);if(e.role)t.setAttribute("role",e.role);if(e.ariaLabel)t.setAttribute("aria-label",e.ariaLabel);if(e.ariaDescribedBy)t.setAttribute("aria-describedby",e.ariaDescribedBy);if(e.ariaLabelledBy)t.setAttribute("aria-labelledby",e.ariaLabelledBy);if(e.ariaHidden!==void 0)t.setAttribute("aria-hidden",String(e.ariaHidden));let n=e.className||e.class;if(n)te(t,n);if(e.rawClass){let r=Array.isArray(e.rawClass)?e.rawClass:e.rawClass.split(" ");t.classList.add(...r.filter(Boolean))}if(e.data)Object.assign(t.dataset,e.data);if(e.attributes)On(t,e.attributes);for(let r in e)if(!["tag","container","html","text","id","name","title","tabIndex","style","role","ariaLabel","ariaDescribedBy","ariaLabelledBy","ariaHidden","data","class","className","rawClass","attributes","forwardEvents","onCreate","context"].includes(r)){let i=e[r];if(i!=null)t.setAttribute(r,String(i))}if(e.forwardEvents)ao(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},lo=(e={})=>{let t=document.createElementNS("http://www.w3.org/2000/svg",e.tag||"svg");if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.attributes)On(t,e.attributes);if(e.forwardEvents)ao(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},uo=(e)=>{let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}};var Qe=K(()=>{Rn();Zf=new Set(["touchstart","touchmove"]);XC=new oo});function Qf(e){return"touches"in e}function Jf(e){return"clientX"in e&&"clientY"in e}var co=()=>{let e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=window.innerWidth<=768;return e||t},Cr,Tt,Si,ze=()=>("ontouchstart"in window)||navigator.maxTouchPoints>0,Je=(e)=>{if(Qf(e)&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}}if(Jf(e))return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}};var _n=K(()=>{Cr={passive:!0},Tt={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},Si={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var ep=(e)=>({getClass:(t)=>`${e}-${t}`,getModifierClass:(t,n)=>`${t}--${n}`,getElementClass:(t,n)=>`${t}-${n}`}),D=(e={})=>({config:e,componentName:e.componentName,...ep(e.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState(t,n){let r=Je(t);if(n==="start")this.touchState={startTime:Date.now(),startPosition:{x:r.clientX,y:r.clientY},isTouching:!0,activeTarget:r.target};else if(n==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),O=(e={})=>(t)=>{let n=(d)=>{if(s.updateTouchState(d,"start"),l.classList.add(`${s.getClass("touch-active")}`),e.forwardEvents?.touchstart&&"emit"in t)t.emit("touchstart",Je(d))},r=(d)=>{if(!s.touchState.isTouching)return;let u=Date.now()-s.touchState.startTime;if(l.classList.remove(`${s.getClass("touch-active")}`),s.updateTouchState(d,"end"),u<Tt.TAP_THRESHOLD&&"emit"in t)t.emit("tap",Je(d));if(e.forwardEvents?.touchend&&"emit"in t)t.emit("touchend",Je(d))},i=(d)=>{if(!s.touchState.isTouching)return;let u=Je(d),c=u.clientX-s.touchState.startPosition.x,p=u.clientY-s.touchState.startPosition.y;if(Math.abs(c)>Tt.SWIPE_THRESHOLD&&"emit"in t)t.emit("swipe",{direction:c>0?"right":"left",deltaX:c,deltaY:p});if(e.forwardEvents?.touchmove&&"emit"in t)t.emit("touchmove",{...u,deltaX:c,deltaY:p})},s=t,a=t.config.parent||e.parent;if(typeof a==="string")a=document.querySelector(a);let o={tag:e.tag||"div",className:[s.getClass(e.componentName||s.componentName||"component"),ze()&&e.interactive?s.getClass("interactive"):null,...Array.isArray(e.className)?e.className:[e.className]].filter(Boolean),attributes:e.attributes||{},id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,forwardEvents:e.forwardEvents||{},context:t,container:a},l=H(o);if(ze()&&e.interactive)l.addEventListener("touchstart",n,Cr),l.addEventListener("touchend",r),l.addEventListener("touchmove",i,Cr);return{...t,element:l,addClass(...d){return l.classList.add(...d.filter(Boolean)),this},destroy(){if(ze()&&e.interactive)l.removeEventListener("touchstart",n),l.removeEventListener("touchend",r),l.removeEventListener("touchmove",i);uo(l),l.remove()}}};var Z=K(()=>{Qe();_n()});var Me=()=>{let e=new Map;return{on:(t,n)=>{let r=e.get(t)||[];return e.set(t,[...r,n]),()=>{let i=e.get(t)||[];e.set(t,i.filter((s)=>s!==n))}},off(t,n){let r=e.get(t)||[];e.set(t,r.filter((i)=>i!==n))},emit:(t,...n)=>{(e.get(t)||[]).forEach((i)=>i(...n))},clear:()=>{e.clear()}}};var B=()=>(e)=>{let t=Me();return{...e,on(n,r){return t.on(n,r),this},off(n,r){return t.off(n,r),this},emit(n,r){return t.emit(n,r),this}}};var mo=()=>{};var tp=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");return a.className=`${r}-${t.componentName||"component"}-text`,a.textContent=s,a};return{setText(s){if(!n&&s)if(n=i(s),t.beforeElement)e.insertBefore(n,t.beforeElement);else e.appendChild(n);else if(n)n.textContent=s;return this},getText(){return n?n.textContent||"":""},getElement(){return n}}},ct=(e)=>(t)=>{let n=tp(t.element,{prefix:e.prefix,componentName:e.componentName||"component"});if(e.text)n.setText(e.text);return{...t,text:n}};var np=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");a.className=`${r}-icon`;let o=`${r}-${t.componentName||"component"}-icon`;if(a.classList.add(o),t.iconPosition)a.classList.add(`${o}--${t.iconPosition}`);if(t.iconSize)a.classList.add(`${r}-icon--${t.iconSize}`);return a.innerHTML=s,a};return{setIcon(s){if(!n&&s)if(n=i(s),t.iconPosition==="end")e.appendChild(n);else{let a=e.querySelector(`[class*="${r}-${t.componentName||"component"}-label"]`);if(a)if(a.nextSibling)e.insertBefore(n,a.nextSibling);else e.appendChild(n);else e.insertBefore(n,e.firstChild)}else if(n&&s)n.innerHTML=s;return this},getIcon(){return n?n.innerHTML:""},getElement(){return n}}},Pe=(e)=>(t)=>{let n=np(t.element,{prefix:e.prefix,componentName:e.componentName||"component",iconPosition:e.iconPosition,iconSize:e.iconSize});if(e.icon)n.setIcon(e.icon);if(t.componentName==="button"&&e.icon&&e.text)t.element.classList.add(`${t.getClass("button")}--icon`);return{...t,icon:n}};var se=(e)=>(t)=>{if(e.variant&&t.element){let n=`${e.prefix}-${e.componentName}--${e.variant}`;t.element.classList.add(n)}return t};var mt=(e)=>(t)=>{if(e.size&&t.element){let n=`${e.prefix}-${e.componentName}--${e.size}`;t.element.classList.add(n)}return t};var fo,Pn=(e)=>(t)=>{if(!e.position||!t.element)return t;let n=fo[e.position.toUpperCase()]||e.position,r=`${e.prefix}-${e.componentName}--${n}`;return t.element.classList.add(r),{...t,position:{setPosition(s){let a=n,o=`${e.prefix}-${e.componentName}--${a}`,l=`${e.prefix}-${e.componentName}--${s}`;return t.element.classList.remove(o),t.element.classList.add(l),this},getPosition(){return n}}}};var po=K(()=>{((o)=>{o.LEFT="left";o.RIGHT="right";o.TOP="top";o.BOTTOM="bottom";o.START="start";o.END="end";o.CENTER="center"})(fo||={})});var go,Qt,uE;var ho=K(()=>{((a)=>{a.LINEAR="linear";a.EASE="ease";a.EASE_IN="ease-in";a.EASE_OUT="ease-out";a.EASE_IN_OUT="ease-in-out";a.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(go||={});Qt={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},uE={duration:{type:"number",minimum:0,default:Qt.duration},timing:{type:"string",enum:Object.values(go),default:Qt.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:Qt.opacity}}});var rp=(e={})=>{let t={...Qt,...e,opacity:e.opacity||Qt.opacity},n=new WeakMap,r=[],i=()=>{let l=document.createElement("div");return l.className=`${Y}-ripple-wave`,l},s=(l,d)=>{if(typeof document.addEventListener==="function")document.addEventListener(l,d),r.push({event:l,handler:d})},a=(l,d)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(l,d),r=r.filter((u)=>!(u.event===l&&u.handler===d))},o=(l,d)=>{if(!d||!d.__rippleContainer)return;let u=d.__rippleContainer,c=d.getBoundingClientRect(),p=i(),g=Math.max(c.width,c.height)*2,f=l.clientX-c.left-g/2,m=l.clientY-c.top-g/2;Object.assign(p.style,{width:`${g}px`,height:`${g}px`,left:`${f}px`,top:`${m}px`}),u.appendChild(p),p.offsetHeight,requestAnimationFrame(()=>{p.classList.add("active")});let h=()=>{a("mouseup",h),a("mouseleave",h),p.classList.remove("active"),p.classList.add("fade-out"),setTimeout(()=>{if(p.parentNode)p.parentNode.removeChild(p);n.get(d)?.delete(p)},t.duration)};s("mouseup",h),s("mouseleave",h)};return{mount:(l)=>{if(!l)return;if(window.getComputedStyle(l).position==="static")l.style.position="relative";let u=l.querySelector(`.${Y}-ripple`);if(!u)u=document.createElement("div"),u.className=`${Y}-ripple`,l.appendChild(u);l.__rippleContainer=u,n.set(l,new Set);let c=(p)=>o(p,l);if(!l.__rippleHandlers)l.__rippleHandlers=[];l.__rippleHandlers.push(c),l.addEventListener("mousedown",c)},unmount:(l)=>{if(!l)return;if(r.forEach(({event:d,handler:u})=>{a(d,u)}),r=[],l.__rippleHandlers)l.__rippleHandlers.forEach((d)=>{l.removeEventListener("mousedown",d)}),l.__rippleHandlers=[];if(n.has(l)){let d=n.get(l);if(d)d.forEach((u)=>{if(u.parentNode)u.parentNode.removeChild(u)});n.delete(l)}if(l.__rippleContainer&&l.__rippleContainer.parentNode)l.__rippleContainer.parentNode.removeChild(l.__rippleContainer),delete l.__rippleContainer}}},Le=(e)=>(t)=>{if(!e.ripple)return t;let n=rp(e.rippleConfig);if(n.mount(t.element),t.lifecycle){let r=t.lifecycle.mount,i=t.lifecycle.destroy;t.lifecycle.mount=()=>{r.call(t.lifecycle)},t.lifecycle.destroy=()=>{n.unmount(t.element),i.call(t.lifecycle)}}return{...t,ripple:n}};var Co=K(()=>{ho();rt()});function Eo(e){return"emit"in e&&typeof e.emit==="function"}var kt=(e={})=>(t)=>{let n=document.createElement("input"),r=t.componentName||"component";n.type="checkbox",n.className=`${t.getClass(r)}-input`,n.style.position="absolute",n.style.opacity="0",n.style.cursor="pointer",t.element.setAttribute("role","presentation"),n.setAttribute("role",r);let i={name:e.name,checked:e.checked,required:e.required,disabled:e.disabled,value:e.value||"on","aria-label":e.label||e.ariaLabel};return Object.entries(i).forEach(([s,a])=>{if(a!==null&&a!==void 0)if(s==="disabled"&&a===!0)n.disabled=!0,n.setAttribute("disabled","true");else if(a===!0)n.setAttribute(s,s);else n.setAttribute(s,String(a))}),n.addEventListener("change",(s)=>{if(Eo(t))t.emit("change",{checked:n.checked,value:n.value,nativeEvent:s})}),n.addEventListener("keydown",(s)=>{if(s.key===" "||s.key==="Enter"){if(s.preventDefault(),!n.disabled)n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0}))}}),t.element.appendChild(n),{...t,input:n,getValue:()=>n.value,setValue(s){if(n.value=s,Eo(t))t.emit("value",{value:s});return this}}};var Ht=(e={})=>(t)=>{if(!t.input)return t;let n=t.componentName||"component",r=()=>{t.element.classList.toggle(`${t.getClass(n)}--checked`,t.input.checked)};if(e.checked!==void 0)t.input.checked=e.checked;if(r(),t.emit)t.on?.("change",r);return{...t,checkable:{check(){if(!t.input.checked)t.input.checked=!0,r(),t.emit?.("change",{checked:!0,value:t.input.value});return this},uncheck(){if(t.input.checked)t.input.checked=!1,r(),t.emit?.("change",{checked:!1,value:t.input.value});return this},toggle(){return t.input.checked=!t.input.checked,r(),t.emit?.("change",{checked:t.input.checked,value:t.input.value}),this},isChecked(){return t.input.checked}}}};var yi=(e={})=>(t)=>{if(e.variant)t.element.classList.add(`${t.getClass("button")}--${e.variant}`);if(e.size)t.element.classList.add(`${t.getClass("button")}--${e.size}`);return t};function St(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}function yt(e){return"emit"in e&&typeof e.emit==="function"}var Bn=(e={})=>(t)=>{let n=e.multiline||e.type==="multiline",r=document.createElement(n?"textarea":"input");r.className=`${t.getClass("textfield")}-input`;let i={name:e.name,required:e.required,disabled:e.disabled,maxLength:e.maxLength,pattern:e.pattern,autocomplete:e.autocomplete,value:e.value||"",placeholder:e.placeholder||" "};if(!n)i.type=e.type||"text";else i["data-type"]="multiline";Object.entries(i).forEach(([l,d])=>{if(d!==null&&d!==void 0)if(typeof d==="boolean"){if(d)r.setAttribute(l,"")}else r.setAttribute(l,String(d))});let s=()=>{let l=!r.value;return t.element.classList.toggle(`${t.getClass("textfield")}--empty`,l),l},a=(l=!0)=>{let d=r.value&&r.value.length>0,u=r.matches(":-webkit-autofill"),p=window.getComputedStyle(r).backgroundColor,g=p==="rgb(250, 255, 189)"||p==="rgb(232, 240, 254)"||p==="rgb(250, 255, 0)"||p==="rgba(255, 255, 0, 0.1)";if(d||u||g){if(t.element.classList.remove(`${t.getClass("textfield")}--empty`),l&&yt(t)&&(u||g))t.emit("input",{value:r.value,isEmpty:!1,isAutofilled:!0})}},o=null;if(typeof MutationObserver<"u")o=new MutationObserver((l)=>{l.forEach((d)=>{if(d.type==="attributes"&&(d.attributeName==="value"||d.attributeName==="data-autofilled"))a(!0)})}),o.observe(r,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(r.addEventListener("focus",()=>{if(t.element.classList.add(`${t.getClass("textfield")}--focused`),yt(t))t.emit("focus",{isEmpty:s()});a(!1)}),r.addEventListener("blur",()=>{if(t.element.classList.remove(`${t.getClass("textfield")}--focused`),yt(t))t.emit("blur",{isEmpty:s()});a(!1)}),r.addEventListener("input",()=>{if(yt(t))t.emit("input",{value:r.value,isEmpty:s(),isAutofilled:!1});else s()}),r.addEventListener("change",()=>{let l=s();if(a(!1),yt(t))t.emit("change",{value:r.value,isEmpty:l,isAutofilled:r.matches?.(":-webkit-autofill")||!1})}),r.addEventListener("animationstart",(l)=>{if(l.animationName==="onAutoFillStart"||l.animationName?.includes("autofill"))a()}),s(),setTimeout(()=>{a(!1)},0),n)t.element.classList.add(`${t.getClass("textfield")}--multiline`);if(t.element.appendChild(r),St(t)){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(o)o.disconnect();r.remove(),l.call(t.lifecycle)}}return{...t,input:r,setValue(l){return r.value=l||"",s(),this},getValue(){return r.value},setAttribute(l,d){return r.setAttribute(l,d),this},getAttribute(l){return r.getAttribute(l)},removeAttribute(l){return r.removeAttribute(l),this}}};var bo=()=>{};var et=(e={})=>(t)=>{if(!e.label)return t;let n=document.createElement("label"),r=e.labelPosition||"start";if(n.className=`${e.prefix}-${e.componentName}-label ${e.prefix}-${e.componentName}-label--${r}`,n.textContent=e.label,r==="start")if(t.element.firstChild)t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);else t.element.appendChild(n);if(r&&t.componentName!=="slider")t.element.classList.add(`${e.prefix}-${e.componentName}--label-${r}`);return{...t,label:{setText(s){return n.textContent=s,this},getText(){return n.textContent||""},getElement(){return n}}}};var ip=`
6
+ var Vf=Object.create;var{getPrototypeOf:Ff,defineProperty:Mn,getOwnPropertyNames:Ya,getOwnPropertyDescriptor:Uf}=Object,bi=Object.prototype.hasOwnProperty;function Xa(e){return this[e]}var Gf,zf,Wf=(e,t,n)=>{var r=e!=null&&typeof e==="object";if(r){var i=t?Gf??=new WeakMap:zf??=new WeakMap,s=i.get(e);if(s)return s}n=e!=null?Vf(Ff(e)):{};let a=t||!e||!e.__esModule||!bi.call(e,"default")?Mn(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let o of Ya(e))if(!bi.call(a,o))Mn(a,o,{get:Xa.bind(e,o),enumerable:!0})}if(r)i.set(e,a);return a},Kf=(e)=>{var t=(Ka??=new WeakMap).get(e),n;if(t)return t;if(t=Mn({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var r of Ya(e))if(!bi.call(t,r))Mn(t,r,{get:Xa.bind(e,r),enumerable:!(n=Uf(e,r))||n.enumerable})}return Ka.set(e,t),t},Ka;var Yf=(e)=>e;function Xf(e,t){this[e]=Yf.bind(null,t)}var qf=(e,t)=>{for(var n in t)Mn(e,n,{get:t[n],enumerable:!0,configurable:!0,set:Xf.bind(t,n)})};var Y=(e,t,n)=>()=>{if(e)try{t=e(e=0)}catch(r){n=[r]}if(n)throw n[0];return t};var O=(...e)=>(t)=>e.reduce((n,r)=>r(n),t),qa=(...e)=>(t)=>e.reduceRight((n,r)=>r(n),t),ja=(...e)=>(t,n={})=>e.reduce((r,i)=>({...r,...i(r,n)}),t);var Za=(e={})=>({element:null,config:e,setup(){return this}});var On=(e,t={})=>{if(!t)return e;let n=Object.keys(t);if(n.length===1){let r=t[n[0]];if(r!=null)e.setAttribute(n[0],String(r));return e}for(let r in t){let i=t[r];if(i!=null)e.setAttribute(r,String(i))}return e},Qa=(e,t=[])=>{for(let n=0;n<t.length;n++)e.removeAttribute(t[n]);return e},Ja=(e,t)=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.action==="set"&&r.value!=null)e.setAttribute(r.key,String(r.value));else if(r.action==="remove")e.removeAttribute(r.key)}return e},eo=(e,t)=>e.hasAttribute(t),to=(e,t,n="")=>e.getAttribute(t)??n;var X="mtrl",no=(e)=>`mtrl-${e}`,ro=(e,t)=>`${e}--${t}`,io=(e,t)=>`${e}-${t}`,vi,Ti,so;var rt=Y(()=>{((s)=>{s.BUTTON="button";s.TEXTFIELD="textfield";s.CONTAINER="container";s.SNACKBAR="snackbar";s.SWITCH="switch"})(vi||={});((s)=>{s.DISABLED="disabled";s.FOCUSED="focused";s.ACTIVE="active";s.LOADING="loading";s.ERROR="error"})(Ti||={});so={bem:(e,t,n)=>{let r=e;if(t)r+=`-${t}`;if(n)r+=`--${n}`;return r},join:(...e)=>e.filter(Boolean).join(" ")}});var xe,gr,jf=500,Zt=(...e)=>{if(e.length===0)return[];if(e.length===1&&typeof e[0]==="string"){let r=e[0];if(!r)return[];if(!r.includes(" "))return[r];if(gr.has(r))return gr.get(r)}let t=new Set,n=[];for(let r of e)if(typeof r==="string"&&r)if(!r.includes(" ")){if(!t.has(r))t.add(r),n.push(r)}else r.split(" ").forEach((i)=>{let s=i.trim();if(s&&!t.has(s))t.add(s),n.push(s)});else if(Array.isArray(r))r.forEach((i)=>{if(typeof i==="string"&&i)i.split(" ").forEach((s)=>{let a=s.trim();if(a&&!t.has(a))t.add(a),n.push(a)})});if(e.length===1&&typeof e[0]==="string"&&n.length<=10){if(gr.size<jf)gr.set(e[0],n)}return n},te=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return te(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.add(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.add(a)});else e.classList.add(i)}return e},he=(e,...t)=>{if(t.length===0)return e;if(t.length===1&&Array.isArray(t[0]))return he(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.remove(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.remove(a)});else e.classList.remove(i)}return e},hr=(e,...t)=>{if(t.length===1&&Array.isArray(t[0]))return hr(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.toggle(i),e}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" "))i.split(" ").forEach((s)=>{let a=s.trim();if(a)e.classList.toggle(a)});else e.classList.toggle(i)}return e},it=(e,...t)=>{if(t.length===0)return!0;if(t.length===1&&Array.isArray(t[0]))return it(e,...t[0]);if(t.length===1&&typeof t[0]==="string"){let r=t[0];if(r&&!r.includes(" ")){let i=r.startsWith(xe)?r:xe+r;if(!i.includes(" "))return e.classList.contains(i)}}let n=Zt(...t);for(let r of n){let i=r.startsWith(xe)?r:xe+r;if(i.includes(" ")){let s=i.split(" ").map((a)=>a.trim()).filter(Boolean);for(let a of s)if(!e.classList.contains(a))return!1}else if(!e.classList.contains(i))return!1}return!0};var Rn=Y(()=>{rt();xe=`${X}-`,gr=new Map});class oo{pools=new Map;maxSize=20;acquire(e="div"){let t=this.pools.get(e);if(t?.length){let n=t.pop();return n.className="",n.innerHTML="",n.removeAttribute("id"),Object.keys(n.dataset).forEach((r)=>delete n.dataset[r]),n}return document.createElement(e)}release(e){let t=e.tagName.toLowerCase(),n=this.pools.get(t);if(!n)n=[],this.pools.set(t,n);if(n.length<this.maxSize)this.cleanElement(e),n.push(e)}cleanElement(e){let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}e.className="",e.innerHTML="",e.removeAttribute("id"),Object.keys(e.dataset).forEach((n)=>delete e.dataset[n]),e.parentNode?.removeChild(e)}}var Zf,ao=(e,t,n)=>{if(!t||!n?.emit&&!n?.on)return;e.__eventHandlers={};for(let r in t){let i=t[r],s=(o)=>{let l=!0;if(typeof i==="function")try{l=i({...n,element:e},o)}catch(d){console.warn(`Error in event condition for ${r}:`,d),l=!1}else l=Boolean(i);if(l&&n.emit)n.emit(r,{event:o,element:e,originalEvent:o})};e.__eventHandlers[r]=s;let a=Zf.has(r)?{passive:!0}:void 0;e.addEventListener(r,s,a)}},XC,H=(e={})=>{if(!e||Object.keys(e).length===0)return document.createElement("div");if(typeof e==="string")return document.createElement(e);let t=document.createElement(e.tag||"div");if(e.html)t.innerHTML=e.html;else if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.name)t.setAttribute("name",e.name);if(e.title)t.title=e.title;if(e.tabIndex!==void 0)t.tabIndex=e.tabIndex;if(e.style)if(typeof e.style==="string")t.setAttribute("style",e.style);else Object.assign(t.style,e.style);if(e.role)t.setAttribute("role",e.role);if(e.ariaLabel)t.setAttribute("aria-label",e.ariaLabel);if(e.ariaDescribedBy)t.setAttribute("aria-describedby",e.ariaDescribedBy);if(e.ariaLabelledBy)t.setAttribute("aria-labelledby",e.ariaLabelledBy);if(e.ariaHidden!==void 0)t.setAttribute("aria-hidden",String(e.ariaHidden));let n=e.className||e.class;if(n)te(t,n);if(e.rawClass){let r=Array.isArray(e.rawClass)?e.rawClass:e.rawClass.split(" ");t.classList.add(...r.filter(Boolean))}if(e.data)Object.assign(t.dataset,e.data);if(e.attributes)On(t,e.attributes);for(let r in e)if(!["tag","container","html","text","id","name","title","tabIndex","style","role","ariaLabel","ariaDescribedBy","ariaLabelledBy","ariaHidden","data","class","className","rawClass","attributes","forwardEvents","onCreate","context"].includes(r)){let i=e[r];if(i!=null)t.setAttribute(r,String(i))}if(e.forwardEvents)ao(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},lo=(e={})=>{let t=document.createElementNS("http://www.w3.org/2000/svg",e.tag||"svg");if(e.text)t.textContent=e.text;if(e.id)t.id=e.id;if(e.attributes)On(t,e.attributes);if(e.forwardEvents)ao(t,e.forwardEvents,e.context);if(e.container)e.container.appendChild(t);if(e.onCreate)e.onCreate(t,e.context);return t},uo=(e)=>{let t=e.__eventHandlers;if(t){for(let n in t)e.removeEventListener(n,t[n]);delete e.__eventHandlers}};var Qe=Y(()=>{Rn();Zf=new Set(["touchstart","touchmove"]);XC=new oo});function Qf(e){return"touches"in e}function Jf(e){return"clientX"in e&&"clientY"in e}var co=()=>{let e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=window.innerWidth<=768;return e||t},Cr,Tt,Si,ze=()=>("ontouchstart"in window)||navigator.maxTouchPoints>0,Je=(e)=>{if(Qf(e)&&e.touches.length>0){let t=e.touches[0];return{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}}if(Jf(e))return{clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:e.target,preventDefault:()=>e.preventDefault(),stopPropagation:()=>e.stopPropagation(),type:e.type}};var _n=Y(()=>{Cr={passive:!0},Tt={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},Si={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var ep=(e)=>({getClass:(t)=>`${e}-${t}`,getModifierClass:(t,n)=>`${t}--${n}`,getElementClass:(t,n)=>`${t}-${n}`}),M=(e={})=>({config:e,componentName:e.componentName,...ep(e.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState(t,n){let r=Je(t);if(n==="start")this.touchState={startTime:Date.now(),startPosition:{x:r.clientX,y:r.clientY},isTouching:!0,activeTarget:r.target};else if(n==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),R=(e={})=>(t)=>{let n=(d)=>{if(s.updateTouchState(d,"start"),l.classList.add(`${s.getClass("touch-active")}`),e.forwardEvents?.touchstart&&"emit"in t)t.emit("touchstart",Je(d))},r=(d)=>{if(!s.touchState.isTouching)return;let u=Date.now()-s.touchState.startTime;if(l.classList.remove(`${s.getClass("touch-active")}`),s.updateTouchState(d,"end"),u<Tt.TAP_THRESHOLD&&"emit"in t)t.emit("tap",Je(d));if(e.forwardEvents?.touchend&&"emit"in t)t.emit("touchend",Je(d))},i=(d)=>{if(!s.touchState.isTouching)return;let u=Je(d),m=u.clientX-s.touchState.startPosition.x,p=u.clientY-s.touchState.startPosition.y;if(Math.abs(m)>Tt.SWIPE_THRESHOLD&&"emit"in t)t.emit("swipe",{direction:m>0?"right":"left",deltaX:m,deltaY:p});if(e.forwardEvents?.touchmove&&"emit"in t)t.emit("touchmove",{...u,deltaX:m,deltaY:p})},s=t,a=t.config.parent||e.parent;if(typeof a==="string")a=document.querySelector(a);let o={tag:e.tag||"div",className:[s.getClass(e.componentName||s.componentName||"component"),ze()&&e.interactive?s.getClass("interactive"):null,...Array.isArray(e.className)?e.className:[e.className]].filter(Boolean),attributes:e.attributes||{},id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,forwardEvents:e.forwardEvents||{},context:t,container:a},l=H(o);if(ze()&&e.interactive)l.addEventListener("touchstart",n,Cr),l.addEventListener("touchend",r),l.addEventListener("touchmove",i,Cr);return{...t,element:l,addClass(...d){return l.classList.add(...d.filter(Boolean)),this},destroy(){if(ze()&&e.interactive)l.removeEventListener("touchstart",n),l.removeEventListener("touchend",r),l.removeEventListener("touchmove",i);uo(l),l.remove()}}};var Z=Y(()=>{Qe();_n()});var Me=()=>{let e=new Map;return{on:(t,n)=>{let r=e.get(t)||[];return e.set(t,[...r,n]),()=>{let i=e.get(t)||[];e.set(t,i.filter((s)=>s!==n))}},off(t,n){let r=e.get(t)||[];e.set(t,r.filter((i)=>i!==n))},emit:(t,...n)=>{(e.get(t)||[]).forEach((i)=>i(...n))},clear:()=>{e.clear()}}};var B=()=>(e)=>{let t=Me();return{...e,on(n,r){return t.on(n,r),this},off(n,r){return t.off(n,r),this},emit(n,r){return t.emit(n,r),this}}};var mo=()=>{};var tp=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");return a.className=`${r}-${t.componentName||"component"}-text`,a.textContent=s,a};return{setText(s){if(!n&&s)if(n=i(s),t.beforeElement)e.insertBefore(n,t.beforeElement);else e.appendChild(n);else if(n)n.textContent=s;return this},getText(){return n?n.textContent||"":""},getElement(){return n}}},ct=(e)=>(t)=>{let n=tp(t.element,{prefix:e.prefix,componentName:e.componentName||"component"});if(e.text)n.setText(e.text);return{...t,text:n}};var np=(e,t={})=>{let n=null,r=t.prefix||"mtrl",i=(s)=>{let a=document.createElement("span");a.className=`${r}-icon`;let o=`${r}-${t.componentName||"component"}-icon`;if(a.classList.add(o),t.iconPosition)a.classList.add(`${o}--${t.iconPosition}`);if(t.iconSize)a.classList.add(`${r}-icon--${t.iconSize}`);return a.innerHTML=s,a};return{setIcon(s){if(!n&&s)if(n=i(s),t.iconPosition==="end")e.appendChild(n);else{let a=e.querySelector(`[class*="${r}-${t.componentName||"component"}-label"]`);if(a)if(a.nextSibling)e.insertBefore(n,a.nextSibling);else e.appendChild(n);else e.insertBefore(n,e.firstChild)}else if(n&&s)n.innerHTML=s;return this},getIcon(){return n?n.innerHTML:""},getElement(){return n}}},Pe=(e)=>(t)=>{let n=np(t.element,{prefix:e.prefix,componentName:e.componentName||"component",iconPosition:e.iconPosition,iconSize:e.iconSize});if(e.icon)n.setIcon(e.icon);if(t.componentName==="button"&&e.icon&&e.text)t.element.classList.add(`${t.getClass("button")}--icon`);return{...t,icon:n}};var se=(e)=>(t)=>{if(e.variant&&t.element){let n=`${e.prefix}-${e.componentName}--${e.variant}`;t.element.classList.add(n)}return t};var mt=(e)=>(t)=>{if(e.size&&t.element){let n=`${e.prefix}-${e.componentName}--${e.size}`;t.element.classList.add(n)}return t};var fo,Pn=(e)=>(t)=>{if(!e.position||!t.element)return t;let n=fo[e.position.toUpperCase()]||e.position,r=`${e.prefix}-${e.componentName}--${n}`;return t.element.classList.add(r),{...t,position:{setPosition(s){let a=n,o=`${e.prefix}-${e.componentName}--${a}`,l=`${e.prefix}-${e.componentName}--${s}`;return t.element.classList.remove(o),t.element.classList.add(l),this},getPosition(){return n}}}};var po=Y(()=>{((o)=>{o.LEFT="left";o.RIGHT="right";o.TOP="top";o.BOTTOM="bottom";o.START="start";o.END="end";o.CENTER="center"})(fo||={})});var go,Qt,uE;var ho=Y(()=>{((a)=>{a.LINEAR="linear";a.EASE="ease";a.EASE_IN="ease-in";a.EASE_OUT="ease-out";a.EASE_IN_OUT="ease-in-out";a.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(go||={});Qt={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},uE={duration:{type:"number",minimum:0,default:Qt.duration},timing:{type:"string",enum:Object.values(go),default:Qt.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:Qt.opacity}}});var rp=(e={})=>{let t={...Qt,...e,opacity:e.opacity||Qt.opacity},n=new WeakMap,r=[],i=()=>{let l=document.createElement("div");return l.className=`${X}-ripple-wave`,l},s=(l,d)=>{if(typeof document.addEventListener==="function")document.addEventListener(l,d),r.push({event:l,handler:d})},a=(l,d)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(l,d),r=r.filter((u)=>!(u.event===l&&u.handler===d))},o=(l,d)=>{if(!d||!d.__rippleContainer)return;let u=d.__rippleContainer,m=d.getBoundingClientRect(),p=i(),g=Math.max(m.width,m.height)*2,c=l.clientX-m.left-g/2,f=l.clientY-m.top-g/2;Object.assign(p.style,{width:`${g}px`,height:`${g}px`,left:`${c}px`,top:`${f}px`}),u.appendChild(p),p.offsetHeight,requestAnimationFrame(()=>{p.classList.add("active")});let h=()=>{a("mouseup",h),a("mouseleave",h),p.classList.remove("active"),p.classList.add("fade-out"),setTimeout(()=>{if(p.parentNode)p.parentNode.removeChild(p);n.get(d)?.delete(p)},t.duration)};s("mouseup",h),s("mouseleave",h)};return{mount:(l)=>{if(!l)return;if(window.getComputedStyle(l).position==="static")l.style.position="relative";let u=l.querySelector(`.${X}-ripple`);if(!u)u=document.createElement("div"),u.className=`${X}-ripple`,l.appendChild(u);l.__rippleContainer=u,n.set(l,new Set);let m=(p)=>o(p,l);if(!l.__rippleHandlers)l.__rippleHandlers=[];l.__rippleHandlers.push(m),l.addEventListener("mousedown",m)},unmount:(l)=>{if(!l)return;if(r.forEach(({event:d,handler:u})=>{a(d,u)}),r=[],l.__rippleHandlers)l.__rippleHandlers.forEach((d)=>{l.removeEventListener("mousedown",d)}),l.__rippleHandlers=[];if(n.has(l)){let d=n.get(l);if(d)d.forEach((u)=>{if(u.parentNode)u.parentNode.removeChild(u)});n.delete(l)}if(l.__rippleContainer&&l.__rippleContainer.parentNode)l.__rippleContainer.parentNode.removeChild(l.__rippleContainer),delete l.__rippleContainer}}},Le=(e)=>(t)=>{if(!e.ripple)return t;let n=rp(e.rippleConfig);if(n.mount(t.element),t.lifecycle){let r=t.lifecycle.mount,i=t.lifecycle.destroy;t.lifecycle.mount=()=>{r.call(t.lifecycle)},t.lifecycle.destroy=()=>{n.unmount(t.element),i.call(t.lifecycle)}}return{...t,ripple:n}};var Co=Y(()=>{ho();rt()});function Eo(e){return"emit"in e&&typeof e.emit==="function"}var Bt=(e={})=>(t)=>{let n=document.createElement("input"),r=t.componentName||"component";n.type="checkbox",n.className=`${t.getClass(r)}-input`,n.style.position="absolute",n.style.opacity="0",n.style.cursor="pointer",t.element.setAttribute("role","presentation"),n.setAttribute("role",r);let i={name:e.name,checked:e.checked,required:e.required,disabled:e.disabled,value:e.value||"on","aria-label":e.label||e.ariaLabel};return Object.entries(i).forEach(([s,a])=>{if(a!==null&&a!==void 0)if(s==="disabled"&&a===!0)n.disabled=!0,n.setAttribute("disabled","true");else if(a===!0)n.setAttribute(s,s);else n.setAttribute(s,String(a))}),n.addEventListener("change",(s)=>{if(Eo(t))t.emit("change",{checked:n.checked,value:n.value,nativeEvent:s})}),n.addEventListener("keydown",(s)=>{if(s.key===" "||s.key==="Enter"){if(s.preventDefault(),!n.disabled)n.checked=!n.checked,n.dispatchEvent(new Event("change",{bubbles:!0}))}}),t.element.appendChild(n),{...t,input:n,getValue:()=>n.value,setValue(s){if(n.value=s,Eo(t))t.emit("value",{value:s});return this}}};var Ht=(e={})=>(t)=>{if(!t.input)return t;let n=t.componentName||"component",r=()=>{t.element.classList.toggle(`${t.getClass(n)}--checked`,t.input.checked)};if(e.checked!==void 0)t.input.checked=e.checked;if(r(),t.emit)t.on?.("change",r);return{...t,checkable:{check(){if(!t.input.checked)t.input.checked=!0,r(),t.emit?.("change",{checked:!0,value:t.input.value});return this},uncheck(){if(t.input.checked)t.input.checked=!1,r(),t.emit?.("change",{checked:!1,value:t.input.value});return this},toggle(){return t.input.checked=!t.input.checked,r(),t.emit?.("change",{checked:t.input.checked,value:t.input.value}),this},isChecked(){return t.input.checked}}}};var yi=(e={})=>(t)=>{if(e.variant)t.element.classList.add(`${t.getClass("button")}--${e.variant}`);if(e.size)t.element.classList.add(`${t.getClass("button")}--${e.size}`);return t};function St(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}function yt(e){return"emit"in e&&typeof e.emit==="function"}var kn=(e={})=>(t)=>{let n=e.multiline||e.type==="multiline",r=document.createElement(n?"textarea":"input");r.className=`${t.getClass("textfield")}-input`;let i={name:e.name,required:e.required,disabled:e.disabled,maxLength:e.maxLength,pattern:e.pattern,autocomplete:e.autocomplete,value:e.value||"",placeholder:e.placeholder||" "};if(!n)i.type=e.type||"text";else i["data-type"]="multiline";Object.entries(i).forEach(([l,d])=>{if(d!==null&&d!==void 0)if(typeof d==="boolean"){if(d)r.setAttribute(l,"")}else r.setAttribute(l,String(d))});let s=()=>{let l=!r.value;return t.element.classList.toggle(`${t.getClass("textfield")}--empty`,l),l},a=(l=!0)=>{let d=r.value&&r.value.length>0,u=r.matches(":-webkit-autofill"),p=window.getComputedStyle(r).backgroundColor,g=p==="rgb(250, 255, 189)"||p==="rgb(232, 240, 254)"||p==="rgb(250, 255, 0)"||p==="rgba(255, 255, 0, 0.1)";if(d||u||g){if(t.element.classList.remove(`${t.getClass("textfield")}--empty`),l&&yt(t)&&(u||g))t.emit("input",{value:r.value,isEmpty:!1,isAutofilled:!0})}},o=null;if(typeof MutationObserver<"u")o=new MutationObserver((l)=>{l.forEach((d)=>{if(d.type==="attributes"&&(d.attributeName==="value"||d.attributeName==="data-autofilled"))a(!0)})}),o.observe(r,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(r.addEventListener("focus",()=>{if(t.element.classList.add(`${t.getClass("textfield")}--focused`),yt(t))t.emit("focus",{isEmpty:s()});a(!1)}),r.addEventListener("blur",()=>{if(t.element.classList.remove(`${t.getClass("textfield")}--focused`),yt(t))t.emit("blur",{isEmpty:s()});a(!1)}),r.addEventListener("input",()=>{if(yt(t))t.emit("input",{value:r.value,isEmpty:s(),isAutofilled:!1});else s()}),r.addEventListener("change",()=>{let l=s();if(a(!1),yt(t))t.emit("change",{value:r.value,isEmpty:l,isAutofilled:r.matches?.(":-webkit-autofill")||!1})}),r.addEventListener("animationstart",(l)=>{if(l.animationName==="onAutoFillStart"||l.animationName?.includes("autofill"))a()}),s(),setTimeout(()=>{a(!1)},0),n)t.element.classList.add(`${t.getClass("textfield")}--multiline`);if(t.element.appendChild(r),St(t)){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(o)o.disconnect();r.remove(),l.call(t.lifecycle)}}return{...t,input:r,setValue(l){return r.value=l||"",s(),this},getValue(){return r.value},setAttribute(l,d){return r.setAttribute(l,d),this},getAttribute(l){return r.getAttribute(l)},removeAttribute(l){return r.removeAttribute(l),this}}};var bo=()=>{};var et=(e={})=>(t)=>{if(!e.label)return t;let n=document.createElement("label"),r=e.labelPosition||"start";if(n.className=`${e.prefix}-${e.componentName}-label ${e.prefix}-${e.componentName}-label--${r}`,n.textContent=e.label,r==="start")if(t.element.firstChild)t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);else t.element.appendChild(n);if(r&&t.componentName!=="slider")t.element.classList.add(`${e.prefix}-${e.componentName}--label-${r}`);return{...t,label:{setText(s){return n.textContent=s,this},getText(){return n.textContent||""},getElement(){return n}}}};var ip=`
7
7
  <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
8
8
  <polyline points="20 6 9 17 4 12"></polyline>
9
- </svg>`,kn=(e)=>(t)=>{let n=document.createElement("span");n.className=`${e.prefix}-${e.componentName}-track`;let r=document.createElement("span");if(r.className=`${e.prefix}-${e.componentName}-thumb`,n.appendChild(r),e.icon!=="none"){let i=document.createElement("span");i.className=`${e.prefix}-${e.componentName}-thumb-icon`,i.innerHTML=e.icon||ip,r.appendChild(i)}return t.element.appendChild(n),{...t,track:n,thumb:r}};var Er=(e)=>{let t=new Map;return{on(n,r){return e.addEventListener(n,r),t.set(r,n),this},off(n,r){return e.removeEventListener(n,r),t.delete(r),this},destroy(){t.forEach((n,r)=>{e.removeEventListener(n,r)}),t.clear()},getHandlers(){return new Map(t)}}};var xi=(e)=>(t)=>{let n=Er(e||t.element),r={addListeners(i){return Object.entries(i).forEach(([s,a])=>{n.on(s,a)}),this},removeListeners(i){return Object.entries(i).forEach(([s,a])=>{n.off(s,a)}),this},once(i,s){let a=(o)=>{s(o),n.off(i,a)};return n.on(i,a),this},on(i,s){return n.on(i,s),this},off(i,s){return n.off(i,s),this},destroy(){n.destroy()}};if(St(t)){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{n.destroy(),i.call(t.lifecycle)}}return{...t,events:r,on:r.on.bind(r),off:r.off.bind(r)}};var vo=()=>{};var Jt=(e,t,n={})=>{let r=null,i=0,{leading:s=!0,trailing:a=!0}=n;return function(...o){let l=Date.now();if(!i&&!s)i=l;let d=t-(l-i);if(d<=0||d>t){if(r)clearTimeout(r),r=null;i=l,e.apply(this,o)}else if(!r&&a)r=window.setTimeout(()=>{i=s?Date.now():0,r=null,e.apply(this,o)},d)}},en=(e,t,n={})=>{let r=null,i=null,s=null,a,o=null,l=0,{leading:d=!1,maxWait:u}=n,c=(m)=>{let h=m-(o||0),C=m-l;return!o||h>=t||h<0||u!==void 0&&C>=u},p=(m)=>{let h=i,C=s;return i=s=null,l=m,a=e.apply(C,h),a},g=(m)=>{if(r=null,i)return p(m);return a},f=(m)=>(l=m,r=window.setTimeout(()=>{g(Date.now())},t),d?p(m):a);return function(...m){let h=Date.now(),C=c(h);if(i=m,s=this,o=h,C){if(r===null)return f(h);if(u!==void 0)r=window.setTimeout(()=>{let T=Date.now();if(c(T))return g(T)},Math.min(t,u-(h-l)))}if(r===null)r=window.setTimeout(()=>{g(Date.now())},t);return a}},br=(e)=>{let t=!1,n;return function(...r){if(!t)t=!0,n=e.apply(this,r);return n}};var Ii=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Jt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,throttled:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.throttled),delete n[a];return s};if(St(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.throttled)}),a.call(t.lifecycle)}}if(e.throttledEvents)Object.entries(e.throttledEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addThrottledEvent:r,removeThrottledEvent:i};return s};var To=()=>{};function sp(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}var Li=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=en(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,debounced:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.debounced),delete n[a];return s};if(sp(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.debounced)}),a.call(t.lifecycle)}}if(e.debouncedEvents)Object.entries(e.debouncedEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addDebouncedEvent:r,removeDebouncedEvent:i};return s};var So=()=>{};function Ai(e){return"input"in e&&e.input instanceof HTMLElement&&"disabled"in e.input}var oe=(e)=>(t)=>{let n=`${t.getClass(e.componentName||t.componentName||"component")}--disabled`,r={enable(){if(t.element.classList.remove(n),Ai(t))t.input.disabled=!1,t.input.removeAttribute("disabled");else{let i=t.element;if("disabled"in i)i.disabled=!1;t.element.removeAttribute("disabled")}return this},disable(){if(t.element.classList.add(n),Ai(t))t.input.disabled=!0,t.input.setAttribute("disabled","true");else{let i=t.element;if("disabled"in i)i.disabled=!0;t.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(Ai(t))return t.input.disabled;let i=t.element;return"disabled"in i&&i.disabled}};if(e.disabled)requestAnimationFrame(()=>{r.disable()});return{...t,disabled:r}};function ap(e){return"events"in e&&e.events&&typeof e.events==="object"&&"destroy"in e.events&&typeof e.events.destroy==="function"}function op(e){return"text"in e&&e.text&&typeof e.text==="object"&&"getElement"in e.text&&typeof e.text.getElement==="function"}function lp(e){return"icon"in e&&e.icon&&typeof e.icon==="object"&&"getElement"in e.icon&&typeof e.icon.getElement==="function"}var P=()=>(e)=>{let t=!1,n=Me();return{...e,lifecycle:{onMount:(i)=>n.on("mount",i),onUnmount:(i)=>n.on("unmount",i),mount:()=>{if(!t)t=!0,n.emit("mount")},unmount:()=>{if(t)t=!1,n.emit("unmount"),n.clear()},isMounted:()=>t,destroy(){if(t)this.unmount();if(ap(e))e.events.destroy();if(op(e)){let i=e.text.getElement();if(i)i.remove()}if(lp(e)){let i=e.icon.getElement();if(i)i.remove()}if(e.element)e.element.remove()}}}};var yo=()=>{};var J=K(()=>{mo();po();Co();bo();vo();To();So();yo()});var ne=K(()=>{Z();J()});function Ni(e,t){Hn[e]=t}function $n(e){return Hn[e]||{}}function wi(e){Object.assign(Hn,e)}function Di(){Object.keys(Hn).forEach((e)=>{delete Hn[e]})}var Hn;var Mi=K(()=>{Hn={}});var _=(e,t={},n)=>{let r=$n(n),i=t.className!==void 0?t.className:t.class,s=e.className!==void 0?e.className:e.class,a={...e,...r,...t,componentName:n,prefix:Y,className:i!==void 0?i:s};if("class"in a&&a.className!==void 0)delete a.class;return a},V=(e,t)=>{let n=e.className||e.class,r=t.className,i=[...Array.isArray(n)?n:[n],...Array.isArray(r)?r:[r]].filter(Boolean),s=t.attributes||{};return{tag:t.tag,componentName:e.componentName,attributes:s,className:i.length>0?i:void 0,rawClass:e.rawClass,id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,html:t.html,text:t.text,forwardEvents:t.forwardEvents||{},interactive:t.interactive}};var Q=K(()=>{rt();Mi()});var zo=(e)=>{let t=new Map,n=(s,a)=>`${s}_${a.toString()}`,r=(s,a)=>(o)=>{try{s(o)}catch(l){console.error(`Error in ${a} handler:`,l)}},i=(s,a)=>{try{e.removeEventListener(s,a)}catch(o){console.warn(`Failed to remove ${s} listener:`,o)}};return{on(s,a,o={}){let l=r(a,s),d=n(s,a);return t.set(d,{original:a,enhanced:l,event:s,options:o}),e.addEventListener(s,l,o),this},off(s,a){let o=n(s,a),l=t.get(o);if(l)i(s,l.enhanced),t.delete(o);return this},pause(){return t.forEach(({enhanced:s,event:a})=>{i(a,s)}),this},resume(){return t.forEach(({enhanced:s,event:a,options:o})=>{e.addEventListener(a,s,o)}),this},destroy(){t.forEach(({enhanced:s,event:a})=>{i(a,s)}),t.clear()},getHandlers(){return new Map(t)},hasHandler(s,a){let o=n(s,a);return t.has(o)}}};var nn=K(()=>{Qe();Rn()});var Tr,We,Wo,st,be,Fn,Ae,at,Oe,rn,Sr;var ft=K(()=>{Tr={LINEAR:"linear",CIRCULAR:"circular"},We={FLAT:"flat",WAVY:"wavy"},Wo={CHANGE:"change",COMPLETE:"complete"},st={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1,LABEL:"Loading"},be={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},Fn={INDICATOR:"sys-color-primary",TRACK:"sys-color-secondary-container",STOP:"sys-color-primary",BUFFER:"sys-color-primary-container"},Ae={LINEAR:{HEIGHT:4,GAP:4,STOP_INDICATOR:4,STOP_TRAILING_SPACE:6,WAVE_HEIGHT:10,EDGE_INSET:4,MIN_HEIGHT:4},CIRCULAR:{SIZE:40,WAVE_SIZE:48,GAP:4,MIN_SIZE:24,MAX_SIZE:240},COMMON:{STROKE_WIDTH:4}},at={THIN:4,THICK:8},Oe={LINEAR:{WAVELENGTH:40,INDETERMINATE_WAVELENGTH:20,AMPLITUDE:3},CIRCULAR:{WAVELENGTH:15,AMPLITUDE:1.6},SPEED:1,AMPLITUDE_START:0.1,AMPLITUDE_END:0.95,AMPLITUDE_DURATION:500},rn={LINEAR:{DURATION:1750,FIRST_HEAD_DELAY:0,FIRST_HEAD_DURATION:1000,FIRST_TAIL_DELAY:250,FIRST_TAIL_DURATION:1000,SECOND_HEAD_DELAY:650,SECOND_HEAD_DURATION:850,SECOND_TAIL_DELAY:900,SECOND_TAIL_DURATION:850},CIRCULAR:{DURATION:6000,ROTATION_DURATION:300,ROTATION_DELAY:1500,GLOBAL_ROTATION:1080,ADDITIONAL_ROTATION:360,MIN_PROGRESS:0.1,MAX_PROGRESS:0.87},VALUE_DURATION:500},Sr={EMPHASIZED_ACCELERATE:[0.3,0,0.8,0.15],EMPHASIZED_DECELERATE:[0.05,0.7,0.1,1],STANDARD:[0.2,0,0,1],LINEAR:[0,0,1,1]}});var Un=(e,t,n)=>{let r=null,i=()=>{if(r)clearTimeout(r);r=window.setTimeout(()=>{n()},100)};if(typeof ResizeObserver<"u"){let s=new ResizeObserver((a)=>{for(let o of a){let{width:l}=o.contentRect,d=parseFloat(t.style.width||"0");if(Math.abs(l-d)>2)i()}});return s.observe(e),()=>{if(r)clearTimeout(r);s.disconnect()}}else return window.addEventListener("resize",i),()=>{if(r)clearTimeout(r);window.removeEventListener("resize",i)}};var Oi=(e)=>Boolean(e&&typeof e==="object"&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})),Ri=(e,t)=>{let i=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),s=e;for(let a=0,o=i.length;a<o;++a){let l=i[a];if(l in s)s=s[l];else return}return s};var xt=(e,t=17)=>{if(!e||!(e instanceof HTMLElement))return{color:"",element:null};let n=0,r=e;while(r&&n<t){let a=window.getComputedStyle(r).backgroundColor;if(a.startsWith("var(")){let o=a.match(/var\((--[\w-]+)\)/);if(o){let l=o[1];a=window.getComputedStyle(document.documentElement).getPropertyValue(l).trim()||"transparent"}}if(a&&a!=="transparent"&&a!=="rgba(0, 0, 0, 0)"&&a!=="rgba(0,0,0,0)")return{color:a,element:r};r=r.parentElement,n++}let i=window.getComputedStyle(document.body).backgroundColor;if(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)")return{color:i,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var _i=()=>{};function Be(e,t){let n=`--${Y}-${e}`;if(t?.onThemeChange)Gn(t.onThemeChange);let i=getComputedStyle(document.body).getPropertyValue(n).trim();if(!i)i=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(!i&&t?.fallback)return t.fallback;if(!i)return"";if(typeof t?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(i))return`rgba(${i}, ${t.alpha})`;if(typeof t?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(i)){let s=i.replace("#",""),a,o,l;if(s.length===3)a=parseInt(s[0]+s[0],16),o=parseInt(s[1]+s[1],16),l=parseInt(s[2]+s[2],16);else a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t.alpha})`}return i}var yr,It=null,bp=()=>{if(It)return;It=new MutationObserver((t)=>{for(let n of t)if(n.type==="attributes"&&(n.attributeName==="data-theme"||n.attributeName==="data-theme-mode")){yr.forEach((r)=>r());break}});let e={attributes:!0,attributeFilter:["data-theme","data-theme-mode"]};if(It.observe(document.documentElement,e),document.body)It.observe(document.body,e)},Gn=(e)=>{if(!It)bp();return yr.add(e),()=>{yr.delete(e)}};var xr=K(()=>{rt();yr=new Set;if(typeof window<"u")window.addEventListener("unload",()=>{if(It)It.disconnect(),It=null;yr.clear()})});var zn=(e,t)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return`rgba(0, 0, 0, ${t})`;r.fillStyle=e;let i=r.fillStyle;if(i.startsWith("#")){let s=i.substring(1),a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t})`}if(i.startsWith("rgb")){let s=i.match(/\d+/g);if(s){let[a,o,l]=s;return`rgba(${a}, ${o}, ${l}, ${t})`}}return`rgba(0, 0, 0, ${t})`};var Ko=(e,t)=>(n,r)=>e(n,r)?t(n,r):n,Yo=(...e)=>e.filter(Boolean).join(" ");var Wn=K(()=>{_n();_i();xr()});var Kn,vp=()=>({indicator:Be(Fn.INDICATOR,{fallback:Kn.indicator}),track:Be(Fn.TRACK,{fallback:Kn.track}),stop:Be(Fn.STOP,{fallback:Kn.stop}),buffer:Be(Fn.BUFFER,{fallback:Kn.buffer})}),Xo=(e)=>{let t=Kn,n=!1,r=()=>{try{t=vp(),n=!0}catch{}},i=Gn(()=>{r(),e()});return{get:()=>{if(!n)r();return t},refresh:r,destroy:i}};var qo=K(()=>{Wn();xr();ft();Kn={indicator:"#6750A4",track:"#E8DEF8",stop:"#6750A4",buffer:"#EADDFF"}});var Tp=(e,t,n,r)=>{let i=(s,a,o)=>{let l=1-o;return 3*l*l*o*s+3*l*o*o*a+o*o*o};return(s)=>{if(s<=0)return 0;if(s>=1)return 1;let a=s;for(let d=0;d<8;d++){let u=i(e,n,a)-s;if(Math.abs(u)<0.00001)return i(t,r,a);let c=3*(1-a)*(1-a)*e+6*(1-a)*a*(n-e)+3*a*a*(1-n);if(Math.abs(c)<0.000001)break;a-=u/c}let o=0,l=1;a=s;while(l-o>0.00001){if(i(e,n,a)<s)o=a;else l=a;a=(o+l)/2}return i(t,r,a)}},Pi=(e)=>Tp(e[0],e[1],e[2],e[3]),Zo,Sp,Qo,Ir=(e,t,n)=>{if(e<=t)return 0;if(e>=t+n)return 1;return Zo((e-t)/n)},Jo=(e)=>{let t=rn.LINEAR,n=(e%t.DURATION+t.DURATION)%t.DURATION;return{firstHead:Ir(n,t.FIRST_HEAD_DELAY,t.FIRST_HEAD_DURATION),firstTail:Ir(n,t.FIRST_TAIL_DELAY,t.FIRST_TAIL_DURATION),secondHead:Ir(n,t.SECOND_HEAD_DELAY,t.SECOND_HEAD_DURATION),secondTail:Ir(n,t.SECOND_TAIL_DELAY,t.SECOND_TAIL_DURATION)}},jo=(e,t,n=(r)=>r)=>{let r=t[0];if(e<=r[0])return r[1];for(let i=1;i<t.length;i++){let[s,a]=t[i],[o,l]=t[i-1];if(e<=s){let d=s-o,u=d<=0?1:n((e-o)/d);return l+(a-l)*u}}return t[t.length-1][1]},el=(e)=>{let t=rn.CIRCULAR,n=(e%t.DURATION+t.DURATION)%t.DURATION,r=n/t.DURATION*t.GLOBAL_ROTATION,i=t.ADDITIONAL_ROTATION/4,s=Math.floor(n/t.ROTATION_DELAY),a=n-s*t.ROTATION_DELAY,o=a>=t.ROTATION_DURATION?i:i*Sp(a/t.ROTATION_DURATION),l=s*i+o,d=t.DURATION/2,u=n<=d?jo(n,[[0,t.MIN_PROGRESS],[d,t.MAX_PROGRESS]]):jo(n,[[d,t.MAX_PROGRESS],[t.DURATION,t.MIN_PROGRESS]],Qo);return{rotation:r+l,sweep:u}},tl=(e)=>e<=Oe.AMPLITUDE_START||e>=Oe.AMPLITUDE_END?0:1,Bi=(e,t,n)=>{if(e===t)return t;let r=Math.min(1,Math.max(0,n/Oe.AMPLITUDE_DURATION)),i=t>e?Qo:Zo;return e+(t-e)*i(r)};var Lr=K(()=>{ft();Zo=Pi(Sr.EMPHASIZED_ACCELERATE),Sp=Pi(Sr.EMPHASIZED_DECELERATE),Qo=Pi(Sr.STANDARD)});var Yn,nl,ki=(e,t,n,r,i,s,a,o,l)=>{if(s<=0||r<=0)return;if(e.strokeStyle=a,e.lineWidth=o,e.lineCap="round",e.lineJoin="round",e.beginPath(),!l||l.amplitude<=0){e.arc(t,n,r,i,i+s),e.stroke();return}let d=s*r,u=Math.max(8,Math.ceil(d/Math.max(1,l.wavelength/24)));for(let c=0;c<=u;c++){let p=c/u,g=i+s*p,f=p*d,m=r+l.amplitude*Math.sin(Yn*(f-l.phase)/l.wavelength),h=t+Math.cos(g)*m,C=n+Math.sin(g)*m;if(c===0)e.moveTo(h,C);else e.lineTo(h,C)}e.stroke()},rl=(e,t)=>{let{ctx:n,width:r,height:i}=e,{strokeWidth:s,colors:a,indeterminate:o,waveAmplitude:l}=t;if(r<=0||i<=0)return;let d=Math.min(r,i),u=r/2,c=i/2,p=d/2-s/2-l;if(p<=0)return;n.clearRect(0,0,r,i);let g=d/Ae.CIRCULAR.SIZE,f=Oe.CIRCULAR.WAVELENGTH*g,m=l>0?{amplitude:l,wavelength:f,phase:t.time/1000*Oe.SPEED*f%f}:void 0,h=Ae.CIRCULAR.GAP+s,C=d>0?h/(Math.PI*d)*Yn:0;if(o){let{rotation:S,sweep:y}=el(t.time),L=S*Math.PI/180;ki(n,u,c,p,L,y*Yn,a.indicator,s,m);return}let b=Math.min(1,Math.max(0,t.progress))*Yn,E=Math.min(b,C),v=Yn-b-E*2;if(v>0)ki(n,u,c,p,nl+b+E,v,a.track,s);ki(n,u,c,p,nl,b,a.indicator,s,m)};var il=K(()=>{Lr();ft();Yn=Math.PI*2,nl=-Math.PI/2});var yp=(e,t,n,r,i,s,a,o,l)=>{let d=Math.min(i,s),u=Math.max(i,s);if(u-d<=0)return;let c=r/2,p=(b)=>{let E=o?1-b:b;return Math.min(Math.max(E*t,c),t-c)},g=p(d),f=p(u);if(Math.abs(f-g)<0.000001&&d!==u)return;if(e.strokeStyle=a,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),!l||l.amplitude<=0){e.moveTo(Math.min(g,f),n),e.lineTo(Math.max(g,f),n),e.stroke();return}let m=Math.min(g,f),h=Math.max(g,f),C=Math.max(1,l.wavelength/24);for(let b=m;b<=h;b+=C){let E=n+l.amplitude*Math.sin(2*Math.PI*(b-l.phase)/l.wavelength);if(b===m)e.moveTo(b,E);else e.lineTo(b,E)}let T=n+l.amplitude*Math.sin(2*Math.PI*(h-l.phase)/l.wavelength);e.lineTo(h,T),e.stroke()},xp=(e,t,n,r,i)=>{let s=Math.min(Ae.LINEAR.STOP_INDICATOR,n),a=Math.min((n-s)/2,Ae.LINEAR.STOP_TRAILING_SPACE),o=i?s/2+a:t-s/2-a;e.fillStyle=r,e.beginPath(),e.arc(o,n/2,s/2,0,2*Math.PI),e.fill()},sl=(e,t)=>{let{ctx:n,width:r,height:i}=e,{strokeWidth:s,colors:a,rtl:o,indeterminate:l,waveAmplitude:d}=t;if(r<=0||i<=0)return;let u=i/2;n.clearRect(0,0,r,i);let c=Ae.LINEAR.GAP+s,p=r>0?c/r:0,g=l?Oe.LINEAR.INDETERMINATE_WAVELENGTH:Oe.LINEAR.WAVELENGTH,f=d>0?{amplitude:d,wavelength:g,phase:t.time/1000*Oe.SPEED*g%g}:void 0,m=(T,b,E,v=!1)=>yp(n,r,u,s,T,b,E,o,v?f:void 0);if(l){let{firstHead:T,firstTail:b,secondHead:E,secondTail:v}=Jo(t.time);if(T<1-p)m(T>0?T+p:0,1,a.track);if(T-b>0)m(b,T,a.indicator,!0);if(b>p)m(E>0?E+p:0,b<1?b-p:1,a.track);if(E-v>0)m(v,E,a.indicator,!0);if(v>p)m(0,v-p,a.track);return}let h=Math.min(1,Math.max(0,t.progress)),C=h+Math.min(h,p);if(C<=1)m(C,1,a.track);if(t.buffer>h){let T=Math.min(1,t.buffer);if(T>C)m(C,T,a.buffer)}if(m(0,h,a.indicator,!0),t.showStopIndicator)xp(n,r,i,a.stop,o)};var al=K(()=>{Lr();ft()});var Ip=(e="thin")=>{if(typeof e==="number")return e;return e==="thick"?at.THICK:at.THIN},ll=(e,t,n)=>e?Oe.CIRCULAR.AMPLITUDE*(n/Ae.CIRCULAR.SIZE):Oe.LINEAR.AMPLITUDE*(t/at.THIN),ol=(e)=>{let t=e.shape===We.WAVY?Ae.CIRCULAR.WAVE_SIZE:Ae.CIRCULAR.SIZE;return Math.max(Ae.CIRCULAR.MIN_SIZE,Math.min(e.size??t,Ae.CIRCULAR.MAX_SIZE))},Lp=(e,t)=>t?e+2*ll(!1,e,0):e,dl=(e)=>(t)=>{let n=e.variant===Tr.CIRCULAR,r=t.element.ownerDocument?.defaultView??null,i=document.createElement("canvas");i.className=`${t.getClass(be.CONTAINER)}-canvas`,i.setAttribute("aria-hidden","true"),t.element.appendChild(i);let s=null,a=e.thickness??"thin",o=e.shape??We.FLAT,l=ol(e),d=e.value??0,u=d,c=null,p=0,g=0,f=0,m=0,h=null,C=0,T=0,b=r?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,E=()=>o===We.WAVY,v=()=>Ip(a),S=()=>t.state?.max??e.max??100,y=()=>t.state?.indeterminate??e.indeterminate??!1,L=Xo(()=>N(C)),I=()=>{if(!s)return;let R=r?.devicePixelRatio||1,re,ue;if(n)re=ue=l;else{let Ue=t.element.getBoundingClientRect?.();re=Math.max(Ue?.width||t.element.offsetWidth||0,0),ue=Lp(v(),E())}i.style.width=`${re}px`,i.style.height=`${ue}px`,i.width=Math.round(re*R),i.height=Math.round(ue*R),s.width=re,s.height=ue,s.pixelRatio=R,s.ctx.setTransform(1,0,0,1,0,0),s.ctx.scale(R,R)},x=()=>{if(typeof i.getContext!=="function")return!1;let R=i.getContext("2d");if(!R)return!1;return s={canvas:i,ctx:R,width:0,height:0,pixelRatio:r?.devicePixelRatio||1},I(),t.ctx=R,!0},A=()=>{if(!E())return 0;let R=ll(n,v(),l);if(y())return R;let re=Bi(g,f,(r?.performance??performance).now()-m);return R*re},N=(R=C)=>{if(!s||s.width<=0||s.height<=0)return;let re=y(),ue=re?0:d/S();if(n)rl(s,{progress:ue,indeterminate:re,strokeWidth:v(),time:R,waveAmplitude:A(),colors:L.get()});else{let Ue=r?.getComputedStyle?.(t.element)?.direction==="rtl";sl(s,{progress:ue,buffer:(t.state?.buffer??e.buffer??0)/S(),indeterminate:re,strokeWidth:v(),time:R,waveAmplitude:A(),rtl:Ue,colors:L.get(),showStopIndicator:!re&&e.showStopIndicator!==!1})}},k=()=>!b?.matches&&(y()||E()),X=(R=0)=>{if(U(),!k()){N(0);return}T=0;let re=(ue)=>{if(T===0)T=ue-R;C=ue-T,N(C),h=k()?requestAnimationFrame(re):null};h=requestAnimationFrame(re)},U=()=>{if(h!==null)cancelAnimationFrame(h),h=null},j=()=>{if(c!==null)cancelAnimationFrame(c),c=null},pe=(R)=>{let re=tl(R);if(re===f)return;g=Bi(g,f,(r?.performance??performance).now()-m),f=re,m=(r?.performance??performance).now()},ge=(R)=>{t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:R,max:S()}}))};t.setValue=(R,re=!0)=>{if(u=Math.max(0,Math.min(S(),R)),pe(u/S()),c!==null&&re)return;if(j(),!re||b?.matches){if(d=u,N(),u>=S())ge(u);return}let ue=d,Ue=(r?.performance??performance).now(),ut=Ue-p,wn=p>0&&ut<rn.VALUE_DURATION?Math.max(100,ut*0.9):rn.VALUE_DURATION;p=Ue;let qt=(Dn)=>{let jt=Math.min((Dn-Ue)/wn,1);if(d=ue+(u-ue)*jt,h===null)N();if(jt<1)c=requestAnimationFrame(qt);else{if(c=null,d=u,h===null)N();if(u>=S())ge(u)}};c=requestAnimationFrame(qt)},t.setIndeterminate=(R)=>{if(t.state)t.state.indeterminate=R;if(j(),d=t.state?.value??d,!R)pe(d/S());if(X(),!k())N(0)},t.setThickness=(R)=>{a=R,I(),N()},t.setShape=(R)=>{if(o===R)return;if(o=R,t.currentShape=R,t.state)t.state.shape=R;if(n&&e.size===void 0)l=ol({...e,shape:R});if(R===We.WAVY)g=0,f=0,m=(r?.performance??performance).now(),pe(d/S());if(I(),X(C),!k())N(0)},t.setSize=(R)=>{if(!n)return;l=Math.max(Ae.CIRCULAR.MIN_SIZE,Math.min(R,Ae.CIRCULAR.MAX_SIZE)),I(),N()},t.getSize=()=>n?l:void 0,t.hide=()=>(t.element.classList.add(t.getClass(be.TRANSITION)),t.element.setAttribute("hidden",""),U(),j(),t),t.show=()=>{if(t.element.classList.add(t.getClass(be.TRANSITION)),t.element.removeAttribute("hidden"),I(),X(C),!k())N(0);return t},t.isVisible=()=>!t.element.hasAttribute("hidden");let w=()=>{I(),N()};if(!x())requestAnimationFrame(()=>{if(x())X(),N()});let W=Un(t.element,i,w);if(E()&&!y())m=(r?.performance??performance).now(),pe(d/S());N(),X();let ee=t.lifecycle?.destroy;return t.lifecycle={...t.lifecycle??{},destroy:()=>{W(),L.destroy(),U(),j(),ee?.()}},{...t,canvas:i,ctx:s?.ctx,draw:N,resize:w}};var ul=K(()=>{ft();qo();il();al();Lr()});var cl=(e)=>(t)=>{if(e.indeterminate&&t.element)te(t.element,be.INDETERMINATE),t.element.removeAttribute("aria-valuenow");if(t.element){let r=t.getClass?.(be.CONTAINER)||"";t.element.classList.remove(`${r}--thin`,`${r}--thick`)}if(e.shape&&e.shape!==We.FLAT&&t.element){if(!t.element.classList.contains(t.getClass?.(be.CIRCULAR)||"")){let i=t.getClass?.(be.CONTAINER)||"";te(t.element,`${i}--${e.shape}`)}}let n={value:e.value??0,max:e.max??100,buffer:e.buffer??0,indeterminate:e.indeterminate===!0,thickness:e.thickness??"thin",shape:e.shape??We.FLAT,labelFormatter:e.labelFormatter??((r,i)=>`${Math.round(r/i*100)}%`),showLabel:e.showLabel};return t.state=n,{...t,state:n}};var ml=K(()=>{ft();nn()});var fl=(e)=>(t)=>{let{element:n,getClass:r,canvas:i}=t,s=n.classList.contains(r(be.CIRCULAR)),a=(u,c)=>{n.dispatchEvent(new CustomEvent(u,{detail:c}))},o=(u,c)=>{n.setAttribute("aria-valuenow",u.toString());let p=t.label;if(p){let g=e.label?.formatter||((f,m)=>`${Math.round(f/m*100)}%`);p.textContent=g(u,c)}if(typeof t.draw==="function")t.draw()},l=(u)=>{if(u)te(n,be.INDETERMINATE),n.removeAttribute("aria-valuenow");else he(n,be.INDETERMINATE),n.setAttribute("aria-valuenow",e.value.getValue().toString());t.setIndeterminate?.(u)};if(e.state.isIndeterminate())l(!0);let d={element:n,canvas:i,track:i,indicator:i,buffer:i,getClass:r,resize:()=>t.resize?.(),getValue(){return e.value.getValue()},setValue(u,c=!0){let p=e.value.getValue(),g=e.value.getMax();if(e.value.setValue(u),p!==u){n.setAttribute("aria-valuenow",u.toString());let f=t.label;if(f){let h=e.label?.formatter||((C,T)=>`${Math.round(C/T*100)}%`);f.textContent=h(u,g)}let m={value:u,max:g};if(a(Wo.CHANGE,m),t.setValue&&typeof t.setValue==="function")t.setValue(u,c);else o(u,g)}return d},getMax(){return e.value.getMax()},getBuffer:()=>e.buffer.getBuffer(),setBuffer(u){if(e.buffer.setBuffer(u),!e.state.isIndeterminate()&&typeof t.draw==="function")t.draw();return d},setIndeterminate(u){if(e.state.isIndeterminate()===u)return d;return e.state.setIndeterminate(u),l(u),d},isIndeterminate:()=>e.state.isIndeterminate(),showLabel(){if(e.label?.show)e.label.show();return d},hideLabel(){if(e.label?.hide)e.label.hide();return d},setLabelFormatter(u){if(e.label?.format)e.label.format(u);let c=t.label||t.state?.label;if(c)c.textContent=u(e.value.getValue(),e.value.getMax());return d},getThickness(){return e.thickness?.getThickness()||at.THIN},setThickness(u){if(e.thickness)e.thickness.setThickness(u);if(t.setThickness)t.setThickness(u);return d},getShape(){if(e.shape&&typeof e.shape.getShape==="function")return e.shape.getShape();return We.FLAT},setShape(u){return t.setShape?.(u),d},setSize(u){if(t.setSize)t.setSize(u);return d},getSize(){return t.getSize?t.getSize():void 0},enable(){return e.disabled.enable(),d},disable(){return e.disabled.disable(),d},isDisabled:e.disabled.isDisabled,hide(){if(t.hide)t.hide();return d},show(){if(t.show)t.show();return d},isVisible(){return t.isVisible?t.isVisible():n.style.display!=="none"},on(u,c){return n.addEventListener(u,c),d},off(u,c){return n.removeEventListener(u,c),d},addClass(...u){return u.forEach((c)=>n.classList.add(c)),d},painted(){return new Promise((u)=>requestAnimationFrame(()=>requestAnimationFrame(()=>u())))},destroy(){e.lifecycle.destroy()},disabled:{enable(){e.disabled.enable()},disable(){e.disabled.disable()},isDisabled:e.disabled.isDisabled},lifecycle:{destroy(){e.lifecycle.destroy()}}};if(t.state?.showLabel===!0){if(e.label?.show)e.label.show()}return d};var pl=K(()=>{ft();nn()});var Ap,gl=(e={})=>_(Ap,e,"progress"),hl=(e)=>{let t=e.indeterminate===!0,n=e.variant===Tr.CIRCULAR,r={role:"progressbar","aria-label":e.ariaLabel||st.LABEL,"aria-valuemin":"0","aria-valuemax":(e.max||100).toString()};if(!t&&e.value!==void 0)r["aria-valuenow"]=e.value.toString();if(e.disabled===!0)r["aria-disabled"]="true";let i=[e.class,be.CONTAINER,n?be.CIRCULAR:be.LINEAR].filter(Boolean);if(!n&&e.shape&&e.shape!==We.FLAT)i.push(`${be.CONTAINER}--${e.shape}`);return V(e,{tag:"div",attributes:r,className:i})},Cl=(e)=>{if(!e.state)e.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:st.SHAPE,labelFormatter:(t,n)=>`${Math.round(t/n*100)}%`};return{value:{getValue:()=>e.state.value,setValue:(t)=>{if(e.state){let n=Math.max(0,Math.min(e.state.max,t));if(e.state.previousValue=e.state.value,e.state.value=n,e.state.label)e.state.label.textContent=e.state.labelFormatter(n,e.state.max);if(typeof e.setValue==="function")e.setValue(n);else if(e.draw)e.draw()}},getMax:()=>e.state.max},buffer:{getBuffer:()=>e.state.buffer,setBuffer:(t)=>{e.state.buffer=Math.max(0,Math.min(e.state.max,t))}},disabled:{enable:()=>e.disabled?.enable?.()||void 0,disable:()=>e.disabled?.disable?.()||void 0,isDisabled:()=>e.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!e.state.label){let t=document.createElement("div");t.className=`${e.getClass(be.LABEL)}`,t.textContent=e.state.labelFormatter(e.state.value,e.state.max),e.element.appendChild(t),e.state.label=t,e.label=t}},hide:()=>{if(e.state.label)e.state.label.remove(),e.state.label=void 0,e.label=void 0},format:(t)=>{e.state.labelFormatter=t},formatter:e.state.labelFormatter},thickness:{getThickness:()=>{let t=e.state.thickness;if(t==="thin")return at.THIN;else if(t==="thick")return at.THICK;else if(typeof t==="number")return t;return at.THIN},setThickness:(t)=>{if(e.state.thickness=t,e.draw)e.draw()}},shape:{getShape:()=>e.state.shape,setShape:(t)=>{if(e.state.shape=t,e.setShape)e.setShape(t)}},state:{setIndeterminate:(t)=>{if(e.state){if(e.state.indeterminate=t,typeof e.setIndeterminate==="function")e.setIndeterminate(t);else if(e.draw)e.draw()}},isIndeterminate:()=>e.state.indeterminate},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()||void 0}}};var El=K(()=>{Q();ft();Ap={variant:st.VARIANT,value:st.VALUE,max:st.MAX,buffer:st.BUFFER,showLabel:st.SHOW_LABEL,thickness:"thin",shape:st.SHAPE,showStopIndicator:!0,ariaLabel:st.LABEL}});var Np=(e={})=>{let t=gl(e);try{return M(D,B(),O(hl(t)),se(t),oe(t),cl(t),P(),dl(t),(r)=>fl(Cl(r))(r))(t)}catch(n){throw console.error("Progress creation error:",n),Error(`Failed to create progress: ${n.message}`)}},Xn;var Hi=K(()=>{ne();Z();J();ul();ml();pl();El();Xn=Np});var wp=async(e)=>{await Promise.resolve().then(() => Hi());return Xn(e)},bl=(e)=>(t)=>{if(!e.progress)return t;let n={},r=typeof e.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:u,...c}=e.progress;if(u)n=u;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...c}})(),i=null,s=null,a=!1,o="",l=async()=>{if(i)return i;if(!s)s=wp(r).then((u)=>(i=u,te(i.element,t.getClass("button-progress")),i.element.style.display="none",Object.entries(n).forEach(([c,p])=>{i.on(c,p)}),t.progress=i,i));return s},d=()=>{let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u&&u.nextSibling)return u.nextSibling;return t.element.firstChild};if(t.showProgress=async function(){let u=await l();if(u.element){if(!t.element.contains(u.element)){let p=d();if(p)t.element.insertBefore(u.element,p);else t.element.appendChild(u.element)}u.element.style.display="",te(t.element,`${t.getClass("button")}--progress`);let c=t.element.querySelector(`.${t.getClass("button-icon")}`);if(c instanceof HTMLElement)c.style.display="none"}return t},t.showProgressSync=function(){return t.showProgress(),t},t.hideProgress=async function(){if(!i)return t;i.element.style.display="none",he(t.element,`${t.getClass("button")}--progress`);let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u instanceof HTMLElement)u.style.display="";return t},t.hideProgressSync=function(){return t.hideProgress(),t},t.setProgress=async function(u){return(await l()).setValue(u),t},t.setProgressSync=function(u){return t.setProgress(u),t},t.setIndeterminate=async function(u){return(await l()).setIndeterminate(u),t},t.setIndeterminateSync=function(u){return t.setIndeterminate(u),t},t.setLoading=async function(u,c){if(u&&!a){if(t.setText&&t.getText)o=t.getText();if(a=!0,await t.showProgress(),t.disabled?.disable)t.disabled.disable();if(c&&t.setText)t.setText(c)}else if(!u&&a){if(a=!1,await t.hideProgress(),t.disabled?.enable)t.disabled.enable();if(c&&t.setText)t.setText(c);else if(o&&t.setText)t.setText(o)}return t},t.setLoadingSync=function(u,c){return t.setLoading(u,c),t},t.lifecycle){let u=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.destroy();if(i&&i.element.parentNode)i.element.parentNode.removeChild(i.element);u()}}if(e.showProgress)l().then(()=>{t.showProgress()});return t};var vl=K(()=>{nn()});var Tl=(e)=>(t)=>{if(!e.toggle)return t;let{element:n}=t,r=t.getClass("button"),i=!1,s=(a)=>{i=a,n.classList.toggle(`${r}--selected`,a),n.setAttribute("aria-pressed",String(a))};if(n.classList.add(`${r}--toggle`),s(e.selected===!0),e.toggleOnClick!==!1)n.addEventListener("click",()=>{if(n.disabled)return;s(!i),t.emit?.("change",{selected:i})});return{...t,toggle:{setSelected:(a)=>{if(a!==i)s(a)},isSelected:()=>i}}};var Sl=(e={},t={})=>{let n={...e},r=Me(),i=new Map,s=t.middleware||[],a=(l,d)=>{r.emit("change",l,d)},o=(l,d)=>s.reduce((u,c)=>c(u,d),l);return{getState:()=>{let l={};return i.forEach((d,u)=>{l[u]=d(n)}),{...n,...l}},setState:(l)=>{let d={...n},u=typeof l==="function"?l(n):{...n,...l};n=o(u,d),a(n,d)},subscribe:(l)=>r.on("change",l),derive:(l,d)=>(i.set(l,d),()=>{i.delete(l)}),select:(l)=>l(n),reset:()=>{n={...e},a(n,{})}}},yl=(e,t)=>(console.log("State change:",{old:t,new:e,diff:Object.keys(e).reduce((n,r)=>{if(e[r]!==t[r])n[r]={from:t[r],to:e[r]};return n},{})}),e),xl=(e)=>(t)=>Object.keys(t).reduce((n,r)=>{if(e(t[r],r))n[r]=t[r];return n},{});var Il=()=>{};var Ll=(e,t={})=>{let n=!1,r=Me();return{onMount:(i)=>r.on("mount",i),onUnmount:(i)=>r.on("unmount",i),mount:()=>{if(!n)n=!0,r.emit("mount")},unmount:()=>{if(n)n=!1,r.emit("unmount"),r.clear()},isMounted:()=>n,destroy(){if(n)this.unmount();if(t.events)t.events.destroy();if(t.text){let i=t.text.getElement();if(i)i.remove()}if(t.icon){let i=t.icon.getElement();if(i)i.remove()}if(e)e.remove()}}};var Al=()=>{};var Nl=(e)=>({enable(){return e.disabled=!1,e.removeAttribute("disabled"),this},disable(){return e.disabled=!0,e.setAttribute("disabled","true"),this},toggle(){if(e.disabled)this.enable();else this.disable();return this},isDisabled(){return e.disabled===!0}});var $i=(e,t,n,r,i,s)=>{if(r<0||i<0)return;let a=typeof s==="number"?[s,s,s,s]:s,[o,l,d,u]=a;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+i-d),e.quadraticCurveTo(t+r,n+i,t+r-d,n+i),e.lineTo(t+u,n+i),e.quadraticCurveTo(t,n+i,t,n+i-u),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()},Dp=(e,t,n,r,i,s,a)=>{if(e.save(),a)e.fillStyle=a;$i(e,t,n,r,i,s),e.fill(),e.restore()},Vi=(e,t,n,r,i,s)=>(e.save(),$i(e,t,n,r,i,s),e.clip(),()=>e.restore()),Fi=(e,t,n,r,i,s,a,o)=>{if(r<0||i<0)return;if(e.save(),o)e.fillStyle=o;e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+s,n+i),e.quadraticCurveTo(t,n+i,t,n+i-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath(),e.fill(),e.restore()},Ui=(e,t,n,r)=>{if(r)e.fillStyle=r,e.fillRect(0,0,t,n);else e.clearRect(0,0,t,n)};var Ar=(e)=>{let s=e;for(let c=0;c<4;c++){let m=s*s,C=1.6*(m*s)+-1.8000000000000003*m+1.2000000000000002*s-e,T=4.800000000000001*m+-3.6000000000000005*s+1.2000000000000002;if(Math.abs(C)<0.00001)break;s=s-C/T}let a=0,o=3-a,l=1-a-o,d=s*s,u=d*s;return l*u+o*d+a*s},Gi,Mp;var wl=K(()=>{Gi={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},Mp={linear:(e)=>e,easeIn:(e)=>e*e,easeOut:(e)=>e*(2-e),easeInOut:(e)=>e<0.5?2*e*e:-1+(4-2*e)*e,materialStandard:Ar}});class Dl{animationId=null;start(e){this.stop();let t=(n)=>{e(n),this.animationId=requestAnimationFrame(t)};this.animationId=requestAnimationFrame(t)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Ml{cleanupFunctions=[];add(e){if(e)this.cleanupFunctions.push(e)}cleanup(){this.cleanupFunctions.forEach((e)=>e()),this.cleanupFunctions=[]}}var qn=(e,t,n)=>{let r=window.devicePixelRatio||1,i=e.getContext("2d");return e.style.width=`${t}px`,e.style.height=`${n}px`,e.width=Math.round(t*r),e.height=Math.round(n*r),i.setTransform(1,0,0,1,0,0),i.scale(r,r),{canvas:e,ctx:i,width:t,height:n,pixelRatio:r}},jn=(e,t,n)=>{let{canvas:r,ctx:i,pixelRatio:s}=e;r.style.width=`${t}px`,r.style.height=`${n}px`,r.width=Math.round(t*s),r.height=Math.round(n*s),e.width=t,e.height=n,i.setTransform(1,0,0,1,0,0),i.scale(s,s)},zi=(e,t)=>{if(e())return t?.(),!0;return requestAnimationFrame(()=>{if(e())t?.();else setTimeout(()=>{if(e())t?.()},100)}),!1},Nr=(e,t)=>{let n=Be(`sys-color-${e}`,{onThemeChange:t});return typeof n==="function"?n:null},Wi=(e,t={})=>{let n=document.createElement("canvas");return n.className=e,Object.assign(n.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...t}),n};var Ki=K(()=>{Wn()});var wr=K(()=>{wl();Ki()});var sn=K(()=>{Q();Il();Al();rt();Mi();Wn();ne();nn();wr();wr()});var Ol=({disabled:e,lifecycle:t})=>(n)=>{let r={setText:(a)=>(n.text.setText(a),r),getText:()=>n.text.getText(),getElement:()=>n.text.getElement()},i={setIcon:(a)=>(n.icon.setIcon(a),i),getIcon:()=>n.icon.getIcon(),getElement:()=>n.icon.getElement()},s={element:n.element,text:r,icon:i,disabled:e,lifecycle:t,getClass:n.getClass,on:(a,o)=>{if(n.on)n.on(a,o);return s},off:(a,o)=>{if(n.off)n.off(a,o);return s},addClass:(...a)=>{if(n.addClass)n.addClass(...a);else te(n.element,...a);return s},getValue:()=>n.element.value,setValue(a){return n.element.value=a,s},enable(){return e.enable(),s},disable(){return e.disable(),s},setText(a){return n.text.setText(a),s},getText(){return n.text.getText()},hasIcon(){let a=n.icon.getElement();return!!a&&!!a.innerHTML.trim()&&!!a.parentNode},setIcon(a){let o=n.componentName||"button",l=n.getClass(o);if(!a){let d=n.icon.getElement();if(d&&d.parentNode)d.parentNode.removeChild(d),n.icon.getElement=()=>null,n.icon.getIcon=()=>"";n.element.classList.remove(`${l}--icon`)}else if(!s.hasIcon()){let d=document.createElement("span");if(d.className=`${n.getClass("button-icon")}`,d.innerHTML=a,n.element.firstChild)n.element.insertBefore(d,n.element.firstChild);else n.element.appendChild(d);n.icon.getElement=()=>d,n.icon.getIcon=()=>a,n.element.classList.add(`${l}--icon`)}else{let d=n.icon.getElement();if(d)d.innerHTML=a}return s},getIcon(){return s.hasIcon()?n.icon.getIcon():""},setVariant(a){let o=n.componentName||"button",l=n.getClass(o);return["filled","tonal","outlined","elevated","text"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getVariant(){let a=n.componentName||"button",o=n.getClass(a),l=["filled","tonal","outlined","elevated","text"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"filled"},getSize(){let a=n.componentName||"button",o=n.getClass(a),l=["xs","s","m","l","xl"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"s"},setSize(a){let o=n.componentName||"button",l=n.getClass(o);return["xs","s","m","l","xl"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getShape(){let a=n.componentName||"button",o=n.getClass(a),l=["round","square"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"round"},setShape(a){let o=n.componentName||"button",l=n.getClass(o);return["round","square"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},setActive(a){if(a)n.element.classList.add(`${n.getClass("button")}--active`);else n.element.classList.remove(`${n.getClass("button")}--active`);return s},setSelected(a){return n.toggle?.setSelected(a),s},isSelected:()=>n.toggle?.isSelected()??!1,setAriaLabel(a){return n.element.setAttribute("aria-label",a),s},destroy(){t.destroy()}};if(n.progress)s.progress=n.progress;if(n.showProgress)s.showProgress=async()=>(await n.showProgress(),s);if(n.showProgressSync)s.showProgressSync=()=>(n.showProgressSync(),s);if(n.hideProgress)s.hideProgress=async()=>(await n.hideProgress(),s);if(n.hideProgressSync)s.hideProgressSync=()=>(n.hideProgressSync(),s);if(n.setProgress)s.setProgress=async(a)=>(await n.setProgress(a),s);if(n.setProgressSync)s.setProgressSync=(a)=>(n.setProgressSync(a),s);if(n.setIndeterminate)s.setIndeterminate=async(a)=>(await n.setIndeterminate(a),s);if(n.setIndeterminateSync)s.setIndeterminateSync=(a)=>(n.setIndeterminateSync(a),s);if(n.setLoading)s.setLoading=async(a,o)=>(await n.setLoading(a,o),s);if(n.setLoadingSync)s.setLoadingSync=(a,o)=>(n.setLoadingSync(a,o),s);return s};var Rl=K(()=>{sn()});var _l,Pl,Bl,kl,Dr;var Hl=K(()=>{_l={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},Pl={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Bl={ROUND:"round",SQUARE:"square"},kl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},Dr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Op,$l=(e={})=>_(Op,e,"button"),Vl=(e)=>{let t={type:e.type||"button"};if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"button",attributes:t,className:e.class,forwardEvents:{click:(n)=>!n.element.disabled,focus:!0,blur:!0}})},Fl=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Ul=K(()=>{Q();Hl();Op={variant:_l.FILLED,size:Pl.S,shape:Bl.ROUND,disabled:!1,type:kl.BUTTON,ripple:!0,rippleConfig:{duration:Dr.DURATION,timing:Dr.TIMING,opacity:Dr.OPACITY}}});var Rp=(e={})=>{let t=$l(e);try{return M(D,B(),O(Vl(t)),se(t),mt(t),ct(t),Pe(t),oe(t),Tl(t),bl(t),Le(t),P(),(r)=>{if(t.shape&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>Ol(Fl(r))(r))(t)}catch(n){throw console.error("Button creation error:",n),Error(`Failed to create button: ${n.message}`)}},Te;var Gl=K(()=>{ne();Z();J();vl();Rl();Ul();Te=Rp});var pt=K(()=>{Gl()});var HC={};qf(HC,{ANIMATION_DURATIONS:()=>Gi,AnimationFrameManager:()=>Dl,COMPONENTS:()=>vi,CleanupManager:()=>Ml,EASING_FUNCTIONS:()=>Mp,PREFIX:()=>Y,STATES:()=>Ti,addClass:()=>te,batchAttributes:()=>Ja,byString:()=>Ri,classNames:()=>so,clearCanvas:()=>Ui,clearGlobalDefaults:()=>Di,clearSnackbars:()=>Oa,clipRoundedRect:()=>Vi,compose:()=>qa,createBadge:()=>Vn,createBase:()=>D,createBottomAppBar:()=>Go,createButton:()=>Te,createButtonGroup:()=>Xi,createCanvasContext:()=>qn,createCanvasThemeObserver:()=>Nr,createCard:()=>qi,createCardActions:()=>Zn,createCardContent:()=>Or,createCardHeader:()=>Rr,createCardMedia:()=>Qn,createCarousel:()=>os,createCheckbox:()=>ds,createChip:()=>on,createChips:()=>ps,createComponent:()=>Za,createComponentConfig:()=>_,createDatePicker:()=>hs,createDialog:()=>Cs,createDisabled:()=>Nl,createDivider:()=>Vt,createDrawer:()=>Ts,createElement:()=>H,createElementConfig:()=>V,createEmitter:()=>Me,createEventManager:()=>zo,createExtendedFab:()=>Zr,createFab:()=>jr,createIconButton:()=>Lt,createLifecycle:()=>Ll,createList:()=>xs,createLoadingIndicator:()=>Ws,createMenu:()=>Ft,createNavigation:()=>fn,createNavigationSystem:()=>wc,createProgress:()=>Xn,createRadios:()=>Xs,createRoundedRectPath:()=>$i,createSVGElement:()=>lo,createSearch:()=>ea,createSegment:()=>oi,createSegmentedButton:()=>li,createSelect:()=>ma,createSheet:()=>Ta,createSlider:()=>Da,createSnackbar:()=>Ra,createSplitButton:()=>Ks,createStateEventManager:()=>Er,createStore:()=>Sl,createStyledCanvas:()=>Wi,createSwitch:()=>_a,createTab:()=>An,createTabs:()=>Sf,createTextfield:()=>ir,createTimePicker:()=>Ba,createTooltip:()=>ka,createTopAppBar:()=>Rf,debounce:()=>en,deriveFiltered:()=>xl,easeOutCubic:()=>Ar,fillRoundedRect:()=>Dp,fillRoundedRectLR:()=>Fi,getAttribute:()=>to,getComponentClass:()=>no,getComponentDefaults:()=>$n,getElementClass:()=>io,getInheritedBackground:()=>xt,getModifierClass:()=>ro,hasAttribute:()=>eo,hasClass:()=>it,hasEmit:()=>yt,hasLifecycle:()=>St,hasTouchSupport:()=>ze,initializeCanvasWithRetry:()=>zi,isObject:()=>Oi,joinClasses:()=>Yo,loggingMiddleware:()=>yl,normalizeClasses:()=>Zt,normalizeEvent:()=>Je,observeCanvasResize:()=>Un,once:()=>br,pipe:()=>M,removeAttributes:()=>Qa,removeClass:()=>he,setAttributes:()=>On,setComponentDefaults:()=>Ni,setGlobalDefaults:()=>wi,throttle:()=>Jt,toggleClass:()=>hr,transform:()=>ja,updateCanvasDimensions:()=>jn,when:()=>Ko,withCheckable:()=>Ht,withDebounce:()=>Li,withDisabled:()=>oe,withElement:()=>O,withEnhancedEvents:()=>xi,withEvents:()=>B,withIcon:()=>Pe,withInput:()=>kt,withLifecycle:()=>P,withPosition:()=>Pn,withRipple:()=>Le,withSize:()=>mt,withStyle:()=>yi,withText:()=>ct,withTextInput:()=>Bn,withTextLabel:()=>et,withThrottle:()=>Ii,withTrack:()=>kn,withVariant:()=>se});module.exports=Kf(HC);ne();Z();J();Q();var xo={SMALL:"small",LARGE:"large"},Io={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},Lo={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"},vr=4;var up={variant:xo.LARGE,color:Io.ERROR,position:Lo.TOP_RIGHT,label:"",visible:!0},Ao=(e={})=>_(up,e,"badge"),No=(e)=>{let t={};if(e.variant!=="small")t.role="status";let n=e.variant==="small"?"":tn(e.label||"",e.max);return V(e,{tag:"span",attributes:t,className:e.class,text:n})},wo=(e)=>({visibility:{show:()=>e.visibility.show(),hide:()=>e.visibility.hide(),toggle:(t)=>e.visibility.toggle(t),isVisible:()=>e.visibility.isVisible()},lifecycle:{destroy:()=>e.lifecycle.destroy()}}),tn=(e,t)=>{if(e===void 0||e===null||e==="")return"";let n=String(e),r=Number(e);if(t!==void 0&&!isNaN(r)&&r>t)n=`${t}+`;if(n.length>vr){let i=Number(e);if(!isNaN(i))if(i>=1000)n="999+";else n=n.substring(0,vr-1)+"+";else n=n.substring(0,vr)}return n};var Do="small",cp="large",mp="error",fp="top-right",Mo=()=>(e)=>{if(e.config.visible===!1)e.element.classList.add(`${e.getClass("badge")}--invisible`);return{...e,visibility:{show(){e.element.classList.remove(`${e.getClass("badge")}--invisible`)},hide(){e.element.classList.add(`${e.getClass("badge")}--invisible`)},toggle(n){if(n===void 0)e.element.classList.toggle(`${e.getClass("badge")}--invisible`);else if(n)this.show();else this.hide()},isVisible(){return!e.element.classList.contains(`${e.getClass("badge")}--invisible`)}}}},Oo=(e)=>(t)=>{let n=e.variant||cp;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),n===Do)t.element.textContent="",t.element.setAttribute("aria-hidden","true");else if(t.element.setAttribute("role","status"),e.label!==void 0&&e.label!==""){let r=tn(e.label,e.max);t.element.textContent=r}return t},Ro=(e)=>(t)=>{let n=e.color||mp;return t.element.classList.add(`${t.getClass("badge")}--${n}`),t},_o=(e)=>(t)=>{let n=e.position||fp;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),e.target)t.element.classList.add(`${t.getClass("badge")}--positioned`);return t},Po=(e)=>(t)=>{if(e.max===void 0||e.variant===Do)return t;if(t.config.max=e.max,e.label!==void 0&&e.label!==""){let n=tn(e.label,e.max);if(t.element.textContent=n,typeof e.label==="number"&&e.label>e.max)t.element.classList.add(`${t.getClass("badge")}--overflow`)}return t},Bo=(e)=>(t)=>{if(!e.target)return t;let n=document.createElement("div");n.classList.add(t.getClass("badge-wrapper")),n.style.position="relative";let r=e.target.parentNode;if(r)r.replaceChild(n,e.target),n.appendChild(e.target),n.appendChild(t.element),t.wrapper=n;return t};var ko="small",pp=["error","primary","secondary","tertiary","success","warning","info"],gp=["small","large"],hp=["top-right","top-left","bottom-right","bottom-left"],Ho=({visibility:e,lifecycle:t})=>(n)=>{let r={element:n.element,wrapper:n.wrapper,getClass:n.getClass,setLabel(i){if(n.config.label=i,n.config.variant===ko)return n.element.textContent="",r;let s=tn(i,n.config.max);if(n.element.textContent=s,n.element.classList.remove(`${n.getClass("badge")}--overflow`),typeof i==="number"&&n.config.max!==void 0&&i>n.config.max)n.element.classList.add(`${n.getClass("badge")}--overflow`);if(s===""||s==="0")r.hide();else r.show();return r},getLabel(){return n.element.textContent||""},setContent(i){return r.setLabel(i)},getContent(){return r.getLabel()},show(){return e.show(),r},hide(){return e.hide(),r},toggle(i){return e.toggle(i),r},isVisible(){return e.isVisible()},setMax(i){if(n.config.max=i,n.config.label!==void 0)r.setLabel(n.config.label);return r},setColor(i){return pp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},setVariant(i){if(gp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),n.config.variant=i,i===ko)n.element.textContent="",n.element.setAttribute("aria-hidden","true");else if(n.element.setAttribute("role","status"),n.config.label!==void 0)r.setLabel(n.config.label);return r},setPosition(i){return hp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},attachTo(i){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element);let s=document.createElement("div");s.classList.add(n.getClass("badge-wrapper")),s.style.position="relative";let a=i.parentNode;if(a)a.replaceChild(s,i),s.appendChild(i),s.appendChild(n.element),n.element.classList.add(`${n.getClass("badge")}--positioned`),n.wrapper=s,r.wrapper=s;return r},detach(){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element),n.element.classList.remove(`${n.getClass("badge")}--positioned`),document.body.appendChild(n.element),n.wrapper=void 0,r.wrapper=void 0;return r},destroy(){if(t.destroy(),n.wrapper){let i=n.wrapper.firstChild,s=n.wrapper.parentNode;if(s&&i)s.replaceChild(i,n.wrapper)}},addClass:(...i)=>(n.addClass(...i),r),removeClass:(...i)=>(n.removeClass(...i),r),on:(i,s)=>(n.on(i,s),r),off:(i,s)=>(n.off(i,s),r)};return r};var Cp=(e={})=>{let t=Ao(e);try{return M(D,B(),O(No(t)),Oo(t),Ro(t),_o(t),Po(t),Mo(),Bo(t),P(),(r)=>Ho(wo(r))(r))(t)}catch(n){throw console.error("Badge creation error:",n),Error(`Failed to create badge: ${n.message}`)}},Vn=Cp;ne();Q();var $o={CENTER:"center",END:"end"},Vo=300;var Ep={tag:"div",hasFab:!1,fabPosition:$o.END,autoHide:!1,transitionDuration:Vo},Fo=(e={})=>_(Ep,e,"bottom-app-bar");var Uo=(e={})=>{let t=Fo(e),n=D(t),r=document.createElement("div");r.className=`${n.getClass("bottom-app-bar")}-actions`;let i=document.createElement("div");i.className=`${n.getClass("bottom-app-bar")}-fab-container`;let s=O({tag:t.tag,componentName:"bottom-app-bar",className:[t.hasFab?`${n.getClass("bottom-app-bar")}--with-fab`:"",t.fabPosition==="center"?`${n.getClass("bottom-app-bar")}--fab-center`:"",t.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(n),a=B()(s),o=P()(a);o.element.appendChild(r),o.element.appendChild(i);let l=!0,d=window.scrollY;if(t.autoHide){let c=()=>{let g=window.scrollY;if(g>d+10){if(l)u.hide(),t.onVisibilityChange?.(!1)}else if(g<d-10){if(!l)u.show(),t.onVisibilityChange?.(!0)}d=g};window.addEventListener("scroll",c,{passive:!0});let p=o.lifecycle.destroy;o.lifecycle.destroy=()=>{window.removeEventListener("scroll",c),p()}}let u={...o,addAction(c){return r.appendChild(c),this},addFab(c){return i.innerHTML="",i.appendChild(c),this.element.classList.add(`${n.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${n.getClass("bottom-app-bar")}--hidden`),l=!0,this},hide(){return this.element.classList.add(`${n.getClass("bottom-app-bar")}--hidden`),l=!1,this},isVisible(){return l},getActionsContainer(){return r}};if(t.autoHide&&t.transitionDuration)u.element.style.transition=`transform ${t.transitionDuration}ms ease-in-out`;return u};var Go=Uo;pt();Z();J();ne();Z();J();var zl=(e)=>(t)=>{if(!e.toggle)return{...t,toggleState:{select:function(){return this},deselect:function(){return this},toggle:function(){return this},isSelected:()=>!1,isToggle:()=>!1,setIcon:function(){return this},setSelectedIcon:function(){return this},getSelectedIcon:()=>""}};let n=e.prefix||"mtrl",r=e.componentName||"icon-button",i=`${n}-${r}--selected`,s=e.selected||!1,a=e.icon||"",o=e.selectedIcon||"",l=()=>{if(!t.icon)return;let f=s&&o?o:a;if(f)t.icon.setIcon(f)},d=()=>{t.element.setAttribute("aria-pressed",String(s))},u={select(){if(!s)s=!0,t.element.classList.add(i),l(),d();return this},deselect(){if(s)s=!1,t.element.classList.remove(i),l(),d();return this},toggle(){if(s)this.deselect();else this.select();return this},isSelected(){return s},isToggle(){return!0},setIcon(f){if(a=f,!s)l();return this},setSelectedIcon(f){if(o=f,s)l();return this},getSelectedIcon(){return o}};if(s)t.element.classList.add(i),d(),l();else d();let c=e.toggleOnClick!==!1,p=()=>{u.toggle();let f=new CustomEvent("toggle",{bubbles:!0,detail:{selected:s}});t.element.dispatchEvent(f)};if(c)t.element.addEventListener("click",p);let g=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(c)t.element.removeEventListener("click",p);if(g)g()};return{...t,toggleState:u}};var Wl=({disabled:e,lifecycle:t,toggleState:n})=>(r)=>{let i=r.componentName||"icon-button",s=r.getClass(i),a={setIcon:(l)=>(r.icon.setIcon(l),a),getIcon:()=>r.icon.getIcon(),getElement:()=>r.icon.getElement()},o={element:r.element,icon:a,disabled:{enable:()=>e.enable(),disable:()=>e.disable(),isDisabled:()=>e.isDisabled()},lifecycle:{destroy:()=>t.destroy()},getClass:r.getClass,getValue:()=>r.element.value,setValue(l){return r.element.value=l,o},getVariant(){let l=["filled","tonal","outlined","standard"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"standard"},setVariant(l){return["filled","tonal","outlined","standard"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),r.element.classList.add(`${s}--${l}`),o},getSize(){let l=["xs","s","m","l","xl"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"s"},setSize(l){if(["xs","s","m","l","xl"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="s")r.element.classList.add(`${s}--${l}`);return o},getShape(){let l=["round","square"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"round"},setShape(l){if(["round","square"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="round")r.element.classList.add(`${s}--${l}`);return o},getWidth(){let l=["narrow","default","wide"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"default"},setWidth(l){if(["narrow","default","wide"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="default")r.element.classList.add(`${s}--${l}`);return o},enable(){return e.enable(),o},disable(){return e.disable(),o},setIcon(l){if(n?.isToggle()&&!n.isSelected())n.setIcon(l);return r.icon.setIcon(l),o},getIcon(){return r.icon.getIcon()},setSelectedIcon(l){if(n)n.setSelectedIcon(l);return o},getSelectedIcon(){return n?.getSelectedIcon()||""},isToggle(){return n?.isToggle()||!1},select(){if(n)n.select();return o},deselect(){if(n)n.deselect();return o},toggleSelected(){if(n)n.toggle();return o},isSelected(){return n?.isSelected()||!1},setAriaLabel(l){return r.element.setAttribute("aria-label",l),o},destroy(){t.destroy()},on(l,d){if(r.on)r.on(l,d);else r.element.addEventListener(l,d);return o},off(l,d){if(r.off)r.off(l,d);else r.element.removeEventListener(l,d);return o},addClass(...l){if(r.addClass)r.addClass(...l);else l.forEach((d)=>r.element.classList.add(d));return o},removeClass(...l){if(r.removeClass)r.removeClass(...l);else l.forEach((d)=>r.element.classList.remove(d));return o}};return o};Q();var Kl={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",STANDARD:"standard"},Yl={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Xl={ROUND:"round",SQUARE:"square"},ql={NARROW:"narrow",DEFAULT:"default",WIDE:"wide"},jl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"};var Mr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]};var _p={variant:Kl.STANDARD,size:Yl.S,shape:Xl.ROUND,width:ql.DEFAULT,disabled:!1,type:jl.BUTTON,toggle:!1,selected:!1,ripple:!0,tooltip:!0,rippleConfig:{duration:Mr.DURATION,timing:Mr.TIMING,opacity:Mr.OPACITY}},Zl=(e={})=>_(_p,e,"icon-button"),Ql=(e)=>{let t={type:e.type||"button"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;if(e.toggle)t["aria-pressed"]=e.selected?"true":"false";if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;let n=[];if(e.size&&e.size!=="s")n.push(`icon-button--${e.size}`);if(e.shape&&e.shape!=="round")n.push(`icon-button--${e.shape}`);if(e.width&&e.width!=="default")n.push(`icon-button--${e.width}`);if(e.toggle)n.push("icon-button--toggle");if(e.toggle&&e.selected)n.push("icon-button--selected");if(e.disabled===!0)n.push("icon-button--disabled");let r=e.className||e.class,i=[...n,...Array.isArray(r)?r:r?[r]:[]],s={...e,className:i};return V(s,{tag:"button",attributes:t,forwardEvents:{click:(a)=>!a.element.disabled,focus:!0,blur:!0},interactive:!0})},Jl=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()},toggleState:e.toggleState});var Pp=(e={})=>{let t=Zl(e);try{return M(D,B(),O(Ql(t)),se(t),mt(t),Pe(t),oe(t),zl(t),Le(t),P(),(r)=>{if(t.shape&&t.shape!=="round"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>{if(t.width&&t.width!=="default"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.width}`;r.element.classList.add(i)}return r},(r)=>Wl(Jl(r))(r))(t)}catch(n){throw console.error("IconButton creation error:",n),Error(`Failed to create icon button: ${n.message}`)}},Lt=Pp;pt();Q();var Bp={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},kp={HORIZONTAL:"horizontal",VERTICAL:"vertical"},tt={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var Hp={STANDARD:"standard",CONNECTED:"connected"},$p={NONE:"none",SINGLE:"single",MULTI:"multi"},Vp={ROUND:"round",SQUARE:"square"},Fp={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Yi={xs:{height:32,icon:20,standardGap:18,connectedCorner:4},s:{height:40,icon:20,standardGap:12,connectedCorner:8},m:{height:56,icon:24,standardGap:8,connectedCorner:8},l:{height:96,icon:32,standardGap:8,connectedCorner:16},xl:{height:136,icon:40,standardGap:8,connectedCorner:20}},ed=2,td=4;var nd=0.15,rd=4,Up={ALWAYS:"always",SELECTED:"selected"},le={KIND:Hp.STANDARD,SELECTION:$p.NONE,SHAPE:Vp.ROUND,SIZE:Fp.S,LABELS:Up.ALWAYS,VARIANT:Bp.OUTLINED,ORIENTATION:kp.HORIZONTAL,DENSITY:tt.DEFAULT,RIPPLE:!0,EQUAL_WIDTH:!1,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]};var Gp={kind:le.KIND,selection:le.SELECTION,shape:le.SHAPE,size:le.SIZE,required:!1,variant:le.VARIANT,orientation:le.ORIENTATION,density:le.DENSITY,ripple:le.RIPPLE,equalWidth:le.EQUAL_WIDTH,disabled:!1,buttons:[]},id=(e={})=>_(Gp,e,"button-group"),sd=(e)=>{let t=e.variant||le.VARIANT,n=e.orientation||le.ORIENTATION,r=e.density||le.DENSITY,i=e.kind||le.KIND,s=e.selection||le.SELECTION,a=e.labels||le.LABELS,o=e.shape||le.SHAPE,l=e.size||le.SIZE;return{tag:"div",componentName:"button-group",attributes:{role:"group","aria-label":e.ariaLabel||"Button group","data-variant":t,"data-orientation":n,"data-density":r,"data-kind":i,"data-selection":s,"data-shape":o,"data-size":l,"data-labels":a},className:[e.class,a==="selected"?`${e.prefix}-button-group--labels-selected`:null,e.disabled?`${e.prefix}-button-group--disabled`:null,`${e.prefix}-button-group--${n}`,`${e.prefix}-button-group--${t}`,`${e.prefix}-button-group--${i}`,`${e.prefix}-button-group--${o}`,`${e.prefix}-button-group--size-${l}`,s!=="none"?`${e.prefix}-button-group--selectable`:null,r!==tt.DEFAULT?`${e.prefix}-button-group--density-${r}`:null,e.equalWidth?`${e.prefix}-button-group--equal-width`:null],interactive:!0}},zp={[tt.DEFAULT]:0,[tt.COMFORTABLE]:1,[tt.COMPACT]:2},ad=(e,t,n=tt.DEFAULT)=>{let r=Yi[e||le.SIZE]||Yi.s,i=t==="connected"?ed:r.standardGap,s=r.height-rd*(zp[n]??0);return{"--button-group-height":`${s}px`,"--button-group-icon":`${r.icon}px`,"--button-group-gap":`${i}px`,"--button-group-inner-corner":`${r.connectedCorner}px`,"--button-group-pressed-corner":`${td}px`,"--button-group-radius":`${s/2}px`}},od=(e,t,n,r)=>{let i=t===0,s=t===n-1,a=n===1,o="";if(a)o=`${r.prefix}-button-group__button--single`;else if(i)o=`${r.prefix}-button-group__button--first`;else if(s)o=`${r.prefix}-button-group__button--last`;else o=`${r.prefix}-button-group__button--middle`;return{...e,variant:r.variant,size:r.size||le.SIZE,shape:r.shape||le.SHAPE,disabled:r.disabled||e.disabled,ripple:r.ripple,rippleConfig:r.rippleConfig,class:[`${r.prefix}-button-group__button`,o,e.class].filter(Boolean).join(" ")}};var Wp=(e={})=>{let t=id(e),n=Me(),r=t.variant||le.VARIANT,i=t.orientation||le.ORIENTATION,s=t.density||le.DENSITY,a=t.kind||le.KIND,o=t.selection||le.SELECTION,l=Boolean(t.required),d=new Set;try{let u=M(D,B(),O(sd(t)),P())(t),c=(x)=>{Object.entries(ad(t.size,a,x)).forEach(([A,N])=>{u.element.style.setProperty(A,N)})};c(s);let p=[],g=t.buttons||[],f=g.length,m=(x)=>{let A=x._groupConfig;return String(A?.value??A?.id??x._groupIndex)},h=(x,A)=>{let N=`${t.prefix}-button-group__button--selected`;x.element.classList.toggle(N,A),x.element.setAttribute("aria-pressed",String(A));let k=x.toggleState;if(k?.isToggle?.())if(A)k.select();else k.deselect();else x.setSelected?.(A)},C=t.expandedRatio??nd,T=()=>{p.forEach((x)=>{x.element.style.width="",x.element.style.paddingLeft="",x.element.style.paddingRight=""}),document.removeEventListener("pointerup",T),document.removeEventListener("pointercancel",T)},b=(x)=>{if(a!=="standard"||C<=0||i!=="horizontal")return;let A=p.map((W)=>W.element.getBoundingClientRect().width);if(!A[x])return;let N=u.element.ownerDocument.defaultView,k=(W,ee)=>N?parseFloat(N.getComputedStyle(p[W].element)[ee])||0:0,X=p[x-1]?x-1:-1,U=p[x+1]?x+1:-1,j=X>=0&&U>=0,pe=C*A[x]/(j?2:1),ge=0,w=(W,ee)=>{let R=Math.min(pe,k(W,ee),A[W]);if(R<=0)return;p[W].element.style.width=`${A[W]-R}px`,p[W].element.style[ee]=`${k(W,ee)-R}px`,ge+=R};if(X>=0)w(X,"paddingRight");if(U>=0)w(U,"paddingLeft");p[x].element.style.width=`${A[x]+ge}px`,document.addEventListener("pointerup",T),document.addEventListener("pointercancel",T)},E=(x,A)=>{let N=p.filter((X)=>d.has(m(X))),k={buttonGroup:I,values:N.map(m),selected:N,button:x,originalEvent:A};n.emit("change",k)},v=(x,A,N,k)=>{if(o==="none")return!1;let X=p.find((U)=>m(U)===x);if(!X)return!1;if(A===d.has(x))return!1;if(!A&&l&&d.size===1)return!1;if(A&&o==="single")for(let U of p){let j=m(U);if(j!==x&&d.has(j))d.delete(j),h(U,!1)}if(A)d.add(x);else d.delete(x);return h(X,A),E(N??X,k),!0};if(g.forEach((x,A)=>{let N=od(x,A,f,t),k=o!=="none",U=Boolean(x.icon)&&!x.text?Lt({...N,toggle:k,toggleOnClick:!1,selectedIcon:x.selectedIcon,variant:N.variant==="text"?"standard":N.variant}):Te({...N,toggle:k,toggleOnClick:!1});if(U._groupConfig=x,U._groupIndex=A,k)U.element.setAttribute("aria-pressed","false");U.element.addEventListener("pointerdown",()=>{if(!U.disabled?.isDisabled())b(A)}),U.on("click",(j)=>{if(!U.disabled?.isDisabled()){let pe={buttonGroup:I,button:U,index:A,originalEvent:j};if(n.emit("click",pe),o!=="none"){let ge=m(U),w=d.has(ge);if(o==="single"){if(!w)v(ge,!0,U,j);else if(!l)v(ge,!1,U,j)}else v(ge,!w,U,j)}}}),U.on("focus",(j)=>{let pe={buttonGroup:I,button:U,index:A,originalEvent:j};n.emit("focus",pe)}),U.on("blur",(j)=>{let pe={buttonGroup:I,button:U,index:A,originalEvent:j};n.emit("blur",pe)}),u.element.appendChild(U.element),p.push(U)}),o!=="none")p.forEach((x)=>{if(x._groupConfig?.selected&&(o==="multi"||d.size===0))d.add(m(x)),h(x,!0)});let S=(x)=>{["filled","tonal","outlined","elevated","text"].forEach((N)=>{u.element.classList.remove(`${t.prefix}-button-group--${N}`)}),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-variant",x),p.forEach((N)=>{N.setVariant(x)}),r=x},y=(x)=>{u.element.classList.remove(`${t.prefix}-button-group--horizontal`,`${t.prefix}-button-group--vertical`),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-orientation",x),i=x},L=(x)=>{if(Object.values(tt).forEach((A)=>{if(A!==tt.DEFAULT)u.element.classList.remove(`${t.prefix}-button-group--density-${A}`)}),x!==tt.DEFAULT)u.element.classList.add(`${t.prefix}-button-group--density-${x}`);u.element.setAttribute("data-density",x),c(x),s=x},I={element:u.element,buttons:p,getButton(x){return p[x]},getButtonById(x){return p.find((A)=>{let N=A._groupConfig;return N?.id===x||N?.value===x})},getVariant(){return r},setVariant(x){return S(x),this},getOrientation(){return i},setOrientation(x){return y(x),this},getDensity(){return s},setDensity(x){return L(x),this},enable(){return u.element.classList.remove(`${t.prefix}-button-group--disabled`),p.forEach((x)=>{if(!x._groupConfig?.disabled)x.enable()}),this},disable(){return u.element.classList.add(`${t.prefix}-button-group--disabled`),p.forEach((x)=>{x.disable()}),this},enableButton(x){let A=p[x];if(A)A.enable();return this},getSelected(){return p.filter((x)=>d.has(m(x))).map(m)},isSelected(x){return d.has(x)},select(x){return v(x,!0),this},deselect(x){return v(x,!1),this},toggle(x){return v(x,!d.has(x)),this},getKind(){return a},getSelection(){return o},disableButton(x){let A=p[x];if(A)A.disable();return this},on(x,A){return n.on(x,A),this},off(x,A){return n.off(x,A),this},destroy(){T(),p.forEach((x)=>{x.destroy()}),p.length=0,n.clear(),u.lifecycle.destroy()}};return I}catch(u){throw console.error("Button Group creation error:",u),Error(`Failed to create button group: ${u.message}`)}},Xi=Wp;ne();Z();J();var ld=({lifecycle:e})=>(t)=>({...t,element:t.element,addContent(n){if(n&&n.classList.contains(`${t.getClass("card")}-content`))t.element.appendChild(n);return this},setHeader(n){if(n&&n.classList.contains(`${t.getClass("card")}-header`)){let r=t.element.querySelector(`.${t.getClass("card")}-header`);if(r)r.remove();if(t.element.querySelector(`.${t.getClass("card")}-media`)){let s=t.element.querySelectorAll(`.${t.getClass("card")}-media`),a=s[s.length-1];if(a.nextSibling)t.element.insertBefore(n,a.nextSibling);else t.element.appendChild(n)}else t.element.insertBefore(n,t.element.firstChild)}return this},addMedia(n,r="top"){if(n&&n.classList.contains(`${t.getClass("card")}-media`))if(r==="top")t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);return this},setActions(n){if(n&&n.classList.contains(`${t.getClass("card")}-actions`)){let r=t.element.querySelector(`.${t.getClass("card")}-actions`);if(r)r.remove();t.element.appendChild(n)}return this},makeDraggable(n){if(t.element.setAttribute("draggable","true"),t.element.setAttribute("aria-grabbed","false"),typeof n==="function")t.element.addEventListener("dragstart",(r)=>{t.element.setAttribute("aria-grabbed","true"),n(r)}),t.element.addEventListener("dragend",()=>{t.element.setAttribute("aria-grabbed","false")});return this},focus(){return t.element.focus(),this},destroy(){e.destroy()}});Q();rt();ne();Z();Qe();var Or=(e={})=>{let t={...e,componentName:"card-content",prefix:Y};try{let n=M(D,O({tag:"div",componentName:"card-content",className:[e.class,e.padding===!1?`${Y}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))(t);if(e.html)n.element.innerHTML=e.html;else if(e.text)n.element.innerHTML=`<p>${e.text}</p>`;if(Array.isArray(e.children))e.children.forEach((r)=>{if(r instanceof HTMLElement)n.element.appendChild(r)});return n.element.classList.add("debug-content"),n.element}catch(n){throw console.error("Card content creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card content: ${n instanceof Error?n.message:String(n)}`)}},Rr=(e={})=>{let t={...e,componentName:"card-header",prefix:Y};try{let n=M(D,O({tag:"div",componentName:"card-header",className:e.class,attributes:{role:"heading","aria-level":"3"}}))(t),r=H({tag:"div",className:`${Y}-card-header-text`,container:n.element});if(e.title){H({tag:"h3",className:`${Y}-card-header-title`,text:e.title,container:r,attributes:{id:`${n.element.id||"card-header"}-title`}});let i=n.element.closest(`.${Y}-card`);if(i&&!i.hasAttribute("aria-labelledby"))i.setAttribute("aria-labelledby",`${n.element.id||"card-header"}-title`)}if(e.subtitle)H({tag:"h4",className:`${Y}-card-header-subtitle`,text:e.subtitle,container:r});if(e.avatar){let i=typeof e.avatar==="string"?H({tag:"div",className:`${Y}-card-header-avatar`,html:e.avatar}):e.avatar,s=i.querySelector("img");if(s&&!s.hasAttribute("alt"))s.setAttribute("alt",""),s.setAttribute("aria-hidden","true");n.element.insertBefore(i,n.element.firstChild)}if(e.action){let i=typeof e.action==="string"?H({tag:"div",className:`${Y}-card-header-action`,html:e.action}):e.action;n.element.appendChild(i)}return n.element}catch(n){throw console.error("Card header creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card header: ${n instanceof Error?n.message:String(n)}`)}},Zn=(e={})=>{let t={...e,componentName:"card-actions",prefix:Y};try{let n=M(D,O({tag:"div",componentName:"card-actions",className:[e.class,e.fullBleed?`${Y}-card-actions--full-bleed`:null,e.vertical?`${Y}-card-actions--vertical`:null,e.align?`${Y}-card-actions--${e.align}`:null],attributes:{role:"group"}}))(t);if(Array.isArray(e.actions))e.actions.forEach((r,i)=>{if(r instanceof HTMLElement){if(!r.hasAttribute("aria-label")&&!r.hasAttribute("aria-labelledby")&&r.textContent?.trim()==="")r.setAttribute("aria-label",`Action ${i+1}`);n.element.appendChild(r)}});return n.element}catch(n){throw console.error("Card actions creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card actions: ${n instanceof Error?n.message:String(n)}`)}},Qn=(e={})=>{let t={...e,componentName:"card-media",prefix:Y};try{let n=M(D,O({tag:"div",componentName:"card-media",className:[e.class,e.aspectRatio?`${Y}-card-media--${e.aspectRatio.replace(":","-")}`:null,e.contain?`${Y}-card-media--contain`:null]}))(t);if(e.element instanceof HTMLElement)n.element.appendChild(e.element);else if(e.src){let r=document.createElement("img");if(r.src=e.src,r.className=`${Y}-card-media-img`,r.alt=e.alt||"",!e.alt)r.setAttribute("aria-hidden","true");n.element.appendChild(r)}return n.element}catch(n){throw console.error("Card media creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card media: ${n instanceof Error?n.message:String(n)}`)}};var _r={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},dd={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4};var Yp={variant:_r.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},ud=(e)=>{let t={...e};if(e.header)t.headerConfig=e.header;if(e.content)t.contentConfig=e.content;if(e.media)t.mediaConfig=e.media;if(e.actions)t.actionsConfig=e.actions;return t},cd=(e,t)=>{if(t.mediaConfig&&(!t.mediaConfig.position||t.mediaConfig.position==="top")){let n=Qn({...t.mediaConfig,position:void 0});e.addMedia(n,"top")}if(t.headerConfig){let n=Rr(t.headerConfig);e.setHeader(n)}if(t.contentConfig){let n=Or(t.contentConfig);e.addContent(n)}if(t.mediaConfig&&t.mediaConfig.position==="bottom"){let n=Qn({...t.mediaConfig,position:void 0});e.addMedia(n,"bottom")}if(t.actionsConfig){let n=Zn(t.actionsConfig);e.setActions(n)}if(Array.isArray(t.buttons)&&t.buttons.length>0)Promise.resolve().then(() => (pt(),{})).then(({})=>{let r=t.buttons.map((s)=>Te(s).element),i=Zn({actions:r,align:t.actionsConfig?.align||"end"});e.setActions(i)}).catch((n)=>{console.error("Error processing buttons:",n)})},md=(e={})=>_(Yp,e,"card"),fd=(e)=>{let t=e.interactive||e.clickable,n=t?"button":"region",r={};if(e.aria)Object.entries(e.aria).forEach(([i,s])=>{if(s!==void 0){let a=i.startsWith("aria-")?i:`aria-${i}`;r[a]=s}});if(!r.role&&!e.aria?.role)r.role=n;if(t&&!r.tabindex)r.tabindex="0";return V(e,{tag:"div",className:[e.class,e.fullWidth?`${e.prefix}-card--full-width`:null,t?`${e.prefix}-card--interactive`:null],attributes:r,forwardEvents:{click:()=>!!e.clickable,mouseenter:()=>!!t,mouseleave:()=>!!t,keydown:()=>!!t,focus:()=>!!t,blur:()=>!!t},interactive:t})},pd=(e)=>({lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}}),$t=dd,gd=(e)=>{let t=e.config;if(t.interactive||t.clickable)e.element.addEventListener("mouseenter",()=>{if(t.variant===_r.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL2))}),e.element.addEventListener("mouseleave",()=>{if(t.variant===_r.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL1))}),e.element.addEventListener("keydown",(r)=>{if((r.key==="Enter"||r.key===" ")&&t.clickable)r.preventDefault(),e.element.click()}),e.element.addEventListener("focus",()=>{e.element.classList.add(`${e.getClass("card")}--focused`)}),e.element.addEventListener("blur",()=>{e.element.classList.remove(`${e.getClass("card")}--focused`)});if(t.draggable)e.element.setAttribute("draggable","true"),e.element.addEventListener("dragstart",(r)=>{if(e.element.style.setProperty("--card-elevation",String($t.LEVEL4)),e.element.classList.add(`${e.getClass("card")}--dragging`),e.emit?.("dragstart",{event:r}),r.dataTransfer){let i=e.element.querySelector(`.${e.getClass("card")}-header-title`)?.textContent||"Card";r.dataTransfer.setData("text/plain",i)}}),e.element.addEventListener("dragend",(r)=>{e.element.style.setProperty("--card-elevation",String($t.LEVEL1)),e.element.classList.remove(`${e.getClass("card")}--dragging`),e.emit?.("dragend",{event:r})});return e};var hd=(e)=>{if(e.config.variant==="elevated")e.element.style.setProperty("--card-elevation",String($t.LEVEL1));else e.element.style.setProperty("--card-elevation",String($t.LEVEL0));return e};var Xp=(e={})=>{let t=ud(e),n=md(t);try{let r=M(D,B(),O(fd(n)),se(n),n.clickable?Le(n):(i)=>i,P(),gd,hd,(i)=>ld(pd(i))(i))(n);return cd(r,t),r}catch(r){throw console.error("Card creation error:",r instanceof Error?r.message:String(r)),Error(`Failed to create card: ${r instanceof Error?r.message:String(r)}`)}},qi=Xp;ne();Z();J();var ji=(e)=>(t)=>{let n=t.getClass("carousel"),r=document.createElement("div");r.className=`${n}__scroller`;let i=document.createElement("div");i.className=`${n}__track`,r.appendChild(i),t.element.appendChild(r);let s=[],a=[],o=t,l,d=()=>{let f=a.length;a.forEach((m,h)=>{m.dataset.index=String(h),m.setAttribute("aria-label",`${h+1} of ${f}`)})},u=(f,m)=>{if(f.replaceChildren(),m.content!==void 0){if(typeof m.content==="string")f.innerHTML=m.content;else f.appendChild(m.content);return}if(m.image){let h=document.createElement("img");h.className=`${n}__image`,h.src=m.image,h.alt=m.alt??m.title??"",h.draggable=!1,f.appendChild(h)}if(m.title||m.description||m.buttonText){let h=document.createElement("div");if(h.className=`${n}__content`,m.title){let C=document.createElement("div");C.className=`${n}__title`,C.textContent=m.title,h.appendChild(C)}if(m.description){let C=document.createElement("div");C.className=`${n}__description`,C.textContent=m.description,h.appendChild(C)}if(m.buttonText){let C=document.createElement("a");if(C.className=`${n}__button`,C.textContent=m.buttonText,m.buttonUrl)C.href=m.buttonUrl;h.appendChild(C)}f.appendChild(h)}},c=(f)=>{let m=document.createElement("div");return m.className=`${n}__item`,m.setAttribute("role","group"),m.setAttribute("aria-roledescription","slide"),m.tabIndex=0,u(m,f),m},p=()=>{d(),l?.()},g={addSlide(f,m){let h=m!==void 0&&m>=0&&m<=s.length?m:s.length,C=c(f);if(s.splice(h,0,f),h<a.length)i.insertBefore(C,a[h]),a.splice(h,0,C);else i.appendChild(C),a.push(C);return p(),g},removeSlide(f){if(f<0||f>=a.length)return g;return i.removeChild(a[f]),a.splice(f,1),s.splice(f,1),p(),g},updateSlide(f,m){if(f<0||f>=a.length)return g;return s[f]=m,u(a[f],m),g},getSlide:(f)=>s[f]??null,getCount:()=>s.length,getElements:()=>a.slice()};return o.scroller=r,o.track=i,o.slides=g,o.slideElements=a,o.onSlidesChanged=(f)=>{l=f},(e.slides??[]).forEach((f)=>{let m=c(f);s.push(f),a.push(m),i.appendChild(m)}),d(),o};var ke={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",HERO_CENTER:"hero-center",FULL_SCREEN:"full-screen"},Cd={CHANGE:"change"},Se={VARIANT:ke.MULTI_BROWSE,ITEM_WIDTH:280,GAP:8,GAP_FULL_SCREEN:16,PADDING:16,CORNER_RADIUS:28,MIN_SMALL_ITEM_WIDTH:40,MAX_SMALL_ITEM_WIDTH:56,ANCHOR_SIZE:10,MEDIUM_LARGE_THRESHOLD:0.85,INITIAL_SLIDE:0};Q();var jp={variant:Se.VARIANT,cornerRadius:Se.CORNER_RADIUS,initialSlide:Se.INITIAL_SLIDE,minSmallItemWidth:Se.MIN_SMALL_ITEM_WIDTH,maxSmallItemWidth:Se.MAX_SMALL_ITEM_WIDTH},Zi=(e)=>{let t=e.variant||Se.VARIANT,n=t===ke.FULL_SCREEN;return{variant:t,gap:e.gap??(n?Se.GAP_FULL_SCREEN:Se.GAP),padding:e.padding??(n?0:Se.PADDING),snap:e.snap??t!==ke.UNCONTAINED}},Ed=(e={})=>_(jp,e,"carousel"),bd=(e)=>{let{variant:t}=Zi(e);return V(e,{tag:"div",attributes:{role:"region","aria-roledescription":"carousel","aria-label":e.ariaLabel||"Carousel"},className:[e.class,`${e.prefix}-carousel--${t}`,t===ke.FULL_SCREEN?`${e.prefix}-carousel--vertical`:null],forwardEvents:{focus:!0,blur:!0}})};var kr=(e)=>e.largeCount+e.mediumCount+e.smallCount,Zp=(e)=>{if(e.largeCount>0&&e.smallCount>0&&e.mediumCount>0)return e.largeSize>e.mediumSize&&e.mediumSize>e.smallSize;if(e.largeCount>0&&e.smallCount>0)return e.largeSize>e.smallSize;return!0},Qi=(e,t)=>Zp(e)?Math.abs(t-e.largeSize)*e.priority:Number.MAX_VALUE,Qp=(e,t,n,r,i)=>(e-(t+r/2)*n)/(i+r/2),Jp=(e,t,n,r,i,s,a,o,l,d,u)=>{let c=d+o+r,p=t-(c-1)*n,g=Math.min(Math.max(i,s),a),f=u*d+l*o+g*r,m=p-f;if(r>0&&m>0)g+=Math.min(m/r,a-g);else if(r>0&&m<0)g+=Math.max(m/r,s-g);g=r>0?g:0;let h=Qp(p,r,g,o,d),C=(h+g)/2;if(o>0&&h!==u){let T=(u-h)*d,b=C*0.1*o,E=Math.min(Math.abs(T),b);if(T>0)C-=E/o,h+=E/d;else C+=E/o,h-=E/d}return{priority:e,smallSize:g,smallCount:r,mediumSize:C,mediumCount:o,largeSize:h,largeCount:d}},Hr=(e)=>{let t=null,n=1;for(let r of e.largeCounts)for(let i of e.mediumCounts)for(let s of e.smallCounts){let a=Jp(n,e.availableSpace,e.gap,s,e.targetSmallSize,e.minSmallSize,e.maxSmallSize,i,e.targetMediumSize,r,e.targetLargeSize);if(t===null||Qi(a,e.targetLargeSize)<Qi(t,e.targetLargeSize)){if(t=a,Qi(t,e.targetLargeSize)===0)return t}n++}return t};var He=(e)=>e.findIndex((t)=>t.isFocal),Ke=(e)=>{for(let t=e.length-1;t>=0;t--)if(e[t].isFocal)return t;return-1},Vr=(e)=>e.findIndex((t)=>!t.isAnchor),Fr=(e)=>{for(let t=e.length-1;t>=0;t--)if(!e[t].isAnchor)return t;return-1},Ji=(e)=>e.findIndex((t)=>t.isPivot),Sd=(e)=>Ke(e)-He(e)+1,es=(e)=>e.reduce((t,n)=>Math.min(t,n.size),Number.MAX_VALUE),ts=(e)=>e.reduce((t,n)=>Math.max(t,n.size),0),yd=(e)=>{let t=e[He(e)];return t.offset-t.size/2>=0&&He(e)===Vr(e)},xd=(e,t)=>{let n=e[Ke(e)];return n.offset+n.size/2<=t&&Ke(e)===Fr(e)},Id=(e,t)=>{for(let n=Ke(e);n<e.length;n++)if(e[n].size===t)return n;return e.length-1},Ld=(e,t)=>{for(let n=He(e)-1;n>=0;n--)if(e[n].size===t)return n;return 0},Ad=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(e[n].unadjustedOffset<t)return e[n];return e[0]},Nd=(e,t)=>e.find((n)=>n.unadjustedOffset>=t)??e[e.length-1],$r=(e,t,n)=>e+(t-e)*n,ns=(e,t,n)=>({size:$r(e.size,t.size,n),offset:$r(e.offset,t.offset,n),unadjustedOffset:$r(e.unadjustedOffset,t.unadjustedOffset,n),isFocal:n<0.5?e.isFocal:t.isFocal,isAnchor:n<0.5?e.isAnchor:t.isAnchor,isPivot:n<0.5?e.isPivot:t.isPivot,cutoff:$r(e.cutoff,t.cutoff,n)}),wd=(e,t,n)=>e.map((r,i)=>ns(r,t[i],n)),vd=(e,t)=>t-e/2<0&&t+e/2>0,Td=(e,t,n)=>t-e/2<n&&t+e/2>n,Dd=(e)=>{let t=-1,n=0;if(e.forEach((i,s)=>{if(!i.isAnchor&&i.size>n)t=s,n=i.size}),t<0)return[-1,-1,0];let r=t;while(r<e.length-1&&e[r+1].size===n)r++;return[t,r,n]},Md=(e,t,n,r,i,s,a,o)=>{if(e.length===0||t<0||t>=e.length)return[];let l=e[t],d=[],u=vd(l.size,n)?n-l.size/2:Td(l.size,n,a)?n+l.size/2-a:0;d.push({size:l.size,offset:n,unadjustedOffset:n,isFocal:t>=r&&t<=i,isAnchor:l.isAnchor,isPivot:!0,cutoff:u});let c=n-s/2-o,p=n-s/2-o;for(let g=t-1;g>=0;g--){let f=e[g],m=c-f.size/2,h=p-s/2;d.unshift({size:f.size,offset:m,unadjustedOffset:h,isFocal:g>=r&&g<=i,isAnchor:f.isAnchor,isPivot:!1,cutoff:vd(f.size,m)?Math.abs(m-f.size/2):0}),c-=f.size+o,p-=s+o}c=n+s/2+o,p=n+s/2+o;for(let g=t+1;g<e.length;g++){let f=e[g],m=c+f.size/2,h=p+s/2;d.push({size:f.size,offset:m,unadjustedOffset:h,isFocal:g>=r&&g<=i,isAnchor:f.isAnchor,isPivot:!1,cutoff:Td(f.size,m,a)?m+f.size/2-a:0}),c+=f.size+o,p+=s+o}return d},rs=(e,t,n,r,i)=>{let[s,a,o]=Dd(i);return Md(i,n,r,s,a,o,e,t)},eg=(e,t,n,r)=>{let[i,s,a]=Dd(r);if(i<0)return[];let o=s-i,l=a/2;if(n==="center"){let d=t===0||o%2===0?0:t/2,u=Math.floor(o/2)*t;l=e/2-a/2*o-d-u}return Md(r,i,l,i,s,a,e,t)},Ur=(e,t,n,r,i,s)=>{let a=[{size:r,isAnchor:!0}],o=(l,d)=>{for(let u=0;u<d;u++)a.push({size:l,isAnchor:!1})};if(s==="center")o(e.smallSize,Math.floor(e.smallCount/2)),o(e.mediumSize,Math.floor(e.mediumCount/2)),o(e.largeSize,e.largeCount),o(e.mediumSize,Math.ceil(e.mediumCount/2)),o(e.smallSize,Math.ceil(e.smallCount/2));else o(e.largeSize,e.largeCount),o(e.mediumSize,e.mediumCount),o(e.smallSize,e.smallCount);return a.push({size:i,isAnchor:!0}),eg(t,n,s,a)},Od=(e,t)=>{let n=[];for(let r=e;r>=t;r--)n.push(r);return n},Rd=(e,t,n,r,i)=>{if(e<=0||t<=0)return[];let s=[1],a=[1,0],o=Math.min(t,e),l=Math.min(Math.max(o/3,i.minSmallSize),i.maxSmallSize),d=(o+l)/2;if(e<i.minSmallSize*2)s=[0];let u=e-d*Math.max(...a)-i.maxSmallSize*Math.max(...s),c=Math.max(1,Math.floor(u/o)),p=Math.ceil(e/o),g=Od(p,c),f={availableSpace:e,gap:n,targetSmallSize:l,minSmallSize:i.minSmallSize,maxSmallSize:i.maxSmallSize,smallCounts:s,targetMediumSize:d,mediumCounts:a,targetLargeSize:o,largeCounts:g},m=Hr(f);if(m&&kr(m)>r){let h=kr(m)-r,C=m.smallCount,T=m.mediumCount;while(h>0){if(C>0)C-=1;else if(T>1)T-=1;h-=1}m=Hr({...f,smallCounts:[C],mediumCounts:[T]})}if(!m)return[];return Ur(m,e,n,i.anchorSize,i.anchorSize,"start")},_d=(e,t,n,r,i,s)=>{if(e<=0)return[];let a=i&&r>=3,o=r<=1?[0]:a?[2]:[1],l=Math.min(t??e,e),d=Math.min(Math.max(l/3,s.minSmallSize),s.maxSmallSize),u=s.minSmallSize*Math.max(...o)+s.minSmallSize*1.25;if(e<u)o=[0];let c=e-s.minSmallSize*Math.max(...o),p=Math.max(1,Math.floor(c/l)),g=Math.ceil(e/l),f=Hr({availableSpace:e,gap:n,targetSmallSize:d,minSmallSize:s.minSmallSize,maxSmallSize:s.maxSmallSize,smallCounts:o,targetMediumSize:0,mediumCounts:[0],targetLargeSize:l,largeCounts:Od(g,p)});if(!f)return[];let m=a&&r>=kr(f)?"center":"start";return Ur(f,e,n,s.anchorSize,s.anchorSize,m)},tg=(e,t,n,r)=>{let i=Math.max(n*1.5,e);if(i>t*r)i=Math.max(n*1.2,e);return i},Gr=(e,t,n,r)=>{if(e<=0||t<=0)return[];let i=Math.min(t,e),s=Math.max(1,Math.floor((e+n)/(i+n))),a=Math.max(0,e-s*(i+n)),o=a>0?1:0,l=tg(r.anchorSize,i,a,r.mediumLargeThreshold),d={priority:0,smallSize:0,smallCount:0,mediumSize:l,mediumCount:o,largeSize:i,largeCount:s},u=Math.min(r.anchorSize,t),c=Math.max(u,l*0.5);return Ur(d,e,n,c,r.anchorSize,"start")},Pd=(e,t,n)=>{if(e<=0)return[];return Ur({priority:0,smallSize:0,smallCount:0,mediumSize:0,mediumCount:0,largeSize:e,largeCount:1},e,t,n.anchorSize,n.anchorSize,"start")};var is=(e,t,n,r,i)=>{if(i<=n)return e;if(i>=r)return t;return e+(t-e)*((i-n)/(r-n))},zr=(e,t,n,r,i,s)=>{let a=e.filter((d)=>!d.isAnchor).length,o=r/a;return rs(t,n,s,i.offset-o/2+r,e.map((d)=>({size:d.size-Math.abs(o),isAnchor:d.isAnchor}))).map((d,u)=>({...d,unadjustedOffset:e[u].unadjustedOffset}))},Wr=(e,t,n,r,i)=>{let s=t>n?1:-1,a=e[t],o=(a.size-a.cutoff+i)*s,l=e[Ji(e)],d=e.slice();return d.splice(t,1),d.splice(n,0,a),rs(r,i,Ji(e)+s,l.offset+o,d.map((u)=>({size:u.size,isAnchor:u.isAnchor})))},ng=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(yd(e)){if(r!==0)i.push(zr(e,t,n,r,e[He(e)],He(e)));return i}let s=Vr(e),o=He(e)-s;if(o<=0&&e[He(e)].cutoff>0)return i.push(Wr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=s+l,c=e.length-1;if(u>0){let p=e[u-1].size;c=Id(d,p)-1}i.push(Wr(d,Vr(e),c,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=zr(l,t,n,r,l[He(l)],He(l))}return i},rg=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(xd(e,t)){if(r!==0)i.push(zr(e,t,n,-r,e[Ke(e)],Ke(e)));return i}let s=Ke(e),a=Fr(e),o=a-s;if(o<=0&&e[Ke(e)].cutoff>0)return i.push(Wr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=a-l,c=0;if(u<e.length-1){let p=e[u+1].size;c=Ld(d,p)+1}i.push(Wr(d,Fr(e),c,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=zr(l,t,n,-r,l[Ke(l)],Ke(l))}return i},Bd=(e,t,n)=>{let r=[0];if(e===0||t.length===0)return r;for(let i=1;i<t.length;i++){let s=t[i-1],a=t[i],o=n?a[0].unadjustedOffset-s[0].unadjustedOffset:s[s.length-1].unadjustedOffset-a[a.length-1].unadjustedOffset,l=i===t.length-1?1:r[i-1]+o/e;r.push(l)}return r},kd=(e,t,n,r,i)=>{let s=ng(e,t,n,r),a=rg(e,t,n,i),o=e.length?e[He(e)].size:0,l=s.length?Math.max(s[s.length-1][0].unadjustedOffset-s[0][0].unadjustedOffset,r):0,d=a.length?Math.max(a[0][a[0].length-1].unadjustedOffset-a[a.length-1][a[a.length-1].length-1].unadjustedOffset,i):0,u=e.length?es(e):0,c=e.length?ts(e):0;for(let p of[...s,...a])u=Math.min(u,es(p)),c=Math.max(c,ts(p));return{defaultKeylines:e,startSteps:s,endSteps:a,availableSpace:t,gap:n,beforePadding:r,afterPadding:i,itemSize:o,minItemSize:u,maxItemSize:c,valid:e.length>0&&t!==0&&o!==0,startShiftDistance:l,endShiftDistance:d,startShiftPoints:Bd(l,s,!0),endShiftPoints:Bd(d,a,!1)}},Hd=(e,t,n,r=!1)=>{let i=Math.max(0,t),s=e.startShiftDistance,a=Math.max(0,n-e.endShiftDistance);if(i>=s&&i<=a)return e.defaultKeylines;let o=is(1,0,0,s,i),{startShiftPoints:l,startSteps:d}=e;if(i>a){if(o=is(0,1,a,n,i),l=e.endShiftPoints,d=e.endSteps,a<0.01&&e.startSteps.length===2&&e.endSteps.length===2)d=[e.startSteps[1],e.endSteps[1]]}let u=0,c=0,p=0,g=l[0];for(let f=1;f<d.length;f++){let m=l[f];if(o<=m){u=f-1,c=f,p=is(0,1,g,m,o);break}g=m}if(r)return d[Math.round(p)===0?u:c];return wd(d[u],d[c],p)},ss=(e,t,n)=>{if(!e.valid)return 0;let r=(d)=>d[He(d)].unadjustedOffset-e.itemSize/2,i=(d)=>d[Ke(d)].unadjustedOffset-e.itemSize/2,s=Math.round(r(e.defaultKeylines)),a=e.startSteps.length-1;if(t<=a){let d=Math.min(Math.max(a-t,0),a);s=Math.round(r(e.startSteps[d]))}let o=e.endSteps.length-1,l=n-1;if(t>=l-o&&n>Sd(e.defaultKeylines)){let d=Math.min(Math.max(o-(l-t),0),o);s=Math.round(i(e.endSteps[d]))}return s},$d=(e,t)=>Math.max(0,e.itemSize*t+e.gap*(t-1)-e.availableSpace),Vd=(e,t,n,r)=>{let i=e.itemSize+e.gap,s=n*i+e.itemSize/2-r,a=Ad(t,s),o=Nd(t,s),l=a===o?1:(s-a.unadjustedOffset)/(o.unadjustedOffset-a.unadjustedOffset),d=ns(a,o,l),u=d.offset;if(a===o)u+=(s-d.unadjustedOffset)/d.size;return{size:d.size,center:u,keyline:d}};var Fd=0.4,ig=4,as=(e)=>(t)=>{let{variant:n,gap:r,padding:i,snap:s}=Zi(e),a=n===ke.FULL_SCREEN,o={minSmallSize:e.minSmallItemWidth??Se.MIN_SMALL_ITEM_WIDTH,maxSmallSize:e.maxSmallItemWidth??Se.MAX_SMALL_ITEM_WIDTH,anchorSize:Se.ANCHOR_SIZE,mediumLargeThreshold:Se.MEDIUM_LARGE_THRESHOLD},l=e.cornerRadius??Se.CORNER_RADIUS,d=typeof window<"u"&&typeof window.matchMedia==="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,{element:u,scroller:c,track:p,slideElements:g}=t,f=t.getClass("carousel"),m=`${f}__snap`;u.classList.toggle(`${f}--snap`,s);let h=null,C=0,T=0,b=0,E=[],v=Math.max(0,e.initialSlide??Se.INITIAL_SLIDE),S=new WeakMap,y=null,L=0,I=()=>{y=null,window.clearTimeout(L)},x=(F)=>{y=F,window.clearTimeout(L),L=window.setTimeout(I,1000)},A=()=>a?c.scrollTop:c.scrollLeft,N=(F,q)=>{let Ee=q&&!d?.matches?"smooth":"auto";if(typeof c.scrollTo==="function")c.scrollTo(a?{top:F,behavior:Ee}:{left:F,behavior:Ee});else if(a)c.scrollTop=F;else c.scrollLeft=F},k=()=>{t.emit?.(Cd.CHANGE,{index:v})},X=(F)=>{let q=0,Ee=Number.MAX_VALUE;return E.forEach((ve,Ce)=>{let Ge=Math.abs(F-ve);if(Ge<Ee)Ee=Ge,q=Ce}),q},U=(F)=>{let q=d?.matches===!0,Ee=e.itemWidth??Se.ITEM_WIDTH;switch(n){case ke.HERO:case ke.HERO_CENTER:{let ve=e.itemWidth??null;return q?Gr(F,Math.min(ve??F,F),r,o):_d(F,ve,r,C,n===ke.HERO_CENTER,o)}case ke.UNCONTAINED:return Gr(F,Ee,r,o);case ke.FULL_SCREEN:return Pd(F,r,o);default:return q?Gr(F,Ee,r,o):Rd(F,Ee,r,C,o)}},j=()=>{if(C=g.length,T=a?c.clientHeight:c.clientWidth,v=C?Math.min(v,C-1):0,T<=0||C===0){h=null;return}let F=n===ke.UNCONTAINED?0:i;if(h=kd(U(T),T,r,i,F),!h.valid){h=null;return}let q=h.itemSize+h.gap;b=-ss(h,0,C),E=g.map((Ce,Ge)=>Ge*q-ss(h,Ge,C)-b);let Ee=Math.max(0,E[C-1]??0);p.style[a?"height":"width"]=`${T+Ee}px`,p.style[a?"width":"height"]="",p.querySelectorAll(`.${m}`).forEach((Ce)=>Ce.remove());let ve=document.createDocumentFragment();E.forEach((Ce)=>{let Ge=document.createElement("div");Ge.className=m,Ge.style[a?"top":"left"]=`${Ce}px`,ve.appendChild(Ge)}),p.appendChild(ve),g.forEach((Ce)=>{Ce.style[a?"height":"width"]=`${h.itemSize}px`,Ce.style[a?"width":"height"]=""}),u.style.setProperty("--mtrl-carousel-corner",`${l}px`)},pe=()=>{if(!h)return;let F=A(),q=F+b,Ee=Hd(h,q,$d(h,C)),ve=h.itemSize,Ce=h.maxItemSize-h.minItemSize;for(let mr=0;mr<C;mr++){let Bt=g[mr],fr=Vd(h,Ee,mr,q),pr=Math.max(0,Math.min(ve,fr.size)),Ci=fr.center-ve/2+F,Ga=fr.center+pr/2<-ve||fr.center-pr/2>T+ve,Ei=Math.max(0,(ve-pr)/2),za=Ce>0?Math.min(1,Math.max(0,(pr-h.minItemSize)/Ce)):1,Wa=Ga?"hidden":`${Math.round(Ci*100)/100}|${Math.round(Ei*100)/100}|${za.toFixed(3)}`;if(S.get(Bt)===Wa)continue;if(S.set(Bt,Wa),Ga){Bt.style.visibility="hidden";continue}Bt.style.visibility="",Bt.style.transform=a?`translate3d(0, ${Ci}px, 0)`:`translate3d(${Ci}px, 0, 0)`,Bt.style.clipPath=a?`inset(${Ei}px 0 round ${l}px)`:`inset(0 ${Ei}px round ${l}px)`,Bt.style.setProperty("--mtrl-carousel-fade",za.toFixed(3))}if(y!==null){if(Math.abs(A()-(E[y]??0))<1)I();return}let Ge=X(A());if(Ge!==v)v=Ge,k()},ge=()=>{if(j(),h)x(v),N(E[v]??0,!1);pe()},w=(F)=>{if(!C)return;let q=Math.min(Math.max(F,0),C-1);if(h)x(q),N(E[q]??0,!0);if(q!==v)v=q,k()},W=()=>w(v+1),ee=()=>w(v-1),R=(F)=>{let q=F?.closest?.(`.${f}__item`);return q?g.indexOf(q):-1},re=(F)=>{let q=R(F.target);if(q<0)return;let Ee=a?"ArrowDown":"ArrowRight",ve=a?"ArrowUp":"ArrowLeft",Ce=-1;if(F.key===Ee)Ce=q+1;else if(F.key===ve)Ce=q-1;else if(F.key==="Home")Ce=0;else if(F.key==="End")Ce=C-1;if(Ce<0||Ce>=C)return;F.preventDefault(),g[Ce].focus({preventScroll:!0}),w(Ce)},ue=(F)=>{let q=R(F.target);if(q>=0&&q!==v)w(q)},Ue=!1,ut=!1,wn=0,qt=0,Dn=0,jt=0,ur=0,Ha=0,_t=()=>{window.clearTimeout(Ha),c.removeEventListener("scrollend",_t),delete u.dataset.settling},$a=(F)=>{if(I(),F.pointerType!=="mouse"||F.button!==0||!h)return;Ue=!0,ut=!1,wn=a?F.clientY:F.clientX,Dn=wn,jt=F.timeStamp,ur=0,qt=A(),_t(),u.dataset.settling="true",c.setPointerCapture(F.pointerId)},Va=(F)=>{if(!Ue)return;let q=a?F.clientY:F.clientX,Ee=q-wn;if(!ut&&Math.abs(Ee)<ig)return;ut=!0,u.dataset.dragging="true";let ve=F.timeStamp-jt;if(ve>0)ur=(q-Dn)/ve;if(Dn=q,jt=F.timeStamp,a)c.scrollTop=qt-Ee;else c.scrollLeft=qt-Ee;F.preventDefault()},cr=(F)=>{if(!Ue)return;if(Ue=!1,c.hasPointerCapture(F.pointerId))c.releasePointerCapture(F.pointerId);if(delete u.dataset.dragging,!ut){_t();return}if(s){let q=X(A());if(ur<-Fd)q=Math.min(C-1,q+1);else if(ur>Fd)q=Math.max(0,q-1);w(q),c.addEventListener("scrollend",_t,{once:!0}),Ha=window.setTimeout(_t,600)}else _t()},Fa=(F)=>{if(ut)ut=!1,F.preventDefault(),F.stopPropagation()};c.addEventListener("scroll",pe,{passive:!0}),c.addEventListener("wheel",I,{passive:!0}),c.addEventListener("touchstart",I,{passive:!0}),c.addEventListener("keydown",re),c.addEventListener("focusin",ue),c.addEventListener("pointerdown",$a),c.addEventListener("pointermove",Va),c.addEventListener("pointerup",cr),c.addEventListener("pointercancel",cr),c.addEventListener("click",Fa,!0),d?.addEventListener?.("change",ge);let Ua=typeof ResizeObserver==="function"?new ResizeObserver(ge):null;Ua?.observe(c),t.onSlidesChanged(ge),ge();let $f=t.lifecycle?.destroy,Pt=t;return Pt.getCurrentSlide=()=>v,Pt.getVariant=()=>n,Pt.next=W,Pt.prev=ee,Pt.goTo=w,Pt.lifecycle={destroy:()=>{_t(),Ua?.disconnect(),d?.removeEventListener?.("change",ge),I(),c.removeEventListener("scroll",pe),c.removeEventListener("wheel",I),c.removeEventListener("touchstart",I),c.removeEventListener("keydown",re),c.removeEventListener("focusin",ue),c.removeEventListener("pointerdown",$a),c.removeEventListener("pointermove",Va),c.removeEventListener("pointerup",cr),c.removeEventListener("pointercancel",cr),c.removeEventListener("click",Fa,!0),$f?.()}},Pt};var Ud=()=>(e)=>{let t={element:e.element,slides:e.slides,lifecycle:{destroy:()=>e.lifecycle?.destroy()},getClass:e.getClass,next(){return e.next(),t},prev(){return e.prev(),t},goTo(n){return e.goTo(n),t},getCurrentSlide:()=>e.getCurrentSlide(),getVariant:()=>e.getVariant(),addSlide(n,r){return e.slides.addSlide(n,r),t},removeSlide(n){return e.slides.removeSlide(n),t},destroy(){e.lifecycle?.destroy()},on(n,r){return e.on?.(n,r),t},off(n,r){return e.off?.(n,r),t},addClass(...n){return e.element.classList.add(...n),t}};return t};var Gd=(e={})=>{let t=Ed(e);return M(D,B(),O(bd(t)),ji(t),P(),as(t),Ud())(t)},os=Gd;ne();Z();J();var zd=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setIndeterminate(i){return r.setIndeterminate?.(i),this},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});Q();var sg={variant:"filled",labelPosition:"end"},Wd=(e={})=>_(sg,e,"checkbox"),Kd=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),Yd=(e)=>(t)=>{let n=document.createElement("span");return n.className=`${e.prefix}-checkbox-icon`,n.innerHTML=`
9
+ </svg>`,Bn=(e)=>(t)=>{let n=document.createElement("span");n.className=`${e.prefix}-${e.componentName}-track`;let r=document.createElement("span");if(r.className=`${e.prefix}-${e.componentName}-thumb`,n.appendChild(r),e.icon!=="none"){let i=document.createElement("span");i.className=`${e.prefix}-${e.componentName}-thumb-icon`,i.innerHTML=e.icon||ip,r.appendChild(i)}return t.element.appendChild(n),{...t,track:n,thumb:r}};var Er=(e)=>{let t=new Map;return{on(n,r){return e.addEventListener(n,r),t.set(r,n),this},off(n,r){return e.removeEventListener(n,r),t.delete(r),this},destroy(){t.forEach((n,r)=>{e.removeEventListener(n,r)}),t.clear()},getHandlers(){return new Map(t)}}};var xi=(e)=>(t)=>{let n=Er(e||t.element),r={addListeners(i){return Object.entries(i).forEach(([s,a])=>{n.on(s,a)}),this},removeListeners(i){return Object.entries(i).forEach(([s,a])=>{n.off(s,a)}),this},once(i,s){let a=(o)=>{s(o),n.off(i,a)};return n.on(i,a),this},on(i,s){return n.on(i,s),this},off(i,s){return n.off(i,s),this},destroy(){n.destroy()}};if(St(t)){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{n.destroy(),i.call(t.lifecycle)}}return{...t,events:r,on:r.on.bind(r),off:r.off.bind(r)}};var vo=()=>{};var Jt=(e,t,n={})=>{let r=null,i=0,{leading:s=!0,trailing:a=!0}=n;return function(...o){let l=Date.now();if(!i&&!s)i=l;let d=t-(l-i);if(d<=0||d>t){if(r)clearTimeout(r),r=null;i=l,e.apply(this,o)}else if(!r&&a)r=window.setTimeout(()=>{i=s?Date.now():0,r=null,e.apply(this,o)},d)}},en=(e,t,n={})=>{let r=null,i=null,s=null,a,o=null,l=0,{leading:d=!1,maxWait:u}=n,m=(f)=>{let h=f-(o||0),C=f-l;return!o||h>=t||h<0||u!==void 0&&C>=u},p=(f)=>{let h=i,C=s;return i=s=null,l=f,a=e.apply(C,h),a},g=(f)=>{if(r=null,i)return p(f);return a},c=(f)=>(l=f,r=window.setTimeout(()=>{g(Date.now())},t),d?p(f):a);return function(...f){let h=Date.now(),C=m(h);if(i=f,s=this,o=h,C){if(r===null)return c(h);if(u!==void 0)r=window.setTimeout(()=>{let T=Date.now();if(m(T))return g(T)},Math.min(t,u-(h-l)))}if(r===null)r=window.setTimeout(()=>{g(Date.now())},t);return a}},br=(e)=>{let t=!1,n;return function(...r){if(!t)t=!0,n=e.apply(this,r);return n}};var Ii=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=Jt(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,throttled:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.throttled),delete n[a];return s};if(St(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.throttled)}),a.call(t.lifecycle)}}if(e.throttledEvents)Object.entries(e.throttledEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addThrottledEvent:r,removeThrottledEvent:i};return s};var To=()=>{};function sp(e){return"lifecycle"in e&&e.lifecycle&&typeof e.lifecycle==="object"&&"destroy"in e.lifecycle&&typeof e.lifecycle.destroy==="function"}var Li=(e={})=>(t)=>{let n={},r=(a,o,l,d={})=>{if(n[a])i(a);let u=en(o,l,d);return t.element.addEventListener(a,u),n[a]={original:o,debounced:u},s},i=(a)=>{let o=n[a];if(o)t.element.removeEventListener(a,o.debounced),delete n[a];return s};if(sp(t)){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{Object.keys(n).forEach((o)=>{let l=n[o];t.element.removeEventListener(o,l.debounced)}),a.call(t.lifecycle)}}if(e.debouncedEvents)Object.entries(e.debouncedEvents).forEach(([a,o])=>{r(a,o.handler,o.wait,o.options)});let s={...t,addDebouncedEvent:r,removeDebouncedEvent:i};return s};var So=()=>{};function Ai(e){return"input"in e&&e.input instanceof HTMLElement&&"disabled"in e.input}var oe=(e)=>(t)=>{let n=`${t.getClass(e.componentName||t.componentName||"component")}--disabled`,r={enable(){if(t.element.classList.remove(n),Ai(t))t.input.disabled=!1,t.input.removeAttribute("disabled");else{let i=t.element;if("disabled"in i)i.disabled=!1;t.element.removeAttribute("disabled")}return this},disable(){if(t.element.classList.add(n),Ai(t))t.input.disabled=!0,t.input.setAttribute("disabled","true");else{let i=t.element;if("disabled"in i)i.disabled=!0;t.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(Ai(t))return t.input.disabled;let i=t.element;return"disabled"in i&&i.disabled}};if(e.disabled)requestAnimationFrame(()=>{r.disable()});return{...t,disabled:r}};function ap(e){return"events"in e&&e.events&&typeof e.events==="object"&&"destroy"in e.events&&typeof e.events.destroy==="function"}function op(e){return"text"in e&&e.text&&typeof e.text==="object"&&"getElement"in e.text&&typeof e.text.getElement==="function"}function lp(e){return"icon"in e&&e.icon&&typeof e.icon==="object"&&"getElement"in e.icon&&typeof e.icon.getElement==="function"}var k=()=>(e)=>{let t=!1,n=Me();return{...e,lifecycle:{onMount:(i)=>n.on("mount",i),onUnmount:(i)=>n.on("unmount",i),mount:()=>{if(!t)t=!0,n.emit("mount")},unmount:()=>{if(t)t=!1,n.emit("unmount"),n.clear()},isMounted:()=>t,destroy(){if(t)this.unmount();if(ap(e))e.events.destroy();if(op(e)){let i=e.text.getElement();if(i)i.remove()}if(lp(e)){let i=e.icon.getElement();if(i)i.remove()}if(e.element)e.element.remove()}}}};var yo=()=>{};var J=Y(()=>{mo();po();Co();bo();vo();To();So();yo()});var ne=Y(()=>{Z();J()});function Ni(e,t){Hn[e]=t}function $n(e){return Hn[e]||{}}function wi(e){Object.assign(Hn,e)}function Di(){Object.keys(Hn).forEach((e)=>{delete Hn[e]})}var Hn;var Mi=Y(()=>{Hn={}});var P=(e,t={},n)=>{let r=$n(n),i=t.className!==void 0?t.className:t.class,s=e.className!==void 0?e.className:e.class,a={...e,...r,...t,componentName:n,prefix:X,className:i!==void 0?i:s};if("class"in a&&a.className!==void 0)delete a.class;return a},V=(e,t)=>{let n=e.className||e.class,r=t.className,i=[...Array.isArray(n)?n:[n],...Array.isArray(r)?r:[r]].filter(Boolean),s=t.attributes||{};return{tag:t.tag,componentName:e.componentName,attributes:s,className:i.length>0?i:void 0,rawClass:e.rawClass,id:e.id,name:e.name,title:e.title,tabIndex:e.tabIndex,style:e.style,data:e.data,role:e.role,ariaLabel:e.ariaLabel,ariaDescribedBy:e.ariaDescribedBy,ariaLabelledBy:e.ariaLabelledBy,ariaHidden:e.ariaHidden,html:t.html,text:t.text,forwardEvents:t.forwardEvents||{},interactive:t.interactive}};var Q=Y(()=>{rt();Mi()});var zo=(e)=>{let t=new Map,n=(s,a)=>`${s}_${a.toString()}`,r=(s,a)=>(o)=>{try{s(o)}catch(l){console.error(`Error in ${a} handler:`,l)}},i=(s,a)=>{try{e.removeEventListener(s,a)}catch(o){console.warn(`Failed to remove ${s} listener:`,o)}};return{on(s,a,o={}){let l=r(a,s),d=n(s,a);return t.set(d,{original:a,enhanced:l,event:s,options:o}),e.addEventListener(s,l,o),this},off(s,a){let o=n(s,a),l=t.get(o);if(l)i(s,l.enhanced),t.delete(o);return this},pause(){return t.forEach(({enhanced:s,event:a})=>{i(a,s)}),this},resume(){return t.forEach(({enhanced:s,event:a,options:o})=>{e.addEventListener(a,s,o)}),this},destroy(){t.forEach(({enhanced:s,event:a})=>{i(a,s)}),t.clear()},getHandlers(){return new Map(t)},hasHandler(s,a){let o=n(s,a);return t.has(o)}}};var nn=Y(()=>{Qe();Rn()});var Tr,We,Wo,st,be,Fn,Ae,at,Oe,rn,Sr;var ft=Y(()=>{Tr={LINEAR:"linear",CIRCULAR:"circular"},We={FLAT:"flat",WAVY:"wavy"},Wo={CHANGE:"change",COMPLETE:"complete"},st={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1,LABEL:"Loading"},be={CONTAINER:"progress",LINEAR:"progress--linear",CIRCULAR:"progress--circular",TRACK:"progress__track",INDICATOR:"progress__indicator",BUFFER:"progress__buffer",LABEL:"progress__label",INDETERMINATE:"progress--indeterminate",DISABLED:"progress--disabled",TEST:"progress--test",TRANSITION:"progress--transition"},Fn={INDICATOR:"sys-color-primary",TRACK:"sys-color-secondary-container",STOP:"sys-color-primary",BUFFER:"sys-color-primary-container"},Ae={LINEAR:{HEIGHT:4,GAP:4,STOP_INDICATOR:4,STOP_TRAILING_SPACE:6,WAVE_HEIGHT:10,EDGE_INSET:4,MIN_HEIGHT:4},CIRCULAR:{SIZE:40,WAVE_SIZE:48,GAP:4,MIN_SIZE:24,MAX_SIZE:240},COMMON:{STROKE_WIDTH:4}},at={THIN:4,THICK:8},Oe={LINEAR:{WAVELENGTH:40,INDETERMINATE_WAVELENGTH:20,AMPLITUDE:3},CIRCULAR:{WAVELENGTH:15,AMPLITUDE:1.6},SPEED:1,AMPLITUDE_START:0.1,AMPLITUDE_END:0.95,AMPLITUDE_DURATION:500},rn={LINEAR:{DURATION:1750,FIRST_HEAD_DELAY:0,FIRST_HEAD_DURATION:1000,FIRST_TAIL_DELAY:250,FIRST_TAIL_DURATION:1000,SECOND_HEAD_DELAY:650,SECOND_HEAD_DURATION:850,SECOND_TAIL_DELAY:900,SECOND_TAIL_DURATION:850},CIRCULAR:{DURATION:6000,ROTATION_DURATION:300,ROTATION_DELAY:1500,GLOBAL_ROTATION:1080,ADDITIONAL_ROTATION:360,MIN_PROGRESS:0.1,MAX_PROGRESS:0.87},VALUE_DURATION:500},Sr={EMPHASIZED_ACCELERATE:[0.3,0,0.8,0.15],EMPHASIZED_DECELERATE:[0.05,0.7,0.1,1],STANDARD:[0.2,0,0,1],LINEAR:[0,0,1,1]}});var Un=(e,t,n)=>{let r=null,i=()=>{if(r)clearTimeout(r);r=window.setTimeout(()=>{n()},100)};if(typeof ResizeObserver<"u"){let s=new ResizeObserver((a)=>{for(let o of a){let{width:l}=o.contentRect,d=parseFloat(t.style.width||"0");if(Math.abs(l-d)>2)i()}});return s.observe(e),()=>{if(r)clearTimeout(r);s.disconnect()}}else return window.addEventListener("resize",i),()=>{if(r)clearTimeout(r);window.removeEventListener("resize",i)}};var Oi=(e)=>Boolean(e&&typeof e==="object"&&Object.getPrototypeOf(e)===Object.getPrototypeOf({})),Ri=(e,t)=>{let i=t.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),s=e;for(let a=0,o=i.length;a<o;++a){let l=i[a];if(l in s)s=s[l];else return}return s};var xt=(e,t=17)=>{if(!e||!(e instanceof HTMLElement))return{color:"",element:null};let n=0,r=e;while(r&&n<t){let a=window.getComputedStyle(r).backgroundColor;if(a.startsWith("var(")){let o=a.match(/var\((--[\w-]+)\)/);if(o){let l=o[1];a=window.getComputedStyle(document.documentElement).getPropertyValue(l).trim()||"transparent"}}if(a&&a!=="transparent"&&a!=="rgba(0, 0, 0, 0)"&&a!=="rgba(0,0,0,0)")return{color:a,element:r};r=r.parentElement,n++}let i=window.getComputedStyle(document.body).backgroundColor;if(i!=="transparent"&&i!=="rgba(0, 0, 0, 0)")return{color:i,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var _i=()=>{};function ke(e,t){let n=`--${X}-${e}`;if(t?.onThemeChange)Gn(t.onThemeChange);let i=getComputedStyle(document.body).getPropertyValue(n).trim();if(!i)i=getComputedStyle(document.documentElement).getPropertyValue(n).trim();if(!i&&t?.fallback)return t.fallback;if(!i)return"";if(typeof t?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(i))return`rgba(${i}, ${t.alpha})`;if(typeof t?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(i)){let s=i.replace("#",""),a,o,l;if(s.length===3)a=parseInt(s[0]+s[0],16),o=parseInt(s[1]+s[1],16),l=parseInt(s[2]+s[2],16);else a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t.alpha})`}return i}var yr,It=null,bp=()=>{if(It)return;It=new MutationObserver((t)=>{for(let n of t)if(n.type==="attributes"&&(n.attributeName==="data-theme"||n.attributeName==="data-theme-mode")){yr.forEach((r)=>r());break}});let e={attributes:!0,attributeFilter:["data-theme","data-theme-mode"]};if(It.observe(document.documentElement,e),document.body)It.observe(document.body,e)},Gn=(e)=>{if(!It)bp();return yr.add(e),()=>{yr.delete(e)}};var xr=Y(()=>{rt();yr=new Set;if(typeof window<"u")window.addEventListener("unload",()=>{if(It)It.disconnect(),It=null;yr.clear()})});var zn=(e,t)=>{let r=document.createElement("canvas").getContext("2d");if(!r)return`rgba(0, 0, 0, ${t})`;r.fillStyle=e;let i=r.fillStyle;if(i.startsWith("#")){let s=i.substring(1),a=parseInt(s.substring(0,2),16),o=parseInt(s.substring(2,4),16),l=parseInt(s.substring(4,6),16);return`rgba(${a}, ${o}, ${l}, ${t})`}if(i.startsWith("rgb")){let s=i.match(/\d+/g);if(s){let[a,o,l]=s;return`rgba(${a}, ${o}, ${l}, ${t})`}}return`rgba(0, 0, 0, ${t})`};var Ko=(e,t)=>(n,r)=>e(n,r)?t(n,r):n,Yo=(...e)=>e.filter(Boolean).join(" ");var Wn=Y(()=>{_n();_i();xr()});var Kn,vp=()=>({indicator:ke(Fn.INDICATOR,{fallback:Kn.indicator}),track:ke(Fn.TRACK,{fallback:Kn.track}),stop:ke(Fn.STOP,{fallback:Kn.stop}),buffer:ke(Fn.BUFFER,{fallback:Kn.buffer})}),Xo=(e)=>{let t=Kn,n=!1,r=()=>{try{t=vp(),n=!0}catch{}},i=Gn(()=>{r(),e()});return{get:()=>{if(!n)r();return t},refresh:r,destroy:i}};var qo=Y(()=>{Wn();xr();ft();Kn={indicator:"#6750A4",track:"#E8DEF8",stop:"#6750A4",buffer:"#EADDFF"}});var Tp=(e,t,n,r)=>{let i=(s,a,o)=>{let l=1-o;return 3*l*l*o*s+3*l*o*o*a+o*o*o};return(s)=>{if(s<=0)return 0;if(s>=1)return 1;let a=s;for(let d=0;d<8;d++){let u=i(e,n,a)-s;if(Math.abs(u)<0.00001)return i(t,r,a);let m=3*(1-a)*(1-a)*e+6*(1-a)*a*(n-e)+3*a*a*(1-n);if(Math.abs(m)<0.000001)break;a-=u/m}let o=0,l=1;a=s;while(l-o>0.00001){if(i(e,n,a)<s)o=a;else l=a;a=(o+l)/2}return i(t,r,a)}},Pi=(e)=>Tp(e[0],e[1],e[2],e[3]),Zo,Sp,Qo,Ir=(e,t,n)=>{if(e<=t)return 0;if(e>=t+n)return 1;return Zo((e-t)/n)},Jo=(e)=>{let t=rn.LINEAR,n=(e%t.DURATION+t.DURATION)%t.DURATION;return{firstHead:Ir(n,t.FIRST_HEAD_DELAY,t.FIRST_HEAD_DURATION),firstTail:Ir(n,t.FIRST_TAIL_DELAY,t.FIRST_TAIL_DURATION),secondHead:Ir(n,t.SECOND_HEAD_DELAY,t.SECOND_HEAD_DURATION),secondTail:Ir(n,t.SECOND_TAIL_DELAY,t.SECOND_TAIL_DURATION)}},jo=(e,t,n=(r)=>r)=>{let r=t[0];if(e<=r[0])return r[1];for(let i=1;i<t.length;i++){let[s,a]=t[i],[o,l]=t[i-1];if(e<=s){let d=s-o,u=d<=0?1:n((e-o)/d);return l+(a-l)*u}}return t[t.length-1][1]},el=(e)=>{let t=rn.CIRCULAR,n=(e%t.DURATION+t.DURATION)%t.DURATION,r=n/t.DURATION*t.GLOBAL_ROTATION,i=t.ADDITIONAL_ROTATION/4,s=Math.floor(n/t.ROTATION_DELAY),a=n-s*t.ROTATION_DELAY,o=a>=t.ROTATION_DURATION?i:i*Sp(a/t.ROTATION_DURATION),l=s*i+o,d=t.DURATION/2,u=n<=d?jo(n,[[0,t.MIN_PROGRESS],[d,t.MAX_PROGRESS]]):jo(n,[[d,t.MAX_PROGRESS],[t.DURATION,t.MIN_PROGRESS]],Qo);return{rotation:r+l,sweep:u}},tl=(e)=>e<=Oe.AMPLITUDE_START||e>=Oe.AMPLITUDE_END?0:1,ki=(e,t,n)=>{if(e===t)return t;let r=Math.min(1,Math.max(0,n/Oe.AMPLITUDE_DURATION)),i=t>e?Qo:Zo;return e+(t-e)*i(r)};var Lr=Y(()=>{ft();Zo=Pi(Sr.EMPHASIZED_ACCELERATE),Sp=Pi(Sr.EMPHASIZED_DECELERATE),Qo=Pi(Sr.STANDARD)});var Yn,nl,Bi=(e,t,n,r,i,s,a,o,l)=>{if(s<=0||r<=0)return;if(e.strokeStyle=a,e.lineWidth=o,e.lineCap="round",e.lineJoin="round",e.beginPath(),!l||l.amplitude<=0){e.arc(t,n,r,i,i+s),e.stroke();return}let d=s*r,u=Math.max(8,Math.ceil(d/Math.max(1,l.wavelength/24)));for(let m=0;m<=u;m++){let p=m/u,g=i+s*p,c=p*d,f=r+l.amplitude*Math.sin(Yn*(c-l.phase)/l.wavelength),h=t+Math.cos(g)*f,C=n+Math.sin(g)*f;if(m===0)e.moveTo(h,C);else e.lineTo(h,C)}e.stroke()},rl=(e,t)=>{let{ctx:n,width:r,height:i}=e,{strokeWidth:s,colors:a,indeterminate:o,waveAmplitude:l}=t;if(r<=0||i<=0)return;let d=Math.min(r,i),u=r/2,m=i/2,p=d/2-s/2-l;if(p<=0)return;n.clearRect(0,0,r,i);let g=d/Ae.CIRCULAR.SIZE,c=Oe.CIRCULAR.WAVELENGTH*g,f=l>0?{amplitude:l,wavelength:c,phase:t.time/1000*Oe.SPEED*c%c}:void 0,h=Ae.CIRCULAR.GAP+s,C=d>0?h/(Math.PI*d)*Yn:0;if(o){let{rotation:S,sweep:y}=el(t.time),L=S*Math.PI/180;Bi(n,u,m,p,L,y*Yn,a.indicator,s,f);return}let b=Math.min(1,Math.max(0,t.progress))*Yn,E=Math.min(b,C),v=Yn-b-E*2;if(v>0)Bi(n,u,m,p,nl+b+E,v,a.track,s);Bi(n,u,m,p,nl,b,a.indicator,s,f)};var il=Y(()=>{Lr();ft();Yn=Math.PI*2,nl=-Math.PI/2});var yp=(e,t,n,r,i,s,a,o,l)=>{let d=Math.min(i,s),u=Math.max(i,s);if(u-d<=0)return;let m=r/2,p=(b)=>{let E=o?1-b:b;return Math.min(Math.max(E*t,m),t-m)},g=p(d),c=p(u);if(Math.abs(c-g)<0.000001&&d!==u)return;if(e.strokeStyle=a,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.beginPath(),!l||l.amplitude<=0){e.moveTo(Math.min(g,c),n),e.lineTo(Math.max(g,c),n),e.stroke();return}let f=Math.min(g,c),h=Math.max(g,c),C=Math.max(1,l.wavelength/24);for(let b=f;b<=h;b+=C){let E=n+l.amplitude*Math.sin(2*Math.PI*(b-l.phase)/l.wavelength);if(b===f)e.moveTo(b,E);else e.lineTo(b,E)}let T=n+l.amplitude*Math.sin(2*Math.PI*(h-l.phase)/l.wavelength);e.lineTo(h,T),e.stroke()},xp=(e,t,n,r,i)=>{let s=Math.min(Ae.LINEAR.STOP_INDICATOR,n),a=Math.min((n-s)/2,Ae.LINEAR.STOP_TRAILING_SPACE),o=i?s/2+a:t-s/2-a;e.fillStyle=r,e.beginPath(),e.arc(o,n/2,s/2,0,2*Math.PI),e.fill()},sl=(e,t)=>{let{ctx:n,width:r,height:i}=e,{strokeWidth:s,colors:a,rtl:o,indeterminate:l,waveAmplitude:d}=t;if(r<=0||i<=0)return;let u=i/2;n.clearRect(0,0,r,i);let m=Ae.LINEAR.GAP+s,p=r>0?m/r:0,g=l?Oe.LINEAR.INDETERMINATE_WAVELENGTH:Oe.LINEAR.WAVELENGTH,c=d>0?{amplitude:d,wavelength:g,phase:t.time/1000*Oe.SPEED*g%g}:void 0,f=(T,b,E,v=!1)=>yp(n,r,u,s,T,b,E,o,v?c:void 0);if(l){let{firstHead:T,firstTail:b,secondHead:E,secondTail:v}=Jo(t.time);if(T<1-p)f(T>0?T+p:0,1,a.track);if(T-b>0)f(b,T,a.indicator,!0);if(b>p)f(E>0?E+p:0,b<1?b-p:1,a.track);if(E-v>0)f(v,E,a.indicator,!0);if(v>p)f(0,v-p,a.track);return}let h=Math.min(1,Math.max(0,t.progress)),C=h+Math.min(h,p);if(C<=1)f(C,1,a.track);if(t.buffer>h){let T=Math.min(1,t.buffer);if(T>C)f(C,T,a.buffer)}if(f(0,h,a.indicator,!0),t.showStopIndicator)xp(n,r,i,a.stop,o)};var al=Y(()=>{Lr();ft()});var Ip=(e="thin")=>{if(typeof e==="number")return e;return e==="thick"?at.THICK:at.THIN},ll=(e,t,n)=>e?Oe.CIRCULAR.AMPLITUDE*(n/Ae.CIRCULAR.SIZE):Oe.LINEAR.AMPLITUDE*(t/at.THIN),ol=(e)=>{let t=e.shape===We.WAVY?Ae.CIRCULAR.WAVE_SIZE:Ae.CIRCULAR.SIZE;return Math.max(Ae.CIRCULAR.MIN_SIZE,Math.min(e.size??t,Ae.CIRCULAR.MAX_SIZE))},Lp=(e,t)=>t?e+2*ll(!1,e,0):e,dl=(e)=>(t)=>{let n=e.variant===Tr.CIRCULAR,r=t.element.ownerDocument?.defaultView??null,i=document.createElement("canvas");i.className=`${t.getClass(be.CONTAINER)}-canvas`,i.setAttribute("aria-hidden","true"),t.element.appendChild(i);let s=null,a=e.thickness??"thin",o=e.shape??We.FLAT,l=ol(e),d=e.value??0,u=d,m=null,p=0,g=0,c=0,f=0,h=null,C=0,T=0,b=r?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,E=()=>o===We.WAVY,v=()=>Ip(a),S=()=>t.state?.max??e.max??100,y=()=>t.state?.indeterminate??e.indeterminate??!1,L=Xo(()=>N(C)),I=()=>{if(!s)return;let _=r?.devicePixelRatio||1,re,ue;if(n)re=ue=l;else{let Ue=t.element.getBoundingClientRect?.();re=Math.max(Ue?.width||t.element.offsetWidth||0,0),ue=Lp(v(),E())}i.style.width=`${re}px`,i.style.height=`${ue}px`,i.width=Math.round(re*_),i.height=Math.round(ue*_),s.width=re,s.height=ue,s.pixelRatio=_,s.ctx.setTransform(1,0,0,1,0,0),s.ctx.scale(_,_)},x=()=>{if(typeof i.getContext!=="function")return!1;let _=i.getContext("2d");if(!_)return!1;return s={canvas:i,ctx:_,width:0,height:0,pixelRatio:r?.devicePixelRatio||1},I(),t.ctx=_,!0},A=()=>{if(!E())return 0;let _=ll(n,v(),l);if(y())return _;let re=ki(g,c,(r?.performance??performance).now()-f);return _*re},N=(_=C)=>{if(!s||s.width<=0||s.height<=0)return;let re=y(),ue=re?0:d/S();if(n)rl(s,{progress:ue,indeterminate:re,strokeWidth:v(),time:_,waveAmplitude:A(),colors:L.get()});else{let Ue=r?.getComputedStyle?.(t.element)?.direction==="rtl";sl(s,{progress:ue,buffer:(t.state?.buffer??e.buffer??0)/S(),indeterminate:re,strokeWidth:v(),time:_,waveAmplitude:A(),rtl:Ue,colors:L.get(),showStopIndicator:!re&&e.showStopIndicator!==!1})}},D=()=>!b?.matches&&(y()||E()),G=(_=0)=>{if(U(),!D()){N(0);return}T=0;let re=(ue)=>{if(T===0)T=ue-_;C=ue-T,N(C),h=D()?requestAnimationFrame(re):null};h=requestAnimationFrame(re)},U=()=>{if(h!==null)cancelAnimationFrame(h),h=null},j=()=>{if(m!==null)cancelAnimationFrame(m),m=null},pe=(_)=>{let re=tl(_);if(re===c)return;g=ki(g,c,(r?.performance??performance).now()-f),c=re,f=(r?.performance??performance).now()},ge=(_)=>{t.element.dispatchEvent(new CustomEvent("complete",{detail:{value:_,max:S()}}))};t.setValue=(_,re=!0)=>{if(u=Math.max(0,Math.min(S(),_)),pe(u/S()),m!==null&&re)return;if(j(),!re||b?.matches){if(d=u,N(),u>=S())ge(u);return}let ue=d,Ue=(r?.performance??performance).now(),ut=Ue-p,wn=p>0&&ut<rn.VALUE_DURATION?Math.max(100,ut*0.9):rn.VALUE_DURATION;p=Ue;let qt=(Dn)=>{let jt=Math.min((Dn-Ue)/wn,1);if(d=ue+(u-ue)*jt,h===null)N();if(jt<1)m=requestAnimationFrame(qt);else{if(m=null,d=u,h===null)N();if(u>=S())ge(u)}};m=requestAnimationFrame(qt)},t.setIndeterminate=(_)=>{if(t.state)t.state.indeterminate=_;if(j(),d=t.state?.value??d,!_)pe(d/S());if(G(),!D())N(0)},t.setThickness=(_)=>{a=_,I(),N()},t.setShape=(_)=>{if(o===_)return;if(o=_,t.currentShape=_,t.state)t.state.shape=_;if(n&&e.size===void 0)l=ol({...e,shape:_});if(_===We.WAVY)g=0,c=0,f=(r?.performance??performance).now(),pe(d/S());if(I(),G(C),!D())N(0)},t.setSize=(_)=>{if(!n)return;l=Math.max(Ae.CIRCULAR.MIN_SIZE,Math.min(_,Ae.CIRCULAR.MAX_SIZE)),I(),N()},t.getSize=()=>n?l:void 0,t.hide=()=>(t.element.classList.add(t.getClass(be.TRANSITION)),t.element.setAttribute("hidden",""),U(),j(),t),t.show=()=>{if(t.element.classList.add(t.getClass(be.TRANSITION)),t.element.removeAttribute("hidden"),I(),G(C),!D())N(0);return t},t.isVisible=()=>!t.element.hasAttribute("hidden");let w=()=>{I(),N()};if(!x())requestAnimationFrame(()=>{if(x())G(),N()});let K=Un(t.element,i,w);if(E()&&!y())f=(r?.performance??performance).now(),pe(d/S());N(),G();let ee=t.lifecycle?.destroy;return t.lifecycle={...t.lifecycle??{},destroy:()=>{K(),L.destroy(),U(),j(),ee?.()}},{...t,canvas:i,ctx:s?.ctx,draw:N,resize:w}};var ul=Y(()=>{ft();qo();il();al();Lr()});var cl=(e)=>(t)=>{if(e.indeterminate&&t.element)te(t.element,be.INDETERMINATE),t.element.removeAttribute("aria-valuenow");if(t.element){let r=t.getClass?.(be.CONTAINER)||"";t.element.classList.remove(`${r}--thin`,`${r}--thick`)}if(e.shape&&e.shape!==We.FLAT&&t.element){if(!t.element.classList.contains(t.getClass?.(be.CIRCULAR)||"")){let i=t.getClass?.(be.CONTAINER)||"";te(t.element,`${i}--${e.shape}`)}}let n={value:e.value??0,max:e.max??100,buffer:e.buffer??0,indeterminate:e.indeterminate===!0,thickness:e.thickness??"thin",shape:e.shape??We.FLAT,labelFormatter:e.labelFormatter??((r,i)=>`${Math.round(r/i*100)}%`),showLabel:e.showLabel};return t.state=n,{...t,state:n}};var ml=Y(()=>{ft();nn()});var fl=(e)=>(t)=>{let{element:n,getClass:r,canvas:i}=t,s=n.classList.contains(r(be.CIRCULAR)),a=(u,m)=>{n.dispatchEvent(new CustomEvent(u,{detail:m}))},o=(u,m)=>{n.setAttribute("aria-valuenow",u.toString());let p=t.label;if(p){let g=e.label?.formatter||((c,f)=>`${Math.round(c/f*100)}%`);p.textContent=g(u,m)}if(typeof t.draw==="function")t.draw()},l=(u)=>{if(u)te(n,be.INDETERMINATE),n.removeAttribute("aria-valuenow");else he(n,be.INDETERMINATE),n.setAttribute("aria-valuenow",e.value.getValue().toString());t.setIndeterminate?.(u)};if(e.state.isIndeterminate())l(!0);let d={element:n,canvas:i,track:i,indicator:i,buffer:i,getClass:r,resize:()=>t.resize?.(),getValue(){return e.value.getValue()},setValue(u,m=!0){let p=e.value.getValue(),g=e.value.getMax();if(e.value.setValue(u),p!==u){n.setAttribute("aria-valuenow",u.toString());let c=t.label;if(c){let h=e.label?.formatter||((C,T)=>`${Math.round(C/T*100)}%`);c.textContent=h(u,g)}let f={value:u,max:g};if(a(Wo.CHANGE,f),t.setValue&&typeof t.setValue==="function")t.setValue(u,m);else o(u,g)}return d},getMax(){return e.value.getMax()},getBuffer:()=>e.buffer.getBuffer(),setBuffer(u){if(e.buffer.setBuffer(u),!e.state.isIndeterminate()&&typeof t.draw==="function")t.draw();return d},setIndeterminate(u){if(e.state.isIndeterminate()===u)return d;return e.state.setIndeterminate(u),l(u),d},isIndeterminate:()=>e.state.isIndeterminate(),showLabel(){if(e.label?.show)e.label.show();return d},hideLabel(){if(e.label?.hide)e.label.hide();return d},setLabelFormatter(u){if(e.label?.format)e.label.format(u);let m=t.label||t.state?.label;if(m)m.textContent=u(e.value.getValue(),e.value.getMax());return d},getThickness(){return e.thickness?.getThickness()||at.THIN},setThickness(u){if(e.thickness)e.thickness.setThickness(u);if(t.setThickness)t.setThickness(u);return d},getShape(){if(e.shape&&typeof e.shape.getShape==="function")return e.shape.getShape();return We.FLAT},setShape(u){return t.setShape?.(u),d},setSize(u){if(t.setSize)t.setSize(u);return d},getSize(){return t.getSize?t.getSize():void 0},enable(){return e.disabled.enable(),d},disable(){return e.disabled.disable(),d},isDisabled:e.disabled.isDisabled,hide(){if(t.hide)t.hide();return d},show(){if(t.show)t.show();return d},isVisible(){return t.isVisible?t.isVisible():n.style.display!=="none"},on(u,m){return n.addEventListener(u,m),d},off(u,m){return n.removeEventListener(u,m),d},addClass(...u){return u.forEach((m)=>n.classList.add(m)),d},painted(){return new Promise((u)=>requestAnimationFrame(()=>requestAnimationFrame(()=>u())))},destroy(){e.lifecycle.destroy()},disabled:{enable(){e.disabled.enable()},disable(){e.disabled.disable()},isDisabled:e.disabled.isDisabled},lifecycle:{destroy(){e.lifecycle.destroy()}}};if(t.state?.showLabel===!0){if(e.label?.show)e.label.show()}return d};var pl=Y(()=>{ft();nn()});var Ap,gl=(e={})=>P(Ap,e,"progress"),hl=(e)=>{let t=e.indeterminate===!0,n=e.variant===Tr.CIRCULAR,r={role:"progressbar","aria-label":e.ariaLabel||st.LABEL,"aria-valuemin":"0","aria-valuemax":(e.max||100).toString()};if(!t&&e.value!==void 0)r["aria-valuenow"]=e.value.toString();if(e.disabled===!0)r["aria-disabled"]="true";let i=[e.class,be.CONTAINER,n?be.CIRCULAR:be.LINEAR].filter(Boolean);if(!n&&e.shape&&e.shape!==We.FLAT)i.push(`${be.CONTAINER}--${e.shape}`);return V(e,{tag:"div",attributes:r,className:i})},Cl=(e)=>{if(!e.state)e.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:st.SHAPE,labelFormatter:(t,n)=>`${Math.round(t/n*100)}%`};return{value:{getValue:()=>e.state.value,setValue:(t)=>{if(e.state){let n=Math.max(0,Math.min(e.state.max,t));if(e.state.previousValue=e.state.value,e.state.value=n,e.state.label)e.state.label.textContent=e.state.labelFormatter(n,e.state.max);if(typeof e.setValue==="function")e.setValue(n);else if(e.draw)e.draw()}},getMax:()=>e.state.max},buffer:{getBuffer:()=>e.state.buffer,setBuffer:(t)=>{e.state.buffer=Math.max(0,Math.min(e.state.max,t))}},disabled:{enable:()=>e.disabled?.enable?.()||void 0,disable:()=>e.disabled?.disable?.()||void 0,isDisabled:()=>e.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!e.state.label){let t=document.createElement("div");t.className=`${e.getClass(be.LABEL)}`,t.textContent=e.state.labelFormatter(e.state.value,e.state.max),e.element.appendChild(t),e.state.label=t,e.label=t}},hide:()=>{if(e.state.label)e.state.label.remove(),e.state.label=void 0,e.label=void 0},format:(t)=>{e.state.labelFormatter=t},formatter:e.state.labelFormatter},thickness:{getThickness:()=>{let t=e.state.thickness;if(t==="thin")return at.THIN;else if(t==="thick")return at.THICK;else if(typeof t==="number")return t;return at.THIN},setThickness:(t)=>{if(e.state.thickness=t,e.draw)e.draw()}},shape:{getShape:()=>e.state.shape,setShape:(t)=>{if(e.state.shape=t,e.setShape)e.setShape(t)}},state:{setIndeterminate:(t)=>{if(e.state){if(e.state.indeterminate=t,typeof e.setIndeterminate==="function")e.setIndeterminate(t);else if(e.draw)e.draw()}},isIndeterminate:()=>e.state.indeterminate},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()||void 0}}};var El=Y(()=>{Q();ft();Ap={variant:st.VARIANT,value:st.VALUE,max:st.MAX,buffer:st.BUFFER,showLabel:st.SHOW_LABEL,thickness:"thin",shape:st.SHAPE,showStopIndicator:!0,ariaLabel:st.LABEL}});var Np=(e={})=>{let t=gl(e);try{return O(M,B(),R(hl(t)),se(t),oe(t),cl(t),k(),dl(t),(r)=>fl(Cl(r))(r))(t)}catch(n){throw console.error("Progress creation error:",n),Error(`Failed to create progress: ${n.message}`)}},Xn;var Hi=Y(()=>{ne();Z();J();ul();ml();pl();El();Xn=Np});var wp=async(e)=>{await Promise.resolve().then(() => Hi());return Xn(e)},bl=(e)=>(t)=>{if(!e.progress)return t;let n={},r=typeof e.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:u,...m}=e.progress;if(u)n=u;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...m}})(),i=null,s=null,a=!1,o="",l=async()=>{if(i)return i;if(!s)s=wp(r).then((u)=>(i=u,te(i.element,t.getClass("button-progress")),i.element.style.display="none",Object.entries(n).forEach(([m,p])=>{i.on(m,p)}),t.progress=i,i));return s},d=()=>{let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u&&u.nextSibling)return u.nextSibling;return t.element.firstChild};if(t.showProgress=async function(){let u=await l();if(u.element){if(!t.element.contains(u.element)){let p=d();if(p)t.element.insertBefore(u.element,p);else t.element.appendChild(u.element)}u.element.style.display="",te(t.element,`${t.getClass("button")}--progress`);let m=t.element.querySelector(`.${t.getClass("button-icon")}`);if(m instanceof HTMLElement)m.style.display="none"}return t},t.showProgressSync=function(){return t.showProgress(),t},t.hideProgress=async function(){if(!i)return t;i.element.style.display="none",he(t.element,`${t.getClass("button")}--progress`);let u=t.element.querySelector(`.${t.getClass("button-icon")}`);if(u instanceof HTMLElement)u.style.display="";return t},t.hideProgressSync=function(){return t.hideProgress(),t},t.setProgress=async function(u){return(await l()).setValue(u),t},t.setProgressSync=function(u){return t.setProgress(u),t},t.setIndeterminate=async function(u){return(await l()).setIndeterminate(u),t},t.setIndeterminateSync=function(u){return t.setIndeterminate(u),t},t.setLoading=async function(u,m){if(u&&!a){if(t.setText&&t.getText)o=t.getText();if(a=!0,await t.showProgress(),t.disabled?.disable)t.disabled.disable();if(m&&t.setText)t.setText(m)}else if(!u&&a){if(a=!1,await t.hideProgress(),t.disabled?.enable)t.disabled.enable();if(m&&t.setText)t.setText(m);else if(o&&t.setText)t.setText(o)}return t},t.setLoadingSync=function(u,m){return t.setLoading(u,m),t},t.lifecycle){let u=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.destroy();if(i&&i.element.parentNode)i.element.parentNode.removeChild(i.element);u()}}if(e.showProgress)l().then(()=>{t.showProgress()});return t};var vl=Y(()=>{nn()});var Tl=(e)=>(t)=>{if(!e.toggle)return t;let{element:n}=t,r=t.getClass("button"),i=!1,s=(a)=>{i=a,n.classList.toggle(`${r}--selected`,a),n.setAttribute("aria-pressed",String(a))};if(n.classList.add(`${r}--toggle`),s(e.selected===!0),e.toggleOnClick!==!1)n.addEventListener("click",()=>{if(n.disabled)return;s(!i),t.emit?.("change",{selected:i})});return{...t,toggle:{setSelected:(a)=>{if(a!==i)s(a)},isSelected:()=>i}}};var Sl=(e={},t={})=>{let n={...e},r=Me(),i=new Map,s=t.middleware||[],a=(l,d)=>{r.emit("change",l,d)},o=(l,d)=>s.reduce((u,m)=>m(u,d),l);return{getState:()=>{let l={};return i.forEach((d,u)=>{l[u]=d(n)}),{...n,...l}},setState:(l)=>{let d={...n},u=typeof l==="function"?l(n):{...n,...l};n=o(u,d),a(n,d)},subscribe:(l)=>r.on("change",l),derive:(l,d)=>(i.set(l,d),()=>{i.delete(l)}),select:(l)=>l(n),reset:()=>{n={...e},a(n,{})}}},yl=(e,t)=>(console.log("State change:",{old:t,new:e,diff:Object.keys(e).reduce((n,r)=>{if(e[r]!==t[r])n[r]={from:t[r],to:e[r]};return n},{})}),e),xl=(e)=>(t)=>Object.keys(t).reduce((n,r)=>{if(e(t[r],r))n[r]=t[r];return n},{});var Il=()=>{};var Ll=(e,t={})=>{let n=!1,r=Me();return{onMount:(i)=>r.on("mount",i),onUnmount:(i)=>r.on("unmount",i),mount:()=>{if(!n)n=!0,r.emit("mount")},unmount:()=>{if(n)n=!1,r.emit("unmount"),r.clear()},isMounted:()=>n,destroy(){if(n)this.unmount();if(t.events)t.events.destroy();if(t.text){let i=t.text.getElement();if(i)i.remove()}if(t.icon){let i=t.icon.getElement();if(i)i.remove()}if(e)e.remove()}}};var Al=()=>{};var Nl=(e)=>({enable(){return e.disabled=!1,e.removeAttribute("disabled"),this},disable(){return e.disabled=!0,e.setAttribute("disabled","true"),this},toggle(){if(e.disabled)this.enable();else this.disable();return this},isDisabled(){return e.disabled===!0}});var $i=(e,t,n,r,i,s)=>{if(r<0||i<0)return;let a=typeof s==="number"?[s,s,s,s]:s,[o,l,d,u]=a;e.beginPath(),e.moveTo(t+o,n),e.lineTo(t+r-l,n),e.quadraticCurveTo(t+r,n,t+r,n+l),e.lineTo(t+r,n+i-d),e.quadraticCurveTo(t+r,n+i,t+r-d,n+i),e.lineTo(t+u,n+i),e.quadraticCurveTo(t,n+i,t,n+i-u),e.lineTo(t,n+o),e.quadraticCurveTo(t,n,t+o,n),e.closePath()},Dp=(e,t,n,r,i,s,a)=>{if(e.save(),a)e.fillStyle=a;$i(e,t,n,r,i,s),e.fill(),e.restore()},Vi=(e,t,n,r,i,s)=>(e.save(),$i(e,t,n,r,i,s),e.clip(),()=>e.restore()),Fi=(e,t,n,r,i,s,a,o)=>{if(r<0||i<0)return;if(e.save(),o)e.fillStyle=o;e.beginPath(),e.moveTo(t+s,n),e.lineTo(t+r-a,n),e.quadraticCurveTo(t+r,n,t+r,n+a),e.lineTo(t+r,n+i-a),e.quadraticCurveTo(t+r,n+i,t+r-a,n+i),e.lineTo(t+s,n+i),e.quadraticCurveTo(t,n+i,t,n+i-s),e.lineTo(t,n+s),e.quadraticCurveTo(t,n,t+s,n),e.closePath(),e.fill(),e.restore()},Ui=(e,t,n,r)=>{if(r)e.fillStyle=r,e.fillRect(0,0,t,n);else e.clearRect(0,0,t,n)};var Ar=(e)=>{let s=e;for(let m=0;m<4;m++){let f=s*s,C=1.6*(f*s)+-1.8000000000000003*f+1.2000000000000002*s-e,T=4.800000000000001*f+-3.6000000000000005*s+1.2000000000000002;if(Math.abs(C)<0.00001)break;s=s-C/T}let a=0,o=3-a,l=1-a-o,d=s*s,u=d*s;return l*u+o*d+a*s},Gi,Mp;var wl=Y(()=>{Gi={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},Mp={linear:(e)=>e,easeIn:(e)=>e*e,easeOut:(e)=>e*(2-e),easeInOut:(e)=>e<0.5?2*e*e:-1+(4-2*e)*e,materialStandard:Ar}});class Dl{animationId=null;start(e){this.stop();let t=(n)=>{e(n),this.animationId=requestAnimationFrame(t)};this.animationId=requestAnimationFrame(t)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Ml{cleanupFunctions=[];add(e){if(e)this.cleanupFunctions.push(e)}cleanup(){this.cleanupFunctions.forEach((e)=>e()),this.cleanupFunctions=[]}}var qn=(e,t,n)=>{let r=window.devicePixelRatio||1,i=e.getContext("2d");return e.style.width=`${t}px`,e.style.height=`${n}px`,e.width=Math.round(t*r),e.height=Math.round(n*r),i.setTransform(1,0,0,1,0,0),i.scale(r,r),{canvas:e,ctx:i,width:t,height:n,pixelRatio:r}},jn=(e,t,n)=>{let{canvas:r,ctx:i,pixelRatio:s}=e;r.style.width=`${t}px`,r.style.height=`${n}px`,r.width=Math.round(t*s),r.height=Math.round(n*s),e.width=t,e.height=n,i.setTransform(1,0,0,1,0,0),i.scale(s,s)},zi=(e,t)=>{if(e())return t?.(),!0;return requestAnimationFrame(()=>{if(e())t?.();else setTimeout(()=>{if(e())t?.()},100)}),!1},Nr=(e,t)=>{let n=ke(`sys-color-${e}`,{onThemeChange:t});return typeof n==="function"?n:null},Wi=(e,t={})=>{let n=document.createElement("canvas");return n.className=e,Object.assign(n.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...t}),n};var Ki=Y(()=>{Wn()});var wr=Y(()=>{wl();Ki()});var sn=Y(()=>{Q();Il();Al();rt();Mi();Wn();ne();nn();wr();wr()});var Ol=({disabled:e,lifecycle:t})=>(n)=>{let r={setText:(a)=>(n.text.setText(a),r),getText:()=>n.text.getText(),getElement:()=>n.text.getElement()},i={setIcon:(a)=>(n.icon.setIcon(a),i),getIcon:()=>n.icon.getIcon(),getElement:()=>n.icon.getElement()},s={element:n.element,text:r,icon:i,disabled:e,lifecycle:t,getClass:n.getClass,on:(a,o)=>{if(n.on)n.on(a,o);return s},off:(a,o)=>{if(n.off)n.off(a,o);return s},addClass:(...a)=>{if(n.addClass)n.addClass(...a);else te(n.element,...a);return s},getValue:()=>n.element.value,setValue(a){return n.element.value=a,s},enable(){return e.enable(),s},disable(){return e.disable(),s},setText(a){return n.text.setText(a),s},getText(){return n.text.getText()},hasIcon(){let a=n.icon.getElement();return!!a&&!!a.innerHTML.trim()&&!!a.parentNode},setIcon(a){let o=n.componentName||"button",l=n.getClass(o);if(!a){let d=n.icon.getElement();if(d&&d.parentNode)d.parentNode.removeChild(d),n.icon.getElement=()=>null,n.icon.getIcon=()=>"";n.element.classList.remove(`${l}--icon`)}else if(!s.hasIcon()){let d=document.createElement("span");if(d.className=`${n.getClass("button-icon")}`,d.innerHTML=a,n.element.firstChild)n.element.insertBefore(d,n.element.firstChild);else n.element.appendChild(d);n.icon.getElement=()=>d,n.icon.getIcon=()=>a,n.element.classList.add(`${l}--icon`)}else{let d=n.icon.getElement();if(d)d.innerHTML=a}return s},getIcon(){return s.hasIcon()?n.icon.getIcon():""},setVariant(a){let o=n.componentName||"button",l=n.getClass(o);return["filled","tonal","outlined","elevated","text"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getVariant(){let a=n.componentName||"button",o=n.getClass(a),l=["filled","tonal","outlined","elevated","text"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"filled"},getSize(){let a=n.componentName||"button",o=n.getClass(a),l=["xs","s","m","l","xl"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"s"},setSize(a){let o=n.componentName||"button",l=n.getClass(o);return["xs","s","m","l","xl"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},getShape(){let a=n.componentName||"button",o=n.getClass(a),l=["round","square"];for(let d of l)if(n.element.classList.contains(`${o}--${d}`))return d;return"round"},setShape(a){let o=n.componentName||"button",l=n.getClass(o);return["round","square"].map((u)=>`${l}--${u}`).forEach((u)=>{n.element.classList.remove(u)}),n.element.classList.add(`${l}--${a}`),s},setActive(a){if(a)n.element.classList.add(`${n.getClass("button")}--active`);else n.element.classList.remove(`${n.getClass("button")}--active`);return s},setSelected(a){return n.toggle?.setSelected(a),s},isSelected:()=>n.toggle?.isSelected()??!1,setAriaLabel(a){return n.element.setAttribute("aria-label",a),s},destroy(){t.destroy()}};if(n.progress)s.progress=n.progress;if(n.showProgress)s.showProgress=async()=>(await n.showProgress(),s);if(n.showProgressSync)s.showProgressSync=()=>(n.showProgressSync(),s);if(n.hideProgress)s.hideProgress=async()=>(await n.hideProgress(),s);if(n.hideProgressSync)s.hideProgressSync=()=>(n.hideProgressSync(),s);if(n.setProgress)s.setProgress=async(a)=>(await n.setProgress(a),s);if(n.setProgressSync)s.setProgressSync=(a)=>(n.setProgressSync(a),s);if(n.setIndeterminate)s.setIndeterminate=async(a)=>(await n.setIndeterminate(a),s);if(n.setIndeterminateSync)s.setIndeterminateSync=(a)=>(n.setIndeterminateSync(a),s);if(n.setLoading)s.setLoading=async(a,o)=>(await n.setLoading(a,o),s);if(n.setLoadingSync)s.setLoadingSync=(a,o)=>(n.setLoadingSync(a,o),s);return s};var Rl=Y(()=>{sn()});var _l,Pl,kl,Bl,Dr;var Hl=Y(()=>{_l={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},Pl={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},kl={ROUND:"round",SQUARE:"square"},Bl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},Dr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Op,$l=(e={})=>P(Op,e,"button"),Vl=(e)=>{let t={type:e.type||"button"};if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"button",attributes:t,className:e.class,forwardEvents:{click:(n)=>!n.element.disabled,focus:!0,blur:!0}})},Fl=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Ul=Y(()=>{Q();Hl();Op={variant:_l.FILLED,size:Pl.S,shape:kl.ROUND,disabled:!1,type:Bl.BUTTON,ripple:!0,rippleConfig:{duration:Dr.DURATION,timing:Dr.TIMING,opacity:Dr.OPACITY}}});var Rp=(e={})=>{let t=$l(e);try{return O(M,B(),R(Vl(t)),se(t),mt(t),ct(t),Pe(t),oe(t),Tl(t),bl(t),Le(t),k(),(r)=>{if(t.shape&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>Ol(Fl(r))(r))(t)}catch(n){throw console.error("Button creation error:",n),Error(`Failed to create button: ${n.message}`)}},Te;var Gl=Y(()=>{ne();Z();J();vl();Rl();Ul();Te=Rp});var pt=Y(()=>{Gl()});var HC={};qf(HC,{ANIMATION_DURATIONS:()=>Gi,AnimationFrameManager:()=>Dl,COMPONENTS:()=>vi,CleanupManager:()=>Ml,EASING_FUNCTIONS:()=>Mp,PREFIX:()=>X,STATES:()=>Ti,addClass:()=>te,batchAttributes:()=>Ja,byString:()=>Ri,classNames:()=>so,clearCanvas:()=>Ui,clearGlobalDefaults:()=>Di,clearSnackbars:()=>Oa,clipRoundedRect:()=>Vi,compose:()=>qa,createBadge:()=>Vn,createBase:()=>M,createBottomAppBar:()=>Go,createButton:()=>Te,createButtonGroup:()=>Xi,createCanvasContext:()=>qn,createCanvasThemeObserver:()=>Nr,createCard:()=>qi,createCardActions:()=>Zn,createCardContent:()=>Or,createCardHeader:()=>Rr,createCardMedia:()=>Qn,createCarousel:()=>os,createCheckbox:()=>ds,createChip:()=>on,createChips:()=>ps,createComponent:()=>Za,createComponentConfig:()=>P,createDatePicker:()=>hs,createDialog:()=>Cs,createDisabled:()=>Nl,createDivider:()=>Vt,createDrawer:()=>Ts,createElement:()=>H,createElementConfig:()=>V,createEmitter:()=>Me,createEventManager:()=>zo,createExtendedFab:()=>Zr,createFab:()=>jr,createIconButton:()=>Lt,createLifecycle:()=>Ll,createList:()=>xs,createLoadingIndicator:()=>Ws,createMenu:()=>Ft,createNavigation:()=>fn,createNavigationSystem:()=>wc,createProgress:()=>Xn,createRadios:()=>Xs,createRoundedRectPath:()=>$i,createSVGElement:()=>lo,createSearch:()=>ea,createSegment:()=>oi,createSegmentedButton:()=>li,createSelect:()=>ma,createSheet:()=>Ta,createSlider:()=>Da,createSnackbar:()=>Ra,createSplitButton:()=>Ks,createStateEventManager:()=>Er,createStore:()=>Sl,createStyledCanvas:()=>Wi,createSwitch:()=>_a,createTab:()=>An,createTabs:()=>Sf,createTextfield:()=>ir,createTimePicker:()=>ka,createTooltip:()=>Ba,createTopAppBar:()=>Rf,debounce:()=>en,deriveFiltered:()=>xl,easeOutCubic:()=>Ar,fillRoundedRect:()=>Dp,fillRoundedRectLR:()=>Fi,getAttribute:()=>to,getComponentClass:()=>no,getComponentDefaults:()=>$n,getElementClass:()=>io,getInheritedBackground:()=>xt,getModifierClass:()=>ro,hasAttribute:()=>eo,hasClass:()=>it,hasEmit:()=>yt,hasLifecycle:()=>St,hasTouchSupport:()=>ze,initializeCanvasWithRetry:()=>zi,isObject:()=>Oi,joinClasses:()=>Yo,loggingMiddleware:()=>yl,normalizeClasses:()=>Zt,normalizeEvent:()=>Je,observeCanvasResize:()=>Un,once:()=>br,pipe:()=>O,removeAttributes:()=>Qa,removeClass:()=>he,setAttributes:()=>On,setComponentDefaults:()=>Ni,setGlobalDefaults:()=>wi,throttle:()=>Jt,toggleClass:()=>hr,transform:()=>ja,updateCanvasDimensions:()=>jn,when:()=>Ko,withCheckable:()=>Ht,withDebounce:()=>Li,withDisabled:()=>oe,withElement:()=>R,withEnhancedEvents:()=>xi,withEvents:()=>B,withIcon:()=>Pe,withInput:()=>Bt,withLifecycle:()=>k,withPosition:()=>Pn,withRipple:()=>Le,withSize:()=>mt,withStyle:()=>yi,withText:()=>ct,withTextInput:()=>kn,withTextLabel:()=>et,withThrottle:()=>Ii,withTrack:()=>Bn,withVariant:()=>se});module.exports=Kf(HC);ne();Z();J();Q();var xo={SMALL:"small",LARGE:"large"},Io={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},Lo={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"},vr=4;var up={variant:xo.LARGE,color:Io.ERROR,position:Lo.TOP_RIGHT,label:"",visible:!0},Ao=(e={})=>P(up,e,"badge"),No=(e)=>{let t={};if(e.variant!=="small")t.role="status";let n=e.variant==="small"?"":tn(e.label||"",e.max);return V(e,{tag:"span",attributes:t,className:e.class,text:n})},wo=(e)=>({visibility:{show:()=>e.visibility.show(),hide:()=>e.visibility.hide(),toggle:(t)=>e.visibility.toggle(t),isVisible:()=>e.visibility.isVisible()},lifecycle:{destroy:()=>e.lifecycle.destroy()}}),tn=(e,t)=>{if(e===void 0||e===null||e==="")return"";let n=String(e),r=Number(e);if(t!==void 0&&!isNaN(r)&&r>t)n=`${t}+`;if(n.length>vr){let i=Number(e);if(!isNaN(i))if(i>=1000)n="999+";else n=n.substring(0,vr-1)+"+";else n=n.substring(0,vr)}return n};var Do="small",cp="large",mp="error",fp="top-right",Mo=()=>(e)=>{if(e.config.visible===!1)e.element.classList.add(`${e.getClass("badge")}--invisible`);return{...e,visibility:{show(){e.element.classList.remove(`${e.getClass("badge")}--invisible`)},hide(){e.element.classList.add(`${e.getClass("badge")}--invisible`)},toggle(n){if(n===void 0)e.element.classList.toggle(`${e.getClass("badge")}--invisible`);else if(n)this.show();else this.hide()},isVisible(){return!e.element.classList.contains(`${e.getClass("badge")}--invisible`)}}}},Oo=(e)=>(t)=>{let n=e.variant||cp;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),n===Do)t.element.textContent="",t.element.setAttribute("aria-hidden","true");else if(t.element.setAttribute("role","status"),e.label!==void 0&&e.label!==""){let r=tn(e.label,e.max);t.element.textContent=r}return t},Ro=(e)=>(t)=>{let n=e.color||mp;return t.element.classList.add(`${t.getClass("badge")}--${n}`),t},_o=(e)=>(t)=>{let n=e.position||fp;if(t.element.classList.add(`${t.getClass("badge")}--${n}`),e.target)t.element.classList.add(`${t.getClass("badge")}--positioned`);return t},Po=(e)=>(t)=>{if(e.max===void 0||e.variant===Do)return t;if(t.config.max=e.max,e.label!==void 0&&e.label!==""){let n=tn(e.label,e.max);if(t.element.textContent=n,typeof e.label==="number"&&e.label>e.max)t.element.classList.add(`${t.getClass("badge")}--overflow`)}return t},ko=(e)=>(t)=>{if(!e.target)return t;let n=document.createElement("div");n.classList.add(t.getClass("badge-wrapper")),n.style.position="relative";let r=e.target.parentNode;if(r)r.replaceChild(n,e.target),n.appendChild(e.target),n.appendChild(t.element),t.wrapper=n;return t};var Bo="small",pp=["error","primary","secondary","tertiary","success","warning","info"],gp=["small","large"],hp=["top-right","top-left","bottom-right","bottom-left"],Ho=({visibility:e,lifecycle:t})=>(n)=>{let r={element:n.element,wrapper:n.wrapper,getClass:n.getClass,setLabel(i){if(n.config.label=i,n.config.variant===Bo)return n.element.textContent="",r;let s=tn(i,n.config.max);if(n.element.textContent=s,n.element.classList.remove(`${n.getClass("badge")}--overflow`),typeof i==="number"&&n.config.max!==void 0&&i>n.config.max)n.element.classList.add(`${n.getClass("badge")}--overflow`);if(s===""||s==="0")r.hide();else r.show();return r},getLabel(){return n.element.textContent||""},setContent(i){return r.setLabel(i)},getContent(){return r.getLabel()},show(){return e.show(),r},hide(){return e.hide(),r},toggle(i){return e.toggle(i),r},isVisible(){return e.isVisible()},setMax(i){if(n.config.max=i,n.config.label!==void 0)r.setLabel(n.config.label);return r},setColor(i){return pp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},setVariant(i){if(gp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),n.config.variant=i,i===Bo)n.element.textContent="",n.element.setAttribute("aria-hidden","true");else if(n.element.setAttribute("role","status"),n.config.label!==void 0)r.setLabel(n.config.label);return r},setPosition(i){return hp.forEach((s)=>{n.element.classList.remove(`${n.getClass("badge")}--${s}`)}),n.element.classList.add(`${n.getClass("badge")}--${i}`),r},attachTo(i){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element);let s=document.createElement("div");s.classList.add(n.getClass("badge-wrapper")),s.style.position="relative";let a=i.parentNode;if(a)a.replaceChild(s,i),s.appendChild(i),s.appendChild(n.element),n.element.classList.add(`${n.getClass("badge")}--positioned`),n.wrapper=s,r.wrapper=s;return r},detach(){if(n.wrapper&&n.wrapper.contains(n.element))n.wrapper.removeChild(n.element),n.element.classList.remove(`${n.getClass("badge")}--positioned`),document.body.appendChild(n.element),n.wrapper=void 0,r.wrapper=void 0;return r},destroy(){if(t.destroy(),n.wrapper){let i=n.wrapper.firstChild,s=n.wrapper.parentNode;if(s&&i)s.replaceChild(i,n.wrapper)}},addClass:(...i)=>(n.addClass(...i),r),removeClass:(...i)=>(n.removeClass(...i),r),on:(i,s)=>(n.on(i,s),r),off:(i,s)=>(n.off(i,s),r)};return r};var Cp=(e={})=>{let t=Ao(e);try{return O(M,B(),R(No(t)),Oo(t),Ro(t),_o(t),Po(t),Mo(),ko(t),k(),(r)=>Ho(wo(r))(r))(t)}catch(n){throw console.error("Badge creation error:",n),Error(`Failed to create badge: ${n.message}`)}},Vn=Cp;ne();Q();var $o={CENTER:"center",END:"end"},Vo=300;var Ep={tag:"div",hasFab:!1,fabPosition:$o.END,autoHide:!1,transitionDuration:Vo},Fo=(e={})=>P(Ep,e,"bottom-app-bar");var Uo=(e={})=>{let t=Fo(e),n=M(t),r=document.createElement("div");r.className=`${n.getClass("bottom-app-bar")}-actions`;let i=document.createElement("div");i.className=`${n.getClass("bottom-app-bar")}-fab-container`;let s=R({tag:t.tag,componentName:"bottom-app-bar",className:[t.hasFab?`${n.getClass("bottom-app-bar")}--with-fab`:"",t.fabPosition==="center"?`${n.getClass("bottom-app-bar")}--fab-center`:"",t.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(n),a=B()(s),o=k()(a);o.element.appendChild(r),o.element.appendChild(i);let l=!0,d=window.scrollY;if(t.autoHide){let m=()=>{let g=window.scrollY;if(g>d+10){if(l)u.hide(),t.onVisibilityChange?.(!1)}else if(g<d-10){if(!l)u.show(),t.onVisibilityChange?.(!0)}d=g};window.addEventListener("scroll",m,{passive:!0});let p=o.lifecycle.destroy;o.lifecycle.destroy=()=>{window.removeEventListener("scroll",m),p()}}let u={...o,addAction(m){return r.appendChild(m),this},addFab(m){return i.innerHTML="",i.appendChild(m),this.element.classList.add(`${n.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${n.getClass("bottom-app-bar")}--hidden`),l=!0,this},hide(){return this.element.classList.add(`${n.getClass("bottom-app-bar")}--hidden`),l=!1,this},isVisible(){return l},getActionsContainer(){return r}};if(t.autoHide&&t.transitionDuration)u.element.style.transition=`transform ${t.transitionDuration}ms ease-in-out`;return u};var Go=Uo;pt();Z();J();ne();Z();J();var zl=(e)=>(t)=>{if(!e.toggle)return{...t,toggleState:{select:function(){return this},deselect:function(){return this},toggle:function(){return this},isSelected:()=>!1,isToggle:()=>!1,setIcon:function(){return this},setSelectedIcon:function(){return this},getSelectedIcon:()=>""}};let n=e.prefix||"mtrl",r=e.componentName||"icon-button",i=`${n}-${r}--selected`,s=e.selected||!1,a=e.icon||"",o=e.selectedIcon||"",l=()=>{if(!t.icon)return;let c=s&&o?o:a;if(c)t.icon.setIcon(c)},d=()=>{t.element.setAttribute("aria-pressed",String(s))},u={select(){if(!s)s=!0,t.element.classList.add(i),l(),d();return this},deselect(){if(s)s=!1,t.element.classList.remove(i),l(),d();return this},toggle(){if(s)this.deselect();else this.select();return this},isSelected(){return s},isToggle(){return!0},setIcon(c){if(a=c,!s)l();return this},setSelectedIcon(c){if(o=c,s)l();return this},getSelectedIcon(){return o}};if(s)t.element.classList.add(i),d(),l();else d();let m=e.toggleOnClick!==!1,p=()=>{u.toggle();let c=new CustomEvent("toggle",{bubbles:!0,detail:{selected:s}});t.element.dispatchEvent(c)};if(m)t.element.addEventListener("click",p);let g=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{if(m)t.element.removeEventListener("click",p);if(g)g()};return{...t,toggleState:u}};var Wl=({disabled:e,lifecycle:t,toggleState:n})=>(r)=>{let i=r.componentName||"icon-button",s=r.getClass(i),a={setIcon:(l)=>(r.icon.setIcon(l),a),getIcon:()=>r.icon.getIcon(),getElement:()=>r.icon.getElement()},o={element:r.element,icon:a,disabled:{enable:()=>e.enable(),disable:()=>e.disable(),isDisabled:()=>e.isDisabled()},lifecycle:{destroy:()=>t.destroy()},getClass:r.getClass,getValue:()=>r.element.value,setValue(l){return r.element.value=l,o},getVariant(){let l=["filled","tonal","outlined","standard"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"standard"},setVariant(l){return["filled","tonal","outlined","standard"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),r.element.classList.add(`${s}--${l}`),o},getSize(){let l=["xs","s","m","l","xl"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"s"},setSize(l){if(["xs","s","m","l","xl"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="s")r.element.classList.add(`${s}--${l}`);return o},getShape(){let l=["round","square"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"round"},setShape(l){if(["round","square"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="round")r.element.classList.add(`${s}--${l}`);return o},getWidth(){let l=["narrow","default","wide"];for(let d of l)if(r.element.classList.contains(`${s}--${d}`))return d;return"default"},setWidth(l){if(["narrow","default","wide"].forEach((u)=>{r.element.classList.remove(`${s}--${u}`)}),l!=="default")r.element.classList.add(`${s}--${l}`);return o},enable(){return e.enable(),o},disable(){return e.disable(),o},setIcon(l){if(n?.isToggle()&&!n.isSelected())n.setIcon(l);return r.icon.setIcon(l),o},getIcon(){return r.icon.getIcon()},setSelectedIcon(l){if(n)n.setSelectedIcon(l);return o},getSelectedIcon(){return n?.getSelectedIcon()||""},isToggle(){return n?.isToggle()||!1},select(){if(n)n.select();return o},deselect(){if(n)n.deselect();return o},toggleSelected(){if(n)n.toggle();return o},isSelected(){return n?.isSelected()||!1},setAriaLabel(l){return r.element.setAttribute("aria-label",l),o},destroy(){t.destroy()},on(l,d){if(r.on)r.on(l,d);else r.element.addEventListener(l,d);return o},off(l,d){if(r.off)r.off(l,d);else r.element.removeEventListener(l,d);return o},addClass(...l){if(r.addClass)r.addClass(...l);else l.forEach((d)=>r.element.classList.add(d));return o},removeClass(...l){if(r.removeClass)r.removeClass(...l);else l.forEach((d)=>r.element.classList.remove(d));return o}};return o};Q();var Kl={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",STANDARD:"standard"},Yl={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Xl={ROUND:"round",SQUARE:"square"},ql={NARROW:"narrow",DEFAULT:"default",WIDE:"wide"},jl={BUTTON:"button",SUBMIT:"submit",RESET:"reset"};var Mr={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]};var _p={variant:Kl.STANDARD,size:Yl.S,shape:Xl.ROUND,width:ql.DEFAULT,disabled:!1,type:jl.BUTTON,toggle:!1,selected:!1,ripple:!0,tooltip:!0,rippleConfig:{duration:Mr.DURATION,timing:Mr.TIMING,opacity:Mr.OPACITY}},Zl=(e={})=>P(_p,e,"icon-button"),Ql=(e)=>{let t={type:e.type||"button"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;if(e.toggle)t["aria-pressed"]=e.selected?"true":"false";if(e.disabled===!0)t.disabled=!0;if(e.value!==void 0)t.value=e.value;let n=[];if(e.size&&e.size!=="s")n.push(`icon-button--${e.size}`);if(e.shape&&e.shape!=="round")n.push(`icon-button--${e.shape}`);if(e.width&&e.width!=="default")n.push(`icon-button--${e.width}`);if(e.toggle)n.push("icon-button--toggle");if(e.toggle&&e.selected)n.push("icon-button--selected");if(e.disabled===!0)n.push("icon-button--disabled");let r=e.className||e.class,i=[...n,...Array.isArray(r)?r:r?[r]:[]],s={...e,className:i};return V(s,{tag:"button",attributes:t,forwardEvents:{click:(a)=>!a.element.disabled,focus:!0,blur:!0},interactive:!0})},Jl=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable(),isDisabled:()=>e.disabled.isDisabled()},lifecycle:{destroy:()=>e.lifecycle.destroy()},toggleState:e.toggleState});var Pp=(e={})=>{let t=Zl(e);try{return O(M,B(),R(Ql(t)),se(t),mt(t),Pe(t),oe(t),zl(t),Le(t),k(),(r)=>{if(t.shape&&t.shape!=="round"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.shape}`;r.element.classList.add(i)}return r},(r)=>{if(t.width&&t.width!=="default"&&r.element){let i=`${t.prefix}-${t.componentName}--${t.width}`;r.element.classList.add(i)}return r},(r)=>Wl(Jl(r))(r))(t)}catch(n){throw console.error("IconButton creation error:",n),Error(`Failed to create icon button: ${n.message}`)}},Lt=Pp;pt();Q();var kp={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},Bp={HORIZONTAL:"horizontal",VERTICAL:"vertical"},tt={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var Hp={STANDARD:"standard",CONNECTED:"connected"},$p={NONE:"none",SINGLE:"single",MULTI:"multi"},Vp={ROUND:"round",SQUARE:"square"},Fp={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},Yi={xs:{height:32,icon:20,standardGap:18,connectedCorner:4},s:{height:40,icon:20,standardGap:12,connectedCorner:8},m:{height:56,icon:24,standardGap:8,connectedCorner:8},l:{height:96,icon:32,standardGap:8,connectedCorner:16},xl:{height:136,icon:40,standardGap:8,connectedCorner:20}},ed=2,td=4;var nd=0.15,rd=4,Up={ALWAYS:"always",SELECTED:"selected"},le={KIND:Hp.STANDARD,SELECTION:$p.NONE,SHAPE:Vp.ROUND,SIZE:Fp.S,LABELS:Up.ALWAYS,VARIANT:kp.OUTLINED,ORIENTATION:Bp.HORIZONTAL,DENSITY:tt.DEFAULT,RIPPLE:!0,EQUAL_WIDTH:!1,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]};var Gp={kind:le.KIND,selection:le.SELECTION,shape:le.SHAPE,size:le.SIZE,required:!1,variant:le.VARIANT,orientation:le.ORIENTATION,density:le.DENSITY,ripple:le.RIPPLE,equalWidth:le.EQUAL_WIDTH,disabled:!1,buttons:[]},id=(e={})=>P(Gp,e,"button-group"),sd=(e)=>{let t=e.variant||le.VARIANT,n=e.orientation||le.ORIENTATION,r=e.density||le.DENSITY,i=e.kind||le.KIND,s=e.selection||le.SELECTION,a=e.labels||le.LABELS,o=e.shape||le.SHAPE,l=e.size||le.SIZE;return{tag:"div",componentName:"button-group",attributes:{role:"group","aria-label":e.ariaLabel||"Button group","data-variant":t,"data-orientation":n,"data-density":r,"data-kind":i,"data-selection":s,"data-shape":o,"data-size":l,"data-labels":a},className:[e.class,a==="selected"?`${e.prefix}-button-group--labels-selected`:null,e.disabled?`${e.prefix}-button-group--disabled`:null,`${e.prefix}-button-group--${n}`,`${e.prefix}-button-group--${t}`,`${e.prefix}-button-group--${i}`,`${e.prefix}-button-group--${o}`,`${e.prefix}-button-group--size-${l}`,s!=="none"?`${e.prefix}-button-group--selectable`:null,r!==tt.DEFAULT?`${e.prefix}-button-group--density-${r}`:null,e.equalWidth?`${e.prefix}-button-group--equal-width`:null],interactive:!0}},zp={[tt.DEFAULT]:0,[tt.COMFORTABLE]:1,[tt.COMPACT]:2},ad=(e,t,n=tt.DEFAULT)=>{let r=Yi[e||le.SIZE]||Yi.s,i=t==="connected"?ed:r.standardGap,s=r.height-rd*(zp[n]??0);return{"--button-group-height":`${s}px`,"--button-group-icon":`${r.icon}px`,"--button-group-gap":`${i}px`,"--button-group-inner-corner":`${r.connectedCorner}px`,"--button-group-pressed-corner":`${td}px`,"--button-group-radius":`${s/2}px`}},od=(e,t,n,r)=>{let i=t===0,s=t===n-1,a=n===1,o="";if(a)o=`${r.prefix}-button-group__button--single`;else if(i)o=`${r.prefix}-button-group__button--first`;else if(s)o=`${r.prefix}-button-group__button--last`;else o=`${r.prefix}-button-group__button--middle`;return{...e,variant:r.variant,size:r.size||le.SIZE,shape:r.shape||le.SHAPE,disabled:r.disabled||e.disabled,ripple:r.ripple,rippleConfig:r.rippleConfig,class:[`${r.prefix}-button-group__button`,o,e.class].filter(Boolean).join(" ")}};var Wp=(e={})=>{let t=id(e),n=Me(),r=t.variant||le.VARIANT,i=t.orientation||le.ORIENTATION,s=t.density||le.DENSITY,a=t.kind||le.KIND,o=t.selection||le.SELECTION,l=Boolean(t.required),d=new Set;try{let u=O(M,B(),R(sd(t)),k())(t),m=(x)=>{Object.entries(ad(t.size,a,x)).forEach(([A,N])=>{u.element.style.setProperty(A,N)})};m(s);let p=[],g=t.buttons||[],c=g.length,f=(x)=>{let A=x._groupConfig;return String(A?.value??A?.id??x._groupIndex)},h=(x,A)=>{let N=`${t.prefix}-button-group__button--selected`;x.element.classList.toggle(N,A),x.element.setAttribute("aria-pressed",String(A));let D=x.toggleState;if(D?.isToggle?.())if(A)D.select();else D.deselect();else x.setSelected?.(A)},C=t.expandedRatio??nd,T=()=>{p.forEach((x)=>{x.element.style.width="",x.element.style.paddingLeft="",x.element.style.paddingRight=""}),document.removeEventListener("pointerup",T),document.removeEventListener("pointercancel",T)},b=(x)=>{if(a!=="standard"||C<=0||i!=="horizontal")return;let A=p.map((K)=>K.element.getBoundingClientRect().width);if(!A[x])return;let N=u.element.ownerDocument.defaultView,D=(K,ee)=>N?parseFloat(N.getComputedStyle(p[K].element)[ee])||0:0,G=p[x-1]?x-1:-1,U=p[x+1]?x+1:-1,j=G>=0&&U>=0,pe=C*A[x]/(j?2:1),ge=0,w=(K,ee)=>{let _=Math.min(pe,D(K,ee),A[K]);if(_<=0)return;p[K].element.style.width=`${A[K]-_}px`,p[K].element.style[ee]=`${D(K,ee)-_}px`,ge+=_};if(G>=0)w(G,"paddingRight");if(U>=0)w(U,"paddingLeft");p[x].element.style.width=`${A[x]+ge}px`,document.addEventListener("pointerup",T),document.addEventListener("pointercancel",T)},E=(x,A)=>{let N=p.filter((G)=>d.has(f(G))),D={buttonGroup:I,values:N.map(f),selected:N,button:x,originalEvent:A};n.emit("change",D)},v=(x,A,N,D)=>{if(o==="none")return!1;let G=p.find((U)=>f(U)===x);if(!G)return!1;if(A===d.has(x))return!1;if(!A&&l&&d.size===1)return!1;if(A&&o==="single")for(let U of p){let j=f(U);if(j!==x&&d.has(j))d.delete(j),h(U,!1)}if(A)d.add(x);else d.delete(x);return h(G,A),E(N??G,D),!0};if(g.forEach((x,A)=>{let N=od(x,A,c,t),D=o!=="none",U=Boolean(x.icon)&&!x.text?Lt({...N,toggle:D,toggleOnClick:!1,selectedIcon:x.selectedIcon,variant:N.variant==="text"?"standard":N.variant}):Te({...N,toggle:D,toggleOnClick:!1});if(U._groupConfig=x,U._groupIndex=A,D)U.element.setAttribute("aria-pressed","false");U.element.addEventListener("pointerdown",()=>{if(!U.disabled?.isDisabled())b(A)}),U.on("click",(j)=>{if(!U.disabled?.isDisabled()){let pe={buttonGroup:I,button:U,index:A,originalEvent:j};if(n.emit("click",pe),o!=="none"){let ge=f(U),w=d.has(ge);if(o==="single"){if(!w)v(ge,!0,U,j);else if(!l)v(ge,!1,U,j)}else v(ge,!w,U,j)}}}),U.on("focus",(j)=>{let pe={buttonGroup:I,button:U,index:A,originalEvent:j};n.emit("focus",pe)}),U.on("blur",(j)=>{let pe={buttonGroup:I,button:U,index:A,originalEvent:j};n.emit("blur",pe)}),u.element.appendChild(U.element),p.push(U)}),o!=="none")p.forEach((x)=>{if(x._groupConfig?.selected&&(o==="multi"||d.size===0))d.add(f(x)),h(x,!0)});let S=(x)=>{["filled","tonal","outlined","elevated","text"].forEach((N)=>{u.element.classList.remove(`${t.prefix}-button-group--${N}`)}),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-variant",x),p.forEach((N)=>{N.setVariant(x)}),r=x},y=(x)=>{u.element.classList.remove(`${t.prefix}-button-group--horizontal`,`${t.prefix}-button-group--vertical`),u.element.classList.add(`${t.prefix}-button-group--${x}`),u.element.setAttribute("data-orientation",x),i=x},L=(x)=>{if(Object.values(tt).forEach((A)=>{if(A!==tt.DEFAULT)u.element.classList.remove(`${t.prefix}-button-group--density-${A}`)}),x!==tt.DEFAULT)u.element.classList.add(`${t.prefix}-button-group--density-${x}`);u.element.setAttribute("data-density",x),m(x),s=x},I={element:u.element,buttons:p,getButton(x){return p[x]},getButtonById(x){return p.find((A)=>{let N=A._groupConfig;return N?.id===x||N?.value===x})},getVariant(){return r},setVariant(x){return S(x),this},getOrientation(){return i},setOrientation(x){return y(x),this},getDensity(){return s},setDensity(x){return L(x),this},enable(){return u.element.classList.remove(`${t.prefix}-button-group--disabled`),p.forEach((x)=>{if(!x._groupConfig?.disabled)x.enable()}),this},disable(){return u.element.classList.add(`${t.prefix}-button-group--disabled`),p.forEach((x)=>{x.disable()}),this},enableButton(x){let A=p[x];if(A)A.enable();return this},getSelected(){return p.filter((x)=>d.has(f(x))).map(f)},isSelected(x){return d.has(x)},select(x){return v(x,!0),this},deselect(x){return v(x,!1),this},toggle(x){return v(x,!d.has(x)),this},getKind(){return a},getSelection(){return o},disableButton(x){let A=p[x];if(A)A.disable();return this},on(x,A){return n.on(x,A),this},off(x,A){return n.off(x,A),this},destroy(){T(),p.forEach((x)=>{x.destroy()}),p.length=0,n.clear(),u.lifecycle.destroy()}};return I}catch(u){throw console.error("Button Group creation error:",u),Error(`Failed to create button group: ${u.message}`)}},Xi=Wp;ne();Z();J();var ld=({lifecycle:e})=>(t)=>({...t,element:t.element,addContent(n){if(n&&n.classList.contains(`${t.getClass("card")}-content`))t.element.appendChild(n);return this},setHeader(n){if(n&&n.classList.contains(`${t.getClass("card")}-header`)){let r=t.element.querySelector(`.${t.getClass("card")}-header`);if(r)r.remove();if(t.element.querySelector(`.${t.getClass("card")}-media`)){let s=t.element.querySelectorAll(`.${t.getClass("card")}-media`),a=s[s.length-1];if(a.nextSibling)t.element.insertBefore(n,a.nextSibling);else t.element.appendChild(n)}else t.element.insertBefore(n,t.element.firstChild)}return this},addMedia(n,r="top"){if(n&&n.classList.contains(`${t.getClass("card")}-media`))if(r==="top")t.element.insertBefore(n,t.element.firstChild);else t.element.appendChild(n);return this},setActions(n){if(n&&n.classList.contains(`${t.getClass("card")}-actions`)){let r=t.element.querySelector(`.${t.getClass("card")}-actions`);if(r)r.remove();t.element.appendChild(n)}return this},makeDraggable(n){if(t.element.setAttribute("draggable","true"),t.element.setAttribute("aria-grabbed","false"),typeof n==="function")t.element.addEventListener("dragstart",(r)=>{t.element.setAttribute("aria-grabbed","true"),n(r)}),t.element.addEventListener("dragend",()=>{t.element.setAttribute("aria-grabbed","false")});return this},focus(){return t.element.focus(),this},destroy(){e.destroy()}});Q();rt();ne();Z();Qe();var Or=(e={})=>{let t={...e,componentName:"card-content",prefix:X};try{let n=O(M,R({tag:"div",componentName:"card-content",className:[e.class,e.padding===!1?`${X}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))(t);if(e.html)n.element.innerHTML=e.html;else if(e.text)n.element.innerHTML=`<p>${e.text}</p>`;if(Array.isArray(e.children))e.children.forEach((r)=>{if(r instanceof HTMLElement)n.element.appendChild(r)});return n.element.classList.add("debug-content"),n.element}catch(n){throw console.error("Card content creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card content: ${n instanceof Error?n.message:String(n)}`)}},Rr=(e={})=>{let t={...e,componentName:"card-header",prefix:X};try{let n=O(M,R({tag:"div",componentName:"card-header",className:e.class,attributes:{role:"heading","aria-level":"3"}}))(t),r=H({tag:"div",className:`${X}-card-header-text`,container:n.element});if(e.title){H({tag:"h3",className:`${X}-card-header-title`,text:e.title,container:r,attributes:{id:`${n.element.id||"card-header"}-title`}});let i=n.element.closest(`.${X}-card`);if(i&&!i.hasAttribute("aria-labelledby"))i.setAttribute("aria-labelledby",`${n.element.id||"card-header"}-title`)}if(e.subtitle)H({tag:"h4",className:`${X}-card-header-subtitle`,text:e.subtitle,container:r});if(e.avatar){let i=typeof e.avatar==="string"?H({tag:"div",className:`${X}-card-header-avatar`,html:e.avatar}):e.avatar,s=i.querySelector("img");if(s&&!s.hasAttribute("alt"))s.setAttribute("alt",""),s.setAttribute("aria-hidden","true");n.element.insertBefore(i,n.element.firstChild)}if(e.action){let i=typeof e.action==="string"?H({tag:"div",className:`${X}-card-header-action`,html:e.action}):e.action;n.element.appendChild(i)}return n.element}catch(n){throw console.error("Card header creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card header: ${n instanceof Error?n.message:String(n)}`)}},Zn=(e={})=>{let t={...e,componentName:"card-actions",prefix:X};try{let n=O(M,R({tag:"div",componentName:"card-actions",className:[e.class,e.fullBleed?`${X}-card-actions--full-bleed`:null,e.vertical?`${X}-card-actions--vertical`:null,e.align?`${X}-card-actions--${e.align}`:null],attributes:{role:"group"}}))(t);if(Array.isArray(e.actions))e.actions.forEach((r,i)=>{if(r instanceof HTMLElement){if(!r.hasAttribute("aria-label")&&!r.hasAttribute("aria-labelledby")&&r.textContent?.trim()==="")r.setAttribute("aria-label",`Action ${i+1}`);n.element.appendChild(r)}});return n.element}catch(n){throw console.error("Card actions creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card actions: ${n instanceof Error?n.message:String(n)}`)}},Qn=(e={})=>{let t={...e,componentName:"card-media",prefix:X};try{let n=O(M,R({tag:"div",componentName:"card-media",className:[e.class,e.aspectRatio?`${X}-card-media--${e.aspectRatio.replace(":","-")}`:null,e.contain?`${X}-card-media--contain`:null]}))(t);if(e.element instanceof HTMLElement)n.element.appendChild(e.element);else if(e.src){let r=document.createElement("img");if(r.src=e.src,r.className=`${X}-card-media-img`,r.alt=e.alt||"",!e.alt)r.setAttribute("aria-hidden","true");n.element.appendChild(r)}return n.element}catch(n){throw console.error("Card media creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create card media: ${n instanceof Error?n.message:String(n)}`)}};var _r={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},dd={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4};var Yp={variant:_r.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},ud=(e)=>{let t={...e};if(e.header)t.headerConfig=e.header;if(e.content)t.contentConfig=e.content;if(e.media)t.mediaConfig=e.media;if(e.actions)t.actionsConfig=e.actions;return t},cd=(e,t)=>{if(t.mediaConfig&&(!t.mediaConfig.position||t.mediaConfig.position==="top")){let n=Qn({...t.mediaConfig,position:void 0});e.addMedia(n,"top")}if(t.headerConfig){let n=Rr(t.headerConfig);e.setHeader(n)}if(t.contentConfig){let n=Or(t.contentConfig);e.addContent(n)}if(t.mediaConfig&&t.mediaConfig.position==="bottom"){let n=Qn({...t.mediaConfig,position:void 0});e.addMedia(n,"bottom")}if(t.actionsConfig){let n=Zn(t.actionsConfig);e.setActions(n)}if(Array.isArray(t.buttons)&&t.buttons.length>0)Promise.resolve().then(() => (pt(),{})).then(({})=>{let r=t.buttons.map((s)=>Te(s).element),i=Zn({actions:r,align:t.actionsConfig?.align||"end"});e.setActions(i)}).catch((n)=>{console.error("Error processing buttons:",n)})},md=(e={})=>P(Yp,e,"card"),fd=(e)=>{let t=e.interactive||e.clickable,n=t?"button":"region",r={};if(e.aria)Object.entries(e.aria).forEach(([i,s])=>{if(s!==void 0){let a=i.startsWith("aria-")?i:`aria-${i}`;r[a]=s}});if(!r.role&&!e.aria?.role)r.role=n;if(t&&!r.tabindex)r.tabindex="0";return V(e,{tag:"div",className:[e.class,e.fullWidth?`${e.prefix}-card--full-width`:null,t?`${e.prefix}-card--interactive`:null],attributes:r,forwardEvents:{click:()=>!!e.clickable,mouseenter:()=>!!t,mouseleave:()=>!!t,keydown:()=>!!t,focus:()=>!!t,blur:()=>!!t},interactive:t})},pd=(e)=>({lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}}),$t=dd,gd=(e)=>{let t=e.config;if(t.interactive||t.clickable)e.element.addEventListener("mouseenter",()=>{if(t.variant===_r.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL2))}),e.element.addEventListener("mouseleave",()=>{if(t.variant===_r.ELEVATED)e.element.style.setProperty("--card-elevation",String($t.LEVEL1))}),e.element.addEventListener("keydown",(r)=>{if((r.key==="Enter"||r.key===" ")&&t.clickable)r.preventDefault(),e.element.click()}),e.element.addEventListener("focus",()=>{e.element.classList.add(`${e.getClass("card")}--focused`)}),e.element.addEventListener("blur",()=>{e.element.classList.remove(`${e.getClass("card")}--focused`)});if(t.draggable)e.element.setAttribute("draggable","true"),e.element.addEventListener("dragstart",(r)=>{if(e.element.style.setProperty("--card-elevation",String($t.LEVEL4)),e.element.classList.add(`${e.getClass("card")}--dragging`),e.emit?.("dragstart",{event:r}),r.dataTransfer){let i=e.element.querySelector(`.${e.getClass("card")}-header-title`)?.textContent||"Card";r.dataTransfer.setData("text/plain",i)}}),e.element.addEventListener("dragend",(r)=>{e.element.style.setProperty("--card-elevation",String($t.LEVEL1)),e.element.classList.remove(`${e.getClass("card")}--dragging`),e.emit?.("dragend",{event:r})});return e};var hd=(e)=>{if(e.config.variant==="elevated")e.element.style.setProperty("--card-elevation",String($t.LEVEL1));else e.element.style.setProperty("--card-elevation",String($t.LEVEL0));return e};var Xp=(e={})=>{let t=ud(e),n=md(t);try{let r=O(M,B(),R(fd(n)),se(n),n.clickable?Le(n):(i)=>i,k(),gd,hd,(i)=>ld(pd(i))(i))(n);return cd(r,t),r}catch(r){throw console.error("Card creation error:",r instanceof Error?r.message:String(r)),Error(`Failed to create card: ${r instanceof Error?r.message:String(r)}`)}},qi=Xp;ne();Z();J();var ji=(e)=>(t)=>{let n=t.getClass("carousel"),r=document.createElement("div");r.className=`${n}__scroller`;let i=document.createElement("div");i.className=`${n}__track`,r.appendChild(i),t.element.appendChild(r);let s=[],a=[],o=t,l,d=()=>{let c=a.length;a.forEach((f,h)=>{f.dataset.index=String(h),f.setAttribute("aria-label",`${h+1} of ${c}`)})},u=(c,f)=>{if(c.replaceChildren(),f.content!==void 0){if(typeof f.content==="string")c.innerHTML=f.content;else c.appendChild(f.content);return}if(f.image){let h=document.createElement("img");h.className=`${n}__image`,h.src=f.image,h.alt=f.alt??f.title??"",h.draggable=!1,c.appendChild(h)}if(f.title||f.description||f.buttonText){let h=document.createElement("div");if(h.className=`${n}__content`,f.title){let C=document.createElement("div");C.className=`${n}__title`,C.textContent=f.title,h.appendChild(C)}if(f.description){let C=document.createElement("div");C.className=`${n}__description`,C.textContent=f.description,h.appendChild(C)}if(f.buttonText){let C=document.createElement("a");if(C.className=`${n}__button`,C.textContent=f.buttonText,f.buttonUrl)C.href=f.buttonUrl;h.appendChild(C)}c.appendChild(h)}},m=(c)=>{let f=document.createElement("div");return f.className=`${n}__item`,f.setAttribute("role","group"),f.setAttribute("aria-roledescription","slide"),f.tabIndex=0,u(f,c),f},p=()=>{d(),l?.()},g={addSlide(c,f){let h=f!==void 0&&f>=0&&f<=s.length?f:s.length,C=m(c);if(s.splice(h,0,c),h<a.length)i.insertBefore(C,a[h]),a.splice(h,0,C);else i.appendChild(C),a.push(C);return p(),g},removeSlide(c){if(c<0||c>=a.length)return g;return i.removeChild(a[c]),a.splice(c,1),s.splice(c,1),p(),g},updateSlide(c,f){if(c<0||c>=a.length)return g;return s[c]=f,u(a[c],f),g},getSlide:(c)=>s[c]??null,getCount:()=>s.length,getElements:()=>a.slice()};return o.scroller=r,o.track=i,o.slides=g,o.slideElements=a,o.onSlidesChanged=(c)=>{l=c},(e.slides??[]).forEach((c)=>{let f=m(c);s.push(c),a.push(f),i.appendChild(f)}),d(),o};var Be={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",HERO_CENTER:"hero-center",FULL_SCREEN:"full-screen"},Cd={CHANGE:"change"},Se={VARIANT:Be.MULTI_BROWSE,ITEM_WIDTH:280,GAP:8,GAP_FULL_SCREEN:16,PADDING:16,CORNER_RADIUS:28,MIN_SMALL_ITEM_WIDTH:40,MAX_SMALL_ITEM_WIDTH:56,ANCHOR_SIZE:10,MEDIUM_LARGE_THRESHOLD:0.85,INITIAL_SLIDE:0};Q();var jp={variant:Se.VARIANT,cornerRadius:Se.CORNER_RADIUS,initialSlide:Se.INITIAL_SLIDE,minSmallItemWidth:Se.MIN_SMALL_ITEM_WIDTH,maxSmallItemWidth:Se.MAX_SMALL_ITEM_WIDTH},Zi=(e)=>{let t=e.variant||Se.VARIANT,n=t===Be.FULL_SCREEN;return{variant:t,gap:e.gap??(n?Se.GAP_FULL_SCREEN:Se.GAP),padding:e.padding??(n?0:Se.PADDING),snap:e.snap??t!==Be.UNCONTAINED}},Ed=(e={})=>P(jp,e,"carousel"),bd=(e)=>{let{variant:t}=Zi(e);return V(e,{tag:"div",attributes:{role:"region","aria-roledescription":"carousel","aria-label":e.ariaLabel||"Carousel"},className:[e.class,`${e.prefix}-carousel--${t}`,t===Be.FULL_SCREEN?`${e.prefix}-carousel--vertical`:null],forwardEvents:{focus:!0,blur:!0}})};var Br=(e)=>e.largeCount+e.mediumCount+e.smallCount,Zp=(e)=>{if(e.largeCount>0&&e.smallCount>0&&e.mediumCount>0)return e.largeSize>e.mediumSize&&e.mediumSize>e.smallSize;if(e.largeCount>0&&e.smallCount>0)return e.largeSize>e.smallSize;return!0},Qi=(e,t)=>Zp(e)?Math.abs(t-e.largeSize)*e.priority:Number.MAX_VALUE,Qp=(e,t,n,r,i)=>(e-(t+r/2)*n)/(i+r/2),Jp=(e,t,n,r,i,s,a,o,l,d,u)=>{let m=d+o+r,p=t-(m-1)*n,g=Math.min(Math.max(i,s),a),c=u*d+l*o+g*r,f=p-c;if(r>0&&f>0)g+=Math.min(f/r,a-g);else if(r>0&&f<0)g+=Math.max(f/r,s-g);g=r>0?g:0;let h=Qp(p,r,g,o,d),C=(h+g)/2;if(o>0&&h!==u){let T=(u-h)*d,b=C*0.1*o,E=Math.min(Math.abs(T),b);if(T>0)C-=E/o,h+=E/d;else C+=E/o,h-=E/d}return{priority:e,smallSize:g,smallCount:r,mediumSize:C,mediumCount:o,largeSize:h,largeCount:d}},Hr=(e)=>{let t=null,n=1;for(let r of e.largeCounts)for(let i of e.mediumCounts)for(let s of e.smallCounts){let a=Jp(n,e.availableSpace,e.gap,s,e.targetSmallSize,e.minSmallSize,e.maxSmallSize,i,e.targetMediumSize,r,e.targetLargeSize);if(t===null||Qi(a,e.targetLargeSize)<Qi(t,e.targetLargeSize)){if(t=a,Qi(t,e.targetLargeSize)===0)return t}n++}return t};var He=(e)=>e.findIndex((t)=>t.isFocal),Ke=(e)=>{for(let t=e.length-1;t>=0;t--)if(e[t].isFocal)return t;return-1},Vr=(e)=>e.findIndex((t)=>!t.isAnchor),Fr=(e)=>{for(let t=e.length-1;t>=0;t--)if(!e[t].isAnchor)return t;return-1},Ji=(e)=>e.findIndex((t)=>t.isPivot),Sd=(e)=>Ke(e)-He(e)+1,es=(e)=>e.reduce((t,n)=>Math.min(t,n.size),Number.MAX_VALUE),ts=(e)=>e.reduce((t,n)=>Math.max(t,n.size),0),yd=(e)=>{let t=e[He(e)];return t.offset-t.size/2>=0&&He(e)===Vr(e)},xd=(e,t)=>{let n=e[Ke(e)];return n.offset+n.size/2<=t&&Ke(e)===Fr(e)},Id=(e,t)=>{for(let n=Ke(e);n<e.length;n++)if(e[n].size===t)return n;return e.length-1},Ld=(e,t)=>{for(let n=He(e)-1;n>=0;n--)if(e[n].size===t)return n;return 0},Ad=(e,t)=>{for(let n=e.length-1;n>=0;n--)if(e[n].unadjustedOffset<t)return e[n];return e[0]},Nd=(e,t)=>e.find((n)=>n.unadjustedOffset>=t)??e[e.length-1],$r=(e,t,n)=>e+(t-e)*n,ns=(e,t,n)=>({size:$r(e.size,t.size,n),offset:$r(e.offset,t.offset,n),unadjustedOffset:$r(e.unadjustedOffset,t.unadjustedOffset,n),isFocal:n<0.5?e.isFocal:t.isFocal,isAnchor:n<0.5?e.isAnchor:t.isAnchor,isPivot:n<0.5?e.isPivot:t.isPivot,cutoff:$r(e.cutoff,t.cutoff,n)}),wd=(e,t,n)=>e.map((r,i)=>ns(r,t[i],n)),vd=(e,t)=>t-e/2<0&&t+e/2>0,Td=(e,t,n)=>t-e/2<n&&t+e/2>n,Dd=(e)=>{let t=-1,n=0;if(e.forEach((i,s)=>{if(!i.isAnchor&&i.size>n)t=s,n=i.size}),t<0)return[-1,-1,0];let r=t;while(r<e.length-1&&e[r+1].size===n)r++;return[t,r,n]},Md=(e,t,n,r,i,s,a,o)=>{if(e.length===0||t<0||t>=e.length)return[];let l=e[t],d=[],u=vd(l.size,n)?n-l.size/2:Td(l.size,n,a)?n+l.size/2-a:0;d.push({size:l.size,offset:n,unadjustedOffset:n,isFocal:t>=r&&t<=i,isAnchor:l.isAnchor,isPivot:!0,cutoff:u});let m=n-s/2-o,p=n-s/2-o;for(let g=t-1;g>=0;g--){let c=e[g],f=m-c.size/2,h=p-s/2;d.unshift({size:c.size,offset:f,unadjustedOffset:h,isFocal:g>=r&&g<=i,isAnchor:c.isAnchor,isPivot:!1,cutoff:vd(c.size,f)?Math.abs(f-c.size/2):0}),m-=c.size+o,p-=s+o}m=n+s/2+o,p=n+s/2+o;for(let g=t+1;g<e.length;g++){let c=e[g],f=m+c.size/2,h=p+s/2;d.push({size:c.size,offset:f,unadjustedOffset:h,isFocal:g>=r&&g<=i,isAnchor:c.isAnchor,isPivot:!1,cutoff:Td(c.size,f,a)?f+c.size/2-a:0}),m+=c.size+o,p+=s+o}return d},rs=(e,t,n,r,i)=>{let[s,a,o]=Dd(i);return Md(i,n,r,s,a,o,e,t)},eg=(e,t,n,r)=>{let[i,s,a]=Dd(r);if(i<0)return[];let o=s-i,l=a/2;if(n==="center"){let d=t===0||o%2===0?0:t/2,u=Math.floor(o/2)*t;l=e/2-a/2*o-d-u}return Md(r,i,l,i,s,a,e,t)},Ur=(e,t,n,r,i,s)=>{let a=[{size:r,isAnchor:!0}],o=(l,d)=>{for(let u=0;u<d;u++)a.push({size:l,isAnchor:!1})};if(s==="center")o(e.smallSize,Math.floor(e.smallCount/2)),o(e.mediumSize,Math.floor(e.mediumCount/2)),o(e.largeSize,e.largeCount),o(e.mediumSize,Math.ceil(e.mediumCount/2)),o(e.smallSize,Math.ceil(e.smallCount/2));else o(e.largeSize,e.largeCount),o(e.mediumSize,e.mediumCount),o(e.smallSize,e.smallCount);return a.push({size:i,isAnchor:!0}),eg(t,n,s,a)},Od=(e,t)=>{let n=[];for(let r=e;r>=t;r--)n.push(r);return n},Rd=(e,t,n,r,i)=>{if(e<=0||t<=0)return[];let s=[1],a=[1,0],o=Math.min(t,e),l=Math.min(Math.max(o/3,i.minSmallSize),i.maxSmallSize),d=(o+l)/2;if(e<i.minSmallSize*2)s=[0];let u=e-d*Math.max(...a)-i.maxSmallSize*Math.max(...s),m=Math.max(1,Math.floor(u/o)),p=Math.ceil(e/o),g=Od(p,m),c={availableSpace:e,gap:n,targetSmallSize:l,minSmallSize:i.minSmallSize,maxSmallSize:i.maxSmallSize,smallCounts:s,targetMediumSize:d,mediumCounts:a,targetLargeSize:o,largeCounts:g},f=Hr(c);if(f&&Br(f)>r){let h=Br(f)-r,C=f.smallCount,T=f.mediumCount;while(h>0){if(C>0)C-=1;else if(T>1)T-=1;h-=1}f=Hr({...c,smallCounts:[C],mediumCounts:[T]})}if(!f)return[];return Ur(f,e,n,i.anchorSize,i.anchorSize,"start")},_d=(e,t,n,r,i,s)=>{if(e<=0)return[];let a=i&&r>=3,o=r<=1?[0]:a?[2]:[1],l=Math.min(t??e,e),d=Math.min(Math.max(l/3,s.minSmallSize),s.maxSmallSize),u=s.minSmallSize*Math.max(...o)+s.minSmallSize*1.25;if(e<u)o=[0];let m=e-s.minSmallSize*Math.max(...o),p=Math.max(1,Math.floor(m/l)),g=Math.ceil(e/l),c=Hr({availableSpace:e,gap:n,targetSmallSize:d,minSmallSize:s.minSmallSize,maxSmallSize:s.maxSmallSize,smallCounts:o,targetMediumSize:0,mediumCounts:[0],targetLargeSize:l,largeCounts:Od(g,p)});if(!c)return[];let f=a&&r>=Br(c)?"center":"start";return Ur(c,e,n,s.anchorSize,s.anchorSize,f)},tg=(e,t,n,r)=>{let i=Math.max(n*1.5,e);if(i>t*r)i=Math.max(n*1.2,e);return i},Gr=(e,t,n,r)=>{if(e<=0||t<=0)return[];let i=Math.min(t,e),s=Math.max(1,Math.floor((e+n)/(i+n))),a=Math.max(0,e-s*(i+n)),o=a>0?1:0,l=tg(r.anchorSize,i,a,r.mediumLargeThreshold),d={priority:0,smallSize:0,smallCount:0,mediumSize:l,mediumCount:o,largeSize:i,largeCount:s},u=Math.min(r.anchorSize,t),m=Math.max(u,l*0.5);return Ur(d,e,n,m,r.anchorSize,"start")},Pd=(e,t,n)=>{if(e<=0)return[];return Ur({priority:0,smallSize:0,smallCount:0,mediumSize:0,mediumCount:0,largeSize:e,largeCount:1},e,t,n.anchorSize,n.anchorSize,"start")};var is=(e,t,n,r,i)=>{if(i<=n)return e;if(i>=r)return t;return e+(t-e)*((i-n)/(r-n))},zr=(e,t,n,r,i,s)=>{let a=e.filter((d)=>!d.isAnchor).length,o=r/a;return rs(t,n,s,i.offset-o/2+r,e.map((d)=>({size:d.size-Math.abs(o),isAnchor:d.isAnchor}))).map((d,u)=>({...d,unadjustedOffset:e[u].unadjustedOffset}))},Wr=(e,t,n,r,i)=>{let s=t>n?1:-1,a=e[t],o=(a.size-a.cutoff+i)*s,l=e[Ji(e)],d=e.slice();return d.splice(t,1),d.splice(n,0,a),rs(r,i,Ji(e)+s,l.offset+o,d.map((u)=>({size:u.size,isAnchor:u.isAnchor})))},ng=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(yd(e)){if(r!==0)i.push(zr(e,t,n,r,e[He(e)],He(e)));return i}let s=Vr(e),o=He(e)-s;if(o<=0&&e[He(e)].cutoff>0)return i.push(Wr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=s+l,m=e.length-1;if(u>0){let p=e[u-1].size;m=Id(d,p)-1}i.push(Wr(d,Vr(e),m,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=zr(l,t,n,r,l[He(l)],He(l))}return i},rg=(e,t,n,r)=>{if(e.length===0)return[];let i=[e];if(xd(e,t)){if(r!==0)i.push(zr(e,t,n,-r,e[Ke(e)],Ke(e)));return i}let s=Ke(e),a=Fr(e),o=a-s;if(o<=0&&e[Ke(e)].cutoff>0)return i.push(Wr(e,0,0,t,n)),i;for(let l=0;l<o;l++){let d=i[i.length-1],u=a-l,m=0;if(u<e.length-1){let p=e[u+1].size;m=Ld(d,p)+1}i.push(Wr(d,Fr(e),m,t,n))}if(r!==0){let l=i[i.length-1];i[i.length-1]=zr(l,t,n,-r,l[Ke(l)],Ke(l))}return i},kd=(e,t,n)=>{let r=[0];if(e===0||t.length===0)return r;for(let i=1;i<t.length;i++){let s=t[i-1],a=t[i],o=n?a[0].unadjustedOffset-s[0].unadjustedOffset:s[s.length-1].unadjustedOffset-a[a.length-1].unadjustedOffset,l=i===t.length-1?1:r[i-1]+o/e;r.push(l)}return r},Bd=(e,t,n,r,i)=>{let s=ng(e,t,n,r),a=rg(e,t,n,i),o=e.length?e[He(e)].size:0,l=s.length?Math.max(s[s.length-1][0].unadjustedOffset-s[0][0].unadjustedOffset,r):0,d=a.length?Math.max(a[0][a[0].length-1].unadjustedOffset-a[a.length-1][a[a.length-1].length-1].unadjustedOffset,i):0,u=e.length?es(e):0,m=e.length?ts(e):0;for(let p of[...s,...a])u=Math.min(u,es(p)),m=Math.max(m,ts(p));return{defaultKeylines:e,startSteps:s,endSteps:a,availableSpace:t,gap:n,beforePadding:r,afterPadding:i,itemSize:o,minItemSize:u,maxItemSize:m,valid:e.length>0&&t!==0&&o!==0,startShiftDistance:l,endShiftDistance:d,startShiftPoints:kd(l,s,!0),endShiftPoints:kd(d,a,!1)}},Hd=(e,t,n,r=!1)=>{let i=Math.max(0,t),s=e.startShiftDistance,a=Math.max(0,n-e.endShiftDistance);if(i>=s&&i<=a)return e.defaultKeylines;let o=is(1,0,0,s,i),{startShiftPoints:l,startSteps:d}=e;if(i>a){if(o=is(0,1,a,n,i),l=e.endShiftPoints,d=e.endSteps,a<0.01&&e.startSteps.length===2&&e.endSteps.length===2)d=[e.startSteps[1],e.endSteps[1]]}let u=0,m=0,p=0,g=l[0];for(let c=1;c<d.length;c++){let f=l[c];if(o<=f){u=c-1,m=c,p=is(0,1,g,f,o);break}g=f}if(r)return d[Math.round(p)===0?u:m];return wd(d[u],d[m],p)},ss=(e,t,n)=>{if(!e.valid)return 0;let r=(d)=>d[He(d)].unadjustedOffset-e.itemSize/2,i=(d)=>d[Ke(d)].unadjustedOffset-e.itemSize/2,s=Math.round(r(e.defaultKeylines)),a=e.startSteps.length-1;if(t<=a){let d=Math.min(Math.max(a-t,0),a);s=Math.round(r(e.startSteps[d]))}let o=e.endSteps.length-1,l=n-1;if(t>=l-o&&n>Sd(e.defaultKeylines)){let d=Math.min(Math.max(o-(l-t),0),o);s=Math.round(i(e.endSteps[d]))}return s},$d=(e,t)=>Math.max(0,e.itemSize*t+e.gap*(t-1)-e.availableSpace),Vd=(e,t,n,r)=>{let i=e.itemSize+e.gap,s=n*i+e.itemSize/2-r,a=Ad(t,s),o=Nd(t,s),l=a===o?1:(s-a.unadjustedOffset)/(o.unadjustedOffset-a.unadjustedOffset),d=ns(a,o,l),u=d.offset;if(a===o)u+=(s-d.unadjustedOffset)/d.size;return{size:d.size,center:u,keyline:d}};var Fd=0.4,ig=4,as=(e)=>(t)=>{let{variant:n,gap:r,padding:i,snap:s}=Zi(e),a=n===Be.FULL_SCREEN,o={minSmallSize:e.minSmallItemWidth??Se.MIN_SMALL_ITEM_WIDTH,maxSmallSize:e.maxSmallItemWidth??Se.MAX_SMALL_ITEM_WIDTH,anchorSize:Se.ANCHOR_SIZE,mediumLargeThreshold:Se.MEDIUM_LARGE_THRESHOLD},l=e.cornerRadius??Se.CORNER_RADIUS,d=typeof window<"u"&&typeof window.matchMedia==="function"?window.matchMedia("(prefers-reduced-motion: reduce)"):null,{element:u,scroller:m,track:p,slideElements:g}=t,c=t.getClass("carousel"),f=`${c}__snap`;u.classList.toggle(`${c}--snap`,s);let h=null,C=0,T=0,b=0,E=[],v=Math.max(0,e.initialSlide??Se.INITIAL_SLIDE),S=new WeakMap,y=null,L=0,I=()=>{y=null,window.clearTimeout(L)},x=(F)=>{y=F,window.clearTimeout(L),L=window.setTimeout(I,1000)},A=()=>a?m.scrollTop:m.scrollLeft,N=(F,q)=>{let Ee=q&&!d?.matches?"smooth":"auto";if(typeof m.scrollTo==="function")m.scrollTo(a?{top:F,behavior:Ee}:{left:F,behavior:Ee});else if(a)m.scrollTop=F;else m.scrollLeft=F},D=()=>{t.emit?.(Cd.CHANGE,{index:v})},G=(F)=>{let q=0,Ee=Number.MAX_VALUE;return E.forEach((ve,Ce)=>{let Ge=Math.abs(F-ve);if(Ge<Ee)Ee=Ge,q=Ce}),q},U=(F)=>{let q=d?.matches===!0,Ee=e.itemWidth??Se.ITEM_WIDTH;switch(n){case Be.HERO:case Be.HERO_CENTER:{let ve=e.itemWidth??null;return q?Gr(F,Math.min(ve??F,F),r,o):_d(F,ve,r,C,n===Be.HERO_CENTER,o)}case Be.UNCONTAINED:return Gr(F,Ee,r,o);case Be.FULL_SCREEN:return Pd(F,r,o);default:return q?Gr(F,Ee,r,o):Rd(F,Ee,r,C,o)}},j=()=>{if(C=g.length,T=a?m.clientHeight:m.clientWidth,v=C?Math.min(v,C-1):0,T<=0||C===0){h=null;return}let F=n===Be.UNCONTAINED?0:i;if(h=Bd(U(T),T,r,i,F),!h.valid){h=null;return}let q=h.itemSize+h.gap;b=-ss(h,0,C),E=g.map((Ce,Ge)=>Ge*q-ss(h,Ge,C)-b);let Ee=Math.max(0,E[C-1]??0);p.style[a?"height":"width"]=`${T+Ee}px`,p.style[a?"width":"height"]="",p.querySelectorAll(`.${f}`).forEach((Ce)=>Ce.remove());let ve=document.createDocumentFragment();E.forEach((Ce)=>{let Ge=document.createElement("div");Ge.className=f,Ge.style[a?"top":"left"]=`${Ce}px`,ve.appendChild(Ge)}),p.appendChild(ve),g.forEach((Ce)=>{Ce.style[a?"height":"width"]=`${h.itemSize}px`,Ce.style[a?"width":"height"]=""}),u.style.setProperty("--mtrl-carousel-corner",`${l}px`)},pe=()=>{if(!h)return;let F=A(),q=F+b,Ee=Hd(h,q,$d(h,C)),ve=h.itemSize,Ce=h.maxItemSize-h.minItemSize;for(let mr=0;mr<C;mr++){let kt=g[mr],fr=Vd(h,Ee,mr,q),pr=Math.max(0,Math.min(ve,fr.size)),Ci=fr.center-ve/2+F,Ga=fr.center+pr/2<-ve||fr.center-pr/2>T+ve,Ei=Math.max(0,(ve-pr)/2),za=Ce>0?Math.min(1,Math.max(0,(pr-h.minItemSize)/Ce)):1,Wa=Ga?"hidden":`${Math.round(Ci*100)/100}|${Math.round(Ei*100)/100}|${za.toFixed(3)}`;if(S.get(kt)===Wa)continue;if(S.set(kt,Wa),Ga){kt.style.visibility="hidden";continue}kt.style.visibility="",kt.style.transform=a?`translate3d(0, ${Ci}px, 0)`:`translate3d(${Ci}px, 0, 0)`,kt.style.clipPath=a?`inset(${Ei}px 0 round ${l}px)`:`inset(0 ${Ei}px round ${l}px)`,kt.style.setProperty("--mtrl-carousel-fade",za.toFixed(3))}if(y!==null){if(Math.abs(A()-(E[y]??0))<1)I();return}let Ge=G(A());if(Ge!==v)v=Ge,D()},ge=()=>{if(j(),h)x(v),N(E[v]??0,!1);pe()},w=(F)=>{if(!C)return;let q=Math.min(Math.max(F,0),C-1);if(h)x(q),N(E[q]??0,!0);if(q!==v)v=q,D()},K=()=>w(v+1),ee=()=>w(v-1),_=(F)=>{let q=F?.closest?.(`.${c}__item`);return q?g.indexOf(q):-1},re=(F)=>{let q=_(F.target);if(q<0)return;let Ee=a?"ArrowDown":"ArrowRight",ve=a?"ArrowUp":"ArrowLeft",Ce=-1;if(F.key===Ee)Ce=q+1;else if(F.key===ve)Ce=q-1;else if(F.key==="Home")Ce=0;else if(F.key==="End")Ce=C-1;if(Ce<0||Ce>=C)return;F.preventDefault(),g[Ce].focus({preventScroll:!0}),w(Ce)},ue=(F)=>{let q=_(F.target);if(q>=0&&q!==v)w(q)},Ue=!1,ut=!1,wn=0,qt=0,Dn=0,jt=0,ur=0,Ha=0,_t=()=>{window.clearTimeout(Ha),m.removeEventListener("scrollend",_t),delete u.dataset.settling},$a=(F)=>{if(I(),F.pointerType!=="mouse"||F.button!==0||!h)return;Ue=!0,ut=!1,wn=a?F.clientY:F.clientX,Dn=wn,jt=F.timeStamp,ur=0,qt=A(),_t(),u.dataset.settling="true",m.setPointerCapture(F.pointerId)},Va=(F)=>{if(!Ue)return;let q=a?F.clientY:F.clientX,Ee=q-wn;if(!ut&&Math.abs(Ee)<ig)return;ut=!0,u.dataset.dragging="true";let ve=F.timeStamp-jt;if(ve>0)ur=(q-Dn)/ve;if(Dn=q,jt=F.timeStamp,a)m.scrollTop=qt-Ee;else m.scrollLeft=qt-Ee;F.preventDefault()},cr=(F)=>{if(!Ue)return;if(Ue=!1,m.hasPointerCapture(F.pointerId))m.releasePointerCapture(F.pointerId);if(delete u.dataset.dragging,!ut){_t();return}if(s){let q=G(A());if(ur<-Fd)q=Math.min(C-1,q+1);else if(ur>Fd)q=Math.max(0,q-1);w(q),m.addEventListener("scrollend",_t,{once:!0}),Ha=window.setTimeout(_t,600)}else _t()},Fa=(F)=>{if(ut)ut=!1,F.preventDefault(),F.stopPropagation()};m.addEventListener("scroll",pe,{passive:!0}),m.addEventListener("wheel",I,{passive:!0}),m.addEventListener("touchstart",I,{passive:!0}),m.addEventListener("keydown",re),m.addEventListener("focusin",ue),m.addEventListener("pointerdown",$a),m.addEventListener("pointermove",Va),m.addEventListener("pointerup",cr),m.addEventListener("pointercancel",cr),m.addEventListener("click",Fa,!0),d?.addEventListener?.("change",ge);let Ua=typeof ResizeObserver==="function"?new ResizeObserver(ge):null;Ua?.observe(m),t.onSlidesChanged(ge),ge();let $f=t.lifecycle?.destroy,Pt=t;return Pt.getCurrentSlide=()=>v,Pt.getVariant=()=>n,Pt.next=K,Pt.prev=ee,Pt.goTo=w,Pt.lifecycle={destroy:()=>{_t(),Ua?.disconnect(),d?.removeEventListener?.("change",ge),I(),m.removeEventListener("scroll",pe),m.removeEventListener("wheel",I),m.removeEventListener("touchstart",I),m.removeEventListener("keydown",re),m.removeEventListener("focusin",ue),m.removeEventListener("pointerdown",$a),m.removeEventListener("pointermove",Va),m.removeEventListener("pointerup",cr),m.removeEventListener("pointercancel",cr),m.removeEventListener("click",Fa,!0),$f?.()}},Pt};var Ud=()=>(e)=>{let t={element:e.element,slides:e.slides,lifecycle:{destroy:()=>e.lifecycle?.destroy()},getClass:e.getClass,next(){return e.next(),t},prev(){return e.prev(),t},goTo(n){return e.goTo(n),t},getCurrentSlide:()=>e.getCurrentSlide(),getVariant:()=>e.getVariant(),addSlide(n,r){return e.slides.addSlide(n,r),t},removeSlide(n){return e.slides.removeSlide(n),t},destroy(){e.lifecycle?.destroy()},on(n,r){return e.on?.(n,r),t},off(n,r){return e.off?.(n,r),t},addClass(...n){return e.element.classList.add(...n),t}};return t};var Gd=(e={})=>{let t=Ed(e);return O(M,B(),R(bd(t)),ji(t),k(),as(t),Ud())(t)},os=Gd;ne();Z();J();var zd=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setIndeterminate(i){return r.setIndeterminate?.(i),this},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});Q();var sg={variant:"filled",labelPosition:"end"},Wd=(e={})=>P(sg,e,"checkbox"),Kd=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),Yd=(e)=>(t)=>{let n=document.createElement("span");return n.className=`${e.prefix}-checkbox-icon`,n.innerHTML=`
10
10
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="20" height="20" fill="currentColor">
11
11
  <path d="M9.55 14.6L6.35 11.4l-1.9 1.9L9.55 18.4l10.9-10.9-1.9-1.9z"/>
12
12
  </svg>
13
- `,t.element.appendChild(n),t},Xd=(e)=>(t)=>{let n=e.labelPosition||"end",r=`${e.prefix}-checkbox--label-${n}`;return t.element.classList.add(r),t},qd=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var ag=(e,t)=>{let n=Ht(t)(e);if(t.indeterminate)n.input.indeterminate=!0;return n.setIndeterminate=(r)=>(n.input.indeterminate=r,n.element.classList.toggle(`${t.prefix}-checkbox--indeterminate`,r),n),n},og=(e={})=>{let t=Wd(e);try{return M(D,B(),O(Kd(t)),kt(t),Yd(t),et(t),Xd(t),(r)=>ag(r,t),oe(t),P(),(r)=>zd(qd(r))(r))(t)}catch(n){throw console.error("Checkbox creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create checkbox: ${n instanceof Error?n.message:String(n)}`)}},ds=og;ne();Z();J();var jd=({disabled:e,lifecycle:t})=>(n)=>{let r=n.element.classList.contains(`${n.getClass("chip")}--selected`),i=n.element.getAttribute("data-value")||null,s=["filled","outlined","elevated","assist","filter","input","suggestion"],a=null;for(let o of s)if(n.element.classList.contains(`${n.getClass("chip")}--${o}`)){a=o;break}return{...n,element:n.element,getValue(){let o=n.element.getAttribute("data-value");if(o!==null)return i=o,o;if(i!==null)return n.element.setAttribute("data-value",i),i;let l=n.element.querySelector(`.${n.getClass("chip")}-text`);if(l&&l.textContent){let d=l.textContent;if(d.includes(" Theme"))i=d.replace(" Theme","").toLowerCase();else i=d.toLowerCase().replace(/\s+/g,"-");return n.element.setAttribute("data-value",i),i}return null},setValue(o){if(o!==null&&o!==void 0)i=o,n.element.setAttribute("data-value",o);else i=null,n.element.removeAttribute("data-value");return this},isDisabled(){return n.element.getAttribute("aria-disabled")==="true"},enable(){return e.enable(),n.element.classList.remove(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","false"),n.element.setAttribute("tabindex","0"),this},disable(){return e.disable(),n.element.classList.add(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","true"),n.element.setAttribute("tabindex","-1"),this},setText(o){let l=`.${n.getClass("chip")}-content`,d=n.element.querySelector(l)||n.element,u=`.${n.getClass("chip")}-text`,c=n.element.querySelector(u);if(!c&&o){c=document.createElement("span"),c.className=`${n.getClass("chip")}-text`;let p=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);if(p)d.insertBefore(c,p.nextSibling);else d.insertBefore(c,d.firstChild)}if(c){if(c.textContent=o||"",!o&&c.parentNode)c.parentNode.removeChild(c)}return this},getText(){let o=n.element.querySelector(`.${n.getClass("chip")}-text`);return o?o.textContent||"":""},setIcon(o){return this.setLeadingIcon(o)},getIcon(){let o=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);return o?o.innerHTML:""},setLeadingIcon(o){let l=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,d=`.${n.getClass("chip")}-leading-icon`,u=n.element.querySelector(d);if(!u&&o)u=document.createElement("span"),u.className=`${n.getClass("chip")}-leading-icon`,l.insertBefore(u,l.firstChild);if(u){if(u.innerHTML=o||"",!o&&u.parentNode)u.parentNode.removeChild(u)}return this},setTrailingIcon(o,l){let d=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,u=`.${n.getClass("chip")}-trailing-icon`,c=n.element.querySelector(u);if(!c&&o){if(c=document.createElement("span"),c.className=`${n.getClass("chip")}-trailing-icon`,d.appendChild(c),l)c.addEventListener("click",(p)=>{p.stopPropagation(),l(this)})}if(c){if(c.innerHTML=o||"",!o&&c.parentNode)c.parentNode.removeChild(c)}return this},isSelected(){return r},setSelected(o){if(r=!!o,o)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");else n.element.classList.remove(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!r)},getVariant(){return a},setVariant(o){if(a)n.element.classList.remove(`${n.getClass("chip")}--${a}`);if(o)n.element.classList.add(`${n.getClass("chip")}--${o}`);return a=o,this},destroy(){t.destroy()}}};Q();var lg={variant:"filled",ripple:!0},Zd=(e={})=>_(lg,e,"chip"),Qd=(e)=>{let t={role:"button",tabindex:"0"};if(e.disabled===!0)t["aria-disabled"]="true";if(e.selected===!0)t["aria-selected"]="true";else if(e.selected===!1)t["aria-selected"]="false";let n=[e.class,e.selected?`${e.prefix}-chip--selected`:null];return V(e,{tag:"div",attributes:t,className:n,forwardEvents:{click:(r)=>r.element.getAttribute("aria-disabled")!=="true",keydown:(r,i)=>{if(i.key===" "||i.key==="Enter")return i.preventDefault(),r.element.click(),!0;return!1},focus:!0,blur:!0}})},Jd=(e)=>({disabled:{enable:()=>e.disabled?.enable(),disable:()=>e.disabled?.disable()},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var dg=(e={})=>{let t=Zd(e);try{let n=M(D,B(),O(Qd(t)),se(t),oe(t),Le(t),P())(t),r=document.createElement("div");if(r.className=`${n.getClass("chip")}-content`,r.style.display="flex",r.style.alignItems="center",r.style.gap="8px",r.style.width="100%",n.element.appendChild(r),e.leadingIcon||e.icon){let a=document.createElement("span");a.className=`${n.getClass("chip")}-leading-icon`,a.innerHTML=e.leadingIcon||e.icon||"",r.appendChild(a)}if(e.text){let a=document.createElement("span");a.className=`${n.getClass("chip")}-text`,a.textContent=e.text,r.appendChild(a)}if(e.trailingIcon){let a=document.createElement("span");if(a.className=`${n.getClass("chip")}-trailing-icon`,a.innerHTML=e.trailingIcon,e.onTrailingIconClick)a.addEventListener("click",(o)=>{o.stopPropagation(),e.onTrailingIconClick(n)});r.appendChild(a)}if(e.selected)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");if(e.value)n.element.setAttribute("data-value",e.value);let i=jd(Jd(n))(n);if(!n.element.hasAttribute("data-value")&&e.text)i.getValue();if((e.variant==="filter"||e.variant==="assist"||e.variant==="suggestion"||e.selectable)&&!e.managedSelection)n.element.addEventListener("click",()=>{if(i.isDisabled())return;let a=i.isSelected();i.toggleSelected();let o=i.isSelected();if(e.onChange&&a!==o)e.onChange(o,i);if(e.onSelect)e.onSelect(i)});return i}catch(n){throw console.error("Chip creation error:",n),Error(`Failed to create chip: ${n.message}`)}},on=dg;Z();J();var us=(e)=>(t)=>{let n={scrollable:e.scrollable===!0,vertical:e.vertical===!0};return{...t,layout:{setScrollable(r){if(n.scrollable=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--scrollable`);else t.element.classList.remove(`${t.getClass("chips")}--scrollable`);return this},isScrollable(){return n.scrollable},setVertical(r){if(n.vertical=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--vertical`);else t.element.classList.remove(`${t.getClass("chips")}--vertical`);return this},isVertical(){return n.vertical}}}};var cs=(e)=>(t)=>({...t,chipInstances:[],onCreated(){if(typeof t.onCreated==="function")t.onCreated();if(Array.isArray(e.chips)&&e.chips.length>0)e.chips.forEach((r)=>{this.chips?.addChip?.(r)})}});var ln={CHANGE:"change",ADD:"add",REMOVE:"remove"};var ms=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize chips controller: missing element"),t;let n={change:[],add:[],remove:[]},r=-1,i=(C,...T)=>{if(n[C])n[C].forEach((b)=>b(...T))},s=(C)=>{if(C.isSelected())C.element.classList.add(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","true");else C.element.classList.remove(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","false");if(!e.multiSelect){if(t.chipInstances.forEach((v)=>{if(v!==C&&v.isSelected())v.setSelected(!1),v.element.classList.remove(`${t.getClass("chip")}--selected`),v.element.setAttribute("aria-selected","false")}),!C.isSelected()&&c().length===0)C.setSelected(!0),C.element.classList.add(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","true")}let b=t.chipInstances.filter((v)=>v.isSelected()).map((v)=>v.getValue()),E=C?C.getValue():null;if(typeof e.onChange==="function")e.onChange(b,E);i(ln.CHANGE,b,E)},a=(C)=>{if(t.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(C.key))return;if(C.key==="Enter"||C.key===" "){if(r>=0&&r<t.chipInstances.length){C.preventDefault();let T=t.chipInstances[r];if(!T.isDisabled()){if(T.toggleSelected(),T.isSelected())T.element.classList.add(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","true");else T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false");s(T)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key)){C.preventDefault();let T=t.layout&&t.layout.isVertical(),b=r;if(r===-1)b=0;else if(T&&C.key==="ArrowUp"||!T&&C.key==="ArrowLeft")b=Math.max(0,r-1);else if(T&&C.key==="ArrowDown"||!T&&C.key==="ArrowRight")b=Math.min(t.chipInstances.length-1,r+1);if(b!==r){if(r>=0&&r<t.chipInstances.length)t.chipInstances[r].element.blur();if(r=b,t.chipInstances[r].element.focus(),t.layout&&t.layout.isScrollable())o(r)}}},o=(C)=>{if(!(t.layout&&t.layout.isScrollable()))return;let b=typeof C==="number"?C:t.chipInstances.indexOf(C);if(b>=0&&b<t.chipInstances.length){let E=t.chipInstances[b].element,v=t.chipContainer||t.element,S=v.getBoundingClientRect(),y=E.getBoundingClientRect();if(t.layout&&t.layout.isVertical()){let I=E.offsetTop-v.offsetTop-S.height/2+y.height/2;v.scrollTo({top:Math.max(0,I),behavior:"smooth"})}else{let I=E.offsetLeft-v.offsetLeft-S.width/2+y.width/2;v.scrollTo({left:Math.max(0,I),behavior:"smooth"})}}},l=(C)=>{let T=on({...C,managedSelection:!0,onSelect:C.onSelect}),b=t.chipContainer||t.element,E=document.createDocumentFragment();return E.appendChild(T.element),b.appendChild(E),t.chipInstances.push(T),T.element.addEventListener("click",()=>{if(!T.isDisabled()){if(T.toggleSelected(),T.isSelected())T.element.classList.add(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","true");else T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false");s(T),r=t.chipInstances.indexOf(T)}}),T.element.addEventListener("keydown",a),i(ln.ADD,T),T},d=(C)=>{let T=typeof C==="number"?C:t.chipInstances.indexOf(C);if(T>=0&&T<t.chipInstances.length){let b=t.chipInstances[T];if(i(ln.REMOVE,b),b.destroy(),t.chipInstances.splice(T,1),T===r)r=-1;else if(T<r)r--}},u=()=>[...t.chipInstances],c=()=>t.chipInstances.filter((C)=>C.isSelected()),p=()=>c().map((C)=>C.getValue()),g=(C,T=!0,b=!e.multiSelect)=>{let E=Array.isArray(C)?C:[C],v=!1;if(b)t.chipInstances.forEach((S)=>{let y=S.getValue();if(!E.includes(y)&&S.isSelected())S.setSelected(!1),S.element.classList.remove(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","false"),v=!0});if(t.chipInstances.forEach((S)=>{let y=S.getValue();if(E.includes(y)&&!S.isSelected())S.setSelected(!0),S.element.classList.add(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","true"),v=!0}),v&&T){let S=p();i(ln.CHANGE,S,null)}},f=(C=!0)=>{let b=p().length>0;if(t.chipInstances.forEach((E)=>{E.setSelected(!1),E.element.classList.remove(`${t.getClass("chip")}--selected`),E.element.setAttribute("aria-selected","false")}),b&&C)i(ln.CHANGE,[],null)},m=()=>{t.chipInstances.forEach((C)=>{C.element.addEventListener("keydown",a)})},h=()=>{t.chipInstances.forEach((C)=>{C.element.removeEventListener("keydown",a)})};if(m(),t.element)t.element.addEventListener("keydown",a);if(t.lifecycle){let C=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{t.chipInstances.forEach((T)=>{T.element.removeEventListener("keydown",a)}),t.chipInstances.forEach((T)=>T.destroy()),t.chipInstances.length=0,Object.keys(n).forEach((T)=>{n[T]=[]}),C()}}return{...t,chips:{addChip:l,removeChip:d,getChips:u,getSelectedChips:c,getSelectedValues:p,selectByValue:g,clearSelection:f,scrollToChip:o},keyboard:{enable:m,disable:h},on(C,T){if(!n[C])n[C]=[];return n[C].push(T),this},off(C,T){if(n[C]){let b=n[C].indexOf(T);if(b!==-1)n[C].splice(b,1)}return this}}};Qe();var fs=(e)=>(t)=>{let n=(o)=>t.getClass(o),r=e.label&&e.label.trim().length>0,i=e.labelPosition||"start",s;if(r)s=H({tag:"label",className:n("chips-label"),text:e.label,container:t.element});let a=H({tag:"div",className:n("chips-container"),container:t.element});return{...t,chipContainer:a,label:s,getChipContainer:()=>a,getLabel:()=>s||null}};var eu=(e)=>(t)=>({...t,element:t.element,addChip(n){if(e.chips&&typeof e.chips.addChip==="function")e.chips.addChip(n);return this},removeChip(n){if(e.chips&&typeof e.chips.removeChip==="function")e.chips.removeChip(n);return this},getChips(){if(e.chips&&typeof e.chips.getChips==="function")return e.chips.getChips();return[]},getSelectedChips(){if(e.chips&&typeof e.chips.getSelectedChips==="function")return e.chips.getSelectedChips();return[]},getSelectedValues(){if(e.chips&&typeof e.chips.getSelectedValues==="function")return e.chips.getSelectedValues();return[]},getValue(){if(e.chips&&typeof e.chips.getSelectedValues==="function"){let n=e.chips.getSelectedValues();if(!e.config?.multiSelect)return n.length>0?n[0]:null;return n}return e.config?.multiSelect?[]:null},setValue(n){if(e.chips&&typeof e.chips.selectByValue==="function"){if(e.chips.clearSelection)e.chips.clearSelection();let r=[];if(n){if(Array.isArray(n))r=n.filter((i)=>i!=null&&i!=="");else if(typeof n==="string"&&n!=="")r=[n]}if(r.length>0)e.chips.selectByValue(r,!1)}return this},selectByValue(n,r=!0){if(e.chips&&typeof e.chips.selectByValue==="function")e.chips.selectByValue(n,r);return this},clearSelection(){if(e.chips&&typeof e.chips.clearSelection==="function")e.chips.clearSelection();return this},setScrollable(n){if(e.layout&&typeof e.layout.setScrollable==="function")e.layout.setScrollable(n);return this},setVertical(n){if(e.layout&&typeof e.layout.setVertical==="function")e.layout.setVertical(n);return this},setLabel(n){if(e.label&&typeof e.label.setText==="function")e.label.setText(n);return this},getLabel(){if(e.label&&typeof e.label.getText==="function")return e.label.getText();return""},setLabelPosition(n){if(e.label&&typeof e.label.setPosition==="function")e.label.setPosition(n);return this},getLabelPosition(){if(e.label&&typeof e.label.getPosition==="function")return e.label.getPosition();return"start"},scrollToChip(n){if(e.chips&&typeof e.chips.scrollToChip==="function")e.chips.scrollToChip(n);return this},enableKeyboardNavigation(){if(e.keyboard&&typeof e.keyboard.enableKeyboardNavigation==="function")e.keyboard.enableKeyboardNavigation();return this},on(n,r){if(e.events&&typeof e.events.on==="function")e.events.on(n,r);return this},off(n,r){if(e.events&&typeof e.events.off==="function")e.events.off(n,r);return this},destroy(){if(e.lifecycle&&typeof e.lifecycle.destroy==="function")e.lifecycle.destroy()}});Q();var cg={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},tu=(e={})=>_(cg,e,"chips"),nu=(e)=>{let t=e.scrollable===!0,n=e.vertical===!0,r=e.multiSelect===!0,i=e.label&&e.label.trim().length>0,s=e.labelPosition||"start",a=["chips",e.class,t?"chips--scrollable":"",n?"chips--vertical":"",i?"chips--with-label":"",i&&s==="end"?"chips--label-end":""].filter(Boolean).join(" ");return V(e,{tag:"div",attributes:{role:"group","aria-multiselectable":r?"true":"false"},className:a})},ru=(e,t)=>({config:{multiSelect:t?.multiSelect??!1},chips:{addChip:function(n){if(e.chips&&typeof e.chips.addChip==="function")return e.chips.addChip(n);return null},removeChip:(n)=>e.chips?.removeChip?.(n),getChips:()=>e.chips?.getChips?.()??[],getSelectedChips:()=>e.chips?.getSelectedChips?.()??[],getSelectedValues:()=>e.chips?.getSelectedValues?.()??[],selectByValue:(n)=>e.chips?.selectByValue?.(n),clearSelection:()=>e.chips?.clearSelection?.(),scrollToChip:(n)=>e.chips?.scrollToChip?.(n)},layout:{setScrollable:(n)=>e.layout?.setScrollable?.(n),isScrollable:()=>e.layout?.isScrollable?.()??!1,setVertical:(n)=>e.layout?.setVertical?.(n),isVertical:()=>e.layout?.isVertical?.()??!1},label:{setText:(n)=>e.label?.setText?.(n),getText:()=>e.label?.getText?.()??"",setPosition:(n)=>e.label?.setPosition?.(n),getPosition:()=>e.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>e.keyboard?.enable?.(),disableKeyboardNavigation:()=>e.keyboard?.disable?.()},events:{on:(n,r)=>e.on?.(n,r),off:(n,r)=>e.off?.(n,r)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var mg=(e={})=>{let t=tu(e);try{let n=M(D,B(),O(nu(t)),us(t),cs(t),fs(t),ms(t),P())(t),r=ru(n,t),i=eu(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});if(Array.isArray(t.chips)&&t.chips.length>0)t.chips.forEach((s)=>{i.addChip(s)});return i}catch(n){throw console.error("Chips creation error:",n),Error(`Failed to create chip: ${n.message}`)}},ps=mg;rt();ne();Z();J();var iu=["S","M","T","W","T","F","S"],Yr=["January","February","March","April","May","June","July","August","September","October","November","December"],Xr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],su="MM/DD/YYYY",au="today",qr="selected",ou="outside-month",lu="range-start",du="range-end",uu="range-middle";var $e=(e)=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if(typeof e==="string"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null},Nt=(e,t="MM/DD/YYYY")=>{if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";let n="",r=0;while(r<t.length)if(t.substring(r,r+4)==="MMMM")n+=Yr[e.getMonth()],r+=4;else if(t.substring(r,r+3)==="MMM")n+=Xr[e.getMonth()],r+=3;else if(t.substring(r,r+2)==="MM")n+=(e.getMonth()+1).toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="M")n+=e.getMonth()+1,r+=1;else if(t.substring(r,r+4)==="YYYY")n+=e.getFullYear(),r+=4;else if(t.substring(r,r+2)==="YY")n+=e.getFullYear().toString().slice(-2),r+=2;else if(t.substring(r,r+2)==="DD")n+=e.getDate().toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="D")n+=e.getDate(),r+=1;else n+=t[r],r+=1;return n},cu=(e,t)=>new Date(e,t+1,0).getDate(),fg=(e,t)=>new Date(e,t,1).getDay(),At=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),pg=(e,t,n)=>{let r=e.getTime();return r>=t.getTime()&&r<=n.getTime()},mu=(e,t,n=null,r=null,i=null,s=null)=>{let a=new Date;a.setHours(0,0,0,0);let o=[],l=fg(e,t),d=cu(e,t-1);for(let g=l-1;g>=0;g--){let f=new Date(e,t-1,d-g),m=i&&f<i||s&&f>s;o.push({date:f,day:f.getDate(),isCurrentMonth:!1,isToday:At(f,a),isSelected:n?At(f,n):!1,isDisabled:m})}let u=cu(e,t);for(let g=1;g<=u;g++){let f=new Date(e,t,g),m=n?At(f,n):!1,h=i&&f<i||s&&f>s,C={date:f,day:g,isCurrentMonth:!0,isToday:At(f,a),isSelected:m,isDisabled:h};if(n&&r)C.isRangeStart=At(f,n),C.isRangeEnd=At(f,r),C.isRangeMiddle=pg(f,n,r)&&!C.isRangeStart&&!C.isRangeEnd;o.push(C)}let p=42-o.length;for(let g=1;g<=p;g++){let f=new Date(e,t+1,g),m=i&&f<i||s&&f>s;o.push({date:f,day:g,isCurrentMonth:!1,isToday:At(f,a),isSelected:n?At(f,n):!1,isDisabled:m})}return o},fu=(e,t=10)=>{let n=[],r=e-t,i=e+t;for(let s=r;s<=i;s++)n.push(s);return n};var gs=(e,t)=>{let n=new Date(e);return n.setMonth(n.getMonth()+t),n};var pu=(e,{disabled:t,lifecycle:n,events:r})=>(i)=>{let s={goToDate(a){let o=$e(a);if(!o)return;e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar()},nextMonth(){let a=gs(new Date(e.currentYear,e.currentMonth,1),1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},prevMonth(){let a=gs(new Date(e.currentYear,e.currentMonth,1),-1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},nextYear(){e.currentYear+=1,e.updateCalendar()},prevYear(){e.currentYear-=1,e.updateCalendar()},showDayView(){e.currentView="day",e.updateCalendar()},showMonthView(){e.currentView="month",e.updateCalendar()},showYearView(){e.currentView="year",e.updateCalendar()},getCurrentView(){return e.currentView}};return{...i,element:i.element,input:e.input,calendar:s,open(){return e.isOpen=!0,e.render(),r.emit("open",{value:this.getValue()}),this},close(){return e.isOpen=!1,e.render(),r.emit("close",{value:this.getValue()}),this},getValue(){if(!e.selectedDate)return null;if(e.selectionMode==="range"&&e.rangeEndDate)return[new Date(e.selectedDate),new Date(e.rangeEndDate)];return new Date(e.selectedDate)},setValue(a){if(Array.isArray(a)&&e.selectionMode==="range"){let l=$e(a[0]),d=$e(a[1]);if(l&&d){if(e.selectedDate=l,e.rangeEndDate=d,l>d)e.selectedDate=d,e.rangeEndDate=l;if(e.updateInputValue(),e.isOpen)e.currentMonth=e.selectedDate.getMonth(),e.currentYear=e.selectedDate.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let o=$e(a);if(o){if(e.selectedDate=o,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!e.selectedDate)return"";if(e.selectionMode==="range"&&e.rangeEndDate){let a=Nt(e.selectedDate,e.dateFormat),o=Nt(e.rangeEndDate,e.dateFormat);return`${a} - ${o}`}return Nt(e.selectedDate,e.dateFormat)},clear(){if(e.selectedDate=null,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.updateCalendar();return r.emit("change",{value:null,formattedValue:""}),this},enable(){return t.enable(),e.input.disabled=!1,this},disable(){return t.disable(),e.input.disabled=!0,this},setMinDate(a){let o=$e(a);if(o){if(e.minDate=o,e.isOpen)e.updateCalendar()}return this},setMaxDate(a){let o=$e(a);if(o){if(e.maxDate=o,e.isOpen)e.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",e.outsideClickHandler),e.calendarElement&&e.calendarElement.parentNode)e.calendarElement.parentNode.removeChild(e.calendarElement);n.destroy()},on(a,o){return r.on(a,o),this},off(a,o){return r.off(a,o),this}}};Q();var gg={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:su,animate:!0},gu=(e={})=>{let t=_(gg,e,"datepicker");if(t.closeOnSelect===void 0)t.closeOnSelect=t.variant!=="docked";return t},hu=(e)=>V(e,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${e.prefix}-datepicker-container`,e.class],forwardEvents:{keydown:!0,click:!0},interactive:!0}),Cu=(e)=>{let t={type:"text",placeholder:e.placeholder||e.dateFormat,autocomplete:"off",readonly:!0};if(e.disabled===!0)t.disabled=!0;return V(e,{tag:"input",attributes:t,className:`${e.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},Eu=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant!=="docked"?"true":"false"},className:[`${e.prefix}-datepicker-calendar`,`${e.prefix}-datepicker-${e.variant}`,e.selectionMode==="range"?`${e.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}}),bu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},events:{on:e.on,off:e.off,emit:e.emit}});Qe();var hg=({currentMonth:e,currentYear:t,currentView:n,prefix:r,emit:i})=>{let s=H({tag:"div",className:`${r}-datepicker-header`}),a=H({tag:"button",className:`${r}-datepicker-month-selector`,text:Yr[e],attributes:{type:"button","aria-label":"Select month"}}),o=H({tag:"button",className:`${r}-datepicker-year-selector`,text:t.toString(),attributes:{type:"button","aria-label":"Select year"}}),l=H({tag:"div",className:`${r}-datepicker-nav-controls`}),d=H({tag:"button",className:`${r}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":n==="day"?"Previous month":n==="month"?"Previous year":"Previous year range"}}),u=H({tag:"button",className:`${r}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":n==="day"?"Next month":n==="month"?"Next year":"Next year range"}});return a.addEventListener("click",(c)=>{c.stopPropagation(),i("viewChange",{view:"month"})}),o.addEventListener("click",(c)=>{c.stopPropagation(),i("viewChange",{view:"year"})}),d.addEventListener("click",(c)=>{if(c.stopPropagation(),n==="day")i("prevMonth");else if(n==="month")i("prevYear");else i("prevYearRange")}),u.addEventListener("click",(c)=>{if(c.stopPropagation(),n==="day")i("nextMonth");else if(n==="month")i("nextYear");else i("nextYearRange")}),s.appendChild(a),s.appendChild(o),l.appendChild(d),l.appendChild(u),s.appendChild(l),s},Cg=(e)=>{let t=H({tag:"div",className:`${e}-datepicker-weekdays`});return iu.forEach((n)=>{let r=H({tag:"span",className:`${e}-datepicker-weekday`,text:n});t.appendChild(r)}),t},Eg=({currentYear:e,currentMonth:t,selectedDate:n,rangeEndDate:r,minDate:i,maxDate:s,prefix:a,emit:o})=>{let l=H({tag:"div",className:`${a}-datepicker-days`});return mu(e,t,n,r,i,s).forEach((u)=>{let c=[`${a}-datepicker-day`,u.isCurrentMonth?"":ou,u.isToday?au:"",u.isSelected?qr:"",u.isDisabled?"disabled":"",u.isRangeStart?lu:"",u.isRangeEnd?du:"",u.isRangeMiddle?uu:""].filter(Boolean).join(" "),p=H({tag:"button",className:c,text:u.day.toString(),attributes:{type:"button","aria-label":u.date.toLocaleDateString(),"aria-selected":u.isSelected?"true":"false","aria-disabled":u.isDisabled?"true":"false","data-date":u.date.toISOString(),disabled:u.isDisabled}});p.addEventListener("click",(g)=>{if(g.stopPropagation(),!u.isDisabled)o("dateSelected",{date:u.date})}),l.appendChild(p)}),l},bg=({currentMonth:e,prefix:t,emit:n})=>{let r=H({tag:"div",className:`${t}-datepicker-months`});return Xr.forEach((i,s)=>{let a=s===e,o=H({tag:"button",className:`${t}-datepicker-month ${a?qr:""}`,text:i,attributes:{type:"button","aria-selected":a?"true":"false","data-month":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("monthSelected",{month:s})}),r.appendChild(o)}),r},vg=({currentYear:e,prefix:t,emit:n})=>{let r=H({tag:"div",className:`${t}-datepicker-years`});return fu(e,10).forEach((s)=>{let a=s===e,o=H({tag:"button",className:`${t}-datepicker-year ${a?qr:""}`,text:s.toString(),attributes:{type:"button","aria-selected":a?"true":"false","data-year":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("yearSelected",{year:s})}),r.appendChild(o)}),r},Tg=({prefix:e,emit:t})=>{let n=H({tag:"div",className:`${e}-datepicker-footer`}),r=H({tag:"button",className:`${e}-datepicker-cancel ${e}-button ${e}-button--text`,text:"Cancel",attributes:{type:"button"}}),i=H({tag:"button",className:`${e}-datepicker-ok ${e}-button ${e}-button--text`,text:"OK",attributes:{type:"button"}});return r.addEventListener("click",(s)=>{s.stopPropagation(),t("cancel")}),i.addEventListener("click",(s)=>{s.stopPropagation(),t("confirm")}),n.appendChild(r),n.appendChild(i),n},vu=(e,t)=>{let{prefix:n,currentView:r,currentMonth:i,currentYear:s,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,variant:u}=e,c=H({tag:"div",className:`${n}-datepicker-calendar-content`}),p=hg({currentMonth:i,currentYear:s,currentView:r,prefix:n,emit:t});if(c.appendChild(p),r==="day"){let g=Cg(n);c.appendChild(g);let f=Eg({currentYear:s,currentMonth:i,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,prefix:n,emit:t});c.appendChild(f)}else if(r==="month"){let g=bg({currentMonth:i,prefix:n,emit:t});c.appendChild(g)}else if(r==="year"){let g=vg({currentYear:s,prefix:n,emit:t});c.appendChild(g)}if(u!=="docked"){let g=Tg({prefix:n,emit:t});c.appendChild(g)}return c};Qe();var Sg=(e={})=>{let t=gu(e);try{let n={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:t.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:t.minDate?$e(t.minDate):null,maxDate:t.maxDate?$e(t.maxDate):null,dateFormat:t.dateFormat,variant:t.variant,selectionMode:t.selectionMode,closeOnSelect:t.closeOnSelect,prefix:t.prefix||Y,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let a=Nt(this.selectedDate,this.dateFormat),o=Nt(this.rangeEndDate,this.dateFormat);this.input.value=`${a} - ${o}`;return}this.input.value=Nt(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let a=vu(this,(o,l)=>{switch(o){case"dateSelected":this.handleDateSelection(l.date);break;case"monthSelected":this.currentMonth=l.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=l.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=l.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(a)},handleDateSelection(a){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=a,this.rangeEndDate=null;else{if(a<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=a;else this.rangeEndDate=a;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=a,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),r.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if(t.value)if(Array.isArray(t.value)&&t.selectionMode==="range"){let a=$e(t.value[0]),o=$e(t.value[1]);if(a&&o)n.selectedDate=a,n.rangeEndDate=o,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}else{let a=$e(t.value);if(a)n.selectedDate=a,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}let r=M(D,B(),O(hu(t)),oe(t),P())(t),i=M(D,O(Cu(t)))(t);n.input=i.element,r.element.appendChild(n.input),n.updateInputValue();let s=Eu(t);return n.calendarElement=H({tag:"div",className:s.className,attributes:s.attributes}),n.calendarElement.style.display="none",r.element.appendChild(n.calendarElement),n.input.addEventListener("click",()=>{if(!r.element.classList.contains("disabled"))if(n.isOpen=!n.isOpen,n.render(),n.isOpen)r.emit("open",{value:n.selectedDate});else r.emit("close",{value:n.selectedDate})}),n.calendarElement.addEventListener("click",(a)=>{a.stopPropagation()}),document.addEventListener("click",(a)=>{if(n.isOpen&&!r.element.contains(a.target))n.isOpen=!1,n.render(),r.emit("close",{value:n.selectedDate})}),pu(n,bu(r))(r)}catch(n){throw console.error("DatePicker creation error:",n),Error(`Failed to create DatePicker: ${n.message}`)}},hs=Sg;ne();Z();J();Q();var xg={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},Tu=(e={})=>_(xg,e,"dialog"),Su=(e)=>{let n={role:e.role||(e.size==="fullscreen"?"dialog":"alertdialog"),tabindex:-1};if(e.modal!==!1)n["aria-modal"]="true";return V(e,{tag:"div",attributes:n,className:e.class})},yu=(e)=>({tag:"div",attributes:{},className:""}),xu=(e)=>({visibility:{open:()=>e.visibility.open(),close:()=>e.visibility.close(),toggle:(t)=>e.visibility.toggle(t),isOpen:()=>e.visibility.isOpen()},content:{setTitle:(t)=>e.content.setTitle(t),getTitle:()=>e.content.getTitle(),setSubtitle:(t)=>e.content.setSubtitle(t),getSubtitle:()=>e.content.getSubtitle(),setContent:(t)=>e.content.setContent(t),getContent:()=>e.content.getContent(),getHeaderElement:()=>e.content.getHeaderElement(),getContentElement:()=>e.content.getContentElement(),getFooterElement:()=>e.content.getFooterElement()},buttons:{addButton:(t)=>e.buttons.addButton(t),removeButton:(t)=>e.buttons.removeButton(t),getButtons:()=>e.buttons.getButtons(),setFooterAlignment:(t)=>e.buttons.setFooterAlignment(t)},focus:{trapFocus:()=>e.focus.trapFocus(),releaseFocus:()=>e.focus.releaseFocus()},size:{setSize:(t)=>e.size.setSize(t)},divider:{toggleDivider:(t)=>e.divider.toggleDivider(t),hasDivider:()=>e.divider.hasDivider()},events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),trigger:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});pt();ne();Q();var Ig={orientation:"horizontal",variant:"full-width",thickness:1},Iu=(e={})=>_(Ig,e,"divider");var Lu=(e)=>(t)=>{let n=e.orientation||"horizontal";t.element.classList.add(`${t.getClass("divider")}--${n}`);let r=e.thickness||1;if(n==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%";else t.element.style.width=`${r}px`,t.element.style.height="100%";return{...t,getOrientation(){return n},setOrientation(i){if(t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`),i==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%",t.element.style.marginTop="",t.element.style.marginBottom="";else t.element.style.width=`${r}px`,t.element.style.height="100%",t.element.style.marginLeft="",t.element.style.marginRight="";return this}}},Au=(e)=>(t)=>{let n=e.variant||"full-width",r=e.orientation||"horizontal";if(n==="inset"||n==="middle-inset")if(r==="horizontal"){let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginLeft=`${i}px`,t.element.style.marginRight=`${s}px`}else{let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginTop=`${i}px`,t.element.style.marginBottom=`${s}px`}return{...t,getVariant(){return n},setVariant(i){t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`);let s=t.getOrientation?t.getOrientation():r;if(i==="full-width")if(s==="horizontal")t.element.style.marginLeft="",t.element.style.marginRight="";else t.element.style.marginTop="",t.element.style.marginBottom="";else{let a=e.insetStart!==void 0?e.insetStart:16,o=e.insetEnd!==void 0?e.insetEnd:i==="middle-inset"?16:0;if(s==="horizontal")t.element.style.marginLeft=`${a}px`,t.element.style.marginRight=`${o}px`;else t.element.style.marginTop=`${a}px`,t.element.style.marginBottom=`${o}px`}return this},setInset(i,s){let a=t.getOrientation?t.getOrientation():r;if((t.getVariant?t.getVariant():n)!=="full-width")if(a==="horizontal"){if(i!==void 0)t.element.style.marginLeft=`${i}px`;if(s!==void 0)t.element.style.marginRight=`${s}px`}else{if(i!==void 0)t.element.style.marginTop=`${i}px`;if(s!==void 0)t.element.style.marginBottom=`${s}px`}return this}}},Nu=(e)=>(t)=>{if(e.color)t.element.style.backgroundColor=e.color;let n=e.thickness||1,r=e.orientation||"horizontal";if(r==="horizontal")t.element.style.height=`${n}px`;else t.element.style.width=`${n}px`;return{...t,setThickness(i){if((t.getOrientation?t.getOrientation():r)==="horizontal")t.element.style.height=`${i}px`;else t.element.style.width=`${i}px`;return this},setColor(i){return t.element.style.backgroundColor=i,this}}};var Vt=(e={})=>{let t=Iu(e);return M(D,O({tag:"hr",componentName:"divider",className:e.class}),Lu(t),se(t),Au(t),Nu(t))(t)};Rn();var dn={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},Lg=0,wu=(e)=>(t)=>{let n=`${t.getClass("dialog")}-${++Lg}`,r=`${n}-title`,i=`${n}-content`,s=yu(e),a=document.createElement(s.tag||"div");if(a.classList.add(t.getClass("dialog-overlay")),s.attributes&&typeof s.attributes==="object")Object.entries(s.attributes).forEach(([E,v])=>{if(E&&typeof E==="string"&&v!==void 0)a.setAttribute(E,String(v))});if(e.zIndex)a.style.zIndex=String(e.zIndex);let o=e.closeButton??e.size==="fullscreen",l=()=>{let E=document.createElement("div");E.classList.add(t.getClass("dialog-header"));let v=document.createElement("div");if(v.classList.add(t.getClass("dialog-header-content")),E.appendChild(v),e.title){let S=document.createElement("h2");S.classList.add(t.getClass("dialog-header-title")),S.id=r,S.textContent=e.title,v.appendChild(S)}if(e.subtitle){let S=document.createElement("p");S.classList.add(t.getClass("dialog-header-subtitle")),S.textContent=e.subtitle,v.appendChild(S)}if(o){let S=document.createElement("button");S.classList.add(t.getClass("dialog-header-close")),S.setAttribute("aria-label","Close dialog"),S.innerHTML=`
13
+ `,t.element.appendChild(n),t},Xd=(e)=>(t)=>{let n=e.labelPosition||"end",r=`${e.prefix}-checkbox--label-${n}`;return t.element.classList.add(r),t},qd=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var ag=(e,t)=>{let n=Ht(t)(e);if(t.indeterminate)n.input.indeterminate=!0;return n.setIndeterminate=(r)=>(n.input.indeterminate=r,n.element.classList.toggle(`${t.prefix}-checkbox--indeterminate`,r),n),n},og=(e={})=>{let t=Wd(e);try{return O(M,B(),R(Kd(t)),Bt(t),Yd(t),et(t),Xd(t),(r)=>ag(r,t),oe(t),k(),(r)=>zd(qd(r))(r))(t)}catch(n){throw console.error("Checkbox creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create checkbox: ${n instanceof Error?n.message:String(n)}`)}},ds=og;ne();Z();J();var jd=({disabled:e,lifecycle:t})=>(n)=>{let r=n.element.classList.contains(`${n.getClass("chip")}--selected`),i=n.element.getAttribute("data-value")||null,s=["filled","outlined","elevated","assist","filter","input","suggestion"],a=null;for(let o of s)if(n.element.classList.contains(`${n.getClass("chip")}--${o}`)){a=o;break}return{...n,element:n.element,getValue(){let o=n.element.getAttribute("data-value");if(o!==null)return i=o,o;if(i!==null)return n.element.setAttribute("data-value",i),i;let l=n.element.querySelector(`.${n.getClass("chip")}-text`);if(l&&l.textContent){let d=l.textContent;if(d.includes(" Theme"))i=d.replace(" Theme","").toLowerCase();else i=d.toLowerCase().replace(/\s+/g,"-");return n.element.setAttribute("data-value",i),i}return null},setValue(o){if(o!==null&&o!==void 0)i=o,n.element.setAttribute("data-value",o);else i=null,n.element.removeAttribute("data-value");return this},isDisabled(){return n.element.getAttribute("aria-disabled")==="true"},enable(){return e.enable(),n.element.classList.remove(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","false"),n.element.setAttribute("tabindex","0"),this},disable(){return e.disable(),n.element.classList.add(`${n.getClass("chip")}--disabled`),n.element.setAttribute("aria-disabled","true"),n.element.setAttribute("tabindex","-1"),this},setText(o){let l=`.${n.getClass("chip")}-content`,d=n.element.querySelector(l)||n.element,u=`.${n.getClass("chip")}-text`,m=n.element.querySelector(u);if(!m&&o){m=document.createElement("span"),m.className=`${n.getClass("chip")}-text`;let p=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);if(p)d.insertBefore(m,p.nextSibling);else d.insertBefore(m,d.firstChild)}if(m){if(m.textContent=o||"",!o&&m.parentNode)m.parentNode.removeChild(m)}return this},getText(){let o=n.element.querySelector(`.${n.getClass("chip")}-text`);return o?o.textContent||"":""},setIcon(o){return this.setLeadingIcon(o)},getIcon(){let o=n.element.querySelector(`.${n.getClass("chip")}-leading-icon`);return o?o.innerHTML:""},setLeadingIcon(o){let l=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,d=`.${n.getClass("chip")}-leading-icon`,u=n.element.querySelector(d);if(!u&&o)u=document.createElement("span"),u.className=`${n.getClass("chip")}-leading-icon`,l.insertBefore(u,l.firstChild);if(u){if(u.innerHTML=o||"",!o&&u.parentNode)u.parentNode.removeChild(u)}return this},setTrailingIcon(o,l){let d=n.element.querySelector(`.${n.getClass("chip")}-content`)||n.element,u=`.${n.getClass("chip")}-trailing-icon`,m=n.element.querySelector(u);if(!m&&o){if(m=document.createElement("span"),m.className=`${n.getClass("chip")}-trailing-icon`,d.appendChild(m),l)m.addEventListener("click",(p)=>{p.stopPropagation(),l(this)})}if(m){if(m.innerHTML=o||"",!o&&m.parentNode)m.parentNode.removeChild(m)}return this},isSelected(){return r},setSelected(o){if(r=!!o,o)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");else n.element.classList.remove(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!r)},getVariant(){return a},setVariant(o){if(a)n.element.classList.remove(`${n.getClass("chip")}--${a}`);if(o)n.element.classList.add(`${n.getClass("chip")}--${o}`);return a=o,this},destroy(){t.destroy()}}};Q();var lg={variant:"filled",ripple:!0},Zd=(e={})=>P(lg,e,"chip"),Qd=(e)=>{let t={role:"button",tabindex:"0"};if(e.disabled===!0)t["aria-disabled"]="true";if(e.selected===!0)t["aria-selected"]="true";else if(e.selected===!1)t["aria-selected"]="false";let n=[e.class,e.selected?`${e.prefix}-chip--selected`:null];return V(e,{tag:"div",attributes:t,className:n,forwardEvents:{click:(r)=>r.element.getAttribute("aria-disabled")!=="true",keydown:(r,i)=>{if(i.key===" "||i.key==="Enter")return i.preventDefault(),r.element.click(),!0;return!1},focus:!0,blur:!0}})},Jd=(e)=>({disabled:{enable:()=>e.disabled?.enable(),disable:()=>e.disabled?.disable()},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var dg=(e={})=>{let t=Zd(e);try{let n=O(M,B(),R(Qd(t)),se(t),oe(t),Le(t),k())(t),r=document.createElement("div");if(r.className=`${n.getClass("chip")}-content`,r.style.display="flex",r.style.alignItems="center",r.style.gap="8px",r.style.width="100%",n.element.appendChild(r),e.leadingIcon||e.icon){let a=document.createElement("span");a.className=`${n.getClass("chip")}-leading-icon`,a.innerHTML=e.leadingIcon||e.icon||"",r.appendChild(a)}if(e.text){let a=document.createElement("span");a.className=`${n.getClass("chip")}-text`,a.textContent=e.text,r.appendChild(a)}if(e.trailingIcon){let a=document.createElement("span");if(a.className=`${n.getClass("chip")}-trailing-icon`,a.innerHTML=e.trailingIcon,e.onTrailingIconClick)a.addEventListener("click",(o)=>{o.stopPropagation(),e.onTrailingIconClick(n)});r.appendChild(a)}if(e.selected)n.element.classList.add(`${n.getClass("chip")}--selected`),n.element.setAttribute("aria-selected","true");if(e.value)n.element.setAttribute("data-value",e.value);let i=jd(Jd(n))(n);if(!n.element.hasAttribute("data-value")&&e.text)i.getValue();if((e.variant==="filter"||e.variant==="assist"||e.variant==="suggestion"||e.selectable)&&!e.managedSelection)n.element.addEventListener("click",()=>{if(i.isDisabled())return;let a=i.isSelected();i.toggleSelected();let o=i.isSelected();if(e.onChange&&a!==o)e.onChange(o,i);if(e.onSelect)e.onSelect(i)});return i}catch(n){throw console.error("Chip creation error:",n),Error(`Failed to create chip: ${n.message}`)}},on=dg;Z();J();var us=(e)=>(t)=>{let n={scrollable:e.scrollable===!0,vertical:e.vertical===!0};return{...t,layout:{setScrollable(r){if(n.scrollable=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--scrollable`);else t.element.classList.remove(`${t.getClass("chips")}--scrollable`);return this},isScrollable(){return n.scrollable},setVertical(r){if(n.vertical=r,t.element)if(r)t.element.classList.add(`${t.getClass("chips")}--vertical`);else t.element.classList.remove(`${t.getClass("chips")}--vertical`);return this},isVertical(){return n.vertical}}}};var cs=(e)=>(t)=>({...t,chipInstances:[],onCreated(){if(typeof t.onCreated==="function")t.onCreated();if(Array.isArray(e.chips)&&e.chips.length>0)e.chips.forEach((r)=>{this.chips?.addChip?.(r)})}});var ln={CHANGE:"change",ADD:"add",REMOVE:"remove"};var ms=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize chips controller: missing element"),t;let n={change:[],add:[],remove:[]},r=-1,i=(C,...T)=>{if(n[C])n[C].forEach((b)=>b(...T))},s=(C)=>{if(C.isSelected())C.element.classList.add(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","true");else C.element.classList.remove(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","false");if(!e.multiSelect){if(t.chipInstances.forEach((v)=>{if(v!==C&&v.isSelected())v.setSelected(!1),v.element.classList.remove(`${t.getClass("chip")}--selected`),v.element.setAttribute("aria-selected","false")}),!C.isSelected()&&m().length===0)C.setSelected(!0),C.element.classList.add(`${t.getClass("chip")}--selected`),C.element.setAttribute("aria-selected","true")}let b=t.chipInstances.filter((v)=>v.isSelected()).map((v)=>v.getValue()),E=C?C.getValue():null;if(typeof e.onChange==="function")e.onChange(b,E);i(ln.CHANGE,b,E)},a=(C)=>{if(t.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(C.key))return;if(C.key==="Enter"||C.key===" "){if(r>=0&&r<t.chipInstances.length){C.preventDefault();let T=t.chipInstances[r];if(!T.isDisabled()){if(T.toggleSelected(),T.isSelected())T.element.classList.add(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","true");else T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false");s(T)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(C.key)){C.preventDefault();let T=t.layout&&t.layout.isVertical(),b=r;if(r===-1)b=0;else if(T&&C.key==="ArrowUp"||!T&&C.key==="ArrowLeft")b=Math.max(0,r-1);else if(T&&C.key==="ArrowDown"||!T&&C.key==="ArrowRight")b=Math.min(t.chipInstances.length-1,r+1);if(b!==r){if(r>=0&&r<t.chipInstances.length)t.chipInstances[r].element.blur();if(r=b,t.chipInstances[r].element.focus(),t.layout&&t.layout.isScrollable())o(r)}}},o=(C)=>{if(!(t.layout&&t.layout.isScrollable()))return;let b=typeof C==="number"?C:t.chipInstances.indexOf(C);if(b>=0&&b<t.chipInstances.length){let E=t.chipInstances[b].element,v=t.chipContainer||t.element,S=v.getBoundingClientRect(),y=E.getBoundingClientRect();if(t.layout&&t.layout.isVertical()){let I=E.offsetTop-v.offsetTop-S.height/2+y.height/2;v.scrollTo({top:Math.max(0,I),behavior:"smooth"})}else{let I=E.offsetLeft-v.offsetLeft-S.width/2+y.width/2;v.scrollTo({left:Math.max(0,I),behavior:"smooth"})}}},l=(C)=>{let T=on({...C,managedSelection:!0,onSelect:C.onSelect}),b=t.chipContainer||t.element,E=document.createDocumentFragment();return E.appendChild(T.element),b.appendChild(E),t.chipInstances.push(T),T.element.addEventListener("click",()=>{if(!T.isDisabled()){if(T.toggleSelected(),T.isSelected())T.element.classList.add(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","true");else T.element.classList.remove(`${t.getClass("chip")}--selected`),T.element.setAttribute("aria-selected","false");s(T),r=t.chipInstances.indexOf(T)}}),T.element.addEventListener("keydown",a),i(ln.ADD,T),T},d=(C)=>{let T=typeof C==="number"?C:t.chipInstances.indexOf(C);if(T>=0&&T<t.chipInstances.length){let b=t.chipInstances[T];if(i(ln.REMOVE,b),b.destroy(),t.chipInstances.splice(T,1),T===r)r=-1;else if(T<r)r--}},u=()=>[...t.chipInstances],m=()=>t.chipInstances.filter((C)=>C.isSelected()),p=()=>m().map((C)=>C.getValue()),g=(C,T=!0,b=!e.multiSelect)=>{let E=Array.isArray(C)?C:[C],v=!1;if(b)t.chipInstances.forEach((S)=>{let y=S.getValue();if(!E.includes(y)&&S.isSelected())S.setSelected(!1),S.element.classList.remove(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","false"),v=!0});if(t.chipInstances.forEach((S)=>{let y=S.getValue();if(E.includes(y)&&!S.isSelected())S.setSelected(!0),S.element.classList.add(`${t.getClass("chip")}--selected`),S.element.setAttribute("aria-selected","true"),v=!0}),v&&T){let S=p();i(ln.CHANGE,S,null)}},c=(C=!0)=>{let b=p().length>0;if(t.chipInstances.forEach((E)=>{E.setSelected(!1),E.element.classList.remove(`${t.getClass("chip")}--selected`),E.element.setAttribute("aria-selected","false")}),b&&C)i(ln.CHANGE,[],null)},f=()=>{t.chipInstances.forEach((C)=>{C.element.addEventListener("keydown",a)})},h=()=>{t.chipInstances.forEach((C)=>{C.element.removeEventListener("keydown",a)})};if(f(),t.element)t.element.addEventListener("keydown",a);if(t.lifecycle){let C=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{t.chipInstances.forEach((T)=>{T.element.removeEventListener("keydown",a)}),t.chipInstances.forEach((T)=>T.destroy()),t.chipInstances.length=0,Object.keys(n).forEach((T)=>{n[T]=[]}),C()}}return{...t,chips:{addChip:l,removeChip:d,getChips:u,getSelectedChips:m,getSelectedValues:p,selectByValue:g,clearSelection:c,scrollToChip:o},keyboard:{enable:f,disable:h},on(C,T){if(!n[C])n[C]=[];return n[C].push(T),this},off(C,T){if(n[C]){let b=n[C].indexOf(T);if(b!==-1)n[C].splice(b,1)}return this}}};Qe();var fs=(e)=>(t)=>{let n=(o)=>t.getClass(o),r=e.label&&e.label.trim().length>0,i=e.labelPosition||"start",s;if(r)s=H({tag:"label",className:n("chips-label"),text:e.label,container:t.element});let a=H({tag:"div",className:n("chips-container"),container:t.element});return{...t,chipContainer:a,label:s,getChipContainer:()=>a,getLabel:()=>s||null}};var eu=(e)=>(t)=>({...t,element:t.element,addChip(n){if(e.chips&&typeof e.chips.addChip==="function")e.chips.addChip(n);return this},removeChip(n){if(e.chips&&typeof e.chips.removeChip==="function")e.chips.removeChip(n);return this},getChips(){if(e.chips&&typeof e.chips.getChips==="function")return e.chips.getChips();return[]},getSelectedChips(){if(e.chips&&typeof e.chips.getSelectedChips==="function")return e.chips.getSelectedChips();return[]},getSelectedValues(){if(e.chips&&typeof e.chips.getSelectedValues==="function")return e.chips.getSelectedValues();return[]},getValue(){if(e.chips&&typeof e.chips.getSelectedValues==="function"){let n=e.chips.getSelectedValues();if(!e.config?.multiSelect)return n.length>0?n[0]:null;return n}return e.config?.multiSelect?[]:null},setValue(n){if(e.chips&&typeof e.chips.selectByValue==="function"){if(e.chips.clearSelection)e.chips.clearSelection();let r=[];if(n){if(Array.isArray(n))r=n.filter((i)=>i!=null&&i!=="");else if(typeof n==="string"&&n!=="")r=[n]}if(r.length>0)e.chips.selectByValue(r,!1)}return this},selectByValue(n,r=!0){if(e.chips&&typeof e.chips.selectByValue==="function")e.chips.selectByValue(n,r);return this},clearSelection(){if(e.chips&&typeof e.chips.clearSelection==="function")e.chips.clearSelection();return this},setScrollable(n){if(e.layout&&typeof e.layout.setScrollable==="function")e.layout.setScrollable(n);return this},setVertical(n){if(e.layout&&typeof e.layout.setVertical==="function")e.layout.setVertical(n);return this},setLabel(n){if(e.label&&typeof e.label.setText==="function")e.label.setText(n);return this},getLabel(){if(e.label&&typeof e.label.getText==="function")return e.label.getText();return""},setLabelPosition(n){if(e.label&&typeof e.label.setPosition==="function")e.label.setPosition(n);return this},getLabelPosition(){if(e.label&&typeof e.label.getPosition==="function")return e.label.getPosition();return"start"},scrollToChip(n){if(e.chips&&typeof e.chips.scrollToChip==="function")e.chips.scrollToChip(n);return this},enableKeyboardNavigation(){if(e.keyboard&&typeof e.keyboard.enableKeyboardNavigation==="function")e.keyboard.enableKeyboardNavigation();return this},on(n,r){if(e.events&&typeof e.events.on==="function")e.events.on(n,r);return this},off(n,r){if(e.events&&typeof e.events.off==="function")e.events.off(n,r);return this},destroy(){if(e.lifecycle&&typeof e.lifecycle.destroy==="function")e.lifecycle.destroy()}});Q();var cg={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},tu=(e={})=>P(cg,e,"chips"),nu=(e)=>{let t=e.scrollable===!0,n=e.vertical===!0,r=e.multiSelect===!0,i=e.label&&e.label.trim().length>0,s=e.labelPosition||"start",a=["chips",e.class,t?"chips--scrollable":"",n?"chips--vertical":"",i?"chips--with-label":"",i&&s==="end"?"chips--label-end":""].filter(Boolean).join(" ");return V(e,{tag:"div",attributes:{role:"group","aria-multiselectable":r?"true":"false"},className:a})},ru=(e,t)=>({config:{multiSelect:t?.multiSelect??!1},chips:{addChip:function(n){if(e.chips&&typeof e.chips.addChip==="function")return e.chips.addChip(n);return null},removeChip:(n)=>e.chips?.removeChip?.(n),getChips:()=>e.chips?.getChips?.()??[],getSelectedChips:()=>e.chips?.getSelectedChips?.()??[],getSelectedValues:()=>e.chips?.getSelectedValues?.()??[],selectByValue:(n)=>e.chips?.selectByValue?.(n),clearSelection:()=>e.chips?.clearSelection?.(),scrollToChip:(n)=>e.chips?.scrollToChip?.(n)},layout:{setScrollable:(n)=>e.layout?.setScrollable?.(n),isScrollable:()=>e.layout?.isScrollable?.()??!1,setVertical:(n)=>e.layout?.setVertical?.(n),isVertical:()=>e.layout?.isVertical?.()??!1},label:{setText:(n)=>e.label?.setText?.(n),getText:()=>e.label?.getText?.()??"",setPosition:(n)=>e.label?.setPosition?.(n),getPosition:()=>e.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>e.keyboard?.enable?.(),disableKeyboardNavigation:()=>e.keyboard?.disable?.()},events:{on:(n,r)=>e.on?.(n,r),off:(n,r)=>e.off?.(n,r)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var mg=(e={})=>{let t=tu(e);try{let n=O(M,B(),R(nu(t)),us(t),cs(t),fs(t),ms(t),k())(t),r=ru(n,t),i=eu(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});if(Array.isArray(t.chips)&&t.chips.length>0)t.chips.forEach((s)=>{i.addChip(s)});return i}catch(n){throw console.error("Chips creation error:",n),Error(`Failed to create chip: ${n.message}`)}},ps=mg;rt();ne();Z();J();var iu=["S","M","T","W","T","F","S"],Yr=["January","February","March","April","May","June","July","August","September","October","November","December"],Xr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],su="MM/DD/YYYY",au="today",qr="selected",ou="outside-month",lu="range-start",du="range-end",uu="range-middle";var $e=(e)=>{if(!e)return null;if(e instanceof Date)return isNaN(e.getTime())?null:e;if(typeof e==="string"){let t=new Date(e);return isNaN(t.getTime())?null:t}return null},Nt=(e,t="MM/DD/YYYY")=>{if(!e||!(e instanceof Date)||isNaN(e.getTime()))return"";let n="",r=0;while(r<t.length)if(t.substring(r,r+4)==="MMMM")n+=Yr[e.getMonth()],r+=4;else if(t.substring(r,r+3)==="MMM")n+=Xr[e.getMonth()],r+=3;else if(t.substring(r,r+2)==="MM")n+=(e.getMonth()+1).toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="M")n+=e.getMonth()+1,r+=1;else if(t.substring(r,r+4)==="YYYY")n+=e.getFullYear(),r+=4;else if(t.substring(r,r+2)==="YY")n+=e.getFullYear().toString().slice(-2),r+=2;else if(t.substring(r,r+2)==="DD")n+=e.getDate().toString().padStart(2,"0"),r+=2;else if(t.substring(r,r+1)==="D")n+=e.getDate(),r+=1;else n+=t[r],r+=1;return n},cu=(e,t)=>new Date(e,t+1,0).getDate(),fg=(e,t)=>new Date(e,t,1).getDay(),At=(e,t)=>e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),pg=(e,t,n)=>{let r=e.getTime();return r>=t.getTime()&&r<=n.getTime()},mu=(e,t,n=null,r=null,i=null,s=null)=>{let a=new Date;a.setHours(0,0,0,0);let o=[],l=fg(e,t),d=cu(e,t-1);for(let g=l-1;g>=0;g--){let c=new Date(e,t-1,d-g),f=i&&c<i||s&&c>s;o.push({date:c,day:c.getDate(),isCurrentMonth:!1,isToday:At(c,a),isSelected:n?At(c,n):!1,isDisabled:f})}let u=cu(e,t);for(let g=1;g<=u;g++){let c=new Date(e,t,g),f=n?At(c,n):!1,h=i&&c<i||s&&c>s,C={date:c,day:g,isCurrentMonth:!0,isToday:At(c,a),isSelected:f,isDisabled:h};if(n&&r)C.isRangeStart=At(c,n),C.isRangeEnd=At(c,r),C.isRangeMiddle=pg(c,n,r)&&!C.isRangeStart&&!C.isRangeEnd;o.push(C)}let p=42-o.length;for(let g=1;g<=p;g++){let c=new Date(e,t+1,g),f=i&&c<i||s&&c>s;o.push({date:c,day:g,isCurrentMonth:!1,isToday:At(c,a),isSelected:n?At(c,n):!1,isDisabled:f})}return o},fu=(e,t=10)=>{let n=[],r=e-t,i=e+t;for(let s=r;s<=i;s++)n.push(s);return n};var gs=(e,t)=>{let n=new Date(e);return n.setMonth(n.getMonth()+t),n};var pu=(e,{disabled:t,lifecycle:n,events:r})=>(i)=>{let s={goToDate(a){let o=$e(a);if(!o)return;e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar()},nextMonth(){let a=gs(new Date(e.currentYear,e.currentMonth,1),1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},prevMonth(){let a=gs(new Date(e.currentYear,e.currentMonth,1),-1);e.currentMonth=a.getMonth(),e.currentYear=a.getFullYear(),e.updateCalendar()},nextYear(){e.currentYear+=1,e.updateCalendar()},prevYear(){e.currentYear-=1,e.updateCalendar()},showDayView(){e.currentView="day",e.updateCalendar()},showMonthView(){e.currentView="month",e.updateCalendar()},showYearView(){e.currentView="year",e.updateCalendar()},getCurrentView(){return e.currentView}};return{...i,element:i.element,input:e.input,calendar:s,open(){return e.isOpen=!0,e.render(),r.emit("open",{value:this.getValue()}),this},close(){return e.isOpen=!1,e.render(),r.emit("close",{value:this.getValue()}),this},getValue(){if(!e.selectedDate)return null;if(e.selectionMode==="range"&&e.rangeEndDate)return[new Date(e.selectedDate),new Date(e.rangeEndDate)];return new Date(e.selectedDate)},setValue(a){if(Array.isArray(a)&&e.selectionMode==="range"){let l=$e(a[0]),d=$e(a[1]);if(l&&d){if(e.selectedDate=l,e.rangeEndDate=d,l>d)e.selectedDate=d,e.rangeEndDate=l;if(e.updateInputValue(),e.isOpen)e.currentMonth=e.selectedDate.getMonth(),e.currentYear=e.selectedDate.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let o=$e(a);if(o){if(e.selectedDate=o,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.currentMonth=o.getMonth(),e.currentYear=o.getFullYear(),e.updateCalendar();r.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!e.selectedDate)return"";if(e.selectionMode==="range"&&e.rangeEndDate){let a=Nt(e.selectedDate,e.dateFormat),o=Nt(e.rangeEndDate,e.dateFormat);return`${a} - ${o}`}return Nt(e.selectedDate,e.dateFormat)},clear(){if(e.selectedDate=null,e.rangeEndDate=null,e.updateInputValue(),e.isOpen)e.updateCalendar();return r.emit("change",{value:null,formattedValue:""}),this},enable(){return t.enable(),e.input.disabled=!1,this},disable(){return t.disable(),e.input.disabled=!0,this},setMinDate(a){let o=$e(a);if(o){if(e.minDate=o,e.isOpen)e.updateCalendar()}return this},setMaxDate(a){let o=$e(a);if(o){if(e.maxDate=o,e.isOpen)e.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",e.outsideClickHandler),e.calendarElement&&e.calendarElement.parentNode)e.calendarElement.parentNode.removeChild(e.calendarElement);n.destroy()},on(a,o){return r.on(a,o),this},off(a,o){return r.off(a,o),this}}};Q();var gg={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:su,animate:!0},gu=(e={})=>{let t=P(gg,e,"datepicker");if(t.closeOnSelect===void 0)t.closeOnSelect=t.variant!=="docked";return t},hu=(e)=>V(e,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${e.prefix}-datepicker-container`,e.class],forwardEvents:{keydown:!0,click:!0},interactive:!0}),Cu=(e)=>{let t={type:"text",placeholder:e.placeholder||e.dateFormat,autocomplete:"off",readonly:!0};if(e.disabled===!0)t.disabled=!0;return V(e,{tag:"input",attributes:t,className:`${e.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},Eu=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant!=="docked"?"true":"false"},className:[`${e.prefix}-datepicker-calendar`,`${e.prefix}-datepicker-${e.variant}`,e.selectionMode==="range"?`${e.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}}),bu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},events:{on:e.on,off:e.off,emit:e.emit}});Qe();var hg=({currentMonth:e,currentYear:t,currentView:n,prefix:r,emit:i})=>{let s=H({tag:"div",className:`${r}-datepicker-header`}),a=H({tag:"button",className:`${r}-datepicker-month-selector`,text:Yr[e],attributes:{type:"button","aria-label":"Select month"}}),o=H({tag:"button",className:`${r}-datepicker-year-selector`,text:t.toString(),attributes:{type:"button","aria-label":"Select year"}}),l=H({tag:"div",className:`${r}-datepicker-nav-controls`}),d=H({tag:"button",className:`${r}-datepicker-prev-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg>',attributes:{type:"button","aria-label":n==="day"?"Previous month":n==="month"?"Previous year":"Previous year range"}}),u=H({tag:"button",className:`${r}-datepicker-next-btn`,html:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>',attributes:{type:"button","aria-label":n==="day"?"Next month":n==="month"?"Next year":"Next year range"}});return a.addEventListener("click",(m)=>{m.stopPropagation(),i("viewChange",{view:"month"})}),o.addEventListener("click",(m)=>{m.stopPropagation(),i("viewChange",{view:"year"})}),d.addEventListener("click",(m)=>{if(m.stopPropagation(),n==="day")i("prevMonth");else if(n==="month")i("prevYear");else i("prevYearRange")}),u.addEventListener("click",(m)=>{if(m.stopPropagation(),n==="day")i("nextMonth");else if(n==="month")i("nextYear");else i("nextYearRange")}),s.appendChild(a),s.appendChild(o),l.appendChild(d),l.appendChild(u),s.appendChild(l),s},Cg=(e)=>{let t=H({tag:"div",className:`${e}-datepicker-weekdays`});return iu.forEach((n)=>{let r=H({tag:"span",className:`${e}-datepicker-weekday`,text:n});t.appendChild(r)}),t},Eg=({currentYear:e,currentMonth:t,selectedDate:n,rangeEndDate:r,minDate:i,maxDate:s,prefix:a,emit:o})=>{let l=H({tag:"div",className:`${a}-datepicker-days`});return mu(e,t,n,r,i,s).forEach((u)=>{let m=[`${a}-datepicker-day`,u.isCurrentMonth?"":ou,u.isToday?au:"",u.isSelected?qr:"",u.isDisabled?"disabled":"",u.isRangeStart?lu:"",u.isRangeEnd?du:"",u.isRangeMiddle?uu:""].filter(Boolean).join(" "),p=H({tag:"button",className:m,text:u.day.toString(),attributes:{type:"button","aria-label":u.date.toLocaleDateString(),"aria-selected":u.isSelected?"true":"false","aria-disabled":u.isDisabled?"true":"false","data-date":u.date.toISOString(),disabled:u.isDisabled}});p.addEventListener("click",(g)=>{if(g.stopPropagation(),!u.isDisabled)o("dateSelected",{date:u.date})}),l.appendChild(p)}),l},bg=({currentMonth:e,prefix:t,emit:n})=>{let r=H({tag:"div",className:`${t}-datepicker-months`});return Xr.forEach((i,s)=>{let a=s===e,o=H({tag:"button",className:`${t}-datepicker-month ${a?qr:""}`,text:i,attributes:{type:"button","aria-selected":a?"true":"false","data-month":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("monthSelected",{month:s})}),r.appendChild(o)}),r},vg=({currentYear:e,prefix:t,emit:n})=>{let r=H({tag:"div",className:`${t}-datepicker-years`});return fu(e,10).forEach((s)=>{let a=s===e,o=H({tag:"button",className:`${t}-datepicker-year ${a?qr:""}`,text:s.toString(),attributes:{type:"button","aria-selected":a?"true":"false","data-year":s.toString()}});o.addEventListener("click",(l)=>{l.stopPropagation(),n("yearSelected",{year:s})}),r.appendChild(o)}),r},Tg=({prefix:e,emit:t})=>{let n=H({tag:"div",className:`${e}-datepicker-footer`}),r=H({tag:"button",className:`${e}-datepicker-cancel ${e}-button ${e}-button--text`,text:"Cancel",attributes:{type:"button"}}),i=H({tag:"button",className:`${e}-datepicker-ok ${e}-button ${e}-button--text`,text:"OK",attributes:{type:"button"}});return r.addEventListener("click",(s)=>{s.stopPropagation(),t("cancel")}),i.addEventListener("click",(s)=>{s.stopPropagation(),t("confirm")}),n.appendChild(r),n.appendChild(i),n},vu=(e,t)=>{let{prefix:n,currentView:r,currentMonth:i,currentYear:s,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,variant:u}=e,m=H({tag:"div",className:`${n}-datepicker-calendar-content`}),p=hg({currentMonth:i,currentYear:s,currentView:r,prefix:n,emit:t});if(m.appendChild(p),r==="day"){let g=Cg(n);m.appendChild(g);let c=Eg({currentYear:s,currentMonth:i,selectedDate:a,rangeEndDate:o,minDate:l,maxDate:d,prefix:n,emit:t});m.appendChild(c)}else if(r==="month"){let g=bg({currentMonth:i,prefix:n,emit:t});m.appendChild(g)}else if(r==="year"){let g=vg({currentYear:s,prefix:n,emit:t});m.appendChild(g)}if(u!=="docked"){let g=Tg({prefix:n,emit:t});m.appendChild(g)}return m};Qe();var Sg=(e={})=>{let t=gu(e);try{let n={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:t.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:t.minDate?$e(t.minDate):null,maxDate:t.maxDate?$e(t.maxDate):null,dateFormat:t.dateFormat,variant:t.variant,selectionMode:t.selectionMode,closeOnSelect:t.closeOnSelect,prefix:t.prefix||X,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let a=Nt(this.selectedDate,this.dateFormat),o=Nt(this.rangeEndDate,this.dateFormat);this.input.value=`${a} - ${o}`;return}this.input.value=Nt(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let a=vu(this,(o,l)=>{switch(o){case"dateSelected":this.handleDateSelection(l.date);break;case"monthSelected":this.currentMonth=l.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=l.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=l.view,this.updateCalendar();break;case"prevMonth":this.prevMonth();break;case"nextMonth":this.nextMonth();break;case"prevYear":this.prevYear();break;case"nextYear":this.nextYear();break;case"prevYearRange":this.currentYear-=20,this.updateCalendar();break;case"nextYearRange":this.currentYear+=20,this.updateCalendar();break;case"cancel":this.isOpen=!1,this.render();break;case"confirm":this.isOpen=!1,this.render();break}});this.calendarElement.appendChild(a)},handleDateSelection(a){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=a,this.rangeEndDate=null;else{if(a<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=a;else this.rangeEndDate=a;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=a,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),r.emit("change",{value:this.selectedDate,rangeEndDate:this.rangeEndDate,formattedValue:this.input.value})},prevMonth(){if(this.currentMonth===0)this.currentMonth=11,this.currentYear--;else this.currentMonth--;this.updateCalendar()},nextMonth(){if(this.currentMonth===11)this.currentMonth=0,this.currentYear++;else this.currentMonth++;this.updateCalendar()},prevYear(){this.currentYear--,this.updateCalendar()},nextYear(){this.currentYear++,this.updateCalendar()},render(){if(this.calendarElement)if(this.isOpen)this.calendarElement.style.display="block",this.updateCalendar(),setTimeout(()=>{this.calendarElement.focus()},10);else this.calendarElement.style.display="none"}};if(t.value)if(Array.isArray(t.value)&&t.selectionMode==="range"){let a=$e(t.value[0]),o=$e(t.value[1]);if(a&&o)n.selectedDate=a,n.rangeEndDate=o,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}else{let a=$e(t.value);if(a)n.selectedDate=a,n.currentMonth=a.getMonth(),n.currentYear=a.getFullYear()}let r=O(M,B(),R(hu(t)),oe(t),k())(t),i=O(M,R(Cu(t)))(t);n.input=i.element,r.element.appendChild(n.input),n.updateInputValue();let s=Eu(t);return n.calendarElement=H({tag:"div",className:s.className,attributes:s.attributes}),n.calendarElement.style.display="none",r.element.appendChild(n.calendarElement),n.input.addEventListener("click",()=>{if(!r.element.classList.contains("disabled"))if(n.isOpen=!n.isOpen,n.render(),n.isOpen)r.emit("open",{value:n.selectedDate});else r.emit("close",{value:n.selectedDate})}),n.calendarElement.addEventListener("click",(a)=>{a.stopPropagation()}),document.addEventListener("click",(a)=>{if(n.isOpen&&!r.element.contains(a.target))n.isOpen=!1,n.render(),r.emit("close",{value:n.selectedDate})}),pu(n,bu(r))(r)}catch(n){throw console.error("DatePicker creation error:",n),Error(`Failed to create DatePicker: ${n.message}`)}},hs=Sg;ne();Z();J();Q();var xg={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},Tu=(e={})=>P(xg,e,"dialog"),Su=(e)=>{let n={role:e.role||(e.size==="fullscreen"?"dialog":"alertdialog"),tabindex:-1};if(e.modal!==!1)n["aria-modal"]="true";return V(e,{tag:"div",attributes:n,className:e.class})},yu=(e)=>({tag:"div",attributes:{},className:""}),xu=(e)=>({visibility:{open:()=>e.visibility.open(),close:()=>e.visibility.close(),toggle:(t)=>e.visibility.toggle(t),isOpen:()=>e.visibility.isOpen()},content:{setTitle:(t)=>e.content.setTitle(t),getTitle:()=>e.content.getTitle(),setSubtitle:(t)=>e.content.setSubtitle(t),getSubtitle:()=>e.content.getSubtitle(),setContent:(t)=>e.content.setContent(t),getContent:()=>e.content.getContent(),getHeaderElement:()=>e.content.getHeaderElement(),getContentElement:()=>e.content.getContentElement(),getFooterElement:()=>e.content.getFooterElement()},buttons:{addButton:(t)=>e.buttons.addButton(t),removeButton:(t)=>e.buttons.removeButton(t),getButtons:()=>e.buttons.getButtons(),setFooterAlignment:(t)=>e.buttons.setFooterAlignment(t)},focus:{trapFocus:()=>e.focus.trapFocus(),releaseFocus:()=>e.focus.releaseFocus()},size:{setSize:(t)=>e.size.setSize(t)},divider:{toggleDivider:(t)=>e.divider.toggleDivider(t),hasDivider:()=>e.divider.hasDivider()},events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),trigger:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});pt();ne();Q();var Ig={orientation:"horizontal",variant:"full-width",thickness:1},Iu=(e={})=>P(Ig,e,"divider");var Lu=(e)=>(t)=>{let n=e.orientation||"horizontal";t.element.classList.add(`${t.getClass("divider")}--${n}`);let r=e.thickness||1;if(n==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%";else t.element.style.width=`${r}px`,t.element.style.height="100%";return{...t,getOrientation(){return n},setOrientation(i){if(t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`),i==="horizontal")t.element.style.height=`${r}px`,t.element.style.width="100%",t.element.style.marginTop="",t.element.style.marginBottom="";else t.element.style.width=`${r}px`,t.element.style.height="100%",t.element.style.marginLeft="",t.element.style.marginRight="";return this}}},Au=(e)=>(t)=>{let n=e.variant||"full-width",r=e.orientation||"horizontal";if(n==="inset"||n==="middle-inset")if(r==="horizontal"){let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginLeft=`${i}px`,t.element.style.marginRight=`${s}px`}else{let i=e.insetStart!==void 0?e.insetStart:16,s=e.insetEnd!==void 0?e.insetEnd:n==="middle-inset"?16:0;t.element.style.marginTop=`${i}px`,t.element.style.marginBottom=`${s}px`}return{...t,getVariant(){return n},setVariant(i){t.element.classList.remove(`${t.getClass("divider")}--${n}`),t.element.classList.add(`${t.getClass("divider")}--${i}`);let s=t.getOrientation?t.getOrientation():r;if(i==="full-width")if(s==="horizontal")t.element.style.marginLeft="",t.element.style.marginRight="";else t.element.style.marginTop="",t.element.style.marginBottom="";else{let a=e.insetStart!==void 0?e.insetStart:16,o=e.insetEnd!==void 0?e.insetEnd:i==="middle-inset"?16:0;if(s==="horizontal")t.element.style.marginLeft=`${a}px`,t.element.style.marginRight=`${o}px`;else t.element.style.marginTop=`${a}px`,t.element.style.marginBottom=`${o}px`}return this},setInset(i,s){let a=t.getOrientation?t.getOrientation():r;if((t.getVariant?t.getVariant():n)!=="full-width")if(a==="horizontal"){if(i!==void 0)t.element.style.marginLeft=`${i}px`;if(s!==void 0)t.element.style.marginRight=`${s}px`}else{if(i!==void 0)t.element.style.marginTop=`${i}px`;if(s!==void 0)t.element.style.marginBottom=`${s}px`}return this}}},Nu=(e)=>(t)=>{if(e.color)t.element.style.backgroundColor=e.color;let n=e.thickness||1,r=e.orientation||"horizontal";if(r==="horizontal")t.element.style.height=`${n}px`;else t.element.style.width=`${n}px`;return{...t,setThickness(i){if((t.getOrientation?t.getOrientation():r)==="horizontal")t.element.style.height=`${i}px`;else t.element.style.width=`${i}px`;return this},setColor(i){return t.element.style.backgroundColor=i,this}}};var Vt=(e={})=>{let t=Iu(e);return O(M,R({tag:"hr",componentName:"divider",className:e.class}),Lu(t),se(t),Au(t),Nu(t))(t)};Rn();var dn={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},Lg=0,wu=(e)=>(t)=>{let n=`${t.getClass("dialog")}-${++Lg}`,r=`${n}-title`,i=`${n}-content`,s=yu(e),a=document.createElement(s.tag||"div");if(a.classList.add(t.getClass("dialog-overlay")),s.attributes&&typeof s.attributes==="object")Object.entries(s.attributes).forEach(([E,v])=>{if(E&&typeof E==="string"&&v!==void 0)a.setAttribute(E,String(v))});if(e.zIndex)a.style.zIndex=String(e.zIndex);let o=e.closeButton??e.size==="fullscreen",l=()=>{let E=document.createElement("div");E.classList.add(t.getClass("dialog-header"));let v=document.createElement("div");if(v.classList.add(t.getClass("dialog-header-content")),E.appendChild(v),e.title){let S=document.createElement("h2");S.classList.add(t.getClass("dialog-header-title")),S.id=r,S.textContent=e.title,v.appendChild(S)}if(e.subtitle){let S=document.createElement("p");S.classList.add(t.getClass("dialog-header-subtitle")),S.textContent=e.subtitle,v.appendChild(S)}if(o){let S=document.createElement("button");S.classList.add(t.getClass("dialog-header-close")),S.setAttribute("aria-label","Close dialog"),S.innerHTML=`
14
14
  <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
15
15
  <line x1="18" y1="6" x2="6" y2="18"></line>
16
16
  <line x1="6" y1="6" x2="18" y2="18"></line>
17
17
  </svg>
18
- `,S.addEventListener("click",(y)=>{if(y.preventDefault(),y.stopPropagation(),t&&t.emit)t.emit("dialog:close",{source:"closeButton"})}),E.appendChild(S)}return E},d=()=>{let E=document.createElement("div");if(E.classList.add(t.getClass("dialog-content")),E.id=i,e.content)E.innerHTML=e.content;return E},u=()=>{let E=document.createElement("div");E.classList.add(t.getClass("dialog-footer"));let v=e.footerAlignment||"right";if(v!=="right")te(E,`${t.getClass("dialog-footer")}--${v}`);if(Array.isArray(e.buttons)&&e.buttons.length>0)e.buttons.forEach((S)=>Mu(E,S,t));return E},c=()=>Vt({variant:"full-width",class:t.getClass("dialog-divider")}),p=l(),g=d(),f=Array.isArray(e.buttons)&&e.buttons.length>0?u():null;if(te(t.element,t.getClass("dialog")),e.title)t.element.setAttribute("aria-labelledby",r);else if(e.ariaLabel)t.element.setAttribute("aria-label",e.ariaLabel);if(e.content)t.element.setAttribute("aria-describedby",i);let m=e.size||"medium";if(m!=="medium")te(t.element,`${t.getClass("dialog")}--${m}`);let h=e.animation||"scale";if(h!=="scale")te(t.element,`${t.getClass("dialog")}--${h}`);t.element.appendChild(p);let C=null,T=null;if(e.divider){if(C=c(),C.element.classList.add(t.getClass("dialog-header-divider")),t.element.appendChild(C.element),f)T=c(),T.element.classList.add(t.getClass("dialog-footer-divider"))}if(t.element.appendChild(g),T)t.element.appendChild(T.element);if(f)t.element.appendChild(f);a.appendChild(t.element);let b=e.container||document.body;return b.appendChild(a),{...t,overlay:a,structure:{header:p,content:g,footer:f,headerDivider:C,footerDivider:T,container:b}}},Du=()=>(e)=>({...e,divider:{toggleDivider(t){if(t&&!e.structure.headerDivider){let n=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-header-divider")}`});if(e.element.insertBefore(n.element,e.structure.content),e.structure.headerDivider=n,e.structure.footer&&!e.structure.footerDivider){let r=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-footer-divider")}`});e.element.insertBefore(r.element,e.structure.footer),e.structure.footerDivider=r}}else if(!t){if(e.structure.headerDivider)e.structure.headerDivider.element.remove(),e.structure.headerDivider=null;if(e.structure.footerDivider)e.structure.footerDivider.element.remove(),e.structure.footerDivider=null}return e},hasDivider(){return e.structure.headerDivider!==null}}}),Mu=(e,t,n)=>{let{text:r,variant:i="text",onClick:s,closeDialog:a=!0,autofocus:o=!1,attributes:l={}}=t,d=Te({text:r,variant:i,...l});if(d.on("click",(u)=>{let c=a;if(typeof s==="function")try{if(s(u,n)===!1)c=!1}catch(p){console.error("Error in onClick handler:",p)}if(c){if(n&&n.emit)n.emit("dialog:close",{source:"button",text:r})}}),o)d.element.setAttribute("autofocus","true");if(e.appendChild(d.element),!n._buttons)n._buttons=[];n._buttons.push({config:t,instance:d})},Ou=()=>(e)=>{let t=e.config.open===!0,n=e.config.animationDuration||150,r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=null,s=!1,a=[],o=null,l=()=>Array.from(e.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((E)=>!E.hasAttribute("disabled")&&E.getAttribute("aria-hidden")!=="true"&&(E.offsetWidth>0||E.offsetHeight>0||E===document.activeElement));function d(E){if(E.key!=="Tab")return;let v=l();if(v.length===0){E.preventDefault(),e.element.focus();return}let S=v[0],y=v[v.length-1],L=document.activeElement;if(E.shiftKey&&(L===S||!e.element.contains(L)))y.focus(),E.preventDefault();else if(!E.shiftKey&&L===y)S.focus(),E.preventDefault()}let u=()=>{if(e.config.modal===!1)return;let E=e.overlay.parentElement;if(E)Array.from(E.children).forEach((S)=>{if(S===e.overlay)return;if(S.hasAttribute("inert"))return;S.setAttribute("inert",""),a.push(S)});let v=e.element.ownerDocument.body;if(v&&o===null)o=v.style.overflow,v.style.overflow="hidden"},c=()=>{a.forEach((v)=>v.removeAttribute("inert")),a.length=0;let E=e.element.ownerDocument.body;if(E&&o!==null)E.style.overflow=o,o=null},p=()=>{if(u(),e.config.autofocus!==!1)(e.element.querySelector("[autofocus]")||l()[0]||e.element).focus();if(e.config.trapFocus!==!1)e.element.addEventListener("keydown",d)},g=()=>{if(e.element.removeEventListener("keydown",d),c(),i){if(i.isConnected)i.focus();i=null}},f=()=>{if(e.config.closeOnOverlayClick!==!1)e.overlay.addEventListener("mousedown",h),document.addEventListener("mouseup",C);if(e.config.closeOnEscape!==!1)document.addEventListener("keydown",T)},m=()=>{e.overlay.removeEventListener("mousedown",h),document.removeEventListener("mouseup",C),document.removeEventListener("keydown",T)};function h(E){s=E.target===e.overlay}function C(E){if(s&&E.target===e.overlay)b.close();s=!1}function T(E){if(E.key==="Escape"&&b.isOpen())b.close()}if(t)te(e.overlay,`${e.getClass("dialog-overlay")}--visible`),te(e.element,`${e.getClass("dialog")}--visible`),p(),f();let b={open(){if(this.isOpen())return;i=document.activeElement;let E={dialog:e,defaultPrevented:!1,preventDefault:()=>{E.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(dn.BEFORE_OPEN,E);if(E.defaultPrevented)return;if(e.overlay&&!e.overlay.parentNode)(e.structure.container||document.body).appendChild(e.overlay);te(e.overlay,`${e.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(te(e.element,`${e.getClass("dialog")}--visible`),p(),f(),typeof e.emit==="function")e.emit(dn.OPEN,{dialog:e}),setTimeout(()=>{e.emit(dn.AFTER_OPEN,{dialog:e})},n)},10)},close(){let E={dialog:e,defaultPrevented:!1,preventDefault:()=>{E.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(dn.BEFORE_CLOSE,E);if(E.defaultPrevented){console.log("Dialog close prevented by event handler");return}let v=`${e.getClass("dialog")}--visible`,S=`${e.getClass("dialog-overlay")}--visible`;if(he(e.element,v),he(e.overlay,S),g(),m(),typeof e.emit==="function")e.emit(dn.CLOSE,{dialog:e});setTimeout(()=>{if(e.overlay&&e.overlay.parentNode)e.overlay.parentNode.removeChild(e.overlay);if(typeof e.emit==="function")e.emit(dn.AFTER_CLOSE,{dialog:e})},n)},toggle(E){if(E===void 0)this.isOpen()?this.close():this.open();else if(E)this.open();else this.close()},isOpen(){return e.element.classList.contains(`${e.getClass("dialog")}--visible`)}};if(e&&e.on)e.on("dialog:close",()=>{b.close()});return{...e,visibility:b,focus:{trapFocus:p,releaseFocus:g}}},Ru=()=>(e)=>{let t=e.structure.header,n=e.structure.content,r=e.structure.footer;return{...e,content:{setTitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-title")}`);if(!s&&i)s=document.createElement("h2"),s.classList.add(e.getClass("dialog-header-title")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getTitle(){let i=t.querySelector(`.${e.getClass("dialog-header-title")}`);return i?i.textContent||"":""},setSubtitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);if(!s&&i)s=document.createElement("p"),s.classList.add(e.getClass("dialog-header-subtitle")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getSubtitle(){let i=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);return i?i.textContent||"":""},setContent(i){n.innerHTML=i},getContent(){return n.innerHTML},getHeaderElement(){return t},getContentElement(){return n},getFooterElement(){return r}}}},_u=()=>(e)=>{if(!e._buttons)e._buttons=[];return{...e,buttons:{addButton(t){let n=e.structure.footer;if(!n){n=document.createElement("div"),n.classList.add(e.getClass("dialog-footer"));let r=e.config.footerAlignment||"right";if(r!=="right")te(n,`${e.getClass("dialog-footer")}--${r}`);e.element.appendChild(n),e.structure.footer=n}Mu(n,t,e)},removeButton(t){if(typeof t==="number"){if(t>=0&&t<e._buttons.length)e._buttons[t].instance.destroy(),e._buttons.splice(t,1)}else{let n=e._buttons.findIndex((r)=>r.config.text===t);if(n!==-1)e._buttons[n].instance.destroy(),e._buttons.splice(n,1)}if(e._buttons.length===0&&e.structure.footer)e.element.removeChild(e.structure.footer),e.structure.footer=null},getButtons(){return e._buttons.map((t)=>t.config)},setFooterAlignment(t){if(!e.structure.footer)return;if(["right","left","center","space-between"].forEach((r)=>{if(r!=="right")he(e.structure.footer,`${e.getClass("dialog-footer")}--${r}`)}),t!=="right")te(e.structure.footer,`${e.getClass("dialog-footer")}--${t}`)}}}},Pu=()=>(e)=>({...e,size:{setSize(t){if(["small","medium","large","fullwidth","fullscreen"].forEach((r)=>{he(e.element,`${e.getClass("dialog")}--${r}`)}),t!=="medium")te(e.element,`${e.getClass("dialog")}--${t}`)}}}),Bu=()=>(e)=>({...e,confirm(t){return new Promise((n)=>{let{title:r="Confirm",message:i,confirmText:s="Yes",cancelText:a="No",confirmVariant:o="filled",cancelVariant:l="text",size:d="small"}=t;e.content.setTitle(r),e.content.setContent(`<p>${i}</p>`),e.size.setSize(d),e._buttons.forEach((u)=>u.instance.destroy()),e._buttons=[],e.buttons.addButton({text:s,variant:o,onClick:()=>{n(!0)}}),e.buttons.addButton({text:a,variant:l,onClick:()=>{n(!1)}}),e.visibility.open()})}});Rn();var ku=(e)=>(t)=>({...t,open(){return e.visibility.open(),this},close(){return e.visibility.close(),this},toggle(n){return e.visibility.toggle(n),this},isOpen(){return e.visibility.isOpen()},setTitle(n){return e.content.setTitle(n),this},getTitle(){return e.content.getTitle()},setSubtitle(n){return e.content.setSubtitle(n),this},getSubtitle(){return e.content.getSubtitle()},setContent(n){return e.content.setContent(n),this},getContent(){return e.content.getContent()},addButton(n){return e.buttons.addButton(n),this},removeButton(n){return e.buttons.removeButton(n),this},getButtons(){return e.buttons.getButtons()},setFooterAlignment(n){return e.buttons.setFooterAlignment(n),this},toggleDivider(n){return e.divider.toggleDivider(n),this},hasDivider(){return e.divider.hasDivider()},setSize(n){return e.size.setSize(n),this},on(n,r){return e.events.on(n,r),this},off(n,r){return e.events.off(n,r),this},getHeaderElement(){return e.content.getHeaderElement()},getContentElement(){return e.content.getContentElement()},getFooterElement(){return e.content.getFooterElement()},confirm(n){if(t.confirm)return t.confirm(n||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(this.isOpen()){let n=`${t.getClass("dialog")}--visible`,r=`${t.getClass("dialog-overlay")}--visible`;if(he(t.element,n),he(t.overlay,r),e.focus&&e.focus.releaseFocus)e.focus.releaseFocus()}if(e.lifecycle.destroy(),t.overlay&&t.overlay.parentNode)t.overlay.parentNode.removeChild(t.overlay)},element:t.element,overlay:t.overlay});var Ag=(e={})=>{let t=Tu(e);try{let n=M(D,B(),O(Su(t)),wu(t),Ou(),Ru(),_u(),Pu(),Du(),Bu(),P(),(r)=>ku(xu(r))(r))(t);if(t.on)Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(n){throw console.error("Dialog creation error:",n),Error(`Failed to create dialog: ${n.message}`)}},Cs=Ag;ne();Z();J();var Ng={STANDARD:"standard",MODAL:"modal"},wg={START:"start",END:"end"};var Jn={OPEN:"open",CLOSE:"close",SELECT:"select"};var wt={VARIANT:Ng.STANDARD,POSITION:wg.START,OPEN:!1,DISMISSIBLE:!0,WIDTH:360};var Dg=(e,t)=>{let n=document.createElement("button");if(n.className=t("drawer__item"),n.setAttribute("role","tab"),n.setAttribute("tabindex","-1"),e.id)n.dataset.id=e.id;if(e.disabled)n.disabled=!0,n.setAttribute("aria-disabled","true");let r=document.createElement("span");if(r.className=t("drawer__active-indicator"),n.appendChild(r),e.icon){let i=document.createElement("span");i.className=t("drawer__item-icon"),i.innerHTML=e.icon,n.appendChild(i)}if(e.label){let i=document.createElement("span");i.className=t("drawer__item-label"),i.textContent=e.label,n.appendChild(i)}if(e.badge){let i=document.createElement("span");i.className=t("drawer__item-badge"),i.textContent=e.badge,n.appendChild(i)}if(e.active)n.classList.add(`${t("drawer__item")}--active`),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0");else n.setAttribute("aria-selected","false");return n},Mg=(e)=>{let t=document.createElement("hr");return t.className=e("drawer__divider"),t.setAttribute("role","separator"),t},Og=(e,t)=>{let n=document.createElement("div");return n.className=t("drawer__section-label"),n.textContent=e.label||e.sectionLabel||"",n},Es=(e)=>(t)=>{let n=e.items||[],r=null,i=null,s=n.find((g)=>g.type!=="divider"&&g.type!=="section"&&g.active);if(s?.id)r=s.id;let a=()=>{if(!i)return;i.innerHTML="";let g=0;if(n.forEach((f)=>{let m=f.type||"item";if(m==="divider"){i.appendChild(Mg(t.getClass));return}if(m==="section"){i.appendChild(Og(f,t.getClass));return}let h=Dg(f,t.getClass);h.dataset.navIndex=String(g),g++,h.addEventListener("click",(C)=>{if(f.id&&!f.disabled){o(f.id);let T={id:f.id,label:f.label||"",index:parseInt(h.dataset.navIndex||"0",10),originalEvent:C};if(t.emit(Jn.SELECT,T),e.onSelect)e.onSelect(T)}}),i.appendChild(h)}),!r){let f=i.querySelector(`.${t.getClass("drawer__item")}`);if(f)f.setAttribute("tabindex","0")}},o=(g)=>{if(!i)return;let f=`${t.getClass("drawer__item")}--active`;if(i.querySelectorAll(`.${t.getClass("drawer__item")}`).forEach((h)=>{h.classList.remove(f),h.setAttribute("aria-selected","false"),h.setAttribute("tabindex","-1")}),!g){r=null;let h=i.querySelector(`.${t.getClass("drawer__item")}`);if(h)h.setAttribute("tabindex","0")}else{let h=i.querySelector(`[data-id="${g}"]`);if(h)h.classList.add(f),h.setAttribute("aria-selected","true"),h.setAttribute("tabindex","0"),r=g}n=n.map((h)=>({...h,active:h.id===g}))},l=()=>r,d=(g)=>{n=g,r=g.find((m)=>m.type!=="divider"&&m.type!=="section"&&m.active)?.id||null,a()},u=()=>n,c=(g,f)=>{if(!i)return;let m=i.querySelector(`[data-id="${g}"]`);if(!m)return;let h=m.querySelector(`.${t.getClass("drawer__item-badge")}`);if(f){if(!h)h=document.createElement("span"),h.className=t.getClass("drawer__item-badge"),m.appendChild(h);h.textContent=f}else if(h)h.remove();n=n.map((C)=>C.id===g?{...C,badge:f}:C)},p=(g)=>{if(!i)return;let f=Array.from(i.querySelectorAll(`.${t.getClass("drawer__item")}:not([disabled])`));if(!f.length)return;let m=f.indexOf(document.activeElement),h=-1;switch(g.key){case"ArrowDown":g.preventDefault(),h=m<f.length-1?m+1:0;break;case"ArrowUp":g.preventDefault(),h=m>0?m-1:f.length-1;break;case"Home":g.preventDefault(),h=0;break;case"End":g.preventDefault(),h=f.length-1;break;case"Enter":case" ":if(g.preventDefault(),m>=0)f[m].click();return;default:return}if(h>=0&&h<f.length)f.forEach((C)=>C.setAttribute("tabindex","-1")),f[h].setAttribute("tabindex","0"),f[h].focus()};return i=document.createElement("div"),i.className=t.getClass("drawer__items"),i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),i.addEventListener("keydown",p),a(),{...t,itemsContainer:i,drawerItems:{setActive:o,getActive:l,setItems:d,getItems:u,setBadge:c,renderItems:a}}};var bs=(e)=>(t)=>{let n=e.variant==="modal",r=e.dismissible!==!1,i=e.open===!0,s=null;if(n){if(s=document.createElement("div"),s.className=t.getClass("drawer__scrim"),r)s.addEventListener("click",()=>{l()})}let a=(u)=>{if(u.key==="Escape"&&i&&n&&r)u.preventDefault(),l()};if(n)document.addEventListener("keydown",a);function o(){if(i)return;if(i=!0,t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="hidden";if(requestAnimationFrame(()=>{let u=t.element.querySelector(`.${t.getClass("drawer__item")}[tabindex="0"]`);if(u)u.focus();else t.element.focus()}),t.emit(Jn.OPEN),e.onOpen)e.onOpen()}function l(){if(!i)return;if(i=!1,t.element.classList.remove(`${t.getClass("drawer")}--open`),n&&s)s.classList.remove(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="";if(t.emit(Jn.CLOSE),e.onClose)e.onClose()}function d(){if(i)l();else o()}if(i){if(t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`)}return{...t,scrimElement:s,drawerState:{open:o,close:l,toggle:d,isOpen:()=>i},_stateCleanup:()=>{if(n){if(document.removeEventListener("keydown",a),s&&s.parentNode)s.parentNode.removeChild(s);document.body.style.overflow=""}}}};var vs=(e)=>(t)=>{let n=null,r=e.headline||"";if(r)n=document.createElement("div"),n.className=t.getClass("drawer__headline"),n.textContent=r;return{...t,headlineElement:n,drawerHeadline:{setHeadline:(a)=>{if(r=a,a){if(!n)n=document.createElement("div"),n.className=t.getClass("drawer__headline");n.textContent=a}else if(n&&n.parentNode)n.parentNode.removeChild(n),n=null},getHeadline:()=>r,getElement:()=>n}}};sn();var Hu=({state:e,items:t,headline:n,lifecycle:r})=>(i)=>{let s={element:i.element,getClass:i.getClass,lifecycle:r,on(a,o){if(i.on)i.on(a,o);return s},off(a,o){if(i.off)i.off(a,o);return s},addClass(...a){if(i.addClass)i.addClass(...a);else te(i.element,...a);return s},open(){return e.open(),s},close(){return e.close(),s},toggle(){return e.toggle(),s},isOpen(){return e.isOpen()},setActive(a){return t.setActive(a),s},getActive(){return t.getActive()},setItems(a){return t.setItems(a),s},getItems(){return t.getItems()||[]},setBadge(a,o){return t.setBadge(a,o),s},setHeadline(a){return n.setHeadline(a),s},getHeadline(){return n.getHeadline()},destroy(){r.destroy()}};return s};Q();var Rg={variant:wt.VARIANT,position:wt.POSITION,open:wt.OPEN,dismissible:wt.DISMISSIBLE,width:wt.WIDTH,items:[]},$u=(e={})=>_(Rg,e,"drawer"),Vu=(e)=>{let t=e.variant==="modal",n={};if(t)n.role="dialog",n["aria-modal"]="true";else n.role="navigation";if(e.ariaLabel)n["aria-label"]=e.ariaLabel;return V(e,{tag:"aside",attributes:n,className:[e.dense?`${e.prefix}-drawer--dense`:null,e.class].filter(Boolean),forwardEvents:{click:!0,keydown:!0}})},Fu=(e)=>({state:{open:()=>e.drawerState.open(),close:()=>e.drawerState.close(),toggle:()=>e.drawerState.toggle(),isOpen:()=>e.drawerState.isOpen()},items:{setActive:(t)=>e.drawerItems.setActive(t),getActive:()=>e.drawerItems.getActive(),setItems:(t)=>e.drawerItems.setItems(t||[]),getItems:()=>e.drawerItems.getItems(),setBadge:(t,n)=>e.drawerItems.setBadge(t,n)},headline:{setHeadline:(t)=>e.drawerHeadline.setHeadline(t),getHeadline:()=>e.drawerHeadline.getHeadline()},lifecycle:{destroy:()=>{if(e._stateCleanup)e._stateCleanup();e.lifecycle.destroy()}}});var _g=(e={})=>{let t=$u(e);try{return M(D,B(),O(Vu(t)),se(t),vs(t),Es(t),bs(t),P(),(r)=>{let i=document.createElement("div");i.className=r.getClass("drawer__sheet");let s=t.width,a=s?typeof s==="number"?`${s}px`:s:`${wt.WIDTH}px`;if(r.element.style.setProperty("--drawer-width",a),r.headlineElement)i.appendChild(r.headlineElement);if(r.itemsContainer)i.appendChild(r.itemsContainer);if(r.scrimElement)r.element.appendChild(r.scrimElement);r.element.appendChild(i);let o=t.position||"start";return r.element.classList.add(`${r.getClass("drawer")}--${o}`),r},(r)=>Hu(Fu(r))(r))(t)}catch(n){throw console.error("Drawer creation error:",n),Error(`Failed to create drawer: ${n.message}`)}},Ts=_g;ne();Z();J();var Uu=({disabled:e,lifecycle:t,className:n})=>(r)=>({...r,element:r.element,getValue:()=>r.element.value,setValue(i){return r.element.value=i,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(i){return r.icon.setIcon(i),this},getIcon(){return r.icon.getIcon()},setPosition(i){return["top-right","top-left","bottom-right","bottom-left"].forEach((a)=>{r.element.classList.remove(`${n}--${a}`)}),r.element.classList.add(`${n}--${i}`),this},getPosition(){let i=["top-right","top-left","bottom-right","bottom-left"];for(let s of i)if(r.element.classList.contains(`${n}--${s}`))return s;return null},lower(){return r.element.classList.add(`${n}--lowered`),this},raise(){return r.element.classList.remove(`${n}--lowered`),this},destroy(){t.destroy()}});Q();var Pg={variant:"primary",size:"default",type:"button",ripple:!0},Gu=(e={})=>_(Pg,e,"fab"),zu=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||(e.icon?"action":void 0)};if(e.disabled===!0)t.disabled=!0;let n=[];if(n.push(`fab--${e.size||"default"}`),e.animate)n.push("fab--animate-enter");if(e.position)n.push(`fab--${e.position}`);if(e.disabled===!0)n.push("fab--disabled");let r={...e,className:n};return V(r,{tag:"button",attributes:t,forwardEvents:{click:(i)=>!i.element.disabled,focus:!0,blur:!0},interactive:!0})},Wu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("fab")});var Bg=(e={})=>{let t=Gu(e);try{return M(D,B(),O(zu(t)),se(t),Pe(t),oe(t),Le(t),P(),(r)=>Uu(Wu(r))(r))(t)}catch(n){throw console.error("FAB creation error:",n),Error(`Failed to create FAB: ${n.message}`)}},jr=Bg;ne();Z();J();var Ku=({disabled:e,lifecycle:t,text:n,className:r})=>(i)=>({...i,element:i.element,getValue:()=>i.element.value,setValue(s){return i.element.value=s,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(s){return i.icon.setIcon(s),this},getIcon(){return i.icon.getIcon()},setText(s){return n.setText(s),this},getText(){return n.getText()},setPosition(s){return["top-right","top-left","bottom-right","bottom-left"].forEach((o)=>{i.element.classList.remove(`${r}--${o}`)}),i.element.classList.add(`${r}--${s}`),this},getPosition(){let s=["top-right","top-left","bottom-right","bottom-left"];for(let a of s)if(i.element.classList.contains(`${r}--${a}`))return a;return null},lower(){return i.element.classList.add(`${r}--lowered`),this},raise(){return i.element.classList.remove(`${r}--lowered`),this},collapse(){i.element.classList.add(`${r}--collapsed`);let s=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},expand(){i.element.classList.remove(`${r}--collapsed`);let s=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},destroy(){t.destroy()}});Q();var kg={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},Yu=(e={})=>_(kg,e,"extended-fab"),Xu=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||e.text||(e.icon?"action":void 0)},n=[`${e.prefix}-extended-fab`];if(e.variant)n.push(`${e.prefix}-extended-fab--${e.variant}`);if(e.width)n.push(`${e.prefix}-extended-fab--${e.width}`);if(e.animate)n.push(`${e.prefix}-extended-fab--animate-enter`);if(e.position)n.push(`${e.prefix}-extended-fab--${e.position}`);if(e.collapseOnScroll)n.push(`${e.prefix}-extended-fab--collapsible`);if(e.class)n.push(e.class);if(e.disabled===!0)t.disabled=!0,n.push(`${e.prefix}-extended-fab--disabled`);return V(e,{tag:"button",attributes:t,className:n,forwardEvents:{click:(r)=>!r.element.disabled,focus:!0,blur:!0},interactive:!0})},qu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("extended-fab"),text:{setText:(t)=>e.text.setText(t),getText:()=>e.text.getText()}});var Hg=(e={})=>{let t=Yu(e),n=(r)=>{if(t.collapseOnScroll){let i=window.scrollY,s=!1,a=10,o=()=>{if(!s)window.requestAnimationFrame(()=>{let d=window.scrollY,u=d-i;if(u>a)r.collapse();else if(u<-a)r.expand();if(d<=0)r.expand();i=d,s=!1}),s=!0};window.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(()=>{r.expand()});let l=r.destroy;r.destroy=()=>{window.removeEventListener("scroll",o),l.call(r)}}};try{let r=M(D,B(),O(Xu(t)),se(t),Pe(t),ct(t),oe(t),Le(t),P(),(i)=>Ku(qu(i))(i))(t);return n(r),r}catch(r){throw console.error("Extended FAB creation error:",r),Error(`Failed to create Extended FAB: ${r.message}`)}},Zr=Hg;Z();J();var Qr={SELECT:"select",LOAD:"load",SCROLL:"scroll"};var fe={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var $g=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize list renderer: missing element"),t;let n=e.items||[],r=e.renderItem,i=document.createElement("div");i.className="mtrl-list-content",i.setAttribute("role","list"),t.element.appendChild(i);function s(d,u){let c=document.createElement("div");c.className=fe.ITEM,c.setAttribute("role","listitem");let p=document.createElement("div");p.className="mtrl-list-item-content";let g=document.createElement("div");return g.className="mtrl-list-item-text",g.textContent=d.text||d.title||d.headline||d.name||d.id||String(d),p.appendChild(g),c.appendChild(p),c}let a=()=>{if(i.innerHTML="",!n||n.length===0){i.innerHTML='<div class="mtrl-list-empty">No items</div>';return}let d=document.createDocumentFragment();n.forEach((u,c)=>{if(u==null)return;let p=r?r(u,c):s(u,c);if(!p)return;if(!p.classList.contains(fe.ITEM))p.classList.add(fe.ITEM);if(!p.hasAttribute("role"))p.setAttribute("role","listitem");let g=u?.id||String(c);if(!p.hasAttribute("data-id"))p.setAttribute("data-id",g);d.appendChild(p)}),i.appendChild(d),t.emit?.(Qr.LOAD,{items:n,loading:!1,hasNext:!1,hasPrev:!1,component:t}),console.log(`\uD83D\uDCCB Rendered ${n.length} items directly`)},o=(d,u="start",c=!1)=>{let p=i.querySelector(`[data-id="${d}"]`);if(p)p.scrollIntoView({behavior:c?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})},l=(d,u="start",c=!1)=>{if(d<0||d>=n.length)return;let p=i.children[d];if(p)p.scrollIntoView({behavior:c?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})};if(a(),t.lifecycle?.destroy){let d=t.lifecycle.destroy;t.lifecycle.destroy=()=>{i.innerHTML="",d()}}return{...t,list:{getItems:()=>n,getAllItems:()=>n,getVisibleItems:()=>n,refresh:a,scrollToItem:o,scrollToIndex:l,loadNext:()=>Promise.resolve({hasNext:!1,items:[]}),loadPage:()=>Promise.resolve({hasNext:!1,items:[]}),loadPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollNext:()=>Promise.resolve({hasNext:!1,items:[]}),scrollPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollToItemById:(d,u,c)=>(o(d,u,c),Promise.resolve()),onCollectionChange:()=>()=>{},onPageChange:()=>()=>{},getCurrentPage:()=>1,getPageSize:()=>n.length,getCollection:()=>null,isApiMode:()=>!1,isLoading:()=>!1,hasNextPage:()=>!1}}},Ss=$g;nn();sn();var Vg=(e)=>(t)=>{if(!t.element||!e.trackSelection)return{...t,getSelectedItems:()=>[],getSelectedItemIds:()=>[],isItemSelected:()=>!1,selectItem:()=>t,deselectItem:()=>t,clearSelection:()=>t,setSelection:()=>t};let n=new Set;if(Array.isArray(e.initialSelection))e.initialSelection.forEach((a)=>n.add(String(a)));if(Array.isArray(e.items))e.items.forEach((a,o)=>{if(a?.selected){let l=a.id||String(o);n.add(String(l))}});let r=()=>{(t.element?.querySelectorAll("[data-id]")||[]).forEach((o)=>{let l=o.getAttribute("data-id"),d=n.has(l);if(d&&!it(o,fe.SELECTED))te(o,fe.SELECTED);else if(!d&&it(o,fe.SELECTED))he(o,fe.SELECTED)})},i=(a)=>{let o=a.target.closest("[data-id]");if(!o)return;let l=o.getAttribute("data-id");if(!l)return;let d=t.list?.getItems()||[],u=d.find((p)=>String(p?.id)===l);if(!u){let p=parseInt(l,10);if(!isNaN(p)&&p>=0&&p<d.length)u=d[p]}if(!u){console.warn(`Item not found for ID: ${l}`);return}let c={item:u,element:o,originalEvent:a,component:t,preventDefault:()=>{c.defaultPrevented=!0},defaultPrevented:!1};if(t.emit?.(Qr.SELECT,c),c.defaultPrevented)return;if(e.multiSelect)if(n.has(l))n.delete(l),he(o,fe.SELECTED);else n.add(l),te(o,fe.SELECTED);else{let p=it(o,fe.SELECTED);if(t.element.querySelectorAll(`.${Y}-${fe.SELECTED}`).forEach((f)=>he(f,fe.SELECTED)),n.clear(),!p)n.add(l),te(o,fe.SELECTED)}},s=(a,o)=>{let l=String(a);if(o)n.add(l);else n.delete(l);let d=t.element.querySelector(`[data-id="${l}"]`);if(d){if(o&&!it(d,fe.SELECTED))te(d,fe.SELECTED);else if(!o&&it(d,fe.SELECTED))he(d,fe.SELECTED)}};if(t.element.addEventListener("click",i),setTimeout(r,10),t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{t.element.removeEventListener("click",i),a()}}return{...t,getSelectedItems:()=>(t.list?.getItems()||[]).filter((o,l)=>{let d=o?.id||String(l);return n.has(String(d))}),getSelectedItemIds:()=>Array.from(n),isItemSelected:(a)=>n.has(String(a)),selectItem:(a)=>(s(a,!0),t),deselectItem:(a)=>(s(a,!1),t),clearSelection:()=>{if(n.size>0)n.clear(),t.element.querySelectorAll(`.${Y}-${fe.SELECTED}`).forEach((a)=>he(a,fe.SELECTED));return t},setSelection:(a)=>{if(n.clear(),Array.isArray(a))a.forEach((o)=>n.add(String(o)));return r(),t}}},ys=Vg;var ju=({list:e,selection:t,events:n,lifecycle:r,config:i})=>(s)=>({...s,element:s.element,refresh:async()=>(e.refresh(),s),getAllItems:()=>e.getAllItems(),getVisibleItems:()=>e.getVisibleItems(),scrollToItem:(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToItem(a,o,d),s},scrollToIndex:async(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToIndex(a,o,d),s},isLoading:()=>e.isLoading(),hasNextPage:()=>e.hasNextPage(),getSelectedItems:()=>t.getSelectedItems(),getSelectedItemIds:()=>t.getSelectedItemIds(),isItemSelected:(a)=>t.isItemSelected(a),selectItem:(a)=>(t.selectItem(a),s),deselectItem:(a)=>(t.deselectItem(a),s),clearSelection:()=>(t.clearSelection(),s),setSelection:(a)=>(t.setSelection(a),s),on:(a,o)=>(n.on(a,o),s),off:(a,o)=>(n.off(a,o),s),destroy:()=>{r.destroy()}});Q();var Fg={items:[],trackSelection:!0,multiSelect:!1,animate:!1},Zu=(e={})=>{if(!Array.isArray(e.items)&&!e.renderItem)throw Error("List requires either items array or renderItem function");if(Array.isArray(e.items)&&e.items.length>0&&!e.renderItem)e.renderItem=(t)=>{let n=document.createElement("div");return n.className="mtrl-list-item",n.textContent=t.text||t.title||t.headline||t.name||t.id||String(t),n};return _(Fg,e,"list")},Qu=(e)=>{let t={role:"list",tabindex:"0"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"div",attributes:t,className:[fe.CONTAINER,e.class],forwardEvents:{scroll:!0,keydown:!0}})},Ju=(e,t)=>({list:{refresh:e.list?.refresh,getItems:e.list?.getItems,getAllItems:e.list?.getAllItems,getVisibleItems:e.list?.getVisibleItems,scrollToItem:e.list?.scrollToItem,scrollToIndex:e.list?.scrollToIndex,isLoading:()=>!1,hasNextPage:()=>!1},selection:{getSelectedItems:e.getSelectedItems,getSelectedItemIds:e.getSelectedItemIds,isItemSelected:e.isItemSelected,selectItem:e.selectItem,deselectItem:e.deselectItem,clearSelection:e.clearSelection,setSelection:e.setSelection},events:{on:e.on,off:e.off},lifecycle:{destroy:e.lifecycle?.destroy},config:{animate:t?.animate}});var Ug=(e={})=>{try{let t=Zu(e);return console.log(`\uD83D\uDCCB Creating list with ${t.items?.length||0} items`),M(D,B(),O(Qu(t)),Ss(t),ys(t),P(),(r)=>ju(Ju(r,t))(r))(t)}catch(t){throw console.error("List creation error:",t),Error(`Failed to create list: ${t.message}`)}},xs=Ug;ne();Z();J();var ec=!1,Gg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu controller: missing element"),t;let n={visible:e.visible||!1,items:e.items||[],position:e.position,selectedItemId:null,activeItemIndex:-1,component:t},r={triggerEvent(b,E={},v){let S={menu:n.component,...E,originalEvent:v,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return t.emit(b,S),S}},i=()=>{if(t.opener&&typeof t.opener.getOpener==="function")return t.opener.getOpener();let{opener:b}=e;if(typeof b==="string"){let E=document.querySelector(b);if(!E)return console.warn(`Menu opener not found: ${b}`),null;return E}if(typeof b==="object"&&b!==null&&"element"in b)return b.element;return b},s=(b,E)=>{let v=document.createElement("li"),S=`${t.getClass("menu-item")}`;if(v.className=S,v.setAttribute("role","menuitem"),v.setAttribute("tabindex","-1"),v.setAttribute("data-id",b.id),v.setAttribute("data-index",E.toString()),b.disabled)v.classList.add(`${S}--disabled`),v.setAttribute("aria-disabled","true");else v.setAttribute("aria-disabled","false");if(n.selectedItemId&&b.id===n.selectedItemId)v.classList.add(`${S}--selected`),v.setAttribute("aria-selected","true");else v.setAttribute("aria-selected","false");if(b.hasSubmenu)v.classList.add(`${S}--submenu`),v.setAttribute("aria-haspopup","true"),v.setAttribute("aria-expanded","false");let y=document.createElement("span");if(y.className=`${t.getClass("menu-item-content")}`,b.icon){let I=document.createElement("span");I.className=`${t.getClass("menu-item-icon")}`,I.innerHTML=b.icon,y.appendChild(I)}let L=document.createElement("span");if(L.className=`${t.getClass("menu-item-text")}`,L.textContent=b.text,b.supportingText){let I=document.createElement("span");I.className=`${t.getClass("menu-item-label")}`;let x=document.createElement("span");x.className=`${t.getClass("menu-item-supporting")}`,x.textContent=b.supportingText,I.appendChild(L),I.appendChild(x),y.appendChild(I)}else y.appendChild(L);if(b.shortcut){let I=document.createElement("span");I.className=`${t.getClass("menu-item-shortcut")}`,I.textContent=b.shortcut,y.appendChild(I)}if(v.appendChild(y),!b.disabled){if(v.addEventListener("click",(I)=>d(I,b,E)),v.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),d(I,b,E)}),v.addEventListener("focus",()=>{n.activeItemIndex=E}),b.hasSubmenu&&e.openSubmenuOnHover)v.addEventListener("mouseenter",()=>{if(t.submenu)t.submenu.handleSubmenuHover(b,E,v)}),v.addEventListener("mouseleave",(I)=>{if(t.submenu)t.submenu.handleSubmenuLeave(I)})}return v},a=(b,E)=>{let v=document.createElement("li");if(v.className=`${t.getClass("menu-divider")}`,v.setAttribute("role","separator"),v.setAttribute("data-index",E.toString()),b.id)v.setAttribute("id",b.id);return v},o=()=>{let b=document.createElement("ul");b.className=`${t.getClass("menu-list")}`,b.setAttribute("role","menu"),n.items.forEach((E,v)=>{if("type"in E&&E.type==="divider")b.appendChild(a(E,v));else b.appendChild(s(E,v))}),t.element.innerHTML="",t.element.appendChild(b)},l=(b)=>{for(let E of n.items){if("id"in E&&E.id===b)return E;if("submenu"in E&&Array.isArray(E.submenu)){for(let v of E.submenu)if("id"in v&&v.id===b)return v}}return null},d=(b,E,v)=>{if(b.preventDefault(),b.stopPropagation(),E.disabled)return;if(E.hasSubmenu&&t.submenu){t.submenu.handleSubmenuClick(E,v,b.currentTarget);return}let S=r.triggerEvent("select",{item:E,itemId:E.id,itemData:E.data},b);if(e.closeOnSelect&&!S.defaultPrevented)p(b,!0)},u=(b)=>{if(!t.element)return;t.element.querySelectorAll(`.${t.getClass("menu-item")}`).forEach((v)=>{if(v.getAttribute("data-id")===b)v.classList.add(`${t.getClass("menu-item--selected")}`),v.setAttribute("aria-selected","true");else v.classList.remove(`${t.getClass("menu-item--selected")}`),v.setAttribute("aria-selected","false")}),n.selectedItemId=b},c=(b,E="mouse")=>{if(n.visible)return;if(n.visible=!0,document.removeEventListener("click",f),!t.element.parentNode)t.element.classList.remove(`${t.getClass("menu--visible")}`),t.element.setAttribute("aria-hidden","true"),t.element.style.transform="scaleY(0)",t.element.style.opacity="0",(e.container||document.body).appendChild(t.element);setTimeout(()=>{let v=i();if(v&&t.position)t.position.positionMenu(v);t.element.setAttribute("aria-hidden","false"),t.element.style.transform="",t.element.style.opacity="",t.element.getBoundingClientRect(),t.element.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(t.keyboard&&t.keyboard.handleInitialFocus)t.keyboard.handleInitialFocus(t.element,E);else{let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}`));if(S.forEach((y)=>{y.tabIndex=-1}),S.length>0)S[0].tabIndex=0,S[0].focus();else t.element.tabIndex=0,t.element.focus()}},100),setTimeout(()=>{if(e.closeOnClickOutside&&n.visible)document.addEventListener("click",f);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",h,{passive:!0}),window.addEventListener("scroll",C,{passive:!0})},0)},20),r.triggerEvent("open",{},b)},p=(b,E=!0)=>{if(!n.visible)return;if(t.emit("menu-closing",{event:b,restoreFocus:E}),t.submenu)t.submenu.closeAllSubmenus();setTimeout(()=>{n.visible=!1,t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("menu--visible")}`),document.removeEventListener("click",f),document.removeEventListener("keydown",m),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),r.triggerEvent("close",{restoreFocus:E},b),setTimeout(()=>{if(t.element.parentNode&&!n.visible)t.element.parentNode.removeChild(t.element)},300)},50)},g=(b,E="mouse")=>{if(n.visible)p(b);else{if(b){if(b instanceof KeyboardEvent)E="keyboard";else if(b instanceof MouseEvent)E="mouse"}c(b,E)}},f=(b)=>{if(ec){ec=!1;return}if(t.element.contains(b.target))return;let E=i();if(E&&E.contains(b.target))return;if(t.submenu&&t.submenu.hasOpenSubmenu()){let v=t.submenu.getActiveSubmenus();for(let S of v)if(S.element.contains(b.target))return}p(b,!1)},m=(b)=>{let E=t.element.contains(b.target),v=t.submenu&&t.submenu.hasOpenSubmenu()&&t.submenu.getActiveSubmenus().some((S)=>S.element.contains(b.target));if(n.visible){if(E||v){if(b.key==="Escape")b.preventDefault(),p(b,!0)}else if(t.keyboard&&t.keyboard.handleMenuKeydown)t.keyboard.handleMenuKeydown(b,n,{closeMenu:p,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null})}},h=()=>{if(n.visible)if(e.closeOnResize)p(void 0,!0);else{let b=i();if(b&&t.position)t.position.positionMenu(b)}},C=()=>{if(n.visible)window.requestAnimationFrame(()=>{let b=i();if(b&&t.position)t.position.positionMenu(b)})},T=()=>{if(o(),t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(t.element,n,{closeMenu:p,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null});if(n.visible){let b=i();if(b&&t.position)t.position.positionMenu(b);if(t.element.classList.add(`${t.getClass("menu--visible")}`),e.closeOnClickOutside)document.addEventListener("click",f);if(e.closeOnEscape)document.addEventListener("keydown",m);window.addEventListener("resize",h),window.addEventListener("scroll",C)}};if(t.on("create-menu-items",(b)=>{let{items:E,container:v,onItemCreated:S}=b;E.forEach((y,L)=>{let I;if("type"in y&&y.type==="divider")I=a(y,L);else I=s(y,L);if(v.appendChild(I),S)S(I)})}),setTimeout(T,0),t.lifecycle){let b=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{document.removeEventListener("click",f),document.removeEventListener("keydown",m),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),b()}}return{...t,menu:{open:(b,E="mouse")=>(c(b,E),t),close:(b,E=!0)=>(p(b,E),t),toggle:(b,E="mouse")=>(g(b,E),t),isOpen:()=>n.visible,setItems:(b)=>(n.items=b,o(),t),getItems:()=>n.items,setPosition:(b)=>{if(n.position=b,n.visible){let E=i();if(E&&t.position)t.position.positionMenu(E)}return t},getPosition:()=>n.position,setSelected:(b)=>(u(b),t),getSelected:()=>n.selectedItemId}}},Is=Gg;var zg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu opener: missing element"),t;let n=!1;document.addEventListener("keydown",(m)=>{n=m.key==="Tab",setTimeout(()=>{n=!1},100)});let r={openerElement:null,openerComponent:null,activeClass:""},i=(m)=>{if(!m)return{element:null,component:null};if(typeof m==="string"){let h=document.querySelector(m);if(!h)return console.warn(`Menu opener not found: ${m}`),{element:null,component:null};return{element:h,component:null}}if(typeof m==="object"&&m!==null){if("element"in m&&m.element instanceof HTMLElement)return{element:m.element,component:m};if("getElement"in m&&typeof m.getElement==="function"){let h=m.getElement();if(h instanceof HTMLElement)return{element:h,component:m}}if("input"in m&&m.input instanceof HTMLElement)return{element:m.input,component:m};if(m instanceof HTMLElement)return{element:m,component:null}}return console.warn("Invalid opener type:",m),{element:null,component:null}},s=(m)=>{let h=t.getClass("").split("-")[0];if(m.tagName==="BUTTON")return`${h}-button--active`;else if(m.classList.contains(`${h}-chip`))return`${h}-chip--selected`;else if(m.classList.contains(`${h}-textfield`)||m.classList.contains(`${h}-select`))return`${h}-textfield--focused`;else return`${h}-menu-opener--active`},a=(m)=>{let{element:h,component:C}=m;if(!h)return;if(r.openerElement&&r.openerElement!==h)p();if(r.openerElement=h,r.openerComponent=C,r.activeClass=s(h),!e.manualOpen)h.addEventListener("click",d),h.addEventListener("keydown",u),h.addEventListener("blur",c);h.setAttribute("aria-haspopup","true"),h.setAttribute("aria-expanded","false");let T=t.element.id;if(!T)T=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,t.element.id=T;h.setAttribute("aria-controls",T)},o=(m)=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.setActive==="function"){r.openerComponent.setActive(m);return}if(r.openerComponent&&"selected"in r.openerComponent){r.openerComponent.selected=m;return}if(r.openerComponent&&typeof r.openerComponent.focus==="function"&&typeof r.openerComponent.blur==="function"){if(m)r.openerComponent.focus();else r.openerComponent.blur();return}if(r.openerElement.classList)if(m)r.openerElement.classList.add(r.activeClass);else r.openerElement.classList.remove(r.activeClass)},l=()=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.focus==="function"){requestAnimationFrame(()=>{r.openerComponent.focus()});return}if(r.openerComponent&&"input"in r.openerComponent&&r.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{r.openerComponent.input.focus()});return}requestAnimationFrame(()=>{r.openerElement.focus()})},d=(m)=>{if(m.preventDefault(),m.stopPropagation(),t.menu)if(t.menu.isOpen())t.menu.close(m);else t.menu.open(m,"mouse")},u=(m)=>{if(!t.menu)return;let h=t.menu.isOpen();switch(m.key){case"Enter":case" ":case"ArrowDown":case"Down":if(m.preventDefault(),!h)t.menu.open(m,"keyboard");break;case"Escape":if(h)m.preventDefault(),t.menu.close(m);break;case"ArrowUp":case"Up":if(m.preventDefault(),!h)t.menu.open(m,"keyboard"),setTimeout(()=>{let C=t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`);if(C.length>0){C.forEach((b)=>b.setAttribute("tabindex","-1"));let T=C[C.length-1];T.setAttribute("tabindex","0"),T.focus()}},100);break}},c=(m)=>{if(!t.menu||!t.menu.isOpen())return;let h=m.relatedTarget;if(n){setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},10);return}if(h){if(t.element.contains(h))return;if(h.getAttribute("aria-haspopup")==="true"||h.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(m,!1)},50)},p=()=>{if(r.openerElement){if(!e.manualOpen)r.openerElement.removeEventListener("click",d),r.openerElement.removeEventListener("keydown",u),r.openerElement.removeEventListener("blur",c);r.openerElement.removeAttribute("aria-haspopup"),r.openerElement.removeAttribute("aria-expanded"),r.openerElement.removeAttribute("aria-controls"),o(!1)}r.openerComponent=null,r.openerElement=null,r.activeClass=""},{element:g,component:f}=i(e.opener);if(a({element:g,component:f}),t.lifecycle){let m=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{p(),m()}}return t.on("open",()=>{if(r.openerElement)r.openerElement.setAttribute("aria-expanded","true"),o(!0)}),t.on("close",(m)=>{if(r.openerElement){if(r.openerElement.setAttribute("aria-expanded","false"),o(!1),m.restoreFocus&&!n)l()}}),{...t,opener:{setOpener(m){let h=i(m);if(h.element)a(h);return t},getOpener(){return r.openerElement},getOpenerComponent(){return r.openerComponent},setActive(m){return o(m),t},focus(){return l(),t}}}},Ls=zg;var Wg=(e,t)=>{let n=(s,a,o,l=!1)=>{if(!s||!a)return;let d=t.container&&t.container!==document.body;s.style.position="absolute";let u=d?0:window.pageXOffset||document.documentElement.scrollLeft,c=d?0:window.pageYOffset||document.documentElement.scrollTop,p=a.getBoundingClientRect(),g=s.cloneNode(!0);if(g.style.visibility="hidden",g.style.display="block",g.style.position="absolute",g.style.top="0",g.style.left="0",g.style.transform="none",g.style.opacity="0",g.style.pointerEvents="none",g.classList.add(`${e.getClass("menu--visible")}`),t.width==="100%"&&!l)g.style.width=`${p.width}px`;let f=t.container||document.body;f.appendChild(g);let m=g.getBoundingClientRect(),{innerWidth:h,innerHeight:C}=window;f.removeChild(g);let T=t.offset!==void 0?t.offset:8,b=0,E=0,v=o;if(l){if(v=o||"right-start",v.startsWith("right")&&p.right+m.width+T>h-16)v=v.replace("right","left");else if(v.startsWith("left")&&p.left-m.width-T<16)v=v.replace("left","right");if(p.top+m.height>C-48){if(v==="right-start")v="right-end";else if(v==="left-start")v="left-end"}}else switch(o){case"top-start":case"top":case"top-end":if(p.top<m.height+T+48)v=o.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(p.bottom+m.height+T+48>C){if(p.top>C-p.bottom)v=o.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(p.bottom+m.height>C-48){if(o==="right-start")v="right-end";else if(o==="left-start")v="left-end";else if(o==="right")b=p.top-(m.height-p.height)-T;else if(o==="left")b=p.top-(m.height-p.height)-T}break}if(["position-top","position-bottom","position-right","position-left"].forEach((j)=>{s.classList.remove(`${e.getClass("menu")}--${j}`)}),v.startsWith("top")||v==="right-end"||v==="left-end"||v==="right"&&b<p.top||v==="left"&&b<p.top)s.classList.add(`${e.getClass("menu")}--position-top`);else if(v.startsWith("left"))s.classList.add(`${e.getClass("menu")}--position-left`);else if(v.startsWith("right"))s.classList.add(`${e.getClass("menu")}--position-right`);else s.classList.add(`${e.getClass("menu")}--position-bottom`);let L=d&&t.container?t.container.getBoundingClientRect():{top:0,left:0,right:0,bottom:0},I=d?-L.left:u,x=d?-L.top:c;switch(v){case"top-start":b=p.top+x-m.height-T,E=p.left+I;break;case"top":b=p.top+x-m.height-T,E=p.left+I+p.width/2-m.width/2;break;case"top-end":b=p.top+x-m.height-T,E=p.right+I-m.width;break;case"right-start":b=p.top+x,E=p.right+I+T;break;case"right":if(b===0)b=p.top+x+p.height/2-m.height/2;else b+=x;E=p.right+I+T;break;case"right-end":b=p.bottom+x-m.height,E=p.right+I+T;break;case"bottom-start":b=p.bottom+x+T,E=p.left+I;break;case"bottom":b=p.bottom+x+T,E=p.left+I+p.width/2-m.width/2;break;case"bottom-end":b=p.bottom+x+T,E=p.right+I-m.width;break;case"left-start":b=p.top+x,E=p.left+I-m.width-T;break;case"left":if(b===0)b=p.top+x+p.height/2-m.height/2;else b+=x;E=p.left+I-m.width-T;break;case"left-end":b=p.bottom+x-m.height,E=p.left+I-m.width-T;break}if(d){if(s.style.top=`${b}px`,s.style.left=`${E}px`,t.width==="100%"&&!l)s.style.width=`${p.width}px`;if(t.maxHeight)s.style.maxHeight=t.maxHeight;return}let A=48;if(b-c<A)b=A+c;let N=48;if(b-c+m.height>C-N){let j=C-(b-c)-N,pe=Math.min(m.height,100),ge=Math.max(j,pe);if(s.style.maxHeight=`${ge}px`,t.maxHeight){let w=parseInt(t.maxHeight,10);if(!isNaN(w)&&w<parseInt(s.style.maxHeight||"0",10))s.style.maxHeight=t.maxHeight}}else if(t.maxHeight)s.style.maxHeight=t.maxHeight;if(t.width==="100%"&&!l)s.style.width=`${p.width}px`;let X=Math.max(A+c,b),U=Math.max(16+u,E);if(s.style.top=`${X}px`,s.style.left=`${U}px`,U-u+m.width>h-16)s.style.left="auto",s.style.right="16px"};return{positionMenu:(s)=>{if(!s||!e.element)return;n(e.element,s,t.position,!1)},positionSubmenu:(s,a,o=1)=>{if(!s||!a)return;let l=o%2===1?"right-start":"left-start";s.style.zIndex=`${1000+o*10}`,n(s,a,l,!0)},positionElement:n}},Kg=(e)=>(t)=>{if(!t.element)return t;let n=Wg(t,e);return{...t,position:n}},As=Kg;var Yg=(e)=>{let t=!1,n="",r=null,i=500;(()=>{document.addEventListener("keydown",(g)=>{t=g.key==="Tab",setTimeout(()=>{t=!1},100)})})();let a=()=>{let f=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(f).filter((m)=>m.offsetParent!==null&&!m.classList.contains("hidden"))},o=(g)=>Array.from(g.querySelectorAll(`.${e.getClass("menu-item")}`)),l=()=>{if(n="",r)clearTimeout(r),r=null},d=(g,f)=>{l();let m=o(g);if(m.forEach((h)=>h.setAttribute("tabindex","-1")),m.length>0)m[0].setAttribute("tabindex","0"),m[0].focus();else g.setAttribute("tabindex","0"),g.focus()},u=(g,f,m)=>{let h=f.activeSubmenu&&f.activeSubmenu.contains(g.target),C=h?f.activeSubmenu:e.element,T=o(C);if(T.length===0)return;let b=document.activeElement,E=-1;if(b&&T.includes(b))E=T.indexOf(b);let v=(S)=>{if(T[S])T[S].focus()};if(g.key.length===1&&!g.ctrlKey&&!g.metaKey&&!g.altKey){if(g.preventDefault(),g.stopPropagation(),n+=g.key.toLowerCase(),r)clearTimeout(r);r=setTimeout(()=>{n="",r=null},i);let S=T.findIndex((y)=>(y.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(n));if(S!==-1)v(S);else if(n.length>1){let y=n.slice(-1),L=T.findIndex((I)=>(I.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(y));if(L!==-1)n=y,v(L)}return}switch(g.key){case"ArrowDown":case"Down":if(g.preventDefault(),g.stopPropagation(),E<0)v(0);else if(E<T.length-1)v(E+1);else v(0);break;case"ArrowUp":case"Up":if(g.preventDefault(),g.stopPropagation(),E<0)v(T.length-1);else if(E>0)v(E-1);else v(T.length-1);break;case"Home":g.preventDefault(),g.stopPropagation(),v(0);break;case"End":g.preventDefault(),g.stopPropagation(),v(T.length-1);break;case"Enter":case" ":if(g.preventDefault(),g.stopPropagation(),E>=0)T[E].click();break;case"ArrowRight":case"Right":if(g.preventDefault(),g.stopPropagation(),h){if(E>=0&&T[E].classList.contains(`${e.getClass("menu-item--submenu")}`)){let y=T[E],L=parseInt(y.getAttribute("data-index"),10),x=y.closest(`.${e.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),A=m.findItemById(x);if(A&&A.submenu){let N=A.submenu[L];m.handleNestedSubmenuClick(N,L,y)}}}else if(E>=0&&T[E].classList.contains(`${e.getClass("menu-item--submenu")}`)){let y=T[E],L=parseInt(y.getAttribute("data-index"),10),I=f.items[L];m.handleSubmenuClick(I,L,y)}break;case"ArrowLeft":case"Left":if(g.preventDefault(),g.stopPropagation(),h)if(f.activeSubmenuItem){let y=f.activeSubmenuItem,L=parseInt(C.getAttribute("data-level")||"1",10);if(m.closeSubmenu(L),y)y.focus()}else m.closeSubmenu(1);break;case"Escape":if(g.preventDefault(),g.stopPropagation(),h)if(f.activeSubmenuItem){let y=f.activeSubmenuItem,L=parseInt(C.getAttribute("data-level")||"1",10);if(m.closeSubmenu(L),y)y.focus()}else m.closeSubmenu(1);else m.closeMenu(g,!0);break;case"Tab":if(n="",r)clearTimeout(r),r=null;g.preventDefault();let S=e.opener?.getOpener?.();if(m.closeMenu(g,!0),S)setTimeout(()=>{if(g.shiftKey);else{let y=a(),L=y.indexOf(S);if(L>=0&&L<y.length-1)y[L+1].focus()}},0);break}};return{handleInitialFocus:d,handleMenuKeydown:u,setupKeyboardHandlers:(g,f,m)=>{let h=g.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(h.forEach((C)=>{C.tabIndex=-1}),h.length>0)h[0].tabIndex=0;g.addEventListener("keydown",(C)=>u(C,f,m))},isTabNavigationActive:()=>t,getFocusableElements:a,resetTypeahead:l}},Xg=()=>(e)=>{if(!e.element)return e;let t=Yg(e);return{...e,keyboard:t}},Ns=Xg;var qg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu submenu: missing element"),t;let n={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:t},r=()=>{if(n.hoverIntent.timer)clearTimeout(n.hoverIntent.timer),n.hoverIntent.timer=null,n.hoverIntent.activeItem=null},i=()=>{if(n.submenuTimer)clearTimeout(n.submenuTimer),n.submenuTimer=null},s=(b,E,v)=>{if(!e.openSubmenuOnHover||!b.hasSubmenu)return;r(),i(),n.hoverIntent.activeItem=v,n.hoverIntent.timer=setTimeout(()=>{if(v.matches(":hover")){if(n.activeSubmenuItem!==v)u(b,E,v)}n.hoverIntent.timer=null},100)},a=()=>{r(),i(),n.submenuTimer=setTimeout(()=>{let{activeSubmenu:b,activeSubmenuItem:E}=n;if(b&&E){let v=b.matches(":hover"),S=E.matches(":hover");if(!v&&!S)c(n.submenuLevel)}n.submenuTimer=null},300)},o=(b,E,v)=>{if(!b.submenu||!b.hasSubmenu)return;let S=v.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((L)=>L.isOpening))return;if(S){let L=parseInt(v.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);c(L+1),v.setAttribute("aria-expanded","false")}else u(b,E,v)},l=(b,E,v)=>{if(!b.submenu||!b.hasSubmenu)return;let S=v.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((L)=>L.isOpening))return;if(S){let L=parseInt(v.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);c(L+1)}else u(b,E,v)},d=(b)=>{let E=t.getClass("menu--active"),v=t.getClass("menu--inactive"),S=[t.element,...n.activeSubmenus.map((y)=>y.element)];for(let y of S){if(!y)continue;let L=y===b;y.classList.toggle(E,L),y.classList.toggle(v,b!==null&&!L)}},u=(b,E,v)=>{if(!b.submenu||!b.hasSubmenu)return;let S=v.closest(`.${t.getClass("menu--submenu")}`)?parseInt(v.closest(`.${t.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(c(S),n.activeSubmenus.findIndex((A)=>A.menuItem===v&&A.isOpening)>=0)return;v.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${t.getClass("menu")} ${t.getClass("menu--submenu")}`;for(let A of["menu--vertical","menu--vibrant","menu--dense"]){let N=t.getClass(A);if(t.element.classList.contains(N))L.classList.add(N)}L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",S.toString()),L.setAttribute("data-parent-item",b.id),L.style.zIndex=`${1000+S*10}`;let I=document.createElement("ul");I.className=`${t.getClass("menu-list")}`;let x=[];if(t.emit("create-menu-items",{items:b.submenu,container:I,level:S,onItemCreated:(A)=>{if(!A.classList.contains(`${t.getClass("menu-item--disabled")}`))x.push(A)}}),L.appendChild(I),document.body.appendChild(L),t.position&&t.position.positionSubmenu)t.position.positionSubmenu(L,v,S);if(t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(L,{activeSubmenus:n.activeSubmenus},{closeSubmenu:c,handleNestedSubmenuClick:l});L.addEventListener("mouseenter",()=>{i()}),L.addEventListener("mouseleave",()=>{a()}),n.activeSubmenu=L,n.activeSubmenuItem=v,n.activeSubmenus.push({element:L,menuItem:v,level:S,isOpening:!0}),n.submenuLevel=S,d(L),document.addEventListener("click",g),window.addEventListener("resize",f,{passive:!0}),window.addEventListener("scroll",m,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{let A=n.activeSubmenus.findIndex((N)=>N.element===L);if(A!==-1)n.activeSubmenus[A].isOpening=!1;if(x.length>0){if(S>=2||document.activeElement===v)x[0].setAttribute("tabindex","0"),x[0].focus()}},300)}),t.emit("submenu-opened",{submenuElement:L,parentItem:v,level:S,item:b})},c=(b)=>{r(),i();let E=[];for(let v=n.activeSubmenus.length-1;v>=0;v--)if(n.activeSubmenus[v].level>=b){let S=n.activeSubmenus[v];if(S.menuItem)S.menuItem.setAttribute("aria-expanded","false");S.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(S.element.parentNode)S.element.parentNode.removeChild(S.element)},200),E.push(v)}if(E.forEach((v)=>{n.activeSubmenus.splice(v,1)}),n.activeSubmenus.length>0){let v=n.activeSubmenus[n.activeSubmenus.length-1];if(n.activeSubmenu=v.element,n.activeSubmenuItem=v.menuItem,n.submenuLevel=v.level,v.menuItem)v.menuItem.focus();d(v.element)}else n.activeSubmenu=null,n.activeSubmenuItem=null,n.submenuLevel=0;t.emit("submenu-closed",{level:b})},p=()=>{if(d(null),r(),i(),n.activeSubmenus.length===0)return;[...n.activeSubmenus].forEach((b)=>{if(b.menuItem)b.menuItem.setAttribute("aria-expanded","false");b.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(b.element.parentNode)b.element.parentNode.removeChild(b.element)},200)}),n.activeSubmenu=null,n.activeSubmenuItem=null,n.activeSubmenus=[],n.submenuLevel=0,document.removeEventListener("click",g),window.removeEventListener("resize",f),window.removeEventListener("scroll",m),t.emit("all-submenus-closed",{})},g=(b)=>{if(!n.activeSubmenu)return;let{activeSubmenu:E,activeSubmenuItem:v}=n;if(E.contains(b.target)||v&&v.contains(b.target))return;p()},f=()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)},m=()=>{window.requestAnimationFrame(()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)})},h=()=>n.activeSubmenus.length>0,C=()=>n.submenuLevel,T=()=>[...n.activeSubmenus];if(t.lifecycle){let b=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(r(),i(),document.removeEventListener("click",g),window.removeEventListener("resize",f),window.removeEventListener("scroll",m),n.activeSubmenus.length>0)n.activeSubmenus.forEach((E)=>{if(E.element.parentNode)E.element.parentNode.removeChild(E.element)});b()}}return t.on("menu-closing",()=>{p()}),{...t,submenu:{openSubmenu:u,closeSubmenu:c,closeAllSubmenus:p,handleSubmenuClick:o,handleNestedSubmenuClick:l,handleSubmenuHover:s,handleSubmenuLeave:a,hasOpenSubmenu:h,getSubmenuLevel:C,getActiveSubmenus:T}}},ws=qg;var tc=({menu:e,opener:t,events:n,lifecycle:r})=>(i)=>({element:i.element,open(a,o="mouse"){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard"}return e.open(a,o),this},close(a,o=!0,l=!1){return e.close(a,o,l),this},toggle(a,o){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard";else if(a instanceof MouseEvent)o="mouse"}return e.toggle(a,o),this},isOpen(){return e.isOpen()},setItems(a){return e.setItems(a),this},getItems(){return e.getItems()},setOpener(a){return t.setOpener(a),this},getOpener(){return t.getOpener()},setPosition(a){return e.setPosition(a),this},getPosition(){return e.getPosition()},setSelected(a){return e.setSelected(a),this},getSelected(){return e.getSelected()},on(a,o){if(n?.on)n.on(a,o);else if(i.on)i.on(a,o);return this},off(a,o){if(n?.off)n.off(a,o);else if(i.off)i.off(a,o);return this},destroy(){r.destroy()}});Q();var jg={BASELINE:"baseline",VERTICAL:"vertical"},Zg={STANDARD:"standard",VIBRANT:"vibrant"},Qg={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},Dt={VARIANT:jg.BASELINE,COLOR:Zg.STANDARD,POSITION:Qg.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0};var nc={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator",DENSE:"menu--dense"};var Jg={items:[],position:Dt.POSITION,closeOnSelect:Dt.CLOSE_ON_SELECT,closeOnClickOutside:Dt.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:Dt.CLOSE_ON_ESCAPE,openSubmenuOnHover:Dt.OPEN_SUBMENU_ON_HOVER,offset:Dt.OFFSET,autoFlip:Dt.AUTO_FLIP,visible:!1},rc=(e)=>{if(!e.opener)throw Error("Menu component requires an opener element or selector");return _(Jg,e,"menu")},ic=(e)=>{let t={};if(e.width)t.width=e.width;if(e.maxHeight)t.maxHeight=e.maxHeight;let n={role:"menu",tabindex:"-1","aria-hidden":(!e.visible).toString(),style:Object.entries(t).map(([r,i])=>`${r}: ${i}`).join(";")};return V(e,{tag:"div",attributes:n,className:[e.visible?nc.VISIBLE:null,e.dense?`${e.prefix}-menu--dense`:null,e.variant==="vertical"?`${e.prefix}-menu--vertical`:null,e.variant==="vertical"&&e.color==="vibrant"?`${e.prefix}-menu--vibrant`:null,e.class].filter(Boolean),forwardEvents:{keydown:!0}})},sc=(e)=>({menu:{open:(t,n)=>e.menu?.open(t,n),close:(t,n,r)=>e.menu?.close(t,n,r),toggle:(t,n)=>e.menu?.toggle(t,n),isOpen:()=>e.menu?.isOpen()||!1,setItems:(t)=>e.menu?.setItems(t),getItems:()=>e.menu?.getItems()||[],setPosition:(t)=>e.menu?.setPosition(t),getPosition:()=>e.menu?.getPosition(),setSelected:(t)=>e.menu?.setSelected(t),getSelected:()=>e.menu?.getSelected()},opener:{setOpener:(t)=>e.opener?.setOpener(t),getOpener:()=>e.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>e.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>e.submenu?.closeAllSubmenus()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy()}});var eh=(e)=>{try{let t=rc(e),n=M(D,B(),O(ic(t)),As(t),Ns(),ws(t),Is(t),Ls(t),P(),(r)=>tc(sc(r))(r))(t);if(t.on&&typeof n.on==="function")Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(t){throw console.error("Menu creation error:",t),Error(`Failed to create menu: ${t.message}`)}},Ft=eh;ne();Z();J();var ac=(e)=>(t)=>({...t,element:t.element,items:t.items||new Map,addItem(r){if(typeof t.addItem==="function")t.addItem(r);return this},removeItem(r){if(typeof t.removeItem==="function")t.removeItem(r);return this},getItem(r){if(typeof t.getItem==="function")return t.getItem(r);return this.items.get(r)},getAllItems(){if(typeof t.getAllItems==="function")return t.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof t.getActive==="function")return t.getActive();return null},getItemPath(r){if(typeof t.getItemPath==="function")return t.getItemPath(r);return[]},setActive(r){if(typeof t.handleItemClick==="function")t.handleItemClick(r);else if(typeof t.setActive==="function")t.setActive(r);else{let i=this.items.get(r);if(i&&i.element){if(t.emit)t.emit("change",{id:r,item:i,source:"api"})}}return this},enable(){if(e.disabled.enable)e.disabled.enable();return this},disable(){if(e.disabled.disable)e.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),t.emit)t.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),t.emit)t.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(r,i){if(t.on)t.on(r,i);return this},off(r,i){if(t.off)t.off(r,i);return this},destroy(){if(e.lifecycle.destroy)e.lifecycle.destroy()}});var th={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},nh={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},rh={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"};var oc={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},mn={VARIANT:th.STANDARD,POSITION:nh.LEFT,BEHAVIOR:rh.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},ae={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var ih=(e)=>{let t=document.createElement("span");return t.className=`${e}-${ae.EXPAND_ICON}`,t.innerHTML=`
18
+ `,S.addEventListener("click",(y)=>{if(y.preventDefault(),y.stopPropagation(),t&&t.emit)t.emit("dialog:close",{source:"closeButton"})}),E.appendChild(S)}return E},d=()=>{let E=document.createElement("div");if(E.classList.add(t.getClass("dialog-content")),E.id=i,e.content)E.innerHTML=e.content;return E},u=()=>{let E=document.createElement("div");E.classList.add(t.getClass("dialog-footer"));let v=e.footerAlignment||"right";if(v!=="right")te(E,`${t.getClass("dialog-footer")}--${v}`);if(Array.isArray(e.buttons)&&e.buttons.length>0)e.buttons.forEach((S)=>Mu(E,S,t));return E},m=()=>Vt({variant:"full-width",class:t.getClass("dialog-divider")}),p=l(),g=d(),c=Array.isArray(e.buttons)&&e.buttons.length>0?u():null;if(te(t.element,t.getClass("dialog")),e.title)t.element.setAttribute("aria-labelledby",r);else if(e.ariaLabel)t.element.setAttribute("aria-label",e.ariaLabel);if(e.content)t.element.setAttribute("aria-describedby",i);let f=e.size||"medium";if(f!=="medium")te(t.element,`${t.getClass("dialog")}--${f}`);let h=e.animation||"scale";if(h!=="scale")te(t.element,`${t.getClass("dialog")}--${h}`);t.element.appendChild(p);let C=null,T=null;if(e.divider){if(C=m(),C.element.classList.add(t.getClass("dialog-header-divider")),t.element.appendChild(C.element),c)T=m(),T.element.classList.add(t.getClass("dialog-footer-divider"))}if(t.element.appendChild(g),T)t.element.appendChild(T.element);if(c)t.element.appendChild(c);a.appendChild(t.element);let b=e.container||document.body;return b.appendChild(a),{...t,overlay:a,structure:{header:p,content:g,footer:c,headerDivider:C,footerDivider:T,container:b}}},Du=()=>(e)=>({...e,divider:{toggleDivider(t){if(t&&!e.structure.headerDivider){let n=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-header-divider")}`});if(e.element.insertBefore(n.element,e.structure.content),e.structure.headerDivider=n,e.structure.footer&&!e.structure.footerDivider){let r=Vt({variant:"full-width",class:`${e.getClass("dialog-divider")} ${e.getClass("dialog-footer-divider")}`});e.element.insertBefore(r.element,e.structure.footer),e.structure.footerDivider=r}}else if(!t){if(e.structure.headerDivider)e.structure.headerDivider.element.remove(),e.structure.headerDivider=null;if(e.structure.footerDivider)e.structure.footerDivider.element.remove(),e.structure.footerDivider=null}return e},hasDivider(){return e.structure.headerDivider!==null}}}),Mu=(e,t,n)=>{let{text:r,variant:i="text",onClick:s,closeDialog:a=!0,autofocus:o=!1,attributes:l={}}=t,d=Te({text:r,variant:i,...l});if(d.on("click",(u)=>{let m=a;if(typeof s==="function")try{if(s(u,n)===!1)m=!1}catch(p){console.error("Error in onClick handler:",p)}if(m){if(n&&n.emit)n.emit("dialog:close",{source:"button",text:r})}}),o)d.element.setAttribute("autofocus","true");if(e.appendChild(d.element),!n._buttons)n._buttons=[];n._buttons.push({config:t,instance:d})},Ou=()=>(e)=>{let t=e.config.open===!0,n=e.config.animationDuration||150,r='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=null,s=!1,a=[],o=null,l=()=>Array.from(e.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter((E)=>!E.hasAttribute("disabled")&&E.getAttribute("aria-hidden")!=="true"&&(E.offsetWidth>0||E.offsetHeight>0||E===document.activeElement));function d(E){if(E.key!=="Tab")return;let v=l();if(v.length===0){E.preventDefault(),e.element.focus();return}let S=v[0],y=v[v.length-1],L=document.activeElement;if(E.shiftKey&&(L===S||!e.element.contains(L)))y.focus(),E.preventDefault();else if(!E.shiftKey&&L===y)S.focus(),E.preventDefault()}let u=()=>{if(e.config.modal===!1)return;let E=e.overlay.parentElement;if(E)Array.from(E.children).forEach((S)=>{if(S===e.overlay)return;if(S.hasAttribute("inert"))return;S.setAttribute("inert",""),a.push(S)});let v=e.element.ownerDocument.body;if(v&&o===null)o=v.style.overflow,v.style.overflow="hidden"},m=()=>{a.forEach((v)=>v.removeAttribute("inert")),a.length=0;let E=e.element.ownerDocument.body;if(E&&o!==null)E.style.overflow=o,o=null},p=()=>{if(u(),e.config.autofocus!==!1)(e.element.querySelector("[autofocus]")||l()[0]||e.element).focus();if(e.config.trapFocus!==!1)e.element.addEventListener("keydown",d)},g=()=>{if(e.element.removeEventListener("keydown",d),m(),i){if(i.isConnected)i.focus();i=null}},c=()=>{if(e.config.closeOnOverlayClick!==!1)e.overlay.addEventListener("mousedown",h),document.addEventListener("mouseup",C);if(e.config.closeOnEscape!==!1)document.addEventListener("keydown",T)},f=()=>{e.overlay.removeEventListener("mousedown",h),document.removeEventListener("mouseup",C),document.removeEventListener("keydown",T)};function h(E){s=E.target===e.overlay}function C(E){if(s&&E.target===e.overlay)b.close();s=!1}function T(E){if(E.key==="Escape"&&b.isOpen())b.close()}if(t)te(e.overlay,`${e.getClass("dialog-overlay")}--visible`),te(e.element,`${e.getClass("dialog")}--visible`),p(),c();let b={open(){if(this.isOpen())return;i=document.activeElement;let E={dialog:e,defaultPrevented:!1,preventDefault:()=>{E.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(dn.BEFORE_OPEN,E);if(E.defaultPrevented)return;if(e.overlay&&!e.overlay.parentNode)(e.structure.container||document.body).appendChild(e.overlay);te(e.overlay,`${e.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(te(e.element,`${e.getClass("dialog")}--visible`),p(),c(),typeof e.emit==="function")e.emit(dn.OPEN,{dialog:e}),setTimeout(()=>{e.emit(dn.AFTER_OPEN,{dialog:e})},n)},10)},close(){let E={dialog:e,defaultPrevented:!1,preventDefault:()=>{E.defaultPrevented=!0}};if(typeof e.emit==="function")e.emit(dn.BEFORE_CLOSE,E);if(E.defaultPrevented){console.log("Dialog close prevented by event handler");return}let v=`${e.getClass("dialog")}--visible`,S=`${e.getClass("dialog-overlay")}--visible`;if(he(e.element,v),he(e.overlay,S),g(),f(),typeof e.emit==="function")e.emit(dn.CLOSE,{dialog:e});setTimeout(()=>{if(e.overlay&&e.overlay.parentNode)e.overlay.parentNode.removeChild(e.overlay);if(typeof e.emit==="function")e.emit(dn.AFTER_CLOSE,{dialog:e})},n)},toggle(E){if(E===void 0)this.isOpen()?this.close():this.open();else if(E)this.open();else this.close()},isOpen(){return e.element.classList.contains(`${e.getClass("dialog")}--visible`)}};if(e&&e.on)e.on("dialog:close",()=>{b.close()});return{...e,visibility:b,focus:{trapFocus:p,releaseFocus:g}}},Ru=()=>(e)=>{let t=e.structure.header,n=e.structure.content,r=e.structure.footer;return{...e,content:{setTitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-title")}`);if(!s&&i)s=document.createElement("h2"),s.classList.add(e.getClass("dialog-header-title")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getTitle(){let i=t.querySelector(`.${e.getClass("dialog-header-title")}`);return i?i.textContent||"":""},setSubtitle(i){let s=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);if(!s&&i)s=document.createElement("p"),s.classList.add(e.getClass("dialog-header-subtitle")),t.querySelector(`.${e.getClass("dialog-header-content")}`).appendChild(s);if(s)s.textContent=i},getSubtitle(){let i=t.querySelector(`.${e.getClass("dialog-header-subtitle")}`);return i?i.textContent||"":""},setContent(i){n.innerHTML=i},getContent(){return n.innerHTML},getHeaderElement(){return t},getContentElement(){return n},getFooterElement(){return r}}}},_u=()=>(e)=>{if(!e._buttons)e._buttons=[];return{...e,buttons:{addButton(t){let n=e.structure.footer;if(!n){n=document.createElement("div"),n.classList.add(e.getClass("dialog-footer"));let r=e.config.footerAlignment||"right";if(r!=="right")te(n,`${e.getClass("dialog-footer")}--${r}`);e.element.appendChild(n),e.structure.footer=n}Mu(n,t,e)},removeButton(t){if(typeof t==="number"){if(t>=0&&t<e._buttons.length)e._buttons[t].instance.destroy(),e._buttons.splice(t,1)}else{let n=e._buttons.findIndex((r)=>r.config.text===t);if(n!==-1)e._buttons[n].instance.destroy(),e._buttons.splice(n,1)}if(e._buttons.length===0&&e.structure.footer)e.element.removeChild(e.structure.footer),e.structure.footer=null},getButtons(){return e._buttons.map((t)=>t.config)},setFooterAlignment(t){if(!e.structure.footer)return;if(["right","left","center","space-between"].forEach((r)=>{if(r!=="right")he(e.structure.footer,`${e.getClass("dialog-footer")}--${r}`)}),t!=="right")te(e.structure.footer,`${e.getClass("dialog-footer")}--${t}`)}}}},Pu=()=>(e)=>({...e,size:{setSize(t){if(["small","medium","large","fullwidth","fullscreen"].forEach((r)=>{he(e.element,`${e.getClass("dialog")}--${r}`)}),t!=="medium")te(e.element,`${e.getClass("dialog")}--${t}`)}}}),ku=()=>(e)=>({...e,confirm(t){return new Promise((n)=>{let{title:r="Confirm",message:i,confirmText:s="Yes",cancelText:a="No",confirmVariant:o="filled",cancelVariant:l="text",size:d="small"}=t;e.content.setTitle(r),e.content.setContent(`<p>${i}</p>`),e.size.setSize(d),e._buttons.forEach((u)=>u.instance.destroy()),e._buttons=[],e.buttons.addButton({text:s,variant:o,onClick:()=>{n(!0)}}),e.buttons.addButton({text:a,variant:l,onClick:()=>{n(!1)}}),e.visibility.open()})}});Rn();var Bu=(e)=>(t)=>({...t,open(){return e.visibility.open(),this},close(){return e.visibility.close(),this},toggle(n){return e.visibility.toggle(n),this},isOpen(){return e.visibility.isOpen()},setTitle(n){return e.content.setTitle(n),this},getTitle(){return e.content.getTitle()},setSubtitle(n){return e.content.setSubtitle(n),this},getSubtitle(){return e.content.getSubtitle()},setContent(n){return e.content.setContent(n),this},getContent(){return e.content.getContent()},addButton(n){return e.buttons.addButton(n),this},removeButton(n){return e.buttons.removeButton(n),this},getButtons(){return e.buttons.getButtons()},setFooterAlignment(n){return e.buttons.setFooterAlignment(n),this},toggleDivider(n){return e.divider.toggleDivider(n),this},hasDivider(){return e.divider.hasDivider()},setSize(n){return e.size.setSize(n),this},on(n,r){return e.events.on(n,r),this},off(n,r){return e.events.off(n,r),this},getHeaderElement(){return e.content.getHeaderElement()},getContentElement(){return e.content.getContentElement()},getFooterElement(){return e.content.getFooterElement()},confirm(n){if(t.confirm)return t.confirm(n||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(this.isOpen()){let n=`${t.getClass("dialog")}--visible`,r=`${t.getClass("dialog-overlay")}--visible`;if(he(t.element,n),he(t.overlay,r),e.focus&&e.focus.releaseFocus)e.focus.releaseFocus()}if(e.lifecycle.destroy(),t.overlay&&t.overlay.parentNode)t.overlay.parentNode.removeChild(t.overlay)},element:t.element,overlay:t.overlay});var Ag=(e={})=>{let t=Tu(e);try{let n=O(M,B(),R(Su(t)),wu(t),Ou(),Ru(),_u(),Pu(),Du(),ku(),k(),(r)=>Bu(xu(r))(r))(t);if(t.on)Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(n){throw console.error("Dialog creation error:",n),Error(`Failed to create dialog: ${n.message}`)}},Cs=Ag;ne();Z();J();var Ng={STANDARD:"standard",MODAL:"modal"},wg={START:"start",END:"end"};var Jn={OPEN:"open",CLOSE:"close",SELECT:"select"};var wt={VARIANT:Ng.STANDARD,POSITION:wg.START,OPEN:!1,DISMISSIBLE:!0,WIDTH:360};var Dg=(e,t)=>{let n=document.createElement("button");if(n.className=t("drawer__item"),n.setAttribute("role","tab"),n.setAttribute("tabindex","-1"),e.id)n.dataset.id=e.id;if(e.disabled)n.disabled=!0,n.setAttribute("aria-disabled","true");let r=document.createElement("span");if(r.className=t("drawer__active-indicator"),n.appendChild(r),e.icon){let i=document.createElement("span");i.className=t("drawer__item-icon"),i.innerHTML=e.icon,n.appendChild(i)}if(e.label){let i=document.createElement("span");i.className=t("drawer__item-label"),i.textContent=e.label,n.appendChild(i)}if(e.badge){let i=document.createElement("span");i.className=t("drawer__item-badge"),i.textContent=e.badge,n.appendChild(i)}if(e.active)n.classList.add(`${t("drawer__item")}--active`),n.setAttribute("aria-selected","true"),n.setAttribute("tabindex","0");else n.setAttribute("aria-selected","false");return n},Mg=(e)=>{let t=document.createElement("hr");return t.className=e("drawer__divider"),t.setAttribute("role","separator"),t},Og=(e,t)=>{let n=document.createElement("div");return n.className=t("drawer__section-label"),n.textContent=e.label||e.sectionLabel||"",n},Es=(e)=>(t)=>{let n=e.items||[],r=null,i=null,s=n.find((g)=>g.type!=="divider"&&g.type!=="section"&&g.active);if(s?.id)r=s.id;let a=()=>{if(!i)return;i.innerHTML="";let g=0;if(n.forEach((c)=>{let f=c.type||"item";if(f==="divider"){i.appendChild(Mg(t.getClass));return}if(f==="section"){i.appendChild(Og(c,t.getClass));return}let h=Dg(c,t.getClass);h.dataset.navIndex=String(g),g++,h.addEventListener("click",(C)=>{if(c.id&&!c.disabled){o(c.id);let T={id:c.id,label:c.label||"",index:parseInt(h.dataset.navIndex||"0",10),originalEvent:C};if(t.emit(Jn.SELECT,T),e.onSelect)e.onSelect(T)}}),i.appendChild(h)}),!r){let c=i.querySelector(`.${t.getClass("drawer__item")}`);if(c)c.setAttribute("tabindex","0")}},o=(g)=>{if(!i)return;let c=`${t.getClass("drawer__item")}--active`;if(i.querySelectorAll(`.${t.getClass("drawer__item")}`).forEach((h)=>{h.classList.remove(c),h.setAttribute("aria-selected","false"),h.setAttribute("tabindex","-1")}),!g){r=null;let h=i.querySelector(`.${t.getClass("drawer__item")}`);if(h)h.setAttribute("tabindex","0")}else{let h=i.querySelector(`[data-id="${g}"]`);if(h)h.classList.add(c),h.setAttribute("aria-selected","true"),h.setAttribute("tabindex","0"),r=g}n=n.map((h)=>({...h,active:h.id===g}))},l=()=>r,d=(g)=>{n=g,r=g.find((f)=>f.type!=="divider"&&f.type!=="section"&&f.active)?.id||null,a()},u=()=>n,m=(g,c)=>{if(!i)return;let f=i.querySelector(`[data-id="${g}"]`);if(!f)return;let h=f.querySelector(`.${t.getClass("drawer__item-badge")}`);if(c){if(!h)h=document.createElement("span"),h.className=t.getClass("drawer__item-badge"),f.appendChild(h);h.textContent=c}else if(h)h.remove();n=n.map((C)=>C.id===g?{...C,badge:c}:C)},p=(g)=>{if(!i)return;let c=Array.from(i.querySelectorAll(`.${t.getClass("drawer__item")}:not([disabled])`));if(!c.length)return;let f=c.indexOf(document.activeElement),h=-1;switch(g.key){case"ArrowDown":g.preventDefault(),h=f<c.length-1?f+1:0;break;case"ArrowUp":g.preventDefault(),h=f>0?f-1:c.length-1;break;case"Home":g.preventDefault(),h=0;break;case"End":g.preventDefault(),h=c.length-1;break;case"Enter":case" ":if(g.preventDefault(),f>=0)c[f].click();return;default:return}if(h>=0&&h<c.length)c.forEach((C)=>C.setAttribute("tabindex","-1")),c[h].setAttribute("tabindex","0"),c[h].focus()};return i=document.createElement("div"),i.className=t.getClass("drawer__items"),i.setAttribute("role","tablist"),i.setAttribute("aria-orientation","vertical"),i.addEventListener("keydown",p),a(),{...t,itemsContainer:i,drawerItems:{setActive:o,getActive:l,setItems:d,getItems:u,setBadge:m,renderItems:a}}};var bs=(e)=>(t)=>{let n=e.variant==="modal",r=e.dismissible!==!1,i=e.open===!0,s=null;if(n){if(s=document.createElement("div"),s.className=t.getClass("drawer__scrim"),r)s.addEventListener("click",()=>{l()})}let a=(u)=>{if(u.key==="Escape"&&i&&n&&r)u.preventDefault(),l()};if(n)document.addEventListener("keydown",a);function o(){if(i)return;if(i=!0,t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="hidden";if(requestAnimationFrame(()=>{let u=t.element.querySelector(`.${t.getClass("drawer__item")}[tabindex="0"]`);if(u)u.focus();else t.element.focus()}),t.emit(Jn.OPEN),e.onOpen)e.onOpen()}function l(){if(!i)return;if(i=!1,t.element.classList.remove(`${t.getClass("drawer")}--open`),n&&s)s.classList.remove(`${t.getClass("drawer__scrim")}--visible`),document.body.style.overflow="";if(t.emit(Jn.CLOSE),e.onClose)e.onClose()}function d(){if(i)l();else o()}if(i){if(t.element.classList.add(`${t.getClass("drawer")}--open`),n&&s)s.classList.add(`${t.getClass("drawer__scrim")}--visible`)}return{...t,scrimElement:s,drawerState:{open:o,close:l,toggle:d,isOpen:()=>i},_stateCleanup:()=>{if(n){if(document.removeEventListener("keydown",a),s&&s.parentNode)s.parentNode.removeChild(s);document.body.style.overflow=""}}}};var vs=(e)=>(t)=>{let n=null,r=e.headline||"";if(r)n=document.createElement("div"),n.className=t.getClass("drawer__headline"),n.textContent=r;return{...t,headlineElement:n,drawerHeadline:{setHeadline:(a)=>{if(r=a,a){if(!n)n=document.createElement("div"),n.className=t.getClass("drawer__headline");n.textContent=a}else if(n&&n.parentNode)n.parentNode.removeChild(n),n=null},getHeadline:()=>r,getElement:()=>n}}};sn();var Hu=({state:e,items:t,headline:n,lifecycle:r})=>(i)=>{let s={element:i.element,getClass:i.getClass,lifecycle:r,on(a,o){if(i.on)i.on(a,o);return s},off(a,o){if(i.off)i.off(a,o);return s},addClass(...a){if(i.addClass)i.addClass(...a);else te(i.element,...a);return s},open(){return e.open(),s},close(){return e.close(),s},toggle(){return e.toggle(),s},isOpen(){return e.isOpen()},setActive(a){return t.setActive(a),s},getActive(){return t.getActive()},setItems(a){return t.setItems(a),s},getItems(){return t.getItems()||[]},setBadge(a,o){return t.setBadge(a,o),s},setHeadline(a){return n.setHeadline(a),s},getHeadline(){return n.getHeadline()},destroy(){r.destroy()}};return s};Q();var Rg={variant:wt.VARIANT,position:wt.POSITION,open:wt.OPEN,dismissible:wt.DISMISSIBLE,width:wt.WIDTH,items:[]},$u=(e={})=>P(Rg,e,"drawer"),Vu=(e)=>{let t=e.variant==="modal",n={};if(t)n.role="dialog",n["aria-modal"]="true";else n.role="navigation";if(e.ariaLabel)n["aria-label"]=e.ariaLabel;return V(e,{tag:"aside",attributes:n,className:[e.dense?`${e.prefix}-drawer--dense`:null,e.class].filter(Boolean),forwardEvents:{click:!0,keydown:!0}})},Fu=(e)=>({state:{open:()=>e.drawerState.open(),close:()=>e.drawerState.close(),toggle:()=>e.drawerState.toggle(),isOpen:()=>e.drawerState.isOpen()},items:{setActive:(t)=>e.drawerItems.setActive(t),getActive:()=>e.drawerItems.getActive(),setItems:(t)=>e.drawerItems.setItems(t||[]),getItems:()=>e.drawerItems.getItems(),setBadge:(t,n)=>e.drawerItems.setBadge(t,n)},headline:{setHeadline:(t)=>e.drawerHeadline.setHeadline(t),getHeadline:()=>e.drawerHeadline.getHeadline()},lifecycle:{destroy:()=>{if(e._stateCleanup)e._stateCleanup();e.lifecycle.destroy()}}});var _g=(e={})=>{let t=$u(e);try{return O(M,B(),R(Vu(t)),se(t),vs(t),Es(t),bs(t),k(),(r)=>{let i=document.createElement("div");i.className=r.getClass("drawer__sheet");let s=t.width,a=s?typeof s==="number"?`${s}px`:s:`${wt.WIDTH}px`;if(r.element.style.setProperty("--drawer-width",a),r.headlineElement)i.appendChild(r.headlineElement);if(r.itemsContainer)i.appendChild(r.itemsContainer);if(r.scrimElement)r.element.appendChild(r.scrimElement);r.element.appendChild(i);let o=t.position||"start";return r.element.classList.add(`${r.getClass("drawer")}--${o}`),r},(r)=>Hu(Fu(r))(r))(t)}catch(n){throw console.error("Drawer creation error:",n),Error(`Failed to create drawer: ${n.message}`)}},Ts=_g;ne();Z();J();var Uu=({disabled:e,lifecycle:t,className:n})=>(r)=>({...r,element:r.element,getValue:()=>r.element.value,setValue(i){return r.element.value=i,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(i){return r.icon.setIcon(i),this},getIcon(){return r.icon.getIcon()},setPosition(i){return["top-right","top-left","bottom-right","bottom-left"].forEach((a)=>{r.element.classList.remove(`${n}--${a}`)}),r.element.classList.add(`${n}--${i}`),this},getPosition(){let i=["top-right","top-left","bottom-right","bottom-left"];for(let s of i)if(r.element.classList.contains(`${n}--${s}`))return s;return null},lower(){return r.element.classList.add(`${n}--lowered`),this},raise(){return r.element.classList.remove(`${n}--lowered`),this},destroy(){t.destroy()}});Q();var Pg={variant:"primary",size:"default",type:"button",ripple:!0},Gu=(e={})=>P(Pg,e,"fab"),zu=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||(e.icon?"action":void 0)};if(e.disabled===!0)t.disabled=!0;let n=[];if(n.push(`fab--${e.size||"default"}`),e.animate)n.push("fab--animate-enter");if(e.position)n.push(`fab--${e.position}`);if(e.disabled===!0)n.push("fab--disabled");let r={...e,className:n};return V(r,{tag:"button",attributes:t,forwardEvents:{click:(i)=>!i.element.disabled,focus:!0,blur:!0},interactive:!0})},Wu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("fab")});var kg=(e={})=>{let t=Gu(e);try{return O(M,B(),R(zu(t)),se(t),Pe(t),oe(t),Le(t),k(),(r)=>Uu(Wu(r))(r))(t)}catch(n){throw console.error("FAB creation error:",n),Error(`Failed to create FAB: ${n.message}`)}},jr=kg;ne();Z();J();var Ku=({disabled:e,lifecycle:t,text:n,className:r})=>(i)=>({...i,element:i.element,getValue:()=>i.element.value,setValue(s){return i.element.value=s,this},enable(){return e.enable(),this},disable(){return e.disable(),this},setIcon(s){return i.icon.setIcon(s),this},getIcon(){return i.icon.getIcon()},setText(s){return n.setText(s),this},getText(){return n.getText()},setPosition(s){return["top-right","top-left","bottom-right","bottom-left"].forEach((o)=>{i.element.classList.remove(`${r}--${o}`)}),i.element.classList.add(`${r}--${s}`),this},getPosition(){let s=["top-right","top-left","bottom-right","bottom-left"];for(let a of s)if(i.element.classList.contains(`${r}--${a}`))return a;return null},lower(){return i.element.classList.add(`${r}--lowered`),this},raise(){return i.element.classList.remove(`${r}--lowered`),this},collapse(){i.element.classList.add(`${r}--collapsed`);let s=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},expand(){i.element.classList.remove(`${r}--collapsed`);let s=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return i.element.dispatchEvent(s),this},destroy(){t.destroy()}});Q();var Bg={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},Yu=(e={})=>P(Bg,e,"extended-fab"),Xu=(e)=>{let t={type:e.type||"button","aria-label":e.ariaLabel||e.text||(e.icon?"action":void 0)},n=[`${e.prefix}-extended-fab`];if(e.variant)n.push(`${e.prefix}-extended-fab--${e.variant}`);if(e.width)n.push(`${e.prefix}-extended-fab--${e.width}`);if(e.animate)n.push(`${e.prefix}-extended-fab--animate-enter`);if(e.position)n.push(`${e.prefix}-extended-fab--${e.position}`);if(e.collapseOnScroll)n.push(`${e.prefix}-extended-fab--collapsible`);if(e.class)n.push(e.class);if(e.disabled===!0)t.disabled=!0,n.push(`${e.prefix}-extended-fab--disabled`);return V(e,{tag:"button",attributes:t,className:n,forwardEvents:{click:(r)=>!r.element.disabled,focus:!0,blur:!0},interactive:!0})},qu=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()},className:e.getClass("extended-fab"),text:{setText:(t)=>e.text.setText(t),getText:()=>e.text.getText()}});var Hg=(e={})=>{let t=Yu(e),n=(r)=>{if(t.collapseOnScroll){let i=window.scrollY,s=!1,a=10,o=()=>{if(!s)window.requestAnimationFrame(()=>{let d=window.scrollY,u=d-i;if(u>a)r.collapse();else if(u<-a)r.expand();if(d<=0)r.expand();i=d,s=!1}),s=!0};window.addEventListener("scroll",o,{passive:!0}),requestAnimationFrame(()=>{r.expand()});let l=r.destroy;r.destroy=()=>{window.removeEventListener("scroll",o),l.call(r)}}};try{let r=O(M,B(),R(Xu(t)),se(t),Pe(t),ct(t),oe(t),Le(t),k(),(i)=>Ku(qu(i))(i))(t);return n(r),r}catch(r){throw console.error("Extended FAB creation error:",r),Error(`Failed to create Extended FAB: ${r.message}`)}},Zr=Hg;Z();J();var Qr={SELECT:"select",LOAD:"load",SCROLL:"scroll"};var fe={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var $g=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize list renderer: missing element"),t;let n=e.items||[],r=e.renderItem,i=document.createElement("div");i.className="mtrl-list-content",i.setAttribute("role","list"),t.element.appendChild(i);function s(d,u){let m=document.createElement("div");m.className=fe.ITEM,m.setAttribute("role","listitem");let p=document.createElement("div");p.className="mtrl-list-item-content";let g=document.createElement("div");return g.className="mtrl-list-item-text",g.textContent=d.text||d.title||d.headline||d.name||d.id||String(d),p.appendChild(g),m.appendChild(p),m}let a=()=>{if(i.innerHTML="",!n||n.length===0){i.innerHTML='<div class="mtrl-list-empty">No items</div>';return}let d=document.createDocumentFragment();n.forEach((u,m)=>{if(u==null)return;let p=r?r(u,m):s(u,m);if(!p)return;if(!p.classList.contains(fe.ITEM))p.classList.add(fe.ITEM);if(!p.hasAttribute("role"))p.setAttribute("role","listitem");let g=u?.id||String(m);if(!p.hasAttribute("data-id"))p.setAttribute("data-id",g);d.appendChild(p)}),i.appendChild(d),t.emit?.(Qr.LOAD,{items:n,loading:!1,hasNext:!1,hasPrev:!1,component:t}),console.log(`\uD83D\uDCCB Rendered ${n.length} items directly`)},o=(d,u="start",m=!1)=>{let p=i.querySelector(`[data-id="${d}"]`);if(p)p.scrollIntoView({behavior:m?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})},l=(d,u="start",m=!1)=>{if(d<0||d>=n.length)return;let p=i.children[d];if(p)p.scrollIntoView({behavior:m?"smooth":"auto",block:u==="center"?"center":u==="end"?"end":"start"})};if(a(),t.lifecycle?.destroy){let d=t.lifecycle.destroy;t.lifecycle.destroy=()=>{i.innerHTML="",d()}}return{...t,list:{getItems:()=>n,getAllItems:()=>n,getVisibleItems:()=>n,refresh:a,scrollToItem:o,scrollToIndex:l,loadNext:()=>Promise.resolve({hasNext:!1,items:[]}),loadPage:()=>Promise.resolve({hasNext:!1,items:[]}),loadPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollNext:()=>Promise.resolve({hasNext:!1,items:[]}),scrollPrevious:()=>Promise.resolve({hasPrev:!1,items:[]}),scrollToItemById:(d,u,m)=>(o(d,u,m),Promise.resolve()),onCollectionChange:()=>()=>{},onPageChange:()=>()=>{},getCurrentPage:()=>1,getPageSize:()=>n.length,getCollection:()=>null,isApiMode:()=>!1,isLoading:()=>!1,hasNextPage:()=>!1}}},Ss=$g;nn();sn();var Vg=(e)=>(t)=>{if(!t.element||!e.trackSelection)return{...t,getSelectedItems:()=>[],getSelectedItemIds:()=>[],isItemSelected:()=>!1,selectItem:()=>t,deselectItem:()=>t,clearSelection:()=>t,setSelection:()=>t};let n=new Set;if(Array.isArray(e.initialSelection))e.initialSelection.forEach((a)=>n.add(String(a)));if(Array.isArray(e.items))e.items.forEach((a,o)=>{if(a?.selected){let l=a.id||String(o);n.add(String(l))}});let r=()=>{(t.element?.querySelectorAll("[data-id]")||[]).forEach((o)=>{let l=o.getAttribute("data-id"),d=n.has(l);if(d&&!it(o,fe.SELECTED))te(o,fe.SELECTED);else if(!d&&it(o,fe.SELECTED))he(o,fe.SELECTED)})},i=(a)=>{let o=a.target.closest("[data-id]");if(!o)return;let l=o.getAttribute("data-id");if(!l)return;let d=t.list?.getItems()||[],u=d.find((p)=>String(p?.id)===l);if(!u){let p=parseInt(l,10);if(!isNaN(p)&&p>=0&&p<d.length)u=d[p]}if(!u){console.warn(`Item not found for ID: ${l}`);return}let m={item:u,element:o,originalEvent:a,component:t,preventDefault:()=>{m.defaultPrevented=!0},defaultPrevented:!1};if(t.emit?.(Qr.SELECT,m),m.defaultPrevented)return;if(e.multiSelect)if(n.has(l))n.delete(l),he(o,fe.SELECTED);else n.add(l),te(o,fe.SELECTED);else{let p=it(o,fe.SELECTED);if(t.element.querySelectorAll(`.${X}-${fe.SELECTED}`).forEach((c)=>he(c,fe.SELECTED)),n.clear(),!p)n.add(l),te(o,fe.SELECTED)}},s=(a,o)=>{let l=String(a);if(o)n.add(l);else n.delete(l);let d=t.element.querySelector(`[data-id="${l}"]`);if(d){if(o&&!it(d,fe.SELECTED))te(d,fe.SELECTED);else if(!o&&it(d,fe.SELECTED))he(d,fe.SELECTED)}};if(t.element.addEventListener("click",i),setTimeout(r,10),t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{t.element.removeEventListener("click",i),a()}}return{...t,getSelectedItems:()=>(t.list?.getItems()||[]).filter((o,l)=>{let d=o?.id||String(l);return n.has(String(d))}),getSelectedItemIds:()=>Array.from(n),isItemSelected:(a)=>n.has(String(a)),selectItem:(a)=>(s(a,!0),t),deselectItem:(a)=>(s(a,!1),t),clearSelection:()=>{if(n.size>0)n.clear(),t.element.querySelectorAll(`.${X}-${fe.SELECTED}`).forEach((a)=>he(a,fe.SELECTED));return t},setSelection:(a)=>{if(n.clear(),Array.isArray(a))a.forEach((o)=>n.add(String(o)));return r(),t}}},ys=Vg;var ju=({list:e,selection:t,events:n,lifecycle:r,config:i})=>(s)=>({...s,element:s.element,refresh:async()=>(e.refresh(),s),getAllItems:()=>e.getAllItems(),getVisibleItems:()=>e.getVisibleItems(),scrollToItem:(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToItem(a,o,d),s},scrollToIndex:async(a,o,l)=>{let d=l!==void 0?l:i?.animate||!1;return e.scrollToIndex(a,o,d),s},isLoading:()=>e.isLoading(),hasNextPage:()=>e.hasNextPage(),getSelectedItems:()=>t.getSelectedItems(),getSelectedItemIds:()=>t.getSelectedItemIds(),isItemSelected:(a)=>t.isItemSelected(a),selectItem:(a)=>(t.selectItem(a),s),deselectItem:(a)=>(t.deselectItem(a),s),clearSelection:()=>(t.clearSelection(),s),setSelection:(a)=>(t.setSelection(a),s),on:(a,o)=>(n.on(a,o),s),off:(a,o)=>(n.off(a,o),s),destroy:()=>{r.destroy()}});Q();var Fg={items:[],trackSelection:!0,multiSelect:!1,animate:!1},Zu=(e={})=>{if(!Array.isArray(e.items)&&!e.renderItem)throw Error("List requires either items array or renderItem function");if(Array.isArray(e.items)&&e.items.length>0&&!e.renderItem)e.renderItem=(t)=>{let n=document.createElement("div");return n.className="mtrl-list-item",n.textContent=t.text||t.title||t.headline||t.name||t.id||String(t),n};return P(Fg,e,"list")},Qu=(e)=>{let t={role:"list",tabindex:"0"};if(e.ariaLabel)t["aria-label"]=e.ariaLabel;return V(e,{tag:"div",attributes:t,className:[fe.CONTAINER,e.class],forwardEvents:{scroll:!0,keydown:!0}})},Ju=(e,t)=>({list:{refresh:e.list?.refresh,getItems:e.list?.getItems,getAllItems:e.list?.getAllItems,getVisibleItems:e.list?.getVisibleItems,scrollToItem:e.list?.scrollToItem,scrollToIndex:e.list?.scrollToIndex,isLoading:()=>!1,hasNextPage:()=>!1},selection:{getSelectedItems:e.getSelectedItems,getSelectedItemIds:e.getSelectedItemIds,isItemSelected:e.isItemSelected,selectItem:e.selectItem,deselectItem:e.deselectItem,clearSelection:e.clearSelection,setSelection:e.setSelection},events:{on:e.on,off:e.off},lifecycle:{destroy:e.lifecycle?.destroy},config:{animate:t?.animate}});var Ug=(e={})=>{try{let t=Zu(e);return console.log(`\uD83D\uDCCB Creating list with ${t.items?.length||0} items`),O(M,B(),R(Qu(t)),Ss(t),ys(t),k(),(r)=>ju(Ju(r,t))(r))(t)}catch(t){throw console.error("List creation error:",t),Error(`Failed to create list: ${t.message}`)}},xs=Ug;ne();Z();J();var ec=!1,Gg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu controller: missing element"),t;let n={visible:e.visible||!1,items:e.items||[],position:e.position,selectedItemId:null,activeItemIndex:-1,component:t},r={triggerEvent(b,E={},v){let S={menu:n.component,...E,originalEvent:v,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return t.emit(b,S),S}},i=()=>{if(t.opener&&typeof t.opener.getOpener==="function")return t.opener.getOpener();let{opener:b}=e;if(typeof b==="string"){let E=document.querySelector(b);if(!E)return console.warn(`Menu opener not found: ${b}`),null;return E}if(typeof b==="object"&&b!==null&&"element"in b)return b.element;return b},s=(b,E)=>{let v=document.createElement("li"),S=`${t.getClass("menu-item")}`;if(v.className=S,v.setAttribute("role","menuitem"),v.setAttribute("tabindex","-1"),v.setAttribute("data-id",b.id),v.setAttribute("data-index",E.toString()),b.disabled)v.classList.add(`${S}--disabled`),v.setAttribute("aria-disabled","true");else v.setAttribute("aria-disabled","false");if(n.selectedItemId&&b.id===n.selectedItemId)v.classList.add(`${S}--selected`),v.setAttribute("aria-selected","true");else v.setAttribute("aria-selected","false");if(b.hasSubmenu)v.classList.add(`${S}--submenu`),v.setAttribute("aria-haspopup","true"),v.setAttribute("aria-expanded","false");let y=document.createElement("span");if(y.className=`${t.getClass("menu-item-content")}`,b.icon){let I=document.createElement("span");I.className=`${t.getClass("menu-item-icon")}`,I.innerHTML=b.icon,y.appendChild(I)}let L=document.createElement("span");if(L.className=`${t.getClass("menu-item-text")}`,L.textContent=b.text,b.supportingText){let I=document.createElement("span");I.className=`${t.getClass("menu-item-label")}`;let x=document.createElement("span");x.className=`${t.getClass("menu-item-supporting")}`,x.textContent=b.supportingText,I.appendChild(L),I.appendChild(x),y.appendChild(I)}else y.appendChild(L);if(b.shortcut){let I=document.createElement("span");I.className=`${t.getClass("menu-item-shortcut")}`,I.textContent=b.shortcut,y.appendChild(I)}if(v.appendChild(y),!b.disabled){if(v.addEventListener("click",(I)=>d(I,b,E)),v.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),d(I,b,E)}),v.addEventListener("focus",()=>{n.activeItemIndex=E}),b.hasSubmenu&&e.openSubmenuOnHover)v.addEventListener("mouseenter",()=>{if(t.submenu)t.submenu.handleSubmenuHover(b,E,v)}),v.addEventListener("mouseleave",(I)=>{if(t.submenu)t.submenu.handleSubmenuLeave(I)})}return v},a=(b,E)=>{let v=document.createElement("li");if(v.className=`${t.getClass("menu-divider")}`,v.setAttribute("role","separator"),v.setAttribute("data-index",E.toString()),b.id)v.setAttribute("id",b.id);return v},o=()=>{let b=document.createElement("ul");b.className=`${t.getClass("menu-list")}`,b.setAttribute("role","menu"),n.items.forEach((E,v)=>{if("type"in E&&E.type==="divider")b.appendChild(a(E,v));else b.appendChild(s(E,v))}),t.element.innerHTML="",t.element.appendChild(b)},l=(b)=>{for(let E of n.items){if("id"in E&&E.id===b)return E;if("submenu"in E&&Array.isArray(E.submenu)){for(let v of E.submenu)if("id"in v&&v.id===b)return v}}return null},d=(b,E,v)=>{if(b.preventDefault(),b.stopPropagation(),E.disabled)return;if(E.hasSubmenu&&t.submenu){t.submenu.handleSubmenuClick(E,v,b.currentTarget);return}let S=r.triggerEvent("select",{item:E,itemId:E.id,itemData:E.data},b);if(e.closeOnSelect&&!S.defaultPrevented)p(b,!0)},u=(b)=>{if(!t.element)return;t.element.querySelectorAll(`.${t.getClass("menu-item")}`).forEach((v)=>{if(v.getAttribute("data-id")===b)v.classList.add(`${t.getClass("menu-item--selected")}`),v.setAttribute("aria-selected","true");else v.classList.remove(`${t.getClass("menu-item--selected")}`),v.setAttribute("aria-selected","false")}),n.selectedItemId=b},m=(b,E)=>{if(n.visible)return;if(!E)if(b instanceof KeyboardEvent)E="keyboard";else E="mouse";if(n.visible=!0,document.removeEventListener("click",c),!t.element.parentNode)t.element.classList.remove(`${t.getClass("menu--visible")}`),t.element.setAttribute("aria-hidden","true"),t.element.style.transform="scaleY(0)",t.element.style.opacity="0",(e.container||document.body).appendChild(t.element);setTimeout(()=>{let v=i();if(v&&t.position)t.position.positionMenu(v);t.element.setAttribute("aria-hidden","false"),t.element.style.transform="",t.element.style.opacity="",t.element.getBoundingClientRect(),t.element.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(t.keyboard&&t.keyboard.handleInitialFocus)t.keyboard.handleInitialFocus(t.element,E);else{let S=Array.from(t.element.querySelectorAll(`.${t.getClass("menu-item")}`));if(S.forEach((y)=>{y.tabIndex=-1}),S.length>0)S[0].tabIndex=0;if(E==="keyboard"&&S.length>0)S[0].focus();else t.element.tabIndex=-1,t.element.focus()}},100),setTimeout(()=>{if(e.closeOnClickOutside&&n.visible)document.addEventListener("click",c);if(e.closeOnEscape)document.addEventListener("keydown",f);window.addEventListener("resize",h,{passive:!0}),window.addEventListener("scroll",C,{passive:!0})},0)},20),r.triggerEvent("open",{},b)},p=(b,E=!0)=>{if(!n.visible)return;if(t.emit("menu-closing",{event:b,restoreFocus:E}),t.submenu)t.submenu.closeAllSubmenus();setTimeout(()=>{n.visible=!1,t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("menu--visible")}`),document.removeEventListener("click",c),document.removeEventListener("keydown",f),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),r.triggerEvent("close",{restoreFocus:E},b),setTimeout(()=>{if(t.element.parentNode&&!n.visible)t.element.parentNode.removeChild(t.element)},300)},50)},g=(b,E)=>{if(n.visible)p(b);else{if(b){if(b instanceof KeyboardEvent)E="keyboard";else if(b instanceof MouseEvent)E="mouse"}m(b,E)}},c=(b)=>{if(ec){ec=!1;return}if(t.element.contains(b.target))return;let E=i();if(E&&E.contains(b.target))return;if(t.submenu&&t.submenu.hasOpenSubmenu()){let v=t.submenu.getActiveSubmenus();for(let S of v)if(S.element.contains(b.target))return}p(b,!1)},f=(b)=>{let E=t.element.contains(b.target),v=t.submenu&&t.submenu.hasOpenSubmenu()&&t.submenu.getActiveSubmenus().some((S)=>S.element.contains(b.target));if(n.visible){if(E){if(b.key==="Escape")b.preventDefault(),p(b,!0)}else if(v){if(t.keyboard&&t.keyboard.handleMenuKeydown)t.keyboard.handleMenuKeydown(b,n,{closeMenu:p,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null});else if(b.key==="Escape")b.preventDefault(),p(b,!0)}else if(t.keyboard&&t.keyboard.handleMenuKeydown)t.keyboard.handleMenuKeydown(b,n,{closeMenu:p,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null})}},h=()=>{if(n.visible)if(e.closeOnResize)p(void 0,!0);else{let b=i();if(b&&t.position)t.position.positionMenu(b)}},C=()=>{if(n.visible)window.requestAnimationFrame(()=>{let b=i();if(b&&t.position)t.position.positionMenu(b)})},T=()=>{if(o(),t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(t.element,n,{closeMenu:p,closeSubmenu:t.submenu?t.submenu.closeSubmenu:null,findItemById:l,handleSubmenuClick:t.submenu?t.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:t.submenu?t.submenu.handleNestedSubmenuClick:null});if(n.visible){let b=i();if(b&&t.position)t.position.positionMenu(b);if(t.element.classList.add(`${t.getClass("menu--visible")}`),e.closeOnClickOutside)document.addEventListener("click",c);if(e.closeOnEscape)document.addEventListener("keydown",f);window.addEventListener("resize",h),window.addEventListener("scroll",C)}};if(t.on("create-menu-items",(b)=>{let{items:E,container:v,onItemCreated:S}=b;E.forEach((y,L)=>{let I;if("type"in y&&y.type==="divider")I=a(y,L);else I=s(y,L);if(v.appendChild(I),S)S(I)})}),setTimeout(T,0),t.lifecycle){let b=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{document.removeEventListener("click",c),document.removeEventListener("keydown",f),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),b()}}return{...t,menu:{open:(b,E)=>(m(b,E),t),close:(b,E=!0)=>(p(b,E),t),toggle:(b,E)=>(g(b,E),t),isOpen:()=>n.visible,setItems:(b)=>(n.items=b,o(),t),getItems:()=>n.items,setPosition:(b)=>{if(n.position=b,n.visible){let E=i();if(E&&t.position)t.position.positionMenu(E)}return t},getPosition:()=>n.position,setSelected:(b)=>(u(b),t),getSelected:()=>n.selectedItemId}}},Is=Gg;var zg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu opener: missing element"),t;let n=!1;document.addEventListener("keydown",(f)=>{n=f.key==="Tab",setTimeout(()=>{n=!1},100)});let r={openerElement:null,openerComponent:null,activeClass:""},i=(f)=>{if(!f)return{element:null,component:null};if(typeof f==="string"){let h=document.querySelector(f);if(!h)return console.warn(`Menu opener not found: ${f}`),{element:null,component:null};return{element:h,component:null}}if(typeof f==="object"&&f!==null){if("element"in f&&f.element instanceof HTMLElement)return{element:f.element,component:f};if("getElement"in f&&typeof f.getElement==="function"){let h=f.getElement();if(h instanceof HTMLElement)return{element:h,component:f}}if("input"in f&&f.input instanceof HTMLElement)return{element:f.input,component:f};if(f instanceof HTMLElement)return{element:f,component:null}}return console.warn("Invalid opener type:",f),{element:null,component:null}},s=(f)=>{let h=t.getClass("").split("-")[0];if(f.tagName==="BUTTON")return`${h}-button--active`;else if(f.classList.contains(`${h}-chip`))return`${h}-chip--selected`;else if(f.classList.contains(`${h}-textfield`)||f.classList.contains(`${h}-select`))return`${h}-textfield--focused`;else return`${h}-menu-opener--active`},a=(f)=>{let{element:h,component:C}=f;if(!h)return;if(r.openerElement&&r.openerElement!==h)p();if(r.openerElement=h,r.openerComponent=C,r.activeClass=s(h),!e.manualOpen)h.addEventListener("click",d),h.addEventListener("keydown",u),h.addEventListener("blur",m);h.setAttribute("aria-haspopup","true"),h.setAttribute("aria-expanded","false");let T=t.element.id;if(!T)T=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,t.element.id=T;h.setAttribute("aria-controls",T)},o=(f)=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.setActive==="function"){r.openerComponent.setActive(f);return}if(r.openerComponent&&"selected"in r.openerComponent){r.openerComponent.selected=f;return}if(r.openerComponent&&typeof r.openerComponent.focus==="function"&&typeof r.openerComponent.blur==="function"){if(f)r.openerComponent.focus();else r.openerComponent.blur();return}if(r.openerElement.classList)if(f)r.openerElement.classList.add(r.activeClass);else r.openerElement.classList.remove(r.activeClass)},l=()=>{if(!r.openerElement)return;if(r.openerComponent&&typeof r.openerComponent.focus==="function"){requestAnimationFrame(()=>{r.openerComponent.focus()});return}if(r.openerComponent&&"input"in r.openerComponent&&r.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{r.openerComponent.input.focus()});return}requestAnimationFrame(()=>{r.openerElement.focus()})},d=(f)=>{if(f.preventDefault(),f.stopPropagation(),t.menu)if(t.menu.isOpen())t.menu.close(f);else t.menu.open(f,"mouse")},u=(f)=>{if(!t.menu)return;let h=t.menu.isOpen();switch(f.key){case"Enter":case" ":case"ArrowDown":case"Down":if(f.preventDefault(),!h)t.menu.open(f,"keyboard");break;case"Escape":if(h)f.preventDefault(),t.menu.close(f);break;case"ArrowUp":case"Up":if(f.preventDefault(),!h)t.menu.open(f,"keyboard"),setTimeout(()=>{let C=t.element.querySelectorAll(`.${t.getClass("menu-item")}:not(.${t.getClass("menu-item--disabled")})`);if(C.length>0){C.forEach((b)=>b.setAttribute("tabindex","-1"));let T=C[C.length-1];T.setAttribute("tabindex","0"),T.focus()}},100);break}},m=(f)=>{if(!t.menu||!t.menu.isOpen())return;let h=f.relatedTarget;if(n){setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(f,!1)},10);return}if(h){if(t.element.contains(h))return;if(h.getAttribute("aria-haspopup")==="true"||h.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if(t.menu&&t.menu.isOpen())t.menu.close(f,!1)},50)},p=()=>{if(r.openerElement){if(!e.manualOpen)r.openerElement.removeEventListener("click",d),r.openerElement.removeEventListener("keydown",u),r.openerElement.removeEventListener("blur",m);r.openerElement.removeAttribute("aria-haspopup"),r.openerElement.removeAttribute("aria-expanded"),r.openerElement.removeAttribute("aria-controls"),o(!1)}r.openerComponent=null,r.openerElement=null,r.activeClass=""},{element:g,component:c}=i(e.opener);if(a({element:g,component:c}),t.lifecycle){let f=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{p(),f()}}return t.on("open",()=>{if(r.openerElement)r.openerElement.setAttribute("aria-expanded","true"),o(!0)}),t.on("close",(f)=>{if(r.openerElement){if(r.openerElement.setAttribute("aria-expanded","false"),o(!1),f.restoreFocus&&!n)l()}}),{...t,opener:{setOpener(f){let h=i(f);if(h.element)a(h);return t},getOpener(){return r.openerElement},getOpenerComponent(){return r.openerComponent},setActive(f){return o(f),t},focus(){return l(),t}}}},Ls=zg;var Wg=(e,t)=>{let n=(s,a,o,l=!1)=>{if(!s||!a)return;let d=t.container&&t.container!==document.body;s.style.position="absolute";let u=d?0:window.pageXOffset||document.documentElement.scrollLeft,m=d?0:window.pageYOffset||document.documentElement.scrollTop,p=a.getBoundingClientRect(),g=s.cloneNode(!0);if(g.style.visibility="hidden",g.style.display="block",g.style.position="absolute",g.style.top="0",g.style.left="0",g.style.transform="none",g.style.opacity="0",g.style.pointerEvents="none",g.classList.add(`${e.getClass("menu--visible")}`),t.width==="100%"&&!l)g.style.width=`${p.width}px`;let c=t.container||document.body;c.appendChild(g);let f=g.getBoundingClientRect(),{innerWidth:h,innerHeight:C}=window;c.removeChild(g);let T=t.offset!==void 0?t.offset:8,b=0,E=0,v=o;if(l){if(v=o||"right-start",v.startsWith("right")&&p.right+f.width+T>h-16)v=v.replace("right","left");else if(v.startsWith("left")&&p.left-f.width-T<16)v=v.replace("left","right");if(p.top+f.height>C-48){if(v==="right-start")v="right-end";else if(v==="left-start")v="left-end"}}else switch(o){case"top-start":case"top":case"top-end":if(p.top<f.height+T+48)v=o.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(p.bottom+f.height+T+48>C){if(p.top>C-p.bottom)v=o.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(p.bottom+f.height>C-48){if(o==="right-start")v="right-end";else if(o==="left-start")v="left-end";else if(o==="right")b=p.top-(f.height-p.height)-T;else if(o==="left")b=p.top-(f.height-p.height)-T}break}if(["position-top","position-bottom","position-right","position-left"].forEach((j)=>{s.classList.remove(`${e.getClass("menu")}--${j}`)}),v.startsWith("top")||v==="right-end"||v==="left-end"||v==="right"&&b<p.top||v==="left"&&b<p.top)s.classList.add(`${e.getClass("menu")}--position-top`);else if(v.startsWith("left"))s.classList.add(`${e.getClass("menu")}--position-left`);else if(v.startsWith("right"))s.classList.add(`${e.getClass("menu")}--position-right`);else s.classList.add(`${e.getClass("menu")}--position-bottom`);let L=d&&t.container?t.container.getBoundingClientRect():{top:0,left:0,right:0,bottom:0},I=d?-L.left:u,x=d?-L.top:m;switch(v){case"top-start":b=p.top+x-f.height-T,E=p.left+I;break;case"top":b=p.top+x-f.height-T,E=p.left+I+p.width/2-f.width/2;break;case"top-end":b=p.top+x-f.height-T,E=p.right+I-f.width;break;case"right-start":b=p.top+x,E=p.right+I+T;break;case"right":if(b===0)b=p.top+x+p.height/2-f.height/2;else b+=x;E=p.right+I+T;break;case"right-end":b=p.bottom+x-f.height,E=p.right+I+T;break;case"bottom-start":b=p.bottom+x+T,E=p.left+I;break;case"bottom":b=p.bottom+x+T,E=p.left+I+p.width/2-f.width/2;break;case"bottom-end":b=p.bottom+x+T,E=p.right+I-f.width;break;case"left-start":b=p.top+x,E=p.left+I-f.width-T;break;case"left":if(b===0)b=p.top+x+p.height/2-f.height/2;else b+=x;E=p.left+I-f.width-T;break;case"left-end":b=p.bottom+x-f.height,E=p.left+I-f.width-T;break}if(d){if(s.style.top=`${b}px`,s.style.left=`${E}px`,t.width==="100%"&&!l)s.style.width=`${p.width}px`;if(t.maxHeight)s.style.maxHeight=t.maxHeight;return}let A=48;if(b-m<A)b=A+m;let N=48;if(b-m+f.height>C-N){let j=C-(b-m)-N,pe=Math.min(f.height,100),ge=Math.max(j,pe);if(s.style.maxHeight=`${ge}px`,t.maxHeight){let w=parseInt(t.maxHeight,10);if(!isNaN(w)&&w<parseInt(s.style.maxHeight||"0",10))s.style.maxHeight=t.maxHeight}}else if(t.maxHeight)s.style.maxHeight=t.maxHeight;if(t.width==="100%"&&!l)s.style.width=`${p.width}px`;let G=Math.max(A+m,b),U=Math.max(16+u,E);if(s.style.top=`${G}px`,s.style.left=`${U}px`,U-u+f.width>h-16)s.style.left="auto",s.style.right="16px"};return{positionMenu:(s)=>{if(!s||!e.element)return;n(e.element,s,t.position,!1)},positionSubmenu:(s,a,o=1)=>{if(!s||!a)return;let l=o%2===1?"right-start":"left-start";s.style.zIndex=`${1000+o*10}`,n(s,a,l,!0)},positionElement:n}},Kg=(e)=>(t)=>{if(!t.element)return t;let n=Wg(t,e);return{...t,position:n}},As=Kg;var Yg=(e)=>{let t=!1,n="",r=null,i=500;(()=>{document.addEventListener("keydown",(c)=>{t=c.key==="Tab",setTimeout(()=>{t=!1},100)})})();let a=()=>{let f=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(f).filter((h)=>h.offsetParent!==null&&!h.classList.contains("hidden"))},o=(c)=>{let f=c.getAttribute("data-parent-item");if(!f)return null;let h=parseInt(c.getAttribute("data-level")||"1",10);return((h<=1?e.element:document.querySelector(`.${e.getClass("menu--submenu")}[data-level="${h-1}"]`))??document).querySelector(`.${e.getClass("menu-item")}[data-id="${f}"]`)??null},l=(c)=>Array.from(c.querySelectorAll(`.${e.getClass("menu-item")}`)),d=()=>{if(n="",r)clearTimeout(r),r=null},u=(c,f)=>{d();let h=l(c);if(h.forEach((C)=>C.setAttribute("tabindex","-1")),h.length>0)h[0].setAttribute("tabindex","0");if(f==="keyboard"&&h.length>0){h[0].focus();return}c.setAttribute("tabindex","-1"),c.focus()},m=(c,f,h)=>{let T=c.target?.closest?.(`.${e.getClass("menu")}`)??null,b=T??e.element,E=!!T&&T.classList.contains(e.getClass("menu--submenu")),v=l(b);if(v.length===0)return;let S=document.activeElement,y=-1;if(S&&v.includes(S))y=v.indexOf(S);let L=(I)=>{if(v[I])v[I].focus()};if(c.key.length===1&&!c.ctrlKey&&!c.metaKey&&!c.altKey){if(c.preventDefault(),c.stopPropagation(),n+=c.key.toLowerCase(),r)clearTimeout(r);r=setTimeout(()=>{n="",r=null},i);let I=v.findIndex((x)=>(x.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(n));if(I!==-1)L(I);else if(n.length>1){let x=n.slice(-1),A=v.findIndex((N)=>(N.querySelector(`.${e.getClass("menu-item-text")}`)?.textContent?.toLowerCase()||"").startsWith(x));if(A!==-1)n=x,L(A)}return}switch(c.key){case"ArrowDown":case"Down":if(c.preventDefault(),c.stopPropagation(),y<0)L(0);else if(y<v.length-1)L(y+1);else L(0);break;case"ArrowUp":case"Up":if(c.preventDefault(),c.stopPropagation(),y<0)L(v.length-1);else if(y>0)L(y-1);else L(v.length-1);break;case"Home":c.preventDefault(),c.stopPropagation(),L(0);break;case"End":c.preventDefault(),c.stopPropagation(),L(v.length-1);break;case"Enter":case" ":if(c.preventDefault(),c.stopPropagation(),y>=0)v[y].click();break;case"ArrowRight":case"Right":if(c.preventDefault(),c.stopPropagation(),E){if(y>=0&&v[y].classList.contains(`${e.getClass("menu-item--submenu")}`)){let x=v[y],A=parseInt(x.getAttribute("data-index"),10),D=x.closest(`.${e.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),G=h.findItemById(D);if(G&&G.submenu){let U=G.submenu[A];h.handleNestedSubmenuClick(U,A,x)}}}else if(y>=0&&v[y].classList.contains(`${e.getClass("menu-item--submenu")}`)){let x=v[y],A=parseInt(x.getAttribute("data-index"),10),N=f.items[A];h.handleSubmenuClick(N,A,x)}break;case"ArrowLeft":case"Left":if(c.preventDefault(),c.stopPropagation(),E){let x=o(b),A=parseInt(b.getAttribute("data-level")||"1",10);if(h.closeSubmenu(A),x)x.focus()}break;case"Escape":if(c.preventDefault(),c.stopPropagation(),E){let x=o(b),A=parseInt(b.getAttribute("data-level")||"1",10);if(h.closeSubmenu(A),x)x.focus()}else h.closeMenu(c,!0);break;case"Tab":if(n="",r)clearTimeout(r),r=null;c.preventDefault();let I=e.opener?.getOpener?.();if(h.closeMenu(c,!0),I)setTimeout(()=>{if(c.shiftKey);else{let x=a(),A=x.indexOf(I);if(A>=0&&A<x.length-1)x[A+1].focus()}},0);break}};return{handleInitialFocus:u,handleMenuKeydown:m,setupKeyboardHandlers:(c,f,h)=>{let C=c.querySelectorAll(`.${e.getClass("menu-item")}:not(.${e.getClass("menu-item--disabled")})`);if(C.forEach((T)=>{T.tabIndex=-1}),C.length>0)C[0].tabIndex=0;c.addEventListener("keydown",(T)=>m(T,f,h))},isTabNavigationActive:()=>t,getFocusableElements:a,resetTypeahead:d}},Xg=()=>(e)=>{if(!e.element)return e;let t=Yg(e);return{...e,keyboard:t}},Ns=Xg;var qg=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize menu submenu: missing element"),t;let n={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:t},r=()=>{if(n.hoverIntent.timer)clearTimeout(n.hoverIntent.timer),n.hoverIntent.timer=null,n.hoverIntent.activeItem=null},i=()=>{if(n.submenuTimer)clearTimeout(n.submenuTimer),n.submenuTimer=null},s=(v,S,y)=>{if(!e.openSubmenuOnHover||!v.hasSubmenu)return;r(),i(),n.hoverIntent.activeItem=y,n.hoverIntent.timer=setTimeout(()=>{if(y.matches(":hover")){if(n.activeSubmenuItem!==y)p(v,S,y)}n.hoverIntent.timer=null},100)},a=()=>{r(),i(),n.submenuTimer=setTimeout(()=>{let{activeSubmenu:v,activeSubmenuItem:S}=n;if(v&&S){let y=v.matches(":hover"),L=S.matches(":hover");if(!y&&!L)g(n.submenuLevel)}n.submenuTimer=null},300)},o=(v,S,y)=>{if(!v.submenu||!v.hasSubmenu)return;let L=y.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((x)=>x.isOpening))return;if(L){let x=parseInt(y.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);g(x+1),y.setAttribute("aria-expanded","false")}else p(v,S,y)},l=()=>t.menu?.getItems?.()??e.items??[],d=(v)=>{let S=(y)=>{for(let L of y){let I=L;if(!I||typeof I!=="object")continue;if(I.id===v)return I;if(Array.isArray(I.submenu)){let x=S(I.submenu);if(x)return x}}return null};return S(l())},u=(v,S,y)=>{if(!v.submenu||!v.hasSubmenu)return;let L=y.getAttribute("aria-expanded")==="true";if(n.activeSubmenus.some((x)=>x.isOpening))return;if(L){let x=parseInt(y.closest(`.${t.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);g(x+1)}else p(v,S,y)},m=(v)=>{let S=t.getClass("menu--active"),y=t.getClass("menu--inactive"),L=[t.element,...n.activeSubmenus.map((I)=>I.element)];for(let I of L){if(!I)continue;let x=I===v;I.classList.toggle(S,x),I.classList.toggle(y,v!==null&&!x)}},p=(v,S,y)=>{if(!v.submenu||!v.hasSubmenu)return;let L=y.closest(`.${t.getClass("menu--submenu")}`)?parseInt(y.closest(`.${t.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(g(L),n.activeSubmenus.findIndex((D)=>D.menuItem===y&&D.isOpening)>=0)return;y.setAttribute("aria-expanded","true");let x=document.createElement("div");x.className=`${t.getClass("menu")} ${t.getClass("menu--submenu")}`;for(let D of["menu--vertical","menu--vibrant","menu--dense"]){let G=t.getClass(D);if(t.element.classList.contains(G))x.classList.add(G)}x.setAttribute("role","menu"),x.setAttribute("tabindex","-1"),x.setAttribute("data-level",L.toString()),x.setAttribute("data-parent-item",v.id),x.style.zIndex=`${1000+L*10}`;let A=document.createElement("ul");A.className=`${t.getClass("menu-list")}`;let N=[];if(t.emit("create-menu-items",{items:v.submenu,container:A,level:L,onItemCreated:(D)=>{if(!D.classList.contains(`${t.getClass("menu-item--disabled")}`))N.push(D)}}),x.appendChild(A),document.body.appendChild(x),t.position&&t.position.positionSubmenu)t.position.positionSubmenu(x,y,L);if(t.keyboard&&t.keyboard.setupKeyboardHandlers)t.keyboard.setupKeyboardHandlers(x,{activeSubmenus:n.activeSubmenus,items:l()},{closeSubmenu:g,handleNestedSubmenuClick:u,handleSubmenuClick:o,findItemById:d,closeMenu:(D,G)=>t.menu?.close(D,G)});x.addEventListener("mouseenter",()=>{i()}),x.addEventListener("mouseleave",()=>{a()}),n.activeSubmenu=x,n.activeSubmenuItem=y,n.activeSubmenus.push({element:x,menuItem:y,level:L,isOpening:!0}),n.submenuLevel=L,m(x),document.addEventListener("click",f),window.addEventListener("resize",h,{passive:!0}),window.addEventListener("scroll",C,{passive:!0}),requestAnimationFrame(()=>{x.classList.add(`${t.getClass("menu--visible")}`),setTimeout(()=>{let D=n.activeSubmenus.findIndex((G)=>G.element===x);if(D!==-1)n.activeSubmenus[D].isOpening=!1;if(N.length>0){if(L>=2||document.activeElement===y)N[0].setAttribute("tabindex","0"),N[0].focus()}},300)}),t.emit("submenu-opened",{submenuElement:x,parentItem:y,level:L,item:v})},g=(v)=>{r(),i();let S=[];for(let y=n.activeSubmenus.length-1;y>=0;y--)if(n.activeSubmenus[y].level>=v){let L=n.activeSubmenus[y];if(L.menuItem)L.menuItem.setAttribute("aria-expanded","false");L.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(L.element.parentNode)L.element.parentNode.removeChild(L.element)},200),S.push(y)}if(S.forEach((y)=>{n.activeSubmenus.splice(y,1)}),n.activeSubmenus.length>0){let y=n.activeSubmenus[n.activeSubmenus.length-1];if(n.activeSubmenu=y.element,n.activeSubmenuItem=y.menuItem,n.submenuLevel=y.level,y.menuItem)y.menuItem.focus();m(y.element)}else n.activeSubmenu=null,n.activeSubmenuItem=null,n.submenuLevel=0;t.emit("submenu-closed",{level:v})},c=()=>{if(m(null),r(),i(),n.activeSubmenus.length===0)return;[...n.activeSubmenus].forEach((v)=>{if(v.menuItem)v.menuItem.setAttribute("aria-expanded","false");v.element.classList.remove(`${t.getClass("menu--visible")}`),setTimeout(()=>{if(v.element.parentNode)v.element.parentNode.removeChild(v.element)},200)}),n.activeSubmenu=null,n.activeSubmenuItem=null,n.activeSubmenus=[],n.submenuLevel=0,document.removeEventListener("click",f),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),t.emit("all-submenus-closed",{})},f=(v)=>{if(!n.activeSubmenu)return;let{activeSubmenu:S,activeSubmenuItem:y}=n;if(S.contains(v.target)||y&&y.contains(v.target))return;c()},h=()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)},C=()=>{window.requestAnimationFrame(()=>{if(n.activeSubmenu&&n.activeSubmenuItem&&t.position)t.position.positionSubmenu(n.activeSubmenu,n.activeSubmenuItem,n.submenuLevel)})},T=()=>n.activeSubmenus.length>0,b=()=>n.submenuLevel,E=()=>[...n.activeSubmenus];if(t.lifecycle){let v=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(r(),i(),document.removeEventListener("click",f),window.removeEventListener("resize",h),window.removeEventListener("scroll",C),n.activeSubmenus.length>0)n.activeSubmenus.forEach((S)=>{if(S.element.parentNode)S.element.parentNode.removeChild(S.element)});v()}}return t.on("menu-closing",()=>{c()}),{...t,submenu:{openSubmenu:p,closeSubmenu:g,closeAllSubmenus:c,handleSubmenuClick:o,handleNestedSubmenuClick:u,handleSubmenuHover:s,handleSubmenuLeave:a,hasOpenSubmenu:T,getSubmenuLevel:b,getActiveSubmenus:E}}},ws=qg;var tc=({menu:e,opener:t,events:n,lifecycle:r})=>(i)=>({element:i.element,open(a,o){return e.open(a,o),this},close(a,o=!0,l=!1){return e.close(a,o,l),this},toggle(a,o){if(a&&!o){if(a instanceof KeyboardEvent)o="keyboard";else if(a instanceof MouseEvent)o="mouse"}return e.toggle(a,o),this},isOpen(){return e.isOpen()},setItems(a){return e.setItems(a),this},getItems(){return e.getItems()},setOpener(a){return t.setOpener(a),this},getOpener(){return t.getOpener()},setPosition(a){return e.setPosition(a),this},getPosition(){return e.getPosition()},setSelected(a){return e.setSelected(a),this},getSelected(){return e.getSelected()},on(a,o){if(n?.on)n.on(a,o);else if(i.on)i.on(a,o);return this},off(a,o){if(n?.off)n.off(a,o);else if(i.off)i.off(a,o);return this},destroy(){r.destroy()}});Q();var jg={BASELINE:"baseline",VERTICAL:"vertical"},Zg={STANDARD:"standard",VIBRANT:"vibrant"},Qg={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT:"right",RIGHT_END:"right-end",LEFT_START:"left-start",LEFT:"left",LEFT_END:"left-end"},Dt={VARIANT:jg.BASELINE,COLOR:Zg.STANDARD,POSITION:Qg.BOTTOM_START,OFFSET:0,CLOSE_ON_SELECT:!0,CLOSE_ON_CLICK_OUTSIDE:!0,CLOSE_ON_ESCAPE:!0,OPEN_SUBMENU_ON_HOVER:!0,AUTO_FLIP:!0};var nc={CONTAINER:"menu",VISIBLE:"menu--visible",INNER:"menu__inner",ITEM:"menu__item",ITEM_DISABLED:"menu__item--disabled",ITEM_SELECTED:"menu__item--selected",ITEM_HAS_SUBMENU:"menu__item--has-submenu",DIVIDER:"menu__divider",ITEM_ICON:"menu__item-icon",ITEM_TEXT:"menu__item-text",ITEM_SHORTCUT:"menu__item-shortcut",SUBMENU_INDICATOR:"menu__submenu-indicator",DENSE:"menu--dense"};var Jg={items:[],position:Dt.POSITION,closeOnSelect:Dt.CLOSE_ON_SELECT,closeOnClickOutside:Dt.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:Dt.CLOSE_ON_ESCAPE,openSubmenuOnHover:Dt.OPEN_SUBMENU_ON_HOVER,offset:Dt.OFFSET,autoFlip:Dt.AUTO_FLIP,visible:!1},rc=(e)=>{if(!e.opener)throw Error("Menu component requires an opener element or selector");return P(Jg,e,"menu")},ic=(e)=>{let t={};if(e.width)t.width=e.width;if(e.maxHeight)t.maxHeight=e.maxHeight;let n={role:"menu",tabindex:"-1","aria-hidden":(!e.visible).toString(),style:Object.entries(t).map(([r,i])=>`${r}: ${i}`).join(";")};return V(e,{tag:"div",attributes:n,className:[e.visible?nc.VISIBLE:null,e.dense?`${e.prefix}-menu--dense`:null,e.variant==="vertical"?`${e.prefix}-menu--vertical`:null,e.variant==="vertical"&&e.color==="vibrant"?`${e.prefix}-menu--vibrant`:null,e.class].filter(Boolean),forwardEvents:{keydown:!0}})},sc=(e)=>({menu:{open:(t,n)=>e.menu?.open(t,n),close:(t,n,r)=>e.menu?.close(t,n,r),toggle:(t,n)=>e.menu?.toggle(t,n),isOpen:()=>e.menu?.isOpen()||!1,setItems:(t)=>e.menu?.setItems(t),getItems:()=>e.menu?.getItems()||[],setPosition:(t)=>e.menu?.setPosition(t),getPosition:()=>e.menu?.getPosition(),setSelected:(t)=>e.menu?.setSelected(t),getSelected:()=>e.menu?.getSelected()},opener:{setOpener:(t)=>e.opener?.setOpener(t),getOpener:()=>e.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>e.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>e.submenu?.closeAllSubmenus()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy()}});var eh=(e)=>{try{let t=rc(e),n=O(M,B(),R(ic(t)),As(t),Ns(),ws(t),Is(t),Ls(t),k(),(r)=>tc(sc(r))(r))(t);if(t.on&&typeof n.on==="function")Object.entries(t.on).forEach(([r,i])=>{if(typeof i==="function")n.on(r,i)});return n}catch(t){throw console.error("Menu creation error:",t),Error(`Failed to create menu: ${t.message}`)}},Ft=eh;ne();Z();J();var ac=(e)=>(t)=>({...t,element:t.element,items:t.items||new Map,addItem(r){if(typeof t.addItem==="function")t.addItem(r);return this},removeItem(r){if(typeof t.removeItem==="function")t.removeItem(r);return this},getItem(r){if(typeof t.getItem==="function")return t.getItem(r);return this.items.get(r)},getAllItems(){if(typeof t.getAllItems==="function")return t.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof t.getActive==="function")return t.getActive();return null},getItemPath(r){if(typeof t.getItemPath==="function")return t.getItemPath(r);return[]},setActive(r){if(typeof t.handleItemClick==="function")t.handleItemClick(r);else if(typeof t.setActive==="function")t.setActive(r);else{let i=this.items.get(r);if(i&&i.element){if(t.emit)t.emit("change",{id:r,item:i,source:"api"})}}return this},enable(){if(e.disabled.enable)e.disabled.enable();return this},disable(){if(e.disabled.disable)e.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),t.emit)t.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),t.emit)t.emit("collapsed",{source:"api"});return this},isExpanded(){return!this.element.classList.contains(`${this.element.className.split(" ")[0]}--hidden`)},toggle(){return this.isExpanded()?this.collapse():this.expand()},on(r,i){if(t.on)t.on(r,i);return this},off(r,i){if(t.off)t.off(r,i);return this},destroy(){if(e.lifecycle.destroy)e.lifecycle.destroy()}});var th={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},nh={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},rh={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"};var oc={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},mn={VARIANT:th.STANDARD,POSITION:nh.LEFT,BEHAVIOR:rh.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},ae={CONTAINER:"nav",VARIANT_PREFIX:"nav--",POSITION_PREFIX:"nav--pos-",BEHAVIOR_PREFIX:"nav--",EXPANDED:"nav--expanded",DISABLED:"nav--disabled",ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon",ACTIVE:"nav-item--active",ITEM_DISABLED:"nav-item--disabled"};var ih=(e)=>{let t=document.createElement("span");return t.className=`${e}-${ae.EXPAND_ICON}`,t.innerHTML=`
19
19
  <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor">
20
20
  <polyline points="9 18 15 12 9 6"></polyline>
21
21
  </svg>
22
- `,t},sh=(e,t,n)=>{let r=document.createElement("div");return r.className=`${t}-${ae.NESTED_CONTAINER}`,r.setAttribute("role","menu"),r.hidden=!0,e.forEach((i)=>{n(i,r,t)}),r},Jr=(e,t,n)=>{let r=document.createElement("div");r.className=`${n}-${ae.ITEM_CONTAINER}`;let i=t.getAttribute("role")==="menu",s=t.getAttribute("role")==="tablist",a=t.closest(`.${n}-nav--drawer, .${n}-nav--drawer-modal, .${n}-nav--drawer-standard`)!==null,o=document.createElement("button");if(o.className=`${n}-${ae.ITEM}`,o.type="button",e.items?.length)if(a)o.setAttribute("role","button"),o.setAttribute("aria-expanded",e.expanded?"true":"false"),o.setAttribute("aria-haspopup","menu");else o.setAttribute("role","button");else if(i)o.setAttribute("role","menuitem");else if(s)o.setAttribute("role","tab"),o.setAttribute("aria-selected",e.active?"true":"false"),o.setAttribute("tabindex",e.active?"0":"-1");if(e.id)o.dataset.id=e.id;if(e.disabled)o.disabled=!0,o.setAttribute("aria-disabled","true");if(e.icon){let l=document.createElement("span");l.className=`${n}-${ae.ICON}`,l.innerHTML=e.icon,o.appendChild(l)}if(e.label){let l=document.createElement("a");l.className=`${n}-${ae.LABEL}`,l.textContent=e.label,l.href=`/${e.id}`,l.style.textDecoration="none",l.style.color="inherit",l.style.pointerEvents="none",l.setAttribute("title",e.label),o.appendChild(l),o.setAttribute("aria-label",e.label)}if(e.badge){let l=document.createElement("span");l.className=`${n}-${ae.BADGE}`,l.textContent=e.badge,l.setAttribute("aria-label",`${e.badge} notifications`),o.appendChild(l)}if(e.active&&!e.items?.length){if(o.classList.add(`${n}-${ae.ACTIVE}`),!s)o.setAttribute("aria-current","page")}if(r.appendChild(o),e.items?.length&&a){let l=ih(n);o.appendChild(l);let d=sh(e.items,n,Jr);d.hidden=!e.expanded,r.appendChild(d),o.addEventListener("click",(u)=>{u.stopPropagation();let c=o.getAttribute("aria-expanded")==="true";if(o.setAttribute("aria-expanded",(!c).toString()),d.hidden=c,l.style)l.style.transform=c?"":"rotate(90deg)"})}return t.appendChild(r),o},Ds=(e,t)=>{let n=e.closest(`.${t}-${ae.ITEM_CONTAINER}`);if(!n)return[];let r=n.querySelector(`.${t}-${ae.NESTED_CONTAINER}`);if(!r)return[];return Array.from(r.querySelectorAll(`.${t}-${ae.ITEM}`)).reduce((s,a)=>[...s,a,...Ds(a,t)],[])};function ah(e,t){if(!e)return null;let n=e.getAttribute("data-id");if(n)return n;if(e.classList.contains(`${t}-nav--rail`))return"rail";if(e.classList.contains(`${t}-nav--drawer`))return"drawer";return null}var lc=(e)=>(t)=>{let n=new Map,r=null,i=e.prefix||"mtrl",s=(l,d)=>{if(n.set(l.id,{element:d,config:l}),l.items?.length)l.items.forEach((u)=>{let c=d.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(c){let p=c.querySelector(`.${i}-${ae.NESTED_CONTAINER}`);if(p){let g=p.querySelector(`[data-id="${u.id}"]`);if(g)s(u,g)}}})},a=(l,d,u)=>{let c=l.getAttribute("role");if(u){if(l.classList.add(`${i}-${ae.ACTIVE}`),c==="tab")l.setAttribute("aria-selected","true"),l.setAttribute("tabindex","0");else if(!l.getAttribute("aria-haspopup"))l.setAttribute("aria-current","page")}else if(l.classList.remove(`${i}-${ae.ACTIVE}`),c==="tab")l.setAttribute("aria-selected","false"),l.setAttribute("tabindex","-1");else if(l.hasAttribute("aria-current"))l.removeAttribute("aria-current")};if(e.items)e.items.forEach((l)=>{let d=Jr(l,t.element,i);if(s(l,d),l.active)r={element:d,config:l},a(d,r,!0)});if(t.emit)t.element.addEventListener("mouseover",(l)=>{let u=l.target.closest("[data-id]");if(u){let c=u.dataset.id;if(c)t.emit("mouseover",{id:c,clientX:l.clientX,clientY:l.clientY,target:u,item:n.get(c)})}},{passive:!0}),t.element.addEventListener("mouseenter",(l)=>{let d=t.element.dataset.id||t.componentName||"nav";t.emit("mouseenter",{clientX:l.clientX,clientY:l.clientY,id:d})},{passive:!0}),t.element.addEventListener("mouseleave",(l)=>{let d=l.relatedTarget,u=ah(d,i),c=t.element.dataset.id||t.componentName||"nav";t.emit("mouseleave",{clientX:l.clientX,clientY:l.clientY,relatedTargetId:u,id:c})});if(t.lifecycle){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(n.clear(),l)l()}}let o=(l)=>{let d=[l],u=n.get(l);if(!u)return d;let c=u.element.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(!c)return d;let p=c.parentElement;if(!p||!p.classList.contains(`${i}-${ae.NESTED_CONTAINER}`))return d;let g=p;while(g){let f=g.parentElement;if(!f||!f.classList.contains(`${i}-${ae.ITEM_CONTAINER}`))break;let m=f.querySelector(`.${i}-${ae.ITEM}[data-id]`);if(!m)break;let h=m.getAttribute("data-id");if(!h)break;d.unshift(h);let C=f.parentElement;if(!C||!C.classList.contains(`${i}-${ae.NESTED_CONTAINER}`))break;g=C}return d};return{...t,items:n,addItem(l){if(n.has(l.id))return this;let d=Jr(l,t.element,i);if(s(l,d),l.active)this.setActive(l.id);if(t.emit)t.emit("itemAdded",{id:l.id,item:{element:d,config:l}});return this},removeItem(l){let d=n.get(l);if(!d)return this;if(Ds(d.element,i).forEach((p)=>{let g=p.dataset.id;if(g)n.delete(g)}),r?.config.id===l)r=null;let c=d.element.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(c)c.remove();if(n.delete(l),t.emit)t.emit("itemRemoved",{id:l,item:d});return this},getItem:(l)=>n.get(l),getAllItems:()=>Array.from(n.values()),getActive:()=>r,getItemPath:(l)=>o(l),setActive(l){let d=n.get(l);if(!d||d.config.disabled)return this;if(r)a(r.element,r,!1);if(a(d.element,d,!0),r=d,o(l).forEach((c)=>{let p=n.get(c);if(p){let g=p.element,f=g.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(f){let m=f.querySelector(`.${i}-${ae.NESTED_CONTAINER}`);if(m)g.setAttribute("aria-expanded","true"),m.hidden=!1}}}),t.emit)t.emit(oc.CHANGE,{id:l,item:d,previousItem:r,path:o(l)});return this}}};var ot={ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon"};var dc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=(a,o)=>{if(!a)return;let l=a.getAttribute("role");if(o){if(a.classList.add(`${n}-${ot.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","true"),a.setAttribute("tabindex","0");else if(!a.getAttribute("aria-haspopup"))a.setAttribute("aria-current","page")}else if(a.classList.remove(`${n}-${ot.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","false"),a.setAttribute("tabindex","-1");else if(a.hasAttribute("aria-current"))a.removeAttribute("aria-current")},i=(a)=>{if(a.getAttribute("aria-expanded")===null)return!1;let l=a.getAttribute("aria-expanded")==="true";a.setAttribute("aria-expanded",(!l).toString());let d=a.closest(`.${n}-${ot.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(d){let c=d.querySelector(`.${n}-${ot.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(c){c.hidden=l;let p=a.querySelector(`.${n}-${ot.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(p&&p.style)p.style.transform=l?"":"rotate(90deg)"}}let u=a.dataset.id;if(u&&t.emit)t.emit("expandToggle",{id:u,expanded:!l});return!0},s={...t,handleItemClick(a){if(!t.items)return;let o=t.items.get(a);if(!o)return;let l=t.element.querySelector(`.${n}-${ot.ITEM}--active, .mtrl-nav-item--active`);if(l)r(l,!1);if(o.element)r(o.element,!0);if(t.emit){let d=t.getItemPath?t.getItemPath(a):[];t.emit("change",{id:a,item:o,previousItem:l?{element:l,config:{id:l.dataset.id}}:null,path:d,source:"userAction"})}}};return t.element.addEventListener("click",(a)=>{let o=a.target,l=o.closest(`.${n}-${ot.ITEM}, .mtrl-nav-item`);if(!l){if(!o.closest("[data-id]"))return}let d=l||o.closest("[data-id]");if(d.hasAttribute("disabled")||d.getAttribute("aria-disabled")==="true")return;let u=d.dataset.id;if(!u)return;if(i(d))return;s.handleItemClick(u)}),t.element.addEventListener("keydown",(a)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;let o=["rail","drawer"].includes(t.variant||""),l=["bar"].includes(t.variant||"");if(a.key==="Enter"||a.key===" "){let g=document.activeElement;if(g&&g.classList.contains(`${n}-${ot.ITEM}`)){if(a.preventDefault(),g.dataset.id)g.click()}return}let d=Array.from(t.element.querySelectorAll(`.${n}-${ot.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
- .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(d.length===0)return;let u=document.activeElement,c=d.indexOf(u),p=-1;if(o&&(a.key==="ArrowDown"||a.key==="ArrowRight")||l&&a.key==="ArrowRight")p=c<0?0:(c+1)%d.length;else if(o&&(a.key==="ArrowUp"||a.key==="ArrowLeft")||l&&a.key==="ArrowLeft")p=c<0?d.length-1:(c-1+d.length)%d.length;else if(a.key==="Home")p=0;else if(a.key==="End")p=d.length-1;if(p>=0)a.preventDefault(),d[p].focus()}),s};Q();var oh={variant:mn.VARIANT,position:mn.POSITION,behavior:mn.BEHAVIOR,items:[],showLabels:mn.SHOW_LABELS,scrimEnabled:mn.SCRIM_ENABLED},uc=(e={})=>_(oh,e,"nav"),cc=(e)=>{let t=e.variant?`${e.prefix}-${ae.VARIANT_PREFIX}${e.variant}`:"",n=e.position?`${e.prefix}-${ae.POSITION_PREFIX}${e.position}`:"",r=e.class||"",i=[t,n,r].filter(Boolean);return V(e,{tag:"nav",attributes:{role:"navigation","aria-label":e.ariaLabel||"Main Navigation"},className:i})},mc=(e)=>({disabled:{enable:e.disabled?.enable||(()=>{}),disable:e.disabled?.disable||(()=>{})},lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})}});var lh=(e,t)=>{let{element:n}=e,r=t.variant||"rail",i=t.prefix||"mtrl";if(n.setAttribute("aria-label",t.ariaLabel||"Main Navigation"),r==="bar")if(!t.items?.some((a)=>a.items?.length))n.setAttribute("role","tablist"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","menubar"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","navigation");if((r==="modal"||r==="drawer"&&t.behavior==="dismissible")&&!t.expanded)n.classList.add(`${i}-nav--hidden`)},dh=(e={})=>{let t=uc(e);try{let r=M(D,B(),O(cc(t)),se(t),Pn(t),lc(t),dc(t),oe(t),P(),(i)=>ac(mc(i))(i))(t);if(lh(r,t),t.disabled)r.disable();if(r.element.dataset.componentType="navigation",t.variant)r.element.dataset.variant=t.variant;return r}catch(n){throw Error(`Failed to create navigation: ${n instanceof Error?n.message:String(n)}`)}},fn=dh;var fc=(e={})=>({rail:null,drawer:null,activeSection:e.activeSection||null,activeSubsection:e.activeSubsection||null,items:e.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}),Ms=(e={})=>({animateDrawer:e.animateDrawer!==!1,showLabelsOnRail:e.showLabelsOnRail!==!1,hideDrawerOnClick:e.hideDrawerOnClick||!1,expanded:e.expanded===!0,hoverDelay:e.hoverDelay||200,closeDelay:e.closeDelay||100,railOptions:e.railOptions||{},drawerOptions:e.drawerOptions||{}}),Os=(e={})=>({breakpoint:e.breakpoint||960,lockBodyScroll:e.lockBodyScroll!==!1,hideOnClickOutside:e.hideOnClickOutside!==!1,enableSwipeGestures:e.enableSwipeGestures!==!1,optimizeForTouch:e.optimizeForTouch!==!1,overlayClass:e.overlayClass||"mtrl-nav-overlay",closeButtonClass:e.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:e.bodyLockClass||"mtrl-body-drawer-open"});_n();var pc=(e,t,n,r)=>{if(!e.drawer||!t||!e.items[t])return;let s=e.items[t].items||[];if(s.length===0){r();return}let a=e.drawer.getAllItems();if(a?.length>0)a.forEach((o)=>{e.drawer.removeItem(o.config.id)});s.forEach((o)=>{e.drawer.addItem(o)}),n()},gc=(e,t)=>{let n=Object.keys(e.items||{}).map((i)=>({id:i,label:e.items[i]?.label||i,icon:e.items[i]?.icon||"",active:i===e.activeSection})),r=fn({variant:"rail",position:"left",showLabels:t.showLabelsOnRail,items:n,...t.railOptions});return document.body.appendChild(r.element),r},hc=(e,t)=>{let n=fn({variant:"drawer",position:"left",items:[],...t.drawerOptions});if(document.body.appendChild(n.element),n.element.dataset.id="drawer",!t.expanded)n.element.classList.add("mtrl-nav--hidden"),n.element.setAttribute("aria-hidden","true");return n},Cc=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.remove("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","false"),e.isMobile){if(e.overlayElement)e.overlayElement.classList.add("active"),e.overlayElement.setAttribute("aria-hidden","false");if(t.lockBodyScroll)document.body.classList.add(t.bodyLockClass);if(e.closeButtonElement)e.closeButtonElement.style.display="flex"}},Ec=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.add("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","true"),e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(t.lockBodyScroll)document.body.classList.remove(t.bodyLockClass)},bc=(e)=>{if(!e.drawer)return!1;return!e.drawer.element.classList.contains("mtrl-nav--hidden")},vc=(e,t,n,r,i)=>{let s=e.isMobile;if(e.isMobile=window.innerWidth<=t.breakpoint||co(),s!==e.isMobile){if(e.isMobile)n();else r();if(i.onViewChange)i.onViewChange({mobile:e.isMobile,previousMobile:s,width:window.innerWidth})}},Tc=(e)=>{if(e.overlayElement&&e.overlayElement.parentNode)e.overlayElement.parentNode.removeChild(e.overlayElement),e.overlayElement=null;if(e.rail)e.rail.destroy(),e.rail=null;if(e.drawer)e.drawer.destroy(),e.drawer=null;e.activeSection=null,e.activeSubsection=null,e.mouseInDrawer=!1,e.mouseInRail=!1,e.processingChange=!1,e.isMobile=!1},Sc=(e,t,n,r)=>{if(!t||!e.items[t])return;if(e.activeSection===t&&e.activeSubsection===n)return;if(e.activeSection=t,e.rail)e.rail.setActive(t,r);if(n&&e.drawer)e.activeSubsection=n,e.drawer.setActive(n,r)};var yc=(e,t,n,r,i,s)=>{let a=e.rail;if(!a)return;a.on("change",(o)=>{let l=o?.id;if(!l||e.processingChange)return;let d=o?.source==="userAction";if(e.processingChange=!0,e.activeSection=l,n(l),s.onSectionChange&&d)s.onSectionChange(l,{source:d?"userClick":"programmatic"});setTimeout(()=>{e.processingChange=!1},50)}),a.on("mouseover",(o)=>{let l=o?.id;if(e.mouseInRail=!0,clearTimeout(e.hoverTimer),e.hoverTimer=null,l)if(e.items[l]?.items?.length>0)e.hoverTimer=window.setTimeout(()=>{n(l)},t.hoverDelay);else e.closeTimer=window.setTimeout(()=>{if(e.mouseInRail&&!e.mouseInDrawer)i()},t.hoverDelay)}),a.on("mouseenter",()=>{e.mouseInRail=!0,clearTimeout(e.closeTimer),e.closeTimer=null}),a.on("mouseleave",()=>{if(e.mouseInRail=!1,clearTimeout(e.hoverTimer),e.hoverTimer=null,!e.mouseInDrawer)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInRail&&!e.mouseInDrawer)i()},t.closeDelay)})},xc=(e,t,n,r)=>{let i=e.drawer;if(!i)return;if(typeof i.on==="function")i.on("change",(s)=>{let a=s.id;if(e.activeSubsection=a,t.hideDrawerOnClick)n();if(r.onItemSelect)r.onItemSelect(s)}),i.on("mouseenter",()=>{e.mouseInDrawer=!0,clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null}),i.on("mouseleave",()=>{if(e.mouseInDrawer=!1,!e.mouseInRail)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInDrawer&&!e.mouseInRail)n()},t.closeDelay)})},Ic=(e,t)=>{if(window.ResizeObserver)e.resizeObserver=new ResizeObserver(()=>{t()}),e.resizeObserver.observe(document.body);else window.addEventListener("resize",t);window.addEventListener("orientationchange",()=>{setTimeout(t,100)})},Lc=(e,t)=>{if(e.resizeObserver)e.resizeObserver.disconnect(),e.resizeObserver=null;else window.removeEventListener("resize",t);if(window.removeEventListener("orientationchange",t),e.outsideClickHandler){let n="ontouchend"in window?"touchend":"click";document.removeEventListener(n,e.outsideClickHandler)}clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null};_n();var uh=(e,t,n)=>{if(e.overlayElement)return e.overlayElement;return e.overlayElement=document.createElement("div"),e.overlayElement.className=t.overlayClass,e.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(e.overlayElement),e.overlayElement.addEventListener("click",(r)=>{if(r.target===e.overlayElement)n()}),e.overlayElement},ch=(e,t,n)=>{if(!e.drawer||e.closeButtonElement)return null;if(e.closeButtonElement=document.createElement("button"),e.closeButtonElement.className=t.closeButtonClass,e.closeButtonElement.setAttribute("aria-label","Close navigation"),e.closeButtonElement.innerHTML=`
22
+ `,t},sh=(e,t,n)=>{let r=document.createElement("div");return r.className=`${t}-${ae.NESTED_CONTAINER}`,r.setAttribute("role","menu"),r.hidden=!0,e.forEach((i)=>{n(i,r,t)}),r},Jr=(e,t,n)=>{let r=document.createElement("div");r.className=`${n}-${ae.ITEM_CONTAINER}`;let i=t.getAttribute("role")==="menu",s=t.getAttribute("role")==="tablist",a=t.closest(`.${n}-nav--drawer, .${n}-nav--drawer-modal, .${n}-nav--drawer-standard`)!==null,o=document.createElement("button");if(o.className=`${n}-${ae.ITEM}`,o.type="button",e.items?.length)if(a)o.setAttribute("role","button"),o.setAttribute("aria-expanded",e.expanded?"true":"false"),o.setAttribute("aria-haspopup","menu");else o.setAttribute("role","button");else if(i)o.setAttribute("role","menuitem");else if(s)o.setAttribute("role","tab"),o.setAttribute("aria-selected",e.active?"true":"false"),o.setAttribute("tabindex",e.active?"0":"-1");if(e.id)o.dataset.id=e.id;if(e.disabled)o.disabled=!0,o.setAttribute("aria-disabled","true");if(e.icon){let l=document.createElement("span");l.className=`${n}-${ae.ICON}`,l.innerHTML=e.icon,o.appendChild(l)}if(e.label){let l=document.createElement("a");l.className=`${n}-${ae.LABEL}`,l.textContent=e.label,l.href=`/${e.id}`,l.style.textDecoration="none",l.style.color="inherit",l.style.pointerEvents="none",l.setAttribute("title",e.label),o.appendChild(l),o.setAttribute("aria-label",e.label)}if(e.badge){let l=document.createElement("span");l.className=`${n}-${ae.BADGE}`,l.textContent=e.badge,l.setAttribute("aria-label",`${e.badge} notifications`),o.appendChild(l)}if(e.active&&!e.items?.length){if(o.classList.add(`${n}-${ae.ACTIVE}`),!s)o.setAttribute("aria-current","page")}if(r.appendChild(o),e.items?.length&&a){let l=ih(n);o.appendChild(l);let d=sh(e.items,n,Jr);d.hidden=!e.expanded,r.appendChild(d),o.addEventListener("click",(u)=>{u.stopPropagation();let m=o.getAttribute("aria-expanded")==="true";if(o.setAttribute("aria-expanded",(!m).toString()),d.hidden=m,l.style)l.style.transform=m?"":"rotate(90deg)"})}return t.appendChild(r),o},Ds=(e,t)=>{let n=e.closest(`.${t}-${ae.ITEM_CONTAINER}`);if(!n)return[];let r=n.querySelector(`.${t}-${ae.NESTED_CONTAINER}`);if(!r)return[];return Array.from(r.querySelectorAll(`.${t}-${ae.ITEM}`)).reduce((s,a)=>[...s,a,...Ds(a,t)],[])};function ah(e,t){if(!e)return null;let n=e.getAttribute("data-id");if(n)return n;if(e.classList.contains(`${t}-nav--rail`))return"rail";if(e.classList.contains(`${t}-nav--drawer`))return"drawer";return null}var lc=(e)=>(t)=>{let n=new Map,r=null,i=e.prefix||"mtrl",s=(l,d)=>{if(n.set(l.id,{element:d,config:l}),l.items?.length)l.items.forEach((u)=>{let m=d.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(m){let p=m.querySelector(`.${i}-${ae.NESTED_CONTAINER}`);if(p){let g=p.querySelector(`[data-id="${u.id}"]`);if(g)s(u,g)}}})},a=(l,d,u)=>{let m=l.getAttribute("role");if(u){if(l.classList.add(`${i}-${ae.ACTIVE}`),m==="tab")l.setAttribute("aria-selected","true"),l.setAttribute("tabindex","0");else if(!l.getAttribute("aria-haspopup"))l.setAttribute("aria-current","page")}else if(l.classList.remove(`${i}-${ae.ACTIVE}`),m==="tab")l.setAttribute("aria-selected","false"),l.setAttribute("tabindex","-1");else if(l.hasAttribute("aria-current"))l.removeAttribute("aria-current")};if(e.items)e.items.forEach((l)=>{let d=Jr(l,t.element,i);if(s(l,d),l.active)r={element:d,config:l},a(d,r,!0)});if(t.emit)t.element.addEventListener("mouseover",(l)=>{let u=l.target.closest("[data-id]");if(u){let m=u.dataset.id;if(m)t.emit("mouseover",{id:m,clientX:l.clientX,clientY:l.clientY,target:u,item:n.get(m)})}},{passive:!0}),t.element.addEventListener("mouseenter",(l)=>{let d=t.element.dataset.id||t.componentName||"nav";t.emit("mouseenter",{clientX:l.clientX,clientY:l.clientY,id:d})},{passive:!0}),t.element.addEventListener("mouseleave",(l)=>{let d=l.relatedTarget,u=ah(d,i),m=t.element.dataset.id||t.componentName||"nav";t.emit("mouseleave",{clientX:l.clientX,clientY:l.clientY,relatedTargetId:u,id:m})});if(t.lifecycle){let l=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(n.clear(),l)l()}}let o=(l)=>{let d=[l],u=n.get(l);if(!u)return d;let m=u.element.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(!m)return d;let p=m.parentElement;if(!p||!p.classList.contains(`${i}-${ae.NESTED_CONTAINER}`))return d;let g=p;while(g){let c=g.parentElement;if(!c||!c.classList.contains(`${i}-${ae.ITEM_CONTAINER}`))break;let f=c.querySelector(`.${i}-${ae.ITEM}[data-id]`);if(!f)break;let h=f.getAttribute("data-id");if(!h)break;d.unshift(h);let C=c.parentElement;if(!C||!C.classList.contains(`${i}-${ae.NESTED_CONTAINER}`))break;g=C}return d};return{...t,items:n,addItem(l){if(n.has(l.id))return this;let d=Jr(l,t.element,i);if(s(l,d),l.active)this.setActive(l.id);if(t.emit)t.emit("itemAdded",{id:l.id,item:{element:d,config:l}});return this},removeItem(l){let d=n.get(l);if(!d)return this;if(Ds(d.element,i).forEach((p)=>{let g=p.dataset.id;if(g)n.delete(g)}),r?.config.id===l)r=null;let m=d.element.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(m)m.remove();if(n.delete(l),t.emit)t.emit("itemRemoved",{id:l,item:d});return this},getItem:(l)=>n.get(l),getAllItems:()=>Array.from(n.values()),getActive:()=>r,getItemPath:(l)=>o(l),setActive(l){let d=n.get(l);if(!d||d.config.disabled)return this;if(r)a(r.element,r,!1);if(a(d.element,d,!0),r=d,o(l).forEach((m)=>{let p=n.get(m);if(p){let g=p.element,c=g.closest(`.${i}-${ae.ITEM_CONTAINER}`);if(c){let f=c.querySelector(`.${i}-${ae.NESTED_CONTAINER}`);if(f)g.setAttribute("aria-expanded","true"),f.hidden=!1}}}),t.emit)t.emit(oc.CHANGE,{id:l,item:d,previousItem:r,path:o(l)});return this}}};var ot={ITEM:"nav-item",ITEM_CONTAINER:"nav-item-container",ICON:"nav-item-icon",LABEL:"nav-item-label",BADGE:"nav-item-badge",DIVIDER:"nav-divider",SCRIM:"nav-scrim",GROUP:"nav-group",GROUP_TITLE:"nav-group-title",SUBTITLE:"nav-subtitle",NESTED_CONTAINER:"nav-nested-container",NESTED_ITEM:"nav-nested-item",EXPAND_ICON:"nav-expand-icon"};var dc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=(a,o)=>{if(!a)return;let l=a.getAttribute("role");if(o){if(a.classList.add(`${n}-${ot.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","true"),a.setAttribute("tabindex","0");else if(!a.getAttribute("aria-haspopup"))a.setAttribute("aria-current","page")}else if(a.classList.remove(`${n}-${ot.ITEM}--active`),l==="tab")a.setAttribute("aria-selected","false"),a.setAttribute("tabindex","-1");else if(a.hasAttribute("aria-current"))a.removeAttribute("aria-current")},i=(a)=>{if(a.getAttribute("aria-expanded")===null)return!1;let l=a.getAttribute("aria-expanded")==="true";a.setAttribute("aria-expanded",(!l).toString());let d=a.closest(`.${n}-${ot.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(d){let m=d.querySelector(`.${n}-${ot.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(m){m.hidden=l;let p=a.querySelector(`.${n}-${ot.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(p&&p.style)p.style.transform=l?"":"rotate(90deg)"}}let u=a.dataset.id;if(u&&t.emit)t.emit("expandToggle",{id:u,expanded:!l});return!0},s={...t,handleItemClick(a){if(!t.items)return;let o=t.items.get(a);if(!o)return;let l=t.element.querySelector(`.${n}-${ot.ITEM}--active, .mtrl-nav-item--active`);if(l)r(l,!1);if(o.element)r(o.element,!0);if(t.emit){let d=t.getItemPath?t.getItemPath(a):[];t.emit("change",{id:a,item:o,previousItem:l?{element:l,config:{id:l.dataset.id}}:null,path:d,source:"userAction"})}}};return t.element.addEventListener("click",(a)=>{let o=a.target,l=o.closest(`.${n}-${ot.ITEM}, .mtrl-nav-item`);if(!l){if(!o.closest("[data-id]"))return}let d=l||o.closest("[data-id]");if(d.hasAttribute("disabled")||d.getAttribute("aria-disabled")==="true")return;let u=d.dataset.id;if(!u)return;if(i(d))return;s.handleItemClick(u)}),t.element.addEventListener("keydown",(a)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;let o=["rail","drawer"].includes(t.variant||""),l=["bar"].includes(t.variant||"");if(a.key==="Enter"||a.key===" "){let g=document.activeElement;if(g&&g.classList.contains(`${n}-${ot.ITEM}`)){if(a.preventDefault(),g.dataset.id)g.click()}return}let d=Array.from(t.element.querySelectorAll(`.${n}-${ot.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
+ .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(d.length===0)return;let u=document.activeElement,m=d.indexOf(u),p=-1;if(o&&(a.key==="ArrowDown"||a.key==="ArrowRight")||l&&a.key==="ArrowRight")p=m<0?0:(m+1)%d.length;else if(o&&(a.key==="ArrowUp"||a.key==="ArrowLeft")||l&&a.key==="ArrowLeft")p=m<0?d.length-1:(m-1+d.length)%d.length;else if(a.key==="Home")p=0;else if(a.key==="End")p=d.length-1;if(p>=0)a.preventDefault(),d[p].focus()}),s};Q();var oh={variant:mn.VARIANT,position:mn.POSITION,behavior:mn.BEHAVIOR,items:[],showLabels:mn.SHOW_LABELS,scrimEnabled:mn.SCRIM_ENABLED},uc=(e={})=>P(oh,e,"nav"),cc=(e)=>{let t=e.variant?`${e.prefix}-${ae.VARIANT_PREFIX}${e.variant}`:"",n=e.position?`${e.prefix}-${ae.POSITION_PREFIX}${e.position}`:"",r=e.class||"",i=[t,n,r].filter(Boolean);return V(e,{tag:"nav",attributes:{role:"navigation","aria-label":e.ariaLabel||"Main Navigation"},className:i})},mc=(e)=>({disabled:{enable:e.disabled?.enable||(()=>{}),disable:e.disabled?.disable||(()=>{})},lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})}});var lh=(e,t)=>{let{element:n}=e,r=t.variant||"rail",i=t.prefix||"mtrl";if(n.setAttribute("aria-label",t.ariaLabel||"Main Navigation"),r==="bar")if(!t.items?.some((a)=>a.items?.length))n.setAttribute("role","tablist"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","menubar"),n.setAttribute("aria-orientation","horizontal");else n.setAttribute("role","navigation");if((r==="modal"||r==="drawer"&&t.behavior==="dismissible")&&!t.expanded)n.classList.add(`${i}-nav--hidden`)},dh=(e={})=>{let t=uc(e);try{let r=O(M,B(),R(cc(t)),se(t),Pn(t),lc(t),dc(t),oe(t),k(),(i)=>ac(mc(i))(i))(t);if(lh(r,t),t.disabled)r.disable();if(r.element.dataset.componentType="navigation",t.variant)r.element.dataset.variant=t.variant;return r}catch(n){throw Error(`Failed to create navigation: ${n instanceof Error?n.message:String(n)}`)}},fn=dh;var fc=(e={})=>({rail:null,drawer:null,activeSection:e.activeSection||null,activeSubsection:e.activeSubsection||null,items:e.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}),Ms=(e={})=>({animateDrawer:e.animateDrawer!==!1,showLabelsOnRail:e.showLabelsOnRail!==!1,hideDrawerOnClick:e.hideDrawerOnClick||!1,expanded:e.expanded===!0,hoverDelay:e.hoverDelay||200,closeDelay:e.closeDelay||100,railOptions:e.railOptions||{},drawerOptions:e.drawerOptions||{}}),Os=(e={})=>({breakpoint:e.breakpoint||960,lockBodyScroll:e.lockBodyScroll!==!1,hideOnClickOutside:e.hideOnClickOutside!==!1,enableSwipeGestures:e.enableSwipeGestures!==!1,optimizeForTouch:e.optimizeForTouch!==!1,overlayClass:e.overlayClass||"mtrl-nav-overlay",closeButtonClass:e.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:e.bodyLockClass||"mtrl-body-drawer-open"});_n();var pc=(e,t,n,r)=>{if(!e.drawer||!t||!e.items[t])return;let s=e.items[t].items||[];if(s.length===0){r();return}let a=e.drawer.getAllItems();if(a?.length>0)a.forEach((o)=>{e.drawer.removeItem(o.config.id)});s.forEach((o)=>{e.drawer.addItem(o)}),n()},gc=(e,t)=>{let n=Object.keys(e.items||{}).map((i)=>({id:i,label:e.items[i]?.label||i,icon:e.items[i]?.icon||"",active:i===e.activeSection})),r=fn({variant:"rail",position:"left",showLabels:t.showLabelsOnRail,items:n,...t.railOptions});return document.body.appendChild(r.element),r},hc=(e,t)=>{let n=fn({variant:"drawer",position:"left",items:[],...t.drawerOptions});if(document.body.appendChild(n.element),n.element.dataset.id="drawer",!t.expanded)n.element.classList.add("mtrl-nav--hidden"),n.element.setAttribute("aria-hidden","true");return n},Cc=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.remove("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","false"),e.isMobile){if(e.overlayElement)e.overlayElement.classList.add("active"),e.overlayElement.setAttribute("aria-hidden","false");if(t.lockBodyScroll)document.body.classList.add(t.bodyLockClass);if(e.closeButtonElement)e.closeButtonElement.style.display="flex"}},Ec=(e,t)=>{if(!e.drawer)return;if(e.drawer.element.classList.add("mtrl-nav--hidden"),e.drawer.element.setAttribute("aria-hidden","true"),e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(t.lockBodyScroll)document.body.classList.remove(t.bodyLockClass)},bc=(e)=>{if(!e.drawer)return!1;return!e.drawer.element.classList.contains("mtrl-nav--hidden")},vc=(e,t,n,r,i)=>{let s=e.isMobile;if(e.isMobile=window.innerWidth<=t.breakpoint||co(),s!==e.isMobile){if(e.isMobile)n();else r();if(i.onViewChange)i.onViewChange({mobile:e.isMobile,previousMobile:s,width:window.innerWidth})}},Tc=(e)=>{if(e.overlayElement&&e.overlayElement.parentNode)e.overlayElement.parentNode.removeChild(e.overlayElement),e.overlayElement=null;if(e.rail)e.rail.destroy(),e.rail=null;if(e.drawer)e.drawer.destroy(),e.drawer=null;e.activeSection=null,e.activeSubsection=null,e.mouseInDrawer=!1,e.mouseInRail=!1,e.processingChange=!1,e.isMobile=!1},Sc=(e,t,n,r)=>{if(!t||!e.items[t])return;if(e.activeSection===t&&e.activeSubsection===n)return;if(e.activeSection=t,e.rail)e.rail.setActive(t,r);if(n&&e.drawer)e.activeSubsection=n,e.drawer.setActive(n,r)};var yc=(e,t,n,r,i,s)=>{let a=e.rail;if(!a)return;a.on("change",(o)=>{let l=o?.id;if(!l||e.processingChange)return;let d=o?.source==="userAction";if(e.processingChange=!0,e.activeSection=l,n(l),s.onSectionChange&&d)s.onSectionChange(l,{source:d?"userClick":"programmatic"});setTimeout(()=>{e.processingChange=!1},50)}),a.on("mouseover",(o)=>{let l=o?.id;if(e.mouseInRail=!0,clearTimeout(e.hoverTimer),e.hoverTimer=null,l)if(e.items[l]?.items?.length>0)e.hoverTimer=window.setTimeout(()=>{n(l)},t.hoverDelay);else e.closeTimer=window.setTimeout(()=>{if(e.mouseInRail&&!e.mouseInDrawer)i()},t.hoverDelay)}),a.on("mouseenter",()=>{e.mouseInRail=!0,clearTimeout(e.closeTimer),e.closeTimer=null}),a.on("mouseleave",()=>{if(e.mouseInRail=!1,clearTimeout(e.hoverTimer),e.hoverTimer=null,!e.mouseInDrawer)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInRail&&!e.mouseInDrawer)i()},t.closeDelay)})},xc=(e,t,n,r)=>{let i=e.drawer;if(!i)return;if(typeof i.on==="function")i.on("change",(s)=>{let a=s.id;if(e.activeSubsection=a,t.hideDrawerOnClick)n();if(r.onItemSelect)r.onItemSelect(s)}),i.on("mouseenter",()=>{e.mouseInDrawer=!0,clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null}),i.on("mouseleave",()=>{if(e.mouseInDrawer=!1,!e.mouseInRail)e.closeTimer=window.setTimeout(()=>{if(!e.mouseInDrawer&&!e.mouseInRail)n()},t.closeDelay)})},Ic=(e,t)=>{if(window.ResizeObserver)e.resizeObserver=new ResizeObserver(()=>{t()}),e.resizeObserver.observe(document.body);else window.addEventListener("resize",t);window.addEventListener("orientationchange",()=>{setTimeout(t,100)})},Lc=(e,t)=>{if(e.resizeObserver)e.resizeObserver.disconnect(),e.resizeObserver=null;else window.removeEventListener("resize",t);if(window.removeEventListener("orientationchange",t),e.outsideClickHandler){let n="ontouchend"in window?"touchend":"click";document.removeEventListener(n,e.outsideClickHandler)}clearTimeout(e.hoverTimer),clearTimeout(e.closeTimer),e.hoverTimer=null,e.closeTimer=null};_n();var uh=(e,t,n)=>{if(e.overlayElement)return e.overlayElement;return e.overlayElement=document.createElement("div"),e.overlayElement.className=t.overlayClass,e.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(e.overlayElement),e.overlayElement.addEventListener("click",(r)=>{if(r.target===e.overlayElement)n()}),e.overlayElement},ch=(e,t,n)=>{if(!e.drawer||e.closeButtonElement)return null;if(e.closeButtonElement=document.createElement("button"),e.closeButtonElement.className=t.closeButtonClass,e.closeButtonElement.setAttribute("aria-label","Close navigation"),e.closeButtonElement.innerHTML=`
24
24
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
25
25
  <line x1="18" y1="6" x2="6" y2="18"></line>
26
26
  <line x1="6" y1="6" x2="18" y2="18"></line>
27
27
  </svg>
28
- `,e.closeButtonElement.addEventListener("click",()=>{n()}),ze()&&t.optimizeForTouch)e.closeButtonElement.style.minWidth=`${Si.COMFORTABLE}px`,e.closeButtonElement.style.minHeight=`${Si.COMFORTABLE}px`,e.closeButtonElement.addEventListener("touchstart",()=>{e.closeButtonElement.classList.add("active")},{passive:!0}),e.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{e.closeButtonElement.classList.remove("active")},Tt.FEEDBACK_DURATION)},{passive:!0});return e.drawer.element.appendChild(e.closeButtonElement),e.closeButtonElement},Ac=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;if(uh(e,t,n),ch(e,t,n),mh(e,t,n,r),t.enableSwipeGestures&&ze())fh(e,n,r);n()},mh=(e,t,n,r)=>{if(!t.hideOnClickOutside)return;if(e.outsideClickHandlerSet)return;e.outsideClickHandlerSet=!0;let i=ze()?"touchend":"click",s=(a)=>{if(!e.isMobile||!r())return;let l=Je(a).target;if(e.drawer.element.contains(l)||e.rail.element.contains(l))return;n()};e.outsideClickHandler=s,document.addEventListener(i,s,ze()?{passive:!0}:!1)},fh=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;let a=0,o=0;s.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),s.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||n()||!r)return;let d=l.touches[0],u=d.clientX-a,c=d.clientY-o;if(Math.abs(u)>Math.abs(c)&&u>Tt.SWIPE_THRESHOLD)r()},{passive:!0}),i.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),i.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||!n())return;let u=l.touches[0].clientX-a;if(u<0){if(i.element.style.transform=`translateX(${u/2}px)`,u<-Tt.SWIPE_THRESHOLD)t()}},{passive:!0}),i.element.addEventListener("touchend",()=>{if(i.element.style.transform)i.element.style.transition="transform 0.2s ease",i.element.style.transform="",setTimeout(()=>{i.element.style.transition=""},200)},{passive:!0})},Nc=(e,t)=>{if(e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(e.closeButtonElement)e.closeButtonElement.style.display="none";document.body.classList.remove(t.bodyLockClass)};var ph=(e={})=>{let t=fc(e),n=Ms(e),r=Os(e),i={initialize:()=>i,cleanup:()=>{},navigateTo:()=>{},getRail:()=>t.rail,getDrawer:()=>t.drawer,getActiveSection:()=>t.activeSection,getActiveSubsection:()=>t.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>i,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>t.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},s=()=>Cc(t,r),a=()=>Ec(t,r),o=()=>bc(t),l=(m)=>{pc(t,m,s,a)},d=()=>{Ac(t,r,a,o)},u=()=>{vc(t,r,d,()=>Nc(t,r),i)},c=(m,h,C)=>{Sc(t,m,h,C)},p=()=>{if(t.rail=gc(t,n),t.drawer=hc(t,n),yc(t,n,l,s,a,i),xc(t,n,a,i),Ic(t,u),e.activeSection&&t.items[e.activeSection]){if(t.activeSection=e.activeSection,t.rail)t.rail.setActive(e.activeSection);if(l(e.activeSection),e.expanded===!0)s();else a()}return u(),i},g=()=>{Lc(t,u),Tc(t)},f=(m)=>(Object.assign(e,m),Object.assign(n,Ms({...e,...m})),Object.assign(r,Os({...e,...m})),i);return i.initialize=p,i.cleanup=g,i.navigateTo=c,i.showDrawer=s,i.hideDrawer=a,i.isDrawerVisible=o,i.configure=f,i.setProcessingChange=(m)=>{t.processingChange=m},i.isProcessingChange=()=>t.processingChange,i.isMobile=()=>t.isMobile,i.checkMobileState=u,i},wc=ph;Hi();ne();Z();J();Ki();xr();var gn=0.0001,Gt=(e,t,n)=>(1-n)*e+n*t,nr=(e,t)=>Math.sqrt(e*e+t*t),er=(e,t)=>{let n=nr(e,t);if(n<=0)throw Error("Required distance greater than zero");return[e/n,t/n]},tr=([e,t])=>[-t,e],pn=(e,t)=>e[0]*t[0]+e[1]*t[1],ei=(e,t,n,r)=>[e,t,Gt(e,n,0.3333333333333333),Gt(t,r,0.3333333333333333),Gt(e,n,0.6666666666666666),Gt(t,r,0.6666666666666666),n,r],Dc=(e,t,n,r,i,s)=>{let a=er(n-e,r-t),o=er(i-e,s-t),l=tr(a),d=tr(o),u=pn(l,[i-e,s-t])>=0,c=pn(a,o);if(c>0.999)return ei(n,r,i,s);let p=nr(n-e,r-t)*4/3*((Math.sqrt(2*(1-c))-Math.sqrt(1-c*c))/(1-c))*(u?1:-1);return[n,r,n+l[0]*p,r+l[1]*p,i-d[0]*p,s-d[1]*p,i,s]},Rs=(e,t)=>{let n=1-t;return[e[0]*(n*n*n)+e[2]*(3*t*n*n)+e[4]*(3*t*t*n)+e[6]*(t*t*t),e[1]*(n*n*n)+e[3]*(3*t*n*n)+e[5]*(3*t*t*n)+e[7]*(t*t*t)]},Mc=(e)=>[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]],ti=(e)=>Math.abs(e[0]-e[6])<0.0001&&Math.abs(e[1]-e[7])<0.0001,Oc=(e,t)=>{let n=t(e[0],e[1]),r=t(e[2],e[3]),i=t(e[4],e[5]),s=t(e[6],e[7]);return[n[0],n[1],r[0],r[1],i[0],i[1],s[0],s[1]]},Rc=(e)=>{if(ti(e))return[e[0],e[1],e[0],e[1]];return[Math.min(e[0],e[2],e[4],e[6]),Math.min(e[1],e[3],e[5],e[7]),Math.max(e[0],e[2],e[4],e[6]),Math.max(e[1],e[3],e[5],e[7])]};var Ps={radius:0,smoothing:0},rr=(e,t)=>[e[0]-t[0],e[1]-t[1]],ht=(e,t)=>[e[0]+t[0],e[1]+t[1]],Ye=(e,t)=>[e[0]*t,e[1]*t],_c=(e)=>nr(e[0],e[1]),kc=(e)=>er(e[0],e[1]),gh=(e,t,n)=>[Gt(e[0],t[0],n),Gt(e[1],t[1],n)],hh=(e,t,n,r)=>{let i=tr(r),s=pn(t,i);if(Math.abs(s)<gn)return null;let a=pn(rr(n,e),i);if(Math.abs(s)<gn*Math.abs(a))return null;return ht(e,Ye(t,a/s))},Ch=(e,t,n,r)=>{let i=rr(e,t),s=rr(n,t),a=_c(i),o=_c(s);if(a>0&&o>0){let l=Ye(i,1/a),d=Ye(s,1/o),u=r.radius,c=r.smoothing??0,p=pn(l,d),g=Math.sqrt(1-p*p),f=g>0.001?u*(p+1)/g:0;return{p0:e,p1:t,p2:n,d1:l,d2:d,cornerRadius:u,smoothing:c,expectedRoundCut:f,expectedCut:(1+c)*f}}return{p0:e,p1:t,p2:n,d1:[0,0],d2:[0,0],cornerRadius:0,smoothing:0,expectedRoundCut:0,expectedCut:0}},Pc=(e,t)=>{if(t>e.expectedCut)return e.smoothing;if(t>e.expectedRoundCut)return e.smoothing*(t-e.expectedRoundCut)/(e.expectedCut-e.expectedRoundCut);return 0},Bc=(e,t,n,r,i,s,a,o)=>{let l=kc(rr(r,n)),d=ht(n,Ye(l,e*(1+t))),u=gh(i,Ye(ht(i,s),0.5),t),c=ht(a,Ye(er(u[0]-a[0],u[1]-a[1]),o)),p=tr(rr(c,a)),g=hh(r,l,c,p)??i,f=Ye(ht(d,Ye(g,2)),0.3333333333333333);return[d[0],d[1],f[0],f[1],g[0],g[1],c[0],c[1]]},Eh=(e,t,n)=>{let r=Math.min(t,n),{p0:i,p1:s,p2:a,d1:o,d2:l,cornerRadius:d,expectedRoundCut:u}=e;if(u<gn||r<gn||d<gn)return[ei(s[0],s[1],s[0],s[1])];let c=Math.min(r,u),p=Pc(e,t),g=Pc(e,n),f=d*c/u,m=Math.sqrt(f*f+c*c),h=ht(s,Ye(kc(Ye(ht(o,l),0.5)),m)),C=ht(s,Ye(o,c)),T=ht(s,Ye(l,c)),b=Bc(c,p,s,i,C,T,h,f),E=Mc(Bc(c,g,s,a,T,C,h,f));return[b,Dc(h[0],h[1],b[6],b[7],E[0],E[1]),E]},ni=(e,t=Ps,n,r,i)=>{if(e.length<6)throw Error("Polygons must have at least 3 vertices");if(e.length%2===1)throw Error("The vertices array should have even size");let s=e.length/2;if(n&&n.length!==s)throw Error("perVertexRounding should have one entry per vertex");let a=(g)=>[e[g%s*2],e[g%s*2+1]],o=[];for(let g=0;g<s;g++)o.push(Ch(a(g+s-1),a(g),a(g+1),n?.[g]??t));let l=[];for(let g=0;g<s;g++){let f=o[(g+1)%s],m=o[g].expectedRoundCut+f.expectedRoundCut,h=o[g].expectedCut+f.expectedCut,C=a(g),T=a(g+1),b=nr(C[0]-T[0],C[1]-T[1]);if(m>b)l.push([b/m,0]);else if(h>b)l.push([1,(b-m)/(h-m)]);else l.push([1,1])}let d=[];for(let g=0;g<s;g++){let f=o[g],m=[];for(let h=0;h<=1;h++){let[C,T]=l[(g+s-1+h)%s];m.push(f.expectedRoundCut*C+(f.expectedCut-f.expectedRoundCut)*T)}d.push(Eh(f,m[0],m[1]))}let u=[];for(let g=0;g<s;g++){let f=d[g],m=d[(g+1)%s];for(let b of f)if(!ti(b))u.push(b);let h=f[f.length-1],C=m[0],T=ei(h[6],h[7],C[0],C[1]);if(!ti(T))u.push(T)}let c=r,p=i;if(c===void 0||p===void 0){let g=0,f=0;for(let m=0;m<s;m++)g+=e[m*2],f+=e[m*2+1];c=g/s,p=f/s}return{cubics:u,centerX:c,centerY:p}},_s=(e,t,n,r)=>[n+Math.cos(t)*e,r+Math.sin(t)*e],bh=(e,t=1,n=0,r=0,i=Ps,s)=>{let a=[];for(let o=0;o<e;o++)a.push(..._s(t,Math.PI/e*2*o,n,r));return ni(a,i,s,n,r)},Bs=(e=8,t=1,n=0,r=0)=>{if(e<3)throw Error("Circle must have at least three vertices");let i=Math.PI/e;return bh(e,t/Math.cos(i),n,r,{radius:t})},ks=(e,t=1,n=0.5,r=Ps,i,s,a=0,o=0)=>{if(t<=0||n<=0)throw Error("Star radii must both be greater than 0");if(n>=t)throw Error("innerRadius must be less than radius");let l=s;if(!l&&i){l=[];for(let u=0;u<e;u++)l.push(r,i)}let d=[];for(let u=0;u<e;u++)d.push(..._s(t,Math.PI/e*2*u,a,o)),d.push(..._s(n,Math.PI/e*(2*u+1),a,o));return ni(d,r,l,a,o)},Hs=(e,t)=>{let n=t(e.centerX,e.centerY);return{cubics:e.cubics.map((r)=>Oc(r,t)),centerX:n[0],centerY:n[1]}},$s=(e,t)=>{let n=t*Math.PI/180,r=Math.cos(n),i=Math.sin(n);return Hs(e,(s,a)=>[s*r-a*i,s*i+a*r])},Hc=(e,t,n=t)=>Hs(e,(r,i)=>[r*t,i*n]),Vs=(e)=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let s of e.cubics){let a=Rc(s);t=Math.min(t,a[0]),n=Math.min(n,a[1]),r=Math.max(r,a[2]),i=Math.max(i,a[3])}return[t,n,r,i]};var $c=(e)=>{let t=Vs(e),n=t[2]-t[0],r=t[3]-t[1],i=Math.max(n,r),s=(i-n)/2-t[0],a=(i-r)/2-t[1];return Hs(e,(o,l)=>[(o+s)/i,(l+a)/i])};var vh={radius:0.15},Th={radius:0.5},Xe=(e,t,n={radius:0})=>({x:e,y:t,r:n}),Vc=(e)=>e/360*2*Math.PI,Sh=(e,t,n,r,i)=>{let s=[];if(i){let o=e.map((c)=>Math.atan2(c.y-r,c.x-n)*180/Math.PI),l=e.map((c)=>Math.hypot(c.x-n,c.y-r)),d=t*2,u=360/d;for(let c=0;c<d;c++)for(let p=0;p<e.length;p++){let g=c%2===0?p:e.length-1-p;if(g>0||c%2===0){let f=Vc(u*c+(c%2===0?o[g]:u-o[g]+2*o[0]));s.push(Xe(Math.cos(f)*l[g]+n,Math.sin(f)*l[g]+r,e[g].r))}}return s}let a=e.length;for(let o=0;o<a*t;o++){let l=e[o%a],d=Vc(Math.floor(o/a)*(360/t)),u=l.x-n,c=l.y-r;s.push(Xe(u*Math.cos(d)-c*Math.sin(d)+n,u*Math.sin(d)+c*Math.cos(d)+r,l.r))}return s},ri=(e,t,n=!1,r=0.5,i=0.5)=>{let s=Sh(e,t,r,i,n),a=[];for(let o of s)a.push(o.x,o.y);return ni(a,void 0,s.map((o)=>o.r),r,i)},yh={circle:()=>Bs(10),oval:()=>$s(Hc(Bs(),1,0.64),-45),pill:()=>ri([Xe(0.961,0.039,{radius:0.426}),Xe(1.001,0.428),Xe(1,0.609,{radius:1})],2,!0),pentagon:()=>ri([Xe(0.5,-0.009,{radius:0.172}),Xe(1.03,0.365,{radius:0.164}),Xe(0.828,0.97,{radius:0.169})],1,!0),sunny:()=>ks(8,1,0.8,vh),cookie4:()=>ri([Xe(1.237,1.236,{radius:0.258}),Xe(0.5,0.918,{radius:0.233})],4),cookie9:()=>$s(ks(9,1,0.8,Th),-90),softBurst:()=>ri([Xe(0.193,0.277,{radius:0.053}),Xe(0.176,0.055,{radius:0.053})],10)},Fc=new Map,Fs=(e)=>{let t=Fc.get(e);if(!t)t=$c(yh[e]()),Fc.set(e,t);return t},ii=Math.PI*2,Us=(e,t=360,n=24)=>{let r=[];for(let g of e.cubics)for(let f=0;f<n;f++)r.push(Rs(g,f/n));let i=0,s=0,a=0;for(let g=0;g<r.length;g++){let[f,m]=r[g],[h,C]=r[(g+1)%r.length],T=f*C-h*m;i+=T,s+=(f+h)*T,a+=(m+C)*T}if(Math.abs(i)>0.000000000001)s/=3*i,a/=3*i;else{let g=Vs(e);s=(g[0]+g[2])/2,a=(g[1]+g[3])/2}let o=[];for(let[g,f]of r){let m=g-s,h=f-a,C=Math.atan2(h,m);if(C<0)C+=ii;o.push([C,Math.hypot(m,h)])}o.sort((g,f)=>g[0]-f[0]);let l=o[o.length-1],d=o[0];o.unshift([l[0]-ii,l[1]]),o.push([d[0]+ii,d[1]]);let u=new Float32Array(t),c=0,p=0;for(let g=0;g<t;g++){let f=g/t*ii;while(o[c+1][0]<f)c++;let[m,h]=o[c],[C,T]=o[c+1],b=C===m?0:(f-m)/(C-m),E=h+(T-h)*b;if(u[g]=E,E>p)p=E}return{radii:u,centerX:s,centerY:a,maxRadius:p}};var ye={SIZE:48,INDICATOR_SIZE:38,MIN_SIZE:24,MAX_SIZE:240,MORPH_INTERVAL:650,ROTATION_DURATION:4666,MORPH_ROTATION:90,LABEL:"Loading",SAMPLES:360},hn={DAMPING:0.6,STIFFNESS:200,THRESHOLD:0.1},Uc=["softBurst","cookie9","pentagon","pill","sunny","cookie4","oval"],Gc=["circle","softBurst"],Cn={ROOT:"loading-indicator",CONTAINED:"loading-indicator--contained",DETERMINATE:"loading-indicator--determinate",CANVAS:"loading-indicator__canvas"};var zc=new Map,xh=(e)=>{let t=zc.get(e);if(!t)t=Us(Fs(e),ye.SAMPLES),zc.set(e,t);return t},Ih=Math.PI*2,Wc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=document.createElement("canvas");r.className=`${n}-${Cn.CANVAS}`,r.setAttribute("aria-hidden","true"),t.element.appendChild(r);let i=null,s="",a=null,o=(h)=>{if(typeof r.getContext!=="function")return null;if(!i){if(!r.getContext("2d"))return null;i=qn(r,h,h)}else if(i.width!==h)jn(i,h,h);return i},l=()=>{let h=t.element.ownerDocument.defaultView;s=h&&t.element.isConnected?h.getComputedStyle(t.element).color:""},d=(h,C)=>{a={shapes:h,frame:C};let T=i?.width??0,b=i?.ctx;if(!b||T<=0||h.length===0)return;let E=h[C.index%h.length],v=h[(C.index+1)%h.length],S=E.radii.length,y=0;for(let N of h)y=Math.max(y,N.maxRadius);let L=T*(ye.INDICATOR_SIZE/ye.SIZE)/2/y,I=T/2,x=C.rotation*Math.PI/180,A=C.progress;if(b.clearRect(0,0,T,T),!s)l();b.fillStyle=s||"#000",b.beginPath();for(let N=0;N<S;N++){let k=(E.radii[N]+(v.radii[N]-E.radii[N])*A)*L,X=N/S*Ih+x,U=I+Math.cos(X)*k,j=I+Math.sin(X)*k;if(N===0)b.moveTo(U,j);else b.lineTo(U,j)}b.closePath(),b.fill()},u=()=>{if(a)d(a.shapes,a.frame)},c=(h)=>{o(h),l(),u()},p=Gn(()=>{l(),u()}),g=typeof ResizeObserver<"u"?new ResizeObserver(()=>{l(),u()}):null;g?.observe(t.element);let f=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{g?.disconnect(),p(),f?.call(t.lifecycle)};return{...t,canvas:r,renderer:{draw:d,resize:c,refreshColor:l,redraw:u,profiles:(h)=>h.map(xh)}}};var Lh=(e)=>{let t=hn.DAMPING,n=Math.sqrt(hn.STIFFNESS),r=n*Math.sqrt(1-t*t),i=Math.exp(-t*n*e),s=1-i*(Math.cos(r*e)+t*n/r*Math.sin(r*e)),a=i*(n*n/r)*Math.sin(r*e);return[s,a]},Ah=()=>{let e=hn.THRESHOLD,t=hn.DAMPING,n=Math.sqrt(hn.STIFFNESS),r=n*Math.sqrt(1-t*t),i=1,s=t*n*1/r,a=Math.sqrt(1+s*s);return Math.log(a/e)/(t*n)},Nh=Ah(),wh=(e)=>{let t=e/1000;if(t>=Nh)return 1;return Lh(t)[0]},Kc=(e,t)=>{let n=ye.MORPH_INTERVAL,r=Math.floor(e/n),i=e-r*n,s=r%t,a=wh(i),o=ye.MORPH_ROTATION*(r+1)+a*ye.MORPH_ROTATION,l=e%ye.ROTATION_DURATION/ye.ROTATION_DURATION*360;return{index:s,progress:a,rotation:(o+l)%360}},Yc=(e,t)=>({index:Math.floor(e/ye.MORPH_INTERVAL)%t,progress:0,rotation:0}),Xc=(e)=>({index:0,progress:e,rotation:-e*180});Q();var Dh={size:ye.SIZE,contained:!1,ariaLabel:ye.LABEL},qc=(e={})=>_(Dh,e,"loading-indicator"),Gs=(e)=>{let t=typeof e==="number"&&Number.isFinite(e)?e:ye.SIZE;return Math.min(ye.MAX_SIZE,Math.max(ye.MIN_SIZE,t))},zs=(e)=>{if(e===null||e===void 0||!Number.isFinite(e))return null;return Math.min(1,Math.max(0,e))},jc=(e)=>V(e,{tag:"div",attributes:{role:"progressbar","aria-label":e.ariaLabel||ye.LABEL}});var Zc=({config:e,lifecycle:t})=>(n)=>{let{element:r,renderer:i,canvas:s}=n,a=e.prefix||"mtrl",o=(I)=>`${a}-${I}`,d=r.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,u=i.profiles(Uc),c=i.profiles(Gc),p=Gs(e.size),g=zs(e.value),f=!1,m=null,h=0,C=0,T=()=>typeof performance<"u"?performance.now():Date.now(),b=()=>{r.style.setProperty(`--${a}-loading-indicator-size`,`${p}px`),i.resize(p)},E=()=>{if(g===null)r.classList.remove(o(Cn.DETERMINATE)),r.removeAttribute("aria-valuenow"),r.removeAttribute("aria-valuemin"),r.removeAttribute("aria-valuemax");else r.classList.add(o(Cn.DETERMINATE)),r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax","100"),r.setAttribute("aria-valuenow",String(Math.round(g*100))),i.draw(c,Xc(g))},v=()=>{if(m=null,!f||g!==null)return;let I=T()-h,x=d?.matches?Yc(I,u.length):Kc(I,u.length);i.draw(u,x),m=requestAnimationFrame(v)},S=()=>{if(f)return;if(f=!0,h=T()-C,g===null&&m===null)m=requestAnimationFrame(v)},y=()=>{if(!f)return;if(f=!1,C=T()-h,m!==null)cancelAnimationFrame(m),m=null},L={element:r,canvas:s,setValue(I){let x=g;if(g=zs(I),E(),g===null&&x!==null&&f&&m===null)h=T(),m=requestAnimationFrame(v);return this},getValue(){return g},setSize(I){if(p=Gs(I),b(),g!==null)E();return this},getSize(){return p},setLabel(I){return r.setAttribute("aria-label",I),this},start(){return S(),this},stop(){return y(),this},isRunning(){return f},destroy(){y(),r.remove(),t.destroy()}};if(e.contained)r.classList.add(o(Cn.CONTAINED));return b(),E(),S(),L};var Mh=(e={})=>{let t=qc(e);try{return M(D,O(jc(t)),P(),Wc(t),(n)=>Zc({config:t,lifecycle:{destroy:n.lifecycle?.destroy||(()=>{})}})(n))(t)}catch(n){throw console.error("Loading indicator creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create loading indicator: ${n instanceof Error?n.message:String(n)}`)}},Ws=Mh;ne();Z();J();pt();var Oh={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated"},Rh={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},lt={CLICK:"click",EXPAND:"expand",COLLAPSE:"collapse",CHANGE:"change",SELECT:"select"},En={VARIANT:Oh.FILLED,SIZE:Rh.S,TRAILING_LABEL:"More options",MENU_OFFSET:4},bn={ROOT:"split-button",LEADING:"split-button__leading",TRAILING:"split-button__trailing",CHEVRON:"split-button__chevron",EXPANDED:"split-button--expanded"},Jc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor" aria-hidden="true"><path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"/></svg>';var em=(e)=>(t)=>{let n=e.prefix||"mtrl",r=(l)=>`${n}-${l}`,i={variant:e.variant,size:e.size,disabled:e.disabled,prefix:n},s=Te({...i,text:e.text,icon:e.icon,ariaLabel:e.ariaLabel,class:r(bn.LEADING)}),a=Te({...i,icon:Jc,iconSize:"inherit",ariaLabel:e.trailingLabel,class:r(bn.TRAILING)});return a.element.querySelector("svg")?.classList.add(r(bn.CHEVRON)),a.element.setAttribute("aria-haspopup","true"),a.element.setAttribute("aria-expanded","false"),t.element.appendChild(s.element),t.element.appendChild(a.element),{...t,leading:s,trailing:a,leadingElement:s.element,trailingElement:a.element}};var tm=(e)=>(t)=>{if(!e.items||e.items.length===0)return t;let n=t.trailingElement,r=Ft({opener:n,items:e.items,position:"bottom-end",offset:En.MENU_OFFSET,manualOpen:!0,prefix:e.prefix});return{...t,menu:r}};var nm=({config:e,lifecycle:t})=>(n)=>{let r=n.element,i=e.prefix||"mtrl",{leading:s,trailing:a,menu:o}=n,l=`${i}-${bn.EXPANDED}`,d=!1;if(o)a.element.setAttribute("aria-haspopup","menu");let u=(g,f={})=>{n.emit?.(g,{splitButton:p,expanded:d,originalEvent:null,...f})},c=(g,f=null)=>{if(d===g)return;if(d=g,r.classList.toggle(l,d),a.element.setAttribute("aria-expanded",String(d)),o)if(d)o.open(f??void 0);else o.close(f??void 0);u(d?lt.EXPAND:lt.COLLAPSE,{originalEvent:f}),u(lt.CHANGE,{originalEvent:f})},p={element:r,leadingElement:s.element,trailingElement:a.element,menu:o,setText(g){return s.setText(g),this},getText(){return s.getText()},setIcon(g){return s.setIcon(g),this},expand(){return c(!0),this},collapse(){return c(!1),this},isExpanded(){return d},disable(){return s.disable(),a.disable(),this},enable(){return s.enable(),a.enable(),this},isDisabled(){return s.element.disabled===!0},on(g,f){return n.on?.(g,f),this},off(g,f){return n.off?.(g,f),this},destroy(){o?.destroy?.(),s.destroy(),a.destroy(),r.remove(),t.destroy()}};if(s.on("click",(g)=>{u(lt.CLICK,{originalEvent:g})}),a.on("click",(g)=>{c(!d,g)}),o)o.on?.("close",()=>{if(!d)return;d=!1,r.classList.remove(l),a.element.setAttribute("aria-expanded","false"),u(lt.COLLAPSE),u(lt.CHANGE)}),o.on?.("select",(g)=>{u(lt.SELECT,{item:g?.item})});if(e.onClick)p.on(lt.CLICK,e.onClick);if(e.onSelect)p.on(lt.SELECT,e.onSelect);if(e.on){for(let[g,f]of Object.entries(e.on))if(f)p.on(g,f)}return p};Q();var _h={variant:En.VARIANT,size:En.SIZE,disabled:!1,trailingLabel:En.TRAILING_LABEL},rm=(e={})=>_(_h,e,"split-button"),im=(e)=>{let t={role:"group"};if(e.groupLabel)t["aria-label"]=e.groupLabel;return V(e,{tag:"div",attributes:t})};var Ph=(e={})=>{let t=rm(e);try{return M(D,B(),O(im(t)),se(t),mt(t),em(t),tm(t),P(),(n)=>nm({config:t,lifecycle:{destroy:n.lifecycle?.destroy||(()=>{})}})(n))(t)}catch(n){throw console.error("Split button creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create split button: ${n instanceof Error?n.message:String(n)}`)}},Ks=Ph;ne();Z();J();var sm=(e)=>(t)=>{let n=[],r=t.getClass("radios"),i=e.value||"";if(t.element.classList.add(`${r}--${e.direction||"vertical"}`),e.disabled)t.element.classList.add(`${r}--disabled`);let s=(l)=>{let d=document.createElement("div");d.classList.add(`${r}-item`);let u=document.createElement("input");if(u.type="radio",u.name=e.name,u.value=l.value,u.classList.add(`${r}-input`),i===l.value)u.checked=!0;if(e.disabled||l.disabled)u.disabled=!0,d.classList.add(`${r}-item--disabled`);let c=document.createElement("label");c.classList.add(`${r}-label`);let p=document.createElement("span");p.classList.add(`${r}-control`);let g=document.createElement("span");if(g.classList.add(`${r}-circle`),e.ripple!==!1){let C=document.createElement("span");C.classList.add(`${r}-ripple`),p.appendChild(C)}p.appendChild(g);let f=document.createElement("span");if(f.classList.add(`${r}-text`),f.textContent=l.label,l.labelBefore)c.classList.add(`${r}-label--before`),c.appendChild(f),c.appendChild(p);else c.appendChild(p),c.appendChild(f);let m=`${r}-${l.value}-${Math.random().toString(36).substring(2,9)}`;u.id=m,c.htmlFor=m,d.appendChild(u),d.appendChild(c);let h=(C)=>{if(u.checked){if(i=l.value,n.forEach((T)=>{if(T.input!==u)T.input.checked=!1}),t.events&&typeof t.events.emit==="function")t.events.emit("change",{value:l.value,originalEvent:C,option:l});else if(typeof t.on==="function"){let T=new CustomEvent("change",{detail:{value:l.value,originalEvent:C,option:l}});t.element.dispatchEvent(T)}}};return u.addEventListener("change",h),{element:d,input:u,label:c,config:l,destroy:()=>{if(u.removeEventListener("change",h),d.parentNode)d.parentNode.removeChild(d)}}},a=(l)=>{let d=s(l);return t.element.appendChild(d.element),n.push(d),t},o=(l)=>{let d=n.findIndex((u)=>u.config.value===l);if(d!==-1){if(n[d].destroy(),n.splice(d,1),i===l)i=""}return t};if(e.options&&Array.isArray(e.options))e.options.forEach((l)=>a(l));if(!t.events)t.events={on:(l,d)=>{t.element.addEventListener(l,(u)=>d(u.detail))},off:(l,d)=>{t.element.removeEventListener(l,d)},emit:(l,d)=>{let u=new CustomEvent(l,{detail:d});t.element.dispatchEvent(u)}};return{...t,radios:n,getValue:()=>i,setValue:(l)=>(i=l,n.forEach((d)=>{d.input.checked=d.config.value===l}),t),getSelected:()=>{let l=n.find((d)=>d.config.value===i);return l?l.config:null},addOption:a,removeOption:o,enable:()=>(t.element.classList.remove(`${r}--disabled`),n.forEach((l)=>{if(l.input.disabled=l.config.disabled||!1,!l.config.disabled)l.element.classList.remove(`${r}-item--disabled`)}),t),disable:()=>(t.element.classList.add(`${r}--disabled`),n.forEach((l)=>{l.input.disabled=!0,l.element.classList.add(`${r}-item--disabled`)}),t),enableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d){if(d.config.disabled=!1,d.input.disabled=t.element.classList.contains(`${r}--disabled`),!d.input.disabled)d.element.classList.remove(`${r}-item--disabled`)}return t},disableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d)d.config.disabled=!0,d.input.disabled=!0,d.element.classList.add(`${r}-item--disabled`);return t}}};var am=({disabled:e,lifecycle:t})=>(n)=>{if(!n.events)n.events={on:(i,s)=>{n.element.addEventListener(i,(a)=>s(a.detail))},off:(i,s)=>{n.element.removeEventListener(i,s)},emit:(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)}};else if(!n.events.emit)n.events.emit=(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)};return{element:n.element,radios:n.radios,lifecycle:{destroy:t.destroy},getClass:n.getClass,getValue:()=>n.getValue(),setValue(i){return n.setValue(i),this},getSelected:()=>n.getSelected(),addOption(i){return n.addOption(i),this},removeOption(i){return n.removeOption(i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},enableOption(i){return n.enableOption(i),this},disableOption(i){return n.disableOption(i),this},on(i,s){return n.events.on(i,s),this},off(i,s){return n.events.off(i,s),this},destroy(){n.radios.forEach((i)=>i.destroy()),t.destroy()}}};Q();var Bh={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},om=(e)=>_(Bh,e,"radios"),lm=(e)=>V(e,{tag:"div",attributes:{role:"radiogroup"},className:e.class}),dm=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var kh=(e)=>{if(!e.name)e.name=`radios-${Math.random().toString(36).substring(2,9)}`;let t=om(e);try{return M(D,B(),O(lm(t)),sm(t),oe(t),P(),(r)=>am(dm(r))(r))(t)}catch(n){throw console.error("Radios creation error:",n),Error(`Failed to create radios component: ${n.message}`)}},Xs=kh;Z();J();var Re={BAR:"bar",VIEW:"view"},zt={DOCKED:"docked",FULLSCREEN:"fullscreen"},qs={BAR_HEIGHT:56,BAR_MIN_WIDTH:360,BAR_MAX_WIDTH:720,VIEW_DOCKED_HEADER_HEIGHT:56,VIEW_DOCKED_MIN_WIDTH:360,VIEW_DOCKED_MAX_WIDTH:720,VIEW_DOCKED_MIN_HEIGHT:240,VIEW_FULLSCREEN_HEADER_HEIGHT:72,PADDING_HORIZONTAL:16,ICON_SIZE:24,AVATAR_SIZE:30,ICON_SPACING:16},Wt={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",EXPAND:"expand",COLLAPSE:"collapse",SUGGESTION_SELECT:"suggestionSelect"},Ct={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',MIC:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"/></svg>',HISTORY:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'},vn={STATE:Re.BAR,VIEW_MODE:zt.DOCKED,PLACEHOLDER:"Search",VALUE:"",SHOW_CLEAR_BUTTON:!0,DISABLED:!1,FULL_WIDTH:!1},G={ROOT:"search",STATE_BAR:"search--bar",STATE_VIEW:"search--view",VIEW_DOCKED:"search--docked",VIEW_FULLSCREEN:"search--fullscreen",FOCUSED:"search--focused",DISABLED:"search--disabled",POPULATED:"search--populated",FULL_WIDTH:"search--full-width",CONTAINER:"search__container",HEADER:"search__header",INPUT_WRAPPER:"search__input-wrapper",INPUT:"search__input",DIVIDER:"search__divider",CONTENT:"search__content",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",CLEAR_BUTTON:"search__clear-button",CLEAR_BUTTON_HIDDEN:"search__clear-button--hidden",AVATAR:"search__avatar",SUGGESTIONS:"search__suggestions",SUGGESTION_LIST:"search__suggestion-list",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_ITEM_SELECTED:"search__suggestion-item--selected",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",SUGGESTION_DIVIDER:"search__suggestion-divider"},Tn={ENTER:"Enter",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",TAB:"Tab"};Qe();var js=(e)=>(t)=>{let n=e.disabled===!0,r=e.initialState||Re.BAR,i=r===Re.VIEW,s=e.placeholder||"Search",a=e.value||"",o=(S)=>t.getClass?t.getClass(S):S,l=[o(G.ROOT),o(r===Re.BAR?G.STATE_BAR:G.STATE_VIEW),o(e.viewMode==="fullscreen"?G.VIEW_FULLSCREEN:G.VIEW_DOCKED)];if(e.fullWidth)l.push(o(G.FULL_WIDTH));if(n)l.push(o(G.DISABLED));if(a)l.push(o(G.POPULATED));t.element.className=l.filter(Boolean).join(" "),t.element.setAttribute("role","search"),t.element.setAttribute("aria-disabled",n?"true":"false");let d=H({tag:"div",className:o(G.CONTAINER),container:t.element}),u=i?Ct.BACK:e.leadingIcon||Ct.SEARCH,c=H({tag:"button",className:o(G.LEADING_ICON),container:d,html:u,attributes:{type:"button",tabindex:n?"-1":"0","aria-label":i?"Go back":"Search"}}),p=H({tag:"div",className:o(G.INPUT_WRAPPER),container:d}),g={type:"text",placeholder:s,"aria-label":s};if(a)g.value=a;if(n)g.disabled="disabled";let f=H({tag:"input",className:o(G.INPUT),container:p,attributes:g});if(a)f.value=a;let m=null;if(e.showClearButton!==!1){let S=[o(G.CLEAR_BUTTON)];if(!a)S.push(o(G.CLEAR_BUTTON_HIDDEN));m=H({tag:"button",className:S.join(" "),container:d,html:Ct.CLEAR,attributes:{type:"button",tabindex:n||!a?"-1":"0","aria-label":"Clear search"}})}let h=null;if(e.trailingItems&&e.trailingItems.length>0)h=H({tag:"div",className:o("search__trailing"),container:d}),e.trailingItems.forEach((S)=>{let y=S.type==="avatar"?o(G.AVATAR):o(G.TRAILING_ICON);H({tag:S.type==="avatar"?"div":"button",className:y,container:h,html:S.content,attributes:{...S.type!=="avatar"&&{type:"button"},tabindex:n?"-1":"0","aria-label":S.ariaLabel||"","data-trailing-id":S.id}})});let C=null,T=null,b=null,E=null;if(C=H({tag:"div",className:o(G.DIVIDER)}),T=H({tag:"div",className:o(G.CONTENT)}),b=H({tag:"div",className:o(G.SUGGESTIONS),container:T}),E=H({tag:"ul",className:o(G.SUGGESTION_LIST),container:b,attributes:{role:"listbox","aria-label":"Search suggestions"}}),i)t.element.appendChild(C),t.element.appendChild(T);return{...t,structure:{container:d,input:f,inputWrapper:p,leadingIcon:c,clearButton:m,trailingContainer:h,divider:C,suggestionsContainer:b,suggestionsList:E}}};var Zs=(e)=>(t)=>{let n=e.initialState||Re.BAR,r=e.viewMode||zt.DOCKED,i=e.disabled===!0,s=(g)=>t.getClass?t.getClass(g):g,a=()=>{if(n===Re.VIEW||i)return;let{element:g,structure:f}=t;if(n=Re.VIEW,g.classList.remove(s(G.STATE_BAR)),g.classList.add(s(G.STATE_VIEW)),f?.leadingIcon)f.leadingIcon.innerHTML=Ct.BACK,f.leadingIcon.setAttribute("aria-label","Go back");if(f?.divider&&!g.contains(f.divider))g.appendChild(f.divider);if(f?.suggestionsContainer?.parentElement&&!g.contains(f.suggestionsContainer.parentElement))g.appendChild(f.suggestionsContainer.parentElement);if(f?.input)requestAnimationFrame(()=>{f.input.focus()});if(t.emit)t.emit("expand",{component:t,state:n,viewMode:r})},o=()=>{if(n===Re.BAR)return;let{element:g,structure:f}=t;if(n=Re.BAR,g.classList.remove(s(G.STATE_VIEW)),g.classList.add(s(G.STATE_BAR)),f?.leadingIcon)f.leadingIcon.innerHTML=e.leadingIcon||Ct.SEARCH,f.leadingIcon.setAttribute("aria-label","Search");if(f?.divider&&g.contains(f.divider))g.removeChild(f.divider);if(f?.suggestionsContainer?.parentElement&&g.contains(f.suggestionsContainer.parentElement))g.removeChild(f.suggestionsContainer.parentElement);if(t.emit)t.emit("collapse",{component:t,state:n,viewMode:r})},l=(g)=>{if(g===r)return;let f=t.element;f.classList.remove(s(r===zt.DOCKED?G.VIEW_DOCKED:G.VIEW_FULLSCREEN)),r=g,f.classList.add(s(g===zt.DOCKED?G.VIEW_DOCKED:G.VIEW_FULLSCREEN))},d=()=>{i=!0;let{element:g,structure:f}=t;if(g.classList.add(s(G.DISABLED)),g.setAttribute("aria-disabled","true"),f?.input)f.input.disabled=!0;let m=[f?.leadingIcon,f?.clearButton].filter(Boolean);if(f?.trailingContainer)f.trailingContainer.querySelectorAll("button").forEach((C)=>m.push(C));m.forEach((h)=>{if(h)h.tabIndex=-1,h.setAttribute("aria-disabled","true")})},u=()=>{i=!1;let{element:g,structure:f}=t;if(g.classList.remove(s(G.DISABLED)),g.setAttribute("aria-disabled","false"),f?.input)f.input.disabled=!1;let m=[f?.leadingIcon,f?.clearButton].filter(Boolean);if(f?.trailingContainer)f.trailingContainer.querySelectorAll("button").forEach((C)=>m.push(C));if(m.forEach((h)=>{if(h)h.tabIndex=0,h.setAttribute("aria-disabled","false")}),f?.clearButton&&f.input&&!f.input.value)f.clearButton.tabIndex=-1},c=(g)=>{let f=t.element;if(g)f.classList.add(s(G.POPULATED));else f.classList.remove(s(G.POPULATED))},p=(g)=>{let f=t.element;if(g)f.classList.add(s(G.FOCUSED));else f.classList.remove(s(G.FOCUSED))};if(i)setTimeout(()=>{d()},0);return{...t,states:{expand:a,collapse:o,getState:()=>n,isExpanded:()=>n===Re.VIEW,setViewMode:l,getViewMode:()=>r,updatePopulatedState:c,updateFocusedState:p},disabled:{enable(){return u(),this},disable(){return d(),this},isDisabled:()=>i}}};var um=(e)=>{if(!e)return[];return e.map((t)=>{if(typeof t==="string")return{text:t,value:t};return{...t,value:t.value??t.text}})},Qs=(e)=>(t)=>{let n=e.value||"",r=e.placeholder||"Search",i=um(e.suggestions),s=(S)=>t.getClass?t.getClass(S):S,a=(S,y=null,L={})=>{let I={component:t,value:n,originalEvent:y,preventDefault:()=>{I.defaultPrevented=!0},defaultPrevented:!1,...L};return I},o=(S,y=null,L={})=>{let I=a(S,y,L);if(t.emit)t.emit(S,I);let x=`on${S.charAt(0).toUpperCase()}${S.slice(1)}`,A=e[x];if(typeof A==="function")if(S==="suggestionSelect"&&L.suggestion)A(L.suggestion);else A(n);return I},l=(S)=>{let y=t.structure?.clearButton;if(!y)return;if(S){if(y.classList.remove(s(G.CLEAR_BUTTON_HIDDEN)),!t.disabled?.isDisabled())y.tabIndex=0}else y.classList.add(s(G.CLEAR_BUTTON_HIDDEN)),y.tabIndex=-1},d=(S,y=!0)=>{let L=n;n=S;let I=t.structure?.input;if(I&&I.value!==S)I.value=S;if(l(!!S),t.states?.updatePopulatedState)t.states.updatePopulatedState(!!S);if(y&&S!==L)o(Wt.INPUT)},u=()=>n,c=(S)=>{r=S;let y=t.structure?.input;if(y)y.placeholder=S,y.setAttribute("aria-label",S)},p=()=>r,g=(S=!0)=>{d("",!1);let y=t.structure?.input;if(y&&!t.disabled?.isDisabled())y.focus();if(S)o(Wt.CLEAR)},f=()=>{if(n)o(Wt.SUBMIT)},m=()=>{let S=t.structure?.input;if(S&&!t.disabled?.isDisabled())S.focus()},h=()=>{let S=t.structure?.input;if(S)S.blur()},C=(S)=>{i=um(S)},T=()=>[...i],b=()=>{i=[]},E=(S)=>{d(S.value??S.text,!1),o(Wt.SUGGESTION_SELECT,null,{suggestion:S})},v=()=>{let S=t.structure?.input,y=t.structure?.clearButton,L=t.structure?.leadingIcon;if(!S)return;if(S.addEventListener("input",(I)=>{let x=I.target;d(x.value,!0)}),S.addEventListener("focus",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!0);if(o(Wt.FOCUS,I),e.expandOnFocus!==!1&&t.states?.expand)t.states.expand()}),S.addEventListener("blur",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!1);if(o(Wt.BLUR,I),e.collapseOnBlur!==!1&&t.states?.collapse){let x=e.collapseDelay??150;setTimeout(()=>{if(document.activeElement!==S)t.states.collapse()},x)}}),S.addEventListener("keydown",(I)=>{switch(I.key){case"Enter":I.preventDefault(),f();break;case"Escape":if(I.preventDefault(),n)g();else if(t.states?.isExpanded?.())t.states.collapse();break;case"ArrowDown":break;case"ArrowUp":break}}),y)y.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),g()}),y.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),g()});if(L)L.addEventListener("click",(I)=>{if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()}),L.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()})};return setTimeout(()=>{v()},0),{...t,input:{setValue:d,getValue:u,setPlaceholder:c,getPlaceholder:p,clear:g,submit:f,focus:m,blur:h,setSuggestions:C,getSuggestions:T,clearSuggestions:b,selectSuggestion:E,emitEvent:o}}};Qe();var Js=(e)=>(t)=>{let n=-1,r=[],i=(C)=>t.getClass?t.getClass(C):C,s=()=>{if(t.input?.getSuggestions)return t.input.getSuggestions();return r},a=(C,T)=>{if(!T)return C;let b=C.toLowerCase(),E=T.toLowerCase(),v=b.indexOf(E);if(v===-1)return C;let S=C.slice(0,v),y=C.slice(v,v+T.length),L=C.slice(v+T.length);return`${S}<strong>${y}</strong>${L}`},o=(C,T,b)=>{let E=T===n,v=[i(G.SUGGESTION_ITEM)];if(E)v.push(i(G.SUGGESTION_ITEM_SELECTED));let S=H({tag:"li",className:v.join(" "),attributes:{role:"option","aria-selected":E?"true":"false","data-index":String(T),"data-value":C.value??C.text,tabindex:"-1"}});if(C.icon){let L=H({tag:"span",className:i(G.SUGGESTION_ICON),container:S,html:C.icon})}else{let L=H({tag:"span",className:i(G.SUGGESTION_ICON),container:S,html:Ct.HISTORY})}let y=H({tag:"span",className:i(G.SUGGESTION_TEXT),container:S,html:a(C.text,b)});return S},l=()=>H({tag:"li",className:i(G.SUGGESTION_DIVIDER),attributes:{role:"separator","aria-hidden":"true"}}),d=()=>{let C=t.structure?.suggestionsList;if(!C)return;let T=s(),b=t.input?.getValue?.()||"";if(C.innerHTML="",T.length===0)return;let E;T.forEach((S,y)=>{if(S.group&&S.group!==E){if(E!==void 0)C.appendChild(l());E=S.group}let L=o(S,y,b);L.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),f(y)}),L.addEventListener("mouseenter",()=>{c(y)}),C.appendChild(L)});let v=T.length;C.setAttribute("aria-label",`${v} suggestion${v!==1?"s":""} available`)},u=()=>{let C=t.structure?.suggestionsList;if(C)C.innerHTML="";n=-1},c=(C)=>{let T=t.structure?.suggestionsList;if(!T)return;let b=s();if(C<-1)C=b.length-1;if(C>=b.length)C=-1;if(n>=0){let E=T.querySelector(`[data-index="${n}"]`);if(E)E.classList.remove(i(G.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","false")}if(n=C,n>=0){let E=T.querySelector(`[data-index="${n}"]`);if(E)E.classList.add(i(G.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","true"),E.scrollIntoView({block:"nearest",behavior:"smooth"})}},p=()=>{c(n+1)},g=()=>{c(n-1)},f=(C)=>{let T=s();if(C<0||C>=T.length)return;let b=T[C];if(t.input?.selectSuggestion)t.input.selectSuggestion(b);if(t.states?.collapse)t.states.collapse()},m=()=>{if(n>=0)return f(n),!0;return!1},h=()=>{let C=t.structure?.input;if(!C)return;C.addEventListener("keydown",(T)=>{let b=s();if(!t.states?.isExpanded?.()||b.length===0)return;switch(T.key){case Tn.ARROW_DOWN:T.preventDefault(),p();break;case Tn.ARROW_UP:T.preventDefault(),g();break;case Tn.ENTER:if(n>=0)T.preventDefault(),m();break;case Tn.TAB:if(n>=0)m();break;case Tn.ESCAPE:n=-1;break}})};return setTimeout(()=>{h()},0),{...t,suggestions:{render:d,clear:u,setHighlightedIndex:c,getHighlightedIndex:()=>n,highlightNext:p,highlightPrevious:g,select:f,selectHighlighted:m}}};var cm=(e)=>(t)=>({element:t.element,setValue(r,i=!0){return e.value.setValue(r,i),this},getValue(){return e.value.getValue()},setPlaceholder(r){return e.value.setPlaceholder(r),this},getPlaceholder(){return e.value.getPlaceholder()},expand(){return e.state.expand(),this},collapse(){return e.state.collapse(),this},getState(){return e.state.getState()},isExpanded(){return e.state.isExpanded()},setViewMode(r){return e.state.setViewMode(r),this},getViewMode(){return e.state.getViewMode()},focus(){return e.value.focus(),this},blur(){return e.value.blur(),this},clear(){return e.value.clear(),this},submit(){return e.value.submit(),this},setLeadingIcon(r){return console.warn("setLeadingIcon: Not yet implemented"),this},addTrailingItem(r){return console.warn("addTrailingItem: Not yet implemented"),this},removeTrailingItem(r){return console.warn("removeTrailingItem: Not yet implemented"),this},setTrailingItems(r){return console.warn("setTrailingItems: Not yet implemented"),this},setSuggestions(r){return e.suggestions.set(r),e.suggestions.render(),this},getSuggestions(){return e.suggestions.get()},clearSuggestions(){return e.suggestions.clear(),e.suggestions.render(),this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},on(r,i){return e.events.on(r,i),this},off(r,i){return e.events.off(r,i),this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});Q();var Hh={initialState:Re.BAR,viewMode:zt.DOCKED,disabled:vn.DISABLED,placeholder:vn.PLACEHOLDER,value:vn.VALUE,leadingIcon:void 0,trailingItems:void 0,suggestions:void 0,showClearButton:vn.SHOW_CLEAR_BUTTON,expandOnFocus:!0,collapseOnBlur:!0,collapseDelay:150,minWidth:qs.BAR_MIN_WIDTH,maxWidth:qs.BAR_MAX_WIDTH,fullWidth:vn.FULL_WIDTH},mm=(e={})=>_(Hh,e,"search"),fm=(e)=>V(e,{tag:"div",attributes:{role:"search","aria-disabled":e.disabled===!0?"true":"false"},className:e.class}),pm=(e)=>({value:{setValue:(t,n)=>e.input?.setValue?.(t,n),getValue:()=>e.input?.getValue?.()??"",setPlaceholder:(t)=>e.input?.setPlaceholder?.(t),getPlaceholder:()=>e.input?.getPlaceholder?.()??"",clear:()=>e.input?.clear?.(),submit:()=>e.input?.submit?.(),focus:()=>e.input?.focus?.(),blur:()=>e.input?.blur?.()},state:{expand:()=>e.states?.expand?.(),collapse:()=>e.states?.collapse?.(),getState:()=>e.states?.getState?.()??"bar",isExpanded:()=>e.states?.isExpanded?.()??!1,setViewMode:(t)=>e.states?.setViewMode?.(t),getViewMode:()=>e.states?.getViewMode?.()??"docked"},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},suggestions:{set:(t)=>e.input?.setSuggestions?.(t),get:()=>e.input?.getSuggestions?.()??[],clear:()=>e.input?.clearSuggestions?.(),render:()=>e.suggestions?.render?.()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var $h=(e={})=>{let t=mm(e);try{let n=M(D,B(),O(fm(t)),js(t),Zs(t),Qs(t),Js(t),P())(t),r=pm(n),i=cm(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Search creation error:",n),Error(`Failed to create search: ${n.message}`)}},ea=$h;ne();Z();J();ne();Z();J();var gm=({disabled:e,lifecycle:t})=>(n)=>({element:n.element,input:n.input,getValue:n.getValue||(()=>""),setValue(r){return n.setValue?.(r),this},setAttribute(r,i){return n.setAttribute?.(r,i),this},getAttribute(r){return n.getAttribute?.(r)||null},removeAttribute(r){return n.removeAttribute?.(r),this},setVariant(r){let i=n.config?.prefix||"mtrl",s=n.config?.componentName||"textfield";if(n.element.classList.remove(`${i}-${s}--filled`,`${i}-${s}--outlined`),n.element.classList.add(`${i}-${s}--${r}`),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getVariant(){let r=n.config?.prefix||"mtrl",i=n.config?.componentName||"textfield";if(n.element.classList.contains(`${r}-${i}--outlined`))return"outlined";return"filled"},setLabel(r){if(n.label?.setText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getLabel(){return n.label?.getText()||""},leadingIcon:n.leadingIcon||null,setLeadingIcon(r){if(n.setLeadingIcon){if(n.setLeadingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeLeadingIcon(){if(n.removeLeadingIcon){if(n.removeLeadingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},trailingIcon:n.trailingIcon||null,setTrailingIcon(r){if(n.setTrailingIcon){if(n.setTrailingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeTrailingIcon(){if(n.removeTrailingIcon){if(n.removeTrailingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},supportingTextElement:n.supportingTextElement||null,setSupportingText(r,i){if(n.setSupportingText)n.setSupportingText(r,i);return this},removeSupportingText(){if(n.removeSupportingText)n.removeSupportingText();return this},prefixTextElement:n.prefixTextElement||null,setPrefixText(r){if(n.setPrefixText){if(n.setPrefixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removePrefixText(){if(n.removePrefixText){if(n.removePrefixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},suffixTextElement:n.suffixTextElement||null,setSuffixText(r){if(n.setSuffixText){if(n.setSuffixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeSuffixText(){if(n.removeSuffixText){if(n.removeSuffixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},updatePositions(){if(n.input&&n.element){let r=n.input.value&&n.input.value.length>0,i=n.input.matches?.(":-webkit-autofill")||!1;if(r||i)n.element.classList.remove(`${n.config?.prefix||"mtrl"}-textfield--empty`);else n.element.classList.add(`${n.config?.prefix||"mtrl"}-textfield--empty`)}if(n.updateElementPositions)n.updateElementPositions();return this},setError(r,i){if(n.setError)n.setError(r,i);return this},isError(){return n.isError?.()||!1},setDensity(r){if(n.density?.set)n.density.set(r);return this},getDensity(){return n.density?.current||"default"},on(r,i){return n.on?.(r,i),this},off(r,i){return n.off?.(r,i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});var ta=(e)=>(t)=>{if(!e.leadingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-leading-icon`,r.innerHTML=e.leadingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return setTimeout(()=>{let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i){if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`))i.style.left="44px"}},10),{...t,leadingIcon:r,setLeadingIcon(i){return r.innerHTML=i,this},removeLeadingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`)){let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left=""}this.leadingIcon=null}return this}}};var na=(e)=>(t)=>{if(!e.trailingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-trailing-icon`,r.innerHTML=e.trailingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,trailingIcon:r,setTrailingIcon(i){return r.innerHTML=i,this},removeTrailingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var ra=(e)=>(t)=>{if(!e.prefixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-prefix`,r.textContent=e.prefixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-prefix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,prefixTextElement:r,setPrefixText(i){return r.textContent=i,this},removePrefixText(){if(r.parentNode){r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-prefix`);let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left="";this.prefixTextElement=null}return this}}};var ia=(e)=>(t)=>{if(!e.suffixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-suffix`,r.textContent=e.suffixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-suffix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,suffixTextElement:r,setSuffixText(i){return r.textContent=i,this},removeSuffixText(){if(r.parentNode)r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var sa=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=null,s=(a,o=!1)=>{let l=document.createElement("div");if(l.className=`${n}-${r}-helper`,l.textContent=a,o)l.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);return l};if(e.supportingText)i=s(e.supportingText,e.error),t.element.appendChild(i);if("lifecycle"in t&&t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:i,setSupportingText(a,o=!1){if(i)i.remove(),t.element.classList.remove(`${n}-${r}--error`);if(a)i=s(a,o),t.element.appendChild(i),this.supportingTextElement=i;else i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this},removeSupportingText(){if(i)i.remove(),i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}};_i();var aa=()=>(e)=>{let t=e.config.prefix||"mtrl",n=e.config.componentName||"textfield",r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=()=>{if(!e.element||!e.element.isConnected)return e;let d=e.element.querySelector(`.${t}-${n}-label`),u=e.element.querySelector(`.${t}-${n}-prefix`),c=e.element.querySelector(`.${t}-${n}-suffix`),p=e.element.classList.contains(`${t}-${n}--outlined`),g=e.element.classList.contains(`${t}-${n}--focused`),f=e.element.classList.contains(`${t}-${n}--empty`),m=e.element.classList.contains(`${t}-${n}--with-leading-icon`);if(p&&d){let{color:h,element:C}=xt(e.element);if(g||!f){if(d.style.backgroundColor=h,d.style.paddingLeft="4px",d.style.paddingRight="4px",C&&!r.has(e.element)){let T=new MutationObserver(()=>{let{color:v}=xt(e.element);d.style.backgroundColor=v});T.observe(C,{attributes:!0,attributeFilter:["style","class"]}),r.set(e.element,T);let b=C.parentElement,E=[];while(b&&b!==document.documentElement){let v=new MutationObserver(()=>{let{color:S}=xt(e.element);d.style.backgroundColor=S});v.observe(b,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),E.push(v),b=b.parentElement}if(E.length)i.set(e.element,E)}if(!s.has(e.element)){let T=()=>{let{color:b}=xt(e.element);if(g||!f)d.style.backgroundColor=b};document.addEventListener("themechange",T),s.set(e.element,T)}}else d.style.backgroundColor="",d.style.padding=""}if(u&&e.input){let C=u.getBoundingClientRect().width+4+12;if(e.input.style.paddingLeft=`${C}px`,d){let T=C;if(m)T=Math.max(T,44);if(!g&&f)d.style.left=`${T}px`;else d.style.left="12px"}}else if(m&&d){if(p)if(!g&&f)d.style.left="44px";else d.style.left="12px"}if(c&&e.input){let C=c.getBoundingClientRect().width+4+12;e.input.style.paddingRight=`${C}px`}return e},l=()=>{let d=new MutationObserver((u)=>{u.forEach((c)=>{if(c.type==="attributes"&&c.attributeName==="class")setTimeout(o,10)})});d.observe(e.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",o),a.set(e.element,d)};if(setTimeout(()=>{l(),o()},0),"lifecycle"in e&&e.lifecycle?.destroy){let d=e.lifecycle.destroy;e.lifecycle.destroy=()=>{window.removeEventListener("resize",o);let u=a.get(e.element);if(u)u.disconnect(),a.delete(e.element);let c=r.get(e.element);if(c)c.disconnect(),r.delete(e.element);let p=i.get(e.element);if(p)p.forEach((f)=>f.disconnect()),i.delete(e.element);let g=s.get(e.element);if(g)document.removeEventListener("themechange",g),s.delete(e.element);d.call(e.lifecycle)}}return{...e,updateElementPositions:()=>(o(),e)}};var oa=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.density||"default";if(i!=="default")t.element.classList.add(`${n}-${r}--density-${i}`);if(t.element.setAttribute("data-density",i),t.input)s(t.input,i);function s(o,l){o.setAttribute("data-density",l)}let a=(o)=>{if(["default","compact"].forEach((l)=>{t.element.classList.remove(`${n}-${r}--density-${l}`)}),o!=="default")t.element.classList.add(`${n}-${r}--density-${o}`);if(t.element.setAttribute("data-density",o),t.input)t.input.setAttribute("data-density",o);if(t.density)t.density.current=o;if(t.updateElementPositions)setTimeout(()=>t.updateElementPositions(),10)};return t.density={current:i,set:a},t};var la=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.error||!1;if(i)t.element.classList.add(`${n}-${r}--error`);return{...t,errorState:i,setError(s,a){if(i=s,t.element.classList.toggle(`${n}-${r}--error`,s),a!==void 0&&t.setSupportingText){if(a)t.setSupportingText(a,s);else if(!s)t.setSupportingText("",!1)}else if(t.supportingTextElement&&t.setSupportingText){let o=t.supportingTextElement.textContent||"";if(o)t.setSupportingText(o,s)}return this},isError(){return i}}};Q();var Vh={FILLED:"filled",OUTLINED:"outlined"};var Fh={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"};var Uh={DEFAULT:"default",COMPACT:"compact"},da={TYPE:Fh.TEXT,VARIANT:Vh.FILLED,DENSITY:Uh.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150};var Gh={type:da.TYPE,variant:da.VARIANT},hm=(e={})=>_(Gh,e,"textfield"),Cm=(e)=>V(e,{tag:"div",className:e.class}),Em=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy}});var zh=(e={})=>{let t=hm(e);try{return M(D,B(),O(Cm(t)),se(t),oa(t),Bn(t),et(t),ta(t),na(t),ra(t),ia(t),sa(t),la(t),oe(t),P(),aa(),(r)=>gm(Em(r))(r))(t)}catch(n){throw console.error("Textfield creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create textfield: ${n instanceof Error?n.message:String(n)}`)}},ir=zh;var bm=(e)=>(t)=>{let n="";if(e.value){let s=(e.options||[]).find((a)=>a.id===e.value);if(s)n=s.text}let r='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',i=ir({label:e.label,variant:e.variant||"filled",density:e.density||"default",value:n,name:e.name,disabled:e.disabled,required:e.required,supportingText:e.supportingText,error:e.error,trailingIcon:r,readonly:!0});if(i.element.classList.add(`${e.prefix||"mtrl"}-select`),i.input)i.input.addEventListener("keydown",(s)=>{if(!["Tab","Escape","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(s.key))s.preventDefault()}),i.input.addEventListener("paste",(s)=>{s.preventDefault()}),i.input.addEventListener("cut",(s)=>{s.preventDefault()});return{...t,element:i.element,textfield:i}},ua=(e)=>e.map((t)=>{if("type"in t&&t.type==="divider")return t;let n={id:t.id.toString(),text:t.text,icon:t.icon,disabled:t.disabled,hasSubmenu:!1,data:t};if(t.hasSubmenu&&Array.isArray(t.submenu))n.hasSubmenu=!0,n.submenu=ua(t.submenu);return n}),vm=(e)=>(t)=>{if(!t.textfield)return console.warn("Cannot add menu: textfield not found"),t;let n={options:e.options||[],selectedOption:null};if(e.value)n.selectedOption=n.options.find((a)=>a.id===e.value);let r=ua(n.options),i=Ft({opener:t.textfield,items:r,position:e.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOnResize:!0,offset:0,container:t.element});i.on("select",(a)=>{if(!a.item||a.item.hasSubmenu)return;let o=a.item.data;if(!o||!("id"in o)||!("text"in o)){console.warn("Invalid menu selection: missing required data properties");return}if(n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id),t.emit)t.emit("change",{select:t,value:o.id,text:o.text,option:o,originalEvent:a.originalEvent,preventDefault:()=>{a.defaultPrevented=!0},defaultPrevented:!1})}),t.textfield.element.addEventListener("keydown",(a)=>{if(t.textfield.input.disabled)return;if((a.key==="Enter"||a.key===" "||a.key==="ArrowDown")&&!i.isOpen()){if(a.preventDefault(),i.open(a,"keyboard"),t.emit)t.emit("open",{select:t,originalEvent:a,preventDefault:()=>{},defaultPrevented:!1})}else if(a.key==="Escape"&&i.isOpen())a.preventDefault(),i.close(a)}),i.on("open",()=>{t.textfield.element.classList.add(`${e.prefix||"mtrl"}-select--open`);let a=e.prefix||"mtrl";if(t.textfield.element.classList.add(`${a}-textfield--focused`),t.textfield.element.classList.contains(`${a}-textfield--filled`))t.textfield.element.classList.add(`${a}-textfield--filled-focused`)}),i.on("close",(a)=>{if(t.textfield.element.classList.remove(`${e.prefix||"mtrl"}-select--open`),setTimeout(()=>{let o=e.prefix||"mtrl";if(document.activeElement===t.textfield.input||t.textfield.element.contains(document.activeElement)){if(t.textfield.element.classList.add(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.add(`${o}-textfield--filled-focused`)}else if(t.textfield.element.classList.remove(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.remove(`${o}-textfield--filled-focused`)},10),t.emit)t.emit("close",{select:t,originalEvent:a.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let s=()=>{if(!n.selectedOption)return;i.setSelected(n.selectedOption.id)};return i.on("open",()=>{setTimeout(s,50)}),{...t,menu:i,select:{getValue:()=>n.selectedOption?.id||null,setValue:(a)=>{if(a===null||a===void 0||a==="")return n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t;let o=n.options.find((l)=>("id"in l)&&l.id===a);if(o&&"text"in o)n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id);return t},clear:()=>(n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t),getText:()=>n.selectedOption?.text||"",getSelectedOption:()=>n.selectedOption,getOptions:()=>[...n.options],setOptions:(a)=>{n.options=a;let o=ua(a);if(i.setItems(o),n.selectedOption&&!a.find((l)=>("id"in l)&&l.id===n.selectedOption.id))n.selectedOption=null,t.textfield.setValue("");return t},open:(a,o="mouse")=>(i.open(a,o),t),close:(a)=>(i.close(a),t),isOpen:()=>i.isOpen()}}};var Tm=(e)=>(t)=>({...t,element:t.element,textfield:t.textfield,menu:t.menu,getValue:e.select.getValue,setValue(n){return e.select.setValue(n),this},clear(){return e.select.clear(),this},getText:e.select.getText,getSelectedOption:e.select.getSelectedOption,getOptions:e.select.getOptions,setOptions(n){return e.select.setOptions(n),this},open(n="mouse"){if(t.menu&&typeof t.menu.open==="function")t.menu.open(void 0,n);else e.select.open();return this},close(){return e.select.close(),this},isOpen:e.select.isOpen,setDensity(n){if(t.textfield?.setDensity)t.textfield.setDensity(n);return this},getDensity(){if(t.textfield?.getDensity)return t.textfield.getDensity();return"default"},on(n,r){if(e.events?.on)e.events.on(n,r);else if(t.on)t.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);else if(t.off)t.off(n,r);return this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},setError(n,r){if(t.textfield?.setError)t.textfield.setError(n,r);return this},clearError(){if(t.textfield?.setError)t.textfield.setError(!1);return this},destroy(){e.lifecycle.destroy()}});Q();var Wh={FILLED:"filled",OUTLINED:"outlined"},Kh={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"};var ca={VARIANT:Wh.FILLED,PLACEMENT:Kh.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1};var Yh={options:[],variant:ca.VARIANT,placement:ca.PLACEMENT},Sm=(e={options:[]})=>_(Yh,e,"select"),ym=(e)=>({select:{getValue:e.select?.getValue||(()=>null),setValue:e.select?.setValue||(()=>e),clear:e.select?.clear||(()=>e),getText:e.select?.getText||(()=>""),getSelectedOption:e.select?.getSelectedOption||(()=>null),getOptions:e.select?.getOptions||(()=>[]),setOptions:e.select?.setOptions||(()=>e),open:e.select?.open||(()=>e),close:e.select?.close||(()=>e),isOpen:e.select?.isOpen||(()=>!1)},events:{on:e.on||(()=>e),off:e.off||(()=>e)},disabled:{enable:()=>{if(e.textfield?.enable)e.textfield.enable();return e},disable:()=>{if(e.textfield?.disable)e.textfield.disable();return e}},lifecycle:{destroy:()=>{if(e.textfield?.destroy)e.textfield.destroy();if(e.menu?.destroy)e.menu.destroy();if(e.lifecycle?.destroy)e.lifecycle.destroy()}}});var Xh=(e)=>{try{let t=Sm(e),n=M(D,B(),bm(t),vm(t),P(),(r)=>Tm(ym(r))(r))(t);if(e.on){if(e.on.change)n.on("change",e.on.change);if(e.on.open)n.on("open",e.on.open);if(e.on.close)n.on("close",e.on.close)}return n}catch(t){throw console.error("Select creation error:",t),Error(`Failed to create select: ${t.message}`)}},ma=Xh;Z();J();Q();var qh={SINGLE:"single",MULTI:"multi"},jh={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var ai={MODE:qh.SINGLE,DENSITY:jh.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},fa='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>';var Zh={mode:ai.MODE,ripple:ai.RIPPLE,density:ai.DENSITY},xm=(e={})=>_(Zh,e,"segmented-button"),Im=(e)=>{let t=e.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":e.mode||"single","data-density":t},className:[e.class,e.disabled?`${e.prefix}-segmented-button--disabled`:null,t!=="default"?`${e.prefix}-segmented-button--${t}`:null],interactive:!0}},pa=(e)=>{switch(e){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};pt();var Qh=(e,t)=>{let n=document.createElement("span");return n.className=`${e}-segment-checkmark`,n.innerHTML=t||fa,n},oi=(e,t,n,r=!1,i={ripple:!0,rippleConfig:{}})=>{let s=r||e.disabled,a=e.icon,o=Boolean(e.text),l=Boolean(a),d=l&&!o,u=o&&!l,c=e.checkmarkIcon||fa,p=Te({text:e.text,icon:d?a:l&&e.selected?c:a,value:e.value||e.text||"",disabled:s,ripple:i.ripple,rippleConfig:i.rippleConfig,class:e.class,ariaLabel:e.text||e.value});p.element.classList.add(`${n}-segmented-button-segment`);let g=null;if(u){g=Qh(n,c);let h=p.element.querySelector(`.${n}-button-text`);if(h)h.parentNode?.insertBefore(g,h);else p.element.prepend(g)}if(e.selected)p.element.classList.add(`${n}-segment--selected`),p.element.setAttribute("aria-pressed","true");else p.element.setAttribute("aria-pressed","false");t.appendChild(p.element);let f=(h)=>{if(p.element.classList.toggle(`${n}-segment--selected`,h),p.element.setAttribute("aria-pressed",h?"true":"false"),d);else if(l&&o)if(h)p.setIcon(c);else p.setIcon(a)},m=e.selected||!1;return{element:p.element,value:e.value||e.text||"",isSelected(){return m},setSelected(h){m=h,f(h)},isDisabled(){return p.disabled?.isDisabled?.()||!1},setDisabled(h){if(h)p.disable();else p.enable()},destroy(){if(g&&g.parentNode)g.parentNode.removeChild(g);p.destroy()}}};var Jh=(e={})=>{let t=xm(e),n=t.mode||"single",r=t.density||"default",i=Me();try{let s=M(D,B(),O(Im(t)),P())(t),a=pa(r);Object.entries(a).forEach(([f,m])=>{s.element.style.setProperty(f,m)});let o=[];if(t.segments&&t.segments.length)t.segments.forEach((f)=>{let m=oi(f,s.element,t.prefix,t.disabled,{ripple:t.ripple,rippleConfig:t.rippleConfig});o.push(m)});if(n==="single"&&!o.some((f)=>f.isSelected())){let f=o.find((m)=>!m.isDisabled());if(f)f.setSelected(!0)}let l=(f)=>{let m=f.currentTarget,h=o.find((b)=>b.element===m);if(!h||h.isDisabled())return;let C=u();if(n==="single")o.forEach((b)=>{b.setSelected(b===h)});else h.setSelected(!h.isSelected());let T=u();if(C.length!==T.length||C.some((b)=>!T.includes(b))||T.some((b)=>!C.includes(b)))i.emit("change",{selected:d(),value:T,oldValue:C})};o.forEach((f)=>{f.element.addEventListener("click",l)});let d=()=>o.filter((f)=>f.isSelected()),u=()=>d().map((f)=>f.value),c=(f)=>o.find((m)=>m.value===f),p=(f)=>{if(["default","comfortable","compact"].forEach((h)=>{if(h!=="default")s.element.classList.remove(`${t.prefix}-segmented-button--${h}`)}),f!=="default")s.element.classList.add(`${t.prefix}-segmented-button--${f}`);s.element.setAttribute("data-density",f);let m=pa(f);Object.entries(m).forEach(([h,C])=>{s.element.style.setProperty(h,C)})};return{element:s.element,segments:o,getSelected:d,getValue(){return u()},select(f){let m=c(f);if(m&&!m.isDisabled()){let h=u();if(n==="single")o.forEach((T)=>T.setSelected(T===m));else m.setSelected(!0);let C=u();if(h.join(",")!==C.join(","))i.emit("change",{selected:d(),value:C,oldValue:h})}return this},deselect(f){let m=c(f);if(m&&!m.isDisabled())if(n==="single"){if(d().length>1||!m.isSelected()){let C=u();m.setSelected(!1);let T=u();if(C.join(",")!==T.join(","))i.emit("change",{selected:d(),value:T,oldValue:C})}}else{let h=u();m.setSelected(!1);let C=u();if(h.join(",")!==C.join(","))i.emit("change",{selected:d(),value:C,oldValue:h})}return this},enable(){return s.element.classList.remove(`${t.prefix}-segmented-button--disabled`),o.forEach((f)=>{if(!t.segments?.find((m)=>m.value===f.value)?.disabled)f.setDisabled(!1)}),this},disable(){return s.element.classList.add(`${t.prefix}-segmented-button--disabled`),o.forEach((f)=>{f.setDisabled(!0)}),this},enableSegment(f){let m=c(f);if(m)m.setDisabled(!1);return this},disableSegment(f){let m=c(f);if(m)m.setDisabled(!0);return this},setDensity(f){return p(f),this},getDensity(){return s.element.getAttribute("data-density")||"default"},on(f,m){return i.on(f,m),this},off(f,m){return i.off(f,m),this},destroy(){o.forEach((f)=>{f.element.removeEventListener("click",l),f.destroy()}),i.clear(),s.lifecycle.destroy()}}}catch(s){throw console.error("Segmented Button creation error:",s),Error(`Failed to create segmented button: ${s.message}`)}},li=Jh;ne();Z();J();var qe={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},Sn={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var ga=(e)=>(t)=>{let{position:n=qe.BOTTOM}=e,r=`${t.getClass("sheet")}--${n.toLowerCase()}`;return t.element.classList.add(r),{...t,position:{setPosition(i){t.element.classList.remove(r);let s=`${t.getClass("sheet")}--${i.toLowerCase()}`;t.element.classList.add(s)},getPosition(){return n}}}};var ha=(e)=>(t)=>{let{content:n=""}=e,r=document.createElement("div");return r.className=`${t.getClass("sheet")}-content`,r.innerHTML=n,t.container=document.createElement("div"),t.container.className=`${t.getClass("sheet")}-container`,t.container.appendChild(r),t.element.appendChild(t.container),{...t,content:{setContent(i){return r.innerHTML=i,this},getContent(){return r.innerHTML},getElement(){return r}}}};var Ca=(e)=>(t)=>{let{title:n=""}=e,r=null;if(n||e.dragHandle){if(r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,n)r.textContent=n;if(t.container.insertBefore(r,t.container.firstChild),e.dragHandle){let i=document.createElement("div");i.className=`${t.getClass("sheet")}-handle`,t.container.insertBefore(i,t.container.firstChild),t.dragHandle={element:i,setVisible(s){i.style.display=s?"block":"none"}}}}return{...t,title:{setTitle(i){if(!r&&i)r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,t.container.insertBefore(r,t.content.getElement());if(r)r.textContent=i;return this},getTitle(){return r?r.textContent||"":""},getElement(){return r}}}};var Ea=(e)=>(t)=>{let{open:n=!1,dismissible:r=!0}=e,i=n,s=document.createElement("div");if(s.className=`${t.getClass("sheet")}-scrim`,t.element.parentNode?.insertBefore(s,t.element.nextSibling),r)t.element.classList.add(`${t.getClass("sheet")}--dismissible`),s.addEventListener("click",()=>{if(r)o()});if(n)t.element.classList.add(`${t.getClass("sheet")}--open`);if(e.elevation)t.element.classList.add(`${t.getClass("sheet")}--elevation-${e.elevation}`);document.addEventListener("keydown",(l)=>{if(l.key==="Escape"&&i&&r)o()});function a(){if(!i){if(i=!0,t.element.classList.add(`${t.getClass("sheet")}--open`),t.events.emit(Sn.OPEN),e.onOpen)e.onOpen()}}function o(){if(i){if(i=!1,t.element.classList.remove(`${t.getClass("sheet")}--open`),t.events.emit(Sn.CLOSE),e.onClose)e.onClose()}}return{...t,state:{open:a,close:o,isOpen(){return i},setDismissible(l){if(l)t.element.classList.add(`${t.getClass("sheet")}--dismissible`);else t.element.classList.remove(`${t.getClass("sheet")}--dismissible`)}},initialize(){if(s.parentNode!==t.element.parentNode)t.element.parentNode?.insertBefore(s,t.element.nextSibling)}}};var ba=(e)=>(t)=>{if(e.enableGestures===!1)return t;let n=e.position||qe.BOTTOM,r=0,i=0,s=!1,a=t.dragHandle?.element||t.element,o=(p)=>{if(!t.state.isOpen())return;if(s=!0,document.body.style.userSelect="none",p.type==="touchstart")r=p.touches[0].clientY,i=p.touches[0].clientX;else r=p.clientY,i=p.clientX,document.addEventListener("mousemove",l),document.addEventListener("mouseup",d);t.events.emit(Sn.DRAG_START)},l=(p)=>{if(!s)return;let g,f;if(p.type==="touchmove")g=p.touches[0].clientY,f=p.touches[0].clientX;else g=p.clientY,f=p.clientX;let m=0;switch(n){case qe.BOTTOM:if(m=g-r,m<0)m=0;t.element.style.transform=`translateY(${m}px)`;break;case qe.TOP:if(m=r-g,m<0)m=0;t.element.style.transform=`translateY(-${m}px)`;break;case qe.LEFT:if(m=i-f,m<0)m=0;t.element.style.transform=`translateX(-${m}px)`;break;case qe.RIGHT:if(m=f-i,m<0)m=0;t.element.style.transform=`translateX(${m}px)`;break}let h=n===qe.BOTTOM||n===qe.TOP?t.element.offsetHeight:t.element.offsetWidth,C=Math.min(m/h,1),T=t.element.nextElementSibling;if(T&&T.classList.contains(`${t.getClass("sheet")}-scrim`))T.style.opacity=`${0.32*(1-C)}`},d=()=>{if(!s)return;s=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d);let p=n===qe.BOTTOM||n===qe.TOP?t.element.offsetHeight:t.element.offsetWidth,g=0;if(t.element.style.transform){let f=t.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);g=f?parseFloat(f[1]):0}if(g>p*0.3)t.state.close();else{t.element.style.transform="";let f=t.element.nextElementSibling;if(f&&f.classList.contains(`${t.getClass("sheet")}-scrim`))f.style.opacity=""}t.events.emit(Sn.DRAG_END)};a.addEventListener("touchstart",o,{passive:!0}),a.addEventListener("touchmove",l,{passive:!0}),a.addEventListener("touchend",d),a.addEventListener("mousedown",o);let u=()=>{a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",l),a.removeEventListener("touchend",d),a.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d)},c=t.lifecycle?.destroy||(()=>{});return t.lifecycle={...t.lifecycle,destroy:()=>{u(),c()}},t};var Am=({state:e,lifecycle:t})=>(n)=>({...n,element:n.element,container:n.container,open(){return e.open(),this},close(){return e.close(),this},setContent(r){return n.content.setContent(r),this},getContent(){return n.content.getContent()},setTitle(r){return n.title.setTitle(r),this},getTitle(){return n.title.getTitle()},setDragHandle(r){if(n.dragHandle)n.dragHandle.setVisible(r);return this},setMaxHeight(r){return n.container.style.maxHeight=r,this},destroy(){t.destroy()},initialize(){if(n.initialize)n.initialize();return this}});Q();var di={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},va={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"};var eC={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},yn={VARIANT:di.STANDARD,POSITION:va.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:eC.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0};var tC={variant:di.STANDARD,position:va.BOTTOM,open:yn.OPEN,dismissible:yn.DISMISSIBLE,dragHandle:yn.DRAG_HANDLE,elevation:yn.ELEVATION,enableGestures:yn.ENABLE_GESTURES},Nm=(e={})=>_(tC,e,"sheet"),wm=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant===di.MODAL?"true":"false"},className:e.class,forwardEvents:{click:!0,keydown:!0}}),Dm=(e)=>({state:{open:()=>e.state.open(),close:()=>e.state.close()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var nC=(e={})=>{let t=Nm(e);try{let n=M(D,B(),O(wm(t)),se(t),ga(t),ha(t),Ca(t),Ea(t),ba(t),P(),(r)=>Am(Dm(r))(r))(t);return n.initialize(),n}catch(n){throw console.error("Sheet creation error:",n),Error(`Failed to create sheet: ${n.message}`)}},Ta=nC;Z();J();Qe();var Sa=(e)=>(t)=>{if(!e.range||!e.secondValue||!t.schema)return t;try{let n=e.min||0,r=e.max||100,i=e.secondValue,s=(i-n)/(r-n)*100,a=e.valueFormatter||((p)=>p.toString()),o=e.disabled===!0,l=t.getClass,d=JSON.parse(JSON.stringify(t.schema)),u=d.element.options.className||[];if(Array.isArray(u))u.push(l("slider--range"));else d.element.options.className=`${u} ${l("slider--range")}`.trim();let c=d.element.children.container.children;return c.secondHandle={name:"secondHandle",creator:H,options:{tag:"div",className:l("slider-handle"),attributes:{role:"slider","aria-valuemin":String(n),"aria-valuemax":String(r),"aria-valuenow":String(i),"aria-orientation":"horizontal",tabindex:o?"-1":"0","aria-disabled":o?"true":"false","data-value":String(i),"data-handle-index":"1"},style:{left:`${s}%`}}},c.secondValueBubble={name:"secondValueBubble",creator:H,options:{tag:"div",className:l("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:a(i),style:{left:`${s}%`}}},{...t,schema:d}}catch(n){return console.warn("Error enhancing structure with range functionality:",n),t}};var Yt={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},Ve={XS:16,S:24,M:40,L:56,XL:96},ce={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:44,HANDLE_HEIGHT_OFFSET:12,MIN_HEIGHT:48,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:6,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},Ie={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},Mm={START:"start",END:"end"},Ne={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Yt.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:Mm.START,LABEL_POSITION:Mm.START};var ya=(e)=>(t)=>{if(e.disabled===!0)setTimeout(()=>{r()},0);function r(){if(t.element.classList.add(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","true"),t.structure?.handle)t.structure.handle.tabIndex=-1,t.structure.handle.setAttribute("aria-disabled","true");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=-1,t.structure.secondHandle.setAttribute("aria-disabled","true");if(t.drawCanvas)t.drawCanvas()}function i(){if(t.element.classList.remove(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","false"),t.structure?.handle)t.structure.handle.tabIndex=0,t.structure.handle.setAttribute("aria-disabled","false");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=0,t.structure.secondHandle.setAttribute("aria-disabled","false");if(t.drawCanvas)t.drawCanvas()}function s(){return Object.values(Yt).find((o)=>t.element.classList.contains(`${t.getClass("slider")}--${o}`))||Yt.PRIMARY}function a(){return Object.keys(Ve).find((d)=>t.element.classList.contains(`${t.getClass("slider")}--${d.toLowerCase()}`))||"XS"}return{...t,disabled:{enable(){return i(),this},disable(){return r(),this},isDisabled(){return t.element.classList.contains(`${t.getClass("slider")}--disabled`)}},appearance:{setColor(o){if(Object.values(Yt).forEach((l)=>{t.element.classList.remove(`${t.getClass("slider")}--${l}`)}),o!==Yt.PRIMARY)t.element.classList.add(`${t.getClass("slider")}--${o}`);return this},getColor(){return s()},setSize(o){Object.keys(Ve).forEach((u)=>{t.element.classList.remove(`${t.getClass("slider")}--${u.toLowerCase()}`)});let d;if(typeof o==="string"&&o in Ve)d=o;else if(typeof o==="number"){let u=Object.entries(Ve).find(([,c])=>c===o);d=u?u[0]:"XS"}else d="XS";return t.element.classList.add(`${t.getClass("slider")}--${d.toLowerCase()}`),this},getSize(){return a()},showTicks(o){if(e.ticks=o,t.slider)t.slider.regenerateTicks();return this},showCurrentValue(o){return e.showValue=o,this}}}};var Om=(e,t,n,r)=>{let i=t.component?.components||{},s=t.component||{},a=s.container||i.container||null,o=s.handle||i.handle||null,l=s.valueBubble||i.valueBubble||null,d=s.secondHandle||i.secondHandle||null,u=s.secondValueBubble||i.secondValueBubble||null,{getValueFromPosition:c=()=>0,roundToStep:p=(w)=>w,clamp:g=(w)=>w,showValueBubble:f=()=>{},render:m=()=>{}}=n,{triggerEvent:h=()=>({defaultPrevented:!1})}=r,C=!1,T=0,b=3,E=null,v=()=>{if(t.valueHideTimer)clearTimeout(t.valueHideTimer),t.valueHideTimer=null},S=()=>{if(v(),l)f(l,!1);if(u)f(u,!1)},y=(w)=>{if(S(),w&&e.showValue)f(w,!0)},L=(w,W=0)=>{if(v(),!w||!e.showValue)return;if(W>0)t.valueHideTimer=setTimeout(()=>{f(w,!1)},W);else f(w,!1)},I=()=>{if(o)o.classList.remove(`${t.component.getClass("slider-handle")}--focused`);if(d)d.classList.remove(`${t.component.getClass("slider-handle")}--focused`);try{let w=t.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${w}`).forEach((W)=>{W.classList.remove(w)}),document.activeElement?.classList.contains(t.component.getClass("slider-handle")))document.activeElement.blur()}catch(w){console.warn("Error clearing keyboard focus:",w)}},x=(w,W=!1)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled())return;if(w.type==="mousedown")w.preventDefault();w.stopPropagation(),S(),I(),T=w.type.includes("touch")?w.touches[0].clientX:w.clientX,t.dragging=!1,t.pressed=!0,C=!1,t.activeHandle=W?"second":"first",t.activeBubble=W?u:l,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",k),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",k),m(),h(Ie.START,w)},A=(w)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled()||!a)return;if(w.type==="mousedown")w.preventDefault();S(),I();let W=!1;try{let ee=w.type.includes("touch")?w.touches[0].clientX:w.clientX,R=c(ee);if(e.snapToSteps&&t.step>0)R=p(R);if(R=g(R,t.min,t.max),e.range&&t.secondValue!==null){let re=Math.abs(R-t.value);W=Math.abs(R-t.secondValue)<re,W?t.secondValue=R:t.value=R}else if(e.centered&&t.component.slider&&t.component.slider.setValue)t.component.slider.setValue(R,!1);else t.value=R;m(),h(Ie.INPUT,w)}catch(ee){console.warn("Error handling track click:",ee)}if(t.activeHandle=W?"second":"first",t.activeBubble=W?u:l,T=w.type.includes("touch")?w.touches[0].clientX:w.clientX,e.centered&&!e.range)y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",k),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",k),t.pressed=!1,h(Ie.START,w);else t.dragging=!1,t.pressed=!1,C=!1,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",k),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",k),m(),h(Ie.START,w)},N=(w)=>{if(!t.activeHandle||!a)return;w.preventDefault();try{let W=w.type.includes("touch")?w.touches[0].clientX:w.clientX;if(!C&&Math.abs(W-T)>=b)C=!0,t.dragging=!0,t.component.element.classList.add(`${t.component.getClass("slider")}--dragging`);let ee=c(W);if(e.snapToSteps&&t.step>0)ee=p(ee);ee=g(ee,t.min,t.max);let R=t.activeHandle==="second";if(e.range&&t.secondValue!==null)if(R)if(ee>=t.value)t.secondValue=ee;else L(t.activeBubble,0),t.secondValue=t.value,t.value=ee,t.activeHandle="first",t.activeBubble=l,y(t.activeBubble);else if(ee<=t.secondValue)t.value=ee;else L(t.activeBubble,0),t.value=t.secondValue,t.secondValue=ee,t.activeHandle="second",t.activeBubble=u,y(t.activeBubble);else{if(e.centered)t.previousValue=t.value;t.value=ee}m(),h(Ie.INPUT,w)}catch(W){console.warn("Error during slider drag:",W)}},k=(w)=>{if(!t.activeHandle)return;w.preventDefault(),t.dragging=!1,t.pressed=!1,C=!1,t.component.element.classList.remove(`${t.component.getClass("slider")}--dragging`),L(t.activeBubble,1000),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",k),t.activeHandle=null,m(),h(Ie.CHANGE,w),h(Ie.END,w)},X=(w,W=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let ee=t.step||1,R=W?t.secondValue:t.value,re=w.shiftKey?ee*10:ee;if(w.key==="Tab")return;let ue=!1;switch(w.key){case"ArrowRight":case"ArrowUp":w.preventDefault(),R=Math.min(R+re,t.max),ue=!0;break;case"ArrowLeft":case"ArrowDown":w.preventDefault(),R=Math.max(R-re,t.min),ue=!0;break;case"Home":w.preventDefault(),R=t.min,ue=!0;break;case"End":w.preventDefault(),R=t.max,ue=!0;break;case"PageUp":w.preventDefault(),R=Math.min(R+ee*10,t.max),ue=!0;break;case"PageDown":w.preventDefault(),R=Math.max(R-ee*10,t.min),ue=!0;break;default:return}if(!ue)return;if(t.activeBubble=W?u:l,y(t.activeBubble),W)t.secondValue=R;else{if(e.centered)t.previousValue=t.value;t.value=R}m(),h(Ie.INPUT,w),h(Ie.CHANGE,w)},U=(w,W=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let ee=W?d:o;if(E&&E!==ee)S();E=ee,ee.classList.add(`${t.component.getClass("slider-handle")}--focused`),y(W?u:l),t.activeBubble=W?u:l,h(Ie.FOCUS,w)},j=(w,W=!1)=>{(W?d:o).classList.remove(`${t.component.getClass("slider-handle")}--focused`);let R=w.relatedTarget;if(!R||R!==(W?o:d))L(W?u:l,200);h(Ie.BLUR,w)};return{handleHandleMouseDown:x,handleTrackMouseDown:A,handleMouseMove:N,handleMouseUp:k,handleKeyDown:X,handleFocus:U,handleBlur:j,setupEventListeners:()=>{if(!t.component||!o){console.warn("Cannot set up event listeners: missing component or handle");return}if(a.addEventListener("mousedown",A),a.addEventListener("touchstart",A,{passive:!0}),o.addEventListener("mousedown",(w)=>x(w,!1)),o.addEventListener("touchstart",(w)=>x(w,!1),{passive:!0}),o.addEventListener("keydown",(w)=>X(w,!1)),o.addEventListener("focus",(w)=>U(w,!1)),o.addEventListener("blur",(w)=>j(w,!1)),e.range&&d)d.addEventListener("mousedown",(w)=>x(w,!0)),d.addEventListener("touchstart",(w)=>x(w,!0),{passive:!0}),d.addEventListener("keydown",(w)=>X(w,!0)),d.addEventListener("focus",(w)=>U(w,!0)),d.addEventListener("blur",(w)=>j(w,!0))},cleanupEventListeners:()=>{if(!t.component)return;if(a)a.removeEventListener("mousedown",A),a.removeEventListener("touchstart",A);if(o)o.removeEventListener("mousedown",(w)=>x(w,!1)),o.removeEventListener("touchstart",(w)=>x(w,!1)),o.removeEventListener("keydown",(w)=>X(w,!1)),o.removeEventListener("focus",(w)=>U(w,!1)),o.removeEventListener("blur",(w)=>j(w,!1));if(e.range&&d)d.removeEventListener("mousedown",(w)=>x(w,!0)),d.removeEventListener("touchstart",(w)=>x(w,!0)),d.removeEventListener("keydown",(w)=>X(w,!0)),d.removeEventListener("focus",(w)=>U(w,!0)),d.removeEventListener("blur",(w)=>j(w,!0));document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",k)},showActiveBubble:y,hideActiveBubble:L,hideAllBubbles:S,clearKeyboardFocus:I}};var xa=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize slider controller: missing element"),t;let n={component:t,value:e.value!==void 0?e.value:0,secondValue:e.secondValue!==void 0?e.secondValue:null,min:e.min!==void 0?e.min:0,max:e.max!==void 0?e.max:100,step:e.step!==void 0?e.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},r={triggerEvent(E,v=null){let S={slider:n.component,value:n.value,secondValue:n.secondValue,originalEvent:v,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return n.component.emit(E,S),S}},i=()=>{if(!n.component)return{};let E=n.component.components||{},v=n.component;return{container:v.container||E.container,handle:v.handle||E.handle,valueBubble:v.valueBubble||E.valueBubble,secondHandle:v.secondHandle||E.secondHandle,secondValueBubble:v.secondValueBubble||E.secondValueBubble,...E}},s=(E)=>{let v=n.max-n.min;return v===0?0:(E-n.min)/v*100},a=()=>{let E=i(),{handle:v,container:S}=E;if(!v||!S)return null;try{let y=v.getBoundingClientRect(),L=S.getBoundingClientRect(),I=y.width||ce.HANDLE_SIZE,x=L.width,A=ce.EDGE_PADDING/x*100,k=(n.activeHandle?6:8)/x*100;return{handleSize:I,trackSize:x,edgeConstraint:A,paddingPercent:k}}catch(y){return console.warn("Error calculating track dimensions:",y),{handleSize:ce.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},o=(E,v=200)=>{let S=ce.EDGE_PADDING/v*100,y=S,L=100-S,I=L-y;if(E<=0)return y;if(E>=100)return L;return y+E/100*I},l=(E)=>{let v=i(),{handle:S,container:y}=v;if(!S||!y)return n.min;try{let L=y.getBoundingClientRect(),I=n.max-n.min,x=L.left+ce.EDGE_PADDING,A=L.right-ce.EDGE_PADDING,N=A-x,X=(Math.max(x,Math.min(A,E))-x)/N;return n.min+X*I}catch(L){return console.warn("Error calculating value from position:",L),n.min}},d=(E)=>{let v=n.step;if(!v||v<=0)return E;let S=Math.round((E-n.min)/v);return n.min+S*v},u=(E,v,S)=>Math.min(Math.max(E,v),S),c=()=>{let E=i(),{handle:v,container:S,valueBubble:y,secondHandle:L,secondValueBubble:I}=E;if(!v||!S)return;let x=a();if(!x)return;let{trackSize:A}=x,N=s(n.value),k=o(N,A);if(v.style.left=`${k}%`,v.style.transform="translate(-50%, -50%)",y)y.style.left=`${k}%`,y.style.transform="translateX(-50%)";if(e.range&&L&&n.secondValue!==null){let X=s(n.secondValue),U=o(X,A);if(L.style.left=`${U}%`,L.style.transform="translate(-50%, -50%)",I)I.style.left=`${U}%`,I.style.transform="translateX(-50%)"}if(v)v.setAttribute("aria-valuenow",String(n.value))},p=()=>{let E=i(),{valueBubble:v,secondValueBubble:S}=E;if(!v)return;let y=e.valueFormatter||((L)=>L.toString());if(v.textContent=y(n.value),e.range&&S&&n.secondValue!==null)S.textContent=y(n.secondValue)},g=(E,v)=>{if(!E||!e.showValue)return;let S=n.component.getClass("slider-value");E.classList[v?"add":"remove"](`${S}--visible`)},f=()=>{},m=()=>{},h=()=>{try{if(c(),p(),t.drawCanvas)t.drawCanvas(n)}catch(E){console.warn("Error rendering UI:",E)}},T=Om(e,n,{getPercentage:s,getValueFromPosition:l,roundToStep:d,clamp:u,showValueBubble:g,updateUi:h,render:h},r),b=()=>{try{let E=i();if(!E.handle){console.warn("Cannot initialize slider controller: missing required handle component");return}let{handle:v,secondHandle:S}=E;if(v){if(v.setAttribute("aria-valuemin",String(n.min)),v.setAttribute("aria-valuemax",String(n.max)),v.setAttribute("aria-valuenow",String(n.value)),e.range&&S&&n.secondValue!==null)S.setAttribute("aria-valuemin",String(n.min)),S.setAttribute("aria-valuemax",String(n.max)),S.setAttribute("aria-valuenow",String(n.secondValue))}T.setupEventListeners(),h()}catch(E){console.error("Error initializing slider controller:",E)}};if(t.lifecycle){let E=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{T.cleanupEventListeners(),E()}}return setTimeout(()=>{b()},0),{...t,slider:{setValue(E,v=!0){let S=u(E,n.min,n.max);if(n.value=S,h(),v)r.triggerEvent(Ie.CHANGE);return this},getValue(){return n.value},setSecondValue(E,v=!0){if(!e.range)return this;let S=u(E,n.min,n.max);if(n.secondValue=S,h(),v)r.triggerEvent(Ie.CHANGE);return this},getSecondValue(){return e.range?n.secondValue:null},setMin(E){n.min=E;let v=i();if(v.handle)v.handle.setAttribute("aria-valuemin",String(E));if(e.range&&v.secondHandle)v.secondHandle.setAttribute("aria-valuemin",String(E));if(n.value<E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue<E)n.secondValue=E;if(e.ticks||e.tickLabels)f();return h(),this},getMin(){return n.min},setMax(E){n.max=E;let v=i();if(v.handle)v.handle.setAttribute("aria-valuemax",String(E));if(e.range&&v.secondHandle)v.secondHandle.setAttribute("aria-valuemax",String(E));if(n.value>E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue>E)n.secondValue=E;if(e.ticks||e.tickLabels)f();return h(),this},getMax(){return n.max},setStep(E){if(n.step=E,t.element.classList[E>0?"add":"remove"](`${t.getClass("slider")}--discrete`),e.ticks||e.tickLabels)f(),m();return this},getStep(){return n.step},regenerateTicks(){return h(),this},updateUi(){return h(),this}}}};Wn();wr();var rC=(e)=>e?.disabled?.isDisabled?.()||e?.element?.classList?.contains?.(`${e?.getClass?.("slider")}--disabled`)||!1,La=(e,t,n="track")=>{let r=rC(t),i=e.color||"primary";if(r){let d=Be("sys-color-on-surface",{fallback:"#000000"});return{primary:zn(d,0.38),secondary:zn(d,0.12)}}let s=t?.element&&typeof getComputedStyle==="function"?getComputedStyle(t.element):void 0,a=s?.getPropertyValue("--mtrl-slider-color").trim(),o=s?.getPropertyValue("--mtrl-slider-on-color").trim();if(n==="tick")return{primary:o||Be(`sys-color-on-${i}`,{fallback:"#ffffff"}),secondary:a||Be(`sys-color-${i}`,{fallback:"#1976d2"})};let l=a||Be(`sys-color-${i}`,{fallback:"#1976d2"});return{primary:l,secondary:zn(l,0.24)}},ui=(e,t,n)=>(e-t)/(n-t)*100,Fe=(e,t,n,r,i,s,a)=>{if(r>0)Fi(e,t,n,r,i,s,s,a)},sr=(e)=>{if(typeof e==="number")return Math.max(e,Ve.XS);if(typeof e==="string"&&e in Ve)return Ve[e];return Ve.XS},Aa=(e)=>{let t=sr(e);if(t<=Ve.S)return ce.SMALL_HANDLE_HEIGHT;return t+ce.HANDLE_HEIGHT_OFFSET},iC=(e)=>{let t=sr(e);if(t<=Ve.S)return ce.SMALL_TRACK_EXTERNAL_RADIUS;return t*ce.LARGE_TRACK_RADIUS_RATIO},Rm=(e,t,n)=>{let r=sr(n?.size),i=Aa(n?.size),s=e.parentElement;if(!s)return;let a=s.getBoundingClientRect().width||s.offsetWidth||200,o=Math.max(i,r,ce.MIN_HEIGHT);s.style.height=`${o}px`,jn(t,a,o)},_m=(e,t)=>{let n=e.parentElement;if(!n)throw Error("Canvas must have a parent element");let r=sr(t?.size),i=Aa(t?.size),s=n.getBoundingClientRect().width||n.offsetWidth||200,a=Math.max(i,r,ce.MIN_HEIGHT);return n.style.height=`${a}px`,qn(e,s,a)},ci=(e,t)=>{let n=ce.EDGE_PADDING/t*100,r=n,i=100-n,s=i-r;if(e<=0)return r;if(e>=100)return i;return r+e/100*s},sC=(e,t,n,r,i,s)=>{let a=n/2,o=sr(r.size),l=iC(r.size),d=ce.TRACK_RADIUS,u=Vi(e,0,a-o/2,t,o,l),{primary:c,secondary:p}=La(r,s),g=ui(i.value,i.min,i.max),f=ci(g,t),m=i.pressed?ce.HANDLE_GAP_PRESSED_REDUCTION:0,h=ce.HANDLE_GAP-m,T=ce.CENTER_GAP/2/t*100,b=h/t*100;if(r.centered){let E=ui(0,i.min,i.max),v=ci(E,t),S=Math.abs(f-v)<b,y=i.value>=0;if(S){let L=(f-b)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(f+b)/100*t,x=t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,p)}else if(y){let L=(v-T)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(v+T)/100*t,x=(f-b)/100*t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,c);let A=(f+b)/100*t,N=t-A;if(N>0)Fe(e,A,a-o/2,N,o,d,p)}else{let L=(f-b)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(f+b)/100*t,x=(v-T)/100*t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,c);let A=(v+T)/100*t,N=t-A;if(N>0)Fe(e,A,a-o/2,N,o,d,p)}}else if(r.range&&i.secondValue!==null){let E=ui(i.secondValue,i.min,i.max),v=ci(E,t),S=Math.min(f,v),y=Math.max(f,v),L=f<=v,I=i.pressed&&i.activeHandle==="first"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,x=i.pressed&&i.activeHandle==="second"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,A=ce.HANDLE_GAP-I,N=ce.HANDLE_GAP-x,k=L?A/t*100:N/t*100,X=L?N/t*100:A/t*100,U=(S-k)/100*t;if(U>0)Fe(e,0,a-o/2,U,o,d,p);let j=(S+k)/100*t,pe=(y-X)/100*t-j;if(pe>o)Fe(e,j,a-o/2,pe,o,d,c);let ge=(y+X)/100*t,w=t-ge;if(w>0)Fe(e,ge,a-o/2,w,o,d,p)}else{let E=(f-b)/100*t;if(E>0)Fe(e,0,a-o/2,E,o,d,c);let v=(f+b)/100*t,S=t-v;if(S>0)Fe(e,v,a-o/2,S,o,d,p)}u()},aC=(e,t,n,r,i,s)=>{if(!r.ticks)return;let a=ce.TICK_SIZE,o=n/2,{primary:l,secondary:d}=La(r,s,"tick"),u=Math.floor((i.max-i.min)/i.step);for(let c=0;c<=u;c++){let p=i.min+c*i.step;if(p>i.max)continue;let g=ui(p,i.min,i.max),m=ci(g,t)/100*t,h=Math.abs(p-i.value)<i.step*0.1,C=r.range&&i.secondValue!==null&&Math.abs(p-i.secondValue)<i.step*0.1;if(h||C)continue;let T=!1;if(r.centered)T=i.value>=0?p>=0&&p<=i.value:p>=i.value&&p<=0;else if(r.range&&i.secondValue!==null){let b=Math.min(i.value,i.secondValue),E=Math.max(i.value,i.secondValue);T=p>=b&&p<=E}else T=p<=i.value;e.fillStyle=T?l:d,e.globalAlpha=T?1:0.5,e.beginPath(),e.arc(m,o,a/2,0,Math.PI*2),e.fill()}e.globalAlpha=1},oC=(e,t,n,r,i)=>{if(r.ticks)return;let s=ce.DOT_SIZE,a=n/2,o=ce.EDGE_PADDING,{primary:l}=La(r,i,"dot");e.fillStyle=l,e.beginPath(),e.arc(t-o,a,s/2,0,Math.PI*2),e.fill()},Ia=(e,t,n,r)=>{let{ctx:i,width:s,height:a}=e;if(s===0||a===0)return;Ui(i,s,a),oC(i,s,a,t,r),sC(i,s,a,t,n,r),aC(i,s,a,t,n,r)},Pm=(e,t)=>{let n=Aa(t),r=e.handle||e.components?.handle,i=e.secondHandle||e.components?.secondHandle;if(r)r.style.height=`${n}px`,r.style.transform="translate(-50%, -50%)";if(i)i.style.height=`${n}px`,i.style.transform="translate(-50%, -50%)"},lC=(e,t,n)=>{if(e)return{value:e.value,secondValue:e.secondValue,min:e.min,max:e.max,step:e.step,pressed:e.pressed||!1,activeHandle:e.activeHandle||null};if(t?.slider)return{value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep(),pressed:!1,activeHandle:null};return n||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Na=(e)=>(t)=>{let n=Wi(`${t.getClass("slider-canvas")}`,{zIndex:"1"}),r=t.container||t.components?.container;if(r)r.insertBefore(n,r.firstChild);else t.element.appendChild(n);let i=null,s=null,a=null,o=e.size||"XS",l=lC(null,t,{value:e.value||0,secondValue:e.secondValue||null,min:e.min||0,max:e.max||100,step:e.step||1,pressed:!1,activeHandle:null}),d={animatedValue:l.value,animatedSecondValue:l.secondValue,targetValue:l.value,targetSecondValue:l.secondValue,startValue:l.value,startSecondValue:l.secondValue,startTime:0,duration:Gi.MEDIUM,animationFrame:null};if(t.animationState=d,zi(()=>{try{return i=_m(n,{...e,size:o}),t.ctx=i.ctx,!0}catch(h){return console.warn("Slider canvas initialization failed:",h),!1}},()=>{Pm(t,o)}),e.color&&e.color!=="primary")t.element.classList.add(`${t.getClass("slider")}--${e.color}`);t.canvas=n;let u=()=>{if(!i)return;Ia(i,{...e,size:o},{...l,value:d.animatedValue,secondValue:d.animatedSecondValue},t)},c=(h)=>{if(!i)return;let T=(h||performance.now())-d.startTime,b=Math.min(T/d.duration,1),E=Ar(b),{startValue:v,targetValue:S}=d;if(d.animatedValue=v+(S-v)*E,d.targetSecondValue!==null&&d.animatedSecondValue!==null){let{startSecondValue:y,targetSecondValue:L}=d;d.animatedSecondValue=y+(L-y)*E}if(u(),b<1)d.animationFrame=requestAnimationFrame((y)=>c(y));else d.animationFrame=null},p=(h)=>{if(!i){console.warn("Canvas context not ready");return}Rm(n,i,{...e,size:o});let C,T=!1;if(h)C={value:h.value,secondValue:h.secondValue,min:h.min,max:h.max,step:h.step,pressed:h.pressed||!1,activeHandle:h.activeHandle||null},T=h.dragging||!1,l={...C};else if(t.slider)C={value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep()},l={...C};else C={...l};let b=C.value!==d.targetValue,E=C.secondValue!==d.targetSecondValue;if((b||E)&&!T){if(d.startValue=d.animatedValue,d.startSecondValue=d.animatedSecondValue,d.targetValue=C.value,d.targetSecondValue=C.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame);d.startTime=performance.now(),c()}else if(T){if(d.animatedValue=C.value,d.animatedSecondValue=C.secondValue,d.targetValue=C.value,d.targetSecondValue=C.secondValue,d.startValue=C.value,d.startSecondValue=C.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame),d.animationFrame=null;Ia(i,{...e,size:o},h||C,t)}else Ia(i,{...e,size:o},h||C,t)},g=()=>{if(!i)return;try{let h=_m(n,{...e,size:o});t.ctx=h.ctx,Object.assign(i,h),u()}catch(h){console.warn("Slider canvas resize failed:",h)}};s=Un(t.element,n,g);let f=()=>u();a=Nr(e.color||"primary",f),requestAnimationFrame(()=>{p()}),t.drawCanvas=p,t.resize=g,t.setSize=(h)=>{if(o=h,i)Rm(n,i,{...e,size:o}),u();Pm(t,o)},t.getSize=()=>o;let m=t.appearance?.setColor;if(m)t.appearance.setColor=(h)=>{if(m(h),e.color&&e.color!=="primary")t.element.classList.remove(`${t.getClass("slider")}--${e.color}`);if(h&&h!=="primary")t.element.classList.add(`${t.getClass("slider")}--${h}`);if(e.color=h,a)a(),a=null;a=Nr(h,f),p()};if(t.lifecycle){let h=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(s)s();if(a)a();if(d.animationFrame)cancelAnimationFrame(d.animationFrame);h()}}return t};Qe();var xn=(e,t)=>(Object.assign(e.style,t),e);var wa=(e)=>(t)=>{let n=(T)=>t.getClass(T),r=e.min||0,i=e.max||100,s=e.value!==void 0?e.value:r,a=e.disabled===!0,o=e.valueFormatter||((T)=>T.toString()),l=(s-r)/(i-r)*100,d=H({tag:"div",className:n("slider-container"),container:t.element});xn(d,{position:"relative"});let u=e.label||"",c=e.range&&u?`${u} minimum`:u,p=u?`${u} maximum`:"",g={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(s),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(s),"data-handle-index":"0"};if(c)g["aria-label"]=c;let f=H({tag:"div",className:n("slider-handle"),attributes:g,container:d});xn(f,{left:`${l}%`});let m=H({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:o(s),container:d});xn(m,{left:`${l}%`});let h,C;if(e.range){let T=e.secondValue!==void 0?e.secondValue:i,b=(T-r)/(i-r)*100,E={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(T),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(T),"data-handle-index":"1"};if(p)E["aria-label"]=p;h=H({tag:"div",className:n("slider-handle"),attributes:E,container:d}),xn(h,{left:`${b}%`}),C=H({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:o(T),container:d}),xn(C,{left:`${b}%`})}return{...t,container:d,handle:f,valueBubble:m,secondHandle:h,secondValueBubble:C,getContainer:()=>d,getHandle:()=>f,getValueBubble:()=>m,getSecondHandle:()=>h||null,getSecondValueBubble:()=>C||null}};var Bm=(e)=>(t)=>({...t,element:t.element,setValue(n,r=!0){return e.slider.setValue(n,r),this},getValue(){return e.slider.getValue()},setSecondValue(n,r=!0){return e.slider.setSecondValue(n,r),this},getSecondValue(){return e.slider.getSecondValue()},setMin(n){return e.slider.setMin(n),this},getMin(){return e.slider.getMin()},setMax(n){return e.slider.setMax(n),this},getMax(){return e.slider.getMax()},setStep(n){return e.slider.setStep(n),this},getStep(){return e.slider.getStep()},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},setColor(n){return e.appearance.setColor(n),this},getColor(){return e.appearance.getColor()},setSize(n){return e.appearance.setSize(n),this},getSize(){return e.appearance.getSize()},showTicks(n){return e.appearance.showTicks(n),this},showCurrentValue(n){return e.appearance.showCurrentValue(n),this},setLabel(n){if(e.text?.setText)e.text.setText(n);return this},getLabel(){return e.text?.getText?e.text.getText():""},setIcon(n){if(e.icon?.setIcon)e.icon.setIcon(n);return this},getIcon(){return e.icon?.getIcon?e.icon.getIcon():""},on(n,r){if(e.events?.on)e.events.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);return this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});Q();var dC={min:Ne.MIN,max:Ne.MAX,value:Ne.VALUE,step:Ne.STEP,disabled:Ne.DISABLED,color:Ne.COLOR,size:Ne.SIZE,ticks:Ne.TICKS,showValue:Ne.SHOW_VALUE,snapToSteps:Ne.SNAP_TO_STEPS,range:Ne.RANGE,centered:Ne.CENTERED,iconPosition:Ne.ICON_POSITION,labelPosition:Ne.LABEL_POSITION,valueFormatter:(e)=>e.toString()},km=(e={})=>_(dC,e,"slider"),Hm=(e)=>{let t=["slider",e.class,e.disabled?"slider--disabled":"",e.size&&e.size!=="XS"?`slider--${typeof e.size==="string"?e.size.toLowerCase():e.size}`:"",e.color&&e.color!=="primary"?`slider--${e.color}`:"",e.range?"slider--range":"",e.centered?"slider--centered":"",e.icon?"slider--icon":""].filter(Boolean).join(" "),n={tabindex:"-1"};if(e.disabled)n["aria-disabled"]="true";return V(e,{tag:"div",attributes:n,className:t,forwardEvents:{click:!0,keydown:!0,touchstart:!0,touchmove:!0,touchend:!0,mousedown:!0,mousemove:!0,mouseup:!0},interactive:!0})},$m=(e)=>({slider:{setValue:(t,n)=>e.slider?.setValue(t,n),getValue:()=>e.slider?.getValue()??0,setSecondValue:(t,n)=>e.slider?.setSecondValue(t,n),getSecondValue:()=>e.slider?.getSecondValue()??null,setMin:(t)=>e.slider?.setMin(t),getMin:()=>e.slider?.getMin()??0,setMax:(t)=>e.slider?.setMax(t),getMax:()=>e.slider?.getMax()??100,setStep:(t)=>e.slider?.setStep(t),getStep:()=>e.slider?.getStep()??1,regenerateTicks:()=>e.slider?.regenerateTicks?.()},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},appearance:{setColor:(t)=>e.appearance?.setColor?.(t),getColor:()=>e.appearance?.getColor?.()??"primary",setSize:(t)=>e.setSize?.(t),getSize:()=>e.getSize?.()??"XS",showTicks:(t)=>e.appearance?.showTicks?.(t),showCurrentValue:(t)=>e.appearance?.showCurrentValue?.(t)},text:{setText:(t)=>e.label?.setText?.(t),getText:()=>e.label?.getText?.()??""},icon:{setIcon:(t)=>e.icon?.setIcon?.(t),getIcon:()=>e.icon?.getIcon?.()??""},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var uC=(e={})=>{let t=km(e);try{let n=M(D,B(),O(Hm(t)),Sa(t),wa(t),et(t),Pe(t),Na(t),ya(t),xa(t),P())(t),r=$m(n),i=Bm(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Slider creation error:",n),Error(`Failed to create slider: ${n.message}`)}},Da=uC;ne();Z();pt();var In={CENTER:"center",START:"start",END:"end"};var ar={short:4000,long:1e4,indefinite:0};var mi={QUEUE:"queue",REPLACE:"replace"};var Et={POSITION:In.CENTER,QUEUE_BEHAVIOR:mi.QUEUE,QUEUE_GAP:200,CLOSE_LABEL:"Dismiss",ANIMATION_DURATION:425,ACTION_INLINE_MAX_WIDTH:128},bt={ROOT:"snackbar",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",WITH_ACTION:"snackbar--with-action",DISMISSIBLE:"snackbar--dismissible",ACTION_BELOW:"snackbar--action-below",TEXT:"snackbar-text",ACTION:"snackbar-action",CLOSE:"snackbar-close"},Vm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24" height="24" fill="currentColor" aria-hidden="true"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>';Q();var cC={position:Et.POSITION,queueBehavior:Et.QUEUE_BEHAVIOR,closeLabel:Et.CLOSE_LABEL},Fm=(e)=>_(cC,e,"snackbar"),fi=(e,t)=>{if(e===void 0||e===null)return t?ar.indefinite:ar.short;if(typeof e==="number")return Number.isFinite(e)&&e>0?e:0;return ar[e]??ar.short},Um=(e)=>V(e,{tag:"div",attributes:{role:"status"}}),Gm=(e)=>({...e,text:e.message}),zm=(e,t,n)=>({lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})},queue:t,config:n});var Wm=(e)=>(t)=>{if(!e.action)return t;let n=e.prefix||"mtrl",r=Te({text:e.action,variant:"text",prefix:n,class:`${n}-${bt.ACTION}`});return t.element.classList.add(`${n}-${bt.WITH_ACTION}`),t.element.appendChild(r.element),{...t,action:r,actionButton:r.element}},Km=(e)=>(t)=>{if(!e.dismissible)return t;let n=e.prefix||"mtrl",r=Lt({icon:Vm,variant:"standard",size:"s",ariaLabel:e.closeLabel||"Dismiss",prefix:n,class:`${n}-${bt.CLOSE}`});return t.element.classList.add(`${n}-${bt.DISMISSIBLE}`),t.element.appendChild(r.element),{...t,close:r,closeButton:r.element}},Ym=(e)=>(t)=>{let n=t.element,r=fi(e.duration,Boolean(e.action)),i=null,s=0,a=0,o=!1,l=!1,d=!1,u=()=>{i=null,o=!1,t.emit?.("timeout")},c=()=>{if(i!==null||s<=0)return;a=Date.now(),i=setTimeout(u,s)},p=()=>{if(i===null)return;clearTimeout(i),i=null,s-=Date.now()-a},g=()=>l||d,f=()=>{if(p(),s=r,o=r>0,o&&!g())c()},m=()=>{p(),o=!1,s=0},h=()=>{if(o&&!g())c()};n.addEventListener("pointerenter",()=>{l=!0,p()}),n.addEventListener("pointerleave",()=>{l=!1,h()}),n.addEventListener("focusin",()=>{d=!0,p()}),n.addEventListener("focusout",(b)=>{let E=b.relatedTarget;if(E instanceof Node&&n.contains(E))return;d=!1,h()});let C=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{m(),C?.call(t.lifecycle)};return{...t,timer:{start:f,stop:m,setDuration:(b)=>{r=Number.isFinite(b)&&b>0?b:0},getDuration:()=>r}}};var Ma=(e)=>Object.values(In).includes(e),Xm=(e)=>(t)=>{let n=e.prefix||"mtrl",r=Ma(e.position)?e.position:In.CENTER,i=(s)=>`${n}-snackbar--${s}`;return t.element.classList.add(i(r)),{...t,position:{getPosition:()=>r,setPosition:(s)=>{let a=Ma(s)?s:In.CENTER;if(!Ma(s))console.warn(`Invalid position: ${s}. Using default: ${In.CENTER}`);return t.element.classList.remove(i(r)),r=a,t.element.classList.add(i(r)),t}}}};J();var qm=({lifecycle:e,queue:t,config:n})=>(r)=>{if(!t)throw Error("Snackbar queue is required");let i=r.element,s=n.prefix||"mtrl",a=(T)=>`${s}-${T}`,o=!1,l=null,d=null,u=null,c=(T,b={})=>{r.emit?.(T,{snackbar:C,originalEvent:null,...b})},p=()=>{let T=r.actionButton;if(!T)return;let b=T.offsetWidth>Et.ACTION_INLINE_MAX_WIDTH;i.classList.toggle(a(bt.ACTION_BELOW),b)},g=()=>{if(d!==null)clearTimeout(d),d=null;if(u)i.removeEventListener("transitionend",u),u=null},f=()=>{g();let T=()=>{g(),i.remove()};u=(b)=>{if(b.target===i&&b.propertyName==="opacity")T()},i.addEventListener("transitionend",u),d=setTimeout(T,Et.ANIMATION_DURATION)},m=(T,b=null)=>{if(!o)return;o=!1,C.state="hidden",r.timer?.stop();let E=i.ownerDocument.activeElement;if(E&&i.contains(E)&&l instanceof HTMLElement&&l.isConnected)l.focus();i.classList.remove(a(bt.VISIBLE)),f(),c("close",{reason:T,originalEvent:b}),c("dismiss",{reason:T,originalEvent:b})},h=()=>{g(),l=i.ownerDocument.activeElement,i.ownerDocument.body.appendChild(i),p(),i.offsetHeight,i.classList.add(a(bt.VISIBLE)),r.timer?.start(),c("open")},C={element:i,actionButton:r.actionButton,closeButton:r.closeButton,timer:r.timer,state:"hidden",show(){if(o)return this;return o=!0,this.state="visible",t.add({element:i,on:(T,b)=>r.on?.(T,b),off:(T,b)=>r.off?.(T,b),_show:h,_hide:()=>m("queue")},{behavior:n.queueBehavior}),this},hide(){return m("api"),this},setMessage(T){return r.text?.setText(T),this},getMessage(){return r.text?.getText()||""},setAction(T){if(r.action?.setText(T),o)p();return this},getAction(){return r.action?.getText()||""},setDuration(T){if(r.timer?.setDuration(fi(T,Boolean(r.action))),o)r.timer?.start();return this},getDuration(){return r.timer?.getDuration()??0},setPosition(T){return r.position?.setPosition(T),this},getPosition(){return r.position?.getPosition()||"center"},on(T,b){return r.on?.(T,b),this},off(T,b){return r.off?.(T,b),this},destroy(){o=!1,g(),i.remove(),r.timer?.stop(),r.action?.destroy(),r.close?.destroy(),e.destroy()}};if(r.on?.("timeout",()=>m("timeout")),r.actionButton?.addEventListener("click",(T)=>{c("action",{originalEvent:T}),m("action",T)}),r.closeButton?.addEventListener("click",(T)=>{m("close-button",T)}),i.addEventListener("keydown",(T)=>{if(T.key!=="Escape"||!o)return;T.stopPropagation(),m("escape",T)}),n.onOpen)C.on("open",n.onOpen);if(n.onClose)C.on("close",n.onClose);if(n.onAction)C.on("action",n.onAction);if(n.on){for(let[T,b]of Object.entries(n.on))if(b)C.on(T,b)}return C};var jm=(e=Et.QUEUE_GAP)=>{let t=[],n=null,r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null},a=()=>{if(n&&r)n.off?.("dismiss",r);n=null,r=null},o=()=>{let d=n;a();try{d?._hide?.()}catch{}},l=()=>{if(s(),n||t.length===0)return;let d=t.shift();n=d;let u=()=>{if(a(),t.length>0)i=setTimeout(()=>{i=null,l()},e)};r=u,d.on?.("dismiss",u),d._show()};return{add(d,u={}){if(!d._show)throw Error("Snackbar must implement _show method");let c=u.behavior??mi.QUEUE;if(n&&n.element&&!n.element.isConnected)a();if(c===mi.REPLACE){t.length=0,s(),o(),t.push(d),l();return}if(t.push(d),!n)l()},clear(){t.length=0,s(),o()},getLength(){return t.length+(n?1:0)}}};var Zm=jm(),mC=(e)=>{if(!e.message)throw Error("Snackbar message is required");let t=Fm(e);try{return M(D,B(),O(Um(t)),Xm(t),ct(Gm(t)),Wm(t),Km(t),P(),Ym(t),(r)=>qm(zm(r,Zm,t))(r))(t)}catch(n){throw console.error("Snackbar creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create snackbar: ${n instanceof Error?n.message:String(n)}`)}},Oa=()=>Zm.clear(),Ra=mC;ne();Z();J();var Qm=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},supportingTextElement:r.supportingTextElement||null,setSupportingText(i,s){if(r.setSupportingText)r.setSupportingText(i,s);return this},removeSupportingText(){if(r.removeSupportingText)r.removeSupportingText();return this},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});J();var Jm=(e,t,n)=>{let r=t||"mtrl",i=n||"switch",s=e.element.querySelector(`.${r}-${i}-container`);if(!s){s=document.createElement("div"),s.className=`${r}-${i}-container`;let o=e.element.querySelector(`.${r}-${i}-input`),l=e.element.querySelector(`.${r}-${i}-track`),d=[];if(o)d.push(o);if(l)d.push(l);let u=document.createElement("div");u.className=`${r}-${i}-content`;let c=e.element.querySelector(`.${r}-${i}-label`);if(c)u.appendChild(c);return s.appendChild(u),d.forEach((p)=>s.appendChild(p)),e.element.appendChild(s),{container:s,contentWrapper:u}}let a=e.element.querySelector(`.${r}-${i}-content`);if(!a){a=document.createElement("div"),a.className=`${r}-${i}-content`;let o=e.element.querySelector(`.${r}-${i}-label`);if(o)a.appendChild(o);s.insertBefore(a,s.firstChild)}return{container:s,contentWrapper:a}},ef=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"switch",{contentWrapper:i}=Jm(t,n,r),s=null;if(e.supportingText){if(s=document.createElement("div"),s.className=`${n}-${r}-helper`,s.textContent=e.supportingText,e.error)s.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);i.appendChild(s)}if("lifecycle"in t&&t.lifecycle&&typeof t.lifecycle==="object"&&"destroy"in t.lifecycle&&s){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(s)s.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:s,setSupportingText(a,o=!1){let{contentWrapper:l}=Jm(t,n,r),d=this.supportingTextElement;if(!d)d=document.createElement("div"),d.className=`${n}-${r}-helper`,l.appendChild(d),this.supportingTextElement=d;return d.textContent=a,d.classList.toggle(`${n}-${r}-helper--error`,o),t.element.classList.toggle(`${n}-${r}--error`,o),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}},tf=(e)=>(t)=>{let n={...e,prefix:e.prefix||"mtrl",componentName:e.componentName||"switch"};return kn(n)(t)};Q();var fC={prefix:"mtrl",componentName:"switch"},nf=(e={})=>_(fC,e,"switch"),rf=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),sf=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var pC=(e={})=>{let t=nf(e);try{return M(D,B(),O(rf(t)),et(t),kt(t),tf(t),ef(t),Ht(t),oe(t),P(),(r)=>Qm(sf(r))(r))(t)}catch(n){throw console.error("Switch creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create switch: ${n instanceof Error?n.message:String(n)}`)}},_a=pC;ne();Z();J();ne();Z();J();var hC={PRIMARY:"primary",SECONDARY:"secondary"},af={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},CC={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"};var lr={VARIANT:hC.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:CC.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},Ln={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"};Q();Z();var EC={state:af.INACTIVE,componentName:"tab",ripple:lr.RIPPLE},bC={variant:lr.VARIANT,scrollable:lr.SCROLLABLE,showDivider:lr.SHOW_DIVIDER,componentName:"tabs"},of=(e={})=>_(bC,e,"tabs"),lf=(e={})=>_(EC,e,"tab"),df=(e)=>{let t={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${e.prefix}-tabs`,`${e.prefix}-tabs--${e.variant||"primary"}`,e.class]};return(n)=>O(t)(n)};pt();var An=(e={})=>{let t=lf(e);try{let n=M(D,B(),P())(t),r=Te({text:t.text,icon:t.icon,iconSize:t.iconSize,disabled:t.disabled,ripple:t.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...t.rippleConfig||{}},value:t.value,prefix:t.prefix,variant:"text",class:`${t.prefix}-tab`});if(n.element=r.element,n.element.setAttribute("role","tab"),n.element.setAttribute("aria-selected",t.state==="active"?"true":"false"),t.value)n.element.setAttribute("id",`tab-${t.value}`),n.element.setAttribute("aria-controls",`tabpanel-${t.value}`);if(t.state==="active")n.element.classList.add(`${n.getClass("tab")}--active`);r.on("click",(s)=>{if(n.emit)n.emit("click",s)});let i={...n,button:r,element:r.element,badge:null,getValue(){return r.getValue()},setValue(s){let a=s||"";return r.setValue(a),this.element.setAttribute("id",`tab-${a}`),this.element.setAttribute("aria-controls",`tabpanel-${a}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let s=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(s),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return r.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return r.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(s){return r.setText(s),this.updateLayoutStyle(),this},getText(){return r.getText()},setIcon(s){return r.setIcon(s),this.updateLayoutStyle(),this},getIcon(){return r.getIcon()},setBadge(s){if(!this.badge){let a={content:s,standalone:!1,target:this.element,prefix:t.prefix,...t.badgeConfig||{}};this.badge=Vn(a)}else this.badge.setContent(s),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(r.destroy)r.destroy();n.lifecycle.destroy()},updateLayoutStyle(){let s=!!this.getText(),a=!!this.getIcon(),o="";if(s&&a)o=Ln.ICON_AND_TEXT;else if(a)o=Ln.ICON_ONLY;else o=Ln.TEXT_ONLY;if(Object.values(Ln).forEach((l)=>{this.element.classList.remove(`${this.getClass("tab")}--${l}`)}),this.element.classList.add(`${this.getClass("tab")}--${o}`),o===Ln.ICON_ONLY&&s)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if(t.badge!==void 0)i.setBadge(t.badge);return i.updateLayoutStyle(),i}catch(n){throw console.error("Tab creation error:",n),Error(`Failed to create tab: ${n.message}`)}};var uf=({lifecycle:e})=>(t)=>({...t,element:t.element,addTab(n){let r={...n,prefix:t.config.prefix,variant:n.variant||t.config.variant};if(r.value===void 0)r.value="";let i=An(r);if(t.tabs.push(i),t.tabsContainer.appendChild(i.element),i.on&&typeof i.on==="function")i.on("click",(a)=>t.handleTabClick(a,i));return i.element.addEventListener("click",(a)=>{t.handleTabClick(a,i)}),i},add(n){if(t.tabs.push(n),t.tabsContainer.appendChild(n.element),n.on&&typeof n.on==="function")n.on("click",(i)=>t.handleTabClick(i,n));return n.element.addEventListener("click",(i)=>{t.handleTabClick(i,n)}),this},getTabs(){return[...t.tabs]},getActiveTab(){return t.tabs.find((n)=>n.isActive())||null},setActiveTab(n){let r=typeof n==="string"?t.tabs.find((i)=>i.getValue()===n):n;if(!r)return this;if(t.tabs.forEach((i)=>i.deactivate()),r.activate(),t.emit)t.emit("change",{tab:r,value:r.getValue()});return this},removeTab(n){let r=typeof n==="string"?t.tabs.find((s)=>s.getValue()===n):n;if(!r)return this;let i=t.tabs.indexOf(r);if(i!==-1)t.tabs.splice(i,1);if(r.element.parentNode)r.element.parentNode.removeChild(r.element);return r.destroy(),this},on(n,r){if(t.on)t.on(n,r);return this},off(n,r){if(t.off)t.off(n,r);return this},destroy(){t.tabs.forEach((n)=>n.destroy()),t.tabs.length=0,e.destroy()}}),cf=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});function mf(e){if(typeof e.getActiveTab==="function")return e.getActiveTab();if(Array.isArray(e.tabs))return e.tabs.find((t)=>t.isActive&&t.isActive());return null}function ff(e){let t=mf(e);if(!t)return;if(typeof t.getValue!=="function")return;let n=t.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((i)=>{if(i.getAttribute("aria-labelledby")?.replace("tab-","")===n)i.removeAttribute("hidden"),i.setAttribute("tabindex","0");else i.setAttribute("hidden","true"),i.setAttribute("tabindex","-1")})}function pf(e){if(!e.element)return;e.element.addEventListener("keydown",(t)=>{if(t.target!==t.currentTarget)return;if(typeof e.getTabs!=="function"||typeof e.setActiveTab!=="function")return;let n=e.getTabs(),r=mf(e),i=r?n.indexOf(r):-1,s=i;switch(t.key){case"ArrowRight":case"ArrowDown":s=i<n.length-1?i+1:0;break;case"ArrowLeft":case"ArrowUp":s=i>0?i-1:n.length-1;break;case"Home":s=0;break;case"End":s=n.length-1;break;default:return}if(s!==i&&n[s])t.preventDefault(),n[s].element.focus(),e.setActiveTab(n[s])})}var vC={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},gf=(e={})=>{let t={...vC,...e},n=t.prefix||"mtrl",r=document.createElement("div");if(r.className=`${n}-tabs-indicator`,r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
29
- width ${t.animationDuration}ms ${t.animationTiming}`,r.style.width=`${t.fixedWidth}px`,!t.visible)r.style.opacity="0";let i=null,s=(f)=>{if(t.widthStrategy==="auto"){if(t.variant==="secondary")return f.element.offsetWidth;let m=f.element.querySelector(`.${n}-tab-text`)||f.element.querySelector(`.${n}-button-text`);if(m)return m.clientWidth;return Math.max(f.element.offsetWidth/2,30)}switch(t.widthStrategy){case"dynamic":return Math.max(f.element.offsetWidth/2,30);case"content":let m=f.element.querySelector(`.${n}-button-text`)||f.element.querySelector(`.${n}-tab-text`);if(m)return Math.max(m.clientWidth,30);return t.fixedWidth||40;case"fixed":default:return t.fixedWidth||40}},a=(f)=>{let m=f.parentElement;if(!m)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:f.offsetWidth};let h=f.getBoundingClientRect(),C=m.getBoundingClientRect();return{left:h.left-C.left,width:h.width}},o=(f,m)=>{let{left:h,width:C}=a(f.element);if(t.variant!=="secondary"&&(t.widthStrategy==="auto"||t.widthStrategy==="content")){let T=f.element.querySelector(`.${n}-tab-text`)||f.element.querySelector(`.${n}-button-text`);if(T){let b=T.getBoundingClientRect(),E=f.element.getBoundingClientRect(),v=b.left-E.left;return{left:h+v}}}if(m<C)return{left:h+(C-m)/2};return{left:h}},l=(f,m=!1)=>{if(!f||!f.element){console.error("Invalid tab or tab has no element");return}i=f;let h=s(f),{left:C}=o(f,h);if(m)r.style.transition="none",r.offsetHeight;if(r.style.width=`${h}px`,r.style.transform=`translateX(${C}px)`,m)setTimeout(()=>{r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
30
- width ${t.animationDuration}ms ${t.animationTiming}`},10)};return{element:r,moveToTab:l,show:()=>{r.style.opacity="1"},hide:()=>{r.style.opacity="0"},setColor:(f)=>{r.style.backgroundColor=f},update:()=>{if(i)l(i,!0)},destroy:()=>{if(r.parentNode)r.parentNode.removeChild(r);i=null}}};var hf=(e)=>(t)=>{let n=[],r=t.scrollContainer||t.element;if(Array.isArray(e.tabs))e.tabs.forEach((o)=>{let l={...o,prefix:e.prefix,variant:o.variant||e.variant},d=An(l);n.push(d),r.appendChild(d.element)});let i=()=>[...n],s=()=>n.find((o)=>o.isActive())||null,a=(o,l)=>{if(o&&typeof o.preventDefault==="function")o.preventDefault();if(l.disabled&&l.disabled.isDisabled&&l.disabled.isDisabled())return;n.forEach((u)=>u.deactivate()),l.activate();let d=l.getValue();if(ff({tabs:n,getActiveTab:()=>n.find((u)=>u.isActive())||null}),typeof t.emit==="function")t.emit("change",{tab:l,value:d})};return n.forEach((o)=>{if(o.on&&typeof o.on==="function")o.on("click",(l)=>a(l,o));o.element.addEventListener("click",(l)=>a(l,o))}),{...t,tabs:n,tabsContainer:r,handleTabClick:a,getTabs:i,getActiveTab:s}},Cf=(e)=>(t)=>{if(e.scrollable===!1)return t;t.element.classList.add(`${t.getClass("tabs")}--scrollable`);let n=document.createElement("div");n.className=`${t.getClass("tabs")}-scroll`;while(t.element.firstChild)n.appendChild(t.element.firstChild);return t.element.appendChild(n),{...t,scrollContainer:n}},Ef=(e)=>(t)=>{if(e.showDivider===!1)return t;let n=document.createElement("div");return n.className=`${t.getClass("tabs")}-divider`,t.element.appendChild(n),t},bf=(e)=>(t)=>{let n=e.indicator||{},r=gf({prefix:e.prefix,widthStrategy:n.widthStrategy||e.indicatorWidthStrategy||"auto",height:n.height||e.indicatorHeight||3,fixedWidth:n.fixedWidth||40,animationDuration:n.animationDuration||250,animationTiming:n.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:n.color,variant:e.variant??"primary"}),i=t.scrollContainer||t.element;if(!i)throw console.error("No scroll container found - cannot add indicator"),Error("Failed to create tabs: No scroll container found");i.appendChild(r.element);let s=t.handleTabClick;t.handleTabClick=function(u,c){if(c.disabled&&c.disabled.isDisabled&&c.disabled.isDisabled())return;s.call(this,u,c),setTimeout(()=>{r.moveToTab(c)},10)},setTimeout(()=>{let u=t.tabs.find((c)=>c.isActive());if(u)r.moveToTab(u,!0)},50);let a=()=>{let u=t.tabs.find((c)=>c.isActive());if(u)r.moveToTab(u,!0)};if(i)i.addEventListener("scroll",a);let o=new ResizeObserver(()=>{let u=t.tabs.find((c)=>c.isActive());if(u)r.moveToTab(u,!0)});o.observe(i);let l=new MutationObserver((u)=>{for(let c of u)if(c.type==="attributes"&&c.attributeName==="class"&&c.target.classList.contains(`${e.prefix}-tab--active`)){let p=c.target,g=t.tabs.find((f)=>f.element===p);if(g)r.moveToTab(g)}});if(Array.isArray(t.tabs))t.tabs.forEach((u)=>{if(u.element)l.observe(u.element,{attributes:!0})});let d=t.destroy||(()=>{});return t.destroy=function(){if(r.destroy(),o.disconnect(),l.disconnect(),i)i.removeEventListener("scroll",a);if(typeof d==="function")d.call(this)},{...t,indicator:r,getIndicator:()=>r}};var vf=()=>{if(document.getElementById("tab-state-styles"))return;let e=document.createElement("style");e.id="tab-state-styles",e.textContent=`
28
+ `,e.closeButtonElement.addEventListener("click",()=>{n()}),ze()&&t.optimizeForTouch)e.closeButtonElement.style.minWidth=`${Si.COMFORTABLE}px`,e.closeButtonElement.style.minHeight=`${Si.COMFORTABLE}px`,e.closeButtonElement.addEventListener("touchstart",()=>{e.closeButtonElement.classList.add("active")},{passive:!0}),e.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{e.closeButtonElement.classList.remove("active")},Tt.FEEDBACK_DURATION)},{passive:!0});return e.drawer.element.appendChild(e.closeButtonElement),e.closeButtonElement},Ac=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;if(uh(e,t,n),ch(e,t,n),mh(e,t,n,r),t.enableSwipeGestures&&ze())fh(e,n,r);n()},mh=(e,t,n,r)=>{if(!t.hideOnClickOutside)return;if(e.outsideClickHandlerSet)return;e.outsideClickHandlerSet=!0;let i=ze()?"touchend":"click",s=(a)=>{if(!e.isMobile||!r())return;let l=Je(a).target;if(e.drawer.element.contains(l)||e.rail.element.contains(l))return;n()};e.outsideClickHandler=s,document.addEventListener(i,s,ze()?{passive:!0}:!1)},fh=(e,t,n,r)=>{let{drawer:i,rail:s}=e;if(!i||!s)return;let a=0,o=0;s.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),s.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||n()||!r)return;let d=l.touches[0],u=d.clientX-a,m=d.clientY-o;if(Math.abs(u)>Math.abs(m)&&u>Tt.SWIPE_THRESHOLD)r()},{passive:!0}),i.element.addEventListener("touchstart",(l)=>{let d=l.touches[0];a=d.clientX,o=d.clientY},{passive:!0}),i.element.addEventListener("touchmove",(l)=>{if(!e.isMobile||!n())return;let u=l.touches[0].clientX-a;if(u<0){if(i.element.style.transform=`translateX(${u/2}px)`,u<-Tt.SWIPE_THRESHOLD)t()}},{passive:!0}),i.element.addEventListener("touchend",()=>{if(i.element.style.transform)i.element.style.transition="transform 0.2s ease",i.element.style.transform="",setTimeout(()=>{i.element.style.transition=""},200)},{passive:!0})},Nc=(e,t)=>{if(e.overlayElement)e.overlayElement.classList.remove("active"),e.overlayElement.setAttribute("aria-hidden","true");if(e.closeButtonElement)e.closeButtonElement.style.display="none";document.body.classList.remove(t.bodyLockClass)};var ph=(e={})=>{let t=fc(e),n=Ms(e),r=Os(e),i={initialize:()=>i,cleanup:()=>{},navigateTo:()=>{},getRail:()=>t.rail,getDrawer:()=>t.drawer,getActiveSection:()=>t.activeSection,getActiveSubsection:()=>t.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>i,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>t.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},s=()=>Cc(t,r),a=()=>Ec(t,r),o=()=>bc(t),l=(f)=>{pc(t,f,s,a)},d=()=>{Ac(t,r,a,o)},u=()=>{vc(t,r,d,()=>Nc(t,r),i)},m=(f,h,C)=>{Sc(t,f,h,C)},p=()=>{if(t.rail=gc(t,n),t.drawer=hc(t,n),yc(t,n,l,s,a,i),xc(t,n,a,i),Ic(t,u),e.activeSection&&t.items[e.activeSection]){if(t.activeSection=e.activeSection,t.rail)t.rail.setActive(e.activeSection);if(l(e.activeSection),e.expanded===!0)s();else a()}return u(),i},g=()=>{Lc(t,u),Tc(t)},c=(f)=>(Object.assign(e,f),Object.assign(n,Ms({...e,...f})),Object.assign(r,Os({...e,...f})),i);return i.initialize=p,i.cleanup=g,i.navigateTo=m,i.showDrawer=s,i.hideDrawer=a,i.isDrawerVisible=o,i.configure=c,i.setProcessingChange=(f)=>{t.processingChange=f},i.isProcessingChange=()=>t.processingChange,i.isMobile=()=>t.isMobile,i.checkMobileState=u,i},wc=ph;Hi();ne();Z();J();Ki();xr();var gn=0.0001,Gt=(e,t,n)=>(1-n)*e+n*t,nr=(e,t)=>Math.sqrt(e*e+t*t),er=(e,t)=>{let n=nr(e,t);if(n<=0)throw Error("Required distance greater than zero");return[e/n,t/n]},tr=([e,t])=>[-t,e],pn=(e,t)=>e[0]*t[0]+e[1]*t[1],ei=(e,t,n,r)=>[e,t,Gt(e,n,0.3333333333333333),Gt(t,r,0.3333333333333333),Gt(e,n,0.6666666666666666),Gt(t,r,0.6666666666666666),n,r],Dc=(e,t,n,r,i,s)=>{let a=er(n-e,r-t),o=er(i-e,s-t),l=tr(a),d=tr(o),u=pn(l,[i-e,s-t])>=0,m=pn(a,o);if(m>0.999)return ei(n,r,i,s);let p=nr(n-e,r-t)*4/3*((Math.sqrt(2*(1-m))-Math.sqrt(1-m*m))/(1-m))*(u?1:-1);return[n,r,n+l[0]*p,r+l[1]*p,i-d[0]*p,s-d[1]*p,i,s]},Rs=(e,t)=>{let n=1-t;return[e[0]*(n*n*n)+e[2]*(3*t*n*n)+e[4]*(3*t*t*n)+e[6]*(t*t*t),e[1]*(n*n*n)+e[3]*(3*t*n*n)+e[5]*(3*t*t*n)+e[7]*(t*t*t)]},Mc=(e)=>[e[6],e[7],e[4],e[5],e[2],e[3],e[0],e[1]],ti=(e)=>Math.abs(e[0]-e[6])<0.0001&&Math.abs(e[1]-e[7])<0.0001,Oc=(e,t)=>{let n=t(e[0],e[1]),r=t(e[2],e[3]),i=t(e[4],e[5]),s=t(e[6],e[7]);return[n[0],n[1],r[0],r[1],i[0],i[1],s[0],s[1]]},Rc=(e)=>{if(ti(e))return[e[0],e[1],e[0],e[1]];return[Math.min(e[0],e[2],e[4],e[6]),Math.min(e[1],e[3],e[5],e[7]),Math.max(e[0],e[2],e[4],e[6]),Math.max(e[1],e[3],e[5],e[7])]};var Ps={radius:0,smoothing:0},rr=(e,t)=>[e[0]-t[0],e[1]-t[1]],ht=(e,t)=>[e[0]+t[0],e[1]+t[1]],Ye=(e,t)=>[e[0]*t,e[1]*t],_c=(e)=>nr(e[0],e[1]),Bc=(e)=>er(e[0],e[1]),gh=(e,t,n)=>[Gt(e[0],t[0],n),Gt(e[1],t[1],n)],hh=(e,t,n,r)=>{let i=tr(r),s=pn(t,i);if(Math.abs(s)<gn)return null;let a=pn(rr(n,e),i);if(Math.abs(s)<gn*Math.abs(a))return null;return ht(e,Ye(t,a/s))},Ch=(e,t,n,r)=>{let i=rr(e,t),s=rr(n,t),a=_c(i),o=_c(s);if(a>0&&o>0){let l=Ye(i,1/a),d=Ye(s,1/o),u=r.radius,m=r.smoothing??0,p=pn(l,d),g=Math.sqrt(1-p*p),c=g>0.001?u*(p+1)/g:0;return{p0:e,p1:t,p2:n,d1:l,d2:d,cornerRadius:u,smoothing:m,expectedRoundCut:c,expectedCut:(1+m)*c}}return{p0:e,p1:t,p2:n,d1:[0,0],d2:[0,0],cornerRadius:0,smoothing:0,expectedRoundCut:0,expectedCut:0}},Pc=(e,t)=>{if(t>e.expectedCut)return e.smoothing;if(t>e.expectedRoundCut)return e.smoothing*(t-e.expectedRoundCut)/(e.expectedCut-e.expectedRoundCut);return 0},kc=(e,t,n,r,i,s,a,o)=>{let l=Bc(rr(r,n)),d=ht(n,Ye(l,e*(1+t))),u=gh(i,Ye(ht(i,s),0.5),t),m=ht(a,Ye(er(u[0]-a[0],u[1]-a[1]),o)),p=tr(rr(m,a)),g=hh(r,l,m,p)??i,c=Ye(ht(d,Ye(g,2)),0.3333333333333333);return[d[0],d[1],c[0],c[1],g[0],g[1],m[0],m[1]]},Eh=(e,t,n)=>{let r=Math.min(t,n),{p0:i,p1:s,p2:a,d1:o,d2:l,cornerRadius:d,expectedRoundCut:u}=e;if(u<gn||r<gn||d<gn)return[ei(s[0],s[1],s[0],s[1])];let m=Math.min(r,u),p=Pc(e,t),g=Pc(e,n),c=d*m/u,f=Math.sqrt(c*c+m*m),h=ht(s,Ye(Bc(Ye(ht(o,l),0.5)),f)),C=ht(s,Ye(o,m)),T=ht(s,Ye(l,m)),b=kc(m,p,s,i,C,T,h,c),E=Mc(kc(m,g,s,a,T,C,h,c));return[b,Dc(h[0],h[1],b[6],b[7],E[0],E[1]),E]},ni=(e,t=Ps,n,r,i)=>{if(e.length<6)throw Error("Polygons must have at least 3 vertices");if(e.length%2===1)throw Error("The vertices array should have even size");let s=e.length/2;if(n&&n.length!==s)throw Error("perVertexRounding should have one entry per vertex");let a=(g)=>[e[g%s*2],e[g%s*2+1]],o=[];for(let g=0;g<s;g++)o.push(Ch(a(g+s-1),a(g),a(g+1),n?.[g]??t));let l=[];for(let g=0;g<s;g++){let c=o[(g+1)%s],f=o[g].expectedRoundCut+c.expectedRoundCut,h=o[g].expectedCut+c.expectedCut,C=a(g),T=a(g+1),b=nr(C[0]-T[0],C[1]-T[1]);if(f>b)l.push([b/f,0]);else if(h>b)l.push([1,(b-f)/(h-f)]);else l.push([1,1])}let d=[];for(let g=0;g<s;g++){let c=o[g],f=[];for(let h=0;h<=1;h++){let[C,T]=l[(g+s-1+h)%s];f.push(c.expectedRoundCut*C+(c.expectedCut-c.expectedRoundCut)*T)}d.push(Eh(c,f[0],f[1]))}let u=[];for(let g=0;g<s;g++){let c=d[g],f=d[(g+1)%s];for(let b of c)if(!ti(b))u.push(b);let h=c[c.length-1],C=f[0],T=ei(h[6],h[7],C[0],C[1]);if(!ti(T))u.push(T)}let m=r,p=i;if(m===void 0||p===void 0){let g=0,c=0;for(let f=0;f<s;f++)g+=e[f*2],c+=e[f*2+1];m=g/s,p=c/s}return{cubics:u,centerX:m,centerY:p}},_s=(e,t,n,r)=>[n+Math.cos(t)*e,r+Math.sin(t)*e],bh=(e,t=1,n=0,r=0,i=Ps,s)=>{let a=[];for(let o=0;o<e;o++)a.push(..._s(t,Math.PI/e*2*o,n,r));return ni(a,i,s,n,r)},ks=(e=8,t=1,n=0,r=0)=>{if(e<3)throw Error("Circle must have at least three vertices");let i=Math.PI/e;return bh(e,t/Math.cos(i),n,r,{radius:t})},Bs=(e,t=1,n=0.5,r=Ps,i,s,a=0,o=0)=>{if(t<=0||n<=0)throw Error("Star radii must both be greater than 0");if(n>=t)throw Error("innerRadius must be less than radius");let l=s;if(!l&&i){l=[];for(let u=0;u<e;u++)l.push(r,i)}let d=[];for(let u=0;u<e;u++)d.push(..._s(t,Math.PI/e*2*u,a,o)),d.push(..._s(n,Math.PI/e*(2*u+1),a,o));return ni(d,r,l,a,o)},Hs=(e,t)=>{let n=t(e.centerX,e.centerY);return{cubics:e.cubics.map((r)=>Oc(r,t)),centerX:n[0],centerY:n[1]}},$s=(e,t)=>{let n=t*Math.PI/180,r=Math.cos(n),i=Math.sin(n);return Hs(e,(s,a)=>[s*r-a*i,s*i+a*r])},Hc=(e,t,n=t)=>Hs(e,(r,i)=>[r*t,i*n]),Vs=(e)=>{let t=1/0,n=1/0,r=-1/0,i=-1/0;for(let s of e.cubics){let a=Rc(s);t=Math.min(t,a[0]),n=Math.min(n,a[1]),r=Math.max(r,a[2]),i=Math.max(i,a[3])}return[t,n,r,i]};var $c=(e)=>{let t=Vs(e),n=t[2]-t[0],r=t[3]-t[1],i=Math.max(n,r),s=(i-n)/2-t[0],a=(i-r)/2-t[1];return Hs(e,(o,l)=>[(o+s)/i,(l+a)/i])};var vh={radius:0.15},Th={radius:0.5},Xe=(e,t,n={radius:0})=>({x:e,y:t,r:n}),Vc=(e)=>e/360*2*Math.PI,Sh=(e,t,n,r,i)=>{let s=[];if(i){let o=e.map((m)=>Math.atan2(m.y-r,m.x-n)*180/Math.PI),l=e.map((m)=>Math.hypot(m.x-n,m.y-r)),d=t*2,u=360/d;for(let m=0;m<d;m++)for(let p=0;p<e.length;p++){let g=m%2===0?p:e.length-1-p;if(g>0||m%2===0){let c=Vc(u*m+(m%2===0?o[g]:u-o[g]+2*o[0]));s.push(Xe(Math.cos(c)*l[g]+n,Math.sin(c)*l[g]+r,e[g].r))}}return s}let a=e.length;for(let o=0;o<a*t;o++){let l=e[o%a],d=Vc(Math.floor(o/a)*(360/t)),u=l.x-n,m=l.y-r;s.push(Xe(u*Math.cos(d)-m*Math.sin(d)+n,u*Math.sin(d)+m*Math.cos(d)+r,l.r))}return s},ri=(e,t,n=!1,r=0.5,i=0.5)=>{let s=Sh(e,t,r,i,n),a=[];for(let o of s)a.push(o.x,o.y);return ni(a,void 0,s.map((o)=>o.r),r,i)},yh={circle:()=>ks(10),oval:()=>$s(Hc(ks(),1,0.64),-45),pill:()=>ri([Xe(0.961,0.039,{radius:0.426}),Xe(1.001,0.428),Xe(1,0.609,{radius:1})],2,!0),pentagon:()=>ri([Xe(0.5,-0.009,{radius:0.172}),Xe(1.03,0.365,{radius:0.164}),Xe(0.828,0.97,{radius:0.169})],1,!0),sunny:()=>Bs(8,1,0.8,vh),cookie4:()=>ri([Xe(1.237,1.236,{radius:0.258}),Xe(0.5,0.918,{radius:0.233})],4),cookie9:()=>$s(Bs(9,1,0.8,Th),-90),softBurst:()=>ri([Xe(0.193,0.277,{radius:0.053}),Xe(0.176,0.055,{radius:0.053})],10)},Fc=new Map,Fs=(e)=>{let t=Fc.get(e);if(!t)t=$c(yh[e]()),Fc.set(e,t);return t},ii=Math.PI*2,Us=(e,t=360,n=24)=>{let r=[];for(let g of e.cubics)for(let c=0;c<n;c++)r.push(Rs(g,c/n));let i=0,s=0,a=0;for(let g=0;g<r.length;g++){let[c,f]=r[g],[h,C]=r[(g+1)%r.length],T=c*C-h*f;i+=T,s+=(c+h)*T,a+=(f+C)*T}if(Math.abs(i)>0.000000000001)s/=3*i,a/=3*i;else{let g=Vs(e);s=(g[0]+g[2])/2,a=(g[1]+g[3])/2}let o=[];for(let[g,c]of r){let f=g-s,h=c-a,C=Math.atan2(h,f);if(C<0)C+=ii;o.push([C,Math.hypot(f,h)])}o.sort((g,c)=>g[0]-c[0]);let l=o[o.length-1],d=o[0];o.unshift([l[0]-ii,l[1]]),o.push([d[0]+ii,d[1]]);let u=new Float32Array(t),m=0,p=0;for(let g=0;g<t;g++){let c=g/t*ii;while(o[m+1][0]<c)m++;let[f,h]=o[m],[C,T]=o[m+1],b=C===f?0:(c-f)/(C-f),E=h+(T-h)*b;if(u[g]=E,E>p)p=E}return{radii:u,centerX:s,centerY:a,maxRadius:p}};var ye={SIZE:48,INDICATOR_SIZE:38,MIN_SIZE:24,MAX_SIZE:240,MORPH_INTERVAL:650,ROTATION_DURATION:4666,MORPH_ROTATION:90,LABEL:"Loading",SAMPLES:360},hn={DAMPING:0.6,STIFFNESS:200,THRESHOLD:0.1},Uc=["softBurst","cookie9","pentagon","pill","sunny","cookie4","oval"],Gc=["circle","softBurst"],Cn={ROOT:"loading-indicator",CONTAINED:"loading-indicator--contained",DETERMINATE:"loading-indicator--determinate",CANVAS:"loading-indicator__canvas"};var zc=new Map,xh=(e)=>{let t=zc.get(e);if(!t)t=Us(Fs(e),ye.SAMPLES),zc.set(e,t);return t},Ih=Math.PI*2,Wc=(e)=>(t)=>{let n=e.prefix||"mtrl",r=document.createElement("canvas");r.className=`${n}-${Cn.CANVAS}`,r.setAttribute("aria-hidden","true"),t.element.appendChild(r);let i=null,s="",a=null,o=(h)=>{if(typeof r.getContext!=="function")return null;if(!i){if(!r.getContext("2d"))return null;i=qn(r,h,h)}else if(i.width!==h)jn(i,h,h);return i},l=()=>{let h=t.element.ownerDocument.defaultView;s=h&&t.element.isConnected?h.getComputedStyle(t.element).color:""},d=(h,C)=>{a={shapes:h,frame:C};let T=i?.width??0,b=i?.ctx;if(!b||T<=0||h.length===0)return;let E=h[C.index%h.length],v=h[(C.index+1)%h.length],S=E.radii.length,y=0;for(let N of h)y=Math.max(y,N.maxRadius);let L=T*(ye.INDICATOR_SIZE/ye.SIZE)/2/y,I=T/2,x=C.rotation*Math.PI/180,A=C.progress;if(b.clearRect(0,0,T,T),!s)l();b.fillStyle=s||"#000",b.beginPath();for(let N=0;N<S;N++){let D=(E.radii[N]+(v.radii[N]-E.radii[N])*A)*L,G=N/S*Ih+x,U=I+Math.cos(G)*D,j=I+Math.sin(G)*D;if(N===0)b.moveTo(U,j);else b.lineTo(U,j)}b.closePath(),b.fill()},u=()=>{if(a)d(a.shapes,a.frame)},m=(h)=>{o(h),l(),u()},p=Gn(()=>{l(),u()}),g=typeof ResizeObserver<"u"?new ResizeObserver(()=>{l(),u()}):null;g?.observe(t.element);let c=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{g?.disconnect(),p(),c?.call(t.lifecycle)};return{...t,canvas:r,renderer:{draw:d,resize:m,refreshColor:l,redraw:u,profiles:(h)=>h.map(xh)}}};var Lh=(e)=>{let t=hn.DAMPING,n=Math.sqrt(hn.STIFFNESS),r=n*Math.sqrt(1-t*t),i=Math.exp(-t*n*e),s=1-i*(Math.cos(r*e)+t*n/r*Math.sin(r*e)),a=i*(n*n/r)*Math.sin(r*e);return[s,a]},Ah=()=>{let e=hn.THRESHOLD,t=hn.DAMPING,n=Math.sqrt(hn.STIFFNESS),r=n*Math.sqrt(1-t*t),i=1,s=t*n*1/r,a=Math.sqrt(1+s*s);return Math.log(a/e)/(t*n)},Nh=Ah(),wh=(e)=>{let t=e/1000;if(t>=Nh)return 1;return Lh(t)[0]},Kc=(e,t)=>{let n=ye.MORPH_INTERVAL,r=Math.floor(e/n),i=e-r*n,s=r%t,a=wh(i),o=ye.MORPH_ROTATION*(r+1)+a*ye.MORPH_ROTATION,l=e%ye.ROTATION_DURATION/ye.ROTATION_DURATION*360;return{index:s,progress:a,rotation:(o+l)%360}},Yc=(e,t)=>({index:Math.floor(e/ye.MORPH_INTERVAL)%t,progress:0,rotation:0}),Xc=(e)=>({index:0,progress:e,rotation:-e*180});Q();var Dh={size:ye.SIZE,contained:!1,ariaLabel:ye.LABEL},qc=(e={})=>P(Dh,e,"loading-indicator"),Gs=(e)=>{let t=typeof e==="number"&&Number.isFinite(e)?e:ye.SIZE;return Math.min(ye.MAX_SIZE,Math.max(ye.MIN_SIZE,t))},zs=(e)=>{if(e===null||e===void 0||!Number.isFinite(e))return null;return Math.min(1,Math.max(0,e))},jc=(e)=>V(e,{tag:"div",attributes:{role:"progressbar","aria-label":e.ariaLabel||ye.LABEL}});var Zc=({config:e,lifecycle:t})=>(n)=>{let{element:r,renderer:i,canvas:s}=n,a=e.prefix||"mtrl",o=(I)=>`${a}-${I}`,d=r.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,u=i.profiles(Uc),m=i.profiles(Gc),p=Gs(e.size),g=zs(e.value),c=!1,f=null,h=0,C=0,T=()=>typeof performance<"u"?performance.now():Date.now(),b=()=>{r.style.setProperty(`--${a}-loading-indicator-size`,`${p}px`),i.resize(p)},E=()=>{if(g===null)r.classList.remove(o(Cn.DETERMINATE)),r.removeAttribute("aria-valuenow"),r.removeAttribute("aria-valuemin"),r.removeAttribute("aria-valuemax");else r.classList.add(o(Cn.DETERMINATE)),r.setAttribute("aria-valuemin","0"),r.setAttribute("aria-valuemax","100"),r.setAttribute("aria-valuenow",String(Math.round(g*100))),i.draw(m,Xc(g))},v=()=>{if(f=null,!c||g!==null)return;let I=T()-h,x=d?.matches?Yc(I,u.length):Kc(I,u.length);i.draw(u,x),f=requestAnimationFrame(v)},S=()=>{if(c)return;if(c=!0,h=T()-C,g===null&&f===null)f=requestAnimationFrame(v)},y=()=>{if(!c)return;if(c=!1,C=T()-h,f!==null)cancelAnimationFrame(f),f=null},L={element:r,canvas:s,setValue(I){let x=g;if(g=zs(I),E(),g===null&&x!==null&&c&&f===null)h=T(),f=requestAnimationFrame(v);return this},getValue(){return g},setSize(I){if(p=Gs(I),b(),g!==null)E();return this},getSize(){return p},setLabel(I){return r.setAttribute("aria-label",I),this},start(){return S(),this},stop(){return y(),this},isRunning(){return c},destroy(){y(),r.remove(),t.destroy()}};if(e.contained)r.classList.add(o(Cn.CONTAINED));return b(),E(),S(),L};var Mh=(e={})=>{let t=qc(e);try{return O(M,R(jc(t)),k(),Wc(t),(n)=>Zc({config:t,lifecycle:{destroy:n.lifecycle?.destroy||(()=>{})}})(n))(t)}catch(n){throw console.error("Loading indicator creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create loading indicator: ${n instanceof Error?n.message:String(n)}`)}},Ws=Mh;ne();Z();J();pt();var Oh={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated"},Rh={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},lt={CLICK:"click",EXPAND:"expand",COLLAPSE:"collapse",CHANGE:"change",SELECT:"select"},En={VARIANT:Oh.FILLED,SIZE:Rh.S,TRAILING_LABEL:"More options",MENU_OFFSET:4},bn={ROOT:"split-button",LEADING:"split-button__leading",TRAILING:"split-button__trailing",CHEVRON:"split-button__chevron",EXPANDED:"split-button--expanded"},Jc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="currentColor" aria-hidden="true"><path d="M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"/></svg>';var em=(e)=>(t)=>{let n=e.prefix||"mtrl",r=(l)=>`${n}-${l}`,i={variant:e.variant,size:e.size,disabled:e.disabled,prefix:n},s=Te({...i,text:e.text,icon:e.icon,ariaLabel:e.ariaLabel,class:r(bn.LEADING)}),a=Te({...i,icon:Jc,iconSize:"inherit",ariaLabel:e.trailingLabel,class:r(bn.TRAILING)});return a.element.querySelector("svg")?.classList.add(r(bn.CHEVRON)),a.element.setAttribute("aria-haspopup","true"),a.element.setAttribute("aria-expanded","false"),t.element.appendChild(s.element),t.element.appendChild(a.element),{...t,leading:s,trailing:a,leadingElement:s.element,trailingElement:a.element}};var tm=(e)=>(t)=>{if(!e.items||e.items.length===0)return t;let n=t.trailingElement,r=Ft({opener:n,items:e.items,position:"bottom-end",offset:En.MENU_OFFSET,manualOpen:!0,prefix:e.prefix});return{...t,menu:r}};var nm=({config:e,lifecycle:t})=>(n)=>{let r=n.element,i=e.prefix||"mtrl",{leading:s,trailing:a,menu:o}=n,l=`${i}-${bn.EXPANDED}`,d=!1;if(o)a.element.setAttribute("aria-haspopup","menu");let u=(g,c={})=>{n.emit?.(g,{splitButton:p,expanded:d,originalEvent:null,...c})},m=(g,c=null)=>{if(d===g)return;if(d=g,r.classList.toggle(l,d),a.element.setAttribute("aria-expanded",String(d)),o)if(d)o.open(c??void 0);else o.close(c??void 0);u(d?lt.EXPAND:lt.COLLAPSE,{originalEvent:c}),u(lt.CHANGE,{originalEvent:c})},p={element:r,leadingElement:s.element,trailingElement:a.element,menu:o,setText(g){return s.setText(g),this},getText(){return s.getText()},setIcon(g){return s.setIcon(g),this},expand(){return m(!0),this},collapse(){return m(!1),this},isExpanded(){return d},disable(){return s.disable(),a.disable(),this},enable(){return s.enable(),a.enable(),this},isDisabled(){return s.element.disabled===!0},on(g,c){return n.on?.(g,c),this},off(g,c){return n.off?.(g,c),this},destroy(){o?.destroy?.(),s.destroy(),a.destroy(),r.remove(),t.destroy()}};if(s.on("click",(g)=>{u(lt.CLICK,{originalEvent:g})}),a.on("click",(g)=>{m(!d,g)}),o)o.on?.("close",()=>{if(!d)return;d=!1,r.classList.remove(l),a.element.setAttribute("aria-expanded","false"),u(lt.COLLAPSE),u(lt.CHANGE)}),o.on?.("select",(g)=>{u(lt.SELECT,{item:g?.item})});if(e.onClick)p.on(lt.CLICK,e.onClick);if(e.onSelect)p.on(lt.SELECT,e.onSelect);if(e.on){for(let[g,c]of Object.entries(e.on))if(c)p.on(g,c)}return p};Q();var _h={variant:En.VARIANT,size:En.SIZE,disabled:!1,trailingLabel:En.TRAILING_LABEL},rm=(e={})=>P(_h,e,"split-button"),im=(e)=>{let t={role:"group"};if(e.groupLabel)t["aria-label"]=e.groupLabel;return V(e,{tag:"div",attributes:t})};var Ph=(e={})=>{let t=rm(e);try{return O(M,B(),R(im(t)),se(t),mt(t),em(t),tm(t),k(),(n)=>nm({config:t,lifecycle:{destroy:n.lifecycle?.destroy||(()=>{})}})(n))(t)}catch(n){throw console.error("Split button creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create split button: ${n instanceof Error?n.message:String(n)}`)}},Ks=Ph;ne();Z();J();var sm=(e)=>(t)=>{let n=[],r=t.getClass("radios"),i=e.value||"";if(t.element.classList.add(`${r}--${e.direction||"vertical"}`),e.disabled)t.element.classList.add(`${r}--disabled`);let s=(l)=>{let d=document.createElement("div");d.classList.add(`${r}-item`);let u=document.createElement("input");if(u.type="radio",u.name=e.name,u.value=l.value,u.classList.add(`${r}-input`),i===l.value)u.checked=!0;if(e.disabled||l.disabled)u.disabled=!0,d.classList.add(`${r}-item--disabled`);let m=document.createElement("label");m.classList.add(`${r}-label`);let p=document.createElement("span");p.classList.add(`${r}-control`);let g=document.createElement("span");if(g.classList.add(`${r}-circle`),e.ripple!==!1){let C=document.createElement("span");C.classList.add(`${r}-ripple`),p.appendChild(C)}p.appendChild(g);let c=document.createElement("span");if(c.classList.add(`${r}-text`),c.textContent=l.label,l.labelBefore)m.classList.add(`${r}-label--before`),m.appendChild(c),m.appendChild(p);else m.appendChild(p),m.appendChild(c);let f=`${r}-${l.value}-${Math.random().toString(36).substring(2,9)}`;u.id=f,m.htmlFor=f,d.appendChild(u),d.appendChild(m);let h=(C)=>{if(u.checked){if(i=l.value,n.forEach((T)=>{if(T.input!==u)T.input.checked=!1}),t.events&&typeof t.events.emit==="function")t.events.emit("change",{value:l.value,originalEvent:C,option:l});else if(typeof t.on==="function"){let T=new CustomEvent("change",{detail:{value:l.value,originalEvent:C,option:l}});t.element.dispatchEvent(T)}}};return u.addEventListener("change",h),{element:d,input:u,label:m,config:l,destroy:()=>{if(u.removeEventListener("change",h),d.parentNode)d.parentNode.removeChild(d)}}},a=(l)=>{let d=s(l);return t.element.appendChild(d.element),n.push(d),t},o=(l)=>{let d=n.findIndex((u)=>u.config.value===l);if(d!==-1){if(n[d].destroy(),n.splice(d,1),i===l)i=""}return t};if(e.options&&Array.isArray(e.options))e.options.forEach((l)=>a(l));if(!t.events)t.events={on:(l,d)=>{t.element.addEventListener(l,(u)=>d(u.detail))},off:(l,d)=>{t.element.removeEventListener(l,d)},emit:(l,d)=>{let u=new CustomEvent(l,{detail:d});t.element.dispatchEvent(u)}};return{...t,radios:n,getValue:()=>i,setValue:(l)=>(i=l,n.forEach((d)=>{d.input.checked=d.config.value===l}),t),getSelected:()=>{let l=n.find((d)=>d.config.value===i);return l?l.config:null},addOption:a,removeOption:o,enable:()=>(t.element.classList.remove(`${r}--disabled`),n.forEach((l)=>{if(l.input.disabled=l.config.disabled||!1,!l.config.disabled)l.element.classList.remove(`${r}-item--disabled`)}),t),disable:()=>(t.element.classList.add(`${r}--disabled`),n.forEach((l)=>{l.input.disabled=!0,l.element.classList.add(`${r}-item--disabled`)}),t),enableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d){if(d.config.disabled=!1,d.input.disabled=t.element.classList.contains(`${r}--disabled`),!d.input.disabled)d.element.classList.remove(`${r}-item--disabled`)}return t},disableOption:(l)=>{let d=n.find((u)=>u.config.value===l);if(d)d.config.disabled=!0,d.input.disabled=!0,d.element.classList.add(`${r}-item--disabled`);return t}}};var am=({disabled:e,lifecycle:t})=>(n)=>{if(!n.events)n.events={on:(i,s)=>{n.element.addEventListener(i,(a)=>s(a.detail))},off:(i,s)=>{n.element.removeEventListener(i,s)},emit:(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)}};else if(!n.events.emit)n.events.emit=(i,s)=>{let a=new CustomEvent(i,{detail:s});n.element.dispatchEvent(a)};return{element:n.element,radios:n.radios,lifecycle:{destroy:t.destroy},getClass:n.getClass,getValue:()=>n.getValue(),setValue(i){return n.setValue(i),this},getSelected:()=>n.getSelected(),addOption(i){return n.addOption(i),this},removeOption(i){return n.removeOption(i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},enableOption(i){return n.enableOption(i),this},disableOption(i){return n.disableOption(i),this},on(i,s){return n.events.on(i,s),this},off(i,s){return n.events.off(i,s),this},destroy(){n.radios.forEach((i)=>i.destroy()),t.destroy()}}};Q();var kh={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},om=(e)=>P(kh,e,"radios"),lm=(e)=>V(e,{tag:"div",attributes:{role:"radiogroup"},className:e.class}),dm=(e)=>({disabled:{enable:()=>e.disabled.enable(),disable:()=>e.disabled.disable()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var Bh=(e)=>{if(!e.name)e.name=`radios-${Math.random().toString(36).substring(2,9)}`;let t=om(e);try{return O(M,B(),R(lm(t)),sm(t),oe(t),k(),(r)=>am(dm(r))(r))(t)}catch(n){throw console.error("Radios creation error:",n),Error(`Failed to create radios component: ${n.message}`)}},Xs=Bh;Z();J();var Re={BAR:"bar",VIEW:"view"},zt={DOCKED:"docked",FULLSCREEN:"fullscreen"},qs={BAR_HEIGHT:56,BAR_MIN_WIDTH:360,BAR_MAX_WIDTH:720,VIEW_DOCKED_HEADER_HEIGHT:56,VIEW_DOCKED_MIN_WIDTH:360,VIEW_DOCKED_MAX_WIDTH:720,VIEW_DOCKED_MIN_HEIGHT:240,VIEW_FULLSCREEN_HEADER_HEIGHT:72,PADDING_HORIZONTAL:16,ICON_SIZE:24,AVATAR_SIZE:30,ICON_SPACING:16},Wt={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",EXPAND:"expand",COLLAPSE:"collapse",SUGGESTION_SELECT:"suggestionSelect"},Ct={SEARCH:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>',BACK:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>',CLEAR:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',MIC:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 14c1.66 0 2.99-1.34 2.99-3L15 5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3zm5.3-3c0 3-2.54 5.1-5.3 5.1S6.7 14 6.7 11H5c0 3.41 2.72 6.23 6 6.72V21h2v-3.28c3.28-.48 6-3.3 6-6.72h-1.7z"/></svg>',HISTORY:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"/></svg>'},vn={STATE:Re.BAR,VIEW_MODE:zt.DOCKED,PLACEHOLDER:"Search",VALUE:"",SHOW_CLEAR_BUTTON:!0,DISABLED:!1,FULL_WIDTH:!1},z={ROOT:"search",STATE_BAR:"search--bar",STATE_VIEW:"search--view",VIEW_DOCKED:"search--docked",VIEW_FULLSCREEN:"search--fullscreen",FOCUSED:"search--focused",DISABLED:"search--disabled",POPULATED:"search--populated",FULL_WIDTH:"search--full-width",CONTAINER:"search__container",HEADER:"search__header",INPUT_WRAPPER:"search__input-wrapper",INPUT:"search__input",DIVIDER:"search__divider",CONTENT:"search__content",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",CLEAR_BUTTON:"search__clear-button",CLEAR_BUTTON_HIDDEN:"search__clear-button--hidden",AVATAR:"search__avatar",SUGGESTIONS:"search__suggestions",SUGGESTION_LIST:"search__suggestion-list",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_ITEM_SELECTED:"search__suggestion-item--selected",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",SUGGESTION_DIVIDER:"search__suggestion-divider"},Tn={ENTER:"Enter",ESCAPE:"Escape",ARROW_DOWN:"ArrowDown",ARROW_UP:"ArrowUp",TAB:"Tab"};Qe();var js=(e)=>(t)=>{let n=e.disabled===!0,r=e.initialState||Re.BAR,i=r===Re.VIEW,s=e.placeholder||"Search",a=e.value||"",o=(S)=>t.getClass?t.getClass(S):S,l=[o(z.ROOT),o(r===Re.BAR?z.STATE_BAR:z.STATE_VIEW),o(e.viewMode==="fullscreen"?z.VIEW_FULLSCREEN:z.VIEW_DOCKED)];if(e.fullWidth)l.push(o(z.FULL_WIDTH));if(n)l.push(o(z.DISABLED));if(a)l.push(o(z.POPULATED));t.element.className=l.filter(Boolean).join(" "),t.element.setAttribute("role","search"),t.element.setAttribute("aria-disabled",n?"true":"false");let d=H({tag:"div",className:o(z.CONTAINER),container:t.element}),u=i?Ct.BACK:e.leadingIcon||Ct.SEARCH,m=H({tag:"button",className:o(z.LEADING_ICON),container:d,html:u,attributes:{type:"button",tabindex:n?"-1":"0","aria-label":i?"Go back":"Search"}}),p=H({tag:"div",className:o(z.INPUT_WRAPPER),container:d}),g={type:"text",placeholder:s,"aria-label":s};if(a)g.value=a;if(n)g.disabled="disabled";let c=H({tag:"input",className:o(z.INPUT),container:p,attributes:g});if(a)c.value=a;let f=null;if(e.showClearButton!==!1){let S=[o(z.CLEAR_BUTTON)];if(!a)S.push(o(z.CLEAR_BUTTON_HIDDEN));f=H({tag:"button",className:S.join(" "),container:d,html:Ct.CLEAR,attributes:{type:"button",tabindex:n||!a?"-1":"0","aria-label":"Clear search"}})}let h=null;if(e.trailingItems&&e.trailingItems.length>0)h=H({tag:"div",className:o("search__trailing"),container:d}),e.trailingItems.forEach((S)=>{let y=S.type==="avatar"?o(z.AVATAR):o(z.TRAILING_ICON);H({tag:S.type==="avatar"?"div":"button",className:y,container:h,html:S.content,attributes:{...S.type!=="avatar"&&{type:"button"},tabindex:n?"-1":"0","aria-label":S.ariaLabel||"","data-trailing-id":S.id}})});let C=null,T=null,b=null,E=null;if(C=H({tag:"div",className:o(z.DIVIDER)}),T=H({tag:"div",className:o(z.CONTENT)}),b=H({tag:"div",className:o(z.SUGGESTIONS),container:T}),E=H({tag:"ul",className:o(z.SUGGESTION_LIST),container:b,attributes:{role:"listbox","aria-label":"Search suggestions"}}),i)t.element.appendChild(C),t.element.appendChild(T);return{...t,structure:{container:d,input:c,inputWrapper:p,leadingIcon:m,clearButton:f,trailingContainer:h,divider:C,suggestionsContainer:b,suggestionsList:E}}};var Zs=(e)=>(t)=>{let n=e.initialState||Re.BAR,r=e.viewMode||zt.DOCKED,i=e.disabled===!0,s=(g)=>t.getClass?t.getClass(g):g,a=()=>{if(n===Re.VIEW||i)return;let{element:g,structure:c}=t;if(n=Re.VIEW,g.classList.remove(s(z.STATE_BAR)),g.classList.add(s(z.STATE_VIEW)),c?.leadingIcon)c.leadingIcon.innerHTML=Ct.BACK,c.leadingIcon.setAttribute("aria-label","Go back");if(c?.divider&&!g.contains(c.divider))g.appendChild(c.divider);if(c?.suggestionsContainer?.parentElement&&!g.contains(c.suggestionsContainer.parentElement))g.appendChild(c.suggestionsContainer.parentElement);if(c?.input)requestAnimationFrame(()=>{c.input.focus()});if(t.emit)t.emit("expand",{component:t,state:n,viewMode:r})},o=()=>{if(n===Re.BAR)return;let{element:g,structure:c}=t;if(n=Re.BAR,g.classList.remove(s(z.STATE_VIEW)),g.classList.add(s(z.STATE_BAR)),c?.leadingIcon)c.leadingIcon.innerHTML=e.leadingIcon||Ct.SEARCH,c.leadingIcon.setAttribute("aria-label","Search");if(c?.divider&&g.contains(c.divider))g.removeChild(c.divider);if(c?.suggestionsContainer?.parentElement&&g.contains(c.suggestionsContainer.parentElement))g.removeChild(c.suggestionsContainer.parentElement);if(t.emit)t.emit("collapse",{component:t,state:n,viewMode:r})},l=(g)=>{if(g===r)return;let c=t.element;c.classList.remove(s(r===zt.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN)),r=g,c.classList.add(s(g===zt.DOCKED?z.VIEW_DOCKED:z.VIEW_FULLSCREEN))},d=()=>{i=!0;let{element:g,structure:c}=t;if(g.classList.add(s(z.DISABLED)),g.setAttribute("aria-disabled","true"),c?.input)c.input.disabled=!0;let f=[c?.leadingIcon,c?.clearButton].filter(Boolean);if(c?.trailingContainer)c.trailingContainer.querySelectorAll("button").forEach((C)=>f.push(C));f.forEach((h)=>{if(h)h.tabIndex=-1,h.setAttribute("aria-disabled","true")})},u=()=>{i=!1;let{element:g,structure:c}=t;if(g.classList.remove(s(z.DISABLED)),g.setAttribute("aria-disabled","false"),c?.input)c.input.disabled=!1;let f=[c?.leadingIcon,c?.clearButton].filter(Boolean);if(c?.trailingContainer)c.trailingContainer.querySelectorAll("button").forEach((C)=>f.push(C));if(f.forEach((h)=>{if(h)h.tabIndex=0,h.setAttribute("aria-disabled","false")}),c?.clearButton&&c.input&&!c.input.value)c.clearButton.tabIndex=-1},m=(g)=>{let c=t.element;if(g)c.classList.add(s(z.POPULATED));else c.classList.remove(s(z.POPULATED))},p=(g)=>{let c=t.element;if(g)c.classList.add(s(z.FOCUSED));else c.classList.remove(s(z.FOCUSED))};if(i)setTimeout(()=>{d()},0);return{...t,states:{expand:a,collapse:o,getState:()=>n,isExpanded:()=>n===Re.VIEW,setViewMode:l,getViewMode:()=>r,updatePopulatedState:m,updateFocusedState:p},disabled:{enable(){return u(),this},disable(){return d(),this},isDisabled:()=>i}}};var um=(e)=>{if(!e)return[];return e.map((t)=>{if(typeof t==="string")return{text:t,value:t};return{...t,value:t.value??t.text}})},Qs=(e)=>(t)=>{let n=e.value||"",r=e.placeholder||"Search",i=um(e.suggestions),s=(S)=>t.getClass?t.getClass(S):S,a=(S,y=null,L={})=>{let I={component:t,value:n,originalEvent:y,preventDefault:()=>{I.defaultPrevented=!0},defaultPrevented:!1,...L};return I},o=(S,y=null,L={})=>{let I=a(S,y,L);if(t.emit)t.emit(S,I);let x=`on${S.charAt(0).toUpperCase()}${S.slice(1)}`,A=e[x];if(typeof A==="function")if(S==="suggestionSelect"&&L.suggestion)A(L.suggestion);else A(n);return I},l=(S)=>{let y=t.structure?.clearButton;if(!y)return;if(S){if(y.classList.remove(s(z.CLEAR_BUTTON_HIDDEN)),!t.disabled?.isDisabled())y.tabIndex=0}else y.classList.add(s(z.CLEAR_BUTTON_HIDDEN)),y.tabIndex=-1},d=(S,y=!0)=>{let L=n;n=S;let I=t.structure?.input;if(I&&I.value!==S)I.value=S;if(l(!!S),t.states?.updatePopulatedState)t.states.updatePopulatedState(!!S);if(y&&S!==L)o(Wt.INPUT)},u=()=>n,m=(S)=>{r=S;let y=t.structure?.input;if(y)y.placeholder=S,y.setAttribute("aria-label",S)},p=()=>r,g=(S=!0)=>{d("",!1);let y=t.structure?.input;if(y&&!t.disabled?.isDisabled())y.focus();if(S)o(Wt.CLEAR)},c=()=>{if(n)o(Wt.SUBMIT)},f=()=>{let S=t.structure?.input;if(S&&!t.disabled?.isDisabled())S.focus()},h=()=>{let S=t.structure?.input;if(S)S.blur()},C=(S)=>{i=um(S)},T=()=>[...i],b=()=>{i=[]},E=(S)=>{d(S.value??S.text,!1),o(Wt.SUGGESTION_SELECT,null,{suggestion:S})},v=()=>{let S=t.structure?.input,y=t.structure?.clearButton,L=t.structure?.leadingIcon;if(!S)return;if(S.addEventListener("input",(I)=>{let x=I.target;d(x.value,!0)}),S.addEventListener("focus",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!0);if(o(Wt.FOCUS,I),e.expandOnFocus!==!1&&t.states?.expand)t.states.expand()}),S.addEventListener("blur",(I)=>{if(t.states?.updateFocusedState)t.states.updateFocusedState(!1);if(o(Wt.BLUR,I),e.collapseOnBlur!==!1&&t.states?.collapse){let x=e.collapseDelay??150;setTimeout(()=>{if(document.activeElement!==S)t.states.collapse()},x)}}),S.addEventListener("keydown",(I)=>{switch(I.key){case"Enter":I.preventDefault(),c();break;case"Escape":if(I.preventDefault(),n)g();else if(t.states?.isExpanded?.())t.states.collapse();break;case"ArrowDown":break;case"ArrowUp":break}}),y)y.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),g()}),y.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")I.preventDefault(),g()});if(L)L.addEventListener("click",(I)=>{if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()}),L.addEventListener("keydown",(I)=>{if(I.key==="Enter"||I.key===" ")if(I.preventDefault(),t.states?.isExpanded?.())t.states.collapse();else t.states?.expand()})};return setTimeout(()=>{v()},0),{...t,input:{setValue:d,getValue:u,setPlaceholder:m,getPlaceholder:p,clear:g,submit:c,focus:f,blur:h,setSuggestions:C,getSuggestions:T,clearSuggestions:b,selectSuggestion:E,emitEvent:o}}};Qe();var Js=(e)=>(t)=>{let n=-1,r=[],i=(C)=>t.getClass?t.getClass(C):C,s=()=>{if(t.input?.getSuggestions)return t.input.getSuggestions();return r},a=(C,T)=>{if(!T)return C;let b=C.toLowerCase(),E=T.toLowerCase(),v=b.indexOf(E);if(v===-1)return C;let S=C.slice(0,v),y=C.slice(v,v+T.length),L=C.slice(v+T.length);return`${S}<strong>${y}</strong>${L}`},o=(C,T,b)=>{let E=T===n,v=[i(z.SUGGESTION_ITEM)];if(E)v.push(i(z.SUGGESTION_ITEM_SELECTED));let S=H({tag:"li",className:v.join(" "),attributes:{role:"option","aria-selected":E?"true":"false","data-index":String(T),"data-value":C.value??C.text,tabindex:"-1"}});if(C.icon){let L=H({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:C.icon})}else{let L=H({tag:"span",className:i(z.SUGGESTION_ICON),container:S,html:Ct.HISTORY})}let y=H({tag:"span",className:i(z.SUGGESTION_TEXT),container:S,html:a(C.text,b)});return S},l=()=>H({tag:"li",className:i(z.SUGGESTION_DIVIDER),attributes:{role:"separator","aria-hidden":"true"}}),d=()=>{let C=t.structure?.suggestionsList;if(!C)return;let T=s(),b=t.input?.getValue?.()||"";if(C.innerHTML="",T.length===0)return;let E;T.forEach((S,y)=>{if(S.group&&S.group!==E){if(E!==void 0)C.appendChild(l());E=S.group}let L=o(S,y,b);L.addEventListener("click",(I)=>{I.preventDefault(),I.stopPropagation(),c(y)}),L.addEventListener("mouseenter",()=>{m(y)}),C.appendChild(L)});let v=T.length;C.setAttribute("aria-label",`${v} suggestion${v!==1?"s":""} available`)},u=()=>{let C=t.structure?.suggestionsList;if(C)C.innerHTML="";n=-1},m=(C)=>{let T=t.structure?.suggestionsList;if(!T)return;let b=s();if(C<-1)C=b.length-1;if(C>=b.length)C=-1;if(n>=0){let E=T.querySelector(`[data-index="${n}"]`);if(E)E.classList.remove(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","false")}if(n=C,n>=0){let E=T.querySelector(`[data-index="${n}"]`);if(E)E.classList.add(i(z.SUGGESTION_ITEM_SELECTED)),E.setAttribute("aria-selected","true"),E.scrollIntoView({block:"nearest",behavior:"smooth"})}},p=()=>{m(n+1)},g=()=>{m(n-1)},c=(C)=>{let T=s();if(C<0||C>=T.length)return;let b=T[C];if(t.input?.selectSuggestion)t.input.selectSuggestion(b);if(t.states?.collapse)t.states.collapse()},f=()=>{if(n>=0)return c(n),!0;return!1},h=()=>{let C=t.structure?.input;if(!C)return;C.addEventListener("keydown",(T)=>{let b=s();if(!t.states?.isExpanded?.()||b.length===0)return;switch(T.key){case Tn.ARROW_DOWN:T.preventDefault(),p();break;case Tn.ARROW_UP:T.preventDefault(),g();break;case Tn.ENTER:if(n>=0)T.preventDefault(),f();break;case Tn.TAB:if(n>=0)f();break;case Tn.ESCAPE:n=-1;break}})};return setTimeout(()=>{h()},0),{...t,suggestions:{render:d,clear:u,setHighlightedIndex:m,getHighlightedIndex:()=>n,highlightNext:p,highlightPrevious:g,select:c,selectHighlighted:f}}};var cm=(e)=>(t)=>({element:t.element,setValue(r,i=!0){return e.value.setValue(r,i),this},getValue(){return e.value.getValue()},setPlaceholder(r){return e.value.setPlaceholder(r),this},getPlaceholder(){return e.value.getPlaceholder()},expand(){return e.state.expand(),this},collapse(){return e.state.collapse(),this},getState(){return e.state.getState()},isExpanded(){return e.state.isExpanded()},setViewMode(r){return e.state.setViewMode(r),this},getViewMode(){return e.state.getViewMode()},focus(){return e.value.focus(),this},blur(){return e.value.blur(),this},clear(){return e.value.clear(),this},submit(){return e.value.submit(),this},setLeadingIcon(r){return console.warn("setLeadingIcon: Not yet implemented"),this},addTrailingItem(r){return console.warn("addTrailingItem: Not yet implemented"),this},removeTrailingItem(r){return console.warn("removeTrailingItem: Not yet implemented"),this},setTrailingItems(r){return console.warn("setTrailingItems: Not yet implemented"),this},setSuggestions(r){return e.suggestions.set(r),e.suggestions.render(),this},getSuggestions(){return e.suggestions.get()},clearSuggestions(){return e.suggestions.clear(),e.suggestions.render(),this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},on(r,i){return e.events.on(r,i),this},off(r,i){return e.events.off(r,i),this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});Q();var Hh={initialState:Re.BAR,viewMode:zt.DOCKED,disabled:vn.DISABLED,placeholder:vn.PLACEHOLDER,value:vn.VALUE,leadingIcon:void 0,trailingItems:void 0,suggestions:void 0,showClearButton:vn.SHOW_CLEAR_BUTTON,expandOnFocus:!0,collapseOnBlur:!0,collapseDelay:150,minWidth:qs.BAR_MIN_WIDTH,maxWidth:qs.BAR_MAX_WIDTH,fullWidth:vn.FULL_WIDTH},mm=(e={})=>P(Hh,e,"search"),fm=(e)=>V(e,{tag:"div",attributes:{role:"search","aria-disabled":e.disabled===!0?"true":"false"},className:e.class}),pm=(e)=>({value:{setValue:(t,n)=>e.input?.setValue?.(t,n),getValue:()=>e.input?.getValue?.()??"",setPlaceholder:(t)=>e.input?.setPlaceholder?.(t),getPlaceholder:()=>e.input?.getPlaceholder?.()??"",clear:()=>e.input?.clear?.(),submit:()=>e.input?.submit?.(),focus:()=>e.input?.focus?.(),blur:()=>e.input?.blur?.()},state:{expand:()=>e.states?.expand?.(),collapse:()=>e.states?.collapse?.(),getState:()=>e.states?.getState?.()??"bar",isExpanded:()=>e.states?.isExpanded?.()??!1,setViewMode:(t)=>e.states?.setViewMode?.(t),getViewMode:()=>e.states?.getViewMode?.()??"docked"},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},suggestions:{set:(t)=>e.input?.setSuggestions?.(t),get:()=>e.input?.getSuggestions?.()??[],clear:()=>e.input?.clearSuggestions?.(),render:()=>e.suggestions?.render?.()},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var $h=(e={})=>{let t=mm(e);try{let n=O(M,B(),R(fm(t)),js(t),Zs(t),Qs(t),Js(t),k())(t),r=pm(n),i=cm(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Search creation error:",n),Error(`Failed to create search: ${n.message}`)}},ea=$h;ne();Z();J();ne();Z();J();var gm=({disabled:e,lifecycle:t})=>(n)=>({element:n.element,input:n.input,getValue:n.getValue||(()=>""),setValue(r){return n.setValue?.(r),this},setAttribute(r,i){return n.setAttribute?.(r,i),this},getAttribute(r){return n.getAttribute?.(r)||null},removeAttribute(r){return n.removeAttribute?.(r),this},setVariant(r){let i=n.config?.prefix||"mtrl",s=n.config?.componentName||"textfield";if(n.element.classList.remove(`${i}-${s}--filled`,`${i}-${s}--outlined`),n.element.classList.add(`${i}-${s}--${r}`),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getVariant(){let r=n.config?.prefix||"mtrl",i=n.config?.componentName||"textfield";if(n.element.classList.contains(`${r}-${i}--outlined`))return"outlined";return"filled"},setLabel(r){if(n.label?.setText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10);return this},getLabel(){return n.label?.getText()||""},leadingIcon:n.leadingIcon||null,setLeadingIcon(r){if(n.setLeadingIcon){if(n.setLeadingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeLeadingIcon(){if(n.removeLeadingIcon){if(n.removeLeadingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},trailingIcon:n.trailingIcon||null,setTrailingIcon(r){if(n.setTrailingIcon){if(n.setTrailingIcon(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeTrailingIcon(){if(n.removeTrailingIcon){if(n.removeTrailingIcon(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},supportingTextElement:n.supportingTextElement||null,setSupportingText(r,i){if(n.setSupportingText)n.setSupportingText(r,i);return this},removeSupportingText(){if(n.removeSupportingText)n.removeSupportingText();return this},prefixTextElement:n.prefixTextElement||null,setPrefixText(r){if(n.setPrefixText){if(n.setPrefixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removePrefixText(){if(n.removePrefixText){if(n.removePrefixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},suffixTextElement:n.suffixTextElement||null,setSuffixText(r){if(n.setSuffixText){if(n.setSuffixText(r),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},removeSuffixText(){if(n.removeSuffixText){if(n.removeSuffixText(),n.updateElementPositions)setTimeout(()=>n.updateElementPositions(),10)}return this},updatePositions(){if(n.input&&n.element){let r=n.input.value&&n.input.value.length>0,i=n.input.matches?.(":-webkit-autofill")||!1;if(r||i)n.element.classList.remove(`${n.config?.prefix||"mtrl"}-textfield--empty`);else n.element.classList.add(`${n.config?.prefix||"mtrl"}-textfield--empty`)}if(n.updateElementPositions)n.updateElementPositions();return this},setError(r,i){if(n.setError)n.setError(r,i);return this},isError(){return n.isError?.()||!1},setDensity(r){if(n.density?.set)n.density.set(r);return this},getDensity(){return n.density?.current||"default"},on(r,i){return n.on?.(r,i),this},off(r,i){return n.off?.(r,i),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});var ta=(e)=>(t)=>{if(!e.leadingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-leading-icon`,r.innerHTML=e.leadingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return setTimeout(()=>{let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i){if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`))i.style.left="44px"}},10),{...t,leadingIcon:r,setLeadingIcon(i){return r.innerHTML=i,this},removeLeadingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-leading-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-leading-icon`);if(!t.element.classList.contains(`${n}-${e.componentName||"textfield"}--with-prefix`)){let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left=""}this.leadingIcon=null}return this}}};var na=(e)=>(t)=>{if(!e.trailingIcon)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-trailing-icon`,r.innerHTML=e.trailingIcon,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.add(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,trailingIcon:r,setTrailingIcon(i){return r.innerHTML=i,this},removeTrailingIcon(){if(r.parentNode){if(r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-trailing-icon`),t.input)t.input.classList.remove(`${n}-${e.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var ra=(e)=>(t)=>{if(!e.prefixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-prefix`,r.textContent=e.prefixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-prefix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,prefixTextElement:r,setPrefixText(i){return r.textContent=i,this},removePrefixText(){if(r.parentNode){r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-prefix`);let i=t.element.querySelector(`.${n}-${e.componentName||"textfield"}-label`);if(i)i.style.left="";this.prefixTextElement=null}return this}}};var ia=(e)=>(t)=>{if(!e.suffixText)return t;let n=e.prefix||"mtrl",r=document.createElement("span");if(r.className=`${n}-${e.componentName||"textfield"}-suffix`,r.textContent=e.suffixText,t.element.appendChild(r),t.element.classList.add(`${n}-${e.componentName||"textfield"}--with-suffix`),"lifecycle"in t&&t.lifecycle?.destroy){let i=t.lifecycle.destroy;t.lifecycle.destroy=()=>{r.remove(),i.call(t.lifecycle)}}return{...t,suffixTextElement:r,setSuffixText(i){return r.textContent=i,this},removeSuffixText(){if(r.parentNode)r.remove(),t.element.classList.remove(`${n}-${e.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var sa=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=null,s=(a,o=!1)=>{let l=document.createElement("div");if(l.className=`${n}-${r}-helper`,l.textContent=a,o)l.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);return l};if(e.supportingText)i=s(e.supportingText,e.error),t.element.appendChild(i);if("lifecycle"in t&&t.lifecycle?.destroy){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(i)i.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:i,setSupportingText(a,o=!1){if(i)i.remove(),t.element.classList.remove(`${n}-${r}--error`);if(a)i=s(a,o),t.element.appendChild(i),this.supportingTextElement=i;else i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this},removeSupportingText(){if(i)i.remove(),i=null,this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}};_i();var aa=()=>(e)=>{let t=e.config.prefix||"mtrl",n=e.config.componentName||"textfield",r=new WeakMap,i=new WeakMap,s=new WeakMap,a=new WeakMap,o=()=>{if(!e.element||!e.element.isConnected)return e;let d=e.element.querySelector(`.${t}-${n}-label`),u=e.element.querySelector(`.${t}-${n}-prefix`),m=e.element.querySelector(`.${t}-${n}-suffix`),p=e.element.classList.contains(`${t}-${n}--outlined`),g=e.element.classList.contains(`${t}-${n}--focused`),c=e.element.classList.contains(`${t}-${n}--empty`),f=e.element.classList.contains(`${t}-${n}--with-leading-icon`);if(p&&d){let{color:h,element:C}=xt(e.element);if(g||!c){if(d.style.backgroundColor=h,d.style.paddingLeft="4px",d.style.paddingRight="4px",C&&!r.has(e.element)){let T=new MutationObserver(()=>{let{color:v}=xt(e.element);d.style.backgroundColor=v});T.observe(C,{attributes:!0,attributeFilter:["style","class"]}),r.set(e.element,T);let b=C.parentElement,E=[];while(b&&b!==document.documentElement){let v=new MutationObserver(()=>{let{color:S}=xt(e.element);d.style.backgroundColor=S});v.observe(b,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),E.push(v),b=b.parentElement}if(E.length)i.set(e.element,E)}if(!s.has(e.element)){let T=()=>{let{color:b}=xt(e.element);if(g||!c)d.style.backgroundColor=b};document.addEventListener("themechange",T),s.set(e.element,T)}}else d.style.backgroundColor="",d.style.padding=""}if(u&&e.input){let C=u.getBoundingClientRect().width+4+12;if(e.input.style.paddingLeft=`${C}px`,d){let T=C;if(f)T=Math.max(T,44);if(!g&&c)d.style.left=`${T}px`;else d.style.left="12px"}}else if(f&&d){if(p)if(!g&&c)d.style.left="44px";else d.style.left="12px"}if(m&&e.input){let C=m.getBoundingClientRect().width+4+12;e.input.style.paddingRight=`${C}px`}return e},l=()=>{let d=new MutationObserver((u)=>{u.forEach((m)=>{if(m.type==="attributes"&&m.attributeName==="class")setTimeout(o,10)})});d.observe(e.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",o),a.set(e.element,d)};if(setTimeout(()=>{l(),o()},0),"lifecycle"in e&&e.lifecycle?.destroy){let d=e.lifecycle.destroy;e.lifecycle.destroy=()=>{window.removeEventListener("resize",o);let u=a.get(e.element);if(u)u.disconnect(),a.delete(e.element);let m=r.get(e.element);if(m)m.disconnect(),r.delete(e.element);let p=i.get(e.element);if(p)p.forEach((c)=>c.disconnect()),i.delete(e.element);let g=s.get(e.element);if(g)document.removeEventListener("themechange",g),s.delete(e.element);d.call(e.lifecycle)}}return{...e,updateElementPositions:()=>(o(),e)}};var oa=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.density||"default";if(i!=="default")t.element.classList.add(`${n}-${r}--density-${i}`);if(t.element.setAttribute("data-density",i),t.input)s(t.input,i);function s(o,l){o.setAttribute("data-density",l)}let a=(o)=>{if(["default","compact"].forEach((l)=>{t.element.classList.remove(`${n}-${r}--density-${l}`)}),o!=="default")t.element.classList.add(`${n}-${r}--density-${o}`);if(t.element.setAttribute("data-density",o),t.input)t.input.setAttribute("data-density",o);if(t.density)t.density.current=o;if(t.updateElementPositions)setTimeout(()=>t.updateElementPositions(),10)};return t.density={current:i,set:a},t};var la=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"textfield",i=e.error||!1;if(i)t.element.classList.add(`${n}-${r}--error`);return{...t,errorState:i,setError(s,a){if(i=s,t.element.classList.toggle(`${n}-${r}--error`,s),a!==void 0&&t.setSupportingText){if(a)t.setSupportingText(a,s);else if(!s)t.setSupportingText("",!1)}else if(t.supportingTextElement&&t.setSupportingText){let o=t.supportingTextElement.textContent||"";if(o)t.setSupportingText(o,s)}return this},isError(){return i}}};Q();var Vh={FILLED:"filled",OUTLINED:"outlined"};var Fh={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"};var Uh={DEFAULT:"default",COMPACT:"compact"},da={TYPE:Fh.TEXT,VARIANT:Vh.FILLED,DENSITY:Uh.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150};var Gh={type:da.TYPE,variant:da.VARIANT},hm=(e={})=>P(Gh,e,"textfield"),Cm=(e)=>V(e,{tag:"div",className:e.class}),Em=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy}});var zh=(e={})=>{let t=hm(e);try{return O(M,B(),R(Cm(t)),se(t),oa(t),kn(t),et(t),ta(t),na(t),ra(t),ia(t),sa(t),la(t),oe(t),k(),aa(),(r)=>gm(Em(r))(r))(t)}catch(n){throw console.error("Textfield creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create textfield: ${n instanceof Error?n.message:String(n)}`)}},ir=zh;var bm=(e)=>(t)=>{let n="";if(e.value){let s=(e.options||[]).find((a)=>a.id===e.value);if(s)n=s.text}let r='<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 0 24 24" width="24px" fill="currentColor"><path d="M0 0h24v24H0V0z" fill="none"/><path d="M7 10l5 5 5-5H7z"/></svg>',i=ir({label:e.label,variant:e.variant||"filled",density:e.density||"default",value:n,name:e.name,disabled:e.disabled,required:e.required,supportingText:e.supportingText,error:e.error,trailingIcon:r,readonly:!0});if(i.element.classList.add(`${e.prefix||"mtrl"}-select`),i.input)i.input.addEventListener("keydown",(s)=>{if(!["Tab","Escape","ArrowDown","ArrowUp","ArrowLeft","ArrowRight","Enter"," ","Home","End"].includes(s.key))s.preventDefault()}),i.input.addEventListener("paste",(s)=>{s.preventDefault()}),i.input.addEventListener("cut",(s)=>{s.preventDefault()});return{...t,element:i.element,textfield:i}},ua=(e)=>e.map((t)=>{if("type"in t&&t.type==="divider")return t;let n={id:t.id.toString(),text:t.text,icon:t.icon,disabled:t.disabled,hasSubmenu:!1,data:t};if(t.hasSubmenu&&Array.isArray(t.submenu))n.hasSubmenu=!0,n.submenu=ua(t.submenu);return n}),vm=(e)=>(t)=>{if(!t.textfield)return console.warn("Cannot add menu: textfield not found"),t;let n={options:e.options||[],selectedOption:null};if(e.value)n.selectedOption=n.options.find((a)=>a.id===e.value);let r=ua(n.options),i=Ft({opener:t.textfield,items:r,position:e.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOnResize:!0,offset:0,container:t.element});i.on("select",(a)=>{if(!a.item||a.item.hasSubmenu)return;let o=a.item.data;if(!o||!("id"in o)||!("text"in o)){console.warn("Invalid menu selection: missing required data properties");return}if(n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id),t.emit)t.emit("change",{select:t,value:o.id,text:o.text,option:o,originalEvent:a.originalEvent,preventDefault:()=>{a.defaultPrevented=!0},defaultPrevented:!1})}),t.textfield.element.addEventListener("keydown",(a)=>{if(t.textfield.input.disabled)return;if((a.key==="Enter"||a.key===" "||a.key==="ArrowDown")&&!i.isOpen()){if(a.preventDefault(),i.open(a,"keyboard"),t.emit)t.emit("open",{select:t,originalEvent:a,preventDefault:()=>{},defaultPrevented:!1})}else if(a.key==="Escape"&&i.isOpen())a.preventDefault(),i.close(a)}),i.on("open",()=>{t.textfield.element.classList.add(`${e.prefix||"mtrl"}-select--open`);let a=e.prefix||"mtrl";if(t.textfield.element.classList.add(`${a}-textfield--focused`),t.textfield.element.classList.contains(`${a}-textfield--filled`))t.textfield.element.classList.add(`${a}-textfield--filled-focused`)}),i.on("close",(a)=>{if(t.textfield.element.classList.remove(`${e.prefix||"mtrl"}-select--open`),setTimeout(()=>{let o=e.prefix||"mtrl";if(document.activeElement===t.textfield.input||t.textfield.element.contains(document.activeElement)){if(t.textfield.element.classList.add(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.add(`${o}-textfield--filled-focused`)}else if(t.textfield.element.classList.remove(`${o}-textfield--focused`),t.textfield.element.classList.contains(`${o}-textfield--filled`))t.textfield.element.classList.remove(`${o}-textfield--filled-focused`)},10),t.emit)t.emit("close",{select:t,originalEvent:a.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let s=()=>{if(!n.selectedOption)return;i.setSelected(n.selectedOption.id)};return i.on("open",()=>{setTimeout(s,50)}),{...t,menu:i,select:{getValue:()=>n.selectedOption?.id||null,setValue:(a)=>{if(a===null||a===void 0||a==="")return n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t;let o=n.options.find((l)=>("id"in l)&&l.id===a);if(o&&"text"in o)n.selectedOption=o,t.textfield.setValue(o.text),i.setSelected(o.id);return t},clear:()=>(n.selectedOption=null,t.textfield.setValue(""),i.setSelected(null),t),getText:()=>n.selectedOption?.text||"",getSelectedOption:()=>n.selectedOption,getOptions:()=>[...n.options],setOptions:(a)=>{n.options=a;let o=ua(a);if(i.setItems(o),n.selectedOption&&!a.find((l)=>("id"in l)&&l.id===n.selectedOption.id))n.selectedOption=null,t.textfield.setValue("");return t},open:(a,o="mouse")=>(i.open(a,o),t),close:(a)=>(i.close(a),t),isOpen:()=>i.isOpen()}}};var Tm=(e)=>(t)=>({...t,element:t.element,textfield:t.textfield,menu:t.menu,getValue:e.select.getValue,setValue(n){return e.select.setValue(n),this},clear(){return e.select.clear(),this},getText:e.select.getText,getSelectedOption:e.select.getSelectedOption,getOptions:e.select.getOptions,setOptions(n){return e.select.setOptions(n),this},open(n="mouse"){if(t.menu&&typeof t.menu.open==="function")t.menu.open(void 0,n);else e.select.open();return this},close(){return e.select.close(),this},isOpen:e.select.isOpen,setDensity(n){if(t.textfield?.setDensity)t.textfield.setDensity(n);return this},getDensity(){if(t.textfield?.getDensity)return t.textfield.getDensity();return"default"},on(n,r){if(e.events?.on)e.events.on(n,r);else if(t.on)t.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);else if(t.off)t.off(n,r);return this},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},setError(n,r){if(t.textfield?.setError)t.textfield.setError(n,r);return this},clearError(){if(t.textfield?.setError)t.textfield.setError(!1);return this},destroy(){e.lifecycle.destroy()}});Q();var Wh={FILLED:"filled",OUTLINED:"outlined"},Kh={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"};var ca={VARIANT:Wh.FILLED,PLACEMENT:Kh.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1};var Yh={options:[],variant:ca.VARIANT,placement:ca.PLACEMENT},Sm=(e={options:[]})=>P(Yh,e,"select"),ym=(e)=>({select:{getValue:e.select?.getValue||(()=>null),setValue:e.select?.setValue||(()=>e),clear:e.select?.clear||(()=>e),getText:e.select?.getText||(()=>""),getSelectedOption:e.select?.getSelectedOption||(()=>null),getOptions:e.select?.getOptions||(()=>[]),setOptions:e.select?.setOptions||(()=>e),open:e.select?.open||(()=>e),close:e.select?.close||(()=>e),isOpen:e.select?.isOpen||(()=>!1)},events:{on:e.on||(()=>e),off:e.off||(()=>e)},disabled:{enable:()=>{if(e.textfield?.enable)e.textfield.enable();return e},disable:()=>{if(e.textfield?.disable)e.textfield.disable();return e}},lifecycle:{destroy:()=>{if(e.textfield?.destroy)e.textfield.destroy();if(e.menu?.destroy)e.menu.destroy();if(e.lifecycle?.destroy)e.lifecycle.destroy()}}});var Xh=(e)=>{try{let t=Sm(e),n=O(M,B(),bm(t),vm(t),k(),(r)=>Tm(ym(r))(r))(t);if(e.on){if(e.on.change)n.on("change",e.on.change);if(e.on.open)n.on("open",e.on.open);if(e.on.close)n.on("close",e.on.close)}return n}catch(t){throw console.error("Select creation error:",t),Error(`Failed to create select: ${t.message}`)}},ma=Xh;Z();J();Q();var qh={SINGLE:"single",MULTI:"multi"},jh={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"};var ai={MODE:qh.SINGLE,DENSITY:jh.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},fa='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="currentColor"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>';var Zh={mode:ai.MODE,ripple:ai.RIPPLE,density:ai.DENSITY},xm=(e={})=>P(Zh,e,"segmented-button"),Im=(e)=>{let t=e.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":e.mode||"single","data-density":t},className:[e.class,e.disabled?`${e.prefix}-segmented-button--disabled`:null,t!=="default"?`${e.prefix}-segmented-button--${t}`:null],interactive:!0}},pa=(e)=>{switch(e){case"compact":return{"--segment-padding":"4px 8px","--segment-height":"28px","--segment-font-size":"0.8125rem"};case"comfortable":return{"--segment-padding":"6px 12px","--segment-height":"32px","--segment-font-size":"0.875rem"};case"default":default:return{"--segment-padding":"8px 16px","--segment-height":"36px","--segment-font-size":"0.875rem"}}};pt();var Qh=(e,t)=>{let n=document.createElement("span");return n.className=`${e}-segment-checkmark`,n.innerHTML=t||fa,n},oi=(e,t,n,r=!1,i={ripple:!0,rippleConfig:{}})=>{let s=r||e.disabled,a=e.icon,o=Boolean(e.text),l=Boolean(a),d=l&&!o,u=o&&!l,m=e.checkmarkIcon||fa,p=Te({text:e.text,icon:d?a:l&&e.selected?m:a,value:e.value||e.text||"",disabled:s,ripple:i.ripple,rippleConfig:i.rippleConfig,class:e.class,ariaLabel:e.text||e.value});p.element.classList.add(`${n}-segmented-button-segment`);let g=null;if(u){g=Qh(n,m);let h=p.element.querySelector(`.${n}-button-text`);if(h)h.parentNode?.insertBefore(g,h);else p.element.prepend(g)}if(e.selected)p.element.classList.add(`${n}-segment--selected`),p.element.setAttribute("aria-pressed","true");else p.element.setAttribute("aria-pressed","false");t.appendChild(p.element);let c=(h)=>{if(p.element.classList.toggle(`${n}-segment--selected`,h),p.element.setAttribute("aria-pressed",h?"true":"false"),d);else if(l&&o)if(h)p.setIcon(m);else p.setIcon(a)},f=e.selected||!1;return{element:p.element,value:e.value||e.text||"",isSelected(){return f},setSelected(h){f=h,c(h)},isDisabled(){return p.disabled?.isDisabled?.()||!1},setDisabled(h){if(h)p.disable();else p.enable()},destroy(){if(g&&g.parentNode)g.parentNode.removeChild(g);p.destroy()}}};var Jh=(e={})=>{let t=xm(e),n=t.mode||"single",r=t.density||"default",i=Me();try{let s=O(M,B(),R(Im(t)),k())(t),a=pa(r);Object.entries(a).forEach(([c,f])=>{s.element.style.setProperty(c,f)});let o=[];if(t.segments&&t.segments.length)t.segments.forEach((c)=>{let f=oi(c,s.element,t.prefix,t.disabled,{ripple:t.ripple,rippleConfig:t.rippleConfig});o.push(f)});if(n==="single"&&!o.some((c)=>c.isSelected())){let c=o.find((f)=>!f.isDisabled());if(c)c.setSelected(!0)}let l=(c)=>{let f=c.currentTarget,h=o.find((b)=>b.element===f);if(!h||h.isDisabled())return;let C=u();if(n==="single")o.forEach((b)=>{b.setSelected(b===h)});else h.setSelected(!h.isSelected());let T=u();if(C.length!==T.length||C.some((b)=>!T.includes(b))||T.some((b)=>!C.includes(b)))i.emit("change",{selected:d(),value:T,oldValue:C})};o.forEach((c)=>{c.element.addEventListener("click",l)});let d=()=>o.filter((c)=>c.isSelected()),u=()=>d().map((c)=>c.value),m=(c)=>o.find((f)=>f.value===c),p=(c)=>{if(["default","comfortable","compact"].forEach((h)=>{if(h!=="default")s.element.classList.remove(`${t.prefix}-segmented-button--${h}`)}),c!=="default")s.element.classList.add(`${t.prefix}-segmented-button--${c}`);s.element.setAttribute("data-density",c);let f=pa(c);Object.entries(f).forEach(([h,C])=>{s.element.style.setProperty(h,C)})};return{element:s.element,segments:o,getSelected:d,getValue(){return u()},select(c){let f=m(c);if(f&&!f.isDisabled()){let h=u();if(n==="single")o.forEach((T)=>T.setSelected(T===f));else f.setSelected(!0);let C=u();if(h.join(",")!==C.join(","))i.emit("change",{selected:d(),value:C,oldValue:h})}return this},deselect(c){let f=m(c);if(f&&!f.isDisabled())if(n==="single"){if(d().length>1||!f.isSelected()){let C=u();f.setSelected(!1);let T=u();if(C.join(",")!==T.join(","))i.emit("change",{selected:d(),value:T,oldValue:C})}}else{let h=u();f.setSelected(!1);let C=u();if(h.join(",")!==C.join(","))i.emit("change",{selected:d(),value:C,oldValue:h})}return this},enable(){return s.element.classList.remove(`${t.prefix}-segmented-button--disabled`),o.forEach((c)=>{if(!t.segments?.find((f)=>f.value===c.value)?.disabled)c.setDisabled(!1)}),this},disable(){return s.element.classList.add(`${t.prefix}-segmented-button--disabled`),o.forEach((c)=>{c.setDisabled(!0)}),this},enableSegment(c){let f=m(c);if(f)f.setDisabled(!1);return this},disableSegment(c){let f=m(c);if(f)f.setDisabled(!0);return this},setDensity(c){return p(c),this},getDensity(){return s.element.getAttribute("data-density")||"default"},on(c,f){return i.on(c,f),this},off(c,f){return i.off(c,f),this},destroy(){o.forEach((c)=>{c.element.removeEventListener("click",l),c.destroy()}),i.clear(),s.lifecycle.destroy()}}}catch(s){throw console.error("Segmented Button creation error:",s),Error(`Failed to create segmented button: ${s.message}`)}},li=Jh;ne();Z();J();var qe={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},Sn={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var ga=(e)=>(t)=>{let{position:n=qe.BOTTOM}=e,r=`${t.getClass("sheet")}--${n.toLowerCase()}`;return t.element.classList.add(r),{...t,position:{setPosition(i){t.element.classList.remove(r);let s=`${t.getClass("sheet")}--${i.toLowerCase()}`;t.element.classList.add(s)},getPosition(){return n}}}};var ha=(e)=>(t)=>{let{content:n=""}=e,r=document.createElement("div");return r.className=`${t.getClass("sheet")}-content`,r.innerHTML=n,t.container=document.createElement("div"),t.container.className=`${t.getClass("sheet")}-container`,t.container.appendChild(r),t.element.appendChild(t.container),{...t,content:{setContent(i){return r.innerHTML=i,this},getContent(){return r.innerHTML},getElement(){return r}}}};var Ca=(e)=>(t)=>{let{title:n=""}=e,r=null;if(n||e.dragHandle){if(r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,n)r.textContent=n;if(t.container.insertBefore(r,t.container.firstChild),e.dragHandle){let i=document.createElement("div");i.className=`${t.getClass("sheet")}-handle`,t.container.insertBefore(i,t.container.firstChild),t.dragHandle={element:i,setVisible(s){i.style.display=s?"block":"none"}}}}return{...t,title:{setTitle(i){if(!r&&i)r=document.createElement("div"),r.className=`${t.getClass("sheet")}-title`,t.container.insertBefore(r,t.content.getElement());if(r)r.textContent=i;return this},getTitle(){return r?r.textContent||"":""},getElement(){return r}}}};var Ea=(e)=>(t)=>{let{open:n=!1,dismissible:r=!0}=e,i=n,s=document.createElement("div");if(s.className=`${t.getClass("sheet")}-scrim`,t.element.parentNode?.insertBefore(s,t.element.nextSibling),r)t.element.classList.add(`${t.getClass("sheet")}--dismissible`),s.addEventListener("click",()=>{if(r)o()});if(n)t.element.classList.add(`${t.getClass("sheet")}--open`);if(e.elevation)t.element.classList.add(`${t.getClass("sheet")}--elevation-${e.elevation}`);document.addEventListener("keydown",(l)=>{if(l.key==="Escape"&&i&&r)o()});function a(){if(!i){if(i=!0,t.element.classList.add(`${t.getClass("sheet")}--open`),t.events.emit(Sn.OPEN),e.onOpen)e.onOpen()}}function o(){if(i){if(i=!1,t.element.classList.remove(`${t.getClass("sheet")}--open`),t.events.emit(Sn.CLOSE),e.onClose)e.onClose()}}return{...t,state:{open:a,close:o,isOpen(){return i},setDismissible(l){if(l)t.element.classList.add(`${t.getClass("sheet")}--dismissible`);else t.element.classList.remove(`${t.getClass("sheet")}--dismissible`)}},initialize(){if(s.parentNode!==t.element.parentNode)t.element.parentNode?.insertBefore(s,t.element.nextSibling)}}};var ba=(e)=>(t)=>{if(e.enableGestures===!1)return t;let n=e.position||qe.BOTTOM,r=0,i=0,s=!1,a=t.dragHandle?.element||t.element,o=(p)=>{if(!t.state.isOpen())return;if(s=!0,document.body.style.userSelect="none",p.type==="touchstart")r=p.touches[0].clientY,i=p.touches[0].clientX;else r=p.clientY,i=p.clientX,document.addEventListener("mousemove",l),document.addEventListener("mouseup",d);t.events.emit(Sn.DRAG_START)},l=(p)=>{if(!s)return;let g,c;if(p.type==="touchmove")g=p.touches[0].clientY,c=p.touches[0].clientX;else g=p.clientY,c=p.clientX;let f=0;switch(n){case qe.BOTTOM:if(f=g-r,f<0)f=0;t.element.style.transform=`translateY(${f}px)`;break;case qe.TOP:if(f=r-g,f<0)f=0;t.element.style.transform=`translateY(-${f}px)`;break;case qe.LEFT:if(f=i-c,f<0)f=0;t.element.style.transform=`translateX(-${f}px)`;break;case qe.RIGHT:if(f=c-i,f<0)f=0;t.element.style.transform=`translateX(${f}px)`;break}let h=n===qe.BOTTOM||n===qe.TOP?t.element.offsetHeight:t.element.offsetWidth,C=Math.min(f/h,1),T=t.element.nextElementSibling;if(T&&T.classList.contains(`${t.getClass("sheet")}-scrim`))T.style.opacity=`${0.32*(1-C)}`},d=()=>{if(!s)return;s=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d);let p=n===qe.BOTTOM||n===qe.TOP?t.element.offsetHeight:t.element.offsetWidth,g=0;if(t.element.style.transform){let c=t.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);g=c?parseFloat(c[1]):0}if(g>p*0.3)t.state.close();else{t.element.style.transform="";let c=t.element.nextElementSibling;if(c&&c.classList.contains(`${t.getClass("sheet")}-scrim`))c.style.opacity=""}t.events.emit(Sn.DRAG_END)};a.addEventListener("touchstart",o,{passive:!0}),a.addEventListener("touchmove",l,{passive:!0}),a.addEventListener("touchend",d),a.addEventListener("mousedown",o);let u=()=>{a.removeEventListener("touchstart",o),a.removeEventListener("touchmove",l),a.removeEventListener("touchend",d),a.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",d)},m=t.lifecycle?.destroy||(()=>{});return t.lifecycle={...t.lifecycle,destroy:()=>{u(),m()}},t};var Am=({state:e,lifecycle:t})=>(n)=>({...n,element:n.element,container:n.container,open(){return e.open(),this},close(){return e.close(),this},setContent(r){return n.content.setContent(r),this},getContent(){return n.content.getContent()},setTitle(r){return n.title.setTitle(r),this},getTitle(){return n.title.getTitle()},setDragHandle(r){if(n.dragHandle)n.dragHandle.setVisible(r);return this},setMaxHeight(r){return n.container.style.maxHeight=r,this},destroy(){t.destroy()},initialize(){if(n.initialize)n.initialize();return this}});Q();var di={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},va={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"};var eC={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},yn={VARIANT:di.STANDARD,POSITION:va.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:eC.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0};var tC={variant:di.STANDARD,position:va.BOTTOM,open:yn.OPEN,dismissible:yn.DISMISSIBLE,dragHandle:yn.DRAG_HANDLE,elevation:yn.ELEVATION,enableGestures:yn.ENABLE_GESTURES},Nm=(e={})=>P(tC,e,"sheet"),wm=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":e.variant===di.MODAL?"true":"false"},className:e.class,forwardEvents:{click:!0,keydown:!0}}),Dm=(e)=>({state:{open:()=>e.state.open(),close:()=>e.state.close()},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var nC=(e={})=>{let t=Nm(e);try{let n=O(M,B(),R(wm(t)),se(t),ga(t),ha(t),Ca(t),Ea(t),ba(t),k(),(r)=>Am(Dm(r))(r))(t);return n.initialize(),n}catch(n){throw console.error("Sheet creation error:",n),Error(`Failed to create sheet: ${n.message}`)}},Ta=nC;Z();J();Qe();var Sa=(e)=>(t)=>{if(!e.range||!e.secondValue||!t.schema)return t;try{let n=e.min||0,r=e.max||100,i=e.secondValue,s=(i-n)/(r-n)*100,a=e.valueFormatter||((p)=>p.toString()),o=e.disabled===!0,l=t.getClass,d=JSON.parse(JSON.stringify(t.schema)),u=d.element.options.className||[];if(Array.isArray(u))u.push(l("slider--range"));else d.element.options.className=`${u} ${l("slider--range")}`.trim();let m=d.element.children.container.children;return m.secondHandle={name:"secondHandle",creator:H,options:{tag:"div",className:l("slider-handle"),attributes:{role:"slider","aria-valuemin":String(n),"aria-valuemax":String(r),"aria-valuenow":String(i),"aria-orientation":"horizontal",tabindex:o?"-1":"0","aria-disabled":o?"true":"false","data-value":String(i),"data-handle-index":"1"},style:{left:`${s}%`}}},m.secondValueBubble={name:"secondValueBubble",creator:H,options:{tag:"div",className:l("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:a(i),style:{left:`${s}%`}}},{...t,schema:d}}catch(n){return console.warn("Error enhancing structure with range functionality:",n),t}};var Yt={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},Ve={XS:16,S:24,M:40,L:56,XL:96},ce={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:44,HANDLE_HEIGHT_OFFSET:12,MIN_HEIGHT:48,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:6,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},Ie={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},Mm={START:"start",END:"end"},Ne={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Yt.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:Mm.START,LABEL_POSITION:Mm.START};var ya=(e)=>(t)=>{if(e.disabled===!0)setTimeout(()=>{r()},0);function r(){if(t.element.classList.add(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","true"),t.structure?.handle)t.structure.handle.tabIndex=-1,t.structure.handle.setAttribute("aria-disabled","true");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=-1,t.structure.secondHandle.setAttribute("aria-disabled","true");if(t.drawCanvas)t.drawCanvas()}function i(){if(t.element.classList.remove(`${t.getClass("slider")}--disabled`),t.element.setAttribute("aria-disabled","false"),t.structure?.handle)t.structure.handle.tabIndex=0,t.structure.handle.setAttribute("aria-disabled","false");if(e.range&&t.structure?.secondHandle)t.structure.secondHandle.tabIndex=0,t.structure.secondHandle.setAttribute("aria-disabled","false");if(t.drawCanvas)t.drawCanvas()}function s(){return Object.values(Yt).find((o)=>t.element.classList.contains(`${t.getClass("slider")}--${o}`))||Yt.PRIMARY}function a(){return Object.keys(Ve).find((d)=>t.element.classList.contains(`${t.getClass("slider")}--${d.toLowerCase()}`))||"XS"}return{...t,disabled:{enable(){return i(),this},disable(){return r(),this},isDisabled(){return t.element.classList.contains(`${t.getClass("slider")}--disabled`)}},appearance:{setColor(o){if(Object.values(Yt).forEach((l)=>{t.element.classList.remove(`${t.getClass("slider")}--${l}`)}),o!==Yt.PRIMARY)t.element.classList.add(`${t.getClass("slider")}--${o}`);return this},getColor(){return s()},setSize(o){Object.keys(Ve).forEach((u)=>{t.element.classList.remove(`${t.getClass("slider")}--${u.toLowerCase()}`)});let d;if(typeof o==="string"&&o in Ve)d=o;else if(typeof o==="number"){let u=Object.entries(Ve).find(([,m])=>m===o);d=u?u[0]:"XS"}else d="XS";return t.element.classList.add(`${t.getClass("slider")}--${d.toLowerCase()}`),this},getSize(){return a()},showTicks(o){if(e.ticks=o,t.slider)t.slider.regenerateTicks();return this},showCurrentValue(o){return e.showValue=o,this}}}};var Om=(e,t,n,r)=>{let i=t.component?.components||{},s=t.component||{},a=s.container||i.container||null,o=s.handle||i.handle||null,l=s.valueBubble||i.valueBubble||null,d=s.secondHandle||i.secondHandle||null,u=s.secondValueBubble||i.secondValueBubble||null,{getValueFromPosition:m=()=>0,roundToStep:p=(w)=>w,clamp:g=(w)=>w,showValueBubble:c=()=>{},render:f=()=>{}}=n,{triggerEvent:h=()=>({defaultPrevented:!1})}=r,C=!1,T=0,b=3,E=null,v=()=>{if(t.valueHideTimer)clearTimeout(t.valueHideTimer),t.valueHideTimer=null},S=()=>{if(v(),l)c(l,!1);if(u)c(u,!1)},y=(w)=>{if(S(),w&&e.showValue)c(w,!0)},L=(w,K=0)=>{if(v(),!w||!e.showValue)return;if(K>0)t.valueHideTimer=setTimeout(()=>{c(w,!1)},K);else c(w,!1)},I=()=>{if(o)o.classList.remove(`${t.component.getClass("slider-handle")}--focused`);if(d)d.classList.remove(`${t.component.getClass("slider-handle")}--focused`);try{let w=t.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${w}`).forEach((K)=>{K.classList.remove(w)}),document.activeElement?.classList.contains(t.component.getClass("slider-handle")))document.activeElement.blur()}catch(w){console.warn("Error clearing keyboard focus:",w)}},x=(w,K=!1)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled())return;if(w.type==="mousedown")w.preventDefault();w.stopPropagation(),S(),I(),T=w.type.includes("touch")?w.touches[0].clientX:w.clientX,t.dragging=!1,t.pressed=!0,C=!1,t.activeHandle=K?"second":"first",t.activeBubble=K?u:l,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",D),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",D),f(),h(Ie.START,w)},A=(w)=>{if(!t.component||t.component.disabled&&t.component.disabled.isDisabled()||!a)return;if(w.type==="mousedown")w.preventDefault();S(),I();let K=!1;try{let ee=w.type.includes("touch")?w.touches[0].clientX:w.clientX,_=m(ee);if(e.snapToSteps&&t.step>0)_=p(_);if(_=g(_,t.min,t.max),e.range&&t.secondValue!==null){let re=Math.abs(_-t.value);K=Math.abs(_-t.secondValue)<re,K?t.secondValue=_:t.value=_}else if(e.centered&&t.component.slider&&t.component.slider.setValue)t.component.slider.setValue(_,!1);else t.value=_;f(),h(Ie.INPUT,w)}catch(ee){console.warn("Error handling track click:",ee)}if(t.activeHandle=K?"second":"first",t.activeBubble=K?u:l,T=w.type.includes("touch")?w.touches[0].clientX:w.clientX,e.centered&&!e.range)y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",D),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",D),t.pressed=!1,h(Ie.START,w);else t.dragging=!1,t.pressed=!1,C=!1,y(t.activeBubble),document.addEventListener("mousemove",N),document.addEventListener("mouseup",D),document.addEventListener("touchmove",N,{passive:!1}),document.addEventListener("touchend",D),f(),h(Ie.START,w)},N=(w)=>{if(!t.activeHandle||!a)return;w.preventDefault();try{let K=w.type.includes("touch")?w.touches[0].clientX:w.clientX;if(!C&&Math.abs(K-T)>=b)C=!0,t.dragging=!0,t.component.element.classList.add(`${t.component.getClass("slider")}--dragging`);let ee=m(K);if(e.snapToSteps&&t.step>0)ee=p(ee);ee=g(ee,t.min,t.max);let _=t.activeHandle==="second";if(e.range&&t.secondValue!==null)if(_)if(ee>=t.value)t.secondValue=ee;else L(t.activeBubble,0),t.secondValue=t.value,t.value=ee,t.activeHandle="first",t.activeBubble=l,y(t.activeBubble);else if(ee<=t.secondValue)t.value=ee;else L(t.activeBubble,0),t.value=t.secondValue,t.secondValue=ee,t.activeHandle="second",t.activeBubble=u,y(t.activeBubble);else{if(e.centered)t.previousValue=t.value;t.value=ee}f(),h(Ie.INPUT,w)}catch(K){console.warn("Error during slider drag:",K)}},D=(w)=>{if(!t.activeHandle)return;w.preventDefault(),t.dragging=!1,t.pressed=!1,C=!1,t.component.element.classList.remove(`${t.component.getClass("slider")}--dragging`),L(t.activeBubble,1000),document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",D),t.activeHandle=null,f(),h(Ie.CHANGE,w),h(Ie.END,w)},G=(w,K=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let ee=t.step||1,_=K?t.secondValue:t.value,re=w.shiftKey?ee*10:ee;if(w.key==="Tab")return;let ue=!1;switch(w.key){case"ArrowRight":case"ArrowUp":w.preventDefault(),_=Math.min(_+re,t.max),ue=!0;break;case"ArrowLeft":case"ArrowDown":w.preventDefault(),_=Math.max(_-re,t.min),ue=!0;break;case"Home":w.preventDefault(),_=t.min,ue=!0;break;case"End":w.preventDefault(),_=t.max,ue=!0;break;case"PageUp":w.preventDefault(),_=Math.min(_+ee*10,t.max),ue=!0;break;case"PageDown":w.preventDefault(),_=Math.max(_-ee*10,t.min),ue=!0;break;default:return}if(!ue)return;if(t.activeBubble=K?u:l,y(t.activeBubble),K)t.secondValue=_;else{if(e.centered)t.previousValue=t.value;t.value=_}f(),h(Ie.INPUT,w),h(Ie.CHANGE,w)},U=(w,K=!1)=>{if(t.component.disabled&&t.component.disabled.isDisabled())return;let ee=K?d:o;if(E&&E!==ee)S();E=ee,ee.classList.add(`${t.component.getClass("slider-handle")}--focused`),y(K?u:l),t.activeBubble=K?u:l,h(Ie.FOCUS,w)},j=(w,K=!1)=>{(K?d:o).classList.remove(`${t.component.getClass("slider-handle")}--focused`);let _=w.relatedTarget;if(!_||_!==(K?o:d))L(K?u:l,200);h(Ie.BLUR,w)};return{handleHandleMouseDown:x,handleTrackMouseDown:A,handleMouseMove:N,handleMouseUp:D,handleKeyDown:G,handleFocus:U,handleBlur:j,setupEventListeners:()=>{if(!t.component||!o){console.warn("Cannot set up event listeners: missing component or handle");return}if(a.addEventListener("mousedown",A),a.addEventListener("touchstart",A,{passive:!0}),o.addEventListener("mousedown",(w)=>x(w,!1)),o.addEventListener("touchstart",(w)=>x(w,!1),{passive:!0}),o.addEventListener("keydown",(w)=>G(w,!1)),o.addEventListener("focus",(w)=>U(w,!1)),o.addEventListener("blur",(w)=>j(w,!1)),e.range&&d)d.addEventListener("mousedown",(w)=>x(w,!0)),d.addEventListener("touchstart",(w)=>x(w,!0),{passive:!0}),d.addEventListener("keydown",(w)=>G(w,!0)),d.addEventListener("focus",(w)=>U(w,!0)),d.addEventListener("blur",(w)=>j(w,!0))},cleanupEventListeners:()=>{if(!t.component)return;if(a)a.removeEventListener("mousedown",A),a.removeEventListener("touchstart",A);if(o)o.removeEventListener("mousedown",(w)=>x(w,!1)),o.removeEventListener("touchstart",(w)=>x(w,!1)),o.removeEventListener("keydown",(w)=>G(w,!1)),o.removeEventListener("focus",(w)=>U(w,!1)),o.removeEventListener("blur",(w)=>j(w,!1));if(e.range&&d)d.removeEventListener("mousedown",(w)=>x(w,!0)),d.removeEventListener("touchstart",(w)=>x(w,!0)),d.removeEventListener("keydown",(w)=>G(w,!0)),d.removeEventListener("focus",(w)=>U(w,!0)),d.removeEventListener("blur",(w)=>j(w,!0));document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",N),document.removeEventListener("touchend",D)},showActiveBubble:y,hideActiveBubble:L,hideAllBubbles:S,clearKeyboardFocus:I}};var xa=(e)=>(t)=>{if(!t.element)return console.warn("Cannot initialize slider controller: missing element"),t;let n={component:t,value:e.value!==void 0?e.value:0,secondValue:e.secondValue!==void 0?e.secondValue:null,min:e.min!==void 0?e.min:0,max:e.max!==void 0?e.max:100,step:e.step!==void 0?e.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},r={triggerEvent(E,v=null){let S={slider:n.component,value:n.value,secondValue:n.secondValue,originalEvent:v,preventDefault:()=>{S.defaultPrevented=!0},defaultPrevented:!1};return n.component.emit(E,S),S}},i=()=>{if(!n.component)return{};let E=n.component.components||{},v=n.component;return{container:v.container||E.container,handle:v.handle||E.handle,valueBubble:v.valueBubble||E.valueBubble,secondHandle:v.secondHandle||E.secondHandle,secondValueBubble:v.secondValueBubble||E.secondValueBubble,...E}},s=(E)=>{let v=n.max-n.min;return v===0?0:(E-n.min)/v*100},a=()=>{let E=i(),{handle:v,container:S}=E;if(!v||!S)return null;try{let y=v.getBoundingClientRect(),L=S.getBoundingClientRect(),I=y.width||ce.HANDLE_SIZE,x=L.width,A=ce.EDGE_PADDING/x*100,D=(n.activeHandle?6:8)/x*100;return{handleSize:I,trackSize:x,edgeConstraint:A,paddingPercent:D}}catch(y){return console.warn("Error calculating track dimensions:",y),{handleSize:ce.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},o=(E,v=200)=>{let S=ce.EDGE_PADDING/v*100,y=S,L=100-S,I=L-y;if(E<=0)return y;if(E>=100)return L;return y+E/100*I},l=(E)=>{let v=i(),{handle:S,container:y}=v;if(!S||!y)return n.min;try{let L=y.getBoundingClientRect(),I=n.max-n.min,x=L.left+ce.EDGE_PADDING,A=L.right-ce.EDGE_PADDING,N=A-x,G=(Math.max(x,Math.min(A,E))-x)/N;return n.min+G*I}catch(L){return console.warn("Error calculating value from position:",L),n.min}},d=(E)=>{let v=n.step;if(!v||v<=0)return E;let S=Math.round((E-n.min)/v);return n.min+S*v},u=(E,v,S)=>Math.min(Math.max(E,v),S),m=()=>{let E=i(),{handle:v,container:S,valueBubble:y,secondHandle:L,secondValueBubble:I}=E;if(!v||!S)return;let x=a();if(!x)return;let{trackSize:A}=x,N=s(n.value),D=o(N,A);if(v.style.left=`${D}%`,v.style.transform="translate(-50%, -50%)",y)y.style.left=`${D}%`,y.style.transform="translateX(-50%)";if(e.range&&L&&n.secondValue!==null){let G=s(n.secondValue),U=o(G,A);if(L.style.left=`${U}%`,L.style.transform="translate(-50%, -50%)",I)I.style.left=`${U}%`,I.style.transform="translateX(-50%)"}if(v)v.setAttribute("aria-valuenow",String(n.value))},p=()=>{let E=i(),{valueBubble:v,secondValueBubble:S}=E;if(!v)return;let y=e.valueFormatter||((L)=>L.toString());if(v.textContent=y(n.value),e.range&&S&&n.secondValue!==null)S.textContent=y(n.secondValue)},g=(E,v)=>{if(!E||!e.showValue)return;let S=n.component.getClass("slider-value");E.classList[v?"add":"remove"](`${S}--visible`)},c=()=>{},f=()=>{},h=()=>{try{if(m(),p(),t.drawCanvas)t.drawCanvas(n)}catch(E){console.warn("Error rendering UI:",E)}},T=Om(e,n,{getPercentage:s,getValueFromPosition:l,roundToStep:d,clamp:u,showValueBubble:g,updateUi:h,render:h},r),b=()=>{try{let E=i();if(!E.handle){console.warn("Cannot initialize slider controller: missing required handle component");return}let{handle:v,secondHandle:S}=E;if(v){if(v.setAttribute("aria-valuemin",String(n.min)),v.setAttribute("aria-valuemax",String(n.max)),v.setAttribute("aria-valuenow",String(n.value)),e.range&&S&&n.secondValue!==null)S.setAttribute("aria-valuemin",String(n.min)),S.setAttribute("aria-valuemax",String(n.max)),S.setAttribute("aria-valuenow",String(n.secondValue))}T.setupEventListeners(),h()}catch(E){console.error("Error initializing slider controller:",E)}};if(t.lifecycle){let E=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{T.cleanupEventListeners(),E()}}return setTimeout(()=>{b()},0),{...t,slider:{setValue(E,v=!0){let S=u(E,n.min,n.max);if(n.value=S,h(),v)r.triggerEvent(Ie.CHANGE);return this},getValue(){return n.value},setSecondValue(E,v=!0){if(!e.range)return this;let S=u(E,n.min,n.max);if(n.secondValue=S,h(),v)r.triggerEvent(Ie.CHANGE);return this},getSecondValue(){return e.range?n.secondValue:null},setMin(E){n.min=E;let v=i();if(v.handle)v.handle.setAttribute("aria-valuemin",String(E));if(e.range&&v.secondHandle)v.secondHandle.setAttribute("aria-valuemin",String(E));if(n.value<E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue<E)n.secondValue=E;if(e.ticks||e.tickLabels)c();return h(),this},getMin(){return n.min},setMax(E){n.max=E;let v=i();if(v.handle)v.handle.setAttribute("aria-valuemax",String(E));if(e.range&&v.secondHandle)v.secondHandle.setAttribute("aria-valuemax",String(E));if(n.value>E)n.value=E;if(e.range&&n.secondValue!==null&&n.secondValue>E)n.secondValue=E;if(e.ticks||e.tickLabels)c();return h(),this},getMax(){return n.max},setStep(E){if(n.step=E,t.element.classList[E>0?"add":"remove"](`${t.getClass("slider")}--discrete`),e.ticks||e.tickLabels)c(),f();return this},getStep(){return n.step},regenerateTicks(){return h(),this},updateUi(){return h(),this}}}};Wn();wr();var rC=(e)=>e?.disabled?.isDisabled?.()||e?.element?.classList?.contains?.(`${e?.getClass?.("slider")}--disabled`)||!1,La=(e,t,n="track")=>{let r=rC(t),i=e.color||"primary";if(r){let d=ke("sys-color-on-surface",{fallback:"#000000"});return{primary:zn(d,0.38),secondary:zn(d,0.12)}}let s=t?.element&&typeof getComputedStyle==="function"?getComputedStyle(t.element):void 0,a=s?.getPropertyValue("--mtrl-slider-color").trim(),o=s?.getPropertyValue("--mtrl-slider-on-color").trim();if(n==="tick")return{primary:o||ke(`sys-color-on-${i}`,{fallback:"#ffffff"}),secondary:a||ke(`sys-color-${i}`,{fallback:"#1976d2"})};let l=a||ke(`sys-color-${i}`,{fallback:"#1976d2"});return{primary:l,secondary:zn(l,0.24)}},ui=(e,t,n)=>(e-t)/(n-t)*100,Fe=(e,t,n,r,i,s,a)=>{if(r>0)Fi(e,t,n,r,i,s,s,a)},sr=(e)=>{if(typeof e==="number")return Math.max(e,Ve.XS);if(typeof e==="string"&&e in Ve)return Ve[e];return Ve.XS},Aa=(e)=>{let t=sr(e);if(t<=Ve.S)return ce.SMALL_HANDLE_HEIGHT;return t+ce.HANDLE_HEIGHT_OFFSET},iC=(e)=>{let t=sr(e);if(t<=Ve.S)return ce.SMALL_TRACK_EXTERNAL_RADIUS;return t*ce.LARGE_TRACK_RADIUS_RATIO},Rm=(e,t,n)=>{let r=sr(n?.size),i=Aa(n?.size),s=e.parentElement;if(!s)return;let a=s.getBoundingClientRect().width||s.offsetWidth||200,o=Math.max(i,r,ce.MIN_HEIGHT);s.style.height=`${o}px`,jn(t,a,o)},_m=(e,t)=>{let n=e.parentElement;if(!n)throw Error("Canvas must have a parent element");let r=sr(t?.size),i=Aa(t?.size),s=n.getBoundingClientRect().width||n.offsetWidth||200,a=Math.max(i,r,ce.MIN_HEIGHT);return n.style.height=`${a}px`,qn(e,s,a)},ci=(e,t)=>{let n=ce.EDGE_PADDING/t*100,r=n,i=100-n,s=i-r;if(e<=0)return r;if(e>=100)return i;return r+e/100*s},sC=(e,t,n,r,i,s)=>{let a=n/2,o=sr(r.size),l=iC(r.size),d=ce.TRACK_RADIUS,u=Vi(e,0,a-o/2,t,o,l),{primary:m,secondary:p}=La(r,s),g=ui(i.value,i.min,i.max),c=ci(g,t),f=i.pressed?ce.HANDLE_GAP_PRESSED_REDUCTION:0,h=ce.HANDLE_GAP-f,T=ce.CENTER_GAP/2/t*100,b=h/t*100;if(r.centered){let E=ui(0,i.min,i.max),v=ci(E,t),S=Math.abs(c-v)<b,y=i.value>=0;if(S){let L=(c-b)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(c+b)/100*t,x=t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,p)}else if(y){let L=(v-T)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(v+T)/100*t,x=(c-b)/100*t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,m);let A=(c+b)/100*t,N=t-A;if(N>0)Fe(e,A,a-o/2,N,o,d,p)}else{let L=(c-b)/100*t;if(L>0)Fe(e,0,a-o/2,L,o,d,p);let I=(c+b)/100*t,x=(v-T)/100*t-I;if(x>0)Fe(e,I,a-o/2,x,o,d,m);let A=(v+T)/100*t,N=t-A;if(N>0)Fe(e,A,a-o/2,N,o,d,p)}}else if(r.range&&i.secondValue!==null){let E=ui(i.secondValue,i.min,i.max),v=ci(E,t),S=Math.min(c,v),y=Math.max(c,v),L=c<=v,I=i.pressed&&i.activeHandle==="first"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,x=i.pressed&&i.activeHandle==="second"?ce.HANDLE_GAP_PRESSED_REDUCTION:0,A=ce.HANDLE_GAP-I,N=ce.HANDLE_GAP-x,D=L?A/t*100:N/t*100,G=L?N/t*100:A/t*100,U=(S-D)/100*t;if(U>0)Fe(e,0,a-o/2,U,o,d,p);let j=(S+D)/100*t,pe=(y-G)/100*t-j;if(pe>o)Fe(e,j,a-o/2,pe,o,d,m);let ge=(y+G)/100*t,w=t-ge;if(w>0)Fe(e,ge,a-o/2,w,o,d,p)}else{let E=(c-b)/100*t;if(E>0)Fe(e,0,a-o/2,E,o,d,m);let v=(c+b)/100*t,S=t-v;if(S>0)Fe(e,v,a-o/2,S,o,d,p)}u()},aC=(e,t,n,r,i,s)=>{if(!r.ticks)return;let a=ce.TICK_SIZE,o=n/2,{primary:l,secondary:d}=La(r,s,"tick"),u=Math.floor((i.max-i.min)/i.step);for(let m=0;m<=u;m++){let p=i.min+m*i.step;if(p>i.max)continue;let g=ui(p,i.min,i.max),f=ci(g,t)/100*t,h=Math.abs(p-i.value)<i.step*0.1,C=r.range&&i.secondValue!==null&&Math.abs(p-i.secondValue)<i.step*0.1;if(h||C)continue;let T=!1;if(r.centered)T=i.value>=0?p>=0&&p<=i.value:p>=i.value&&p<=0;else if(r.range&&i.secondValue!==null){let b=Math.min(i.value,i.secondValue),E=Math.max(i.value,i.secondValue);T=p>=b&&p<=E}else T=p<=i.value;e.fillStyle=T?l:d,e.globalAlpha=T?1:0.5,e.beginPath(),e.arc(f,o,a/2,0,Math.PI*2),e.fill()}e.globalAlpha=1},oC=(e,t,n,r,i)=>{if(r.ticks)return;let s=ce.DOT_SIZE,a=n/2,o=ce.EDGE_PADDING,{primary:l}=La(r,i,"dot");e.fillStyle=l,e.beginPath(),e.arc(t-o,a,s/2,0,Math.PI*2),e.fill()},Ia=(e,t,n,r)=>{let{ctx:i,width:s,height:a}=e;if(s===0||a===0)return;Ui(i,s,a),oC(i,s,a,t,r),sC(i,s,a,t,n,r),aC(i,s,a,t,n,r)},Pm=(e,t)=>{let n=Aa(t),r=e.handle||e.components?.handle,i=e.secondHandle||e.components?.secondHandle;if(r)r.style.height=`${n}px`,r.style.transform="translate(-50%, -50%)";if(i)i.style.height=`${n}px`,i.style.transform="translate(-50%, -50%)"},lC=(e,t,n)=>{if(e)return{value:e.value,secondValue:e.secondValue,min:e.min,max:e.max,step:e.step,pressed:e.pressed||!1,activeHandle:e.activeHandle||null};if(t?.slider)return{value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep(),pressed:!1,activeHandle:null};return n||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},Na=(e)=>(t)=>{let n=Wi(`${t.getClass("slider-canvas")}`,{zIndex:"1"}),r=t.container||t.components?.container;if(r)r.insertBefore(n,r.firstChild);else t.element.appendChild(n);let i=null,s=null,a=null,o=e.size||"XS",l=lC(null,t,{value:e.value||0,secondValue:e.secondValue||null,min:e.min||0,max:e.max||100,step:e.step||1,pressed:!1,activeHandle:null}),d={animatedValue:l.value,animatedSecondValue:l.secondValue,targetValue:l.value,targetSecondValue:l.secondValue,startValue:l.value,startSecondValue:l.secondValue,startTime:0,duration:Gi.MEDIUM,animationFrame:null};if(t.animationState=d,zi(()=>{try{return i=_m(n,{...e,size:o}),t.ctx=i.ctx,!0}catch(h){return console.warn("Slider canvas initialization failed:",h),!1}},()=>{Pm(t,o)}),e.color&&e.color!=="primary")t.element.classList.add(`${t.getClass("slider")}--${e.color}`);t.canvas=n;let u=()=>{if(!i)return;Ia(i,{...e,size:o},{...l,value:d.animatedValue,secondValue:d.animatedSecondValue},t)},m=(h)=>{if(!i)return;let T=(h||performance.now())-d.startTime,b=Math.min(T/d.duration,1),E=Ar(b),{startValue:v,targetValue:S}=d;if(d.animatedValue=v+(S-v)*E,d.targetSecondValue!==null&&d.animatedSecondValue!==null){let{startSecondValue:y,targetSecondValue:L}=d;d.animatedSecondValue=y+(L-y)*E}if(u(),b<1)d.animationFrame=requestAnimationFrame((y)=>m(y));else d.animationFrame=null},p=(h)=>{if(!i){console.warn("Canvas context not ready");return}Rm(n,i,{...e,size:o});let C,T=!1;if(h)C={value:h.value,secondValue:h.secondValue,min:h.min,max:h.max,step:h.step,pressed:h.pressed||!1,activeHandle:h.activeHandle||null},T=h.dragging||!1,l={...C};else if(t.slider)C={value:t.slider.getValue(),secondValue:t.slider.getSecondValue(),min:t.slider.getMin(),max:t.slider.getMax(),step:t.slider.getStep()},l={...C};else C={...l};let b=C.value!==d.targetValue,E=C.secondValue!==d.targetSecondValue;if((b||E)&&!T){if(d.startValue=d.animatedValue,d.startSecondValue=d.animatedSecondValue,d.targetValue=C.value,d.targetSecondValue=C.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame);d.startTime=performance.now(),m()}else if(T){if(d.animatedValue=C.value,d.animatedSecondValue=C.secondValue,d.targetValue=C.value,d.targetSecondValue=C.secondValue,d.startValue=C.value,d.startSecondValue=C.secondValue,d.animationFrame)cancelAnimationFrame(d.animationFrame),d.animationFrame=null;Ia(i,{...e,size:o},h||C,t)}else Ia(i,{...e,size:o},h||C,t)},g=()=>{if(!i)return;try{let h=_m(n,{...e,size:o});t.ctx=h.ctx,Object.assign(i,h),u()}catch(h){console.warn("Slider canvas resize failed:",h)}};s=Un(t.element,n,g);let c=()=>u();a=Nr(e.color||"primary",c),requestAnimationFrame(()=>{p()}),t.drawCanvas=p,t.resize=g,t.setSize=(h)=>{if(o=h,i)Rm(n,i,{...e,size:o}),u();Pm(t,o)},t.getSize=()=>o;let f=t.appearance?.setColor;if(f)t.appearance.setColor=(h)=>{if(f(h),e.color&&e.color!=="primary")t.element.classList.remove(`${t.getClass("slider")}--${e.color}`);if(h&&h!=="primary")t.element.classList.add(`${t.getClass("slider")}--${h}`);if(e.color=h,a)a(),a=null;a=Nr(h,c),p()};if(t.lifecycle){let h=t.lifecycle.destroy||(()=>{});t.lifecycle.destroy=()=>{if(s)s();if(a)a();if(d.animationFrame)cancelAnimationFrame(d.animationFrame);h()}}return t};Qe();var xn=(e,t)=>(Object.assign(e.style,t),e);var wa=(e)=>(t)=>{let n=(T)=>t.getClass(T),r=e.min||0,i=e.max||100,s=e.value!==void 0?e.value:r,a=e.disabled===!0,o=e.valueFormatter||((T)=>T.toString()),l=(s-r)/(i-r)*100,d=H({tag:"div",className:n("slider-container"),container:t.element});xn(d,{position:"relative"});let u=e.label||"",m=e.range&&u?`${u} minimum`:u,p=u?`${u} maximum`:"",g={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(s),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(s),"data-handle-index":"0"};if(m)g["aria-label"]=m;let c=H({tag:"div",className:n("slider-handle"),attributes:g,container:d});xn(c,{left:`${l}%`});let f=H({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:o(s),container:d});xn(f,{left:`${l}%`});let h,C;if(e.range){let T=e.secondValue!==void 0?e.secondValue:i,b=(T-r)/(i-r)*100,E={role:"slider","aria-valuemin":String(r),"aria-valuemax":String(i),"aria-valuenow":String(T),"aria-orientation":"horizontal",tabindex:a?"-1":"0","aria-disabled":a?"true":"false","data-value":String(T),"data-handle-index":"1"};if(p)E["aria-label"]=p;h=H({tag:"div",className:n("slider-handle"),attributes:E,container:d}),xn(h,{left:`${b}%`}),C=H({tag:"div",className:n("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:o(T),container:d}),xn(C,{left:`${b}%`})}return{...t,container:d,handle:c,valueBubble:f,secondHandle:h,secondValueBubble:C,getContainer:()=>d,getHandle:()=>c,getValueBubble:()=>f,getSecondHandle:()=>h||null,getSecondValueBubble:()=>C||null}};var km=(e)=>(t)=>({...t,element:t.element,setValue(n,r=!0){return e.slider.setValue(n,r),this},getValue(){return e.slider.getValue()},setSecondValue(n,r=!0){return e.slider.setSecondValue(n,r),this},getSecondValue(){return e.slider.getSecondValue()},setMin(n){return e.slider.setMin(n),this},getMin(){return e.slider.getMin()},setMax(n){return e.slider.setMax(n),this},getMax(){return e.slider.getMax()},setStep(n){return e.slider.setStep(n),this},getStep(){return e.slider.getStep()},enable(){return e.disabled.enable(),this},disable(){return e.disabled.disable(),this},isDisabled(){return e.disabled.isDisabled()},setColor(n){return e.appearance.setColor(n),this},getColor(){return e.appearance.getColor()},setSize(n){return e.appearance.setSize(n),this},getSize(){return e.appearance.getSize()},showTicks(n){return e.appearance.showTicks(n),this},showCurrentValue(n){return e.appearance.showCurrentValue(n),this},setLabel(n){if(e.text?.setText)e.text.setText(n);return this},getLabel(){return e.text?.getText?e.text.getText():""},setIcon(n){if(e.icon?.setIcon)e.icon.setIcon(n);return this},getIcon(){return e.icon?.getIcon?e.icon.getIcon():""},on(n,r){if(e.events?.on)e.events.on(n,r);return this},off(n,r){if(e.events?.off)e.events.off(n,r);return this},destroy(){if(e.lifecycle?.destroy)e.lifecycle.destroy()}});Q();var dC={min:Ne.MIN,max:Ne.MAX,value:Ne.VALUE,step:Ne.STEP,disabled:Ne.DISABLED,color:Ne.COLOR,size:Ne.SIZE,ticks:Ne.TICKS,showValue:Ne.SHOW_VALUE,snapToSteps:Ne.SNAP_TO_STEPS,range:Ne.RANGE,centered:Ne.CENTERED,iconPosition:Ne.ICON_POSITION,labelPosition:Ne.LABEL_POSITION,valueFormatter:(e)=>e.toString()},Bm=(e={})=>P(dC,e,"slider"),Hm=(e)=>{let t=["slider",e.class,e.disabled?"slider--disabled":"",e.size&&e.size!=="XS"?`slider--${typeof e.size==="string"?e.size.toLowerCase():e.size}`:"",e.color&&e.color!=="primary"?`slider--${e.color}`:"",e.range?"slider--range":"",e.centered?"slider--centered":"",e.icon?"slider--icon":""].filter(Boolean).join(" "),n={tabindex:"-1"};if(e.disabled)n["aria-disabled"]="true";return V(e,{tag:"div",attributes:n,className:t,forwardEvents:{click:!0,keydown:!0,touchstart:!0,touchmove:!0,touchend:!0,mousedown:!0,mousemove:!0,mouseup:!0},interactive:!0})},$m=(e)=>({slider:{setValue:(t,n)=>e.slider?.setValue(t,n),getValue:()=>e.slider?.getValue()??0,setSecondValue:(t,n)=>e.slider?.setSecondValue(t,n),getSecondValue:()=>e.slider?.getSecondValue()??null,setMin:(t)=>e.slider?.setMin(t),getMin:()=>e.slider?.getMin()??0,setMax:(t)=>e.slider?.setMax(t),getMax:()=>e.slider?.getMax()??100,setStep:(t)=>e.slider?.setStep(t),getStep:()=>e.slider?.getStep()??1,regenerateTicks:()=>e.slider?.regenerateTicks?.()},disabled:{enable:()=>e.disabled?.enable?.(),disable:()=>e.disabled?.disable?.(),isDisabled:()=>e.disabled?.isDisabled?.()??!1},appearance:{setColor:(t)=>e.appearance?.setColor?.(t),getColor:()=>e.appearance?.getColor?.()??"primary",setSize:(t)=>e.setSize?.(t),getSize:()=>e.getSize?.()??"XS",showTicks:(t)=>e.appearance?.showTicks?.(t),showCurrentValue:(t)=>e.appearance?.showCurrentValue?.(t)},text:{setText:(t)=>e.label?.setText?.(t),getText:()=>e.label?.getText?.()??""},icon:{setIcon:(t)=>e.icon?.setIcon?.(t),getIcon:()=>e.icon?.getIcon?.()??""},events:{on:(t,n)=>e.on?.(t,n),off:(t,n)=>e.off?.(t,n)},lifecycle:{destroy:()=>e.lifecycle?.destroy?.()}});var uC=(e={})=>{let t=Bm(e);try{let n=O(M,B(),R(Hm(t)),Sa(t),wa(t),et(t),Pe(t),Na(t),ya(t),xa(t),k())(t),r=$m(n),i=km(r)(n);if(t.on&&typeof i.on==="function")Object.entries(t.on).forEach(([s,a])=>{if(typeof a==="function")i.on(s,a)});return i}catch(n){throw console.error("Slider creation error:",n),Error(`Failed to create slider: ${n.message}`)}},Da=uC;ne();Z();pt();var In={CENTER:"center",START:"start",END:"end"};var ar={short:4000,long:1e4,indefinite:0};var mi={QUEUE:"queue",REPLACE:"replace"};var Et={POSITION:In.CENTER,QUEUE_BEHAVIOR:mi.QUEUE,QUEUE_GAP:200,CLOSE_LABEL:"Dismiss",ANIMATION_DURATION:425,ACTION_INLINE_MAX_WIDTH:128},bt={ROOT:"snackbar",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",WITH_ACTION:"snackbar--with-action",DISMISSIBLE:"snackbar--dismissible",ACTION_BELOW:"snackbar--action-below",TEXT:"snackbar-text",ACTION:"snackbar-action",CLOSE:"snackbar-close"},Vm='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" width="24" height="24" fill="currentColor" aria-hidden="true"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>';Q();var cC={position:Et.POSITION,queueBehavior:Et.QUEUE_BEHAVIOR,closeLabel:Et.CLOSE_LABEL},Fm=(e)=>P(cC,e,"snackbar"),fi=(e,t)=>{if(e===void 0||e===null)return t?ar.indefinite:ar.short;if(typeof e==="number")return Number.isFinite(e)&&e>0?e:0;return ar[e]??ar.short},Um=(e)=>V(e,{tag:"div",attributes:{role:"status"}}),Gm=(e)=>({...e,text:e.message}),zm=(e,t,n)=>({lifecycle:{destroy:e.lifecycle?.destroy||(()=>{})},queue:t,config:n});var Wm=(e)=>(t)=>{if(!e.action)return t;let n=e.prefix||"mtrl",r=Te({text:e.action,variant:"text",prefix:n,class:`${n}-${bt.ACTION}`});return t.element.classList.add(`${n}-${bt.WITH_ACTION}`),t.element.appendChild(r.element),{...t,action:r,actionButton:r.element}},Km=(e)=>(t)=>{if(!e.dismissible)return t;let n=e.prefix||"mtrl",r=Lt({icon:Vm,variant:"standard",size:"s",ariaLabel:e.closeLabel||"Dismiss",prefix:n,class:`${n}-${bt.CLOSE}`});return t.element.classList.add(`${n}-${bt.DISMISSIBLE}`),t.element.appendChild(r.element),{...t,close:r,closeButton:r.element}},Ym=(e)=>(t)=>{let n=t.element,r=fi(e.duration,Boolean(e.action)),i=null,s=0,a=0,o=!1,l=!1,d=!1,u=()=>{i=null,o=!1,t.emit?.("timeout")},m=()=>{if(i!==null||s<=0)return;a=Date.now(),i=setTimeout(u,s)},p=()=>{if(i===null)return;clearTimeout(i),i=null,s-=Date.now()-a},g=()=>l||d,c=()=>{if(p(),s=r,o=r>0,o&&!g())m()},f=()=>{p(),o=!1,s=0},h=()=>{if(o&&!g())m()};n.addEventListener("pointerenter",()=>{l=!0,p()}),n.addEventListener("pointerleave",()=>{l=!1,h()}),n.addEventListener("focusin",()=>{d=!0,p()}),n.addEventListener("focusout",(b)=>{let E=b.relatedTarget;if(E instanceof Node&&n.contains(E))return;d=!1,h()});let C=t.lifecycle?.destroy;if(t.lifecycle)t.lifecycle.destroy=()=>{f(),C?.call(t.lifecycle)};return{...t,timer:{start:c,stop:f,setDuration:(b)=>{r=Number.isFinite(b)&&b>0?b:0},getDuration:()=>r}}};var Ma=(e)=>Object.values(In).includes(e),Xm=(e)=>(t)=>{let n=e.prefix||"mtrl",r=Ma(e.position)?e.position:In.CENTER,i=(s)=>`${n}-snackbar--${s}`;return t.element.classList.add(i(r)),{...t,position:{getPosition:()=>r,setPosition:(s)=>{let a=Ma(s)?s:In.CENTER;if(!Ma(s))console.warn(`Invalid position: ${s}. Using default: ${In.CENTER}`);return t.element.classList.remove(i(r)),r=a,t.element.classList.add(i(r)),t}}}};J();var qm=({lifecycle:e,queue:t,config:n})=>(r)=>{if(!t)throw Error("Snackbar queue is required");let i=r.element,s=n.prefix||"mtrl",a=(T)=>`${s}-${T}`,o=!1,l=null,d=null,u=null,m=(T,b={})=>{r.emit?.(T,{snackbar:C,originalEvent:null,...b})},p=()=>{let T=r.actionButton;if(!T)return;let b=T.offsetWidth>Et.ACTION_INLINE_MAX_WIDTH;i.classList.toggle(a(bt.ACTION_BELOW),b)},g=()=>{if(d!==null)clearTimeout(d),d=null;if(u)i.removeEventListener("transitionend",u),u=null},c=()=>{g();let T=()=>{g(),i.remove()};u=(b)=>{if(b.target===i&&b.propertyName==="opacity")T()},i.addEventListener("transitionend",u),d=setTimeout(T,Et.ANIMATION_DURATION)},f=(T,b=null)=>{if(!o)return;o=!1,C.state="hidden",r.timer?.stop();let E=i.ownerDocument.activeElement;if(E&&i.contains(E)&&l instanceof HTMLElement&&l.isConnected)l.focus();i.classList.remove(a(bt.VISIBLE)),c(),m("close",{reason:T,originalEvent:b}),m("dismiss",{reason:T,originalEvent:b})},h=()=>{g(),l=i.ownerDocument.activeElement,i.ownerDocument.body.appendChild(i),p(),i.offsetHeight,i.classList.add(a(bt.VISIBLE)),r.timer?.start(),m("open")},C={element:i,actionButton:r.actionButton,closeButton:r.closeButton,timer:r.timer,state:"hidden",show(){if(o)return this;return o=!0,this.state="visible",t.add({element:i,on:(T,b)=>r.on?.(T,b),off:(T,b)=>r.off?.(T,b),_show:h,_hide:()=>f("queue")},{behavior:n.queueBehavior}),this},hide(){return f("api"),this},setMessage(T){return r.text?.setText(T),this},getMessage(){return r.text?.getText()||""},setAction(T){if(r.action?.setText(T),o)p();return this},getAction(){return r.action?.getText()||""},setDuration(T){if(r.timer?.setDuration(fi(T,Boolean(r.action))),o)r.timer?.start();return this},getDuration(){return r.timer?.getDuration()??0},setPosition(T){return r.position?.setPosition(T),this},getPosition(){return r.position?.getPosition()||"center"},on(T,b){return r.on?.(T,b),this},off(T,b){return r.off?.(T,b),this},destroy(){o=!1,g(),i.remove(),r.timer?.stop(),r.action?.destroy(),r.close?.destroy(),e.destroy()}};if(r.on?.("timeout",()=>f("timeout")),r.actionButton?.addEventListener("click",(T)=>{m("action",{originalEvent:T}),f("action",T)}),r.closeButton?.addEventListener("click",(T)=>{f("close-button",T)}),i.addEventListener("keydown",(T)=>{if(T.key!=="Escape"||!o)return;T.stopPropagation(),f("escape",T)}),n.onOpen)C.on("open",n.onOpen);if(n.onClose)C.on("close",n.onClose);if(n.onAction)C.on("action",n.onAction);if(n.on){for(let[T,b]of Object.entries(n.on))if(b)C.on(T,b)}return C};var jm=(e=Et.QUEUE_GAP)=>{let t=[],n=null,r=null,i=null,s=()=>{if(i!==null)clearTimeout(i),i=null},a=()=>{if(n&&r)n.off?.("dismiss",r);n=null,r=null},o=()=>{let d=n;a();try{d?._hide?.()}catch{}},l=()=>{if(s(),n||t.length===0)return;let d=t.shift();n=d;let u=()=>{if(a(),t.length>0)i=setTimeout(()=>{i=null,l()},e)};r=u,d.on?.("dismiss",u),d._show()};return{add(d,u={}){if(!d._show)throw Error("Snackbar must implement _show method");let m=u.behavior??mi.QUEUE;if(n&&n.element&&!n.element.isConnected)a();if(m===mi.REPLACE){t.length=0,s(),o(),t.push(d),l();return}if(t.push(d),!n)l()},clear(){t.length=0,s(),o()},getLength(){return t.length+(n?1:0)}}};var Zm=jm(),mC=(e)=>{if(!e.message)throw Error("Snackbar message is required");let t=Fm(e);try{return O(M,B(),R(Um(t)),Xm(t),ct(Gm(t)),Wm(t),Km(t),k(),Ym(t),(r)=>qm(zm(r,Zm,t))(r))(t)}catch(n){throw console.error("Snackbar creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create snackbar: ${n instanceof Error?n.message:String(n)}`)}},Oa=()=>Zm.clear(),Ra=mC;ne();Z();J();var Qm=({disabled:e,lifecycle:t,checkable:n})=>(r)=>({...r,element:r.element,input:r.input,getValue(){return n.isChecked()},setValue(i){if(typeof i==="boolean")if(i)n.check();else n.uncheck();else if(typeof i==="string")if(i==="true"||i==="1")n.check();else n.uncheck();return this},getValueAttribute(){return r.input?.value||""},setValueAttribute(i){if(r.input)r.input.value=i;return this},check(){return n.check(),this},uncheck(){return n.uncheck(),this},toggle(){return n.toggle(),this},isChecked(){return n.isChecked()},setLabel(i){return r.text?.setText(i),this},getLabel(){return r.text?.getText()||""},supportingTextElement:r.supportingTextElement||null,setSupportingText(i,s){if(r.setSupportingText)r.setSupportingText(i,s);return this},removeSupportingText(){if(r.removeSupportingText)r.removeSupportingText();return this},on(i,s){return r.on?.(i,s),this},off(i,s){return r.off?.(i,s),this},enable(){return e.enable(),this},disable(){return e.disable(),this},destroy(){t.destroy()}});J();var Jm=(e,t,n)=>{let r=t||"mtrl",i=n||"switch",s=e.element.querySelector(`.${r}-${i}-container`);if(!s){s=document.createElement("div"),s.className=`${r}-${i}-container`;let o=e.element.querySelector(`.${r}-${i}-input`),l=e.element.querySelector(`.${r}-${i}-track`),d=[];if(o)d.push(o);if(l)d.push(l);let u=document.createElement("div");u.className=`${r}-${i}-content`;let m=e.element.querySelector(`.${r}-${i}-label`);if(m)u.appendChild(m);return s.appendChild(u),d.forEach((p)=>s.appendChild(p)),e.element.appendChild(s),{container:s,contentWrapper:u}}let a=e.element.querySelector(`.${r}-${i}-content`);if(!a){a=document.createElement("div"),a.className=`${r}-${i}-content`;let o=e.element.querySelector(`.${r}-${i}-label`);if(o)a.appendChild(o);s.insertBefore(a,s.firstChild)}return{container:s,contentWrapper:a}},ef=(e)=>(t)=>{let n=e.prefix||"mtrl",r=e.componentName||"switch",{contentWrapper:i}=Jm(t,n,r),s=null;if(e.supportingText){if(s=document.createElement("div"),s.className=`${n}-${r}-helper`,s.textContent=e.supportingText,e.error)s.classList.add(`${n}-${r}-helper--error`),t.element.classList.add(`${n}-${r}--error`);i.appendChild(s)}if("lifecycle"in t&&t.lifecycle&&typeof t.lifecycle==="object"&&"destroy"in t.lifecycle&&s){let a=t.lifecycle.destroy;t.lifecycle.destroy=()=>{if(s)s.remove();a.call(t.lifecycle)}}return{...t,supportingTextElement:s,setSupportingText(a,o=!1){let{contentWrapper:l}=Jm(t,n,r),d=this.supportingTextElement;if(!d)d=document.createElement("div"),d.className=`${n}-${r}-helper`,l.appendChild(d),this.supportingTextElement=d;return d.textContent=a,d.classList.toggle(`${n}-${r}-helper--error`,o),t.element.classList.toggle(`${n}-${r}--error`,o),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,t.element.classList.remove(`${n}-${r}--error`);return this}}},tf=(e)=>(t)=>{let n={...e,prefix:e.prefix||"mtrl",componentName:e.componentName||"switch"};return Bn(n)(t)};Q();var fC={prefix:"mtrl",componentName:"switch"},nf=(e={})=>P(fC,e,"switch"),rf=(e)=>V(e,{tag:"div",className:e.class,interactive:!0}),sf=(e)=>({disabled:{enable:e.disabled?.enable,disable:e.disabled?.disable},lifecycle:{destroy:e.lifecycle?.destroy},checkable:{check:e.checkable?.check,uncheck:e.checkable?.uncheck,toggle:e.checkable?.toggle,isChecked:e.checkable?.isChecked}});var pC=(e={})=>{let t=nf(e);try{return O(M,B(),R(rf(t)),et(t),Bt(t),tf(t),ef(t),Ht(t),oe(t),k(),(r)=>Qm(sf(r))(r))(t)}catch(n){throw console.error("Switch creation error:",n instanceof Error?n.message:String(n)),Error(`Failed to create switch: ${n instanceof Error?n.message:String(n)}`)}},_a=pC;ne();Z();J();ne();Z();J();var hC={PRIMARY:"primary",SECONDARY:"secondary"},af={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},CC={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"};var lr={VARIANT:hC.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:CC.AUTO,INDICATOR_FIXED_WIDTH:40,INDICATOR_ANIMATION_DURATION:250,INDICATOR_ANIMATION_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",ICON_SIZE:"24px",RIPPLE:!0},Ln={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"};Q();Z();var EC={state:af.INACTIVE,componentName:"tab",ripple:lr.RIPPLE},bC={variant:lr.VARIANT,scrollable:lr.SCROLLABLE,showDivider:lr.SHOW_DIVIDER,componentName:"tabs"},of=(e={})=>P(bC,e,"tabs"),lf=(e={})=>P(EC,e,"tab"),df=(e)=>{let t={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${e.prefix}-tabs`,`${e.prefix}-tabs--${e.variant||"primary"}`,e.class]};return(n)=>R(t)(n)};pt();var An=(e={})=>{let t=lf(e);try{let n=O(M,B(),k())(t),r=Te({text:t.text,icon:t.icon,iconSize:t.iconSize,disabled:t.disabled,ripple:t.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...t.rippleConfig||{}},value:t.value,prefix:t.prefix,variant:"text",class:`${t.prefix}-tab`});if(n.element=r.element,n.element.setAttribute("role","tab"),n.element.setAttribute("aria-selected",t.state==="active"?"true":"false"),t.value)n.element.setAttribute("id",`tab-${t.value}`),n.element.setAttribute("aria-controls",`tabpanel-${t.value}`);if(t.state==="active")n.element.classList.add(`${n.getClass("tab")}--active`);r.on("click",(s)=>{if(n.emit)n.emit("click",s)});let i={...n,button:r,element:r.element,badge:null,getValue(){return r.getValue()},setValue(s){let a=s||"";return r.setValue(a),this.element.setAttribute("id",`tab-${a}`),this.element.setAttribute("aria-controls",`tabpanel-${a}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let s=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(s),this},deactivate(){return this.element.classList.remove(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","false"),this},isActive(){return this.element.classList.contains(`${this.getClass("tab")}--active`)},enable(){return r.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return r.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(s){return r.setText(s),this.updateLayoutStyle(),this},getText(){return r.getText()},setIcon(s){return r.setIcon(s),this.updateLayoutStyle(),this},getIcon(){return r.getIcon()},setBadge(s){if(!this.badge){let a={content:s,standalone:!1,target:this.element,prefix:t.prefix,...t.badgeConfig||{}};this.badge=Vn(a)}else this.badge.setContent(s),this.badge.show();return this.element.setAttribute("data-has-badge","true"),this},getBadge(){return this.badge?this.badge.getContent():""},showBadge(){if(this.badge)this.badge.show(),this.element.setAttribute("data-has-badge","true");return this},hideBadge(){if(this.badge)this.badge.hide(),this.element.setAttribute("data-has-badge","false");return this},getBadgeComponent(){return this.badge},destroy(){if(this.badge)this.badge.destroy();if(r.destroy)r.destroy();n.lifecycle.destroy()},updateLayoutStyle(){let s=!!this.getText(),a=!!this.getIcon(),o="";if(s&&a)o=Ln.ICON_AND_TEXT;else if(a)o=Ln.ICON_ONLY;else o=Ln.TEXT_ONLY;if(Object.values(Ln).forEach((l)=>{this.element.classList.remove(`${this.getClass("tab")}--${l}`)}),this.element.classList.add(`${this.getClass("tab")}--${o}`),o===Ln.ICON_ONLY&&s)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if(t.badge!==void 0)i.setBadge(t.badge);return i.updateLayoutStyle(),i}catch(n){throw console.error("Tab creation error:",n),Error(`Failed to create tab: ${n.message}`)}};var uf=({lifecycle:e})=>(t)=>({...t,element:t.element,addTab(n){let r={...n,prefix:t.config.prefix,variant:n.variant||t.config.variant};if(r.value===void 0)r.value="";let i=An(r);if(t.tabs.push(i),t.tabsContainer.appendChild(i.element),i.on&&typeof i.on==="function")i.on("click",(a)=>t.handleTabClick(a,i));return i.element.addEventListener("click",(a)=>{t.handleTabClick(a,i)}),i},add(n){if(t.tabs.push(n),t.tabsContainer.appendChild(n.element),n.on&&typeof n.on==="function")n.on("click",(i)=>t.handleTabClick(i,n));return n.element.addEventListener("click",(i)=>{t.handleTabClick(i,n)}),this},getTabs(){return[...t.tabs]},getActiveTab(){return t.tabs.find((n)=>n.isActive())||null},setActiveTab(n){let r=typeof n==="string"?t.tabs.find((i)=>i.getValue()===n):n;if(!r)return this;if(t.tabs.forEach((i)=>i.deactivate()),r.activate(),t.emit)t.emit("change",{tab:r,value:r.getValue()});return this},removeTab(n){let r=typeof n==="string"?t.tabs.find((s)=>s.getValue()===n):n;if(!r)return this;let i=t.tabs.indexOf(r);if(i!==-1)t.tabs.splice(i,1);if(r.element.parentNode)r.element.parentNode.removeChild(r.element);return r.destroy(),this},on(n,r){if(t.on)t.on(n,r);return this},off(n,r){if(t.off)t.off(n,r);return this},destroy(){t.tabs.forEach((n)=>n.destroy()),t.tabs.length=0,e.destroy()}}),cf=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});function mf(e){if(typeof e.getActiveTab==="function")return e.getActiveTab();if(Array.isArray(e.tabs))return e.tabs.find((t)=>t.isActive&&t.isActive());return null}function ff(e){let t=mf(e);if(!t)return;if(typeof t.getValue!=="function")return;let n=t.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((i)=>{if(i.getAttribute("aria-labelledby")?.replace("tab-","")===n)i.removeAttribute("hidden"),i.setAttribute("tabindex","0");else i.setAttribute("hidden","true"),i.setAttribute("tabindex","-1")})}function pf(e){if(!e.element)return;e.element.addEventListener("keydown",(t)=>{if(t.target!==t.currentTarget)return;if(typeof e.getTabs!=="function"||typeof e.setActiveTab!=="function")return;let n=e.getTabs(),r=mf(e),i=r?n.indexOf(r):-1,s=i;switch(t.key){case"ArrowRight":case"ArrowDown":s=i<n.length-1?i+1:0;break;case"ArrowLeft":case"ArrowUp":s=i>0?i-1:n.length-1;break;case"Home":s=0;break;case"End":s=n.length-1;break;default:return}if(s!==i&&n[s])t.preventDefault(),n[s].element.focus(),e.setActiveTab(n[s])})}var vC={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},gf=(e={})=>{let t={...vC,...e},n=t.prefix||"mtrl",r=document.createElement("div");if(r.className=`${n}-tabs-indicator`,r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
29
+ width ${t.animationDuration}ms ${t.animationTiming}`,r.style.width=`${t.fixedWidth}px`,!t.visible)r.style.opacity="0";let i=null,s=(c)=>{if(t.widthStrategy==="auto"){if(t.variant==="secondary")return c.element.offsetWidth;let f=c.element.querySelector(`.${n}-tab-text`)||c.element.querySelector(`.${n}-button-text`);if(f)return f.clientWidth;return Math.max(c.element.offsetWidth/2,30)}switch(t.widthStrategy){case"dynamic":return Math.max(c.element.offsetWidth/2,30);case"content":let f=c.element.querySelector(`.${n}-button-text`)||c.element.querySelector(`.${n}-tab-text`);if(f)return Math.max(f.clientWidth,30);return t.fixedWidth||40;case"fixed":default:return t.fixedWidth||40}},a=(c)=>{let f=c.parentElement;if(!f)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:c.offsetWidth};let h=c.getBoundingClientRect(),C=f.getBoundingClientRect();return{left:h.left-C.left,width:h.width}},o=(c,f)=>{let{left:h,width:C}=a(c.element);if(t.variant!=="secondary"&&(t.widthStrategy==="auto"||t.widthStrategy==="content")){let T=c.element.querySelector(`.${n}-tab-text`)||c.element.querySelector(`.${n}-button-text`);if(T){let b=T.getBoundingClientRect(),E=c.element.getBoundingClientRect(),v=b.left-E.left;return{left:h+v}}}if(f<C)return{left:h+(C-f)/2};return{left:h}},l=(c,f=!1)=>{if(!c||!c.element){console.error("Invalid tab or tab has no element");return}i=c;let h=s(c),{left:C}=o(c,h);if(f)r.style.transition="none",r.offsetHeight;if(r.style.width=`${h}px`,r.style.transform=`translateX(${C}px)`,f)setTimeout(()=>{r.style.transition=`transform ${t.animationDuration}ms ${t.animationTiming},
30
+ width ${t.animationDuration}ms ${t.animationTiming}`},10)};return{element:r,moveToTab:l,show:()=>{r.style.opacity="1"},hide:()=>{r.style.opacity="0"},setColor:(c)=>{r.style.backgroundColor=c},update:()=>{if(i)l(i,!0)},destroy:()=>{if(r.parentNode)r.parentNode.removeChild(r);i=null}}};var hf=(e)=>(t)=>{let n=[],r=t.scrollContainer||t.element;if(Array.isArray(e.tabs))e.tabs.forEach((o)=>{let l={...o,prefix:e.prefix,variant:o.variant||e.variant},d=An(l);n.push(d),r.appendChild(d.element)});let i=()=>[...n],s=()=>n.find((o)=>o.isActive())||null,a=(o,l)=>{if(o&&typeof o.preventDefault==="function")o.preventDefault();if(l.disabled&&l.disabled.isDisabled&&l.disabled.isDisabled())return;n.forEach((u)=>u.deactivate()),l.activate();let d=l.getValue();if(ff({tabs:n,getActiveTab:()=>n.find((u)=>u.isActive())||null}),typeof t.emit==="function")t.emit("change",{tab:l,value:d})};return n.forEach((o)=>{if(o.on&&typeof o.on==="function")o.on("click",(l)=>a(l,o));o.element.addEventListener("click",(l)=>a(l,o))}),{...t,tabs:n,tabsContainer:r,handleTabClick:a,getTabs:i,getActiveTab:s}},Cf=(e)=>(t)=>{if(e.scrollable===!1)return t;t.element.classList.add(`${t.getClass("tabs")}--scrollable`);let n=document.createElement("div");n.className=`${t.getClass("tabs")}-scroll`;while(t.element.firstChild)n.appendChild(t.element.firstChild);return t.element.appendChild(n),{...t,scrollContainer:n}},Ef=(e)=>(t)=>{if(e.showDivider===!1)return t;let n=document.createElement("div");return n.className=`${t.getClass("tabs")}-divider`,t.element.appendChild(n),t},bf=(e)=>(t)=>{let n=e.indicator||{},r=gf({prefix:e.prefix,widthStrategy:n.widthStrategy||e.indicatorWidthStrategy||"auto",height:n.height||e.indicatorHeight||3,fixedWidth:n.fixedWidth||40,animationDuration:n.animationDuration||250,animationTiming:n.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:n.color,variant:e.variant??"primary"}),i=t.scrollContainer||t.element;if(!i)throw console.error("No scroll container found - cannot add indicator"),Error("Failed to create tabs: No scroll container found");i.appendChild(r.element);let s=t.handleTabClick;t.handleTabClick=function(u,m){if(m.disabled&&m.disabled.isDisabled&&m.disabled.isDisabled())return;s.call(this,u,m),setTimeout(()=>{r.moveToTab(m)},10)},setTimeout(()=>{let u=t.tabs.find((m)=>m.isActive());if(u)r.moveToTab(u,!0)},50);let a=()=>{let u=t.tabs.find((m)=>m.isActive());if(u)r.moveToTab(u,!0)};if(i)i.addEventListener("scroll",a);let o=new ResizeObserver(()=>{let u=t.tabs.find((m)=>m.isActive());if(u)r.moveToTab(u,!0)});o.observe(i);let l=new MutationObserver((u)=>{for(let m of u)if(m.type==="attributes"&&m.attributeName==="class"&&m.target.classList.contains(`${e.prefix}-tab--active`)){let p=m.target,g=t.tabs.find((c)=>c.element===p);if(g)r.moveToTab(g)}});if(Array.isArray(t.tabs))t.tabs.forEach((u)=>{if(u.element)l.observe(u.element,{attributes:!0})});let d=t.destroy||(()=>{});return t.destroy=function(){if(r.destroy(),o.disconnect(),l.disconnect(),i)i.removeEventListener("scroll",a);if(typeof d==="function")d.call(this)},{...t,indicator:r,getIndicator:()=>r}};var vf=()=>{if(document.getElementById("tab-state-styles"))return;let e=document.createElement("style");e.id="tab-state-styles",e.textContent=`
31
31
  @keyframes ripple-effect {
32
32
  0% {
33
33
  transform: scale(0);
@@ -38,7 +38,7 @@ var Vf=Object.create;var{getPrototypeOf:Ff,defineProperty:Mn,getOwnPropertyNames
38
38
  opacity: 0;
39
39
  }
40
40
  }
41
- `,document.head.appendChild(e)};var TC=(e={})=>{let t=of(e);vf();try{let n=M(D,B(),df(t),Cf(t),hf(t),Ef(t),bf(t),P(),(r)=>uf(cf(r))(r))(t);return pf(n),n}catch(n){throw console.error("Tabs creation error:",n),Error(`Failed to create tabs: ${n.message}`)}},Tf=TC;var Sf=Tf;rt();ne();Z();J();Q();var SC={DIAL:"dial",INPUT:"input"},yC={VERTICAL:"vertical",HORIZONTAL:"horizontal"},xC={AMPM:"12h",MILITARY:"24h"};var _e={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},Xt={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},BR={HOURS_12:Array.from({length:12},(e,t)=>t===0?12:t),HOURS_24:Array.from({length:24},(e,t)=>t),MINUTES:Array.from({length:60},(e,t)=>t),SECONDS:Array.from({length:60},(e,t)=>t)},Pa={MODAL:1050,DIALOG:1051},de={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},dt={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
41
+ `,document.head.appendChild(e)};var TC=(e={})=>{let t=of(e);vf();try{let n=O(M,B(),df(t),Cf(t),hf(t),Ef(t),bf(t),k(),(r)=>uf(cf(r))(r))(t);return pf(n),n}catch(n){throw console.error("Tabs creation error:",n),Error(`Failed to create tabs: ${n.message}`)}},Tf=TC;var Sf=Tf;rt();ne();Z();J();Q();var SC={DIAL:"dial",INPUT:"input"},yC={VERTICAL:"vertical",HORIZONTAL:"horizontal"},xC={AMPM:"12h",MILITARY:"24h"};var _e={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},Xt={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},kR={HOURS_12:Array.from({length:12},(e,t)=>t===0?12:t),HOURS_24:Array.from({length:24},(e,t)=>t),MINUTES:Array.from({length:60},(e,t)=>t),SECONDS:Array.from({length:60},(e,t)=>t)},Pa={MODAL:1050,DIALOG:1051},de={CONTAINER:".mtrl-time-picker",MODAL:".mtrl-time-picker-modal",DIALOG:".mtrl-time-picker-dialog",TITLE:".mtrl-time-picker-title",CONTENT:".mtrl-time-picker-content",DIAL:".mtrl-time-picker-dial",DIAL_CANVAS:".mtrl-time-picker-dial-canvas",DIAL_FACE:".mtrl-time-picker-dial-face",DIAL_HAND:".mtrl-time-picker-dial-hand",DIAL_CENTER:".mtrl-time-picker-dial-center",DIAL_NUMBERS:".mtrl-time-picker-dial-numbers",DIAL_NUMBER:".mtrl-time-picker-dial-number",INPUT_CONTAINER:".mtrl-time-picker-input-container",HOURS_INPUT:".mtrl-time-picker-hours",MINUTES_INPUT:".mtrl-time-picker-minutes",SECONDS_INPUT:".mtrl-time-picker-seconds",SEPARATOR:".mtrl-time-picker-separator",PERIOD_CONTAINER:".mtrl-time-picker-period",PERIOD_AM:".mtrl-time-picker-period-am",PERIOD_PM:".mtrl-time-picker-period-pm",ACTIONS:".mtrl-time-picker-actions",TOGGLE_TYPE_BUTTON:".mtrl-time-picker-toggle-type",CANCEL_BUTTON:".mtrl-time-picker-cancel",CONFIRM_BUTTON:".mtrl-time-picker-confirm"},dt={CLOCK:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
42
42
  <circle cx="12" cy="12" r="10"></circle>
43
43
  <polyline points="12 6 12 12 16 14"></polyline>
44
44
  </svg>`,KEYBOARD:`<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
@@ -52,6 +52,6 @@ var Vf=Object.create;var{getPrototypeOf:Ff,defineProperty:Mn,getOwnPropertyNames
52
52
  <line x1="14" y1="12" x2="14" y2="12"></line>
53
53
  <line x1="18" y1="12" x2="18" y2="12"></line>
54
54
  <line x1="6" y1="16" x2="18" y2="16"></line>
55
- </svg>`},Rt={TYPE:SC.DIAL,FORMAT:xC.AMPM,ORIENTATION:yC.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:dt.CLOCK,KEYBOARD_ICON:dt.KEYBOARD};var IC={type:"dial",format:"12h",orientation:"vertical",showSeconds:Rt.SHOW_SECONDS,closeOnSelect:Rt.CLOSE_ON_SELECT,minuteStep:Rt.MINUTE_STEP,secondStep:Rt.SECOND_STEP,cancelText:Rt.CANCEL_TEXT,confirmText:Rt.CONFIRM_TEXT,isOpen:Rt.IS_OPEN,clockIcon:dt.CLOCK,keyboardIcon:dt.KEYBOARD},yf=(e={})=>_(IC,e,"time-picker"),xf=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${e.prefix}-time-picker-title`},className:[e.class,e.isOpen?`${e.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0});var If=(e)=>({events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),emit:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ie=(e)=>e.toString().padStart(2,"0"),Lf=(e,t)=>{try{let n=e.split(":"),r=parseInt(n[0],10),i=parseInt(n[1],10),s=n[2]?parseInt(n[2],10):0;if(isNaN(r)||r<0||r>23||isNaN(i)||i<0||i>59||isNaN(s)||s<0||s>59)throw Error("Invalid time format");let a=r>=12?"PM":"AM";return{hours:r,minutes:i,seconds:s,period:a}}catch(n){console.error("Error parsing time:",n);let r=new Date,i=r.getHours(),s=r.getMinutes(),a=r.getSeconds(),o=i>=12?"PM":"AM";return{hours:i,minutes:s,seconds:a,period:o}}},Af=(e,t)=>{let{hours:n,minutes:r,seconds:i}=e;if(t){if(i!==void 0)return`${ie(n)}:${ie(r)}:${ie(i)}`;return`${ie(n)}:${ie(r)}`}else{let s=n%12;if(s===0)s=12;if(i!==void 0)return`${ie(s)}:${ie(r)}:${ie(i)} ${e.period}`;return`${ie(s)}:${ie(r)} ${e.period}`}};var Nf=(e)=>{let t=e>=12?"PM":"AM",n=e%12;if(n===0)n=12;return{hours:n,period:t}};var me={...Xt,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function LC(e){let t=document.documentElement,n=getComputedStyle(t),r=n.getPropertyValue(`--${e}-sys-color-primary`).trim()||"#6750A4",i=n.getPropertyValue(`--${e}-sys-color-on-primary`).trim()||"#FFFFFF",s=n.getPropertyValue(`--${e}-sys-color-on-surface`).trim()||"#1C1B1F",a=n.getPropertyValue(`--${e}-sys-color-primary-rgb`).trim()||"103, 80, 164",l=`rgba(${n.getPropertyValue(`--${e}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,d=`rgba(${a}, 0.1)`;return{primaryColor:r,onPrimaryColor:i,onSurfaceColor:s,bgColor:l,selectedBgColor:d}}var we=(e,t,n)=>{let r=e.getContext("2d");if(!r){console.error("Could not get canvas context");return}let i=LC(n.prefix),s=window.devicePixelRatio||1;e.width=me.DIAMETER*s,e.height=me.DIAMETER*s,r.scale(s,s);let a=me.DIAMETER/2,o=me.DIAMETER/2,l=me.DIAMETER/2;if(r.clearRect(0,0,e.width,e.height),r.beginPath(),r.arc(a,o,l-2,0,2*Math.PI),r.fillStyle=i.bgColor,r.fill(),r.beginPath(),r.arc(a,o,me.CENTER_SIZE/2,0,2*Math.PI),r.fillStyle=i.primaryColor,r.fill(),n.activeSelector==="hour")if(n.format==="24h")NC(r,a,o,l,t.hours,i);else AC(r,a,o,l,t.hours%12||12,i);else if(n.activeSelector==="minute")wf(r,a,o,l,t.minutes,i);else if(n.activeSelector==="second"&&n.showSeconds)wf(r,a,o,l,t.seconds||0,i);wC(r,a,o,t,n,i)},AC=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let o=1;o<=12;o++){let l=o/6*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),c=o===i;if(c)e.beginPath(),e.arc(d,u,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=c?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(o.toString(),d,u+2)}},NC=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let l=1;l<=12;l++){let d=l/6*Math.PI-Math.PI/2,u=t+a*Math.cos(d),c=n+a*Math.sin(d),p=l===i;if(p)e.beginPath(),e.arc(u,c,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=p?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(l.toString(),u,c+2)}let o=me.INNER_RADIUS;for(let l=13;l<=24;l++){let d=l===24?0:l,u=(l-12)/6*Math.PI-Math.PI/2,c=t+o*Math.cos(u),p=n+o*Math.sin(u),g=d===i;if(g)e.beginPath(),e.arc(c,p,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="14px Roboto, Arial, sans-serif",e.fillStyle=g?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(d),c,p+2)}},wf=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let o=0;o<60;o+=5){let l=o/30*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),c=o===i;if(c)e.beginPath(),e.arc(d,u,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=c?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(o),d,u)}if(i%5!==0){let o=i/30*Math.PI-Math.PI/2,l=t+a*Math.cos(o),d=n+a*Math.sin(o);e.beginPath(),e.arc(l,d,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.primaryColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(i),l,d)}},wC=(e,t,n,r,i,s)=>{let a,o;if(i.activeSelector==="hour")if(i.format==="24h")if(r.hours>=12)a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=me.INNER_RADIUS;else{let c=r.hours;if(c===0)c=12;a=c/6*Math.PI-Math.PI/2,o=me.OUTER_RADIUS}else a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else if(i.activeSelector==="minute")a=r.minutes/30*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else if(i.activeSelector==="second")a=(r.seconds||0)/30*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else return;e.beginPath(),e.moveTo(t,n),e.lineTo(t+o*Math.cos(a),n+o*Math.sin(a)),e.lineWidth=me.HAND_WIDTH,e.strokeStyle=s.primaryColor,e.stroke();let l=t+o*Math.cos(a),d=n+o*Math.sin(a);e.beginPath(),e.arc(l,d,me.KNOB_SIZE/2,0,2*Math.PI),e.fillStyle=s.primaryColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.onPrimaryColor,e.textAlign="center",e.textBaseline="middle";let u="";if(i.activeSelector==="hour")if(i.format==="24h")u=ie(r.hours);else u=String(r.hours%12||12);else if(i.activeSelector==="minute")u=ie(r.minutes);else if(i.activeSelector==="second")u=ie(r.seconds||0);e.fillText(u,l,d)},gi=(e,t,n,r)=>{let i=me.DIAMETER/2,s=me.DIAMETER/2,a=t-i,o=n-s,l=Math.sqrt(a*a+o*o),d=Math.atan2(o,a)+Math.PI/2;if(d<0)d+=2*Math.PI;if(r.activeSelector==="hour")if(r.format==="24h"){let u=(me.INNER_RADIUS+me.OUTER_RADIUS)/2,c=l<u,p=Math.round(d/(Math.PI/6))%12;if(c&&p!==0)p+=12;else if(!c&&p===0)p=12;else if(c&&p===0)p=0;return p}else{let u=Math.round(d/(Math.PI/6))%12;if(u===0)u=12;return u}else if(r.activeSelector==="minute"||r.activeSelector==="second")return Math.round(d/(Math.PI/30))%60;return null};var je=(e,t,n,r)=>{if(e.innerHTML="",n.title){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-title`,y.textContent=n.title,y.id=`${n.prefix}-time-picker-title`,e.appendChild(y)}let i=document.createElement("div");i.className=`${n.prefix}-time-picker-content`,e.appendChild(i);let s=document.createElement("div");s.className=`${n.prefix}-time-picker-input-container`,i.appendChild(s);let{hours:a}=n.format==="24h"?{hours:t.hours}:Nf(t.hours),o=document.createElement("div");o.className=`${n.prefix}-time-picker-time-input-field`;let l=document.createElement("input");l.type="number",l.className=`${n.prefix}-time-picker-hours`,l.min=n.format==="24h"?"0":"1",l.max=n.format==="24h"?"23":"12",l.value=ie(a),l.setAttribute("data-type","hour"),l.setAttribute("inputmode","numeric"),l.setAttribute("pattern","[0-9]*"),o.appendChild(l),s.appendChild(o);let d=document.createElement("div");d.className=`${n.prefix}-time-picker-separator`,d.textContent=":",s.appendChild(d);let u=document.createElement("div");u.className=`${n.prefix}-time-picker-time-input-field`;let c=document.createElement("input");c.type="number",c.className=`${n.prefix}-time-picker-minutes`,c.min="0",c.max="59",c.value=ie(t.minutes),c.setAttribute("data-type","minute"),c.setAttribute("inputmode","numeric"),c.setAttribute("pattern","[0-9]*"),u.appendChild(c),s.appendChild(u);let p;if(n.showSeconds){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-separator`,y.textContent=":",s.appendChild(y);let L=document.createElement("div");L.className=`${n.prefix}-time-picker-time-input-field`,p=document.createElement("input"),p.type="number",p.className=`${n.prefix}-time-picker-seconds`,p.min="0",p.max="59",p.value=ie(t.seconds||0),p.setAttribute("data-type","second"),p.setAttribute("inputmode","numeric"),p.setAttribute("pattern","[0-9]*");let I=document.createElement("label");I.className=`${n.prefix}-time-picker-input-label`,I.textContent="Second",L.appendChild(p),L.appendChild(I),s.appendChild(L)}if(n.format==="12h"){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-period`;let L=document.createElement("div");L.className=`${n.prefix}-time-picker-period-am ${t.period==="AM"?`${n.prefix}-time-picker-period--selected`:""}`,L.textContent="AM",L.setAttribute("role","button"),L.setAttribute("tabindex","0"),L.setAttribute("aria-pressed",t.period==="AM"?"true":"false");let I=document.createElement("div");I.className=`${n.prefix}-time-picker-period-pm ${t.period==="PM"?`${n.prefix}-time-picker-period--selected`:""}`,I.textContent="PM",I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.setAttribute("aria-pressed",t.period==="PM"?"true":"false"),y.appendChild(L),y.appendChild(I),s.appendChild(y)}let g=document.createElement("div");g.className=`${n.prefix}-time-picker-dial`,g.style.display=n.type==="dial"?"block":"none",i.appendChild(g);let f=document.createElement("canvas");f.className=`${n.prefix}-time-picker-dial-canvas`,f.width=Xt.DIAMETER,f.height=Xt.DIAMETER,f.style.width=`${Xt.DIAMETER}px`,f.style.height=`${Xt.DIAMETER}px`,g.appendChild(f);let m=document.createElement("div");m.className=`${n.prefix}-time-picker-actions`,e.appendChild(m);let h=document.createElement("button");h.className=`${n.prefix}-time-picker-toggle-type`,h.setAttribute("aria-label",n.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),h.innerHTML=n.type==="dial"?n.keyboardIcon||dt.KEYBOARD:n.clockIcon||dt.CLOCK,m.appendChild(h);let C=document.createElement("div");C.className=`${n.prefix}-time-picker-action-buttons`,m.appendChild(C);let T=document.createElement("button");T.className=`${n.prefix}-time-picker-cancel`,T.textContent=n.cancelText||"Cancel",T.setAttribute("type","button"),C.appendChild(T);let b=document.createElement("button");b.className=`${n.prefix}-time-picker-confirm`,b.textContent=n.confirmText||"OK",b.setAttribute("type","button"),C.appendChild(b);let E="hour";if(n.type==="dial")setTimeout(()=>{we(f,t,{type:n.type,format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})},0);h.addEventListener("click",()=>{if(g.style.display==="none")g.style.display="block",h.innerHTML=n.keyboardIcon||dt.KEYBOARD,h.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{f.focus(),document.querySelectorAll(`.${n.prefix}-time-picker-hours`).forEach((x)=>x.setAttribute("data-active","true")),document.querySelectorAll(`.${n.prefix}-time-picker-minutes`).forEach((x)=>x.setAttribute("data-active","false")),document.querySelectorAll(`.${n.prefix}-time-picker-seconds`).forEach((x)=>x.setAttribute("data-active","false")),we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:"hour"})},50);else g.style.display="none",h.innerHTML=n.clockIcon||dt.CLOCK,h.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{l.focus(),l.select()},50)});let v=(y)=>{let L=y.target,I=L.getAttribute("data-type"),x=L.value;if(x==="")return;let A=parseInt(x,10);if(isNaN(A))return;if(I==="hour"){let N=A;if(n.format==="12h"){if(A<0)N=1;if(A>12)N=12;if(t.period==="PM"&&N!==12)N+=12;else if(t.period==="AM"&&N===12)N=0}else{if(A<0)N=0;if(A>23)N=23}if(t.hours=N,E="hour",l.setAttribute("data-active","true"),c.setAttribute("data-active","false"),p)p.setAttribute("data-active","false");if(we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("hours",N)}else if(I==="minute"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.minutes=N,E="minute",l.setAttribute("data-active","false"),c.setAttribute("data-active","true"),p)p.setAttribute("data-active","false");if(we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("minutes",N)}else if(I==="second"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.seconds=N,E="second",l.setAttribute("data-active","false"),c.setAttribute("data-active","false"),p)p.setAttribute("data-active","true");if(we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("seconds",N)}};if(l.addEventListener("input",v),c.addEventListener("input",v),p)p.addEventListener("input",v);if(l.addEventListener("keyup",(y)=>{if(y.key==="Enter")c.focus(),c.select()}),c.addEventListener("keyup",(y)=>{if(y.key==="Enter")if(n.showSeconds&&p)p.focus(),p.select();else b.focus()}),p)p.addEventListener("keyup",(y)=>{if(y.key==="Enter")b.focus()});let S=(y)=>{if(t.period!==y){let L=t.period;if(t.period=y,L==="AM"&&y==="PM"){if(t.hours<12)t.hours+=12}else if(L==="PM"&&y==="AM"){if(t.hours>=12)t.hours-=12}if(n.format==="12h"){let x=t.hours===0?12:t.hours>12?t.hours-12:t.hours;l.value=ie(x)}document.querySelectorAll(`.${n.prefix}-time-picker-period-am, .${n.prefix}-time-picker-period-pm`).forEach((x)=>{x.classList.remove(`${n.prefix}-time-picker-period--selected`),x.setAttribute("aria-pressed","false")});let I=document.querySelector(`.${n.prefix}-time-picker-period-${y.toLowerCase()}`);if(I)I.classList.add(`${n.prefix}-time-picker-period--selected`),I.setAttribute("aria-pressed","true");if(g.style.display==="block")we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(r)r("hours",t.hours)}};if(n.format==="12h"){let y=document.querySelector(`.${n.prefix}-time-picker-period-am`),L=document.querySelector(`.${n.prefix}-time-picker-period-pm`);if(y)y.addEventListener("click",()=>{S("AM")});if(L)L.addEventListener("click",()=>{S("PM")})}if(n.type==="dial"||g.style.display==="block"){if(f.addEventListener("click",(y)=>{let L=f.getBoundingClientRect(),I=y.clientX-L.left,x=y.clientY-L.top,A=gi(f,I,x,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(A!==null){if(E==="hour"){let N=A;if(n.format==="12h"){if(t.period==="PM"&&A!==12)N+=12;else if(t.period==="AM"&&A===12)N=0}if(t.hours=N,n.format==="12h"){let k=N===0?12:N>12?N-12:N;l.value=ie(k)}else l.value=ie(N);if(r)r("hours",N)}else if(E==="minute"){if(t.minutes=A,c.value=ie(A),r)r("minutes",A)}else if(E==="second"&&p){if(t.seconds=A,p.value=ie(A),r)r("seconds",A)}we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),l.addEventListener("click",()=>{if(g.style.display==="block"){if(E="hour",l.setAttribute("data-active","true"),c.setAttribute("data-active","false"),p)p.setAttribute("data-active","false");we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),c.addEventListener("click",()=>{if(g.style.display==="block"){if(E="minute",l.setAttribute("data-active","false"),c.setAttribute("data-active","true"),p)p.setAttribute("data-active","false");we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),p)p.addEventListener("click",()=>{if(g.style.display==="block")E="second",l.setAttribute("data-active","false"),c.setAttribute("data-active","false"),p.setAttribute("data-active","true"),we(f,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})})}};var Df=(e,t,n,r,i,s)=>{let a=!!i.isOpen,o=(c)=>{if(c.key==="Escape")d.close(),s.events.emit(_e.CANCEL)},l=(c)=>{if(c.target===t)d.close()},d={element:e.element,modalElement:t,dialogElement:n,isOpen:a,open(){if(a)return this;if(t.style.display="block",t.offsetWidth,t.classList.add("active"),n.classList.add("active"),document.addEventListener("keydown",o),t.addEventListener("click",l),a=!0,e.element.classList.add(`${i.prefix}-time-picker--open`),setTimeout(()=>{je(n,r,i)},50),s.events.emit(_e.OPEN),i.onOpen)i.onOpen();return this},close(){if(!a)return this;if(t.classList.remove("active"),n.classList.remove("active"),setTimeout(()=>{t.style.display="none"},300),document.removeEventListener("keydown",o),t.removeEventListener("click",l),a=!1,e.element.classList.remove(`${i.prefix}-time-picker--open`),s.events.emit(_e.CLOSE),i.onClose)i.onClose();return this},toggle(){return a?this.close():this.open()},getValue(){return Af(r,i.format==="24h")},getTimeObject(){return{...r}},setValue(c){try{let p=c.split(":"),g=parseInt(p[0],10),f=parseInt(p[1],10),m=p[2]?parseInt(p[2],10):0;if(isNaN(g)||g<0||g>23||isNaN(f)||f<0||f>59||isNaN(m)||m<0||m>59)throw Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(r.hours=g,r.minutes=f,r.seconds=m,r.period=g>=12?"PM":"AM",je(n,r,i),s.events.emit(_e.CHANGE,this.getValue()),i.onChange)i.onChange(this.getValue())}catch(p){console.error("Error setting time value:",p)}return this},setType(c){if(i.type===c)return this;return i.type=c,n.classList.remove(`${i.prefix}-time-picker-dialog--${"dial"}`,`${i.prefix}-time-picker-dialog--${"input"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${c}`),je(n,r,i),this},getType(){return i.type},setFormat(c){if(i.format===c)return this;if(i.format=c,n.classList.remove(`${i.prefix}-time-picker-dialog--${"12h"}`,`${i.prefix}-time-picker-dialog--${"24h"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${c}`),c==="24h")r.period=r.hours>=12?"PM":"AM";else r.period=r.hours>=12?"PM":"AM";return je(n,r,i),s.events.emit(_e.CHANGE,this.getValue()),this},getFormat(){return i.format},setOrientation(c){if(i.orientation===c)return this;return i.orientation=c,n.classList.remove(`${i.prefix}-time-picker-dialog--${"vertical"}`,`${i.prefix}-time-picker-dialog--${"horizontal"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${c}`),je(n,r,i),this},getOrientation(){return i.orientation},setTitle(c){i.title=c;let p=n.querySelector(de.TITLE);if(p)p.textContent=c;else je(n,r,i);return this},getTitle(){return i.title||""},destroy(){if(a)this.close();if(t&&t.parentNode)t.parentNode.removeChild(t);s.lifecycle.destroy()},on(c,p){return s.events.on(c,p),this},off(c,p){return s.events.off(c,p),this}};n.addEventListener("click",(c)=>{let p=c.target;if(p.closest(de.CANCEL_BUTTON)){if(d.close(),s.events.emit(_e.CANCEL),i.onCancel)i.onCancel()}if(p.closest(de.CONFIRM_BUTTON)){if(d.close(),s.events.emit(_e.CONFIRM,d.getValue()),i.onConfirm)i.onConfirm(d.getValue())}if(p.closest(de.TOGGLE_TYPE_BUTTON)){let g=i.type==="dial"?"input":"dial";d.setType(g)}if(p.closest(de.PERIOD_AM)){if(r.period!=="AM"){if(r.period="AM",r.hours>=12)r.hours-=12;if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(p.closest(de.PERIOD_PM)){if(r.period!=="PM"){if(r.period="PM",r.hours<12)r.hours+=12;if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(p.closest(de.DIAL_CANVAS)){if(i.type==="dial"){let g=p,f=g.getBoundingClientRect(),m=c.clientX-f.left,h=c.clientY-f.top,C="hour",T=n.querySelector(de.HOURS_INPUT),b=n.querySelector(de.MINUTES_INPUT),E=n.querySelector(de.SECONDS_INPUT);if(T&&T.getAttribute("data-active")==="true")C="hour";else if(b&&b.getAttribute("data-active")==="true")C="minute";else if(i.showSeconds&&E&&E.getAttribute("data-active")==="true")C="second";let v=gi(g,m,h,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(v!==null){if(C==="hour"){let S=v;if(i.format==="12h"){if(r.period==="PM"&&v!==12)S+=12;else if(r.period==="AM"&&v===12)S=0}if(r.hours!==S){r.hours=S;let y=T;if(y)y.textContent=ie(i.format==="24h"?S:S%12||12);let L=n.querySelector(de.DIAL_CANVAS);if(L)we(L,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(C==="minute"){if(r.minutes!==v){r.minutes=v;let S=b;if(S)S.textContent=ie(v);let y=n.querySelector(de.DIAL_CANVAS);if(y)we(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(C==="second"&&i.showSeconds){if(r.seconds!==v){r.seconds=v;let S=E;if(S)S.textContent=ie(v);let y=n.querySelector(de.DIAL_CANVAS);if(y)we(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}}}}});let u=(c)=>{let p=c.target,g=p.getAttribute("data-type"),f=parseInt(p.value,10);if(isNaN(f))return;if(g==="hour"){let m=f;if(i.format==="12h"){if(f<1)m=12;if(f>12)m=1;if(r.period==="PM"&&m!==12)m+=12;else if(r.period==="AM"&&m===12)m=0}else{if(f<0)m=0;if(f>23)m=23}r.hours=m}else if(g==="minute"){let m=f;if(m<0)m=0;if(m>59)m=59;r.minutes=m}else if(g==="second"){let m=f;if(m<0)m=0;if(m>59)m=59;r.seconds=m}if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())};return n.addEventListener("change",(c)=>{let p=c.target;if(p.matches(de.HOURS_INPUT)||p.matches(de.MINUTES_INPUT)||p.matches(de.SECONDS_INPUT))u(c)}),n.addEventListener("keyup",(c)=>{let p=c.target;if(p.matches(de.HOURS_INPUT)||p.matches(de.MINUTES_INPUT)||p.matches(de.SECONDS_INPUT)){if(c.key==="Enter"){if(u(c),p.matches(de.HOURS_INPUT)){let g=n.querySelector(de.MINUTES_INPUT);if(g)g.focus()}else if(p.matches(de.MINUTES_INPUT))if(i.showSeconds){let g=n.querySelector(de.SECONDS_INPUT);if(g)g.focus()}else{let g=n.querySelector(de.CONFIRM_BUTTON);if(g)g.focus()}else if(p.matches(de.SECONDS_INPUT)){let g=n.querySelector(de.CONFIRM_BUTTON);if(g)g.focus()}}}}),d};var DC=(e={})=>{let t=yf(e);try{let n=M(D,B(),O(xf(t)),P())(t),r=document.createElement("div");r.className=`${Y}-time-picker-modal`,r.style.display="none",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.4)",r.style.zIndex=Pa.MODAL.toString(),r.setAttribute("role","presentation");let i=document.createElement("div");i.className=[`${Y}-time-picker-dialog`,`${Y}-time-picker-dialog--${t.type}`,`${Y}-time-picker-dialog--${t.orientation}`,`${Y}-time-picker-dialog--${t.format}`].join(" "),i.style.position="absolute",i.style.top="50%",i.style.left="50%",i.style.transform="translate(-50%, -50%)",i.style.zIndex=Pa.DIALOG.toString(),r.appendChild(i),(typeof t.container==="string"?document.querySelector(t.container)||document.body:t.container||document.body).appendChild(r);let a;if(t.value)a=Lf(t.value,t.format);else{let l=new Date;a={hours:l.getHours(),minutes:l.getMinutes(),seconds:t.showSeconds?l.getSeconds():0,period:l.getHours()>=12?"PM":"AM"}}je(i,a,t);let o=Df(n,r,i,a,t,If(n));if(t.isOpen)setTimeout(()=>o.open(),0);return o}catch(n){throw console.error("TimePicker creation error:",n),Error(`Failed to create time picker: ${n.message}`)}},Ba=DC;ne();Q();var MC={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"};var Nn={TAG:"header",TYPE:MC.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4};var OC={tag:Nn.TAG,type:Nn.TYPE,scrollable:Nn.SCROLLABLE,compressible:Nn.COMPRESSIBLE,scrollThreshold:Nn.SCROLL_THRESHOLD},Mf=(e={})=>_(OC,e,"top-app-bar");var Of=(e={})=>{let t=Mf(e),n=D(t),r=()=>{let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-leading`;let h=document.createElement("h1");if(h.className=`${n.getClass("top-app-bar")}-headline`,t.title)h.textContent=t.title;let C=document.createElement("div");return C.className=`${n.getClass("top-app-bar")}-trailing`,{leadingContainer:m,headlineElement:h,trailingContainer:C}},{leadingContainer:i,headlineElement:s,trailingContainer:a}=r(),o=()=>{let m=[t.class];if(t.type!=="small")m.push(`${n.getClass("top-app-bar")}--${t.type}`);if(t.compressible&&(t.type==="medium"||t.type==="large"))m.push(`${n.getClass("top-app-bar")}--compressible`);return m.filter(Boolean)},l=O({tag:t.tag,componentName:"top-app-bar",className:o(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(n),d=B()(l),u=P()(d);(()=>{if(t.type==="medium"||t.type==="large"){let m=document.createElement("div");m.className=`${n.getClass("top-app-bar")}-row`,m.appendChild(i),m.appendChild(a);let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(s),u.element.appendChild(m),u.element.appendChild(h)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)})();let p=!1;if(t.scrollable){let m=()=>{let C=window.scrollY>t.scrollThreshold;if(p!==C){if(p=C,p)u.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else u.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);t.onScroll?.(p)}};window.addEventListener("scroll",m,{passive:!0}),m();let h=u.lifecycle.destroy;u.lifecycle.destroy=()=>{window.removeEventListener("scroll",m),h()}}let g=(m)=>{while(u.element.firstChild)u.element.removeChild(u.element.firstChild);if(["small","medium","large","center"].forEach((h)=>{u.element.classList.remove(`${n.getClass("top-app-bar")}--${h}`)}),m!=="small")u.element.classList.add(`${n.getClass("top-app-bar")}--${m}`);if(u.element.classList.toggle(`${n.getClass("top-app-bar")}--compressible`,t.compressible&&(m==="medium"||m==="large")),m==="medium"||m==="large"){let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(i),h.appendChild(a);let C=document.createElement("div");C.className=`${n.getClass("top-app-bar")}-row`,C.appendChild(s),u.element.appendChild(h),u.element.appendChild(C)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)};return{...u,setTitle(m){return s.textContent=m,this},getTitle(){return s.textContent||""},addLeadingElement(m){return i.appendChild(m),this},addTrailingElement(m){return a.appendChild(m),this},setType(m){return t.type=m,g(m),this},setScrollState(m){if(p=m,m)this.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return s},getLeadingContainer(){return i},getTrailingContainer(){return a}}};var Rf=Of;rt();ne();Z();J();var De={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var _f=8;var Pf=({lifecycle:e})=>(t)=>{let n=null,r=De.BOTTOM,i=!1,s=null,a=null,o=300,l=100,d=!0,u=!0,c=document.createElement("div");c.className=`${t.getClass("tooltip")}__arrow`,t.element.appendChild(c),document.body.appendChild(t.element),t.element.setAttribute("aria-hidden","true");let p=()=>{if(!n)return{top:0,left:0};let S=t.element.getBoundingClientRect(),y=n.getBoundingClientRect(),L=window.scrollY||window.pageYOffset,I=window.scrollX||window.pageXOffset,x=_f,A=0,N=0,k;switch(r){case De.TOP:A=y.top+L-S.height-x,N=y.left+I+y.width/2-S.width/2,k="bottom";break;case De.TOP_START:A=y.top+L-S.height-x,N=y.left+I,k="bottom-start";break;case De.TOP_END:A=y.top+L-S.height-x,N=y.left+I+y.width-S.width,k="bottom-end";break;case De.RIGHT:A=y.top+L+y.height/2-S.height/2,N=y.left+I+y.width+x,k="left";break;case De.RIGHT_START:A=y.top+L,N=y.left+I+y.width+x,k="left-start";break;case De.RIGHT_END:A=y.top+L+y.height-S.height,N=y.left+I+y.width+x,k="left-end";break;case De.BOTTOM:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,k="top";break;case De.BOTTOM_START:A=y.top+L+y.height+x,N=y.left+I,k="top-start";break;case De.BOTTOM_END:A=y.top+L+y.height+x,N=y.left+I+y.width-S.width,k="top-end";break;case De.LEFT:A=y.top+L+y.height/2-S.height/2,N=y.left+I-S.width-x,k="right";break;case De.LEFT_START:A=y.top+L,N=y.left+I-S.width-x,k="right-start";break;case De.LEFT_END:A=y.top+L+y.height-S.height,N=y.left+I-S.width-x,k="right-end";break;default:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,k="top"}let X=window.innerWidth;if(N<0)N=0;else if(N+S.width>X)N=X-S.width;return{top:A,left:N,arrowPosition:k}},g=(S)=>{if(u)S.addEventListener("mouseenter",m),S.addEventListener("mouseleave",h);if(d)S.addEventListener("focus",C),S.addEventListener("blur",T)},f=(S)=>{if(S)S.removeEventListener("mouseenter",m),S.removeEventListener("mouseleave",h),S.removeEventListener("focus",C),S.removeEventListener("blur",T)},m=()=>b.show(),h=()=>b.hide(),C=()=>b.show(),T=()=>b.hide(),b={element:t.element,target:n,lifecycle:e,getClass:t.getClass,setText(S){let y=document.createTextNode(S);while(t.element.firstChild!==c)t.element.removeChild(t.element.firstChild);if(t.element.insertBefore(y,c),i)this.updatePosition();return this},getText(){let S=t.element.cloneNode(!0),y=S.querySelector(`.${t.getClass("tooltip")}__arrow`);if(y)y.remove();return S.textContent||""},setPosition(S){r=S;let y=t.getClass("tooltip"),L=Object.values(De).map((I)=>`${y}--${I}`);if(t.element.classList.remove(...L),t.element.classList.add(`${y}--${S}`),i)this.updatePosition();return this},getPosition(){return r},setTarget(S){if(n)f(n);if(n=S,this.target=S,n.setAttribute("aria-describedby",t.element.id),g(n),i)this.updatePosition();return this},show(S=!1){if(s!==null)window.clearTimeout(s),s=null;if(a!==null)window.clearTimeout(a),a=null;let y=()=>{if(!n)return this;t.element.setAttribute("aria-hidden","false"),t.element.classList.add(`${t.getClass("tooltip")}--visible`),i=!0,this.updatePosition(),window.addEventListener("resize",E),window.addEventListener("scroll",v)};if(S)y();else s=window.setTimeout(y,o);return this},hide(S=!1){if(a!==null)window.clearTimeout(a),a=null;if(s!==null)window.clearTimeout(s),s=null;let y=()=>{t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("tooltip")}--visible`),i=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",v)};if(S)y();else a=window.setTimeout(y,l);return this},isVisible(){return i},updatePosition(){if(!n)return this;let{top:S,left:y,arrowPosition:L}=p();if(t.element.style.top=`${Math.round(S)}px`,t.element.style.left=`${Math.round(y)}px`,L)c.className=`${t.getClass("tooltip")}__arrow`,c.classList.add(`${t.getClass("tooltip")}__arrow--${L}`);return this},destroy(){if(s!==null)window.clearTimeout(s);if(a!==null)window.clearTimeout(a);if(n)f(n),n.removeAttribute("aria-describedby");if(window.removeEventListener("resize",E),window.removeEventListener("scroll",v),t.element.parentNode)t.element.parentNode.removeChild(t.element);e.destroy()}},E=()=>{b.updatePosition()},v=()=>{b.updatePosition()};return b};Q();var RC={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},_C={DEFAULT:"default",RICH:"rich",PLAIN:"plain"};var vt={POSITION:RC.BOTTOM,VARIANT:_C.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1};var PC={position:vt.POSITION,variant:vt.VARIANT,visible:vt.VISIBLE,showDelay:vt.SHOW_DELAY,hideDelay:vt.HIDE_DELAY,showOnFocus:vt.SHOW_ON_FOCUS,showOnHover:vt.SHOW_ON_HOVER,rich:vt.RICH},Bf=(e={})=>_(PC,e,"tooltip"),kf=(e)=>{let t={role:"tooltip","aria-hidden":"true"};if(e.zIndex!==void 0)t.style=`z-index: ${e.zIndex};`;return V(e,{tag:"div",attributes:t,className:[e.class,`${e.prefix}-tooltip--${e.position}`,`${e.prefix}-tooltip--${e.variant}`],text:e.text||""})},Hf=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});var BC=()=>`${Y}-tooltip-${Math.random().toString(36).substring(2,9)}`,kC=(e={})=>{let t=Bf(e);try{let n=M(D,O(kf(t)),P(),(r)=>Pf(Hf(r))(r))(t);if(n.element.id=BC(),t.target)n.setTarget(t.target);if(t.text)n.setText(t.text);if(t.visible)n.show(!0);return n}catch(n){throw console.error("Tooltip creation error:",n),Error(`Failed to create tooltip: ${n.message}`)}},ka=kC;sn();sn();
55
+ </svg>`},Rt={TYPE:SC.DIAL,FORMAT:xC.AMPM,ORIENTATION:yC.VERTICAL,SHOW_SECONDS:!1,CLOSE_ON_SELECT:!0,MINUTE_STEP:1,SECOND_STEP:1,CANCEL_TEXT:"Cancel",CONFIRM_TEXT:"OK",IS_OPEN:!1,CLOCK_ICON:dt.CLOCK,KEYBOARD_ICON:dt.KEYBOARD};var IC={type:"dial",format:"12h",orientation:"vertical",showSeconds:Rt.SHOW_SECONDS,closeOnSelect:Rt.CLOSE_ON_SELECT,minuteStep:Rt.MINUTE_STEP,secondStep:Rt.SECOND_STEP,cancelText:Rt.CANCEL_TEXT,confirmText:Rt.CONFIRM_TEXT,isOpen:Rt.IS_OPEN,clockIcon:dt.CLOCK,keyboardIcon:dt.KEYBOARD},yf=(e={})=>P(IC,e,"time-picker"),xf=(e)=>V(e,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${e.prefix}-time-picker-title`},className:[e.class,e.isOpen?`${e.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0});var If=(e)=>({events:{on:(t,n)=>e.on(t,n),off:(t,n)=>e.off(t,n),emit:(t,n)=>e.emit(t,n)},lifecycle:{destroy:()=>e.lifecycle.destroy()}});var ie=(e)=>e.toString().padStart(2,"0"),Lf=(e,t)=>{try{let n=e.split(":"),r=parseInt(n[0],10),i=parseInt(n[1],10),s=n[2]?parseInt(n[2],10):0;if(isNaN(r)||r<0||r>23||isNaN(i)||i<0||i>59||isNaN(s)||s<0||s>59)throw Error("Invalid time format");let a=r>=12?"PM":"AM";return{hours:r,minutes:i,seconds:s,period:a}}catch(n){console.error("Error parsing time:",n);let r=new Date,i=r.getHours(),s=r.getMinutes(),a=r.getSeconds(),o=i>=12?"PM":"AM";return{hours:i,minutes:s,seconds:a,period:o}}},Af=(e,t)=>{let{hours:n,minutes:r,seconds:i}=e;if(t){if(i!==void 0)return`${ie(n)}:${ie(r)}:${ie(i)}`;return`${ie(n)}:${ie(r)}`}else{let s=n%12;if(s===0)s=12;if(i!==void 0)return`${ie(s)}:${ie(r)}:${ie(i)} ${e.period}`;return`${ie(s)}:${ie(r)} ${e.period}`}};var Nf=(e)=>{let t=e>=12?"PM":"AM",n=e%12;if(n===0)n=12;return{hours:n,period:t}};var me={...Xt,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function LC(e){let t=document.documentElement,n=getComputedStyle(t),r=n.getPropertyValue(`--${e}-sys-color-primary`).trim()||"#6750A4",i=n.getPropertyValue(`--${e}-sys-color-on-primary`).trim()||"#FFFFFF",s=n.getPropertyValue(`--${e}-sys-color-on-surface`).trim()||"#1C1B1F",a=n.getPropertyValue(`--${e}-sys-color-primary-rgb`).trim()||"103, 80, 164",l=`rgba(${n.getPropertyValue(`--${e}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,d=`rgba(${a}, 0.1)`;return{primaryColor:r,onPrimaryColor:i,onSurfaceColor:s,bgColor:l,selectedBgColor:d}}var we=(e,t,n)=>{let r=e.getContext("2d");if(!r){console.error("Could not get canvas context");return}let i=LC(n.prefix),s=window.devicePixelRatio||1;e.width=me.DIAMETER*s,e.height=me.DIAMETER*s,r.scale(s,s);let a=me.DIAMETER/2,o=me.DIAMETER/2,l=me.DIAMETER/2;if(r.clearRect(0,0,e.width,e.height),r.beginPath(),r.arc(a,o,l-2,0,2*Math.PI),r.fillStyle=i.bgColor,r.fill(),r.beginPath(),r.arc(a,o,me.CENTER_SIZE/2,0,2*Math.PI),r.fillStyle=i.primaryColor,r.fill(),n.activeSelector==="hour")if(n.format==="24h")NC(r,a,o,l,t.hours,i);else AC(r,a,o,l,t.hours%12||12,i);else if(n.activeSelector==="minute")wf(r,a,o,l,t.minutes,i);else if(n.activeSelector==="second"&&n.showSeconds)wf(r,a,o,l,t.seconds||0,i);wC(r,a,o,t,n,i)},AC=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let o=1;o<=12;o++){let l=o/6*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),m=o===i;if(m)e.beginPath(),e.arc(d,u,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=m?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(o.toString(),d,u+2)}},NC=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let l=1;l<=12;l++){let d=l/6*Math.PI-Math.PI/2,u=t+a*Math.cos(d),m=n+a*Math.sin(d),p=l===i;if(p)e.beginPath(),e.arc(u,m,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=p?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(l.toString(),u,m+2)}let o=me.INNER_RADIUS;for(let l=13;l<=24;l++){let d=l===24?0:l,u=(l-12)/6*Math.PI-Math.PI/2,m=t+o*Math.cos(u),p=n+o*Math.sin(u),g=d===i;if(g)e.beginPath(),e.arc(m,p,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="14px Roboto, Arial, sans-serif",e.fillStyle=g?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(d),m,p+2)}},wf=(e,t,n,r,i,s)=>{let a=me.OUTER_RADIUS;for(let o=0;o<60;o+=5){let l=o/30*Math.PI-Math.PI/2,d=t+a*Math.cos(l),u=n+a*Math.sin(l),m=o===i;if(m)e.beginPath(),e.arc(d,u,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill();e.font="16px Roboto, Arial, sans-serif",e.fillStyle=m?s.primaryColor:s.onSurfaceColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(o),d,u)}if(i%5!==0){let o=i/30*Math.PI-Math.PI/2,l=t+a*Math.cos(o),d=n+a*Math.sin(o);e.beginPath(),e.arc(l,d,me.NUMBER_SIZE/2,0,2*Math.PI),e.fillStyle=s.selectedBgColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.primaryColor,e.textAlign="center",e.textBaseline="middle",e.fillText(ie(i),l,d)}},wC=(e,t,n,r,i,s)=>{let a,o;if(i.activeSelector==="hour")if(i.format==="24h")if(r.hours>=12)a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=me.INNER_RADIUS;else{let m=r.hours;if(m===0)m=12;a=m/6*Math.PI-Math.PI/2,o=me.OUTER_RADIUS}else a=(r.hours%12||12)/6*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else if(i.activeSelector==="minute")a=r.minutes/30*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else if(i.activeSelector==="second")a=(r.seconds||0)/30*Math.PI-Math.PI/2,o=me.OUTER_RADIUS;else return;e.beginPath(),e.moveTo(t,n),e.lineTo(t+o*Math.cos(a),n+o*Math.sin(a)),e.lineWidth=me.HAND_WIDTH,e.strokeStyle=s.primaryColor,e.stroke();let l=t+o*Math.cos(a),d=n+o*Math.sin(a);e.beginPath(),e.arc(l,d,me.KNOB_SIZE/2,0,2*Math.PI),e.fillStyle=s.primaryColor,e.fill(),e.font="16px Roboto, Arial, sans-serif",e.fillStyle=s.onPrimaryColor,e.textAlign="center",e.textBaseline="middle";let u="";if(i.activeSelector==="hour")if(i.format==="24h")u=ie(r.hours);else u=String(r.hours%12||12);else if(i.activeSelector==="minute")u=ie(r.minutes);else if(i.activeSelector==="second")u=ie(r.seconds||0);e.fillText(u,l,d)},gi=(e,t,n,r)=>{let i=me.DIAMETER/2,s=me.DIAMETER/2,a=t-i,o=n-s,l=Math.sqrt(a*a+o*o),d=Math.atan2(o,a)+Math.PI/2;if(d<0)d+=2*Math.PI;if(r.activeSelector==="hour")if(r.format==="24h"){let u=(me.INNER_RADIUS+me.OUTER_RADIUS)/2,m=l<u,p=Math.round(d/(Math.PI/6))%12;if(m&&p!==0)p+=12;else if(!m&&p===0)p=12;else if(m&&p===0)p=0;return p}else{let u=Math.round(d/(Math.PI/6))%12;if(u===0)u=12;return u}else if(r.activeSelector==="minute"||r.activeSelector==="second")return Math.round(d/(Math.PI/30))%60;return null};var je=(e,t,n,r)=>{if(e.innerHTML="",n.title){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-title`,y.textContent=n.title,y.id=`${n.prefix}-time-picker-title`,e.appendChild(y)}let i=document.createElement("div");i.className=`${n.prefix}-time-picker-content`,e.appendChild(i);let s=document.createElement("div");s.className=`${n.prefix}-time-picker-input-container`,i.appendChild(s);let{hours:a}=n.format==="24h"?{hours:t.hours}:Nf(t.hours),o=document.createElement("div");o.className=`${n.prefix}-time-picker-time-input-field`;let l=document.createElement("input");l.type="number",l.className=`${n.prefix}-time-picker-hours`,l.min=n.format==="24h"?"0":"1",l.max=n.format==="24h"?"23":"12",l.value=ie(a),l.setAttribute("data-type","hour"),l.setAttribute("inputmode","numeric"),l.setAttribute("pattern","[0-9]*"),o.appendChild(l),s.appendChild(o);let d=document.createElement("div");d.className=`${n.prefix}-time-picker-separator`,d.textContent=":",s.appendChild(d);let u=document.createElement("div");u.className=`${n.prefix}-time-picker-time-input-field`;let m=document.createElement("input");m.type="number",m.className=`${n.prefix}-time-picker-minutes`,m.min="0",m.max="59",m.value=ie(t.minutes),m.setAttribute("data-type","minute"),m.setAttribute("inputmode","numeric"),m.setAttribute("pattern","[0-9]*"),u.appendChild(m),s.appendChild(u);let p;if(n.showSeconds){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-separator`,y.textContent=":",s.appendChild(y);let L=document.createElement("div");L.className=`${n.prefix}-time-picker-time-input-field`,p=document.createElement("input"),p.type="number",p.className=`${n.prefix}-time-picker-seconds`,p.min="0",p.max="59",p.value=ie(t.seconds||0),p.setAttribute("data-type","second"),p.setAttribute("inputmode","numeric"),p.setAttribute("pattern","[0-9]*");let I=document.createElement("label");I.className=`${n.prefix}-time-picker-input-label`,I.textContent="Second",L.appendChild(p),L.appendChild(I),s.appendChild(L)}if(n.format==="12h"){let y=document.createElement("div");y.className=`${n.prefix}-time-picker-period`;let L=document.createElement("div");L.className=`${n.prefix}-time-picker-period-am ${t.period==="AM"?`${n.prefix}-time-picker-period--selected`:""}`,L.textContent="AM",L.setAttribute("role","button"),L.setAttribute("tabindex","0"),L.setAttribute("aria-pressed",t.period==="AM"?"true":"false");let I=document.createElement("div");I.className=`${n.prefix}-time-picker-period-pm ${t.period==="PM"?`${n.prefix}-time-picker-period--selected`:""}`,I.textContent="PM",I.setAttribute("role","button"),I.setAttribute("tabindex","0"),I.setAttribute("aria-pressed",t.period==="PM"?"true":"false"),y.appendChild(L),y.appendChild(I),s.appendChild(y)}let g=document.createElement("div");g.className=`${n.prefix}-time-picker-dial`,g.style.display=n.type==="dial"?"block":"none",i.appendChild(g);let c=document.createElement("canvas");c.className=`${n.prefix}-time-picker-dial-canvas`,c.width=Xt.DIAMETER,c.height=Xt.DIAMETER,c.style.width=`${Xt.DIAMETER}px`,c.style.height=`${Xt.DIAMETER}px`,g.appendChild(c);let f=document.createElement("div");f.className=`${n.prefix}-time-picker-actions`,e.appendChild(f);let h=document.createElement("button");h.className=`${n.prefix}-time-picker-toggle-type`,h.setAttribute("aria-label",n.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),h.innerHTML=n.type==="dial"?n.keyboardIcon||dt.KEYBOARD:n.clockIcon||dt.CLOCK,f.appendChild(h);let C=document.createElement("div");C.className=`${n.prefix}-time-picker-action-buttons`,f.appendChild(C);let T=document.createElement("button");T.className=`${n.prefix}-time-picker-cancel`,T.textContent=n.cancelText||"Cancel",T.setAttribute("type","button"),C.appendChild(T);let b=document.createElement("button");b.className=`${n.prefix}-time-picker-confirm`,b.textContent=n.confirmText||"OK",b.setAttribute("type","button"),C.appendChild(b);let E="hour";if(n.type==="dial")setTimeout(()=>{we(c,t,{type:n.type,format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})},0);h.addEventListener("click",()=>{if(g.style.display==="none")g.style.display="block",h.innerHTML=n.keyboardIcon||dt.KEYBOARD,h.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{c.focus(),document.querySelectorAll(`.${n.prefix}-time-picker-hours`).forEach((x)=>x.setAttribute("data-active","true")),document.querySelectorAll(`.${n.prefix}-time-picker-minutes`).forEach((x)=>x.setAttribute("data-active","false")),document.querySelectorAll(`.${n.prefix}-time-picker-seconds`).forEach((x)=>x.setAttribute("data-active","false")),we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:"hour"})},50);else g.style.display="none",h.innerHTML=n.clockIcon||dt.CLOCK,h.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{l.focus(),l.select()},50)});let v=(y)=>{let L=y.target,I=L.getAttribute("data-type"),x=L.value;if(x==="")return;let A=parseInt(x,10);if(isNaN(A))return;if(I==="hour"){let N=A;if(n.format==="12h"){if(A<0)N=1;if(A>12)N=12;if(t.period==="PM"&&N!==12)N+=12;else if(t.period==="AM"&&N===12)N=0}else{if(A<0)N=0;if(A>23)N=23}if(t.hours=N,E="hour",l.setAttribute("data-active","true"),m.setAttribute("data-active","false"),p)p.setAttribute("data-active","false");if(we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("hours",N)}else if(I==="minute"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.minutes=N,E="minute",l.setAttribute("data-active","false"),m.setAttribute("data-active","true"),p)p.setAttribute("data-active","false");if(we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("minutes",N)}else if(I==="second"){let N=A;if(A<0)N=0;if(A>59)N=59;if(t.seconds=N,E="second",l.setAttribute("data-active","false"),m.setAttribute("data-active","false"),p)p.setAttribute("data-active","true");if(we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E}),r)r("seconds",N)}};if(l.addEventListener("input",v),m.addEventListener("input",v),p)p.addEventListener("input",v);if(l.addEventListener("keyup",(y)=>{if(y.key==="Enter")m.focus(),m.select()}),m.addEventListener("keyup",(y)=>{if(y.key==="Enter")if(n.showSeconds&&p)p.focus(),p.select();else b.focus()}),p)p.addEventListener("keyup",(y)=>{if(y.key==="Enter")b.focus()});let S=(y)=>{if(t.period!==y){let L=t.period;if(t.period=y,L==="AM"&&y==="PM"){if(t.hours<12)t.hours+=12}else if(L==="PM"&&y==="AM"){if(t.hours>=12)t.hours-=12}if(n.format==="12h"){let x=t.hours===0?12:t.hours>12?t.hours-12:t.hours;l.value=ie(x)}document.querySelectorAll(`.${n.prefix}-time-picker-period-am, .${n.prefix}-time-picker-period-pm`).forEach((x)=>{x.classList.remove(`${n.prefix}-time-picker-period--selected`),x.setAttribute("aria-pressed","false")});let I=document.querySelector(`.${n.prefix}-time-picker-period-${y.toLowerCase()}`);if(I)I.classList.add(`${n.prefix}-time-picker-period--selected`),I.setAttribute("aria-pressed","true");if(g.style.display==="block")we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(r)r("hours",t.hours)}};if(n.format==="12h"){let y=document.querySelector(`.${n.prefix}-time-picker-period-am`),L=document.querySelector(`.${n.prefix}-time-picker-period-pm`);if(y)y.addEventListener("click",()=>{S("AM")});if(L)L.addEventListener("click",()=>{S("PM")})}if(n.type==="dial"||g.style.display==="block"){if(c.addEventListener("click",(y)=>{let L=c.getBoundingClientRect(),I=y.clientX-L.left,x=y.clientY-L.top,A=gi(c,I,x,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E});if(A!==null){if(E==="hour"){let N=A;if(n.format==="12h"){if(t.period==="PM"&&A!==12)N+=12;else if(t.period==="AM"&&A===12)N=0}if(t.hours=N,n.format==="12h"){let D=N===0?12:N>12?N-12:N;l.value=ie(D)}else l.value=ie(N);if(r)r("hours",N)}else if(E==="minute"){if(t.minutes=A,m.value=ie(A),r)r("minutes",A)}else if(E==="second"&&p){if(t.seconds=A,p.value=ie(A),r)r("seconds",A)}we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),l.addEventListener("click",()=>{if(g.style.display==="block"){if(E="hour",l.setAttribute("data-active","true"),m.setAttribute("data-active","false"),p)p.setAttribute("data-active","false");we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),m.addEventListener("click",()=>{if(g.style.display==="block"){if(E="minute",l.setAttribute("data-active","false"),m.setAttribute("data-active","true"),p)p.setAttribute("data-active","false");we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})}}),p)p.addEventListener("click",()=>{if(g.style.display==="block")E="second",l.setAttribute("data-active","false"),m.setAttribute("data-active","false"),p.setAttribute("data-active","true"),we(c,t,{type:"dial",format:n.format,showSeconds:n.showSeconds,prefix:n.prefix,activeSelector:E})})}};var Df=(e,t,n,r,i,s)=>{let a=!!i.isOpen,o=(m)=>{if(m.key==="Escape")d.close(),s.events.emit(_e.CANCEL)},l=(m)=>{if(m.target===t)d.close()},d={element:e.element,modalElement:t,dialogElement:n,isOpen:a,open(){if(a)return this;if(t.style.display="block",t.offsetWidth,t.classList.add("active"),n.classList.add("active"),document.addEventListener("keydown",o),t.addEventListener("click",l),a=!0,e.element.classList.add(`${i.prefix}-time-picker--open`),setTimeout(()=>{je(n,r,i)},50),s.events.emit(_e.OPEN),i.onOpen)i.onOpen();return this},close(){if(!a)return this;if(t.classList.remove("active"),n.classList.remove("active"),setTimeout(()=>{t.style.display="none"},300),document.removeEventListener("keydown",o),t.removeEventListener("click",l),a=!1,e.element.classList.remove(`${i.prefix}-time-picker--open`),s.events.emit(_e.CLOSE),i.onClose)i.onClose();return this},toggle(){return a?this.close():this.open()},getValue(){return Af(r,i.format==="24h")},getTimeObject(){return{...r}},setValue(m){try{let p=m.split(":"),g=parseInt(p[0],10),c=parseInt(p[1],10),f=p[2]?parseInt(p[2],10):0;if(isNaN(g)||g<0||g>23||isNaN(c)||c<0||c>59||isNaN(f)||f<0||f>59)throw Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(r.hours=g,r.minutes=c,r.seconds=f,r.period=g>=12?"PM":"AM",je(n,r,i),s.events.emit(_e.CHANGE,this.getValue()),i.onChange)i.onChange(this.getValue())}catch(p){console.error("Error setting time value:",p)}return this},setType(m){if(i.type===m)return this;return i.type=m,n.classList.remove(`${i.prefix}-time-picker-dialog--${"dial"}`,`${i.prefix}-time-picker-dialog--${"input"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${m}`),je(n,r,i),this},getType(){return i.type},setFormat(m){if(i.format===m)return this;if(i.format=m,n.classList.remove(`${i.prefix}-time-picker-dialog--${"12h"}`,`${i.prefix}-time-picker-dialog--${"24h"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${m}`),m==="24h")r.period=r.hours>=12?"PM":"AM";else r.period=r.hours>=12?"PM":"AM";return je(n,r,i),s.events.emit(_e.CHANGE,this.getValue()),this},getFormat(){return i.format},setOrientation(m){if(i.orientation===m)return this;return i.orientation=m,n.classList.remove(`${i.prefix}-time-picker-dialog--${"vertical"}`,`${i.prefix}-time-picker-dialog--${"horizontal"}`),n.classList.add(`${i.prefix}-time-picker-dialog--${m}`),je(n,r,i),this},getOrientation(){return i.orientation},setTitle(m){i.title=m;let p=n.querySelector(de.TITLE);if(p)p.textContent=m;else je(n,r,i);return this},getTitle(){return i.title||""},destroy(){if(a)this.close();if(t&&t.parentNode)t.parentNode.removeChild(t);s.lifecycle.destroy()},on(m,p){return s.events.on(m,p),this},off(m,p){return s.events.off(m,p),this}};n.addEventListener("click",(m)=>{let p=m.target;if(p.closest(de.CANCEL_BUTTON)){if(d.close(),s.events.emit(_e.CANCEL),i.onCancel)i.onCancel()}if(p.closest(de.CONFIRM_BUTTON)){if(d.close(),s.events.emit(_e.CONFIRM,d.getValue()),i.onConfirm)i.onConfirm(d.getValue())}if(p.closest(de.TOGGLE_TYPE_BUTTON)){let g=i.type==="dial"?"input":"dial";d.setType(g)}if(p.closest(de.PERIOD_AM)){if(r.period!=="AM"){if(r.period="AM",r.hours>=12)r.hours-=12;if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(p.closest(de.PERIOD_PM)){if(r.period!=="PM"){if(r.period="PM",r.hours<12)r.hours+=12;if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}if(p.closest(de.DIAL_CANVAS)){if(i.type==="dial"){let g=p,c=g.getBoundingClientRect(),f=m.clientX-c.left,h=m.clientY-c.top,C="hour",T=n.querySelector(de.HOURS_INPUT),b=n.querySelector(de.MINUTES_INPUT),E=n.querySelector(de.SECONDS_INPUT);if(T&&T.getAttribute("data-active")==="true")C="hour";else if(b&&b.getAttribute("data-active")==="true")C="minute";else if(i.showSeconds&&E&&E.getAttribute("data-active")==="true")C="second";let v=gi(g,f,h,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(v!==null){if(C==="hour"){let S=v;if(i.format==="12h"){if(r.period==="PM"&&v!==12)S+=12;else if(r.period==="AM"&&v===12)S=0}if(r.hours!==S){r.hours=S;let y=T;if(y)y.textContent=ie(i.format==="24h"?S:S%12||12);let L=n.querySelector(de.DIAL_CANVAS);if(L)we(L,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(C==="minute"){if(r.minutes!==v){r.minutes=v;let S=b;if(S)S.textContent=ie(v);let y=n.querySelector(de.DIAL_CANVAS);if(y)we(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}else if(C==="second"&&i.showSeconds){if(r.seconds!==v){r.seconds=v;let S=E;if(S)S.textContent=ie(v);let y=n.querySelector(de.DIAL_CANVAS);if(y)we(y,r,{type:i.type,format:i.format,showSeconds:i.showSeconds,prefix:i.prefix,activeSelector:C});if(s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())}}}}}});let u=(m)=>{let p=m.target,g=p.getAttribute("data-type"),c=parseInt(p.value,10);if(isNaN(c))return;if(g==="hour"){let f=c;if(i.format==="12h"){if(c<1)f=12;if(c>12)f=1;if(r.period==="PM"&&f!==12)f+=12;else if(r.period==="AM"&&f===12)f=0}else{if(c<0)f=0;if(c>23)f=23}r.hours=f}else if(g==="minute"){let f=c;if(f<0)f=0;if(f>59)f=59;r.minutes=f}else if(g==="second"){let f=c;if(f<0)f=0;if(f>59)f=59;r.seconds=f}if(je(n,r,i),s.events.emit(_e.CHANGE,d.getValue()),i.onChange)i.onChange(d.getValue())};return n.addEventListener("change",(m)=>{let p=m.target;if(p.matches(de.HOURS_INPUT)||p.matches(de.MINUTES_INPUT)||p.matches(de.SECONDS_INPUT))u(m)}),n.addEventListener("keyup",(m)=>{let p=m.target;if(p.matches(de.HOURS_INPUT)||p.matches(de.MINUTES_INPUT)||p.matches(de.SECONDS_INPUT)){if(m.key==="Enter"){if(u(m),p.matches(de.HOURS_INPUT)){let g=n.querySelector(de.MINUTES_INPUT);if(g)g.focus()}else if(p.matches(de.MINUTES_INPUT))if(i.showSeconds){let g=n.querySelector(de.SECONDS_INPUT);if(g)g.focus()}else{let g=n.querySelector(de.CONFIRM_BUTTON);if(g)g.focus()}else if(p.matches(de.SECONDS_INPUT)){let g=n.querySelector(de.CONFIRM_BUTTON);if(g)g.focus()}}}}),d};var DC=(e={})=>{let t=yf(e);try{let n=O(M,B(),R(xf(t)),k())(t),r=document.createElement("div");r.className=`${X}-time-picker-modal`,r.style.display="none",r.style.position="fixed",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",r.style.backgroundColor="rgba(0, 0, 0, 0.4)",r.style.zIndex=Pa.MODAL.toString(),r.setAttribute("role","presentation");let i=document.createElement("div");i.className=[`${X}-time-picker-dialog`,`${X}-time-picker-dialog--${t.type}`,`${X}-time-picker-dialog--${t.orientation}`,`${X}-time-picker-dialog--${t.format}`].join(" "),i.style.position="absolute",i.style.top="50%",i.style.left="50%",i.style.transform="translate(-50%, -50%)",i.style.zIndex=Pa.DIALOG.toString(),r.appendChild(i),(typeof t.container==="string"?document.querySelector(t.container)||document.body:t.container||document.body).appendChild(r);let a;if(t.value)a=Lf(t.value,t.format);else{let l=new Date;a={hours:l.getHours(),minutes:l.getMinutes(),seconds:t.showSeconds?l.getSeconds():0,period:l.getHours()>=12?"PM":"AM"}}je(i,a,t);let o=Df(n,r,i,a,t,If(n));if(t.isOpen)setTimeout(()=>o.open(),0);return o}catch(n){throw console.error("TimePicker creation error:",n),Error(`Failed to create time picker: ${n.message}`)}},ka=DC;ne();Q();var MC={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"};var Nn={TAG:"header",TYPE:MC.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4};var OC={tag:Nn.TAG,type:Nn.TYPE,scrollable:Nn.SCROLLABLE,compressible:Nn.COMPRESSIBLE,scrollThreshold:Nn.SCROLL_THRESHOLD},Mf=(e={})=>P(OC,e,"top-app-bar");var Of=(e={})=>{let t=Mf(e),n=M(t),r=()=>{let f=document.createElement("div");f.className=`${n.getClass("top-app-bar")}-leading`;let h=document.createElement("h1");if(h.className=`${n.getClass("top-app-bar")}-headline`,t.title)h.textContent=t.title;let C=document.createElement("div");return C.className=`${n.getClass("top-app-bar")}-trailing`,{leadingContainer:f,headlineElement:h,trailingContainer:C}},{leadingContainer:i,headlineElement:s,trailingContainer:a}=r(),o=()=>{let f=[t.class];if(t.type!=="small")f.push(`${n.getClass("top-app-bar")}--${t.type}`);if(t.compressible&&(t.type==="medium"||t.type==="large"))f.push(`${n.getClass("top-app-bar")}--compressible`);return f.filter(Boolean)},l=R({tag:t.tag,componentName:"top-app-bar",className:o(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(n),d=B()(l),u=k()(d);(()=>{if(t.type==="medium"||t.type==="large"){let f=document.createElement("div");f.className=`${n.getClass("top-app-bar")}-row`,f.appendChild(i),f.appendChild(a);let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(s),u.element.appendChild(f),u.element.appendChild(h)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)})();let p=!1;if(t.scrollable){let f=()=>{let C=window.scrollY>t.scrollThreshold;if(p!==C){if(p=C,p)u.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else u.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);t.onScroll?.(p)}};window.addEventListener("scroll",f,{passive:!0}),f();let h=u.lifecycle.destroy;u.lifecycle.destroy=()=>{window.removeEventListener("scroll",f),h()}}let g=(f)=>{while(u.element.firstChild)u.element.removeChild(u.element.firstChild);if(["small","medium","large","center"].forEach((h)=>{u.element.classList.remove(`${n.getClass("top-app-bar")}--${h}`)}),f!=="small")u.element.classList.add(`${n.getClass("top-app-bar")}--${f}`);if(u.element.classList.toggle(`${n.getClass("top-app-bar")}--compressible`,t.compressible&&(f==="medium"||f==="large")),f==="medium"||f==="large"){let h=document.createElement("div");h.className=`${n.getClass("top-app-bar")}-row`,h.appendChild(i),h.appendChild(a);let C=document.createElement("div");C.className=`${n.getClass("top-app-bar")}-row`,C.appendChild(s),u.element.appendChild(h),u.element.appendChild(C)}else u.element.appendChild(i),u.element.appendChild(s),u.element.appendChild(a)};return{...u,setTitle(f){return s.textContent=f,this},getTitle(){return s.textContent||""},addLeadingElement(f){return i.appendChild(f),this},addTrailingElement(f){return a.appendChild(f),this},setType(f){return t.type=f,g(f),this},setScrollState(f){if(p=f,f)this.element.classList.add(`${n.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${n.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return s},getLeadingContainer(){return i},getTrailingContainer(){return a}}};var Rf=Of;rt();ne();Z();J();var De={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"};var _f=8;var Pf=({lifecycle:e})=>(t)=>{let n=null,r=De.BOTTOM,i=!1,s=null,a=null,o=300,l=100,d=!0,u=!0,m=document.createElement("div");m.className=`${t.getClass("tooltip")}__arrow`,t.element.appendChild(m),document.body.appendChild(t.element),t.element.setAttribute("aria-hidden","true");let p=()=>{if(!n)return{top:0,left:0};let S=t.element.getBoundingClientRect(),y=n.getBoundingClientRect(),L=window.scrollY||window.pageYOffset,I=window.scrollX||window.pageXOffset,x=_f,A=0,N=0,D;switch(r){case De.TOP:A=y.top+L-S.height-x,N=y.left+I+y.width/2-S.width/2,D="bottom";break;case De.TOP_START:A=y.top+L-S.height-x,N=y.left+I,D="bottom-start";break;case De.TOP_END:A=y.top+L-S.height-x,N=y.left+I+y.width-S.width,D="bottom-end";break;case De.RIGHT:A=y.top+L+y.height/2-S.height/2,N=y.left+I+y.width+x,D="left";break;case De.RIGHT_START:A=y.top+L,N=y.left+I+y.width+x,D="left-start";break;case De.RIGHT_END:A=y.top+L+y.height-S.height,N=y.left+I+y.width+x,D="left-end";break;case De.BOTTOM:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,D="top";break;case De.BOTTOM_START:A=y.top+L+y.height+x,N=y.left+I,D="top-start";break;case De.BOTTOM_END:A=y.top+L+y.height+x,N=y.left+I+y.width-S.width,D="top-end";break;case De.LEFT:A=y.top+L+y.height/2-S.height/2,N=y.left+I-S.width-x,D="right";break;case De.LEFT_START:A=y.top+L,N=y.left+I-S.width-x,D="right-start";break;case De.LEFT_END:A=y.top+L+y.height-S.height,N=y.left+I-S.width-x,D="right-end";break;default:A=y.top+L+y.height+x,N=y.left+I+y.width/2-S.width/2,D="top"}let G=window.innerWidth;if(N<0)N=0;else if(N+S.width>G)N=G-S.width;return{top:A,left:N,arrowPosition:D}},g=(S)=>{if(u)S.addEventListener("mouseenter",f),S.addEventListener("mouseleave",h);if(d)S.addEventListener("focus",C),S.addEventListener("blur",T)},c=(S)=>{if(S)S.removeEventListener("mouseenter",f),S.removeEventListener("mouseleave",h),S.removeEventListener("focus",C),S.removeEventListener("blur",T)},f=()=>b.show(),h=()=>b.hide(),C=()=>b.show(),T=()=>b.hide(),b={element:t.element,target:n,lifecycle:e,getClass:t.getClass,setText(S){let y=document.createTextNode(S);while(t.element.firstChild!==m)t.element.removeChild(t.element.firstChild);if(t.element.insertBefore(y,m),i)this.updatePosition();return this},getText(){let S=t.element.cloneNode(!0),y=S.querySelector(`.${t.getClass("tooltip")}__arrow`);if(y)y.remove();return S.textContent||""},setPosition(S){r=S;let y=t.getClass("tooltip"),L=Object.values(De).map((I)=>`${y}--${I}`);if(t.element.classList.remove(...L),t.element.classList.add(`${y}--${S}`),i)this.updatePosition();return this},getPosition(){return r},setTarget(S){if(n)c(n);if(n=S,this.target=S,n.setAttribute("aria-describedby",t.element.id),g(n),i)this.updatePosition();return this},show(S=!1){if(s!==null)window.clearTimeout(s),s=null;if(a!==null)window.clearTimeout(a),a=null;let y=()=>{if(!n)return this;t.element.setAttribute("aria-hidden","false"),t.element.classList.add(`${t.getClass("tooltip")}--visible`),i=!0,this.updatePosition(),window.addEventListener("resize",E),window.addEventListener("scroll",v)};if(S)y();else s=window.setTimeout(y,o);return this},hide(S=!1){if(a!==null)window.clearTimeout(a),a=null;if(s!==null)window.clearTimeout(s),s=null;let y=()=>{t.element.setAttribute("aria-hidden","true"),t.element.classList.remove(`${t.getClass("tooltip")}--visible`),i=!1,window.removeEventListener("resize",E),window.removeEventListener("scroll",v)};if(S)y();else a=window.setTimeout(y,l);return this},isVisible(){return i},updatePosition(){if(!n)return this;let{top:S,left:y,arrowPosition:L}=p();if(t.element.style.top=`${Math.round(S)}px`,t.element.style.left=`${Math.round(y)}px`,L)m.className=`${t.getClass("tooltip")}__arrow`,m.classList.add(`${t.getClass("tooltip")}__arrow--${L}`);return this},destroy(){if(s!==null)window.clearTimeout(s);if(a!==null)window.clearTimeout(a);if(n)c(n),n.removeAttribute("aria-describedby");if(window.removeEventListener("resize",E),window.removeEventListener("scroll",v),t.element.parentNode)t.element.parentNode.removeChild(t.element);e.destroy()}},E=()=>{b.updatePosition()},v=()=>{b.updatePosition()};return b};Q();var RC={TOP:"top",RIGHT:"right",BOTTOM:"bottom",LEFT:"left",TOP_START:"top-start",TOP_END:"top-end",RIGHT_START:"right-start",RIGHT_END:"right-end",BOTTOM_START:"bottom-start",BOTTOM_END:"bottom-end",LEFT_START:"left-start",LEFT_END:"left-end"},_C={DEFAULT:"default",RICH:"rich",PLAIN:"plain"};var vt={POSITION:RC.BOTTOM,VARIANT:_C.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1};var PC={position:vt.POSITION,variant:vt.VARIANT,visible:vt.VISIBLE,showDelay:vt.SHOW_DELAY,hideDelay:vt.HIDE_DELAY,showOnFocus:vt.SHOW_ON_FOCUS,showOnHover:vt.SHOW_ON_HOVER,rich:vt.RICH},kf=(e={})=>P(PC,e,"tooltip"),Bf=(e)=>{let t={role:"tooltip","aria-hidden":"true"};if(e.zIndex!==void 0)t.style=`z-index: ${e.zIndex};`;return V(e,{tag:"div",attributes:t,className:[e.class,`${e.prefix}-tooltip--${e.position}`,`${e.prefix}-tooltip--${e.variant}`],text:e.text||""})},Hf=(e)=>({lifecycle:{destroy:()=>e.lifecycle.destroy()}});var kC=()=>`${X}-tooltip-${Math.random().toString(36).substring(2,9)}`,BC=(e={})=>{let t=kf(e);try{let n=O(M,R(Bf(t)),k(),(r)=>Pf(Hf(r))(r))(t);if(n.element.id=kC(),t.target)n.setTarget(t.target);if(t.text)n.setText(t.text);if(t.visible)n.show(!0);return n}catch(n){throw console.error("Tooltip creation error:",n),Error(`Failed to create tooltip: ${n.message}`)}},Ba=BC;sn();sn();
56
56
 
57
- //# debugId=0BD1C2609902149464756E2164756E21
57
+ //# debugId=3A7D8F491CD6B63564756E2164756E21