mtrl 0.4.4 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +61 -60
  2. package/dist/README.md +61 -60
  3. package/dist/components/chips/chips.d.ts +2 -2
  4. package/dist/components/chips/config.d.ts +1 -1
  5. package/dist/components/chips/features/controller.d.ts +1 -1
  6. package/dist/components/chips/features/dom.d.ts +15 -0
  7. package/dist/components/chips/features/index.d.ts +5 -4
  8. package/dist/components/chips/schema.d.ts +2 -2
  9. package/dist/components/list/api.d.ts +82 -39
  10. package/dist/components/list/config.d.ts +23 -19
  11. package/dist/components/list/features/index.d.ts +1 -1
  12. package/dist/components/list/features/renderer.d.ts +9 -0
  13. package/dist/components/list/features/selection.d.ts +1 -1
  14. package/dist/components/list/list.d.ts +3 -2
  15. package/dist/components/list/types.d.ts +68 -121
  16. package/dist/components/progress/constants.d.ts +3 -3
  17. package/dist/components/slider/features/canvas.d.ts +2 -2
  18. package/dist/components/slider/features/dom.d.ts +21 -0
  19. package/dist/components/slider/features/index.d.ts +5 -4
  20. package/dist/components/slider/slider.d.ts +4 -4
  21. package/dist/components/textfield/api.d.ts +2 -0
  22. package/dist/components/textfield/features/error.d.ts +54 -0
  23. package/dist/components/textfield/features/index.d.ts +1 -0
  24. package/dist/components/textfield/features/placement.d.ts +1 -1
  25. package/dist/components/textfield/features/supporting-text.d.ts +1 -1
  26. package/dist/components/textfield/types.d.ts +7 -0
  27. package/dist/core/compose/features/icon.d.ts +2 -2
  28. package/dist/core/compose/features/index.d.ts +0 -2
  29. package/dist/core/compose/features/textinput.d.ts +4 -0
  30. package/dist/core/compose/features/textlabel.d.ts +2 -2
  31. package/dist/core/compose/index.d.ts +1 -5
  32. package/dist/core/dom/attributes.d.ts +32 -2
  33. package/dist/core/dom/classes.d.ts +15 -13
  34. package/dist/core/dom/create.d.ts +35 -87
  35. package/dist/core/dom/index.d.ts +6 -6
  36. package/dist/core/dom/utils.d.ts +1 -10
  37. package/dist/core/index.d.ts +18 -22
  38. package/dist/index.cjs +15 -15
  39. package/dist/index.cjs.map +36 -74
  40. package/dist/index.d.ts +1 -6
  41. package/dist/index.js +15 -15
  42. package/dist/index.js.map +36 -74
  43. package/dist/package.json +1 -1
  44. package/dist/styles.css +2 -2
  45. package/package.json +4 -3
  46. package/dist/components/list/features/listmanager.d.ts +0 -9
  47. package/dist/components/slider/schema.d.ts +0 -65
  48. package/dist/core/collection/adapters/base.d.ts +0 -47
  49. package/dist/core/collection/adapters/route.d.ts +0 -149
  50. package/dist/core/collection/collection.d.ts +0 -131
  51. package/dist/core/collection/index.d.ts +0 -10
  52. package/dist/core/collection/list-manager/config.d.ts +0 -29
  53. package/dist/core/collection/list-manager/dom-elements.d.ts +0 -30
  54. package/dist/core/collection/list-manager/index.d.ts +0 -61
  55. package/dist/core/collection/list-manager/item-measurement.d.ts +0 -91
  56. package/dist/core/collection/list-manager/renderer.d.ts +0 -31
  57. package/dist/core/collection/list-manager/scroll-tracker.d.ts +0 -20
  58. package/dist/core/collection/list-manager/state.d.ts +0 -60
  59. package/dist/core/collection/list-manager/types.d.ts +0 -361
  60. package/dist/core/collection/list-manager/utils/recycling.d.ts +0 -34
  61. package/dist/core/collection/list-manager/utils/visibility.d.ts +0 -45
  62. package/dist/core/compose/features/gestures/longpress.d.ts +0 -85
  63. package/dist/core/compose/features/gestures/pan.d.ts +0 -108
  64. package/dist/core/compose/features/gestures/pinch.d.ts +0 -111
  65. package/dist/core/compose/features/gestures/rotate.d.ts +0 -111
  66. package/dist/core/compose/features/gestures/swipe.d.ts +0 -149
  67. package/dist/core/compose/features/gestures/tap.d.ts +0 -79
  68. package/dist/core/compose/features/gestures.d.ts +0 -86
  69. package/dist/core/composition/features/dom.d.ts +0 -19
  70. package/dist/core/composition/features/icon.d.ts +0 -45
  71. package/dist/core/composition/features/index.d.ts +0 -7
  72. package/dist/core/composition/features/label.d.ts +0 -49
  73. package/dist/core/composition/features/layout.d.ts +0 -31
  74. package/dist/core/composition/index.d.ts +0 -16
  75. package/dist/core/gestures/index.d.ts +0 -12
  76. package/dist/core/gestures/longpress.d.ts +0 -23
  77. package/dist/core/gestures/manager.d.ts +0 -14
  78. package/dist/core/gestures/pan.d.ts +0 -12
  79. package/dist/core/gestures/pinch.d.ts +0 -14
  80. package/dist/core/gestures/rotate.d.ts +0 -14
  81. package/dist/core/gestures/swipe.d.ts +0 -20
  82. package/dist/core/gestures/tap.d.ts +0 -12
  83. package/dist/core/gestures/types.d.ts +0 -320
  84. package/dist/core/gestures/utils.d.ts +0 -57
  85. package/dist/core/layout/array.d.ts +0 -20
  86. package/dist/core/layout/config.d.ts +0 -32
  87. package/dist/core/layout/create.d.ts +0 -14
  88. package/dist/core/layout/index.d.ts +0 -13
  89. package/dist/core/layout/jsx.d.ts +0 -13
  90. package/dist/core/layout/object.d.ts +0 -14
  91. package/dist/core/layout/processor.d.ts +0 -28
  92. package/dist/core/layout/result.d.ts +0 -12
  93. package/dist/core/layout/template.d.ts +0 -12
  94. package/dist/core/layout/types.d.ts +0 -137
  95. package/dist/core/layout/utils.d.ts +0 -38
package/dist/index.js CHANGED
@@ -1,35 +1,35 @@
1
1
  /**
2
- * mtrl v0.4.4
2
+ * mtrl v0.5.0
3
3
  * A functional TypeScript component library based on Material Design 3
4
4
  * @license MIT
5
5
  */
6
- var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(Z)=>$[Q]=()=>Z})};var T=(J,$)=>()=>(J&&($=J(J=0)),$);var b=(...J)=>($)=>J.reduce((Q,Z)=>Z(Q),$),z3=(...J)=>($)=>J.reduceRight((Q,Z)=>Z(Q),$),W3=(...J)=>($,Q={})=>J.reduce((Z,q)=>({...Z,...q(Z,Q)}),$);var Y3=(J={})=>({element:null,config:J,setup(){return this}});var GJ=(J,$={})=>{return Object.entries($).forEach(([Q,Z])=>{if(Z===null||Z===void 0)return;J.setAttribute(Q,String(Z))}),J},U3=(J,$=[])=>{return $.forEach((Q)=>J.removeAttribute(Q)),J};var f="mtrl",X3=(J)=>`mtrl-${J}`,B3=(J,$)=>`${J}--${$}`,F3=(J,$)=>`${J}-${$}`,zJ,WJ,H3;var w6=T(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(zJ||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(WJ||={});H3={bem:(J,$,Q)=>{let Z=J;if($)Z+=`-${$}`;if(Q)Z+=`--${Q}`;return Z},join:(...J)=>J.filter(Boolean).join(" ")}});var z9,e6=(...J)=>{let $=J.flat().reduce((Z,q)=>{if(typeof q==="string")Z.push(...q.split(/\s+/));return Z},[]).filter(Boolean),Q=new Set;return $.forEach((Z)=>Q.add(Z)),Array.from(Q)},g=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.add(...Z);return J},j6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return J;let Z=[];for(let q=0;q<Q.length;q++){let j=Q[q];if(!j)continue;Z.push(j.startsWith(z9)?j:z9+j)}if(Z.length)J.classList.remove(...Z);return J},YJ=(J,...$)=>{let Q=e6(...$);for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;J.classList.toggle(j)}return J},R6=(J,...$)=>{let Q=e6(...$);if(!Q.length)return!0;for(let Z=0;Z<Q.length;Z++){let q=Q[Z];if(!q)continue;let j=q.startsWith(z9)?q:z9+q;if(!J.classList.contains(j))return!1}return!0};var R9=T(()=>{w6();z9=`${f}-`});var k3,UJ=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let Z in $){let q=$[Z],j=(G)=>{let K=!0;if(typeof q==="function")try{let z={...Q,element:J};K=q(z,G)}catch(z){console.warn(`Error in event condition for ${Z}:`,z),K=!1}else K=Boolean(q);if(K){if(Q.emit)Q.emit(Z,{event:G,element:J,originalEvent:G});else if(Q.on)J.dispatchEvent(new CustomEvent(Z,{detail:{event:G,element:J,originalEvent:G},bubbles:!0,cancelable:!0}))}};J.__eventHandlers[Z]=j,J.addEventListener(Z,j)}},XJ=(J,{html:$,text:Q,id:Z})=>{if($)J.innerHTML=$;if(Q)J.textContent=Q;if(Z)J.id=Z},BJ=(J,$,Q)=>{if($)g(J,$);if(Q){let Z=e6(Q);if(Z.length)J.classList.add(...Z)}},FJ=(J,$,Q,Z)=>{if($)$.appendChild(J);if(Q)Q(J,Z);return J},v=(J={})=>{let{tag:$="div",container:Q=null,html:Z="",text:q="",id:j="",data:G={},class:K,className:z,rawClass:W,attributes:Y={},forwardEvents:U={},onCreate:X,context:_,...H}=J,B=document.createElement($);XJ(B,{html:Z,text:q,id:j}),BJ(B,K||z,W);for(let k in G)B.dataset[k]=G[k];let M={...Y,...H};for(let k in M){let N=M[k];if(N!=null)B.setAttribute(k,String(N))}return UJ(B,U,_),FJ(B,Q,X,_)},M3=(J={})=>{let{tag:$="svg",container:Q=null,html:Z="",text:q="",id:j="",class:G,className:K,rawClass:z,attributes:W={},forwardEvents:Y={},onCreate:U,context:X,..._}=J;if(!k3.includes($.toLowerCase()))console.warn(`Warning: '${$}' is not a standard SVG element tag.`);let H=document.createElementNS("http://www.w3.org/2000/svg",$);XJ(H,{html:Z,text:q,id:j}),BJ(H,G||K,z);let B={...W,..._};for(let M in B){let k=B[M];if(k!=null)H.setAttributeNS(null,M,String(k))}return UJ(H,Y,X),FJ(H,Q,U,X)},HJ=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var A6=T(()=>{R9();R9();k3=["svg","circle","ellipse","line","path","polygon","polyline","rect","g","text","tspan","textPath","defs","clipPath","mask","pattern","marker","linearGradient","radialGradient","stop","use","foreignObject","desc","title","metadata","symbol","switch"]});function V3(J){return"touches"in J}function N3(J){return"clientX"in J&&"clientY"in J}var kJ=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},u7,W9,E$,u6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},p6=(J)=>{if(V3(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(N3(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var q7=T(()=>{u7={passive:!0},W9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},E$={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var _3=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),S=(J={})=>({config:J,componentName:J.componentName,..._3(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let Z=p6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:Z.clientX,y:Z.clientY},isTouching:!0,activeTarget:Z.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),h=(J={})=>($)=>{let Q=(W)=>{if(j.updateTouchState(W,"start"),z.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",p6(W))},Z=(W)=>{if(!j.touchState.isTouching)return;let Y=Date.now()-j.touchState.startTime;if(z.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(W,"end"),Y<W9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",p6(W));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",p6(W))},q=(W)=>{if(!j.touchState.isTouching)return;let Y=p6(W),U=Y.clientX-j.touchState.startPosition.x,X=Y.clientY-j.touchState.startPosition.y;if(Math.abs(U)>W9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:U>0?"right":"left",deltaX:U,deltaY:X});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...Y,deltaX:U,deltaY:X})},j=$,G=$.config.parent||J.parent;if(typeof G==="string")G=document.querySelector(G);let K={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),u6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:G},z=v(K);if(u6()&&J.interactive)z.addEventListener("touchstart",Q,u7),z.addEventListener("touchend",Z),z.addEventListener("touchmove",q,u7);return{...$,element:z,addClass(...W){return z.classList.add(...W.filter(Boolean)),this},destroy(){if(u6()&&J.interactive)z.removeEventListener("touchstart",Q),z.removeEventListener("touchend",Z),z.removeEventListener("touchmove",q);HJ(z),z.remove()}}};var c=T(()=>{A6();q7()});var f6=()=>{let J=new Map;return{on:($,Q)=>{let Z=J.get($)||[];return J.set($,[...Z,Q]),()=>{let q=J.get($)||[];J.set($,q.filter((j)=>j!==Q))}},off($,Q){let Z=J.get($)||[];J.set($,Z.filter((q)=>q!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((q)=>q(...Q))},clear:()=>{J.clear()}}};var d=()=>(J)=>{let $=f6();return{...J,on(Q,Z){return $.on(Q,Z),this},off(Q,Z){return $.off(Q,Z),this},emit(Q,Z){return $.emit(Q,Z),this}}};var MJ=()=>{};var L3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");return G.className=`${Z}-${$.componentName||"component"}-text`,G.textContent=j,G};return{setText(j){if(!Q&&j)if(Q=q(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},Y9=(J)=>($)=>{let Q=L3($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var D3=(J,$={})=>{let Q=null,Z=$.prefix||"mtrl",q=(j)=>{let G=document.createElement("span");G.className=`${Z}-icon`;let K=`${Z}-${$.componentName||"component"}-icon`;if(G.classList.add(K),$.iconSize)G.classList.add(`${Z}-icon--${$.iconSize}`);return G.innerHTML=j,G};return{setIcon(j){if(!Q&&j)if(Q=q(j),$.iconPosition==="end")J.appendChild(Q);else J.insertBefore(Q,J.firstChild);else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},O3=(J,$)=>{let{text:Q,icon:Z}=$,q=`${J.getClass("button")}--circular`;if(!Q&&Z)J.element.classList.add(q);else J.element.classList.remove(q)},U9=(J)=>($)=>{let Q=D3($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)O3($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var K6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var f7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var VJ,g7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=VJ[J.position.toUpperCase()]||J.position,Z=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(Z),{...$,position:{setPosition(j){let G=Q,K=`${J.prefix}-${J.componentName}--${G}`,z=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(K),$.element.classList.add(z),this},getPosition(){return Q}}}};var NJ=T(()=>{((K)=>{K.LEFT="left";K.RIGHT="right";K.TOP="top";K.BOTTOM="bottom";K.START="start";K.END="end";K.CENTER="center"})(VJ||={})});var _J,h9,sK;var LJ=T(()=>{((G)=>{G.LINEAR="linear";G.EASE="ease";G.EASE_IN="ease-in";G.EASE_OUT="ease-out";G.EASE_IN_OUT="ease-in-out";G.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(_J||={});h9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},sK={duration:{type:"number",minimum:0,default:h9.duration},timing:{type:"string",enum:Object.values(_J),default:h9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:h9.opacity}}});var P3=(J={})=>{let $={...h9,...J,opacity:J.opacity||h9.opacity},Q=new WeakMap,Z=[],q=()=>{let z=document.createElement("div");return z.className=`${f}-ripple-wave`,z},j=(z,W)=>{if(typeof document.addEventListener==="function")document.addEventListener(z,W),Z.push({event:z,handler:W})},G=(z,W)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(z,W),Z=Z.filter((Y)=>!(Y.event===z&&Y.handler===W))},K=(z,W)=>{if(!W||!W.__rippleContainer)return;let Y=W.__rippleContainer,U=W.getBoundingClientRect(),X=q(),_=Math.max(U.width,U.height)*2,H=z.clientX-U.left-_/2,B=z.clientY-U.top-_/2;Object.assign(X.style,{width:`${_}px`,height:`${_}px`,left:`${H}px`,top:`${B}px`}),Y.appendChild(X),X.offsetHeight,requestAnimationFrame(()=>{X.classList.add("active")});let M=()=>{G("mouseup",M),G("mouseleave",M),X.classList.remove("active"),X.classList.add("fade-out"),setTimeout(()=>{if(X.parentNode)X.parentNode.removeChild(X);Q.get(W)?.delete(X)},$.duration)};j("mouseup",M),j("mouseleave",M)};return{mount:(z)=>{if(!z)return;if(window.getComputedStyle(z).position==="static")z.style.position="relative";let Y=z.querySelector(`.${f}-ripple`);if(!Y)Y=document.createElement("div"),Y.className=`${f}-ripple`,z.appendChild(Y);z.__rippleContainer=Y,Q.set(z,new Set);let U=(X)=>K(X,z);if(!z.__rippleHandlers)z.__rippleHandlers=[];z.__rippleHandlers.push(U),z.addEventListener("mousedown",U)},unmount:(z)=>{if(!z)return;if(Z.forEach(({event:W,handler:Y})=>{G(W,Y)}),Z=[],z.__rippleHandlers)z.__rippleHandlers.forEach((W)=>{z.removeEventListener("mousedown",W)}),z.__rippleHandlers=[];if(Q.has(z)){let W=Q.get(z);if(W)W.forEach((Y)=>{if(Y.parentNode)Y.parentNode.removeChild(Y)});Q.delete(z)}if(z.__rippleContainer&&z.__rippleContainer.parentNode)z.__rippleContainer.parentNode.removeChild(z.__rippleContainer),delete z.__rippleContainer}}},S6=(J)=>($)=>{if(!J.ripple)return $;let Q=P3(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let Z=$.lifecycle.mount,q=$.lifecycle.destroy;$.lifecycle.mount=()=>{Z.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),q.call($.lifecycle)}}return{...$,ripple:Q}};var DJ=T(()=>{LJ();w6()});function OJ(J){return"emit"in J&&typeof J.emit==="function"}var u9=(J={})=>($)=>{let Q=document.createElement("input"),Z=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(Z)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",Z);let q={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(q).forEach(([j,G])=>{if(G!==null&&G!==void 0)if(j==="disabled"&&G===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(G===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(G))}),Q.addEventListener("change",(j)=>{if(OJ($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,OJ($))$.emit("value",{value:j});return this}}};var f9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",Z=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(Z(),$.emit)$.on?.("change",Z);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,Z(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,Z(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,Z(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var PJ=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function M6(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function _6(J){return"emit"in J&&typeof J.emit==="function"}var d7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",Z=document.createElement(Q?"textarea":"input");Z.className=`${$.getClass("textfield")}-input`;let q={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||""};if(!Q)q.type=J.type||"text";else q["data-type"]="multiline";Object.entries(q).forEach(([K,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)Z.setAttribute(K,"")}else Z.setAttribute(K,String(z))});let j=()=>{let K=!Z.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,K),K},G=()=>{if(Z.matches(":-webkit-autofill")||window.getComputedStyle(Z).backgroundColor==="rgb(250, 255, 189)"||window.getComputedStyle(Z).backgroundColor==="rgb(232, 240, 254)"){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),_6($))$.emit("input",{value:Z.value,isEmpty:!1,isAutofilled:!0})}};if(Z.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),_6($))$.emit("focus",{isEmpty:j()});setTimeout(G,100)}),Z.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),_6($))$.emit("blur",{isEmpty:j()})}),Z.addEventListener("input",()=>{if(_6($))$.emit("input",{value:Z.value,isEmpty:j(),isAutofilled:!1});else j()}),j(),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(Z),M6($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),K.call($.lifecycle)}}return{...$,input:Z,setValue(K){return Z.value=K||"",j(),this},getValue(){return Z.value},setAttribute(K,z){return Z.setAttribute(K,z),this},getAttribute(K){return Z.getAttribute(K)},removeAttribute(K){return Z.removeAttribute(K),this}}};var RJ=()=>{};var X9=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label");Q.className=`${J.prefix}-${J.componentName}-label`,Q.textContent=J.label;let Z=J.labelPosition||"start";if(Z==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(Z&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${Z}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var R3=`
6
+ var N2=Object.defineProperty;var GJ=(J,$)=>{for(var Q in $)N2(J,Q,{get:$[Q],enumerable:!0,configurable:!0,set:(q)=>$[Q]=()=>q})};var g=(J,$)=>()=>(J&&($=J(J=0)),$);var I=(...J)=>($)=>J.reduce((Q,q)=>q(Q),$),L2=(...J)=>($)=>J.reduceRight((Q,q)=>q(Q),$),V2=(...J)=>($,Q={})=>J.reduce((q,Z)=>({...q,...Z(q,Q)}),$);var _2=(J={})=>({element:null,config:J,setup(){return this}});var N7=(J,$={})=>{if(!$)return J;let Q=Object.keys($);if(Q.length===1){let q=$[Q[0]];if(q!=null)J.setAttribute(Q[0],String(q));return J}for(let q in $){let Z=$[q];if(Z!=null)J.setAttribute(q,String(Z))}return J},D2=(J,$=[])=>{for(let Q=0;Q<$.length;Q++)J.removeAttribute($[Q]);return J},O2=(J,$)=>{for(let Q=0;Q<$.length;Q++){let q=$[Q];if(q.action==="set"&&q.value!=null)J.setAttribute(q.key,String(q.value));else if(q.action==="remove")J.removeAttribute(q.key)}return J},P2=(J,$)=>J.hasAttribute($),R2=(J,$,Q="")=>J.getAttribute($)??Q;var u="mtrl",y2=(J)=>`mtrl-${J}`,A2=(J,$)=>`${J}--${$}`,w2=(J,$)=>`${J}-${$}`,YJ,zJ,x2;var y6=g(()=>{((j)=>{j.BUTTON="button";j.TEXTFIELD="textfield";j.CONTAINER="container";j.SNACKBAR="snackbar";j.SWITCH="switch"})(YJ||={});((j)=>{j.DISABLED="disabled";j.FOCUSED="focused";j.ACTIVE="active";j.LOADING="loading";j.ERROR="error"})(zJ||={});x2={bem:(J,$,Q)=>{let q=J;if($)q+=`-${$}`;if(Q)q+=`--${Q}`;return q},join:(...J)=>J.filter(Boolean).join(" ")}});var N6,L7,T2=500,y9=(...J)=>{if(J.length===0)return[];if(J.length===1&&typeof J[0]==="string"){let q=J[0];if(!q)return[];if(!q.includes(" "))return[q];if(L7.has(q))return L7.get(q)}let $=new Set,Q=[];for(let q of J)if(typeof q==="string"&&q)if(!q.includes(" ")){if(!$.has(q))$.add(q),Q.push(q)}else q.split(" ").forEach((Z)=>{let j=Z.trim();if(j&&!$.has(j))$.add(j),Q.push(j)});else if(Array.isArray(q))q.forEach((Z)=>{if(typeof Z==="string"&&Z&&!$.has(Z))$.add(Z),Q.push(Z)});if(J.length===1&&typeof J[0]==="string"&&Q.length<=10){if(L7.size<T2)L7.set(J[0],Q)}return Q},p=(J,...$)=>{if($.length===0)return J;if($.length===1&&Array.isArray($[0]))return p(J,...$[0]);if($.length===1&&typeof $[0]==="string"){let q=$[0];if(q&&!q.includes(" ")){let Z=q.startsWith(N6)?q:N6+q;if(!Z.includes(" "))return J.classList.add(Z),J}}let Q=y9(...$);for(let q of Q){let Z=q.startsWith(N6)?q:N6+q;if(Z.includes(" "))Z.split(" ").forEach((j)=>{let K=j.trim();if(K)J.classList.add(K)});else J.classList.add(Z)}return J},K6=(J,...$)=>{if($.length===0)return J;if($.length===1&&Array.isArray($[0]))return K6(J,...$[0]);if($.length===1&&typeof $[0]==="string"){let q=$[0];if(q&&!q.includes(" ")){let Z=q.startsWith(N6)?q:N6+q;if(!Z.includes(" "))return J.classList.remove(Z),J}}let Q=y9(...$);for(let q of Q){let Z=q.startsWith(N6)?q:N6+q;if(Z.includes(" "))Z.split(" ").forEach((j)=>{let K=j.trim();if(K)J.classList.remove(K)});else J.classList.remove(Z)}return J},B$=(J,...$)=>{if($.length===1&&Array.isArray($[0]))return B$(J,...$[0]);if($.length===1&&typeof $[0]==="string"){let q=$[0];if(q&&!q.includes(" ")){let Z=q.startsWith(N6)?q:N6+q;if(!Z.includes(" "))return J.classList.toggle(Z),J}}let Q=y9(...$);for(let q of Q){let Z=q.startsWith(N6)?q:N6+q;if(Z.includes(" "))Z.split(" ").forEach((j)=>{let K=j.trim();if(K)J.classList.toggle(K)});else J.classList.toggle(Z)}return J},c6=(J,...$)=>{if($.length===0)return!0;if($.length===1&&Array.isArray($[0]))return c6(J,...$[0]);if($.length===1&&typeof $[0]==="string"){let q=$[0];if(q&&!q.includes(" ")){let Z=q.startsWith(N6)?q:N6+q;if(!Z.includes(" "))return J.classList.contains(Z)}}let Q=y9(...$);for(let q of Q){let Z=q.startsWith(N6)?q:N6+q;if(Z.includes(" ")){let j=Z.split(" ").map((K)=>K.trim()).filter(Boolean);for(let K of j)if(!J.classList.contains(K))return!1}else if(!J.classList.contains(Z))return!1}return!0};var A9=g(()=>{y6();N6=`${u}-`,L7=new Map});class UJ{pools=new Map;maxSize=20;acquire(J="div"){let $=this.pools.get(J);if($?.length){let Q=$.pop();return Q.className="",Q.innerHTML="",Q.removeAttribute("id"),Object.keys(Q.dataset).forEach((q)=>delete Q.dataset[q]),Q}return document.createElement(J)}release(J){let $=J.tagName.toLowerCase(),Q=this.pools.get($);if(!Q)Q=[],this.pools.set($,Q);if(Q.length<this.maxSize)this.cleanElement(J),Q.push(J)}cleanElement(J){let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}J.className="",J.innerHTML="",J.removeAttribute("id"),Object.keys(J.dataset).forEach((Q)=>delete J.dataset[Q]),J.parentNode?.removeChild(J)}}var WJ=(J,$,Q)=>{if(!$||!Q?.emit&&!Q?.on)return;J.__eventHandlers={};for(let q in $){let Z=$[q],j=(K)=>{let G=!0;if(typeof Z==="function")try{G=Z({...Q,element:J},K)}catch(Y){console.warn(`Error in event condition for ${q}:`,Y),G=!1}else G=Boolean(Z);if(G&&Q.emit)Q.emit(q,{event:K,element:J,originalEvent:K})};J.__eventHandlers[q]=j,J.addEventListener(q,j)}},yZ,E=(J={})=>{if(!J||Object.keys(J).length===0)return document.createElement("div");if(typeof J==="string")return document.createElement(J);let $=document.createElement(J.tag||"div");if(J.html)$.innerHTML=J.html;else if(J.text)$.textContent=J.text;if(J.id)$.id=J.id;if(J.ariaLabel)$.setAttribute("aria-label",J.ariaLabel);let Q=J.className||J.class;if(Q)p($,Q);if(J.rawClass){let q=Array.isArray(J.rawClass)?J.rawClass:J.rawClass.split(" ");$.classList.add(...q.filter(Boolean))}if(J.data)Object.assign($.dataset,J.data);if(J.attributes)N7($,J.attributes);for(let q in J)if(!["tag","container","html","text","id","ariaLabel","data","class","className","rawClass","attributes","forwardEvents","onCreate","context"].includes(q)){let Z=J[q];if(Z!=null)$.setAttribute(q,String(Z))}if(J.forwardEvents)WJ($,J.forwardEvents,J.context);if(J.container)J.container.appendChild($);if(J.onCreate)J.onCreate($,J.context);return $},I2=(J={})=>{let $=document.createElementNS("http://www.w3.org/2000/svg",J.tag||"svg");if(J.text)$.textContent=J.text;if(J.id)$.id=J.id;if(J.attributes)N7($,J.attributes);if(J.forwardEvents)WJ($,J.forwardEvents,J.context);if(J.container)J.container.appendChild($);if(J.onCreate)J.onCreate($,J.context);return $},XJ=(J)=>{let $=J.__eventHandlers;if($){for(let Q in $)J.removeEventListener(Q,$[Q]);delete J.__eventHandlers}};var S6=g(()=>{A9();yZ=new UJ});function S2(J){return"touches"in J}function b2(J){return"clientX"in J&&"clientY"in J}var BJ=()=>{let J=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),$=window.innerWidth<=768;return J||$},V7,$9,F$,b6=()=>{return"ontouchstart"in window||navigator.maxTouchPoints>0},f6=(J)=>{if(S2(J)&&J.touches.length>0){let $=J.touches[0];return{clientX:$.clientX,clientY:$.clientY,pageX:$.pageX,pageY:$.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}}if(b2(J))return{clientX:J.clientX,clientY:J.clientY,pageX:J.pageX,pageY:J.pageY,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type};return{clientX:0,clientY:0,pageX:0,pageY:0,target:J.target,preventDefault:()=>J.preventDefault(),stopPropagation:()=>J.stopPropagation(),type:J.type}};var a9=g(()=>{V7={passive:!0},$9={TARGET_SIZE:44,FEEDBACK_DURATION:200,TAP_THRESHOLD:250,SWIPE_THRESHOLD:50},F$={MINIMUM:44,COMFORTABLE:48,LARGE:56}});var v2=(J)=>({getClass:($)=>`${J}-${$}`,getModifierClass:($,Q)=>`${$}--${Q}`,getElementClass:($,Q)=>`${$}-${Q}`}),T=(J={})=>({config:J,componentName:J.componentName,...v2(J.prefix||"mtrl"),touchState:{startTime:0,startPosition:{x:0,y:0},isTouching:!1,activeTarget:null},updateTouchState($,Q){let q=f6($);if(Q==="start")this.touchState={startTime:Date.now(),startPosition:{x:q.clientX,y:q.clientY},isTouching:!0,activeTarget:q.target};else if(Q==="end")this.touchState.isTouching=!1,this.touchState.activeTarget=null}}),S=(J={})=>($)=>{let Q=(z)=>{if(j.updateTouchState(z,"start"),Y.classList.add(`${j.getClass("touch-active")}`),J.forwardEvents?.touchstart&&"emit"in $)$.emit("touchstart",f6(z))},q=(z)=>{if(!j.touchState.isTouching)return;let W=Date.now()-j.touchState.startTime;if(Y.classList.remove(`${j.getClass("touch-active")}`),j.updateTouchState(z,"end"),W<$9.TAP_THRESHOLD&&"emit"in $)$.emit("tap",f6(z));if(J.forwardEvents?.touchend&&"emit"in $)$.emit("touchend",f6(z))},Z=(z)=>{if(!j.touchState.isTouching)return;let W=f6(z),X=W.clientX-j.touchState.startPosition.x,U=W.clientY-j.touchState.startPosition.y;if(Math.abs(X)>$9.SWIPE_THRESHOLD&&"emit"in $)$.emit("swipe",{direction:X>0?"right":"left",deltaX:X,deltaY:U});if(J.forwardEvents?.touchmove&&"emit"in $)$.emit("touchmove",{...W,deltaX:X,deltaY:U})},j=$,K=$.config.parent||J.parent;if(typeof K==="string")K=document.querySelector(K);let G={tag:J.tag||"div",className:[j.getClass(J.componentName||j.componentName||"component"),b6()&&J.interactive?j.getClass("interactive"):null,...Array.isArray(J.className)?J.className:[J.className]].filter(Boolean),attributes:J.attributes||{},forwardEvents:J.forwardEvents||{},context:$,container:K},Y=E(G);if(b6()&&J.interactive)Y.addEventListener("touchstart",Q,V7),Y.addEventListener("touchend",q),Y.addEventListener("touchmove",Z,V7);return{...$,element:Y,addClass(...z){return Y.classList.add(...z.filter(Boolean)),this},destroy(){if(b6()&&J.interactive)Y.removeEventListener("touchstart",Q),Y.removeEventListener("touchend",q),Y.removeEventListener("touchmove",Z);XJ(Y),Y.remove()}}};var s=g(()=>{S6();a9()});var v6=()=>{let J=new Map;return{on:($,Q)=>{let q=J.get($)||[];return J.set($,[...q,Q]),()=>{let Z=J.get($)||[];J.set($,Z.filter((j)=>j!==Q))}},off($,Q){let q=J.get($)||[];J.set($,q.filter((Z)=>Z!==Q))},emit:($,...Q)=>{(J.get($)||[]).forEach((Z)=>Z(...Q))},clear:()=>{J.clear()}}};var h=()=>(J)=>{let $=v6();return{...J,on(Q,q){return $.on(Q,q),this},off(Q,q){return $.off(Q,q),this},emit(Q,q){return $.emit(Q,q),this}}};var FJ=()=>{};var C2=(J,$={})=>{let Q=null,q=$.prefix||"mtrl",Z=(j)=>{let K=document.createElement("span");return K.className=`${q}-${$.componentName||"component"}-text`,K.textContent=j,K};return{setText(j){if(!Q&&j)if(Q=Z(j),$.beforeElement)J.insertBefore(Q,$.beforeElement);else J.appendChild(Q);else if(Q)Q.textContent=j;return this},getText(){return Q?Q.textContent||"":""},getElement(){return Q}}},J9=(J)=>($)=>{let Q=C2($.element,{prefix:J.prefix,componentName:J.componentName||"component"});if(J.text)Q.setText(J.text);return{...$,text:Q}};var E2=(J,$={})=>{let Q=null,q=$.prefix||"mtrl",Z=(j)=>{let K=document.createElement("span");K.className=`${q}-icon`;let G=`${q}-${$.componentName||"component"}-icon`;if(K.classList.add(G),$.iconPosition)K.classList.add(`${G}--${$.iconPosition}`);if($.iconSize)K.classList.add(`${q}-icon--${$.iconSize}`);return K.innerHTML=j,K};return{setIcon(j){if(!Q&&j)if(Q=Z(j),$.iconPosition==="end")J.appendChild(Q);else{let K=J.querySelector(`[class*="${q}-${$.componentName||"component"}-label"]`);if(K)if(K.nextSibling)J.insertBefore(Q,K.nextSibling);else J.appendChild(Q);else J.insertBefore(Q,J.firstChild)}else if(Q&&j)Q.innerHTML=j;return this},getIcon(){return Q?Q.innerHTML:""},getElement(){return Q}}},h2=(J,$)=>{let{text:Q,icon:q}=$,Z=`${J.getClass("button")}--circular`;if(!Q&&q)J.element.classList.add(Z);else J.element.classList.remove(Z)},g6=(J)=>($)=>{let Q=E2($.element,{prefix:J.prefix,componentName:J.componentName||"component",iconPosition:J.iconPosition,iconSize:J.iconSize});if(J.icon)Q.setIcon(J.icon);if($.componentName==="button"){if(!J.text)h2($,J);else if(J.icon&&J.text)$.element.classList.add(`${$.getClass("button")}--icon`)}return{...$,icon:Q}};var G6=(J)=>($)=>{if(J.variant&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.variant}`;$.element.classList.add(Q)}return $};var _7=(J)=>($)=>{if(J.size&&$.element){let Q=`${J.prefix}-${J.componentName}--${J.size}`;$.element.classList.add(Q)}return $};var HJ,D7=(J)=>($)=>{if(!J.position||!$.element)return $;let Q=HJ[J.position.toUpperCase()]||J.position,q=`${J.prefix}-${J.componentName}--${Q}`;return $.element.classList.add(q),{...$,position:{setPosition(j){let K=Q,G=`${J.prefix}-${J.componentName}--${K}`,Y=`${J.prefix}-${J.componentName}--${j}`;return $.element.classList.remove(G),$.element.classList.add(Y),this},getPosition(){return Q}}}};var MJ=g(()=>{((G)=>{G.LEFT="left";G.RIGHT="right";G.TOP="top";G.BOTTOM="bottom";G.START="start";G.END="end";G.CENTER="center"})(HJ||={})});var kJ,w9,rZ;var NJ=g(()=>{((K)=>{K.LINEAR="linear";K.EASE="ease";K.EASE_IN="ease-in";K.EASE_OUT="ease-out";K.EASE_IN_OUT="ease-in-out";K.MATERIAL="cubic-bezier(0.4, 0.0, 0.2, 1)"})(kJ||={});w9={duration:450,timing:"cubic-bezier(0.4, 0.0, 0.2, 1)",opacity:["0.4","0"]},rZ={duration:{type:"number",minimum:0,default:w9.duration},timing:{type:"string",enum:Object.values(kJ),default:w9.timing},opacity:{type:"array",items:{type:"string",pattern:"^[0-1](\\.\\d+)?$"},minItems:2,maxItems:2,default:w9.opacity}}});var u2=(J={})=>{let $={...w9,...J,opacity:J.opacity||w9.opacity},Q=new WeakMap,q=[],Z=()=>{let Y=document.createElement("div");return Y.className=`${u}-ripple-wave`,Y},j=(Y,z)=>{if(typeof document.addEventListener==="function")document.addEventListener(Y,z),q.push({event:Y,handler:z})},K=(Y,z)=>{if(typeof document.removeEventListener==="function")document.removeEventListener(Y,z),q=q.filter((W)=>!(W.event===Y&&W.handler===z))},G=(Y,z)=>{if(!z||!z.__rippleContainer)return;let W=z.__rippleContainer,X=z.getBoundingClientRect(),U=Z(),_=Math.max(X.width,X.height)*2,N=Y.clientX-X.left-_/2,F=Y.clientY-X.top-_/2;Object.assign(U.style,{width:`${_}px`,height:`${_}px`,left:`${N}px`,top:`${F}px`}),W.appendChild(U),U.offsetHeight,requestAnimationFrame(()=>{U.classList.add("active")});let k=()=>{K("mouseup",k),K("mouseleave",k),U.classList.remove("active"),U.classList.add("fade-out"),setTimeout(()=>{if(U.parentNode)U.parentNode.removeChild(U);Q.get(z)?.delete(U)},$.duration)};j("mouseup",k),j("mouseleave",k)};return{mount:(Y)=>{if(!Y)return;if(window.getComputedStyle(Y).position==="static")Y.style.position="relative";let W=Y.querySelector(`.${u}-ripple`);if(!W)W=document.createElement("div"),W.className=`${u}-ripple`,Y.appendChild(W);Y.__rippleContainer=W,Q.set(Y,new Set);let X=(U)=>G(U,Y);if(!Y.__rippleHandlers)Y.__rippleHandlers=[];Y.__rippleHandlers.push(X),Y.addEventListener("mousedown",X)},unmount:(Y)=>{if(!Y)return;if(q.forEach(({event:z,handler:W})=>{K(z,W)}),q=[],Y.__rippleHandlers)Y.__rippleHandlers.forEach((z)=>{Y.removeEventListener("mousedown",z)}),Y.__rippleHandlers=[];if(Q.has(Y)){let z=Q.get(Y);if(z)z.forEach((W)=>{if(W.parentNode)W.parentNode.removeChild(W)});Q.delete(Y)}if(Y.__rippleContainer&&Y.__rippleContainer.parentNode)Y.__rippleContainer.parentNode.removeChild(Y.__rippleContainer),delete Y.__rippleContainer}}},A6=(J)=>($)=>{if(!J.ripple)return $;let Q=u2(J.rippleConfig);if(Q.mount($.element),$.lifecycle){let q=$.lifecycle.mount,Z=$.lifecycle.destroy;$.lifecycle.mount=()=>{q.call($.lifecycle)},$.lifecycle.destroy=()=>{Q.unmount($.element),Z.call($.lifecycle)}}return{...$,ripple:Q}};var LJ=g(()=>{NJ();y6()});function VJ(J){return"emit"in J&&typeof J.emit==="function"}var x9=(J={})=>($)=>{let Q=document.createElement("input"),q=$.componentName||"component";Q.type="checkbox",Q.className=`${$.getClass(q)}-input`,Q.style.position="absolute",Q.style.opacity="0",Q.style.cursor="pointer",$.element.setAttribute("role","presentation"),Q.setAttribute("role",q);let Z={name:J.name,checked:J.checked,required:J.required,disabled:J.disabled,value:J.value||"on","aria-label":J.label||J.ariaLabel};return Object.entries(Z).forEach(([j,K])=>{if(K!==null&&K!==void 0)if(j==="disabled"&&K===!0)Q.disabled=!0,Q.setAttribute("disabled","true");else if(K===!0)Q.setAttribute(j,j);else Q.setAttribute(j,String(K))}),Q.addEventListener("change",(j)=>{if(VJ($))$.emit("change",{checked:Q.checked,value:Q.value,nativeEvent:j})}),Q.addEventListener("keydown",(j)=>{if(j.key===" "||j.key==="Enter"){if(j.preventDefault(),!Q.disabled)Q.checked=!Q.checked,Q.dispatchEvent(new Event("change",{bubbles:!0}))}}),$.element.appendChild(Q),{...$,input:Q,getValue:()=>Q.value,setValue(j){if(Q.value=j,VJ($))$.emit("value",{value:j});return this}}};var T9=(J={})=>($)=>{if(!$.input)return $;let Q=$.componentName||"component",q=()=>{$.element.classList.toggle(`${$.getClass(Q)}--checked`,$.input.checked)};if(J.checked!==void 0)$.input.checked=J.checked;if(q(),$.emit)$.on?.("change",q);return{...$,checkable:{check(){if(!$.input.checked)$.input.checked=!0,q(),$.emit?.("change",{checked:!0,value:$.input.value});return this},uncheck(){if($.input.checked)$.input.checked=!1,q(),$.emit?.("change",{checked:!1,value:$.input.value});return this},toggle(){return $.input.checked=!$.input.checked,q(),$.emit?.("change",{checked:$.input.checked,value:$.input.value}),this},isChecked(){return $.input.checked}}}};var _J=(J={})=>($)=>{if(J.variant)$.element.classList.add(`${$.getClass("button")}--${J.variant}`);if(J.size)$.element.classList.add(`${$.getClass("button")}--${J.size}`);return $};function B9(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}function F9(J){return"emit"in J&&typeof J.emit==="function"}var O7=(J={})=>($)=>{let Q=J.multiline||J.type==="multiline",q=document.createElement(Q?"textarea":"input");q.className=`${$.getClass("textfield")}-input`;let Z={name:J.name,required:J.required,disabled:J.disabled,maxLength:J.maxLength,pattern:J.pattern,autocomplete:J.autocomplete,value:J.value||"",placeholder:J.placeholder||" "};if(!Q)Z.type=J.type||"text";else Z["data-type"]="multiline";Object.entries(Z).forEach(([Y,z])=>{if(z!==null&&z!==void 0)if(typeof z==="boolean"){if(z)q.setAttribute(Y,"")}else q.setAttribute(Y,String(z))});let j=()=>{let Y=!q.value;return $.element.classList.toggle(`${$.getClass("textfield")}--empty`,Y),Y},K=(Y=!0)=>{let z=q.value&&q.value.length>0,W=q.matches(":-webkit-autofill"),U=window.getComputedStyle(q).backgroundColor,_=U==="rgb(250, 255, 189)"||U==="rgb(232, 240, 254)"||U==="rgb(250, 255, 0)"||U==="rgba(255, 255, 0, 0.1)";if(z||W||_){if($.element.classList.remove(`${$.getClass("textfield")}--empty`),Y&&F9($)&&(W||_))$.emit("input",{value:q.value,isEmpty:!1,isAutofilled:!0})}},G=null;if(typeof MutationObserver!=="undefined")G=new MutationObserver((Y)=>{Y.forEach((z)=>{if(z.type==="attributes"&&(z.attributeName==="value"||z.attributeName==="data-autofilled"))K(!0)})}),G.observe(q,{attributes:!0,attributeFilter:["value","data-autofilled","autocomplete"]});if(q.addEventListener("focus",()=>{if($.element.classList.add(`${$.getClass("textfield")}--focused`),F9($))$.emit("focus",{isEmpty:j()});K(!1)}),q.addEventListener("blur",()=>{if($.element.classList.remove(`${$.getClass("textfield")}--focused`),F9($))$.emit("blur",{isEmpty:j()});K(!1)}),q.addEventListener("input",()=>{if(F9($))$.emit("input",{value:q.value,isEmpty:j(),isAutofilled:!1});else j()}),q.addEventListener("change",()=>{let Y=j();if(K(!1),F9($))$.emit("change",{value:q.value,isEmpty:Y,isAutofilled:q.matches?.(":-webkit-autofill")||!1})}),q.addEventListener("animationstart",(Y)=>{if(Y.animationName==="onAutoFillStart"||Y.animationName?.includes("autofill"))K()}),j(),setTimeout(()=>{K(!1)},0),Q)$.element.classList.add(`${$.getClass("textfield")}--multiline`);if($.element.appendChild(q),B9($)){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(G)G.disconnect();q.remove(),Y.call($.lifecycle)}}return{...$,input:q,setValue(Y){return q.value=Y||"",j(),this},getValue(){return q.value},setAttribute(Y,z){return q.setAttribute(Y,z),this},getAttribute(Y){return q.getAttribute(Y)},removeAttribute(Y){return q.removeAttribute(Y),this}}};var DJ=()=>{};var d6=(J={})=>($)=>{if(!J.label)return $;let Q=document.createElement("label"),q=J.labelPosition||"start";if(Q.className=`${J.prefix}-${J.componentName}-label ${J.prefix}-${J.componentName}-label--${q}`,Q.textContent=J.label,q==="start")if($.element.firstChild)$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);else $.element.appendChild(Q);if(q&&$.componentName!=="slider")$.element.classList.add(`${J.prefix}-${J.componentName}--label-${q}`);return{...$,label:{setText(j){return Q.textContent=j,this},getText(){return Q.textContent||""},getElement(){return Q}}}};var f2=`
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>`,l7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let Z=document.createElement("span");if(Z.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(Z),J.icon!=="none"){let q=document.createElement("span");q.className=`${J.prefix}-${J.componentName}-thumb-icon`,q.innerHTML=J.icon||R3,Z.appendChild(q)}return $.element.appendChild(Q),{...$,track:Q,thumb:Z}};var h$=(J)=>{let $=new Map;return{on(Q,Z){return J.addEventListener(Q,Z),$.set(Z,Q),this},off(Q,Z){return J.removeEventListener(Q,Z),$.delete(Z),this},destroy(){$.forEach((Q,Z)=>{J.removeEventListener(Q,Z)}),$.clear()},getHandlers(){return new Map($)}}};var AJ=(J)=>($)=>{let Q=h$(J||$.element),Z={addListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.on(j,G)}),this},removeListeners(q){return Object.entries(q).forEach(([j,G])=>{Q.off(j,G)}),this},once(q,j){let G=(K)=>{j(K),Q.off(q,G)};return Q.on(q,G),this},on(q,j){return Q.on(q,j),this},off(q,j){return Q.off(q,j),this},destroy(){Q.destroy()}};if(M6($)){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),q.call($.lifecycle)}}return{...$,events:Z,on:Z.on.bind(Z),off:Z.off.bind(Z)}};var wJ=()=>{};var xJ=T(()=>{K7();w6()});var G7=(J,$,Q={})=>{let Z=null,q=0,{leading:j=!0,trailing:G=!0}=Q;return function(...K){let z=Date.now();if(!q&&!j)q=z;let W=$-(z-q);if(W<=0||W>$){if(Z)clearTimeout(Z),Z=null;q=z,J.apply(this,K)}else if(!Z&&G)Z=window.setTimeout(()=>{q=j?Date.now():0,Z=null,J.apply(this,K)},W)}},z7=(J,$,Q={})=>{let Z=null,q=null,j=null,G,K=null,z=0,{leading:W=!1,maxWait:Y}=Q,U=(B)=>{let M=B-(K||0),k=B-z;return!K||M>=$||M<0||Y!==void 0&&k>=Y},X=(B)=>{let M=q,k=j;return q=j=null,z=B,G=J.apply(k,M),G},_=(B)=>{if(Z=null,q)return X(B);return G},H=(B)=>{return z=B,Z=window.setTimeout(()=>{_(Date.now())},$),W?X(B):G};return function(...B){let M=Date.now(),k=U(M);if(q=B,j=this,K=M,k){if(Z===null)return H(M);if(Y!==void 0)Z=window.setTimeout(()=>{let N=Date.now();if(U(N))return _(N)},Math.min($,Y-(M-z)))}if(Z===null)Z=window.setTimeout(()=>{_(Date.now())},$);return G}},u$=(J)=>{let $=!1,Q;return function(...Z){if(!$)$=!0,Q=J.apply(this,Z);return Q}};var yJ=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=G7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,throttled:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.throttled),delete Q[G];return j};if(M6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.throttled)}),G.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addThrottledEvent:Z,removeThrottledEvent:q};return j};var TJ=()=>{};function A3(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var IJ=(J={})=>($)=>{let Q={},Z=(G,K,z,W={})=>{if(Q[G])q(G);let Y=z7(K,z,W);return $.element.addEventListener(G,Y),Q[G]={original:K,debounced:Y},j},q=(G)=>{let K=Q[G];if(K)$.element.removeEventListener(G,K.debounced),delete Q[G];return j};if(A3($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((K)=>{let z=Q[K];$.element.removeEventListener(K,z.debounced)}),G.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([G,K])=>{Z(G,K.handler,K.wait,K.options)});let j={...$,addDebouncedEvent:Z,removeDebouncedEvent:q};return j};var SJ=()=>{};var f$=()=>{};function bJ(J,$,Q,Z){return Math.sqrt(Math.pow(Q-J,2)+Math.pow(Z-$,2))}function vJ(J,$,Q,Z){let q=Math.atan2(Z-$,Q-J)*180/Math.PI;return q<0?q+360:q}function b6(J,$,Q){let Z=Date.now(),q=!1,j={type:J,originalEvent:$,target:Q.target||$.target,startTime:Q.startTime,endTime:Z,duration:Z-Q.startTime,defaultPrevented:q,preventDefault:()=>{if(q=!0,j.defaultPrevented=!0,$.cancelable)$.preventDefault()},stopPropagation:()=>{$.stopPropagation()}};return j}function CJ(){return"ontouchstart"in window||navigator.maxTouchPoints&&navigator.maxTouchPoints>0}function EJ(){return!!window.PointerEvent}function g$(J){if("touches"in J&&J.touches.length>0)return{clientX:J.touches[0].clientX,clientY:J.touches[0].clientY};return{clientX:J.clientX,clientY:J.clientY}}function d$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY;if(Math.sqrt(q*q+j*j)<Q.tapDistanceThreshold){let W=Date.now()-$.lastTapTime<300?$.tapCount+1:1;return{...b6("tap",Z,$),type:"tap",count:W,x:$.currentX,y:$.currentY}}return null}var l$=()=>{};function w3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}function p$(J){let{state:$,options:Q,originalEvent:Z}=J,q=$.currentX-$.startX,j=$.currentY-$.startY,G=Math.sqrt(q*q+j*j),z=Date.now()-$.startTime,W=G/z;if(G>=Q.swipeThreshold&&z<=Q.swipeTimeThreshold){let Y=w3(q,j);return{...b6("swipe",Z,$),type:"swipe",direction:Y,deltaX:q,deltaY:j,distance:G,velocity:W,startX:$.startX,startY:$.startY,endX:$.currentX,endY:$.currentY}}return null}var s$=T(()=>{f$()});function m$(J,$){let{state:Q,options:Z,originalEvent:q}=J,j=window.setTimeout(()=>{if(Q.active){let G=Math.abs(Q.currentX-Q.startX),K=Math.abs(Q.currentY-Q.startY);if(G<Z.tapDistanceThreshold&&K<Z.tapDistanceThreshold){let z={...b6("longpress",q,Q),type:"longpress",x:Q.currentX,y:Q.currentY};$(z)}}},Z.longPressTime);return()=>{clearTimeout(j)}}function hJ(J){let{state:$,options:Q}=J,Z=Math.abs($.currentX-$.startX),q=Math.abs($.currentY-$.startY);return Z>Q.tapDistanceThreshold||q>Q.tapDistanceThreshold}var a$=()=>{};function c$(J){let{state:$,originalEvent:Q}=J,Z=$.currentX-$.startX,q=$.currentY-$.startY,j=$.currentX-$.lastX,G=$.currentY-$.lastY;if(Math.sqrt(j*j+G*G)>0)return{...b6("pan",Q,$),type:"pan",deltaX:Z,deltaY:q,startX:$.startX,startY:$.startY,currentX:$.currentX,currentY:$.currentY};return null}var i$=()=>{};function o$(J,$,Q){let{state:Z,originalEvent:q}=J,j=bJ($.clientX,$.clientY,Q.clientX,Q.clientY),G=10;if(Math.abs(j-Z.startDistance)>10){let K=j/Z.startDistance,z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...b6("pinch",q,Z),type:"pinch",scale:K,centerX:z,centerY:W}}return null}var t$=()=>{};function n$(J,$,Q){let{state:Z,originalEvent:q}=J,j=vJ($.clientX,$.clientY,Q.clientX,Q.clientY),G=10,K=j-Z.startAngle;if(Math.abs(K)>10){let z=($.clientX+Q.clientX)/2,W=($.clientY+Q.clientY)/2;return{...b6("rotate",q,Z),type:"rotate",rotation:K,centerX:z,centerY:W}}return null}var e$=()=>{};var r7=(J,$={})=>{let Q={swipeThreshold:30,swipeTimeThreshold:300,longPressTime:500,tapDistanceThreshold:10,preventDefault:!0,stopPropagation:!1,...$},Z=new Map,q={active:!1,startTime:0,startX:0,startY:0,lastX:0,lastY:0,currentX:0,currentY:0,touchCount:0,longPressTimer:null,startDistance:0,startAngle:0,lastTapTime:0,tapCount:0,target:null},j=CJ(),G=EJ(),K={tap:!0,swipe:!0,swipeleft:!0,swiperight:!0,swipeup:!0,swipedown:!0,longpress:!0,pan:!0,pinch:j||G,rotate:j||G},z=(k)=>{let N=Z.get(k.type);if(!N)return;if(N.forEach((F)=>{try{F(k)}catch(V){console.error(`Error in gesture handler for ${k.type}:`,V)}}),k.type==="swipe"&&"direction"in k){let F={...k,type:`swipe${k.direction}`};z(F)}if(Q.preventDefault&&!k.defaultPrevented)k.preventDefault();if(Q.stopPropagation)k.stopPropagation()},W=null,Y=(k)=>{let N=g$(k),F="touches"in k?k.touches.length:1;if(q.active=!0,q.startTime=Date.now(),q.startX=q.lastX=q.currentX=N.clientX,q.startY=q.lastY=q.currentY=N.clientY,q.touchCount=F,q.target=k.target,F===2&&"touches"in k){let O=k.touches[0],P=k.touches[1];if(q.startDistance=Math.sqrt(Math.pow(P.clientX-O.clientX,2)+Math.pow(P.clientY-O.clientY,2)),q.startAngle=Math.atan2(P.clientY-O.clientY,P.clientX-O.clientX)*180/Math.PI,q.startAngle<0)q.startAngle+=360}let V={state:q,options:Q,originalEvent:k};if(W)W();W=m$(V,(O)=>{z(O)})},U=(k)=>{if(!q.active)return;let N=g$(k),F="touches"in k?k.touches.length:1;q.lastX=q.currentX,q.lastY=q.currentY,q.currentX=N.clientX,q.currentY=N.clientY;let V={state:q,options:Q,originalEvent:k};if(hJ(V)&&W)W(),W=null;let O=c$(V);if(O)z(O);if(F===2&&"touches"in k){let P=k.touches[0],L=k.touches[1],D=o$(V,P,L);if(D)z(D);let R=n$(V,P,L);if(R)z(R)}},X=(k)=>{if(!q.active)return;if(W)W(),W=null;let N={state:q,options:Q,originalEvent:k},F=d$(N);if(F)q.lastTapTime=Date.now(),q.tapCount=F.count,z(F);else{let V=p$(N);if(V)z(V)}q.active=!1},_=()=>{if(W)W(),W=null;q.active=!1},H={},B=()=>{if(G)H={pointerdown:Y,pointermove:U,pointerup:X,pointercancel:_};else if(j)H={touchstart:Y,touchmove:U,touchend:X,touchcancel:_};else H={mousedown:Y,mousemove:U,mouseup:X,mouseleave:_};Object.entries(H).forEach(([k,N])=>{J.addEventListener(k,N,{passive:!Q.preventDefault})})},M=()=>{Object.entries(H).forEach(([k,N])=>{J.removeEventListener(k,N)}),H={}};return B(),{on(k,N){if(!Z.has(k))Z.set(k,new Set);return Z.get(k).add(N),this},off(k,N){let F=Z.get(k);if(F){if(F.delete(N),F.size===0)Z.delete(k)}return this},isSupported(k){return k in K&&K[k]},enable(){return B(),this},disable(){return M(),this},destroy(){if(M(),W)W(),W=null;Z.clear()}}};var uJ=T(()=>{f$();l$();s$();a$();i$();t$();e$()});var p7=T(()=>{uJ();l$();s$();a$();t$();e$();i$()});var fJ=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add gesture recognition: missing element"),$;let{enableGestures:Q=!0,gestureHandlers:Z={},...q}=J,j=r7($.element,q);if(Object.entries(Z).forEach(([G,K])=>{j.on(G,K)}),!Q)j.disable();if(_6($)){let G=(K)=>{$.emit(K.type,K)};["tap","swipe","swipeleft","swiperight","swipeup","swipedown","longpress","pinch","rotate","pan"].forEach((K)=>{j.on(K,G)})}if(M6($)){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{j.destroy(),G.call($.lifecycle)}}return{...$,gestures:j,onGesture(G,K){return j.on(G,K),this},offGesture(G,K){return j.off(G,K),this},isGestureSupported(G){return j.isSupported(G)},enableGestures(){return j.enable(),this},disableGestures(){return j.disable(),this}}};var gJ=T(()=>{p7()});function $8(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var G6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,Z={enable(){if($.element.classList.remove(Q),$8($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let q=$.element;if("disabled"in q)q.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),$8($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let q=$.element;if("disabled"in q)q.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if($8($))return $.input.disabled;let q=$.element;return"disabled"in q&&q.disabled}};if(J.disabled)requestAnimationFrame(()=>{Z.disable()});return{...$,disabled:Z}};function y3(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function T3(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function I3(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var C=()=>(J)=>{let $=!1,Q=f6();return{...J,lifecycle:{onMount:(q)=>Q.on("mount",q),onUnmount:(q)=>Q.on("unmount",q),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(y3(J))J.events.destroy();if(T3(J)){let q=J.text.getElement();if(q)q.remove()}if(I3(J)){let q=J.icon.getElement();if(q)q.remove()}if(J.element)J.element.remove()}}}};var dJ=()=>{};var o=T(()=>{MJ();NJ();DJ();RJ();wJ();xJ();TJ();SJ();gJ();dJ()});var S3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add tap gesture recognition: missing element"),$;let{tapDistanceThreshold:Q=10,preventDefault:Z=!0,onTap:q,enabled:j=!0}=J,G=new Set;if(q)G.add(q);let K=0,z=0,W=!1,Y=0,U=0,X=0,_=j,H=(O,P,L)=>{let D=Date.now();if(D-U<300)X++;else X=1;U=D;let w={type:"tap",originalEvent:O,target:O.target,startTime:Y,endTime:D,duration:D-Y,defaultPrevented:!1,preventDefault:()=>{if(w.defaultPrevented=!0,O.cancelable)O.preventDefault()},stopPropagation:()=>{O.stopPropagation()},count:X,x:P,y:L};if(G.forEach((A)=>{try{A(w)}catch(x){console.error("Error in tap handler:",x)}}),_6($))$.emit("tap",w);if(Z&&!w.defaultPrevented)w.preventDefault()},B=(O)=>{if(!_)return;let P="touches"in O?O.touches[0]:O;K=P.clientX,z=P.clientY,Y=Date.now(),W=!0},M=(O)=>{if(!W||!_)return;let P="changedTouches"in O&&O.changedTouches.length>0?O.changedTouches[0]:O,L=P.clientX,D=P.clientY,R=L-K,w=D-z;if(Math.sqrt(R*R+w*w)<Q)H(O,L,D);W=!1},k=()=>{W=!1},N={mousedown:B,mouseup:M,mouseleave:k,touchstart:B,touchend:M,touchcancel:k},F=()=>{Object.entries(N).forEach(([O,P])=>{$.element.addEventListener(O,P,{passive:!Z})})},V=()=>{Object.entries(N).forEach(([O,P])=>{$.element.removeEventListener(O,P)})};if(_)F();if(M6($)){let O=$.lifecycle.destroy;$.lifecycle.destroy=()=>{V(),G.clear(),O.call($.lifecycle)}}return{...$,onTap(O){return G.add(O),this},offTap(O){return G.delete(O),this},enableTap(){if(!_)_=!0,F();return this},disableTap(){if(_)_=!1,V();return this}}};var lJ=()=>{};function b3(J,$){if(Math.abs(J)>Math.abs($))return J>0?"right":"left";return $>0?"down":"up"}var v3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add swipe gesture recognition: missing element"),$;let{swipeThreshold:Q=30,swipeTimeThreshold:Z=300,preventDefault:q=!0,onSwipe:j,onSwipeLeft:G,onSwipeRight:K,onSwipeUp:z,onSwipeDown:W,enabled:Y=!0}=J,U={swipe:new Set,swipeleft:new Set,swiperight:new Set,swipeup:new Set,swipedown:new Set};if(j)U.swipe.add(j);if(G)U.swipeleft.add(G);if(K)U.swiperight.add(K);if(z)U.swipeup.add(z);if(W)U.swipedown.add(W);let X=0,_=0,H=!1,B=0,M=Y,k=(D,R,w)=>{let A=R-X,x=w-_,I=Math.sqrt(A*A+x*x),r=Date.now(),a=r-B,k6=I/a,i=b3(A,x),y={type:"swipe",originalEvent:D,target:D.target,startTime:B,endTime:r,duration:a,defaultPrevented:!1,preventDefault:()=>{if(y.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},direction:i,deltaX:A,deltaY:x,distance:I,velocity:k6,startX:X,startY:_,endX:R,endY:w};U.swipe.forEach((m)=>{try{m(y)}catch(s){console.error("Error in swipe handler:",s)}});let l=`swipe${i}`;if(U[l].forEach((m)=>{try{m({...y,type:l})}catch(s){console.error(`Error in ${l} handler:`,s)}}),_6($))$.emit("swipe",y),$.emit(l,y);if(q&&!y.defaultPrevented)y.preventDefault()},N=(D)=>{if(!M)return;let R="touches"in D?D.touches[0]:D;X=R.clientX,_=R.clientY,B=Date.now(),H=!0},F=(D)=>{if(!H||!M)return;let R="changedTouches"in D&&D.changedTouches.length>0?D.changedTouches[0]:D,w=R.clientX,A=R.clientY,x=w-X,I=A-_,r=Math.sqrt(x*x+I*I),a=Date.now()-B;if(r>=Q&&a<=Z)k(D,w,A);H=!1},V=()=>{H=!1},O={mousedown:N,mouseup:F,mouseleave:V,touchstart:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(M)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{L(),Object.values(U).forEach((R)=>R.clear()),D.call($.lifecycle)}}return{...$,onSwipe(D){return U.swipe.add(D),this},onSwipeLeft(D){return U.swipeleft.add(D),this},onSwipeRight(D){return U.swiperight.add(D),this},onSwipeUp(D){return U.swipeup.add(D),this},onSwipeDown(D){return U.swipedown.add(D),this},offSwipe(D){return U.swipe.delete(D),this},offSwipeLeft(D){return U.swipeleft.delete(D),this},offSwipeRight(D){return U.swiperight.delete(D),this},offSwipeUp(D){return U.swipeup.delete(D),this},offSwipeDown(D){return U.swipedown.delete(D),this},enableSwipe(){if(!M)M=!0,P();return this},disableSwipe(){if(M)M=!1,L();return this}}};var rJ=T(()=>{p7()});var C3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add long press gesture recognition: missing element"),$;let{longPressTime:Q=500,moveThreshold:Z=10,preventDefault:q=!0,onLongPress:j,enabled:G=!0}=J,K=new Set;if(j)K.add(j);let z=0,W=0,Y=0,U=0,X=!1,_=0,H=null,B=G,M=(D)=>{let R={type:"longpress",originalEvent:D,target:D.target,startTime:_,endTime:Date.now(),duration:Date.now()-_,defaultPrevented:!1,preventDefault:()=>{if(R.defaultPrevented=!0,D.cancelable)D.preventDefault()},stopPropagation:()=>{D.stopPropagation()},x:Y,y:U};if(K.forEach((w)=>{try{w(R)}catch(A){console.error("Error in long press handler:",A)}}),_6($))$.emit("longpress",R);if(q&&!R.defaultPrevented)R.preventDefault()},k=(D)=>{if(!B)return;let R="touches"in D?D.touches[0]:D;if(z=Y=R.clientX,W=U=R.clientY,_=Date.now(),X=!0,H!==null)window.clearTimeout(H);H=window.setTimeout(()=>{if(X){let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)<Z)M(D)}H=null},Q)},N=(D)=>{if(!X||!B)return;let R="touches"in D?D.touches[0]:D;Y=R.clientX,U=R.clientY;let w=Y-z,A=U-W;if(Math.sqrt(w*w+A*A)>Z){if(H!==null)window.clearTimeout(H),H=null}},F=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},V=()=>{if(H!==null)window.clearTimeout(H),H=null;X=!1},O={mousedown:k,mousemove:N,mouseup:F,mouseleave:V,touchstart:k,touchmove:N,touchend:F,touchcancel:V},P=()=>{Object.entries(O).forEach(([D,R])=>{$.element.addEventListener(D,R,{passive:!q})})},L=()=>{Object.entries(O).forEach(([D,R])=>{$.element.removeEventListener(D,R)})};if(B)P();if(M6($)){let D=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(L(),H!==null)window.clearTimeout(H),H=null;K.clear(),D.call($.lifecycle)}}return{...$,onLongPress(D){return K.add(D),this},offLongPress(D){return K.delete(D),this},enableLongPress(){if(!B)B=!0,P();return this},disableLongPress(){if(B){if(B=!1,L(),H!==null)window.clearTimeout(H),H=null}return this}}};var pJ=()=>{};var E3=(J={})=>($)=>{if(!$.element)return console.warn("Cannot add pan gesture recognition: missing element"),$;let{preventDefault:Q=!0,onPanStart:Z,onPan:q,onPanEnd:j,enabled:G=!0}=J,K={panstart:new Set,pan:new Set,panend:new Set};if(Z)K.panstart.add(Z);if(q)K.pan.add(q);if(j)K.panend.add(j);let z=0,W=0,Y=0,U=0,X=0,_=0,H=!1,B=!1,M=0,k=G,N=(A,x)=>{let I={type:x,originalEvent:A,target:A.target,startTime:M,endTime:Date.now(),duration:Date.now()-M,defaultPrevented:!1,preventDefault:()=>{if(I.defaultPrevented=!0,A.cancelable)A.preventDefault()},stopPropagation:()=>{A.stopPropagation()},deltaX:X-z,deltaY:_-W,startX:z,startY:W,currentX:X,currentY:_};return I},F=(A,x)=>{let I=N(A,x);if(K[x].forEach((r)=>{try{r(I)}catch(a){console.error(`Error in ${x} handler:`,a)}}),_6($))$.emit(x,I);if(Q&&!I.defaultPrevented)I.preventDefault()},V=(A)=>{if(!k)return;let x="touches"in A?A.touches[0]:A;z=Y=X=x.clientX,W=U=_=x.clientY,M=Date.now(),H=!0,B=!1},O=(A)=>{if(!H||!k)return;let x="touches"in A?A.touches[0]:A;Y=X,U=_,X=x.clientX,_=x.clientY;let I=X-Y,r=_-U;if(Math.sqrt(I*I+r*r)>0){if(!B)B=!0,F(A,"panstart");F(A,"pan")}},P=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},L=(A)=>{if(!H||!k)return;if(B)F(A,"panend");H=!1,B=!1},D={mousedown:V,mousemove:O,mouseup:P,mouseleave:L,touchstart:V,touchmove:O,touchend:P,touchcancel:L},R=()=>{Object.entries(D).forEach(([A,x])=>{$.element.addEventListener(A,x,{passive:!Q})})},w=()=>{Object.entries(D).forEach(([A,x])=>{$.element.removeEventListener(A,x)})};if(k)R();if(M6($)){let A=$.lifecycle.destroy;$.lifecycle.destroy=()=>{w(),Object.values(K).forEach((x)=>x.clear()),A.call($.lifecycle)}}return{...$,onPanStart(A){return K.panstart.add(A),this},onPan(A){return K.pan.add(A),this},onPanEnd(A){return K.panend.add(A),this},offPanStart(A){return K.panstart.delete(A),this},offPan(A){return K.pan.delete(A),this},offPanEnd(A){return K.panend.delete(A),this},enablePan(){if(!k)k=!0,R();return this},disablePan(){if(k)k=!1,w();return this}}};var sJ=()=>{};var J6=T(()=>{c();o();lJ();rJ();pJ();sJ()});function mJ(J,$){W7[J]=$}function s7(J){return W7[J]||{}}function aJ(J){Object.assign(W7,J)}function cJ(){Object.keys(W7).forEach((J)=>{delete W7[J]})}var W7;var J8=T(()=>{W7={}});var u=(J,$={},Q)=>{let Z=s7(Q),q=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,G={...J,...Z,...$,componentName:Q,prefix:f,className:q!==void 0?q:j};if("class"in G&&G.className!==void 0)delete G.class;return G},p=(J,$)=>{let Q=J.className||J.class,Z=$.className,q=[...Array.isArray(Q)?Q:[Q],...Array.isArray(Z)?Z:[Z]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:q.length>0?q:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var t=T(()=>{w6();J8()});var m7,a7,c7,g9=4;var Q8=T(()=>{m7={SMALL:"small",LARGE:"large"},a7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},c7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var h3,iJ=(J={})=>u(h3,J,"badge"),oJ=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":d9(J.label||"",J.max);return p(J,{tag:"span",attributes:$,className:J.class,text:Q})},tJ=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),d9=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),Z=Number(J);if($!==void 0&&!isNaN(Z)&&Z>$)Q=`${$}+`;if(Q.length>g9){let q=Number(J);if(!isNaN(q))if(q>=1000)Q="999+";else Q=Q.substring(0,g9-1)+"+";else Q=Q.substring(0,g9)}return Q};var i7=T(()=>{t();Q8();h3={variant:m7.LARGE,color:a7.ERROR,position:c7.TOP_RIGHT,label:"",visible:!0}});var nJ="small",u3="large",f3="error",g3="top-right",eJ=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},$0=(J)=>($)=>{let Q=J.variant||u3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===nJ)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let Z=d9(J.label,J.max);$.element.textContent=Z}return $},J0=(J)=>($)=>{let Q=J.color||f3;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},Q0=(J)=>($)=>{let Q=J.position||g3;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},Z0=(J)=>($)=>{if(J.max===void 0||J.variant===nJ)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=d9(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},q0=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let Z=J.target.parentNode;if(Z)Z.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var j0=T(()=>{i7()});var K0="small",d3,l3,r3,G0=({visibility:J,lifecycle:$})=>(Q)=>{let Z={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(q){if(Q.config.label=q,Q.config.variant===K0)return Q.element.textContent="",Z;let j=d9(q,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof q==="number"&&Q.config.max!==void 0&&q>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")Z.hide();else Z.show();return Z},getLabel(){return Q.element.textContent||""},setContent(q){return Z.setLabel(q)},getContent(){return Z.getLabel()},show(){return J.show(),Z},hide(){return J.hide(),Z},toggle(q){return J.toggle(q),Z},isVisible(){return J.isVisible()},setMax(q){if(Q.config.max=q,Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setColor(q){return d3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},setVariant(q){if(l3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Q.config.variant=q,q===K0)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)Z.setLabel(Q.config.label);return Z},setPosition(q){return r3.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${q}`),Z},attachTo(q){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let G=q.parentNode;if(G)G.replaceChild(j,q),j.appendChild(q),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,Z.wrapper=j;return Z},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,Z.wrapper=void 0;return Z},destroy(){if($.destroy(),Q.wrapper){let q=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&q)j.replaceChild(q,Q.wrapper)}},addClass:(...q)=>{return Q.addClass(...q),Z},removeClass:(...q)=>{return Q.removeClass(...q),Z},on:(q,j)=>{return Q.on(q,j),Z},off:(q,j)=>{return Q.off(q,j),Z}};return Z};var z0=T(()=>{i7();d3=["error","primary","secondary","tertiary","success","warning","info"],l3=["small","large"],r3=["top-right","top-left","bottom-right","bottom-left"]});var p3=(J={})=>{let $=iJ(J);try{return b(S,d(),h(oJ($)),$0($),J0($),Q0($),Z0($),eJ(),q0($),C(),(Z)=>G0(tJ(Z))(Z))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},j7;var W0=T(()=>{J6();c();o();j0();z0();i7();j7=p3});var K7=T(()=>{W0()});var a3=(J)=>{let $=new Map,Q=(j,G)=>`${j}_${G.toString()}`,Z=(j,G)=>(K)=>{try{j(K)}catch(z){console.error(`Error in ${G} handler:`,z)}},q=(j,G)=>{try{J.removeEventListener(j,G)}catch(K){console.warn(`Failed to remove ${j} listener:`,K)}};return{on(j,G,K={}){let z=Z(G,j),W=Q(j,G);return $.set(W,{original:G,enhanced:z,event:j,options:K}),J.addEventListener(j,z,K),this},off(j,G){let K=Q(j,G),z=$.get(K);if(z)q(j,z.enhanced),$.delete(K);return this},pause(){return $.forEach(({enhanced:j,event:G})=>{q(G,j)}),this},resume(){return $.forEach(({enhanced:j,event:G,options:K})=>{J.addEventListener(G,j,K)}),this},destroy(){$.forEach(({enhanced:j,event:G})=>{q(G,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,G){let K=Q(j,G);return $.has(K)}}};var A9=T(()=>{A6();R9()});var B9,v6,Y7,g6,W6,s6,d6,z6;var m6=T(()=>{B9={LINEAR:"linear",CIRCULAR:"circular"},v6={FLAT:"flat",WAVY:"wavy"},Y7={CHANGE:"change",COMPLETE:"complete"},g6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},W6={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"},s6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},d6={THIN:4,THICK:8},z6={LINEAR:{AMPLITUDE:3,SPEED:0.88,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1.1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var a6=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},X0=(J,$)=>{let q=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let G=0,K=q.length;G<K;++G){let z=q[G];if(z in j)j=j[z];else return}return j};var w9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,Z=J;while(Z&&Q<$){let G=window.getComputedStyle(Z).backgroundColor;if(G.startsWith("var(")){let K=G.match(/var\((--[\w-]+)\)/);if(K){let z=K[1];G=window.getComputedStyle(document.documentElement).getPropertyValue(z).trim()||"transparent"}}if(G&&G!=="transparent"&&G!=="rgba(0, 0, 0, 0)"&&G!=="rgba(0,0,0,0)")return{color:G,element:Z};Z=Z.parentElement,Q++}let q=window.getComputedStyle(document.body).backgroundColor;if(q!=="transparent"&&q!=="rgba(0, 0, 0, 0)")return{color:q,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var j8=()=>{};function B6(J,$){let Q=`--${f}-${J}`;if($?.onThemeChange)i3($.onThemeChange);let q=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!q)q=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!q&&$?.fallback)return $.fallback;if(!q)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(q))return`rgba(${q}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(q)){let j=q.replace("#",""),G,K,z;if(j.length===3)G=parseInt(j[0]+j[0],16),K=parseInt(j[1]+j[1],16),z=parseInt(j[2]+j[2],16);else G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$.alpha})`}return q}var o7,x9=null,c3=()=>{if(x9)return;x9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){o7.forEach((Q)=>Q());break}}),x9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},i3=(J)=>{if(!x9)c3();return o7.add(J),()=>{o7.delete(J)}};var B0=T(()=>{w6();o7=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(x9)x9.disconnect(),x9=null;o7.clear()})});var U7=(J,$)=>{let Z=document.createElement("canvas").getContext("2d");if(!Z)return`rgba(0, 0, 0, ${$})`;Z.fillStyle=J;let q=Z.fillStyle;if(q.startsWith("#")){let j=q.substring(1),G=parseInt(j.substring(0,2),16),K=parseInt(j.substring(2,4),16),z=parseInt(j.substring(4,6),16);return`rgba(${G}, ${K}, ${z}, ${$})`}if(q.startsWith("rgb")){let j=q.match(/\d+/g);if(j){let[G,K,z]=j;return`rgba(${G}, ${K}, ${z}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var o3=(J,$)=>(Q,Z)=>J(Q,Z)?$(Q,Z):Q,t3=(...J)=>J.filter(Boolean).join(" ");var $9=T(()=>{q7();j8();B0()});var t7=(J,$,Q)=>{let Z=null,q=()=>{if(Z)clearTimeout(Z);Z=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((G)=>{for(let K of G){let{width:z}=K.contentRect,W=parseFloat($.style.width||"0");if(Math.abs(z-W)>2)q()}});return j.observe(J),()=>{if(Z)clearTimeout(Z);j.disconnect()}}else return window.addEventListener("resize",q),()=>{if(Z)clearTimeout(Z);window.removeEventListener("resize",q)}};var F0=(J,$,Q,Z,q,j,G,K,z)=>{let W=Math.max(100,Math.abs(j-q)*50),Y=(j-q)/W,U=z6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let X=0;X<=W;X++){let _=q+Y*X,H=_*K+z*U,B=Math.sin(H),k=Math.sign(B)*Math.pow(Math.abs(B),z6.CIRCULAR.POWER)*G,N=Z+k,F=$+N*Math.cos(_),V=Q+N*Math.sin(_);if(X===0)J.moveTo(F,V);else J.lineTo(F,V)}J.stroke()},H0=(J,$,Q,Z,q,j=0,G="flat")=>{let{ctx:K,width:z,height:W}=J,Y=X7($.thickness),U=G==="wavy",X=Math.min(z,W),_=q?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,H=X/2-Y/2,B=H*(_/100),M=U?y9(Y,B):0,k=H-M,N=z/2,F=W/2;K.clearRect(0,0,z,W);let O=(s6.CIRCULAR.GAP+2*Y)/k,P=-Math.PI/2,L=2*Math.PI-O;K.lineWidth=Y,K.lineCap="round",K.lineJoin="round";let D=q?z6.CIRCULAR.INDETERMINATE_FREQUENCY:z6.CIRCULAR.FREQUENCY;if(q){let y=j%1333/1333,l=(O9)=>{let U6=O9<=0.5?O9*2:2-O9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},m=()=>{let O9=j/1568*2*Math.PI,U6=Math.floor(j/1333),h6=j%1333/1333,n6=0;if(h6>0.5){let Z7=(h6-0.5)*2;n6=0.722*(Z7<0.5?2*Z7*Z7:1-Math.pow(-2*Z7+2,2)/2)}return O9+(U6*0.722+n6)*2*Math.PI},s=l(y)*2*Math.PI,K9=m(),N6=P+K9,X6=N6+s;K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath();let C9=O/2;if(K.arc(N,F,k,X6+C9,N6-C9+2*Math.PI),K.stroke(),K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"}),U)F0(K,N,F,k,N6,X6,M,D,j);else K.beginPath(),K.arc(N,F,k,N6,X6),K.stroke();return}let R=Q/Z,A=Math.max(R,0.001),x=0.95,I=L;if(R>=x){let i=(R-x)/(1-x),y=i*i;I=L+O*y}if(R<0.99){let y=P+I*A+O/2,l=P+L+O/2;if(y<l)K.strokeStyle=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),K.beginPath(),K.arc(N,F,k,y,l),K.stroke()}K.strokeStyle=B6("sys-color-primary",{fallback:"#6750A4"});let r=M;if(U){let i=z6.CIRCULAR.START_TRANSITION_END,y=z6.CIRCULAR.END_TRANSITION_START;if(R===0&&i>0)r=0;else if(R>0&&R<=i){let l=R/i;r=M*Math.pow(l,2)}else if(R>=y){let l=(R-y)/(1-y),m=1-Math.pow(1-l,2);r=M*(1-m)}if(R>=1)r=0}let a=P,k6=P+I*A;if(U)F0(K,N,F,k,a,k6,r,D,j);else K.beginPath(),K.arc(N,F,k,a,k6),K.stroke()};var k0=T(()=>{m6();$9();n7()});var B7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},F9=(J,$,Q,Z,q,j,G)=>{if(J.beginPath(),!q||G.amplitude===0)J.moveTo($,Z),J.lineTo(Q,Z);else{let K=$;for(let z=$;z<=Q;z+=1){let W=z*G.frequency+j*G.speed,Y=Math.sin(W),U=Math.sign(Y)*Math.pow(Math.abs(Y),z6.LINEAR.POWER),X=Z+U*G.amplitude;if(z===$)J.moveTo(z,X);else J.lineTo(z,X);K=z}if(K<Q){let z=Q*G.frequency+j*G.speed,W=Math.sin(z),Y=Math.sign(W)*Math.pow(Math.abs(W),z6.LINEAR.POWER),U=Z+Y*G.amplitude;J.lineTo(Q,U)}}J.stroke()},M0=(J,$)=>{let[Q,Z,q]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=Z)return 0.661479;else if(q&&J<=q)return 0.661479;return q?0.661479-0.5814790000000001*((J-q)/(1-q)):0.08},V0=(J,$)=>{for(let q=0;q<$.length-1;q++){let[j,G]=$[q],[K,z]=$[q+1];if(J<=K){let W=(J-j)/(K-j);return G+(z-G)*W}}let[Q,Z]=$[$.length-1];return Z+(220-Z)*((J-Q)/(1-Q))},N0=(J,$,Q,Z,q,j,G=0,K=!0,z="flat")=>{let{ctx:W,width:Y,height:U}=J,X=X7($.thickness),_=U/2,H=z==="wavy",B=X/2,M=Y-B*2,k=s6.LINEAR.GAP,N=Q/Z,F=0.001,V=Math.max(N,0.001),O=B+M*V;W.clearRect(0,0,Y,U);let P=B6("sys-color-primary",{fallback:"#6750A4"}),L=B6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let k6=G%2000/2000,i=k*2+X/2,y=M0(k6,[0.3665,0.6915]),l=V0(k6,[[0,-120],[0.2,0],[0.5915,83.6714]]),m=k6<=0.5?0:M0(k6,[0.8335,null,0.8335]),s=k6<=0.5?-54.8889:V0(k6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),N6=[{scale:y,translate:l,start:Math.max(B,B+M*l/100),end:Math.min(Y-B,B+M*l/100+M*y)},{scale:m,translate:s,start:Math.max(B,B+M*s/100),end:Math.min(Y-B,B+M*s/100+M*m)}].filter((U6)=>U6.end>U6.start).sort((U6,h6)=>U6.start-h6.start),X6=[];for(let U6=0;U6<N6.length;U6++){let h6=N6[U6];if(X6.length===0)X6.push({...h6});else{let n6=X6[X6.length-1];if(h6.start<=n6.end+i)n6.end=Math.max(n6.end,h6.end);else X6.push({...h6})}}B7(W,X,L);let C9=X;if(X6.length===0)F9(W,B,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=X6[0].start;if(U6-B>i+C9)F9(W,B,U6-i,_,!1,0,{amplitude:0,frequency:0,speed:0});if(X6.length===2){if(X6[1].start-X6[0].end>2*i+C9)F9(W,X6[0].end+i,X6[1].start-i,_,!1,0,{amplitude:0,frequency:0,speed:0})}let n6=X6[X6.length-1].end;if(Y-B-n6>i+C9)F9(W,n6+i,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0})}B7(W,X,P);let O9={amplitude:H?y9(X,z6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:z6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};X6.forEach((U6)=>{F9(W,U6.start,U6.end,_,H,G,O9)});return}let D=z6.LINEAR.START_TRANSITION_END,R=z6.LINEAR.END_TRANSITION_START,w=(k+X)/2;B7(W,X,L);let A=N===0?B+X+k:Math.min(O+w,Y-B);F9(W,A,Y-B,_,!1,0,{amplitude:0,frequency:0,speed:0}),B7(W,X,P);let x=N>=1?Y-B:Math.max(B,O-w),I;if(N===0)I=B+(H?0.1:0);else{let a=X/2;I=Math.max(B+a,x)}let r=H?y9(X,z6.LINEAR.AMPLITUDE):0;if(H){if(N===0&&D>0)r=0;else if(V<=D)r*=Math.pow(V/D,2);else if(V>=R)r*=Math.pow((1-V)/(1-R),2)}if(F9(W,B,I,_,H,G,{amplitude:r,frequency:z6.LINEAR.FREQUENCY*2*Math.PI/100,speed:z6.LINEAR.SPEED*2*Math.PI/1000}),q>0&&q>Q){B7(W,X,B6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let a=B+M*(q/Z);F9(W,O,a,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(N<1&&K){let a=Math.min(X*0.5,2);W.beginPath(),W.arc(Y-B,_,a,0,2*Math.PI),W.fillStyle=P,W.fill()}};var _0=T(()=>{m6();$9();n7()});var X7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?d6.THICK:d6.THIN},y9=(J,$,Q)=>{let q=1+0.3*(4-J)/(J+4),j=$*q;return Q?Math.min(j,Q):j},K8=(J,$,Q,Z)=>{let q=window.devicePixelRatio||1,j=X7(Z?.thickness),{ctx:G}=$;if(Q){let K=Math.max(24,Math.min(Z?.size??s6.CIRCULAR.SIZE,240)),z=0;if(Z?.shape==="wavy"){let Y=K/2-j/2,U=Z?.indeterminate?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,X=Y*(U/100);z=y9(j,X)}let W=K+z*2;J.style.width=J.style.height=`${W}px`,J.width=J.height=Math.round(W*q),$.width=$.height=W}else{let K=J.parentElement;if(!K)return;let z=Math.max(K.getBoundingClientRect().width||K.offsetWidth,200),W=0;if(Z?.shape==="wavy"){let U=z6.LINEAR.AMPLITUDE,X=y9(j,U);W=Math.ceil(X*2)}let Y=j+W;J.style.width=`${z}px`,J.style.height=`${Y}px`,J.width=Math.round(z*q),J.height=Math.round(Y*q),$.width=z,$.height=Y}G.setTransform(1,0,0,1,0,0),G.scale(q,q)},L0=(J,$,Q)=>{let Z={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return K8(J,Z,$,Q),Z},D0=(J)=>($)=>{let Z=J.variant===B9.CIRCULAR,q=document.createElement("canvas");q.className=`${$.getClass(W6.CONTAINER)}-canvas`,q.style.maxWidth="100%",q.style.maxHeight="100%",q.style.boxSizing="border-box",$.element.appendChild(q);let j=null,G=null,K=null,z=J.thickness,W=J.shape,Y=J.size??s6.CIRCULAR.SIZE,U=J.value??0,X=U,_=0,H=()=>{try{return j=L0(q,Z,{...J,thickness:z,shape:W,size:Y}),$.ctx=j.ctx,!0}catch(D){return console.warn("Canvas initialization failed:",D),!1}};if(!H())requestAnimationFrame(()=>{if(!H())setTimeout(H,100)});$.canvas=q,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=W;let B=(D=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,w=(A)=>{if(!$.state?.indeterminate){M();return}if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.animationId=requestAnimationFrame(w)};$.animationId=requestAnimationFrame(w)},M=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},k=(D=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,w=(A)=>{if(R===0)R=A-D;let x=A-R;$.animationTime=x,F(x),$.wavyAnimationId=requestAnimationFrame(w)};$.wavyAnimationId=requestAnimationFrame(w)},N=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},F=(D=0)=>{if(!j)return;let R=$.state,w=R?.value??J.value??0,A=R?.max??J.max??100,x=R?.buffer??J.buffer??0,I=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:z,shape:W,size:Y};K8(q,j,Z,r);let a=I||!R?w:U;if(Z)H0(j,r,a,A,I,D,W);else N0(j,r,a,A,x,I,D,!0,W)},V=()=>{if(!j)return;try{let D=L0(q,Z,{...J,thickness:z,shape:W,size:Y});$.ctx=D.ctx,Object.assign(j,D),F()}catch(D){console.warn("Canvas resize failed:",D)}};G=t7($.element,q,()=>{if($.element.offsetWidth>0||Z)V()});let O=B6("sys-color-primary",{onThemeChange:F});K=typeof O==="function"?O:null;let P=()=>{if(!j){requestAnimationFrame(P);return}if(F(),$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k()};requestAnimationFrame(P);let L=(D)=>{if(!j)return;let R={...J,thickness:z,shape:W,size:Y,...D};K8(q,j,Z,R),F()};if($.setThickness=(D)=>{z=D,L({thickness:D})},$.setSize=(D)=>{if(!Z)return;Y=Math.max(24,Math.min(D,240)),L({size:Y})},$.getSize=()=>Z?Y:void 0,$.setShape=(D)=>{if(W===D)return;if(W=D,$.currentShape=W,L({shape:D}),$.state?.indeterminate){let R=$.animationTime||0;if(N(),M(),D==="wavy"||!Z)k(R);else B(R)}else if(D==="wavy"){if(!$.wavyAnimationId)k()}else N();F($.animationTime||0)},$.setValue=(D,R=!0)=>{if(X=Math.max(0,Math.min($.state.max,D)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(U=X,F(),W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}));return}let w=U,A=performance.now(),x=A-_,I=300;if(x<300&&_>0)I=Math.max(100,x*0.9);_=A;let r=(a)=>{let k6=a-A,i=Math.min(k6/I,1),y=i<0.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2;if(U=w+(X-w)*y,!$.wavyAnimationId||W!=="wavy")F(a);if(i<1)$.valueAnimationId=requestAnimationFrame(r);else{if(U=X,$.valueAnimationId=null,W==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)k();if(X>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:X,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(D)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=D,D){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(U=$.state.value,W==="wavy"||!Z)k();else B()}else{if(U=$.state.value,M(),W==="wavy"){if(!$.wavyAnimationId)k()}else N();F()}},$.hide=()=>{$.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.opacity="0";let D=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",D)};return $.element.addEventListener("transitionend",D),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(W==="wavy"||!Z)k();else B();else if(W==="wavy")k();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(G)G();if(K)K();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),D()}}return Object.assign($,{startWavyAnimation:k,stopWavyAnimation:N,startIndeterminateAnimation:B,stopIndeterminateAnimation:M}),{...$,canvas:q,get ctx(){return j?.ctx},draw:F,resize:V}};var n7=T(()=>{m6();$9();k0();_0()});var O0=(J)=>($)=>{if(J.indeterminate&&$.element)g($.element,W6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(W6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==v6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(W6.CIRCULAR)||"")){let G=$.getClass?.(W6.CONTAINER)||"";g($.element,`${G}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??v6.FLAT,labelFormatter:J.labelFormatter??((j,G)=>`${Math.round(j/G*100)}%`),showLabel:J.showLabel},Z=$.lifecycle?.init,q=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==v6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),Z)Z()},destroy:()=>{if(q)q()}},{...$,state:Q}};var P0=T(()=>{m6();A9()});var R0=(J)=>($)=>{let{element:Q,getClass:Z,canvas:q}=$,j=Q.classList.contains(Z(W6.CIRCULAR)),G=(Y,U)=>{Q.dispatchEvent(new CustomEvent(Y,{detail:U}))},K=(Y,U)=>{Q.setAttribute("aria-valuenow",Y.toString());let X=$.label;if(X){let _=J.label?.formatter||((H,B)=>`${Math.round(H/B*100)}%`);X.textContent=_(Y,U)}if(typeof $.draw==="function")$.draw()},z=(Y)=>{if(Y){if(g(Q,W6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||v6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(j6(Q,W6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())z(!0);let W={element:Q,track:q,indicator:q,buffer:q,getClass:Z,getValue(){return J.value.getValue()},setValue(Y,U=!0){let X=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(Y),X!==Y){Q.setAttribute("aria-valuenow",Y.toString());let H=$.label;if(H){let M=J.label?.formatter||((k,N)=>`${Math.round(k/N*100)}%`);H.textContent=M(Y,_)}let B={value:Y,max:_};if(G(Y7.CHANGE,B),$.setValue&&typeof $.setValue==="function")$.setValue(Y,U);else K(Y,_)}return W},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(Y){if(J.buffer.setBuffer(Y),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return W},setIndeterminate(Y){if(J.state.isIndeterminate()===Y)return W;return J.state.setIndeterminate(Y),z(Y),W},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return W},hideLabel(){if(J.label?.hide)J.label.hide();return W},setLabelFormatter(Y){if(J.label?.format)J.label.format(Y);let U=$.label||$.state?.label;if(U)U.textContent=Y(J.value.getValue(),J.value.getMax());return W},getThickness(){return J.thickness?.getThickness()||d6.THIN},setThickness(Y){if(J.thickness)J.thickness.setThickness(Y);if($.setThickness)$.setThickness(Y);return W},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return v6.FLAT},setShape(Y){return $.setShape?.(Y),W},setSize(Y){if($.setSize)$.setSize(Y);return W},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),W},disable(){return J.disabled.disable(),W},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return W},show(){if($.show)$.show();return W},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(Y,U){return Q.addEventListener(Y,U),W},off(Y,U){return Q.removeEventListener(Y,U),W},addClass(...Y){return Y.forEach((U)=>Q.classList.add(U)),W},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return W};var A0=T(()=>{m6();A9()});var n3,w0=(J={})=>{return u(n3,J,"progress")},x0=(J)=>{let $=J.indeterminate===!0,Q=J.variant===B9.CIRCULAR,Z={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)Z["aria-valuenow"]=J.value.toString();if(J.disabled===!0)Z["aria-disabled"]="true";let q=[J.class,W6.CONTAINER,Q?W6.CIRCULAR:W6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==v6.FLAT)q.push(`${W6.CONTAINER}--${J.shape}`);return p(J,{tag:"div",attributes:Z,className:q})},y0=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:g6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(W6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return d6.THIN;else if($==="thick")return d6.THICK;else if(typeof $==="number")return $;return d6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var T0=T(()=>{t();m6();n3={variant:g6.VARIANT,value:g6.VALUE,max:g6.MAX,buffer:g6.BUFFER,showLabel:g6.SHOW_LABEL,thickness:"thin",shape:g6.SHAPE}});var I0={};KJ(I0,{default:()=>G8});var e3=(J={})=>{let $=w0(J);try{let Q=b(S,d(),h(x0($)),K6($),G6($),O0($),D0($),(Z)=>{return R0(y0(Z))(Z)},C())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},G8;var z8=T(()=>{J6();c();o();n7();P0();A0();T0();G8=e3});var $q=async(J)=>{let{default:$}=await Promise.resolve().then(() => (z8(),I0));return $(J)},S0=(J)=>($)=>{if(!J.progress)return $;let Q={},Z=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:Y,...U}=J.progress;if(Y)Q=Y;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...U}})(),q=null,j=null,G=!1,K="",z=async()=>{if(q)return q;if(!j)j=$q(Z).then((Y)=>{return q=Y,g(q.element,$.getClass("button-progress")),q.element.style.display="none",Object.entries(Q).forEach(([U,X])=>{q.on(U,X)}),$.progress=q,q});return j},W=()=>{let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y&&Y.nextSibling)return Y.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let Y=await z();if(Y.element){if(!$.element.contains(Y.element)){let X=W();if(X)$.element.insertBefore(Y.element,X);else $.element.appendChild(Y.element)}Y.element.style.display="",g($.element,`${$.getClass("button")}--progress`);let U=$.element.querySelector(`.${$.getClass("button-icon")}`);if(U instanceof HTMLElement)U.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!q)return $;q.element.style.display="none",j6($.element,`${$.getClass("button")}--progress`);let Y=$.element.querySelector(`.${$.getClass("button-icon")}`);if(Y instanceof HTMLElement)Y.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(Y){return(await z()).setValue(Y),$},$.setProgressSync=function(Y){return $.setProgress(Y),$},$.setIndeterminate=async function(Y){return(await z()).setIndeterminate(Y),$},$.setIndeterminateSync=function(Y){return $.setIndeterminate(Y),$},$.setLoading=async function(Y,U){if(Y&&!G){if($.setText&&$.getText)K=$.getText();if(G=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(U&&$.setText)$.setText(U)}else if(!Y&&G){if(G=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(U&&$.setText)$.setText(U);else if(K&&$.setText)$.setText(K)}return $},$.setLoadingSync=function(Y,U){return $.setLoading(Y,U),$},$.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(q)q.destroy();if(q&&q.element.parentNode)q.element.parentNode.removeChild(q.element);Y()}}if(J.showProgress)z().then(()=>{$.showProgress()});return $};var b0=T(()=>{A9()});var Jq=(J={},$={})=>{let Q={...J},Z=f6(),q=new Map,j=$.middleware||[],G=(z,W)=>{Z.emit("change",z,W)},K=(z,W)=>{return j.reduce((Y,U)=>U(Y,W),z)};return{getState:()=>{let z={};return q.forEach((W,Y)=>{z[Y]=W(Q)}),{...Q,...z}},setState:(z)=>{let W={...Q},Y=typeof z==="function"?z(Q):{...Q,...z};Q=K(Y,W),G(Q,W)},subscribe:(z)=>Z.on("change",z),derive:(z,W)=>{return q.set(z,W),()=>{q.delete(z)}},select:(z)=>z(Q),reset:()=>{Q={...J},G(Q,{})}}},Qq=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,Z)=>{if(J[Z]!==$[Z])Q[Z]={from:$[Z],to:J[Z]};return Q},{})}),J},Zq=(J)=>($)=>Object.keys($).reduce((Q,Z)=>{if(J($[Z],Z))Q[Z]=$[Z];return Q},{});var v0=()=>{};var qq=(J,$={})=>{let Q=!1,Z=f6();return{onMount:(q)=>Z.on("mount",q),onUnmount:(q)=>Z.on("unmount",q),mount:()=>{if(!Q)Q=!0,Z.emit("mount")},unmount:()=>{if(Q)Q=!1,Z.emit("unmount"),Z.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let q=$.text.getElement();if(q)q.remove()}if($.icon){let q=$.icon.getElement();if(q)q.remove()}if(J)J.remove()}}};var C0=()=>{};var jq=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};function x6(J){return J&&typeof J==="object"&&"element"in J}function F7(){return document.createDocumentFragment()}function Kq(...J){return e6(...J)}function l9(J,$=!1,Q=!1){if(!J||$)return{...J};if(!(J.class||J.className||J.rawClass))return{...J};let q={...J};if(q.className){if(!q.class)q.class=q.className;else{let j=Kq([q.class,q.className]);q.class=j.join(" ")}delete q.className}if(q.class&&!$){if(typeof q.class==="string"){let j=q.class.split(/\s+/).filter(Boolean);if(Q)q.class=j.map((G)=>{if(!G||G.startsWith(H9))return G;if(G.includes("__")){let[K,z]=G.split("__");return`${H9}${K}__${z}`}else if(G.includes("--")){let[K,z]=G.split("--");return`${H9}${K}--${z}`}return`${H9}${G}`}).join(" ");else q.class=j.map((G)=>G&&!G.startsWith(H9)?`${H9}${G}`:G).filter(Boolean).join(" ")}else if(Array.isArray(q.class))q.class=q.class.filter(Boolean).map((j)=>typeof j==="string"&&!j.startsWith(H9)?`${H9}${j}`:j).join(" ")}return q}function W8(J){let $={};if(!J||typeof J!=="object")return $;for(let Q in J){let Z=J[Q];if(Z&&typeof Z!=="function"&&(Z instanceof HTMLElement||typeof SVGElement!=="undefined"&&Z instanceof SVGElement||x6(Z)))$[Q]=Z}return $}var H9;var H7=T(()=>{w6();A9();H9=`${f}-`});function J9(J){let $=W8(J);return{layout:J,element:J.element,component:$,get(Z){return J[Z]??null},getAll(){return $},destroy(){let Z=J.element;if(Z){if(x6(Z)&&typeof Z.destroy==="function")Z.destroy();else if(x6(Z)&&Z.element?.parentNode)Z.element.parentNode.removeChild(Z.element);else if(Z instanceof HTMLElement&&Z.parentNode)Z.parentNode.removeChild(Z)}for(let q in J){if(q==="element")continue;let j=J[q];if(x6(j)&&typeof j.destroy==="function")j.destroy()}}}}var k7=T(()=>{H7()});function e7(J,$=null,Q=0,Z={}){Q++;let q={},j=[],G=F7(),K=null;if(!Array.isArray(J))return console.error("Schema is not an array!",$,Q,J),J9(q);let z=Z.creator||v;for(let W=0;W<J.length;W++){let Y=J[W];if(!Y)continue;if(Array.isArray(Y)){let F=e7(Y,K||$,Q,Z);Object.assign(q,F.layout);continue}let U,X,_;if(typeof Y==="function"){U=Y;let N=J[W+1],F=J[W+2];if(typeof N==="string")if(X=N,W++,a6(F))_=F,W++;else _={};else if(a6(N))_=N,W++;else _={}}else if(typeof Y==="string"){U=z,X=Y;let N=J[W+1];if(a6(N))_=N,W++;else _={};if(U===v&&!("tag"in _))_.tag="div"}else if(a6(Y))U=z,_=Y;else{console.warn("Skipping unsupported item type:",Y);continue}let H=J[W+1];if(a6(H)&&!Array.isArray(H)&&typeof H.prefix!=="undefined")Object.assign(_,H),W++;let M=("prefix"in _?_.prefix:Z.prefix!==!1)?l9(_):{..._};if(X&&!("name"in M)&&!(U===v||U.isElement))M.name=X;K=r9(U,M);let k=x6(K)?K.element:K;if(Q===1)q.element=k;if(X)q[X]=K,j.push([X,K]);if(K){if("insert"in K&&typeof K.insert==="function")K.insert(G);else G.appendChild(k);if($){if(K._container=$,"onInserted"in K&&typeof K.onInserted==="function")K.onInserted($)}}}if($&&G.hasChildNodes())(x6($)?$.element:$).appendChild(G);return q.components=j,J9(q)}var E0=T(()=>{A6();H7();k7();M7();$9()});function $$(J,$=null,Q={}){let Z={},q=Q.creator||v;if(J.element&&!$){let K=J.element,z=K.creator||q,W=K.options||{},Y=Q.prefix!==!1?l9(W):{...W},U=r9(z,Y),X=x6(U)?U.element:U;if(Z.element=U,K.name)Z[K.name]=U;if(K.children){let _=F7(),H=[];for(let B in K.children){let M=K.children[B];if(M&&!M.name)M.name=B;let k=$$({[B]:M},_,Q);H.push(k.layout)}X.appendChild(_);for(let B of H)Object.assign(Z,B)}return J9(Z)}let j=$?F7():null,G=[];for(let K in J){let z=J[K];if(!z)continue;let W=z.creator||q,Y=z.options||{},X=("prefix"in Y?Y.prefix:Q.prefix!==!1)?l9(Y):{...Y};if(!z.name&&K!=="element")z.name=K;let _=r9(W,X);if(Z[K]=_,z.name&&z.name!==K)Z[z.name]=_;let H=x6(_)?_.element:_;if(j)j.appendChild(H);if(z.children){let B=typeof SVGElement!=="undefined"&&H instanceof SVGElement,M=$$(z.children,H,Q);if(G.push(M.layout),B)Object.assign(Z,M.layout)}}if($&&j)(x6($)?$.element:$).appendChild(j);for(let K of G)Object.assign(Z,K);return J9(Z)}var h0=T(()=>{A6();H7();k7();M7()});function u0(J){if(!J)return;Array.from(J.classList).filter((Z)=>Z.startsWith("layout--")||Z.includes("-layout--")).forEach((Z)=>{J.classList.remove(Z)})}function p9(J){return R6(J,"layout--stack")?"stack":R6(J,"layout--row")?"row":R6(J,"layout--grid")?"grid":""}function Y8(J,$,Q=!0){if(!J||!$)return;if(Q)u0(J);if($.type)g(J,`layout--${$.type}`);if($.gap!==void 0){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-gap-${$.gap}`)}if($.align){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-${$.align}`)}if($.justify){let Z=$.type||p9(J);if(Z)g(J,`layout--${Z}-justify-${$.justify}`)}if($.type==="grid"||p9(J)==="grid"){if(typeof $.columns==="number")g(J,`layout--grid-cols-${$.columns}`);else if($.columns==="auto-fill")g(J,"layout--grid-fill");else if($.columns==="auto-fit")g(J,"layout--grid-cols-auto-fit");if($.dense)g(J,"layout--grid-dense");if($.autoHeight)g(J,"layout--grid-auto-height")}if($.type==="row"||p9(J)==="row"){if($.wrap===!1||$.wrap==="nowrap")g(J,"layout--row-nowrap");else if($.wrap==="reverse")g(J,"layout--row-wrap-reverse");if($.mobileStack)g(J,"layout--row-mobile-stack");if($.mobileScroll)g(J,"layout--row-mobile-scroll")}if($.class)$.class.split(" ").filter(Boolean).forEach((Z)=>{J.classList.add(Z)})}function U8(J,$){if(!J||!$)return;if(g(J,"layout__item"),$.width&&$.width>=1&&$.width<=12)g(J,`layout__item--${$.width}`);if($.sm)g(J,`layout__item--sm-${$.sm}`);if($.md)g(J,`layout__item--md-${$.md}`);if($.lg)g(J,`layout__item--lg-${$.lg}`);if($.xl)g(J,`layout__item--xl-${$.xl}`);if($.span)g(J,`layout__item--span-${$.span}`);if($.rowSpan)g(J,`layout__item--row-span-${$.rowSpan}`);if($.order)if(typeof $.order==="number")g(J,`layout__item--order-${$.order}`);else g(J,`layout__item--order-${$.order}`);if($.align)g(J,`layout__item--self-${$.align}`);if($.auto)g(J,"layout__item--auto")}var X8=T(()=>{R9()});function r9(J,$={}){try{let{layout:Q,layoutItem:Z,style:q,attributes:j}=$,G=$.events||$.event,K={...$};delete K.layout,delete K.layoutItem,delete K.events,delete K.event;let W=typeof J==="function"&&Object.getOwnPropertyDescriptor(J,"prototype")?.writable===!1?new J(K):J(K);if(W){let Y=W.element||(W instanceof HTMLElement?W:null);if(Y){if(Q)Y8(Y,Q);if(Z)U8(Y,Z);if(q&&typeof q==="object")Object.assign(Y.style,q);if(j&&typeof j==="object"){for(let[U,X]of Object.entries(j))if(X!==void 0&&X!==null)Y.setAttribute(U,X.toString())}if(G){if(typeof G==="object"&&!Array.isArray(G)){for(let[U,X]of Object.entries(G))if(typeof X==="function")Y.addEventListener(U,X)}else if(Array.isArray(G)){for(let U of G)if(Array.isArray(U)&&U.length>=2){let[X,_]=U;if(typeof X==="string"&&typeof _==="function")Y.addEventListener(X,_)}}}}}return W}catch(Q){return console.error("Error creating component instance:",Q),document.createElement("div")}}function f0(J){return Array.isArray(J)&&J.length>=3&&typeof J[0]==="function"&&typeof J[1]==="string"&&a6(J[2])}function B8(J,$=null,Q=0,Z={}){if(!J)return console.warn("Empty schema provided to layout processor"),{layout:{},element:document.createElement("div"),component:{},get:()=>null,getAll:()=>({}),destroy:()=>{}};if(f0(J))return e7(J,$,Q,Z);return Array.isArray(J)?e7(J,$,Q,Z):$$(J,$,Z)}var M7=T(()=>{E0();h0();$9();X8()});function s9(J,$=null,Q={}){if(typeof J==="function")J=J();if(typeof J==="string"){let Z=document.createElement("template");Z.innerHTML=J.trim();let q=Z.content;if($&&q.hasChildNodes())$.appendChild(q);let j={element:q.firstElementChild};return J9(j)}return B8(J,$,0,Q)}var J$=T(()=>{M7();k7()});function V7(J,$,...Q){if(J===g0)return Q.flat(1/0).filter(Boolean);let Z=$||{};if(Z.style&&typeof Z.style==="object")Z.style=Object.entries(Z.style).map(([K,z])=>{return`${K.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}: ${z}`}).join("; ");let q=Z.id||Z.name||`el-${Math.floor(Math.random()*1e4)}`,j={...Z};delete j.id,delete j.name;let G=Q.flat(1/0).filter((K)=>K!==null&&K!==void 0&&K!==!1);if(typeof J==="function")return[J,q,j,G.length>0?F8(G):void 0].filter(Boolean);else if(typeof J==="string")return[v,q,{...j,tag:J},G.length>0?F8(G):void 0].filter(Boolean);return[]}function F8(J){let $=[];for(let Q of J)if(typeof Q==="string"||typeof Q==="number"||typeof Q==="boolean")$.push(String(Q));else if(Array.isArray(Q))$.push(...F8(Q));else if(Q&&typeof Q==="object")$.push(Q);return $}function Gq(J,$){return s9(J,$)}var g0;var H8=T(()=>{A6();J$();g0=Symbol("Fragment")});var d0;var Q$=T(()=>{H7();J$();k7();M7();X8();H8();J$();d0=s9});var Y6,zq,k8=(J={})=>{let $=new Map,Q=new Set,Z=null,q=null,j=null,G=!1,K=!1,z=null,W=[],Y={event:Y6.CHANGE,data:null},U=J.transform||((M)=>M),X=J.validate||(()=>!0);function _(M,k){if(Q.size===0)return;Y.event=M,Y.data=k,W.length=0,Q.forEach((N)=>W.push(N));for(let N=0;N<W.length;N++)W[N](Y)}function H(){if(G&&j!==null)return j;if(!Z&&!q){let N=Array.from($.values());return j=N,G=!0,N}let M=Array.from($.values()),k=M;if(Z)k=M.filter(Z);if(q)k.sort(q);return j=k,G=!0,k}function B(M){if(!Array.isArray(M)){if(!X(M))return[];return[U(M)]}if(M.length===0)return[];let k=[];for(let N=0;N<M.length;N++)if(X(M[N])){let F=U(M[N]);if(F.id)k.push(F);else throw new Error("Items must have an id property")}return k}return{subscribe(M){return Q.add(M),()=>{Q.delete(M)}},getItems:H,getSize(){return $.size},isLoading(){return K},getError(){return z},query(M){Z=M,G=!1,_(Y6.CHANGE,H())},sort(M){q=M,G=!1,_(Y6.CHANGE,H())},async add(M){try{K=!0,_(Y6.LOADING,!0);let k=B(M);if(k.length===0)return k;for(let N=0;N<k.length;N++)$.set(k[N].id,k[N]);return G=!1,_(Y6.ADD,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async update(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let F=0;F<k.length;F++)if(!$.has(k[F].id))throw new Error(`Item with id ${k[F].id} not found`);let N=B(k);for(let F=0;F<N.length;F++)$.set(N[F].id,N[F]);return G=!1,_(Y6.UPDATE,N),_(Y6.CHANGE,H()),N}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},async remove(M){try{K=!0,_(Y6.LOADING,!0);let k=Array.isArray(M)?M:[M];if(k.length===0)return[];for(let N=0;N<k.length;N++)if(!$.has(k[N]))throw new Error(`Item with id ${k[N]} not found`);for(let N=0;N<k.length;N++)$.delete(k[N]);return G=!1,_(Y6.REMOVE,k),_(Y6.CHANGE,H()),k}catch(k){throw z=k instanceof Error?k:new Error(String(k)),_(Y6.ERROR,z),z}finally{K=!1,_(Y6.LOADING,!1)}},clear(){$.clear(),Z=null,q=null,j=null,G=!1,_(Y6.CHANGE,[])}}};var N7=T(()=>{Y6={CHANGE:"change",ADD:"add",UPDATE:"update",REMOVE:"remove",ERROR:"error",LOADING:"loading"},zq={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var y6,M8=(J={})=>{return{handleError:(Q,Z)=>{throw J.onError?.(Q,Z),Q}}};var V8=T(()=>{y6={EQ:"eq",NE:"ne",GT:"gt",GTE:"gte",LT:"lt",LTE:"lte",IN:"in",NIN:"nin",CONTAINS:"contains",STARTS_WITH:"startsWith",ENDS_WITH:"endsWith"}});var Wq,N8=(J={})=>{let $=M8(J),Q=null,Z=new Map,q=new Map,j={strategy:J.pagination?.strategy||"cursor",cursorParamName:J.pagination?.cursorParamName||"cursor",pageParamName:J.pagination?.pageParamName||"page",perPageParamName:J.pagination?.perPageParamName||"per_page",offsetParamName:J.pagination?.offsetParamName||"offset",limitParamName:J.pagination?.limitParamName||"limit",defaultPageSize:J.pagination?.defaultPageSize||20},G=(H)=>{if(!H)return"http://localhost";if(/^https?:\/\//i.test(H))return H;if(H.startsWith("/"))return`${window.location.origin}${H}`;return`http://${H}`},K=(H,B={})=>{try{let M=H+JSON.stringify(B);if(q.has(M))return q.get(M);let k=G(J.base),N=new URL(k+H);if(Object.entries(B).forEach(([V,O])=>{if(Array.isArray(O))O.forEach((P)=>N.searchParams.append(V,P));else if(O!==null&&O!==void 0)N.searchParams.append(V,String(O))}),J.base&&J.base.startsWith("/")){let V=`${N.pathname}${N.search}`;return q.set(M,V),V}let F=N.toString();return q.set(M,F),F}catch(M){throw console.error("Error building URL:",M,{base:J.base,endpoint:H,params:B}),M}},z=(H)=>{let B={};return Object.entries(H).forEach(([M,k])=>{if(typeof k==="object")Object.entries(k).forEach(([N,F])=>{let V=Wq[N];if(V)B[`${M}_${V}`]=F});else B[M]=k}),B},W=async(H,B={})=>{if(Q)Q.abort();Q=new AbortController;try{let M=await fetch(H,{...B,headers:{"Content-Type":"application/json",...J.headers,...B.headers},signal:Q.signal});if(!M.ok){let N;try{N=await M.json()}catch{N={message:`HTTP error ${M.status}`}}return console.error("API error response:",N),$.handleError(new Error(N.message||"API request failed"))}let k=M.headers.get("content-type");if(k&&k.includes("application/json"))return await M.json();else return await M.text()}catch(M){if(console.error("API request error:",M),M.name==="AbortError")return null;return $.handleError(M)}finally{Q=null}},Y=(H)=>{if(!J.cache)return null;let B=Z.get(H);if(!B)return null;let{data:M,timestamp:k}=B;if(Date.now()-k>300000)return Z.delete(H),null;return M},U=(H,B)=>{if(!J.cache)return;Z.set(H,{data:B,timestamp:Date.now()})},X=(H={},B={})=>{let M={};switch(j.strategy){case"cursor":{let N=H.cursor||B.cursor;if(N)M[j.cursorParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"offset":{let N=H.offset!==void 0?H.offset:B.offset!==void 0?B.offset:0;M[j.offsetParamName]=N;let F=H.limit||B.limit||j.defaultPageSize;M[j.limitParamName]=F;break}case"page":{let N=H.page!==void 0?H.page:B.page!==void 0?B.page:H.cursor?H.cursor:1;M[j.pageParamName]=N;let F=H.per_page||H.perPage||H.limit||B.per_page||B.perPage||B.limit||j.defaultPageSize;M[j.perPageParamName]=F;break}}return M},_=(H,B={},M={})=>{if(J.adapter?.parseResponse)return J.adapter.parseResponse(H);if(H&&H.items)return H;if(Array.isArray(H))return{items:H,meta:{cursor:null,hasNext:!1}};let k=H.data||H.items||H.results||H.content||[],N=H.meta||H.pagination||H.page||{},F=N.total||H.total||k.length,V={cursor:null,hasNext:!1,total:F};switch(j.strategy){case"cursor":{if(N.next||N.nextCursor||N.nextPage)V.cursor=String(N.next||N.nextCursor||N.nextPage),V.hasNext=!0;else if(N.hasMore||N.hasNext)V.hasNext=Boolean(N.hasMore||N.hasNext),V.cursor=N.cursor||(N.page?String(Number(N.page)+1):null);else{let P=B.limit||M.limit||j.defaultPageSize;if(V.hasNext=k.length>=P,V.hasNext&&k.length>0){let L=k[k.length-1];V.cursor=L.id||L._id||String(k.length)}}break}case"offset":{let P=Number(B.offset||M.offset||N.offset||0),L=Number(B.limit||M.limit||N.limit||j.defaultPageSize),D=k.length;if(F!==void 0)V.hasNext=P+D<F;else V.hasNext=D>=L;V.cursor=V.hasNext?String(P+D):null,V.offset=P;break}case"page":{let P=Number(B.page||M.page||N.page||N.current_page||1),L=Number(B.per_page||B.perPage||B.limit||M.per_page||M.perPage||M.limit||N.per_page||N.perPage||N.size||N.limit||j.defaultPageSize);V.page=P;let D=Number(N.totalPages||N.total_pages||N.pages||N.pageCount||0);if(D>0)V.hasNext=P<D,V.pages=D;else if(F!==void 0){let R=Math.ceil(F/L);V.hasNext=P<R,V.pages=R}else V.hasNext=k.length>=L;V.cursor=V.hasNext?String(P+1):null;break}}return{items:k,meta:V}};return{...$,create:async(H)=>{let B=K(J.endpoints?.create||"/create"),M=await W(B,{method:"POST",body:JSON.stringify({items:H})});return _(M)},read:async(H={},B={})=>{let M={...H};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((w)=>{delete M[w]});let k=z(M),N=X(H,B),F={};if(H.search||B.search)F.search=H.search||B.search;if(H.sort||B.sort)F.sort=H.sort||B.sort;if(H.fields||B.fields)F.fields=H.fields||B.fields;let V={...k,...N,...F};Object.keys(V).forEach((w)=>{if(V[w]===void 0)delete V[w]});let O=K(J.endpoints?.list||"/list",V),P=O.toString(),L=Y(P);if(L)return L;let D=await W(O),R=_(D,H,B);return U(P,R),R},update:async(H)=>{let B=K(J.endpoints?.update||"/update"),M=await W(B,{method:"PUT",body:JSON.stringify({items:H})});return _(M)},delete:async(H)=>{let B=K(J.endpoints?.delete||"/delete"),M=await W(B,{method:"DELETE",body:JSON.stringify({ids:H})});return _(M)},query:async(H={},B={})=>{let M={...H},k={...B};["cursor","page","offset","limit","per_page","perPage","sort","fields","search"].forEach((D)=>{delete M[D],delete k[D]});let N=z(M),F=X(H,B),V={...k};if(H.search||B.search)V.search=H.search||B.search;let O={...N,...F,...V},P=K(J.endpoints?.list||"/list",O),L=await W(P);return _(L,H,B)},setPaginationStrategy:(H)=>{j.strategy=H},getPaginationConfig:()=>{return{...j}},disconnect:()=>{if(Q)Q.abort(),Q=null;Z.clear(),q.clear()}}};var _8=T(()=>{V8();Wq={[y6.EQ]:"eq",[y6.NE]:"ne",[y6.GT]:"gt",[y6.GTE]:"gte",[y6.LT]:"lt",[y6.LTE]:"lte",[y6.IN]:"in",[y6.NIN]:"nin",[y6.CONTAINS]:"contains",[y6.STARTS_WITH]:"startsWith",[y6.ENDS_WITH]:"endsWith"}});function Uq(J){return{...Yq,...J}}function l0(J){if(!J.renderItem||typeof J.renderItem!=="function")throw new Error("List manager requires a renderItem function");let $=Uq(J);if(!$.collection)$.collection="items";if(!$.transform)$.transform=(Q)=>Q;return $}function r0(J){return Boolean(J.baseUrl)}function p0(J){return J.staticItems||J.items||[]}var Yq;var s0=T(()=>{Yq={renderBufferSize:5,overscanCount:3,itemHeight:48,measureItemsInitially:!0,pageSize:20,loadThreshold:0.8,throttleMs:16,dedupeItems:!0,dynamicItemSize:!1,scrollStrategy:"scroll"}});function m0(J){if(getComputedStyle(J).position==="static")J.style.position="relative";let $=document.createElement("div");$.style.position="relative",$.style.width="100%",$.style.willChange="transform";let Q=document.createElement("div");return Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="1px",Q.style.visibility="hidden",Q.style.pointerEvents="none",J.appendChild($),J.appendChild(Q),{container:J,content:$,spacer:Q}}function a0(J){let $=document.createElement("div");$.className="mtrl-list-sentinel mtrl-list-sentinel--top",$.style.position="absolute",$.style.top="0",$.style.left="0",$.style.width="100%",$.style.height="1px",$.style.pointerEvents="none",$.style.visibility="hidden";let Q=document.createElement("div");return Q.className="mtrl-list-sentinel mtrl-list-sentinel--bottom",Q.style.position="absolute",Q.style.bottom="0",Q.style.left="0",Q.style.width="100%",Q.style.height="1px",Q.style.pointerEvents="none",Q.style.visibility="hidden",J.content.appendChild($),J.content.appendChild(Q),{...J,topSentinel:$,bottomSentinel:Q}}function L8(J,$){J.spacer.style.height=`${$}px`}function c0(J){if(J.content.parentNode)J.content.parentNode.removeChild(J.content);if(J.spacer.parentNode)J.spacer.parentNode.removeChild(J.spacer);if(J.topSentinel&&J.topSentinel.parentNode)J.topSentinel.remove();if(J.bottomSentinel&&J.bottomSentinel.parentNode)J.bottomSentinel.remove()}var i0=(J=48)=>{let $=new Map,Q=new Map,Z=!1,q=!0,j=!1,G=(W)=>{if(!W)return;return W.id||W.original&&W.original.id},K=(W)=>{if(Z&&Q.size>=W.length)return;if(Q.clear(),q){let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y),Y+=J}}else{let Y=0;for(let U=0;U<W.length;U++)if(W[U]){let X=G(W[U]);if(X)Q.set(X,Y);Q.set(`index:${U}`,Y);let _=X&&$.has(X)?$.get(X):J;Y+=_}}Z=!0},z=(W)=>{if(!W)return;if(j=W.dynamicItemSize===!0,q=!j,W.itemHeight)J=W.itemHeight};return{setup:(W)=>{z(W)},measureItemHeight:(W,Y)=>{if(!Y||!W)return J;if(q&&$.size>0)return J;let U=G(W);if(!U)return J;let X=Y.offsetHeight;if(j||$.size===0||$.has(U)){if(X>0){let H=$.get(U)!==X;if($.size===0&&!j)J=X;if(H){if($.set(U,X),Z&&!q)Z=!1}}}if($.size===1&&!j&&Y.offsetHeight>0)return $.values().next().value;return j?$.get(U)||J:J},getItemHeight:(W)=>{if(q)return J;if(!W)return J;let Y=G(W);if(!Y)return J;if($.has(Y))return $.get(Y)||J;return J},setItemHeights:(W)=>{if(q&&!j)return!1;let Y=!1;for(let[U,X]of Object.entries(W))if($.get(U)!==X&&X>0)$.set(U,X),Y=!0;if(Y)Z=!1;return Y},calculateTotalHeight:(W)=>{if(!W||W.length===0)return 0;let Y=W.length;if(q)return Y*J;let U=0;for(let X of W){if(!X)continue;let _=G(X);U+=_&&$.has(_)?$.get(_):J}return U},getItemOffset:(W,Y)=>{if(Z&&Q.has(Y))return Q.get(Y)||0;if(K(W),Q.has(Y))return Q.get(Y)||0;if(q){let U=W.findIndex((X)=>G(X)===Y);if(U>=0)return U*J}else{let U=0;for(let X of W){let _=G(X);if(_===Y)return U;let H=_&&$.has(_)?$.get(_):J;U+=H}}return-1},getOffsetAtIndex:(W)=>{let Y=`index:${W}`;if(Z&&Q.has(Y))return Q.get(Y)||0;if(q)return W*J;return W*J},measureMarkedElements:(W,Y)=>{let U=$.size===0?".mtrl-list-item":'[data-needs-measurement="true"]',X=W.querySelectorAll(U),_=!1;if(X.length>0){if($.size===0&&X.length>0){let B=X[0].offsetHeight;if(B>0){if(J=B,_=!0,!j)return!0}}if(j)for(let H=0;H<X.length;H++){let B=X[H],M=B.getAttribute("data-id");if(M){if(Y.find((N)=>G(N)===M)){let N=B.offsetHeight;if(N>0&&$.get(M)!==N)$.set(M,N),_=!0;delete B.dataset.needsMeasurement}}}if(_&&!q)Z=!1}return _},hasCachedOffsets:()=>{return Z},calculateOffsets:K,clear:()=>{$.clear(),Q.clear(),Z=!1},getAllHeights:()=>{return new Map($)},getDefaultHeight:()=>{return J},isUsingUniformHeight:()=>{return q}}};function Xq(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3}=q,K=Math.floor(J/$),z=Math.ceil(Q/$),W=K+z,Y=Math.max(0,K-j-G),U=Math.min(Z,W+j+G);return{start:Y,end:U}}function Bq(J,$,Q,Z,q,j,G){let K=0,z=$.length-1,W=0;if(typeof Z.hasCachedOffsets==="function"&&Z.hasCachedOffsets())while(K<=z){let H=Math.floor((K+z)/2);if(!$[H]){K=H+1;continue}if(Z.getItemOffset($,$[H].id)<J)W=H,K=H+1;else z=H-1}else{let H=Z.getAllHeights(),B=G;if(H.size>0){let k=0,N=0;H.forEach((F)=>{k+=F,N++}),B=k/N}W=Math.floor(J/B);let M=W*B;while(W<$.length&&M<J){if($[W])M+=Z.getItemHeight($[W]);W++}while(W>0&&M>J)if(W--,$[W])M-=Z.getItemHeight($[W])}W=Math.max(0,Math.min(W,$.length-1));let Y=Math.max(0,W-q-j),U=0;for(let H=0;H<Y;H++)if($[H])U+=Z.getItemHeight($[H]);let X=Y,_=J+Q+q*G;while(X<$.length&&U<_){if($[X])U+=Z.getItemHeight($[X]);X++}return X=Math.min($.length,X+j),{start:Y,end:X}}function o0(J,$,Q,Z,q){let{renderBufferSize:j=5,overscanCount:G=3,itemHeight:K=48}=q;if($.length===0)return{start:0,end:0};if($.length<10)return{start:0,end:$.length};let z=Z.getAllHeights();if(new Set(z.values()).size<=1&&$.length>20)return Xq(J,K,Q,$.length,q);if($.length>100)return Bq(J,$,Q,Z,j,G,K);let Y=0,U=0,X=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+H>J-j*q.itemHeight){U=Math.max(0,_-G);break}Y+=H}Y=0;for(let _=0;_<$.length;_++){if(!$[_])continue;let H=Z.getItemHeight($[_]);if(Y+=H,Y>J+Q+j*q.itemHeight){X=Math.min($.length,_+G);break}}if(X===0)X=$.length;return{start:U,end:X}}function t0(J,$,Q){if(typeof Q.hasCachedOffsets==="function"&&Q.hasCachedOffsets()&&typeof Q.getOffsetAtIndex==="function"){let j=[];for(let G=$.start;G<$.end;G++)if(J[G])j.push({index:G,item:J[G],offset:Q.getOffsetAtIndex(G)});return j}let Z=0;for(let j=0;j<$.start;j++)if(J[j])Z+=Q.getItemHeight(J[j]);let q=[];for(let j=$.start;j<$.end;j++)if(J[j])q.push({index:j,item:J[j],offset:Z}),Z+=Q.getItemHeight(J[j]);return q}function n0(J,$,Q,Z){if(Q<=0||$<=0)return!1;return(J+$)/Q>Z}var e0=(J,$,Q,Z)=>{let q=null,j=new Map,G={start:0,end:0};if(typeof Q.setup==="function")Q.setup(J);let K=(W,Y)=>{if(!W){console.warn("Attempted to render undefined item at index",Y);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}let U=Z.getRecycledElement(W),X=J.renderItem(W,Y,U);if(!X){console.warn("renderItem returned null or undefined for item",W);let _=document.createElement("div");return _.style.height=`${J.itemHeight||48}px`,_}if(!X.classList.contains("mtrl-list-item"))X.classList.add("mtrl-list-item");if(W.id&&!X.hasAttribute("data-id"))X.setAttribute("data-id",W.id);if(W.type)X.dataset.itemType=W.type;if((J.dynamicItemSize===!0||j.size===0)&&!X.hasAttribute("data-needs-measurement"))X.dataset.needsMeasurement="true";if(q)q(W,X);return X},z=(W,Y,U)=>{if(Math.abs(U.end-U.start-(G.end-G.start))>10)return!1;let _=0;return Array.from(W).forEach((H)=>{if(Y.has(H))_++}),_>=W.size/2};return{setRenderHook:(W)=>{q=W},renderVisibleItems:(W,Y)=>{if(!$.content)return console.warn("Cannot render items: content element missing"),new Map;if(Y.start===G.start&&Y.end===G.end)return j;G=Y;let{topSentinel:U,bottomSentinel:X}=$,_=t0(W,Y,Q),H=new Set(_.map((k)=>k.item.id)),B=new Set(j.keys());if(z(H,B,Y)){let k=_.filter((F)=>!B.has(F.item.id));if(Array.from(j.entries()).filter(([F])=>!H.has(F)).forEach(([F,V])=>{Z.recycleElement(V),j.delete(F),V.remove()}),k.length>0){let F=document.createDocumentFragment();k.forEach(({index:V,item:O,offset:P})=>{let L=K(O,V);L.style.position="absolute",L.style.top=`${P}px`,L.style.left="0",L.style.width="100%",F.appendChild(L),j.set(O.id,L)}),$.content.appendChild(F)}_.forEach(({item:F,offset:V})=>{if(j.has(F.id)){let O=j.get(F.id);if(parseInt(O.style.top,10)!==V)O.style.top=`${V}px`}})}else{let k=new Map;Array.from($.content.children).forEach((F)=>{if(F===U||F===X)return;let V=F.getAttribute("data-id");if(V)k.set(V,F),F.remove()});let N=document.createDocumentFragment();j.clear(),_.forEach(({index:F,item:V,offset:O})=>{let P;if(k.has(V.id)){if(P=k.get(V.id),k.delete(V.id),P.style.top=`${O}px`,J.dynamicItemSize===!0||j.size===0)P.dataset.needsMeasurement="true"}else P=K(V,F),P.style.position="absolute",P.style.top=`${O}px`,P.style.left="0",P.style.width="100%";N.appendChild(P),j.set(V.id,P)}),k.forEach((F)=>{Z.recycleElement(F)}),$.content.innerHTML="",$.content.appendChild(N)}if(U&&!U.parentNode)$.content.insertBefore(U,$.content.firstChild);if(X&&!X.parentNode)$.content.appendChild(X);return j},getItemElements:()=>{return new Map(j)}}};var $4=()=>{};function J4(J,$,Q,Z){let{scrollStrategy:q="scroll"}=Q;switch(q){case"intersection":return Q4(J,$,Z);case"hybrid":return Fq(J,$,Z);case"scroll":default:return D8(J,Q,Z)}}function D8(J,$,Q){let Z=null,q=0,j=5,G=$.throttleMs||16,K=0;return{setup:()=>{let z=(W)=>{let Y=W.target.scrollTop;if(Math.abs(Y-q)<j)return;let U=Date.now();if(U-K<G){if(Z)return;Z=requestAnimationFrame(()=>{q=Y,K=Date.now(),Q.onScroll(Y),Z=null});return}q=Y,K=U,Q.onScroll(Y)};return J.addEventListener("scroll",z,{passive:!0}),()=>{if(J.removeEventListener("scroll",z),Z)cancelAnimationFrame(Z),Z=null}},getScrollTop:()=>{return J.scrollTop}}}function Q4(J,$,Q){let Z=null,q=null,j=null,G=!1;return{setup:()=>{if(!("IntersectionObserver"in window))return console.warn("IntersectionObserver not supported, falling back to scroll events"),D8(J,{renderItem:()=>document.createElement("div")},Q).setup();if(!$.topSentinel||!$.bottomSentinel)Object.assign($,a0($));if(Z=new IntersectionObserver((W)=>{if(G)return;G=!0;let Y=!1,U=!1;if(W.forEach((X)=>{if(X.target===$.topSentinel&&X.isIntersecting)Y=!0;if(X.target===$.bottomSentinel&&X.isIntersecting)U=!0,Y=!0}),U){if(j!==null)clearTimeout(j);j=window.setTimeout(()=>{Q.onLoadMore(),j=null},100)}if(Y)Q.onScroll(J.scrollTop);setTimeout(()=>{G=!1},100)},{root:J,rootMargin:"400px 0px 400px 0px",threshold:0}),$.topSentinel)Z.observe($.topSentinel);if($.bottomSentinel)Z.observe($.bottomSentinel);let K=()=>{if(!G)Q.onScroll(J.scrollTop)},z=0;return q=()=>{let W=Date.now();if(W-z<200)return;z=W,K()},J.addEventListener("scroll",q,{passive:!0}),()=>{if(Z)Z.disconnect(),Z=null;if(q)J.removeEventListener("scroll",q),q=null;if(j!==null)clearTimeout(j),j=null}},getScrollTop:()=>{return J.scrollTop}}}function Fq(J,$,Q){let q=D8(J,{throttleMs:32,renderItem:()=>document.createElement("div")},{onScroll:Q.onScroll,onLoadMore:()=>{}}),j=Q4(J,$,{onScroll:(K)=>{let z=J.scrollTop;if(Math.abs(z-K)>50)Q.onScroll(z)},onLoadMore:Q.onLoadMore}),G=[];return{setup:()=>{return G.push(q.setup()),G.push(j.setup()),()=>{G.forEach((K)=>K()),G=[]}},getScrollTop:()=>{return q.getScrollTop()}}}var Z4=()=>{};var q4=()=>{let J=new Map,$=50;return{getRecycledElement:(Q)=>{let Z=Q.type||"default";if(!J.has(Z))return J.set(Z,[]),null;let q=J.get(Z);return q.length>0?q.pop():null},recycleElement:(Q,Z=!1)=>{if(!Q)return;if(!Z&&Q.innerHTML.length<100)return;let q=Q.dataset.itemType||"default";if(!J.has(q))J.set(q,[]);let j=J.get(q);if(j.length<50){Q.style.display="none",Q.style.top="-9999px";for(let G in Q.dataset)if(G!=="itemType")delete Q.dataset[G];j.push(Q)}},getPool:(Q)=>{return J.get(Q)||[]},clear:()=>{J.forEach((Q)=>{Q.length=0}),J.clear()},getSize:()=>{let Q=0;return J.forEach((Z)=>{Q+=Z.length}),Q}}};function j4(J){let $=Boolean(J.baseUrl),Q=!$,Z=Q?J.staticItems||J.items||[]:[],q=J.pagination?.strategy||"cursor";return{items:Z,visibleItems:[],visibleRange:{start:0,end:0},totalHeight:0,totalHeightDirty:!0,itemHeights:new Map,loading:!1,cursor:null,page:q==="page"?1:void 0,paginationStrategy:q,hasNext:$,itemElements:new Map,scrollTop:0,containerHeight:0,scrollRAF:null,resizeRAF:null,mounted:!1,itemCount:Z.length,useStatic:Q,renderHook:null}}function K4(J,$,Q,Z=!0){let q=Q.cursor??null,j=Q.hasNext??!1,G=J.page;if(Q.page!==void 0)G=Q.page;else if(q&&/^\d+$/.test(q))G=parseInt(q,10)-1;if(J.paginationStrategy==="page"&&Q.page===void 0&&!q)G=J.page;let K;if(J.paginationStrategy==="page"&&J.page===1)K=[...$];else{let W=$;if(Z&&$.length>0&&J.items.length>0){let Y=new Set;for(let U=0;U<J.items.length;U++){let X=J.items[U];if(X&&X.id)Y.add(X.id)}W=$.filter((U)=>U&&U.id&&!Y.has(U.id))}K=[...J.items,...W]}let z=Q.total!==void 0?Q.total:K.length;return{items:K,cursor:q,page:G,hasNext:j,totalHeightDirty:!0,itemCount:z}}function G4(J,$,Q){return{visibleItems:$,visibleRange:Q}}function O8(J,$){return{totalHeight:$,totalHeightDirty:!1}}function P8(J,$){return{loading:$}}function z4(J,$=[]){return{items:J.useStatic?[...$]:[],visibleItems:[],visibleRange:{start:0,end:0},itemElements:new Map,cursor:null,page:J.paginationStrategy==="page"?1:void 0,hasNext:!J.useStatic,totalHeightDirty:!0,itemCount:J.useStatic?$.length:0}}function W4(J,$){let Q={};switch($||J.paginationStrategy||"cursor"){case"page":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);else if(J.page!==void 0)Q.page=J.page;else Q.page=1;break}case"offset":{if(J.cursor&&/^\d+$/.test(J.cursor))Q.offset=parseInt(J.cursor,10);else Q.offset=0;break}case"cursor":default:{if(J.cursor)Q.cursor=J.cursor;if(J.cursor&&/^\d+$/.test(J.cursor))Q.page=parseInt(J.cursor,10);break}}return Q}var R8=(J,$,Q)=>{Q.collection=J;let Z=l0(Q);if(!$||!($ instanceof HTMLElement))throw new Error("List manager requires a valid container element");let q=r0(Z),j=!q,G=j?p0(Z):[],K=j4(Z);K.useStatic=j;let z=m0($),W=i0(Z.itemHeight),Y=q4(),U=e0(Z,z,W,Y),X=k8({transform:Z.transform,initialCapacity:j?G.length:50}),_=q?N8({base:Z.baseUrl,endpoints:{list:`/${J}`},headers:{"Content-Type":"application/json"},cache:!0,pagination:Z.pagination?{strategy:Z.pagination.strategy||"cursor",...Z.pagination}:{strategy:"cursor"}}):null,H=[],B=async(L={})=>{try{if(Object.assign(K,P8(K,!0)),K.useStatic)return{items:[...K.items],meta:{cursor:null,hasNext:!1}};if(!_)throw new Error("Cannot load items: API adapter not initialized");let D=await _.read(L),R=Array.isArray(D.items)?D.items.map(Z.transform):[];if(Object.assign(K,K4(K,R,D.meta,Z.dedupeItems)),K.paginationStrategy==="page"&&L.page===1){if(await X.clear(),R.length>0)await X.add(R)}else if(Z.dedupeItems){let w=new Set(K.items.map((x)=>x.id).filter(Boolean)),A=R.filter((x)=>!w.has(x.id));if(A.length>0)await X.add(A)}else await X.add(R);if(K.totalHeightDirty=!0,Z.afterLoad){let w=[...K.items],A={loading:!1,hasNext:K.hasNext,hasPrev:!!L.cursor||L.page&&L.page>1,items:[...R],allItems:w};Z.afterLoad(A)}if(K.paginationStrategy==="cursor"&&D.meta?.cursor)K.cursor=D.meta.cursor;else if(K.paginationStrategy==="page"&&L.page)K.page=L.page;return{items:R,meta:D.meta}}catch(D){return console.error(`Error loading ${J}:`,D),{items:[],meta:{cursor:null,hasNext:!1}}}finally{Object.assign(K,P8(K,!1))}},M=(L=K.scrollTop)=>{if(!K.mounted)return;if(K.containerHeight===0)K.containerHeight=$.clientHeight;K.scrollTop=L;let D=o0(L,K.items,K.containerHeight,W,Z);if(D.start===K.visibleRange.start&&D.end===K.visibleRange.end)return;if(Object.assign(K,G4(K,K.items.slice(D.start,D.end).filter(Boolean),D)),typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);if(K.totalHeightDirty){let w=W.calculateTotalHeight(K.items);Object.assign(K,O8(K,w)),L8(z,w)}if(U.renderVisibleItems(K.items,D),W.measureMarkedElements(z.content,K.items)){let w=W.calculateTotalHeight(K.items);Object.assign(K,O8(K,w)),L8(z,w)}k(L)},k=(L)=>{if(K.loading||!K.hasNext)return;if(n0(L,K.containerHeight,K.totalHeight,Z.loadThreshold))N()},N=async()=>{if(K.loading||!K.hasNext)return{hasNext:K.hasNext,items:[]};if(K.useStatic)return{hasNext:!1,items:[]};let L=Z.pagination?.strategy||"cursor";if(K.paginationStrategy=L,L==="page")if(K.cursor&&/^\d+$/.test(K.cursor))K.page=parseInt(K.cursor,10);else if(K.page!==void 0)K.page+=1;else K.page=1;let D=W4(K,L);if(!D.limit&&!D.per_page)if(L==="page"){let w=Z.pagination?.perPageParamName||"per_page";D[w]=Z.pageSize||20}else{let w=Z.pagination?.limitParamName||"limit";D[w]=Z.pageSize||20}let R=await B(D);return M(K.scrollTop),{hasNext:K.hasNext,items:R.items}},F=async()=>{if(Object.assign(K,z4(K,G)),Y.clear(),X.clear(),K.useStatic&&G&&G.length>0)K.items=[...G],await X.add(G);else await B();M(0)},V=(L,D="start")=>{if(typeof W.calculateOffsets==="function")W.calculateOffsets(K.items);let R=W.getItemOffset(K.items,L);if(R===-1)return;let w=R;if(D==="center")w=R-K.containerHeight/2;else if(D==="end"){let A=K.items.findIndex((I)=>I&&I.id===L);if(A===-1)return;let x=W.getItemHeight(K.items[A]);w=R-K.containerHeight+x}$.scrollTo({top:Math.max(0,w),behavior:"smooth"})},P=(()=>{K.mounted=!0;let D=J4($,z,Z,{onScroll:M,onLoadMore:N}).setup();H.push(D);let R=X.subscribe(({event:w})=>{if(w===Y6.CHANGE)K.totalHeightDirty=!0,requestAnimationFrame(()=>{M(K.scrollTop)})});if(H.push(R),K.useStatic&&G&&G.length>0)X.add(G).then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error adding static items to collection:",w)});else if(!K.useStatic)B().then(()=>{requestAnimationFrame(()=>{M(K.scrollTop)})}).catch((w)=>{console.error("Error loading items:",w)});if("ResizeObserver"in window){let w=new ResizeObserver((A)=>{for(let x of A)if(x.target===$){let I=$.clientHeight;if(I!==K.containerHeight){if(K.containerHeight=I,K.resizeRAF)cancelAnimationFrame(K.resizeRAF);K.resizeRAF=requestAnimationFrame(()=>{M(K.scrollTop),K.resizeRAF=null})}}});w.observe($),H.push(()=>{if(w.disconnect(),K.resizeRAF)cancelAnimationFrame(K.resizeRAF),K.resizeRAF=null})}else{let w=null,A=()=>{if(w)clearTimeout(w);w=window.setTimeout(()=>{let x=$.clientHeight;if(x!==K.containerHeight)K.containerHeight=x,M(K.scrollTop);w=null},100)};window.addEventListener("resize",A,{passive:!0}),H.push(()=>{if(window.removeEventListener("resize",A),w)clearTimeout(w),w=null})}return()=>{H.forEach((w)=>w()),H.length=0,K.mounted=!1}})();return{loadItems:B,loadMore:N,refresh:F,updateVisibleItems:M,scrollToItem:V,setItemHeights:(L)=>{let D=W.setItemHeights(L);if(D)K.totalHeightDirty=!0,M(K.scrollTop);return D},getCollection:()=>X,getVisibleItems:()=>K.visibleItems,getAllItems:()=>K.items,isLoading:()=>K.loading,hasNextPage:()=>K.hasNext,isApiMode:()=>q,setRenderHook:(L)=>{U.setRenderHook(L),M(K.scrollTop)},destroy:()=>{if(P(),X.clear(),typeof W.clear==="function")W.clear();if(Y.clear(),z.content)z.content.innerHTML="";if(c0(z),_&&typeof _.disconnect==="function")_.disconnect()}}},Hq;var A8=T(()=>{N7();_8();s0();$4();Z4();Hq={track:(J)=>({id:J._id,headline:J.title||"Untitled",supportingText:J.artist||"Unknown Artist",meta:J.year?.toString()||""}),playlist:(J)=>({id:J._id,headline:J.name||"Untitled Playlist",supportingText:`${J.tracks?.length||0} tracks`,meta:J.creator||""}),country:(J)=>({id:J._id,headline:J.name||J.code,supportingText:J.continent||"",meta:J.code||""})}});var Y4=T(()=>{N7();N7();N7();A8();V8();_8()});var U4=(J,$,Q,Z,q,j)=>{if(Z<0||q<0)return;let G=typeof j==="number"?[j,j,j,j]:j,[K,z,W,Y]=G;J.beginPath(),J.moveTo($+K,Q),J.lineTo($+Z-z,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+z),J.lineTo($+Z,Q+q-W),J.quadraticCurveTo($+Z,Q+q,$+Z-W,Q+q),J.lineTo($+Y,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-Y),J.lineTo($,Q+K),J.quadraticCurveTo($,Q,$+K,Q),J.closePath()},QX=(J,$,Q,Z,q,j,G)=>{if(J.save(),G)J.fillStyle=G;U4(J,$,Q,Z,q,j),J.fill(),J.restore()},X4=(J,$,Q,Z,q,j)=>{return J.save(),U4(J,$,Q,Z,q,j),J.clip(),()=>J.restore()},B4=(J,$,Q,Z,q,j,G,K)=>{if(Z<0||q<0)return;if(J.save(),K)J.fillStyle=K;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+Z-G,Q),J.quadraticCurveTo($+Z,Q,$+Z,Q+G),J.lineTo($+Z,Q+q-G),J.quadraticCurveTo($+Z,Q+q,$+Z-G,Q+q),J.lineTo($+j,Q+q),J.quadraticCurveTo($,Q+q,$,Q+q-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},F4=(J,$,Q,Z)=>{if(Z)J.fillStyle=Z,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var w8=(J)=>{let j=J;for(let U=0;U<4;U++){let B=j*j,k=1.6*(B*j)+-1.8000000000000003*B+1.2000000000000002*j-J,N=4.800000000000001*B+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(k)<0.00001)break;j=j-k/N}let G=0,K=3-G,z=1-G-K,W=j*j,Y=W*j;return z*Y+K*W+G*j},H4,qX;var k4=T(()=>{H4={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},qX={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:w8}});class kq{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Mq{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var M4=(J,$,Q)=>{let Z=window.devicePixelRatio||1,q=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*Z),J.height=Math.round(Q*Z),q.setTransform(1,0,0,1,0,0),q.scale(Z,Z),{canvas:J,ctx:q,width:$,height:Q,pixelRatio:Z}},V4=(J,$,Q)=>{let{canvas:Z,ctx:q,pixelRatio:j}=J;Z.style.width=`${$}px`,Z.style.height=`${Q}px`,Z.width=Math.round($*j),Z.height=Math.round(Q*j),J.width=$,J.height=Q,q.setTransform(1,0,0,1,0,0),q.scale(j,j)},N4=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},x8=(J,$)=>{let Q=B6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},_4=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var L4=T(()=>{$9()});var y8=T(()=>{k4();L4()});var _7=T(()=>{J6();A9();v0();C0();Q$();Y4();y8();w6();J8();$9();p7()});var D4=({disabled:J,lifecycle:$})=>(Q)=>{let Z={setText:(G)=>{return Q.text.setText(G),Z},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},q={setIcon:(G)=>{return Q.icon.setIcon(G),q},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:Z,icon:q,disabled:J,lifecycle:$,getClass:Q.getClass,on:(G,K)=>{if(Q.on)Q.on(G,K);return j},off:(G,K)=>{if(Q.off)Q.off(G,K);return j},addClass:(...G)=>{if(Q.addClass)Q.addClass(...G);else g(Q.element,...G);return j},getValue:()=>Q.element.value,setValue(G){return Q.element.value=G,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(G){return Q.text.setText(G),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let G=Q.icon.getElement();return!!G&&!!G.innerHTML.trim()&&!!G.parentNode},setIcon(G){let K=Q.componentName||"button",z=Q.getClass(K);if(!G){let W=Q.icon.getElement();if(W&&W.parentNode)W.parentNode.removeChild(W),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${z}--icon`)}else if(!j.hasIcon()){let W=document.createElement("span");if(W.className=`${Q.getClass("button-icon")}`,W.innerHTML=G,Q.element.firstChild)Q.element.insertBefore(W,Q.element.firstChild);else Q.element.appendChild(W);Q.icon.getElement=()=>W,Q.icon.getIcon=()=>G,Q.element.classList.add(`${z}--icon`)}else{let W=Q.icon.getElement();if(W)W.innerHTML=G}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(G){let K=Q.componentName||"button",z=Q.getClass(K);return["filled","tonal","outlined","elevated","text"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getVariant(){let G=Q.componentName||"button",K=Q.getClass(G),z=["filled","tonal","outlined","elevated","text"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"filled"},getSize(){let G=Q.componentName||"button",K=Q.getClass(G),z=["xs","s","m","l","xl"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"s"},setSize(G){let K=Q.componentName||"button",z=Q.getClass(K);return["xs","s","m","l","xl"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},getShape(){let G=Q.componentName||"button",K=Q.getClass(G),z=["round","square"];for(let W of z)if(Q.element.classList.contains(`${K}--${W}`))return W;return"round"},setShape(G){let K=Q.componentName||"button",z=Q.getClass(K);return["round","square"].map((Y)=>`${z}--${Y}`).forEach((Y)=>{Q.element.classList.remove(Y)}),Q.element.classList.add(`${z}--${G}`),j},setActive(G){if(G)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(G){return Q.element.setAttribute("aria-label",G),j},destroy(){$.destroy()},updateCircularStyle(){let G=Q.text.getText()!=="",K=j.hasIcon();if(!G)g(Q.element,"button--circular"),j6(Q.element,"button--icon");else j6(Q.element,"button--circular");if(K&&G)g(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(G)=>{return await Q.setProgress(G),j};if(Q.setProgressSync)j.setProgressSync=(G)=>{return Q.setProgressSync(G),j};if(Q.setIndeterminate)j.setIndeterminate=async(G)=>{return await Q.setIndeterminate(G),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(G)=>{return Q.setIndeterminateSync(G),j};if(Q.setLoading)j.setLoading=async(G,K)=>{return await Q.setLoading(G,K),j};if(Q.setLoadingSync)j.setLoadingSync=(G,K)=>{return Q.setLoadingSync(G,K),j};return j};var O4=T(()=>{_7()});var Z$,q$,j$,K$,P4,m9;var T8=T(()=>{Z$={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},q$={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},j$={ROUND:"round",SQUARE:"square"},K$={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},P4={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},m9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Vq,R4=(J={})=>u(Vq,J,"button"),A4=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},w4=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var x4=T(()=>{t();T8();Vq={variant:Z$.FILLED,size:q$.S,shape:j$.ROUND,disabled:!1,type:K$.BUTTON,ripple:!0,rippleConfig:{duration:m9.DURATION,timing:m9.TIMING,opacity:m9.OPACITY}}});var Nq=(J={})=>{let $=R4(J);try{return b(S,d(),h(A4($)),K6($),f7($),Y9($),U9($),G6($),S0($),S6($),C(),(Z)=>{if($.shape&&Z.element){let q=`${$.prefix}-${$.componentName}--${$.shape}`;Z.element.classList.add(q)}return Z},(Z)=>D4(w4(Z))(Z))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},Q9;var y4=T(()=>{J6();c();o();b0();O4();x4();Q9=Nq});var T4={};KJ(T4,{default:()=>Q9});var T9=T(()=>{y4()});var G9={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},y$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},T$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},P9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},I$={START:"start",CENTER:"center",END:"end"},$6={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var E7={FILLED:"filled",OUTLINED:"outlined"},h7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},S$={MOUSE:"mouse",KEYBOARD:"keyboard"},b$={CHANGE:"change",OPEN:"open",CLOSE:"close"},v$={DROPDOWN:'<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="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<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="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},E9={VARIANT:E7.FILLED,PLACEMENT:h7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},C$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};K7();J6();t();var Z8={CENTER:"center",END:"end"},q8=300;var s3={tag:"div",hasFab:!1,fabPosition:Z8.END,autoHide:!1,transitionDuration:q8},Y0=(J={})=>u(s3,J,"bottom-app-bar");var U0=(J={})=>{let $=Y0(J),Q=S($),Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-actions`;let q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=h({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),G=d()(j),K=C()(G);K.element.appendChild(Z),K.element.appendChild(q);let z=!0,W=window.scrollY;if($.autoHide){let U=()=>{let _=window.scrollY;if(_>W+10){if(z)Y.hide(),$.onVisibilityChange?.(!1)}else if(_<W-10){if(!z)Y.show(),$.onVisibilityChange?.(!0)}W=_};window.addEventListener("scroll",U,{passive:!0});let X=K.lifecycle.destroy;K.lifecycle.destroy=()=>{window.removeEventListener("scroll",U),X()}}let Y={...K,addAction(U){return Z.appendChild(U),this},addFab(U){return q.innerHTML="",q.appendChild(U),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),z=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),z=!1,this},isVisible(){return z},getActionsContainer(){return Z}};if($.autoHide&&$.transitionDuration)Y.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return Y};var m3=U0;T9();J6();c();o();var I8=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let Z=$.element.querySelector(`.${$.getClass("card")}-header`);if(Z)Z.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),G=j[j.length-1];if(G.nextSibling)$.element.insertBefore(Q,G.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,Z="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(Z==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let Z=$.element.querySelector(`.${$.getClass("card")}-actions`);if(Z)Z.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(Z)=>{$.element.setAttribute("aria-grabbed","true"),Q(Z)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});t();w6();J6();c();A6();var G$=(J={})=>{let $={...J,componentName:"card-content",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${f}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((Z)=>{if(Z instanceof HTMLElement)Q.element.appendChild(Z)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},z$=(J={})=>{let $={...J,componentName:"card-header",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),Z=v({tag:"div",className:`${f}-card-header-text`,container:Q.element});if(J.title){v({tag:"h3",className:`${f}-card-header-title`,text:J.title,container:Z,attributes:{id:`${Q.element.id||"card-header"}-title`}});let q=Q.element.closest(`.${f}-card`);if(q&&!q.hasAttribute("aria-labelledby"))q.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)v({tag:"h4",className:`${f}-card-header-subtitle`,text:J.subtitle,container:Z});if(J.avatar){let q=typeof J.avatar==="string"?v({tag:"div",className:`${f}-card-header-avatar`,html:J.avatar}):J.avatar,j=q.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(q,Q.element.firstChild)}if(J.action){let q=typeof J.action==="string"?v({tag:"div",className:`${f}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},L7=(J={})=>{let $={...J,componentName:"card-actions",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${f}-card-actions--full-bleed`:null,J.vertical?`${f}-card-actions--vertical`:null,J.align?`${f}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((Z,q)=>{if(Z instanceof HTMLElement){if(!Z.hasAttribute("aria-label")&&!Z.hasAttribute("aria-labelledby")&&Z.textContent?.trim()==="")Z.setAttribute("aria-label",`Action ${q+1}`);Q.element.appendChild(Z)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},D7=(J={})=>{let $={...J,componentName:"card-media",prefix:f};try{let Q=b(S,h({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${f}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${f}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let Z=document.createElement("img");if(Z.src=J.src,Z.className=`${f}-card-media-img`,Z.alt=J.alt||"",!J.alt)Z.setAttribute("aria-hidden","true");Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var I9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},O7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},S8={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},I4={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},b8={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},S4={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},b4={TOP:"top",BOTTOM:"bottom"},v4={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var _q={variant:I9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},C4=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},E4=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=z$($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=G$($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=D7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=L7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (T9(),T4)).then(({default:Q})=>{let Z=$.buttons.map((j)=>Q(j).element),q=L7({actions:Z,align:$.actionsConfig?.align||"end"});J.setActions(q)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},h4=(J={})=>u(_q,J,"card"),u4=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",Z={};if(J.aria)Object.entries(J.aria).forEach(([q,j])=>{if(j!==void 0){let G=q.startsWith("aria-")?q:`aria-${q}`;Z[G]=j}});if(!Z.role&&!J.aria?.role)Z.role=Q;if($&&!Z.tabindex)Z.tabindex="0";return p(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:Z,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},f4=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),S9=O7,g4=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===I9.ELEVATED)J.element.style.setProperty("--card-elevation",String(S9.LEVEL1))}),J.element.addEventListener("keydown",(Z)=>{if((Z.key==="Enter"||Z.key===" ")&&$.clickable)Z.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(Z)=>{if(J.element.style.setProperty("--card-elevation",String(S9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:Z}),Z.dataTransfer){let q=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";Z.dataTransfer.setData("text/plain",q)}}),J.element.addEventListener("dragend",(Z)=>{J.element.style.setProperty("--card-elevation",String(S9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:Z})});return J};w6();A6();var Lq=(J={})=>($)=>{let Q=J.initialState||!1,Z=null,q=Q;function j(G){if(q=G,G&&!Z)Z=v({tag:"div",className:`${f}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),v({tag:"div",className:`${f}-card-loading-spinner`,container:Z}),$.element.classList.add(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!G&&Z)Z.remove(),Z=null,$.element.classList.remove(`${f}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>q,setLoading:j}}},v8=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(S9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(S9.LEVEL0));return J},Dq=(J={})=>($)=>{let Q=J.initialExpanded||!1,Z=Q,q=J.expandableContent,j=v({tag:"button",className:`${f}-card-expand-button`,attributes:{"aria-expanded":Z?"true":"false","aria-label":Z?"Collapse content":"Expand content","aria-controls":q?.id||`${$.element.id||"card"}-expandable-content`}}),G=$.element.querySelector(`.${f}-card-actions`);if(G)G.appendChild(j);else v({tag:"div",className:`${f}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(q){if(q.classList.add(`${f}-card-expandable-content`),!q.id)q.id=`${$.element.id||"card"}-expandable-content`;if(!Q)q.style.display="none",q.setAttribute("aria-hidden","true");else q.setAttribute("aria-hidden","false");$.element.appendChild(q)}function K(W){if(Z=W,q)q.style.display=W?"block":"none",q.setAttribute("aria-hidden",W?"false":"true");if(j.setAttribute("aria-expanded",W?"true":"false"),j.setAttribute("aria-label",W?"Collapse content":"Expand content"),W)$.element.classList.add(`${f}-card--expanded`);else $.element.classList.remove(`${f}-card--expanded`);$.emit?.("expandedChanged",{expanded:W})}function z(){K(!Z)}return j.addEventListener("click",(W)=>{W.stopPropagation(),z()}),j.addEventListener("keydown",(W)=>{if(W.key==="Enter"||W.key===" ")W.preventDefault(),z()}),{...$,expandable:{isExpanded:()=>Z,setExpanded:K,toggleExpanded:z}}},Oq=(J={})=>($)=>{let Q=J.threshold||100,Z=0,q=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=v({tag:"button",className:`${f}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),G=v({tag:"button",className:`${f}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),G.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function K(Y){Z=Y.touches[0].clientX,$.element.style.transition="none"}function z(Y){if(!Z)return;q=Y.touches[0].clientX;let U=q-Z;$.element.style.transform=`translateX(${U}px)`}function W(){if(!Z)return;$.element.style.transition="transform 0.3s ease";let Y=q-Z;if(Math.abs(Y)>=Q)if(Y>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(Y<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";Z=0,q=0}return $.element.addEventListener("touchstart",K),$.element.addEventListener("touchmove",z),$.element.addEventListener("touchend",W),$.element.classList.add(`${f}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var Pq=(J={})=>{let $=C4(J),Q=h4($);try{let Z=b(S,d(),h(u4(Q)),K6(Q),Q.clickable?S6(Q):(q)=>q,C(),g4,v8,(q)=>I8(f4(q))(q))(Q);return E4(Z,$),Z}catch(Z){throw console.error("Card creation error:",Z instanceof Error?Z.message:String(Z)),new Error(`Failed to create card: ${Z instanceof Error?Z.message:String(Z)}`)}},d4=Pq;J6();c();o();var k9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},l4={DEFAULT:"default",SNAP:"snap"},Rq={LARGE:"large",MEDIUM:"medium",SMALL:"small"},W$={SLIDE:"slide",FADE:"fade",NONE:"none"},a9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},F6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:W$.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:k9.MULTI_BROWSE,SCROLL_BEHAVIOR:l4.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[k9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[k9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[k9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[k9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var C8=(J)=>($)=>{let Q={...$},Z=J.layout||F6.LAYOUT,q=()=>{let F=document.createElement("div");return F.className=`${$.getClass("carousel")}-wrapper`,F.dataset.layout=Z,$.element.appendChild(F),F},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||F6.GAP}`;let G=q();G.appendChild(j);let K=J.initialSlide||0,z=0,W=[],Y=[];function U(F){if(Y[F]?.size)return Y[F].size;switch(Z){case"multi-browse":if(F===0||F===1)return"large";if(F===2)return"medium";return"small";case"uncontained":return"large";case"hero":return F===0?"large":"small";case"full-screen":return"large";default:return"large"}}function X(){let F=j.clientWidth,V=typeof F6.ITEM_WIDTHS[Z].LARGE==="number"?F6.ITEM_WIDTHS[Z].LARGE:F,O=typeof F6.ITEM_WIDTHS[Z].MEDIUM==="number"?F6.ITEM_WIDTHS[Z].MEDIUM:F*0.75,P=typeof F6.ITEM_WIDTHS[Z].SMALL==="number"?F6.ITEM_WIDTHS[Z].SMALL:F6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")V=Math.min(V,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")P=J.smallItemWidth;if(Z==="full-screen")V=F,O=F,P=F;W.forEach((L,D)=>{let R=U(D);switch(R){case"large":L.style.width=`${V}px`;break;case"medium":L.style.width=`${O}px`;break;case"small":L.style.width=`${P}px`;break}L.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let w=L.querySelector(`.${$.getClass("carousel")}-slide-title`),A=L.querySelector(`.${$.getClass("carousel")}-slide-description`);if(w)if(R==="small"&&Z!=="uncontained")w.classList.add("visually-hidden");else w.classList.remove("visually-hidden");if(A)if(R==="small"||R==="medium"&&Z==="multi-browse")A.classList.add("visually-hidden");else A.classList.remove("visually-hidden")})}function _(F,V){let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide`,O.setAttribute("role","listitem"),O.setAttribute("aria-roledescription","slide"),O.dataset.borderRadius=`${J.borderRadius||F6.BORDER_RADIUS}`;let P=document.createElement("div");P.className=`${$.getClass("carousel")}-slide-image`;let L=document.createElement("img");if(L.src=F.image,L.alt=F.title||"Carousel slide",P.appendChild(L),F.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,F.accent)R.style.backgroundColor=F.accent;P.appendChild(R)}let D=document.createElement("div");if(D.className=`${$.getClass("carousel")}-slide-content`,F.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=F.title,Z==="full-screen")D.appendChild(R);else P.appendChild(R)}if(F.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=F.description,D.appendChild(R)}if(F.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=F.buttonText,F.buttonUrl)R.href=F.buttonUrl;if(F.accent)R.style.backgroundColor=F.accent;D.appendChild(R)}if(O.appendChild(P),O.appendChild(D),V!==void 0&&V>=0&&V<=Y.length)Y.splice(V,0,F);else Y.push(F);if(V!==void 0&&V>=0&&V<=W.length)if(V<W.length)j.insertBefore(O,W[V]),W.splice(V,0,O);else j.appendChild(O),W.push(O);else j.appendChild(O),W.push(O);return z++,X(),O}let H=()=>{if(J.showAllLink===!1)return;let F=document.createElement("div");F.className=`${$.getClass("carousel")}-show-all`,F.setAttribute("role","button"),F.setAttribute("tabindex","0"),F.setAttribute("aria-label","Show all items");let V=document.createElement("span");V.textContent="Show all",F.appendChild(V),G.appendChild(F),F.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),F.addEventListener("keydown",(O)=>{if(O.key==="Enter"||O.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();O.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((F)=>{_(F)});if(J.showAllLink!==!1&&Z!=="full-screen")H();let B=()=>{X();let F=new CustomEvent(a9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(F)};window.addEventListener("resize",B),setTimeout(X,0);let M=(F)=>{if(F<0||F>=z)if(J.loop)if(F<0)F=z-1;else F=0;else return Q;if(K!==F){let V=new CustomEvent(a9.SLIDE_CHANGE,{detail:{previousSlide:K,nextSlide:F}});$.element.dispatchEvent(V),K=F,W.forEach((L,D)=>{if(D===K)L.classList.add(`${$.getClass("carousel")}-slide--active`),L.setAttribute("aria-current","true");else L.classList.remove(`${$.getClass("carousel")}-slide--active`),L.removeAttribute("aria-current")});let O=J.scrollBehavior==="snap"?"smooth":"auto";if(W[F])if(Z==="hero"&&J.centered){let L=W[F].offsetWidth,D=j.clientWidth,R=W[F].offsetLeft;j.scrollTo({left:R-D/2+L/2,behavior:O})}else W[F].scrollIntoView({behavior:O,block:"nearest",inline:"start"});let P=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(P)}return Q};if(Object.assign(Q,{slides:{addSlide:(F,V)=>{return _(F,V),Q.slides},removeSlide:(F)=>{if(F>=0&&F<W.length){if(j.removeChild(W[F]),W.splice(F,1),Y.splice(F,1),z--,K>=z)K=z-1;if(K<0)K=0;X()}return Q.slides},updateSlide:(F,V)=>{if(F>=0&&F<W.length){Y[F]=V;let O=W[F],P=O.querySelector("img");if(P)P.src=V.image,P.alt=V.title||"Carousel slide";let L=O.querySelector(`.${$.getClass("carousel")}-slide-title`);if(L&&V.title)L.textContent=V.title;let D=O.querySelector(`.${$.getClass("carousel")}-slide-description`);if(D&&V.description)D.textContent=V.description;let R=O.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&V.accent)R.style.backgroundColor=V.accent;let w=O.querySelector(`.${$.getClass("carousel")}-slide-button`);if(w)if(V.buttonText){if(w.textContent=V.buttonText,V.buttonUrl)w.href=V.buttonUrl;if(V.accent)w.style.backgroundColor=V.accent}else w.parentElement?.removeChild(w);else if(V.buttonText){let A=O.querySelector(`.${$.getClass("carousel")}-slide-content`);if(A){let x=document.createElement("a");if(x.className=`${$.getClass("carousel")}-slide-button`,x.textContent=V.buttonText,V.buttonUrl)x.href=V.buttonUrl;if(V.accent)x.style.backgroundColor=V.accent;A.appendChild(x)}}if(V.size)X()}return Q.slides},getSlide:(F)=>{if(F>=0&&F<Y.length)return Y[F];return null},getCount:()=>z,getElements:()=>[...W]},slidesContainer:j,slideData:Y,wrapper:G,getCurrentSlide:()=>K,goTo:M,next:()=>M(K+1),prev:()=>M(K-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(F)=>{return J.borderRadius=F,W.forEach((V)=>{V.dataset.borderRadius=`${F}`}),Q},setGap:(F)=>{return J.gap=F,j.dataset.gap=`${F}`,Q},updateLayout:(F)=>{return J.layout=F,G.dataset.layout=F,$.element.dataset.layout=F,Object.values(k9).forEach((V)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${V}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${F}`),X(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let F=0,V=1/0,O=j.scrollLeft,P=j.clientWidth;if(W.forEach((L,D)=>{let w=L.offsetLeft+L.offsetWidth/2,A=O+P/2,x=Math.abs(w-A);if(x<V)V=x,F=D}),F!==K){K=F,W.forEach((D,R)=>{if(R===K)D.classList.add(`${$.getClass("carousel")}-slide--active`),D.setAttribute("aria-current","true");else D.classList.remove(`${$.getClass("carousel")}-slide--active`),D.removeAttribute("aria-current")});let L=new CustomEvent(a9.SLIDE_CHANGED,{detail:{currentSlide:K}});$.element.dispatchEvent(L)}},150)});return Q};var E8=(J)=>($)=>{let Q,Z,q,j=!1,G=0,K=0,z,W=J.scrollBehavior||"default",Y=(V)=>{if(V.button!==0)return;cancelAnimationFrame(z),Q=V.clientX,Z=$.slidesContainer.scrollLeft,q=Q,j=!0,K=Date.now(),G=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(V.pointerId),V.preventDefault()},U=(V)=>{if(!j)return;let O=V.clientX-Q;$.slidesContainer.scrollLeft=Z-O;let P=Date.now(),L=P-K;if(L>0)G=(V.clientX-q)/L;q=V.clientX,K=P,V.preventDefault()},X=()=>{let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft,L=J.layout==="hero"&&J.centered,D=0,R=1/0;return V.forEach((w)=>{let A;if(L)A=w.offsetLeft+w.offsetWidth/2-O/2;else A=w.offsetLeft;let x=Math.abs(A-P);if(x<R)R=x,D=A}),D},_=(V,O,P)=>{let L=Date.now(),D=O-V,R=500;if(Math.abs(P)>0.5)R=Math.min(R,300);let w=()=>{let A=Date.now()-L,x=Math.min(A/R,1);x=1-Math.pow(1-x,3);let I=V+D*x;if($.slidesContainer.scrollLeft=I,x<1)z=requestAnimationFrame(w)};z=requestAnimationFrame(w)},H=(V)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),W==="snap"){let O=X();_($.slidesContainer.scrollLeft,O,G)}else if(Math.abs(G)>0.5){let O=G*100,P=$.slidesContainer.scrollLeft-O;_($.slidesContainer.scrollLeft,P,G)}G=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},B=(V)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(V.pointerId),$.slidesContainer.style.scrollBehavior=""},M=(V)=>{if(J.layout==="full-screen")return;V.preventDefault();let P=(V.deltaY||V.deltaX)*0.5;if(W==="snap")$.slidesContainer.scrollLeft+=P,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let L=X();_($.slidesContainer.scrollLeft,L,0)},150);else $.slidesContainer.scrollLeft+=P},k=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let V=$.slides.getElements(),O=$.slidesContainer.clientWidth,P=$.slidesContainer.scrollLeft;V.forEach((L)=>{let{offsetLeft:D,offsetWidth:R}=L,w=D+R/2,A=P+O/2,x=w-A,I=Math.max(-1,Math.min(1,x/(O/2))),r=L.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${I*-5}%)`})},N=()=>{k()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",Y),window.addEventListener("pointermove",U),window.addEventListener("pointerup",H),window.addEventListener("pointercancel",B),$.slidesContainer.addEventListener("wheel",M,{passive:!1}),$.slidesContainer.addEventListener("scroll",N,{passive:!0});let F=(V)=>{if($.element!==document.activeElement)return;switch(V.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:W==="snap"?"smooth":"auto"});V.preventDefault();break;case"Home":if($.goTo)$.goTo(0);V.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);V.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",F),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(z),$.slidesContainer.removeEventListener("pointerdown",Y),window.removeEventListener("pointermove",U),window.removeEventListener("pointerup",H),window.removeEventListener("pointercancel",B),$.slidesContainer.removeEventListener("wheel",M),$.slidesContainer.removeEventListener("scroll",N),$.element.removeEventListener("keydown",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var r4=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(Z,q)=>{return J.slides.addSlide(Z,q),Q.slides},removeSlide:(Z)=>{return J.slides.removeSlide(Z),Q.slides},updateSlide:(Z,q)=>{return J.slides.updateSlide(Z,q),Q.slides},getSlide:(Z)=>{if($.slideData&&Z>=0&&Z<$.slideData.length)return $.slideData[Z];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(Z){return $.goTo(Z),this},getCurrentSlide:$.getCurrentSlide,addSlide(Z,q){return J.slides.addSlide(Z,q),this},removeSlide(Z){return J.slides.removeSlide(Z),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(Z){if($.setBorderRadius)$.setBorderRadius(Z);return this},setGap(Z){if($.setGap)$.setGap(Z);return this},destroy(){J.lifecycle.destroy()},on(Z,q){if($.on)$.on(Z,q);else if($.element.addEventListener)$.element.addEventListener(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);else if($.element.removeEventListener)$.element.removeEventListener(Z,q);return this},addClass(...Z){if($.addClass)$.addClass(...Z);else Z.forEach((q)=>$.element.classList.add(q));return this}};return Q};t();var Aq={initialSlide:F6.INITIAL_SLIDE,loop:F6.LOOP,transition:W$.SLIDE,transitionDuration:F6.TRANSITION_DURATION,borderRadius:F6.BORDER_RADIUS,gap:F6.GAP,prefix:"carousel",showAllLink:!0},p4=(J={})=>u(Aq,J,"carousel"),s4=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return p(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var wq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||xq(J.layout);let $=p4(J);try{let Z={...b(S,d(),h(s4($)))($)};yq(Z,J);let q=C8($)(Z),j=E8($)(q),G=C()(j),K={slides:{addSlide:G.slides.addSlide,removeSlide:G.slides.removeSlide,updateSlide:G.slides.updateSlide,getCount:G.slides.getCount,getElements:G.slides.getElements},lifecycle:{destroy:G.lifecycle.destroy}},z=r4(K)(G);return z.element.dataset.layout=J.layout,z.element.dataset.scrollBehavior=J.scrollBehavior,z}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function xq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function yq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var m4=wq;J6();c();o();var a4=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(q){return Z.setIndeterminate?.(q),this},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});t();var Tq={variant:"filled",labelPosition:"end"},c4=(J={})=>u(Tq,J,"checkbox"),i4=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),o4=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.innerHTML=`
9
+ </svg>`,P7=(J)=>($)=>{let Q=document.createElement("span");Q.className=`${J.prefix}-${J.componentName}-track`;let q=document.createElement("span");if(q.className=`${J.prefix}-${J.componentName}-thumb`,Q.appendChild(q),J.icon!=="none"){let Z=document.createElement("span");Z.className=`${J.prefix}-${J.componentName}-thumb-icon`,Z.innerHTML=J.icon||f2,q.appendChild(Z)}return $.element.appendChild(Q),{...$,track:Q,thumb:q}};var H$=(J)=>{let $=new Map;return{on(Q,q){return J.addEventListener(Q,q),$.set(q,Q),this},off(Q,q){return J.removeEventListener(Q,q),$.delete(q),this},destroy(){$.forEach((Q,q)=>{J.removeEventListener(Q,q)}),$.clear()},getHandlers(){return new Map($)}}};var OJ=(J)=>($)=>{let Q=H$(J||$.element),q={addListeners(Z){return Object.entries(Z).forEach(([j,K])=>{Q.on(j,K)}),this},removeListeners(Z){return Object.entries(Z).forEach(([j,K])=>{Q.off(j,K)}),this},once(Z,j){let K=(G)=>{j(G),Q.off(Z,K)};return Q.on(Z,K),this},on(Z,j){return Q.on(Z,j),this},off(Z,j){return Q.off(Z,j),this},destroy(){Q.destroy()}};if(B9($)){let Z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Q.destroy(),Z.call($.lifecycle)}}return{...$,events:q,on:q.on.bind(q),off:q.off.bind(q)}};var PJ=()=>{};var RJ=g(()=>{c9();y6()});var o9=(J,$,Q={})=>{let q=null,Z=0,{leading:j=!0,trailing:K=!0}=Q;return function(...G){let Y=Date.now();if(!Z&&!j)Z=Y;let z=$-(Y-Z);if(z<=0||z>$){if(q)clearTimeout(q),q=null;Z=Y,J.apply(this,G)}else if(!q&&K)q=window.setTimeout(()=>{Z=j?Date.now():0,q=null,J.apply(this,G)},z)}},t9=(J,$,Q={})=>{let q=null,Z=null,j=null,K,G=null,Y=0,{leading:z=!1,maxWait:W}=Q,X=(F)=>{let k=F-(G||0),L=F-Y;return!G||k>=$||k<0||W!==void 0&&L>=W},U=(F)=>{let k=Z,L=j;return Z=j=null,Y=F,K=J.apply(L,k),K},_=(F)=>{if(q=null,Z)return U(F);return K},N=(F)=>{return Y=F,q=window.setTimeout(()=>{_(Date.now())},$),z?U(F):K};return function(...F){let k=Date.now(),L=X(k);if(Z=F,j=this,G=k,L){if(q===null)return N(k);if(W!==void 0)q=window.setTimeout(()=>{let D=Date.now();if(X(D))return _(D)},Math.min($,W-(k-Y)))}if(q===null)q=window.setTimeout(()=>{_(Date.now())},$);return K}},M$=(J)=>{let $=!1,Q;return function(...q){if(!$)$=!0,Q=J.apply(this,q);return Q}};var yJ=(J={})=>($)=>{let Q={},q=(K,G,Y,z={})=>{if(Q[K])Z(K);let W=o9(G,Y,z);return $.element.addEventListener(K,W),Q[K]={original:G,throttled:W},j},Z=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.throttled),delete Q[K];return j};if(B9($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let Y=Q[G];$.element.removeEventListener(G,Y.throttled)}),K.call($.lifecycle)}}if(J.throttledEvents)Object.entries(J.throttledEvents).forEach(([K,G])=>{q(K,G.handler,G.wait,G.options)});let j={...$,addThrottledEvent:q,removeThrottledEvent:Z};return j};var AJ=()=>{};function g2(J){return"lifecycle"in J&&J.lifecycle&&typeof J.lifecycle==="object"&&"destroy"in J.lifecycle&&typeof J.lifecycle.destroy==="function"}var wJ=(J={})=>($)=>{let Q={},q=(K,G,Y,z={})=>{if(Q[K])Z(K);let W=t9(G,Y,z);return $.element.addEventListener(K,W),Q[K]={original:G,debounced:W},j},Z=(K)=>{let G=Q[K];if(G)$.element.removeEventListener(K,G.debounced),delete Q[K];return j};if(g2($)){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Object.keys(Q).forEach((G)=>{let Y=Q[G];$.element.removeEventListener(G,Y.debounced)}),K.call($.lifecycle)}}if(J.debouncedEvents)Object.entries(J.debouncedEvents).forEach(([K,G])=>{q(K,G.handler,G.wait,G.options)});let j={...$,addDebouncedEvent:q,removeDebouncedEvent:Z};return j};var xJ=()=>{};function k$(J){return"input"in J&&J.input instanceof HTMLElement&&"disabled"in J.input}var Y6=(J)=>($)=>{let Q=`${$.getClass(J.componentName||$.componentName||"component")}--disabled`,q={enable(){if($.element.classList.remove(Q),k$($))$.input.disabled=!1,$.input.removeAttribute("disabled");else{let Z=$.element;if("disabled"in Z)Z.disabled=!1;$.element.removeAttribute("disabled")}return this},disable(){if($.element.classList.add(Q),k$($))$.input.disabled=!0,$.input.setAttribute("disabled","true");else{let Z=$.element;if("disabled"in Z)Z.disabled=!0;$.element.setAttribute("disabled","true")}return this},toggle(){if(this.isDisabled())this.enable();else this.disable();return this},isDisabled(){if(k$($))return $.input.disabled;let Z=$.element;return"disabled"in Z&&Z.disabled}};if(J.disabled)requestAnimationFrame(()=>{q.disable()});return{...$,disabled:q}};function d2(J){return"events"in J&&J.events&&typeof J.events==="object"&&"destroy"in J.events&&typeof J.events.destroy==="function"}function r2(J){return"text"in J&&J.text&&typeof J.text==="object"&&"getElement"in J.text&&typeof J.text.getElement==="function"}function l2(J){return"icon"in J&&J.icon&&typeof J.icon==="object"&&"getElement"in J.icon&&typeof J.icon.getElement==="function"}var b=()=>(J)=>{let $=!1,Q=v6();return{...J,lifecycle:{onMount:(Z)=>Q.on("mount",Z),onUnmount:(Z)=>Q.on("unmount",Z),mount:()=>{if(!$)$=!0,Q.emit("mount")},unmount:()=>{if($)$=!1,Q.emit("unmount"),Q.clear()},isMounted:()=>$,destroy(){if($)this.unmount();if(d2(J))J.events.destroy();if(r2(J)){let Z=J.text.getElement();if(Z)Z.remove()}if(l2(J)){let Z=J.icon.getElement();if(Z)Z.remove()}if(J.element)J.element.remove()}}}};var TJ=()=>{};var i=g(()=>{FJ();MJ();LJ();DJ();PJ();RJ();AJ();xJ();TJ()});var n=g(()=>{s();i()});function IJ(J,$){n9[J]=$}function R7(J){return n9[J]||{}}function SJ(J){Object.assign(n9,J)}function bJ(){Object.keys(n9).forEach((J)=>{delete n9[J]})}var n9;var N$=g(()=>{n9={}});var C=(J,$={},Q)=>{let q=R7(Q),Z=$.className!==void 0?$.className:$.class,j=J.className!==void 0?J.className:J.class,K={...J,...q,...$,componentName:Q,prefix:u,className:Z!==void 0?Z:j};if("class"in K&&K.className!==void 0)delete K.class;return K},f=(J,$)=>{let Q=J.className||J.class,q=$.className,Z=[...Array.isArray(Q)?Q:[Q],...Array.isArray(q)?q:[q]].filter(Boolean),j=$.attributes||{};return{tag:$.tag,componentName:J.componentName,attributes:j,className:Z.length>0?Z:void 0,rawClass:J.rawClass,html:$.html,text:$.text,forwardEvents:$.forwardEvents||{},interactive:$.interactive}};var c=g(()=>{y6();N$()});var y7,A7,w7,I9=4;var L$=g(()=>{y7={SMALL:"small",LARGE:"large"},A7={ERROR:"error",PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SUCCESS:"success",WARNING:"warning",INFO:"info"},w7={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"}});var p2,vJ=(J={})=>C(p2,J,"badge"),CJ=(J)=>{let $={};if(J.variant!=="small")$.role="status";let Q=J.variant==="small"?"":S9(J.label||"",J.max);return f(J,{tag:"span",attributes:$,className:J.class,text:Q})},EJ=(J)=>({visibility:{show:()=>J.visibility.show(),hide:()=>J.visibility.hide(),toggle:($)=>J.visibility.toggle($),isVisible:()=>J.visibility.isVisible()},lifecycle:{destroy:()=>J.lifecycle.destroy()}}),S9=(J,$)=>{if(J===void 0||J===null||J==="")return"";let Q=String(J),q=Number(J);if($!==void 0&&!isNaN(q)&&q>$)Q=`${$}+`;if(Q.length>I9){let Z=Number(J);if(!isNaN(Z))if(Z>=1000)Q="999+";else Q=Q.substring(0,I9-1)+"+";else Q=Q.substring(0,I9)}return Q};var x7=g(()=>{c();L$();p2={variant:y7.LARGE,color:A7.ERROR,position:w7.TOP_RIGHT,label:"",visible:!0}});var hJ="small",s2="large",m2="error",a2="top-right",uJ=()=>(J)=>{if(J.config.visible===!1)J.element.classList.add(`${J.getClass("badge")}--invisible`);return{...J,visibility:{show(){J.element.classList.remove(`${J.getClass("badge")}--invisible`)},hide(){J.element.classList.add(`${J.getClass("badge")}--invisible`)},toggle(Q){if(Q===void 0)J.element.classList.toggle(`${J.getClass("badge")}--invisible`);else if(Q)this.show();else this.hide()},isVisible(){return!J.element.classList.contains(`${J.getClass("badge")}--invisible`)}}}},fJ=(J)=>($)=>{let Q=J.variant||s2;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),Q===hJ)$.element.textContent="",$.element.setAttribute("aria-hidden","true");else if($.element.setAttribute("role","status"),J.label!==void 0&&J.label!==""){let q=S9(J.label,J.max);$.element.textContent=q}return $},gJ=(J)=>($)=>{let Q=J.color||m2;return $.element.classList.add(`${$.getClass("badge")}--${Q}`),$},dJ=(J)=>($)=>{let Q=J.position||a2;if($.element.classList.add(`${$.getClass("badge")}--${Q}`),J.target)$.element.classList.add(`${$.getClass("badge")}--positioned`);return $},rJ=(J)=>($)=>{if(J.max===void 0||J.variant===hJ)return $;if($.config.max=J.max,J.label!==void 0&&J.label!==""){let Q=S9(J.label,J.max);if($.element.textContent=Q,typeof J.label==="number"&&J.label>J.max)$.element.classList.add(`${$.getClass("badge")}--overflow`)}return $},lJ=(J)=>($)=>{if(!J.target)return $;let Q=document.createElement("div");Q.classList.add($.getClass("badge-wrapper")),Q.style.position="relative";let q=J.target.parentNode;if(q)q.replaceChild(Q,J.target),Q.appendChild(J.target),Q.appendChild($.element),$.wrapper=Q;return $};var pJ=g(()=>{x7()});var sJ="small",i2,c2,o2,mJ=({visibility:J,lifecycle:$})=>(Q)=>{let q={element:Q.element,wrapper:Q.wrapper,getClass:Q.getClass,setLabel(Z){if(Q.config.label=Z,Q.config.variant===sJ)return Q.element.textContent="",q;let j=S9(Z,Q.config.max);if(Q.element.textContent=j,Q.element.classList.remove(`${Q.getClass("badge")}--overflow`),typeof Z==="number"&&Q.config.max!==void 0&&Z>Q.config.max)Q.element.classList.add(`${Q.getClass("badge")}--overflow`);if(j===""||j==="0")q.hide();else q.show();return q},getLabel(){return Q.element.textContent||""},setContent(Z){return q.setLabel(Z)},getContent(){return q.getLabel()},show(){return J.show(),q},hide(){return J.hide(),q},toggle(Z){return J.toggle(Z),q},isVisible(){return J.isVisible()},setMax(Z){if(Q.config.max=Z,Q.config.label!==void 0)q.setLabel(Q.config.label);return q},setColor(Z){return i2.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${Z}`),q},setVariant(Z){if(c2.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${Z}`),Q.config.variant=Z,Z===sJ)Q.element.textContent="",Q.element.setAttribute("aria-hidden","true");else if(Q.element.setAttribute("role","status"),Q.config.label!==void 0)q.setLabel(Q.config.label);return q},setPosition(Z){return o2.forEach((j)=>{Q.element.classList.remove(`${Q.getClass("badge")}--${j}`)}),Q.element.classList.add(`${Q.getClass("badge")}--${Z}`),q},attachTo(Z){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element);let j=document.createElement("div");j.classList.add(Q.getClass("badge-wrapper")),j.style.position="relative";let K=Z.parentNode;if(K)K.replaceChild(j,Z),j.appendChild(Z),j.appendChild(Q.element),Q.element.classList.add(`${Q.getClass("badge")}--positioned`),Q.wrapper=j,q.wrapper=j;return q},detach(){if(Q.wrapper&&Q.wrapper.contains(Q.element))Q.wrapper.removeChild(Q.element),Q.element.classList.remove(`${Q.getClass("badge")}--positioned`),document.body.appendChild(Q.element),Q.wrapper=void 0,q.wrapper=void 0;return q},destroy(){if($.destroy(),Q.wrapper){let Z=Q.wrapper.firstChild,j=Q.wrapper.parentNode;if(j&&Z)j.replaceChild(Z,Q.wrapper)}},addClass:(...Z)=>{return Q.addClass(...Z),q},removeClass:(...Z)=>{return Q.removeClass(...Z),q},on:(Z,j)=>{return Q.on(Z,j),q},off:(Z,j)=>{return Q.off(Z,j),q}};return q};var aJ=g(()=>{x7();i2=["error","primary","secondary","tertiary","success","warning","info"],c2=["small","large"],o2=["top-right","top-left","bottom-right","bottom-left"]});var t2=(J={})=>{let $=vJ(J);try{return I(T,h(),S(CJ($)),fJ($),gJ($),dJ($),rJ($),uJ(),lJ($),b(),(q)=>mJ(EJ(q))(q))($)}catch(Q){throw console.error("Badge creation error:",Q),new Error(`Failed to create badge: ${Q.message}`)}},i9;var iJ=g(()=>{n();s();i();pJ();aJ();x7();i9=t2});var c9=g(()=>{iJ()});var $q=(J)=>{let $=new Map,Q=(j,K)=>`${j}_${K.toString()}`,q=(j,K)=>(G)=>{try{j(G)}catch(Y){console.error(`Error in ${K} handler:`,Y)}},Z=(j,K)=>{try{J.removeEventListener(j,K)}catch(G){console.warn(`Failed to remove ${j} listener:`,G)}};return{on(j,K,G={}){let Y=q(K,j),z=Q(j,K);return $.set(z,{original:K,enhanced:Y,event:j,options:G}),J.addEventListener(j,Y,G),this},off(j,K){let G=Q(j,K),Y=$.get(G);if(Y)Z(j,Y.enhanced),$.delete(G);return this},pause(){return $.forEach(({enhanced:j,event:K})=>{Z(K,j)}),this},resume(){return $.forEach(({enhanced:j,event:K,options:G})=>{J.addEventListener(K,j,G)}),this},destroy(){$.forEach(({enhanced:j,event:K})=>{Z(K,j)}),$.clear()},getHandlers(){return new Map($)},hasHandler(j,K){let G=Q(j,K);return $.has(G)}}};var b9=g(()=>{S6();A9()});var Q9,w6,e9,C6,W6,r6,E6,z6;var l6=g(()=>{Q9={LINEAR:"linear",CIRCULAR:"circular"},w6={FLAT:"flat",WAVY:"wavy"},e9={CHANGE:"change",COMPLETE:"complete"},C6={VARIANT:"linear",VALUE:0,MAX:100,BUFFER:0,SHAPE:"flat",SHOW_LABEL:!1,INDETERMINATE:!1},W6={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"},r6={LINEAR:{MIN_HEIGHT:4,GAP:4,STOP_INDICATOR:4,HEIGHT:4},CIRCULAR:{SIZE:48,GAP:8},COMMON:{STROKE_WIDTH:4}},E6={THIN:4,THICK:8},z6={LINEAR:{AMPLITUDE:4,SPEED:1,FREQUENCY:2,INDETERMINATE_FREQUENCY:4,INDETERMINATE_AMPLITUDE:2,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92},CIRCULAR:{AMPLITUDE:6,INDETERMINATE_AMPLITUDE:4,SPEED:1,FREQUENCY:10,INDETERMINATE_FREQUENCY:16,POWER:0.8,START_TRANSITION_END:0,END_TRANSITION_START:0.92}}});var tJ=(J)=>{return Boolean(J&&typeof J==="object"&&Object.getPrototypeOf(J)===Object.getPrototypeOf({}))},nJ=(J,$)=>{let Z=$.replace(/\[(\w+)\]/g,".$1").replace(/^\./,"").split("."),j=J;for(let K=0,G=Z.length;K<G;++K){let Y=Z[K];if(Y in j)j=j[Y];else return}return j};var H9=(J,$=17)=>{if(!J||!(J instanceof HTMLElement))return{color:"",element:null};let Q=0,q=J;while(q&&Q<$){let K=window.getComputedStyle(q).backgroundColor;if(K.startsWith("var(")){let G=K.match(/var\((--[\w-]+)\)/);if(G){let Y=G[1];K=window.getComputedStyle(document.documentElement).getPropertyValue(Y).trim()||"transparent"}}if(K&&K!=="transparent"&&K!=="rgba(0, 0, 0, 0)"&&K!=="rgba(0,0,0,0)")return{color:K,element:q};q=q.parentElement,Q++}let Z=window.getComputedStyle(document.body).backgroundColor;if(Z!=="transparent"&&Z!=="rgba(0, 0, 0, 0)")return{color:Z,element:document.body};return{color:"rgb(255, 255, 255)",element:null}};var D$=()=>{};function F6(J,$){let Q=`--${u}-${J}`;if($?.onThemeChange)Qq($.onThemeChange);let Z=getComputedStyle(document.body).getPropertyValue(Q).trim();if(!Z)Z=getComputedStyle(document.documentElement).getPropertyValue(Q).trim();if(!Z&&$?.fallback)return $.fallback;if(!Z)return"";if(typeof $?.alpha==="number"&&/\d+,\s*\d+,\s*\d+/.test(Z))return`rgba(${Z}, ${$.alpha})`;if(typeof $?.alpha==="number"&&/^#([\da-f]{6}|[\da-f]{3})$/i.test(Z)){let j=Z.replace("#",""),K,G,Y;if(j.length===3)K=parseInt(j[0]+j[0],16),G=parseInt(j[1]+j[1],16),Y=parseInt(j[2]+j[2],16);else K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),Y=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${Y}, ${$.alpha})`}return Z}var T7,M9=null,Jq=()=>{if(M9)return;M9=new MutationObserver((J)=>{for(let $ of J)if($.type==="attributes"&&($.attributeName==="data-theme"||$.attributeName==="data-theme-mode")){T7.forEach((Q)=>Q());break}}),M9.observe(document.body,{attributes:!0,attributeFilter:["data-theme","data-theme-mode"]})},Qq=(J)=>{if(!M9)Jq();return T7.add(J),()=>{T7.delete(J)}};var eJ=g(()=>{y6();T7=new Set;if(typeof window!=="undefined")window.addEventListener("unload",()=>{if(M9)M9.disconnect(),M9=null;T7.clear()})});var $7=(J,$)=>{let q=document.createElement("canvas").getContext("2d");if(!q)return`rgba(0, 0, 0, ${$})`;q.fillStyle=J;let Z=q.fillStyle;if(Z.startsWith("#")){let j=Z.substring(1),K=parseInt(j.substring(0,2),16),G=parseInt(j.substring(2,4),16),Y=parseInt(j.substring(4,6),16);return`rgba(${K}, ${G}, ${Y}, ${$})`}if(Z.startsWith("rgb")){let j=Z.match(/\d+/g);if(j){let[K,G,Y]=j;return`rgba(${K}, ${G}, ${Y}, ${$})`}}return`rgba(0, 0, 0, ${$})`};var qq=(J,$)=>(Q,q)=>J(Q,q)?$(Q,q):Q,Zq=(...J)=>J.filter(Boolean).join(" ");var k9=g(()=>{a9();D$();eJ()});var I7=(J,$,Q)=>{let q=null,Z=()=>{if(q)clearTimeout(q);q=window.setTimeout(()=>{Q()},100)};if(typeof ResizeObserver!=="undefined"){let j=new ResizeObserver((K)=>{for(let G of K){let{width:Y}=G.contentRect,z=parseFloat($.style.width||"0");if(Math.abs(Y-z)>2)Z()}});return j.observe(J),()=>{if(q)clearTimeout(q);j.disconnect()}}else return window.addEventListener("resize",Z),()=>{if(q)clearTimeout(q);window.removeEventListener("resize",Z)}};var $1=(J,$,Q,q,Z,j,K,G,Y)=>{let z=Math.max(100,Math.abs(j-Z)*50),W=(j-Z)/z,X=z6.CIRCULAR.SPEED*2*Math.PI/1000;J.beginPath();for(let U=0;U<=z;U++){let _=Z+W*U,N=_*G+Y*X,F=Math.sin(N),L=Math.sign(F)*Math.pow(Math.abs(F),z6.CIRCULAR.POWER)*K,D=q+L,B=$+D*Math.cos(_),H=Q+D*Math.sin(_);if(U===0)J.moveTo(B,H);else J.lineTo(B,H)}J.stroke()},J1=(J,$,Q,q,Z,j=0,K="flat")=>{let{ctx:G,width:Y,height:z}=J,W=J7($.thickness),X=K==="wavy",U=Math.min(Y,z),_=Z?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,N=U/2-W/2,F=N*(_/100),k=X?N9(W,F):0,L=N-k,D=Y/2,B=z/2;G.clearRect(0,0,Y,z);let V=(r6.CIRCULAR.GAP+2*W)/L,O=-Math.PI/2,M=2*Math.PI-V;G.lineWidth=W,G.lineCap="round",G.lineJoin="round";let P=Z?z6.CIRCULAR.INDETERMINATE_FREQUENCY:z6.CIRCULAR.FREQUENCY;if(Z){let B6=j%1333/1333,w=(U9)=>{let U6=U9<=0.5?U9*2:2-U9*2;return 0.028+0.722*(U6<0.5?2*U6*U6:1-Math.pow(-2*U6+2,2)/2)},l=()=>{let U9=j/1568*2*Math.PI,U6=Math.floor(j/1333),I6=j%1333/1333,i6=0;if(I6>0.5){let m9=(I6-0.5)*2;i6=0.722*(m9<0.5?2*m9*m9:1-Math.pow(-2*m9+2,2)/2)}return U9+(U6*0.722+i6)*2*Math.PI},m=w(B6)*2*Math.PI,a=l(),O6=O+a,$6=O6+m;G.strokeStyle=F6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath();let P9=V/2;if(G.arc(D,B,L,$6+P9,O6-P9+2*Math.PI),G.stroke(),G.strokeStyle=F6("sys-color-primary",{fallback:"#6750A4"}),X)$1(G,D,B,L,O6,$6,k,P,j);else G.beginPath(),G.arc(D,B,L,O6,$6),G.stroke();return}let R=Q/q,x=Math.max(R,0.001),A=0.95,v=M;if(R>=A){let e=(R-A)/(1-A),B6=e*e;v=M+V*B6}if(R<0.99){let B6=O+v*x+V/2,w=O+M+V/2;if(B6<w)G.strokeStyle=F6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"}),G.beginPath(),G.arc(D,B,L,B6,w),G.stroke()}G.strokeStyle=F6("sys-color-primary",{fallback:"#6750A4"});let r=k;if(X){let e=z6.CIRCULAR.START_TRANSITION_END,B6=z6.CIRCULAR.END_TRANSITION_START;if(R===0&&e>0)r=0;else if(R>0&&R<=e){let w=R/e;r=k*Math.pow(w,2)}else if(R>=B6){let w=(R-B6)/(1-B6),l=1-Math.pow(1-w,2);r=k*(1-l)}if(R>=1)r=0}let Q6=O,X6=O+v*x;if(X)$1(G,D,B,L,Q6,X6,r,P,j);else G.beginPath(),G.arc(D,B,L,Q6,X6),G.stroke()};var Q1=g(()=>{l6();k9();S7()});var Q7=(J,$,Q)=>{J.strokeStyle=Q,J.lineWidth=$,J.lineCap="round"},q9=(J,$,Q,q,Z,j,K)=>{if(J.beginPath(),!Z||K.amplitude===0)J.moveTo($,q),J.lineTo(Q,q);else{let G=$;for(let Y=$;Y<=Q;Y+=1){let z=Y*K.frequency+j*K.speed,W=Math.sin(z),X=Math.sign(W)*Math.pow(Math.abs(W),z6.LINEAR.POWER),U=q+X*K.amplitude;if(Y===$)J.moveTo(Y,U);else J.lineTo(Y,U);G=Y}if(G<Q){let Y=Q*K.frequency+j*K.speed,z=Math.sin(Y),W=Math.sign(z)*Math.pow(Math.abs(z),z6.LINEAR.POWER),X=q+W*K.amplitude;J.lineTo(Q,X)}}J.stroke()},q1=(J,$)=>{let[Q,q,Z]=$;if(J<=Q)return 0.08+0.5814790000000001*(J/Q);else if(J<=q)return 0.661479;else if(Z&&J<=Z)return 0.661479;return Z?0.661479-0.5814790000000001*((J-Z)/(1-Z)):0.08},Z1=(J,$)=>{for(let Z=0;Z<$.length-1;Z++){let[j,K]=$[Z],[G,Y]=$[Z+1];if(J<=G){let z=(J-j)/(G-j);return K+(Y-K)*z}}let[Q,q]=$[$.length-1];return q+(220-q)*((J-Q)/(1-Q))},j1=(J,$,Q,q,Z,j,K=0,G=!0,Y="flat")=>{let{ctx:z,width:W,height:X}=J,U=J7($.thickness),_=X/2,N=Y==="wavy",F=U/2,k=W-F*2,L=r6.LINEAR.GAP,D=Q/q,B=0.001,H=Math.max(D,0.001),V=F+k*H;z.clearRect(0,0,W,X);let O=F6("sys-color-primary",{fallback:"#6750A4"}),M=F6("sys-color-primary-rgb",{alpha:0.12,fallback:"rgba(103, 80, 164, 0.12)"});if(j){let X6=K%2000/2000,e=L*2+U/2,B6=q1(X6,[0.3665,0.6915]),w=Z1(X6,[[0,-120],[0.2,0],[0.5915,83.6714]]),l=X6<=0.5?0:q1(X6,[0.8335,null,0.8335]),m=X6<=0.5?-54.8889:Z1(X6,[[0.5,-54.8889],[0.7,25.0389],[0.85,83.6714]]),O6=[{scale:B6,translate:w,start:Math.max(F,F+k*w/100),end:Math.min(W-F,F+k*w/100+k*B6)},{scale:l,translate:m,start:Math.max(F,F+k*m/100),end:Math.min(W-F,F+k*m/100+k*l)}].filter((U6)=>U6.end>U6.start).sort((U6,I6)=>U6.start-I6.start),$6=[];for(let U6=0;U6<O6.length;U6++){let I6=O6[U6];if($6.length===0)$6.push({...I6});else{let i6=$6[$6.length-1];if(I6.start<=i6.end+e)i6.end=Math.max(i6.end,I6.end);else $6.push({...I6})}}Q7(z,U,M);let P9=U;if($6.length===0)q9(z,F,W-F,_,!1,0,{amplitude:0,frequency:0,speed:0});else{let U6=$6[0].start;if(U6-F>e+P9)q9(z,F,U6-e,_,!1,0,{amplitude:0,frequency:0,speed:0});if($6.length===2){if($6[1].start-$6[0].end>2*e+P9)q9(z,$6[0].end+e,$6[1].start-e,_,!1,0,{amplitude:0,frequency:0,speed:0})}let i6=$6[$6.length-1].end;if(W-F-i6>e+P9)q9(z,i6+e,W-F,_,!1,0,{amplitude:0,frequency:0,speed:0})}Q7(z,U,O);let U9={amplitude:N?N9(U,z6.LINEAR.INDETERMINATE_AMPLITUDE):0,frequency:z6.LINEAR.INDETERMINATE_FREQUENCY*2*Math.PI/100,speed:0};$6.forEach((U6)=>{q9(z,U6.start,U6.end,_,N,K,U9)});return}let P=z6.LINEAR.START_TRANSITION_END,R=z6.LINEAR.END_TRANSITION_START,y=(L+U)/2;Q7(z,U,M);let x=D===0?F+U+L:Math.min(V+y,W-F);q9(z,x,W-F,_,!1,0,{amplitude:0,frequency:0,speed:0}),Q7(z,U,O);let A=D>=1?W-F:Math.max(F,V-y),v;if(D===0)v=F+(N?0.1:0);else{let Q6=U/2;v=Math.max(F+Q6,A)}let r=N?N9(U,z6.LINEAR.AMPLITUDE):0;if(N){if(D===0&&P>0)r=0;else if(H<=P)r*=Math.pow(H/P,2);else if(H>=R)r*=Math.pow((1-H)/(1-R),2)}if(q9(z,F,v,_,N,K,{amplitude:r,frequency:z6.LINEAR.FREQUENCY*2*Math.PI/100,speed:z6.LINEAR.SPEED*2*Math.PI/1000}),Z>0&&Z>Q){Q7(z,U,F6("sys-color-secondary-container",{fallback:"#E8DEF8"}));let Q6=F+k*(Z/q);q9(z,V,Q6,_,!1,0,{amplitude:0,frequency:0,speed:0})}if(D<1&&G){let Q6=Math.min(U*0.5,2);z.beginPath(),z.arc(W-F,_,Q6,0,2*Math.PI),z.fillStyle=O,z.fill()}};var K1=g(()=>{l6();k9();S7()});var J7=(J="thin")=>{if(typeof J==="number")return J;return J==="thick"?E6.THICK:E6.THIN},N9=(J,$,Q)=>{let Z=1+0.3*(4-J)/(J+4),j=$*Z;return Q?Math.min(j,Q):j},O$=(J,$,Q,q)=>{let Z=window.devicePixelRatio||1,j=J7(q?.thickness),{ctx:K}=$;if(Q){let G=Math.max(24,Math.min(q?.size??r6.CIRCULAR.SIZE,240)),Y=0;if(q?.shape==="wavy"){let W=G/2-j/2,X=q?.indeterminate?z6.CIRCULAR.INDETERMINATE_AMPLITUDE:z6.CIRCULAR.AMPLITUDE,U=W*(X/100);Y=N9(j,U)}let z=G+Y*2;J.style.width=J.style.height=`${z}px`,J.width=J.height=Math.round(z*Z),$.width=$.height=z}else{let G=J.parentElement;if(!G)return;let Y=Math.max(G.getBoundingClientRect().width||G.offsetWidth,200),z=0;if(q?.shape==="wavy"){let X=z6.LINEAR.AMPLITUDE,U=N9(j,X);z=Math.ceil(U*2)}let W=j+z;J.style.width=`${Y}px`,J.style.height=`${W}px`,J.width=Math.round(Y*Z),J.height=Math.round(W*Z),$.width=Y,$.height=W}K.setTransform(1,0,0,1,0,0),K.scale(Z,Z)},G1=(J,$,Q)=>{let q={canvas:J,ctx:J.getContext("2d"),width:0,height:0,pixelRatio:window.devicePixelRatio||1};return O$(J,q,$,Q),q},Y1=(J)=>($)=>{let q=J.variant===Q9.CIRCULAR,Z=document.createElement("canvas");Z.className=`${$.getClass(W6.CONTAINER)}-canvas`,Z.style.maxWidth="100%",Z.style.maxHeight="100%",Z.style.boxSizing="border-box",$.element.appendChild(Z);let j=null,K=null,G=null,Y=J.thickness,z=J.shape,W=J.size??r6.CIRCULAR.SIZE,X=J.value??0,U=X,_=0,N=()=>{try{return j=G1(Z,q,{...J,thickness:Y,shape:z,size:W}),$.ctx=j.ctx,!0}catch(P){return console.warn("Canvas initialization failed:",P),!1}};if(!N())requestAnimationFrame(()=>{if(!N())setTimeout(N,100)});$.canvas=Z,$.animationTime=0,$.animationId=null,$.wavyAnimationId=null,$.valueAnimationId=null,$.currentShape=z;let F=(P=0)=>{if(!$.state?.indeterminate)return;if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null;let R=0,y=(x)=>{if(!$.state?.indeterminate){k();return}if(R===0)R=x-P;let A=x-R;$.animationTime=A,B(A),$.animationId=requestAnimationFrame(y)};$.animationId=requestAnimationFrame(y)},k=()=>{if($.animationId)cancelAnimationFrame($.animationId),$.animationId=null},L=(P=0)=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null;let R=0,y=(x)=>{if(R===0)R=x-P;let A=x-R;$.animationTime=A,B(A),$.wavyAnimationId=requestAnimationFrame(y)};$.wavyAnimationId=requestAnimationFrame(y)},D=()=>{if($.wavyAnimationId)cancelAnimationFrame($.wavyAnimationId),$.wavyAnimationId=null},B=(P=0)=>{if(!j)return;let R=$.state,y=R?.value??J.value??0,x=R?.max??J.max??100,A=R?.buffer??J.buffer??0,v=R?.indeterminate??J.indeterminate??!1,r={...J,thickness:Y,shape:z,size:W};O$(Z,j,q,r);let Q6=v||!R?y:X;if(q)J1(j,r,Q6,x,v,P,z);else j1(j,r,Q6,x,A,v,P,!0,z)},H=()=>{if(!j)return;try{let P=G1(Z,q,{...J,thickness:Y,shape:z,size:W});$.ctx=P.ctx,Object.assign(j,P),B()}catch(P){console.warn("Canvas resize failed:",P)}};K=I7($.element,Z,()=>{if($.element.offsetWidth>0||q)H()});let V=F6("sys-color-primary",{onThemeChange:B});G=typeof V==="function"?V:null;let O=()=>{if(!j){requestAnimationFrame(O);return}if(B(),$.state?.indeterminate)if(z==="wavy"||!q)L();else F();else if(z==="wavy")L()};requestAnimationFrame(O);let M=(P)=>{if(!j)return;let R={...J,thickness:Y,shape:z,size:W,...P};O$(Z,j,q,R),B()};if($.setThickness=(P)=>{Y=P,M({thickness:P})},$.setSize=(P)=>{if(!q)return;W=Math.max(24,Math.min(P,240)),M({size:W})},$.getSize=()=>q?W:void 0,$.setShape=(P)=>{if(z===P)return;if(z=P,$.currentShape=z,M({shape:P}),$.state?.indeterminate){let R=$.animationTime||0;if(D(),k(),P==="wavy"||!q)L(R);else F(R)}else if(P==="wavy"){if(!$.wavyAnimationId)L()}else D();B($.animationTime||0)},$.setValue=(P,R=!0)=>{if(U=Math.max(0,Math.min($.state.max,P)),$.state.indeterminate)$.setIndeterminate(!1);if($.valueAnimationId&&R)return;if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(!R){if(X=U,B(),z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)L();if(U>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:U,max:$.state.max}}));return}let y=X,x=performance.now(),A=x-_,v=300;if(A<300&&_>0)v=Math.max(100,A*0.9);_=x;let r=(Q6)=>{let X6=Q6-x,e=Math.min(X6/v,1),B6=e<0.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;if(X=y+(U-y)*B6,!$.wavyAnimationId||z!=="wavy")B(Q6);if(e<1)$.valueAnimationId=requestAnimationFrame(r);else{if(X=U,$.valueAnimationId=null,z==="wavy"&&!$.state.indeterminate&&!$.wavyAnimationId)L();if(U>=$.state.max)$.element.dispatchEvent(new CustomEvent("complete",{detail:{value:U,max:$.state.max}}))}};$.valueAnimationId=requestAnimationFrame(r)},$.setIndeterminate=(P)=>{if(!$.state){console.warn("[Progress] No state available for setIndeterminate");return}if($.state.indeterminate=P,P){if($.valueAnimationId)cancelAnimationFrame($.valueAnimationId),$.valueAnimationId=null;if(X=$.state.value,z==="wavy"||!q)L();else F()}else{if(X=$.state.value,k(),z==="wavy"){if(!$.wavyAnimationId)L()}else D();B()}},$.hide=()=>{$.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.opacity="0";let P=()=>{$.element.style.display="none",$.element.removeEventListener("transitionend",P)};return $.element.addEventListener("transitionend",P),[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),$.animationId=$.wavyAnimationId=$.valueAnimationId=null,$},$.show=()=>{if($.element.classList.add($.getClass(W6.TRANSITION)),$.element.style.display="",$.element.style.opacity="0",$.element.offsetHeight,$.element.style.opacity="1",$.state?.indeterminate)if(z==="wavy"||!q)L();else F();else if(z==="wavy")L();return $},$.isVisible=()=>$.element.style.display!=="none"&&$.element.style.opacity!=="0",$.lifecycle){let P=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(K)K();if(G)G();[$.animationId,$.wavyAnimationId,$.valueAnimationId].forEach((R)=>{if(R)cancelAnimationFrame(R)}),P()}}return Object.assign($,{startWavyAnimation:L,stopWavyAnimation:D,startIndeterminateAnimation:F,stopIndeterminateAnimation:k}),{...$,canvas:Z,get ctx(){return j?.ctx},draw:B,resize:H}};var S7=g(()=>{l6();k9();Q1();K1()});var z1=(J)=>($)=>{if(J.indeterminate&&$.element)p($.element,W6.INDETERMINATE),$.element.removeAttribute("aria-valuenow");if($.element){let j=$.getClass?.(W6.CONTAINER)||"";$.element.classList.remove(`${j}--thin`,`${j}--thick`)}if(J.shape&&J.shape!==w6.FLAT&&$.element){if(!$.element.classList.contains($.getClass?.(W6.CIRCULAR)||"")){let K=$.getClass?.(W6.CONTAINER)||"";p($.element,`${K}--${J.shape}`)}}let Q={value:J.value??0,max:J.max??100,buffer:J.buffer??0,indeterminate:J.indeterminate===!0,thickness:J.thickness??"thin",shape:J.shape??w6.FLAT,labelFormatter:J.labelFormatter??((j,K)=>`${Math.round(j/K*100)}%`),showLabel:J.showLabel},q=$.lifecycle?.init,Z=$.lifecycle?.destroy;return $.state=Q,$.lifecycle={init:()=>{if(requestAnimationFrame(()=>{try{if(Q.indeterminate)$.setIndeterminate?.(!0);else if($.setValue?.(Q.value),J.buffer!==void 0)$.setBuffer?.(Q.buffer);if(Q.shape!==w6.FLAT&&$.setShape)$.setShape(Q.shape);if(Q.thickness)if($.setThickness)$.setThickness(Q.thickness);else $.state.thickness=Q.thickness}catch(j){console.error("Error initializing progress state:",j)}}),q)q()},destroy:()=>{if(Z)Z()}},{...$,state:Q}};var W1=g(()=>{l6();b9()});var U1=(J)=>($)=>{let{element:Q,getClass:q,canvas:Z}=$,j=Q.classList.contains(q(W6.CIRCULAR)),K=(W,X)=>{Q.dispatchEvent(new CustomEvent(W,{detail:X}))},G=(W,X)=>{Q.setAttribute("aria-valuenow",W.toString());let U=$.label;if(U){let _=J.label?.formatter||((N,F)=>`${Math.round(N/F*100)}%`);U.textContent=_(W,X)}if(typeof $.draw==="function")$.draw()},Y=(W)=>{if(W){if(p(Q,W6.INDETERMINATE),Q.removeAttribute("aria-valuenow"),!j){if((J.shape?.getShape()||w6.FLAT)!=="wavy"&&$.startIndeterminateAnimation)$.startIndeterminateAnimation()}}else if(K6(Q,W6.INDETERMINATE),$.stopIndeterminateAnimation)$.stopIndeterminateAnimation();if(typeof $.draw==="function")$.draw()};if(J.state.isIndeterminate())Y(!0);let z={element:Q,track:Z,indicator:Z,buffer:Z,getClass:q,getValue(){return J.value.getValue()},setValue(W,X=!0){let U=J.value.getValue(),_=J.value.getMax();if(J.value.setValue(W),U!==W){Q.setAttribute("aria-valuenow",W.toString());let N=$.label;if(N){let k=J.label?.formatter||((L,D)=>`${Math.round(L/D*100)}%`);N.textContent=k(W,_)}let F={value:W,max:_};if(K(e9.CHANGE,F),$.setValue&&typeof $.setValue==="function")$.setValue(W,X);else G(W,_)}return z},getMax(){return J.value.getMax()},getBuffer:()=>J.buffer.getBuffer(),setBuffer(W){if(J.buffer.setBuffer(W),!J.state.isIndeterminate()&&typeof $.draw==="function")$.draw();return z},setIndeterminate(W){if(J.state.isIndeterminate()===W)return z;return J.state.setIndeterminate(W),Y(W),z},isIndeterminate:()=>J.state.isIndeterminate(),showLabel(){if(J.label?.show)J.label.show();return z},hideLabel(){if(J.label?.hide)J.label.hide();return z},setLabelFormatter(W){if(J.label?.format)J.label.format(W);let X=$.label||$.state?.label;if(X)X.textContent=W(J.value.getValue(),J.value.getMax());return z},getThickness(){return J.thickness?.getThickness()||E6.THIN},setThickness(W){if(J.thickness)J.thickness.setThickness(W);if($.setThickness)$.setThickness(W);return z},getShape(){if(J.shape&&typeof J.shape.getShape==="function")return J.shape.getShape();return w6.FLAT},setShape(W){return $.setShape?.(W),z},setSize(W){if($.setSize)$.setSize(W);return z},getSize(){return $.getSize?$.getSize():void 0},enable(){return J.disabled.enable(),z},disable(){return J.disabled.disable(),z},isDisabled:J.disabled.isDisabled,hide(){if($.hide)$.hide();return z},show(){if($.show)$.show();return z},isVisible(){return $.isVisible?$.isVisible():Q.style.display!=="none"},on(W,X){return Q.addEventListener(W,X),z},off(W,X){return Q.removeEventListener(W,X),z},addClass(...W){return W.forEach((X)=>Q.classList.add(X)),z},destroy(){J.lifecycle.destroy()},disabled:{enable(){J.disabled.enable()},disable(){J.disabled.disable()},isDisabled:J.disabled.isDisabled},lifecycle:{destroy(){J.lifecycle.destroy()}}};if($.state?.showLabel===!0){if(J.label?.show)J.label.show()}return z};var X1=g(()=>{l6();b9()});var jq,B1=(J={})=>{return C(jq,J,"progress")},F1=(J)=>{let $=J.indeterminate===!0,Q=J.variant===Q9.CIRCULAR,q={role:"progressbar","aria-valuemin":"0","aria-valuemax":(J.max||100).toString()};if(!$&&J.value!==void 0)q["aria-valuenow"]=J.value.toString();if(J.disabled===!0)q["aria-disabled"]="true";let Z=[J.class,W6.CONTAINER,Q?W6.CIRCULAR:W6.LINEAR].filter(Boolean);if(!Q&&J.shape&&J.shape!==w6.FLAT)Z.push(`${W6.CONTAINER}--${J.shape}`);return f(J,{tag:"div",attributes:q,className:Z})},H1=(J)=>{if(!J.state)J.state={value:0,max:100,buffer:0,indeterminate:!1,thickness:"thin",shape:C6.SHAPE,labelFormatter:($,Q)=>`${Math.round($/Q*100)}%`};return{value:{getValue:()=>J.state.value,setValue:($)=>{if(J.state){let Q=Math.max(0,Math.min(J.state.max,$));if(J.state.previousValue=J.state.value,J.state.value=Q,J.state.label)J.state.label.textContent=J.state.labelFormatter(Q,J.state.max);if(typeof J.setValue==="function")J.setValue(Q);else if(J.draw)J.draw()}},getMax:()=>J.state.max},buffer:{getBuffer:()=>J.state.buffer,setBuffer:($)=>{J.state.buffer=Math.max(0,Math.min(J.state.max,$))}},disabled:{enable:()=>J.disabled?.enable?.()||void 0,disable:()=>J.disabled?.disable?.()||void 0,isDisabled:()=>J.disabled?.isDisabled?.()||!1},label:{show:()=>{if(!J.state.label){let $=document.createElement("div");$.className=`${J.getClass(W6.LABEL)}`,$.textContent=J.state.labelFormatter(J.state.value,J.state.max),J.element.appendChild($),J.state.label=$,J.label=$}},hide:()=>{if(J.state.label)J.state.label.remove(),J.state.label=void 0,J.label=void 0},format:($)=>{J.state.labelFormatter=$},formatter:J.state.labelFormatter},thickness:{getThickness:()=>{let $=J.state.thickness;if($==="thin")return E6.THIN;else if($==="thick")return E6.THICK;else if(typeof $==="number")return $;return E6.THIN},setThickness:($)=>{if(J.state.thickness=$,J.draw)J.draw()}},shape:{getShape:()=>J.state.shape,setShape:($)=>{if(J.state.shape=$,J.setShape)J.setShape($)}},state:{setIndeterminate:($)=>{if(J.state){if(J.state.indeterminate=$,typeof J.setIndeterminate==="function")J.setIndeterminate($);else if(J.draw)J.draw()}},isIndeterminate:()=>J.state.indeterminate},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()||void 0}}};var M1=g(()=>{c();l6();jq={variant:C6.VARIANT,value:C6.VALUE,max:C6.MAX,buffer:C6.BUFFER,showLabel:C6.SHOW_LABEL,thickness:"thin",shape:C6.SHAPE}});var k1={};GJ(k1,{default:()=>P$});var Kq=(J={})=>{let $=B1(J);try{let Q=I(T,h(),S(F1($)),G6($),Y6($),z1($),Y1($),(q)=>{return U1(H1(q))(q)},b())($);if(Q.lifecycle?.init)Q.lifecycle.init();return Q}catch(Q){throw console.error("Progress creation error:",Q),new Error(`Failed to create progress: ${Q.message}`)}},P$;var R$=g(()=>{n();s();i();S7();W1();X1();M1();P$=Kq});var Gq=async(J)=>{let{default:$}=await Promise.resolve().then(() => (R$(),k1));return $(J)},N1=(J)=>($)=>{if(!J.progress)return $;let Q={},q=typeof J.progress==="boolean"?{variant:"circular",size:20,thickness:2,indeterminate:!0}:(()=>{let{on:W,...X}=J.progress;if(W)Q=W;return{variant:"circular",size:20,thickness:2,indeterminate:!0,...X}})(),Z=null,j=null,K=!1,G="",Y=async()=>{if(Z)return Z;if(!j)j=Gq(q).then((W)=>{return Z=W,p(Z.element,$.getClass("button-progress")),Z.element.style.display="none",Object.entries(Q).forEach(([X,U])=>{Z.on(X,U)}),$.progress=Z,Z});return j},z=()=>{let W=$.element.querySelector(`.${$.getClass("button-icon")}`);if(W&&W.nextSibling)return W.nextSibling;return $.element.firstChild};if($.showProgress=async function(){let W=await Y();if(W.element){if(!$.element.contains(W.element)){let U=z();if(U)$.element.insertBefore(W.element,U);else $.element.appendChild(W.element)}W.element.style.display="",p($.element,`${$.getClass("button")}--progress`);let X=$.element.querySelector(`.${$.getClass("button-icon")}`);if(X instanceof HTMLElement)X.style.display="none"}return $},$.showProgressSync=function(){return $.showProgress(),$},$.hideProgress=async function(){if(!Z)return $;Z.element.style.display="none",K6($.element,`${$.getClass("button")}--progress`);let W=$.element.querySelector(`.${$.getClass("button-icon")}`);if(W instanceof HTMLElement)W.style.display="";return $},$.hideProgressSync=function(){return $.hideProgress(),$},$.setProgress=async function(W){return(await Y()).setValue(W),$},$.setProgressSync=function(W){return $.setProgress(W),$},$.setIndeterminate=async function(W){return(await Y()).setIndeterminate(W),$},$.setIndeterminateSync=function(W){return $.setIndeterminate(W),$},$.setLoading=async function(W,X){if(W&&!K){if($.setText&&$.getText)G=$.getText();if(K=!0,await $.showProgress(),$.disabled?.disable)$.disabled.disable();if(X&&$.setText)$.setText(X)}else if(!W&&K){if(K=!1,await $.hideProgress(),$.disabled?.enable)$.disabled.enable();if(X&&$.setText)$.setText(X);else if(G&&$.setText)$.setText(G)}return $},$.setLoadingSync=function(W,X){return $.setLoading(W,X),$},$.lifecycle){let W=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Z)Z.destroy();if(Z&&Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);W()}}if(J.showProgress)Y().then(()=>{$.showProgress()});return $};var L1=g(()=>{b9()});var Yq=(J={},$={})=>{let Q={...J},q=v6(),Z=new Map,j=$.middleware||[],K=(Y,z)=>{q.emit("change",Y,z)},G=(Y,z)=>{return j.reduce((W,X)=>X(W,z),Y)};return{getState:()=>{let Y={};return Z.forEach((z,W)=>{Y[W]=z(Q)}),{...Q,...Y}},setState:(Y)=>{let z={...Q},W=typeof Y==="function"?Y(Q):{...Q,...Y};Q=G(W,z),K(Q,z)},subscribe:(Y)=>q.on("change",Y),derive:(Y,z)=>{return Z.set(Y,z),()=>{Z.delete(Y)}},select:(Y)=>Y(Q),reset:()=>{Q={...J},K(Q,{})}}},zq=(J,$)=>{return console.log("State change:",{old:$,new:J,diff:Object.keys(J).reduce((Q,q)=>{if(J[q]!==$[q])Q[q]={from:$[q],to:J[q]};return Q},{})}),J},Wq=(J)=>($)=>Object.keys($).reduce((Q,q)=>{if(J($[q],q))Q[q]=$[q];return Q},{});var V1=()=>{};var Uq=(J,$={})=>{let Q=!1,q=v6();return{onMount:(Z)=>q.on("mount",Z),onUnmount:(Z)=>q.on("unmount",Z),mount:()=>{if(!Q)Q=!0,q.emit("mount")},unmount:()=>{if(Q)Q=!1,q.emit("unmount"),q.clear()},isMounted:()=>Q,destroy(){if(Q)this.unmount();if($.events)$.events.destroy();if($.text){let Z=$.text.getElement();if(Z)Z.remove()}if($.icon){let Z=$.icon.getElement();if(Z)Z.remove()}if(J)J.remove()}}};var _1=()=>{};var Xq=(J)=>{return{enable(){return J.disabled=!1,J.removeAttribute("disabled"),this},disable(){return J.disabled=!0,J.setAttribute("disabled","true"),this},toggle(){if(J.disabled)this.enable();else this.disable();return this},isDisabled(){return J.disabled===!0}}};var D1=(J,$,Q,q,Z,j)=>{if(q<0||Z<0)return;let K=typeof j==="number"?[j,j,j,j]:j,[G,Y,z,W]=K;J.beginPath(),J.moveTo($+G,Q),J.lineTo($+q-Y,Q),J.quadraticCurveTo($+q,Q,$+q,Q+Y),J.lineTo($+q,Q+Z-z),J.quadraticCurveTo($+q,Q+Z,$+q-z,Q+Z),J.lineTo($+W,Q+Z),J.quadraticCurveTo($,Q+Z,$,Q+Z-W),J.lineTo($,Q+G),J.quadraticCurveTo($,Q,$+G,Q),J.closePath()},wG=(J,$,Q,q,Z,j,K)=>{if(J.save(),K)J.fillStyle=K;D1(J,$,Q,q,Z,j),J.fill(),J.restore()},O1=(J,$,Q,q,Z,j)=>{return J.save(),D1(J,$,Q,q,Z,j),J.clip(),()=>J.restore()},P1=(J,$,Q,q,Z,j,K,G)=>{if(q<0||Z<0)return;if(J.save(),G)J.fillStyle=G;J.beginPath(),J.moveTo($+j,Q),J.lineTo($+q-K,Q),J.quadraticCurveTo($+q,Q,$+q,Q+K),J.lineTo($+q,Q+Z-K),J.quadraticCurveTo($+q,Q+Z,$+q-K,Q+Z),J.lineTo($+j,Q+Z),J.quadraticCurveTo($,Q+Z,$,Q+Z-j),J.lineTo($,Q+j),J.quadraticCurveTo($,Q,$+j,Q),J.closePath(),J.fill(),J.restore()},R1=(J,$,Q,q)=>{if(q)J.fillStyle=q,J.fillRect(0,0,$,Q);else J.clearRect(0,0,$,Q)};var y$=(J)=>{let j=J;for(let X=0;X<4;X++){let F=j*j,L=1.6*(F*j)+-1.8000000000000003*F+1.2000000000000002*j-J,D=4.800000000000001*F+-3.6000000000000005*j+1.2000000000000002;if(Math.abs(L)<0.00001)break;j=j-L/D}let K=0,G=3-K,Y=1-K-G,z=j*j,W=z*j;return Y*W+G*z+K*j},y1,TG;var A1=g(()=>{y1={SHORT:100,MEDIUM:225,LONG:375,EXTRA_LONG:500},TG={linear:(J)=>J,easeIn:(J)=>J*J,easeOut:(J)=>J*(2-J),easeInOut:(J)=>J<0.5?2*J*J:-1+(4-2*J)*J,materialStandard:y$}});class Bq{animationId=null;start(J){this.stop();let $=(Q)=>{J(Q),this.animationId=requestAnimationFrame($)};this.animationId=requestAnimationFrame($)}stop(){if(this.animationId!==null)cancelAnimationFrame(this.animationId),this.animationId=null}get isRunning(){return this.animationId!==null}}class Fq{cleanupFunctions=[];add(J){if(J)this.cleanupFunctions.push(J)}cleanup(){this.cleanupFunctions.forEach((J)=>J()),this.cleanupFunctions=[]}}var w1=(J,$,Q)=>{let q=window.devicePixelRatio||1,Z=J.getContext("2d");return J.style.width=`${$}px`,J.style.height=`${Q}px`,J.width=Math.round($*q),J.height=Math.round(Q*q),Z.setTransform(1,0,0,1,0,0),Z.scale(q,q),{canvas:J,ctx:Z,width:$,height:Q,pixelRatio:q}},x1=(J,$,Q)=>{let{canvas:q,ctx:Z,pixelRatio:j}=J;q.style.width=`${$}px`,q.style.height=`${Q}px`,q.width=Math.round($*j),q.height=Math.round(Q*j),J.width=$,J.height=Q,Z.setTransform(1,0,0,1,0,0),Z.scale(j,j)},T1=(J,$)=>{if(J())return $?.(),!0;return requestAnimationFrame(()=>{if(J())$?.();else setTimeout(()=>{if(J())$?.()},100)}),!1},A$=(J,$)=>{let Q=F6(`sys-color-${J}`,{onThemeChange:$});return typeof Q==="function"?Q:null},I1=(J,$={})=>{let Q=document.createElement("canvas");return Q.className=J,Object.assign(Q.style,{position:"absolute",width:"100%",height:"100%",pointerEvents:"none",...$}),Q};var S1=g(()=>{k9()});var w$=g(()=>{A1();S1()});var q7=g(()=>{n();b9();V1();_1();w$();y6();N$();k9()});var b1=({disabled:J,lifecycle:$})=>(Q)=>{let q={setText:(K)=>{return Q.text.setText(K),q},getText:()=>Q.text.getText(),getElement:()=>Q.text.getElement()},Z={setIcon:(K)=>{return Q.icon.setIcon(K),Z},getIcon:()=>Q.icon.getIcon(),getElement:()=>Q.icon.getElement()},j={element:Q.element,text:q,icon:Z,disabled:J,lifecycle:$,getClass:Q.getClass,on:(K,G)=>{if(Q.on)Q.on(K,G);return j},off:(K,G)=>{if(Q.off)Q.off(K,G);return j},addClass:(...K)=>{if(Q.addClass)Q.addClass(...K);else p(Q.element,...K);return j},getValue:()=>Q.element.value,setValue(K){return Q.element.value=K,j},enable(){return J.enable(),j},disable(){return J.disable(),j},setText(K){return Q.text.setText(K),j.updateCircularStyle(),j},getText(){return Q.text.getText()},hasIcon(){let K=Q.icon.getElement();return!!K&&!!K.innerHTML.trim()&&!!K.parentNode},setIcon(K){let G=Q.componentName||"button",Y=Q.getClass(G);if(!K){let z=Q.icon.getElement();if(z&&z.parentNode)z.parentNode.removeChild(z),Q.icon.getElement=()=>null,Q.icon.getIcon=()=>"";Q.element.classList.remove(`${Y}--icon`)}else if(!j.hasIcon()){let z=document.createElement("span");if(z.className=`${Q.getClass("button-icon")}`,z.innerHTML=K,Q.element.firstChild)Q.element.insertBefore(z,Q.element.firstChild);else Q.element.appendChild(z);Q.icon.getElement=()=>z,Q.icon.getIcon=()=>K,Q.element.classList.add(`${Y}--icon`)}else{let z=Q.icon.getElement();if(z)z.innerHTML=K}return j.updateCircularStyle(),j},getIcon(){return j.hasIcon()?Q.icon.getIcon():""},setVariant(K){let G=Q.componentName||"button",Y=Q.getClass(G);return["filled","tonal","outlined","elevated","text"].map((W)=>`${Y}--${W}`).forEach((W)=>{Q.element.classList.remove(W)}),Q.element.classList.add(`${Y}--${K}`),j},getVariant(){let K=Q.componentName||"button",G=Q.getClass(K),Y=["filled","tonal","outlined","elevated","text"];for(let z of Y)if(Q.element.classList.contains(`${G}--${z}`))return z;return"filled"},getSize(){let K=Q.componentName||"button",G=Q.getClass(K),Y=["xs","s","m","l","xl"];for(let z of Y)if(Q.element.classList.contains(`${G}--${z}`))return z;return"s"},setSize(K){let G=Q.componentName||"button",Y=Q.getClass(G);return["xs","s","m","l","xl"].map((W)=>`${Y}--${W}`).forEach((W)=>{Q.element.classList.remove(W)}),Q.element.classList.add(`${Y}--${K}`),j},getShape(){let K=Q.componentName||"button",G=Q.getClass(K),Y=["round","square"];for(let z of Y)if(Q.element.classList.contains(`${G}--${z}`))return z;return"round"},setShape(K){let G=Q.componentName||"button",Y=Q.getClass(G);return["round","square"].map((W)=>`${Y}--${W}`).forEach((W)=>{Q.element.classList.remove(W)}),Q.element.classList.add(`${Y}--${K}`),j},setActive(K){if(K)Q.element.classList.add(`${Q.getClass("button")}--active`);else Q.element.classList.remove(`${Q.getClass("button")}--active`);return j},setAriaLabel(K){return Q.element.setAttribute("aria-label",K),j},destroy(){$.destroy()},updateCircularStyle(){let K=Q.text.getText()!=="",G=j.hasIcon();if(!K)p(Q.element,"button--circular"),K6(Q.element,"button--icon");else K6(Q.element,"button--circular");if(G&&K)p(Q.element,"button--icon")}};if(Q.progress)j.progress=Q.progress;if(Q.showProgress)j.showProgress=async()=>{return await Q.showProgress(),j};if(Q.showProgressSync)j.showProgressSync=()=>{return Q.showProgressSync(),j};if(Q.hideProgress)j.hideProgress=async()=>{return await Q.hideProgress(),j};if(Q.hideProgressSync)j.hideProgressSync=()=>{return Q.hideProgressSync(),j};if(Q.setProgress)j.setProgress=async(K)=>{return await Q.setProgress(K),j};if(Q.setProgressSync)j.setProgressSync=(K)=>{return Q.setProgressSync(K),j};if(Q.setIndeterminate)j.setIndeterminate=async(K)=>{return await Q.setIndeterminate(K),j};if(Q.setIndeterminateSync)j.setIndeterminateSync=(K)=>{return Q.setIndeterminateSync(K),j};if(Q.setLoading)j.setLoading=async(K,G)=>{return await Q.setLoading(K,G),j};if(Q.setLoadingSync)j.setLoadingSync=(K,G)=>{return Q.setLoadingSync(K,G),j};return j};var v1=g(()=>{q7()});var b7,v7,C7,E7,C1,v9;var x$=g(()=>{b7={FILLED:"filled",TONAL:"tonal",OUTLINED:"outlined",ELEVATED:"elevated",TEXT:"text"},v7={XS:"xs",S:"s",M:"m",L:"l",XL:"xl"},C7={ROUND:"round",SQUARE:"square"},E7={BUTTON:"button",SUBMIT:"submit",RESET:"reset"},C1={ROOT:"button",ICON:"button-icon",TEXT:"button-text",CIRCULAR:"button-circular",ACTIVE:"button-active",DISABLED:"button-disabled"},v9={DURATION:450,TIMING:"cubic-bezier(0.4, 0.0, 0.2, 1)",OPACITY:["0.7","0"]}});var Hq,E1=(J={})=>C(Hq,J,"button"),h1=(J)=>{let $={type:J.type||"button"};if(J.disabled===!0)$.disabled=!0;if(J.value!==void 0)$.value=J.value;if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return f(J,{tag:"button",attributes:$,className:J.class,forwardEvents:{click:(Q)=>!Q.element.disabled,focus:!0,blur:!0}})},u1=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable(),isDisabled:()=>J.disabled.isDisabled()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var f1=g(()=>{c();x$();Hq={variant:b7.FILLED,size:v7.S,shape:C7.ROUND,disabled:!1,type:E7.BUTTON,ripple:!0,rippleConfig:{duration:v9.DURATION,timing:v9.TIMING,opacity:v9.OPACITY}}});var Mq=(J={})=>{let $=E1(J);try{return I(T,h(),S(h1($)),G6($),_7($),J9($),g6($),Y6($),N1($),A6($),b(),(q)=>{if($.shape&&q.element){let Z=`${$.prefix}-${$.componentName}--${$.shape}`;q.element.classList.add(Z)}return q},(q)=>b1(u1(q))(q))($)}catch(Q){throw console.error("Button creation error:",Q),new Error(`Failed to create button: ${Q.message}`)}},o6;var g1=g(()=>{n();s();i();L1();v1();f1();o6=Mq});var d1={};GJ(d1,{default:()=>o6});var L9=g(()=>{g1()});var j$={COLLECTION:"items",BASE_URL:"http://localhost:4000/api",PAGE_SIZE:20,RENDER_BUFFER_SIZE:5,ITEM_HEIGHT:48},K$={DEFAULT:"default",SINGLE_SELECT:"single-select",MULTI_SELECT:"multi-select"},G$={NONE:"none",SINGLE:"single",MULTIPLE:"multiple"},X9={SELECT:"select",LOAD:"load",SCROLL:"scroll"},Y$={START:"start",CENTER:"center",END:"end"},Z6={CONTAINER:"list-container",LIST:"list",ITEM:"list-item",SELECTED:"list-item--selected",LOADING:"list--loading",EMPTY:"list--empty"};var M7={FILLED:"filled",OUTLINED:"outlined"},k7={BOTTOM_START:"bottom-start",BOTTOM:"bottom",BOTTOM_END:"bottom-end",TOP_START:"top-start",TOP:"top",TOP_END:"top-end"},z$={MOUSE:"mouse",KEYBOARD:"keyboard"},W$={CHANGE:"change",OPEN:"open",CLOSE:"close"},U$={DROPDOWN:'<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="M7 10l5 5 5-5z"/></svg>',CHECKMARK:'<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="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},R9={VARIANT:M7.FILLED,PLACEMENT:k7.BOTTOM_START,LABEL:"Select",VALUE:"",REQUIRED:!1,DISABLED:!1,SUPPORTING_TEXT:"",ERROR:!1},X$={CONTAINER:"select",TEXTFIELD:"select__textfield",DROPDOWN_ICON:"select__dropdown-icon",MENU:"select__menu",MENU_ITEM:"select__menu-item",MENU_ITEM_SELECTED:"select__menu-item--selected",MENU_ITEM_DISABLED:"select__menu-item--disabled",MENU_ITEM_CHECKMARK:"select__menu-item-checkmark",MENU_ITEM_ICON:"select__menu-item-icon",MENU_ITEM_TEXT:"select__menu-item-text",FILLED:"select--filled",OUTLINED:"select--outlined",OPEN:"select--open",DISABLED:"select--disabled",REQUIRED:"select--required",ERROR:"select--error"};c9();n();c();var V$={CENTER:"center",END:"end"},_$=300;var n2={tag:"div",hasFab:!1,fabPosition:V$.END,autoHide:!1,transitionDuration:_$},cJ=(J={})=>C(n2,J,"bottom-app-bar");var oJ=(J={})=>{let $=cJ(J),Q=T($),q=document.createElement("div");q.className=`${Q.getClass("bottom-app-bar")}-actions`;let Z=document.createElement("div");Z.className=`${Q.getClass("bottom-app-bar")}-fab-container`;let j=S({tag:$.tag,componentName:"bottom-app-bar",className:[$.hasFab?`${Q.getClass("bottom-app-bar")}--with-fab`:"",$.fabPosition==="center"?`${Q.getClass("bottom-app-bar")}--fab-center`:"",$.class],attributes:{role:"toolbar","aria-label":"Bottom app bar"},interactive:!0})(Q),K=h()(j),G=b()(K);G.element.appendChild(q),G.element.appendChild(Z);let Y=!0,z=window.scrollY;if($.autoHide){let X=()=>{let _=window.scrollY;if(_>z+10){if(Y)W.hide(),$.onVisibilityChange?.(!1)}else if(_<z-10){if(!Y)W.show(),$.onVisibilityChange?.(!0)}z=_};window.addEventListener("scroll",X,{passive:!0});let U=G.lifecycle.destroy;G.lifecycle.destroy=()=>{window.removeEventListener("scroll",X),U()}}let W={...G,addAction(X){return q.appendChild(X),this},addFab(X){return Z.innerHTML="",Z.appendChild(X),this.element.classList.add(`${Q.getClass("bottom-app-bar")}--with-fab`),this},show(){return this.element.classList.remove(`${Q.getClass("bottom-app-bar")}--hidden`),Y=!0,this},hide(){return this.element.classList.add(`${Q.getClass("bottom-app-bar")}--hidden`),Y=!1,this},isVisible(){return Y},getActionsContainer(){return q}};if($.autoHide&&$.transitionDuration)W.element.style.transition=`transform ${$.transitionDuration}ms ease-in-out`;return W};var e2=oJ;L9();n();s();i();var T$=({lifecycle:J})=>($)=>({...$,element:$.element,addContent(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-content`))$.element.appendChild(Q);return this},setHeader(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-header`)){let q=$.element.querySelector(`.${$.getClass("card")}-header`);if(q)q.remove();if($.element.querySelector(`.${$.getClass("card")}-media`)){let j=$.element.querySelectorAll(`.${$.getClass("card")}-media`),K=j[j.length-1];if(K.nextSibling)$.element.insertBefore(Q,K.nextSibling);else $.element.appendChild(Q)}else $.element.insertBefore(Q,$.element.firstChild)}return this},addMedia(Q,q="top"){if(Q&&Q.classList.contains(`${$.getClass("card")}-media`))if(q==="top")$.element.insertBefore(Q,$.element.firstChild);else $.element.appendChild(Q);return this},setActions(Q){if(Q&&Q.classList.contains(`${$.getClass("card")}-actions`)){let q=$.element.querySelector(`.${$.getClass("card")}-actions`);if(q)q.remove();$.element.appendChild(Q)}return this},makeDraggable(Q){if($.element.setAttribute("draggable","true"),$.element.setAttribute("aria-grabbed","false"),typeof Q==="function")$.element.addEventListener("dragstart",(q)=>{$.element.setAttribute("aria-grabbed","true"),Q(q)}),$.element.addEventListener("dragend",()=>{$.element.setAttribute("aria-grabbed","false")});return this},focus(){return $.element.focus(),this},destroy(){J.destroy()}});c();y6();n();s();S6();var h7=(J={})=>{let $={...J,componentName:"card-content",prefix:u};try{let Q=I(T,S({tag:"div",componentName:"card-content",className:[J.class,J.padding===!1?`${u}-card-content--no-padding`:null],attributes:{role:"region",style:"display: block; color: inherit;"}}))($);if(J.html)Q.element.innerHTML=J.html;else if(J.text)Q.element.innerHTML=`<p>${J.text}</p>`;if(Array.isArray(J.children))J.children.forEach((q)=>{if(q instanceof HTMLElement)Q.element.appendChild(q)});return Q.element.classList.add("debug-content"),Q.element}catch(Q){throw console.error("Card content creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card content: ${Q instanceof Error?Q.message:String(Q)}`)}},u7=(J={})=>{let $={...J,componentName:"card-header",prefix:u};try{let Q=I(T,S({tag:"div",componentName:"card-header",className:J.class,attributes:{role:"heading","aria-level":"3"}}))($),q=E({tag:"div",className:`${u}-card-header-text`,container:Q.element});if(J.title){E({tag:"h3",className:`${u}-card-header-title`,text:J.title,container:q,attributes:{id:`${Q.element.id||"card-header"}-title`}});let Z=Q.element.closest(`.${u}-card`);if(Z&&!Z.hasAttribute("aria-labelledby"))Z.setAttribute("aria-labelledby",`${Q.element.id||"card-header"}-title`)}if(J.subtitle)E({tag:"h4",className:`${u}-card-header-subtitle`,text:J.subtitle,container:q});if(J.avatar){let Z=typeof J.avatar==="string"?E({tag:"div",className:`${u}-card-header-avatar`,html:J.avatar}):J.avatar,j=Z.querySelector("img");if(j&&!j.hasAttribute("alt"))j.setAttribute("alt",""),j.setAttribute("aria-hidden","true");Q.element.insertBefore(Z,Q.element.firstChild)}if(J.action){let Z=typeof J.action==="string"?E({tag:"div",className:`${u}-card-header-action`,html:J.action}):J.action;Q.element.appendChild(Z)}return Q.element}catch(Q){throw console.error("Card header creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card header: ${Q instanceof Error?Q.message:String(Q)}`)}},Z7=(J={})=>{let $={...J,componentName:"card-actions",prefix:u};try{let Q=I(T,S({tag:"div",componentName:"card-actions",className:[J.class,J.fullBleed?`${u}-card-actions--full-bleed`:null,J.vertical?`${u}-card-actions--vertical`:null,J.align?`${u}-card-actions--${J.align}`:null],attributes:{role:"group"}}))($);if(Array.isArray(J.actions))J.actions.forEach((q,Z)=>{if(q instanceof HTMLElement){if(!q.hasAttribute("aria-label")&&!q.hasAttribute("aria-labelledby")&&q.textContent?.trim()==="")q.setAttribute("aria-label",`Action ${Z+1}`);Q.element.appendChild(q)}});return Q.element}catch(Q){throw console.error("Card actions creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card actions: ${Q instanceof Error?Q.message:String(Q)}`)}},j7=(J={})=>{let $={...J,componentName:"card-media",prefix:u};try{let Q=I(T,S({tag:"div",componentName:"card-media",className:[J.class,J.aspectRatio?`${u}-card-media--${J.aspectRatio.replace(":","-")}`:null,J.contain?`${u}-card-media--contain`:null]}))($);if(J.element instanceof HTMLElement)Q.element.appendChild(J.element);else if(J.src){let q=document.createElement("img");if(q.src=J.src,q.className=`${u}-card-media-img`,q.alt=J.alt||"",!J.alt)q.setAttribute("aria-hidden","true");Q.element.appendChild(q)}return Q.element}catch(Q){throw console.error("Card media creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create card media: ${Q instanceof Error?Q.message:String(Q)}`)}};var V9={ELEVATED:"elevated",FILLED:"filled",OUTLINED:"outlined"},K7={LEVEL0:0,LEVEL1:1,LEVEL2:2,LEVEL4:4},I$={SMALL:"344px",MEDIUM:"480px",LARGE:"624px",FULL:"100%"},r1={SMALL:"8px",MEDIUM:"12px",LARGE:"16px"},S$={SQUARE:"1:1",STANDARD:"4:3",WIDESCREEN:"16:9"},l1={START:"start",CENTER:"center",END:"end",SPACE_BETWEEN:"space-between"},p1={TOP:"top",BOTTOM:"bottom"},s1={ROOT:"card",HEADER:"card-header",TITLE:"card-title",SUBTITLE:"card-subtitle",AVATAR:"card-avatar",HEADER_ACTION:"card-header-action",CONTENT:"card-content",MEDIA:"card-media",ACTIONS:"card-actions",DRAGGABLE:"card-draggable",INTERACTIVE:"card-interactive",FULL_WIDTH:"card-full-width",CLICKABLE:"card-clickable",LOADING:"card-loading",EXPANDED:"card-expanded",ELEVATION_PREFIX:"card-elevation-"};var kq={variant:V9.ELEVATED,interactive:!1,fullWidth:!1,clickable:!1,draggable:!1},m1=(J)=>{let $={...J};if(J.header)$.headerConfig=J.header;if(J.content)$.contentConfig=J.content;if(J.media)$.mediaConfig=J.media;if(J.actions)$.actionsConfig=J.actions;return $},a1=(J,$)=>{if($.mediaConfig&&(!$.mediaConfig.position||$.mediaConfig.position==="top")){let Q=j7({...$.mediaConfig,position:void 0});J.addMedia(Q,"top")}if($.headerConfig){let Q=u7($.headerConfig);J.setHeader(Q)}if($.contentConfig){let Q=h7($.contentConfig);J.addContent(Q)}if($.mediaConfig&&$.mediaConfig.position==="bottom"){let Q=j7({...$.mediaConfig,position:void 0});J.addMedia(Q,"bottom")}if($.actionsConfig){let Q=Z7($.actionsConfig);J.setActions(Q)}if(Array.isArray($.buttons)&&$.buttons.length>0)Promise.resolve().then(() => (L9(),d1)).then(({default:Q})=>{let q=$.buttons.map((j)=>Q(j).element),Z=Z7({actions:q,align:$.actionsConfig?.align||"end"});J.setActions(Z)}).catch((Q)=>{console.error("Error processing buttons:",Q)})},i1=(J={})=>C(kq,J,"card"),c1=(J)=>{let $=J.interactive||J.clickable,Q=$?"button":"region",q={};if(J.aria)Object.entries(J.aria).forEach(([Z,j])=>{if(j!==void 0){let K=Z.startsWith("aria-")?Z:`aria-${Z}`;q[K]=j}});if(!q.role&&!J.aria?.role)q.role=Q;if($&&!q.tabindex)q.tabindex="0";return f(J,{tag:"div",className:[J.class,J.fullWidth?`${J.prefix}-card--full-width`:null,$?`${J.prefix}-card--interactive`:null],attributes:q,forwardEvents:{click:()=>!!J.clickable,mouseenter:()=>!!$,mouseleave:()=>!!$,keydown:()=>!!$,focus:()=>!!$,blur:()=>!!$},interactive:$})},o1=(J)=>({lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}}),_9=K7,t1=(J)=>{let $=J.config;if($.interactive||$.clickable)J.element.addEventListener("mouseenter",()=>{if($.variant===V9.ELEVATED)J.element.style.setProperty("--card-elevation",String(_9.LEVEL2))}),J.element.addEventListener("mouseleave",()=>{if($.variant===V9.ELEVATED)J.element.style.setProperty("--card-elevation",String(_9.LEVEL1))}),J.element.addEventListener("keydown",(q)=>{if((q.key==="Enter"||q.key===" ")&&$.clickable)q.preventDefault(),J.element.click()}),J.element.addEventListener("focus",()=>{J.element.classList.add(`${J.getClass("card")}--focused`)}),J.element.addEventListener("blur",()=>{J.element.classList.remove(`${J.getClass("card")}--focused`)});if($.draggable)J.element.setAttribute("draggable","true"),J.element.addEventListener("dragstart",(q)=>{if(J.element.style.setProperty("--card-elevation",String(_9.LEVEL4)),J.element.classList.add(`${J.getClass("card")}--dragging`),J.emit?.("dragstart",{event:q}),q.dataTransfer){let Z=J.element.querySelector(`.${J.getClass("card")}-header-title`)?.textContent||"Card";q.dataTransfer.setData("text/plain",Z)}}),J.element.addEventListener("dragend",(q)=>{J.element.style.setProperty("--card-elevation",String(_9.LEVEL1)),J.element.classList.remove(`${J.getClass("card")}--dragging`),J.emit?.("dragend",{event:q})});return J};y6();S6();var Nq=(J={})=>($)=>{let Q=J.initialState||!1,q=null,Z=Q;function j(K){if(Z=K,K&&!q)q=E({tag:"div",className:`${u}-card-loading-overlay`,container:$.element,attributes:{role:"progressbar","aria-busy":"true","aria-label":"Loading"}}),E({tag:"div",className:`${u}-card-loading-spinner`,container:q}),$.element.classList.add(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","true");else if(!K&&q)q.remove(),q=null,$.element.classList.remove(`${u}-card--state-loading`),$.element.setAttribute("aria-busy","false")}if(Q)j(!0);return{...$,loading:{isLoading:()=>Z,setLoading:j}}},b$=(J)=>{if(J.config.variant==="elevated")J.element.style.setProperty("--card-elevation",String(_9.LEVEL1));else J.element.style.setProperty("--card-elevation",String(_9.LEVEL0));return J},Lq=(J={})=>($)=>{let Q=J.initialExpanded||!1,q=Q,Z=J.expandableContent,j=E({tag:"button",className:`${u}-card-expand-button`,attributes:{"aria-expanded":q?"true":"false","aria-label":q?"Collapse content":"Expand content","aria-controls":Z?.id||`${$.element.id||"card"}-expandable-content`}}),K=$.element.querySelector(`.${u}-card-actions`);if(K)K.appendChild(j);else E({tag:"div",className:`${u}-card-actions`,container:$.element,attributes:{role:"group"}}).appendChild(j);if(Z){if(Z.classList.add(`${u}-card-expandable-content`),!Z.id)Z.id=`${$.element.id||"card"}-expandable-content`;if(!Q)Z.style.display="none",Z.setAttribute("aria-hidden","true");else Z.setAttribute("aria-hidden","false");$.element.appendChild(Z)}function G(z){if(q=z,Z)Z.style.display=z?"block":"none",Z.setAttribute("aria-hidden",z?"false":"true");if(j.setAttribute("aria-expanded",z?"true":"false"),j.setAttribute("aria-label",z?"Collapse content":"Expand content"),z)$.element.classList.add(`${u}-card--expanded`);else $.element.classList.remove(`${u}-card--expanded`);$.emit?.("expandedChanged",{expanded:z})}function Y(){G(!q)}return j.addEventListener("click",(z)=>{z.stopPropagation(),Y()}),j.addEventListener("keydown",(z)=>{if(z.key==="Enter"||z.key===" ")z.preventDefault(),Y()}),{...$,expandable:{isExpanded:()=>q,setExpanded:G,toggleExpanded:Y}}},Vq=(J={})=>($)=>{let Q=J.threshold||100,q=0,Z=0;$.element.setAttribute("aria-description","Swipeable card. Swipe left or right to perform actions.");let j=E({tag:"button",className:`${u}-card-swipe-left-action`,text:"Swipe Left Action",container:$.element,attributes:{"aria-label":"Perform swipe left action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}}),K=E({tag:"button",className:`${u}-card-swipe-right-action`,text:"Swipe Right Action",container:$.element,attributes:{"aria-label":"Perform swipe right action",style:"position: absolute; left: -9999px; top: -9999px; visibility: hidden;"}});j.addEventListener("click",()=>{if(J.onSwipeLeft)$.element.style.transform="translateX(-100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeLeft($)}),K.addEventListener("click",()=>{if(J.onSwipeRight)$.element.style.transform="translateX(100%)",$.element.style.transition="transform 0.3s ease",J.onSwipeRight($)});function G(W){q=W.touches[0].clientX,$.element.style.transition="none"}function Y(W){if(!q)return;Z=W.touches[0].clientX;let X=Z-q;$.element.style.transform=`translateX(${X}px)`}function z(){if(!q)return;$.element.style.transition="transform 0.3s ease";let W=Z-q;if(Math.abs(W)>=Q)if(W>0&&J.onSwipeRight)$.element.style.transform="translateX(100%)",J.onSwipeRight($);else if(W<0&&J.onSwipeLeft)$.element.style.transform="translateX(-100%)",J.onSwipeLeft($);else $.element.style.transform="translateX(0)";else $.element.style.transform="translateX(0)";q=0,Z=0}return $.element.addEventListener("touchstart",G),$.element.addEventListener("touchmove",Y),$.element.addEventListener("touchend",z),$.element.classList.add(`${u}-card--swipeable`),{...$,swipeable:{reset:()=>{$.element.style.transition="transform 0.3s ease",$.element.style.transform="translateX(0)"}}}};var _q=(J={})=>{let $=m1(J),Q=i1($);try{let q=I(T,h(),S(c1(Q)),G6(Q),Q.clickable?A6(Q):(Z)=>Z,b(),t1,b$,(Z)=>T$(o1(Z))(Z))(Q);return a1(q,$),q}catch(q){throw console.error("Card creation error:",q instanceof Error?q.message:String(q)),new Error(`Failed to create card: ${q instanceof Error?q.message:String(q)}`)}},n1=_q;n();s();i();var Z9={MULTI_BROWSE:"multi-browse",UNCONTAINED:"uncontained",HERO:"hero",FULL_SCREEN:"full-screen"},e1={DEFAULT:"default",SNAP:"snap"},Dq={LARGE:"large",MEDIUM:"medium",SMALL:"small"},f7={SLIDE:"slide",FADE:"fade",NONE:"none"},C9={SLIDE_CHANGE:"slide-change",SLIDE_CHANGED:"slide-changed",RESIZE:"resize"},H6={INITIAL_SLIDE:0,LOOP:!0,TRANSITION:f7.SLIDE,TRANSITION_DURATION:300,BORDER_RADIUS:16,GAP:8,LAYOUT:Z9.MULTI_BROWSE,SCROLL_BEHAVIOR:e1.SNAP,SMALL_ITEM_WIDTH:48,ITEM_WIDTHS:{[Z9.MULTI_BROWSE]:{LARGE:240,MEDIUM:180,SMALL:48},[Z9.UNCONTAINED]:{LARGE:240,MEDIUM:240,SMALL:240},[Z9.HERO]:{LARGE:300,MEDIUM:240,SMALL:48},[Z9.FULL_SCREEN]:{LARGE:"100%",MEDIUM:"100%",SMALL:"100%"}}};var v$=(J)=>($)=>{let Q={...$},q=J.layout||H6.LAYOUT,Z=()=>{let B=document.createElement("div");return B.className=`${$.getClass("carousel")}-wrapper`,B.dataset.layout=q,$.element.appendChild(B),B},j=document.createElement("div");if(j.className=`${$.getClass("carousel")}-slides`,j.setAttribute("role","list"),j.setAttribute("aria-label","Carousel Slides"),J.scrollBehavior==="snap")j.dataset.snapScroll="true";j.dataset.gap=`${J.gap||H6.GAP}`;let K=Z();K.appendChild(j);let G=J.initialSlide||0,Y=0,z=[],W=[];function X(B){if(W[B]?.size)return W[B].size;switch(q){case"multi-browse":if(B===0||B===1)return"large";if(B===2)return"medium";return"small";case"uncontained":return"large";case"hero":return B===0?"large":"small";case"full-screen":return"large";default:return"large"}}function U(){let B=j.clientWidth,H=typeof H6.ITEM_WIDTHS[q].LARGE==="number"?H6.ITEM_WIDTHS[q].LARGE:B,V=typeof H6.ITEM_WIDTHS[q].MEDIUM==="number"?H6.ITEM_WIDTHS[q].MEDIUM:B*0.75,O=typeof H6.ITEM_WIDTHS[q].SMALL==="number"?H6.ITEM_WIDTHS[q].SMALL:H6.SMALL_ITEM_WIDTH;if(J.largeItemMaxWidth&&typeof J.largeItemMaxWidth==="number")H=Math.min(H,J.largeItemMaxWidth);if(J.smallItemWidth&&typeof J.smallItemWidth==="number")O=J.smallItemWidth;if(q==="full-screen")H=B,V=B,O=B;z.forEach((M,P)=>{let R=X(P);switch(R){case"large":M.style.width=`${H}px`;break;case"medium":M.style.width=`${V}px`;break;case"small":M.style.width=`${O}px`;break}M.className=`${$.getClass("carousel")}-slide ${$.getClass("carousel")}-slide--${R}`;let y=M.querySelector(`.${$.getClass("carousel")}-slide-title`),x=M.querySelector(`.${$.getClass("carousel")}-slide-description`);if(y)if(R==="small"&&q!=="uncontained")y.classList.add("visually-hidden");else y.classList.remove("visually-hidden");if(x)if(R==="small"||R==="medium"&&q==="multi-browse")x.classList.add("visually-hidden");else x.classList.remove("visually-hidden")})}function _(B,H){let V=document.createElement("div");V.className=`${$.getClass("carousel")}-slide`,V.setAttribute("role","listitem"),V.setAttribute("aria-roledescription","slide"),V.dataset.borderRadius=`${J.borderRadius||H6.BORDER_RADIUS}`;let O=document.createElement("div");O.className=`${$.getClass("carousel")}-slide-image`;let M=document.createElement("img");if(M.src=B.image,M.alt=B.title||"Carousel slide",O.appendChild(M),B.accent){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-overlay`,B.accent)R.style.backgroundColor=B.accent;O.appendChild(R)}let P=document.createElement("div");if(P.className=`${$.getClass("carousel")}-slide-content`,B.title){let R=document.createElement("div");if(R.className=`${$.getClass("carousel")}-slide-title`,R.textContent=B.title,q==="full-screen")P.appendChild(R);else O.appendChild(R)}if(B.description){let R=document.createElement("div");R.className=`${$.getClass("carousel")}-slide-description`,R.textContent=B.description,P.appendChild(R)}if(B.buttonText){let R=document.createElement("a");if(R.className=`${$.getClass("carousel")}-slide-button`,R.textContent=B.buttonText,B.buttonUrl)R.href=B.buttonUrl;if(B.accent)R.style.backgroundColor=B.accent;P.appendChild(R)}if(V.appendChild(O),V.appendChild(P),H!==void 0&&H>=0&&H<=W.length)W.splice(H,0,B);else W.push(B);if(H!==void 0&&H>=0&&H<=z.length)if(H<z.length)j.insertBefore(V,z[H]),z.splice(H,0,V);else j.appendChild(V),z.push(V);else j.appendChild(V),z.push(V);return Y++,U(),V}let N=()=>{if(J.showAllLink===!1)return;let B=document.createElement("div");B.className=`${$.getClass("carousel")}-show-all`,B.setAttribute("role","button"),B.setAttribute("tabindex","0"),B.setAttribute("aria-label","Show all items");let H=document.createElement("span");H.textContent="Show all",B.appendChild(H),K.appendChild(B),B.addEventListener("click",()=>{if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll()}),B.addEventListener("keydown",(V)=>{if(V.key==="Enter"||V.key===" "){if(J.onShowAll&&typeof J.onShowAll==="function")J.onShowAll();V.preventDefault()}})};if(J.slides&&J.slides.length>0)J.slides.forEach((B)=>{_(B)});if(J.showAllLink!==!1&&q!=="full-screen")N();let F=()=>{U();let B=new CustomEvent(C9.RESIZE,{detail:{width:j.clientWidth}});$.element.dispatchEvent(B)};window.addEventListener("resize",F),setTimeout(U,0);let k=(B)=>{if(B<0||B>=Y)if(J.loop)if(B<0)B=Y-1;else B=0;else return Q;if(G!==B){let H=new CustomEvent(C9.SLIDE_CHANGE,{detail:{previousSlide:G,nextSlide:B}});$.element.dispatchEvent(H),G=B,z.forEach((M,P)=>{if(P===G)M.classList.add(`${$.getClass("carousel")}-slide--active`),M.setAttribute("aria-current","true");else M.classList.remove(`${$.getClass("carousel")}-slide--active`),M.removeAttribute("aria-current")});let V=J.scrollBehavior==="snap"?"smooth":"auto";if(z[B])if(q==="hero"&&J.centered){let M=z[B].offsetWidth,P=j.clientWidth,R=z[B].offsetLeft;j.scrollTo({left:R-P/2+M/2,behavior:V})}else z[B].scrollIntoView({behavior:V,block:"nearest",inline:"start"});let O=new CustomEvent(C9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(O)}return Q};if(Object.assign(Q,{slides:{addSlide:(B,H)=>{return _(B,H),Q.slides},removeSlide:(B)=>{if(B>=0&&B<z.length){if(j.removeChild(z[B]),z.splice(B,1),W.splice(B,1),Y--,G>=Y)G=Y-1;if(G<0)G=0;U()}return Q.slides},updateSlide:(B,H)=>{if(B>=0&&B<z.length){W[B]=H;let V=z[B],O=V.querySelector("img");if(O)O.src=H.image,O.alt=H.title||"Carousel slide";let M=V.querySelector(`.${$.getClass("carousel")}-slide-title`);if(M&&H.title)M.textContent=H.title;let P=V.querySelector(`.${$.getClass("carousel")}-slide-description`);if(P&&H.description)P.textContent=H.description;let R=V.querySelector(`.${$.getClass("carousel")}-slide-overlay`);if(R&&H.accent)R.style.backgroundColor=H.accent;let y=V.querySelector(`.${$.getClass("carousel")}-slide-button`);if(y)if(H.buttonText){if(y.textContent=H.buttonText,H.buttonUrl)y.href=H.buttonUrl;if(H.accent)y.style.backgroundColor=H.accent}else y.parentElement?.removeChild(y);else if(H.buttonText){let x=V.querySelector(`.${$.getClass("carousel")}-slide-content`);if(x){let A=document.createElement("a");if(A.className=`${$.getClass("carousel")}-slide-button`,A.textContent=H.buttonText,H.buttonUrl)A.href=H.buttonUrl;if(H.accent)A.style.backgroundColor=H.accent;x.appendChild(A)}}if(H.size)U()}return Q.slides},getSlide:(B)=>{if(B>=0&&B<W.length)return W[B];return null},getCount:()=>Y,getElements:()=>[...z]},slidesContainer:j,slideData:W,wrapper:K,getCurrentSlide:()=>G,goTo:k,next:()=>k(G+1),prev:()=>k(G-1),enableLoop:()=>{return J.loop=!0,Q},disableLoop:()=>{return J.loop=!1,Q},setBorderRadius:(B)=>{return J.borderRadius=B,z.forEach((H)=>{H.dataset.borderRadius=`${B}`}),Q},setGap:(B)=>{return J.gap=B,j.dataset.gap=`${B}`,Q},updateLayout:(B)=>{return J.layout=B,K.dataset.layout=B,$.element.dataset.layout=B,Object.values(Z9).forEach((H)=>{$.element.classList.remove(`${$.getClass("carousel")}-layout--${H}`)}),$.element.classList.add(`${$.getClass("carousel")}-layout--${B}`),U(),Q},lifecycle:{...$.lifecycle||{},destroy:()=>{if(window.removeEventListener("resize",F),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}),J.transition)$.element.classList.add(`${$.getClass("carousel")}-transition--${J.transition}`);if(J.scrollBehavior==="snap")j.addEventListener("scroll",()=>{clearTimeout(Q.scrollTimeout),Q.scrollTimeout=setTimeout(()=>{let B=0,H=1/0,V=j.scrollLeft,O=j.clientWidth;if(z.forEach((M,P)=>{let y=M.offsetLeft+M.offsetWidth/2,x=V+O/2,A=Math.abs(y-x);if(A<H)H=A,B=P}),B!==G){G=B,z.forEach((P,R)=>{if(R===G)P.classList.add(`${$.getClass("carousel")}-slide--active`),P.setAttribute("aria-current","true");else P.classList.remove(`${$.getClass("carousel")}-slide--active`),P.removeAttribute("aria-current")});let M=new CustomEvent(C9.SLIDE_CHANGED,{detail:{currentSlide:G}});$.element.dispatchEvent(M)}},150)});return Q};var C$=(J)=>($)=>{let Q,q,Z,j=!1,K=0,G=0,Y,z=J.scrollBehavior||"default",W=(H)=>{if(H.button!==0)return;cancelAnimationFrame(Y),Q=H.clientX,q=$.slidesContainer.scrollLeft,Z=Q,j=!0,G=Date.now(),K=0,$.slidesContainer.dataset.touchAction="none",$.element.dataset.dragging="true",$.slidesContainer.style.scrollBehavior="auto",$.element.setPointerCapture(H.pointerId),H.preventDefault()},X=(H)=>{if(!j)return;let V=H.clientX-Q;$.slidesContainer.scrollLeft=q-V;let O=Date.now(),M=O-G;if(M>0)K=(H.clientX-Z)/M;Z=H.clientX,G=O,H.preventDefault()},U=()=>{let H=$.slides.getElements(),V=$.slidesContainer.clientWidth,O=$.slidesContainer.scrollLeft,M=J.layout==="hero"&&J.centered,P=0,R=1/0;return H.forEach((y)=>{let x;if(M)x=y.offsetLeft+y.offsetWidth/2-V/2;else x=y.offsetLeft;let A=Math.abs(x-O);if(A<R)R=A,P=x}),P},_=(H,V,O)=>{let M=Date.now(),P=V-H,R=500;if(Math.abs(O)>0.5)R=Math.min(R,300);let y=()=>{let x=Date.now()-M,A=Math.min(x/R,1);A=1-Math.pow(1-A,3);let v=H+P*A;if($.slidesContainer.scrollLeft=v,A<1)Y=requestAnimationFrame(y)};Y=requestAnimationFrame(y)},N=(H)=>{if(!j)return;if(j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(H.pointerId),z==="snap"){let V=U();_($.slidesContainer.scrollLeft,V,K)}else if(Math.abs(K)>0.5){let V=K*100,O=$.slidesContainer.scrollLeft-V;_($.slidesContainer.scrollLeft,O,K)}K=0,setTimeout(()=>{$.slidesContainer.style.scrollBehavior=""},0)},F=(H)=>{if(j)j=!1,delete $.element.dataset.dragging,$.element.releasePointerCapture(H.pointerId),$.slidesContainer.style.scrollBehavior=""},k=(H)=>{if(J.layout==="full-screen")return;H.preventDefault();let O=(H.deltaY||H.deltaX)*0.5;if(z==="snap")$.slidesContainer.scrollLeft+=O,clearTimeout($.wheelSnapTimeout),$.wheelSnapTimeout=setTimeout(()=>{let M=U();_($.slidesContainer.scrollLeft,M,0)},150);else $.slidesContainer.scrollLeft+=O},L=()=>{if(J.layout!=="multi-browse"||!$.element.dataset.enableParallax)return;let H=$.slides.getElements(),V=$.slidesContainer.clientWidth,O=$.slidesContainer.scrollLeft;H.forEach((M)=>{let{offsetLeft:P,offsetWidth:R}=M,y=P+R/2,x=O+V/2,A=y-x,v=Math.max(-1,Math.min(1,A/(V/2))),r=M.querySelector(`.${$.getClass("carousel")}-slide-image img`);if(r)r.style.transform=`translateX(${v*-5}%)`})},D=()=>{L()};if(J.layout==="multi-browse")$.element.dataset.enableParallax="true";$.element.dataset.swipe="true",$.slidesContainer.addEventListener("pointerdown",W),window.addEventListener("pointermove",X),window.addEventListener("pointerup",N),window.addEventListener("pointercancel",F),$.slidesContainer.addEventListener("wheel",k,{passive:!1}),$.slidesContainer.addEventListener("scroll",D,{passive:!0});let B=(H)=>{if($.element!==document.activeElement)return;switch(H.key){case"ArrowLeft":if($.prev)$.prev();else $.slidesContainer.scrollBy({left:-200,behavior:z==="snap"?"smooth":"auto"});H.preventDefault();break;case"ArrowRight":if($.next)$.next();else $.slidesContainer.scrollBy({left:200,behavior:z==="snap"?"smooth":"auto"});H.preventDefault();break;case"Home":if($.goTo)$.goTo(0);H.preventDefault();break;case"End":if($.goTo&&$.slides.getCount)$.goTo($.slides.getCount()-1);H.preventDefault();break}};return $.element.setAttribute("tabindex","0"),$.element.addEventListener("keydown",B),$.element.setAttribute("aria-label","Carousel"),{...$,lifecycle:{...$.lifecycle,destroy:()=>{if(cancelAnimationFrame(Y),$.slidesContainer.removeEventListener("pointerdown",W),window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",N),window.removeEventListener("pointercancel",F),$.slidesContainer.removeEventListener("wheel",k),$.slidesContainer.removeEventListener("scroll",D),$.element.removeEventListener("keydown",B),$.lifecycle&&$.lifecycle.destroy)$.lifecycle.destroy()}}}};var $Q=(J)=>($)=>{let Q={element:$.element,slides:{addSlide:(q,Z)=>{return J.slides.addSlide(q,Z),Q.slides},removeSlide:(q)=>{return J.slides.removeSlide(q),Q.slides},updateSlide:(q,Z)=>{return J.slides.updateSlide(q,Z),Q.slides},getSlide:(q)=>{if($.slideData&&q>=0&&q<$.slideData.length)return $.slideData[q];return null},getCount:J.slides.getCount,getElements:J.slides.getElements},lifecycle:{destroy:J.lifecycle.destroy},getClass:$.getClass,next(){return $.next(),this},prev(){return $.prev(),this},goTo(q){return $.goTo(q),this},getCurrentSlide:$.getCurrentSlide,addSlide(q,Z){return J.slides.addSlide(q,Z),this},removeSlide(q){return J.slides.removeSlide(q),this},enableLoop(){return $.enableLoop(),this},disableLoop(){return $.disableLoop(),this},setBorderRadius(q){if($.setBorderRadius)$.setBorderRadius(q);return this},setGap(q){if($.setGap)$.setGap(q);return this},destroy(){J.lifecycle.destroy()},on(q,Z){if($.on)$.on(q,Z);else if($.element.addEventListener)$.element.addEventListener(q,Z);return this},off(q,Z){if($.off)$.off(q,Z);else if($.element.removeEventListener)$.element.removeEventListener(q,Z);return this},addClass(...q){if($.addClass)$.addClass(...q);else q.forEach((Z)=>$.element.classList.add(Z));return this}};return Q};c();var Oq={initialSlide:H6.INITIAL_SLIDE,loop:H6.LOOP,transition:f7.SLIDE,transitionDuration:H6.TRANSITION_DURATION,borderRadius:H6.BORDER_RADIUS,gap:H6.GAP,prefix:"carousel",showAllLink:!0},JQ=(J={})=>C(Oq,J,"carousel"),QQ=(J)=>{let $={role:"region","aria-roledescription":"carousel","aria-live":"polite"},Q={"data-transition":J.transition,"data-loop":J.loop?"true":"false"};return f(J,{tag:"div",attributes:{...$,...Q},className:J.class,forwardEvents:{keydown:!0,focus:!0,blur:!0}})};var Pq=(J={})=>{J.layout=J.layout||"multi-browse",J.scrollBehavior=J.scrollBehavior||Rq(J.layout);let $=JQ(J);try{let q={...I(T,h(),S(QQ($)))($)};yq(q,J);let Z=v$($)(q),j=C$($)(Z),K=b()(j),G={slides:{addSlide:K.slides.addSlide,removeSlide:K.slides.removeSlide,updateSlide:K.slides.updateSlide,getCount:K.slides.getCount,getElements:K.slides.getElements},lifecycle:{destroy:K.lifecycle.destroy}},Y=$Q(G)(K);return Y.element.dataset.layout=J.layout,Y.element.dataset.scrollBehavior=J.scrollBehavior,Y}catch(Q){throw console.error("Carousel creation error:",Q),new Error(`Failed to create carousel: ${Q.message}`)}};function Rq(J){switch(J){case"multi-browse":case"hero":case"full-screen":return"snap";case"uncontained":return"default";default:return"default"}}function yq(J,$){switch(J.element.classList.add(`${J.getClass("carousel")}-layout--${$.layout}`),$.layout){case"multi-browse":J.element.dataset.enableParallax="true",J.element.dataset.layout="multi-browse";break;case"uncontained":J.element.style.overflow="visible",J.element.dataset.layout="uncontained";break;case"hero":if(J.element.dataset.largeItemFocus="true",J.element.dataset.layout="hero",$.centered)J.element.dataset.centered="true";break;case"full-screen":J.element.style.width="100%",J.element.style.height="100%",J.element.style.maxWidth="100vw",J.element.style.maxHeight="100vh",J.element.dataset.verticalScroll="true",J.element.dataset.layout="full-screen",$.scrollBehavior="snap";break}if($.scrollBehavior==="snap")J.element.dataset.snapScroll="true";else J.element.dataset.snapScroll="false"}var qQ=Pq;n();s();i();var ZQ=({disabled:J,lifecycle:$,checkable:Q})=>(q)=>({...q,element:q.element,input:q.input,getValue:q.getValue||(()=>""),setValue(Z){return q.setValue?.(Z),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setIndeterminate(Z){return q.setIndeterminate?.(Z),this},setLabel(Z){return q.text?.setText(Z),this},getLabel(){return q.text?.getText()||""},on(Z,j){return q.on?.(Z,j),this},off(Z,j){return q.off?.(Z,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});c();var Aq={variant:"filled",labelPosition:"end"},jQ=(J={})=>C(Aq,J,"checkbox"),KQ=(J)=>f(J,{tag:"div",className:J.class,interactive:!0}),GQ=(J)=>($)=>{let Q=document.createElement("span");return Q.className=`${J.prefix}-checkbox-icon`,Q.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
- `,$.element.appendChild(Q),$},t4=(J)=>($)=>{let Q=J.labelPosition||"end",Z=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(Z),$},n4=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var Iq=(J,$)=>{let Q=f9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(Z)=>{return Q.input.indeterminate=Z,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,Z),Q},Q},Sq=(J={})=>{let $=c4(J);try{return b(S,d(),h(i4($)),u9($),o4($),X9($),t4($),(Z)=>Iq(Z,$),G6($),C(),(Z)=>a4(n4(Z))(Z))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},e4=Sq;var h8={FILLED:"filled",OUTLINED:"outlined"},u8={START:"start",END:"end"},$5={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},J5={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};J6();c();o();var Q5=({disabled:J,lifecycle:$})=>(Q)=>{let Z=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),q=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return q=j,j;if(q!==null)return Q.element.setAttribute("data-value",q),q;let G=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(G&&G.textContent){let K=G.textContent;if(K.includes(" Theme"))q=K.replace(" Theme","").toLowerCase();else q=K.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",q),q}return null},setValue(j){if(j!==null&&j!==void 0)q=j,Q.element.setAttribute("data-value",j);else q=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let G=`.${Q.getClass("chip")}-content`,K=Q.element.querySelector(G)||Q.element,z=`.${Q.getClass("chip")}-text`,W=Q.element.querySelector(z);if(!W&&j){W=document.createElement("span"),W.className=`${Q.getClass("chip")}-text`;let Y=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(Y)K.insertBefore(W,Y.nextSibling);else K.insertBefore(W,K.firstChild)}if(W){if(W.textContent=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,K=`.${Q.getClass("chip")}-leading-icon`,z=Q.element.querySelector(K);if(!z&&j)z=document.createElement("span"),z.className=`${Q.getClass("chip")}-leading-icon`,G.insertBefore(z,G.firstChild);if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},setTrailingIcon(j,G){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,z=`.${Q.getClass("chip")}-trailing-icon`,W=Q.element.querySelector(z);if(!W&&j){if(W=document.createElement("span"),W.className=`${Q.getClass("chip")}-trailing-icon`,K.appendChild(W),G)W.addEventListener("click",(Y)=>{Y.stopPropagation(),G(this)})}if(W){if(W.innerHTML=j||"",!j&&W.parentNode)W.parentNode.removeChild(W)}return this},isSelected(){return Z},setSelected(j){if(Z=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!Z)},destroy(){$.destroy()}}};t();var bq={variant:"filled",ripple:!0},Z5=(J={})=>u(bq,J,"chip"),q5=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return p(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(Z)=>Z.element.getAttribute("aria-disabled")!=="true",keydown:(Z,q)=>{if(q.key===" "||q.key==="Enter")return q.preventDefault(),Z.element.click(),!0;return!1},focus:!0,blur:!0}})},j5=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var vq=(J={})=>{let $=Z5(J);try{let Q=b(S,d(),h(q5($)),K6($),G6($),S6($),C())($),Z=document.createElement("div");if(Z.className=`${Q.getClass("chip")}-content`,Z.style.display="flex",Z.style.alignItems="center",Z.style.gap="8px",Z.style.width="100%",Q.element.appendChild(Z),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",Z.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,Z.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(G)=>{G.stopPropagation(),J.onTrailingIconClick(Q)});Z.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let q=Q5(j5(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)q.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(q.isDisabled())return;let j=q.isSelected();q.toggleSelected();let G=q.isSelected();if(J.onChange&&j!==G)J.onChange(G,q);if(J.onSelect)J.onSelect(q)});return q}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},Y$=vq;c();o();var P7=(J)=>($)=>{if(!J.schema)return console.warn("No schema definition found in component config"),$;return{...$,schema:J.schema}};A6();var f8=(J)=>($)=>{if(!J.icon||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.iconPosition||"start",G=q.element.options.className||[],K=`${Q}-${Z}--icon`;if(Array.isArray(G)){if(!G.includes(K))G.push(K)}else if(typeof G==="string"){if(!G.includes(K))q.element.options.className=`${G} ${K}`.trim()}else q.element.options.className=[K];let z={name:"icon",creator:v,options:{tag:"span",className:[`${Q}-${Z}-icon`,`${Q}-${Z}-icon--${j}`],html:J.icon}};if(J.iconSize){let W=z.options.className;if(Array.isArray(W))W.push(`${Q}-${Z}-icon--${J.iconSize}`)}if(j==="start"){let W={...q.element.children};q.element.children={icon:z,...W}}else q.element.children.icon=z;return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with icon:",Q),$}};A6();var R7=(J)=>($)=>{if(!J.label||!$.schema)return $;try{let Q=J.prefix||$.config?.prefix||"mtrl",Z=J.componentName||$.componentName||"component",q=JSON.parse(JSON.stringify($.schema)),j=J.labelPosition||"start",G=J.label,K=null;if(J.required)K={requiredIndicator:{name:"requiredIndicator",creator:v,options:{tag:"span",className:`${Q}-${Z}-label-required`,text:"*",attributes:{"aria-hidden":"true"}}}},G=J.label;let z={name:"label",creator:v,options:{tag:"label",className:[`${Q}-${Z}-label`,`${Q}-${Z}-label--${j}`],attributes:{for:J.id},text:G}};if(K)z.children=K;if(j==="end"||j==="bottom")q.element.children.label=z;else{let W={...q.element.children};q.element.children={label:z,...W}}return{...$,schema:q}}catch(Q){return console.warn("Error enhancing schema with label:",Q),$}};Q$();var A7=()=>(J)=>{if(!J.schema)return J;try{let $=d0(J.schema),Q=$.getAll(),Z=J.config?.parent;if(typeof Z==="string")Z=document.querySelector(Z);if(Z&&$.element)Z.appendChild($.element);return{...J,element:$.element,components:Q}}catch($){throw console.error("Failed to create DOM structure:",$),new Error(`Failed to create component DOM: ${$.message}`)}};var g8=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(Z){if(Q.scrollable=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(Z){if(Q.vertical=Z,$.element)if(Z)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var d8=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((Z)=>{this.chips?.addChip?.(Z)})}}};var K5={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},G5={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},M9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var l8=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize chips controller: missing element or components"),$;let Q={change:[],add:[],remove:[]},Z=-1,q=(k,...N)=>{if(Q[k])Q[k].forEach((F)=>F(...N))},j=(k)=>{if(k.isSelected())k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true");else k.element.classList.remove(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((O)=>{if(O!==k&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false")}),!k.isSelected()&&U().length===0)k.setSelected(!0),k.element.classList.add(`${$.getClass("chip")}--selected`),k.element.setAttribute("aria-selected","true")}let F=$.chipInstances.filter((O)=>O.isSelected()).map((O)=>O.getValue()),V=k?k.getValue():null;if(typeof J.onChange==="function")J.onChange(F,V);q(M9.CHANGE,F,V)},G=(k)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(k.key))return;if(k.key==="Enter"||k.key===" "){if(Z>=0&&Z<$.chipInstances.length){k.preventDefault();let N=$.chipInstances[Z];if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(k.key)){k.preventDefault();let N=$.layout&&$.layout.isVertical(),F=Z;if(Z===-1)F=0;else if(N&&k.key==="ArrowUp"||!N&&k.key==="ArrowLeft")F=Math.max(0,Z-1);else if(N&&k.key==="ArrowDown"||!N&&k.key==="ArrowRight")F=Math.min($.chipInstances.length-1,Z+1);if(F!==Z){if(Z>=0&&Z<$.chipInstances.length)$.chipInstances[Z].element.blur();if(Z=F,$.chipInstances[Z].element.focus(),$.layout&&$.layout.isScrollable())K(Z)}}},K=(k)=>{if(!($.layout&&$.layout.isScrollable()))return;let F=typeof k==="number"?k:$.chipInstances.indexOf(k);if(F>=0&&F<$.chipInstances.length){let V=$.chipInstances[F].element,O=$.components.chipContainer||$.element,P=O.getBoundingClientRect(),L=V.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=V.offsetTop-O.offsetTop-P.height/2+L.height/2;O.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=V.offsetLeft-O.offsetLeft-P.width/2+L.width/2;O.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},z=(k)=>{let N=Y$({...k,onSelect:k.onSelect}),F=$.components.chipContainer||$.element,V=document.createDocumentFragment();return V.appendChild(N.element),F.appendChild(V),$.chipInstances.push(N),N.element.addEventListener("click",()=>{if(!N.isDisabled()){if(N.toggleSelected(),N.isSelected())N.element.classList.add(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","true");else N.element.classList.remove(`${$.getClass("chip")}--selected`),N.element.setAttribute("aria-selected","false");j(N),Z=$.chipInstances.indexOf(N)}}),N.element.addEventListener("keydown",G),q(M9.ADD,N),N},W=(k)=>{let N=typeof k==="number"?k:$.chipInstances.indexOf(k);if(N>=0&&N<$.chipInstances.length){let F=$.chipInstances[N];if(q(M9.REMOVE,F),F.destroy(),$.chipInstances.splice(N,1),N===Z)Z=-1;else if(N<Z)Z--}},Y=()=>{return[...$.chipInstances]},U=()=>{return $.chipInstances.filter((k)=>k.isSelected())},X=()=>{return U().map((k)=>k.getValue())},_=(k,N=!0,F=!J.multiSelect)=>{let V=Array.isArray(k)?k:[k],O=!1;if(F)$.chipInstances.forEach((P)=>{if(!V.includes(P.getValue())&&P.isSelected())P.setSelected(!1),P.element.classList.remove(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","false"),O=!0});if($.chipInstances.forEach((P)=>{if(V.includes(P.getValue())&&!P.isSelected())P.setSelected(!0),P.element.classList.add(`${$.getClass("chip")}--selected`),P.element.setAttribute("aria-selected","true"),O=!0}),O&&N){let P=X();q(M9.CHANGE,P,null)}},H=(k=!0)=>{let F=X().length>0;if($.chipInstances.forEach((V)=>{V.setSelected(!1),V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false")}),F&&k)q(M9.CHANGE,[],null)},B=()=>{$.chipInstances.forEach((k)=>{k.element.addEventListener("keydown",G)})},M=()=>{$.chipInstances.forEach((k)=>{k.element.removeEventListener("keydown",G)})};if(B(),$.element)$.element.addEventListener("keydown",G);if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((N)=>{N.element.removeEventListener("keydown",G)}),$.chipInstances.forEach((N)=>N.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((N)=>{Q[N]=[]}),k()}}return{...$,chips:{addChip:z,removeChip:W,getChips:Y,getSelectedChips:U,getSelectedValues:X,selectByValue:_,clearSelection:H,scrollToChip:K},keyboard:{enable:B,disable:M},on(k,N){if(!Q[k])Q[k]=[];return Q[k].push(N),this},off(k,N){if(Q[k]){let F=Q[k].indexOf(N);if(F!==-1)Q[k].splice(F,1)}return this}}};var z5=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,Z=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,Z);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,Z){if(J.events&&typeof J.events.on==="function")J.events.on(Q,Z);return this},off(Q,Z){if(J.events&&typeof J.events.off==="function")J.events.off(Q,Z);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};t();function W5(J,$){let Q=(z)=>J.getClass(z),Z=$.scrollable===!0,q=$.vertical===!0,j=$.multiSelect===!0,G=$.label&&$.label.trim().length>0,K=$.labelPosition||"start";return{element:{options:{className:[Q("chips"),Z?Q("chips--scrollable"):null,q?Q("chips--vertical"):null,G?Q("chips--with-label"):null,G&&K==="end"?Q("chips--label-end"):null,$.class].filter(Boolean),attributes:{role:"group","aria-multiselectable":j?"true":"false"}},children:{...G?{label:{options:{tag:"label",className:Q("chips-label"),text:$.label}}}:{},chipContainer:{options:{className:Q("chips-container")}}}}}}var Cq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},Y5=(J={})=>{let $=u(Cq,J,"chips"),Q={componentName:"chips",config:$,getClass:(Z)=>{let q=$.prefix||"mtrl";return Z?`${q}-${Z}`:q}};return $.schema=W5(Q,$),$};var U5=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Eq=(J={})=>{let $=Y5(J);try{let Q=b(S,d(),P7($),g8($),R7($),d8($),A7(),l8($),C())($),Z=U5(Q),q=z5(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},hq=Eq;w6();J6();c();o();var X5=["S","M","T","W","T","F","S"],U$=["January","February","March","April","May","June","July","August","September","October","November","December"],X$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r8="MM/DD/YYYY",B5="today",B$="selected",F5="outside-month",H5="range-start",k5="range-end",M5="range-middle";var T6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},N9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",Z=0;while(Z<$.length)if($.substring(Z,Z+4)==="MMMM")Q+=U$[J.getMonth()],Z+=4;else if($.substring(Z,Z+3)==="MMM")Q+=X$[J.getMonth()],Z+=3;else if($.substring(Z,Z+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="M")Q+=J.getMonth()+1,Z+=1;else if($.substring(Z,Z+4)==="YYYY")Q+=J.getFullYear(),Z+=4;else if($.substring(Z,Z+2)==="YY")Q+=J.getFullYear().toString().slice(-2),Z+=2;else if($.substring(Z,Z+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),Z+=2;else if($.substring(Z,Z+1)==="D")Q+=J.getDate(),Z+=1;else Q+=$[Z],Z+=1;return Q},V5=(J,$)=>{return new Date(J,$+1,0).getDate()},uq=(J,$)=>{return new Date(J,$,1).getDay()},V9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},fq=(J,$,Q)=>{let Z=J.getTime();return Z>=$.getTime()&&Z<=Q.getTime()},N5=(J,$,Q=null,Z=null,q=null,j=null)=>{let G=new Date;G.setHours(0,0,0,0);let K=[],z=uq(J,$),W=V5(J,$-1);for(let _=z-1;_>=0;_--){let H=new Date(J,$-1,W-_),B=q&&H<q||j&&H>j;K.push({date:H,day:H.getDate(),isCurrentMonth:!1,isToday:V9(H,G),isSelected:Q?V9(H,Q):!1,isDisabled:B})}let Y=V5(J,$);for(let _=1;_<=Y;_++){let H=new Date(J,$,_),B=Q?V9(H,Q):!1,M=q&&H<q||j&&H>j,k={date:H,day:_,isCurrentMonth:!0,isToday:V9(H,G),isSelected:B,isDisabled:M};if(Q&&Z)k.isRangeStart=V9(H,Q),k.isRangeEnd=V9(H,Z),k.isRangeMiddle=fq(H,Q,Z)&&!k.isRangeStart&&!k.isRangeEnd;K.push(k)}let X=42-K.length;for(let _=1;_<=X;_++){let H=new Date(J,$+1,_),B=q&&H<q||j&&H>j;K.push({date:H,day:_,isCurrentMonth:!1,isToday:V9(H,G),isSelected:Q?V9(H,Q):!1,isDisabled:B})}return K},_5=(J,$=10)=>{let Q=[],Z=J-$,q=J+$;for(let j=Z;j<=q;j++)Q.push(j);return Q};var p8=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var L5=(J,{disabled:$,lifecycle:Q,events:Z})=>(q)=>{let j={goToDate(G){let K=T6(G);if(!K)return;J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextMonth(){let G=p8(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},prevMonth(){let G=p8(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...q,element:q.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),Z.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),Z.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(G){if(Array.isArray(G)&&J.selectionMode==="range"){let z=T6(G[0]),W=T6(G[1]);if(z&&W){if(J.selectedDate=z,J.rangeEndDate=W,z>W)J.selectedDate=W,J.rangeEndDate=z;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let K=T6(G);if(K){if(J.selectedDate=K,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar();Z.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let G=N9(J.selectedDate,J.dateFormat),K=N9(J.rangeEndDate,J.dateFormat);return`${G} - ${K}`}return N9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return Z.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(G){let K=T6(G);if(K){if(J.minDate=K,J.isOpen)J.updateCalendar()}return this},setMaxDate(G){let K=T6(G);if(K){if(J.maxDate=K,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(G,K){return Z.on(G,K),this},off(G,K){return Z.off(G,K),this}}};t();var gq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:r8,animate:!0},D5=(J={})=>{let $=u(gq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},O5=(J)=>{return p(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},P5=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return p(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},R5=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},A5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});A6();var dq=({currentMonth:J,currentYear:$,currentView:Q,prefix:Z,emit:q})=>{let j=v({tag:"div",className:`${Z}-datepicker-header`}),G=v({tag:"button",className:`${Z}-datepicker-month-selector`,text:U$[J],attributes:{type:"button","aria-label":"Select month"}}),K=v({tag:"button",className:`${Z}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),z=v({tag:"div",className:`${Z}-datepicker-nav-controls`}),W=v({tag:"button",className:`${Z}-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":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),Y=v({tag:"button",className:`${Z}-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":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return G.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"month"})}),K.addEventListener("click",(U)=>{U.stopPropagation(),q("viewChange",{view:"year"})}),W.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("prevMonth");else if(Q==="month")q("prevYear");else q("prevYearRange")}),Y.addEventListener("click",(U)=>{if(U.stopPropagation(),Q==="day")q("nextMonth");else if(Q==="month")q("nextYear");else q("nextYearRange")}),j.appendChild(G),j.appendChild(K),z.appendChild(W),z.appendChild(Y),j.appendChild(z),j},lq=(J)=>{let $=v({tag:"div",className:`${J}-datepicker-weekdays`});return X5.forEach((Q)=>{let Z=v({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(Z)}),$},rq=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:Z,minDate:q,maxDate:j,prefix:G,emit:K})=>{let z=v({tag:"div",className:`${G}-datepicker-days`});return N5(J,$,Q,Z,q,j).forEach((Y)=>{let U=[`${G}-datepicker-day`,Y.isCurrentMonth?"":F5,Y.isToday?B5:"",Y.isSelected?B$:"",Y.isDisabled?"disabled":"",Y.isRangeStart?H5:"",Y.isRangeEnd?k5:"",Y.isRangeMiddle?M5:""].filter(Boolean).join(" "),X=v({tag:"button",className:U,text:Y.day.toString(),attributes:{type:"button","aria-label":Y.date.toLocaleDateString(),"aria-selected":Y.isSelected?"true":"false","aria-disabled":Y.isDisabled?"true":"false","data-date":Y.date.toISOString(),disabled:Y.isDisabled}});X.addEventListener("click",(_)=>{if(_.stopPropagation(),!Y.isDisabled)K("dateSelected",{date:Y.date})}),z.appendChild(X)}),z},pq=({currentMonth:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-months`});return X$.forEach((q,j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-month ${G?B$:""}`,text:q,attributes:{type:"button","aria-selected":G?"true":"false","data-month":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("monthSelected",{month:j})}),Z.appendChild(K)}),Z},sq=({currentYear:J,prefix:$,emit:Q})=>{let Z=v({tag:"div",className:`${$}-datepicker-years`});return _5(J,10).forEach((j)=>{let G=j===J,K=v({tag:"button",className:`${$}-datepicker-year ${G?B$:""}`,text:j.toString(),attributes:{type:"button","aria-selected":G?"true":"false","data-year":j.toString()}});K.addEventListener("click",(z)=>{z.stopPropagation(),Q("yearSelected",{year:j})}),Z.appendChild(K)}),Z},mq=({prefix:J,emit:$})=>{let Q=v({tag:"div",className:`${J}-datepicker-footer`}),Z=v({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),q=v({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return Z.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),q.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(Z),Q.appendChild(q),Q},w5=(J,$)=>{let{prefix:Q,currentView:Z,currentMonth:q,currentYear:j,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,variant:Y}=J,U=v({tag:"div",className:`${Q}-datepicker-calendar-content`}),X=dq({currentMonth:q,currentYear:j,currentView:Z,prefix:Q,emit:$});if(U.appendChild(X),Z==="day"){let _=lq(Q);U.appendChild(_);let H=rq({currentYear:j,currentMonth:q,selectedDate:G,rangeEndDate:K,minDate:z,maxDate:W,prefix:Q,emit:$});U.appendChild(H)}else if(Z==="month"){let _=pq({currentMonth:q,prefix:Q,emit:$});U.appendChild(_)}else if(Z==="year"){let _=sq({currentYear:j,prefix:Q,emit:$});U.appendChild(_)}if(Y!=="docked"){let _=mq({prefix:Q,emit:$});U.appendChild(_)}return U};A6();var aq=(J={})=>{let $=D5(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?T6($.minDate):null,maxDate:$.maxDate?T6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||f,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let G=N9(this.selectedDate,this.dateFormat),K=N9(this.rangeEndDate,this.dateFormat);this.input.value=`${G} - ${K}`;return}this.input.value=N9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let G=w5(this,(K,z)=>{switch(K){case"dateSelected":this.handleDateSelection(z.date);break;case"monthSelected":this.currentMonth=z.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=z.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=z.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(G)},handleDateSelection(G){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=G,this.rangeEndDate=null;else{if(G<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=G;else this.rangeEndDate=G;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=G,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),Z.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($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let G=T6($.value[0]),K=T6($.value[1]);if(G&&K)Q.selectedDate=G,Q.rangeEndDate=K,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}else{let G=T6($.value);if(G)Q.selectedDate=G,Q.currentMonth=G.getMonth(),Q.currentYear=G.getFullYear()}let Z=b(S,d(),h(O5($)),G6($),C())($),q=b(S,h(P5($)))($);Q.input=q.element,Z.element.appendChild(Q.input),Q.updateInputValue();let j=R5($);return Q.calendarElement=v({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",Z.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!Z.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)Z.emit("open",{value:Q.selectedDate});else Z.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(G)=>{G.stopPropagation()}),document.addEventListener("click",(G)=>{if(Q.isOpen&&!Z.element.contains(G.target))Q.isOpen=!1,Q.render(),Z.emit("close",{value:Q.selectedDate})}),L5(Q,A5(Z))(Z)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},x5=aq;J6();c();o();t();var cq={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},y5=(J={})=>u(cq,J,"dialog"),T5=(J)=>{return p(J,{tag:"div",attributes:{},className:J.class})},I5=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},S5=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});T9();J6();t();var iq={orientation:"horizontal",variant:"full-width",thickness:1},b5=(J={})=>{return u(iq,J,"divider")};var v5=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let Z=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%";else $.element.style.width=`${Z}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(q){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`),q==="horizontal")$.element.style.height=`${Z}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${Z}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},C5=(J)=>($)=>{let Q=J.variant||"full-width",Z=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(Z==="horizontal"){let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${q}px`,$.element.style.marginRight=`${j}px`}else{let q=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${q}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(q){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${q}`);let j=$.getOrientation?$.getOrientation():Z;if(q==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let G=J.insetStart!==void 0?J.insetStart:16,K=J.insetEnd!==void 0?J.insetEnd:q==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${G}px`,$.element.style.marginRight=`${K}px`;else $.element.style.marginTop=`${G}px`,$.element.style.marginBottom=`${K}px`}return this},setInset(q,j){let G=$.getOrientation?$.getOrientation():Z;if(($.getVariant?$.getVariant():Q)!=="full-width")if(G==="horizontal"){if(q!==void 0)$.element.style.marginLeft=`${q}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(q!==void 0)$.element.style.marginTop=`${q}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},E5=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,Z=J.orientation||"horizontal";if(Z==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(q){if(($.getOrientation?$.getOrientation():Z)==="horizontal")$.element.style.height=`${q}px`;else $.element.style.width=`${q}px`;return this},setColor(q){return $.element.style.backgroundColor=q,this}}};var c9=(J={})=>{let $=b5(J);return b(S,h({tag:"hr",componentName:"divider",className:J.class}),v5($),K6($),C5($),E5($))($)};R9();var i9={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},h5=(J)=>($)=>{let Q=I5(J),Z=document.createElement(Q.tag||"div");if(Z.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([M,k])=>{if(M&&typeof M==="string"&&k!==void 0)Z.setAttribute(M,String(k))});if(J.zIndex)Z.style.zIndex=String(J.zIndex);let q=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-header"));let k=document.createElement("div");if(k.classList.add($.getClass("dialog-header-content")),M.appendChild(k),J.title){let N=document.createElement("h2");N.classList.add($.getClass("dialog-header-title")),N.textContent=J.title,k.appendChild(N)}if(J.subtitle){let N=document.createElement("p");N.classList.add($.getClass("dialog-header-subtitle")),N.textContent=J.subtitle,k.appendChild(N)}if(J.closeButton!==!1){let N=document.createElement("button");N.classList.add($.getClass("dialog-header-close")),N.setAttribute("aria-label","Close dialog"),N.innerHTML=`
13
+ `,$.element.appendChild(Q),$},YQ=(J)=>($)=>{let Q=J.labelPosition||"end",q=`${J.prefix}-checkbox--label-${Q}`;return $.element.classList.add(q),$},zQ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var wq=(J,$)=>{let Q=T9($)(J);if($.indeterminate)Q.input.indeterminate=!0;return Q.setIndeterminate=(q)=>{return Q.input.indeterminate=q,Q.element.classList.toggle(`${$.prefix}-checkbox--indeterminate`,q),Q},Q},xq=(J={})=>{let $=jQ(J);try{return I(T,h(),S(KQ($)),x9($),GQ($),d6($),YQ($),(q)=>wq(q,$),Y6($),b(),(q)=>ZQ(zQ(q))(q))($)}catch(Q){throw console.error("Checkbox creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create checkbox: ${Q instanceof Error?Q.message:String(Q)}`)}},WQ=xq;var E$={FILLED:"filled",OUTLINED:"outlined"},h$={START:"start",END:"end"},UQ={CHECKED:"checked",INDETERMINATE:"indeterminate",DISABLED:"disabled",FOCUSED:"focused"},XQ={ROOT:"checkbox",INPUT:"checkbox-input",ICON:"checkbox-icon",LABEL:"checkbox-label"};n();s();i();var BQ=({disabled:J,lifecycle:$})=>(Q)=>{let q=Q.element.classList.contains(`${Q.getClass("chip")}--selected`),Z=Q.element.getAttribute("data-value")||null;return{...Q,element:Q.element,getValue(){let j=Q.element.getAttribute("data-value");if(j!==null)return Z=j,j;if(Z!==null)return Q.element.setAttribute("data-value",Z),Z;let K=Q.element.querySelector(`.${Q.getClass("chip")}-text`);if(K&&K.textContent){let G=K.textContent;if(G.includes(" Theme"))Z=G.replace(" Theme","").toLowerCase();else Z=G.toLowerCase().replace(/\s+/g,"-");return Q.element.setAttribute("data-value",Z),Z}return null},setValue(j){if(j!==null&&j!==void 0)Z=j,Q.element.setAttribute("data-value",j);else Z=null,Q.element.removeAttribute("data-value");return this},isDisabled(){return Q.element.getAttribute("aria-disabled")==="true"},enable(){return J.enable(),Q.element.classList.remove(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","false"),Q.element.setAttribute("tabindex","0"),this},disable(){return J.disable(),Q.element.classList.add(`${Q.getClass("chip")}--disabled`),Q.element.setAttribute("aria-disabled","true"),Q.element.setAttribute("tabindex","-1"),this},setText(j){let K=`.${Q.getClass("chip")}-content`,G=Q.element.querySelector(K)||Q.element,Y=`.${Q.getClass("chip")}-text`,z=Q.element.querySelector(Y);if(!z&&j){z=document.createElement("span"),z.className=`${Q.getClass("chip")}-text`;let W=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);if(W)G.insertBefore(z,W.nextSibling);else G.insertBefore(z,G.firstChild)}if(z){if(z.textContent=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},getText(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-text`);return j?j.textContent||"":""},setIcon(j){return this.setLeadingIcon(j)},getIcon(){let j=Q.element.querySelector(`.${Q.getClass("chip")}-leading-icon`);return j?j.innerHTML:""},setLeadingIcon(j){let K=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,G=`.${Q.getClass("chip")}-leading-icon`,Y=Q.element.querySelector(G);if(!Y&&j)Y=document.createElement("span"),Y.className=`${Q.getClass("chip")}-leading-icon`,K.insertBefore(Y,K.firstChild);if(Y){if(Y.innerHTML=j||"",!j&&Y.parentNode)Y.parentNode.removeChild(Y)}return this},setTrailingIcon(j,K){let G=Q.element.querySelector(`.${Q.getClass("chip")}-content`)||Q.element,Y=`.${Q.getClass("chip")}-trailing-icon`,z=Q.element.querySelector(Y);if(!z&&j){if(z=document.createElement("span"),z.className=`${Q.getClass("chip")}-trailing-icon`,G.appendChild(z),K)z.addEventListener("click",(W)=>{W.stopPropagation(),K(this)})}if(z){if(z.innerHTML=j||"",!j&&z.parentNode)z.parentNode.removeChild(z)}return this},isSelected(){return q},setSelected(j){if(q=!!j,j)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");else Q.element.classList.remove(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","false");return this},toggleSelected(){return this.setSelected(!q)},destroy(){$.destroy()}}};c();var Tq={variant:"filled",ripple:!0},FQ=(J={})=>C(Tq,J,"chip"),HQ=(J)=>{let $={role:"button",tabindex:"0"};if(J.disabled===!0)$["aria-disabled"]="true";if(J.selected===!0)$["aria-selected"]="true";else if(J.selected===!1)$["aria-selected"]="false";let Q=[J.class,J.selected?`${J.prefix}-chip--selected`:null];return f(J,{tag:"div",attributes:$,className:Q,forwardEvents:{click:(q)=>q.element.getAttribute("aria-disabled")!=="true",keydown:(q,Z)=>{if(Z.key===" "||Z.key==="Enter")return Z.preventDefault(),q.element.click(),!0;return!1},focus:!0,blur:!0}})},MQ=(J)=>({disabled:{enable:()=>J.disabled?.enable(),disable:()=>J.disabled?.disable()},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Iq=(J={})=>{let $=FQ(J);try{let Q=I(T,h(),S(HQ($)),G6($),Y6($),A6($),b())($),q=document.createElement("div");if(q.className=`${Q.getClass("chip")}-content`,q.style.display="flex",q.style.alignItems="center",q.style.gap="8px",q.style.width="100%",Q.element.appendChild(q),J.leadingIcon||J.icon){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-leading-icon`,j.innerHTML=J.leadingIcon||J.icon||"",q.appendChild(j)}if(J.text){let j=document.createElement("span");j.className=`${Q.getClass("chip")}-text`,j.textContent=J.text,q.appendChild(j)}if(J.trailingIcon){let j=document.createElement("span");if(j.className=`${Q.getClass("chip")}-trailing-icon`,j.innerHTML=J.trailingIcon,J.onTrailingIconClick)j.addEventListener("click",(K)=>{K.stopPropagation(),J.onTrailingIconClick(Q)});q.appendChild(j)}if(J.selected)Q.element.classList.add(`${Q.getClass("chip")}--selected`),Q.element.setAttribute("aria-selected","true");if(J.value)Q.element.setAttribute("data-value",J.value);let Z=BQ(MQ(Q))(Q);if(!Q.element.hasAttribute("data-value")&&J.text)Z.getValue();if(J.variant==="filter"||J.variant==="assist"||J.variant==="suggestion"||J.selectable)Q.element.addEventListener("click",()=>{if(Z.isDisabled())return;let j=Z.isSelected();Z.toggleSelected();let K=Z.isSelected();if(J.onChange&&j!==K)J.onChange(K,Z);if(J.onSelect)J.onSelect(Z)});return Z}catch(Q){throw console.error("Chip creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},g7=Iq;s();i();var u$=(J)=>($)=>{let Q={scrollable:J.scrollable===!0,vertical:J.vertical===!0};return{...$,layout:{setScrollable(q){if(Q.scrollable=q,$.element)if(q)$.element.classList.add(`${$.getClass("chips")}--scrollable`);else $.element.classList.remove(`${$.getClass("chips")}--scrollable`);return this},isScrollable(){return Q.scrollable},setVertical(q){if(Q.vertical=q,$.element)if(q)$.element.classList.add(`${$.getClass("chips")}--vertical`);else $.element.classList.remove(`${$.getClass("chips")}--vertical`);return this},isVertical(){return Q.vertical}}}};var f$=(J)=>($)=>{return{...$,chipInstances:[],onCreated(){if(typeof $.onCreated==="function")$.onCreated();if(Array.isArray(J.chips)&&J.chips.length>0)J.chips.forEach((q)=>{this.chips?.addChip?.(q)})}}};var kQ={FILLED:"filled",OUTLINED:"outlined",ELEVATED:"elevated",ASSIST:"assist",FILTER:"filter",INPUT:"input",SUGGESTION:"suggestion"},NQ={CHANGE:"change",SELECT:"select",DESELECT:"deselect",REMOVE:"remove"},j9={CHANGE:"change",ADD:"add",REMOVE:"remove"};var g$=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize chips controller: missing element"),$;let Q={change:[],add:[],remove:[]},q=-1,Z=(L,...D)=>{if(Q[L])Q[L].forEach((B)=>B(...D))},j=(L)=>{if(L.isSelected())L.element.classList.add(`${$.getClass("chip")}--selected`),L.element.setAttribute("aria-selected","true");else L.element.classList.remove(`${$.getClass("chip")}--selected`),L.element.setAttribute("aria-selected","false");if(!J.multiSelect){if($.chipInstances.forEach((V)=>{if(V!==L&&V.isSelected())V.setSelected(!1),V.element.classList.remove(`${$.getClass("chip")}--selected`),V.element.setAttribute("aria-selected","false")}),!L.isSelected()&&X().length===0)L.setSelected(!0),L.element.classList.add(`${$.getClass("chip")}--selected`),L.element.setAttribute("aria-selected","true")}let B=$.chipInstances.filter((V)=>V.isSelected()).map((V)=>V.getValue()),H=L?L.getValue():null;if(typeof J.onChange==="function")J.onChange(B,H);Z(j9.CHANGE,B,H)},K=(L)=>{if($.chipInstances.length===0)return;if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Enter"," "].includes(L.key))return;if(L.key==="Enter"||L.key===" "){if(q>=0&&q<$.chipInstances.length){L.preventDefault();let D=$.chipInstances[q];if(!D.isDisabled()){if(D.toggleSelected(),D.isSelected())D.element.classList.add(`${$.getClass("chip")}--selected`),D.element.setAttribute("aria-selected","true");else D.element.classList.remove(`${$.getClass("chip")}--selected`),D.element.setAttribute("aria-selected","false");j(D)}return}}if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(L.key)){L.preventDefault();let D=$.layout&&$.layout.isVertical(),B=q;if(q===-1)B=0;else if(D&&L.key==="ArrowUp"||!D&&L.key==="ArrowLeft")B=Math.max(0,q-1);else if(D&&L.key==="ArrowDown"||!D&&L.key==="ArrowRight")B=Math.min($.chipInstances.length-1,q+1);if(B!==q){if(q>=0&&q<$.chipInstances.length)$.chipInstances[q].element.blur();if(q=B,$.chipInstances[q].element.focus(),$.layout&&$.layout.isScrollable())G(q)}}},G=(L)=>{if(!($.layout&&$.layout.isScrollable()))return;let B=typeof L==="number"?L:$.chipInstances.indexOf(L);if(B>=0&&B<$.chipInstances.length){let H=$.chipInstances[B].element,V=$.chipContainer||$.element,O=V.getBoundingClientRect(),M=H.getBoundingClientRect();if($.layout&&$.layout.isVertical()){let R=H.offsetTop-V.offsetTop-O.height/2+M.height/2;V.scrollTo({top:Math.max(0,R),behavior:"smooth"})}else{let R=H.offsetLeft-V.offsetLeft-O.width/2+M.width/2;V.scrollTo({left:Math.max(0,R),behavior:"smooth"})}}},Y=(L)=>{let D=g7({...L,onSelect:L.onSelect}),B=$.chipContainer||$.element,H=document.createDocumentFragment();return H.appendChild(D.element),B.appendChild(H),$.chipInstances.push(D),D.element.addEventListener("click",()=>{if(!D.isDisabled()){if(D.toggleSelected(),D.isSelected())D.element.classList.add(`${$.getClass("chip")}--selected`),D.element.setAttribute("aria-selected","true");else D.element.classList.remove(`${$.getClass("chip")}--selected`),D.element.setAttribute("aria-selected","false");j(D),q=$.chipInstances.indexOf(D)}}),D.element.addEventListener("keydown",K),Z(j9.ADD,D),D},z=(L)=>{let D=typeof L==="number"?L:$.chipInstances.indexOf(L);if(D>=0&&D<$.chipInstances.length){let B=$.chipInstances[D];if(Z(j9.REMOVE,B),B.destroy(),$.chipInstances.splice(D,1),D===q)q=-1;else if(D<q)q--}},W=()=>{return[...$.chipInstances]},X=()=>{return $.chipInstances.filter((L)=>L.isSelected())},U=()=>{return X().map((L)=>L.getValue())},_=(L,D=!0,B=!J.multiSelect)=>{let H=Array.isArray(L)?L:[L],V=!1;if(B)$.chipInstances.forEach((O)=>{if(!H.includes(O.getValue())&&O.isSelected())O.setSelected(!1),O.element.classList.remove(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","false"),V=!0});if($.chipInstances.forEach((O)=>{if(H.includes(O.getValue())&&!O.isSelected())O.setSelected(!0),O.element.classList.add(`${$.getClass("chip")}--selected`),O.element.setAttribute("aria-selected","true"),V=!0}),V&&D){let O=U();Z(j9.CHANGE,O,null)}},N=(L=!0)=>{let B=U().length>0;if($.chipInstances.forEach((H)=>{H.setSelected(!1),H.element.classList.remove(`${$.getClass("chip")}--selected`),H.element.setAttribute("aria-selected","false")}),B&&L)Z(j9.CHANGE,[],null)},F=()=>{$.chipInstances.forEach((L)=>{L.element.addEventListener("keydown",K)})},k=()=>{$.chipInstances.forEach((L)=>{L.element.removeEventListener("keydown",K)})};if(F(),$.element)$.element.addEventListener("keydown",K);if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{$.chipInstances.forEach((D)=>{D.element.removeEventListener("keydown",K)}),$.chipInstances.forEach((D)=>D.destroy()),$.chipInstances.length=0,Object.keys(Q).forEach((D)=>{Q[D]=[]}),L()}}return{...$,chips:{addChip:Y,removeChip:z,getChips:W,getSelectedChips:X,getSelectedValues:U,selectByValue:_,clearSelection:N,scrollToChip:G},keyboard:{enable:F,disable:k},on(L,D){if(!Q[L])Q[L]=[];return Q[L].push(D),this},off(L,D){if(Q[L]){let B=Q[L].indexOf(D);if(B!==-1)Q[L].splice(B,1)}return this}}};S6();var d$=(J)=>($)=>{let Q=(G)=>$.getClass(G),q=J.label&&J.label.trim().length>0,Z=J.labelPosition||"start",j;if(q)j=E({tag:"label",className:Q("chips-label"),text:J.label,container:$.element});let K=E({tag:"div",className:Q("chips-container"),container:$.element});return{...$,chipContainer:K,label:j,getChipContainer:()=>K,getLabel:()=>j||null}};var LQ=(J)=>($)=>{return{...$,element:$.element,addChip(Q){if(J.chips&&typeof J.chips.addChip==="function")J.chips.addChip(Q);return this},removeChip(Q){if(J.chips&&typeof J.chips.removeChip==="function")J.chips.removeChip(Q);return this},getChips(){if(J.chips&&typeof J.chips.getChips==="function")return J.chips.getChips();return[]},getSelectedChips(){if(J.chips&&typeof J.chips.getSelectedChips==="function")return J.chips.getSelectedChips();return[]},getSelectedValues(){if(J.chips&&typeof J.chips.getSelectedValues==="function")return J.chips.getSelectedValues();return[]},selectByValue(Q,q=!0){if(J.chips&&typeof J.chips.selectByValue==="function")J.chips.selectByValue(Q,q);return this},clearSelection(){if(J.chips&&typeof J.chips.clearSelection==="function")J.chips.clearSelection();return this},setScrollable(Q){if(J.layout&&typeof J.layout.setScrollable==="function")J.layout.setScrollable(Q);return this},setVertical(Q){if(J.layout&&typeof J.layout.setVertical==="function")J.layout.setVertical(Q);return this},setLabel(Q){if(J.label&&typeof J.label.setText==="function")J.label.setText(Q);return this},getLabel(){if(J.label&&typeof J.label.getText==="function")return J.label.getText();return""},setLabelPosition(Q){if(J.label&&typeof J.label.setPosition==="function")J.label.setPosition(Q);return this},getLabelPosition(){if(J.label&&typeof J.label.getPosition==="function")return J.label.getPosition();return"start"},scrollToChip(Q){if(J.chips&&typeof J.chips.scrollToChip==="function")J.chips.scrollToChip(Q);return this},enableKeyboardNavigation(){if(J.keyboard&&typeof J.keyboard.enableKeyboardNavigation==="function")J.keyboard.enableKeyboardNavigation();return this},on(Q,q){if(J.events&&typeof J.events.on==="function")J.events.on(Q,q);return this},off(Q,q){if(J.events&&typeof J.events.off==="function")J.events.off(Q,q);return this},destroy(){if(J.lifecycle&&typeof J.lifecycle.destroy==="function")J.lifecycle.destroy()}}};c();var Sq={chips:[],scrollable:!1,vertical:!1,multiSelect:!1,onChange:null,selector:null,labelPosition:"start"},VQ=(J={})=>{return C(Sq,J,"chips")},_Q=(J)=>{let $=J.scrollable===!0,Q=J.vertical===!0,q=J.multiSelect===!0,Z=J.label&&J.label.trim().length>0,j=J.labelPosition||"start",K=["chips",J.class,$?"chips--scrollable":"",Q?"chips--vertical":"",Z?"chips--with-label":"",Z&&j==="end"?"chips--label-end":""].filter(Boolean).join(" ");return f(J,{tag:"div",attributes:{role:"group","aria-multiselectable":q?"true":"false"},className:K})},DQ=(J)=>({chips:{addChip:function($){if(J.chips&&typeof J.chips.addChip==="function")return J.chips.addChip($);return null},removeChip:($)=>J.chips?.removeChip?.($),getChips:()=>J.chips?.getChips?.()??[],getSelectedChips:()=>J.chips?.getSelectedChips?.()??[],getSelectedValues:()=>J.chips?.getSelectedValues?.()??[],selectByValue:($)=>J.chips?.selectByValue?.($),clearSelection:()=>J.chips?.clearSelection?.(),scrollToChip:($)=>J.chips?.scrollToChip?.($)},layout:{setScrollable:($)=>J.layout?.setScrollable?.($),isScrollable:()=>J.layout?.isScrollable?.()??!1,setVertical:($)=>J.layout?.setVertical?.($),isVertical:()=>J.layout?.isVertical?.()??!1},label:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??"",setPosition:($)=>J.label?.setPosition?.($),getPosition:()=>J.label?.getPosition?.()??"start"},keyboard:{enableKeyboardNavigation:()=>J.keyboard?.enable?.(),disableKeyboardNavigation:()=>J.keyboard?.disable?.()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var bq=(J={})=>{let $=VQ(J);try{let Q=I(T,h(),S(_Q($)),u$($),f$($),d$($),g$($),b())($),q=DQ(Q),Z=LQ(q)(Q);if($.on&&typeof Z.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")Z.on(j,K)});return Z}catch(Q){throw console.error("Chips creation error:",Q),new Error(`Failed to create chip: ${Q.message}`)}},vq=bq;y6();n();s();i();var OQ=["S","M","T","W","T","F","S"],d7=["January","February","March","April","May","June","July","August","September","October","November","December"],r7=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r$="MM/DD/YYYY",PQ="today",l7="selected",RQ="outside-month",yQ="range-start",AQ="range-end",wQ="range-middle";var P6=(J)=>{if(!J)return null;if(J instanceof Date)return isNaN(J.getTime())?null:J;if(typeof J==="string"){let $=new Date(J);return isNaN($.getTime())?null:$}return null},G9=(J,$="MM/DD/YYYY")=>{if(!J||!(J instanceof Date)||isNaN(J.getTime()))return"";let Q="",q=0;while(q<$.length)if($.substring(q,q+4)==="MMMM")Q+=d7[J.getMonth()],q+=4;else if($.substring(q,q+3)==="MMM")Q+=r7[J.getMonth()],q+=3;else if($.substring(q,q+2)==="MM")Q+=(J.getMonth()+1).toString().padStart(2,"0"),q+=2;else if($.substring(q,q+1)==="M")Q+=J.getMonth()+1,q+=1;else if($.substring(q,q+4)==="YYYY")Q+=J.getFullYear(),q+=4;else if($.substring(q,q+2)==="YY")Q+=J.getFullYear().toString().slice(-2),q+=2;else if($.substring(q,q+2)==="DD")Q+=J.getDate().toString().padStart(2,"0"),q+=2;else if($.substring(q,q+1)==="D")Q+=J.getDate(),q+=1;else Q+=$[q],q+=1;return Q},xQ=(J,$)=>{return new Date(J,$+1,0).getDate()},Cq=(J,$)=>{return new Date(J,$,1).getDay()},K9=(J,$)=>{return J.getDate()===$.getDate()&&J.getMonth()===$.getMonth()&&J.getFullYear()===$.getFullYear()},Eq=(J,$,Q)=>{let q=J.getTime();return q>=$.getTime()&&q<=Q.getTime()},TQ=(J,$,Q=null,q=null,Z=null,j=null)=>{let K=new Date;K.setHours(0,0,0,0);let G=[],Y=Cq(J,$),z=xQ(J,$-1);for(let _=Y-1;_>=0;_--){let N=new Date(J,$-1,z-_),F=Z&&N<Z||j&&N>j;G.push({date:N,day:N.getDate(),isCurrentMonth:!1,isToday:K9(N,K),isSelected:Q?K9(N,Q):!1,isDisabled:F})}let W=xQ(J,$);for(let _=1;_<=W;_++){let N=new Date(J,$,_),F=Q?K9(N,Q):!1,k=Z&&N<Z||j&&N>j,L={date:N,day:_,isCurrentMonth:!0,isToday:K9(N,K),isSelected:F,isDisabled:k};if(Q&&q)L.isRangeStart=K9(N,Q),L.isRangeEnd=K9(N,q),L.isRangeMiddle=Eq(N,Q,q)&&!L.isRangeStart&&!L.isRangeEnd;G.push(L)}let U=42-G.length;for(let _=1;_<=U;_++){let N=new Date(J,$+1,_),F=Z&&N<Z||j&&N>j;G.push({date:N,day:_,isCurrentMonth:!1,isToday:K9(N,K),isSelected:Q?K9(N,Q):!1,isDisabled:F})}return G},IQ=(J,$=10)=>{let Q=[],q=J-$,Z=J+$;for(let j=q;j<=Z;j++)Q.push(j);return Q};var l$=(J,$)=>{let Q=new Date(J);return Q.setMonth(Q.getMonth()+$),Q};var SQ=(J,{disabled:$,lifecycle:Q,events:q})=>(Z)=>{let j={goToDate(K){let G=P6(K);if(!G)return;J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar()},nextMonth(){let K=l$(new Date(J.currentYear,J.currentMonth,1),1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},prevMonth(){let K=l$(new Date(J.currentYear,J.currentMonth,1),-1);J.currentMonth=K.getMonth(),J.currentYear=K.getFullYear(),J.updateCalendar()},nextYear(){J.currentYear+=1,J.updateCalendar()},prevYear(){J.currentYear-=1,J.updateCalendar()},showDayView(){J.currentView="day",J.updateCalendar()},showMonthView(){J.currentView="month",J.updateCalendar()},showYearView(){J.currentView="year",J.updateCalendar()},getCurrentView(){return J.currentView}};return{...Z,element:Z.element,input:J.input,calendar:j,open(){return J.isOpen=!0,J.render(),q.emit("open",{value:this.getValue()}),this},close(){return J.isOpen=!1,J.render(),q.emit("close",{value:this.getValue()}),this},getValue(){if(!J.selectedDate)return null;if(J.selectionMode==="range"&&J.rangeEndDate)return[new Date(J.selectedDate),new Date(J.rangeEndDate)];return new Date(J.selectedDate)},setValue(K){if(Array.isArray(K)&&J.selectionMode==="range"){let Y=P6(K[0]),z=P6(K[1]);if(Y&&z){if(J.selectedDate=Y,J.rangeEndDate=z,Y>z)J.selectedDate=z,J.rangeEndDate=Y;if(J.updateInputValue(),J.isOpen)J.currentMonth=J.selectedDate.getMonth(),J.currentYear=J.selectedDate.getFullYear(),J.updateCalendar();q.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this}let G=P6(K);if(G){if(J.selectedDate=G,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.currentMonth=G.getMonth(),J.currentYear=G.getFullYear(),J.updateCalendar();q.emit("change",{value:this.getValue(),formattedValue:this.getFormattedValue()})}return this},getFormattedValue(){if(!J.selectedDate)return"";if(J.selectionMode==="range"&&J.rangeEndDate){let K=G9(J.selectedDate,J.dateFormat),G=G9(J.rangeEndDate,J.dateFormat);return`${K} - ${G}`}return G9(J.selectedDate,J.dateFormat)},clear(){if(J.selectedDate=null,J.rangeEndDate=null,J.updateInputValue(),J.isOpen)J.updateCalendar();return q.emit("change",{value:null,formattedValue:""}),this},enable(){return $.enable(),J.input.disabled=!1,this},disable(){return $.disable(),J.input.disabled=!0,this},setMinDate(K){let G=P6(K);if(G){if(J.minDate=G,J.isOpen)J.updateCalendar()}return this},setMaxDate(K){let G=P6(K);if(G){if(J.maxDate=G,J.isOpen)J.updateCalendar()}return this},destroy(){if(document.removeEventListener("click",J.outsideClickHandler),J.calendarElement&&J.calendarElement.parentNode)J.calendarElement.parentNode.removeChild(J.calendarElement);Q.destroy()},on(K,G){return q.on(K,G),this},off(K,G){return q.off(K,G),this}}};c();var hq={variant:"docked",initialView:"day",selectionMode:"single",dateFormat:r$,animate:!0},bQ=(J={})=>{let $=C(hq,J,"datepicker");if($.closeOnSelect===void 0)$.closeOnSelect=$.variant!=="docked";return $},vQ=(J)=>{return f(J,{tag:"div",attributes:{role:"application","aria-label":"Date Picker",tabindex:"-1"},className:[`${J.prefix}-datepicker-container`,J.class],forwardEvents:{keydown:!0,click:!0},interactive:!0})},CQ=(J)=>{let $={type:"text",placeholder:J.placeholder||J.dateFormat,autocomplete:"off",readonly:!0};if(J.disabled===!0)$.disabled=!0;return f(J,{tag:"input",attributes:$,className:`${J.prefix}-datepicker-input`,forwardEvents:{focus:!0,blur:!0,click:!0},interactive:!0})},EQ=(J)=>{return f(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant!=="docked"?"true":"false"},className:[`${J.prefix}-datepicker-calendar`,`${J.prefix}-datepicker-${J.variant}`,J.selectionMode==="range"?`${J.prefix}-datepicker-range`:""],forwardEvents:{keydown:!0,click:!0}})},hQ=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},events:{on:J.on,off:J.off,emit:J.emit}});S6();var uq=({currentMonth:J,currentYear:$,currentView:Q,prefix:q,emit:Z})=>{let j=E({tag:"div",className:`${q}-datepicker-header`}),K=E({tag:"button",className:`${q}-datepicker-month-selector`,text:d7[J],attributes:{type:"button","aria-label":"Select month"}}),G=E({tag:"button",className:`${q}-datepicker-year-selector`,text:$.toString(),attributes:{type:"button","aria-label":"Select year"}}),Y=E({tag:"div",className:`${q}-datepicker-nav-controls`}),z=E({tag:"button",className:`${q}-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":Q==="day"?"Previous month":Q==="month"?"Previous year":"Previous year range"}}),W=E({tag:"button",className:`${q}-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":Q==="day"?"Next month":Q==="month"?"Next year":"Next year range"}});return K.addEventListener("click",(X)=>{X.stopPropagation(),Z("viewChange",{view:"month"})}),G.addEventListener("click",(X)=>{X.stopPropagation(),Z("viewChange",{view:"year"})}),z.addEventListener("click",(X)=>{if(X.stopPropagation(),Q==="day")Z("prevMonth");else if(Q==="month")Z("prevYear");else Z("prevYearRange")}),W.addEventListener("click",(X)=>{if(X.stopPropagation(),Q==="day")Z("nextMonth");else if(Q==="month")Z("nextYear");else Z("nextYearRange")}),j.appendChild(K),j.appendChild(G),Y.appendChild(z),Y.appendChild(W),j.appendChild(Y),j},fq=(J)=>{let $=E({tag:"div",className:`${J}-datepicker-weekdays`});return OQ.forEach((Q)=>{let q=E({tag:"span",className:`${J}-datepicker-weekday`,text:Q});$.appendChild(q)}),$},gq=({currentYear:J,currentMonth:$,selectedDate:Q,rangeEndDate:q,minDate:Z,maxDate:j,prefix:K,emit:G})=>{let Y=E({tag:"div",className:`${K}-datepicker-days`});return TQ(J,$,Q,q,Z,j).forEach((W)=>{let X=[`${K}-datepicker-day`,W.isCurrentMonth?"":RQ,W.isToday?PQ:"",W.isSelected?l7:"",W.isDisabled?"disabled":"",W.isRangeStart?yQ:"",W.isRangeEnd?AQ:"",W.isRangeMiddle?wQ:""].filter(Boolean).join(" "),U=E({tag:"button",className:X,text:W.day.toString(),attributes:{type:"button","aria-label":W.date.toLocaleDateString(),"aria-selected":W.isSelected?"true":"false","aria-disabled":W.isDisabled?"true":"false","data-date":W.date.toISOString(),disabled:W.isDisabled}});U.addEventListener("click",(_)=>{if(_.stopPropagation(),!W.isDisabled)G("dateSelected",{date:W.date})}),Y.appendChild(U)}),Y},dq=({currentMonth:J,prefix:$,emit:Q})=>{let q=E({tag:"div",className:`${$}-datepicker-months`});return r7.forEach((Z,j)=>{let K=j===J,G=E({tag:"button",className:`${$}-datepicker-month ${K?l7:""}`,text:Z,attributes:{type:"button","aria-selected":K?"true":"false","data-month":j.toString()}});G.addEventListener("click",(Y)=>{Y.stopPropagation(),Q("monthSelected",{month:j})}),q.appendChild(G)}),q},rq=({currentYear:J,prefix:$,emit:Q})=>{let q=E({tag:"div",className:`${$}-datepicker-years`});return IQ(J,10).forEach((j)=>{let K=j===J,G=E({tag:"button",className:`${$}-datepicker-year ${K?l7:""}`,text:j.toString(),attributes:{type:"button","aria-selected":K?"true":"false","data-year":j.toString()}});G.addEventListener("click",(Y)=>{Y.stopPropagation(),Q("yearSelected",{year:j})}),q.appendChild(G)}),q},lq=({prefix:J,emit:$})=>{let Q=E({tag:"div",className:`${J}-datepicker-footer`}),q=E({tag:"button",className:`${J}-datepicker-cancel ${J}-button ${J}-button--text`,text:"Cancel",attributes:{type:"button"}}),Z=E({tag:"button",className:`${J}-datepicker-ok ${J}-button ${J}-button--text`,text:"OK",attributes:{type:"button"}});return q.addEventListener("click",(j)=>{j.stopPropagation(),$("cancel")}),Z.addEventListener("click",(j)=>{j.stopPropagation(),$("confirm")}),Q.appendChild(q),Q.appendChild(Z),Q},uQ=(J,$)=>{let{prefix:Q,currentView:q,currentMonth:Z,currentYear:j,selectedDate:K,rangeEndDate:G,minDate:Y,maxDate:z,variant:W}=J,X=E({tag:"div",className:`${Q}-datepicker-calendar-content`}),U=uq({currentMonth:Z,currentYear:j,currentView:q,prefix:Q,emit:$});if(X.appendChild(U),q==="day"){let _=fq(Q);X.appendChild(_);let N=gq({currentYear:j,currentMonth:Z,selectedDate:K,rangeEndDate:G,minDate:Y,maxDate:z,prefix:Q,emit:$});X.appendChild(N)}else if(q==="month"){let _=dq({currentMonth:Z,prefix:Q,emit:$});X.appendChild(_)}else if(q==="year"){let _=rq({currentYear:j,prefix:Q,emit:$});X.appendChild(_)}if(W!=="docked"){let _=lq({prefix:Q,emit:$});X.appendChild(_)}return X};S6();var pq=(J={})=>{let $=bQ(J);try{let Q={isOpen:!1,selectedDate:null,rangeEndDate:null,currentView:$.initialView,currentMonth:new Date().getMonth(),currentYear:new Date().getFullYear(),minDate:$.minDate?P6($.minDate):null,maxDate:$.maxDate?P6($.maxDate):null,dateFormat:$.dateFormat,variant:$.variant,selectionMode:$.selectionMode,closeOnSelect:$.closeOnSelect,prefix:$.prefix||u,calendarElement:null,input:null,updateInputValue(){if(!this.input)return;if(!this.selectedDate){this.input.value="";return}if(this.selectionMode==="range"&&this.rangeEndDate){let K=G9(this.selectedDate,this.dateFormat),G=G9(this.rangeEndDate,this.dateFormat);this.input.value=`${K} - ${G}`;return}this.input.value=G9(this.selectedDate,this.dateFormat)},updateCalendar(){if(!this.isOpen||!this.calendarElement)return;this.calendarElement.innerHTML="";let K=uQ(this,(G,Y)=>{switch(G){case"dateSelected":this.handleDateSelection(Y.date);break;case"monthSelected":this.currentMonth=Y.month,this.currentView="day",this.updateCalendar();break;case"yearSelected":this.currentYear=Y.year,this.currentView="month",this.updateCalendar();break;case"viewChange":this.currentView=Y.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(K)},handleDateSelection(K){if(this.selectionMode==="range")if(!this.selectedDate||this.selectedDate&&this.rangeEndDate)this.selectedDate=K,this.rangeEndDate=null;else{if(K<this.selectedDate)this.rangeEndDate=this.selectedDate,this.selectedDate=K;else this.rangeEndDate=K;if(this.closeOnSelect)this.isOpen=!1}else if(this.selectedDate=K,this.closeOnSelect)this.isOpen=!1;this.updateInputValue(),this.updateCalendar(),q.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($.value)if(Array.isArray($.value)&&$.selectionMode==="range"){let K=P6($.value[0]),G=P6($.value[1]);if(K&&G)Q.selectedDate=K,Q.rangeEndDate=G,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}else{let K=P6($.value);if(K)Q.selectedDate=K,Q.currentMonth=K.getMonth(),Q.currentYear=K.getFullYear()}let q=I(T,h(),S(vQ($)),Y6($),b())($),Z=I(T,S(CQ($)))($);Q.input=Z.element,q.element.appendChild(Q.input),Q.updateInputValue();let j=EQ($);return Q.calendarElement=E({tag:"div",className:j.className,attributes:j.attributes}),Q.calendarElement.style.display="none",q.element.appendChild(Q.calendarElement),Q.input.addEventListener("click",()=>{if(!q.element.classList.contains("disabled"))if(Q.isOpen=!Q.isOpen,Q.render(),Q.isOpen)q.emit("open",{value:Q.selectedDate});else q.emit("close",{value:Q.selectedDate})}),Q.calendarElement.addEventListener("click",(K)=>{K.stopPropagation()}),document.addEventListener("click",(K)=>{if(Q.isOpen&&!q.element.contains(K.target))Q.isOpen=!1,Q.render(),q.emit("close",{value:Q.selectedDate})}),SQ(Q,hQ(q))(q)}catch(Q){throw console.error("DatePicker creation error:",Q),new Error(`Failed to create DatePicker: ${Q.message}`)}},fQ=pq;n();s();i();c();var sq={size:"medium",animation:"scale",footerAlignment:"right",open:!1,closeButton:!0,closeOnOverlayClick:!0,closeOnEscape:!0,modal:!0,autofocus:!0,trapFocus:!0,divider:!1,animationDuration:150,buttons:[]},gQ=(J={})=>C(sq,J,"dialog"),dQ=(J)=>{return f(J,{tag:"div",attributes:{},className:J.class})},rQ=(J)=>{return{tag:"div",attributes:{"aria-modal":J.modal===!1?!1:!0,role:"dialog",tabindex:-1},className:""}},lQ=(J)=>({visibility:{open:()=>J.visibility.open(),close:()=>J.visibility.close(),toggle:($)=>J.visibility.toggle($),isOpen:()=>J.visibility.isOpen()},content:{setTitle:($)=>J.content.setTitle($),getTitle:()=>J.content.getTitle(),setSubtitle:($)=>J.content.setSubtitle($),getSubtitle:()=>J.content.getSubtitle(),setContent:($)=>J.content.setContent($),getContent:()=>J.content.getContent(),getHeaderElement:()=>J.content.getHeaderElement(),getContentElement:()=>J.content.getContentElement(),getFooterElement:()=>J.content.getFooterElement()},buttons:{addButton:($)=>J.buttons.addButton($),removeButton:($)=>J.buttons.removeButton($),getButtons:()=>J.buttons.getButtons(),setFooterAlignment:($)=>J.buttons.setFooterAlignment($)},focus:{trapFocus:()=>J.focus.trapFocus(),releaseFocus:()=>J.focus.releaseFocus()},size:{setSize:($)=>J.size.setSize($)},divider:{toggleDivider:($)=>J.divider.toggleDivider($),hasDivider:()=>J.divider.hasDivider()},events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),trigger:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});L9();n();c();var mq={orientation:"horizontal",variant:"full-width",thickness:1},pQ=(J={})=>{return C(mq,J,"divider")};var sQ=(J)=>($)=>{let Q=J.orientation||"horizontal";$.element.classList.add(`${$.getClass("divider")}--${Q}`);let q=J.thickness||1;if(Q==="horizontal")$.element.style.height=`${q}px`,$.element.style.width="100%";else $.element.style.width=`${q}px`,$.element.style.height="100%";return{...$,getOrientation(){return Q},setOrientation(Z){if($.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${Z}`),Z==="horizontal")$.element.style.height=`${q}px`,$.element.style.width="100%",$.element.style.marginTop="",$.element.style.marginBottom="";else $.element.style.width=`${q}px`,$.element.style.height="100%",$.element.style.marginLeft="",$.element.style.marginRight="";return this}}},mQ=(J)=>($)=>{let Q=J.variant||"full-width",q=J.orientation||"horizontal";if(Q==="inset"||Q==="middle-inset")if(q==="horizontal"){let Z=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginLeft=`${Z}px`,$.element.style.marginRight=`${j}px`}else{let Z=J.insetStart!==void 0?J.insetStart:16,j=J.insetEnd!==void 0?J.insetEnd:Q==="middle-inset"?16:0;$.element.style.marginTop=`${Z}px`,$.element.style.marginBottom=`${j}px`}return{...$,getVariant(){return Q},setVariant(Z){$.element.classList.remove(`${$.getClass("divider")}--${Q}`),$.element.classList.add(`${$.getClass("divider")}--${Z}`);let j=$.getOrientation?$.getOrientation():q;if(Z==="full-width")if(j==="horizontal")$.element.style.marginLeft="",$.element.style.marginRight="";else $.element.style.marginTop="",$.element.style.marginBottom="";else{let K=J.insetStart!==void 0?J.insetStart:16,G=J.insetEnd!==void 0?J.insetEnd:Z==="middle-inset"?16:0;if(j==="horizontal")$.element.style.marginLeft=`${K}px`,$.element.style.marginRight=`${G}px`;else $.element.style.marginTop=`${K}px`,$.element.style.marginBottom=`${G}px`}return this},setInset(Z,j){let K=$.getOrientation?$.getOrientation():q;if(($.getVariant?$.getVariant():Q)!=="full-width")if(K==="horizontal"){if(Z!==void 0)$.element.style.marginLeft=`${Z}px`;if(j!==void 0)$.element.style.marginRight=`${j}px`}else{if(Z!==void 0)$.element.style.marginTop=`${Z}px`;if(j!==void 0)$.element.style.marginBottom=`${j}px`}return this}}},aQ=(J)=>($)=>{if(J.color)$.element.style.backgroundColor=J.color;let Q=J.thickness||1,q=J.orientation||"horizontal";if(q==="horizontal")$.element.style.height=`${Q}px`;else $.element.style.width=`${Q}px`;return{...$,setThickness(Z){if(($.getOrientation?$.getOrientation():q)==="horizontal")$.element.style.height=`${Z}px`;else $.element.style.width=`${Z}px`;return this},setColor(Z){return $.element.style.backgroundColor=Z,this}}};var E9=(J={})=>{let $=pQ(J);return I(T,S({tag:"hr",componentName:"divider",className:J.class}),sQ($),G6($),mQ($),aQ($))($)};A9();var h9={OPEN:"open",CLOSE:"close",BEFORE_OPEN:"beforeopen",BEFORE_CLOSE:"beforeclose",AFTER_OPEN:"afteropen",AFTER_CLOSE:"afterclose"},iQ=(J)=>($)=>{let Q=rQ(J),q=document.createElement(Q.tag||"div");if(q.classList.add($.getClass("dialog-overlay")),Q.attributes&&typeof Q.attributes==="object")Object.entries(Q.attributes).forEach(([k,L])=>{if(k&&typeof k==="string"&&L!==void 0)q.setAttribute(k,String(L))});if(J.zIndex)q.style.zIndex=String(J.zIndex);let Z=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-header"));let L=document.createElement("div");if(L.classList.add($.getClass("dialog-header-content")),k.appendChild(L),J.title){let D=document.createElement("h2");D.classList.add($.getClass("dialog-header-title")),D.textContent=J.title,L.appendChild(D)}if(J.subtitle){let D=document.createElement("p");D.classList.add($.getClass("dialog-header-subtitle")),D.textContent=J.subtitle,L.appendChild(D)}if(J.closeButton!==!1){let D=document.createElement("button");D.classList.add($.getClass("dialog-header-close")),D.setAttribute("aria-label","Close dialog"),D.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
- `,N.addEventListener("click",(F)=>{if(F.preventDefault(),F.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),M.appendChild(N)}return M},j=()=>{let M=document.createElement("div");if(M.classList.add($.getClass("dialog-content")),J.content)M.innerHTML=J.content;return M},G=()=>{let M=document.createElement("div");M.classList.add($.getClass("dialog-footer"));let k=J.footerAlignment||"right";if(k!=="right")g(M,`${$.getClass("dialog-footer")}--${k}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((N)=>f5(M,N,$));return M},K=()=>{return c9({variant:"full-width",class:$.getClass("dialog-divider")})},z=q(),W=j(),Y=Array.isArray(J.buttons)&&J.buttons.length>0?G():null;g($.element,$.getClass("dialog"));let U=J.size||"medium";if(U!=="medium")g($.element,`${$.getClass("dialog")}--${U}`);let X=J.animation||"scale";if(X!=="scale")g($.element,`${$.getClass("dialog")}--${X}`);$.element.appendChild(z);let _=null,H=null;if(J.divider){if(_=K(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),Y)H=K(),H.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(W),H)$.element.appendChild(H.element);if(Y)$.element.appendChild(Y);Z.appendChild($.element);let B=J.container||document.body;return B.appendChild(Z),{...$,overlay:Z,structure:{header:z,content:W,footer:Y,headerDivider:_,footerDivider:H,container:B}}},u5=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let Z=c9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(Z.element,J.structure.footer),J.structure.footerDivider=Z}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},f5=(J,$,Q)=>{let{text:Z,variant:q="text",onClick:j,closeDialog:G=!0,autofocus:K=!1,attributes:z={}}=$,W=Q9({text:Z,variant:q,...z});if(W.on("click",(Y)=>{console.log("button click");let U=G;if(typeof j==="function")try{if(j(Y,Q)===!1)U=!1}catch(X){console.error("Error in onClick handler:",X)}if(U){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:Z})}}),K)W.element.setAttribute("autofocus","true");if(J.appendChild(W.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:W})},g5=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,Z='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',q=null,j=()=>{if(!J.config.trapFocus)return;let X=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(X.length===0)return;let _=X[0],H=X[X.length-1];if(J.config.autofocus){let M=J.element.querySelector("[autofocus]");if(M)M.focus();else _.focus()}J.element.addEventListener("keydown",B);function B(M){if(M.key!=="Tab")return;if(M.shiftKey){if(document.activeElement===_)H.focus(),M.preventDefault()}else if(document.activeElement===H)_.focus(),M.preventDefault()}},G=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",X),q)q.focus(),q=null;function X(){}},K=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",W);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",Y)},z=()=>{J.overlay.removeEventListener("click",W),document.removeEventListener("keydown",Y)};function W(X){if(X.target===J.overlay)U.close()}function Y(X){if(X.key==="Escape"&&U.isOpen())U.close()}if($)g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),g(J.element,`${J.getClass("dialog")}--visible`),j(),K();let U={open(){if(this.isOpen())return;q=document.activeElement;let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_OPEN,X);if(X.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);g(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(g(J.element,`${J.getClass("dialog")}--visible`),j(),K(),typeof J.emit==="function")J.emit(i9.OPEN,{dialog:J}),setTimeout(()=>{J.emit(i9.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let X={dialog:J,defaultPrevented:!1,preventDefault:()=>{X.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(i9.BEFORE_CLOSE,X);if(X.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,H=`${J.getClass("dialog-overlay")}--visible`;if(j6(J.element,_),j6(J.overlay,H),G(),z(),typeof J.emit==="function")J.emit(i9.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(i9.AFTER_CLOSE,{dialog:J})},Q)},toggle(X){if(X===void 0)this.isOpen()?this.close():this.open();else if(X)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{U.close()});return{...J,visibility:U}},d5=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,Z=J.structure.footer;return{...J,content:{setTitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&q)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getTitle(){let q=$.querySelector(`.${J.getClass("dialog-header-title")}`);return q?q.textContent||"":""},setSubtitle(q){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&q)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=q},getSubtitle(){let q=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return q?q.textContent||"":""},setContent(q){Q.innerHTML=q},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return Z}}}},l5=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let Z=J.config.footerAlignment||"right";if(Z!=="right")g(Q,`${J.getClass("dialog-footer")}--${Z}`);J.element.appendChild(Q),J.structure.footer=Q}f5(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((Z)=>Z.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((Z)=>{if(Z!=="right")j6(J.structure.footer,`${J.getClass("dialog-footer")}--${Z}`)}),$!=="right")g(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},r5=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((Z)=>{j6(J.element,`${J.getClass("dialog")}--${Z}`)}),$!=="medium")g(J.element,`${J.getClass("dialog")}--${$}`)}}}},p5=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:Z="Confirm",message:q,confirmText:j="Yes",cancelText:G="No",confirmVariant:K="filled",cancelVariant:z="text",size:W="small"}=$;J.content.setTitle(Z),J.content.setContent(`<p>${q}</p>`),J.size.setSize(W),J._buttons.forEach((Y)=>Y.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:K,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:G,variant:z,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};R9();var s5=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,Z){return J.events.on(Q,Z),this},off(Q,Z){return J.events.off(Q,Z),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,Z=`${$.getClass("dialog-overlay")}--visible`;if(j6($.element,Q),j6($.overlay,Z),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var oq=(J={})=>{let $=y5(J);try{let Q=b(S,d(),h(T5($)),h5($),g5(),d5(),l5(),r5(),u5(),p5(),C(),(Z)=>s5(S5(Z))(Z))($);if($.on)Object.entries($.on).forEach(([Z,q])=>{if(typeof q==="function")Q.on(Z,q)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},m5=oq;J6();c();o();var a5=({disabled:J,lifecycle:$,className:Q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(q){return Z.element.value=q,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(q){return Z.icon.setIcon(q),this},getIcon(){return Z.icon.getIcon()},setPosition(q){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{Z.element.classList.remove(`${Q}--${G}`)}),Z.element.classList.add(`${Q}--${q}`),this},getPosition(){let q=["top-right","top-left","bottom-right","bottom-left"];for(let j of q)if(Z.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return Z.element.classList.add(`${Q}--lowered`),this},raise(){return Z.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});t();var tq={variant:"primary",size:"default",type:"button",ripple:!0},c5=(J={})=>u(tq,J,"fab"),i5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let Z={...J,className:Q};return p(Z,{tag:"button",attributes:$,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},o5=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var nq=(J={})=>{let $=c5(J);try{return b(S,d(),h(i5($)),K6($),U9($),G6($),S6($),C(),(Z)=>a5(o5(Z))(Z))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},s8=nq;J6();c();o();var t5=({disabled:J,lifecycle:$,text:Q,className:Z})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(j){return q.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return q.icon.setIcon(j),this},getIcon(){return q.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{q.element.classList.remove(`${Z}--${K}`)}),q.element.classList.add(`${Z}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let G of j)if(q.element.classList.contains(`${Z}--${G}`))return G;return null},lower(){return q.element.classList.add(`${Z}--lowered`),this},raise(){return q.element.classList.remove(`${Z}--lowered`),this},collapse(){q.element.classList.add(`${Z}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},expand(){q.element.classList.remove(`${Z}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return q.element.dispatchEvent(j),this},destroy(){$.destroy()}});t();var eq={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},n5=(J={})=>u(eq,J,"extended-fab"),e5=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return p(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},$Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var $j=(J={})=>{let $=n5(J),Q=(Z)=>{if($.collapseOnScroll){let q=window.scrollY,j=!1,G=10,K=()=>{if(!j)window.requestAnimationFrame(()=>{let W=window.scrollY,Y=W-q;if(Y>G)Z.collapse();else if(Y<-G)Z.expand();if(W<=0)Z.expand();q=W,j=!1}),j=!0};window.addEventListener("scroll",K,{passive:!0}),requestAnimationFrame(()=>{Z.expand()});let z=Z.destroy;Z.destroy=()=>{window.removeEventListener("scroll",K),z.call(Z)}}};try{let Z=b(S,d(),h(e5($)),K6($),U9($),Y9($),G6($),S6($),C(),(q)=>t5($Q(q))(q))($);return Q(Z),Z}catch(Z){throw console.error("Extended FAB creation error:",Z),new Error(`Failed to create Extended FAB: ${Z.message}`)}},m8=$j;J6();c();o();var JQ=!1,Jj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},Z={triggerEvent(F,V={},O){let P={menu:Q.component,...V,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return $.emit(F,P),P}},q=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:F}=J;if(typeof F==="string"){let V=document.querySelector(F);if(!V)return console.warn(`Menu opener not found: ${F}`),null;return V}if(typeof F==="object"&&F!==null&&"element"in F)return F.element;return F},j=(F,V)=>{let O=document.createElement("li"),P=`${$.getClass("menu-item")}`;if(O.className=P,O.setAttribute("role","menuitem"),O.setAttribute("tabindex","-1"),O.setAttribute("data-id",F.id),O.setAttribute("data-index",V.toString()),F.disabled)O.classList.add(`${P}--disabled`),O.setAttribute("aria-disabled","true");else O.setAttribute("aria-disabled","false");if(Q.selectedItemId&&F.id===Q.selectedItemId)O.classList.add(`${P}--selected`),O.setAttribute("aria-selected","true");else O.setAttribute("aria-selected","false");if(F.hasSubmenu)O.classList.add(`${P}--submenu`),O.setAttribute("aria-haspopup","true"),O.setAttribute("aria-expanded","false");let L=document.createElement("span");if(L.className=`${$.getClass("menu-item-content")}`,F.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=F.icon,L.appendChild(R)}let D=document.createElement("span");if(D.className=`${$.getClass("menu-item-text")}`,D.textContent=F.text,L.appendChild(D),F.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=F.shortcut,L.appendChild(R)}if(O.appendChild(L),!F.disabled){if(O.addEventListener("click",(R)=>W(R,F,V)),O.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),W(R,F,V)}),O.addEventListener("focus",()=>{Q.activeItemIndex=V}),F.hasSubmenu&&J.openSubmenuOnHover)O.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(F,V,O)}),O.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return O},G=(F,V)=>{let O=document.createElement("li");if(O.className=`${$.getClass("menu-divider")}`,O.setAttribute("role","separator"),O.setAttribute("data-index",V.toString()),F.id)O.setAttribute("id",F.id);return O},K=()=>{let F=document.createElement("ul");F.className=`${$.getClass("menu-list")}`,F.setAttribute("role","menu"),Q.items.forEach((V,O)=>{if("type"in V&&V.type==="divider")F.appendChild(G(V,O));else F.appendChild(j(V,O))}),$.element.innerHTML="",$.element.appendChild(F)},z=(F)=>{for(let V of Q.items){if("id"in V&&V.id===F)return V;if("submenu"in V&&Array.isArray(V.submenu)){for(let O of V.submenu)if("id"in O&&O.id===F)return O}}return null},W=(F,V,O)=>{if(F.preventDefault(),F.stopPropagation(),V.disabled)return;if(V.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(V,O,F.currentTarget);return}let P=Z.triggerEvent("select",{item:V,itemId:V.id,itemData:V.data},F);if(J.closeOnSelect&&!P.defaultPrevented)X(F,!0)},Y=(F)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((O)=>{if(O.getAttribute("data-id")===F)O.classList.add(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","true");else O.classList.remove(`${$.getClass("menu-item--selected")}`),O.setAttribute("aria-selected","false")}),Q.selectedItemId=F},U=(F,V="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",H),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let O=q();if(O&&$.position)$.position.positionMenu(O);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,V);else if(V==="keyboard"){let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0,P[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let P=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(P.length>0)P.forEach((L)=>{L.tabIndex=-1}),P[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M,{passive:!0}),window.addEventListener("scroll",k,{passive:!0})},0)},20),Z.triggerEvent("open",{},F)},X=(F,V=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:F,restoreFocus:V}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),Z.triggerEvent("close",{restoreFocus:V},F),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(F,V="mouse")=>{if(Q.visible)X(F);else{if(F){if(F instanceof KeyboardEvent)V="keyboard";else if(F instanceof MouseEvent)V="mouse"}U(F,V)}},H=(F)=>{if(JQ){JQ=!1;return}if($.element.contains(F.target))return;let V=q();if(V&&V.contains(F.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let O=$.submenu.getActiveSubmenus();for(let P of O)if(P.element.contains(F.target))return}X(F,!1)},B=(F)=>{let V=$.element.contains(F.target),O=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((P)=>P.element.contains(F.target));if(Q.visible){if(V||O){if(F.key==="Escape")F.preventDefault(),X(F,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(F,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},M=()=>{if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F)}},k=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let F=q();if(F&&$.position)$.position.positionMenu(F)})},N=()=>{if(K(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:X,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:z,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let F=q();if(F&&$.position)$.position.positionMenu(F);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",H);if(J.closeOnEscape)document.addEventListener("keydown",B);window.addEventListener("resize",M),window.addEventListener("scroll",k)}};if($.on("create-menu-items",(F)=>{let{items:V,container:O,onItemCreated:P}=F;V.forEach((L,D)=>{let R;if("type"in L&&L.type==="divider")R=G(L,D);else R=j(L,D);if(O.appendChild(R),P)P(R)})}),setTimeout(N,0),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",H),document.removeEventListener("keydown",B),window.removeEventListener("resize",M),window.removeEventListener("scroll",k),F()}}return{...$,menu:{open:(F,V="mouse")=>{return U(F,V),$},close:(F,V=!0)=>{return X(F,V),$},toggle:(F,V="mouse")=>{return _(F,V),$},isOpen:()=>Q.visible,setItems:(F)=>{return Q.items=F,K(),$},getItems:()=>Q.items,setPosition:(F)=>{if(Q.position=F,Q.visible){let V=q();if(V&&$.position)$.position.positionMenu(V)}return $},getPosition:()=>Q.position,setSelected:(F)=>{return Y(F),$},getSelected:()=>Q.selectedItemId}}},a8=Jj;var Qj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(B)=>{Q=B.key==="Tab",setTimeout(()=>{Q=!1},100)});let Z={openerElement:null,openerComponent:null,activeClass:""},q=(B)=>{if(!B)return{element:null,component:null};if(typeof B==="string"){let M=document.querySelector(B);if(!M)return console.warn(`Menu opener not found: ${B}`),{element:null,component:null};return{element:M,component:null}}if(typeof B==="object"&&B!==null){if("element"in B&&B.element instanceof HTMLElement)return{element:B.element,component:B};if("getElement"in B&&typeof B.getElement==="function"){let M=B.getElement();if(M instanceof HTMLElement)return{element:M,component:B}}if("input"in B&&B.input instanceof HTMLElement)return{element:B.input,component:B};if(B instanceof HTMLElement)return{element:B,component:null}}return console.warn("Invalid opener type:",B),{element:null,component:null}},j=(B)=>{let M=$.getClass("").split("-")[0];if(B.tagName==="BUTTON")return`${M}-button--active`;else if(B.classList.contains(`${M}-chip`))return`${M}-chip--selected`;else if(B.classList.contains(`${M}-textfield`)||B.classList.contains(`${M}-select`))return`${M}-textfield--focused`;else return`${M}-menu-opener--active`},G=(B)=>{let{element:M,component:k}=B;if(!M)return;if(Z.openerElement&&Z.openerElement!==M)X();Z.openerElement=M,Z.openerComponent=k,Z.activeClass=j(M),M.addEventListener("click",W),M.addEventListener("keydown",Y),M.addEventListener("blur",U),M.setAttribute("aria-haspopup","true"),M.setAttribute("aria-expanded","false");let N=$.element.id;if(!N)N=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=N;M.setAttribute("aria-controls",N)},K=(B)=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.setActive==="function"){Z.openerComponent.setActive(B);return}if(Z.openerComponent&&"selected"in Z.openerComponent){Z.openerComponent.selected=B;return}if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"&&typeof Z.openerComponent.blur==="function"){if(B)Z.openerComponent.focus();else Z.openerComponent.blur();return}if(Z.openerElement.classList)if(B)Z.openerElement.classList.add(Z.activeClass);else Z.openerElement.classList.remove(Z.activeClass)},z=()=>{if(!Z.openerElement)return;if(Z.openerComponent&&typeof Z.openerComponent.focus==="function"){requestAnimationFrame(()=>{Z.openerComponent.focus()});return}if(Z.openerComponent&&"input"in Z.openerComponent&&Z.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{Z.openerComponent.input.focus()});return}requestAnimationFrame(()=>{Z.openerElement.focus()})},W=(B)=>{if(B.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(B);else $.menu.open(B,"mouse")},Y=(B)=>{if(!$.menu)return;let M=$.menu.isOpen();switch(B.key){case"Enter":case" ":case"ArrowDown":case"Down":if(B.preventDefault(),!M)$.menu.open(B,"keyboard");break;case"Escape":if(M)B.preventDefault(),$.menu.close(B);break;case"ArrowUp":case"Up":if(B.preventDefault(),!M)$.menu.open(B,"keyboard"),setTimeout(()=>{let k=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(k.length>0){k.forEach((F)=>F.setAttribute("tabindex","-1"));let N=k[k.length-1];N.setAttribute("tabindex","0"),N.focus()}},100);break}},U=(B)=>{if(!$.menu||!$.menu.isOpen())return;let M=B.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},10);return}if(M){if($.element.contains(M))return;if(M.getAttribute("aria-haspopup")==="true"||M.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(B,!1)},50)},X=()=>{if(Z.openerElement)Z.openerElement.removeEventListener("click",W),Z.openerElement.removeEventListener("keydown",Y),Z.openerElement.removeEventListener("blur",U),Z.openerElement.removeAttribute("aria-haspopup"),Z.openerElement.removeAttribute("aria-expanded"),Z.openerElement.removeAttribute("aria-controls"),K(!1);Z.openerComponent=null,Z.openerElement=null,Z.activeClass=""},{element:_,component:H}=q(J.opener);if(G({element:_,component:H}),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{X(),B()}}return $.on("open",()=>{if(Z.openerElement)Z.openerElement.setAttribute("aria-expanded","true"),K(!0)}),$.on("close",(B)=>{if(Z.openerElement){if(Z.openerElement.setAttribute("aria-expanded","false"),K(!1),B.restoreFocus&&!Q)z()}}),{...$,opener:{setOpener(B){let M=q(B);if(M.element)G(M);return $},getOpener(){return Z.openerElement},getOpenerComponent(){return Z.openerComponent},setActive(B){return K(B),$},focus(){return z(),$}}}},c8=Qj;var Zj=(J,$)=>{let Q=(j,G,K,z=!1)=>{if(!j||!G)return;j.style.position="absolute";let W=window.pageXOffset||document.documentElement.scrollLeft,Y=window.pageYOffset||document.documentElement.scrollTop,U=j.cloneNode(!0);U.style.visibility="hidden",U.style.display="block",U.style.position="absolute",U.style.top="0",U.style.left="0",U.style.transform="none",U.style.opacity="0",U.style.pointerEvents="none",U.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(U);let X=G.getBoundingClientRect(),_=U.getBoundingClientRect(),H=window.innerWidth,B=window.innerHeight;document.body.removeChild(U);let M=$.offset!==void 0?$.offset:8,k=0,N=0,F=K;if(z){if(F=K||"right-start",F.startsWith("right")&&X.right+_.width+M>H-16)F=F.replace("right","left");else if(F.startsWith("left")&&X.left-_.width-M<16)F=F.replace("left","right");if(X.top+_.height>B-48){if(F==="right-start")F="right-end";else if(F==="left-start")F="left-end"}}else switch(K){case"top-start":case"top":case"top-end":if(X.top<_.height+M+48)F=K.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(X.bottom+_.height+M+48>B){if(X.top>B-X.bottom)F=K.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(X.bottom+_.height>B-48){if(K==="right-start")F="right-end";else if(K==="left-start")F="left-end";else if(K==="right")k=X.top-(_.height-X.height)-M;else if(K==="left")k=X.top-(_.height-X.height)-M}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),F.startsWith("top")||F==="right-end"||F==="left-end"||F==="right"&&k<X.top||F==="left"&&k<X.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(F.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(F.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(F){case"top-start":k=X.top+Y-_.height-M,N=X.left+W;break;case"top":k=X.top+Y-_.height-M,N=X.left+W+X.width/2-_.width/2;break;case"top-end":k=X.top+Y-_.height-M,N=X.right+W-_.width;break;case"right-start":k=X.top+Y,N=X.right+W+M;break;case"right":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.right+W+M;break;case"right-end":k=X.bottom+Y-_.height,N=X.right+W+M;break;case"bottom-start":k=X.bottom+Y+M,N=X.left+W;break;case"bottom":k=X.bottom+Y+M,N=X.left+W+X.width/2-_.width/2;break;case"bottom-end":k=X.bottom+Y+M,N=X.right+W-_.width;break;case"left-start":k=X.top+Y,N=X.left+W-_.width-M;break;case"left":if(k===0)k=X.top+Y+X.height/2-_.height/2;else k+=Y;N=X.left+W-_.width-M;break;case"left-end":k=X.bottom+Y-_.height,N=X.left+W-_.width-M;break}let P=48;if(k-Y<P)k=P+Y;let L=48;if(k-Y+_.height>B-L){let R=B-(k-Y)-L,w=Math.min(_.height,100),A=Math.max(R,w);if(j.style.maxHeight=`${A}px`,$.maxHeight){let x=parseInt($.maxHeight,10);if(!isNaN(x)&&x<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!z)j.style.width=`${X.width}px`;if(j.style.top=`${Math.max(P+Y,k)}px`,j.style.left=`${Math.max(16+W,N)}px`,N-W+_.width>H-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,G,K=1)=>{if(!j||!G)return;let z=K%2===1?"right-start":"left-start";j.style.zIndex=`${1000+K*10}`,Q(j,G,z,!0)},positionElement:Q}},qj=(J)=>($)=>{if(!$.element)return $;let Q=Zj($,J);return{...$,position:Q}},i8=qj;var jj=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(z)=>{$=z.key==="Tab",setTimeout(()=>{$=!1},100)})})();let Z=()=>{let W=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(W).filter((Y)=>{return Y.offsetParent!==null&&!Y.classList.contains("hidden")})},q=(z,W)=>{if(W==="keyboard"){let Y=Array.from(z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(Y.length>0)Y[0].setAttribute("tabindex","0"),Y[0].focus();else z.setAttribute("tabindex","0"),z.focus()}else{z.setAttribute("tabindex","-1");let Y=z.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(Y)Y.setAttribute("tabindex","0")}},j=(z,W,Y)=>{let U=W.activeSubmenu&&W.activeSubmenu.contains(z.target),X=U?W.activeSubmenu:J.element,_=Array.from(X.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let H=document.activeElement,B=-1;if(H&&_.includes(H))B=_.indexOf(H);let M=(k)=>{if(_[k])_[k].focus()};switch(z.key){case"ArrowDown":case"Down":if(z.preventDefault(),B<0)M(0);else if(B<_.length-1)M(B+1);else M(0);break;case"ArrowUp":case"Up":if(z.preventDefault(),B<0)M(_.length-1);else if(B>0)M(B-1);else M(_.length-1);break;case"Home":z.preventDefault(),M(0);break;case"End":z.preventDefault(),M(_.length-1);break;case"Enter":case" ":if(z.preventDefault(),B>=0)_[B].click();break;case"ArrowRight":case"Right":if(z.preventDefault(),U){if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),O=N.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),P=Y.findItemById(O);if(P&&P.submenu){let L=P.submenu[F];Y.handleNestedSubmenuClick(L,F,N)}}}else if(B>=0&&_[B].classList.contains(`${J.getClass("menu-item--submenu")}`)){let N=_[B],F=parseInt(N.getAttribute("data-index"),10),V=W.items[F];Y.handleSubmenuClick(V,F,N)}break;case"ArrowLeft":case"Left":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);break;case"Escape":if(z.preventDefault(),U)if(W.activeSubmenuItem){let N=W.activeSubmenuItem,F=parseInt(X.getAttribute("data-level")||"1",10);if(Y.closeSubmenu(F),N)N.focus()}else Y.closeSubmenu(1);else Y.closeMenu(z,!0);break;case"Tab":z.preventDefault();let k=J.opener?.getOpener?.();if(Y.closeMenu(z,!0),k)setTimeout(()=>{if(z.shiftKey);else{let N=Z(),F=N.indexOf(k);if(F>=0&&F<N.length-1)N[F+1].focus()}},0);break}};return{handleInitialFocus:q,handleMenuKeydown:j,setupKeyboardHandlers:(z,W,Y)=>{let U=z.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(U.forEach((X)=>{X.tabIndex=-1}),U.length>0)U[0].tabIndex=0;z.addEventListener("keydown",(X)=>j(X,W,Y))},isTabNavigationActive:()=>$,getFocusableElements:Z}},Kj=()=>(J)=>{if(!J.element)return J;let $=jj(J);return{...J,keyboard:$}},o8=Kj;var Gj=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},Z=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},q=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(N,F,V)=>{if(!J.openSubmenuOnHover||!N.hasSubmenu)return;Z(),q(),Q.hoverIntent.activeItem=V,Q.hoverIntent.timer=setTimeout(()=>{if(V.matches(":hover")){if(Q.activeSubmenuItem!==V)W(N,F,V)}Q.hoverIntent.timer=null},100)},G=()=>{Z(),q(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:N,activeSubmenuItem:F}=Q;if(N&&F){let V=N.matches(":hover"),O=F.matches(":hover");if(!V&&!O)Y(Q.submenuLevel)}Q.submenuTimer=null},300)},K=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);Y(L+1),V.setAttribute("aria-expanded","false")}else W(N,F,V)},z=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((L)=>L.isOpening))return;if(O){let L=parseInt(V.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);Y(L+1)}else W(N,F,V)},W=(N,F,V)=>{if(!N.submenu||!N.hasSubmenu)return;let O=V.closest(`.${$.getClass("menu--submenu")}`)?parseInt(V.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(Y(O),Q.activeSubmenus.findIndex((w)=>w.menuItem===V&&w.isOpening)>=0)return;V.setAttribute("aria-expanded","true");let L=document.createElement("div");L.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,L.setAttribute("role","menu"),L.setAttribute("tabindex","-1"),L.setAttribute("data-level",O.toString()),L.setAttribute("data-parent-item",N.id),L.style.zIndex=`${1000+O*10}`;let D=document.createElement("ul");D.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:N.submenu,container:D,level:O,onItemCreated:(w)=>{if(!w.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(w)}}),L.appendChild(D),document.body.appendChild(L),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(L,V,O);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(L,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:Y,handleNestedSubmenuClick:z});L.addEventListener("mouseenter",()=>{q()}),L.addEventListener("mouseleave",()=>{G()}),Q.activeSubmenu=L,Q.activeSubmenuItem=V,Q.activeSubmenus.push({element:L,menuItem:V,level:O,isOpening:!0}),Q.submenuLevel=O,document.addEventListener("click",X),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",H,{passive:!0}),requestAnimationFrame(()=>{L.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let w=Q.activeSubmenus.findIndex((A)=>A.element===L);if(w!==-1)Q.activeSubmenus[w].isOpening=!1;if(R.length>0){if(O>=2||document.activeElement===V)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:L,parentItem:V,level:O,item:N})},Y=(N)=>{Z(),q();let F=[];for(let V=Q.activeSubmenus.length-1;V>=0;V--)if(Q.activeSubmenus[V].level>=N){let O=Q.activeSubmenus[V];if(O.menuItem)O.menuItem.setAttribute("aria-expanded","false");O.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(O.element.parentNode)O.element.parentNode.removeChild(O.element)},200),F.push(V)}if(F.forEach((V)=>{Q.activeSubmenus.splice(V,1)}),Q.activeSubmenus.length>0){let V=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=V.element,Q.activeSubmenuItem=V.menuItem,Q.submenuLevel=V.level,V.menuItem)V.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:N})},U=()=>{if(Z(),q(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((N)=>{if(N.menuItem)N.menuItem.setAttribute("aria-expanded","false");N.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(N.element.parentNode)N.element.parentNode.removeChild(N.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),$.emit("all-submenus-closed",{})},X=(N)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:F,activeSubmenuItem:V}=Q;if(F.contains(N.target)||V&&V.contains(N.target))return;U()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},H=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},B=()=>{return Q.activeSubmenus.length>0},M=()=>{return Q.submenuLevel},k=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let N=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(Z(),q(),document.removeEventListener("click",X),window.removeEventListener("resize",_),window.removeEventListener("scroll",H),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((F)=>{if(F.element.parentNode)F.element.parentNode.removeChild(F.element)});N()}}return $.on("menu-closing",()=>{U()}),{...$,submenu:{openSubmenu:W,closeSubmenu:Y,closeAllSubmenus:U,handleSubmenuClick:K,handleNestedSubmenuClick:z,handleSubmenuHover:j,handleSubmenuLeave:G,hasOpenSubmenu:B,getSubmenuLevel:M,getActiveSubmenus:k}}},t8=Gj;var QQ=({menu:J,opener:$,events:Q,lifecycle:Z})=>(q)=>{return{element:q.element,open(G,K="mouse"){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard"}return J.open(G,K),this},close(G,K=!0,z=!1){return J.close(G,K,z),this},toggle(G,K){if(G&&!K){if(G instanceof KeyboardEvent)K="keyboard";else if(G instanceof MouseEvent)K="mouse"}return J.toggle(G,K),this},isOpen(){return J.isOpen()},setItems(G){return J.setItems(G),this},getItems(){return J.getItems()},setOpener(G){return $.setOpener(G),this},getOpener(){return $.getOpener()},setPosition(G){return J.setPosition(G),this},getPosition(){return J.getPosition()},setSelected(G){return J.setSelected(G),this},getSelected(){return J.getSelected()},on(G,K){if(Q?.on)Q.on(G,K);else if(q.on)q.on(G,K);return this},off(G,K){if(Q?.off)Q.off(G,K);else if(q.off)q.off(G,K);return this},destroy(){Z.destroy()}}};t();var n8={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"},c6={POSITION:n8.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},ZQ={MOUSE:"mouse",KEYBOARD:"keyboard"},qQ={ITEM:"item",DIVIDER:"divider"},jQ={OPEN:"open",CLOSE:"close",SELECT:"select"},F$={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"};var zj={items:[],position:c6.POSITION,closeOnSelect:c6.CLOSE_ON_SELECT,closeOnClickOutside:c6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:c6.CLOSE_ON_ESCAPE,openSubmenuOnHover:c6.OPEN_SUBMENU_ON_HOVER,offset:c6.OFFSET,autoFlip:c6.AUTO_FLIP,visible:!1},KQ=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return u(zj,J,"menu")},GQ=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([Z,q])=>`${Z}: ${q}`).join(";")};return p(J,{tag:"div",attributes:Q,className:[J.visible?F$.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},zQ=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,Z)=>J.menu?.close($,Q,Z),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var Wj=(J)=>{try{let $=KQ(J);return b(S,d(),h(GQ($)),i8($),o8(),t8($),a8($),c8($),C(),(Z)=>QQ(zQ(Z))(Z))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},H$=Wj;J6();c();o();var WQ=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(Z){if(typeof $.addItem==="function")$.addItem(Z);return this},removeItem(Z){if(typeof $.removeItem==="function")$.removeItem(Z);return this},getItem(Z){if(typeof $.getItem==="function")return $.getItem(Z);return this.items.get(Z)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(Z){if(typeof $.getItemPath==="function")return $.getItemPath(Z);return[]},setActive(Z){if(typeof $.handleItemClick==="function")$.handleItemClick(Z);else if(typeof $.setActive==="function")$.setActive(Z);else{let q=this.items.get(Z);if(q&&q.element){if($.emit)$.emit("change",{id:Z,item:q,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.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(Z,q){if($.on)$.on(Z,q);return this},off(Z,q){if($.off)$.off(Z,q);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var e8={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},$1={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},J1={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},YQ={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},k$={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},_9={VARIANT:e8.STANDARD,POSITION:$1.LEFT,BEHAVIOR:J1.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},n={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 Yj=(J)=>{let $=document.createElement("span");return $.className=`${J}-${n.EXPAND_ICON}`,$.innerHTML=`
18
+ `,D.addEventListener("click",(B)=>{if(B.preventDefault(),B.stopPropagation(),$&&$.emit)$.emit("dialog:close",{source:"closeButton"})}),k.appendChild(D)}return k},j=()=>{let k=document.createElement("div");if(k.classList.add($.getClass("dialog-content")),J.content)k.innerHTML=J.content;return k},K=()=>{let k=document.createElement("div");k.classList.add($.getClass("dialog-footer"));let L=J.footerAlignment||"right";if(L!=="right")p(k,`${$.getClass("dialog-footer")}--${L}`);if(Array.isArray(J.buttons)&&J.buttons.length>0)J.buttons.forEach((D)=>oQ(k,D,$));return k},G=()=>{return E9({variant:"full-width",class:$.getClass("dialog-divider")})},Y=Z(),z=j(),W=Array.isArray(J.buttons)&&J.buttons.length>0?K():null;p($.element,$.getClass("dialog"));let X=J.size||"medium";if(X!=="medium")p($.element,`${$.getClass("dialog")}--${X}`);let U=J.animation||"scale";if(U!=="scale")p($.element,`${$.getClass("dialog")}--${U}`);$.element.appendChild(Y);let _=null,N=null;if(J.divider){if(_=G(),_.element.classList.add($.getClass("dialog-header-divider")),$.element.appendChild(_.element),W)N=G(),N.element.classList.add($.getClass("dialog-footer-divider"))}if($.element.appendChild(z),N)$.element.appendChild(N.element);if(W)$.element.appendChild(W);q.appendChild($.element);let F=J.container||document.body;return F.appendChild(q),{...$,overlay:q,structure:{header:Y,content:z,footer:W,headerDivider:_,footerDivider:N,container:F}}},cQ=()=>(J)=>{return{...J,divider:{toggleDivider($){if($&&!J.structure.headerDivider){let Q=E9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-header-divider")}`});if(J.element.insertBefore(Q.element,J.structure.content),J.structure.headerDivider=Q,J.structure.footer&&!J.structure.footerDivider){let q=E9({variant:"full-width",class:`${J.getClass("dialog-divider")} ${J.getClass("dialog-footer-divider")}`});J.element.insertBefore(q.element,J.structure.footer),J.structure.footerDivider=q}}else if(!$){if(J.structure.headerDivider)J.structure.headerDivider.element.remove(),J.structure.headerDivider=null;if(J.structure.footerDivider)J.structure.footerDivider.element.remove(),J.structure.footerDivider=null}return J},hasDivider(){return J.structure.headerDivider!==null}}}},oQ=(J,$,Q)=>{let{text:q,variant:Z="text",onClick:j,closeDialog:K=!0,autofocus:G=!1,attributes:Y={}}=$,z=o6({text:q,variant:Z,...Y});if(z.on("click",(W)=>{console.log("button click");let X=K;if(typeof j==="function")try{if(j(W,Q)===!1)X=!1}catch(U){console.error("Error in onClick handler:",U)}if(X){if(Q&&Q.emit)Q.emit("dialog:close",{source:"button",text:q})}}),G)z.element.setAttribute("autofocus","true");if(J.appendChild(z.element),!Q._buttons)Q._buttons=[];Q._buttons.push({config:$,instance:z})},tQ=()=>(J)=>{let $=J.config.open===!0,Q=J.config.animationDuration||150,q='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',Z=null,j=()=>{if(!J.config.trapFocus)return;let U=J.element.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(U.length===0)return;let _=U[0],N=U[U.length-1];if(J.config.autofocus){let k=J.element.querySelector("[autofocus]");if(k)k.focus();else _.focus()}J.element.addEventListener("keydown",F);function F(k){if(k.key!=="Tab")return;if(k.shiftKey){if(document.activeElement===_)N.focus(),k.preventDefault()}else if(document.activeElement===N)_.focus(),k.preventDefault()}},K=()=>{if(!J.config.trapFocus)return;if(J.element.removeEventListener("keydown",U),Z)Z.focus(),Z=null;function U(){}},G=()=>{if(J.config.closeOnOverlayClick!==!1)J.overlay.addEventListener("click",z);if(J.config.closeOnEscape!==!1)document.addEventListener("keydown",W)},Y=()=>{J.overlay.removeEventListener("click",z),document.removeEventListener("keydown",W)};function z(U){if(U.target===J.overlay)X.close()}function W(U){if(U.key==="Escape"&&X.isOpen())X.close()}if($)p(J.overlay,`${J.getClass("dialog-overlay")}--visible`),p(J.element,`${J.getClass("dialog")}--visible`),j(),G();let X={open(){if(this.isOpen())return;Z=document.activeElement;let U={dialog:J,defaultPrevented:!1,preventDefault:()=>{U.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(h9.BEFORE_OPEN,U);if(U.defaultPrevented)return;if(J.overlay&&!J.overlay.parentNode)(J.structure.container||document.body).appendChild(J.overlay);p(J.overlay,`${J.getClass("dialog-overlay")}--visible`),setTimeout(()=>{if(p(J.element,`${J.getClass("dialog")}--visible`),j(),G(),typeof J.emit==="function")J.emit(h9.OPEN,{dialog:J}),setTimeout(()=>{J.emit(h9.AFTER_OPEN,{dialog:J})},Q)},10)},close(){console.log("Dialog close method called");let U={dialog:J,defaultPrevented:!1,preventDefault:()=>{U.defaultPrevented=!0}};if(typeof J.emit==="function")J.emit(h9.BEFORE_CLOSE,U);if(U.defaultPrevented){console.log("Dialog close prevented by event handler");return}let _=`${J.getClass("dialog")}--visible`,N=`${J.getClass("dialog-overlay")}--visible`;if(K6(J.element,_),K6(J.overlay,N),K(),Y(),typeof J.emit==="function")J.emit(h9.CLOSE,{dialog:J});setTimeout(()=>{if(J.overlay&&J.overlay.parentNode)J.overlay.parentNode.removeChild(J.overlay);if(typeof J.emit==="function")J.emit(h9.AFTER_CLOSE,{dialog:J})},Q)},toggle(U){if(U===void 0)this.isOpen()?this.close():this.open();else if(U)this.open();else this.close()},isOpen(){return J.element.classList.contains(`${J.getClass("dialog")}--visible`)}};if(J&&J.on)J.on("dialog:close",()=>{X.close()});return{...J,visibility:X}},nQ=()=>(J)=>{let $=J.structure.header,Q=J.structure.content,q=J.structure.footer;return{...J,content:{setTitle(Z){let j=$.querySelector(`.${J.getClass("dialog-header-title")}`);if(!j&&Z)j=document.createElement("h2"),j.classList.add(J.getClass("dialog-header-title")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=Z},getTitle(){let Z=$.querySelector(`.${J.getClass("dialog-header-title")}`);return Z?Z.textContent||"":""},setSubtitle(Z){let j=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);if(!j&&Z)j=document.createElement("p"),j.classList.add(J.getClass("dialog-header-subtitle")),$.querySelector(`.${J.getClass("dialog-header-content")}`).appendChild(j);if(j)j.textContent=Z},getSubtitle(){let Z=$.querySelector(`.${J.getClass("dialog-header-subtitle")}`);return Z?Z.textContent||"":""},setContent(Z){Q.innerHTML=Z},getContent(){return Q.innerHTML},getHeaderElement(){return $},getContentElement(){return Q},getFooterElement(){return q}}}},eQ=()=>(J)=>{if(!J._buttons)J._buttons=[];return{...J,buttons:{addButton($){let Q=J.structure.footer;if(!Q){Q=document.createElement("div"),Q.classList.add(J.getClass("dialog-footer"));let q=J.config.footerAlignment||"right";if(q!=="right")p(Q,`${J.getClass("dialog-footer")}--${q}`);J.element.appendChild(Q),J.structure.footer=Q}oQ(Q,$,J)},removeButton($){if(typeof $==="number"){if($>=0&&$<J._buttons.length)J._buttons[$].instance.destroy(),J._buttons.splice($,1)}else{let Q=J._buttons.findIndex((q)=>q.config.text===$);if(Q!==-1)J._buttons[Q].instance.destroy(),J._buttons.splice(Q,1)}if(J._buttons.length===0&&J.structure.footer)J.element.removeChild(J.structure.footer),J.structure.footer=null},getButtons(){return J._buttons.map(($)=>$.config)},setFooterAlignment($){if(!J.structure.footer)return;if(["right","left","center","space-between"].forEach((q)=>{if(q!=="right")K6(J.structure.footer,`${J.getClass("dialog-footer")}--${q}`)}),$!=="right")p(J.structure.footer,`${J.getClass("dialog-footer")}--${$}`)}}}},$0=()=>(J)=>{return{...J,size:{setSize($){if(["small","medium","large","fullwidth","fullscreen"].forEach((q)=>{K6(J.element,`${J.getClass("dialog")}--${q}`)}),$!=="medium")p(J.element,`${J.getClass("dialog")}--${$}`)}}}},J0=()=>(J)=>{return{...J,confirm($){return new Promise((Q)=>{let{title:q="Confirm",message:Z,confirmText:j="Yes",cancelText:K="No",confirmVariant:G="filled",cancelVariant:Y="text",size:z="small"}=$;J.content.setTitle(q),J.content.setContent(`<p>${Z}</p>`),J.size.setSize(z),J._buttons.forEach((W)=>W.instance.destroy()),J._buttons=[],J.buttons.addButton({text:j,variant:G,onClick:()=>{Q(!0)}}),J.buttons.addButton({text:K,variant:Y,onClick:()=>{Q(!1)}}),J.visibility.open()})}}};A9();var Q0=(J)=>($)=>({...$,open(){return J.visibility.open(),this},close(){return J.visibility.close(),this},toggle(Q){return J.visibility.toggle(Q),this},isOpen(){return J.visibility.isOpen()},setTitle(Q){return J.content.setTitle(Q),this},getTitle(){return J.content.getTitle()},setSubtitle(Q){return J.content.setSubtitle(Q),this},getSubtitle(){return J.content.getSubtitle()},setContent(Q){return J.content.setContent(Q),this},getContent(){return J.content.getContent()},addButton(Q){return J.buttons.addButton(Q),this},removeButton(Q){return J.buttons.removeButton(Q),this},getButtons(){return J.buttons.getButtons()},setFooterAlignment(Q){return J.buttons.setFooterAlignment(Q),this},toggleDivider(Q){return J.divider.toggleDivider(Q),this},hasDivider(){return J.divider.hasDivider()},setSize(Q){return J.size.setSize(Q),this},on(Q,q){return J.events.on(Q,q),this},off(Q,q){return J.events.off(Q,q),this},getHeaderElement(){return J.content.getHeaderElement()},getContentElement(){return J.content.getContentElement()},getFooterElement(){return J.content.getFooterElement()},confirm(Q){if($.confirm)return $.confirm(Q||{message:"Are you sure?"});return Promise.resolve(!1)},destroy(){if(console.log("destroy",this.isOpen()),this.isOpen()){let Q=`${$.getClass("dialog")}--visible`,q=`${$.getClass("dialog-overlay")}--visible`;if(K6($.element,Q),K6($.overlay,q),J.focus&&J.focus.releaseFocus)J.focus.releaseFocus()}if(J.lifecycle.destroy(),$.overlay&&$.overlay.parentNode)$.overlay.parentNode.removeChild($.overlay)},element:$.element,overlay:$.overlay});var aq=(J={})=>{let $=gQ(J);try{let Q=I(T,h(),S(dQ($)),iQ($),tQ(),nQ(),eQ(),$0(),cQ(),J0(),b(),(q)=>Q0(lQ(q))(q))($);if($.on)Object.entries($.on).forEach(([q,Z])=>{if(typeof Z==="function")Q.on(q,Z)});return Q}catch(Q){throw console.error("Dialog creation error:",Q),new Error(`Failed to create dialog: ${Q.message}`)}},q0=aq;n();s();i();var Z0=({disabled:J,lifecycle:$,className:Q})=>(q)=>({...q,element:q.element,getValue:()=>q.element.value,setValue(Z){return q.element.value=Z,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(Z){return q.icon.setIcon(Z),this},getIcon(){return q.icon.getIcon()},setPosition(Z){return["top-right","top-left","bottom-right","bottom-left"].forEach((K)=>{q.element.classList.remove(`${Q}--${K}`)}),q.element.classList.add(`${Q}--${Z}`),this},getPosition(){let Z=["top-right","top-left","bottom-right","bottom-left"];for(let j of Z)if(q.element.classList.contains(`${Q}--${j}`))return j;return null},lower(){return q.element.classList.add(`${Q}--lowered`),this},raise(){return q.element.classList.remove(`${Q}--lowered`),this},destroy(){$.destroy()}});c();var iq={variant:"primary",size:"default",type:"button",ripple:!0},j0=(J={})=>C(iq,J,"fab"),K0=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||(J.icon?"action":void 0)};if(J.disabled===!0)$.disabled=!0;let Q=[];if(Q.push(`fab--${J.size||"default"}`),J.animate)Q.push("fab--animate-enter");if(J.position)Q.push(`fab--${J.position}`);if(J.disabled===!0)Q.push("fab--disabled");let q={...J,className:Q};return f(q,{tag:"button",attributes:$,forwardEvents:{click:(Z)=>!Z.element.disabled,focus:!0,blur:!0},interactive:!0})},G0=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("fab")});var cq=(J={})=>{let $=j0(J);try{return I(T,h(),S(K0($)),G6($),g6($),Y6($),A6($),b(),(q)=>Z0(G0(q))(q))($)}catch(Q){throw console.error("FAB creation error:",Q),new Error(`Failed to create FAB: ${Q.message}`)}},p$=cq;n();s();i();var Y0=({disabled:J,lifecycle:$,text:Q,className:q})=>(Z)=>({...Z,element:Z.element,getValue:()=>Z.element.value,setValue(j){return Z.element.value=j,this},enable(){return J.enable(),this},disable(){return J.disable(),this},setIcon(j){return Z.icon.setIcon(j),this},getIcon(){return Z.icon.getIcon()},setText(j){return Q.setText(j),this},getText(){return Q.getText()},setPosition(j){return["top-right","top-left","bottom-right","bottom-left"].forEach((G)=>{Z.element.classList.remove(`${q}--${G}`)}),Z.element.classList.add(`${q}--${j}`),this},getPosition(){let j=["top-right","top-left","bottom-right","bottom-left"];for(let K of j)if(Z.element.classList.contains(`${q}--${K}`))return K;return null},lower(){return Z.element.classList.add(`${q}--lowered`),this},raise(){return Z.element.classList.remove(`${q}--lowered`),this},collapse(){Z.element.classList.add(`${q}--collapsed`);let j=new CustomEvent("collapse",{bubbles:!0,cancelable:!0});return Z.element.dispatchEvent(j),this},expand(){Z.element.classList.remove(`${q}--collapsed`);let j=new CustomEvent("expand",{bubbles:!0,cancelable:!0});return Z.element.dispatchEvent(j),this},destroy(){$.destroy()}});c();var oq={variant:"primary",type:"button",ripple:!0,iconPosition:"start",width:"fixed"},z0=(J={})=>C(oq,J,"extended-fab"),W0=(J)=>{let $={type:J.type||"button","aria-label":J.ariaLabel||J.text||(J.icon?"action":void 0)},Q=[`${J.prefix}-extended-fab`];if(J.variant)Q.push(`${J.prefix}-extended-fab--${J.variant}`);if(J.width)Q.push(`${J.prefix}-extended-fab--${J.width}`);if(J.animate)Q.push(`${J.prefix}-extended-fab--animate-enter`);if(J.position)Q.push(`${J.prefix}-extended-fab--${J.position}`);if(J.collapseOnScroll)Q.push(`${J.prefix}-extended-fab--collapsible`);if(J.class)Q.push(J.class);if(J.disabled===!0)$.disabled=!0,Q.push(`${J.prefix}-extended-fab--disabled`);return f(J,{tag:"button",attributes:$,className:Q,forwardEvents:{click:(q)=>!q.element.disabled,focus:!0,blur:!0},interactive:!0})},U0=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()},className:J.getClass("extended-fab"),text:{setText:($)=>J.text.setText($),getText:()=>J.text.getText()}});var tq=(J={})=>{let $=z0(J),Q=(q)=>{if($.collapseOnScroll){let Z=window.scrollY,j=!1,K=10,G=()=>{if(!j)window.requestAnimationFrame(()=>{let z=window.scrollY,W=z-Z;if(W>K)q.collapse();else if(W<-K)q.expand();if(z<=0)q.expand();Z=z,j=!1}),j=!0};window.addEventListener("scroll",G,{passive:!0}),requestAnimationFrame(()=>{q.expand()});let Y=q.destroy;q.destroy=()=>{window.removeEventListener("scroll",G),Y.call(q)}}};try{let q=I(T,h(),S(W0($)),G6($),g6($),J9($),Y6($),A6($),b(),(Z)=>Y0(U0(Z))(Z))($);return Q(q),q}catch(q){throw console.error("Extended FAB creation error:",q),new Error(`Failed to create Extended FAB: ${q.message}`)}},s$=tq;n();s();i();var X0=!1,nq=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu controller: missing element"),$;let Q={visible:J.visible||!1,items:J.items||[],position:J.position,selectedItemId:null,activeItemIndex:-1,component:$},q={triggerEvent(B,H={},V){let O={menu:Q.component,...H,originalEvent:V,preventDefault:()=>{O.defaultPrevented=!0},defaultPrevented:!1};return $.emit(B,O),O}},Z=()=>{if($.opener&&typeof $.opener.getOpener==="function")return $.opener.getOpener();let{opener:B}=J;if(typeof B==="string"){let H=document.querySelector(B);if(!H)return console.warn(`Menu opener not found: ${B}`),null;return H}if(typeof B==="object"&&B!==null&&"element"in B)return B.element;return B},j=(B,H)=>{let V=document.createElement("li"),O=`${$.getClass("menu-item")}`;if(V.className=O,V.setAttribute("role","menuitem"),V.setAttribute("tabindex","-1"),V.setAttribute("data-id",B.id),V.setAttribute("data-index",H.toString()),B.disabled)V.classList.add(`${O}--disabled`),V.setAttribute("aria-disabled","true");else V.setAttribute("aria-disabled","false");if(Q.selectedItemId&&B.id===Q.selectedItemId)V.classList.add(`${O}--selected`),V.setAttribute("aria-selected","true");else V.setAttribute("aria-selected","false");if(B.hasSubmenu)V.classList.add(`${O}--submenu`),V.setAttribute("aria-haspopup","true"),V.setAttribute("aria-expanded","false");let M=document.createElement("span");if(M.className=`${$.getClass("menu-item-content")}`,B.icon){let R=document.createElement("span");R.className=`${$.getClass("menu-item-icon")}`,R.innerHTML=B.icon,M.appendChild(R)}let P=document.createElement("span");if(P.className=`${$.getClass("menu-item-text")}`,P.textContent=B.text,M.appendChild(P),B.shortcut){let R=document.createElement("span");R.className=`${$.getClass("menu-item-shortcut")}`,R.textContent=B.shortcut,M.appendChild(R)}if(V.appendChild(M),!B.disabled){if(V.addEventListener("click",(R)=>z(R,B,H)),V.addEventListener("keydown",(R)=>{if(R.key==="Enter"||R.key===" ")R.preventDefault(),z(R,B,H)}),V.addEventListener("focus",()=>{Q.activeItemIndex=H}),B.hasSubmenu&&J.openSubmenuOnHover)V.addEventListener("mouseenter",()=>{if($.submenu)$.submenu.handleSubmenuHover(B,H,V)}),V.addEventListener("mouseleave",(R)=>{if($.submenu)$.submenu.handleSubmenuLeave(R)})}return V},K=(B,H)=>{let V=document.createElement("li");if(V.className=`${$.getClass("menu-divider")}`,V.setAttribute("role","separator"),V.setAttribute("data-index",H.toString()),B.id)V.setAttribute("id",B.id);return V},G=()=>{let B=document.createElement("ul");B.className=`${$.getClass("menu-list")}`,B.setAttribute("role","menu"),Q.items.forEach((H,V)=>{if("type"in H&&H.type==="divider")B.appendChild(K(H,V));else B.appendChild(j(H,V))}),$.element.innerHTML="",$.element.appendChild(B)},Y=(B)=>{for(let H of Q.items){if("id"in H&&H.id===B)return H;if("submenu"in H&&Array.isArray(H.submenu)){for(let V of H.submenu)if("id"in V&&V.id===B)return V}}return null},z=(B,H,V)=>{if(B.preventDefault(),B.stopPropagation(),H.disabled)return;if(H.hasSubmenu&&$.submenu){$.submenu.handleSubmenuClick(H,V,B.currentTarget);return}let O=q.triggerEvent("select",{item:H,itemId:H.id,itemData:H.data},B);if(J.closeOnSelect&&!O.defaultPrevented)U(B,!0)},W=(B)=>{if(!$.element)return;$.element.querySelectorAll(`.${$.getClass("menu-item")}`).forEach((V)=>{if(V.getAttribute("data-id")===B)V.classList.add(`${$.getClass("menu-item--selected")}`),V.setAttribute("aria-selected","true");else V.classList.remove(`${$.getClass("menu-item--selected")}`),V.setAttribute("aria-selected","false")}),Q.selectedItemId=B},X=(B,H="mouse")=>{if(Q.visible)return;if(Q.visible=!0,document.removeEventListener("click",N),!$.element.parentNode)$.element.classList.remove(`${$.getClass("menu--visible")}`),$.element.setAttribute("aria-hidden","true"),$.element.style.transform="scaleY(0)",$.element.style.opacity="0",document.body.appendChild($.element);let V=Z();if(V&&$.position)$.position.positionMenu(V);setTimeout(()=>{$.element.setAttribute("aria-hidden","false"),$.element.style.transform="",$.element.style.opacity="",$.element.getBoundingClientRect(),$.element.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{if($.keyboard&&$.keyboard.handleInitialFocus)$.keyboard.handleInitialFocus($.element,H);else if(H==="keyboard"){let O=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(O.length>0)O.forEach((M)=>{M.tabIndex=-1}),O[0].tabIndex=0,O[0].focus();else $.element.tabIndex=0,$.element.focus()}else{$.element.tabIndex=-1;let O=Array.from($.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`));if(O.length>0)O.forEach((M)=>{M.tabIndex=-1}),O[0].tabIndex=0}},100),setTimeout(()=>{if(J.closeOnClickOutside&&Q.visible)document.addEventListener("click",N);if(J.closeOnEscape)document.addEventListener("keydown",F);window.addEventListener("resize",k,{passive:!0}),window.addEventListener("scroll",L,{passive:!0})},0)},20),q.triggerEvent("open",{},B)},U=(B,H=!0)=>{if(!Q.visible)return;if($.emit("menu-closing",{event:B,restoreFocus:H}),$.submenu)$.submenu.closeAllSubmenus();setTimeout(()=>{Q.visible=!1,$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("menu--visible")}`),document.removeEventListener("click",N),document.removeEventListener("keydown",F),window.removeEventListener("resize",k),window.removeEventListener("scroll",L),q.triggerEvent("close",{restoreFocus:H},B),setTimeout(()=>{if($.element.parentNode&&!Q.visible)$.element.parentNode.removeChild($.element)},300)},50)},_=(B,H="mouse")=>{if(Q.visible)U(B);else{if(B){if(B instanceof KeyboardEvent)H="keyboard";else if(B instanceof MouseEvent)H="mouse"}X(B,H)}},N=(B)=>{if(X0){X0=!1;return}if($.element.contains(B.target))return;let H=Z();if(H&&H.contains(B.target))return;if($.submenu&&$.submenu.hasOpenSubmenu()){let V=$.submenu.getActiveSubmenus();for(let O of V)if(O.element.contains(B.target))return}U(B,!1)},F=(B)=>{let H=$.element.contains(B.target),V=$.submenu&&$.submenu.hasOpenSubmenu()&&$.submenu.getActiveSubmenus().some((O)=>O.element.contains(B.target));if(Q.visible){if(H||V){if(B.key==="Escape")B.preventDefault(),U(B,!0)}else if($.keyboard&&$.keyboard.handleMenuKeydown)$.keyboard.handleMenuKeydown(B,Q,{closeMenu:U,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:Y,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null})}},k=()=>{if(Q.visible){let B=Z();if(B&&$.position)$.position.positionMenu(B)}},L=()=>{if(Q.visible)window.requestAnimationFrame(()=>{let B=Z();if(B&&$.position)$.position.positionMenu(B)})},D=()=>{if(G(),$.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers($.element,Q,{closeMenu:U,closeSubmenu:$.submenu?$.submenu.closeSubmenu:null,findItemById:Y,handleSubmenuClick:$.submenu?$.submenu.handleSubmenuClick:null,handleNestedSubmenuClick:$.submenu?$.submenu.handleNestedSubmenuClick:null});if(Q.visible){let B=Z();if(B&&$.position)$.position.positionMenu(B);if($.element.classList.add(`${$.getClass("menu--visible")}`),J.closeOnClickOutside)document.addEventListener("click",N);if(J.closeOnEscape)document.addEventListener("keydown",F);window.addEventListener("resize",k),window.addEventListener("scroll",L)}};if($.on("create-menu-items",(B)=>{let{items:H,container:V,onItemCreated:O}=B;H.forEach((M,P)=>{let R;if("type"in M&&M.type==="divider")R=K(M,P);else R=j(M,P);if(V.appendChild(R),O)O(R)})}),setTimeout(D,0),$.lifecycle){let B=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{document.removeEventListener("click",N),document.removeEventListener("keydown",F),window.removeEventListener("resize",k),window.removeEventListener("scroll",L),B()}}return{...$,menu:{open:(B,H="mouse")=>{return X(B,H),$},close:(B,H=!0)=>{return U(B,H),$},toggle:(B,H="mouse")=>{return _(B,H),$},isOpen:()=>Q.visible,setItems:(B)=>{return Q.items=B,G(),$},getItems:()=>Q.items,setPosition:(B)=>{if(Q.position=B,Q.visible){let H=Z();if(H&&$.position)$.position.positionMenu(H)}return $},getPosition:()=>Q.position,setSelected:(B)=>{return W(B),$},getSelected:()=>Q.selectedItemId}}},m$=nq;var eq=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu opener: missing element"),$;let Q=!1;document.addEventListener("keydown",(F)=>{Q=F.key==="Tab",setTimeout(()=>{Q=!1},100)});let q={openerElement:null,openerComponent:null,activeClass:""},Z=(F)=>{if(!F)return{element:null,component:null};if(typeof F==="string"){let k=document.querySelector(F);if(!k)return console.warn(`Menu opener not found: ${F}`),{element:null,component:null};return{element:k,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 k=F.getElement();if(k instanceof HTMLElement)return{element:k,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}},j=(F)=>{let k=$.getClass("").split("-")[0];if(F.tagName==="BUTTON")return`${k}-button--active`;else if(F.classList.contains(`${k}-chip`))return`${k}-chip--selected`;else if(F.classList.contains(`${k}-textfield`)||F.classList.contains(`${k}-select`))return`${k}-textfield--focused`;else return`${k}-menu-opener--active`},K=(F)=>{let{element:k,component:L}=F;if(!k)return;if(q.openerElement&&q.openerElement!==k)U();q.openerElement=k,q.openerComponent=L,q.activeClass=j(k),k.addEventListener("click",z),k.addEventListener("keydown",W),k.addEventListener("blur",X),k.setAttribute("aria-haspopup","true"),k.setAttribute("aria-expanded","false");let D=$.element.id;if(!D)D=`menu-${Date.now()}-${Math.floor(Math.random()*1000)}`,$.element.id=D;k.setAttribute("aria-controls",D)},G=(F)=>{if(!q.openerElement)return;if(q.openerComponent&&typeof q.openerComponent.setActive==="function"){q.openerComponent.setActive(F);return}if(q.openerComponent&&"selected"in q.openerComponent){q.openerComponent.selected=F;return}if(q.openerComponent&&typeof q.openerComponent.focus==="function"&&typeof q.openerComponent.blur==="function"){if(F)q.openerComponent.focus();else q.openerComponent.blur();return}if(q.openerElement.classList)if(F)q.openerElement.classList.add(q.activeClass);else q.openerElement.classList.remove(q.activeClass)},Y=()=>{if(!q.openerElement)return;if(q.openerComponent&&typeof q.openerComponent.focus==="function"){requestAnimationFrame(()=>{q.openerComponent.focus()});return}if(q.openerComponent&&"input"in q.openerComponent&&q.openerComponent.input instanceof HTMLElement){requestAnimationFrame(()=>{q.openerComponent.input.focus()});return}requestAnimationFrame(()=>{q.openerElement.focus()})},z=(F)=>{if(F.preventDefault(),$.menu)if($.menu.isOpen())$.menu.close(F);else $.menu.open(F,"mouse")},W=(F)=>{if(!$.menu)return;let k=$.menu.isOpen();switch(F.key){case"Enter":case" ":case"ArrowDown":case"Down":if(F.preventDefault(),!k)$.menu.open(F,"keyboard");break;case"Escape":if(k)F.preventDefault(),$.menu.close(F);break;case"ArrowUp":case"Up":if(F.preventDefault(),!k)$.menu.open(F,"keyboard"),setTimeout(()=>{let L=$.element.querySelectorAll(`.${$.getClass("menu-item")}:not(.${$.getClass("menu-item--disabled")})`);if(L.length>0){L.forEach((B)=>B.setAttribute("tabindex","-1"));let D=L[L.length-1];D.setAttribute("tabindex","0"),D.focus()}},100);break}},X=(F)=>{if(!$.menu||!$.menu.isOpen())return;let k=F.relatedTarget;if(Q){setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(F,!1)},10);return}if(k){if($.element.contains(k))return;if(k.getAttribute("aria-haspopup")==="true"||k.closest('[aria-haspopup="true"]'))return}setTimeout(()=>{if($.menu&&$.menu.isOpen())$.menu.close(F,!1)},50)},U=()=>{if(q.openerElement)q.openerElement.removeEventListener("click",z),q.openerElement.removeEventListener("keydown",W),q.openerElement.removeEventListener("blur",X),q.openerElement.removeAttribute("aria-haspopup"),q.openerElement.removeAttribute("aria-expanded"),q.openerElement.removeAttribute("aria-controls"),G(!1);q.openerComponent=null,q.openerElement=null,q.activeClass=""},{element:_,component:N}=Z(J.opener);if(K({element:_,component:N}),$.lifecycle){let F=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{U(),F()}}return $.on("open",()=>{if(q.openerElement)q.openerElement.setAttribute("aria-expanded","true"),G(!0)}),$.on("close",(F)=>{if(q.openerElement){if(q.openerElement.setAttribute("aria-expanded","false"),G(!1),F.restoreFocus&&!Q)Y()}}),{...$,opener:{setOpener(F){let k=Z(F);if(k.element)K(k);return $},getOpener(){return q.openerElement},getOpenerComponent(){return q.openerComponent},setActive(F){return G(F),$},focus(){return Y(),$}}}},a$=eq;var $3=(J,$)=>{let Q=(j,K,G,Y=!1)=>{if(!j||!K)return;j.style.position="absolute";let z=window.pageXOffset||document.documentElement.scrollLeft,W=window.pageYOffset||document.documentElement.scrollTop,X=j.cloneNode(!0);X.style.visibility="hidden",X.style.display="block",X.style.position="absolute",X.style.top="0",X.style.left="0",X.style.transform="none",X.style.opacity="0",X.style.pointerEvents="none",X.classList.add(`${J.getClass("menu--visible")}`),document.body.appendChild(X);let U=K.getBoundingClientRect(),_=X.getBoundingClientRect(),N=window.innerWidth,F=window.innerHeight;document.body.removeChild(X);let k=$.offset!==void 0?$.offset:8,L=0,D=0,B=G;if(Y){if(B=G||"right-start",B.startsWith("right")&&U.right+_.width+k>N-16)B=B.replace("right","left");else if(B.startsWith("left")&&U.left-_.width-k<16)B=B.replace("left","right");if(U.top+_.height>F-48){if(B==="right-start")B="right-end";else if(B==="left-start")B="left-end"}}else switch(G){case"top-start":case"top":case"top-end":if(U.top<_.height+k+48)B=G.replace("top","bottom");break;case"bottom-start":case"bottom":case"bottom-end":if(U.bottom+_.height+k+48>F){if(U.top>F-U.bottom)B=G.replace("bottom","top")}break;case"right-start":case"right":case"left-start":case"left":if(U.bottom+_.height>F-48){if(G==="right-start")B="right-end";else if(G==="left-start")B="left-end";else if(G==="right")L=U.top-(_.height-U.height)-k;else if(G==="left")L=U.top-(_.height-U.height)-k}break}if(["position-top","position-bottom","position-right","position-left"].forEach((R)=>{j.classList.remove(`${J.getClass("menu")}--${R}`)}),B.startsWith("top")||B==="right-end"||B==="left-end"||B==="right"&&L<U.top||B==="left"&&L<U.top)j.classList.add(`${J.getClass("menu")}--position-top`);else if(B.startsWith("left"))j.classList.add(`${J.getClass("menu")}--position-left`);else if(B.startsWith("right"))j.classList.add(`${J.getClass("menu")}--position-right`);else j.classList.add(`${J.getClass("menu")}--position-bottom`);switch(B){case"top-start":L=U.top+W-_.height-k,D=U.left+z;break;case"top":L=U.top+W-_.height-k,D=U.left+z+U.width/2-_.width/2;break;case"top-end":L=U.top+W-_.height-k,D=U.right+z-_.width;break;case"right-start":L=U.top+W,D=U.right+z+k;break;case"right":if(L===0)L=U.top+W+U.height/2-_.height/2;else L+=W;D=U.right+z+k;break;case"right-end":L=U.bottom+W-_.height,D=U.right+z+k;break;case"bottom-start":L=U.bottom+W+k,D=U.left+z;break;case"bottom":L=U.bottom+W+k,D=U.left+z+U.width/2-_.width/2;break;case"bottom-end":L=U.bottom+W+k,D=U.right+z-_.width;break;case"left-start":L=U.top+W,D=U.left+z-_.width-k;break;case"left":if(L===0)L=U.top+W+U.height/2-_.height/2;else L+=W;D=U.left+z-_.width-k;break;case"left-end":L=U.bottom+W-_.height,D=U.left+z-_.width-k;break}let O=48;if(L-W<O)L=O+W;let M=48;if(L-W+_.height>F-M){let R=F-(L-W)-M,y=Math.min(_.height,100),x=Math.max(R,y);if(j.style.maxHeight=`${x}px`,$.maxHeight){let A=parseInt($.maxHeight,10);if(!isNaN(A)&&A<parseInt(j.style.maxHeight||"0",10))j.style.maxHeight=$.maxHeight}}else if($.maxHeight)j.style.maxHeight=$.maxHeight;if($.width==="100%"&&!Y)j.style.width=`${U.width}px`;if(j.style.top=`${Math.max(O+W,L)}px`,j.style.left=`${Math.max(16+z,D)}px`,D-z+_.width>N-16)j.style.left="auto",j.style.right="16px"};return{positionMenu:(j)=>{if(!j||!J.element)return;Q(J.element,j,$.position,!1)},positionSubmenu:(j,K,G=1)=>{if(!j||!K)return;let Y=G%2===1?"right-start":"left-start";j.style.zIndex=`${1000+G*10}`,Q(j,K,Y,!0)},positionElement:Q}},J3=(J)=>($)=>{if(!$.element)return $;let Q=$3($,J);return{...$,position:Q}},i$=J3;var Q3=(J)=>{let $=!1;(()=>{document.addEventListener("keydown",(Y)=>{$=Y.key==="Tab",setTimeout(()=>{$=!1},100)})})();let q=()=>{let z=document.querySelectorAll('a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');return Array.from(z).filter((W)=>{return W.offsetParent!==null&&!W.classList.contains("hidden")})},Z=(Y,z)=>{if(z==="keyboard"){let W=Array.from(Y.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(W.length>0)W[0].setAttribute("tabindex","0"),W[0].focus();else Y.setAttribute("tabindex","0"),Y.focus()}else{Y.setAttribute("tabindex","-1");let W=Y.querySelector(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(W)W.setAttribute("tabindex","0")}},j=(Y,z,W)=>{let X=z.activeSubmenu&&z.activeSubmenu.contains(Y.target),U=X?z.activeSubmenu:J.element,_=Array.from(U.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`));if(_.length===0)return;let N=document.activeElement,F=-1;if(N&&_.includes(N))F=_.indexOf(N);let k=(L)=>{if(_[L])_[L].focus()};switch(Y.key){case"ArrowDown":case"Down":if(Y.preventDefault(),F<0)k(0);else if(F<_.length-1)k(F+1);else k(0);break;case"ArrowUp":case"Up":if(Y.preventDefault(),F<0)k(_.length-1);else if(F>0)k(F-1);else k(_.length-1);break;case"Home":Y.preventDefault(),k(0);break;case"End":Y.preventDefault(),k(_.length-1);break;case"Enter":case" ":if(Y.preventDefault(),F>=0)_[F].click();break;case"ArrowRight":case"Right":if(Y.preventDefault(),X){if(F>=0&&_[F].classList.contains(`${J.getClass("menu-item--submenu")}`)){let D=_[F],B=parseInt(D.getAttribute("data-index"),10),V=D.closest(`.${J.getClass("menu--submenu")}`)?.getAttribute("data-parent-item"),O=W.findItemById(V);if(O&&O.submenu){let M=O.submenu[B];W.handleNestedSubmenuClick(M,B,D)}}}else if(F>=0&&_[F].classList.contains(`${J.getClass("menu-item--submenu")}`)){let D=_[F],B=parseInt(D.getAttribute("data-index"),10),H=z.items[B];W.handleSubmenuClick(H,B,D)}break;case"ArrowLeft":case"Left":if(Y.preventDefault(),X)if(z.activeSubmenuItem){let D=z.activeSubmenuItem,B=parseInt(U.getAttribute("data-level")||"1",10);if(W.closeSubmenu(B),D)D.focus()}else W.closeSubmenu(1);break;case"Escape":if(Y.preventDefault(),X)if(z.activeSubmenuItem){let D=z.activeSubmenuItem,B=parseInt(U.getAttribute("data-level")||"1",10);if(W.closeSubmenu(B),D)D.focus()}else W.closeSubmenu(1);else W.closeMenu(Y,!0);break;case"Tab":Y.preventDefault();let L=J.opener?.getOpener?.();if(W.closeMenu(Y,!0),L)setTimeout(()=>{if(Y.shiftKey);else{let D=q(),B=D.indexOf(L);if(B>=0&&B<D.length-1)D[B+1].focus()}},0);break}};return{handleInitialFocus:Z,handleMenuKeydown:j,setupKeyboardHandlers:(Y,z,W)=>{let X=Y.querySelectorAll(`.${J.getClass("menu-item")}:not(.${J.getClass("menu-item--disabled")})`);if(X.forEach((U)=>{U.tabIndex=-1}),X.length>0)X[0].tabIndex=0;Y.addEventListener("keydown",(U)=>j(U,z,W))},isTabNavigationActive:()=>$,getFocusableElements:q}},q3=()=>(J)=>{if(!J.element)return J;let $=Q3(J);return{...J,keyboard:$}},c$=q3;var Z3=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize menu submenu: missing element"),$;let Q={activeSubmenu:null,activeSubmenuItem:null,submenuLevel:0,activeSubmenus:[],submenuTimer:null,hoverIntent:{timer:null,activeItem:null},component:$},q=()=>{if(Q.hoverIntent.timer)clearTimeout(Q.hoverIntent.timer),Q.hoverIntent.timer=null,Q.hoverIntent.activeItem=null},Z=()=>{if(Q.submenuTimer)clearTimeout(Q.submenuTimer),Q.submenuTimer=null},j=(D,B,H)=>{if(!J.openSubmenuOnHover||!D.hasSubmenu)return;q(),Z(),Q.hoverIntent.activeItem=H,Q.hoverIntent.timer=setTimeout(()=>{if(H.matches(":hover")){if(Q.activeSubmenuItem!==H)z(D,B,H)}Q.hoverIntent.timer=null},100)},K=()=>{q(),Z(),Q.submenuTimer=setTimeout(()=>{let{activeSubmenu:D,activeSubmenuItem:B}=Q;if(D&&B){let H=D.matches(":hover"),V=B.matches(":hover");if(!H&&!V)W(Q.submenuLevel)}Q.submenuTimer=null},300)},G=(D,B,H)=>{if(!D.submenu||!D.hasSubmenu)return;let V=H.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((M)=>M.isOpening))return;if(V){let M=parseInt(H.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"0",10);W(M+1),H.setAttribute("aria-expanded","false")}else z(D,B,H)},Y=(D,B,H)=>{if(!D.submenu||!D.hasSubmenu)return;let V=H.getAttribute("aria-expanded")==="true";if(Q.activeSubmenus.some((M)=>M.isOpening))return;if(V){let M=parseInt(H.closest(`.${$.getClass("menu--submenu")}`)?.getAttribute("data-level")||"1",10);W(M+1)}else z(D,B,H)},z=(D,B,H)=>{if(!D.submenu||!D.hasSubmenu)return;let V=H.closest(`.${$.getClass("menu--submenu")}`)?parseInt(H.closest(`.${$.getClass("menu--submenu")}`).getAttribute("data-level")||"0",10)+1:1;if(W(V),Q.activeSubmenus.findIndex((y)=>y.menuItem===H&&y.isOpening)>=0)return;H.setAttribute("aria-expanded","true");let M=document.createElement("div");M.className=`${$.getClass("menu")} ${$.getClass("menu--submenu")}`,M.setAttribute("role","menu"),M.setAttribute("tabindex","-1"),M.setAttribute("data-level",V.toString()),M.setAttribute("data-parent-item",D.id),M.style.zIndex=`${1000+V*10}`;let P=document.createElement("ul");P.className=`${$.getClass("menu-list")}`;let R=[];if($.emit("create-menu-items",{items:D.submenu,container:P,level:V,onItemCreated:(y)=>{if(!y.classList.contains(`${$.getClass("menu-item--disabled")}`))R.push(y)}}),M.appendChild(P),document.body.appendChild(M),$.position&&$.position.positionSubmenu)$.position.positionSubmenu(M,H,V);if($.keyboard&&$.keyboard.setupKeyboardHandlers)$.keyboard.setupKeyboardHandlers(M,{activeSubmenus:Q.activeSubmenus},{closeSubmenu:W,handleNestedSubmenuClick:Y});M.addEventListener("mouseenter",()=>{Z()}),M.addEventListener("mouseleave",()=>{K()}),Q.activeSubmenu=M,Q.activeSubmenuItem=H,Q.activeSubmenus.push({element:M,menuItem:H,level:V,isOpening:!0}),Q.submenuLevel=V,document.addEventListener("click",U),window.addEventListener("resize",_,{passive:!0}),window.addEventListener("scroll",N,{passive:!0}),requestAnimationFrame(()=>{M.classList.add(`${$.getClass("menu--visible")}`),setTimeout(()=>{let y=Q.activeSubmenus.findIndex((x)=>x.element===M);if(y!==-1)Q.activeSubmenus[y].isOpening=!1;if(R.length>0){if(V>=2||document.activeElement===H)R[0].setAttribute("tabindex","0"),R[0].focus()}},300)}),$.emit("submenu-opened",{submenuElement:M,parentItem:H,level:V,item:D})},W=(D)=>{q(),Z();let B=[];for(let H=Q.activeSubmenus.length-1;H>=0;H--)if(Q.activeSubmenus[H].level>=D){let V=Q.activeSubmenus[H];if(V.menuItem)V.menuItem.setAttribute("aria-expanded","false");V.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(V.element.parentNode)V.element.parentNode.removeChild(V.element)},200),B.push(H)}if(B.forEach((H)=>{Q.activeSubmenus.splice(H,1)}),Q.activeSubmenus.length>0){let H=Q.activeSubmenus[Q.activeSubmenus.length-1];if(Q.activeSubmenu=H.element,Q.activeSubmenuItem=H.menuItem,Q.submenuLevel=H.level,H.menuItem)H.menuItem.focus()}else Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.submenuLevel=0;$.emit("submenu-closed",{level:D})},X=()=>{if(q(),Z(),Q.activeSubmenus.length===0)return;[...Q.activeSubmenus].forEach((D)=>{if(D.menuItem)D.menuItem.setAttribute("aria-expanded","false");D.element.classList.remove(`${$.getClass("menu--visible")}`),setTimeout(()=>{if(D.element.parentNode)D.element.parentNode.removeChild(D.element)},200)}),Q.activeSubmenu=null,Q.activeSubmenuItem=null,Q.activeSubmenus=[],Q.submenuLevel=0,document.removeEventListener("click",U),window.removeEventListener("resize",_),window.removeEventListener("scroll",N),$.emit("all-submenus-closed",{})},U=(D)=>{if(!Q.activeSubmenu)return;let{activeSubmenu:B,activeSubmenuItem:H}=Q;if(B.contains(D.target)||H&&H.contains(D.target))return;X()},_=()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)},N=()=>{window.requestAnimationFrame(()=>{if(Q.activeSubmenu&&Q.activeSubmenuItem&&$.position)$.position.positionSubmenu(Q.activeSubmenu,Q.activeSubmenuItem,Q.submenuLevel)})},F=()=>{return Q.activeSubmenus.length>0},k=()=>{return Q.submenuLevel},L=()=>{return[...Q.activeSubmenus]};if($.lifecycle){let D=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(q(),Z(),document.removeEventListener("click",U),window.removeEventListener("resize",_),window.removeEventListener("scroll",N),Q.activeSubmenus.length>0)Q.activeSubmenus.forEach((B)=>{if(B.element.parentNode)B.element.parentNode.removeChild(B.element)});D()}}return $.on("menu-closing",()=>{X()}),{...$,submenu:{openSubmenu:z,closeSubmenu:W,closeAllSubmenus:X,handleSubmenuClick:G,handleNestedSubmenuClick:Y,handleSubmenuHover:j,handleSubmenuLeave:K,hasOpenSubmenu:F,getSubmenuLevel:k,getActiveSubmenus:L}}},o$=Z3;var B0=({menu:J,opener:$,events:Q,lifecycle:q})=>(Z)=>{return{element:Z.element,open(K,G="mouse"){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard"}return J.open(K,G),this},close(K,G=!0,Y=!1){return J.close(K,G,Y),this},toggle(K,G){if(K&&!G){if(K instanceof KeyboardEvent)G="keyboard";else if(K instanceof MouseEvent)G="mouse"}return J.toggle(K,G),this},isOpen(){return J.isOpen()},setItems(K){return J.setItems(K),this},getItems(){return J.getItems()},setOpener(K){return $.setOpener(K),this},getOpener(){return $.getOpener()},setPosition(K){return J.setPosition(K),this},getPosition(){return J.getPosition()},setSelected(K){return J.setSelected(K),this},getSelected(){return J.getSelected()},on(K,G){if(Q?.on)Q.on(K,G);else if(Z.on)Z.on(K,G);return this},off(K,G){if(Q?.off)Q.off(K,G);else if(Z.off)Z.off(K,G);return this},destroy(){q.destroy()}}};c();var t$={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"},p6={POSITION:t$.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},F0={MOUSE:"mouse",KEYBOARD:"keyboard"},H0={ITEM:"item",DIVIDER:"divider"},M0={OPEN:"open",CLOSE:"close",SELECT:"select"},p7={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"};var j3={items:[],position:p6.POSITION,closeOnSelect:p6.CLOSE_ON_SELECT,closeOnClickOutside:p6.CLOSE_ON_CLICK_OUTSIDE,closeOnEscape:p6.CLOSE_ON_ESCAPE,openSubmenuOnHover:p6.OPEN_SUBMENU_ON_HOVER,offset:p6.OFFSET,autoFlip:p6.AUTO_FLIP,visible:!1},k0=(J)=>{if(!J.opener)throw new Error("Menu component requires an opener element or selector");return C(j3,J,"menu")},N0=(J)=>{let $={};if(J.width)$.width=J.width;if(J.maxHeight)$.maxHeight=J.maxHeight;let Q={role:"menu",tabindex:"-1","aria-hidden":(!J.visible).toString(),style:Object.entries($).map(([q,Z])=>`${q}: ${Z}`).join(";")};return f(J,{tag:"div",attributes:Q,className:[J.visible?p7.VISIBLE:null,J.class].filter(Boolean),forwardEvents:{keydown:!0}})},L0=(J)=>({menu:{open:($,Q)=>J.menu?.open($,Q),close:($,Q,q)=>J.menu?.close($,Q,q),toggle:($,Q)=>J.menu?.toggle($,Q),isOpen:()=>J.menu?.isOpen()||!1,setItems:($)=>J.menu?.setItems($),getItems:()=>J.menu?.getItems()||[],setPosition:($)=>J.menu?.setPosition($),getPosition:()=>J.menu?.getPosition(),setSelected:($)=>J.menu?.setSelected($),getSelected:()=>J.menu?.getSelected()},opener:{setOpener:($)=>J.opener?.setOpener($),getOpener:()=>J.opener?.getOpener()},submenu:{hasOpenSubmenu:()=>J.submenu?.hasOpenSubmenu()||!1,closeAllSubmenus:()=>J.submenu?.closeAllSubmenus()},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy()}});var K3=(J)=>{try{let $=k0(J);return I(T,h(),S(N0($)),i$($),c$(),o$($),m$($),a$($),b(),(q)=>B0(L0(q))(q))($)}catch($){throw console.error("Menu creation error:",$),new Error(`Failed to create menu: ${$.message}`)}},s7=K3;n();s();i();var V0=(J)=>($)=>{return{...$,element:$.element,items:$.items||new Map,addItem(q){if(typeof $.addItem==="function")$.addItem(q);return this},removeItem(q){if(typeof $.removeItem==="function")$.removeItem(q);return this},getItem(q){if(typeof $.getItem==="function")return $.getItem(q);return this.items.get(q)},getAllItems(){if(typeof $.getAllItems==="function")return $.getAllItems();return Array.from(this.items.values())},getActive(){if(typeof $.getActive==="function")return $.getActive();return null},getItemPath(q){if(typeof $.getItemPath==="function")return $.getItemPath(q);return[]},setActive(q){if(typeof $.handleItemClick==="function")$.handleItemClick(q);else if(typeof $.setActive==="function")$.setActive(q);else{let Z=this.items.get(q);if(Z&&Z.element){if($.emit)$.emit("change",{id:q,item:Z,source:"api"})}}return this},enable(){if(J.disabled.enable)J.disabled.enable();return this},disable(){if(J.disabled.disable)J.disabled.disable();return this},expand(){if(this.element.classList.remove(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","false"),$.emit)$.emit("expanded",{source:"api"});return this},collapse(){if(this.element.classList.add(`${this.element.className.split(" ")[0]}--hidden`),this.element.setAttribute("aria-hidden","true"),$.emit)$.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(q,Z){if($.on)$.on(q,Z);return this},off(q,Z){if($.off)$.off(q,Z);return this},destroy(){if(J.lifecycle.destroy)J.lifecycle.destroy()}}};var n$={RAIL:"rail",DRAWER:"drawer",BAR:"bar",MODAL:"modal",STANDARD:"standard"},e$={LEFT:"left",RIGHT:"right",TOP:"top",BOTTOM:"bottom"},$8={FIXED:"fixed",DISMISSIBLE:"dismissible",MODAL:"modal"},_0={ACTIVE:"active",DISABLED:"disabled",EXPANDED:"expanded",COLLAPSED:"collapsed",HOVERED:"hovered",FOCUSED:"focused",PRESSED:"pressed"},m7={CHANGE:"change",EXPAND:"expand",COLLAPSE:"collapse",GROUP_EXPAND:"group:expand",GROUP_COLLAPSE:"group:collapse"},Y9={VARIANT:n$.STANDARD,POSITION:e$.LEFT,BEHAVIOR:$8.FIXED,EXPANDED:!1,SHOW_LABELS:!0,SCRIM_ENABLED:!0},o={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 G3=(J)=>{let $=document.createElement("span");return $.className=`${J}-${o.EXPAND_ICON}`,$.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
- `,$},Uj=(J,$,Q)=>{let Z=document.createElement("div");return Z.className=`${$}-${n.NESTED_CONTAINER}`,Z.setAttribute("role","menu"),Z.hidden=!0,J.forEach((q)=>{Q(q,Z,$)}),Z},M$=(J,$,Q)=>{let Z=document.createElement("div");Z.className=`${Q}-${n.ITEM_CONTAINER}`;let q=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",G=$.closest(`.${Q}-nav--drawer, .${Q}-nav--drawer-modal, .${Q}-nav--drawer-standard`)!==null,K=document.createElement("button");if(K.className=`${Q}-${n.ITEM}`,K.type="button",J.items?.length)if(G)K.setAttribute("role","button"),K.setAttribute("aria-expanded",J.expanded?"true":"false"),K.setAttribute("aria-haspopup","menu");else K.setAttribute("role","button");else if(q)K.setAttribute("role","menuitem");else if(j)K.setAttribute("role","tab"),K.setAttribute("aria-selected",J.active?"true":"false"),K.setAttribute("tabindex",J.active?"0":"-1");if(J.id)K.dataset.id=J.id;if(J.disabled)K.disabled=!0,K.setAttribute("aria-disabled","true");if(J.icon){let z=document.createElement("span");z.className=`${Q}-${n.ICON}`,z.innerHTML=J.icon,K.appendChild(z)}if(J.label){let z=document.createElement("a");z.className=`${Q}-${n.LABEL}`,z.textContent=J.label,z.href=`/${J.id}`,z.style.textDecoration="none",z.style.color="inherit",z.style.pointerEvents="none",z.setAttribute("title",J.label),K.appendChild(z),K.setAttribute("aria-label",J.label)}if(J.badge){let z=document.createElement("span");z.className=`${Q}-${n.BADGE}`,z.textContent=J.badge,z.setAttribute("aria-label",`${J.badge} notifications`),K.appendChild(z)}if(J.active&&!J.items?.length){if(K.classList.add(`${Q}-${n.ACTIVE}`),!j)K.setAttribute("aria-current","page")}if(Z.appendChild(K),J.items?.length&&G){let z=Yj(Q);K.appendChild(z);let W=Uj(J.items,Q,M$);W.hidden=!J.expanded,Z.appendChild(W),K.addEventListener("click",(Y)=>{Y.stopPropagation();let U=K.getAttribute("aria-expanded")==="true";if(K.setAttribute("aria-expanded",(!U).toString()),W.hidden=U,z.style)z.style.transform=U?"":"rotate(90deg)"})}return $.appendChild(Z),K},Q1=(J,$)=>{let Q=J.closest(`.${$}-${n.ITEM_CONTAINER}`);if(!Q)return[];let Z=Q.querySelector(`.${$}-${n.NESTED_CONTAINER}`);if(!Z)return[];return Array.from(Z.querySelectorAll(`.${$}-${n.ITEM}`)).reduce((j,G)=>{return[...j,G,...Q1(G,$)]},[])};function Xj(J,$){if(!J)return null;let Q=J.getAttribute("data-id");if(Q)return Q;if(J.classList.contains(`${$}-nav--rail`))return"rail";if(J.classList.contains(`${$}-nav--drawer`))return"drawer";return null}var UQ=(J)=>($)=>{let Q=new Map,Z=null,q=J.prefix||"mtrl",j=(z,W)=>{if(Q.set(z.id,{element:W,config:z}),z.items?.length)z.items.forEach((Y)=>{let U=W.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U){let X=U.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(X){let _=X.querySelector(`[data-id="${Y.id}"]`);if(_)j(Y,_)}}})},G=(z,W,Y)=>{let U=z.getAttribute("role");if(Y){if(z.classList.add(`${q}-${n.ACTIVE}`),U==="tab")z.setAttribute("aria-selected","true"),z.setAttribute("tabindex","0");else if(!z.getAttribute("aria-haspopup"))z.setAttribute("aria-current","page")}else if(z.classList.remove(`${q}-${n.ACTIVE}`),U==="tab")z.setAttribute("aria-selected","false"),z.setAttribute("tabindex","-1");else if(z.hasAttribute("aria-current"))z.removeAttribute("aria-current")};if(J.items)J.items.forEach((z)=>{let W=M$(z,$.element,q);if(j(z,W),z.active)Z={element:W,config:z},G(W,Z,!0)});if($.emit)$.element.addEventListener("mouseover",(z)=>{let Y=z.target.closest("[data-id]");if(Y){let U=Y.dataset.id;if(U)$.emit("mouseover",{id:U,clientX:z.clientX,clientY:z.clientY,target:Y,item:Q.get(U)})}},{passive:!0}),$.element.addEventListener("mouseenter",(z)=>{let W=$.element.dataset.id||$.componentName||"nav";$.emit("mouseenter",{clientX:z.clientX,clientY:z.clientY,id:W})},{passive:!0}),$.element.addEventListener("mouseleave",(z)=>{let W=z.relatedTarget,Y=Xj(W,q),U=$.element.dataset.id||$.componentName||"nav";$.emit("mouseleave",{clientX:z.clientX,clientY:z.clientY,relatedTargetId:Y,id:U})});if($.lifecycle){let z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Q.clear(),z)z()}}let K=(z)=>{let W=[z],Y=Q.get(z);if(!Y)return W;let U=Y.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(!U)return W;let X=U.parentElement;if(!X||!X.classList.contains(`${q}-${n.NESTED_CONTAINER}`))return W;let _=X;while(_){let H=_.parentElement;if(!H||!H.classList.contains(`${q}-${n.ITEM_CONTAINER}`))break;let B=H.querySelector(`.${q}-${n.ITEM}[data-id]`);if(!B)break;let M=B.getAttribute("data-id");if(!M)break;W.unshift(M);let k=H.parentElement;if(!k||!k.classList.contains(`${q}-${n.NESTED_CONTAINER}`))break;_=k}return W};return{...$,items:Q,addItem(z){if(Q.has(z.id))return this;let W=M$(z,$.element,q);if(j(z,W),z.active)this.setActive(z.id);if($.emit)$.emit("itemAdded",{id:z.id,item:{element:W,config:z}});return this},removeItem(z){let W=Q.get(z);if(!W)return this;if(Q1(W.element,q).forEach((X)=>{let _=X.dataset.id;if(_)Q.delete(_)}),Z?.config.id===z)Z=null;let U=W.element.closest(`.${q}-${n.ITEM_CONTAINER}`);if(U)U.remove();if(Q.delete(z),$.emit)$.emit("itemRemoved",{id:z,item:W});return this},getItem:(z)=>Q.get(z),getAllItems:()=>Array.from(Q.values()),getActive:()=>Z,getItemPath:(z)=>K(z),setActive(z){let W=Q.get(z);if(!W||W.config.disabled)return this;if(Z)G(Z.element,Z,!1);if(G(W.element,W,!0),Z=W,K(z).forEach((U)=>{let X=Q.get(U);if(X){let _=X.element,H=_.closest(`.${q}-${n.ITEM_CONTAINER}`);if(H){let B=H.querySelector(`.${q}-${n.NESTED_CONTAINER}`);if(B)_.setAttribute("aria-expanded","true"),B.hidden=!1}}}),$.emit)$.emit(k$.CHANGE,{id:z,item:W,previousItem:Z,path:K(z)});return this}}};var i6={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 XQ=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=(G,K)=>{if(!G)return;let z=G.getAttribute("role");if(K){if(G.classList.add(`${Q}-${i6.ITEM}--active`),z==="tab")G.setAttribute("aria-selected","true"),G.setAttribute("tabindex","0");else if(!G.getAttribute("aria-haspopup"))G.setAttribute("aria-current","page")}else if(G.classList.remove(`${Q}-${i6.ITEM}--active`),z==="tab")G.setAttribute("aria-selected","false"),G.setAttribute("tabindex","-1");else if(G.hasAttribute("aria-current"))G.removeAttribute("aria-current")},q=(G)=>{if(G.getAttribute("aria-expanded")===null)return!1;let z=G.getAttribute("aria-expanded")==="true";G.setAttribute("aria-expanded",(!z).toString());let W=G.closest(`.${Q}-${i6.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(W){let U=W.querySelector(`.${Q}-${i6.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(U){U.hidden=z;let X=G.querySelector(`.${Q}-${i6.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(X&&X.style)X.style.transform=z?"":"rotate(90deg)"}}let Y=G.dataset.id;if(Y&&$.emit)$.emit("expandToggle",{id:Y,expanded:!z});return!0},j={...$,handleItemClick(G){if(!$.items)return;let K=$.items.get(G);if(!K)return;let z=$.element.querySelector(`.${Q}-${i6.ITEM}--active, .mtrl-nav-item--active`);if(z)Z(z,!1);if(K.element)Z(K.element,!0);if($.emit){let W=$.getItemPath?$.getItemPath(G):[];$.emit("change",{id:G,item:K,previousItem:z?{element:z,config:{id:z.dataset.id}}:null,path:W,source:"userAction"})}}};return $.element.addEventListener("click",(G)=>{let K=G.target,z=K.closest(`.${Q}-${i6.ITEM}, .mtrl-nav-item`);if(!z){if(!K.closest("[data-id]"))return}let W=z||K.closest("[data-id]");if(W.hasAttribute("disabled")||W.getAttribute("aria-disabled")==="true")return;let Y=W.dataset.id;if(!Y)return;if(q(W))return;j.handleItemClick(Y)}),$.element.addEventListener("keydown",(G)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(G.key))return;let K=["rail","drawer"].includes($.variant||""),z=["bar"].includes($.variant||"");if(G.key==="Enter"||G.key===" "){let _=document.activeElement;if(_&&_.classList.contains(`${Q}-${i6.ITEM}`)){if(G.preventDefault(),_.dataset.id)_.click()}return}let W=Array.from($.element.querySelectorAll(`.${Q}-${i6.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
- .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(W.length===0)return;let Y=document.activeElement,U=W.indexOf(Y),X=-1;if(K&&(G.key==="ArrowDown"||G.key==="ArrowRight")||z&&G.key==="ArrowRight")X=U<0?0:(U+1)%W.length;else if(K&&(G.key==="ArrowUp"||G.key==="ArrowLeft")||z&&G.key==="ArrowLeft")X=U<0?W.length-1:(U-1+W.length)%W.length;else if(G.key==="Home")X=0;else if(G.key==="End")X=W.length-1;if(X>=0)G.preventDefault(),W[X].focus()}),j};t();var Bj={variant:_9.VARIANT,position:_9.POSITION,behavior:_9.BEHAVIOR,items:[],showLabels:_9.SHOW_LABELS,scrimEnabled:_9.SCRIM_ENABLED},BQ=(J={})=>u(Bj,J,"nav"),FQ=(J)=>{let $=J.variant?`${J.prefix}-${n.VARIANT_PREFIX}${J.variant}`:"",Q=J.position?`${J.prefix}-${n.POSITION_PREFIX}${J.position}`:"",Z=J.class||"",q=[$,Q,Z].filter(Boolean);return p(J,{tag:"nav",attributes:{role:"navigation","aria-label":J.ariaLabel||"Main Navigation"},className:q})},HQ=(J)=>({disabled:{enable:J.disabled?.enable||(()=>{}),disable:J.disabled?.disable||(()=>{})},lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})}});var Fj=(J,$)=>{let{element:Q}=J,Z=$.variant||"rail",q=$.prefix||"mtrl";if(Q.setAttribute("aria-label",$.ariaLabel||"Main Navigation"),Z==="bar")if(!$.items?.some((G)=>G.items?.length))Q.setAttribute("role","tablist"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","menubar"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","navigation");if((Z==="modal"||Z==="drawer"&&$.behavior==="dismissible")&&!$.expanded)Q.classList.add(`${q}-nav--hidden`)},Hj=(J={})=>{let $=BQ(J);try{let Z=b(S,d(),h(FQ($)),K6($),g7($),UQ($),XQ($),G6($),C(),(q)=>WQ(HQ(q))(q))($);if(Fj(Z,$),$.disabled)Z.disable();if(Z.element.dataset.componentType="navigation",$.variant)Z.element.dataset.variant=$.variant;return Z}catch(Q){throw new Error(`Failed to create navigation: ${Q instanceof Error?Q.message:String(Q)}`)}},w7=Hj;m6();J6();c();o();var kQ=(J)=>($)=>{let Q=[],Z=$.getClass("radios"),q=J.value||"";if($.element.classList.add(`${Z}--${J.direction||"vertical"}`),J.disabled)$.element.classList.add(`${Z}--disabled`);let j=(z)=>{let W=document.createElement("div");W.classList.add(`${Z}-item`);let Y=document.createElement("input");if(Y.type="radio",Y.name=J.name,Y.value=z.value,Y.classList.add(`${Z}-input`),q===z.value)Y.checked=!0;if(J.disabled||z.disabled)Y.disabled=!0,W.classList.add(`${Z}-item--disabled`);let U=document.createElement("label");U.classList.add(`${Z}-label`);let X=document.createElement("span");X.classList.add(`${Z}-control`);let _=document.createElement("span");if(_.classList.add(`${Z}-circle`),J.ripple!==!1){let k=document.createElement("span");k.classList.add(`${Z}-ripple`),X.appendChild(k)}X.appendChild(_);let H=document.createElement("span");if(H.classList.add(`${Z}-text`),H.textContent=z.label,z.labelBefore)U.classList.add(`${Z}-label--before`),U.appendChild(H),U.appendChild(X);else U.appendChild(X),U.appendChild(H);let B=`${Z}-${z.value}-${Math.random().toString(36).substring(2,9)}`;Y.id=B,U.htmlFor=B,W.appendChild(Y),W.appendChild(U);let M=(k)=>{if(Y.checked){if(q=z.value,Q.forEach((N)=>{if(N.input!==Y)N.input.checked=!1}),$.events&&typeof $.events.emit==="function")$.events.emit("change",{value:z.value,originalEvent:k,option:z});else if(typeof $.on==="function"){let N=new CustomEvent("change",{detail:{value:z.value,originalEvent:k,option:z}});$.element.dispatchEvent(N)}}};return Y.addEventListener("change",M),{element:W,input:Y,label:U,config:z,destroy:()=>{if(Y.removeEventListener("change",M),W.parentNode)W.parentNode.removeChild(W)}}},G=(z)=>{let W=j(z);return $.element.appendChild(W.element),Q.push(W),$},K=(z)=>{let W=Q.findIndex((Y)=>Y.config.value===z);if(W!==-1){if(Q[W].destroy(),Q.splice(W,1),q===z)q=""}return $};if(J.options&&Array.isArray(J.options))J.options.forEach((z)=>G(z));if(!$.events)$.events={on:(z,W)=>{$.element.addEventListener(z,(Y)=>W(Y.detail))},off:(z,W)=>{$.element.removeEventListener(z,W)},emit:(z,W)=>{let Y=new CustomEvent(z,{detail:W});$.element.dispatchEvent(Y)}};return{...$,radios:Q,getValue:()=>q,setValue:(z)=>{return q=z,Q.forEach((W)=>{W.input.checked=W.config.value===z}),$},getSelected:()=>{let z=Q.find((W)=>W.config.value===q);return z?z.config:null},addOption:G,removeOption:K,enable:()=>{return $.element.classList.remove(`${Z}--disabled`),Q.forEach((z)=>{if(z.input.disabled=z.config.disabled||!1,!z.config.disabled)z.element.classList.remove(`${Z}-item--disabled`)}),$},disable:()=>{return $.element.classList.add(`${Z}--disabled`),Q.forEach((z)=>{z.input.disabled=!0,z.element.classList.add(`${Z}-item--disabled`)}),$},enableOption:(z)=>{let W=Q.find((Y)=>Y.config.value===z);if(W){if(W.config.disabled=!1,W.input.disabled=$.element.classList.contains(`${Z}--disabled`),!W.input.disabled)W.element.classList.remove(`${Z}-item--disabled`)}return $},disableOption:(z)=>{let W=Q.find((Y)=>Y.config.value===z);if(W)W.config.disabled=!0,W.input.disabled=!0,W.element.classList.add(`${Z}-item--disabled`);return $}}};var MQ=({disabled:J,lifecycle:$})=>(Q)=>{if(!Q.events)Q.events={on:(q,j)=>{Q.element.addEventListener(q,(G)=>j(G.detail))},off:(q,j)=>{Q.element.removeEventListener(q,j)},emit:(q,j)=>{let G=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(G)}};else if(!Q.events.emit)Q.events.emit=(q,j)=>{let G=new CustomEvent(q,{detail:j});Q.element.dispatchEvent(G)};return{element:Q.element,radios:Q.radios,lifecycle:{destroy:$.destroy},getClass:Q.getClass,getValue:()=>Q.getValue(),setValue(q){return Q.setValue(q),this},getSelected:()=>Q.getSelected(),addOption(q){return Q.addOption(q),this},removeOption(q){return Q.removeOption(q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},enableOption(q){return Q.enableOption(q),this},disableOption(q){return Q.disableOption(q),this},on(q,j){return Q.events.on(q,j),this},off(q,j){return Q.events.off(q,j),this},destroy(){Q.radios.forEach((q)=>q.destroy()),$.destroy()}}};t();var kj={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},VQ=(J)=>u(kj,J,"radios"),NQ=(J)=>{return p(J,{tag:"div",attributes:{role:"radiogroup"},className:J.class})},_Q=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Mj=(J)=>{if(!J.name)J.name=`radios-${Math.random().toString(36).substring(2,9)}`;let $=VQ(J);try{return b(S,d(),h(NQ($)),kQ($),G6($),C(),(Z)=>MQ(_Q(Z))(Z))($)}catch(Q){throw console.error("Radios creation error:",Q),new Error(`Failed to create radios component: ${Q.message}`)}},LQ=Mj;var DQ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",FOCUSED:"focused"},Z1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},q1={STANDARD:"standard",FILLED:"filled",OUTLINED:"outlined"},j1={RIGHT:"right",LEFT:"left"},K1={SMALL:"small",MEDIUM:"medium",LARGE:"large"},OQ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},PQ={VARIANT:q1.STANDARD,DIRECTION:Z1.VERTICAL,LABEL_POSITION:j1.RIGHT,SIZE:K1.MEDIUM},RQ={GROUP:"radio-group",RADIO:"radio",INPUT:"radio__input",LABEL:"radio__label",CONTROL:"radio__control",DOT:"radio__dot",FOCUS_RING:"radio__focus-ring",RIPPLE:"radio__ripple",CHECKED:"radio--checked",DISABLED:"radio--disabled",FOCUSED:"radio--focused",LABEL_RIGHT:"radio--label-right",LABEL_LEFT:"radio--label-left",SMALL:"radio--small",MEDIUM:"radio--medium",LARGE:"radio--large"};c();o();A6();var G1=(J)=>($)=>{let Q=J.disabled===!0,q=(J.variant||"bar")==="view",j=J.placeholder||"Search",G=J.value||"",K=(F)=>$.getClass(F),z={type:"text",placeholder:j,value:G,"aria-label":j};if(Q)z.disabled="disabled";let W=v({tag:"div",className:K("search-container"),container:$.element,attributes:{style:`
22
+ `,$},Y3=(J,$,Q)=>{let q=document.createElement("div");return q.className=`${$}-${o.NESTED_CONTAINER}`,q.setAttribute("role","menu"),q.hidden=!0,J.forEach((Z)=>{Q(Z,q,$)}),q},a7=(J,$,Q)=>{let q=document.createElement("div");q.className=`${Q}-${o.ITEM_CONTAINER}`;let Z=$.getAttribute("role")==="menu",j=$.getAttribute("role")==="tablist",K=$.closest(`.${Q}-nav--drawer, .${Q}-nav--drawer-modal, .${Q}-nav--drawer-standard`)!==null,G=document.createElement("button");if(G.className=`${Q}-${o.ITEM}`,G.type="button",J.items?.length)if(K)G.setAttribute("role","button"),G.setAttribute("aria-expanded",J.expanded?"true":"false"),G.setAttribute("aria-haspopup","menu");else G.setAttribute("role","button");else if(Z)G.setAttribute("role","menuitem");else if(j)G.setAttribute("role","tab"),G.setAttribute("aria-selected",J.active?"true":"false"),G.setAttribute("tabindex",J.active?"0":"-1");if(J.id)G.dataset.id=J.id;if(J.disabled)G.disabled=!0,G.setAttribute("aria-disabled","true");if(J.icon){let Y=document.createElement("span");Y.className=`${Q}-${o.ICON}`,Y.innerHTML=J.icon,G.appendChild(Y)}if(J.label){let Y=document.createElement("a");Y.className=`${Q}-${o.LABEL}`,Y.textContent=J.label,Y.href=`/${J.id}`,Y.style.textDecoration="none",Y.style.color="inherit",Y.style.pointerEvents="none",Y.setAttribute("title",J.label),G.appendChild(Y),G.setAttribute("aria-label",J.label)}if(J.badge){let Y=document.createElement("span");Y.className=`${Q}-${o.BADGE}`,Y.textContent=J.badge,Y.setAttribute("aria-label",`${J.badge} notifications`),G.appendChild(Y)}if(J.active&&!J.items?.length){if(G.classList.add(`${Q}-${o.ACTIVE}`),!j)G.setAttribute("aria-current","page")}if(q.appendChild(G),J.items?.length&&K){let Y=G3(Q);G.appendChild(Y);let z=Y3(J.items,Q,a7);z.hidden=!J.expanded,q.appendChild(z),G.addEventListener("click",(W)=>{W.stopPropagation();let X=G.getAttribute("aria-expanded")==="true";if(G.setAttribute("aria-expanded",(!X).toString()),z.hidden=X,Y.style)Y.style.transform=X?"":"rotate(90deg)"})}return $.appendChild(q),G},J8=(J,$)=>{let Q=J.closest(`.${$}-${o.ITEM_CONTAINER}`);if(!Q)return[];let q=Q.querySelector(`.${$}-${o.NESTED_CONTAINER}`);if(!q)return[];return Array.from(q.querySelectorAll(`.${$}-${o.ITEM}`)).reduce((j,K)=>{return[...j,K,...J8(K,$)]},[])};function z3(J,$){if(!J)return null;let Q=J.getAttribute("data-id");if(Q)return Q;if(J.classList.contains(`${$}-nav--rail`))return"rail";if(J.classList.contains(`${$}-nav--drawer`))return"drawer";return null}var D0=(J)=>($)=>{let Q=new Map,q=null,Z=J.prefix||"mtrl",j=(Y,z)=>{if(Q.set(Y.id,{element:z,config:Y}),Y.items?.length)Y.items.forEach((W)=>{let X=z.closest(`.${Z}-${o.ITEM_CONTAINER}`);if(X){let U=X.querySelector(`.${Z}-${o.NESTED_CONTAINER}`);if(U){let _=U.querySelector(`[data-id="${W.id}"]`);if(_)j(W,_)}}})},K=(Y,z,W)=>{let X=Y.getAttribute("role");if(W){if(Y.classList.add(`${Z}-${o.ACTIVE}`),X==="tab")Y.setAttribute("aria-selected","true"),Y.setAttribute("tabindex","0");else if(!Y.getAttribute("aria-haspopup"))Y.setAttribute("aria-current","page")}else if(Y.classList.remove(`${Z}-${o.ACTIVE}`),X==="tab")Y.setAttribute("aria-selected","false"),Y.setAttribute("tabindex","-1");else if(Y.hasAttribute("aria-current"))Y.removeAttribute("aria-current")};if(J.items)J.items.forEach((Y)=>{let z=a7(Y,$.element,Z);if(j(Y,z),Y.active)q={element:z,config:Y},K(z,q,!0)});if($.emit)$.element.addEventListener("mouseover",(Y)=>{let W=Y.target.closest("[data-id]");if(W){let X=W.dataset.id;if(X)$.emit("mouseover",{id:X,clientX:Y.clientX,clientY:Y.clientY,target:W,item:Q.get(X)})}},{passive:!0}),$.element.addEventListener("mouseenter",(Y)=>{let z=$.element.dataset.id||$.componentName||"nav";$.emit("mouseenter",{clientX:Y.clientX,clientY:Y.clientY,id:z})},{passive:!0}),$.element.addEventListener("mouseleave",(Y)=>{let z=Y.relatedTarget,W=z3(z,Z),X=$.element.dataset.id||$.componentName||"nav";$.emit("mouseleave",{clientX:Y.clientX,clientY:Y.clientY,relatedTargetId:W,id:X})});if($.lifecycle){let Y=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Q.clear(),Y)Y()}}let G=(Y)=>{let z=[Y],W=Q.get(Y);if(!W)return z;let X=W.element.closest(`.${Z}-${o.ITEM_CONTAINER}`);if(!X)return z;let U=X.parentElement;if(!U||!U.classList.contains(`${Z}-${o.NESTED_CONTAINER}`))return z;let _=U;while(_){let N=_.parentElement;if(!N||!N.classList.contains(`${Z}-${o.ITEM_CONTAINER}`))break;let F=N.querySelector(`.${Z}-${o.ITEM}[data-id]`);if(!F)break;let k=F.getAttribute("data-id");if(!k)break;z.unshift(k);let L=N.parentElement;if(!L||!L.classList.contains(`${Z}-${o.NESTED_CONTAINER}`))break;_=L}return z};return{...$,items:Q,addItem(Y){if(Q.has(Y.id))return this;let z=a7(Y,$.element,Z);if(j(Y,z),Y.active)this.setActive(Y.id);if($.emit)$.emit("itemAdded",{id:Y.id,item:{element:z,config:Y}});return this},removeItem(Y){let z=Q.get(Y);if(!z)return this;if(J8(z.element,Z).forEach((U)=>{let _=U.dataset.id;if(_)Q.delete(_)}),q?.config.id===Y)q=null;let X=z.element.closest(`.${Z}-${o.ITEM_CONTAINER}`);if(X)X.remove();if(Q.delete(Y),$.emit)$.emit("itemRemoved",{id:Y,item:z});return this},getItem:(Y)=>Q.get(Y),getAllItems:()=>Array.from(Q.values()),getActive:()=>q,getItemPath:(Y)=>G(Y),setActive(Y){let z=Q.get(Y);if(!z||z.config.disabled)return this;if(q)K(q.element,q,!1);if(K(z.element,z,!0),q=z,G(Y).forEach((X)=>{let U=Q.get(X);if(U){let _=U.element,N=_.closest(`.${Z}-${o.ITEM_CONTAINER}`);if(N){let F=N.querySelector(`.${Z}-${o.NESTED_CONTAINER}`);if(F)_.setAttribute("aria-expanded","true"),F.hidden=!1}}}),$.emit)$.emit(m7.CHANGE,{id:Y,item:z,previousItem:q,path:G(Y)});return this}}};var s6={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 O0=(J)=>($)=>{let Q=J.prefix||"mtrl",q=(K,G)=>{if(!K)return;let Y=K.getAttribute("role");if(G){if(K.classList.add(`${Q}-${s6.ITEM}--active`),Y==="tab")K.setAttribute("aria-selected","true"),K.setAttribute("tabindex","0");else if(!K.getAttribute("aria-haspopup"))K.setAttribute("aria-current","page")}else if(K.classList.remove(`${Q}-${s6.ITEM}--active`),Y==="tab")K.setAttribute("aria-selected","false"),K.setAttribute("tabindex","-1");else if(K.hasAttribute("aria-current"))K.removeAttribute("aria-current")},Z=(K)=>{if(K.getAttribute("aria-expanded")===null)return!1;let Y=K.getAttribute("aria-expanded")==="true";K.setAttribute("aria-expanded",(!Y).toString());let z=K.closest(`.${Q}-${s6.ITEM_CONTAINER}, .mtrl-nav-item-container`);if(z){let X=z.querySelector(`.${Q}-${s6.NESTED_CONTAINER}, .mtrl-nav-nested-container`);if(X){X.hidden=Y;let U=K.querySelector(`.${Q}-${s6.EXPAND_ICON}, .mtrl-nav-expand-icon`);if(U&&U.style)U.style.transform=Y?"":"rotate(90deg)"}}let W=K.dataset.id;if(W&&$.emit)$.emit("expandToggle",{id:W,expanded:!Y});return!0},j={...$,handleItemClick(K){if(!$.items)return;let G=$.items.get(K);if(!G)return;let Y=$.element.querySelector(`.${Q}-${s6.ITEM}--active, .mtrl-nav-item--active`);if(Y)q(Y,!1);if(G.element)q(G.element,!0);if($.emit){let z=$.getItemPath?$.getItemPath(K):[];$.emit("change",{id:K,item:G,previousItem:Y?{element:Y,config:{id:Y.dataset.id}}:null,path:z,source:"userAction"})}}};return $.element.addEventListener("click",(K)=>{let G=K.target,Y=G.closest(`.${Q}-${s6.ITEM}, .mtrl-nav-item`);if(!Y){if(!G.closest("[data-id]"))return}let z=Y||G.closest("[data-id]");if(z.hasAttribute("disabled")||z.getAttribute("aria-disabled")==="true")return;let W=z.dataset.id;if(!W)return;if(Z(z))return;j.handleItemClick(W)}),$.element.addEventListener("keydown",(K)=>{if(!["Enter"," ","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End"].includes(K.key))return;let G=["rail","drawer"].includes($.variant||""),Y=["bar"].includes($.variant||"");if(K.key==="Enter"||K.key===" "){let _=document.activeElement;if(_&&_.classList.contains(`${Q}-${s6.ITEM}`)){if(K.preventDefault(),_.dataset.id)_.click()}return}let z=Array.from($.element.querySelectorAll(`.${Q}-${s6.ITEM}:not([disabled]):not([aria-disabled="true"]),
23
+ .mtrl-nav-item:not([disabled]):not([aria-disabled="true"])`));if(z.length===0)return;let W=document.activeElement,X=z.indexOf(W),U=-1;if(G&&(K.key==="ArrowDown"||K.key==="ArrowRight")||Y&&K.key==="ArrowRight")U=X<0?0:(X+1)%z.length;else if(G&&(K.key==="ArrowUp"||K.key==="ArrowLeft")||Y&&K.key==="ArrowLeft")U=X<0?z.length-1:(X-1+z.length)%z.length;else if(K.key==="Home")U=0;else if(K.key==="End")U=z.length-1;if(U>=0)K.preventDefault(),z[U].focus()}),j};c();var W3={variant:Y9.VARIANT,position:Y9.POSITION,behavior:Y9.BEHAVIOR,items:[],showLabels:Y9.SHOW_LABELS,scrimEnabled:Y9.SCRIM_ENABLED},P0=(J={})=>C(W3,J,"nav"),R0=(J)=>{let $=J.variant?`${J.prefix}-${o.VARIANT_PREFIX}${J.variant}`:"",Q=J.position?`${J.prefix}-${o.POSITION_PREFIX}${J.position}`:"",q=J.class||"",Z=[$,Q,q].filter(Boolean);return f(J,{tag:"nav",attributes:{role:"navigation","aria-label":J.ariaLabel||"Main Navigation"},className:Z})},y0=(J)=>({disabled:{enable:J.disabled?.enable||(()=>{}),disable:J.disabled?.disable||(()=>{})},lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})}});var U3=(J,$)=>{let{element:Q}=J,q=$.variant||"rail",Z=$.prefix||"mtrl";if(Q.setAttribute("aria-label",$.ariaLabel||"Main Navigation"),q==="bar")if(!$.items?.some((K)=>K.items?.length))Q.setAttribute("role","tablist"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","menubar"),Q.setAttribute("aria-orientation","horizontal");else Q.setAttribute("role","navigation");if((q==="modal"||q==="drawer"&&$.behavior==="dismissible")&&!$.expanded)Q.classList.add(`${Z}-nav--hidden`)},X3=(J={})=>{let $=P0(J);try{let q=I(T,h(),S(R0($)),G6($),D7($),D0($),O0($),Y6($),b(),(Z)=>V0(y0(Z))(Z))($);if(U3(q,$),$.disabled)q.disable();if(q.element.dataset.componentType="navigation",$.variant)q.element.dataset.variant=$.variant;return q}catch(Q){throw new Error(`Failed to create navigation: ${Q instanceof Error?Q.message:String(Q)}`)}},G7=X3;l6();n();s();i();var A0=(J)=>($)=>{let Q=[],q=$.getClass("radios"),Z=J.value||"";if($.element.classList.add(`${q}--${J.direction||"vertical"}`),J.disabled)$.element.classList.add(`${q}--disabled`);let j=(Y)=>{let z=document.createElement("div");z.classList.add(`${q}-item`);let W=document.createElement("input");if(W.type="radio",W.name=J.name,W.value=Y.value,W.classList.add(`${q}-input`),Z===Y.value)W.checked=!0;if(J.disabled||Y.disabled)W.disabled=!0,z.classList.add(`${q}-item--disabled`);let X=document.createElement("label");X.classList.add(`${q}-label`);let U=document.createElement("span");U.classList.add(`${q}-control`);let _=document.createElement("span");if(_.classList.add(`${q}-circle`),J.ripple!==!1){let L=document.createElement("span");L.classList.add(`${q}-ripple`),U.appendChild(L)}U.appendChild(_);let N=document.createElement("span");if(N.classList.add(`${q}-text`),N.textContent=Y.label,Y.labelBefore)X.classList.add(`${q}-label--before`),X.appendChild(N),X.appendChild(U);else X.appendChild(U),X.appendChild(N);let F=`${q}-${Y.value}-${Math.random().toString(36).substring(2,9)}`;W.id=F,X.htmlFor=F,z.appendChild(W),z.appendChild(X);let k=(L)=>{if(W.checked){if(Z=Y.value,Q.forEach((D)=>{if(D.input!==W)D.input.checked=!1}),$.events&&typeof $.events.emit==="function")$.events.emit("change",{value:Y.value,originalEvent:L,option:Y});else if(typeof $.on==="function"){let D=new CustomEvent("change",{detail:{value:Y.value,originalEvent:L,option:Y}});$.element.dispatchEvent(D)}}};return W.addEventListener("change",k),{element:z,input:W,label:X,config:Y,destroy:()=>{if(W.removeEventListener("change",k),z.parentNode)z.parentNode.removeChild(z)}}},K=(Y)=>{let z=j(Y);return $.element.appendChild(z.element),Q.push(z),$},G=(Y)=>{let z=Q.findIndex((W)=>W.config.value===Y);if(z!==-1){if(Q[z].destroy(),Q.splice(z,1),Z===Y)Z=""}return $};if(J.options&&Array.isArray(J.options))J.options.forEach((Y)=>K(Y));if(!$.events)$.events={on:(Y,z)=>{$.element.addEventListener(Y,(W)=>z(W.detail))},off:(Y,z)=>{$.element.removeEventListener(Y,z)},emit:(Y,z)=>{let W=new CustomEvent(Y,{detail:z});$.element.dispatchEvent(W)}};return{...$,radios:Q,getValue:()=>Z,setValue:(Y)=>{return Z=Y,Q.forEach((z)=>{z.input.checked=z.config.value===Y}),$},getSelected:()=>{let Y=Q.find((z)=>z.config.value===Z);return Y?Y.config:null},addOption:K,removeOption:G,enable:()=>{return $.element.classList.remove(`${q}--disabled`),Q.forEach((Y)=>{if(Y.input.disabled=Y.config.disabled||!1,!Y.config.disabled)Y.element.classList.remove(`${q}-item--disabled`)}),$},disable:()=>{return $.element.classList.add(`${q}--disabled`),Q.forEach((Y)=>{Y.input.disabled=!0,Y.element.classList.add(`${q}-item--disabled`)}),$},enableOption:(Y)=>{let z=Q.find((W)=>W.config.value===Y);if(z){if(z.config.disabled=!1,z.input.disabled=$.element.classList.contains(`${q}--disabled`),!z.input.disabled)z.element.classList.remove(`${q}-item--disabled`)}return $},disableOption:(Y)=>{let z=Q.find((W)=>W.config.value===Y);if(z)z.config.disabled=!0,z.input.disabled=!0,z.element.classList.add(`${q}-item--disabled`);return $}}};var w0=({disabled:J,lifecycle:$})=>(Q)=>{if(!Q.events)Q.events={on:(Z,j)=>{Q.element.addEventListener(Z,(K)=>j(K.detail))},off:(Z,j)=>{Q.element.removeEventListener(Z,j)},emit:(Z,j)=>{let K=new CustomEvent(Z,{detail:j});Q.element.dispatchEvent(K)}};else if(!Q.events.emit)Q.events.emit=(Z,j)=>{let K=new CustomEvent(Z,{detail:j});Q.element.dispatchEvent(K)};return{element:Q.element,radios:Q.radios,lifecycle:{destroy:$.destroy},getClass:Q.getClass,getValue:()=>Q.getValue(),setValue(Z){return Q.setValue(Z),this},getSelected:()=>Q.getSelected(),addOption(Z){return Q.addOption(Z),this},removeOption(Z){return Q.removeOption(Z),this},enable(){return J.enable(),this},disable(){return J.disable(),this},enableOption(Z){return Q.enableOption(Z),this},disableOption(Z){return Q.disableOption(Z),this},on(Z,j){return Q.events.on(Z,j),this},off(Z,j){return Q.events.off(Z,j),this},destroy(){Q.radios.forEach((Z)=>Z.destroy()),$.destroy()}}};c();var B3={name:"",direction:"vertical",disabled:!1,ripple:!0,options:[]},x0=(J)=>C(B3,J,"radios"),T0=(J)=>{return f(J,{tag:"div",attributes:{role:"radiogroup"},className:J.class})},I0=(J)=>({disabled:{enable:()=>J.disabled.enable(),disable:()=>J.disabled.disable()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var F3=(J)=>{if(!J.name)J.name=`radios-${Math.random().toString(36).substring(2,9)}`;let $=x0(J);try{return I(T,h(),S(T0($)),A0($),Y6($),b(),(q)=>w0(I0(q))(q))($)}catch(Q){throw console.error("Radios creation error:",Q),new Error(`Failed to create radios component: ${Q.message}`)}},S0=F3;var b0={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",FOCUSED:"focused"},Q8={VERTICAL:"vertical",HORIZONTAL:"horizontal"},q8={STANDARD:"standard",FILLED:"filled",OUTLINED:"outlined"},Z8={RIGHT:"right",LEFT:"left"},j8={SMALL:"small",MEDIUM:"medium",LARGE:"large"},v0={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},C0={VARIANT:q8.STANDARD,DIRECTION:Q8.VERTICAL,LABEL_POSITION:Z8.RIGHT,SIZE:j8.MEDIUM},E0={GROUP:"radio-group",RADIO:"radio",INPUT:"radio__input",LABEL:"radio__label",CONTROL:"radio__control",DOT:"radio__dot",FOCUS_RING:"radio__focus-ring",RIPPLE:"radio__ripple",CHECKED:"radio--checked",DISABLED:"radio--disabled",FOCUSED:"radio--focused",LABEL_RIGHT:"radio--label-right",LABEL_LEFT:"radio--label-left",SMALL:"radio--small",MEDIUM:"radio--medium",LARGE:"radio--large"};s();i();S6();var K8=(J)=>($)=>{let Q=J.disabled===!0,Z=(J.variant||"bar")==="view",j=J.placeholder||"Search",K=J.value||"",G=(B)=>$.getClass(B),Y={type:"text",placeholder:j,value:K,"aria-label":j};if(Q)Y.disabled="disabled";let z=E({tag:"div",className:G("search-container"),container:$.element,attributes:{style:`
24
24
  ${J.minWidth?`min-width: ${J.minWidth}px;`:""}
25
25
  ${J.maxWidth?`max-width: ${J.maxWidth}px;`:""}
26
26
  ${J.fullWidth?"width: 100%;":""}
27
- `}}),Y=v({tag:"div",className:K("search-leading-icon"),container:W,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),U=v({tag:"div",className:K("search-input-wrapper"),container:W}),X=v({tag:"input",className:K("search-input"),container:U,attributes:z}),_=v({tag:"div",className:[K("search-clear-button"),G?"":K("search-clear-button--hidden")],container:W,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!G?"-1":"0","aria-label":"Clear search"}}),H,B,M;if(J.trailingIcon)H=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)B=v({tag:"div",className:K("search-trailing-icon"),container:W,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)M=v({tag:"div",className:K("search-avatar"),container:W,html:J.avatar});let k,N;if(q||J.suggestions)k=v({tag:"div",className:K("search-divider")}),N=v({tag:"div",className:K("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),Vj($,J,q,Q),{...$,structure:{container:W,input:X,inputWrapper:U,leadingIcon:Y,clearButton:_,trailingIcon:H,trailingIcon2:B,avatar:M,divider:k,suggestionsContainer:N}}};function Vj(J,$,Q,Z){let q=J.getClass("search");if(J.element.classList.add(`${q}--${$.variant||"bar"}`),Z)J.element.classList.add(`${q}--disabled`);if(Q)J.element.classList.add(`${q}--expanded`);if($.fullWidth)J.element.classList.add(`${q}--fullwidth`)}var V$={BAR:"bar",VIEW:"view"},z1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=-1,K.setAttribute("aria-disabled","true")})}function q(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((K)=>{K.tabIndex=0,K.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(V$).find((G)=>$.element.classList.contains(`${$.getClass("search")}--${G}`))||V$.BAR}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(G){if(j()===G)return this;if(Object.values(V$).forEach((z)=>{$.element.classList.remove(`${$.getClass("search")}--${z}`)}),$.element.classList.add(`${$.getClass("search")}--${G}`),G===V$.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var W1=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:Z,clearButton:q,trailingIcon:j,trailingIcon2:G,avatar:K,divider:z,suggestionsContainer:W}=$.structure,Y={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},U={triggerEvent(L,D=null){let R={search:Y.component,value:Y.value,originalEvent:D,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(L,R);let w=`on${L.charAt(0).toUpperCase()+L.slice(1)}`;if(J[w]&&typeof J[w]==="function")J[w](Y.value);return R}},X=(L,D=!0)=>{if(Y.value=L,Q)Q.value=L;if(q)if(L){if(q.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())q.tabIndex=0}else q.classList.add(`${$.getClass("search-clear-button")}--hidden`),q.tabIndex=-1;if(D)U.triggerEvent("input")},_=()=>{if(Y.value){if(U.triggerEvent("submit"),!Y.isExpanded)M()}},H=(L=!0)=>{if(X("",L),Q)Q.focus();if(L)U.triggerEvent("clear")},B=()=>{if(W)F()},M=()=>{if(W)W.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},k=()=>{if(Y.isExpanded)return;if(Y.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(B(),Q)setTimeout(()=>{Q.focus()},50)},N=()=>{if(!Y.isExpanded)return;if(Y.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(M(),Q)Q.blur()},F=()=>{if(!W||!Y.suggestions||!Y.suggestions.length)return;W.innerHTML="";let L=document.createElement("ul");if(L.className=$.getClass("search-suggestions-list"),L.setAttribute("role","listbox"),Y.suggestions.forEach((D)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof D==="string"){if(R.textContent=D,Y.value&&D.toLowerCase().includes(Y.value.toLowerCase())){let w=D.toLowerCase().indexOf(Y.value.toLowerCase()),A=D.slice(0,w),x=D.slice(w,w+Y.value.length),I=D.slice(w+Y.value.length);R.innerHTML=`${A}<strong>${x}</strong>${I}`}}else{if(D.icon){let A=document.createElement("span");A.className=$.getClass("search-suggestion-icon"),A.innerHTML=D.icon,R.appendChild(A)}let w=document.createElement("span");if(w.className=$.getClass("search-suggestion-text"),w.textContent=D.text,Y.value&&D.text.toLowerCase().includes(Y.value.toLowerCase())){let A=D.text.toLowerCase().indexOf(Y.value.toLowerCase()),x=D.text.slice(0,A),I=D.text.slice(A,A+Y.value.length),r=D.text.slice(A+Y.value.length);w.innerHTML=`${x}<strong>${I}</strong>${r}`}if(R.appendChild(w),D.value)R.dataset.value=D.value}R.addEventListener("click",(w)=>{w.preventDefault(),w.stopPropagation();let A=R.dataset.value||(typeof D==="string"?D:D.text);X(A),_()}),L.appendChild(R)}),J.showDividers&&z&&z.parentElement!==W){let D=z.cloneNode(!0);W.appendChild(D)}W.appendChild(L),W.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},V=()=>{if(Q)Q.addEventListener("input",(L)=>{if(X(L.target.value),Y.isExpanded)B()}),Q.addEventListener("focus",(L)=>{if(Y.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!Y.isExpanded&&J.variant==="bar")k();U.triggerEvent("focus",L)}),Q.addEventListener("blur",(L)=>{if($.element.contains(L.relatedTarget))return;Y.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!Y.isFocused){if(M(),Y.isExpanded&&J.variant==="bar")N()}},200),U.triggerEvent("blur",L)}),Q.addEventListener("keydown",(L)=>{if(L.key==="Enter")L.preventDefault(),_();else if(L.key==="Escape"){if(L.preventDefault(),Y.value)H();else if(Y.isExpanded&&J.variant==="bar")N()}});if(Z)Z.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;if(Y.isExpanded)N();else k();U.triggerEvent("iconClick",L)}),Z.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),Z.click()});if(q)q.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;H()}),q.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),q.click()});if(j)j.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),j.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),j.click()});if(G)G.addEventListener("click",(L)=>{if(L.preventDefault(),$.disabled?.isDisabled())return;U.triggerEvent("iconClick",L)}),G.addEventListener("keydown",(L)=>{if(L.key==="Enter"||L.key===" ")L.preventDefault(),G.click()});document.addEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},O=()=>{if(!$.element)return;document.removeEventListener("click",(L)=>{if(!$.element.contains(L.target)&&Y.isExpanded){if(M(),Y.isExpanded&&J.variant==="bar")N()}})},P=()=>{if(J.value&&Q){if(Q.value=J.value,q&&J.showClearButton!==!1)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",Y.placeholder||"Search");if(V(),Y.isExpanded&&J.suggestions&&J.suggestions.length>0)B()};if($.lifecycle){let L=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{O(),L()}}return P(),{...$,search:{setValue(L,D=!0){return X(L,D),this},getValue(){return Y.value},setPlaceholder(L){if(Y.placeholder=L,Q)Q.placeholder=L,Q.setAttribute("aria-label",L);return this},getPlaceholder(){return Y.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return k(),this},collapse(){return N(),this},clear(){return H(),this},submit(){return _(),this},setSuggestions(L){if(Y.suggestions=L,Y.isExpanded)F();return this},showSuggestions(L){if(L)B();else M();return this}},icons:{setLeadingIcon(L){if(Z)Z.innerHTML=L||"";return this},setTrailingIcon(L){if(j)j.innerHTML=L||"";return this},setTrailingIcon2(L){if(G)G.innerHTML=L||"";return this},setAvatar(L){if(K)K.innerHTML=L||"";return this},showClearButton(L){if(q)if(L)q.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else q.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var AQ=(J)=>($)=>{return{element:$.element,setValue(Z,q=!0){return J.search.setValue(Z,q),this},getValue(){return J.search.getValue()},setPlaceholder(Z){return J.search.setPlaceholder(Z),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(Z){return J.icons.setLeadingIcon(Z),this},setTrailingIcon(Z){return J.icons.setTrailingIcon(Z),this},setTrailingIcon2(Z){return J.icons.setTrailingIcon2(Z),this},setAvatar(Z){return J.icons.setAvatar(Z),this},showClearButton(Z){return J.icons.showClearButton(Z),this},setSuggestions(Z){return J.search.setSuggestions(Z),this},showSuggestions(Z){return J.search.showSuggestions(Z),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(Z,q){return J.events.on(Z,q),this},off(Z,q){return J.events.off(Z,q),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();var x7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},wQ={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},xQ={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},y7={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>',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>',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>',SETTINGS:'<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 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},o6={VARIANT:x7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:y7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},yQ={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var Nj={variant:x7.BAR,disabled:!1,placeholder:o6.PLACEHOLDER,value:o6.VALUE,leadingIcon:y7.SEARCH,showClearButton:o6.SHOW_CLEAR_BUTTON,minWidth:o6.MIN_WIDTH,maxWidth:o6.MAX_WIDTH,fullWidth:o6.FULL_WIDTH,showDividers:o6.SHOW_DIVIDERS},TQ=(J={})=>u(Nj,J,"search"),IQ=(J)=>p(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),SQ=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var _j=(J={})=>{let $=TQ(J);try{let Q=b(S,d(),h(IQ($)),G1($),z1($),W1($),C())($),Z=SQ(Q),q=AQ(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},bQ=_j;c();o();var N$;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(N$||={});var _$;((Z)=>{Z.DEFAULT="default";Z.COMFORTABLE="comfortable";Z.COMPACT="compact"})(_$||={});t();var Y1={SINGLE:"single",MULTI:"multi"},U1={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},vQ={CHANGE:"change"},o9={MODE:Y1.SINGLE,DENSITY:U1.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},CQ=`
27
+ `}}),W=E({tag:"div",className:G("search-leading-icon"),container:z,html:J.leadingIcon||"",attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search"}}),X=E({tag:"div",className:G("search-input-wrapper"),container:z}),U=E({tag:"input",className:G("search-input"),container:X,attributes:Y}),_=E({tag:"div",className:[G("search-clear-button"),K?"":G("search-clear-button--hidden")],container:z,html:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',attributes:{role:"button",tabindex:Q||!K?"-1":"0","aria-label":"Clear search"}}),N,F,k;if(J.trailingIcon)N=E({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.trailingIcon2)F=E({tag:"div",className:G("search-trailing-icon"),container:z,html:J.trailingIcon2,attributes:{role:"button",tabindex:Q?"-1":"0","aria-label":"Search option"}});if(J.avatar)k=E({tag:"div",className:G("search-avatar"),container:z,html:J.avatar});let L,D;if(Z||J.suggestions)L=E({tag:"div",className:G("search-divider")}),D=E({tag:"div",className:G("search-suggestions-container"),container:$.element});return $.element.classList.add($.getClass("search")),$.element.setAttribute("role","search"),$.element.setAttribute("aria-disabled",Q?"true":"false"),H3($,J,Z,Q),{...$,structure:{container:z,input:U,inputWrapper:X,leadingIcon:W,clearButton:_,trailingIcon:N,trailingIcon2:F,avatar:k,divider:L,suggestionsContainer:D}}};function H3(J,$,Q,q){let Z=J.getClass("search");if(J.element.classList.add(`${Z}--${$.variant||"bar"}`),q)J.element.classList.add(`${Z}--disabled`);if(Q)J.element.classList.add(`${Z}--expanded`);if($.fullWidth)J.element.classList.add(`${Z}--fullwidth`)}var i7={BAR:"bar",VIEW:"view"},G8=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{q()},0);function q(){if($.element.classList.add(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.input)$.structure.input.disabled=!0;[$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=-1,G.setAttribute("aria-disabled","true")})}function Z(){if($.element.classList.remove(`${$.getClass("search")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.input)$.structure.input.disabled=!1;if([$.structure?.leadingIcon,$.structure?.clearButton,$.structure?.trailingIcon,$.structure?.trailingIcon2].filter(Boolean).forEach((G)=>{G.tabIndex=0,G.setAttribute("aria-disabled","false")}),$.structure?.clearButton&&$.structure.input&&!$.structure.input.value)$.structure.clearButton.tabIndex=-1}function j(){return Object.values(i7).find((K)=>$.element.classList.contains(`${$.getClass("search")}--${K}`))||i7.BAR}return{...$,disabled:{enable(){return Z(),this},disable(){return q(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("search")}--disabled`)}},appearance:{setVariant(K){if(j()===K)return this;if(Object.values(i7).forEach((Y)=>{$.element.classList.remove(`${$.getClass("search")}--${Y}`)}),$.element.classList.add(`${$.getClass("search")}--${K}`),K===i7.VIEW)$.element.classList.add(`${$.getClass("search")}--expanded`);else $.element.classList.remove(`${$.getClass("search")}--expanded`);return this},getVariant(){return j()}}}};var Y8=(J)=>($)=>{if(!$.emit)console.warn("Search component requires event emission capability");if(!$.structure)return console.error("Search component missing structure"),$;let{input:Q,leadingIcon:q,clearButton:Z,trailingIcon:j,trailingIcon2:K,avatar:G,divider:Y,suggestionsContainer:z}=$.structure,W={value:J.value||"",placeholder:J.placeholder||"Search",suggestions:J.suggestions||[],isFocused:!1,isExpanded:J.variant==="view",component:$},X={triggerEvent(M,P=null){let R={search:W.component,value:W.value,originalEvent:P,preventDefault:()=>{R.defaultPrevented=!0},defaultPrevented:!1};if($.emit)$.emit(M,R);let y=`on${M.charAt(0).toUpperCase()+M.slice(1)}`;if(J[y]&&typeof J[y]==="function")J[y](W.value);return R}},U=(M,P=!0)=>{if(W.value=M,Q)Q.value=M;if(Z)if(M){if(Z.classList.remove(`${$.getClass("search-clear-button")}--hidden`),!$.disabled?.isDisabled())Z.tabIndex=0}else Z.classList.add(`${$.getClass("search-clear-button")}--hidden`),Z.tabIndex=-1;if(P)X.triggerEvent("input")},_=()=>{if(W.value){if(X.triggerEvent("submit"),!W.isExpanded)k()}},N=(M=!0)=>{if(U("",M),Q)Q.focus();if(M)X.triggerEvent("clear")},F=()=>{if(z)B()},k=()=>{if(z)z.classList.remove(`${$.getClass("search-suggestions-container")}--visible`)},L=()=>{if(W.isExpanded)return;if(W.isExpanded=!0,$.element.classList.add(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--view`))$.element.classList.remove(`${$.getClass("search")}--bar`),$.element.classList.add(`${$.getClass("search")}--view`);if(F(),Q)setTimeout(()=>{Q.focus()},50)},D=()=>{if(!W.isExpanded)return;if(W.isExpanded=!1,$.element.classList.remove(`${$.getClass("search")}--expanded`),!$.element.classList.contains(`${$.getClass("search")}--bar`))$.element.classList.remove(`${$.getClass("search")}--view`),$.element.classList.add(`${$.getClass("search")}--bar`);if(k(),Q)Q.blur()},B=()=>{if(!z||!W.suggestions||!W.suggestions.length)return;z.innerHTML="";let M=document.createElement("ul");if(M.className=$.getClass("search-suggestions-list"),M.setAttribute("role","listbox"),W.suggestions.forEach((P)=>{let R=document.createElement("li");if(R.className=$.getClass("search-suggestion-item"),R.setAttribute("role","option"),R.tabIndex=0,typeof P==="string"){if(R.textContent=P,W.value&&P.toLowerCase().includes(W.value.toLowerCase())){let y=P.toLowerCase().indexOf(W.value.toLowerCase()),x=P.slice(0,y),A=P.slice(y,y+W.value.length),v=P.slice(y+W.value.length);R.innerHTML=`${x}<strong>${A}</strong>${v}`}}else{if(P.icon){let x=document.createElement("span");x.className=$.getClass("search-suggestion-icon"),x.innerHTML=P.icon,R.appendChild(x)}let y=document.createElement("span");if(y.className=$.getClass("search-suggestion-text"),y.textContent=P.text,W.value&&P.text.toLowerCase().includes(W.value.toLowerCase())){let x=P.text.toLowerCase().indexOf(W.value.toLowerCase()),A=P.text.slice(0,x),v=P.text.slice(x,x+W.value.length),r=P.text.slice(x+W.value.length);y.innerHTML=`${A}<strong>${v}</strong>${r}`}if(R.appendChild(y),P.value)R.dataset.value=P.value}R.addEventListener("click",(y)=>{y.preventDefault(),y.stopPropagation();let x=R.dataset.value||(typeof P==="string"?P:P.text);U(x),_()}),M.appendChild(R)}),J.showDividers&&Y&&Y.parentElement!==z){let P=Y.cloneNode(!0);z.appendChild(P)}z.appendChild(M),z.classList.add(`${$.getClass("search-suggestions-container")}--visible`)},H=()=>{if(Q)Q.addEventListener("input",(M)=>{if(U(M.target.value),W.isExpanded)F()}),Q.addEventListener("focus",(M)=>{if(W.isFocused=!0,$.element.classList.add(`${$.getClass("search")}--focused`),!W.isExpanded&&J.variant==="bar")L();X.triggerEvent("focus",M)}),Q.addEventListener("blur",(M)=>{if($.element.contains(M.relatedTarget))return;W.isFocused=!1,$.element.classList.remove(`${$.getClass("search")}--focused`),setTimeout(()=>{if(!W.isFocused){if(k(),W.isExpanded&&J.variant==="bar")D()}},200),X.triggerEvent("blur",M)}),Q.addEventListener("keydown",(M)=>{if(M.key==="Enter")M.preventDefault(),_();else if(M.key==="Escape"){if(M.preventDefault(),W.value)N();else if(W.isExpanded&&J.variant==="bar")D()}});if(q)q.addEventListener("click",(M)=>{if(M.preventDefault(),$.disabled?.isDisabled())return;if(W.isExpanded)D();else L();X.triggerEvent("iconClick",M)}),q.addEventListener("keydown",(M)=>{if(M.key==="Enter"||M.key===" ")M.preventDefault(),q.click()});if(Z)Z.addEventListener("click",(M)=>{if(M.preventDefault(),$.disabled?.isDisabled())return;N()}),Z.addEventListener("keydown",(M)=>{if(M.key==="Enter"||M.key===" ")M.preventDefault(),Z.click()});if(j)j.addEventListener("click",(M)=>{if(M.preventDefault(),$.disabled?.isDisabled())return;X.triggerEvent("iconClick",M)}),j.addEventListener("keydown",(M)=>{if(M.key==="Enter"||M.key===" ")M.preventDefault(),j.click()});if(K)K.addEventListener("click",(M)=>{if(M.preventDefault(),$.disabled?.isDisabled())return;X.triggerEvent("iconClick",M)}),K.addEventListener("keydown",(M)=>{if(M.key==="Enter"||M.key===" ")M.preventDefault(),K.click()});document.addEventListener("click",(M)=>{if(!$.element.contains(M.target)&&W.isExpanded){if(k(),W.isExpanded&&J.variant==="bar")D()}})},V=()=>{if(!$.element)return;document.removeEventListener("click",(M)=>{if(!$.element.contains(M.target)&&W.isExpanded){if(k(),W.isExpanded&&J.variant==="bar")D()}})},O=()=>{if(J.value&&Q){if(Q.value=J.value,Z&&J.showClearButton!==!1)Z.classList.remove(`${$.getClass("search-clear-button")}--hidden`)}if(Q)Q.setAttribute("role","searchbox"),Q.setAttribute("aria-label",W.placeholder||"Search");if(H(),W.isExpanded&&J.suggestions&&J.suggestions.length>0)F()};if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{V(),M()}}return O(),{...$,search:{setValue(M,P=!0){return U(M,P),this},getValue(){return W.value},setPlaceholder(M){if(W.placeholder=M,Q)Q.placeholder=M,Q.setAttribute("aria-label",M);return this},getPlaceholder(){return W.placeholder},focus(){if(Q&&!$.disabled?.isDisabled())Q.focus();return this},blur(){if(Q)Q.blur();return this},expand(){return L(),this},collapse(){return D(),this},clear(){return N(),this},submit(){return _(),this},setSuggestions(M){if(W.suggestions=M,W.isExpanded)B();return this},showSuggestions(M){if(M)F();else k();return this}},icons:{setLeadingIcon(M){if(q)q.innerHTML=M||"";return this},setTrailingIcon(M){if(j)j.innerHTML=M||"";return this},setTrailingIcon2(M){if(K)K.innerHTML=M||"";return this},setAvatar(M){if(G)G.innerHTML=M||"";return this},showClearButton(M){if(Z)if(M)Z.classList.remove(`${$.getClass("search-clear-button")}--hidden`);else Z.classList.add(`${$.getClass("search-clear-button")}--hidden`);return this}}}};var h0=(J)=>($)=>{return{element:$.element,setValue(q,Z=!0){return J.search.setValue(q,Z),this},getValue(){return J.search.getValue()},setPlaceholder(q){return J.search.setPlaceholder(q),this},getPlaceholder(){return J.search.getPlaceholder()},setLeadingIcon(q){return J.icons.setLeadingIcon(q),this},setTrailingIcon(q){return J.icons.setTrailingIcon(q),this},setTrailingIcon2(q){return J.icons.setTrailingIcon2(q),this},setAvatar(q){return J.icons.setAvatar(q),this},showClearButton(q){return J.icons.showClearButton(q),this},setSuggestions(q){return J.search.setSuggestions(q),this},showSuggestions(q){return J.search.showSuggestions(q),this},focus(){return J.search.focus(),this},blur(){return J.search.blur(),this},expand(){return J.search.expand(),this},collapse(){return J.search.collapse(),this},clear(){return J.search.clear(),this},submit(){return J.search.submit(),this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},on(q,Z){return J.events.on(q,Z),this},off(q,Z){return J.events.off(q,Z),this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};c();var Y7={STANDARD:"standard",BAR:"bar",RAIL:"rail",DRAWER:"drawer",MODAL:"modal"},u0={FOCUSED:"focused",EXPANDED:"expanded",COLLAPSED:"collapsed",POPULATED:"populated",DISABLED:"disabled",SUGGESTING:"suggesting"},f0={FOCUS:"focus",BLUR:"blur",INPUT:"input",SUBMIT:"submit",CLEAR:"clear",ICON_CLICK:"iconClick"},z7={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>',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>',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>',SETTINGS:'<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 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>'},m6={VARIANT:Y7.STANDARD,PLACEHOLDER:"Search",VALUE:"",LEADING_ICON:z7.SEARCH,SHOW_CLEAR_BUTTON:!0,MAX_WIDTH:480,MIN_WIDTH:240,FULL_WIDTH:!1,SHOW_DIVIDERS:!0},g0={CONTAINER:"search",VARIANT_PREFIX:"search--",INPUT:"search__input",LEADING_ICON:"search__leading-icon",TRAILING_ICON:"search__trailing-icon",TRAILING_ICON2:"search__trailing-icon2",AVATAR:"search__avatar",CLEAR_BUTTON:"search__clear-button",SUGGESTIONS:"search__suggestions",SUGGESTION_ITEM:"search__suggestion-item",SUGGESTION_DIVIDER:"search__suggestion-divider",SUGGESTION_ICON:"search__suggestion-icon",SUGGESTION_TEXT:"search__suggestion-text",FOCUSED:"search--focused",EXPANDED:"search--expanded",POPULATED:"search--populated",DISABLED:"search--disabled",FULL_WIDTH:"search--full-width",SUGGESTING:"search--suggesting"};var M3={variant:Y7.BAR,disabled:!1,placeholder:m6.PLACEHOLDER,value:m6.VALUE,leadingIcon:z7.SEARCH,showClearButton:m6.SHOW_CLEAR_BUTTON,minWidth:m6.MIN_WIDTH,maxWidth:m6.MAX_WIDTH,fullWidth:m6.FULL_WIDTH,showDividers:m6.SHOW_DIVIDERS},d0=(J={})=>C(M3,J,"search"),r0=(J)=>f(J,{tag:"div",attributes:{role:"search","aria-disabled":J.disabled===!0?"true":"false"},className:J.class}),l0=(J)=>({search:{setValue:($,Q)=>J.search?.setValue($,Q),getValue:()=>J.search?.getValue()??"",setPlaceholder:($)=>J.search?.setPlaceholder($),getPlaceholder:()=>J.search?.getPlaceholder()??"",focus:()=>J.search?.focus(),blur:()=>J.search?.blur(),expand:()=>J.search?.expand(),collapse:()=>J.search?.collapse(),clear:()=>J.search?.clear(),submit:()=>J.search?.submit(),setSuggestions:($)=>J.search?.setSuggestions($),showSuggestions:($)=>J.search?.showSuggestions($)},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"",setSize:($)=>J.appearance?.setSize?.($),getSize:()=>J.appearance?.getSize?.()??""},icons:{setLeadingIcon:($)=>J.icons?.setLeadingIcon?.($),setTrailingIcon:($)=>J.icons?.setTrailingIcon?.($),setTrailingIcon2:($)=>J.icons?.setTrailingIcon2?.($),setAvatar:($)=>J.icons?.setAvatar?.($),showClearButton:($)=>J.icons?.showClearButton?.($)},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var k3=(J={})=>{let $=d0(J);try{let Q=I(T,h(),S(r0($)),K8($),G8($),Y8($),b())($),q=l0(Q),Z=h0(q)(Q);if($.on&&typeof Z.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")Z.on(j,K)});return Z}catch(Q){throw console.error("Search creation error:",Q),new Error(`Failed to create search: ${Q.message}`)}},p0=k3;s();i();var c7;((Q)=>{Q.SINGLE="single";Q.MULTI="multi"})(c7||={});var o7;((q)=>{q.DEFAULT="default";q.COMFORTABLE="comfortable";q.COMPACT="compact"})(o7||={});c();var z8={SINGLE:"single",MULTI:"multi"},W8={DEFAULT:"default",COMFORTABLE:"comfortable",COMPACT:"compact"},s0={CHANGE:"change"},u9={MODE:z8.SINGLE,DENSITY:W8.DEFAULT,RIPPLE:!0,RIPPLE_DURATION:300,RIPPLE_TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",RIPPLE_OPACITY:["0.2","0"]},m0=`
28
28
  <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
29
29
  <polyline points="20 6 9 17 4 12"></polyline>
30
- </svg>`,EQ={CHECKMARK:'<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="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},hQ={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var Lj={mode:o9.MODE,ripple:o9.RIPPLE,density:o9.DENSITY},uQ=(J={})=>u(Lj,J,"segmented-button"),fQ=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},X1=(J)=>{switch(J){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"}}};T9();var B1=(J,$,Q,Z=!1,q={ripple:!0,rippleConfig:{}})=>{let j=Z||J.disabled,G=J.icon,K=J.checkmarkIcon||CQ,z=Q9({text:J.text,icon:J.selected&&J.text&&G?K:G,value:J.value||J.text||"",disabled:j,ripple:q.ripple,rippleConfig:q.rippleConfig,class:J.class});if(z.element.classList.add(`${Q}-segmented-button-segment`),J.selected)z.element.classList.add(`${Q}-segment--selected`),z.element.setAttribute("aria-pressed","true");else z.element.setAttribute("aria-pressed","false");$.appendChild(z.element);let W=(U)=>{if(z.element.classList.toggle(`${Q}-segment--selected`,U),z.element.setAttribute("aria-pressed",U?"true":"false"),J.text&&G)if(U)z.setIcon(K);else z.setIcon(G)},Y=J.selected||!1;return{element:z.element,value:J.value||J.text||"",isSelected(){return Y},setSelected(U){Y=U,W(U)},isDisabled(){return z.disabled?.isDisabled?.()||!1},setDisabled(U){if(U)z.disable();else z.enable()},destroy(){z.destroy()}}};var Dj=(J={})=>{let $=uQ(J),Q=$.mode||"single",Z=$.density||"default",q=f6();try{let j=b(S,d(),h(fQ($)),C())($),G=X1(Z);Object.entries(G).forEach(([H,B])=>{j.element.style.setProperty(H,B)});let K=[];if($.segments&&$.segments.length)$.segments.forEach((H)=>{let B=B1(H,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});K.push(B)});if(Q==="single"&&!K.some((H)=>H.isSelected())){let H=K.find((B)=>!B.isDisabled());if(H)H.setSelected(!0)}let z=(H)=>{let B=H.currentTarget,M=K.find((F)=>F.element===B);if(!M||M.isDisabled())return;let k=Y();if(Q==="single")K.forEach((F)=>{F.setSelected(F===M)});else M.setSelected(!M.isSelected());let N=Y();if(k.length!==N.length||k.some((F)=>!N.includes(F))||N.some((F)=>!k.includes(F)))q.emit("change",{selected:W(),value:N,oldValue:k})};K.forEach((H)=>{H.element.addEventListener("click",z)});let W=()=>K.filter((H)=>H.isSelected()),Y=()=>W().map((H)=>H.value),U=(H)=>K.find((B)=>B.value===H),X=(H)=>{if(["default","comfortable","compact"].forEach((M)=>{if(M!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${M}`)}),H!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${H}`);j.element.setAttribute("data-density",H);let B=X1(H);Object.entries(B).forEach(([M,k])=>{j.element.style.setProperty(M,k)})};return{element:j.element,segments:K,getSelected:W,getValue(){return Y()},select(H){let B=U(H);if(B&&!B.isDisabled()){let M=Y();if(Q==="single")K.forEach((N)=>N.setSelected(N===B));else B.setSelected(!0);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},deselect(H){let B=U(H);if(B&&!B.isDisabled())if(Q==="single"){if(W().length>1||!B.isSelected()){let k=Y();B.setSelected(!1);let N=Y();if(k.join(",")!==N.join(","))q.emit("change",{selected:W(),value:N,oldValue:k})}}else{let M=Y();B.setSelected(!1);let k=Y();if(M.join(",")!==k.join(","))q.emit("change",{selected:W(),value:k,oldValue:M})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{if(!$.segments?.find((B)=>B.value===H.value)?.disabled)H.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),K.forEach((H)=>{H.setDisabled(!0)}),this},enableSegment(H){let B=U(H);if(B)B.setDisabled(!1);return this},disableSegment(H){let B=U(H);if(B)B.setDisabled(!0);return this},setDensity(H){return X(H),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(H,B){return q.on(H,B),this},off(H,B){return q.off(H,B),this},destroy(){K.forEach((H)=>{H.element.removeEventListener("click",z),H.destroy()}),q.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},F1=Dj;J6();c();o();var C6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},t9={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var H1=(J)=>($)=>{let{position:Q=C6.BOTTOM}=J,Z=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(Z),{...$,position:{setPosition(q){$.element.classList.remove(Z);let j=`${$.getClass("sheet")}--${q.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var k1=(J)=>($)=>{let{content:Q=""}=J,Z=document.createElement("div");return Z.className=`${$.getClass("sheet")}-content`,Z.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(Z),$.element.appendChild($.container),{...$,content:{setContent(q){return Z.innerHTML=q,this},getContent(){return Z.innerHTML},getElement(){return Z}}}};var M1=(J)=>($)=>{let{title:Q=""}=J,Z=null;if(Q||J.dragHandle){if(Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,Q)Z.textContent=Q;if($.container.insertBefore(Z,$.container.firstChild),J.dragHandle){let q=document.createElement("div");q.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(q,$.container.firstChild),$.dragHandle={element:q,setVisible(j){q.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(q){if(!Z&&q)Z=document.createElement("div"),Z.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(Z,$.content.getElement());if(Z)Z.textContent=q;return this},getTitle(){return Z?Z.textContent||"":""},getElement(){return Z}}}};var V1=(J)=>($)=>{let{open:Q=!1,dismissible:Z=!0}=J,q=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),Z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(Z)K()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(z)=>{if(z.key==="Escape"&&q&&Z)K()});function G(){if(!q){if(q=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(t9.OPEN),J.onOpen)J.onOpen()}}function K(){if(q){if(q=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(t9.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:G,close:K,isOpen(){return q},setDismissible(z){if(z)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var N1=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||C6.BOTTOM,Z=0,q=0,j=!1,G=$.dragHandle?.element||$.element,K=(X)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",X.type==="touchstart")Z=X.touches[0].clientY,q=X.touches[0].clientX;else Z=X.clientY,q=X.clientX,document.addEventListener("mousemove",z),document.addEventListener("mouseup",W);$.events.emit(t9.DRAG_START)},z=(X)=>{if(!j)return;let _,H;if(X.type==="touchmove")_=X.touches[0].clientY,H=X.touches[0].clientX;else _=X.clientY,H=X.clientX;let B=0;switch(Q){case C6.BOTTOM:if(B=_-Z,B<0)B=0;$.element.style.transform=`translateY(${B}px)`;break;case C6.TOP:if(B=Z-_,B<0)B=0;$.element.style.transform=`translateY(-${B}px)`;break;case C6.LEFT:if(B=q-H,B<0)B=0;$.element.style.transform=`translateX(-${B}px)`;break;case C6.RIGHT:if(B=H-q,B<0)B=0;$.element.style.transform=`translateX(${B}px)`;break}let M=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,k=Math.min(B/M,1),N=$.element.nextElementSibling;if(N&&N.classList.contains(`${$.getClass("sheet")}-scrim`))N.style.opacity=`${0.32*(1-k)}`},W=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W);let X=Q===C6.BOTTOM||Q===C6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let H=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=H?parseFloat(H[1]):0}if(_>X*0.3)$.state.close();else{$.element.style.transform="";let H=$.element.nextElementSibling;if(H&&H.classList.contains(`${$.getClass("sheet")}-scrim`))H.style.opacity=""}$.events.emit(t9.DRAG_END)};G.addEventListener("touchstart",K),G.addEventListener("touchmove",z),G.addEventListener("touchend",W),G.addEventListener("mousedown",K);let Y=()=>{G.removeEventListener("touchstart",K),G.removeEventListener("touchmove",z),G.removeEventListener("touchend",W),G.removeEventListener("mousedown",K),document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",W)},U=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{Y(),U()}},$};var gQ=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(Z){return Q.content.setContent(Z),this},getContent(){return Q.content.getContent()},setTitle(Z){return Q.title.setTitle(Z),this},getTitle(){return Q.title.getTitle()},setDragHandle(Z){if(Q.dragHandle)Q.dragHandle.setVisible(Z);return this},setMaxHeight(Z){return Q.container.style.maxHeight=Z,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});t();var b9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},n9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},dQ={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},_1={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},L9={VARIANT:b9.STANDARD,POSITION:n9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:_1.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},lQ={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},rQ={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},pQ={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var Oj={variant:b9.STANDARD,position:n9.BOTTOM,open:L9.OPEN,dismissible:L9.DISMISSIBLE,dragHandle:L9.DRAG_HANDLE,elevation:L9.ELEVATION,enableGestures:L9.ENABLE_GESTURES},sQ=(J={})=>u(Oj,J,"sheet"),mQ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===b9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},aQ=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var Pj=(J={})=>{let $=sQ(J);try{let Q=b(S,d(),h(mQ($)),K6($),H1($),k1($),M1($),V1($),N1($),C(),(Z)=>gQ(aQ(Z))(Z))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},cQ=Pj;c();o();A6();var L1=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,Z=J.max||100,q=J.secondValue,j=(q-Q)/(Z-Q)*100,G=J.valueFormatter||((X)=>X.toString()),K=J.disabled===!0,z=$.getClass,W=JSON.parse(JSON.stringify($.schema)),Y=W.element.options.className||[];if(Array.isArray(Y))Y.push(z("slider--range"));else W.element.options.className=`${Y} ${z("slider--range")}`.trim();let U=W.element.children.container.children;return U.secondHandle={name:"secondHandle",creator:v,options:{tag:"div",className:z("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(Z),"aria-valuenow":String(q),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(q),"data-handle-index":"1"},style:{left:`${j}%`}}},U.secondValueBubble={name:"secondValueBubble",creator:v,options:{tag:"div",className:z("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:G(q),style:{left:`${j}%`}}},{...$,schema:W}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var Z9={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},D6={XS:16,S:24,M:40,L:56,XL:80},Z6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},H6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},L$={START:"start",END:"end"},V6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:Z9.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:L$.START,LABEL_POSITION:L$.START},iQ={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var D1=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{Z()},0);function Z(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function q(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(Z9).find((K)=>$.element.classList.contains(`${$.getClass("slider")}--${K}`))||Z9.PRIMARY}function G(){return Object.keys(D6).find((W)=>$.element.classList.contains(`${$.getClass("slider")}--${W.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return q(),this},disable(){return Z(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(K){if(Object.values(Z9).forEach((z)=>{$.element.classList.remove(`${$.getClass("slider")}--${z}`)}),K!==Z9.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${K}`);return this},getColor(){return j()},setSize(K){Object.keys(D6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y.toLowerCase()}`)});let W;if(typeof K==="string"&&K in D6)W=K;else if(typeof K==="number"){let Y=Object.entries(D6).find(([,U])=>U===K);W=Y?Y[0]:"XS"}else W="XS";return $.element.classList.add(`${$.getClass("slider")}--${W.toLowerCase()}`),this},getSize(){return G()},showTicks(K){if(J.ticks=K,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(K){return J.showValue=K,this}}}};var oQ=(J,$,Q,Z)=>{let q=$.component?.components||{},{container:j=null,handle:G=null,valueBubble:K=null,secondHandle:z=null,secondValueBubble:W=null}=q,{getValueFromPosition:Y=()=>0,roundToStep:U=(y)=>y,clamp:X=(y)=>y,showValueBubble:_=()=>{},render:H=()=>{}}=Q,{triggerEvent:B=()=>({defaultPrevented:!1})}=Z,M=!1,k=0,N=3,F=null,V=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(V(),K)_(K,!1);if(W)_(W,!1)},P=(y)=>{if(O(),y&&J.showValue)_(y,!0)},L=(y,l=0)=>{if(V(),!y||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{_(y,!1)},l);else _(y,!1)},D=()=>{if(G)G.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(z)z.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let y=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${y}`).forEach((l)=>{l.classList.remove(y)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(y){console.warn("Error clearing keyboard focus:",y)}},R=(y,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;y.preventDefault(),y.stopPropagation(),O(),D(),k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,$.dragging=!1,$.pressed=!0,M=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?W:K,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},w=(y)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!j)return;y.preventDefault(),O(),D();let l=!1;try{let m=y.type.includes("touch")?y.touches[0].clientX:y.clientX,s=Y(m);if(J.snapToSteps&&$.step>0)s=U(s);if(s=X(s,$.min,$.max),J.range&&$.secondValue!==null){let K9=Math.abs(s-$.value);l=Math.abs(s-$.secondValue)<K9,l?$.secondValue=s:$.value=s}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(s,!1);else $.value=s;H(),B(H6.INPUT,y)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?W:K,k=y.type.includes("touch")?y.touches[0].clientX:y.clientX,J.centered&&!J.range)P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),$.pressed=!1,B(H6.START,y);else $.dragging=!1,$.pressed=!1,M=!1,P($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",x),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",x),H(),B(H6.START,y)},A=(y)=>{if(!$.activeHandle||!j)return;y.preventDefault();try{let l=y.type.includes("touch")?y.touches[0].clientX:y.clientX;if(!M&&Math.abs(l-k)>=N)M=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=Y(l);if(J.snapToSteps&&$.step>0)m=U(m);m=X(m,$.min,$.max);let s=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(s)if(m>=$.value)$.secondValue=m;else L($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=K,P($.activeBubble);else if(m<=$.secondValue)$.value=m;else L($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=W,P($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}H(),B(H6.INPUT,y)}catch(l){console.warn("Error during slider drag:",l)}},x=(y)=>{if(!$.activeHandle)return;y.preventDefault(),$.dragging=!1,$.pressed=!1,M=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),L($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x),$.activeHandle=null,H(),B(H6.CHANGE,y),B(H6.END,y)},I=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,s=l?$.secondValue:$.value,K9=y.shiftKey?m*10:m;if(y.key==="Tab")return;let N6=!1;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),s=Math.min(s+K9,$.max),N6=!0;break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),s=Math.max(s-K9,$.min),N6=!0;break;case"Home":y.preventDefault(),s=$.min,N6=!0;break;case"End":y.preventDefault(),s=$.max,N6=!0;break;case"PageUp":y.preventDefault(),s=Math.min(s+m*10,$.max),N6=!0;break;case"PageDown":y.preventDefault(),s=Math.max(s-m*10,$.min),N6=!0;break;default:return}if(!N6)return;if($.activeBubble=l?W:K,P($.activeBubble),l)$.secondValue=s;else{if(J.centered)$.previousValue=$.value;$.value=s}H(),B(H6.INPUT,y),B(H6.CHANGE,y)},r=(y,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?z:G;if(F&&F!==m)O();F=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),P(l?W:K),$.activeBubble=l?W:K,B(H6.FOCUS,y)},a=(y,l=!1)=>{(l?z:G).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let s=y.relatedTarget;if(!s||s!==(l?G:z))L(l?W:K,200);B(H6.BLUR,y)};return{handleHandleMouseDown:R,handleTrackMouseDown:w,handleMouseMove:A,handleMouseUp:x,handleKeyDown:I,handleFocus:r,handleBlur:a,setupEventListeners:()=>{if(!$.component||!$.component.components){console.warn("Cannot set up event listeners: missing component structure");return}if(j.addEventListener("mousedown",w),j.addEventListener("touchstart",w,{passive:!1}),G.addEventListener("mousedown",(y)=>R(y,!1)),G.addEventListener("touchstart",(y)=>R(y,!1),{passive:!1}),G.addEventListener("keydown",(y)=>I(y,!1)),G.addEventListener("focus",(y)=>r(y,!1)),G.addEventListener("blur",(y)=>a(y,!1)),J.range&&z)z.addEventListener("mousedown",(y)=>R(y,!0)),z.addEventListener("touchstart",(y)=>R(y,!0),{passive:!1}),z.addEventListener("keydown",(y)=>I(y,!0)),z.addEventListener("focus",(y)=>r(y,!0)),z.addEventListener("blur",(y)=>a(y,!0))},cleanupEventListeners:()=>{if(!$.component||!$.component.components)return;if(j)j.removeEventListener("mousedown",w),j.removeEventListener("touchstart",w);if(G)G.removeEventListener("mousedown",(y)=>R(y,!1)),G.removeEventListener("touchstart",(y)=>R(y,!1)),G.removeEventListener("keydown",(y)=>I(y,!1)),G.removeEventListener("focus",(y)=>r(y,!1)),G.removeEventListener("blur",(y)=>a(y,!1));if(J.range&&z)z.removeEventListener("mousedown",(y)=>R(y,!0)),z.removeEventListener("touchstart",(y)=>R(y,!0)),z.removeEventListener("keydown",(y)=>I(y,!0)),z.removeEventListener("focus",(y)=>r(y,!0)),z.removeEventListener("blur",(y)=>a(y,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",x)},showActiveBubble:P,hideActiveBubble:L,hideAllBubbles:O,clearKeyboardFocus:D}};var O1=(J)=>($)=>{if(!$.element||!$.components)return console.warn("Cannot initialize slider controller: missing element or components"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},Z={triggerEvent(V,O=null){let P={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:O,preventDefault:()=>{P.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(V,P),P}},q=()=>{if(!Q.component?.components)return{};return Q.component.components},j=(V)=>{let O=Q.max-Q.min;return O===0?0:(V-Q.min)/O*100},G=()=>{let V=q(),{handle:O,container:P}=V;if(!O||!P)return null;try{let L=O.getBoundingClientRect(),D=P.getBoundingClientRect(),R=L.width||Z6.HANDLE_SIZE,w=D.width,A=Z6.EDGE_PADDING/w*100,I=(Q.activeHandle?6:8)/w*100;return{handleSize:R,trackSize:w,edgeConstraint:A,paddingPercent:I}}catch(L){return console.warn("Error calculating track dimensions:",L),{handleSize:Z6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},K=(V,O=200)=>{let P=Z6.EDGE_PADDING/O*100,L=P,D=100-P,R=D-L;if(V<=0)return L;if(V>=100)return D;return L+V/100*R},z=(V)=>{let O=q(),{handle:P,container:L}=O;if(!P||!L)return Q.min;try{let D=L.getBoundingClientRect(),R=Q.max-Q.min,w=D.left+Z6.EDGE_PADDING,A=D.right-Z6.EDGE_PADDING,x=A-w,r=(Math.max(w,Math.min(A,V))-w)/x;return Q.min+r*R}catch(D){return console.warn("Error calculating value from position:",D),Q.min}},W=(V)=>{let O=Q.step;if(!O||O<=0)return V;let P=Math.round((V-Q.min)/O);return Q.min+P*O},Y=(V,O,P)=>Math.min(Math.max(V,O),P),U=()=>{let V=q(),{handle:O,container:P,valueBubble:L,secondHandle:D,secondValueBubble:R}=V;if(!O||!P)return;let w=G();if(!w)return;let{trackSize:A}=w,x=j(Q.value),I=K(x,A);if(O.style.left=`${I}%`,O.style.transform="translate(-50%, -50%)",L)L.style.left=`${I}%`,L.style.transform="translateX(-50%)";if(J.range&&D&&Q.secondValue!==null){let r=j(Q.secondValue),a=K(r,A);if(D.style.left=`${a}%`,D.style.transform="translate(-50%, -50%)",R)R.style.left=`${a}%`,R.style.transform="translateX(-50%)"}if(O)O.setAttribute("aria-valuenow",String(Q.value))},X=()=>{let V=q(),{valueBubble:O,secondValueBubble:P}=V;if(!O)return;let L=J.valueFormatter||((D)=>D.toString());if(O.textContent=L(Q.value),J.range&&P&&Q.secondValue!==null)P.textContent=L(Q.secondValue)},_=(V,O)=>{if(!V||!J.showValue)return;let P=Q.component.getClass("slider-value");V.classList[O?"add":"remove"](`${P}--visible`)},H=()=>{},B=()=>{},M=()=>{try{if(U(),X(),$.drawCanvas)$.drawCanvas(Q)}catch(V){console.warn("Error rendering UI:",V)}},N=oQ(J,Q,{getPercentage:j,getValueFromPosition:z,roundToStep:W,clamp:Y,showValueBubble:_,updateUi:M,render:M},Z),F=()=>{try{if(!$.components||!$.components.handle){console.warn("Cannot initialize slider controller: missing required components");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:V,secondHandle:O}=$.components;if(V){if(V.setAttribute("aria-valuemin",String(Q.min)),V.setAttribute("aria-valuemax",String(Q.max)),V.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}N.setupEventListeners(),M()}catch(V){console.error("Error initializing slider controller:",V)}};if($.lifecycle){let V=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{N.cleanupEventListeners(),V()}}return setTimeout(()=>{F()},0),{...$,slider:{setValue(V,O=!0){let P=Y(V,Q.min,Q.max);if(Q.value=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getValue(){return Q.value},setSecondValue(V,O=!0){if(!J.range)return this;let P=Y(V,Q.min,Q.max);if(Q.secondValue=P,M(),O)Z.triggerEvent(H6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(V){if(Q.min=V,$.element.setAttribute("aria-valuemin",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemin",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemin",String(V));if(Q.value<V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue<V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMin(){return Q.min},setMax(V){if(Q.max=V,$.element.setAttribute("aria-valuemax",String(V)),$.components?.handle)$.components.handle.setAttribute("aria-valuemax",String(V));if(J.range&&$.components?.secondHandle)$.components.secondHandle.setAttribute("aria-valuemax",String(V));if(Q.value>V)Q.value=V;if(J.range&&Q.secondValue!==null&&Q.secondValue>V)Q.secondValue=V;if(J.ticks||J.tickLabels)H();return M(),this},getMax(){return Q.max},setStep(V){if(Q.step=V,$.element.classList[V>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)H(),B();return this},getStep(){return Q.step},regenerateTicks(){return M(),this},updateUi(){return M(),this}}}};$9();y8();var Rj=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,R1=(J,$,Q="track")=>{let Z=Rj($),q=J.color||"primary";if(Z){let G=B6("sys-color-on-surface",{fallback:"#000000"});return{primary:U7(G,0.38),secondary:U7(G,0.12)}}if(Q==="tick")return{primary:B6(`sys-color-on-${q}`,{fallback:"#ffffff"}),secondary:B6(`sys-color-${q}`,{fallback:"#1976d2"})};let j=B6(`sys-color-${q}`,{fallback:"#1976d2"});return{primary:j,secondary:U7(j,0.24)}},D$=(J,$,Q)=>(J-$)/(Q-$)*100,I6=(J,$,Q,Z,q,j,G)=>{if(Z>0)B4(J,$,Q,Z,q,j,j,G)},T7=(J)=>{if(typeof J==="number")return Math.max(J,D6.XS);if(typeof J==="string"&&J in D6)return D6[J];return D6.XS},A1=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_HANDLE_HEIGHT;return $+Z6.HANDLE_HEIGHT_OFFSET},Aj=(J)=>{let $=T7(J);if($<=D6.S)return Z6.SMALL_TRACK_EXTERNAL_RADIUS;return $*Z6.LARGE_TRACK_RADIUS_RATIO},tQ=(J,$,Q)=>{let Z=T7(Q?.size),q=A1(Q?.size),j=J.parentElement;if(!j)return;let G=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),K=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);j.style.height=`${K}px`,V4($,G,K)},nQ=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let Z=T7($?.size),q=A1($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),G=Math.max(q+20,Z+32,Z6.MIN_HEIGHT);return Q.style.height=`${G}px`,M4(J,j,G)},O$=(J,$)=>{let Q=Z6.EDGE_PADDING/$*100,Z=Q,q=100-Q,j=q-Z;if(J<=0)return Z;if(J>=100)return q;return Z+J/100*j},wj=(J,$,Q,Z,q,j)=>{let G=Q/2,K=T7(Z.size),z=Aj(Z.size),W=Z6.TRACK_RADIUS,Y=X4(J,0,G-K/2,$,K,z),{primary:U,secondary:X}=R1(Z,j),_=D$(q.value,q.min,q.max),H=O$(_,$),B=q.pressed?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,M=Z6.HANDLE_GAP-B,N=Z6.CENTER_GAP/2/$*100,F=M/$*100;if(Z.centered){let V=D$(0,q.min,q.max),O=O$(V,$),P=Math.abs(H-O)<F,L=q.value>=0;if(P){let D=(H-F)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=$-R;if(w>0)I6(J,R,G-K/2,w,K,W,X)}else if(L){let D=(O-N)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(O+N)/100*$,w=(H-F)/100*$-R;if(w>0)I6(J,R,G-K/2,w,K,W,U);let A=(H+F)/100*$,x=$-A;if(x>0)I6(J,A,G-K/2,x,K,W,X)}else{let D=(H-F)/100*$;if(D>0)I6(J,0,G-K/2,D,K,W,X);let R=(H+F)/100*$,w=(O-N)/100*$-R;if(w>0)I6(J,R,G-K/2,w,K,W,U);let A=(O+N)/100*$,x=$-A;if(x>0)I6(J,A,G-K/2,x,K,W,X)}}else if(Z.range&&q.secondValue!==null){let V=D$(q.secondValue,q.min,q.max),O=O$(V,$),P=Math.min(H,O),L=Math.max(H,O),D=H<=O,R=q.pressed&&q.activeHandle==="first"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,w=q.pressed&&q.activeHandle==="second"?Z6.HANDLE_GAP_PRESSED_REDUCTION:0,A=Z6.HANDLE_GAP-R,x=Z6.HANDLE_GAP-w,I=D?A/$*100:x/$*100,r=D?x/$*100:A/$*100,a=(P-I)/100*$;if(a>0)I6(J,0,G-K/2,a,K,W,X);let k6=(P+I)/100*$,i=(L-r)/100*$-k6;if(i>K)I6(J,k6,G-K/2,i,K,W,U);let y=(L+r)/100*$,l=$-y;if(l>0)I6(J,y,G-K/2,l,K,W,X)}else{let V=(H-F)/100*$;if(V>0)I6(J,0,G-K/2,V,K,W,U);let O=(H+F)/100*$,P=$-O;if(P>0)I6(J,O,G-K/2,P,K,W,X)}Y()},xj=(J,$,Q,Z,q,j)=>{if(!Z.ticks)return;let G=Z6.TICK_SIZE,K=Q/2,{primary:z,secondary:W}=R1(Z,j,"tick"),Y=Math.floor((q.max-q.min)/q.step);for(let U=0;U<=Y;U++){let X=q.min+U*q.step;if(X>q.max)continue;let _=D$(X,q.min,q.max),B=O$(_,$)/100*$,M=Math.abs(X-q.value)<q.step*0.1,k=Z.range&&q.secondValue!==null&&Math.abs(X-q.secondValue)<q.step*0.1;if(M||k)continue;let N=!1;if(Z.centered)N=q.value>=0?X>=0&&X<=q.value:X>=q.value&&X<=0;else if(Z.range&&q.secondValue!==null){let F=Math.min(q.value,q.secondValue),V=Math.max(q.value,q.secondValue);N=X>=F&&X<=V}else N=X<=q.value;J.fillStyle=N?z:W,J.globalAlpha=N?1:0.5,J.beginPath(),J.arc(B,K,G/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},yj=(J,$,Q,Z,q)=>{if(Z.ticks)return;let j=Z6.DOT_SIZE,G=Q/2,K=Z6.EDGE_PADDING,{primary:z}=R1(Z,q,"dot");J.fillStyle=z,J.beginPath(),J.arc($-K,G,j/2,0,Math.PI*2),J.fill()},P1=(J,$,Q,Z)=>{let{ctx:q,width:j,height:G}=J;if(j===0||G===0)return;F4(q,j,G),yj(q,j,G,$,Z),wj(q,j,G,$,Q,Z),xj(q,j,G,$,Q,Z)},eQ=(J,$)=>{let Q=A1($),{handle:Z,secondHandle:q}=J.components||{};if(Z)Z.style.height=`${Q}px`;if(q)q.style.height=`${Q}px`},Tj=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},w1=(J)=>($)=>{let Q=_4(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),Z=$.components?.container;if(Z)Z.insertBefore(Q,Z.firstChild);else $.element.appendChild(Q);let q=null,j=null,G=null,K=J.size||"XS",z=Tj(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),W={animatedValue:z.value,animatedSecondValue:z.secondValue,targetValue:z.value,targetSecondValue:z.secondValue,startValue:z.value,startSecondValue:z.secondValue,startTime:0,duration:H4.MEDIUM,animationFrame:null};if($.animationState=W,N4(()=>{try{return q=nQ(Q,{...J,size:K}),$.ctx=q.ctx,!0}catch(M){return console.warn("Slider canvas initialization failed:",M),!1}},()=>{eQ($,K)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let Y=()=>{if(!q)return;P1(q,{...J,size:K},{...z,value:W.animatedValue,secondValue:W.animatedSecondValue},$)},U=(M)=>{if(!q)return;let N=(M||performance.now())-W.startTime,F=Math.min(N/W.duration,1),V=w8(F),O=W.startValue,P=W.targetValue;if(W.animatedValue=O+(P-O)*V,W.targetSecondValue!==null&&W.animatedSecondValue!==null){let{startSecondValue:L,targetSecondValue:D}=W;W.animatedSecondValue=L+(D-L)*V}if(Y(),F<1)W.animationFrame=requestAnimationFrame((L)=>U(L));else W.animationFrame=null},X=(M)=>{if(!q){console.warn("Canvas context not ready");return}tQ(Q,q,{...J,size:K});let k,N=!1;if(M)k={value:M.value,secondValue:M.secondValue,min:M.min,max:M.max,step:M.step,pressed:M.pressed||!1,activeHandle:M.activeHandle||null},N=M.dragging||!1,z={...k};else if($.slider)k={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},z={...k};else k={...z};let F=k.value!==W.targetValue,V=k.secondValue!==W.targetSecondValue;if((F||V)&&!N){if(W.startValue=W.animatedValue,W.startSecondValue=W.animatedSecondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame);W.startTime=performance.now(),U()}else if(N){if(W.animatedValue=k.value,W.animatedSecondValue=k.secondValue,W.targetValue=k.value,W.targetSecondValue=k.secondValue,W.startValue=k.value,W.startSecondValue=k.secondValue,W.animationFrame)cancelAnimationFrame(W.animationFrame),W.animationFrame=null;P1(q,{...J,size:K},M||k,$)}else P1(q,{...J,size:K},M||k,$)},_=()=>{if(!q)return;try{let M=nQ(Q,{...J,size:K});$.ctx=M.ctx,Object.assign(q,M),Y()}catch(M){console.warn("Slider canvas resize failed:",M)}};j=t7($.element,Q,_);let H=()=>Y();G=x8(J.color||"primary",H),requestAnimationFrame(()=>{X()}),$.drawCanvas=X,$.resize=_,$.setSize=(M)=>{if(K=M,q)tQ(Q,q,{...J,size:K}),Y();eQ($,K)},$.getSize=()=>K;let B=$.appearance?.setColor;if(B)$.appearance.setColor=(M)=>{if(B(M),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(M&&M!=="primary")$.element.classList.add(`${$.getClass("slider")}--${M}`);if(J.color=M,G)G(),G=null;G=x8(M,H),X()};if($.lifecycle){let M=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(G)G();if(W.animationFrame)cancelAnimationFrame(W.animationFrame);M()}}return $};var $Z=(J)=>($)=>{return{...$,element:$.element,setValue(Q,Z=!0){return J.slider.setValue(Q,Z),this},getValue(){return J.slider.getValue()},setSecondValue(Q,Z=!0){return J.slider.setSecondValue(Q,Z),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};t();function JZ(J,$){let Q=(W)=>J.getClass(W),Z=$.min||0,q=$.max||100,j=$.value!==void 0?$.value:Z,G=$.disabled===!0,K=$.valueFormatter||((W)=>W.toString()),z=(j-Z)/(q-Z)*100;return{element:{options:{className:[Q("slider"),$.class].filter(Boolean),attributes:{tabindex:"-1",role:"none","aria-disabled":G?"true":"false"}},children:{container:{options:{className:Q("slider-container"),style:{position:"relative"}},children:{handle:{options:{className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Z),"aria-valuemax":String(q),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(j),"data-handle-index":"0"},style:{left:`${z}%`}}},valueBubble:{options:{className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:K(j),style:{left:`${z}%`}}}}}}}}}var Ij={min:V6.MIN,max:V6.MAX,value:V6.VALUE,step:V6.STEP,disabled:V6.DISABLED,color:V6.COLOR,size:V6.SIZE,ticks:V6.TICKS,showValue:V6.SHOW_VALUE,snapToSteps:V6.SNAP_TO_STEPS,range:V6.RANGE,centered:V6.CENTERED,iconPosition:V6.ICON_POSITION,labelPosition:V6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},QZ=(J={})=>{let $=u(Ij,J,"slider"),Q={componentName:"slider",config:$,getClass:(Z)=>{return`${$.prefix||"mtrl"}-${Z}`}};return $.schema=JZ(Q,$),$};var ZZ=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var Sj=(J={})=>{let $=QZ(J);try{let Q=b(S,d(),P7($),f8($),R7($),L1($),A7(),w1($),D1($),O1($),C())($),Z=ZZ(Q),q=$Z(Z)(Q);if($.on&&typeof q.on==="function")Object.entries($.on).forEach(([j,G])=>{if(typeof G==="function")q.on(j,G)});return q}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},qZ=Sj;J6();c();var jZ=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},KZ=(J)=>($)=>{let Q=null,Z=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},q=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(q(),j)j.call($.lifecycle)};return{...$,timer:{start:Z,stop:q}}};var x1={BASIC:"basic",ACTION:"action"},q9={CENTER:"center",START:"start",END:"end"},GZ={VISIBLE:"visible",HIDDEN:"hidden"},zZ={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},e9={VARIANT:x1.BASIC,POSITION:q9.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},WZ={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var YZ=(J)=>($)=>{let Q=J.position||q9.CENTER,Z=J.prefix||"mtrl",q=`${Z}-snackbar--${Q}`;$.element.classList.add(q);let j=(G)=>{$.element.classList.remove(q);let K=`${Z}-snackbar--${G}`;if($.element.classList.add(K),$.element.classList.contains(`${Z}-snackbar--visible`))if(G===q9.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(G)=>{if(Object.values(q9).includes(G))return j(G),$;else return console.warn(`Invalid position: ${G}. Using default: ${q9.CENTER}`),j(q9.CENTER),$}}}};o();var UZ=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let Z=!1,q={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:Z?"visible":"hidden",show(){if(Z)return this;return Z=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!Z)return this;if(Z=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(G)=>{if(G.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,G){return Q.on?.(j,G),this},off(j,G){return Q.off?.(j,G),this},destroy(){if(Z&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(Z)q.hide()};Q.on("dismiss",j);let G=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),G?.call(J)}}return q};var XZ=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let Z=J[0],q=()=>{if(J.shift(),Z.off?.("dismiss",q),J.length===0)$=!1;else setTimeout(Q,200)};Z.on?.("dismiss",q),Z._show()};return{add(Z){if(!Z._show)throw new Error("Snackbar must implement _show method");if(J.push(Z),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};t();var bj={variant:e9.VARIANT,position:e9.POSITION,duration:e9.DURATION},BZ=(J)=>u(bj,J,"snackbar"),FZ=(J)=>p(J,{tag:"div",className:J.class}),HZ=(J)=>({...J,text:J.message}),kZ=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var vj=XZ(),Cj=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=BZ(J);try{return b(S,d(),h(FZ($)),K6($),YZ($),Y9(HZ($)),jZ($),C(),KZ($),(Z)=>UZ(kZ(Z,vj))(Z))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},MZ=Cj;J6();c();o();var VZ=({disabled:J,lifecycle:$,checkable:Q})=>(Z)=>({...Z,element:Z.element,input:Z.input,getValue:Z.getValue||(()=>""),setValue(q){return Z.setValue?.(q),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(q){return Z.text?.setText(q),this},getLabel(){return Z.text?.getText()||""},supportingTextElement:Z.supportingTextElement||null,setSupportingText(q,j){if(Z.setSupportingText)Z.setSupportingText(q,j);return this},removeSupportingText(){if(Z.removeSupportingText)Z.removeSupportingText();return this},on(q,j){return Z.on?.(q,j),this},off(q,j){return Z.off?.(q,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});o();var NZ=(J,$,Q)=>{let Z=$||"mtrl",q=Q||"switch",j=J.element.querySelector(`.${Z}-${q}-container`);if(!j){j=document.createElement("div"),j.className=`${Z}-${q}-container`;let K=J.element.querySelector(`.${Z}-${q}-input`),z=J.element.querySelector(`.${Z}-${q}-track`),W=[];if(K)W.push(K);if(z)W.push(z);let Y=document.createElement("div");Y.className=`${Z}-${q}-content`;let U=J.element.querySelector(`.${Z}-${q}-label`);if(U)Y.appendChild(U);return j.appendChild(Y),W.forEach((X)=>j.appendChild(X)),J.element.appendChild(j),{container:j,contentWrapper:Y}}let G=J.element.querySelector(`.${Z}-${q}-content`);if(!G){G=document.createElement("div"),G.className=`${Z}-${q}-content`;let K=J.element.querySelector(`.${Z}-${q}-label`);if(K)G.appendChild(K);j.insertBefore(G,j.firstChild)}return{container:j,contentWrapper:G}},y1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"switch",{contentWrapper:q}=NZ($,Q,Z),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${Z}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${Z}-helper--error`),$.element.classList.add(`${Q}-${Z}--error`);q.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let G=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();G.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(G,K=!1){let{contentWrapper:z}=NZ($,Q,Z),W=this.supportingTextElement;if(!W)W=document.createElement("div"),W.className=`${Q}-${Z}-helper`,z.appendChild(W),this.supportingTextElement=W;return W.textContent=G,W.classList.toggle(`${Q}-${Z}-helper--error`,K),$.element.classList.toggle(`${Q}-${Z}--error`,K),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${Z}--error`);return this}}},_Z=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return l7(Q)($)};t();var Ej={prefix:"mtrl",componentName:"switch"},LZ=(J={})=>u(Ej,J,"switch"),DZ=(J)=>p(J,{tag:"div",className:J.class,interactive:!0}),OZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var hj=(J={})=>{let $=LZ(J);try{return b(S,d(),h(DZ($)),X9($),u9($),_Z($),y1($),f9($),G6($),C(),(Z)=>VZ(OZ(Z))(Z))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},PZ=hj;var T1={START:"start",END:"end"},RZ={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},AZ={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},wZ={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:T1.END,VALUE:"on"},xZ={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};J6();c();o();J6();c();o();var P$={PRIMARY:"primary",SECONDARY:"secondary"},I7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},I1={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},yZ={CLICK:"click",FOCUS:"focus",BLUR:"blur"},S1={CHANGE:"change"},v9={VARIANT:P$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:I1.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},$7={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},TZ={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},IZ={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};t();c();var uj={state:I7.INACTIVE,componentName:"tab",ripple:v9.RIPPLE},fj={variant:v9.VARIANT,scrollable:v9.SCROLLABLE,showDivider:v9.SHOW_DIVIDER,componentName:"tabs"},SZ=(J={})=>u(fj,J,"tabs"),bZ=(J={})=>u(uj,J,"tab"),vZ=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>h($)(Q)};T9();K7();var S7=(J={})=>{let $=bZ(J);try{let Q=b(S,d(),C())($),Z=Q9({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=Z.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);Z.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let q={...Q,button:Z,element:Z.element,badge:null,getValue(){return Z.getValue()},setValue(j){let G=j||"";return Z.setValue(G),this.element.setAttribute("id",`tab-${G}`),this.element.setAttribute("aria-controls",`tabpanel-${G}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),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 Z.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return Z.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return Z.setText(j),this.updateLayoutStyle(),this},getText(){return Z.getText()},setIcon(j){return Z.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return Z.getIcon()},setBadge(j){if(!this.badge){let G={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=j7(G)}else this.badge.setContent(j),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(Z.destroy)Z.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),G=!!this.getIcon(),K="";if(j&&G)K=$7.ICON_AND_TEXT;else if(G)K=$7.ICON_ONLY;else K=$7.TEXT_ONLY;if(Object.values($7).forEach((z)=>{this.element.classList.remove(`${this.getClass("tab")}--${z}`)}),this.element.classList.add(`${this.getClass("tab")}--${K}`),K===$7.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)q.setBadge($.badge);return q.updateLayoutStyle(),q}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var CZ=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let Z={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(Z.value===void 0)Z.value="";let q=S7(Z);if($.tabs.push(q),$.tabsContainer.appendChild(q.element),q.on&&typeof q.on==="function")q.on("click",(G)=>$.handleTabClick(G,q));return q.element.addEventListener("click",(G)=>{$.handleTabClick(G,q)}),q},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(q)=>$.handleTabClick(q,Q));return Q.element.addEventListener("click",(q)=>{$.handleTabClick(q,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let Z=typeof Q==="string"?$.tabs.find((q)=>q.getValue()===Q):Q;if(!Z)return this;if($.tabs.forEach((q)=>q.deactivate()),Z.activate(),$.emit)$.emit("change",{tab:Z,value:Z.getValue()});return this},removeTab(Q){let Z=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!Z)return this;let q=$.tabs.indexOf(Z);if(q!==-1)$.tabs.splice(q,1);if(Z.element.parentNode)Z.element.parentNode.removeChild(Z.element);return Z.destroy(),this},on(Q,Z){if($.on)$.on(Q,Z);return this},off(Q,Z){if($.off)$.off(Q,Z);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),EZ=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function hZ(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function b1(J){let $=hZ(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((q)=>{if(q.getAttribute("aria-labelledby")?.replace("tab-","")===Q)q.removeAttribute("hidden"),q.setAttribute("tabindex","0");else q.setAttribute("hidden","true"),q.setAttribute("tabindex","-1")})}function v1(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),Z=hZ(J),q=Z?Q.indexOf(Z):-1,j=q;switch($.key){case"ArrowRight":case"ArrowDown":j=q<Q.length-1?q+1:0;break;case"ArrowLeft":case"ArrowUp":j=q>0?q-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==q&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var gj={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},C1=(J={})=>{let $={...gj,...J},Q=$.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-tabs-indicator`,Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
31
- width ${$.animationDuration}ms ${$.animationTiming}`,Z.style.width=`${$.fixedWidth}px`,!$.visible)Z.style.opacity="0";let q=null,j=(H)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return H.element.offsetWidth;let B=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(B)return B.clientWidth;return Math.max(H.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(H.element.offsetWidth/2,30);case"content":let B=H.element.querySelector(`.${Q}-button-text`)||H.element.querySelector(`.${Q}-tab-text`);if(B)return Math.max(B.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},G=(H)=>{let B=H.parentElement;if(!B)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:H.offsetWidth};let M=H.getBoundingClientRect(),k=B.getBoundingClientRect();return{left:M.left-k.left,width:M.width}},K=(H,B)=>{let{left:M,width:k}=G(H.element);if($.variant!=="secondary"&&($.widthStrategy==="auto"||$.widthStrategy==="content")){let N=H.element.querySelector(`.${Q}-tab-text`)||H.element.querySelector(`.${Q}-button-text`);if(N){let F=N.getBoundingClientRect(),V=H.element.getBoundingClientRect(),O=F.left-V.left;return{left:M+O}}}if(B<k)return{left:M+(k-B)/2};return{left:M}},z=(H,B=!1)=>{if(!H||!H.element){console.error("Invalid tab or tab has no element");return}q=H;let M=j(H),{left:k}=K(H,M);if(B)Z.style.transition="none",Z.offsetHeight;if(Z.style.width=`${M}px`,Z.style.transform=`translateX(${k}px)`,B)setTimeout(()=>{Z.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
32
- width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:Z,moveToTab:z,show:()=>{Z.style.opacity="1"},hide:()=>{Z.style.opacity="0"},setColor:(H)=>{Z.style.backgroundColor=H},update:()=>{if(q)z(q,!0)},destroy:()=>{if(Z.parentNode)Z.parentNode.removeChild(Z);q=null}}};var E1=(J)=>($)=>{let Q=[],Z=$.scrollContainer||$.element;if(Array.isArray(J.tabs))J.tabs.forEach((K)=>{let z={...K,prefix:J.prefix,variant:K.variant||J.variant},W=S7(z);Q.push(W),Z.appendChild(W.element)});let q=()=>{return[...Q]},j=()=>{return Q.find((K)=>K.isActive())||null},G=(K,z)=>{if(K&&typeof K.preventDefault==="function")K.preventDefault();if(z.disabled&&z.disabled.isDisabled&&z.disabled.isDisabled())return;Q.forEach((Y)=>Y.deactivate()),z.activate();let W=z.getValue();if(b1({tabs:Q,getActiveTab:()=>Q.find((Y)=>Y.isActive())||null}),typeof $.emit==="function")$.emit("change",{tab:z,value:W})};return Q.forEach((K)=>{if(K.on&&typeof K.on==="function")K.on("click",(z)=>G(z,K));K.element.addEventListener("click",(z)=>G(z,K))}),{...$,tabs:Q,tabsContainer:Z,handleTabClick:G,getTabs:q,getActiveTab:j}},h1=(J)=>($)=>{if(J.scrollable===!1)return $;$.element.classList.add(`${$.getClass("tabs")}--scrollable`);let Q=document.createElement("div");Q.className=`${$.getClass("tabs")}-scroll`;while($.element.firstChild)Q.appendChild($.element.firstChild);return $.element.appendChild(Q),{...$,scrollContainer:Q}},u1=(J)=>($)=>{if(J.showDivider===!1)return $;let Q=document.createElement("div");return Q.className=`${$.getClass("tabs")}-divider`,$.element.appendChild(Q),$},f1=(J)=>($)=>{let Q=J.indicator||{},Z=C1({prefix:J.prefix,widthStrategy:Q.widthStrategy||J.indicatorWidthStrategy||"auto",height:Q.height||J.indicatorHeight||3,fixedWidth:Q.fixedWidth||40,animationDuration:Q.animationDuration||250,animationTiming:Q.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:Q.color,variant:J.variant??"primary"}),q=$.scrollContainer||$.element;if(!q)throw console.error("No scroll container found - cannot add indicator"),new Error("Failed to create tabs: No scroll container found");q.appendChild(Z.element);let j=$.handleTabClick;$.handleTabClick=function(Y,U){if(U.disabled&&U.disabled.isDisabled&&U.disabled.isDisabled())return;j.call(this,Y,U),setTimeout(()=>{Z.moveToTab(U)},10)},setTimeout(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)},50);let G=()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)};if(q)q.addEventListener("scroll",G);let K=new ResizeObserver(()=>{let Y=$.tabs.find((U)=>U.isActive());if(Y)Z.moveToTab(Y,!0)});K.observe(q);let z=new MutationObserver((Y)=>{for(let U of Y)if(U.type==="attributes"&&U.attributeName==="class"&&U.target.classList.contains(`${J.prefix}-tab--active`)){let X=U.target,_=$.tabs.find((H)=>H.element===X);if(_)Z.moveToTab(_)}});if(Array.isArray($.tabs))$.tabs.forEach((Y)=>{if(Y.element)z.observe(Y.element,{attributes:!0})});let W=$.destroy||(()=>{});return $.destroy=function(){if(Z.destroy(),K.disconnect(),z.disconnect(),q)q.removeEventListener("scroll",G);if(typeof W==="function")W.call(this)},{...$,indicator:Z,getIndicator:()=>Z}};var dj=(J)=>{let{tabs:$=[],onChange:Q,indicator:Z}=J,q=null,j=$.find((Y)=>Y.isActive());if(j){if(q=j,Z)setTimeout(()=>{Z.moveToTab(j,!0)},50)}let G=(Y)=>{if(!Y.element)return;let U=Y.element.querySelector(`.${Y.getClass("tab")}-ripple`);if(!U)return;let X=document.createElement("span");X.className="ripple",X.style.width="100%",X.style.height="100%",X.style.left="0",X.style.top="0",X.style.animation="ripple-effect 0.4s cubic-bezier(0.4, 0, 0.2, 1)",U.appendChild(X),setTimeout(()=>{X.remove()},400)};return{activateTab:(Y,U=!1)=>{if(!Y||q===Y)return;if(q)q.deactivate();if(Y.activate(),q=Y,Z)setTimeout(()=>{Z.moveToTab(Y,U)},10);if(!U)G(Y);if(Q)Q({tab:Y,value:Y.getValue()})},getActiveTab:()=>{return q},destroy:()=>{q=null}}},uZ=()=>{if(document.getElementById("tab-state-styles"))return;let J=document.createElement("style");J.id="tab-state-styles",J.textContent=`
30
+ </svg>`,a0={CHECKMARK:'<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="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>'},i0={CONTAINER:"segmented-button",SEGMENT:"segmented-button__segment",SELECTED:"segmented-button__segment--selected",DISABLED:"segmented-button__segment--disabled",HAS_ICON:"segmented-button__segment--has-icon",ICON:"segmented-button__icon",LABEL:"segmented-button__label",CHECKMARK:"segmented-button__checkmark",RIPPLE:"segmented-button__ripple",SINGLE_MODE:"segmented-button--single",MULTI_MODE:"segmented-button--multi",DEFAULT_DENSITY:"segmented-button--density-default",COMFORTABLE_DENSITY:"segmented-button--density-comfortable",COMPACT_DENSITY:"segmented-button--density-compact"};var N3={mode:u9.MODE,ripple:u9.RIPPLE,density:u9.DENSITY},c0=(J={})=>C(N3,J,"segmented-button"),o0=(J)=>{let $=J.density||"default";return{tag:"div",componentName:"segmented-button",attributes:{role:"group","aria-label":"Segmented button","data-mode":J.mode||"single","data-density":$},className:[J.class,J.disabled?`${J.prefix}-segmented-button--disabled`:null,$!=="default"?`${J.prefix}-segmented-button--${$}`:null],interactive:!0}},U8=(J)=>{switch(J){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"}}};L9();var X8=(J,$,Q,q=!1,Z={ripple:!0,rippleConfig:{}})=>{let j=q||J.disabled,K=J.icon,G=J.checkmarkIcon||m0,Y=o6({text:J.text,icon:J.selected&&J.text&&K?G:K,value:J.value||J.text||"",disabled:j,ripple:Z.ripple,rippleConfig:Z.rippleConfig,class:J.class});if(Y.element.classList.add(`${Q}-segmented-button-segment`),J.selected)Y.element.classList.add(`${Q}-segment--selected`),Y.element.setAttribute("aria-pressed","true");else Y.element.setAttribute("aria-pressed","false");$.appendChild(Y.element);let z=(X)=>{if(Y.element.classList.toggle(`${Q}-segment--selected`,X),Y.element.setAttribute("aria-pressed",X?"true":"false"),J.text&&K)if(X)Y.setIcon(G);else Y.setIcon(K)},W=J.selected||!1;return{element:Y.element,value:J.value||J.text||"",isSelected(){return W},setSelected(X){W=X,z(X)},isDisabled(){return Y.disabled?.isDisabled?.()||!1},setDisabled(X){if(X)Y.disable();else Y.enable()},destroy(){Y.destroy()}}};var L3=(J={})=>{let $=c0(J),Q=$.mode||"single",q=$.density||"default",Z=v6();try{let j=I(T,h(),S(o0($)),b())($),K=U8(q);Object.entries(K).forEach(([N,F])=>{j.element.style.setProperty(N,F)});let G=[];if($.segments&&$.segments.length)$.segments.forEach((N)=>{let F=X8(N,j.element,$.prefix,$.disabled,{ripple:$.ripple,rippleConfig:$.rippleConfig});G.push(F)});if(Q==="single"&&!G.some((N)=>N.isSelected())){let N=G.find((F)=>!F.isDisabled());if(N)N.setSelected(!0)}let Y=(N)=>{let F=N.currentTarget,k=G.find((B)=>B.element===F);if(!k||k.isDisabled())return;let L=W();if(Q==="single")G.forEach((B)=>{B.setSelected(B===k)});else k.setSelected(!k.isSelected());let D=W();if(L.length!==D.length||L.some((B)=>!D.includes(B))||D.some((B)=>!L.includes(B)))Z.emit("change",{selected:z(),value:D,oldValue:L})};G.forEach((N)=>{N.element.addEventListener("click",Y)});let z=()=>G.filter((N)=>N.isSelected()),W=()=>z().map((N)=>N.value),X=(N)=>G.find((F)=>F.value===N),U=(N)=>{if(["default","comfortable","compact"].forEach((k)=>{if(k!=="default")j.element.classList.remove(`${$.prefix}-segmented-button--${k}`)}),N!=="default")j.element.classList.add(`${$.prefix}-segmented-button--${N}`);j.element.setAttribute("data-density",N);let F=U8(N);Object.entries(F).forEach(([k,L])=>{j.element.style.setProperty(k,L)})};return{element:j.element,segments:G,getSelected:z,getValue(){return W()},select(N){let F=X(N);if(F&&!F.isDisabled()){let k=W();if(Q==="single")G.forEach((D)=>D.setSelected(D===F));else F.setSelected(!0);let L=W();if(k.join(",")!==L.join(","))Z.emit("change",{selected:z(),value:L,oldValue:k})}return this},deselect(N){let F=X(N);if(F&&!F.isDisabled())if(Q==="single"){if(z().length>1||!F.isSelected()){let L=W();F.setSelected(!1);let D=W();if(L.join(",")!==D.join(","))Z.emit("change",{selected:z(),value:D,oldValue:L})}}else{let k=W();F.setSelected(!1);let L=W();if(k.join(",")!==L.join(","))Z.emit("change",{selected:z(),value:L,oldValue:k})}return this},enable(){return j.element.classList.remove(`${$.prefix}-segmented-button--disabled`),G.forEach((N)=>{if(!$.segments?.find((F)=>F.value===N.value)?.disabled)N.setDisabled(!1)}),this},disable(){return j.element.classList.add(`${$.prefix}-segmented-button--disabled`),G.forEach((N)=>{N.setDisabled(!0)}),this},enableSegment(N){let F=X(N);if(F)F.setDisabled(!1);return this},disableSegment(N){let F=X(N);if(F)F.setDisabled(!0);return this},setDensity(N){return U(N),this},getDensity(){return j.element.getAttribute("data-density")||"default"},on(N,F){return Z.on(N,F),this},off(N,F){return Z.off(N,F),this},destroy(){G.forEach((N)=>{N.element.removeEventListener("click",Y),N.destroy()}),Z.clear(),j.lifecycle.destroy()}}}catch(j){throw console.error("Segmented Button creation error:",j),new Error(`Failed to create segmented button: ${j.message}`)}},B8=L3;n();s();i();var x6={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},f9={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"};var F8=(J)=>($)=>{let{position:Q=x6.BOTTOM}=J,q=`${$.getClass("sheet")}--${Q.toLowerCase()}`;return $.element.classList.add(q),{...$,position:{setPosition(Z){$.element.classList.remove(q);let j=`${$.getClass("sheet")}--${Z.toLowerCase()}`;$.element.classList.add(j)},getPosition(){return Q}}}};var H8=(J)=>($)=>{let{content:Q=""}=J,q=document.createElement("div");return q.className=`${$.getClass("sheet")}-content`,q.innerHTML=Q,$.container=document.createElement("div"),$.container.className=`${$.getClass("sheet")}-container`,$.container.appendChild(q),$.element.appendChild($.container),{...$,content:{setContent(Z){return q.innerHTML=Z,this},getContent(){return q.innerHTML},getElement(){return q}}}};var M8=(J)=>($)=>{let{title:Q=""}=J,q=null;if(Q||J.dragHandle){if(q=document.createElement("div"),q.className=`${$.getClass("sheet")}-title`,Q)q.textContent=Q;if($.container.insertBefore(q,$.container.firstChild),J.dragHandle){let Z=document.createElement("div");Z.className=`${$.getClass("sheet")}-handle`,$.container.insertBefore(Z,$.container.firstChild),$.dragHandle={element:Z,setVisible(j){Z.style.display=j?"block":"none"}}}}return{...$,title:{setTitle(Z){if(!q&&Z)q=document.createElement("div"),q.className=`${$.getClass("sheet")}-title`,$.container.insertBefore(q,$.content.getElement());if(q)q.textContent=Z;return this},getTitle(){return q?q.textContent||"":""},getElement(){return q}}}};var k8=(J)=>($)=>{let{open:Q=!1,dismissible:q=!0}=J,Z=Q,j=document.createElement("div");if(j.className=`${$.getClass("sheet")}-scrim`,$.element.parentNode?.insertBefore(j,$.element.nextSibling),q)$.element.classList.add(`${$.getClass("sheet")}--dismissible`),j.addEventListener("click",()=>{if(q)G()});if(Q)$.element.classList.add(`${$.getClass("sheet")}--open`);if(J.elevation)$.element.classList.add(`${$.getClass("sheet")}--elevation-${J.elevation}`);document.addEventListener("keydown",(Y)=>{if(Y.key==="Escape"&&Z&&q)G()});function K(){if(!Z){if(Z=!0,$.element.classList.add(`${$.getClass("sheet")}--open`),$.events.emit(f9.OPEN),J.onOpen)J.onOpen()}}function G(){if(Z){if(Z=!1,$.element.classList.remove(`${$.getClass("sheet")}--open`),$.events.emit(f9.CLOSE),J.onClose)J.onClose()}}return{...$,state:{open:K,close:G,isOpen(){return Z},setDismissible(Y){if(Y)$.element.classList.add(`${$.getClass("sheet")}--dismissible`);else $.element.classList.remove(`${$.getClass("sheet")}--dismissible`)}},initialize(){if(j.parentNode!==$.element.parentNode)$.element.parentNode?.insertBefore(j,$.element.nextSibling)}}};var N8=(J)=>($)=>{if(J.enableGestures===!1)return $;let Q=J.position||x6.BOTTOM,q=0,Z=0,j=!1,K=$.dragHandle?.element||$.element,G=(U)=>{if(!$.state.isOpen())return;if(j=!0,document.body.style.userSelect="none",U.type==="touchstart")q=U.touches[0].clientY,Z=U.touches[0].clientX;else q=U.clientY,Z=U.clientX,document.addEventListener("mousemove",Y),document.addEventListener("mouseup",z);$.events.emit(f9.DRAG_START)},Y=(U)=>{if(!j)return;let _,N;if(U.type==="touchmove")_=U.touches[0].clientY,N=U.touches[0].clientX;else _=U.clientY,N=U.clientX;let F=0;switch(Q){case x6.BOTTOM:if(F=_-q,F<0)F=0;$.element.style.transform=`translateY(${F}px)`;break;case x6.TOP:if(F=q-_,F<0)F=0;$.element.style.transform=`translateY(-${F}px)`;break;case x6.LEFT:if(F=Z-N,F<0)F=0;$.element.style.transform=`translateX(-${F}px)`;break;case x6.RIGHT:if(F=N-Z,F<0)F=0;$.element.style.transform=`translateX(${F}px)`;break}let k=Q===x6.BOTTOM||Q===x6.TOP?$.element.offsetHeight:$.element.offsetWidth,L=Math.min(F/k,1),D=$.element.nextElementSibling;if(D&&D.classList.contains(`${$.getClass("sheet")}-scrim`))D.style.opacity=`${0.32*(1-L)}`},z=()=>{if(!j)return;j=!1,document.body.style.userSelect="",document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",z);let U=Q===x6.BOTTOM||Q===x6.TOP?$.element.offsetHeight:$.element.offsetWidth,_=0;if($.element.style.transform){let N=$.element.style.transform.match(/translate[XY]\(([^p]+)px\)/);_=N?parseFloat(N[1]):0}if(_>U*0.3)$.state.close();else{$.element.style.transform="";let N=$.element.nextElementSibling;if(N&&N.classList.contains(`${$.getClass("sheet")}-scrim`))N.style.opacity=""}$.events.emit(f9.DRAG_END)};K.addEventListener("touchstart",G),K.addEventListener("touchmove",Y),K.addEventListener("touchend",z),K.addEventListener("mousedown",G);let W=()=>{K.removeEventListener("touchstart",G),K.removeEventListener("touchmove",Y),K.removeEventListener("touchend",z),K.removeEventListener("mousedown",G),document.removeEventListener("mousemove",Y),document.removeEventListener("mouseup",z)},X=$.lifecycle?.destroy||(()=>{});return $.lifecycle={...$.lifecycle,destroy:()=>{W(),X()}},$};var t0=({state:J,lifecycle:$})=>(Q)=>({...Q,element:Q.element,container:Q.container,open(){return J.open(),this},close(){return J.close(),this},setContent(q){return Q.content.setContent(q),this},getContent(){return Q.content.getContent()},setTitle(q){return Q.title.setTitle(q),this},getTitle(){return Q.title.getTitle()},setDragHandle(q){if(Q.dragHandle)Q.dragHandle.setVisible(q);return this},setMaxHeight(q){return Q.container.style.maxHeight=q,this},destroy(){$.destroy()},initialize(){if(Q.initialize)Q.initialize();return this}});c();var D9={STANDARD:"standard",MODAL:"modal",EXPANDED:"expanded"},g9={BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"},n0={OPEN:"open",CLOSE:"close",DRAG_START:"dragstart",DRAG_END:"dragend"},L8={LEVEL_1:1,LEVEL_2:2,LEVEL_3:3,LEVEL_4:4,LEVEL_5:5},z9={VARIANT:D9.STANDARD,POSITION:g9.BOTTOM,OPEN:!1,DISMISSIBLE:!0,DRAG_HANDLE:!0,ELEVATION:L8.LEVEL_3,TITLE:"",CONTENT:"",MAX_HEIGHT:"80%",ENABLE_GESTURES:!0},e0={DURATION:300,TIMING:"cubic-bezier(0.4, 0, 0.2, 1)",DELAY:0},$4={MIN_VELOCITY:0.3,MIN_DISTANCE:30,DISMISS_THRESHOLD:0.3},J4={CONTAINER:"sheet",SCRIM:"sheet__scrim",PANEL:"sheet__panel",DRAG_HANDLE:"sheet__drag-handle",TITLE:"sheet__title",CONTENT:"sheet__content",STANDARD:"sheet--standard",MODAL:"sheet--modal",EXPANDED:"sheet--expanded",BOTTOM:"sheet--bottom",TOP:"sheet--top",LEFT:"sheet--left",RIGHT:"sheet--right",OPEN:"sheet--open",DRAGGING:"sheet--dragging",ELEVATION_PREFIX:"sheet--elevation-"};var V3={variant:D9.STANDARD,position:g9.BOTTOM,open:z9.OPEN,dismissible:z9.DISMISSIBLE,dragHandle:z9.DRAG_HANDLE,elevation:z9.ELEVATION,enableGestures:z9.ENABLE_GESTURES},Q4=(J={})=>C(V3,J,"sheet"),q4=(J)=>{return f(J,{tag:"div",attributes:{role:"dialog","aria-modal":J.variant===D9.MODAL?"true":"false"},className:J.class,forwardEvents:{click:!0,keydown:!0}})},Z4=(J)=>({state:{open:()=>J.state.open(),close:()=>J.state.close()},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var _3=(J={})=>{let $=Q4(J);try{let Q=I(T,h(),S(q4($)),G6($),F8($),H8($),M8($),k8($),N8($),b(),(q)=>t0(Z4(q))(q))($);return Q.initialize(),Q}catch(Q){throw console.error("Sheet creation error:",Q),new Error(`Failed to create sheet: ${Q.message}`)}},j4=_3;s();i();S6();var V8=(J)=>($)=>{if(!J.range||!J.secondValue||!$.schema)return $;try{let Q=J.min||0,q=J.max||100,Z=J.secondValue,j=(Z-Q)/(q-Q)*100,K=J.valueFormatter||((U)=>U.toString()),G=J.disabled===!0,Y=$.getClass,z=JSON.parse(JSON.stringify($.schema)),W=z.element.options.className||[];if(Array.isArray(W))W.push(Y("slider--range"));else z.element.options.className=`${W} ${Y("slider--range")}`.trim();let X=z.element.children.container.children;return X.secondHandle={name:"secondHandle",creator:E,options:{tag:"div",className:Y("slider-handle"),attributes:{role:"slider","aria-valuemin":String(Q),"aria-valuemax":String(q),"aria-valuenow":String(Z),"aria-orientation":"horizontal",tabindex:G?"-1":"0","aria-disabled":G?"true":"false","data-value":String(Z),"data-handle-index":"1"},style:{left:`${j}%`}}},X.secondValueBubble={name:"secondValueBubble",creator:E,options:{tag:"div",className:Y("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:K(Z),style:{left:`${j}%`}}},{...$,schema:z}}catch(Q){return console.warn("Error enhancing structure with range functionality:",Q),$}};var t6={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",ERROR:"error"},V6={XS:16,S:24,M:40,L:56,XL:80},q6={HANDLE_SIZE:16,SMALL_HANDLE_HEIGHT:48,HANDLE_HEIGHT_OFFSET:16,MIN_HEIGHT:40,TRACK_RADIUS:3,SMALL_TRACK_EXTERNAL_RADIUS:10,LARGE_TRACK_RADIUS_RATIO:0.35,TICK_SIZE:4,DOT_SIZE:4,HANDLE_GAP:8,HANDLE_GAP_PRESSED_REDUCTION:2,CENTER_GAP:4,EDGE_PADDING:7},M6={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",START:"start",END:"end"},t7={START:"start",END:"end"},k6={MIN:0,MAX:100,VALUE:0,STEP:1,DISABLED:!1,COLOR:t6.PRIMARY,SIZE:"XS",TICKS:!1,SHOW_VALUE:!0,SNAP_TO_STEPS:!0,RANGE:!1,CENTERED:!1,ICON_POSITION:t7.START,LABEL_POSITION:t7.START},K4={ROOT:"slider",CONTAINER:"slider__container",FILL:"slider__fill",HANDLE:"slider__handle",HANDLE_SECOND:"slider__handle--second",LABEL:"slider__label",VALUE:"slider__value",ICON:"slider__icon",DISABLED:"slider--disabled",FOCUSED:"slider--focused",DRAGGING:"slider--dragging",RANGE:"slider--range",PRIMARY:"slider--primary",SECONDARY:"slider--secondary",TERTIARY:"slider--tertiary",ERROR:"slider--error"};var _8=(J)=>($)=>{if(J.disabled===!0)setTimeout(()=>{q()},0);function q(){if($.element.classList.add(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","true"),$.structure?.handle)$.structure.handle.tabIndex=-1,$.structure.handle.setAttribute("aria-disabled","true");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=-1,$.structure.secondHandle.setAttribute("aria-disabled","true");if($.drawCanvas)$.drawCanvas()}function Z(){if($.element.classList.remove(`${$.getClass("slider")}--disabled`),$.element.setAttribute("aria-disabled","false"),$.structure?.handle)$.structure.handle.tabIndex=0,$.structure.handle.setAttribute("aria-disabled","false");if(J.range&&$.structure?.secondHandle)$.structure.secondHandle.tabIndex=0,$.structure.secondHandle.setAttribute("aria-disabled","false");if($.drawCanvas)$.drawCanvas()}function j(){return Object.values(t6).find((G)=>$.element.classList.contains(`${$.getClass("slider")}--${G}`))||t6.PRIMARY}function K(){return Object.keys(V6).find((z)=>$.element.classList.contains(`${$.getClass("slider")}--${z.toLowerCase()}`))||"XS"}return{...$,disabled:{enable(){return Z(),this},disable(){return q(),this},isDisabled(){return $.element.classList.contains(`${$.getClass("slider")}--disabled`)}},appearance:{setColor(G){if(Object.values(t6).forEach((Y)=>{$.element.classList.remove(`${$.getClass("slider")}--${Y}`)}),G!==t6.PRIMARY)$.element.classList.add(`${$.getClass("slider")}--${G}`);return this},getColor(){return j()},setSize(G){Object.keys(V6).forEach((W)=>{$.element.classList.remove(`${$.getClass("slider")}--${W.toLowerCase()}`)});let z;if(typeof G==="string"&&G in V6)z=G;else if(typeof G==="number"){let W=Object.entries(V6).find(([,X])=>X===G);z=W?W[0]:"XS"}else z="XS";return $.element.classList.add(`${$.getClass("slider")}--${z.toLowerCase()}`),this},getSize(){return K()},showTicks(G){if(J.ticks=G,$.slider)$.slider.regenerateTicks();return this},showCurrentValue(G){return J.showValue=G,this}}}};var G4=(J,$,Q,q)=>{let Z=$.component?.components||{},j=$.component||{},K=j.container||Z.container||null,G=j.handle||Z.handle||null,Y=j.valueBubble||Z.valueBubble||null,z=j.secondHandle||Z.secondHandle||null,W=j.secondValueBubble||Z.secondValueBubble||null,{getValueFromPosition:X=()=>0,roundToStep:U=(w)=>w,clamp:_=(w)=>w,showValueBubble:N=()=>{},render:F=()=>{}}=Q,{triggerEvent:k=()=>({defaultPrevented:!1})}=q,L=!1,D=0,B=3,H=null,V=()=>{if($.valueHideTimer)clearTimeout($.valueHideTimer),$.valueHideTimer=null},O=()=>{if(V(),Y)N(Y,!1);if(W)N(W,!1)},M=(w)=>{if(O(),w&&J.showValue)N(w,!0)},P=(w,l=0)=>{if(V(),!w||!J.showValue)return;if(l>0)$.valueHideTimer=setTimeout(()=>{N(w,!1)},l);else N(w,!1)},R=()=>{if(G)G.classList.remove(`${$.component.getClass("slider-handle")}--focused`);if(z)z.classList.remove(`${$.component.getClass("slider-handle")}--focused`);try{let w=$.component.getClass("slider-handle--focused");if(document.querySelectorAll(`.${w}`).forEach((l)=>{l.classList.remove(w)}),document.activeElement?.classList.contains($.component.getClass("slider-handle")))document.activeElement.blur()}catch(w){console.warn("Error clearing keyboard focus:",w)}},y=(w,l=!1)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled())return;w.preventDefault(),w.stopPropagation(),O(),R(),D=w.type.includes("touch")?w.touches[0].clientX:w.clientX,$.dragging=!1,$.pressed=!0,L=!1,$.activeHandle=l?"second":"first",$.activeBubble=l?W:Y,M($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",v),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",v),F(),k(M6.START,w)},x=(w)=>{if(!$.component||$.component.disabled&&$.component.disabled.isDisabled()||!K)return;w.preventDefault(),O(),R();let l=!1;try{let m=w.type.includes("touch")?w.touches[0].clientX:w.clientX,a=X(m);if(J.snapToSteps&&$.step>0)a=U(a);if(a=_(a,$.min,$.max),J.range&&$.secondValue!==null){let O6=Math.abs(a-$.value);l=Math.abs(a-$.secondValue)<O6,l?$.secondValue=a:$.value=a}else if(J.centered&&$.component.slider&&$.component.slider.setValue)$.component.slider.setValue(a,!1);else $.value=a;F(),k(M6.INPUT,w)}catch(m){console.warn("Error handling track click:",m)}if($.activeHandle=l?"second":"first",$.activeBubble=l?W:Y,D=w.type.includes("touch")?w.touches[0].clientX:w.clientX,J.centered&&!J.range)M($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",v),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",v),$.pressed=!1,k(M6.START,w);else $.dragging=!1,$.pressed=!1,L=!1,M($.activeBubble),document.addEventListener("mousemove",A),document.addEventListener("mouseup",v),document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",v),F(),k(M6.START,w)},A=(w)=>{if(!$.activeHandle||!K)return;w.preventDefault();try{let l=w.type.includes("touch")?w.touches[0].clientX:w.clientX;if(!L&&Math.abs(l-D)>=B)L=!0,$.dragging=!0,$.component.element.classList.add(`${$.component.getClass("slider")}--dragging`);let m=X(l);if(J.snapToSteps&&$.step>0)m=U(m);m=_(m,$.min,$.max);let a=$.activeHandle==="second";if(J.range&&$.secondValue!==null)if(a)if(m>=$.value)$.secondValue=m;else P($.activeBubble,0),$.secondValue=$.value,$.value=m,$.activeHandle="first",$.activeBubble=Y,M($.activeBubble);else if(m<=$.secondValue)$.value=m;else P($.activeBubble,0),$.value=$.secondValue,$.secondValue=m,$.activeHandle="second",$.activeBubble=W,M($.activeBubble);else{if(J.centered)$.previousValue=$.value;$.value=m}F(),k(M6.INPUT,w)}catch(l){console.warn("Error during slider drag:",l)}},v=(w)=>{if(!$.activeHandle)return;w.preventDefault(),$.dragging=!1,$.pressed=!1,L=!1,$.component.element.classList.remove(`${$.component.getClass("slider")}--dragging`),P($.activeBubble,1000),document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",v),$.activeHandle=null,F(),k(M6.CHANGE,w),k(M6.END,w)},r=(w,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=$.step||1,a=l?$.secondValue:$.value,O6=w.shiftKey?m*10:m;if(w.key==="Tab")return;let $6=!1;switch(w.key){case"ArrowRight":case"ArrowUp":w.preventDefault(),a=Math.min(a+O6,$.max),$6=!0;break;case"ArrowLeft":case"ArrowDown":w.preventDefault(),a=Math.max(a-O6,$.min),$6=!0;break;case"Home":w.preventDefault(),a=$.min,$6=!0;break;case"End":w.preventDefault(),a=$.max,$6=!0;break;case"PageUp":w.preventDefault(),a=Math.min(a+m*10,$.max),$6=!0;break;case"PageDown":w.preventDefault(),a=Math.max(a-m*10,$.min),$6=!0;break;default:return}if(!$6)return;if($.activeBubble=l?W:Y,M($.activeBubble),l)$.secondValue=a;else{if(J.centered)$.previousValue=$.value;$.value=a}F(),k(M6.INPUT,w),k(M6.CHANGE,w)},Q6=(w,l=!1)=>{if($.component.disabled&&$.component.disabled.isDisabled())return;let m=l?z:G;if(H&&H!==m)O();H=m,m.classList.add(`${$.component.getClass("slider-handle")}--focused`),M(l?W:Y),$.activeBubble=l?W:Y,k(M6.FOCUS,w)},X6=(w,l=!1)=>{(l?z:G).classList.remove(`${$.component.getClass("slider-handle")}--focused`);let a=w.relatedTarget;if(!a||a!==(l?G:z))P(l?W:Y,200);k(M6.BLUR,w)};return{handleHandleMouseDown:y,handleTrackMouseDown:x,handleMouseMove:A,handleMouseUp:v,handleKeyDown:r,handleFocus:Q6,handleBlur:X6,setupEventListeners:()=>{if(!$.component||!G){console.warn("Cannot set up event listeners: missing component or handle");return}if(K.addEventListener("mousedown",x),K.addEventListener("touchstart",x,{passive:!1}),G.addEventListener("mousedown",(w)=>y(w,!1)),G.addEventListener("touchstart",(w)=>y(w,!1),{passive:!1}),G.addEventListener("keydown",(w)=>r(w,!1)),G.addEventListener("focus",(w)=>Q6(w,!1)),G.addEventListener("blur",(w)=>X6(w,!1)),J.range&&z)z.addEventListener("mousedown",(w)=>y(w,!0)),z.addEventListener("touchstart",(w)=>y(w,!0),{passive:!1}),z.addEventListener("keydown",(w)=>r(w,!0)),z.addEventListener("focus",(w)=>Q6(w,!0)),z.addEventListener("blur",(w)=>X6(w,!0))},cleanupEventListeners:()=>{if(!$.component)return;if(K)K.removeEventListener("mousedown",x),K.removeEventListener("touchstart",x);if(G)G.removeEventListener("mousedown",(w)=>y(w,!1)),G.removeEventListener("touchstart",(w)=>y(w,!1)),G.removeEventListener("keydown",(w)=>r(w,!1)),G.removeEventListener("focus",(w)=>Q6(w,!1)),G.removeEventListener("blur",(w)=>X6(w,!1));if(J.range&&z)z.removeEventListener("mousedown",(w)=>y(w,!0)),z.removeEventListener("touchstart",(w)=>y(w,!0)),z.removeEventListener("keydown",(w)=>r(w,!0)),z.removeEventListener("focus",(w)=>Q6(w,!0)),z.removeEventListener("blur",(w)=>X6(w,!0));document.removeEventListener("mousemove",A),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",v)},showActiveBubble:M,hideActiveBubble:P,hideAllBubbles:O,clearKeyboardFocus:R}};var D8=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize slider controller: missing element"),$;let Q={component:$,value:J.value!==void 0?J.value:0,secondValue:J.secondValue!==void 0?J.secondValue:null,min:J.min!==void 0?J.min:0,max:J.max!==void 0?J.max:100,step:J.step!==void 0?J.step:1,dragging:!1,pressed:!1,activeHandle:null,activeBubble:null,valueHideTimer:null},q={triggerEvent(H,V=null){let O={slider:Q.component,value:Q.value,secondValue:Q.secondValue,originalEvent:V,preventDefault:()=>{O.defaultPrevented=!0},defaultPrevented:!1};return Q.component.emit(H,O),O}},Z=()=>{if(!Q.component)return{};let H=Q.component.components||{},V=Q.component;return{container:V.container||H.container,handle:V.handle||H.handle,valueBubble:V.valueBubble||H.valueBubble,secondHandle:V.secondHandle||H.secondHandle,secondValueBubble:V.secondValueBubble||H.secondValueBubble,...H}},j=(H)=>{let V=Q.max-Q.min;return V===0?0:(H-Q.min)/V*100},K=()=>{let H=Z(),{handle:V,container:O}=H;if(!V||!O)return null;try{let M=V.getBoundingClientRect(),P=O.getBoundingClientRect(),R=M.width||q6.HANDLE_SIZE,y=P.width,x=q6.EDGE_PADDING/y*100,v=(Q.activeHandle?6:8)/y*100;return{handleSize:R,trackSize:y,edgeConstraint:x,paddingPercent:v}}catch(M){return console.warn("Error calculating track dimensions:",M),{handleSize:q6.HANDLE_SIZE,trackSize:200,edgeConstraint:3,paddingPercent:4}}},G=(H,V=200)=>{let O=q6.EDGE_PADDING/V*100,M=O,P=100-O,R=P-M;if(H<=0)return M;if(H>=100)return P;return M+H/100*R},Y=(H)=>{let V=Z(),{handle:O,container:M}=V;if(!O||!M)return Q.min;try{let P=M.getBoundingClientRect(),R=Q.max-Q.min,y=P.left+q6.EDGE_PADDING,x=P.right-q6.EDGE_PADDING,A=x-y,r=(Math.max(y,Math.min(x,H))-y)/A;return Q.min+r*R}catch(P){return console.warn("Error calculating value from position:",P),Q.min}},z=(H)=>{let V=Q.step;if(!V||V<=0)return H;let O=Math.round((H-Q.min)/V);return Q.min+O*V},W=(H,V,O)=>Math.min(Math.max(H,V),O),X=()=>{let H=Z(),{handle:V,container:O,valueBubble:M,secondHandle:P,secondValueBubble:R}=H;if(!V||!O)return;let y=K();if(!y)return;let{trackSize:x}=y,A=j(Q.value),v=G(A,x);if(V.style.left=`${v}%`,V.style.transform="translate(-50%, -50%)",M)M.style.left=`${v}%`,M.style.transform="translateX(-50%)";if(J.range&&P&&Q.secondValue!==null){let r=j(Q.secondValue),Q6=G(r,x);if(P.style.left=`${Q6}%`,P.style.transform="translate(-50%, -50%)",R)R.style.left=`${Q6}%`,R.style.transform="translateX(-50%)"}if(V)V.setAttribute("aria-valuenow",String(Q.value))},U=()=>{let H=Z(),{valueBubble:V,secondValueBubble:O}=H;if(!V)return;let M=J.valueFormatter||((P)=>P.toString());if(V.textContent=M(Q.value),J.range&&O&&Q.secondValue!==null)O.textContent=M(Q.secondValue)},_=(H,V)=>{if(!H||!J.showValue)return;let O=Q.component.getClass("slider-value");H.classList[V?"add":"remove"](`${O}--visible`)},N=()=>{},F=()=>{},k=()=>{try{if(X(),U(),$.drawCanvas)$.drawCanvas(Q)}catch(H){console.warn("Error rendering UI:",H)}},D=G4(J,Q,{getPercentage:j,getValueFromPosition:Y,roundToStep:z,clamp:W,showValueBubble:_,updateUi:k,render:k},q),B=()=>{try{let H=Z();if(!H.handle){console.warn("Cannot initialize slider controller: missing required handle component");return}$.element.setAttribute("aria-valuemin",String(Q.min)),$.element.setAttribute("aria-valuemax",String(Q.max)),$.element.setAttribute("aria-valuenow",String(Q.value));let{handle:V,secondHandle:O}=H;if(V){if(V.setAttribute("aria-valuemin",String(Q.min)),V.setAttribute("aria-valuemax",String(Q.max)),V.setAttribute("aria-valuenow",String(Q.value)),J.range&&O&&Q.secondValue!==null)O.setAttribute("aria-valuemin",String(Q.min)),O.setAttribute("aria-valuemax",String(Q.max)),O.setAttribute("aria-valuenow",String(Q.secondValue))}D.setupEventListeners(),k()}catch(H){console.error("Error initializing slider controller:",H)}};if($.lifecycle){let H=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{D.cleanupEventListeners(),H()}}return setTimeout(()=>{B()},0),{...$,slider:{setValue(H,V=!0){let O=W(H,Q.min,Q.max);if(Q.value=O,k(),V)q.triggerEvent(M6.CHANGE);return this},getValue(){return Q.value},setSecondValue(H,V=!0){if(!J.range)return this;let O=W(H,Q.min,Q.max);if(Q.secondValue=O,k(),V)q.triggerEvent(M6.CHANGE);return this},getSecondValue(){return J.range?Q.secondValue:null},setMin(H){Q.min=H,$.element.setAttribute("aria-valuemin",String(H));let V=Z();if(V.handle)V.handle.setAttribute("aria-valuemin",String(H));if(J.range&&V.secondHandle)V.secondHandle.setAttribute("aria-valuemin",String(H));if(Q.value<H)Q.value=H;if(J.range&&Q.secondValue!==null&&Q.secondValue<H)Q.secondValue=H;if(J.ticks||J.tickLabels)N();return k(),this},getMin(){return Q.min},setMax(H){Q.max=H,$.element.setAttribute("aria-valuemax",String(H));let V=Z();if(V.handle)V.handle.setAttribute("aria-valuemax",String(H));if(J.range&&V.secondHandle)V.secondHandle.setAttribute("aria-valuemax",String(H));if(Q.value>H)Q.value=H;if(J.range&&Q.secondValue!==null&&Q.secondValue>H)Q.secondValue=H;if(J.ticks||J.tickLabels)N();return k(),this},getMax(){return Q.max},setStep(H){if(Q.step=H,$.element.classList[H>0?"add":"remove"](`${$.getClass("slider")}--discrete`),J.ticks||J.tickLabels)N(),F();return this},getStep(){return Q.step},regenerateTicks(){return k(),this},updateUi(){return k(),this}}}};k9();w$();var D3=(J)=>J?.disabled?.isDisabled?.()||J?.element?.classList?.contains?.(`${J?.getClass?.("slider")}--disabled`)||!1,P8=(J,$,Q="track")=>{let q=D3($),Z=J.color||"primary";if(q){let K=F6("sys-color-on-surface",{fallback:"#000000"});return{primary:$7(K,0.38),secondary:$7(K,0.12)}}if(Q==="tick")return{primary:F6(`sys-color-on-${Z}`,{fallback:"#ffffff"}),secondary:F6(`sys-color-${Z}`,{fallback:"#1976d2"})};let j=F6(`sys-color-${Z}`,{fallback:"#1976d2"});return{primary:j,secondary:$7(j,0.24)}},n7=(J,$,Q)=>(J-$)/(Q-$)*100,R6=(J,$,Q,q,Z,j,K)=>{if(q>0)P1(J,$,Q,q,Z,j,j,K)},W7=(J)=>{if(typeof J==="number")return Math.max(J,V6.XS);if(typeof J==="string"&&J in V6)return V6[J];return V6.XS},R8=(J)=>{let $=W7(J);if($<=V6.S)return q6.SMALL_HANDLE_HEIGHT;return $+q6.HANDLE_HEIGHT_OFFSET},O3=(J)=>{let $=W7(J);if($<=V6.S)return q6.SMALL_TRACK_EXTERNAL_RADIUS;return $*q6.LARGE_TRACK_RADIUS_RATIO},Y4=(J,$,Q)=>{let q=W7(Q?.size),Z=R8(Q?.size),j=J.parentElement;if(!j)return;let K=Math.max(j.getBoundingClientRect().width||j.offsetWidth,200),G=Math.max(Z+20,q+32,q6.MIN_HEIGHT);j.style.height=`${G}px`,x1($,K,G)},z4=(J,$)=>{let Q=J.parentElement;if(!Q)throw new Error("Canvas must have a parent element");let q=W7($?.size),Z=R8($?.size),j=Math.max(Q.getBoundingClientRect().width||Q.offsetWidth,200),K=Math.max(Z+20,q+32,q6.MIN_HEIGHT);return Q.style.height=`${K}px`,w1(J,j,K)},e7=(J,$)=>{let Q=q6.EDGE_PADDING/$*100,q=Q,Z=100-Q,j=Z-q;if(J<=0)return q;if(J>=100)return Z;return q+J/100*j},P3=(J,$,Q,q,Z,j)=>{let K=Q/2,G=W7(q.size),Y=O3(q.size),z=q6.TRACK_RADIUS,W=O1(J,0,K-G/2,$,G,Y),{primary:X,secondary:U}=P8(q,j),_=n7(Z.value,Z.min,Z.max),N=e7(_,$),F=Z.pressed?q6.HANDLE_GAP_PRESSED_REDUCTION:0,k=q6.HANDLE_GAP-F,D=q6.CENTER_GAP/2/$*100,B=k/$*100;if(q.centered){let H=n7(0,Z.min,Z.max),V=e7(H,$),O=Math.abs(N-V)<B,M=Z.value>=0;if(O){let P=(N-B)/100*$;if(P>0)R6(J,0,K-G/2,P,G,z,U);let R=(N+B)/100*$,y=$-R;if(y>0)R6(J,R,K-G/2,y,G,z,U)}else if(M){let P=(V-D)/100*$;if(P>0)R6(J,0,K-G/2,P,G,z,U);let R=(V+D)/100*$,y=(N-B)/100*$-R;if(y>0)R6(J,R,K-G/2,y,G,z,X);let x=(N+B)/100*$,A=$-x;if(A>0)R6(J,x,K-G/2,A,G,z,U)}else{let P=(N-B)/100*$;if(P>0)R6(J,0,K-G/2,P,G,z,U);let R=(N+B)/100*$,y=(V-D)/100*$-R;if(y>0)R6(J,R,K-G/2,y,G,z,X);let x=(V+D)/100*$,A=$-x;if(A>0)R6(J,x,K-G/2,A,G,z,U)}}else if(q.range&&Z.secondValue!==null){let H=n7(Z.secondValue,Z.min,Z.max),V=e7(H,$),O=Math.min(N,V),M=Math.max(N,V),P=N<=V,R=Z.pressed&&Z.activeHandle==="first"?q6.HANDLE_GAP_PRESSED_REDUCTION:0,y=Z.pressed&&Z.activeHandle==="second"?q6.HANDLE_GAP_PRESSED_REDUCTION:0,x=q6.HANDLE_GAP-R,A=q6.HANDLE_GAP-y,v=P?x/$*100:A/$*100,r=P?A/$*100:x/$*100,Q6=(O-v)/100*$;if(Q6>0)R6(J,0,K-G/2,Q6,G,z,U);let X6=(O+v)/100*$,e=(M-r)/100*$-X6;if(e>G)R6(J,X6,K-G/2,e,G,z,X);let B6=(M+r)/100*$,w=$-B6;if(w>0)R6(J,B6,K-G/2,w,G,z,U)}else{let H=(N-B)/100*$;if(H>0)R6(J,0,K-G/2,H,G,z,X);let V=(N+B)/100*$,O=$-V;if(O>0)R6(J,V,K-G/2,O,G,z,U)}W()},R3=(J,$,Q,q,Z,j)=>{if(!q.ticks)return;let K=q6.TICK_SIZE,G=Q/2,{primary:Y,secondary:z}=P8(q,j,"tick"),W=Math.floor((Z.max-Z.min)/Z.step);for(let X=0;X<=W;X++){let U=Z.min+X*Z.step;if(U>Z.max)continue;let _=n7(U,Z.min,Z.max),F=e7(_,$)/100*$,k=Math.abs(U-Z.value)<Z.step*0.1,L=q.range&&Z.secondValue!==null&&Math.abs(U-Z.secondValue)<Z.step*0.1;if(k||L)continue;let D=!1;if(q.centered)D=Z.value>=0?U>=0&&U<=Z.value:U>=Z.value&&U<=0;else if(q.range&&Z.secondValue!==null){let B=Math.min(Z.value,Z.secondValue),H=Math.max(Z.value,Z.secondValue);D=U>=B&&U<=H}else D=U<=Z.value;J.fillStyle=D?Y:z,J.globalAlpha=D?1:0.5,J.beginPath(),J.arc(F,G,K/2,0,Math.PI*2),J.fill()}J.globalAlpha=1},y3=(J,$,Q,q,Z)=>{if(q.ticks)return;let j=q6.DOT_SIZE,K=Q/2,G=q6.EDGE_PADDING,{primary:Y}=P8(q,Z,"dot");J.fillStyle=Y,J.beginPath(),J.arc($-G,K,j/2,0,Math.PI*2),J.fill()},O8=(J,$,Q,q)=>{let{ctx:Z,width:j,height:K}=J;if(j===0||K===0)return;R1(Z,j,K),y3(Z,j,K,$,q),P3(Z,j,K,$,Q,q),R3(Z,j,K,$,Q,q)},W4=(J,$)=>{let Q=R8($),q=J.handle||J.components?.handle,Z=J.secondHandle||J.components?.secondHandle;if(q)q.style.height=`${Q}px`,q.style.transform="translate(-50%, -50%)";if(Z)Z.style.height=`${Q}px`,Z.style.transform="translate(-50%, -50%)"},A3=(J,$,Q)=>{if(J)return{value:J.value,secondValue:J.secondValue,min:J.min,max:J.max,step:J.step,pressed:J.pressed||!1,activeHandle:J.activeHandle||null};if($?.slider)return{value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep(),pressed:!1,activeHandle:null};return Q||{value:0,secondValue:null,min:0,max:100,step:1,pressed:!1,activeHandle:null}},y8=(J)=>($)=>{let Q=I1(`${$.getClass("slider-canvas")}`,{zIndex:"1"}),q=$.container||$.components?.container;if(q)q.insertBefore(Q,q.firstChild);else $.element.appendChild(Q);let Z=null,j=null,K=null,G=J.size||"XS",Y=A3(null,$,{value:J.value||0,secondValue:J.secondValue||null,min:J.min||0,max:J.max||100,step:J.step||1,pressed:!1,activeHandle:null}),z={animatedValue:Y.value,animatedSecondValue:Y.secondValue,targetValue:Y.value,targetSecondValue:Y.secondValue,startValue:Y.value,startSecondValue:Y.secondValue,startTime:0,duration:y1.MEDIUM,animationFrame:null};if($.animationState=z,T1(()=>{try{return Z=z4(Q,{...J,size:G}),$.ctx=Z.ctx,!0}catch(k){return console.warn("Slider canvas initialization failed:",k),!1}},()=>{W4($,G)}),J.color&&J.color!=="primary")$.element.classList.add(`${$.getClass("slider")}--${J.color}`);$.canvas=Q;let W=()=>{if(!Z)return;O8(Z,{...J,size:G},{...Y,value:z.animatedValue,secondValue:z.animatedSecondValue},$)},X=(k)=>{if(!Z)return;let D=(k||performance.now())-z.startTime,B=Math.min(D/z.duration,1),H=y$(B),V=z.startValue,O=z.targetValue;if(z.animatedValue=V+(O-V)*H,z.targetSecondValue!==null&&z.animatedSecondValue!==null){let{startSecondValue:M,targetSecondValue:P}=z;z.animatedSecondValue=M+(P-M)*H}if(W(),B<1)z.animationFrame=requestAnimationFrame((M)=>X(M));else z.animationFrame=null},U=(k)=>{if(!Z){console.warn("Canvas context not ready");return}Y4(Q,Z,{...J,size:G});let L,D=!1;if(k)L={value:k.value,secondValue:k.secondValue,min:k.min,max:k.max,step:k.step,pressed:k.pressed||!1,activeHandle:k.activeHandle||null},D=k.dragging||!1,Y={...L};else if($.slider)L={value:$.slider.getValue(),secondValue:$.slider.getSecondValue(),min:$.slider.getMin(),max:$.slider.getMax(),step:$.slider.getStep()},Y={...L};else L={...Y};let B=L.value!==z.targetValue,H=L.secondValue!==z.targetSecondValue;if((B||H)&&!D){if(z.startValue=z.animatedValue,z.startSecondValue=z.animatedSecondValue,z.targetValue=L.value,z.targetSecondValue=L.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame);z.startTime=performance.now(),X()}else if(D){if(z.animatedValue=L.value,z.animatedSecondValue=L.secondValue,z.targetValue=L.value,z.targetSecondValue=L.secondValue,z.startValue=L.value,z.startSecondValue=L.secondValue,z.animationFrame)cancelAnimationFrame(z.animationFrame),z.animationFrame=null;O8(Z,{...J,size:G},k||L,$)}else O8(Z,{...J,size:G},k||L,$)},_=()=>{if(!Z)return;try{let k=z4(Q,{...J,size:G});$.ctx=k.ctx,Object.assign(Z,k),W()}catch(k){console.warn("Slider canvas resize failed:",k)}};j=I7($.element,Q,_);let N=()=>W();K=A$(J.color||"primary",N),requestAnimationFrame(()=>{U()}),$.drawCanvas=U,$.resize=_,$.setSize=(k)=>{if(G=k,Z)Y4(Q,Z,{...J,size:G}),W();W4($,G)},$.getSize=()=>G;let F=$.appearance?.setColor;if(F)$.appearance.setColor=(k)=>{if(F(k),J.color&&J.color!=="primary")$.element.classList.remove(`${$.getClass("slider")}--${J.color}`);if(k&&k!=="primary")$.element.classList.add(`${$.getClass("slider")}--${k}`);if(J.color=k,K)K(),K=null;K=A$(k,N),U()};if($.lifecycle){let k=$.lifecycle.destroy||(()=>{});$.lifecycle.destroy=()=>{if(j)j();if(K)K();if(z.animationFrame)cancelAnimationFrame(z.animationFrame);k()}}return $};S6();A9();var d9=(J,$)=>{return Object.assign(J.style,$),J};var A8=(J)=>($)=>{let Q=(N)=>$.getClass(N),q=J.min||0,Z=J.max||100,j=J.value!==void 0?J.value:q,K=J.disabled===!0,G=J.valueFormatter||((N)=>N.toString()),Y=(j-q)/(Z-q)*100,z=E({tag:"div",className:Q("slider-container"),container:$.element});d9(z,{position:"relative"});let W=E({tag:"div",className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(q),"aria-valuemax":String(Z),"aria-valuenow":String(j),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(j),"data-handle-index":"0"},container:z});d9(W,{left:`${Y}%`});let X=E({tag:"div",className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"0"},text:G(j),container:z});d9(X,{left:`${Y}%`});let U,_;if(J.range){let N=J.secondValue!==void 0?J.secondValue:Z,F=(N-q)/(Z-q)*100;U=E({tag:"div",className:Q("slider-handle"),attributes:{role:"slider","aria-valuemin":String(q),"aria-valuemax":String(Z),"aria-valuenow":String(N),"aria-orientation":"horizontal",tabindex:K?"-1":"0","aria-disabled":K?"true":"false","data-value":String(N),"data-handle-index":"1"},container:z}),d9(U,{left:`${F}%`}),_=E({tag:"div",className:Q("slider-value"),attributes:{"aria-hidden":"true","data-handle-index":"1"},text:G(N),container:z}),d9(_,{left:`${F}%`})}return{...$,container:z,handle:W,valueBubble:X,secondHandle:U,secondValueBubble:_,getContainer:()=>z,getHandle:()=>W,getValueBubble:()=>X,getSecondHandle:()=>U||null,getSecondValueBubble:()=>_||null}};var U4=(J)=>($)=>{return{...$,element:$.element,setValue(Q,q=!0){return J.slider.setValue(Q,q),this},getValue(){return J.slider.getValue()},setSecondValue(Q,q=!0){return J.slider.setSecondValue(Q,q),this},getSecondValue(){return J.slider.getSecondValue()},setMin(Q){return J.slider.setMin(Q),this},getMin(){return J.slider.getMin()},setMax(Q){return J.slider.setMax(Q),this},getMax(){return J.slider.getMax()},setStep(Q){return J.slider.setStep(Q),this},getStep(){return J.slider.getStep()},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},isDisabled(){return J.disabled.isDisabled()},setColor(Q){return J.appearance.setColor(Q),this},getColor(){return J.appearance.getColor()},setSize(Q){return J.appearance.setSize(Q),this},getSize(){return J.appearance.getSize()},showTicks(Q){return J.appearance.showTicks(Q),this},showCurrentValue(Q){return J.appearance.showCurrentValue(Q),this},setLabel(Q){if(J.text?.setText)J.text.setText(Q);return this},getLabel(){return J.text?.getText?J.text.getText():""},setIcon(Q){if(J.icon?.setIcon)J.icon.setIcon(Q);return this},getIcon(){return J.icon?.getIcon?J.icon.getIcon():""},on(Q,q){if(J.events?.on)J.events.on(Q,q);return this},off(Q,q){if(J.events?.off)J.events.off(Q,q);return this},destroy(){if(J.lifecycle?.destroy)J.lifecycle.destroy()}}};c();var w3={min:k6.MIN,max:k6.MAX,value:k6.VALUE,step:k6.STEP,disabled:k6.DISABLED,color:k6.COLOR,size:k6.SIZE,ticks:k6.TICKS,showValue:k6.SHOW_VALUE,snapToSteps:k6.SNAP_TO_STEPS,range:k6.RANGE,centered:k6.CENTERED,iconPosition:k6.ICON_POSITION,labelPosition:k6.LABEL_POSITION,valueFormatter:(J)=>J.toString()},X4=(J={})=>{return C(w3,J,"slider")},B4=(J)=>{let $=["slider",J.class,J.disabled?"slider--disabled":"",J.size&&J.size!=="XS"?`slider--${typeof J.size==="string"?J.size.toLowerCase():J.size}`:"",J.color&&J.color!=="primary"?`slider--${J.color}`:"",J.range?"slider--range":"",J.centered?"slider--centered":"",J.icon?"slider--icon":""].filter(Boolean).join(" "),Q={tabindex:"-1",role:"none","aria-disabled":J.disabled?"true":"false","aria-valuemin":String(J.min||0),"aria-valuemax":String(J.max||100),"aria-valuenow":String(J.value||J.min||0)};return f(J,{tag:"div",attributes:Q,className:$,forwardEvents:{click:!0,keydown:!0,touchstart:!0,touchmove:!0,touchend:!0,mousedown:!0,mousemove:!0,mouseup:!0},interactive:!0})},F4=(J)=>({slider:{setValue:($,Q)=>J.slider?.setValue($,Q),getValue:()=>J.slider?.getValue()??0,setSecondValue:($,Q)=>J.slider?.setSecondValue($,Q),getSecondValue:()=>J.slider?.getSecondValue()??null,setMin:($)=>J.slider?.setMin($),getMin:()=>J.slider?.getMin()??0,setMax:($)=>J.slider?.setMax($),getMax:()=>J.slider?.getMax()??100,setStep:($)=>J.slider?.setStep($),getStep:()=>J.slider?.getStep()??1,regenerateTicks:()=>J.slider?.regenerateTicks?.()},disabled:{enable:()=>J.disabled?.enable?.(),disable:()=>J.disabled?.disable?.(),isDisabled:()=>J.disabled?.isDisabled?.()??!1},appearance:{setColor:($)=>J.appearance?.setColor?.($),getColor:()=>J.appearance?.getColor?.()??"primary",setSize:($)=>J.setSize?.($),getSize:()=>J.getSize?.()??"XS",showTicks:($)=>J.appearance?.showTicks?.($),showCurrentValue:($)=>J.appearance?.showCurrentValue?.($)},text:{setText:($)=>J.label?.setText?.($),getText:()=>J.label?.getText?.()??""},icon:{setIcon:($)=>J.icon?.setIcon?.($),getIcon:()=>J.icon?.getIcon?.()??""},events:{on:($,Q)=>J.on?.($,Q),off:($,Q)=>J.off?.($,Q)},lifecycle:{destroy:()=>J.lifecycle?.destroy?.()}});var x3=(J={})=>{let $=X4(J);try{let Q=I(T,h(),S(B4($)),V8($),A8($),d6($),g6($),y8($),_8($),D8($),b())($),q=F4(Q),Z=U4(q)(Q);if($.on&&typeof Z.on==="function")Object.entries($.on).forEach(([j,K])=>{if(typeof K==="function")Z.on(j,K)});return Z}catch(Q){throw console.error("Slider creation error:",Q),new Error(`Failed to create slider: ${Q.message}`)}},H4=x3;n();s();var M4=(J)=>($)=>{if(!J.action)return $;let Q=document.createElement("button");return Q.className=`${J.prefix}-snackbar-action`,Q.textContent=J.action,$.element.appendChild(Q),{...$,actionButton:Q}},k4=(J)=>($)=>{let Q=null,q=()=>{if(Q)clearTimeout(Q),Q=null;if(typeof J.duration==="number"&&J.duration>0)Q=window.setTimeout(()=>{if($.element&&$.emit)$.emit("dismiss")},J.duration)},Z=()=>{if(Q)clearTimeout(Q),Q=null},j=$.lifecycle?.destroy;if($.lifecycle)$.lifecycle.destroy=()=>{if(Z(),j)j.call($.lifecycle)};return{...$,timer:{start:q,stop:Z}}};var w8={BASIC:"basic",ACTION:"action"},n6={CENTER:"center",START:"start",END:"end"},N4={VISIBLE:"visible",HIDDEN:"hidden"},L4={OPEN:"open",CLOSE:"close",ACTION:"action",DISMISS:"dismiss"},r9={VARIANT:w8.BASIC,POSITION:n6.CENTER,DURATION:4000,Z_INDEX:1000,ANIMATION_DURATION:300},V4={ROOT:"snackbar",BASIC:"snackbar--basic",ACTION:"snackbar--action",CENTER:"snackbar--center",START:"snackbar--start",END:"snackbar--end",VISIBLE:"snackbar--visible",HIDDEN:"snackbar--hidden",MESSAGE:"snackbar__message",ACTION_BUTTON:"snackbar__action"};var _4=(J)=>($)=>{let Q=J.position||n6.CENTER,q=J.prefix||"mtrl",Z=`${q}-snackbar--${Q}`;$.element.classList.add(Z);let j=(K)=>{$.element.classList.remove(Z);let G=`${q}-snackbar--${K}`;if($.element.classList.add(G),$.element.classList.contains(`${q}-snackbar--visible`))if(K===n6.CENTER)$.element.style.transform="translateX(-50%) scale(1)";else $.element.style.transform="scale(1)"};return{...$,position:{getPosition:()=>Q,setPosition:(K)=>{if(Object.values(n6).includes(K))return j(K),$;else return console.warn(`Invalid position: ${K}. Using default: ${n6.CENTER}`),j(n6.CENTER),$}}}};i();var D4=({lifecycle:J,queue:$})=>(Q)=>{if(!$)throw new Error("Snackbar queue is required");let q=!1,Z={element:Q.element,actionButton:Q.actionButton,timer:Q.timer,position:Q.position,state:q?"visible":"hidden",show(){if(q)return this;return q=!0,this.state="visible",$.add({...this,_show:()=>{document.body.appendChild(Q.element);let j=Q.element.offsetHeight;if(Q.element.classList.add(`${Q.getClass?.("snackbar")}--visible`),Q.timer)Q.timer.start();return this}}),this},hide(){if(!q)return this;if(q=!1,this.state="hidden",Q.timer)Q.timer.stop();let j=(K)=>{if(K.propertyName!=="opacity")return;if(Q.element.removeEventListener("transitionend",j),Q.element.parentNode)Q.element.remove()};return Q.element.addEventListener("transitionend",j),Q.element.classList.remove(`${Q.getClass?.("snackbar")}--visible`),this},setMessage(j){return Q.text?.setText(j),this},getMessage(){return Q.text?.getText()||""},setAction(j){if(Q.actionButton)Q.actionButton.textContent=j;return this},getAction(){return Q.actionButton?Q.actionButton.textContent||"":""},setDuration(){return this},getDuration(){return 0},setPosition(j){if(Q.position?.setPosition)Q.position.setPosition(j);return this},getPosition(){return Q.position?.getPosition?.()||"center"},on(j,K){return Q.on?.(j,K),this},off(j,K){return Q.off?.(j,K),this},destroy(){if(q&&Q.element.parentNode)Q.element.remove();if(Q.timer)Q.timer.stop();J.destroy()}};if(Q.actionButton)Q.actionButton.addEventListener("click",()=>{Q.emit?.("action"),Q.emit?.("dismiss")});if(Q.on){let j=()=>{if(q)Z.hide()};Q.on("dismiss",j);let K=J.destroy;J.destroy=()=>{Q.off?.("dismiss",j),K?.call(J)}}return Z};var O4=()=>{let J=[],$=!1,Q=()=>{if(J.length===0){$=!1;return}$=!0;let q=J[0],Z=()=>{if(J.shift(),q.off?.("dismiss",Z),J.length===0)$=!1;else setTimeout(Q,200)};q.on?.("dismiss",Z),q._show()};return{add(q){if(!q._show)throw new Error("Snackbar must implement _show method");if(J.push(q),!$)Q()},clear(){J.length=0,$=!1},getLength(){return J.length}}};c();var T3={variant:r9.VARIANT,position:r9.POSITION,duration:r9.DURATION},P4=(J)=>C(T3,J,"snackbar"),R4=(J)=>f(J,{tag:"div",className:J.class}),y4=(J)=>({...J,text:J.message}),A4=(J,$)=>({lifecycle:{destroy:J.lifecycle?.destroy||(()=>{})},queue:$});var I3=O4(),S3=(J)=>{if(!J.message)throw new Error("Snackbar message is required");let $=P4(J);try{return I(T,h(),S(R4($)),G6($),_4($),J9(y4($)),M4($),b(),k4($),(q)=>D4(A4(q,I3))(q))($)}catch(Q){throw console.error("Snackbar creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create snackbar: ${Q instanceof Error?Q.message:String(Q)}`)}},w4=S3;n();s();i();var x4=({disabled:J,lifecycle:$,checkable:Q})=>(q)=>({...q,element:q.element,input:q.input,getValue:q.getValue||(()=>""),setValue(Z){return q.setValue?.(Z),this},check(){return Q.check(),this},uncheck(){return Q.uncheck(),this},toggle(){return Q.toggle(),this},isChecked(){return Q.isChecked()},setLabel(Z){return q.text?.setText(Z),this},getLabel(){return q.text?.getText()||""},supportingTextElement:q.supportingTextElement||null,setSupportingText(Z,j){if(q.setSupportingText)q.setSupportingText(Z,j);return this},removeSupportingText(){if(q.removeSupportingText)q.removeSupportingText();return this},on(Z,j){return q.on?.(Z,j),this},off(Z,j){return q.off?.(Z,j),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});i();var T4=(J,$,Q)=>{let q=$||"mtrl",Z=Q||"switch",j=J.element.querySelector(`.${q}-${Z}-container`);if(!j){j=document.createElement("div"),j.className=`${q}-${Z}-container`;let G=J.element.querySelector(`.${q}-${Z}-input`),Y=J.element.querySelector(`.${q}-${Z}-track`),z=[];if(G)z.push(G);if(Y)z.push(Y);let W=document.createElement("div");W.className=`${q}-${Z}-content`;let X=J.element.querySelector(`.${q}-${Z}-label`);if(X)W.appendChild(X);return j.appendChild(W),z.forEach((U)=>j.appendChild(U)),J.element.appendChild(j),{container:j,contentWrapper:W}}let K=J.element.querySelector(`.${q}-${Z}-content`);if(!K){K=document.createElement("div"),K.className=`${q}-${Z}-content`;let G=J.element.querySelector(`.${q}-${Z}-label`);if(G)K.appendChild(G);j.insertBefore(K,j.firstChild)}return{container:j,contentWrapper:K}},x8=(J)=>($)=>{let Q=J.prefix||"mtrl",q=J.componentName||"switch",{contentWrapper:Z}=T4($,Q,q),j=null;if(J.supportingText){if(j=document.createElement("div"),j.className=`${Q}-${q}-helper`,j.textContent=J.supportingText,J.error)j.classList.add(`${Q}-${q}-helper--error`),$.element.classList.add(`${Q}-${q}--error`);Z.appendChild(j)}if("lifecycle"in $&&$.lifecycle&&typeof $.lifecycle==="object"&&"destroy"in $.lifecycle&&j){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(j)j.remove();K.call($.lifecycle)}}return{...$,supportingTextElement:j,setSupportingText(K,G=!1){let{contentWrapper:Y}=T4($,Q,q),z=this.supportingTextElement;if(!z)z=document.createElement("div"),z.className=`${Q}-${q}-helper`,Y.appendChild(z),this.supportingTextElement=z;return z.textContent=K,z.classList.toggle(`${Q}-${q}-helper--error`,G),$.element.classList.toggle(`${Q}-${q}--error`,G),this},removeSupportingText(){if(this.supportingTextElement&&this.supportingTextElement.parentNode)this.supportingTextElement.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${q}--error`);return this}}},I4=(J)=>($)=>{let Q={...J,prefix:J.prefix||"mtrl",componentName:J.componentName||"switch"};return P7(Q)($)};c();var b3={prefix:"mtrl",componentName:"switch"},S4=(J={})=>C(b3,J,"switch"),b4=(J)=>f(J,{tag:"div",className:J.class,interactive:!0}),v4=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy},checkable:{check:J.checkable?.check,uncheck:J.checkable?.uncheck,toggle:J.checkable?.toggle,isChecked:J.checkable?.isChecked}});var v3=(J={})=>{let $=S4(J);try{return I(T,h(),S(b4($)),d6($),x9($),I4($),x8($),T9($),Y6($),b(),(q)=>x4(v4(q))(q))($)}catch(Q){throw console.error("Switch creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create switch: ${Q instanceof Error?Q.message:String(Q)}`)}},C4=v3;var T8={START:"start",END:"end"},E4={CHECKED:"checked",UNCHECKED:"unchecked",DISABLED:"disabled",ENABLED:"enabled"},h4={CHANGE:"change",FOCUS:"focus",BLUR:"blur"},u4={CHECKED:!1,DISABLED:!1,REQUIRED:!1,LABEL_POSITION:T8.END,VALUE:"on"},f4={ROOT:"switch",CONTAINER:"switch-container",CONTENT:"switch-content",LABEL:"switch-label",INPUT:"switch-input",TRACK:"switch-track",THUMB:"switch-thumb",LABEL_START:"switch--label-start",LABEL_END:"switch--label-end",CHECKED:"switch--checked",DISABLED:"switch--disabled",ERROR:"switch--error",HELPER:"switch-helper",HELPER_ERROR:"switch-helper--error",FOCUSED:"switch--focused"};n();s();i();n();s();i();var $$={PRIMARY:"primary",SECONDARY:"secondary"},U7={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},I8={FIXED:"fixed",DYNAMIC:"dynamic",CONTENT:"content",AUTO:"auto"},g4={CLICK:"click",FOCUS:"focus",BLUR:"blur"},S8={CHANGE:"change"},O9={VARIANT:$$.PRIMARY,SCROLLABLE:!0,SHOW_DIVIDER:!0,INDICATOR_HEIGHT:3,INDICATOR_WIDTH_STRATEGY:I8.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},l9={ICON_ONLY:"icon-only",TEXT_ONLY:"text-only",ICON_AND_TEXT:"icon-and-text"},d4={ROOT:"tabs",PRIMARY:"tabs--primary",SECONDARY:"tabs--secondary",SCROLLABLE:"tabs--scrollable",SCROLL:"tabs-scroll",DIVIDER:"tabs-divider",INDICATOR:"tabs-indicator"},r4={ROOT:"tab",ACTIVE:"tab--active",INACTIVE:"tab--inactive",DISABLED:"tab--disabled",TEXT:"tab-text",ICON:"tab-icon",RIPPLE:"tab-ripple",PRIMARY:"tab--primary",SECONDARY:"tab--secondary",CONTAINER:"tab-container",BADGE:"tab-badge"};c();s();var C3={state:U7.INACTIVE,componentName:"tab",ripple:O9.RIPPLE},E3={variant:O9.VARIANT,scrollable:O9.SCROLLABLE,showDivider:O9.SHOW_DIVIDER,componentName:"tabs"},l4=(J={})=>C(E3,J,"tabs"),p4=(J={})=>C(C3,J,"tab"),s4=(J)=>{let $={tag:"div",attributes:{role:"tablist","aria-orientation":"horizontal"},className:[`${J.prefix}-tabs`,`${J.prefix}-tabs--${J.variant||"primary"}`,J.class]};return(Q)=>S($)(Q)};L9();c9();var X7=(J={})=>{let $=p4(J);try{let Q=I(T,h(),b())($),q=o6({text:$.text,icon:$.icon,iconSize:$.iconSize,disabled:$.disabled,ripple:$.ripple!==!1,rippleConfig:{duration:400,timing:"cubic-bezier(0.4, 0, 0.2, 1)",opacity:["0.2","0"],...$.rippleConfig||{}},value:$.value,prefix:$.prefix,variant:"text",class:`${$.prefix}-tab`});if(Q.element=q.element,Q.element.setAttribute("role","tab"),Q.element.setAttribute("aria-selected",$.state==="active"?"true":"false"),$.value)Q.element.setAttribute("id",`tab-${$.value}`),Q.element.setAttribute("aria-controls",`tabpanel-${$.value}`);if($.state==="active")Q.element.classList.add(`${Q.getClass("tab")}--active`);q.on("click",(j)=>{if(Q.emit)Q.emit("click",j)});let Z={...Q,button:q,element:q.element,badge:null,getValue(){return q.getValue()},setValue(j){let K=j||"";return q.setValue(K),this.element.setAttribute("id",`tab-${K}`),this.element.setAttribute("aria-controls",`tabpanel-${K}`),this},activate(){this.element.classList.add(`${this.getClass("tab")}--active`),this.element.setAttribute("aria-selected","true");let j=new CustomEvent("tab:activated",{bubbles:!0,detail:{value:this.getValue()}});return this.element.dispatchEvent(j),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 q.enable(),this.element.removeAttribute("aria-disabled"),this},disable(){return q.disable(),this.element.setAttribute("aria-disabled","true"),this},setText(j){return q.setText(j),this.updateLayoutStyle(),this},getText(){return q.getText()},setIcon(j){return q.setIcon(j),this.updateLayoutStyle(),this},getIcon(){return q.getIcon()},setBadge(j){if(!this.badge){let K={content:j,standalone:!1,target:this.element,prefix:$.prefix,...$.badgeConfig||{}};this.badge=i9(K)}else this.badge.setContent(j),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(q.destroy)q.destroy();Q.lifecycle.destroy()},updateLayoutStyle(){let j=!!this.getText(),K=!!this.getIcon(),G="";if(j&&K)G=l9.ICON_AND_TEXT;else if(K)G=l9.ICON_ONLY;else G=l9.TEXT_ONLY;if(Object.values(l9).forEach((Y)=>{this.element.classList.remove(`${this.getClass("tab")}--${Y}`)}),this.element.classList.add(`${this.getClass("tab")}--${G}`),G===l9.ICON_ONLY&&j)this.element.setAttribute("aria-label",this.getText());else this.element.removeAttribute("aria-label")}};if($.badge!==void 0)Z.setBadge($.badge);return Z.updateLayoutStyle(),Z}catch(Q){throw console.error("Tab creation error:",Q),new Error(`Failed to create tab: ${Q.message}`)}};var m4=({lifecycle:J})=>($)=>({...$,element:$.element,addTab(Q){let q={...Q,prefix:$.config.prefix,variant:Q.variant||$.config.variant};if(q.value===void 0)q.value="";let Z=X7(q);if($.tabs.push(Z),$.tabsContainer.appendChild(Z.element),Z.on&&typeof Z.on==="function")Z.on("click",(K)=>$.handleTabClick(K,Z));return Z.element.addEventListener("click",(K)=>{$.handleTabClick(K,Z)}),Z},add(Q){if($.tabs.push(Q),$.tabsContainer.appendChild(Q.element),Q.on&&typeof Q.on==="function")Q.on("click",(Z)=>$.handleTabClick(Z,Q));return Q.element.addEventListener("click",(Z)=>{$.handleTabClick(Z,Q)}),this},getTabs(){return[...$.tabs]},getActiveTab(){return $.tabs.find((Q)=>Q.isActive())||null},setActiveTab(Q){let q=typeof Q==="string"?$.tabs.find((Z)=>Z.getValue()===Q):Q;if(!q)return this;if($.tabs.forEach((Z)=>Z.deactivate()),q.activate(),$.emit)$.emit("change",{tab:q,value:q.getValue()});return this},removeTab(Q){let q=typeof Q==="string"?$.tabs.find((j)=>j.getValue()===Q):Q;if(!q)return this;let Z=$.tabs.indexOf(q);if(Z!==-1)$.tabs.splice(Z,1);if(q.element.parentNode)q.element.parentNode.removeChild(q.element);return q.destroy(),this},on(Q,q){if($.on)$.on(Q,q);return this},off(Q,q){if($.off)$.off(Q,q);return this},destroy(){$.tabs.forEach((Q)=>Q.destroy()),$.tabs.length=0,J.destroy()}}),a4=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});function i4(J){if(typeof J.getActiveTab==="function")return J.getActiveTab();if(Array.isArray(J.tabs))return J.tabs.find(($)=>$.isActive&&$.isActive());return null}function b8(J){let $=i4(J);if(!$)return;if(typeof $.getValue!=="function")return;let Q=$.getValue();document.querySelectorAll('[role="tabpanel"]').forEach((Z)=>{if(Z.getAttribute("aria-labelledby")?.replace("tab-","")===Q)Z.removeAttribute("hidden"),Z.setAttribute("tabindex","0");else Z.setAttribute("hidden","true"),Z.setAttribute("tabindex","-1")})}function v8(J){if(!J.element)return;J.element.addEventListener("keydown",($)=>{if($.target!==$.currentTarget)return;if(typeof J.getTabs!=="function"||typeof J.setActiveTab!=="function")return;let Q=J.getTabs(),q=i4(J),Z=q?Q.indexOf(q):-1,j=Z;switch($.key){case"ArrowRight":case"ArrowDown":j=Z<Q.length-1?Z+1:0;break;case"ArrowLeft":case"ArrowUp":j=Z>0?Z-1:Q.length-1;break;case"Home":j=0;break;case"End":j=Q.length-1;break;default:return}if(j!==Z&&Q[j])$.preventDefault(),Q[j].element.focus(),J.setActiveTab(Q[j])})}var h3={widthStrategy:"auto",fixedWidth:40,animationDuration:250,animationTiming:"cubic-bezier(0.4, 0, 0.2, 1)",visible:!0,prefix:"mtrl",variant:"primary"},C8=(J={})=>{let $={...h3,...J},Q=$.prefix||"mtrl",q=document.createElement("div");if(q.className=`${Q}-tabs-indicator`,q.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
31
+ width ${$.animationDuration}ms ${$.animationTiming}`,q.style.width=`${$.fixedWidth}px`,!$.visible)q.style.opacity="0";let Z=null,j=(N)=>{if($.widthStrategy==="auto"){if($.variant==="secondary")return N.element.offsetWidth;let F=N.element.querySelector(`.${Q}-tab-text`)||N.element.querySelector(`.${Q}-button-text`);if(F)return F.clientWidth;return Math.max(N.element.offsetWidth/2,30)}switch($.widthStrategy){case"dynamic":return Math.max(N.element.offsetWidth/2,30);case"content":let F=N.element.querySelector(`.${Q}-button-text`)||N.element.querySelector(`.${Q}-tab-text`);if(F)return Math.max(F.clientWidth,30);return $.fixedWidth||40;case"fixed":default:return $.fixedWidth||40}},K=(N)=>{let F=N.parentElement;if(!F)return console.error("Tab has no parent element, cannot position indicator"),{left:0,width:N.offsetWidth};let k=N.getBoundingClientRect(),L=F.getBoundingClientRect();return{left:k.left-L.left,width:k.width}},G=(N,F)=>{let{left:k,width:L}=K(N.element);if($.variant!=="secondary"&&($.widthStrategy==="auto"||$.widthStrategy==="content")){let D=N.element.querySelector(`.${Q}-tab-text`)||N.element.querySelector(`.${Q}-button-text`);if(D){let B=D.getBoundingClientRect(),H=N.element.getBoundingClientRect(),V=B.left-H.left;return{left:k+V}}}if(F<L)return{left:k+(L-F)/2};return{left:k}},Y=(N,F=!1)=>{if(!N||!N.element){console.error("Invalid tab or tab has no element");return}Z=N;let k=j(N),{left:L}=G(N,k);if(F)q.style.transition="none",q.offsetHeight;if(q.style.width=`${k}px`,q.style.transform=`translateX(${L}px)`,F)setTimeout(()=>{q.style.transition=`transform ${$.animationDuration}ms ${$.animationTiming},
32
+ width ${$.animationDuration}ms ${$.animationTiming}`},10)};return{element:q,moveToTab:Y,show:()=>{q.style.opacity="1"},hide:()=>{q.style.opacity="0"},setColor:(N)=>{q.style.backgroundColor=N},update:()=>{if(Z)Y(Z,!0)},destroy:()=>{if(q.parentNode)q.parentNode.removeChild(q);Z=null}}};var E8=(J)=>($)=>{let Q=[],q=$.scrollContainer||$.element;if(Array.isArray(J.tabs))J.tabs.forEach((G)=>{let Y={...G,prefix:J.prefix,variant:G.variant||J.variant},z=X7(Y);Q.push(z),q.appendChild(z.element)});let Z=()=>{return[...Q]},j=()=>{return Q.find((G)=>G.isActive())||null},K=(G,Y)=>{if(G&&typeof G.preventDefault==="function")G.preventDefault();if(Y.disabled&&Y.disabled.isDisabled&&Y.disabled.isDisabled())return;Q.forEach((W)=>W.deactivate()),Y.activate();let z=Y.getValue();if(b8({tabs:Q,getActiveTab:()=>Q.find((W)=>W.isActive())||null}),typeof $.emit==="function")$.emit("change",{tab:Y,value:z})};return Q.forEach((G)=>{if(G.on&&typeof G.on==="function")G.on("click",(Y)=>K(Y,G));G.element.addEventListener("click",(Y)=>K(Y,G))}),{...$,tabs:Q,tabsContainer:q,handleTabClick:K,getTabs:Z,getActiveTab:j}},h8=(J)=>($)=>{if(J.scrollable===!1)return $;$.element.classList.add(`${$.getClass("tabs")}--scrollable`);let Q=document.createElement("div");Q.className=`${$.getClass("tabs")}-scroll`;while($.element.firstChild)Q.appendChild($.element.firstChild);return $.element.appendChild(Q),{...$,scrollContainer:Q}},u8=(J)=>($)=>{if(J.showDivider===!1)return $;let Q=document.createElement("div");return Q.className=`${$.getClass("tabs")}-divider`,$.element.appendChild(Q),$},f8=(J)=>($)=>{let Q=J.indicator||{},q=C8({prefix:J.prefix,widthStrategy:Q.widthStrategy||J.indicatorWidthStrategy||"auto",height:Q.height||J.indicatorHeight||3,fixedWidth:Q.fixedWidth||40,animationDuration:Q.animationDuration||250,animationTiming:Q.animationTiming||"cubic-bezier(0.4, 0, 0.2, 1)",color:Q.color,variant:J.variant??"primary"}),Z=$.scrollContainer||$.element;if(!Z)throw console.error("No scroll container found - cannot add indicator"),new Error("Failed to create tabs: No scroll container found");Z.appendChild(q.element);let j=$.handleTabClick;$.handleTabClick=function(W,X){if(X.disabled&&X.disabled.isDisabled&&X.disabled.isDisabled())return;j.call(this,W,X),setTimeout(()=>{q.moveToTab(X)},10)},setTimeout(()=>{let W=$.tabs.find((X)=>X.isActive());if(W)q.moveToTab(W,!0)},50);let K=()=>{let W=$.tabs.find((X)=>X.isActive());if(W)q.moveToTab(W,!0)};if(Z)Z.addEventListener("scroll",K);let G=new ResizeObserver(()=>{let W=$.tabs.find((X)=>X.isActive());if(W)q.moveToTab(W,!0)});G.observe(Z);let Y=new MutationObserver((W)=>{for(let X of W)if(X.type==="attributes"&&X.attributeName==="class"&&X.target.classList.contains(`${J.prefix}-tab--active`)){let U=X.target,_=$.tabs.find((N)=>N.element===U);if(_)q.moveToTab(_)}});if(Array.isArray($.tabs))$.tabs.forEach((W)=>{if(W.element)Y.observe(W.element,{attributes:!0})});let z=$.destroy||(()=>{});return $.destroy=function(){if(q.destroy(),G.disconnect(),Y.disconnect(),Z)Z.removeEventListener("scroll",K);if(typeof z==="function")z.call(this)},{...$,indicator:q,getIndicator:()=>q}};var u3=(J)=>{let{tabs:$=[],onChange:Q,indicator:q}=J,Z=null,j=$.find((W)=>W.isActive());if(j){if(Z=j,q)setTimeout(()=>{q.moveToTab(j,!0)},50)}let K=(W)=>{if(!W.element)return;let X=W.element.querySelector(`.${W.getClass("tab")}-ripple`);if(!X)return;let U=document.createElement("span");U.className="ripple",U.style.width="100%",U.style.height="100%",U.style.left="0",U.style.top="0",U.style.animation="ripple-effect 0.4s cubic-bezier(0.4, 0, 0.2, 1)",X.appendChild(U),setTimeout(()=>{U.remove()},400)};return{activateTab:(W,X=!1)=>{if(!W||Z===W)return;if(Z)Z.deactivate();if(W.activate(),Z=W,q)setTimeout(()=>{q.moveToTab(W,X)},10);if(!X)K(W);if(Q)Q({tab:W,value:W.getValue()})},getActiveTab:()=>{return Z},destroy:()=>{Z=null}}},c4=()=>{if(document.getElementById("tab-state-styles"))return;let J=document.createElement("style");J.id="tab-state-styles",J.textContent=`
33
33
  @keyframes ripple-effect {
34
34
  0% {
35
35
  transform: scale(0);
@@ -40,7 +40,7 @@ var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enum
40
40
  opacity: 0;
41
41
  }
42
42
  }
43
- `,document.head.appendChild(J)};var lj=(J={})=>{let $=SZ(J);uZ();try{let Q=b(S,d(),vZ($),h1($),E1($),u1($),f1($),C(),(Z)=>CZ(EZ(Z))(Z))($);return v1(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},fZ=lj;var rj=(J,$={})=>{let{enabled:Q=!0,showButtons:Z=!1,appearance:q="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let G=document.createElement("div");G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`);let K=document.createElement("div");if(K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${q}`),J.element.appendChild(G),J.element.appendChild(K),Z){let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,U.setAttribute("aria-label","Scroll tabs left"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,X.setAttribute("aria-label","Scroll tabs right"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(U),J.element.appendChild(X),U.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),X.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let z=()=>{let{scrollLeft:U,scrollWidth:X,clientWidth:_}=j;if(G.classList.toggle("visible",U>0),K.classList.toggle("visible",U+_<X-1),Z){let H=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),B=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(H)H.disabled=U<=0;if(B)B.disabled=U+_>=X-1}};z(),j.addEventListener("scroll",z);let W=new ResizeObserver(z);W.observe(j);let Y=J.destroy;J.destroy=function(){if(W)W.disconnect();if(j.removeEventListener("scroll",z),G.parentNode)G.parentNode.removeChild(G);if(K.parentNode)K.parentNode.removeChild(K);if(Z){let U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(U&&U.parentNode)U.parentNode.removeChild(U);if(X&&X.parentNode)X.parentNode.removeChild(X)}Y.call(this)}};var g1={SMALL:600,MEDIUM:904,LARGE:1240},pj=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||g1.SMALL,medium:$.breakpoints?.medium||g1.MEDIUM,large:$.breakpoints?.large||g1.LARGE},Z={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},q=new Map,j=J.getTabs();j.forEach((W)=>{let Y="text-only";if(W.getIcon()&&W.getText())Y="icon-and-text";else if(W.getIcon())Y="icon-only";q.set(W,Y)});let G=()=>{if(window.innerWidth<Q.small)j.forEach((Y)=>{if(Z.layout==="icon-only"&&!Y.getIcon())return;if(Z.layout==="icon-only"&&Y.getIcon())Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.add(`${Y.getClass("tab")}--icon-only`);else if(Z.layout==="text-only")Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.add(`${Y.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((Y)=>{let U=q.get(Y)||"text-only";Y.element.classList.remove(`${Y.getClass("tab")}--icon-only`),Y.element.classList.remove(`${Y.getClass("tab")}--text-only`),Y.element.classList.remove(`${Y.getClass("tab")}--icon-and-text`),Y.element.classList.add(`${Y.getClass("tab")}--${U}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};G();let K=new ResizeObserver(G);K.observe(document.body),J._resizeObserver=K;let z=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();z.call(this)}};var sj=fZ;J6();c();o();var gZ=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(Z){return Q.setValue?.(Z),this},setAttribute(Z,q){return Q.setAttribute?.(Z,q),this},getAttribute(Z){return Q.getAttribute?.(Z)||null},removeAttribute(Z){return Q.removeAttribute?.(Z),this},setVariant(Z){let q=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${q}-${j}--filled`,`${q}-${j}--outlined`),Q.element.classList.add(`${q}-${j}--${Z}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let Z=Q.config?.prefix||"mtrl",q=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${Z}-${q}--outlined`))return"outlined";return"filled"},setLabel(Z){if(Q.label?.setText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(Z){if(Q.setLeadingIcon){if(Q.setLeadingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(Z){if(Q.setTrailingIcon){if(Q.setTrailingIcon(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(Z,q){if(Q.setSupportingText)Q.setSupportingText(Z,q);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(Z){if(Q.setPrefixText){if(Q.setPrefixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(Z){if(Q.setSuffixText){if(Q.setSuffixText(Z),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.updateElementPositions)Q.updateElementPositions();return this},setDensity(Z){if(Q.density?.set)Q.density.set(Z);return this},getDensity(){return Q.density?.current||"default"},on(Z,q){return Q.on?.(Z,q),this},off(Z,q){return Q.off?.(Z,q),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var d1=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,Z.innerHTML=J.leadingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return setTimeout(()=>{let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))q.style.left="44px"}},10),{...$,leadingIcon:Z,setLeadingIcon(q){return Z.innerHTML=q,this},removeLeadingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left=""}this.leadingIcon=null}return this}}};var l1=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,Z.innerHTML=J.trailingIcon,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,trailingIcon:Z,setTrailingIcon(q){return Z.innerHTML=q,this},removeTrailingIcon(){if(Z.parentNode){if(Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var r1=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-prefix`,Z.textContent=J.prefixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,prefixTextElement:Z,setPrefixText(q){return Z.textContent=q,this},removePrefixText(){if(Z.parentNode){Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let q=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(q)q.style.left="";this.prefixTextElement=null}return this}}};var p1=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("span");if(Z.className=`${Q}-${J.componentName||"textfield"}-suffix`,Z.textContent=J.suffixText,$.element.appendChild(Z),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,suffixTextElement:Z,setSuffixText(q){return Z.textContent=q,this},removeSuffixText(){if(Z.parentNode)Z.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var s1=(J)=>($)=>{if(!J.supportingText)return $;let Q=J.prefix||"mtrl",Z=document.createElement("div");if(Z.className=`${Q}-${J.componentName||"textfield"}-helper`,Z.textContent=J.supportingText,J.error)Z.classList.add(`${Q}-${J.componentName||"textfield"}-helper--error`),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--error`);if($.element.appendChild(Z),"lifecycle"in $&&$.lifecycle?.destroy){let q=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.remove(),q.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(q,j=!1){return Z.textContent=q,Z.classList.toggle(`${Q}-${J.componentName||"textfield"}-helper--error`,j),$.element.classList.toggle(`${Q}-${J.componentName||"textfield"}--error`,j),this},removeSupportingText(){if(Z.parentNode)Z.remove(),this.supportingTextElement=null,$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--error`);return this}}};j8();var m1=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",Z=new WeakMap,q=new WeakMap,j=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),W=J.element.querySelector(`.${$}-${Q}-prefix`),Y=J.element.querySelector(`.${$}-${Q}-suffix`),U=J.element.classList.contains(`${$}-${Q}--outlined`),X=J.element.classList.contains(`${$}-${Q}--focused`),_=J.element.classList.contains(`${$}-${Q}--empty`),H=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(U&&z){let{color:B,element:M}=w9(J.element);if(X||!_){if(z.style.backgroundColor=B,z.style.paddingLeft="4px",z.style.paddingRight="4px",M&&!Z.has(J.element)){let k=new MutationObserver(()=>{let{color:V}=w9(J.element);z.style.backgroundColor=V});k.observe(M,{attributes:!0,attributeFilter:["style","class"]}),Z.set(J.element,k);let N=M.parentElement,F=[];while(N&&N!==document.documentElement){let V=new MutationObserver(()=>{let{color:O}=w9(J.element);z.style.backgroundColor=O});V.observe(N,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),F.push(V),N=N.parentElement}if(F.length)q.set(J.element,F)}if(!j.has(J.element)){let k=()=>{let{color:N}=w9(J.element);if(X||!_)z.style.backgroundColor=N};document.addEventListener("themechange",k),j.set(J.element,k)}}else z.style.backgroundColor="",z.style.padding=""}if(W&&J.input){let M=W.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${M}px`,z){let k=M;if(H)k=Math.max(k,44);if(!X&&_)z.style.left=`${k}px`;else z.style.left="12px"}}else if(H&&z){if(U)if(!X&&_)z.style.left="44px";else z.style.left="12px"}if(Y&&J.input){let M=Y.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${M}px`}return J},K=()=>{if(J.input){if(J.input.addEventListener("focus",()=>{J.element.classList.add(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("blur",()=>{J.element.classList.remove(`${$}-${Q}--focused`),setTimeout(G,10)}),J.input.addEventListener("input",()=>{let W=!J.input.value;J.element.classList.toggle(`${$}-${Q}--empty`,W),setTimeout(G,10)}),!J.input.value)J.element.classList.add(`${$}-${Q}--empty`)}window.addEventListener("resize",G),new MutationObserver(()=>{if(J.element.isConnected)G()}).observe(document.body,{childList:!0,subtree:!0})};if(setTimeout(()=>{K(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let W=Z.get(J.element);if(W)W.disconnect(),Z.delete(J.element);let Y=q.get(J.element);if(Y)Y.forEach((X)=>X.disconnect()),q.delete(J.element);let U=j.get(J.element);if(U)document.removeEventListener("themechange",U),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var a1=(J)=>($)=>{let Q=J.prefix||"mtrl",Z=J.componentName||"textfield",q=J.density||"default";if(q!=="default")$.element.classList.add(`${Q}-${Z}--density-${q}`);if($.element.setAttribute("data-density",q),$.input)j($.input,q);function j(K,z){K.setAttribute("data-density",z)}let G=(K)=>{if(["default","compact"].forEach((z)=>{$.element.classList.remove(`${Q}-${Z}--density-${z}`)}),K!=="default")$.element.classList.add(`${Q}-${Z}--density-${K}`);if($.element.setAttribute("data-density",K),$.input)$.input.setAttribute("data-density",K);if($.density)$.density.current=K;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:q,set:G},$};t();var R$={FILLED:"filled",OUTLINED:"outlined"},dZ={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},c1={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},lZ={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},rZ={DEFAULT:"default",COMPACT:"compact"},b7={TYPE:c1.TEXT,VARIANT:R$.FILLED,DENSITY:rZ.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},pZ={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var mj={type:b7.TYPE,variant:b7.VARIANT},sZ=(J={})=>u(mj,J,"textfield"),mZ=(J)=>p(J,{tag:"div",className:J.class}),aZ=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var aj=(J={})=>{let $=sZ(J);try{return b(S,d(),h(mZ($)),K6($),a1($),d7($),X9($),d1($),l1($),r1($),p1($),s1($),G6($),C(),m1(),(Z)=>gZ(aZ(Z))(Z))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},A$=aj;w6();J6();c();o();var v7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(v7||={});var w$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(w$||={});var J7;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(J7||={});var Q7;((Q)=>{Q.AM="AM";Q.PM="PM"})(Q7||={});t();var i1={DIAL:"dial",INPUT:"input"},o1={VERTICAL:"vertical",HORIZONTAL:"horizontal"},t1={AMPM:"12h",MILITARY:"24h"},cZ={AM:"AM",PM:"PM"},L6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},j9={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},iZ={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},C7={MODAL:1050,DIALOG:1051},Q6={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"},l6={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">
43
+ `,document.head.appendChild(J)};var f3=(J={})=>{let $=l4(J);c4();try{let Q=I(T,h(),s4($),h8($),E8($),u8($),f8($),b(),(q)=>m4(a4(q))(q))($);return v8(Q),Q}catch(Q){throw console.error("Tabs creation error:",Q),new Error(`Failed to create tabs: ${Q.message}`)}},o4=f3;var g3=(J,$={})=>{let{enabled:Q=!0,showButtons:q=!1,appearance:Z="fade"}=$;if(!Q)return;let j=J.element.querySelector(`.${J.getClass("tabs")}-scroll`);if(!j)return;let K=document.createElement("div");K.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--left`,K.classList.add(`${J.getClass("tabs")}-scroll-indicator--${Z}`);let G=document.createElement("div");if(G.className=`${J.getClass("tabs")}-scroll-indicator ${J.getClass("tabs")}-scroll-indicator--right`,G.classList.add(`${J.getClass("tabs")}-scroll-indicator--${Z}`),J.element.appendChild(K),J.element.appendChild(G),q){let X=document.createElement("button");X.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--left`,X.setAttribute("aria-label","Scroll tabs left"),X.innerHTML='<svg viewBox="0 0 24 24"><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>';let U=document.createElement("button");U.className=`${J.getClass("tabs")}-scroll-button ${J.getClass("tabs")}-scroll-button--right`,U.setAttribute("aria-label","Scroll tabs right"),U.innerHTML='<svg viewBox="0 0 24 24"><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',J.element.appendChild(X),J.element.appendChild(U),X.addEventListener("click",()=>{j.scrollBy({left:-100,behavior:"smooth"})}),U.addEventListener("click",()=>{j.scrollBy({left:100,behavior:"smooth"})})}let Y=()=>{let{scrollLeft:X,scrollWidth:U,clientWidth:_}=j;if(K.classList.toggle("visible",X>0),G.classList.toggle("visible",X+_<U-1),q){let N=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),F=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(N)N.disabled=X<=0;if(F)F.disabled=X+_>=U-1}};Y(),j.addEventListener("scroll",Y);let z=new ResizeObserver(Y);z.observe(j);let W=J.destroy;J.destroy=function(){if(z)z.disconnect();if(j.removeEventListener("scroll",Y),K.parentNode)K.parentNode.removeChild(K);if(G.parentNode)G.parentNode.removeChild(G);if(q){let X=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--left`),U=J.element.querySelector(`.${J.getClass("tabs")}-scroll-button--right`);if(X&&X.parentNode)X.parentNode.removeChild(X);if(U&&U.parentNode)U.parentNode.removeChild(U)}W.call(this)}};var g8={SMALL:600,MEDIUM:904,LARGE:1240},d3=(J,$={})=>{if($.responsive===!1)return;let Q={small:$.breakpoints?.small||g8.SMALL,medium:$.breakpoints?.medium||g8.MEDIUM,large:$.breakpoints?.large||g8.LARGE},q={layout:$.smallScreen?.layout||"icon-only",maxVisibleTabs:$.smallScreen?.maxVisibleTabs||4},Z=new Map,j=J.getTabs();j.forEach((z)=>{let W="text-only";if(z.getIcon()&&z.getText())W="icon-and-text";else if(z.getIcon())W="icon-only";Z.set(z,W)});let K=()=>{if(window.innerWidth<Q.small)j.forEach((W)=>{if(q.layout==="icon-only"&&!W.getIcon())return;if(q.layout==="icon-only"&&W.getIcon())W.element.classList.remove(`${W.getClass("tab")}--icon-and-text`),W.element.classList.remove(`${W.getClass("tab")}--text-only`),W.element.classList.add(`${W.getClass("tab")}--icon-only`);else if(q.layout==="text-only")W.element.classList.remove(`${W.getClass("tab")}--icon-and-text`),W.element.classList.remove(`${W.getClass("tab")}--icon-only`),W.element.classList.add(`${W.getClass("tab")}--text-only`)}),J.element.classList.add(`${J.getClass("tabs")}--responsive-small`);else j.forEach((W)=>{let X=Z.get(W)||"text-only";W.element.classList.remove(`${W.getClass("tab")}--icon-only`),W.element.classList.remove(`${W.getClass("tab")}--text-only`),W.element.classList.remove(`${W.getClass("tab")}--icon-and-text`),W.element.classList.add(`${W.getClass("tab")}--${X}`)}),J.element.classList.remove(`${J.getClass("tabs")}--responsive-small`)};K();let G=new ResizeObserver(K);G.observe(document.body),J._resizeObserver=G;let Y=J.destroy;J.destroy=function(){if(this._resizeObserver)this._resizeObserver.disconnect();Y.call(this)}};var r3=o4;n();s();i();var t4=({disabled:J,lifecycle:$})=>(Q)=>({element:Q.element,input:Q.input,getValue:Q.getValue||(()=>""),setValue(q){return Q.setValue?.(q),this},setAttribute(q,Z){return Q.setAttribute?.(q,Z),this},getAttribute(q){return Q.getAttribute?.(q)||null},removeAttribute(q){return Q.removeAttribute?.(q),this},setVariant(q){let Z=Q.config?.prefix||"mtrl",j=Q.config?.componentName||"textfield";if(Q.element.classList.remove(`${Z}-${j}--filled`,`${Z}-${j}--outlined`),Q.element.classList.add(`${Z}-${j}--${q}`),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getVariant(){let q=Q.config?.prefix||"mtrl",Z=Q.config?.componentName||"textfield";if(Q.element.classList.contains(`${q}-${Z}--outlined`))return"outlined";return"filled"},setLabel(q){if(Q.label?.setText(q),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10);return this},getLabel(){return Q.label?.getText()||""},leadingIcon:Q.leadingIcon||null,setLeadingIcon(q){if(Q.setLeadingIcon){if(Q.setLeadingIcon(q),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeLeadingIcon(){if(Q.removeLeadingIcon){if(Q.removeLeadingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},trailingIcon:Q.trailingIcon||null,setTrailingIcon(q){if(Q.setTrailingIcon){if(Q.setTrailingIcon(q),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeTrailingIcon(){if(Q.removeTrailingIcon){if(Q.removeTrailingIcon(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},supportingTextElement:Q.supportingTextElement||null,setSupportingText(q,Z){if(Q.setSupportingText)Q.setSupportingText(q,Z);return this},removeSupportingText(){if(Q.removeSupportingText)Q.removeSupportingText();return this},prefixTextElement:Q.prefixTextElement||null,setPrefixText(q){if(Q.setPrefixText){if(Q.setPrefixText(q),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removePrefixText(){if(Q.removePrefixText){if(Q.removePrefixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},suffixTextElement:Q.suffixTextElement||null,setSuffixText(q){if(Q.setSuffixText){if(Q.setSuffixText(q),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},removeSuffixText(){if(Q.removeSuffixText){if(Q.removeSuffixText(),Q.updateElementPositions)setTimeout(()=>Q.updateElementPositions(),10)}return this},updatePositions(){if(Q.input&&Q.element){let q=Q.input.value&&Q.input.value.length>0,Z=Q.input.matches?.(":-webkit-autofill")||!1;if(q||Z)Q.element.classList.remove(`${Q.config?.prefix||"mtrl"}-textfield--empty`);else Q.element.classList.add(`${Q.config?.prefix||"mtrl"}-textfield--empty`)}if(Q.updateElementPositions)Q.updateElementPositions();return this},setError(q,Z){if(Q.setError)Q.setError(q,Z);return this},isError(){return Q.isError?.()||!1},setDensity(q){if(Q.density?.set)Q.density.set(q);return this},getDensity(){return Q.density?.current||"default"},on(q,Z){return Q.on?.(q,Z),this},off(q,Z){return Q.off?.(q,Z),this},enable(){return J.enable(),this},disable(){return J.disable(),this},destroy(){$.destroy()}});var d8=(J)=>($)=>{if(!J.leadingIcon)return $;let Q=J.prefix||"mtrl",q=document.createElement("span");if(q.className=`${Q}-${J.componentName||"textfield"}-leading-icon`,q.innerHTML=J.leadingIcon,$.element.appendChild(q),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let Z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{q.remove(),Z.call($.lifecycle)}}return setTimeout(()=>{let Z=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(Z){if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`))Z.style.left="44px"}},10),{...$,leadingIcon:q,setLeadingIcon(Z){return q.innerHTML=Z,this},removeLeadingIcon(){if(q.parentNode){if(q.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-leading-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-leading-icon`);if(!$.element.classList.contains(`${Q}-${J.componentName||"textfield"}--with-prefix`)){let Z=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(Z)Z.style.left=""}this.leadingIcon=null}return this}}};var r8=(J)=>($)=>{if(!J.trailingIcon)return $;let Q=J.prefix||"mtrl",q=document.createElement("span");if(q.className=`${Q}-${J.componentName||"textfield"}-trailing-icon`,q.innerHTML=J.trailingIcon,$.element.appendChild(q),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.add(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);if("lifecycle"in $&&$.lifecycle?.destroy){let Z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{q.remove(),Z.call($.lifecycle)}}return{...$,trailingIcon:q,setTrailingIcon(Z){return q.innerHTML=Z,this},removeTrailingIcon(){if(q.parentNode){if(q.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-trailing-icon`),$.input)$.input.classList.remove(`${Q}-${J.componentName||"textfield"}-input--with-trailing-icon`);this.trailingIcon=null}return this}}};var l8=(J)=>($)=>{if(!J.prefixText)return $;let Q=J.prefix||"mtrl",q=document.createElement("span");if(q.className=`${Q}-${J.componentName||"textfield"}-prefix`,q.textContent=J.prefixText,$.element.appendChild(q),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-prefix`),"lifecycle"in $&&$.lifecycle?.destroy){let Z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{q.remove(),Z.call($.lifecycle)}}return{...$,prefixTextElement:q,setPrefixText(Z){return q.textContent=Z,this},removePrefixText(){if(q.parentNode){q.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-prefix`);let Z=$.element.querySelector(`.${Q}-${J.componentName||"textfield"}-label`);if(Z)Z.style.left="";this.prefixTextElement=null}return this}}};var p8=(J)=>($)=>{if(!J.suffixText)return $;let Q=J.prefix||"mtrl",q=document.createElement("span");if(q.className=`${Q}-${J.componentName||"textfield"}-suffix`,q.textContent=J.suffixText,$.element.appendChild(q),$.element.classList.add(`${Q}-${J.componentName||"textfield"}--with-suffix`),"lifecycle"in $&&$.lifecycle?.destroy){let Z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{q.remove(),Z.call($.lifecycle)}}return{...$,suffixTextElement:q,setSuffixText(Z){return q.textContent=Z,this},removeSuffixText(){if(q.parentNode)q.remove(),$.element.classList.remove(`${Q}-${J.componentName||"textfield"}--with-suffix`),this.suffixTextElement=null;return this}}};var s8=(J)=>($)=>{let Q=J.prefix||"mtrl",q=J.componentName||"textfield",Z=null,j=(K,G=!1)=>{let Y=document.createElement("div");if(Y.className=`${Q}-${q}-helper`,Y.textContent=K,G)Y.classList.add(`${Q}-${q}-helper--error`),$.element.classList.add(`${Q}-${q}--error`);return Y};if(J.supportingText)Z=j(J.supportingText,J.error),$.element.appendChild(Z);if("lifecycle"in $&&$.lifecycle?.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{if(Z)Z.remove();K.call($.lifecycle)}}return{...$,supportingTextElement:Z,setSupportingText(K,G=!1){if(Z)Z.remove(),$.element.classList.remove(`${Q}-${q}--error`);if(K)Z=j(K,G),$.element.appendChild(Z),this.supportingTextElement=Z;else Z=null,this.supportingTextElement=null,$.element.classList.remove(`${Q}-${q}--error`);return this},removeSupportingText(){if(Z)Z.remove(),Z=null,this.supportingTextElement=null,$.element.classList.remove(`${Q}-${q}--error`);return this}}};D$();var m8=()=>(J)=>{let $=J.config.prefix||"mtrl",Q=J.config.componentName||"textfield",q=new WeakMap,Z=new WeakMap,j=new WeakMap,K=new WeakMap,G=()=>{if(!J.element||!J.element.isConnected)return J;let z=J.element.querySelector(`.${$}-${Q}-label`),W=J.element.querySelector(`.${$}-${Q}-prefix`),X=J.element.querySelector(`.${$}-${Q}-suffix`),U=J.element.classList.contains(`${$}-${Q}--outlined`),_=J.element.classList.contains(`${$}-${Q}--focused`),N=J.element.classList.contains(`${$}-${Q}--empty`),F=J.element.classList.contains(`${$}-${Q}--with-leading-icon`);if(U&&z){let{color:k,element:L}=H9(J.element);if(_||!N){if(z.style.backgroundColor=k,z.style.paddingLeft="4px",z.style.paddingRight="4px",L&&!q.has(J.element)){let D=new MutationObserver(()=>{let{color:V}=H9(J.element);z.style.backgroundColor=V});D.observe(L,{attributes:!0,attributeFilter:["style","class"]}),q.set(J.element,D);let B=L.parentElement,H=[];while(B&&B!==document.documentElement){let V=new MutationObserver(()=>{let{color:O}=H9(J.element);z.style.backgroundColor=O});V.observe(B,{attributes:!0,attributeFilter:["style","class","data-theme","data-theme-mode"]}),H.push(V),B=B.parentElement}if(H.length)Z.set(J.element,H)}if(!j.has(J.element)){let D=()=>{let{color:B}=H9(J.element);if(_||!N)z.style.backgroundColor=B};document.addEventListener("themechange",D),j.set(J.element,D)}}else z.style.backgroundColor="",z.style.padding=""}if(W&&J.input){let L=W.getBoundingClientRect().width+4+12;if(J.input.style.paddingLeft=`${L}px`,z){let D=L;if(F)D=Math.max(D,44);if(!_&&N)z.style.left=`${D}px`;else z.style.left="12px"}}else if(F&&z){if(U)if(!_&&N)z.style.left="44px";else z.style.left="12px"}if(X&&J.input){let L=X.getBoundingClientRect().width+4+12;J.input.style.paddingRight=`${L}px`}return J},Y=()=>{let z=new MutationObserver((W)=>{W.forEach((X)=>{if(X.type==="attributes"&&X.attributeName==="class")setTimeout(G,10)})});z.observe(J.element,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",G),K.set(J.element,z)};if(setTimeout(()=>{Y(),G()},0),"lifecycle"in J&&J.lifecycle?.destroy){let z=J.lifecycle.destroy;J.lifecycle.destroy=()=>{window.removeEventListener("resize",G);let W=K.get(J.element);if(W)W.disconnect(),K.delete(J.element);let X=q.get(J.element);if(X)X.disconnect(),q.delete(J.element);let U=Z.get(J.element);if(U)U.forEach((N)=>N.disconnect()),Z.delete(J.element);let _=j.get(J.element);if(_)document.removeEventListener("themechange",_),j.delete(J.element);z.call(J.lifecycle)}}return{...J,updateElementPositions:()=>{return G(),J}}};var a8=(J)=>($)=>{let Q=J.prefix||"mtrl",q=J.componentName||"textfield",Z=J.density||"default";if(Z!=="default")$.element.classList.add(`${Q}-${q}--density-${Z}`);if($.element.setAttribute("data-density",Z),$.input)j($.input,Z);function j(G,Y){G.setAttribute("data-density",Y)}let K=(G)=>{if(["default","compact"].forEach((Y)=>{$.element.classList.remove(`${Q}-${q}--density-${Y}`)}),G!=="default")$.element.classList.add(`${Q}-${q}--density-${G}`);if($.element.setAttribute("data-density",G),$.input)$.input.setAttribute("data-density",G);if($.density)$.density.current=G;if($.updateElementPositions)setTimeout(()=>$.updateElementPositions(),10)};return $.density={current:Z,set:K},$};var i8=(J)=>($)=>{let Q=J.prefix||"mtrl",q=J.componentName||"textfield",Z=J.error||!1;if(Z)$.element.classList.add(`${Q}-${q}--error`);return{...$,errorState:Z,setError(j,K){if(Z=j,$.element.classList.toggle(`${Q}-${q}--error`,j),K!==void 0&&$.setSupportingText){if(K)$.setSupportingText(K,j);else if(!j)$.setSupportingText("",!1)}else if($.supportingTextElement&&$.setSupportingText){let G=$.supportingTextElement.textContent||"";if(G)$.setSupportingText(G,j)}return this},isError(){return Z}}};c();var J$={FILLED:"filled",OUTLINED:"outlined"},n4={ACTIVE:"active",INACTIVE:"inactive",DISABLED:"disabled"},c8={TEXT:"text",PASSWORD:"password",EMAIL:"email",NUMBER:"number",TEL:"tel",URL:"url",SEARCH:"search",MULTILINE:"multiline"},e4={CHANGE:"change",INPUT:"input",FOCUS:"focus",BLUR:"blur",ENTER:"enter",KEYDOWN:"keydown",KEYUP:"keyup"},$5={DEFAULT:"default",COMPACT:"compact"},B7={TYPE:c8.TEXT,VARIANT:J$.FILLED,DENSITY:$5.DEFAULT,DISABLED:!1,REQUIRED:!1,ERROR:!1,FLOAT_LABEL:!0,ANIMATION_DURATION:150},J5={ROOT:"textfield",INPUT:"textfield-input",LABEL:"textfield-label",CONTAINER:"textfield-container",FILLED:"textfield--filled",OUTLINED:"textfield--outlined",FOCUSED:"textfield--focused",DISABLED:"textfield--disabled",ERROR:"textfield--error",REQUIRED:"textfield--required",LABEL_FLOATING:"textfield-label--floating",SUPPORTING_TEXT:"textfield-supporting-text",SUPPORTING_TEXT_ERROR:"textfield-supporting-text--error",LEADING_ICON:"textfield-leading-icon",TRAILING_ICON:"textfield-trailing-icon",PREFIX_TEXT:"textfield-prefix-text",SUFFIX_TEXT:"textfield-suffix-text",OUTLINE:"textfield-outline",MULTILINE:"textfield--multiline"};var l3={type:B7.TYPE,variant:B7.VARIANT},Q5=(J={})=>C(l3,J,"textfield"),q5=(J)=>f(J,{tag:"div",className:J.class}),Z5=(J)=>({disabled:{enable:J.disabled?.enable,disable:J.disabled?.disable},lifecycle:{destroy:J.lifecycle?.destroy}});var p3=(J={})=>{let $=Q5(J);try{return I(T,h(),S(q5($)),G6($),a8($),O7($),d6($),d8($),r8($),l8($),p8($),s8($),i8($),Y6($),b(),m8(),(q)=>t4(Z5(q))(q))($)}catch(Q){throw console.error("Textfield creation error:",Q instanceof Error?Q.message:String(Q)),new Error(`Failed to create textfield: ${Q instanceof Error?Q.message:String(Q)}`)}},Q$=p3;y6();n();s();i();var F7;((Q)=>{Q.DIAL="dial";Q.INPUT="input"})(F7||={});var q$;((Q)=>{Q.VERTICAL="vertical";Q.HORIZONTAL="horizontal"})(q$||={});var p9;((Q)=>{Q.AMPM="12h";Q.MILITARY="24h"})(p9||={});var s9;((Q)=>{Q.AM="AM";Q.PM="PM"})(s9||={});c();var o8={DIAL:"dial",INPUT:"input"},t8={VERTICAL:"vertical",HORIZONTAL:"horizontal"},n8={AMPM:"12h",MILITARY:"24h"},j5={AM:"AM",PM:"PM"},L6={CHANGE:"change",OPEN:"open",CLOSE:"close",CONFIRM:"confirm",CANCEL:"cancel"},e6={DIAMETER:256,INNER_RADIUS:65,OUTER_RADIUS:110,NUMBER_SIZE:40,CENTER_SIZE:8,HAND_SIZE:36,TRACK_WIDTH:2},K5={HOURS_12:Array.from({length:12},(J,$)=>$===0?12:$),HOURS_24:Array.from({length:24},(J,$)=>$),MINUTES:Array.from({length:60},(J,$)=>$),SECONDS:Array.from({length:60},(J,$)=>$)},H7={MODAL:1050,DIALOG:1051},J6={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"},h6={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">
44
44
  <circle cx="12" cy="12" r="10"></circle>
45
45
  <polyline points="12 6 12 12 16 14"></polyline>
46
46
  </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">
@@ -54,11 +54,11 @@ var G3=Object.defineProperty;var KJ=(J,$)=>{for(var Q in $)G3(J,Q,{get:$[Q],enum
54
54
  <line x1="14" y1="12" x2="14" y2="12"></line>
55
55
  <line x1="18" y1="12" x2="18" y2="12"></line>
56
56
  <line x1="6" y1="16" x2="18" y2="16"></line>
57
- </svg>`},t6={TYPE:i1.DIAL,FORMAT:t1.AMPM,ORIENTATION:o1.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:l6.CLOCK,KEYBOARD_ICON:l6.KEYBOARD},oZ={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var cj={type:"dial",format:"12h",orientation:"vertical",showSeconds:t6.SHOW_SECONDS,closeOnSelect:t6.CLOSE_ON_SELECT,minuteStep:t6.MINUTE_STEP,secondStep:t6.SECOND_STEP,cancelText:t6.CANCEL_TEXT,confirmText:t6.CONFIRM_TEXT,isOpen:t6.IS_OPEN,clockIcon:l6.CLOCK,keyboardIcon:l6.KEYBOARD},tZ=(J={})=>u(cj,J,"time-picker"),nZ=(J)=>{return p(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var eZ=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var e=(J)=>{return J.toString().padStart(2,"0")},$2=(J,$)=>{try{let Q=J.split(":"),Z=parseInt(Q[0],10),q=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(Z)||Z<0||Z>23||isNaN(q)||q<0||q>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let G=Z>=12?"PM":"AM";return{hours:Z,minutes:q,seconds:j,period:G}}catch(Q){console.error("Error parsing time:",Q);let Z=new Date,q=Z.getHours(),j=Z.getMinutes(),G=Z.getSeconds(),K=q>=12?"PM":"AM";return{hours:q,minutes:j,seconds:G,period:K}}},J2=(J,$)=>{let{hours:Q,minutes:Z,seconds:q}=J;if($){if(q!==void 0)return`${e(Q)}:${e(Z)}:${e(q)}`;return`${e(Q)}:${e(Z)}`}else{let j=Q%12;if(j===0)j=12;if(q!==void 0)return`${e(j)}:${e(Z)}:${e(q)} ${J.period}`;return`${e(j)}:${e(Z)} ${J.period}`}};var Q2=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var q6={...j9,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function ij(J){let $=document.documentElement,Q=getComputedStyle($),Z=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",q=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",G=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",z=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,W=`rgba(${G}, 0.1)`;return{primaryColor:Z,onPrimaryColor:q,onSurfaceColor:j,bgColor:z,selectedBgColor:W}}var O6=(J,$,Q)=>{let Z=J.getContext("2d");if(!Z){console.error("Could not get canvas context");return}let q=ij(Q.prefix),j=window.devicePixelRatio||1;J.width=q6.DIAMETER*j,J.height=q6.DIAMETER*j,Z.scale(j,j);let G=q6.DIAMETER/2,K=q6.DIAMETER/2,z=q6.DIAMETER/2;if(Z.clearRect(0,0,J.width,J.height),Z.beginPath(),Z.arc(G,K,z-2,0,2*Math.PI),Z.fillStyle=q.bgColor,Z.fill(),Z.beginPath(),Z.arc(G,K,q6.CENTER_SIZE/2,0,2*Math.PI),Z.fillStyle=q.primaryColor,Z.fill(),Q.activeSelector==="hour")if(Q.format==="24h")tj(Z,G,K,z,$.hours,q);else oj(Z,G,K,z,$.hours%12||12,q);else if(Q.activeSelector==="minute")Z2(Z,G,K,z,$.minutes,q);else if(Q.activeSelector==="second"&&Q.showSeconds)Z2(Z,G,K,z,$.seconds||0,q);nj(Z,G,K,$,Q,q)},oj=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let K=1;K<=12;K++){let z=K/6*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(K.toString(),W,Y+2)}},tj=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let z=1;z<=12;z++){let W=z/6*Math.PI-Math.PI/2,Y=$+G*Math.cos(W),U=Q+G*Math.sin(W),X=z===q;if(X)J.beginPath(),J.arc(Y,U,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(z.toString(),Y,U+2)}let K=q6.INNER_RADIUS;for(let z=13;z<=24;z++){let W=z===24?0:z,Y=(z-12)/6*Math.PI-Math.PI/2,U=$+K*Math.cos(Y),X=Q+K*Math.sin(Y),_=W===q;if(_)J.beginPath(),J.arc(U,X,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(W),U,X+2)}},Z2=(J,$,Q,Z,q,j)=>{let G=q6.OUTER_RADIUS;for(let K=0;K<60;K+=5){let z=K/30*Math.PI-Math.PI/2,W=$+G*Math.cos(z),Y=Q+G*Math.sin(z),U=K===q;if(U)J.beginPath(),J.arc(W,Y,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(K),W,Y)}if(q%5!==0){let K=q/30*Math.PI-Math.PI/2,z=$+G*Math.cos(K),W=Q+G*Math.sin(K);J.beginPath(),J.arc(z,W,q6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText(e(q),z,W)}},nj=(J,$,Q,Z,q,j)=>{let G,K;if(q.activeSelector==="hour")if(q.format==="24h")if(Z.hours>=12)G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=q6.INNER_RADIUS;else{let U=Z.hours;if(U===0)U=12;G=U/6*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS}else G=(Z.hours%12||12)/6*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else if(q.activeSelector==="minute")G=Z.minutes/30*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else if(q.activeSelector==="second")G=(Z.seconds||0)/30*Math.PI-Math.PI/2,K=q6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+K*Math.cos(G),Q+K*Math.sin(G)),J.lineWidth=q6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let z=$+K*Math.cos(G),W=Q+K*Math.sin(G);J.beginPath(),J.arc(z,W,q6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let Y="";if(q.activeSelector==="hour")if(q.format==="24h")Y=e(Z.hours);else Y=String(Z.hours%12||12);else if(q.activeSelector==="minute")Y=e(Z.minutes);else if(q.activeSelector==="second")Y=e(Z.seconds||0);J.fillText(Y,z,W)},x$=(J,$,Q,Z)=>{let q=q6.DIAMETER/2,j=q6.DIAMETER/2,G=$-q,K=Q-j,z=Math.sqrt(G*G+K*K),W=Math.atan2(K,G)+Math.PI/2;if(W<0)W+=2*Math.PI;if(Z.activeSelector==="hour")if(Z.format==="24h"){let Y=(q6.INNER_RADIUS+q6.OUTER_RADIUS)/2,U=z<Y,X=Math.round(W/(Math.PI/6))%12;if(U&&X!==0)X+=12;else if(!U&&X===0)X=12;else if(U&&X===0)X=0;return X}else{let Y=Math.round(W/(Math.PI/6))%12;if(Y===0)Y=12;return Y}else if(Z.activeSelector==="minute"||Z.activeSelector==="second")return Math.round(W/(Math.PI/30))%60;return null};var E6=(J,$,Q,Z)=>{if(J.innerHTML="",Q.title){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-title`,L.textContent=Q.title,L.id=`${Q.prefix}-time-picker-title`,J.appendChild(L)}let q=document.createElement("div");q.className=`${Q.prefix}-time-picker-content`,J.appendChild(q);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,q.appendChild(j);let{hours:G}=Q.format==="24h"?{hours:$.hours}:Q2($.hours),K=document.createElement("div");K.className=`${Q.prefix}-time-picker-time-input-field`;let z=document.createElement("input");z.type="number",z.className=`${Q.prefix}-time-picker-hours`,z.min=Q.format==="24h"?"0":"1",z.max=Q.format==="24h"?"23":"12",z.value=e(G),z.setAttribute("data-type","hour"),z.setAttribute("inputmode","numeric"),z.setAttribute("pattern","[0-9]*"),K.appendChild(z),j.appendChild(K);let W=document.createElement("div");W.className=`${Q.prefix}-time-picker-separator`,W.textContent=":",j.appendChild(W);let Y=document.createElement("div");Y.className=`${Q.prefix}-time-picker-time-input-field`;let U=document.createElement("input");U.type="number",U.className=`${Q.prefix}-time-picker-minutes`,U.min="0",U.max="59",U.value=e($.minutes),U.setAttribute("data-type","minute"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*"),Y.appendChild(U),j.appendChild(Y);let X;if(Q.showSeconds){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-separator`,L.textContent=":",j.appendChild(L);let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-time-input-field`,X=document.createElement("input"),X.type="number",X.className=`${Q.prefix}-time-picker-seconds`,X.min="0",X.max="59",X.value=e($.seconds||0),X.setAttribute("data-type","second"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",D.appendChild(X),D.appendChild(R),j.appendChild(D)}if(Q.format==="12h"){let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-period`;let D=document.createElement("div");D.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,D.textContent="AM",D.setAttribute("role","button"),D.setAttribute("tabindex","0"),D.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),L.appendChild(D),L.appendChild(R),j.appendChild(L)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",q.appendChild(_);let H=document.createElement("canvas");H.className=`${Q.prefix}-time-picker-dial-canvas`,H.width=j9.DIAMETER,H.height=j9.DIAMETER,H.style.width=`${j9.DIAMETER}px`,H.style.height=`${j9.DIAMETER}px`,_.appendChild(H);let B=document.createElement("div");B.className=`${Q.prefix}-time-picker-actions`,J.appendChild(B);let M=document.createElement("button");M.className=`${Q.prefix}-time-picker-toggle-type`,M.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),M.innerHTML=Q.type==="dial"?Q.keyboardIcon||l6.KEYBOARD:Q.clockIcon||l6.CLOCK,B.appendChild(M);let k=document.createElement("div");k.className=`${Q.prefix}-time-picker-action-buttons`,B.appendChild(k);let N=document.createElement("button");N.className=`${Q.prefix}-time-picker-cancel`,N.textContent=Q.cancelText||"Cancel",N.setAttribute("type","button"),k.appendChild(N);let F=document.createElement("button");F.className=`${Q.prefix}-time-picker-confirm`,F.textContent=Q.confirmText||"OK",F.setAttribute("type","button"),k.appendChild(F);let V="hour";if(Q.type==="dial")setTimeout(()=>{O6(H,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})},0);M.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",M.innerHTML=Q.keyboardIcon||l6.KEYBOARD,M.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{H.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((w)=>w.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((w)=>w.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((w)=>w.setAttribute("data-active","false")),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",M.innerHTML=Q.clockIcon||l6.CLOCK,M.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{z.focus(),z.select()},50)});let O=(L)=>{let D=L.target,R=D.getAttribute("data-type"),w=D.value;if(w==="")return;let A=parseInt(w,10);if(isNaN(A))return;if(R==="hour"){let x=A;if(Q.format==="12h"){if(A<0)x=1;if(A>12)x=12;if($.period==="PM"&&x!==12)x+=12;else if($.period==="AM"&&x===12)x=0}else{if(A<0)x=0;if(A>23)x=23}if($.hours=x,V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("hours",x)}else if(R==="minute"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.minutes=x,V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("minutes",x)}else if(R==="second"){let x=A;if(A<0)x=0;if(A>59)x=59;if($.seconds=x,V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","true");if(O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V}),Z)Z("seconds",x)}};if(z.addEventListener("input",O),U.addEventListener("input",O),X)X.addEventListener("input",O);if(z.addEventListener("keyup",(L)=>{if(L.key==="Enter")U.focus(),U.select()}),U.addEventListener("keyup",(L)=>{if(L.key==="Enter")if(Q.showSeconds&&X)X.focus(),X.select();else F.focus()}),X)X.addEventListener("keyup",(L)=>{if(L.key==="Enter")F.focus()});let P=(L)=>{if($.period!==L){let D=$.period;if($.period=L,D==="AM"&&L==="PM"){if($.hours<12)$.hours+=12}else if(D==="PM"&&L==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let w=$.hours===0?12:$.hours>12?$.hours-12:$.hours;z.value=e(w)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((w)=>{w.classList.remove(`${Q.prefix}-time-picker-period--selected`),w.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${L.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(Z)Z("hours",$.hours)}};if(Q.format==="12h"){let L=document.querySelector(`.${Q.prefix}-time-picker-period-am`),D=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(L)L.addEventListener("click",()=>{P("AM")});if(D)D.addEventListener("click",()=>{P("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(H.addEventListener("click",(L)=>{let D=H.getBoundingClientRect(),R=L.clientX-D.left,w=L.clientY-D.top,A=x$(H,R,w,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V});if(A!==null){if(V==="hour"){let x=A;if(Q.format==="12h"){if($.period==="PM"&&A!==12)x+=12;else if($.period==="AM"&&A===12)x=0}if($.hours=x,Q.format==="12h"){let I=x===0?12:x>12?x-12:x;z.value=e(I)}else z.value=e(x);if(Z)Z("hours",x)}else if(V==="minute"){if($.minutes=A,U.value=e(A),Z)Z("minutes",A)}else if(V==="second"&&X){if($.seconds=A,X.value=e(A),Z)Z("seconds",A)}O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),z.addEventListener("click",()=>{if(_.style.display==="block"){if(V="hour",z.setAttribute("data-active","true"),U.setAttribute("data-active","false"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),U.addEventListener("click",()=>{if(_.style.display==="block"){if(V="minute",z.setAttribute("data-active","false"),U.setAttribute("data-active","true"),X)X.setAttribute("data-active","false");O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})}}),X)X.addEventListener("click",()=>{if(_.style.display==="block")V="second",z.setAttribute("data-active","false"),U.setAttribute("data-active","false"),X.setAttribute("data-active","true"),O6(H,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:V})})}};var q2=(J,$,Q,Z,q,j)=>{let G=!!q.isOpen,K=(U)=>{if(U.key==="Escape")W.close(),j.events.emit(L6.CANCEL)},z=(U)=>{if(U.target===$)W.close()},W={element:J.element,modalElement:$,dialogElement:Q,isOpen:G,open(){if(G)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",K),$.addEventListener("click",z),G=!0,J.element.classList.add(`${q.prefix}-time-picker--open`),setTimeout(()=>{E6(Q,Z,q)},50),j.events.emit(L6.OPEN),q.onOpen)q.onOpen();return this},close(){if(!G)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",K),$.removeEventListener("click",z),G=!1,J.element.classList.remove(`${q.prefix}-time-picker--open`),j.events.emit(L6.CLOSE),q.onClose)q.onClose();return this},toggle(){return G?this.close():this.open()},getValue(){return J2(Z,q.format==="24h")},getTimeObject(){return{...Z}},setValue(U){try{let X=U.split(":"),_=parseInt(X[0],10),H=parseInt(X[1],10),B=X[2]?parseInt(X[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(H)||H<0||H>59||isNaN(B)||B<0||B>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(Z.hours=_,Z.minutes=H,Z.seconds=B,Z.period=_>=12?"PM":"AM",E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),q.onChange)q.onChange(this.getValue())}catch(X){console.error("Error setting time value:",X)}return this},setType(U){if(q.type===U)return this;return q.type=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"dial"}`,`${q.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getType(){return q.type},setFormat(U){if(q.format===U)return this;if(q.format=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"12h"}`,`${q.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),U==="24h")Z.period=Z.hours>=12?"PM":"AM";else Z.period=Z.hours>=12?"PM":"AM";return E6(Q,Z,q),j.events.emit(L6.CHANGE,this.getValue()),this},getFormat(){return q.format},setOrientation(U){if(q.orientation===U)return this;return q.orientation=U,Q.classList.remove(`${q.prefix}-time-picker-dialog--${"vertical"}`,`${q.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${q.prefix}-time-picker-dialog--${U}`),E6(Q,Z,q),this},getOrientation(){return q.orientation},setTitle(U){q.title=U;let X=Q.querySelector(Q6.TITLE);if(X)X.textContent=U;else E6(Q,Z,q);return this},getTitle(){return q.title||""},destroy(){if(G)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(U,X){return j.events.on(U,X),this},off(U,X){return j.events.off(U,X),this}};Q.addEventListener("click",(U)=>{let X=U.target;if(X.closest(Q6.CANCEL_BUTTON)){if(W.close(),j.events.emit(L6.CANCEL),q.onCancel)q.onCancel()}if(X.closest(Q6.CONFIRM_BUTTON)){if(W.close(),j.events.emit(L6.CONFIRM,W.getValue()),q.onConfirm)q.onConfirm(W.getValue())}if(X.closest(Q6.TOGGLE_TYPE_BUTTON)){let _=q.type==="dial"?"input":"dial";W.setType(_)}if(X.closest(Q6.PERIOD_AM)){if(Z.period!=="AM"){if(Z.period="AM",Z.hours>=12)Z.hours-=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.PERIOD_PM)){if(Z.period!=="PM"){if(Z.period="PM",Z.hours<12)Z.hours+=12;if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}if(X.closest(Q6.DIAL_CANVAS)){if(q.type==="dial"){let _=X,H=_.getBoundingClientRect(),B=U.clientX-H.left,M=U.clientY-H.top,k="hour",N=Q.querySelector(Q6.HOURS_INPUT),F=Q.querySelector(Q6.MINUTES_INPUT),V=Q.querySelector(Q6.SECONDS_INPUT);if(N&&N.getAttribute("data-active")==="true")k="hour";else if(F&&F.getAttribute("data-active")==="true")k="minute";else if(q.showSeconds&&V&&V.getAttribute("data-active")==="true")k="second";let O=x$(_,B,M,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(O!==null){if(k==="hour"){let P=O;if(q.format==="12h"){if(Z.period==="PM"&&O!==12)P+=12;else if(Z.period==="AM"&&O===12)P=0}if(Z.hours!==P){Z.hours=P;let L=N;if(L)L.textContent=e(q.format==="24h"?P:P%12||12);let D=Q.querySelector(Q6.DIAL_CANVAS);if(D)O6(D,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="minute"){if(Z.minutes!==O){Z.minutes=O;let P=F;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}else if(k==="second"&&q.showSeconds){if(Z.seconds!==O){Z.seconds=O;let P=V;if(P)P.textContent=e(O);let L=Q.querySelector(Q6.DIAL_CANVAS);if(L)O6(L,Z,{type:q.type,format:q.format,showSeconds:q.showSeconds,prefix:q.prefix,activeSelector:k});if(j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())}}}}}});let Y=(U)=>{let X=U.target,_=X.getAttribute("data-type"),H=parseInt(X.value,10);if(isNaN(H))return;if(_==="hour"){let B=H;if(q.format==="12h"){if(H<1)B=12;if(H>12)B=1;if(Z.period==="PM"&&B!==12)B+=12;else if(Z.period==="AM"&&B===12)B=0}else{if(H<0)B=0;if(H>23)B=23}Z.hours=B}else if(_==="minute"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.minutes=B}else if(_==="second"){let B=H;if(B<0)B=0;if(B>59)B=59;Z.seconds=B}if(E6(Q,Z,q),j.events.emit(L6.CHANGE,W.getValue()),q.onChange)q.onChange(W.getValue())};return Q.addEventListener("change",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT))Y(U)}),Q.addEventListener("keyup",(U)=>{let X=U.target;if(X.matches(Q6.HOURS_INPUT)||X.matches(Q6.MINUTES_INPUT)||X.matches(Q6.SECONDS_INPUT)){if(U.key==="Enter"){if(Y(U),X.matches(Q6.HOURS_INPUT)){let _=Q.querySelector(Q6.MINUTES_INPUT);if(_)_.focus()}else if(X.matches(Q6.MINUTES_INPUT))if(q.showSeconds){let _=Q.querySelector(Q6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}else if(X.matches(Q6.SECONDS_INPUT)){let _=Q.querySelector(Q6.CONFIRM_BUTTON);if(_)_.focus()}}}}),W};var ej=(J={})=>{let $=tZ(J);try{let Q=b(S,d(),h(nZ($)),C())($),Z=document.createElement("div");Z.className=`${f}-time-picker-modal`,Z.style.display="none",Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="100%",Z.style.height="100%",Z.style.backgroundColor="rgba(0, 0, 0, 0.4)",Z.style.zIndex=C7.MODAL.toString(),Z.setAttribute("role","presentation");let q=document.createElement("div");q.className=[`${f}-time-picker-dialog`,`${f}-time-picker-dialog--${$.type}`,`${f}-time-picker-dialog--${$.orientation}`,`${f}-time-picker-dialog--${$.format}`].join(" "),q.style.position="absolute",q.style.top="50%",q.style.left="50%",q.style.transform="translate(-50%, -50%)",q.style.zIndex=C7.DIALOG.toString(),Z.appendChild(q),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(Z);let G;if($.value)G=$2($.value,$.format);else{let z=new Date;G={hours:z.getHours(),minutes:z.getMinutes(),seconds:$.showSeconds?z.getSeconds():0,period:z.getHours()>=12?"PM":"AM"}}E6(q,G,$);let K=q2(Q,Z,q,G,$,eZ(Q));if($.isOpen)setTimeout(()=>K.open(),0);return K}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},j2=ej;J6();t();var n1={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},K2={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},D9={TAG:"header",TYPE:n1.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},G2={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var $K={tag:D9.TAG,type:D9.TYPE,scrollable:D9.SCROLLABLE,compressible:D9.COMPRESSIBLE,scrollThreshold:D9.SCROLL_THRESHOLD},z2=(J={})=>u($K,J,"top-app-bar");var W2=(J={})=>{let $=z2(J),Q=S($),Z=()=>{let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-leading`;let M=document.createElement("h1");if(M.className=`${Q.getClass("top-app-bar")}-headline`,$.title)M.textContent=$.title;let k=document.createElement("div");return k.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:B,headlineElement:M,trailingContainer:k}},{leadingContainer:q,headlineElement:j,trailingContainer:G}=Z(),K=()=>{let B=[$.class];if($.type!=="small")B.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))B.push(`${Q.getClass("top-app-bar")}--compressible`);return B.filter(Boolean)},z=h({tag:$.tag,componentName:"top-app-bar",className:K(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),W=d()(z),Y=C()(W);(()=>{if($.type==="medium"||$.type==="large"){let B=document.createElement("div");B.className=`${Q.getClass("top-app-bar")}-row`,B.appendChild(q),B.appendChild(G);let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(j),Y.element.appendChild(B),Y.element.appendChild(M)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)})();let X=!1;if($.scrollable){let B=()=>{let k=window.scrollY>$.scrollThreshold;if(X!==k){if(X=k,X)Y.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else Y.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(X)}};window.addEventListener("scroll",B,{passive:!0}),B();let M=Y.lifecycle.destroy;Y.lifecycle.destroy=()=>{window.removeEventListener("scroll",B),M()}}let _=(B)=>{while(Y.element.firstChild)Y.element.removeChild(Y.element.firstChild);if(["small","medium","large","center"].forEach((M)=>{Y.element.classList.remove(`${Q.getClass("top-app-bar")}--${M}`)}),B!=="small")Y.element.classList.add(`${Q.getClass("top-app-bar")}--${B}`);if(Y.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(B==="medium"||B==="large")),B==="medium"||B==="large"){let M=document.createElement("div");M.className=`${Q.getClass("top-app-bar")}-row`,M.appendChild(q),M.appendChild(G);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),Y.element.appendChild(M),Y.element.appendChild(k)}else Y.element.appendChild(q),Y.element.appendChild(j),Y.element.appendChild(G)};return{...Y,setTitle(B){return j.textContent=B,this},getTitle(){return j.textContent||""},addLeadingElement(B){return q.appendChild(B),this},addTrailingElement(B){return G.appendChild(B),this},setType(B){return $.type=B,_(B),this},setScrollState(B){if(X=B,B)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return q},getTrailingContainer(){return G}}};var JK=W2;w6();J6();c();o();var P6={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 Y2=8;var U2=({lifecycle:J})=>($)=>{let Q=null,Z=P6.BOTTOM,q=!1,j=null,G=null,K=300,z=100,W=!0,Y=!0,U=document.createElement("div");U.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(U),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let X=()=>{if(!Q)return{top:0,left:0};let P=$.element.getBoundingClientRect(),L=Q.getBoundingClientRect(),D=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,w=Y2,A=0,x=0,I;switch(Z){case P6.TOP:A=L.top+D-P.height-w,x=L.left+R+L.width/2-P.width/2,I="bottom";break;case P6.TOP_START:A=L.top+D-P.height-w,x=L.left+R,I="bottom-start";break;case P6.TOP_END:A=L.top+D-P.height-w,x=L.left+R+L.width-P.width,I="bottom-end";break;case P6.RIGHT:A=L.top+D+L.height/2-P.height/2,x=L.left+R+L.width+w,I="left";break;case P6.RIGHT_START:A=L.top+D,x=L.left+R+L.width+w,I="left-start";break;case P6.RIGHT_END:A=L.top+D+L.height-P.height,x=L.left+R+L.width+w,I="left-end";break;case P6.BOTTOM:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top";break;case P6.BOTTOM_START:A=L.top+D+L.height+w,x=L.left+R,I="top-start";break;case P6.BOTTOM_END:A=L.top+D+L.height+w,x=L.left+R+L.width-P.width,I="top-end";break;case P6.LEFT:A=L.top+D+L.height/2-P.height/2,x=L.left+R-P.width-w,I="right";break;case P6.LEFT_START:A=L.top+D,x=L.left+R-P.width-w,I="right-start";break;case P6.LEFT_END:A=L.top+D+L.height-P.height,x=L.left+R-P.width-w,I="right-end";break;default:A=L.top+D+L.height+w,x=L.left+R+L.width/2-P.width/2,I="top"}let r=window.innerWidth;if(x<0)x=0;else if(x+P.width>r)x=r-P.width;return{top:A,left:x,arrowPosition:I}},_=(P)=>{if(Y)P.addEventListener("mouseenter",B),P.addEventListener("mouseleave",M);if(W)P.addEventListener("focus",k),P.addEventListener("blur",N)},H=(P)=>{if(P)P.removeEventListener("mouseenter",B),P.removeEventListener("mouseleave",M),P.removeEventListener("focus",k),P.removeEventListener("blur",N)},B=()=>F.show(),M=()=>F.hide(),k=()=>F.show(),N=()=>F.hide(),F={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(P){let L=document.createTextNode(P);while($.element.firstChild!==U)$.element.removeChild($.element.firstChild);if($.element.insertBefore(L,U),q)this.updatePosition();return this},getText(){let P=$.element.cloneNode(!0),L=P.querySelector(`.${$.getClass("tooltip")}__arrow`);if(L)L.remove();return P.textContent||""},setPosition(P){Z=P;let L=$.getClass("tooltip"),D=Object.values(P6).map((R)=>`${L}--${R}`);if($.element.classList.remove(...D),$.element.classList.add(`${L}--${P}`),q)this.updatePosition();return this},getPosition(){return Z},setTarget(P){if(Q)H(Q);if(Q=P,this.target=P,Q.setAttribute("aria-describedby",$.element.id),_(Q),q)this.updatePosition();return this},show(P=!1){if(j!==null)window.clearTimeout(j),j=null;if(G!==null)window.clearTimeout(G),G=null;let L=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),q=!0,this.updatePosition(),window.addEventListener("resize",V),window.addEventListener("scroll",O)};if(P)L();else j=window.setTimeout(L,K);return this},hide(P=!1){if(G!==null)window.clearTimeout(G),G=null;if(j!==null)window.clearTimeout(j),j=null;let L=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),q=!1,window.removeEventListener("resize",V),window.removeEventListener("scroll",O)};if(P)L();else G=window.setTimeout(L,z);return this},isVisible(){return q},updatePosition(){if(!Q)return this;let{top:P,left:L,arrowPosition:D}=X();if($.element.style.top=`${Math.round(P)}px`,$.element.style.left=`${Math.round(L)}px`,D)U.className=`${$.getClass("tooltip")}__arrow`,U.classList.add(`${$.getClass("tooltip")}__arrow--${D}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(G!==null)window.clearTimeout(G);if(Q)H(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",V),window.removeEventListener("scroll",O),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},V=()=>{F.updatePosition()},O=()=>{F.updatePosition()};return F};t();var e1={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"},$J={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},X2={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},r6={POSITION:e1.BOTTOM,VARIANT:$J.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},B2={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var QK={position:r6.POSITION,variant:r6.VARIANT,visible:r6.VISIBLE,showDelay:r6.SHOW_DELAY,hideDelay:r6.HIDE_DELAY,showOnFocus:r6.SHOW_ON_FOCUS,showOnHover:r6.SHOW_ON_HOVER,rich:r6.RICH},F2=(J={})=>u(QK,J,"tooltip"),H2=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return p(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},k2=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var ZK=()=>{return`${f}-tooltip-${Math.random().toString(36).substring(2,9)}`},qK=(J={})=>{let $=F2(J);try{let Q=b(S,h(H2($)),C(),(Z)=>U2(k2(Z))(Z))($);if(Q.element.id=ZK(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},M2=qK;K7();T9();c();o();A8();var jK=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list manager: missing element"),$;let Q=J.renderItem,Z=null,q=(K,z,W)=>{let Y=Q?Q(K,z,W):j(K,W);if(Y&&K.id&&!Y.hasAttribute("data-id"))Y.setAttribute("data-id",K.id);if(Z)Z(K,Y);return Y};function j(K,z){let W=z||document.createElement("div");return W.className=$6.ITEM,W.textContent=K.text||K.title||K.headline||K.name||K.id,W}let G=R8(J.collection,$.element,{...J,renderItem:q,afterLoad:(K)=>{if($.emit(P9.LOAD,K),J.afterLoad)J.afterLoad(K)}});if(G.setRenderHook=(K)=>{Z=K},$.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{G.destroy(),K()}}return{...$,list:G}},JJ=jK;A9();_7();var KK=(J)=>($)=>{if(!$.element||!J.trackSelection)return $;let Q=new Set;if(Array.isArray(J.items))J.items.forEach((K)=>{if(K.selected)Q.add(K.id)});if(Array.isArray(J.initialSelection))J.initialSelection.forEach((K)=>{Q.add(K)});let Z=()=>{if(!$.list){setTimeout(Z,0);return}if(typeof $.list.setRenderHook==="function")$.list.setRenderHook((K,z)=>{if(Q.has(K.id)){if(!R6(z,$6.SELECTED))g(z,$6.SELECTED)}else if(R6(z,$6.SELECTED))j6(z,$6.SELECTED)})};Z();let q=(K)=>{if(!K.target.closest("[data-id]"))return;let z=K.target.closest("[data-id]"),W=z.getAttribute("data-id");if(!W)return;let Y=$.list?.getAllItems().find((X)=>X.id===W);if(!Y)return;let U={item:Y,element:z,originalEvent:K,component:$,preventDefault:()=>{U.defaultPrevented=!0},defaultPrevented:!1};if($.emit(P9.SELECT,U),U.defaultPrevented)return;if(J.multiSelect)if(Q.has(W))Q.delete(W),j6(z,$6.SELECTED);else Q.add(W),g(z,$6.SELECTED);else if(R6(z,$6.SELECTED))Q.clear(),j6(z,$6.SELECTED);else $.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((H)=>{j6(H,$6.SELECTED)}),Q.clear(),Q.add(W),g(z,$6.SELECTED)};$.element.addEventListener("click",q);let j=()=>{$.element.querySelectorAll("[data-id]").forEach((z)=>{let W=z.getAttribute("data-id"),Y=Q.has(W);if(Y&&!R6(z,$6.SELECTED))g(z,$6.SELECTED);else if(!Y&&R6(z,$6.SELECTED))j6(z,$6.SELECTED)})},G=(K,z)=>{if(z)Q.add(K);else Q.delete(K);let W=$.element.querySelector(`[data-id="${K}"]`);if(W){if(z&&!R6(W,$6.SELECTED))g(W,$6.SELECTED);else if(!z&&R6(W,$6.SELECTED))j6(W,$6.SELECTED)}};if($.lifecycle&&$.lifecycle.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",q),K()}}return{...$,getSelectedItems:()=>{return($.list?.getAllItems()||[]).filter((z)=>Q.has(z.id))},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(K)=>Q.has(K),selectItem:(K)=>{return G(K,!0),$},deselectItem:(K)=>{return G(K,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${f}-${$6.SELECTED}`).forEach((z)=>j6(z,$6.SELECTED));return $},setSelection:(K)=>{if(!K?.length&&Q.size===0)return $;if(Q.clear(),Array.isArray(K))K.forEach((z)=>Q.add(z));return j(),$}}},QJ=KK;var V2=({list:J,events:$,lifecycle:Q})=>(Z)=>({...Z,element:Z.element,refresh:async()=>{return await J.refresh(),Z},loadMore:async()=>{return await J.loadMore()},scrollToItem:(q,j="start")=>{return J.scrollToItem(q,j),Z},getVisibleItems:()=>J.getVisibleItems(),getAllItems:()=>J.getAllItems(),isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),on:(q,j)=>{return $.on(q,j),Z},off:(q,j)=>{return $.off(q,j),Z},destroy:()=>{Q.destroy()}});t();var GK={collection:G9.COLLECTION,transform:(J)=>J,baseUrl:G9.BASE_URL,items:[],pageSize:G9.PAGE_SIZE,renderBufferSize:G9.RENDER_BUFFER_SIZE,renderItem:null,trackSelection:!0,multiSelect:!1},N2=(J={})=>{if(!J.renderItem&&!Array.isArray(J.items))throw new Error("List requires either static items or a renderItem function");if(Array.isArray(J.items)&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id,Q};return u(GK,J,"list")},_2=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return p(J,{tag:"div",attributes:$,className:[$6.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},L2=(J)=>({list:{refresh:J.list?.refresh,loadMore:J.list?.loadMore,scrollToItem:J.list?.scrollToItem,getVisibleItems:J.list?.getVisibleItems,getAllItems:J.list?.getAllItems,isLoading:J.list?.isLoading,hasNextPage:J.list?.hasNextPage},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy}});var zK=(J={})=>{try{let $=N2(J);return b(S,d(),h(_2($)),JJ($),QJ($),C(),(Z)=>V2(L2(Z))(Z))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},D2=zK;var O2=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},ZJ=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},qJ=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};q7();var P2=(J,$,Q,Z)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){Z();return}let G=J.drawer.getAllItems();if(G?.length>0)G.forEach((K)=>{J.drawer.removeItem(K.config.id)});j.forEach((K)=>{J.drawer.addItem(K)}),Q()},R2=(J,$)=>{let Q=Object.keys(J.items||{}).map((q)=>({id:q,label:J.items[q]?.label||q,icon:J.items[q]?.icon||"",active:q===J.activeSection})),Z=w7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(Z.element),Z},A2=(J,$)=>{let Q=w7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},w2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},x2=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},y2=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},T2=(J,$,Q,Z,q)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||kJ(),j!==J.isMobile){if(J.isMobile)Q();else Z();if(q.onViewChange)q.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},I2=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},S2=(J,$,Q,Z)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,Z);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,Z)};var b2=(J,$,Q,Z,q,j)=>{let G=J.rail;if(!G)return;G.on("change",(K)=>{let z=K?.id;if(!z||J.processingChange)return;let W=K?.source==="userAction";if(J.processingChange=!0,J.activeSection=z,Q(z),j.onSectionChange&&W)j.onSectionChange(z,{source:W?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),G.on("mouseover",(K)=>{let z=K?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,z)if(J.items[z]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(z)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)q()},$.hoverDelay)}),G.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),G.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)q()},$.closeDelay)})},v2=(J,$,Q,Z)=>{let q=J.drawer;if(!q)return;if(typeof q.on==="function")q.on("change",(j)=>{let G=j.id;if(J.activeSubsection=G,$.hideDrawerOnClick)Q();if(Z.onItemSelect)Z.onItemSelect(j)}),q.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),q.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},C2=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},E2=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};q7();var WK=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(Z)=>{if(Z.target===J.overlayElement)Q()}),J.overlayElement},YK=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
57
+ </svg>`},a6={TYPE:o8.DIAL,FORMAT:n8.AMPM,ORIENTATION:t8.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:h6.CLOCK,KEYBOARD_ICON:h6.KEYBOARD},G5={ROOT:"time-picker",OPEN:"time-picker--open",MODAL:"time-picker-modal",DIALOG:"time-picker-dialog",DIALOG_DIAL:"time-picker-dialog--dial",DIALOG_INPUT:"time-picker-dialog--input",DIALOG_VERTICAL:"time-picker-dialog--vertical",DIALOG_HORIZONTAL:"time-picker-dialog--horizontal",DIALOG_12H:"time-picker-dialog--12h",DIALOG_24H:"time-picker-dialog--24h",TITLE:"time-picker-title",CONTENT:"time-picker-content",DIAL:"time-picker-dial",DIAL_CANVAS:"time-picker-dial-canvas",DIAL_FACE:"time-picker-dial-face",DIAL_HAND:"time-picker-dial-hand",DIAL_CENTER:"time-picker-dial-center",DIAL_NUMBERS:"time-picker-dial-numbers",DIAL_NUMBER:"time-picker-dial-number",DIAL_NUMBER_ACTIVE:"time-picker-dial-number--active",INPUT_CONTAINER:"time-picker-input-container",HOURS_INPUT:"time-picker-hours",MINUTES_INPUT:"time-picker-minutes",SECONDS_INPUT:"time-picker-seconds",SEPARATOR:"time-picker-separator",PERIOD_CONTAINER:"time-picker-period",PERIOD_AM:"time-picker-period-am",PERIOD_PM:"time-picker-period-pm",PERIOD_ACTIVE:"time-picker-period--active",ACTIONS:"time-picker-actions",TOGGLE_TYPE:"time-picker-toggle-type",CANCEL:"time-picker-cancel",CONFIRM:"time-picker-confirm"};var s3={type:"dial",format:"12h",orientation:"vertical",showSeconds:a6.SHOW_SECONDS,closeOnSelect:a6.CLOSE_ON_SELECT,minuteStep:a6.MINUTE_STEP,secondStep:a6.SECOND_STEP,cancelText:a6.CANCEL_TEXT,confirmText:a6.CONFIRM_TEXT,isOpen:a6.IS_OPEN,clockIcon:h6.CLOCK,keyboardIcon:h6.KEYBOARD},Y5=(J={})=>C(s3,J,"time-picker"),z5=(J)=>{return f(J,{tag:"div",attributes:{role:"dialog","aria-modal":"true","aria-labelledby":`${J.prefix}-time-picker-title`},className:[J.class,J.isOpen?`${J.prefix}-time-picker--open`:""],forwardEvents:{click:!0,keydown:!0},interactive:!0})};var W5=(J)=>({events:{on:($,Q)=>J.on($,Q),off:($,Q)=>J.off($,Q),emit:($,Q)=>J.emit($,Q)},lifecycle:{destroy:()=>J.lifecycle.destroy()}});var t=(J)=>{return J.toString().padStart(2,"0")},U5=(J,$)=>{try{let Q=J.split(":"),q=parseInt(Q[0],10),Z=parseInt(Q[1],10),j=Q[2]?parseInt(Q[2],10):0;if(isNaN(q)||q<0||q>23||isNaN(Z)||Z<0||Z>59||isNaN(j)||j<0||j>59)throw new Error("Invalid time format");let K=q>=12?"PM":"AM";return{hours:q,minutes:Z,seconds:j,period:K}}catch(Q){console.error("Error parsing time:",Q);let q=new Date,Z=q.getHours(),j=q.getMinutes(),K=q.getSeconds(),G=Z>=12?"PM":"AM";return{hours:Z,minutes:j,seconds:K,period:G}}},X5=(J,$)=>{let{hours:Q,minutes:q,seconds:Z}=J;if($){if(Z!==void 0)return`${t(Q)}:${t(q)}:${t(Z)}`;return`${t(Q)}:${t(q)}`}else{let j=Q%12;if(j===0)j=12;if(Z!==void 0)return`${t(j)}:${t(q)}:${t(Z)} ${J.period}`;return`${t(j)}:${t(q)} ${J.period}`}};var B5=(J)=>{let $=J>=12?"PM":"AM",Q=J%12;if(Q===0)Q=12;return{hours:Q,period:$}};var j6={...e6,KNOB_SIZE:45,CENTER_SIZE:8,NUMBER_SIZE:24,INNER_RADIUS:75,OUTER_RADIUS:100,TRACK_WIDTH:1.5,HAND_WIDTH:2};function m3(J){let $=document.documentElement,Q=getComputedStyle($),q=Q.getPropertyValue(`--${J}-sys-color-primary`).trim()||"#6750A4",Z=Q.getPropertyValue(`--${J}-sys-color-on-primary`).trim()||"#FFFFFF",j=Q.getPropertyValue(`--${J}-sys-color-on-surface`).trim()||"#1C1B1F",K=Q.getPropertyValue(`--${J}-sys-color-primary-rgb`).trim()||"103, 80, 164",Y=`rgba(${Q.getPropertyValue(`--${J}-sys-color-on-surface-rgb`).trim()||"28, 27, 31"}, 0.05)`,z=`rgba(${K}, 0.1)`;return{primaryColor:q,onPrimaryColor:Z,onSurfaceColor:j,bgColor:Y,selectedBgColor:z}}var _6=(J,$,Q)=>{let q=J.getContext("2d");if(!q){console.error("Could not get canvas context");return}let Z=m3(Q.prefix),j=window.devicePixelRatio||1;J.width=j6.DIAMETER*j,J.height=j6.DIAMETER*j,q.scale(j,j);let K=j6.DIAMETER/2,G=j6.DIAMETER/2,Y=j6.DIAMETER/2;if(q.clearRect(0,0,J.width,J.height),q.beginPath(),q.arc(K,G,Y-2,0,2*Math.PI),q.fillStyle=Z.bgColor,q.fill(),q.beginPath(),q.arc(K,G,j6.CENTER_SIZE/2,0,2*Math.PI),q.fillStyle=Z.primaryColor,q.fill(),Q.activeSelector==="hour")if(Q.format==="24h")i3(q,K,G,Y,$.hours,Z);else a3(q,K,G,Y,$.hours%12||12,Z);else if(Q.activeSelector==="minute")F5(q,K,G,Y,$.minutes,Z);else if(Q.activeSelector==="second"&&Q.showSeconds)F5(q,K,G,Y,$.seconds||0,Z);c3(q,K,G,$,Q,Z)},a3=(J,$,Q,q,Z,j)=>{let K=j6.OUTER_RADIUS;for(let G=1;G<=12;G++){let Y=G/6*Math.PI-Math.PI/2,z=$+K*Math.cos(Y),W=Q+K*Math.sin(Y),X=G===Z;if(X)J.beginPath(),J.arc(z,W,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(G.toString(),z,W+2)}},i3=(J,$,Q,q,Z,j)=>{let K=j6.OUTER_RADIUS;for(let Y=1;Y<=12;Y++){let z=Y/6*Math.PI-Math.PI/2,W=$+K*Math.cos(z),X=Q+K*Math.sin(z),U=Y===Z;if(U)J.beginPath(),J.arc(W,X,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=U?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(Y.toString(),W,X+2)}let G=j6.INNER_RADIUS;for(let Y=13;Y<=24;Y++){let z=Y===24?0:Y,W=(Y-12)/6*Math.PI-Math.PI/2,X=$+G*Math.cos(W),U=Q+G*Math.sin(W),_=z===Z;if(_)J.beginPath(),J.arc(X,U,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="14px Roboto, Arial, sans-serif",J.fillStyle=_?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(t(z),X,U+2)}},F5=(J,$,Q,q,Z,j)=>{let K=j6.OUTER_RADIUS;for(let G=0;G<60;G+=5){let Y=G/30*Math.PI-Math.PI/2,z=$+K*Math.cos(Y),W=Q+K*Math.sin(Y),X=G===Z;if(X)J.beginPath(),J.arc(z,W,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill();J.font="16px Roboto, Arial, sans-serif",J.fillStyle=X?j.primaryColor:j.onSurfaceColor,J.textAlign="center",J.textBaseline="middle",J.fillText(t(G),z,W)}if(Z%5!==0){let G=Z/30*Math.PI-Math.PI/2,Y=$+K*Math.cos(G),z=Q+K*Math.sin(G);J.beginPath(),J.arc(Y,z,j6.NUMBER_SIZE/2,0,2*Math.PI),J.fillStyle=j.selectedBgColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.primaryColor,J.textAlign="center",J.textBaseline="middle",J.fillText(t(Z),Y,z)}},c3=(J,$,Q,q,Z,j)=>{let K,G;if(Z.activeSelector==="hour")if(Z.format==="24h")if(q.hours>=12)K=(q.hours%12||12)/6*Math.PI-Math.PI/2,G=j6.INNER_RADIUS;else{let X=q.hours;if(X===0)X=12;K=X/6*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS}else K=(q.hours%12||12)/6*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else if(Z.activeSelector==="minute")K=q.minutes/30*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else if(Z.activeSelector==="second")K=(q.seconds||0)/30*Math.PI-Math.PI/2,G=j6.OUTER_RADIUS;else return;J.beginPath(),J.moveTo($,Q),J.lineTo($+G*Math.cos(K),Q+G*Math.sin(K)),J.lineWidth=j6.HAND_WIDTH,J.strokeStyle=j.primaryColor,J.stroke();let Y=$+G*Math.cos(K),z=Q+G*Math.sin(K);J.beginPath(),J.arc(Y,z,j6.KNOB_SIZE/2,0,2*Math.PI),J.fillStyle=j.primaryColor,J.fill(),J.font="16px Roboto, Arial, sans-serif",J.fillStyle=j.onPrimaryColor,J.textAlign="center",J.textBaseline="middle";let W="";if(Z.activeSelector==="hour")if(Z.format==="24h")W=t(q.hours);else W=String(q.hours%12||12);else if(Z.activeSelector==="minute")W=t(q.minutes);else if(Z.activeSelector==="second")W=t(q.seconds||0);J.fillText(W,Y,z)},Z$=(J,$,Q,q)=>{let Z=j6.DIAMETER/2,j=j6.DIAMETER/2,K=$-Z,G=Q-j,Y=Math.sqrt(K*K+G*G),z=Math.atan2(G,K)+Math.PI/2;if(z<0)z+=2*Math.PI;if(q.activeSelector==="hour")if(q.format==="24h"){let W=(j6.INNER_RADIUS+j6.OUTER_RADIUS)/2,X=Y<W,U=Math.round(z/(Math.PI/6))%12;if(X&&U!==0)U+=12;else if(!X&&U===0)U=12;else if(X&&U===0)U=0;return U}else{let W=Math.round(z/(Math.PI/6))%12;if(W===0)W=12;return W}else if(q.activeSelector==="minute"||q.activeSelector==="second")return Math.round(z/(Math.PI/30))%60;return null};var T6=(J,$,Q,q)=>{if(J.innerHTML="",Q.title){let M=document.createElement("div");M.className=`${Q.prefix}-time-picker-title`,M.textContent=Q.title,M.id=`${Q.prefix}-time-picker-title`,J.appendChild(M)}let Z=document.createElement("div");Z.className=`${Q.prefix}-time-picker-content`,J.appendChild(Z);let j=document.createElement("div");j.className=`${Q.prefix}-time-picker-input-container`,Z.appendChild(j);let{hours:K}=Q.format==="24h"?{hours:$.hours}:B5($.hours),G=document.createElement("div");G.className=`${Q.prefix}-time-picker-time-input-field`;let Y=document.createElement("input");Y.type="number",Y.className=`${Q.prefix}-time-picker-hours`,Y.min=Q.format==="24h"?"0":"1",Y.max=Q.format==="24h"?"23":"12",Y.value=t(K),Y.setAttribute("data-type","hour"),Y.setAttribute("inputmode","numeric"),Y.setAttribute("pattern","[0-9]*"),G.appendChild(Y),j.appendChild(G);let z=document.createElement("div");z.className=`${Q.prefix}-time-picker-separator`,z.textContent=":",j.appendChild(z);let W=document.createElement("div");W.className=`${Q.prefix}-time-picker-time-input-field`;let X=document.createElement("input");X.type="number",X.className=`${Q.prefix}-time-picker-minutes`,X.min="0",X.max="59",X.value=t($.minutes),X.setAttribute("data-type","minute"),X.setAttribute("inputmode","numeric"),X.setAttribute("pattern","[0-9]*"),W.appendChild(X),j.appendChild(W);let U;if(Q.showSeconds){let M=document.createElement("div");M.className=`${Q.prefix}-time-picker-separator`,M.textContent=":",j.appendChild(M);let P=document.createElement("div");P.className=`${Q.prefix}-time-picker-time-input-field`,U=document.createElement("input"),U.type="number",U.className=`${Q.prefix}-time-picker-seconds`,U.min="0",U.max="59",U.value=t($.seconds||0),U.setAttribute("data-type","second"),U.setAttribute("inputmode","numeric"),U.setAttribute("pattern","[0-9]*");let R=document.createElement("label");R.className=`${Q.prefix}-time-picker-input-label`,R.textContent="Second",P.appendChild(U),P.appendChild(R),j.appendChild(P)}if(Q.format==="12h"){let M=document.createElement("div");M.className=`${Q.prefix}-time-picker-period`;let P=document.createElement("div");P.className=`${Q.prefix}-time-picker-period-am ${$.period==="AM"?`${Q.prefix}-time-picker-period--selected`:""}`,P.textContent="AM",P.setAttribute("role","button"),P.setAttribute("tabindex","0"),P.setAttribute("aria-pressed",$.period==="AM"?"true":"false");let R=document.createElement("div");R.className=`${Q.prefix}-time-picker-period-pm ${$.period==="PM"?`${Q.prefix}-time-picker-period--selected`:""}`,R.textContent="PM",R.setAttribute("role","button"),R.setAttribute("tabindex","0"),R.setAttribute("aria-pressed",$.period==="PM"?"true":"false"),M.appendChild(P),M.appendChild(R),j.appendChild(M)}let _=document.createElement("div");_.className=`${Q.prefix}-time-picker-dial`,_.style.display=Q.type==="dial"?"block":"none",Z.appendChild(_);let N=document.createElement("canvas");N.className=`${Q.prefix}-time-picker-dial-canvas`,N.width=e6.DIAMETER,N.height=e6.DIAMETER,N.style.width=`${e6.DIAMETER}px`,N.style.height=`${e6.DIAMETER}px`,_.appendChild(N);let F=document.createElement("div");F.className=`${Q.prefix}-time-picker-actions`,J.appendChild(F);let k=document.createElement("button");k.className=`${Q.prefix}-time-picker-toggle-type`,k.setAttribute("aria-label",Q.type==="dial"?"Switch to keyboard input":"Switch to dial selector"),k.innerHTML=Q.type==="dial"?Q.keyboardIcon||h6.KEYBOARD:Q.clockIcon||h6.CLOCK,F.appendChild(k);let L=document.createElement("div");L.className=`${Q.prefix}-time-picker-action-buttons`,F.appendChild(L);let D=document.createElement("button");D.className=`${Q.prefix}-time-picker-cancel`,D.textContent=Q.cancelText||"Cancel",D.setAttribute("type","button"),L.appendChild(D);let B=document.createElement("button");B.className=`${Q.prefix}-time-picker-confirm`,B.textContent=Q.confirmText||"OK",B.setAttribute("type","button"),L.appendChild(B);let H="hour";if(Q.type==="dial")setTimeout(()=>{_6(N,$,{type:Q.type,format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H})},0);k.addEventListener("click",()=>{if(_.style.display==="none")_.style.display="block",k.innerHTML=Q.keyboardIcon||h6.KEYBOARD,k.setAttribute("aria-label","Switch to keyboard input"),setTimeout(()=>{N.focus(),document.querySelectorAll(`.${Q.prefix}-time-picker-hours`).forEach((y)=>y.setAttribute("data-active","true")),document.querySelectorAll(`.${Q.prefix}-time-picker-minutes`).forEach((y)=>y.setAttribute("data-active","false")),document.querySelectorAll(`.${Q.prefix}-time-picker-seconds`).forEach((y)=>y.setAttribute("data-active","false")),_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:"hour"})},50);else _.style.display="none",k.innerHTML=Q.clockIcon||h6.CLOCK,k.setAttribute("aria-label","Switch to dial selector"),setTimeout(()=>{Y.focus(),Y.select()},50)});let V=(M)=>{let P=M.target,R=P.getAttribute("data-type"),y=P.value;if(y==="")return;let x=parseInt(y,10);if(isNaN(x))return;if(R==="hour"){let A=x;if(Q.format==="12h"){if(x<0)A=1;if(x>12)A=12;if($.period==="PM"&&A!==12)A+=12;else if($.period==="AM"&&A===12)A=0}else{if(x<0)A=0;if(x>23)A=23}if($.hours=A,H="hour",Y.setAttribute("data-active","true"),X.setAttribute("data-active","false"),U)U.setAttribute("data-active","false");if(_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H}),q)q("hours",A)}else if(R==="minute"){let A=x;if(x<0)A=0;if(x>59)A=59;if($.minutes=A,H="minute",Y.setAttribute("data-active","false"),X.setAttribute("data-active","true"),U)U.setAttribute("data-active","false");if(_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H}),q)q("minutes",A)}else if(R==="second"){let A=x;if(x<0)A=0;if(x>59)A=59;if($.seconds=A,H="second",Y.setAttribute("data-active","false"),X.setAttribute("data-active","false"),U)U.setAttribute("data-active","true");if(_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H}),q)q("seconds",A)}};if(Y.addEventListener("input",V),X.addEventListener("input",V),U)U.addEventListener("input",V);if(Y.addEventListener("keyup",(M)=>{if(M.key==="Enter")X.focus(),X.select()}),X.addEventListener("keyup",(M)=>{if(M.key==="Enter")if(Q.showSeconds&&U)U.focus(),U.select();else B.focus()}),U)U.addEventListener("keyup",(M)=>{if(M.key==="Enter")B.focus()});let O=(M)=>{if($.period!==M){let P=$.period;if($.period=M,P==="AM"&&M==="PM"){if($.hours<12)$.hours+=12}else if(P==="PM"&&M==="AM"){if($.hours>=12)$.hours-=12}if(Q.format==="12h"){let y=$.hours===0?12:$.hours>12?$.hours-12:$.hours;Y.value=t(y)}document.querySelectorAll(`.${Q.prefix}-time-picker-period-am, .${Q.prefix}-time-picker-period-pm`).forEach((y)=>{y.classList.remove(`${Q.prefix}-time-picker-period--selected`),y.setAttribute("aria-pressed","false")});let R=document.querySelector(`.${Q.prefix}-time-picker-period-${M.toLowerCase()}`);if(R)R.classList.add(`${Q.prefix}-time-picker-period--selected`),R.setAttribute("aria-pressed","true");if(_.style.display==="block")_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H});if(q)q("hours",$.hours)}};if(Q.format==="12h"){let M=document.querySelector(`.${Q.prefix}-time-picker-period-am`),P=document.querySelector(`.${Q.prefix}-time-picker-period-pm`);if(M)M.addEventListener("click",()=>{O("AM")});if(P)P.addEventListener("click",()=>{O("PM")})}if(Q.type==="dial"||_.style.display==="block"){if(N.addEventListener("click",(M)=>{let P=N.getBoundingClientRect(),R=M.clientX-P.left,y=M.clientY-P.top,x=Z$(N,R,y,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H});if(x!==null){if(H==="hour"){let A=x;if(Q.format==="12h"){if($.period==="PM"&&x!==12)A+=12;else if($.period==="AM"&&x===12)A=0}if($.hours=A,Q.format==="12h"){let v=A===0?12:A>12?A-12:A;Y.value=t(v)}else Y.value=t(A);if(q)q("hours",A)}else if(H==="minute"){if($.minutes=x,X.value=t(x),q)q("minutes",x)}else if(H==="second"&&U){if($.seconds=x,U.value=t(x),q)q("seconds",x)}_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H})}}),Y.addEventListener("click",()=>{if(_.style.display==="block"){if(H="hour",Y.setAttribute("data-active","true"),X.setAttribute("data-active","false"),U)U.setAttribute("data-active","false");_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H})}}),X.addEventListener("click",()=>{if(_.style.display==="block"){if(H="minute",Y.setAttribute("data-active","false"),X.setAttribute("data-active","true"),U)U.setAttribute("data-active","false");_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H})}}),U)U.addEventListener("click",()=>{if(_.style.display==="block")H="second",Y.setAttribute("data-active","false"),X.setAttribute("data-active","false"),U.setAttribute("data-active","true"),_6(N,$,{type:"dial",format:Q.format,showSeconds:Q.showSeconds,prefix:Q.prefix,activeSelector:H})})}};var H5=(J,$,Q,q,Z,j)=>{let K=!!Z.isOpen,G=(X)=>{if(X.key==="Escape")z.close(),j.events.emit(L6.CANCEL)},Y=(X)=>{if(X.target===$)z.close()},z={element:J.element,modalElement:$,dialogElement:Q,isOpen:K,open(){if(K)return this;if($.style.display="block",$.offsetWidth,$.classList.add("active"),Q.classList.add("active"),document.addEventListener("keydown",G),$.addEventListener("click",Y),K=!0,J.element.classList.add(`${Z.prefix}-time-picker--open`),setTimeout(()=>{T6(Q,q,Z)},50),j.events.emit(L6.OPEN),Z.onOpen)Z.onOpen();return this},close(){if(!K)return this;if($.classList.remove("active"),Q.classList.remove("active"),setTimeout(()=>{$.style.display="none"},300),document.removeEventListener("keydown",G),$.removeEventListener("click",Y),K=!1,J.element.classList.remove(`${Z.prefix}-time-picker--open`),j.events.emit(L6.CLOSE),Z.onClose)Z.onClose();return this},toggle(){return K?this.close():this.open()},getValue(){return X5(q,Z.format==="24h")},getTimeObject(){return{...q}},setValue(X){try{let U=X.split(":"),_=parseInt(U[0],10),N=parseInt(U[1],10),F=U[2]?parseInt(U[2],10):0;if(isNaN(_)||_<0||_>23||isNaN(N)||N<0||N>59||isNaN(F)||F<0||F>59)throw new Error("Invalid time format. Use HH:MM or HH:MM:SS (24-hour format).");if(q.hours=_,q.minutes=N,q.seconds=F,q.period=_>=12?"PM":"AM",T6(Q,q,Z),j.events.emit(L6.CHANGE,this.getValue()),Z.onChange)Z.onChange(this.getValue())}catch(U){console.error("Error setting time value:",U)}return this},setType(X){if(Z.type===X)return this;return Z.type=X,Q.classList.remove(`${Z.prefix}-time-picker-dialog--${"dial"}`,`${Z.prefix}-time-picker-dialog--${"input"}`),Q.classList.add(`${Z.prefix}-time-picker-dialog--${X}`),T6(Q,q,Z),this},getType(){return Z.type},setFormat(X){if(Z.format===X)return this;if(Z.format=X,Q.classList.remove(`${Z.prefix}-time-picker-dialog--${"12h"}`,`${Z.prefix}-time-picker-dialog--${"24h"}`),Q.classList.add(`${Z.prefix}-time-picker-dialog--${X}`),X==="24h")q.period=q.hours>=12?"PM":"AM";else q.period=q.hours>=12?"PM":"AM";return T6(Q,q,Z),j.events.emit(L6.CHANGE,this.getValue()),this},getFormat(){return Z.format},setOrientation(X){if(Z.orientation===X)return this;return Z.orientation=X,Q.classList.remove(`${Z.prefix}-time-picker-dialog--${"vertical"}`,`${Z.prefix}-time-picker-dialog--${"horizontal"}`),Q.classList.add(`${Z.prefix}-time-picker-dialog--${X}`),T6(Q,q,Z),this},getOrientation(){return Z.orientation},setTitle(X){Z.title=X;let U=Q.querySelector(J6.TITLE);if(U)U.textContent=X;else T6(Q,q,Z);return this},getTitle(){return Z.title||""},destroy(){if(K)this.close();if($&&$.parentNode)$.parentNode.removeChild($);j.lifecycle.destroy()},on(X,U){return j.events.on(X,U),this},off(X,U){return j.events.off(X,U),this}};Q.addEventListener("click",(X)=>{let U=X.target;if(U.closest(J6.CANCEL_BUTTON)){if(z.close(),j.events.emit(L6.CANCEL),Z.onCancel)Z.onCancel()}if(U.closest(J6.CONFIRM_BUTTON)){if(z.close(),j.events.emit(L6.CONFIRM,z.getValue()),Z.onConfirm)Z.onConfirm(z.getValue())}if(U.closest(J6.TOGGLE_TYPE_BUTTON)){let _=Z.type==="dial"?"input":"dial";z.setType(_)}if(U.closest(J6.PERIOD_AM)){if(q.period!=="AM"){if(q.period="AM",q.hours>=12)q.hours-=12;if(T6(Q,q,Z),j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())}}if(U.closest(J6.PERIOD_PM)){if(q.period!=="PM"){if(q.period="PM",q.hours<12)q.hours+=12;if(T6(Q,q,Z),j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())}}if(U.closest(J6.DIAL_CANVAS)){if(Z.type==="dial"){let _=U,N=_.getBoundingClientRect(),F=X.clientX-N.left,k=X.clientY-N.top,L="hour",D=Q.querySelector(J6.HOURS_INPUT),B=Q.querySelector(J6.MINUTES_INPUT),H=Q.querySelector(J6.SECONDS_INPUT);if(D&&D.getAttribute("data-active")==="true")L="hour";else if(B&&B.getAttribute("data-active")==="true")L="minute";else if(Z.showSeconds&&H&&H.getAttribute("data-active")==="true")L="second";let V=Z$(_,F,k,{type:Z.type,format:Z.format,showSeconds:Z.showSeconds,prefix:Z.prefix,activeSelector:L});if(V!==null){if(L==="hour"){let O=V;if(Z.format==="12h"){if(q.period==="PM"&&V!==12)O+=12;else if(q.period==="AM"&&V===12)O=0}if(q.hours!==O){q.hours=O;let M=D;if(M)M.textContent=t(Z.format==="24h"?O:O%12||12);let P=Q.querySelector(J6.DIAL_CANVAS);if(P)_6(P,q,{type:Z.type,format:Z.format,showSeconds:Z.showSeconds,prefix:Z.prefix,activeSelector:L});if(j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())}}else if(L==="minute"){if(q.minutes!==V){q.minutes=V;let O=B;if(O)O.textContent=t(V);let M=Q.querySelector(J6.DIAL_CANVAS);if(M)_6(M,q,{type:Z.type,format:Z.format,showSeconds:Z.showSeconds,prefix:Z.prefix,activeSelector:L});if(j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())}}else if(L==="second"&&Z.showSeconds){if(q.seconds!==V){q.seconds=V;let O=H;if(O)O.textContent=t(V);let M=Q.querySelector(J6.DIAL_CANVAS);if(M)_6(M,q,{type:Z.type,format:Z.format,showSeconds:Z.showSeconds,prefix:Z.prefix,activeSelector:L});if(j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())}}}}}});let W=(X)=>{let U=X.target,_=U.getAttribute("data-type"),N=parseInt(U.value,10);if(isNaN(N))return;if(_==="hour"){let F=N;if(Z.format==="12h"){if(N<1)F=12;if(N>12)F=1;if(q.period==="PM"&&F!==12)F+=12;else if(q.period==="AM"&&F===12)F=0}else{if(N<0)F=0;if(N>23)F=23}q.hours=F}else if(_==="minute"){let F=N;if(F<0)F=0;if(F>59)F=59;q.minutes=F}else if(_==="second"){let F=N;if(F<0)F=0;if(F>59)F=59;q.seconds=F}if(T6(Q,q,Z),j.events.emit(L6.CHANGE,z.getValue()),Z.onChange)Z.onChange(z.getValue())};return Q.addEventListener("change",(X)=>{let U=X.target;if(U.matches(J6.HOURS_INPUT)||U.matches(J6.MINUTES_INPUT)||U.matches(J6.SECONDS_INPUT))W(X)}),Q.addEventListener("keyup",(X)=>{let U=X.target;if(U.matches(J6.HOURS_INPUT)||U.matches(J6.MINUTES_INPUT)||U.matches(J6.SECONDS_INPUT)){if(X.key==="Enter"){if(W(X),U.matches(J6.HOURS_INPUT)){let _=Q.querySelector(J6.MINUTES_INPUT);if(_)_.focus()}else if(U.matches(J6.MINUTES_INPUT))if(Z.showSeconds){let _=Q.querySelector(J6.SECONDS_INPUT);if(_)_.focus()}else{let _=Q.querySelector(J6.CONFIRM_BUTTON);if(_)_.focus()}else if(U.matches(J6.SECONDS_INPUT)){let _=Q.querySelector(J6.CONFIRM_BUTTON);if(_)_.focus()}}}}),z};var o3=(J={})=>{let $=Y5(J);try{let Q=I(T,h(),S(z5($)),b())($),q=document.createElement("div");q.className=`${u}-time-picker-modal`,q.style.display="none",q.style.position="fixed",q.style.top="0",q.style.left="0",q.style.width="100%",q.style.height="100%",q.style.backgroundColor="rgba(0, 0, 0, 0.4)",q.style.zIndex=H7.MODAL.toString(),q.setAttribute("role","presentation");let Z=document.createElement("div");Z.className=[`${u}-time-picker-dialog`,`${u}-time-picker-dialog--${$.type}`,`${u}-time-picker-dialog--${$.orientation}`,`${u}-time-picker-dialog--${$.format}`].join(" "),Z.style.position="absolute",Z.style.top="50%",Z.style.left="50%",Z.style.transform="translate(-50%, -50%)",Z.style.zIndex=H7.DIALOG.toString(),q.appendChild(Z),(typeof $.container==="string"?document.querySelector($.container)||document.body:$.container||document.body).appendChild(q);let K;if($.value)K=U5($.value,$.format);else{let Y=new Date;K={hours:Y.getHours(),minutes:Y.getMinutes(),seconds:$.showSeconds?Y.getSeconds():0,period:Y.getHours()>=12?"PM":"AM"}}T6(Z,K,$);let G=H5(Q,q,Z,K,$,W5(Q));if($.isOpen)setTimeout(()=>G.open(),0);return G}catch(Q){throw console.error("TimePicker creation error:",Q),new Error(`Failed to create time picker: ${Q.message}`)}},M5=o3;n();c();var e8={SMALL:"small",MEDIUM:"medium",LARGE:"large",CENTER:"center"},k5={DEFAULT:"default",SCROLLED:"scrolled",FIXED:"fixed"},W9={TAG:"header",TYPE:e8.SMALL,SCROLLABLE:!0,COMPRESSIBLE:!0,SCROLL_THRESHOLD:4},N5={ROOT:"top-app-bar",SMALL:"top-app-bar--small",MEDIUM:"top-app-bar--medium",LARGE:"top-app-bar--large",CENTER:"top-app-bar--center",SCROLLED:"top-app-bar--scrolled",FIXED:"top-app-bar--fixed",ROW:"top-app-bar-row",SECTION:"top-app-bar-section",SECTION_LEADING:"top-app-bar-section--leading",SECTION_HEADLINE:"top-app-bar-section--headline",SECTION_TRAILING:"top-app-bar-section--trailing",TITLE:"top-app-bar-title"};var t3={tag:W9.TAG,type:W9.TYPE,scrollable:W9.SCROLLABLE,compressible:W9.COMPRESSIBLE,scrollThreshold:W9.SCROLL_THRESHOLD},L5=(J={})=>C(t3,J,"top-app-bar");var V5=(J={})=>{let $=L5(J),Q=T($),q=()=>{let F=document.createElement("div");F.className=`${Q.getClass("top-app-bar")}-leading`;let k=document.createElement("h1");if(k.className=`${Q.getClass("top-app-bar")}-headline`,$.title)k.textContent=$.title;let L=document.createElement("div");return L.className=`${Q.getClass("top-app-bar")}-trailing`,{leadingContainer:F,headlineElement:k,trailingContainer:L}},{leadingContainer:Z,headlineElement:j,trailingContainer:K}=q(),G=()=>{let F=[$.class];if($.type!=="small")F.push(`${Q.getClass("top-app-bar")}--${$.type}`);if($.compressible&&($.type==="medium"||$.type==="large"))F.push(`${Q.getClass("top-app-bar")}--compressible`);return F.filter(Boolean)},Y=S({tag:$.tag,componentName:"top-app-bar",className:G(),attributes:{role:"banner","aria-label":"Top app bar"},interactive:!0})(Q),z=h()(Y),W=b()(z);(()=>{if($.type==="medium"||$.type==="large"){let F=document.createElement("div");F.className=`${Q.getClass("top-app-bar")}-row`,F.appendChild(Z),F.appendChild(K);let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(j),W.element.appendChild(F),W.element.appendChild(k)}else W.element.appendChild(Z),W.element.appendChild(j),W.element.appendChild(K)})();let U=!1;if($.scrollable){let F=()=>{let L=window.scrollY>$.scrollThreshold;if(U!==L){if(U=L,U)W.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else W.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);$.onScroll?.(U)}};window.addEventListener("scroll",F,{passive:!0}),F();let k=W.lifecycle.destroy;W.lifecycle.destroy=()=>{window.removeEventListener("scroll",F),k()}}let _=(F)=>{while(W.element.firstChild)W.element.removeChild(W.element.firstChild);if(["small","medium","large","center"].forEach((k)=>{W.element.classList.remove(`${Q.getClass("top-app-bar")}--${k}`)}),F!=="small")W.element.classList.add(`${Q.getClass("top-app-bar")}--${F}`);if(W.element.classList.toggle(`${Q.getClass("top-app-bar")}--compressible`,$.compressible&&(F==="medium"||F==="large")),F==="medium"||F==="large"){let k=document.createElement("div");k.className=`${Q.getClass("top-app-bar")}-row`,k.appendChild(Z),k.appendChild(K);let L=document.createElement("div");L.className=`${Q.getClass("top-app-bar")}-row`,L.appendChild(j),W.element.appendChild(k),W.element.appendChild(L)}else W.element.appendChild(Z),W.element.appendChild(j),W.element.appendChild(K)};return{...W,setTitle(F){return j.textContent=F,this},getTitle(){return j.textContent||""},addLeadingElement(F){return Z.appendChild(F),this},addTrailingElement(F){return K.appendChild(F),this},setType(F){return $.type=F,_(F),this},setScrollState(F){if(U=F,F)this.element.classList.add(`${Q.getClass("top-app-bar")}--scrolled`);else this.element.classList.remove(`${Q.getClass("top-app-bar")}--scrolled`);return this},getHeadlineElement(){return j},getLeadingContainer(){return Z},getTrailingContainer(){return K}}};var n3=V5;y6();n();s();i();var D6={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 _5=8;var D5=({lifecycle:J})=>($)=>{let Q=null,q=D6.BOTTOM,Z=!1,j=null,K=null,G=300,Y=100,z=!0,W=!0,X=document.createElement("div");X.className=`${$.getClass("tooltip")}__arrow`,$.element.appendChild(X),document.body.appendChild($.element),$.element.setAttribute("aria-hidden","true");let U=()=>{if(!Q)return{top:0,left:0};let O=$.element.getBoundingClientRect(),M=Q.getBoundingClientRect(),P=window.scrollY||window.pageYOffset,R=window.scrollX||window.pageXOffset,y=_5,x=0,A=0,v;switch(q){case D6.TOP:x=M.top+P-O.height-y,A=M.left+R+M.width/2-O.width/2,v="bottom";break;case D6.TOP_START:x=M.top+P-O.height-y,A=M.left+R,v="bottom-start";break;case D6.TOP_END:x=M.top+P-O.height-y,A=M.left+R+M.width-O.width,v="bottom-end";break;case D6.RIGHT:x=M.top+P+M.height/2-O.height/2,A=M.left+R+M.width+y,v="left";break;case D6.RIGHT_START:x=M.top+P,A=M.left+R+M.width+y,v="left-start";break;case D6.RIGHT_END:x=M.top+P+M.height-O.height,A=M.left+R+M.width+y,v="left-end";break;case D6.BOTTOM:x=M.top+P+M.height+y,A=M.left+R+M.width/2-O.width/2,v="top";break;case D6.BOTTOM_START:x=M.top+P+M.height+y,A=M.left+R,v="top-start";break;case D6.BOTTOM_END:x=M.top+P+M.height+y,A=M.left+R+M.width-O.width,v="top-end";break;case D6.LEFT:x=M.top+P+M.height/2-O.height/2,A=M.left+R-O.width-y,v="right";break;case D6.LEFT_START:x=M.top+P,A=M.left+R-O.width-y,v="right-start";break;case D6.LEFT_END:x=M.top+P+M.height-O.height,A=M.left+R-O.width-y,v="right-end";break;default:x=M.top+P+M.height+y,A=M.left+R+M.width/2-O.width/2,v="top"}let r=window.innerWidth;if(A<0)A=0;else if(A+O.width>r)A=r-O.width;return{top:x,left:A,arrowPosition:v}},_=(O)=>{if(W)O.addEventListener("mouseenter",F),O.addEventListener("mouseleave",k);if(z)O.addEventListener("focus",L),O.addEventListener("blur",D)},N=(O)=>{if(O)O.removeEventListener("mouseenter",F),O.removeEventListener("mouseleave",k),O.removeEventListener("focus",L),O.removeEventListener("blur",D)},F=()=>B.show(),k=()=>B.hide(),L=()=>B.show(),D=()=>B.hide(),B={element:$.element,target:Q,lifecycle:J,getClass:$.getClass,setText(O){let M=document.createTextNode(O);while($.element.firstChild!==X)$.element.removeChild($.element.firstChild);if($.element.insertBefore(M,X),Z)this.updatePosition();return this},getText(){let O=$.element.cloneNode(!0),M=O.querySelector(`.${$.getClass("tooltip")}__arrow`);if(M)M.remove();return O.textContent||""},setPosition(O){q=O;let M=$.getClass("tooltip"),P=Object.values(D6).map((R)=>`${M}--${R}`);if($.element.classList.remove(...P),$.element.classList.add(`${M}--${O}`),Z)this.updatePosition();return this},getPosition(){return q},setTarget(O){if(Q)N(Q);if(Q=O,this.target=O,Q.setAttribute("aria-describedby",$.element.id),_(Q),Z)this.updatePosition();return this},show(O=!1){if(j!==null)window.clearTimeout(j),j=null;if(K!==null)window.clearTimeout(K),K=null;let M=()=>{if(!Q)return this;$.element.setAttribute("aria-hidden","false"),$.element.classList.add(`${$.getClass("tooltip")}--visible`),Z=!0,this.updatePosition(),window.addEventListener("resize",H),window.addEventListener("scroll",V)};if(O)M();else j=window.setTimeout(M,G);return this},hide(O=!1){if(K!==null)window.clearTimeout(K),K=null;if(j!==null)window.clearTimeout(j),j=null;let M=()=>{$.element.setAttribute("aria-hidden","true"),$.element.classList.remove(`${$.getClass("tooltip")}--visible`),Z=!1,window.removeEventListener("resize",H),window.removeEventListener("scroll",V)};if(O)M();else K=window.setTimeout(M,Y);return this},isVisible(){return Z},updatePosition(){if(!Q)return this;let{top:O,left:M,arrowPosition:P}=U();if($.element.style.top=`${Math.round(O)}px`,$.element.style.left=`${Math.round(M)}px`,P)X.className=`${$.getClass("tooltip")}__arrow`,X.classList.add(`${$.getClass("tooltip")}__arrow--${P}`);return this},destroy(){if(j!==null)window.clearTimeout(j);if(K!==null)window.clearTimeout(K);if(Q)N(Q),Q.removeAttribute("aria-describedby");if(window.removeEventListener("resize",H),window.removeEventListener("scroll",V),$.element.parentNode)$.element.parentNode.removeChild($.element);J.destroy()}},H=()=>{B.updatePosition()},V=()=>{B.updatePosition()};return B};c();var $J={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"},JJ={DEFAULT:"default",RICH:"rich",PLAIN:"plain"},O5={SHOW:"show",HIDE:"hide",ENTER:"enter",LEAVE:"leave"},u6={POSITION:$J.BOTTOM,VARIANT:JJ.DEFAULT,VISIBLE:!1,SHOW_DELAY:300,HIDE_DELAY:100,OFFSET:8,ARROW_SIZE:8,SHOW_ON_FOCUS:!0,SHOW_ON_HOVER:!0,RICH:!1},P5={ROOT:"tooltip",CONTAINER:"tooltip-container",ARROW:"tooltip-arrow",CONTENT:"tooltip-content",VISIBLE:"tooltip--visible",HIDDEN:"tooltip--hidden",DEFAULT:"tooltip--default",RICH:"tooltip--rich",PLAIN:"tooltip--plain",POSITION_PREFIX:"tooltip--"};var e3={position:u6.POSITION,variant:u6.VARIANT,visible:u6.VISIBLE,showDelay:u6.SHOW_DELAY,hideDelay:u6.HIDE_DELAY,showOnFocus:u6.SHOW_ON_FOCUS,showOnHover:u6.SHOW_ON_HOVER,rich:u6.RICH},R5=(J={})=>C(e3,J,"tooltip"),y5=(J)=>{let $={role:"tooltip","aria-hidden":"true"};if(J.zIndex!==void 0)$.style=`z-index: ${J.zIndex};`;return f(J,{tag:"div",attributes:$,className:[J.class,`${J.prefix}-tooltip--${J.position}`,`${J.prefix}-tooltip--${J.variant}`],text:J.text||""})},A5=(J)=>({lifecycle:{destroy:()=>J.lifecycle.destroy()}});var $Z=()=>{return`${u}-tooltip-${Math.random().toString(36).substring(2,9)}`},JZ=(J={})=>{let $=R5(J);try{let Q=I(T,S(y5($)),b(),(q)=>D5(A5(q))(q))($);if(Q.element.id=$Z(),$.target)Q.setTarget($.target);if($.text)Q.setText($.text);if($.visible)Q.show(!0);return Q}catch(Q){throw console.error("Tooltip creation error:",Q),new Error(`Failed to create tooltip: ${Q.message}`)}},w5=JZ;c9();L9();s();i();var QZ=(J)=>($)=>{if(!$.element)return console.warn("Cannot initialize list renderer: missing element"),$;let Q=J.items||[],q=J.renderItem,Z=document.createElement("div");Z.className="mtrl-list-content",Z.setAttribute("role","list"),$.element.appendChild(Z);function j(z,W){let X=document.createElement("div");X.className=Z6.ITEM,X.setAttribute("role","listitem");let U=document.createElement("div");U.className="mtrl-list-item-content";let _=document.createElement("div");return _.className="mtrl-list-item-text",_.textContent=z.text||z.title||z.headline||z.name||z.id||String(z),U.appendChild(_),X.appendChild(U),X}let K=()=>{if(Z.innerHTML="",!Q||Q.length===0){Z.innerHTML='<div class="mtrl-list-empty">No items</div>';return}let z=document.createDocumentFragment();Q.forEach((W,X)=>{if(W==null)return;let U=q?q(W,X):j(W,X);if(!U)return;if(!U.classList.contains(Z6.ITEM))U.classList.add(Z6.ITEM);if(!U.hasAttribute("role"))U.setAttribute("role","listitem");let _=W?.id||String(X);if(!U.hasAttribute("data-id"))U.setAttribute("data-id",_);z.appendChild(U)}),Z.appendChild(z),$.emit?.(X9.LOAD,{items:Q,loading:!1,hasNext:!1,hasPrev:!1,component:$}),console.log(`\uD83D\uDCCB Rendered ${Q.length} items directly`)},G=(z,W="start",X=!1)=>{let U=Z.querySelector(`[data-id="${z}"]`);if(U)U.scrollIntoView({behavior:X?"smooth":"auto",block:W==="center"?"center":W==="end"?"end":"start"})},Y=(z,W="start",X=!1)=>{if(z<0||z>=Q.length)return;let U=Z.children[z];if(U)U.scrollIntoView({behavior:X?"smooth":"auto",block:W==="center"?"center":W==="end"?"end":"start"})};if(K(),$.lifecycle?.destroy){let z=$.lifecycle.destroy;$.lifecycle.destroy=()=>{Z.innerHTML="",z()}}return{...$,list:{getItems:()=>Q,getAllItems:()=>Q,getVisibleItems:()=>Q,refresh:K,scrollToItem:G,scrollToIndex:Y,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:(z,W,X)=>{return G(z,W,X),Promise.resolve()},onCollectionChange:()=>()=>{},onPageChange:()=>()=>{},getCurrentPage:()=>1,getPageSize:()=>Q.length,getCollection:()=>null,isApiMode:()=>!1,isLoading:()=>!1,hasNextPage:()=>!1}}},QJ=QZ;b9();q7();var qZ=(J)=>($)=>{if(!$.element||!J.trackSelection)return{...$,getSelectedItems:()=>[],getSelectedItemIds:()=>[],isItemSelected:()=>!1,selectItem:()=>$,deselectItem:()=>$,clearSelection:()=>$,setSelection:()=>$};let Q=new Set;if(Array.isArray(J.initialSelection))J.initialSelection.forEach((K)=>Q.add(String(K)));if(Array.isArray(J.items))J.items.forEach((K,G)=>{if(K?.selected){let Y=K.id||String(G);Q.add(String(Y))}});let q=()=>{($.element?.querySelectorAll("[data-id]")||[]).forEach((G)=>{let Y=G.getAttribute("data-id"),z=Q.has(Y);if(z&&!c6(G,Z6.SELECTED))p(G,Z6.SELECTED);else if(!z&&c6(G,Z6.SELECTED))K6(G,Z6.SELECTED)})},Z=(K)=>{let G=K.target.closest("[data-id]");if(!G)return;let Y=G.getAttribute("data-id");if(!Y)return;let z=$.list?.getItems()||[],W=z.find((U)=>String(U?.id)===Y);if(!W){let U=parseInt(Y,10);if(!isNaN(U)&&U>=0&&U<z.length)W=z[U]}if(!W){console.warn(`Item not found for ID: ${Y}`);return}let X={item:W,element:G,originalEvent:K,component:$,preventDefault:()=>{X.defaultPrevented=!0},defaultPrevented:!1};if($.emit?.(X9.SELECT,X),X.defaultPrevented)return;if(J.multiSelect)if(Q.has(Y))Q.delete(Y),K6(G,Z6.SELECTED);else Q.add(Y),p(G,Z6.SELECTED);else{let U=c6(G,Z6.SELECTED);if($.element.querySelectorAll(`.${u}-${Z6.SELECTED}`).forEach((N)=>K6(N,Z6.SELECTED)),Q.clear(),!U)Q.add(Y),p(G,Z6.SELECTED)}},j=(K,G)=>{let Y=String(K);if(G)Q.add(Y);else Q.delete(Y);let z=$.element.querySelector(`[data-id="${Y}"]`);if(z){if(G&&!c6(z,Z6.SELECTED))p(z,Z6.SELECTED);else if(!G&&c6(z,Z6.SELECTED))K6(z,Z6.SELECTED)}};if($.element.addEventListener("click",Z),setTimeout(q,10),$.lifecycle?.destroy){let K=$.lifecycle.destroy;$.lifecycle.destroy=()=>{$.element.removeEventListener("click",Z),K()}}return{...$,getSelectedItems:()=>{return($.list?.getItems()||[]).filter((G,Y)=>{let z=G?.id||String(Y);return Q.has(String(z))})},getSelectedItemIds:()=>Array.from(Q),isItemSelected:(K)=>Q.has(String(K)),selectItem:(K)=>{return j(K,!0),$},deselectItem:(K)=>{return j(K,!1),$},clearSelection:()=>{if(Q.size>0)Q.clear(),$.element.querySelectorAll(`.${u}-${Z6.SELECTED}`).forEach((K)=>K6(K,Z6.SELECTED));return $},setSelection:(K)=>{if(Q.clear(),Array.isArray(K))K.forEach((G)=>Q.add(String(G)));return q(),$}}},qJ=qZ;var x5=({list:J,selection:$,events:Q,lifecycle:q,config:Z})=>(j)=>({...j,element:j.element,refresh:async()=>{return J.refresh(),j},getAllItems:()=>J.getAllItems(),getVisibleItems:()=>J.getVisibleItems(),scrollToItem:(K,G,Y)=>{let z=Y!==void 0?Y:Z?.animate||!1;return J.scrollToItem(K,G,z),j},scrollToIndex:async(K,G,Y)=>{let z=Y!==void 0?Y:Z?.animate||!1;return J.scrollToIndex(K,G,z),j},isLoading:()=>J.isLoading(),hasNextPage:()=>J.hasNextPage(),getSelectedItems:()=>$.getSelectedItems(),getSelectedItemIds:()=>$.getSelectedItemIds(),isItemSelected:(K)=>$.isItemSelected(K),selectItem:(K)=>{return $.selectItem(K),j},deselectItem:(K)=>{return $.deselectItem(K),j},clearSelection:()=>{return $.clearSelection(),j},setSelection:(K)=>{return $.setSelection(K),j},on:(K,G)=>{return Q.on(K,G),j},off:(K,G)=>{return Q.off(K,G),j},destroy:()=>{q.destroy()}});c();var ZZ={items:[],trackSelection:!0,multiSelect:!1,animate:!1},T5=(J={})=>{if(!Array.isArray(J.items)&&!J.renderItem)throw new Error("List requires either items array or renderItem function");if(Array.isArray(J.items)&&J.items.length>0&&!J.renderItem)J.renderItem=($)=>{let Q=document.createElement("div");return Q.className="mtrl-list-item",Q.textContent=$.text||$.title||$.headline||$.name||$.id||String($),Q};return C(ZZ,J,"list")},I5=(J)=>{let $={role:"list",tabindex:"0"};if(J.ariaLabel)$["aria-label"]=J.ariaLabel;return f(J,{tag:"div",attrs:$,className:[Z6.CONTAINER,J.class],forwardEvents:{scroll:!0,keydown:!0}})},S5=(J,$)=>({list:{refresh:J.list?.refresh,getItems:J.list?.getItems,getAllItems:J.list?.getAllItems,getVisibleItems:J.list?.getVisibleItems,scrollToItem:J.list?.scrollToItem,scrollToIndex:J.list?.scrollToIndex,isLoading:()=>!1,hasNextPage:()=>!1},selection:{getSelectedItems:J.getSelectedItems,getSelectedItemIds:J.getSelectedItemIds,isItemSelected:J.isItemSelected,selectItem:J.selectItem,deselectItem:J.deselectItem,clearSelection:J.clearSelection,setSelection:J.setSelection},events:{on:J.on,off:J.off},lifecycle:{destroy:J.lifecycle?.destroy},config:{animate:$?.animate}});var jZ=(J={})=>{try{let $=T5(J);return console.log(`\uD83D\uDCCB Creating list with ${$.items?.length||0} items`),I(T,h(),S(I5($)),QJ($),qJ($),b(),(q)=>x5(S5(q,$))(q))($)}catch($){throw console.error("List creation error:",$),new Error(`Failed to create list: ${$.message}`)}},b5=jZ;var v5=(J={})=>{return{rail:null,drawer:null,activeSection:J.activeSection||null,activeSubsection:J.activeSubsection||null,items:J.items||{},mouseInDrawer:!1,mouseInRail:!1,hoverTimer:null,closeTimer:null,processingChange:!1,isMobile:!1,overlayElement:null,closeButtonElement:null,resizeObserver:null,outsideClickHandler:null,outsideClickHandlerSet:!1}},ZJ=(J={})=>{return{animateDrawer:J.animateDrawer!==!1,showLabelsOnRail:J.showLabelsOnRail!==!1,hideDrawerOnClick:J.hideDrawerOnClick||!1,expanded:J.expanded===!0,hoverDelay:J.hoverDelay||200,closeDelay:J.closeDelay||100,railOptions:J.railOptions||{},drawerOptions:J.drawerOptions||{}}},jJ=(J={})=>{return{breakpoint:J.breakpoint||960,lockBodyScroll:J.lockBodyScroll!==!1,hideOnClickOutside:J.hideOnClickOutside!==!1,enableSwipeGestures:J.enableSwipeGestures!==!1,optimizeForTouch:J.optimizeForTouch!==!1,overlayClass:J.overlayClass||"mtrl-nav-overlay",closeButtonClass:J.closeButtonClass||"mtrl-nav-close-btn",bodyLockClass:J.bodyLockClass||"mtrl-body-drawer-open"}};a9();var C5=(J,$,Q,q)=>{if(!J.drawer||!$||!J.items[$])return;let j=J.items[$].items||[];if(j.length===0){q();return}let K=J.drawer.getAllItems();if(K?.length>0)K.forEach((G)=>{J.drawer.removeItem(G.config.id)});j.forEach((G)=>{J.drawer.addItem(G)}),Q()},E5=(J,$)=>{let Q=Object.keys(J.items||{}).map((Z)=>({id:Z,label:J.items[Z]?.label||Z,icon:J.items[Z]?.icon||"",active:Z===J.activeSection})),q=G7({variant:"rail",position:"left",showLabels:$.showLabelsOnRail,items:Q,...$.railOptions});return document.body.appendChild(q.element),q},h5=(J,$)=>{let Q=G7({variant:"drawer",position:"left",items:[],...$.drawerOptions});if(document.body.appendChild(Q.element),Q.element.dataset.id="drawer",!$.expanded)Q.element.classList.add("mtrl-nav--hidden"),Q.element.setAttribute("aria-hidden","true");return Q},u5=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.remove("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","false"),J.isMobile){if(J.overlayElement)J.overlayElement.classList.add("active"),J.overlayElement.setAttribute("aria-hidden","false");if($.lockBodyScroll)document.body.classList.add($.bodyLockClass);if(J.closeButtonElement)J.closeButtonElement.style.display="flex"}},f5=(J,$)=>{if(!J.drawer)return;if(J.drawer.element.classList.add("mtrl-nav--hidden"),J.drawer.element.setAttribute("aria-hidden","true"),J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if($.lockBodyScroll)document.body.classList.remove($.bodyLockClass)},g5=(J)=>{if(!J.drawer)return!1;return!J.drawer.element.classList.contains("mtrl-nav--hidden")},d5=(J,$,Q,q,Z)=>{let j=J.isMobile;if(J.isMobile=window.innerWidth<=$.breakpoint||BJ(),j!==J.isMobile){if(J.isMobile)Q();else q();if(Z.onViewChange)Z.onViewChange({mobile:J.isMobile,previousMobile:j,width:window.innerWidth})}},r5=(J)=>{if(J.overlayElement&&J.overlayElement.parentNode)J.overlayElement.parentNode.removeChild(J.overlayElement),J.overlayElement=null;if(J.rail)J.rail.destroy(),J.rail=null;if(J.drawer)J.drawer.destroy(),J.drawer=null;J.activeSection=null,J.activeSubsection=null,J.mouseInDrawer=!1,J.mouseInRail=!1,J.processingChange=!1,J.isMobile=!1},l5=(J,$,Q,q)=>{if(!$||!J.items[$])return;if(J.activeSection===$&&J.activeSubsection===Q)return;if(J.activeSection=$,J.rail)J.rail.setActive($,q);if(Q&&J.drawer)J.activeSubsection=Q,J.drawer.setActive(Q,q)};var p5=(J,$,Q,q,Z,j)=>{let K=J.rail;if(!K)return;K.on("change",(G)=>{let Y=G?.id;if(!Y||J.processingChange)return;let z=G?.source==="userAction";if(J.processingChange=!0,J.activeSection=Y,Q(Y),j.onSectionChange&&z)j.onSectionChange(Y,{source:z?"userClick":"programmatic"});setTimeout(()=>{J.processingChange=!1},50)}),K.on("mouseover",(G)=>{let Y=G?.id;if(J.mouseInRail=!0,clearTimeout(J.hoverTimer),J.hoverTimer=null,Y)if(J.items[Y]?.items?.length>0)J.hoverTimer=window.setTimeout(()=>{Q(Y)},$.hoverDelay);else J.closeTimer=window.setTimeout(()=>{if(J.mouseInRail&&!J.mouseInDrawer)Z()},$.hoverDelay)}),K.on("mouseenter",()=>{J.mouseInRail=!0,clearTimeout(J.closeTimer),J.closeTimer=null}),K.on("mouseleave",()=>{if(J.mouseInRail=!1,clearTimeout(J.hoverTimer),J.hoverTimer=null,!J.mouseInDrawer)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInRail&&!J.mouseInDrawer)Z()},$.closeDelay)})},s5=(J,$,Q,q)=>{let Z=J.drawer;if(!Z)return;if(typeof Z.on==="function")Z.on("change",(j)=>{let K=j.id;if(J.activeSubsection=K,$.hideDrawerOnClick)Q();if(q.onItemSelect)q.onItemSelect(j)}),Z.on("mouseenter",()=>{J.mouseInDrawer=!0,clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null}),Z.on("mouseleave",()=>{if(J.mouseInDrawer=!1,!J.mouseInRail)J.closeTimer=window.setTimeout(()=>{if(!J.mouseInDrawer&&!J.mouseInRail)Q()},$.closeDelay)})},m5=(J,$)=>{if(window.ResizeObserver)J.resizeObserver=new ResizeObserver(()=>{$()}),J.resizeObserver.observe(document.body);else window.addEventListener("resize",$);window.addEventListener("orientationchange",()=>{setTimeout($,100)})},a5=(J,$)=>{if(J.resizeObserver)J.resizeObserver.disconnect(),J.resizeObserver=null;else window.removeEventListener("resize",$);if(window.removeEventListener("orientationchange",$),J.outsideClickHandler){let Q="ontouchend"in window?"touchend":"click";document.removeEventListener(Q,J.outsideClickHandler)}clearTimeout(J.hoverTimer),clearTimeout(J.closeTimer),J.hoverTimer=null,J.closeTimer=null};a9();var KZ=(J,$,Q)=>{if(J.overlayElement)return J.overlayElement;return J.overlayElement=document.createElement("div"),J.overlayElement.className=$.overlayClass,J.overlayElement.setAttribute("aria-hidden","true"),document.body.appendChild(J.overlayElement),J.overlayElement.addEventListener("click",(q)=>{if(q.target===J.overlayElement)Q()}),J.overlayElement},GZ=(J,$,Q)=>{if(!J.drawer||J.closeButtonElement)return null;if(J.closeButtonElement=document.createElement("button"),J.closeButtonElement.className=$.closeButtonClass,J.closeButtonElement.setAttribute("aria-label","Close navigation"),J.closeButtonElement.innerHTML=`
58
58
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
59
59
  <line x1="18" y1="6" x2="6" y2="18"></line>
60
60
  <line x1="6" y1="6" x2="18" y2="18"></line>
61
61
  </svg>
62
- `,J.closeButtonElement.addEventListener("click",()=>{Q()}),u6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${E$.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${E$.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},W9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},h2=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;if(WK(J,$,Q),YK(J,$,Q),UK(J,$,Q,Z),$.enableSwipeGestures&&u6())XK(J,Q,Z);Q()},UK=(J,$,Q,Z)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let q=u6()?"touchend":"click",j=(G)=>{if(!J.isMobile||!Z())return;let z=p6(G).target;if(J.drawer.element.contains(z)||J.rail.element.contains(z))return;Q()};J.outsideClickHandler=j,document.addEventListener(q,j,u6()?{passive:!0}:!1)},XK=(J,$,Q,Z)=>{let{drawer:q,rail:j}=J;if(!q||!j)return;let G=0,K=0;j.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),j.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||Q()||!Z)return;let W=z.touches[0],Y=W.clientX-G,U=W.clientY-K;if(Math.abs(Y)>Math.abs(U)&&Y>W9.SWIPE_THRESHOLD)Z()},{passive:!0}),q.element.addEventListener("touchstart",(z)=>{let W=z.touches[0];G=W.clientX,K=W.clientY},{passive:!0}),q.element.addEventListener("touchmove",(z)=>{if(!J.isMobile||!Q())return;let Y=z.touches[0].clientX-G;if(Y<0){if(q.element.style.transform=`translateX(${Y/2}px)`,Y<-W9.SWIPE_THRESHOLD)$()}},{passive:!0}),q.element.addEventListener("touchend",()=>{if(q.element.style.transform)q.element.style.transition="transform 0.2s ease",q.element.style.transform="",setTimeout(()=>{q.element.style.transition=""},200)},{passive:!0})},u2=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var BK=(J={})=>{let $=O2(J),Q=ZJ(J),Z=qJ(J),q={initialize:()=>q,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>q,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>w2($,Z),G=()=>x2($,Z),K=()=>y2($),z=(B)=>{P2($,B,j,G)},W=()=>{h2($,Z,G,K)},Y=()=>{T2($,Z,W,()=>u2($,Z),q)},U=(B,M,k)=>{S2($,B,M,k)},X=()=>{if($.rail=R2($,Q),$.drawer=A2($,Q),b2($,Q,z,j,G,q),v2($,Q,G,q),C2($,Y),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(z(J.activeSection),J.expanded===!0)j();else G()}return Y(),q},_=()=>{E2($,Y),I2($)},H=(B)=>{return Object.assign(J,B),Object.assign(Q,ZJ({...J,...B})),Object.assign(Z,qJ({...J,...B})),q};return q.initialize=X,q.cleanup=_,q.navigateTo=U,q.showDrawer=j,q.hideDrawer=G,q.isDrawerVisible=K,q.configure=H,q.setProcessingChange=(B)=>{$.processingChange=B},q.isProcessingChange=()=>$.processingChange,q.isMobile=()=>$.isMobile,q.checkMobileState=Y,q},FK=BK;z8();m6();J6();c();o();var f2=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((G)=>G.id===J.value);if(j)Q=j.text}let Z='<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>',q=A$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:Z,readonly:!0});return q.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:q.element,textfield:q}},jJ=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=jJ($.submenu);return Q})},g2=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((G)=>G.id===J.value);let Z=jJ(Q.options),q=H$({opener:$.textfield,items:Z,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});q.on("select",(G)=>{if(!G.item||G.item.hasSubmenu)return;let K=G.item.data;if(!K||!("id"in K)||!("text"in K)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id),$.emit)$.emit("change",{select:$,value:K.id,text:K.text,option:K,originalEvent:G.originalEvent,preventDefault:()=>{G.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(G)=>{if($.textfield.input.disabled)return;if((G.key==="Enter"||G.key===" "||G.key==="ArrowDown")&&!q.isOpen()){if(G.preventDefault(),q.open(G,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:G,preventDefault:()=>{},defaultPrevented:!1})}else if(G.key==="Escape"&&q.isOpen())G.preventDefault(),q.close(G)}),q.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let G=J.prefix||"mtrl";if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}),q.on("close",(G)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let K=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.remove(`${K}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:G.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;q.setSelected(Q.selectedOption.id)};return q.on("open",()=>{setTimeout(j,50)}),{...$,menu:q,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(G)=>{let K=Q.options.find((z)=>("id"in z)&&z.id===G);if(K&&"text"in K)Q.selectedOption=K,$.textfield.setValue(K.text),q.setSelected(K.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(G)=>{Q.options=G;let K=jJ(G);if(q.setItems(K),Q.selectedOption&&!G.find((z)=>("id"in z)&&z.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(G,K="mouse")=>{return q.open(G,K),$},close:(G)=>{return q.close(G),$},isOpen:()=>q.isOpen()}}};var d2=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,Z){if(J.events?.on)J.events.on(Q,Z);else if($.on)$.on(Q,Z);return this},off(Q,Z){if(J.events?.off)J.events.off(Q,Z);else if($.off)$.off(Q,Z);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});t();var HK={options:[],variant:E9.VARIANT,placement:E9.PLACEMENT},l2=(J={options:[]})=>u(HK,J,"select"),r2=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var kK=(J)=>{try{let $=l2(J),Q=b(S,d(),f2($),g2($),C(),(Z)=>d2(r2(Z))(Z))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},p2=kK;_7();_7();Q$();H8();Q8();T8();var s2={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},m2={DAY:"day",MONTH:"month",YEAR:"year"},a2={SINGLE:"single",RANGE:"range"},c2=["S","M","T","W","T","F","S"],i2=["January","February","March","April","May","June","July","August","September","October","November","December"],o2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],t2="MM/DD/YYYY";var n2={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},e2={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},$3={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var J3={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},Q3="Yes",Z3="No";var q3={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},j3={SMALL:"small",DEFAULT:"default",LARGE:"large"},K3={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};m6();var Tx=V7,Ix=V7,Sx=V7;export{K6 as withVariant,l7 as withTrack,yJ as withThrottle,X9 as withTextLabel,d7 as withTextInput,Y9 as withText,S3 as withTapGesture,E1 as withTabsManagement,Oq as withSwipeable,v3 as withSwipeGesture,y1 as withSupportingText,PJ as withStyle,f7 as withSize,h1 as withScrollable,S6 as withRipple,g7 as withPosition,E3 as withPanGesture,C3 as withLongPressGesture,Lq as withLoading,C as withLifecycle,u9 as withInput,f1 as withIndicator,U9 as withIcon,fJ as withGestures,Dq as withExpandable,d as withEvents,AJ as withEnhancedEvents,v8 as withElevation,h as withElement,u1 as withDivider,G6 as withDisabled,IJ as withDebounce,f9 as withCheckable,I8 as withAPI,o3 as when,b1 as updateTabPanels,V4 as updateCanvasDimensions,Hq as transforms,W3 as transform,YJ as toggleClass,G7 as throttle,pj as setupResponsiveBehavior,v1 as setupKeyboardNavigation,aJ as setGlobalDefaults,mJ as setComponentDefaults,GJ as setAttributes,j6 as removeClass,U3 as removeAttributes,B8 as processSchema,l9 as processClassNames,b as pipe,u$ as once,t7 as observeCanvasResize,p6 as normalizeEvent,e6 as normalizeClasses,Qq as loggingMiddleware,Ix as jsxs,Sx as jsxDEV,Tx as jsx,t3 as joinClasses,a6 as isObject,f0 as isJsxSchema,x6 as isComponent,N4 as initializeCanvasWithRetry,u6 as hasTouchSupport,M6 as hasLifecycle,_6 as hasEmit,R6 as hasClass,V7 as h,B3 as getModifierClass,p9 as getLayoutType,w9 as getInheritedBackground,F3 as getElementClass,s7 as getComponentDefaults,X3 as getComponentClass,W8 as flattenLayout,B4 as fillRoundedRectLR,QX as fillRoundedRect,w8 as easeOutCubic,Zq as deriveFiltered,z7 as debounce,JK as createTopAppBar,M2 as createTooltip,j2 as createTimePicker,A$ as createTextfield,dj as createTabsState,sj as createTabs,C1 as createTabIndicator,S7 as createTab,PZ as createSwitch,_4 as createStyledCanvas,Jq as createStore,h$ as createStateEventManager,MZ as createSnackbar,qZ as createSlider,cQ as createSheet,p2 as createSelect,F1 as createSegmentedButton,B1 as createSegment,bQ as createSearch,M3 as createSVGElement,N8 as createRouteAdapter,U4 as createRoundedRectPath,LQ as createRadios,G8 as createProgress,FK as createNavigationSystem,w7 as createNavigation,H$ as createMenu,R8 as createListManager,D2 as createList,qq as createLifecycle,J9 as createLayoutResult,s9 as createLayout,Gq as createJsxLayout,r7 as createGestureManager,s8 as createFab,m8 as createExtendedFab,a3 as createEventManager,f6 as createEmitter,v as createElement,c9 as createDivider,jq as createDisabled,m5 as createDialog,x5 as createDatePicker,r9 as createComponentInstance,Y3 as createComponent,k8 as createCollection,hq as createChips,Y$ as createChip,e4 as createCheckbox,m4 as createCarousel,D7 as createCardMedia,z$ as createCardHeader,G$ as createCardContent,L7 as createCardActions,d4 as createCard,x8 as createCanvasThemeObserver,M4 as createCanvasContext,Q9 as createButton,m3 as createBottomAppBar,M8 as createBaseAdapter,S as createBase,j7 as createBadge,z3 as compose,X4 as clipRoundedRect,cJ as clearGlobalDefaults,F4 as clearCanvas,u0 as cleanupLayoutClasses,H3 as classNames,X0 as byString,U8 as applyLayoutItemClasses,Y8 as applyLayoutClasses,rj as addScrollIndicators,g as addClass,n1 as TOP_APP_BAR_TYPES,K2 as TOP_APP_BAR_STATES,D9 as TOP_APP_BAR_DEFAULTS,G2 as TOP_APP_BAR_CLASSES,$J as TOOLTIP_VARIANTS,e1 as TOOLTIP_POSITIONS,X2 as TOOLTIP_EVENTS,r6 as TOOLTIP_DEFAULTS,B2 as TOOLTIP_CLASSES,v7 as TIME_PICKER_TYPE,w$ as TIME_PICKER_ORIENTATION,Q7 as TIME_PERIOD,J7 as TIME_FORMAT,C7 as TIMEPICKER_Z_INDEX,iZ as TIMEPICKER_VALUES,i1 as TIMEPICKER_TYPES,Q6 as TIMEPICKER_SELECTORS,cZ as TIMEPICKER_PERIODS,o1 as TIMEPICKER_ORIENTATIONS,l6 as TIMEPICKER_ICONS,t1 as TIMEPICKER_FORMATS,L6 as TIMEPICKER_EVENTS,j9 as TIMEPICKER_DIAL,t6 as TIMEPICKER_DEFAULTS,oZ as TIMEPICKER_CLASSES,R$ as TEXTFIELD_VARIANTS,c1 as TEXTFIELD_TYPES,dZ as TEXTFIELD_STATES,lZ as TEXTFIELD_EVENTS,rZ as TEXTFIELD_DENSITY,b7 as TEXTFIELD_DEFAULTS,pZ as TEXTFIELD_CLASSES,P$ as TAB_VARIANTS,I7 as TAB_STATES,I1 as TAB_INDICATOR_WIDTH_STRATEGIES,yZ as TAB_EVENTS,IZ as TAB_CLASSES,S1 as TABS_EVENTS,v9 as TABS_DEFAULTS,TZ as TABS_CLASSES,N$ as SelectionMode,RZ as SWITCH_STATES,T1 as SWITCH_LABEL_POSITIONS,AZ as SWITCH_EVENTS,wZ as SWITCH_DEFAULTS,xZ as SWITCH_CLASSES,WJ as STATES,x1 as SNACKBAR_VARIANTS,GZ as SNACKBAR_STATES,q9 as SNACKBAR_POSITIONS,zZ as SNACKBAR_EVENTS,e9 as SNACKBAR_DEFAULTS,WZ as SNACKBAR_CLASSES,D6 as SLIDER_SIZES,L$ as SLIDER_POSITIONS,H6 as SLIDER_EVENTS,V6 as SLIDER_DEFAULTS,Z9 as SLIDER_COLORS,iQ as SLIDER_CLASSES,b9 as SHEET_VARIANTS,n9 as SHEET_POSITIONS,rQ as SHEET_GESTURE,dQ as SHEET_EVENTS,_1 as SHEET_ELEVATION,L9 as SHEET_DEFAULTS,pQ as SHEET_CLASSES,lQ as SHEET_ANIMATION,E7 as SELECT_VARIANTS,h7 as SELECT_PLACEMENT,S$ as SELECT_INTERACTION,v$ as SELECT_ICONS,b$ as SELECT_EVENTS,E9 as SELECT_DEFAULTS,C$ as SELECT_CLASSES,Y1 as SEGMENTED_BUTTON_MODES,EQ as SEGMENTED_BUTTON_ICONS,vQ as SEGMENTED_BUTTON_EVENTS,U1 as SEGMENTED_BUTTON_DENSITY,o9 as SEGMENTED_BUTTON_DEFAULTS,hQ as SEGMENTED_BUTTON_CLASSES,x7 as SEARCH_VARIANTS,wQ as SEARCH_STATES,y7 as SEARCH_ICONS,xQ as SEARCH_EVENTS,o6 as SEARCH_DEFAULTS,yQ as SEARCH_CLASSES,q1 as RADIO_VARIANTS,DQ as RADIO_STATES,K1 as RADIO_SIZES,j1 as RADIO_LABEL_POSITIONS,OQ as RADIO_EVENTS,Z1 as RADIO_DIRECTIONS,PQ as RADIO_DEFAULTS,RQ as RADIO_CLASSES,B9 as PROGRESS_VARIANTS,d6 as PROGRESS_THICKNESS,v6 as PROGRESS_SHAPES,s6 as PROGRESS_MEASUREMENTS,Y7 as PROGRESS_EVENTS,g6 as PROGRESS_DEFAULTS,W6 as PROGRESS_CLASSES,f as PREFIX,y6 as OPERATORS,e8 as NAV_VARIANTS,$1 as NAV_POSITIONS,YQ as NAV_ITEM_STATES,k$ as NAV_EVENTS,_9 as NAV_DEFAULTS,n as NAV_CLASSES,J1 as NAV_BEHAVIORS,o2 as MONTH_NAMES_SHORT,i2 as MONTH_NAMES,n8 as MENU_POSITION,qQ as MENU_ITEM_TYPES,ZQ as MENU_INTERACTION_TYPES,jQ as MENU_EVENTS,c6 as MENU_DEFAULTS,F$ as MENU_CLASSES,y$ as LIST_TYPES,T$ as LIST_SELECTION_MODES,I$ as LIST_SCROLL_POSITIONS,P9 as LIST_EVENTS,G9 as LIST_DEFAULTS,$6 as LIST_CLASSES,g0 as Fragment,q3 as FAB_VARIANTS,j3 as FAB_SIZES,K3 as FAB_POSITIONS,qX as EASING_FUNCTIONS,_$ as Density,n2 as DIALOG_SIZES,$3 as DIALOG_FOOTER_ALIGNMENTS,J3 as DIALOG_BUTTON_VARIANTS,e2 as DIALOG_ANIMATIONS,m9 as DEFAULT_RIPPLE_CONFIG,t2 as DEFAULT_DATE_FORMAT,Q3 as DEFAULT_CONFIRM_BUTTON_TEXT,Z3 as DEFAULT_CANCEL_BUTTON_TEXT,c2 as DAY_NAMES,m2 as DATEPICKER_VIEWS,s2 as DATEPICKER_VARIANTS,a2 as DATEPICKER_SELECTION_MODES,Mq as CleanupManager,zJ as COMPONENTS,zq as COLLECTION_OPERATORS,Y6 as COLLECTION_EVENTS,K5 as CHIP_VARIANTS,G5 as CHIP_EVENTS,M9 as CHIPS_EVENTS,h8 as CHECKBOX_VARIANTS,$5 as CHECKBOX_STATES,u8 as CHECKBOX_LABEL_POSITION,J5 as CHECKBOX_CLASSES,W$ as CAROUSEL_TRANSITIONS,l4 as CAROUSEL_SCROLL_BEHAVIORS,k9 as CAROUSEL_LAYOUTS,Rq as CAROUSEL_ITEM_SIZES,a9 as CAROUSEL_EVENTS,F6 as CAROUSEL_DEFAULTS,S8 as CARD_WIDTHS,I9 as CARD_VARIANTS,b4 as CARD_MEDIA_POSITION,O7 as CARD_ELEVATIONS,I4 as CARD_CORNER_RADIUS,v4 as CARD_CLASSES,b8 as CARD_ASPECT_RATIOS,S4 as CARD_ACTION_ALIGNMENT,Z$ as BUTTON_VARIANTS,K$ as BUTTON_TYPES,q$ as BUTTON_SIZES,j$ as BUTTON_SHAPES,P4 as BUTTON_CLASSES,m7 as BADGE_VARIANTS,c7 as BADGE_POSITIONS,g9 as BADGE_MAX_CHARACTERS,a7 as BADGE_COLORS,kq as AnimationFrameManager,H4 as ANIMATION_DURATIONS};
62
+ `,J.closeButtonElement.addEventListener("click",()=>{Q()}),b6()&&$.optimizeForTouch)J.closeButtonElement.style.minWidth=`${F$.COMFORTABLE}px`,J.closeButtonElement.style.minHeight=`${F$.COMFORTABLE}px`,J.closeButtonElement.addEventListener("touchstart",()=>{J.closeButtonElement.classList.add("active")},{passive:!0}),J.closeButtonElement.addEventListener("touchend",()=>{setTimeout(()=>{J.closeButtonElement.classList.remove("active")},$9.FEEDBACK_DURATION)},{passive:!0});return J.drawer.element.appendChild(J.closeButtonElement),J.closeButtonElement},i5=(J,$,Q,q)=>{let{drawer:Z,rail:j}=J;if(!Z||!j)return;if(KZ(J,$,Q),GZ(J,$,Q),YZ(J,$,Q,q),$.enableSwipeGestures&&b6())zZ(J,Q,q);Q()},YZ=(J,$,Q,q)=>{if(!$.hideOnClickOutside)return;if(J.outsideClickHandlerSet)return;J.outsideClickHandlerSet=!0;let Z=b6()?"touchend":"click",j=(K)=>{if(!J.isMobile||!q())return;let Y=f6(K).target;if(J.drawer.element.contains(Y)||J.rail.element.contains(Y))return;Q()};J.outsideClickHandler=j,document.addEventListener(Z,j,b6()?{passive:!0}:!1)},zZ=(J,$,Q,q)=>{let{drawer:Z,rail:j}=J;if(!Z||!j)return;let K=0,G=0;j.element.addEventListener("touchstart",(Y)=>{let z=Y.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),j.element.addEventListener("touchmove",(Y)=>{if(!J.isMobile||Q()||!q)return;let z=Y.touches[0],W=z.clientX-K,X=z.clientY-G;if(Math.abs(W)>Math.abs(X)&&W>$9.SWIPE_THRESHOLD)q()},{passive:!0}),Z.element.addEventListener("touchstart",(Y)=>{let z=Y.touches[0];K=z.clientX,G=z.clientY},{passive:!0}),Z.element.addEventListener("touchmove",(Y)=>{if(!J.isMobile||!Q())return;let W=Y.touches[0].clientX-K;if(W<0){if(Z.element.style.transform=`translateX(${W/2}px)`,W<-$9.SWIPE_THRESHOLD)$()}},{passive:!0}),Z.element.addEventListener("touchend",()=>{if(Z.element.style.transform)Z.element.style.transition="transform 0.2s ease",Z.element.style.transform="",setTimeout(()=>{Z.element.style.transition=""},200)},{passive:!0})},c5=(J,$)=>{if(J.overlayElement)J.overlayElement.classList.remove("active"),J.overlayElement.setAttribute("aria-hidden","true");if(J.closeButtonElement)J.closeButtonElement.style.display="none";document.body.classList.remove($.bodyLockClass)};var WZ=(J={})=>{let $=v5(J),Q=ZJ(J),q=jJ(J),Z={initialize:()=>Z,cleanup:()=>{},navigateTo:()=>{},getRail:()=>$.rail,getDrawer:()=>$.drawer,getActiveSection:()=>$.activeSection,getActiveSubsection:()=>$.activeSubsection,showDrawer:()=>{},hideDrawer:()=>{},isDrawerVisible:()=>!1,configure:()=>Z,setProcessingChange:()=>{},isProcessingChange:()=>!1,isMobile:()=>$.isMobile,checkMobileState:()=>{},onSectionChange:void 0,onItemSelect:void 0,onViewChange:void 0},j=()=>u5($,q),K=()=>f5($,q),G=()=>g5($),Y=(F)=>{C5($,F,j,K)},z=()=>{i5($,q,K,G)},W=()=>{d5($,q,z,()=>c5($,q),Z)},X=(F,k,L)=>{l5($,F,k,L)},U=()=>{if($.rail=E5($,Q),$.drawer=h5($,Q),p5($,Q,Y,j,K,Z),s5($,Q,K,Z),m5($,W),J.activeSection&&$.items[J.activeSection]){if($.activeSection=J.activeSection,$.rail)$.rail.setActive(J.activeSection);if(Y(J.activeSection),J.expanded===!0)j();else K()}return W(),Z},_=()=>{a5($,W),r5($)},N=(F)=>{return Object.assign(J,F),Object.assign(Q,ZJ({...J,...F})),Object.assign(q,jJ({...J,...F})),Z};return Z.initialize=U,Z.cleanup=_,Z.navigateTo=X,Z.showDrawer=j,Z.hideDrawer=K,Z.isDrawerVisible=G,Z.configure=N,Z.setProcessingChange=(F)=>{$.processingChange=F},Z.isProcessingChange=()=>$.processingChange,Z.isMobile=()=>$.isMobile,Z.checkMobileState=W,Z},UZ=WZ;R$();l6();n();s();i();var o5=(J)=>($)=>{let Q="";if(J.value){let j=(J.options||[]).find((K)=>K.id===J.value);if(j)Q=j.text}let q='<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>',Z=Q$({label:J.label,variant:J.variant||"filled",density:J.density||"default",value:Q,name:J.name,disabled:J.disabled,required:J.required,supportingText:J.supportingText,error:J.error,trailingIcon:q,readonly:!0});return Z.element.classList.add(`${J.prefix||"mtrl"}-select`),{...$,element:Z.element,textfield:Z}},KJ=(J)=>{return J.map(($)=>{if("type"in $&&$.type==="divider")return $;let Q={id:$.id.toString(),text:$.text,icon:$.icon,disabled:$.disabled,hasSubmenu:!1,data:$};if($.hasSubmenu&&Array.isArray($.submenu))Q.hasSubmenu=!0,Q.submenu=KJ($.submenu);return Q})},t5=(J)=>($)=>{if(!$.textfield)return console.warn("Cannot add menu: textfield not found"),$;let Q={options:J.options||[],selectedOption:null};if(J.value)Q.selectedOption=Q.options.find((K)=>K.id===J.value);let q=KJ(Q.options),Z=s7({opener:$.textfield,items:q,position:J.placement||"bottom-start",width:"100%",class:"select-menu",closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,offset:0});Z.on("select",(K)=>{if(!K.item||K.item.hasSubmenu)return;let G=K.item.data;if(!G||!("id"in G)||!("text"in G)){console.warn("Invalid menu selection: missing required data properties");return}if(Q.selectedOption=G,$.textfield.setValue(G.text),Z.setSelected(G.id),$.emit)$.emit("change",{select:$,value:G.id,text:G.text,option:G,originalEvent:K.originalEvent,preventDefault:()=>{K.defaultPrevented=!0},defaultPrevented:!1})}),$.textfield.element.addEventListener("keydown",(K)=>{if($.textfield.input.disabled)return;if((K.key==="Enter"||K.key===" "||K.key==="ArrowDown")&&!Z.isOpen()){if(K.preventDefault(),Z.open(K,"keyboard"),$.emit)$.emit("open",{select:$,originalEvent:K,preventDefault:()=>{},defaultPrevented:!1})}else if(K.key==="Escape"&&Z.isOpen())K.preventDefault(),Z.close(K)}),Z.on("open",()=>{$.textfield.element.classList.add(`${J.prefix||"mtrl"}-select--open`);let K=J.prefix||"mtrl";if($.textfield.element.classList.add(`${K}-textfield--focused`),$.textfield.element.classList.contains(`${K}-textfield--filled`))$.textfield.element.classList.add(`${K}-textfield--filled-focused`)}),Z.on("close",(K)=>{if($.textfield.element.classList.remove(`${J.prefix||"mtrl"}-select--open`),setTimeout(()=>{let G=J.prefix||"mtrl";if(document.activeElement===$.textfield.input||$.textfield.element.contains(document.activeElement)){if($.textfield.element.classList.add(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.add(`${G}-textfield--filled-focused`)}else if($.textfield.element.classList.remove(`${G}-textfield--focused`),$.textfield.element.classList.contains(`${G}-textfield--filled`))$.textfield.element.classList.remove(`${G}-textfield--filled-focused`)},10),$.emit)$.emit("close",{select:$,originalEvent:K.originalEvent,preventDefault:()=>{},defaultPrevented:!1})});let j=()=>{if(!Q.selectedOption)return;Z.setSelected(Q.selectedOption.id)};return Z.on("open",()=>{setTimeout(j,50)}),{...$,menu:Z,select:{getValue:()=>Q.selectedOption?.id||null,setValue:(K)=>{let G=Q.options.find((Y)=>("id"in Y)&&Y.id===K);if(G&&"text"in G)Q.selectedOption=G,$.textfield.setValue(G.text),Z.setSelected(G.id);return $},getText:()=>Q.selectedOption?.text||"",getSelectedOption:()=>Q.selectedOption,getOptions:()=>[...Q.options],setOptions:(K)=>{Q.options=K;let G=KJ(K);if(Z.setItems(G),Q.selectedOption&&!K.find((Y)=>("id"in Y)&&Y.id===Q.selectedOption.id))Q.selectedOption=null,$.textfield.setValue("");return $},open:(K,G="mouse")=>{return Z.open(K,G),$},close:(K)=>{return Z.close(K),$},isOpen:()=>Z.isOpen()}}};var n5=(J)=>($)=>({...$,element:$.element,textfield:$.textfield,menu:$.menu,getValue:J.select.getValue,setValue(Q){return J.select.setValue(Q),this},getText:J.select.getText,getSelectedOption:J.select.getSelectedOption,getOptions:J.select.getOptions,setOptions(Q){return J.select.setOptions(Q),this},open(Q="mouse"){if($.menu&&typeof $.menu.open==="function")$.menu.open(void 0,Q);else J.select.open();return this},close(){return J.select.close(),this},isOpen:J.select.isOpen,setDensity(Q){if($.textfield?.setDensity)$.textfield.setDensity(Q);return this},getDensity(){if($.textfield?.getDensity)return $.textfield.getDensity();return"default"},on(Q,q){if(J.events?.on)J.events.on(Q,q);else if($.on)$.on(Q,q);return this},off(Q,q){if(J.events?.off)J.events.off(Q,q);else if($.off)$.off(Q,q);return this},enable(){return J.disabled.enable(),this},disable(){return J.disabled.disable(),this},destroy(){J.lifecycle.destroy()}});c();var XZ={options:[],variant:R9.VARIANT,placement:R9.PLACEMENT},e5=(J={options:[]})=>C(XZ,J,"select"),$2=(J)=>({select:{getValue:J.select?.getValue||(()=>null),setValue:J.select?.setValue||(()=>J),getText:J.select?.getText||(()=>""),getSelectedOption:J.select?.getSelectedOption||(()=>null),getOptions:J.select?.getOptions||(()=>[]),setOptions:J.select?.setOptions||(()=>J),open:J.select?.open||(()=>J),close:J.select?.close||(()=>J),isOpen:J.select?.isOpen||(()=>!1)},events:{on:J.on||(()=>J),off:J.off||(()=>J)},disabled:{enable:()=>{if(J.textfield?.enable)J.textfield.enable();return J},disable:()=>{if(J.textfield?.disable)J.textfield.disable();return J}},lifecycle:{destroy:()=>{if(J.textfield?.destroy)J.textfield.destroy();if(J.menu?.destroy)J.menu.destroy();if(J.lifecycle?.destroy)J.lifecycle.destroy()}}});var BZ=(J)=>{try{let $=e5(J),Q=I(T,h(),o5($),t5($),b(),(q)=>n5($2(q))(q))($);if(J.on){if(J.on.change)Q.on("change",J.on.change);if(J.on.open)Q.on("open",J.on.open);if(J.on.close)Q.on("close",J.on.close)}return Q}catch($){throw console.error("Select creation error:",$),new Error(`Failed to create select: ${$.message}`)}},J2=BZ;q7();q7();L$();x$();var Q2={DOCKED:"docked",MODAL:"modal",MODAL_INPUT:"modal-input"},q2={DAY:"day",MONTH:"month",YEAR:"year"},Z2={SINGLE:"single",RANGE:"range"},j2=["S","M","T","W","T","F","S"],K2=["January","February","March","April","May","June","July","August","September","October","November","December"],G2=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Y2="MM/DD/YYYY";var z2={SMALL:"small",MEDIUM:"medium",LARGE:"large",FULLWIDTH:"fullwidth",FULLSCREEN:"fullscreen"},W2={SCALE:"scale",SLIDE_UP:"slide-up",SLIDE_DOWN:"slide-down",FADE:"fade"},U2={RIGHT:"right",LEFT:"left",CENTER:"center",SPACE_BETWEEN:"space-between"};var X2={TEXT:"text",FILLED:"filled",OUTLINED:"outlined",TONAL:"tonal"},B2="Yes",F2="No";var H2={PRIMARY:"primary",SECONDARY:"secondary",TERTIARY:"tertiary",SURFACE:"surface"},M2={SMALL:"small",DEFAULT:"default",LARGE:"large"},k2={TOP_RIGHT:"top-right",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_LEFT:"bottom-left"};l6();export{G6 as withVariant,P7 as withTrack,yJ as withThrottle,d6 as withTextLabel,O7 as withTextInput,J9 as withText,E8 as withTabsManagement,Vq as withSwipeable,x8 as withSupportingText,_J as withStyle,_7 as withSize,h8 as withScrollable,A6 as withRipple,D7 as withPosition,Nq as withLoading,b as withLifecycle,x9 as withInput,f8 as withIndicator,g6 as withIcon,Lq as withExpandable,h as withEvents,OJ as withEnhancedEvents,b$ as withElevation,S as withElement,u8 as withDivider,Y6 as withDisabled,wJ as withDebounce,T9 as withCheckable,T$ as withAPI,qq as when,b8 as updateTabPanels,x1 as updateCanvasDimensions,V2 as transform,B$ as toggleClass,o9 as throttle,d3 as setupResponsiveBehavior,v8 as setupKeyboardNavigation,SJ as setGlobalDefaults,IJ as setComponentDefaults,N7 as setAttributes,K6 as removeClass,D2 as removeAttributes,I as pipe,M$ as once,I7 as observeCanvasResize,f6 as normalizeEvent,y9 as normalizeClasses,zq as loggingMiddleware,Zq as joinClasses,tJ as isObject,T1 as initializeCanvasWithRetry,b6 as hasTouchSupport,B9 as hasLifecycle,F9 as hasEmit,c6 as hasClass,P2 as hasAttribute,A2 as getModifierClass,H9 as getInheritedBackground,w2 as getElementClass,R7 as getComponentDefaults,y2 as getComponentClass,R2 as getAttribute,P1 as fillRoundedRectLR,wG as fillRoundedRect,y$ as easeOutCubic,Wq as deriveFiltered,t9 as debounce,n3 as createTopAppBar,w5 as createTooltip,M5 as createTimePicker,Q$ as createTextfield,u3 as createTabsState,r3 as createTabs,C8 as createTabIndicator,X7 as createTab,C4 as createSwitch,I1 as createStyledCanvas,Yq as createStore,H$ as createStateEventManager,w4 as createSnackbar,H4 as createSlider,j4 as createSheet,J2 as createSelect,B8 as createSegmentedButton,X8 as createSegment,p0 as createSearch,I2 as createSVGElement,D1 as createRoundedRectPath,S0 as createRadios,P$ as createProgress,UZ as createNavigationSystem,G7 as createNavigation,s7 as createMenu,b5 as createList,Uq as createLifecycle,p$ as createFab,s$ as createExtendedFab,$q as createEventManager,v6 as createEmitter,E as createElement,E9 as createDivider,Xq as createDisabled,q0 as createDialog,fQ as createDatePicker,_2 as createComponent,vq as createChips,g7 as createChip,WQ as createCheckbox,qQ as createCarousel,j7 as createCardMedia,u7 as createCardHeader,h7 as createCardContent,Z7 as createCardActions,n1 as createCard,A$ as createCanvasThemeObserver,w1 as createCanvasContext,o6 as createButton,e2 as createBottomAppBar,T as createBase,i9 as createBadge,L2 as compose,O1 as clipRoundedRect,bJ as clearGlobalDefaults,R1 as clearCanvas,x2 as classNames,nJ as byString,O2 as batchAttributes,g3 as addScrollIndicators,p as addClass,e8 as TOP_APP_BAR_TYPES,k5 as TOP_APP_BAR_STATES,W9 as TOP_APP_BAR_DEFAULTS,N5 as TOP_APP_BAR_CLASSES,JJ as TOOLTIP_VARIANTS,$J as TOOLTIP_POSITIONS,O5 as TOOLTIP_EVENTS,u6 as TOOLTIP_DEFAULTS,P5 as TOOLTIP_CLASSES,F7 as TIME_PICKER_TYPE,q$ as TIME_PICKER_ORIENTATION,s9 as TIME_PERIOD,p9 as TIME_FORMAT,H7 as TIMEPICKER_Z_INDEX,K5 as TIMEPICKER_VALUES,o8 as TIMEPICKER_TYPES,J6 as TIMEPICKER_SELECTORS,j5 as TIMEPICKER_PERIODS,t8 as TIMEPICKER_ORIENTATIONS,h6 as TIMEPICKER_ICONS,n8 as TIMEPICKER_FORMATS,L6 as TIMEPICKER_EVENTS,e6 as TIMEPICKER_DIAL,a6 as TIMEPICKER_DEFAULTS,G5 as TIMEPICKER_CLASSES,J$ as TEXTFIELD_VARIANTS,c8 as TEXTFIELD_TYPES,n4 as TEXTFIELD_STATES,e4 as TEXTFIELD_EVENTS,$5 as TEXTFIELD_DENSITY,B7 as TEXTFIELD_DEFAULTS,J5 as TEXTFIELD_CLASSES,$$ as TAB_VARIANTS,U7 as TAB_STATES,I8 as TAB_INDICATOR_WIDTH_STRATEGIES,g4 as TAB_EVENTS,r4 as TAB_CLASSES,S8 as TABS_EVENTS,O9 as TABS_DEFAULTS,d4 as TABS_CLASSES,c7 as SelectionMode,E4 as SWITCH_STATES,T8 as SWITCH_LABEL_POSITIONS,h4 as SWITCH_EVENTS,u4 as SWITCH_DEFAULTS,f4 as SWITCH_CLASSES,zJ as STATES,w8 as SNACKBAR_VARIANTS,N4 as SNACKBAR_STATES,n6 as SNACKBAR_POSITIONS,L4 as SNACKBAR_EVENTS,r9 as SNACKBAR_DEFAULTS,V4 as SNACKBAR_CLASSES,V6 as SLIDER_SIZES,t7 as SLIDER_POSITIONS,M6 as SLIDER_EVENTS,k6 as SLIDER_DEFAULTS,t6 as SLIDER_COLORS,K4 as SLIDER_CLASSES,D9 as SHEET_VARIANTS,g9 as SHEET_POSITIONS,$4 as SHEET_GESTURE,n0 as SHEET_EVENTS,L8 as SHEET_ELEVATION,z9 as SHEET_DEFAULTS,J4 as SHEET_CLASSES,e0 as SHEET_ANIMATION,M7 as SELECT_VARIANTS,k7 as SELECT_PLACEMENT,z$ as SELECT_INTERACTION,U$ as SELECT_ICONS,W$ as SELECT_EVENTS,R9 as SELECT_DEFAULTS,X$ as SELECT_CLASSES,z8 as SEGMENTED_BUTTON_MODES,a0 as SEGMENTED_BUTTON_ICONS,s0 as SEGMENTED_BUTTON_EVENTS,W8 as SEGMENTED_BUTTON_DENSITY,u9 as SEGMENTED_BUTTON_DEFAULTS,i0 as SEGMENTED_BUTTON_CLASSES,Y7 as SEARCH_VARIANTS,u0 as SEARCH_STATES,z7 as SEARCH_ICONS,f0 as SEARCH_EVENTS,m6 as SEARCH_DEFAULTS,g0 as SEARCH_CLASSES,q8 as RADIO_VARIANTS,b0 as RADIO_STATES,j8 as RADIO_SIZES,Z8 as RADIO_LABEL_POSITIONS,v0 as RADIO_EVENTS,Q8 as RADIO_DIRECTIONS,C0 as RADIO_DEFAULTS,E0 as RADIO_CLASSES,Q9 as PROGRESS_VARIANTS,E6 as PROGRESS_THICKNESS,w6 as PROGRESS_SHAPES,r6 as PROGRESS_MEASUREMENTS,e9 as PROGRESS_EVENTS,C6 as PROGRESS_DEFAULTS,W6 as PROGRESS_CLASSES,u as PREFIX,n$ as NAV_VARIANTS,e$ as NAV_POSITIONS,_0 as NAV_ITEM_STATES,m7 as NAV_EVENTS,Y9 as NAV_DEFAULTS,o as NAV_CLASSES,$8 as NAV_BEHAVIORS,G2 as MONTH_NAMES_SHORT,K2 as MONTH_NAMES,t$ as MENU_POSITION,H0 as MENU_ITEM_TYPES,F0 as MENU_INTERACTION_TYPES,M0 as MENU_EVENTS,p6 as MENU_DEFAULTS,p7 as MENU_CLASSES,K$ as LIST_TYPES,G$ as LIST_SELECTION_MODES,Y$ as LIST_SCROLL_POSITIONS,X9 as LIST_EVENTS,j$ as LIST_DEFAULTS,Z6 as LIST_CLASSES,H2 as FAB_VARIANTS,M2 as FAB_SIZES,k2 as FAB_POSITIONS,TG as EASING_FUNCTIONS,o7 as Density,z2 as DIALOG_SIZES,U2 as DIALOG_FOOTER_ALIGNMENTS,X2 as DIALOG_BUTTON_VARIANTS,W2 as DIALOG_ANIMATIONS,v9 as DEFAULT_RIPPLE_CONFIG,Y2 as DEFAULT_DATE_FORMAT,B2 as DEFAULT_CONFIRM_BUTTON_TEXT,F2 as DEFAULT_CANCEL_BUTTON_TEXT,j2 as DAY_NAMES,q2 as DATEPICKER_VIEWS,Q2 as DATEPICKER_VARIANTS,Z2 as DATEPICKER_SELECTION_MODES,Fq as CleanupManager,YJ as COMPONENTS,kQ as CHIP_VARIANTS,NQ as CHIP_EVENTS,j9 as CHIPS_EVENTS,E$ as CHECKBOX_VARIANTS,UQ as CHECKBOX_STATES,h$ as CHECKBOX_LABEL_POSITION,XQ as CHECKBOX_CLASSES,f7 as CAROUSEL_TRANSITIONS,e1 as CAROUSEL_SCROLL_BEHAVIORS,Z9 as CAROUSEL_LAYOUTS,Dq as CAROUSEL_ITEM_SIZES,C9 as CAROUSEL_EVENTS,H6 as CAROUSEL_DEFAULTS,I$ as CARD_WIDTHS,V9 as CARD_VARIANTS,p1 as CARD_MEDIA_POSITION,K7 as CARD_ELEVATIONS,r1 as CARD_CORNER_RADIUS,s1 as CARD_CLASSES,S$ as CARD_ASPECT_RATIOS,l1 as CARD_ACTION_ALIGNMENT,b7 as BUTTON_VARIANTS,E7 as BUTTON_TYPES,v7 as BUTTON_SIZES,C7 as BUTTON_SHAPES,C1 as BUTTON_CLASSES,y7 as BADGE_VARIANTS,w7 as BADGE_POSITIONS,I9 as BADGE_MAX_CHARACTERS,A7 as BADGE_COLORS,Bq as AnimationFrameManager,y1 as ANIMATION_DURATIONS};
63
63
 
64
- //# debugId=4630CE7A1441793D64756E2164756E21
64
+ //# debugId=C4A964D2124625B364756E2164756E21