@rettangoli/ui 1.0.2 → 1.0.4

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.
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)fa(e,r,{get:t[r],enumerable:!0})};var je=`
1
+ var rettangoli=(()=>{var Re=`
2
2
  :host([href]) {
3
3
  cursor: pointer;
4
4
  position: relative;
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
12
12
  bottom: 0;
13
13
  z-index: 1;
14
14
  }
15
- `,Fe=({linkElement:e,href:t,newTab:r,rel:s})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),s!=null?e.rel=s:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},Me=({shadowRoot:e,slotElement:t,linkElement:r,href:s,newTab:i,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!s)return r&&r.parentNode===e&&e.removeChild(r),null;let a=r||document.createElement("a");return Fe({linkElement:a,href:s,newTab:i,rel:n}),a.parentNode!==e&&e.appendChild(a),a},Tt=({shadowRoot:e,childElement:t,linkElement:r,href:s,newTab:i,rel:n})=>{if(!s)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let a=r||document.createElement("a");return Fe({linkElement:a,href:s,newTab:i,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var le=["default","sm","md","lg","xl"],G=()=>le.reduce((e,t)=>(e[t]={},e),{}),ns=["sm","md","lg","xl"],ha=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,ma=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=ns.indexOf(e);if(r===-1)return t?["default"]:[];let s=ns.slice(r);return t&&s.push("default"),s},Lt=({element:e,size:t,attr:r,includeDefault:s=!0})=>{let i=ma({size:t,includeDefault:s});for(let n of i){let a=ha({size:n,attr:r}),l=e.getAttribute(a);if(l!==null)return l}return null};var ya=/^([1-9]|1[0-2])fg$/,ga=/^([1-9]\d*)\/([1-9]\d*)fb$/,Rt=e=>typeof e=="string"&&ya.test(e),as=e=>{if(typeof e!="string")return null;let t=e.match(ga);if(!t)return null;let r=Number(t[1]),s=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(s)||s<=0||r>s?null:{numerator:r,denominator:s}};function os({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var q=({styleBucket:e,axis:t,dimension:r,fillValue:s,allowFlexGrow:i=!1,flexMinDimension:n="0",lockBounds:a=!0})=>{let l=()=>{!i||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},p=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){l(),e[t]=s,p();return}if(i&&Rt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let o=i?as(r):null;if(o){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=os({...o,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}l(),e[t]=r,a&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},Nt=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:i="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(s&&Rt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=i;return}let n=s?as(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=os({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=i;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};function T(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var ba=["sm","md","lg","xl"],ls={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},ue=Object.keys(ls),J=e=>e.concat(ba.flatMap(t=>e.map(r=>`${t}-${r}`))),ps={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},Y=(e,t={},r=null)=>{let s="";for(let[i,n]of Object.entries(ps)){i!=="default"&&(s+=`${n} {`);for(let[a,l]of Object.entries(e))for(let[p,o]of Object.entries(l)){let u=ls[a],c=o.startsWith("--")?`var(${o})`:o,d=i==="default"?a:`${i}-${a}`,h=i==="default"?`h-${a}`:`${i}-h-${a}`,f=(m,b=!1)=>{let y=b?`:host([${m}="${p}"]:hover)`:`:host([${m}="${p}"])`;if(r)return r.split(",").map(_=>`${y} ${_.trim()}`).join(", ");let g=t[a];return g?`${y} ${g}`:y};if(u){let b=u.split(" ").map(y=>`${y}: ${c};`).join(" ");s+=`
16
- ${f(d)}{
17
- ${b}
15
+ `,Ne=({linkElement:e,href:t,newTab:r,rel:i})=>{e.href=t,r?e.target="_blank":e.removeAttribute("target"),i!=null?e.rel=i:r?e.rel="noopener noreferrer":e.removeAttribute("rel")},je=({shadowRoot:e,slotElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(t.parentNode!==e&&e.appendChild(t),!i)return r&&r.parentNode===e&&e.removeChild(r),null;let a=r||document.createElement("a");return Ne({linkElement:a,href:i,newTab:s,rel:n}),a.parentNode!==e&&e.appendChild(a),a},gt=({shadowRoot:e,childElement:t,linkElement:r,href:i,newTab:s,rel:n})=>{if(!i)return r?(t.parentNode===r&&e.appendChild(t),r.parentNode===e&&e.removeChild(r),null):(t.parentNode!==e&&e.appendChild(t),null);let a=r||document.createElement("a");return Ne({linkElement:a,href:i,newTab:s,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var ae=["default","sm","md","lg","xl"],H=()=>ae.reduce((e,t)=>(e[t]={},e),{}),dr=["sm","md","lg","xl"],ds=({size:e,attr:t})=>e==="default"?t:`${e}-${t}`,cs=({size:e,includeDefault:t=!0})=>{if(e==="default")return["default"];let r=dr.indexOf(e);if(r===-1)return t?["default"]:[];let i=dr.slice(r);return t&&i.push("default"),i},bt=({element:e,size:t,attr:r,includeDefault:i=!0})=>{let s=cs({size:t,includeDefault:i});for(let n of s){let a=ds({size:n,attr:r}),p=e.getAttribute(a);if(p!==null)return p}return null};var us=/^([1-9]|1[0-2])fg$/,hs=/^([1-9]\d*)\/([1-9]\d*)fb$/,vt=e=>typeof e=="string"&&us.test(e),cr=e=>{if(typeof e!="string")return null;let t=e.match(hs);if(!t)return null;let r=Number(t[1]),i=Number(t[2]);return!Number.isInteger(r)||!Number.isInteger(i)||i<=0||r>i?null:{numerator:r,denominator:i}};function ur({numerator:e,denominator:t,gapVar:r}){return e===t?"100%":e===1?`calc((100% - ((${t} - 1) * ${r})) / ${t})`:`calc(((100% - ((${t} - 1) * ${r})) * ${e}) / ${t})`}var q=({styleBucket:e,axis:t,dimension:r,fillValue:i,allowFlexGrow:s=!1,flexMinDimension:n="0",lockBounds:a=!0})=>{let p=()=>{!s||t!=="width"||(e["flex-grow"]="0",e["flex-shrink"]="1",e["flex-basis"]="auto")},l=()=>{e[`min-${t}`]="unset",e[`max-${t}`]="unset"};if(r===void 0)return;if(r==="f"){p(),e[t]=i,l();return}if(s&&vt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%",e[`min-${t}`]=n,e[`max-${t}`]="unset";return}let o=s?cr(r):null;if(o){e["flex-grow"]="0",e["flex-shrink"]="0",e["flex-basis"]=ur({...o,gapVar:"var(--rtgl-flex-gap, 0px)"}),e[`min-${t}`]=n,e[`max-${t}`]="unset";return}p(),e[t]=r,a&&(e[`min-${t}`]=r,e[`max-${t}`]=r)},wt=({style:e,width:t,fillValue:r="var(--width-stretch)",allowFlexGrow:i=!0,flexMinWidth:s="0"})=>{if(t==="f"){e.width=r,e.flexGrow="",e.flexBasis="",e.minWidth="";return}if(i&&vt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexShrink="",e.flexBasis="0%",e.minWidth=s;return}let n=i?cr(t):null;if(n){e.width="",e.flexGrow="0",e.flexShrink="0",e.flexBasis=ur({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),e.minWidth=s;return}if(t!=null){e.width=t,e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexShrink="",e.flexBasis="",e.minWidth=""};function O(e,...t){let r="";return e.forEach((i,s)=>{r+=i+(t[s]||"")}),r}var fs=["sm","md","lg","xl"],hr={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},de=Object.keys(hr),J=e=>e.concat(fs.flatMap(t=>e.map(r=>`${t}-${r}`))),fr={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},G=(e,t={},r=null)=>{let i="";for(let[s,n]of Object.entries(fr)){s!=="default"&&(i+=`${n} {`);for(let[a,p]of Object.entries(e))for(let[l,o]of Object.entries(p)){let c=hr[a],d=o.startsWith("--")?`var(${o})`:o,h=s==="default"?a:`${s}-${a}`,f=s==="default"?`h-${a}`:`${s}-h-${a}`,u=(y,g=!1)=>{let b=g?`:host([${y}="${l}"]:hover)`:`:host([${y}="${l}"])`;if(r)return r.split(",").map(_=>`${b} ${_.trim()}`).join(", ");let m=t[a];return m?`${b} ${m}`:b};if(c){let g=c.split(" ").map(b=>`${b}: ${d};`).join(" ");i+=`
16
+ ${u(h)}{
17
+ ${g}
18
18
  }
19
- ${f(h,!0)}{
20
- ${b}
19
+ ${u(f,!0)}{
20
+ ${g}
21
21
  }
22
- `}else s+=`
23
- ${f(d)}{
22
+ `}else i+=`
23
+ ${u(h)}{
24
24
  ${o}
25
25
  }
26
- ${f(h,!0)}{
26
+ ${u(f,!0)}{
27
27
  ${o}
28
28
  }
29
- `}i!=="default"&&(s+="}")}return s};function va(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var wa=e=>/%$/.test(e),_a=e=>/^([1-9]|1[0-2])fg$/.test(e),V=e=>{if(e!=null)return _a(e)||wa(e)?e:va(e)?`${e}px`:Object.keys(C).includes(e)?`var(${C[e]})`:e},C={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function X(e,t=":host"){let r="",s=["default","xl","lg","md","sm"];for(let i of s){let n=ps[i];if(!e[i]||Object.keys(e[i]).length===0)continue;i!=="default"&&(r+=`${n} {
30
- `);let a="";for(let[l,p]of Object.entries(e[i]))p!=null&&(a+=`${l}: ${p} !important;
29
+ `}s!=="default"&&(i+="}")}return i};function ys(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var ms=e=>/%$/.test(e),gs=e=>/^([1-9]|1[0-2])fg$/.test(e),N=e=>{if(e!=null)return gs(e)||ms(e)?e:ys(e)?`${e}px`:Object.keys(C).includes(e)?`var(${C[e]})`:e},C={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="",i=["default","xl","lg","md","sm"];for(let s of i){let n=fr[s];if(!e[s]||Object.keys(e[s]).length===0)continue;s!=="default"&&(r+=`${n} {
30
+ `);let a="";for(let[p,l]of Object.entries(e[s]))l!=null&&(a+=`${p}: ${l} !important;
31
31
  `);r+=`${t} {
32
32
  ${a.trim()}
33
33
  }
34
- `,i!=="default"&&(r+=`}
35
- `)}return r}var _e=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;for(let i of r)if(!s.includes(i)||!_e(e[i],t[i]))return!1;return!0};var xa={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C,s:{sm:`
34
+ `,s!=="default"&&(r+=`}
35
+ `)}return r}var bs={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C,s:{sm:`
36
36
  height: 28px;
37
37
  padding-left: 12px;
38
38
  padding-right: 12px;
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
81
81
  `,lk:`
82
82
  background-color: transparent;
83
83
  color: var(--foreground);
84
- `}},cs=Y(xa,{},".surface");var Ea=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Vt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
84
+ `}},yr=G(bs,{},".surface");var vs=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],_t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
85
85
  :host {
86
86
  display: inline-flex;
87
87
  }
@@ -248,8 +248,8 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
248
248
  color: inherit;
249
249
  }
250
250
 
251
- ${cs}
252
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,r,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:s}of Ea){let i=`${r}-s`;if(t<=s&&this.hasAttribute(i))return this.getAttribute(i)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),s=this.hasAttribute("new-tab"),i=this.getAttribute("rel"),n=r&&!t,a=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==a){let l=document.createElement(a);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(Fe({linkElement:this._surfaceElement,href:r,newTab:s,rel:i}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[r]||18:s=t[r]||18;let i=this.getAttribute("pre");i&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",i),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=V(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},us=({render:e,html:t})=>Vt;var ds=T`
251
+ ${yr}
252
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,r,i){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:r,maxWidth:i}of vs){let s=`${r}-s`;if(t<=i&&this.hasAttribute(s))return this.getAttribute(s)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),r=this.getAttribute("href"),i=this.hasAttribute("new-tab"),s=this.getAttribute("rel"),n=r&&!t,a=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==a){let p=document.createElement(a);p.className="surface",p.appendChild(this._slotElement),this._surfaceElement=p}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(Ne({linkElement:this._surfaceElement,href:r,newTab:i,rel:s}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},r=this._resolveResponsiveSizeToken(),i=18;this.hasAttribute("sq")?i={sm:14,lg:22}[r]||18:i=t[r]||18;let s=this.getAttribute("pre");s&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",s),this._prefixIcon.setAttribute("wh",i.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",i.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=N(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},mr=({render:e,html:t})=>_t;var gr=O`
253
253
 
254
254
  :host([d="h"]) {
255
255
  flex-direction: row;
@@ -320,7 +320,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
320
320
  justify-content: center;
321
321
  }
322
322
  }
323
- `;var Aa={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},j=Y(Aa);var fs=T`
323
+ `;var ws={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},B=G(ws);var br=O`
324
324
  :host([sh]:not([sv])) {
325
325
  overflow-x: scroll;
326
326
  flex-wrap: nowrap;
@@ -367,7 +367,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
367
367
  flex-wrap: nowrap;
368
368
  }
369
369
 
370
- `;var We={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ka={bgc:{pr:`
370
+ `;var Ve={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},_s={bgc:{pr:`
371
371
  background-color: var(--primary);
372
372
  `,se:`
373
373
  background-color: var(--secondary);
@@ -407,7 +407,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
407
407
  left: 0;
408
408
  top: 0;
409
409
  height: 100%;
410
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:C,pr:C,pb:C,pl:C,p:C,ph:C,pv:C,g:C,gv:C,gh:C,bw:We,bwt:We,bwr:We,bwb:We,bwl:We,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},hs=Y(ka);var $a={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},z=Y($a);var lt=T`
410
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:C,pr:C,pb:C,pl:C,p:C,ph:C,pv:C,g:C,gv:C,gh:C,bw:Ve,bwt:Ve,bwr:Ve,bwb:Ve,bwl:Ve,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},vr=G(_s);var xs={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},K=G(xs);var Qe=O`
411
411
  a, a:link, a:visited, a:hover, a:active {
412
412
  color: inherit;
413
413
  text-decoration: none;
@@ -417,7 +417,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
417
417
  margin: 0;
418
418
  font: inherit;
419
419
  }
420
- `;var Pt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
420
+ `;var xt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
421
421
  slot {
422
422
  display: contents;
423
423
  }
@@ -433,14 +433,14 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
433
433
  }
434
434
 
435
435
 
436
- ${fs}
437
- ${ds}
438
- ${z}
439
- ${j}
440
- ${hs}
441
- ${lt}
442
- ${je}
443
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...J([...ue,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=G();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Me({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=G(),le.forEach(r=>{let s=x=>`${r==="default"?"":`${r}-`}${x}`,i=this.getAttribute(s("wh")),n=V(i===null?this.getAttribute(s("w")):i),a=V(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="flex");let o=this.getAttribute(s("d")),u=this.getAttribute(s("ah")),c=this.getAttribute(s("av")),d=Lt({element:this,size:r,attr:"d"});o==="h"?this._styles[r]["flex-direction"]="row":o==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!o&&["sm","md","lg","xl"].some(E=>this.hasAttribute(`${E}-d`))&&(this._styles[r]["flex-direction"]="column");let h=d==="h",f=d==="v"||!d;h&&(u==="c"?this._styles[r]["justify-content"]="center":u==="e"?this._styles[r]["justify-content"]="flex-end":u==="s"&&(this._styles[r]["justify-content"]="flex-start"),c==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):c==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):c==="s"&&(this._styles[r]["align-items"]="flex-start")),f&&(u!==null||c!==null)&&(u==="c"?this._styles[r]["align-items"]="center":u==="e"?this._styles[r]["align-items"]="flex-end":u==="s"&&(this._styles[r]["align-items"]="flex-start"),c==="c"?this._styles[r]["justify-content"]="center":c==="e"?this._styles[r]["justify-content"]="flex-end":c==="s"&&(this._styles[r]["justify-content"]="flex-start"));let m=this.hasAttribute(s("wrap")),b=this.hasAttribute(s("no-wrap"));m&&(this._styles[r]["flex-wrap"]="wrap"),b&&(this._styles[r]["flex-wrap"]="nowrap");let y=this.hasAttribute(s("sh")),g=this.hasAttribute(s("sv")),_=this.getAttribute(s("overflow"));y&&g?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):y?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):g&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),_==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=X(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==s&&this.updateStyles()}},ms=({render:e,html:t})=>Pt;var Sa={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
436
+ ${br}
437
+ ${gr}
438
+ ${K}
439
+ ${B}
440
+ ${vr}
441
+ ${Qe}
442
+ ${Re}
443
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...J([...de,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=H();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=je({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=H(),ae.forEach(r=>{let i=A=>`${r==="default"?"":`${r}-`}${A}`,s=this.getAttribute(i("wh")),n=N(s===null?this.getAttribute(i("w")):s),a=N(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="flex");let o=this.getAttribute(i("d")),c=this.getAttribute(i("ah")),d=this.getAttribute(i("av")),h=bt({element:this,size:r,attr:"d"});o==="h"?this._styles[r]["flex-direction"]="row":o==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!o&&["sm","md","lg","xl"].some($=>this.hasAttribute(`${$}-d`))&&(this._styles[r]["flex-direction"]="column");let f=h==="h",u=h==="v"||!h;f&&(c==="c"?this._styles[r]["justify-content"]="center":c==="e"?this._styles[r]["justify-content"]="flex-end":c==="s"&&(this._styles[r]["justify-content"]="flex-start"),d==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):d==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):d==="s"&&(this._styles[r]["align-items"]="flex-start")),u&&(c!==null||d!==null)&&(c==="c"?this._styles[r]["align-items"]="center":c==="e"?this._styles[r]["align-items"]="flex-end":c==="s"&&(this._styles[r]["align-items"]="flex-start"),d==="c"?this._styles[r]["justify-content"]="center":d==="e"?this._styles[r]["justify-content"]="flex-end":d==="s"&&(this._styles[r]["justify-content"]="flex-start"));let y=this.hasAttribute(i("wrap")),g=this.hasAttribute(i("no-wrap"));y&&(this._styles[r]["flex-wrap"]="wrap"),g&&(this._styles[r]["flex-wrap"]="nowrap");let b=this.hasAttribute(i("sh")),m=this.hasAttribute(i("sv")),_=this.getAttribute(i("overflow"));b&&m?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):b?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):m&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),_==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=Y(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}r!==i&&this.updateStyles()}},wr=({render:e,html:t})=>xt;var As={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
444
444
  font-size: var(--h1-font-size);
445
445
  font-weight: var(--h1-font-weight);
446
446
  line-height: var(--h1-line-height);
@@ -480,7 +480,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
480
480
  font-weight: var(--xs-font-weight);
481
481
  line-height: var(--xs-line-height);
482
482
  letter-spacing: var(--xs-letter-spacing);
483
- `}},ys=Y(Sa);var Ca={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},pt=Y(Ca);var Dt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
483
+ `}},_r=G(As);var $s={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},Xe=G($s);var At=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
484
484
  :host {
485
485
  display: block;
486
486
  font-size: var(--md-font-size);
@@ -499,12 +499,12 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
499
499
  text-decoration: var(--anchor-text-decoration-hover);
500
500
  color: var(--anchor-color-hover);
501
501
  }
502
- ${je}
503
- ${ys}
504
- ${pt}
505
- ${z}
506
- ${j}
507
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=V(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),Nt({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Me({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:s})}},gs=({render:e,html:t})=>Dt;var ze={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Ia={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:ze,bwt:ze,bwr:ze,bwb:ze,bwl:ze,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},bs=e=>Y(Ia,{},e);var Oa={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},vs=e=>Y(Oa,{},e);var Bt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
502
+ ${Re}
503
+ ${_r}
504
+ ${Xe}
505
+ ${K}
506
+ ${B}
507
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,i){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=N(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),wt({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=je({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}},xr=({render:e,html:t})=>At;var De={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ks={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:De,bwt:De,bwr:De,bwb:De,bwl:De,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Ar=e=>G(ks,{},e);var Es={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},$r=e=>G(Es,{},e);var $t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
508
508
  :host {
509
509
  display: contents;
510
510
  }
@@ -531,7 +531,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
531
531
  height: auto;
532
532
  }
533
533
 
534
- ${lt}
534
+ ${Qe}
535
535
 
536
536
  a {
537
537
  display: block;
@@ -539,10 +539,10 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
539
539
  width: 100%;
540
540
  }
541
541
 
542
- ${bs("img, a")}
543
- ${vs("img, a")}
544
- ${j}
545
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return J([...ue,"key","src","alt","href","new-tab","rel","wh","w","h","hide","show","op","z","of"])}_styles=G();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Tt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==s&&this.updateStyles()}updateStyles(){this._styles=G(),le.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=V(i===null?this.getAttribute(s("w")):i),a=V(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[r].display="block !important")});let t=X(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},ws=({render:e,html:t})=>Bt;var _s=T`
542
+ ${Ar("img, a")}
543
+ ${$r("img, a")}
544
+ ${B}
545
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return J([...de,"key","src","alt","href","new-tab","rel","wh","w","h","hide","show","op","z","of"])}_styles=H();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),i=this.getAttribute("rel");this._linkElement=gt({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:r,rel:i})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,r,i){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}r!==i&&this.updateStyles()}updateStyles(){this._styles=H(),ae.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=N(s===null?this.getAttribute(i("w")):s),a=N(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none !important"),this.hasAttribute(i("show"))&&(this._styles[r].display="block !important")});let t=Y(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),r!==null?this._imgElement.setAttribute("alt",r):this._imgElement.removeAttribute("alt")}},kr=({render:e,html:t})=>$t;var Er=O`
546
546
  :host([pt="xs"]) svg {
547
547
  padding-top: var(--spacing-xs);
548
548
  }
@@ -658,16 +658,16 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
658
658
  padding-top: var(--spacing-xl);
659
659
  padding-bottom: var(--spacing-xl);
660
660
  }
661
- `;var jt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
661
+ `;var kt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
662
662
  :host {
663
663
  color: var(--foreground);
664
664
  flex-shrink: 0;
665
665
  }
666
- ${pt}
667
- ${_s}
668
- ${z}
669
- ${j}
670
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=V(t===null?this.getAttribute("w"):t),s=V(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},xs=({render:e,html:t})=>jt;var Ta=["mt","mr","mb","ml","m","mh","mv","cur"],Ft=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
666
+ ${Xe}
667
+ ${Er}
668
+ ${K}
669
+ ${B}
670
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return e._icons}static addIcon(t,r){e._icons[t]=r}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,r,i){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),r=N(t===null?this.getAttribute("w"):t),i=N(t===null?this.getAttribute("h"):t);r!=null?this.style.width=r:this.style.width="",i!=null?this.style.height=i:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),r=e._icons[t]||(window.rtglIcons||{})[t];if(r){this.shadow.innerHTML=r;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Sr=({render:e,html:t})=>kt;var Ss=["mt","mr","mb","ml","m","mh","mv","cur"],Et=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
671
671
  :host {
672
672
  display: contents;
673
673
  }
@@ -729,9 +729,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
729
729
  input[type="datetime-local"]::-webkit-date-and-time-value {
730
730
  text-align: left;
731
731
  }
732
- ${z}
733
- ${j}
734
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=G(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...J([...Ta,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,s){if(r!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=G(),le.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=V(i===null?this.getAttribute(s("w")):i),a=V(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=X(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",i=this.getAttribute("min"),n=this.getAttribute("max"),a=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",i),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",a),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},ge=({render:e,html:t})=>Ft;var La=ge({}),Ue="date",Mt=class extends La{connectedCallback(){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,s){if(t==="type"&&s!==Ue){this.getAttribute("type")!==Ue&&super.setAttribute("type",Ue);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,s)}},Es=({render:e,html:t})=>Mt;var Ra=ge({}),Ke="time",Wt=class extends Ra{connectedCallback(){this.getAttribute("type")!==Ke&&super.setAttribute("type",Ke),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,s){if(t==="type"&&s!==Ke){this.getAttribute("type")!==Ke&&super.setAttribute("type",Ke);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,s)}},As=({render:e,html:t})=>Wt;var Na=ge({}),He="datetime-local",zt=class extends Na{connectedCallback(){this.getAttribute("type")!==He&&super.setAttribute("type",He),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,s){if(t==="type"&&s!==He){this.getAttribute("type")!==He&&super.setAttribute("type",He);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,s)}},ks=({render:e,html:t})=>zt;var Va=["mt","mr","mb","ml","m","mh","mv","cur"],Ut=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
732
+ ${K}
733
+ ${B}
734
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=H(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...J([...Ss,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=H(),ae.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=N(s===null?this.getAttribute(i("w")):s),a=N(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),i=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",s=this.getAttribute("min"),n=this.getAttribute("max"),a=this.getAttribute("step"),p=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",i),this._setOrRemoveInputAttribute("min",s),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",a),p?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},me=({render:e,html:t})=>Et;var Cs=me({}),Pe="date",St=class extends Cs{connectedCallback(){this.getAttribute("type")!==Pe&&super.setAttribute("type",Pe),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Pe){this.getAttribute("type")!==Pe&&super.setAttribute("type",Pe);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Cr=({render:e,html:t})=>St;var Is=me({}),Be="time",Ct=class extends Is{connectedCallback(){this.getAttribute("type")!==Be&&super.setAttribute("type",Be),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==Be){this.getAttribute("type")!==Be&&super.setAttribute("type",Be);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Ir=({render:e,html:t})=>Ct;var Os=me({}),We="datetime-local",It=class extends Os{connectedCallback(){this.getAttribute("type")!==We&&super.setAttribute("type",We),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,r,i){if(t==="type"&&i!==We){this.getAttribute("type")!==We&&super.setAttribute("type",We);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,r,i)}},Or=({render:e,html:t})=>It;var Ts=["mt","mr","mb","ml","m","mh","mv","cur"],Ot=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
735
735
  :host {
736
736
  display: contents;
737
737
  }
@@ -764,9 +764,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
764
764
  input:disabled {
765
765
  cursor: not-allowed;
766
766
  }
767
- ${z}
768
- ${j}
769
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=G(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...J([...Va,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(r);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,s){if(r!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=G(),le.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=V(i===null?this.getAttribute(s("w")):i),a=V(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=X(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.max(r,n))}let i=this.getAttribute("max");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let s=this._clampValueToBounds(r);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",s),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},$s=({render:e,html:t})=>Ut;var Kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
767
+ ${K}
768
+ ${B}
769
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=H(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...J([...Ts,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let r=this._inputElement.value;if(r.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let i=parseFloat(r);isNaN(i)||(i=this._clampValueToBounds(i),this._inputElement.value=i.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:i},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(e.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=H(),ae.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=N(s===null?this.getAttribute(i("w")):s),a=N(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,r){if(r==null||r==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,r)}_clampValueToBounds(t){let r=t,i=this.getAttribute("min");if(i!==null){let n=parseFloat(i);isNaN(n)||(r=Math.max(r,n))}let s=this.getAttribute("max");if(s!==null){let n=parseFloat(s);isNaN(n)||(r=Math.min(r,n))}return r}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let r=parseFloat(t);if(isNaN(r)){this._inputElement.value="";return}let i=this._clampValueToBounds(r);this._inputElement.value=i.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",i),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Tr=({render:e,html:t})=>Ot;var Tt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
770
770
  :host {
771
771
  display: contents;
772
772
  }
@@ -792,9 +792,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
792
792
  textarea:disabled {
793
793
  cursor: not-allowed;
794
794
  }
795
- ${z}
796
- ${j}
797
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...J([...ue,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,s){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,l=this.getAttribute(a("wh")),p=V(l===null?this.getAttribute(a("w")):l),o=V(l===null?this.getAttribute(a("h")):l),u=this.getAttribute(a("op")),c=this.getAttribute(a("z"));c!==null&&(this._styles[n]["z-index"]=c),u!==null&&(this._styles[n].opacity=u),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let i=X(this._styles,"textarea");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Ss=({render:e,html:t})=>Kt;var Pa=["mt","mr","mb","ml","m","mh","mv","cur"],Da=/^#[0-9a-fA-F]{6}$/,Ht=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
795
+ ${K}
796
+ ${B}
797
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...J([...de,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,r,i){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(a("wh")),l=N(p===null?this.getAttribute(a("w")):p),o=N(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,"textarea");s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),i=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),i?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Lr=({render:e,html:t})=>Tt;var Ls=["mt","mr","mb","ml","m","mh","mv","cur"],Rs=/^#[0-9a-fA-F]{6}$/,Lt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
798
798
  :host {
799
799
  display: contents;
800
800
  }
@@ -815,9 +815,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
815
815
  cursor: not-allowed;
816
816
  opacity: 0.5;
817
817
  }
818
- ${z}
819
- ${j}
820
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=G(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...J([...Pa,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,s){if(r!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=G(),le.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=V(i===null?this.getAttribute(s("w")):i),a=V(i===null?this.getAttribute(s("h")):i),l=this.getAttribute(s("op")),p=this.getAttribute(s("z"));p!==null&&(this._styles[r]["z-index"]=p),l!==null&&(this._styles[r].opacity=l),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[r].display="none"),this.hasAttribute(s("show"))&&(this._styles[r].display="block")});let t=X(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Da.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Cs=({render:e,html:t})=>Ht;var Gt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
818
+ ${K}
819
+ ${B}
820
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=H(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...J([...Ls,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,r,i){if(r!==i){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=H(),ae.forEach(r=>{let i=o=>`${r==="default"?"":`${r}-`}${o}`,s=this.getAttribute(i("wh")),n=N(s===null?this.getAttribute(i("w")):s),a=N(s===null?this.getAttribute(i("h")):s),p=this.getAttribute(i("op")),l=this.getAttribute(i("z"));l!==null&&(this._styles[r]["z-index"]=l),p!==null&&(this._styles[r].opacity=p),q({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),q({styleBucket:this._styles[r],axis:"height",dimension:a,fillValue:"100%"}),this.hasAttribute(i("hide"))&&(this._styles[r].display="none"),this.hasAttribute(i("show"))&&(this._styles[r].display="block")});let t=Y(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Rs.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Rr=({render:e,html:t})=>Lt;var Rt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
821
821
  :host {
822
822
  display: contents;
823
823
  }
@@ -869,9 +869,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
869
869
  input[type="range"]:disabled::-moz-range-thumb {
870
870
  cursor: not-allowed;
871
871
  }
872
- ${z}
873
- ${j}
874
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...J([...ue,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,l=this.getAttribute(a("wh")),p=V(l===null?this.getAttribute(a("w")):l),o=V(l===null?this.getAttribute(a("h")):l),u=this.getAttribute(a("op")),c=this.getAttribute(a("z"));c!==null&&(this._styles[n]["z-index"]=c),u!==null&&(this._styles[n].opacity=u),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let i=X(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",i!==null?this._inputElement.step=i:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Is=({render:e,html:t})=>Gt;var qt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
872
+ ${K}
873
+ ${B}
874
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...J([...de,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.getAttribute("value"),a=this.getAttribute("min")||"0";this._inputElement.value=n??a});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(a("wh")),l=N(p===null?this.getAttribute(a("w")):p),o=N(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,'input[type="range"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),i=this.getAttribute("max"),s=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=r??0,r!==null?this._inputElement.min=r:this._inputElement.min="0",i!==null?this._inputElement.max=i:this._inputElement.max="100",s!==null?this._inputElement.step=s:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Nr=({render:e,html:t})=>Rt;var Nt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
875
875
  :host {
876
876
  display: inline-flex;
877
877
  }
@@ -938,9 +938,9 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
938
938
  cursor: not-allowed;
939
939
  opacity: 0.5;
940
940
  }
941
- ${z}
942
- ${j}
943
- `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...J([...ue,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,s){if(t==="key"&&r!==s){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=s!==null;return}if(t==="disabled"){s!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=d=>`${n==="default"?"":`${n}-`}${d}`,l=this.getAttribute(a("wh")),p=V(l===null?this.getAttribute(a("w")):l),o=V(l===null?this.getAttribute(a("h")):l),u=this.getAttribute(a("op")),c=this.getAttribute(a("z"));c!==null&&(this._styles[n]["z-index"]=c),u!==null&&(this._styles[n].opacity=u),p==="f"?this._styles[n].width="var(--width-stretch)":p!==void 0&&(this._styles[n].width=p,this._styles[n]["min-width"]=p,this._styles[n]["max-width"]=p),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let i=X(this._styles,'input[type="checkbox"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let i=this._labelSlotElement.assignedNodes({flatten:!0}).some(l=>l.nodeType===Node.TEXT_NODE?l.textContent.trim().length>0:l.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,a=i||n;a&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!a&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},Os=({render:e,html:t})=>qt;var Jt=40,Ba=6,Yt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
941
+ ${K}
942
+ ${B}
943
+ `))}constructor(){super(),this._isSyncingLabelState=!1,e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="checkbox",this._wrapperElement=document.createElement("label"),this._wrapperElement.className="checkbox-wrapper",this._labelElement=document.createElement("span"),this._labelElement.className="checkbox-label",this._labelSlotElement=document.createElement("slot"),this._labelSlotElement.addEventListener("slotchange",()=>{this._updateLabelState()}),this._labelElement.appendChild(this._labelSlotElement),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this._wrapperElement.appendChild(this._inputElement),this._wrapperElement.appendChild(this._labelElement),this.shadow.appendChild(this._wrapperElement),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","checked","disabled","label",...J([...de,"wh","w","h","hide","show","op","z"])]}get checked(){return this._inputElement.checked}set checked(t){this._inputElement.checked=!!t}get value(){return this._inputElement.checked}set value(t){this._inputElement.checked=!!t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.checked},bubbles:!0}))};attributeChangedCallback(t,r,i){if(t==="key"&&r!==i){requestAnimationFrame(()=>{let n=this.hasAttribute("checked");this._inputElement.checked=n});return}if(t==="checked"){this._inputElement.checked=i!==null;return}if(t==="disabled"){i!==null?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled");return}if(t==="label"){this._updateLabelState();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=h=>`${n==="default"?"":`${n}-`}${h}`,p=this.getAttribute(a("wh")),l=N(p===null?this.getAttribute(a("w")):p),o=N(p===null?this.getAttribute(a("h")):p),c=this.getAttribute(a("op")),d=this.getAttribute(a("z"));d!==null&&(this._styles[n]["z-index"]=d),c!==null&&(this._styles[n].opacity=c),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),o==="f"?this._styles[n].height="100%":o!==void 0&&(this._styles[n].height=o,this._styles[n]["min-height"]=o,this._styles[n]["max-height"]=o),this.hasAttribute(a("hide"))&&(this._styles[n].display="none"),this.hasAttribute(a("show"))&&(this._styles[n].display="block")});let s=Y(this._styles,'input[type="checkbox"]');s!==this._lastStyleString&&(this._styleElement.textContent=s,this._lastStyleString=s)}connectedCallback(){let t=this.hasAttribute("checked");this._inputElement.checked=t,this.hasAttribute("disabled")&&this._inputElement.setAttribute("disabled",""),this._updateLabelState()}_updateLabelState(){if(!this._isSyncingLabelState){this._isSyncingLabelState=!0;try{let t=this.getAttribute("label"),r=t??"";this._labelSlotElement.textContent!==r&&(this._labelSlotElement.textContent=r);let s=this._labelSlotElement.assignedNodes({flatten:!0}).some(p=>p.nodeType===Node.TEXT_NODE?p.textContent.trim().length>0:p.nodeType===Node.ELEMENT_NODE),n=typeof t=="string"&&t.trim().length>0,a=s||n;a&&!this.hasAttribute("has-label")?this.setAttribute("has-label",""):!a&&this.hasAttribute("has-label")&&this.removeAttribute("has-label")}finally{this._isSyncingLabelState=!1}}}},jr=({render:e,html:t})=>Nt;var jt=40,Ns=6,Vt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
944
944
  :host {
945
945
  display: contents;
946
946
  }
@@ -1017,7 +1017,7 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
1017
1017
  animation: none;
1018
1018
  }
1019
1019
  }
1020
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<Ba&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(r>=s-2*Jt){this._slotElement.style.marginTop=`${Jt}px`,this._slotElement.style.marginBottom=`${Jt}px`,this._dialogElement.style.height="100vh";return}let i=s-r,n=Math.floor(i/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Ts=({render:e,html:t})=>Yt;var Xt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(T`
1020
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():i===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),r=t?Math.round(t.getBoundingClientRect().height):0;if(r<=0){this._layoutRetryCount<Ns&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let i=window.innerHeight;if(r>=i-2*jt){this._slotElement.style.marginTop=`${jt}px`,this._slotElement.style.marginBottom=`${jt}px`,this._dialogElement.style.height="100vh";return}let s=i-r,n=Math.floor(s/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Vr=({render:e,html:t})=>Vt;var Dt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
1021
1021
  :host {
1022
1022
  display: contents;
1023
1023
  }
@@ -1071,19 +1071,19 @@ var rettangoli=(()=>{var fa=Object.defineProperty;var N=(e,t)=>{for(var r in t)f
1071
1071
  min-width: 200px;
1072
1072
  max-width: 400px;
1073
1073
  }
1074
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let l=t,p=r;switch(n){case"t":l=t-s/2,p=r-i-8;break;case"ts":l=t,p=r-i-8;break;case"te":l=t-s,p=r-i-8;break;case"r":l=t+8,p=r-i/2;break;case"rs":l=t+8,p=r;break;case"re":l=t+8,p=r-i;break;case"b":l=t-s/2,p=r+8;break;case"bs":l=t,p=r+8;break;case"be":l=t-s,p=r+8;break;case"l":l=t-s-8,p=r-i/2;break;case"ls":l=t-s-8,p=r;break;case"le":l=t-s-8,p=r-i;break;default:l=t,p=r+8;break}let o=8;return l=Math.max(o,Math.min(l,window.innerWidth-s-o)),p=Math.max(o,Math.min(p,window.innerHeight-i-o)),{left:l,top:p}}get popover(){return this._popoverContainer}},Ls=({render:e,html:t})=>Xt;var Zt={};N(Zt,{handleClickHeader:()=>ja});var ja=(e,t)=>{let{store:r,render:s}=e;r.toggleOpen({}),s()};var Rs={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var Qt={};N(Qt,{createInitialState:()=>Fa,selectViewData:()=>za,toggleOpen:()=>Ua});var Fa=()=>Object.freeze({open:!1}),Ma=["id","class","style","slot","label","content"],Wa=(e={})=>Object.entries(e).filter(([t])=>!Ma.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),za=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Wa(t)}),Ua=({state:e})=>{e.open=!e.open};var Ns={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}};var er={};N(er,{handleClickItem:()=>Ka});var Ka=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index),a=Array.isArray(s.items)?s.items[n]:void 0;if(!a)return;if(a.disabled||a.current){i.preventDefault();return}typeof a.href=="string"&&a.href.length>0||i.preventDefault(),r(new CustomEvent("item-click",{detail:{id:a.id,path:a.path,href:a.href,item:a,index:n,trigger:i.type}}))};var Vs={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}};var tr={};N(tr,{createInitialState:()=>Ha,selectViewData:()=>Qa});var Ha=()=>Object.freeze({}),Ga=["id","class","style","slot","items","sep","max","separator"],qa=(e={})=>Object.entries(e).filter(([t])=>!Ga.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ja=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Ya=e=>`${e}`.replace(/"/g,"&quot;"),Xa=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Za=e=>e.map((t,r)=>{let s=typeof t.href=="string"&&t.href.length>0,i=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,a=!!t.disabled,l=!n&&!a&&(s||i||!!t.click),p=t.rel||(t.newTab?"noopener noreferrer":""),o=[t.newTab?'target="_blank"':"",p?`rel="${Ya(p)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:s?t.href:void 0,path:i?t.path:void 0,isCurrent:n,isDisabled:a,isInteractive:l,linkExtraAttrs:o,c:n?"fg":"mu-fg"}}),Qa=({props:e})=>{let t=qa(e),r=Array.isArray(e.items)?e.items:[],s=Ja(e.max),i=e.sep||"breadcrumb-arrow",n=Za(r),a=Xa(n,s),l=[];return a.forEach((p,o)=>{l.push(p),o<a.length-1&&l.push({isSeparator:!0})}),{containerAttrString:t,items:l,sep:i}};var Ps={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rr={};N(rr,{handleClickMenuItem:()=>to,handleClosePopover:()=>eo});var eo=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},to=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),a=s.items[n],l=a?.type||"item";if(!a||l!=="item"||a.disabled){i.preventDefault();return}a.href||i.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:a,id:a.id,path:a.path,href:a.href,trigger:i.type}}))};var Ds={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}};var sr={};N(sr,{createInitialState:()=>ro,selectViewData:()=>no});var ro=()=>Object.freeze({}),so=e=>`${e}`.replace(/"/g,"&quot;"),io=e=>e.map((t,r)=>{let s=t.type||"item",i=s==="separator",n=s==="label",a=s==="item",l=!!t.disabled,p=a&&!l,o=l?"mu-fg":"fg",u=l?"mu":"",c=l?"":"ac",d=typeof t.href=="string"&&t.href.length>0,h=t.rel||(t.newTab?"noopener noreferrer":""),f=[t.newTab?'target="_blank"':"",h?`rel="${so(h)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:s,isSeparator:i,isLabel:n,isItem:a,isDisabled:l,isInteractive:p,hasHref:d,linkExtraAttrs:f,c:o,bgc:u,hoverBgc:c}}),no=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:io(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}};var Bs={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${w} h=${h} sv g=xs slot=content bgc=mu br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," sv g=xs slot=content bgc=mu br=md"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}]}}],fast:!1}],fast:!1}};var fr={};N(fr,{handleActionClick:()=>bl,handleAfterMount:()=>hl,handleBeforeMount:()=>fl,handleImageClick:()=>vl,handleKeyDown:()=>wl,handleOnUpdate:()=>ml,handleTooltipMouseEnter:()=>_l,handleTooltipMouseLeave:()=>xl,handleValueChange:()=>gl,handleValueInput:()=>yl});var dr={};N(dr,{clearFieldError:()=>ll,collectAllDataFields:()=>Q,createInitialState:()=>rl,flattenFields:()=>ur,get:()=>se,getDefaultValue:()=>Ye,hideTooltip:()=>ul,isDataField:()=>cr,pruneHiddenValues:()=>Re,resetFormValues:()=>al,selectForm:()=>K,selectFormValues:()=>fe,selectViewData:()=>sl,set:()=>pe,setErrors:()=>ol,setFormFieldValue:()=>il,setFormValues:()=>nl,setReactiveMode:()=>pl,showTooltip:()=>cl,validateField:()=>Je,validateForm:()=>Le});var w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ge={NOT:0};var k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},te=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var ir=e=>{if(!e||e.trim()==="")throw new k("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new k(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new k(`Incomplete comparison expression - missing right operand (got: '${e}')`)},js=e=>{if(e.trim().endsWith(" in"))throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new k(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new k(`Missing iterable expression after 'in' (got: '$for ${e}')`);let s=t.includes(",")?t.split(",").map(i=>i.trim()):[t.trim()];for(let i of s){if(!i)throw new k(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(i))throw new k(`Invalid loop syntax (got: '$for ${e}')`)}};var Fs=(e,t,r=!1)=>{if(t===null)return new te(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new te(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new te(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new te(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},Ms=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new te(`Unknown function '${e}' (${r})`)};var ao=(e,t,r={})=>{let s={},i={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},i=r.partials||{}):typeof r=="object"&&(s=r));let a=I(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},I=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return M(e.var,r,s);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return M(e.path,r,s);if(e.type===w.INTERPOLATION)return lo(e.parts,t,r,s);switch(e.type){case w.FUNCTION:return zs(e,t,r,s);case w.BINARY:return Us(e,t,r,s);case w.UNARY:return Ks(e,t,r,s);case w.CONDITIONAL:return co(e,t,r,s);case w.LOOP:return yo(e,t,r,s);case w.OBJECT:return bo(e,t,r,s);case w.ARRAY:return vo(e,t,r,s);case w.PARTIAL:return wo(e,t,r,s);case w.PATH_REFERENCE:return _o(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},Ws=new Map,oo=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},M=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=Ws.get(e);if(!s){let n=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),s=[];for(let p of n){let o=oo(p.trim());s.push(...o)}Ws.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},lo=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=I(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},zs=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw Ms(e.name,i);let a=e.args.map(l=>I(l,t,r,s));return n(...a)},Te=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case w.VARIABLE:return M(e.path,r,s);case w.LITERAL:return e.value;case w.BINARY:return Us(e,t,r,s);case w.UNARY:return Ks(e,t,r,s);case w.FUNCTION:return zs(e,t,r,s);default:return I(e,t,r,s)}},Us=(e,t,r,s)=>{if(e.op===P.AND||e.op===P.OR){let a=Te(e.left,t,r,s),l=Te(e.right,t,r,s);switch(e.op){case P.AND:return a&&l;case P.OR:return a||l}}let i=I(e.left,t,r,s),n=I(e.right,t,r,s);switch(e.op){case P.EQ:return i==n;case P.NEQ:return i!=n;case P.GT:return i>n;case P.LT:return i<n;case P.GTE:return i>=n;case P.LTE:return i<=n;case P.IN:return Array.isArray(n)?n.includes(i):!1;case P.ADD:if(typeof i!="number"||typeof n!="number")throw new te(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case P.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new te(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},Ks=(e,t,r,s)=>{let i=e.op===Ge.NOT?Te(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case Ge.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},po=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===w.VARIABLE)if(M(i.path,r,s)){let a=e.bodies[0];if(a.type===w.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?I(p.parsedKey,t,r,s):p.key,u=p.value;if(u.type===w.LITERAL)l[o]=u.value;else if(u.type===w.VARIABLE)l[o]=M(u.path,r,s);else if(u.type===w.INTERPOLATION){let c=[];for(let d of u.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=M(d.path,r,s);c.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);c.push(h!=null?String(h):"")}l[o]=c.join("")}else l[o]=I(u,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===w.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?I(p.parsedKey,t,r,s):p.key,u=p.value;if(u.type===w.LITERAL)l[o]=u.value;else if(u.type===w.VARIABLE)l[o]=M(u.path,r,s);else if(u.type===w.INTERPOLATION){let c=[];for(let d of u.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=M(d.path,r,s);c.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);c.push(h!=null?String(h):"")}l[o]=c.join("")}else l[o]=I(u,t,r,s)}return l}}}return null},co=(e,t,r,s)=>{let i=po(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Te(a,t,r,s))return I(e.bodies[n],t,r,s)}return Hs},uo=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let o=t[p];if(o[a]){let u={};for(let c of n.properties){let d=c.key,h=c.value;if(h.type===w.LITERAL)u[d]=h.value;else if(h.type===w.VARIABLE){let f=h.path;if(f===s)u[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);u[d]=o[m]}else return null}else if(h.type===w.INTERPOLATION){let f=[],m=!0;for(let b of h.parts)if(typeof b=="string")f.push(b);else if(b.type===w.VARIABLE){let y=b.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let g=y.substring(s.length+1),_=o[g];f.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;u[d]=f.join("")}else return null}l.push(u)}}return l}}}return null},fo=(e,t)=>{let r=e.body,s=e.itemVar,i=uo(e,t);if(i!==null)return i;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let l of r.properties)if(l.parsedKey)return null;let n=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===w.LITERAL)n.push({key:p,type:"literal",value:o.value});else if(o.type===w.VARIABLE){let u=o.path;if(u===s)n.push({key:p,type:"item"});else if(u.startsWith(s+".")){let c=u.substring(s.length+1);if(!c.includes(".")&&!c.includes("["))n.push({key:p,type:"prop",prop:c});else{a=!1;break}}else{a=!1;break}}else if(o.type===w.INTERPOLATION&&o.parts.length===1){let u=o.parts[0];if(u.type===w.VARIABLE){let c=u.path;if(c===s)n.push({key:p,type:"item_string"});else if(c.startsWith(s+".")){let d=c.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],u={};for(let c of n)if(c.type==="literal")u[c.key]=c.value;else if(c.type==="item")u[c.key]=o;else if(c.type==="prop")u[c.key]=o[c.prop];else if(c.type==="item_string")u[c.key]=o!=null?String(o):"";else if(c.type==="prop_string"){let d=o[c.prop];u[c.key]=d!=null?String(d):""}l[p]=u}return l}}return null},ho=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===w.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<i.length;o++){let u=i[o],c={},d={...s,[l]:u,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let h=e.iterable.path||"";if(s&&s.__paths__&&h){let f=h.split("."),m=f[0];m in s.__paths__&&(h=s.__paths__[m],f.length>1&&(h+="."+f.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${h}[${o}]`,...p&&{[p]:o}};for(let f of a.properties){let m=f.parsedKey?I(f.parsedKey,t,r,d):f.key,b=f.value;if(b.type===w.LITERAL)c[m]=b.value;else if(b.type===w.VARIABLE){let y=b.path;if(y===l)c[m]=u;else if(y===p)c[m]=o;else if(y.startsWith(l+".")){let g=y.substring(l.length+1);!g.includes(".")&&!g.includes("[")?c[m]=u[g]:c[m]=M(y,r,{...s,[l]:u,...p&&{[p]:o}})}else c[m]=M(y,r,{...s,[l]:u,...p&&{[p]:o}})}else if(b.type===w.INTERPOLATION){let y=[];for(let g of b.parts)if(typeof g=="string")y.push(g);else if(g.type===w.VARIABLE){let _=g.path,x;if(_===l)x=u;else if(_===p)x=o;else if(_.startsWith(l+".")){let E=_.substring(l.length+1);!E.includes(".")&&!E.includes("[")?x=u[E]:x=M(_,r,{...s,[l]:u,...p&&{[p]:o}})}else x=M(_,r,{...s,[l]:u,...p&&{[p]:o}});y.push(x!=null?String(x):"")}else{let _={...s,[l]:u,...p&&{[p]:o}},x=I(g,t,r,_);y.push(x!=null?String(x):"")}c[m]=y.join("")}else{let y={...s,[l]:u,...p&&{[p]:o}};c[m]=I(b,t,r,y)}}n.push(c)}return n}return null},mo=(e,t,r)=>{let s=e.body;if(s.type===w.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===w.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===w.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===w.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===w.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let o=[];for(let u=0;u<t.length;u++){let c=t[u];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),o.push(d)}}return o}}}}return null},yo=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let o,u=!1;if(e.iterable.type===w.FUNCTION){u=!0;let d=e.iterable.args.map(h=>h.type===w.LITERAL?typeof h.value=="string"?`'${h.value}'`:String(h.value):h.type===w.VARIABLE?h.path:h.type===w.FUNCTION?`${h.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let c=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Fs(c,i,u)}if(!e.indexVar){let o=mo(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=fo(e,i);if(o!==null)return o}let n=ho(e,t,r,s,i);if(n!==null)return n;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),u=o[0];u in s.__paths__&&(l=s.__paths__[u],o.length>1&&(l+="."+o.slice(1).join(".")))}let p=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===w.OBJECT&&o.properties.some(u=>u.key.startsWith("$if ")||u.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let u=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};u.__paths__||(u.__paths__=s.__paths__||{}),u.__paths__={...u.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(u.__paths__[e.indexVar]=o);let c=I(e.body,t,r,u);if(Array.isArray(c)&&c.length===1&&!p){let d=c[0];a.push(d===void 0?{}:d)}else a.push(c===void 0?{}:c)}return a},go=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?I(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===w.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let u of a.properties){let c=u.parsedKey?I(u.parsedKey,t,r,s):u.key,d=u.value;if(d.type===w.LITERAL)p[c]=d.value;else if(d.type===w.VARIABLE)p[c]=M(d.path,r,s);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[c]=h.join("")}else if(d.type===w.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,b=f.value;if(b.type===w.LITERAL)h[m]=b.value;else if(b.type===w.VARIABLE)h[m]=M(b.path,r,s);else if(b.type===w.INTERPOLATION){let y=[];for(let g of b.parts)if(typeof g=="string")y.push(g);else if(g.type===w.VARIABLE){let _=M(g.path,r,s);y.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;h[m]=y.join("")}else{o=!1;break}}if(!o)break;p[c]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},bo=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!Te(e.whenCondition,i,r,s))return;let n=go(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let u of e.properties){let c=u.parsedKey?I(u.parsedKey,t,r,s):u.key,d=u.value;if(d.type===w.LITERAL)o[c]=d.value;else if(d.type===w.VARIABLE)o[c]=M(d.path,r,s);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{let m=I(f,t,r,s);h.push(m!=null?String(m):"")}o[c]=h.join("")}else o[c]=I(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let u=I(o.value,t,r,s);if(!p&&u!==null&&u!==void 0)return Array.isArray(u)&&u.length===1?u[0]:u;typeof u=="object"&&u!==null&&!Array.isArray(u)&&Object.assign(a,u)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return I(o.value,t,r,s)}else{let u=o.value;if(u&&u.type===w.OBJECT&&u.properties){let c=u.properties.find(d=>d.key.startsWith("$for "));if(c){let d=I(c.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=I(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let c=o.parsedKey?I(o.parsedKey,t,r,s):o.key,d=I(o.value,t,r,s);d!==void 0&&(a[c]=d)}}return a},Hs={},vo=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===w.LOOP){let a=I(n,t,r,s);Array.isArray(a)&&n.flatten!==!1?i.push(...a):i.push(a)}else{let a=I(n,t,r,s);a!==Hs&&a!==void 0&&i.push(a)}return i},wo=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!Te(a,p,r,s))return;if(!l[i])throw new te(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new te(`Circular partial reference detected: ${i}`);let u=l[i],c=r,d={...s,_partialStack:[...o,i]};if(s){c={...r};for(let h of Object.keys(s))h.startsWith("_")||(c[h]=s[h])}if(n){let h=I(n,t,r,s);c={...c,...h}}return I(u,t,c,d)},_o=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),a=n[0],l=n.slice(1);if(!s||!(a in s))throw new te(`Path reference '#{${i}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new te(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new te(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},nr=ao;var xo=/\$\{([^}]*)\}/g,Eo=/#\{([^}]*)\}/g,qs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Ao(i,t);return{isFunction:!0,type:w.FUNCTION,name:s,args:n}},Ao=(e,t={})=>e.trim()?ko(e).map(s=>$o(s.trim(),t)):[],ko=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,r+=l):i&&l===n&&p!=="\\"?(i=!1,n="",r+=l):!i&&l==="("?(s++,r+=l):!i&&l===")"?(s--,r+=l):!i&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},$o=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=qs(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1,a=null;for(let{op:l,type:p}of i){let o=0;for(;o<s.length;){let u=xe(s.substring(o),l);if(u===-1)break;let c=o+u;c>n&&(n=c,a={op:l,type:p}),o=c+l.length}}if(n!==-1)try{return Z(s,t)}catch{return{type:w.VARIABLE,path:s}}return{type:w.VARIABLE,path:s}},Js=/^\w+\(.*\)$/,So=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Co=e=>{if(!(!e||e.trim()===""||Js.test(e))&&So.test(e))throw e.includes("?")&&e.includes(":")?new k(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new k(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new k(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gs=e=>{let t=e.trim();if(Js.test(t))throw new k(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new k(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new k(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new k(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new k(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},qe=(e,t={})=>{let r=e.trim();Co(r);let s=qs(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},ar=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,u)=>{let c=`__ESCAPED_${s.length}__`;return s.push(u),c}),r=r.replace(/\\(#\{[^}]*\})/g,(o,u)=>{let c=`__ESCAPED_${s.length}__`;return s.push(u),c}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(xo)],n=[...r.matchAll(Eo)],a=[...i.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,u)=>o.match.index-u.match.index);if(a.length===0){let o=r;for(let u=0;u<s.length;u++)o=o.replace(`__ESCAPED_${u}__`,s[u]);return{type:w.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:u}=a[0];try{return u==="variable"?qe(o[1],t):Gs(o[1])}catch(c){if(c.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw c}}let l=[],p=0;for(let{match:o,type:u}of a){let[c,d]=o,h=o.index;if(h>p){let f=r.substring(p,h);for(let m=0;m<s.length;m++)f=f.replace(`__ESCAPED_${m}__`,s[m]);f&&l.push(f)}try{let f;u==="variable"?f=qe(d.trim(),t):f=Gs(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(c);else throw f}p=h+c.length}if(p<r.length){let o=r.substring(p);for(let u=0;u<s.length;u++)o=o.replace(`__ESCAPED_${u}__`,s[u]);o&&l.push(o)}return{type:w.INTERPOLATION,parts:l}};var be=(e,t)=>typeof e=="string"?ar(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Oo(e,t):To(e,t):{type:w.LITERAL,value:e},Io=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new k("$each value must be a non-empty string");let s=t.trim();if(s==="")throw new k("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new k("Empty $each body not allowed");if(r.$partial!==void 0)throw new k("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${s}`]:r}},Oo=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let p=Io(n),o=Object.keys(p);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let u=Ys(o[0],p[o[0]],t,!0);r.push(u),s=!0;continue}}catch(p){throw p instanceof k?p:new k(p.message)}let l=Object.keys(n);if(l.length===1&&/^\$for(?::\w+)?\s/.test(l[0])){let p=Ys(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=be(n,t);r.push(a),(a.type===w.FUNCTION||a.type===w.CONDITIONAL||a.type===w.LOOP||a.type===w.PARTIAL||a.type===w.OBJECT&&!a.fast||a.type===w.ARRAY&&!a.fast)&&(s=!0)}return{type:w.ARRAY,items:r,fast:!s}},To=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new k("$partial value must be a string");if(e.$partial.trim()==="")throw new k("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[y]of n)for(let g of p)if(y===g||y.startsWith(g+" ")||y.startsWith(g+"#")){o.push(g);break}if(o.length>0)throw new k(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:u,$when:c,...d}=e,h={},f=!1;for(let[y,g]of Object.entries(d)){let _=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(_=y.slice(1)),h[_]=g,f=!0}let m=null;if(f&&(m=be(h,t),m.type===w.OBJECT)){let y=!1;for(let g of m.properties)if(g.value.type===w.VARIABLE||g.value.type===w.INTERPOLATION||g.value.type===w.FUNCTION||g.value.type===w.CONDITIONAL||g.value.type===w.OBJECT&&!g.value.fast||g.value.type===w.ARRAY&&!g.value.fast){y=!0;break}y&&(m.fast=!1)}let b={type:w.PARTIAL,name:u,data:m};if(c!==void 0){let y;if(typeof c=="string"){if(c.trim()==="")throw new k("Empty condition expression after '$when'");y=Z(c,t)}else y={type:w.LITERAL,value:c};b.whenCondition=y}return b}for(let[p,o]of n)if(p==="$when"){if(i!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new k("Missing condition expression after '$when'");let u=typeof o=="string"?o:JSON.stringify(o);if(u.trim()==="")throw new k("Empty condition expression after '$when'");i=Z(u,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new k("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[p,o]=n[a];if(p==="$when"){a++;continue}if(p==="$each")throw new k("$each can only be used inside arrays");if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let u=Lo(n,a,t);r.push({key:p,value:u.node}),s=!0,a=u.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let u=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",c=u?`:${u}`:"";throw new k(`$for loops must be inside arrays - use '- $for${c} item in items:' instead of '$for${c} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new k(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new k("Missing condition expression after '$if'");{let u=be(o,t);(u.type===w.FUNCTION||u.type===w.CONDITIONAL||u.type===w.PARTIAL||u.type===w.OBJECT&&!u.fast||u.type===w.ARRAY&&!u.fast)&&(s=!0);let c=ar(p,t),d={key:p,value:u};(c.type!==w.LITERAL||c.value!==p)&&(d.parsedKey=c),r.push(d),a++}}}let l={type:w.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},Lo=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let c=a.match(/^\$if#(\w+)\s+(.+)$/);if(c)p=c[1],o=c[2];else throw new k(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());ir(o);let u=Z(o,r);for(s.push(u),i.push(be(l,r)),n++;n<e.length;){let[c,d]=e[n],h=!1,f;if(p?c.startsWith(`$elif#${p} `)?(f=c.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(c===`$else#${p}`||c===`$else#${p}:`)&&(h=!0,f=null):c.startsWith("$elif ")?(f=c.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(c==="$else"||c==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{ir(f);let m=Z(f,r);s.push(m)}if(i.push(be(d,r)),n++,f===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),u=0,c=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?u++:o[d]===")"&&u--,u<0){c=!1;break}if(c&&u===0)return Z(o,t)}let r=xe(e,"||");if(r!==-1)return{type:w.BINARY,op:P.OR,left:Z(e.substring(0,r).trim(),t),right:Z(e.substring(r+2).trim(),t)};let s=xe(e,"&&");if(s!==-1)return{type:w.BINARY,op:P.AND,left:Z(e.substring(0,s).trim(),t),right:Z(e.substring(s+2).trim(),t)};let i=[{op:">=",type:P.GTE},{op:"<=",type:P.LTE},{op:"==",type:P.EQ},{op:"!=",type:P.NEQ},{op:">",type:P.GT},{op:"<",type:P.LT},{op:" in ",type:P.IN}];for(let{op:o,type:u}of i){let c=xe(e,o);if(c!==-1)return{type:w.BINARY,op:u,left:Z(e.substring(0,c).trim(),t),right:Z(e.substring(c+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:P.ADD},{op:" - ",type:P.SUBTRACT}];for(let{op:o,type:u}of l){let c=0;for(;c<e.length;){let d=xe(e.substring(c),o);if(d===-1)break;let h=c+d;h>n&&(n=h,a={op:o,type:u}),c=h+o.length}}if(n!==-1&&a)return{type:w.BINARY,op:a.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(xe(e,o)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:w.UNARY,op:Ge.NOT,operand:Z(e.substring(1).trim(),t)}:Xs(e,t)},xe=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},Ro=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},Xs=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return qe(r,t);let i=Ro(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return qe(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},No=(e,t=!1)=>{let r=t?"$each":"$for";try{js(e)}catch(s){if(s instanceof k&&t){let i=s.message.replace(/\$for/g,"$each");throw new k(i.replace("Parse Error: ",""))}throw s}},Ys=(e,t,r,s=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let b=s?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",b)}')`)}let a=n[1],l=n[2].trim();No(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let b=s?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${b} ${l}')`)}let o=p[1].trim(),u=p[2].trim(),c,d=null;if(o.includes(",")){let b=o.split(",").map(y=>y.trim());if(b.length!==2)throw new k(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);c=b[0],d=b[1]}else c=o;let h=["this","undefined","null","true","false"];if(h.includes(c))throw new k(`Reserved variable name: ${c}`);if(d&&h.includes(d))throw new k(`Reserved variable name: ${d}`);let f=Xs(u,r),m=be(t,r);return{type:w.LOOP,itemVar:c,indexVar:d,iterable:f,body:m,flatten:a!=="nested"}};var Vo=(e,t={})=>{let{functions:r={}}=t;return be(e,r)},ct=Vo;var or={};N(or,{now:()=>Po});var Po=()=>Date.now();var Do=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...or,...s},a=ct(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=ct(o,{functions:n});return nr(a,t,{functions:n,partials:l})},lr=Do;var pr=e=>e!==null&&typeof e=="object",ut=e=>pr(e)&&!Array.isArray(e),Bo=e=>typeof e=="string"&&e.includes("."),Zs=e=>typeof e=="string"&&/[\[\]]/.test(e);function Qs(e,t){let r={};for(let s of t){if(typeof s!="string"||s.length===0)continue;let i=se(e,s);i!==void 0&&pe(r,s,i)}return r}function jo(e){if(!ut(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(s=>{if(!ut(s))return s;if(typeof s.$when=="string"&&s.$when.trim().length>0){let{$when:i,...n}=s,a=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${i}`]:a}}return Array.isArray(s.fields)?{...s,fields:t(s.fields)}:s});return{...e,fields:t(e.fields)}}var se=(e,t,r=void 0)=>{if(!t||!pr(e)||Zs(t))return r;let s=t.split(".").filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;i=i[n]}return i},pe=(e,t,r)=>{if(!pr(e)||typeof t!="string"||t.length===0||Zs(t))return e;let s=t.split(".").filter(n=>n!=="");if(s.length===0)return e;Bo(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let a=s[n];(!(a in i)||typeof i[a]!="object"||i[a]===null)&&(i[a]={}),i=i[a]}return i[s[s.length-1]]=r,e},Fo=["id","class","style","slot","form","defaultValues","disabled","context"],Mo=(e={})=>Object.entries(e).filter(([t,r])=>!(Fo.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),Wo={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},de={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},zo="input-date",Uo="input-time",Ko="input-datetime",Ho=/^(\d{4})-(\d{2})-(\d{2})$/,Go=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,qo=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,Jo=e=>{if(typeof e!="string")return null;let t=Ho.exec(e);if(!t)return null;let r=Number(t[1]),s=Number(t[2]),i=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(s)||!Number.isInteger(i)||s<1||s>12||i<1||i>31)return null;let n=new Date(Date.UTC(r,s-1,i));return n.getUTCFullYear()===r&&n.getUTCMonth()===s-1&&n.getUTCDate()===i?{year:r,month:s,day:i}:null},Yo=e=>{if(typeof e!="string")return null;let t=Go.exec(e);if(!t)return null;let r=Number(t[1]),s=Number(t[2]),i=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(s)||!Number.isInteger(i)||r<0||r>23||s<0||s>59||i<0||i>59?null:{hour:r,minute:s,second:i}},ei=e=>{let t=Yo(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},ti=e=>Jo(e)?e:null,Xo=e=>{if(typeof e!="string")return null;let t=qo.exec(e);if(!t)return null;let r=ti(t[1]),s=ei(t[2]);return!r||!s?null:`${r}T${s}`},Zo=e=>e===zo?{normalize:ti,invalidMessage:de.invalidDate}:e===Uo?{normalize:ei,invalidMessage:de.invalidTime}:e===Ko?{normalize:Xo,invalidMessage:de.invalidDateTime}:null,Qo=(e,t)=>{let r=Zo(e.type);if(!r||t==null||t==="")return null;let s=r.normalize(String(t));if(!s)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let i=r.normalize(String(e.min));if(i&&s<i)return de.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let i=r.normalize(String(e.max));if(i&&s>i)return de.maxTemporal(String(e.max))}return null},Je=(e,t)=>{if(e.required){let s=t==null||t===""||typeof t=="boolean"&&t===!1,i=e.type==="input-number"&&t===null;if(e.type==="input-number"?i:s)return typeof e.required=="object"&&e.required.message?e.required.message:de.required}let r=Qo(e,t);if(r)return r;if(Array.isArray(e.rules))for(let s of e.rules){let i=el(s,t);if(i)return i}return null},el=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||de.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||de.maxLength(e.value):null;case"pattern":{let i=Wo[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||de.pattern}return i.test(r)?null:e.message||de.pattern}default:return null}},Le=(e,t)=>{let r={},s=Q(e);for(let i of s){let n=se(t,i.name),a=Je(i,n);a&&(r[i.name]=a)}return{valid:Object.keys(r).length===0,errors:r}},tl=["section","read-only-text","slot"],cr=e=>!tl.includes(e.type),Q=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...Q(r.fields)):cr(r)&&t.push(r);return t},Ye=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":return null;case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},ur=(e,t=0)=>{let r=[],s=t;for(let i of e)if(i.type==="section"){if(r.push({...i,_isSection:!0,_idx:s}),s++,Array.isArray(i.fields)){let n=ur(i.fields,s);r.push(...n),s+=n.length}}else r.push({...i,_isSection:!1,_idx:s}),s++;return r},rl=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),K=({state:e,props:t})=>{let{form:r={}}=t||{},s=jo(r),i=ut(t?.context)?t.context:{},n=ut(e?.formValues)?e.formValues:{},a={...i,...n,formValues:n};return Object.keys(a).length>0?lr(s,a):s},sl=({state:e,props:t})=>{let r=Mo(t),s=K({state:e,props:t}),i=s.fields||[],n=!!t?.disabled,a=ur(i);a.forEach((c,d)=>{if(c._arrIdx=d,c._isSection)return;let h=cr(c);if(c._disabled=n||!!c.disabled,h&&c.name&&(c._error=e.errors[c.name]||null),c.type==="input-text"&&(c._inputType=c.inputType||"text"),c.type==="select"){let f=se(e.formValues,c.name);c._selectedValue=f!==void 0?f:null,c.placeholder=c.placeholder||"",c.noClear=c.clearable===!1}if(c.type==="image"){let f=se(e.formValues,c.name);c._imageSrc=f&&String(f).trim()?f:null,c.placeholderText=c.placeholderText||"No Image"}if(c.type==="read-only-text"&&(c.content=c.content||""),c.type==="checkbox"){let f=typeof c.content=="string"?c.content:typeof c.checkboxLabel=="string"?c.checkboxLabel:"";c._checkboxText=f}});let l=s.actions||{buttons:[]},p=l.layout||"split",o=(l.buttons||[]).map((c,d)=>({...c,_globalIdx:d,variant:c.variant||"se",_disabled:n||!!c.disabled,pre:c.pre||"",suf:c.suf||""})),u;return p==="split"?u={_layout:"split",buttons:o,_leftButtons:o.filter(c=>c.align==="left"),_rightButtons:o.filter(c=>c.align!=="left")}:u={_layout:p,buttons:o,_allButtons:o},{containerAttrString:r,title:s?.title||"",description:s?.description||"",flatFields:a,actions:u,formValues:e.formValues,tooltipState:e.tooltipState}},fe=({state:e,props:t})=>{let r=K({state:e,props:t}),s=Q(r.fields||[]);return Qs(e.formValues,s.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},il=({state:e,props:t},r={})=>{let{name:s,value:i}=r;s&&(pe(e.formValues,s,i),Re({state:e,props:t}))},Re=({state:e,props:t})=>{if(!t)return;let r=K({state:e,props:t}),s=Q(r.fields||[]);e.formValues=Qs(e.formValues,s.map(i=>i.name).filter(i=>typeof i=="string"&&i.length>0))},nl=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(s=>{pe(e.formValues,s,r[s])})},al=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},ol=({state:e},t={})=>{e.errors=t.errors||{}},ll=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},pl=({state:e})=>{e.reactiveMode=!0},cl=({state:e},t={})=>{let{x:r,y:s,content:i}=t;e.tooltipState={open:!0,x:r,y:s,content:i}},ul=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}};var ri=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},si=({form:e,formValues:t={},refs:r,formDisabled:s=!1})=>{let i=e.fields||[],n=0,a=l=>{for(let p of l){if(p.type==="section"){n++,Array.isArray(p.fields)&&a(p.fields);continue}let o=r[`field${n}`];if(n++,!o)continue;let u=s||!!p.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(p.type)){let c=se(t,p.name);if(c==null?o.removeAttribute("value"):o.setAttribute("value",String(c)),p.type==="slider-with-input"&&o.store?.setValue){let d=Number(c??0);o.store.setValue({value:Number.isFinite(d)?d:0}),typeof o.render=="function"&&o.render()}p.type==="popover-input"&&o.store?.setValue&&(o.store.setValue({value:c==null?"":String(c)}),typeof o.render=="function"&&o.render())}p.type==="checkbox"&&(se(t,p.name)?o.setAttribute("checked",""):o.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(p.type)&&p.placeholder&&o.getAttribute("placeholder")!==p.placeholder&&(p.placeholder===void 0||p.placeholder===null?o.removeAttribute("placeholder"):o.setAttribute("placeholder",p.placeholder)),u?o.setAttribute("disabled",""):o.removeAttribute("disabled")}};a(i)},dl=(e,t)=>{let r=t?.defaultValues||{},s={};Object.keys(r).forEach(l=>{pe(s,l,r[l])});let i=K({state:{formValues:s},props:t}),n=Q(i.fields||[]),a={};for(let l of n){let p=se(r,l.name);p!==void 0?pe(a,l.name,p):pe(a,l.name,Ye(l))}e.resetFormValues({defaultValues:a})},fl=e=>{let{store:t,props:r}=e;dl(t,r)},hl=e=>{let{props:t,refs:r,render:s}=e,i=e.store.getState(),n=K({state:i,props:t});si({form:n,formValues:i.formValues,refs:r,formDisabled:!!t?.disabled}),s()},ml=(e,t)=>{let{newProps:r}=t,{store:s,render:i,refs:n}=e,a=!!r?.disabled,l=s.getState();Re({state:l,props:r});let p=K({state:l,props:r});si({form:p,formValues:l.formValues,refs:n,formDisabled:a}),i()},yl=(e,t)=>{let{store:r,dispatchEvent:s,render:i,props:n}=e,a=t._event,l=a.currentTarget.dataset.fieldName;if(!l||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let p=a.detail.value;r.setFormFieldValue({name:l,value:p});let o=r.getState();Re({state:o,props:n});let u=K({state:o,props:n}),d=Q(u.fields||[]).find(h=>h.name===l);if(ri({field:d,target:a.currentTarget,value:p}),o.reactiveMode&&d){let h=Je(d,p);h?r.setErrors({errors:{...o.errors,[l]:h}}):r.clearFieldError({name:l})}i(),s(new CustomEvent("form-input",{bubbles:!0,detail:{name:l,value:p,values:fe({state:r.getState(),props:n})}}))},gl=(e,t)=>{let{store:r,dispatchEvent:s,render:i,props:n}=e,a=t._event,l=a.currentTarget.dataset.fieldName;if(!l||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let p=a.detail.value;r.setFormFieldValue({name:l,value:p});let o=r.getState();Re({state:o,props:n});let u=K({state:o,props:n}),d=Q(u.fields||[]).find(h=>h.name===l);if(ri({field:d,target:a.currentTarget,value:p}),o.reactiveMode&&d){let h=Je(d,p);h?r.setErrors({errors:{...o.errors,[l]:h}}):r.clearFieldError({name:l})}i(),s(new CustomEvent("form-change",{bubbles:!0,detail:{name:l,value:p,values:fe({state:r.getState(),props:n})}}))},bl=(e,t)=>{let{store:r,dispatchEvent:s,render:i,props:n}=e,l=t._event.currentTarget.dataset.actionId;if(!l)return;let p=r.getState(),o=K({state:p,props:n}),d=((o.actions||{}).buttons||[]).find(f=>f.id===l),h=fe({state:p,props:n});if(d&&d.validate){let f=Q(o.fields||[]),{valid:m,errors:b}=Le(f,p.formValues);r.setErrors({errors:b}),m||r.setReactiveMode(),i(),s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:l,values:h,valid:m,errors:b}}))}else s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:l,values:h}}))},vl=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:s,dispatchEvent:i,props:n}=e,a=r.currentTarget.dataset.fieldName;i(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:a,event:r.type,values:fe({state:s.getState(),props:n})}}))},wl=(e,t)=>{let{store:r,dispatchEvent:s,render:i,props:n}=e,a=t._event;if(a.key==="Enter"&&!a.shiftKey){let l=a.target;if(l.tagName==="TEXTAREA"||l.tagName==="RTGL-TEXTAREA")return;a.preventDefault();let p=r.getState(),o=K({state:p,props:n}),c=(o.actions||{}).buttons||[],h=c.find(m=>m.validate)||c[0];if(!h)return;let f=fe({state:p,props:n});if(h.validate){let m=Q(o.fields||[]),{valid:b,errors:y}=Le(m,p.formValues);r.setErrors({errors:y}),b||r.setReactiveMode(),i(),s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:h.id,values:f,valid:b,errors:y}}))}else s(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:h.id,values:f}}))}},_l=(e,t)=>{let{store:r,render:s,props:i}=e,n=t._event,a=n.currentTarget.dataset.fieldName,l=K({state:r.getState(),props:i}),o=Q(l.fields||[]).find(u=>u.name===a);if(o&&o.tooltip){let u=n.currentTarget.getBoundingClientRect();r.showTooltip({x:u.left+u.width/2,y:u.top-8,content:typeof o.tooltip=="string"?o.tooltip:o.tooltip.content||""}),s()}},xl=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()};var hr={};N(hr,{getValues:()=>Cl,reset:()=>Tl,setValues:()=>Il,validate:()=>Ol});var El=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Al=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],kl=({ref:e,fieldType:t,value:r,forceRefresh:s=!1})=>{if(El.includes(t)){if(s&&e.removeAttribute("value"),r==null){if(Al.includes(t)&&s){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},ni=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},$l=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let s=r.getAttribute("data-field-name");s&&t.set(s,r)}),t},ii=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,Sl=({root:e,values:t={}})=>{if(!e||typeof e.querySelectorAll!="function")return;e.querySelectorAll("rtgl-select[data-field-name]").forEach(s=>{let i=s.dataset?.fieldName;if(!i)return;let n=se(t,i);ni({ref:s,value:n})})},Cl=function(){let e=this.store.getState();return fe({state:e,props:this.props})},Il=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),s=K({state:r,props:this.props}),i=Q(s.fields||[]),n=$l(ii(this));for(let l of i){if(!l.name)continue;let p=n.get(l.name);if(!p)continue;let o=Object.prototype.hasOwnProperty.call(t,l.name),u=se(t,l.name);if(!o&&u===void 0)continue;let c=se(r.formValues,l.name);kl({ref:p,fieldType:l.type,value:c,forceRefresh:!0}),typeof p?.tagName=="string"&&p.tagName.toUpperCase()==="RTGL-SELECT"&&ni({ref:p,value:c}),l.type==="checkbox"&&(c?p.setAttribute("checked",""):p.removeAttribute("checked"))}this.render();let a=()=>{let l=this.store.getState();Sl({root:ii(this),values:l.formValues})};a(),setTimeout(()=>{a()},0)},Ol=function(){let e=this.store.getState(),t=K({state:e,props:this.props}),r=Q(t.fields||[]),{valid:s,errors:i}=Le(r,e.formValues);return this.store.setErrors({errors:i}),s||this.store.setReactiveMode(),this.render(),{valid:s,errors:i}},Tl=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{pe(t,n,e[n])});let r=K({state:{formValues:t},props:this.props}),s=Q(r.fields||[]),i={};for(let n of s){let a=se(e,n.name);a!==void 0?pe(i,n.name,a):pe(i,n.name,Ye(n))}this.store.resetFormValues({defaultValues:i}),this.setValues(i)};var ai={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}};var oi={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=flatFields[${field._arrIdx}].options ?no-clear=${field.noClear} :selectedValue=flatFields[${field._arrIdx}]._selectedValue :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=flatFields[",{type:1,path:"field._arrIdx"},"].options ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=flatFields[",{type:1,path:"field._arrIdx"},"]._selectedValue :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var mr={};N(mr,{handleCancel:()=>Nl,handleCloseAll:()=>Fl,handleConfirm:()=>Rl,handleDialogClose:()=>Ll,handleDropdownClose:()=>Vl,handleDropdownItemClick:()=>Pl,handleShowAlert:()=>Dl,handleShowConfirm:()=>Bl,handleShowDropdownMenu:()=>jl});var Ll=(e,t)=>{let{store:r,render:s}=e;r.closeAll(),s()},Rl=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!0)},Nl=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!1)},Vl=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",null)},Pl=(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t._event,{index:a,item:l}=n.detail;r.closeAll(),s(),i.emit("event",{index:a,item:l})},Dl=(e,t)=>{let{store:r,render:s}=e,i=t;r.selectIsOpen()&&(r.closeAll(),s()),r.setAlertConfig(i),s()},Bl=async(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setConfirmConfig(n),s(),new Promise(a=>{i.once("event",l=>{a(l)})})},jl=async(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t;return r.selectIsOpen()&&(r.closeAll(),s()),r.setDropdownConfig(n),s(),new Promise(a=>{i.once("event",l=>{a(l)})})},Fl=e=>{let{store:t,render:r}=e;t.selectIsOpen()&&(t.closeAll(),r())};var li={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}};var yr={};N(yr,{closeAll:()=>Kl,createInitialState:()=>Ml,selectConfig:()=>Hl,selectDropdownConfig:()=>Gl,selectIsOpen:()=>Jl,selectUiType:()=>ql,selectViewData:()=>Yl,setAlertConfig:()=>Wl,setConfirmConfig:()=>zl,setDropdownConfig:()=>Ul});var Ml=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"}}),Wl=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},zl=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"Yes",cancelText:t.cancelText||"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},Ul=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x||0,y:t.y||0,place:t.place||"bs"},e.uiType="dropdown",e.isOpen=!0},Kl=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Hl=({state:e})=>e.config,Gl=({state:e})=>e.dropdownConfig,ql=({state:e})=>e.uiType,Jl=({state:e})=>e.isOpen,Yl=({state:e})=>({isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,place:e.dropdownConfig?.place||"bs"},isDialogOpen:e.isOpen&&e.uiType==="dialog",isDropdownOpen:e.isOpen&&e.uiType==="dropdown"});var pi={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogOpen} s=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=c av=c g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=24 av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogOpen"}," s=sm"]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=dropdownConfig.items key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}};var gr={};N(gr,{handleClickStart:()=>Xl});var Xl=(e,t)=>{let{dispatchEvent:r,store:s}=e,i=t._event;console.log("handle click start",s.selectPath()),r(new CustomEvent("start-click",{detail:{path:s.selectPath()}}))};var ci={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}};var br={};N(br,{createInitialState:()=>Zl,selectPath:()=>sp,selectViewData:()=>rp,setState:()=>ip});var Zl=()=>Object.freeze({}),Ql=["id","class","style","slot","start"],ep=(e={})=>Object.entries(e).filter(([t])=>!Ql.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),tp=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},rp=({props:e})=>{let t=tp(e.start)||e.start;return{containerAttrString:ep(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},sp=({props:e})=>e.start?.path,ip=({state:e})=>{};var ui={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var vr={};N(vr,{handleBeforeMount:()=>ap});var di=(e,t,r)=>{let{store:s,render:i}=r,n,a=-1/0;if(e.forEach(l=>{let p=l.getBoundingClientRect();p.top<=t&&p.top>a&&(a=p.top,n=l.id)}),!n){let l=1/0;e.forEach(p=>{let o=p.getBoundingClientRect();o.top>t&&o.top<l&&(l=o.top,n=p.id)})}n&&n!==s.selectCurrentId()&&(s.setCurrentId({id:n}),i())},np=(e,t,r,s)=>{let{store:i,render:n}=s,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),l=Array.from(a),p=l.map(u=>{let c=1,d=u.tagName.toLowerCase();return d==="h1"?c=1:d==="h2"?c=2:d==="h3"?c=3:d==="h4"?c=4:d==="rtgl-text"&&(c=parseInt(u.getAttribute("data-level")||"1",10)),{id:u.id,href:`#${u.id}`,title:u.textContent,level:c}});i.setItems({items:p}),di(l,r,s),n();let o=di.bind(void 0,l,r,s);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},ap=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let s=document.getElementById(t.targetId);if(!s)return;let i=window;t.scrollContainerId&&(i=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=np(s,i,n,e)}),()=>{r()}};var fi={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}};var wr={};N(wr,{createInitialState:()=>op,selectCurrentId:()=>cp,selectState:()=>pp,selectViewData:()=>lp,setContentContainer:()=>fp,setCurrentId:()=>dp,setItems:()=>up});var op=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),lp=({state:e})=>{let r=((s,i)=>{let n=new Set,a=s.findIndex(p=>p.id===i);if(a===-1)return n;let l=s[a].level;for(let p=a-1;p>=0;p--)if(s[p].level<l){let o=s[p].level;n.add(s[p].id);for(let u=p-1;u>=0;u--)s[u].level<o&&(n.add(s[u].id),o=s[u].level);break}return n})(e.items,e.currentId);return{items:e.items.map(s=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},n=s.id===e.currentId,a=r.has(s.id),l=n||a;return{...s,c:l?"fg":"mu-fg",ml:i[s.level]||"",bc:l?"fg":"mu-fg"}}),currentId:e.currentId}},pp=({state:e})=>e,cp=({state:e})=>e.currentId,up=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},dp=({state:e},t={})=>{e.currentId=t.id},fp=({state:e},t={})=>{e.contentContainer=t.container};var hi={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var _r={};N(_r,{handleBeforeMount:()=>hp,handleInputChange:()=>bp,handleInputKeydown:()=>wp,handleOnUpdate:()=>mp,handlePopoverClose:()=>gp,handleSubmitClick:()=>vp,handleTextClick:()=>yp});var Xe=e=>e==null||e===!0?"":String(e),mi=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=Xe(t);r.setValue({value:n}),r.closePopover({}),i(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),s()},hp=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let s=Xe(r.value);t.setValue({value:s}),t.setTempValue({value:s})}},mp=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let l=Xe(s?.value);i.setValue({value:l}),i.getState().isOpen||i.setTempValue({value:l})}n()},yp=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e;if(n.disabled)return;let a=t._event,l=Xe(n.value);r.setValue({value:l}),r.setTempValue({value:l}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}}),s(),setTimeout(()=>{let{input:p}=i;if(!p)return;p.value=l,p.focus();let o=p.shadowRoot?.querySelector("input, textarea");o&&typeof o.focus=="function"&&o.focus()},50)},gp=(e,t)=>{let{store:r,render:s}=e;r.closePopover({}),s()},bp=(e,t)=>{let{store:r}=e,s=t._event,i=Xe(s.detail.value);r.setTempValue({value:i})},vp=e=>{let{store:t,refs:r}=e,{input:s}=r,i=s?s.value:t.getState().tempValue;mi(e,i)},wp=(e,t)=>{let{store:r,refs:s}=e,i=t._event;if(i.key==="Enter"){i.preventDefault(),i.stopPropagation();let{input:n}=s,a=n?n.value:r.getState().tempValue;mi(e,a)}else i.key==="Escape"&&(i.preventDefault(),i.stopPropagation(),r.closePopover({}),e.render())};var yi={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}};var xr={};N(xr,{closePopover:()=>kp,createInitialState:()=>_p,openPopover:()=>Ap,selectValue:()=>Sp,selectViewData:()=>xp,setTempValue:()=>Ep,setValue:()=>$p});var _p=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),xp=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,s=r?t.value:"-",i=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",a=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:s,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:i,label:n,disabled:a}},Ep=({state:e},t={})=>{e.tempValue=t.value},Ap=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},kp=({state:e})=>{e.isOpen=!1,e.tempValue=""},$p=({state:e},t={})=>{e.value=t.value},Sp=({state:e})=>e.value;var gi={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=mu br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}};var Er={};N(Er,{handleAddOptionClick:()=>Pp,handleAddOptionMouseEnter:()=>Dp,handleAddOptionMouseLeave:()=>Bp,handleBeforeMount:()=>Cp,handleButtonClick:()=>Op,handleClearClick:()=>Vp,handleClickOptionsPopoverOverlay:()=>Tp,handleOnUpdate:()=>Ip,handleOptionClick:()=>Lp,handleOptionMouseEnter:()=>Rp,handleOptionMouseLeave:()=>Np});var Cp=e=>{let{store:t,props:r,render:s}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let i=r.options.find(n=>_e(n.value,r.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),s())}},Ip=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e,a=!1;s?.disabled&&!r?.disabled&&(i.closeOptionsPopover({}),a=!0),r.selectedValue!==s.selectedValue&&(i.updateSelectedValue({value:s.selectedValue}),a=!0),a&&n()},Op=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let l=i.selectButton,p=l.firstElementChild,o=p?p.getBoundingClientRect():l.getBoundingClientRect(),u=r.selectSelectedValue(),c=u!==null?u:n.selectedValue,d=null;c!=null&&n.options&&(d=n.options.findIndex(h=>_e(h.value,c)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:d}),s()},Tp=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},Lp=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=e;if(i.disabled)return;let a=t._event;a.stopPropagation();let l=a.currentTarget.id.slice(6),p=Number(l),o=i.options[l];n.updateSelectedValue({value:o?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("value-change",{detail:{value:o.value,label:o.label,index:p,item:o},bubbles:!0})),r()},Rp=(e,t)=>{let{store:r,render:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),s()},Np=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption({}),s()},Vp=(e,t)=>{let{store:r,render:s,dispatchEvent:i,props:n}=e;if(n.disabled)return;t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),i(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),s()},Pp=(e,t)=>{if(e.props.disabled)return;let{store:r,render:s,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),s()},Dp=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!0}),s()},Bp=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!1}),s()};var bi={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}};var Ar={};N(Ar,{clearHoveredOption:()=>Yp,clearSelectedValue:()=>Xp,closeOptionsPopover:()=>Hp,createInitialState:()=>Mp,openOptionsPopover:()=>Kp,resetSelection:()=>qp,selectSelectedValue:()=>Up,selectState:()=>zp,selectViewData:()=>Wp,setHoveredAddOption:()=>Zp,setHoveredOption:()=>Jp,updateSelectedValue:()=>Gp});var jp=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],Fp=(e={})=>Object.entries(e).filter(([t])=>!jp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Mp=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Wp=({state:e,props:t})=>{let r=Fp(t),s=!!t.disabled,n=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,a=t.placeholder||"Select an option",l=!0,p=t.options||[],o=p.find(c=>_e(c.value,n));o&&(a=o.label,l=!1);let u=p.map((c,d)=>{let h=_e(c.value,n),f=e.hoveredOptionId===d;return{...c,isSelected:h,bgc:f?"ac":h?"mu":""}});return{containerAttrString:r,isDisabled:s,isOpen:e.isOpen,position:e.position,options:u,selectedValue:n,selectedLabel:a,selectedLabelColor:l?"mu-fg":"fg",hasValue:n!=null,showClear:!s&&!t.noClear&&n!=null,showAddOption:!s&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},zp=({state:e})=>e,Up=({state:e})=>e.selectedValue,Kp=({state:e},t={})=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Hp=({state:e})=>{e.isOpen=!1},Gp=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},qp=({state:e})=>{e.selectedValue=void 0},Jp=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Yp=({state:e})=>{e.hoveredOptionId=null},Xp=({state:e})=>{e.selectedValue=void 0},Zp=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered};var vi={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#selectButton v=ol ${containerAttrString} ?disabled=${isDisabled} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-button#selectButton v=ol ",{type:1,path:"containerAttrString"}," ?disabled=",{type:1,path:"isDisabled"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=mu br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0}},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs"]}}],fast:!1}],fast:!1}};var kr={};N(kr,{handleHeaderClick:()=>Qp,handleItemClick:()=>ec});var Qp=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n,a=r.selectHeader();i.currentTarget.id==="headerLabel"?n=a.labelPath:i.currentTarget.id==="headerImage"?n=a.image.path:i.currentTarget.id==="header"&&(n=a.path),s(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},ec=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.itemId||i.currentTarget.id.slice(4),a=r.selectItem(n);s(new CustomEvent("item-click",{detail:{item:a},bubbles:!0,composed:!0}))};var wi={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}};var Sr={};N(Sr,{createInitialState:()=>tc,selectActiveItem:()=>lc,selectHeader:()=>oc,selectItem:()=>pc,selectViewData:()=>ac,setState:()=>cc});var tc=()=>Object.freeze({}),rc=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],sc=(e={})=>Object.entries(e).filter(([t])=>!rc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ze=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},ic=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},nc=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function $r(e,t=null){let r=[];for(let s of e){let i=s.id||s.href||s.path,n=t===i;if(r.push({id:i,title:s.title,href:s.href,type:s.type||"item",icon:s.icon,hrefAttr:s.href?`href=${s.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),s.items&&Array.isArray(s.items))for(let a of s.items){let l=a.id||a.href||a.path,p=t===l;r.push({id:l,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:p,itemBgc:p?"ac":"bg",itemHoverBgc:p?"ac":"mu"})}}return r}var ac=({props:e})=>{let t=Ze(e.header)||e.header,r=Ze(e.items)||e.items,s=e.selectedItemId,i=sc(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=r?$r(r,s):[],p=!ic(e.hideHeader),o=e.bwr||"xs",u=nc(e.w,n),c=n==="full"?"fs":"c",d=n==="full"?"fs":"c",h=n==="full"?"lg":"sm",f=n==="full"?"md":"sm",m=n==="shrunk-lg"?48:40,b=n==="shrunk-lg"?28:20,y=n==="shrunk-lg"?"md":"sm",g=n==="full",_=n==="full",x=n==="full"?"fs":"c",E=n==="full"?"":`ah=${d}`,A=n==="full"?"f":m;return{containerAttrString:i,mode:n,header:a,items:l,sidebarWidth:u,headerAlign:c,itemAlign:d,headerPadding:h,itemPadding:f,itemHeight:m,iconSize:b,firstLetterSize:y,showLabels:g,showGroupLabels:_,itemContentAlign:x,itemAlignAttr:E,itemWidth:A,headerWidth:A,selectedItemId:s,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",showHeader:p,rightBorderWidth:o}},oc=({props:e})=>Ze(e.header)||e.header,lc=({state:e,props:t})=>{let r=Ze(t.items)||t.items;return(r?$r(r):[]).find(i=>i.active)},pc=({props:e},t)=>{let r=Ze(e.items)||e.items;return(r?$r(r):[]).find(i=>i.id===t)},cc=({state:e})=>{};var _i={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg sv ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg sv ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Cr={};N(Cr,{handleBeforeMount:()=>uc,handleOnUpdate:()=>dc,handleValueChange:()=>fc,handleValueInput:()=>hc});var uc=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},dc=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e,a=r?.key!==s?.key,l=r?.value!==s?.value;if(a||l){let p=s?.value??0;i.setValue({value:p}),n()}},fc=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(o=>o?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),s(),i(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},hc=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(o=>o?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),s(),i(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))};var xi={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}};var Ir={};N(Ir,{createInitialState:()=>mc,selectViewData:()=>yc,setValue:()=>gc});var mc=()=>Object.freeze({value:0}),yc=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),gc=({state:e},t={})=>{e.value=t.value};var Ei={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var Or={};N(Or,{handleBeforeMount:()=>bc,handleHeaderClick:()=>wc,handleRowClick:()=>vc});var bc=e=>{},vc=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),a=s.data?.rows?.[n];a&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:a}}))},wc=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,a=t._event.currentTarget.dataset.columnKey,l=r.selectSortInfo(),p="asc";l.column===a&&(l.direction==="asc"?p="desc":l.direction==="desc"&&(p=null)),p?r.setSortColumn({column:a,direction:p}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:a,direction:p,sortInfo:p?{column:a,direction:p}:null}}))};var Ai={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}};var Tr={};N(Tr,{clearSort:()=>Ic,createInitialState:()=>_c,selectSortInfo:()=>Sc,selectState:()=>$c,selectViewData:()=>kc,setSortColumn:()=>Cc});var _c=()=>Object.freeze({sortColumn:null,sortDirection:null}),xc=["id","class","style","slot","data"],Ec=(e={})=>Object.entries(e).filter(([t])=>!xc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ac=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},kc=({state:e,props:t})=>{let r=Ec(t),s=t.data||{columns:[],rows:[]},i=s.rows.map((n,a)=>{let l=s.columns.map(p=>{let o=Ac(n,p.key);return{key:p.key,value:o!=null?String(o):""}});return{index:a,cells:l}});return{containerAttrString:r,columns:s.columns||[],rows:i||[]}},$c=({state:e})=>e,Sc=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),Cc=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},Ic=({state:e})=>{e.sortColumn=null,e.sortDirection=null};var ki={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Lr={};N(Lr,{handleClickItem:()=>Oc});var Oc=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))};var $i={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}};var Rr={};N(Rr,{createInitialState:()=>Tc,selectViewData:()=>Nc});var Tc=()=>Object.freeze({}),Lc=["id","class","style","slot","items","selectedTab"],Rc=(e={})=>Object.entries(e).filter(([t])=>!Lc.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Nc=({props:e})=>{let t=Rc(e),r=e.items||[],s=e.selectedTab,i=r.map(n=>({...n,isSelected:n.id===s,bgColor:n.id===s?"ac":"",borderColor:n.id===s?"":"tr",textColor:n.id===s?"":"mu-fg"}));return{containerAttrString:t,items:i,selectedTab:s}};var Si={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ci={};var Ii={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var Nr={};N(Nr,{createInitialState:()=>Vc,selectViewData:()=>Pc});var Vc=()=>Object.freeze({}),Pc=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""});var Oi={template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=bg bc=bo br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=fg",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," no-overlay"]}}],fast:!0}],fast:!0},refs:{}};var Vr={};N(Vr,{handleAfterMount:()=>Dc,handleOnUpdate:()=>Bc});var Dc=async e=>{let{props:t,store:r,render:s,refs:i}=e,{waveformData:n}=t;r.setWaveformData({data:n}),s();let a=i.canvas;a&&Ti(n,a)},Bc=async(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:a}),s();let l=i.canvas;l&&Ti(a,l)};async function Ti(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let a=t.width,l=t.height;if(r.clearRect(0,0,a,l),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,l),!e||!e.amplitudes)return;let p=e.amplitudes,o=l/2,u=r.createLinearGradient(0,0,0,l);u.addColorStop(0,"#404040"),u.addColorStop(.5,"#A1A1A1"),u.addColorStop(1,"#404040");let c=Math.max(1,a/p.length),d=.2;for(let h=0;h<p.length;h++){let m=p[h]/255*(l*.85),b=h*c,y=o-m/2;r.fillStyle=u,r.fillRect(b,y,Math.max(1,c*(1-d)),m)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var Li={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}};var Pr={};N(Pr,{createInitialState:()=>jc,selectViewData:()=>Mc,setWaveformData:()=>Fc});var jc=()=>Object.freeze({waveformData:null}),Fc=({state:e},t={})=>{e.waveformData=t.data},Mc=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData});var Ri={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}};var Dr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ft=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),dt=e=>{if(e!=null)return e===""?!0:e},Ni=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return dt(r);let s=Dr(t);if(s!==t){let i=e.getAttribute(s);if(i!==null)return dt(i)}},Vi=(e,t)=>{let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i)){let n=e[i];return n!==void 0?n:Ni(e,i)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(s,i){return typeof i=="string"&&r.has(i)},ownKeys(){return[...r]},getOwnPropertyDescriptor(s,i){if(typeof i=="string"&&r.has(i))return{configurable:!0,enumerable:!0,get:()=>{let n=e[i];return n!==void 0?n:Ni(e,i)}}}})};var Pi=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let s of Object.keys(r.properties))if(!t.includes(s))throw new Error(`method '${s}' is declared in schema but missing in .methods.js exports.`)}return!0};var v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Qe={NOT:0};var L=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var Br=e=>{if(!e||e.trim()==="")throw new L("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new L(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new L(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Di=e=>{if(e.trim().endsWith(" in"))throw new L(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new L(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new L(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let s=t.split(",").map(i=>i.trim());for(let i of s)if(!i)throw new L(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new L(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var Bi=(e,t,r=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new re(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new re(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},ji=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${r})`)};var Wc=(e,t,r={})=>{let s={},i={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(s=r.functions||{},i=r.partials||{}):typeof r=="object"&&(s=r));let a=O(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},O=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return W(e.var,r,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return W(e.path,r,s);if(e.type===v.INTERPOLATION)return Uc(e.parts,t,r,s);switch(e.type){case v.FUNCTION:return Mi(e,t,r,s);case v.BINARY:return Wi(e,t,r,s);case v.UNARY:return zi(e,t,r,s);case v.CONDITIONAL:return Hc(e,t,r,s);case v.LOOP:return Xc(e,t,r,s);case v.OBJECT:return Qc(e,t,r,s);case v.ARRAY:return eu(e,t,r,s);case v.PARTIAL:return tu(e,t,r,s);case v.PATH_REFERENCE:return ru(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},Fi=new Map,zc=e=>{let t=[],r="",s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),s=!0;else if(n==="]"){if(s&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let l=a.slice(1,-1);t.push({type:"property",value:l})}else t.push({type:"property",value:a});r=""}s=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},W=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=Fi.get(e);if(!s){let n=[],a="",l=0;for(let p=0;p<e.length;p++){let o=e[p];o==="["?(l++,a+=o):o==="]"?(l--,a+=o):o==="."&&l===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),s=[];for(let p of n){let o=zc(p.trim());s.push(...o)}Fi.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let a=s[n];if(a.type==="property"&&a.value in r){i=r[a.value];continue}if(i==null)return;(a.type==="property"||a.type==="index")&&(i=i[a.value])}return i},Uc=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=O(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},Mi=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw ji(e.name,i);let a=e.args.map(l=>O(l,t,r,s));return n(...a)},Ne=(e,t,r,s)=>{if(e.var&&!e.type)return W(e.var,r,s);switch(e.type){case v.VARIABLE:return W(e.path,r,s);case v.LITERAL:return e.value;case v.BINARY:return Wi(e,t,r,s);case v.UNARY:return zi(e,t,r,s);case v.FUNCTION:return Mi(e,t,r,s);default:return O(e,t,r,s)}},Wi=(e,t,r,s)=>{if(e.op===D.AND||e.op===D.OR){let a=Ne(e.left,t,r,s),l=Ne(e.right,t,r,s);switch(e.op){case D.AND:return a&&l;case D.OR:return a||l}}let i=O(e.left,t,r,s),n=O(e.right,t,r,s);switch(e.op){case D.EQ:return i==n;case D.NEQ:return i!=n;case D.GT:return i>n;case D.LT:return i<n;case D.GTE:return i>=n;case D.LTE:return i<=n;case D.IN:return Array.isArray(n)?n.includes(i):!1;case D.ADD:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},zi=(e,t,r,s)=>{let i=e.op===Qe.NOT?Ne(e.operand,t,r,s):O(e.operand,t,r,s);switch(e.op){case Qe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Kc=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(W(i.path,r,s)){let a=e.bodies[0];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?O(p.parsedKey,t,r,s):p.key,u=p.value;if(u.type===v.LITERAL)l[o]=u.value;else if(u.type===v.VARIABLE)l[o]=W(u.path,r,s);else if(u.type===v.INTERPOLATION){let c=[];for(let d of u.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=W(d.path,r,s);c.push(h!=null?String(h):"")}else{let h=O(d,t,r,s);c.push(h!=null?String(h):"")}l[o]=c.join("")}else l[o]=O(u,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===v.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?O(p.parsedKey,t,r,s):p.key,u=p.value;if(u.type===v.LITERAL)l[o]=u.value;else if(u.type===v.VARIABLE)l[o]=W(u.path,r,s);else if(u.type===v.INTERPOLATION){let c=[];for(let d of u.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=W(d.path,r,s);c.push(h!=null?String(h):"")}else{let h=O(d,t,r,s);c.push(h!=null?String(h):"")}l[o]=c.join("")}else l[o]=O(u,t,r,s)}return l}}}return null},Hc=(e,t,r,s)=>{let i=Kc(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Ne(a,t,r,s))return O(e.bodies[n],t,r,s)}return Ui},Gc=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let a=i.substring(s.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let p of n.properties)if(p.parsedKey)return null;let l=[];for(let p=0;p<t.length;p++){let o=t[p];if(o[a]){let u={};for(let c of n.properties){let d=c.key,h=c.value;if(h.type===v.LITERAL)u[d]=h.value;else if(h.type===v.VARIABLE){let f=h.path;if(f===s)u[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);u[d]=o[m]}else return null}else if(h.type===v.INTERPOLATION){let f=[],m=!0;for(let b of h.parts)if(typeof b=="string")f.push(b);else if(b.type===v.VARIABLE){let y=b.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let g=y.substring(s.length+1),_=o[g];f.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;u[d]=f.join("")}else return null}l.push(u)}}return l}}}return null},qc=(e,t)=>{let r=e.body,s=e.itemVar,i=Gc(e,t);if(i!==null)return i;if(r.type===v.OBJECT&&r.properties.length<=5){for(let l of r.properties)if(l.parsedKey)return null;let n=[],a=!0;for(let l of r.properties){let p=l.key,o=l.value;if(o.type===v.LITERAL)n.push({key:p,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let u=o.path;if(u===s)n.push({key:p,type:"item"});else if(u.startsWith(s+".")){let c=u.substring(s.length+1);if(!c.includes(".")&&!c.includes("["))n.push({key:p,type:"prop",prop:c});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let u=o.parts[0];if(u.type===v.VARIABLE){let c=u.path;if(c===s)n.push({key:p,type:"item_string"});else if(c.startsWith(s+".")){let d=c.substring(s.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:p,type:"prop_string",prop:d});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let l=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let p=0;p<t.length;p++){let o=t[p];l[p]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let p=0;p<t.length;p++){let o=t[p],u={};for(let c of n)if(c.type==="literal")u[c.key]=c.value;else if(c.type==="item")u[c.key]=o;else if(c.type==="prop")u[c.key]=o[c.prop];else if(c.type==="item_string")u[c.key]=o!=null?String(o):"";else if(c.type==="prop_string"){let d=o[c.prop];u[c.key]=d!=null?String(d):""}l[p]=u}return l}}return null},Jc=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<i.length;o++){let u=i[o],c={},d={...s,[l]:u,...p&&{[p]:o}};d.__paths__||(d.__paths__=s.__paths__||{});let h=e.iterable.path||"";if(s&&s.__paths__&&h){let f=h.split("."),m=f[0];m in s.__paths__&&(h=s.__paths__[m],f.length>1&&(h+="."+f.slice(1).join(".")))}d.__paths__={...d.__paths__,[l]:`${h}[${o}]`,...p&&{[p]:o}};for(let f of a.properties){let m=f.parsedKey?O(f.parsedKey,t,r,d):f.key,b=f.value;if(b.type===v.LITERAL)c[m]=b.value;else if(b.type===v.VARIABLE){let y=b.path;if(y===l)c[m]=u;else if(y===p)c[m]=o;else if(y.startsWith(l+".")){let g=y.substring(l.length+1);!g.includes(".")&&!g.includes("[")?c[m]=u[g]:c[m]=W(y,r,{...s,[l]:u,...p&&{[p]:o}})}else c[m]=W(y,r,{...s,[l]:u,...p&&{[p]:o}})}else if(b.type===v.INTERPOLATION){let y=[];for(let g of b.parts)if(typeof g=="string")y.push(g);else if(g.type===v.VARIABLE){let _=g.path,x;if(_===l)x=u;else if(_===p)x=o;else if(_.startsWith(l+".")){let E=_.substring(l.length+1);!E.includes(".")&&!E.includes("[")?x=u[E]:x=W(_,r,{...s,[l]:u,...p&&{[p]:o}})}else x=W(_,r,{...s,[l]:u,...p&&{[p]:o}});y.push(x!=null?String(x):"")}else{let _={...s,[l]:u,...p&&{[p]:o}},x=O(g,t,r,_);y.push(x!=null?String(x):"")}c[m]=y.join("")}else{let y={...s,[l]:u,...p&&{[p]:o}};c[m]=O(b,t,r,y)}}n.push(c)}return n}return null},Yc=(e,t,r)=>{let s=e.body;if(s.type===v.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===v.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===v.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===v.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===v.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let o=[];for(let u=0;u<t.length;u++){let c=t[u];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),o.push(d)}}return o}}}}return null},Xc=(e,t,r,s)=>{let i=O(e.iterable,t,r,s);if(!Array.isArray(i)){let o,u=!1;if(e.iterable.type===v.FUNCTION){u=!0;let d=e.iterable.args.map(h=>h.type===v.LITERAL?typeof h.value=="string"?`'${h.value}'`:String(h.value):h.type===v.VARIABLE?h.path:h.type===v.FUNCTION?`${h.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let c=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Bi(c,i,u)}if(!e.indexVar){let o=Yc(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=qc(e,i);if(o!==null)return o}let n=Jc(e,t,r,s,i);if(n!==null)return n;let a=[],l=e.iterable.path||"";if(s&&s.__paths__&&l){let o=l.split("."),u=o[0];u in s.__paths__&&(l=s.__paths__[u],o.length>1&&(l+="."+o.slice(1).join(".")))}let p=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===v.OBJECT&&o.properties.some(u=>u.key.startsWith("$if ")||u.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let u=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};u.__paths__||(u.__paths__=s.__paths__||{}),u.__paths__={...u.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(u.__paths__[e.indexVar]=o);let c=O(e.body,t,r,u);Array.isArray(c)&&c.length===1&&!p?a.push(c[0]):a.push(c)}return a},Zc=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?O(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let u of a.properties){let c=u.parsedKey?O(u.parsedKey,t,r,s):u.key,d=u.value;if(d.type===v.LITERAL)p[c]=d.value;else if(d.type===v.VARIABLE)p[c]=W(d.path,r,s);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let m=W(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[c]=h.join("")}else if(d.type===v.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,b=f.value;if(b.type===v.LITERAL)h[m]=b.value;else if(b.type===v.VARIABLE)h[m]=W(b.path,r,s);else if(b.type===v.INTERPOLATION){let y=[];for(let g of b.parts)if(typeof g=="string")y.push(g);else if(g.type===v.VARIABLE){let _=W(g.path,r,s);y.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;h[m]=y.join("")}else{o=!1;break}}if(!o)break;p[c]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},Qc=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!Ne(e.whenCondition,i,r,s))return;let n=Zc(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let u of e.properties){let c=u.parsedKey?O(u.parsedKey,t,r,s):u.key,d=u.value;if(d.type===v.LITERAL)o[c]=d.value;else if(d.type===v.VARIABLE)o[c]=W(d.path,r,s);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let m=W(f.path,r,s);h.push(m!=null?String(m):"")}else{let m=O(f,t,r,s);h.push(m!=null?String(m):"")}o[c]=h.join("")}else o[c]=O(d,t,r,s)}return o}let a={},l=null,p=!1;for(let o of e.properties)if(!o.key.startsWith("$if ")&&!o.key.match(/^\$if\s+\w+.*:?$/)&&!o.key.startsWith("$elif")&&!o.key.startsWith("$else")&&!o.key.startsWith("$for ")){p=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let u=O(o.value,t,r,s);if(!p&&u!==null&&u!==void 0)return Array.isArray(u)&&u.length===1?u[0]:u;typeof u=="object"&&u!==null&&!Array.isArray(u)&&Object.assign(a,u)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return O(o.value,t,r,s)}else{let u=o.value;if(u&&u.type===v.OBJECT&&u.properties){let c=u.properties.find(d=>d.key.startsWith("$for "));if(c){let d=O(c.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=O(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let c=o.parsedKey?O(o.parsedKey,t,r,s):o.key,d=O(o.value,t,r,s);d!==void 0&&(a[c]=d)}}return a},Ui={},eu=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let a=O(n,t,r,s);i.push(a)}else{let a=O(n,t,r,s);a!==Ui&&a!==void 0&&i.push(a)}return i},tu=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!Ne(a,p,r,s))return;if(!l[i])throw new re(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new re(`Circular partial reference detected: ${i}`);let u=l[i],c=r,d={...s,_partialStack:[...o,i]};if(s){c={...r};for(let h of Object.keys(s))h.startsWith("_")||(c[h]=s[h])}if(n){let h=O(n,t,r,s);c={...c,...h}}return O(u,t,c,d)},ru=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),a=n[0],l=n.slice(1);if(!s||!(a in s))throw new re(`Path reference '#{${i}}' refers to '${a}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(a in s.__paths__))throw new re(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let p=s.__paths__[a];if(typeof p=="number"){if(l.length>0)throw new re(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},et=Wc;var su=/\$\{([^}]*)\}/g,iu=/#\{([^}]*)\}/g,Hi=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=nu(i,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:n}},nu=(e,t={})=>e.trim()?au(e).map(s=>ou(s.trim(),t)):[],au=e=>{let t=[],r="",s=0,i=!1,n="";for(let a=0;a<e.length;a++){let l=e[a],p=a>0?e[a-1]:"";!i&&(l==='"'||l==="'")?(i=!0,n=l,r+=l):i&&l===n&&p!=="\\"?(i=!1,n="",r+=l):!i&&l==="("?(s++,r+=l):!i&&l===")"?(s--,r+=l):!i&&l===","&&s===0?(t.push(r),r=""):r+=l}return r&&t.push(r),t},ou=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=Hi(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let s=e.trim(),i=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1,a=null;for(let{op:l,type:p}of i){let o=0;for(;o<s.length;){let u=Ee(s.substring(o),l);if(u===-1)break;let c=o+u;c>n&&(n=c,a={op:l,type:p}),o=c+l.length}}if(n!==-1)try{return ee(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},Gi=/^\w+\(.*\)$/,lu=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,pu=e=>{if(!(!e||e.trim()===""||Gi.test(e))&&lu.test(e))throw e.includes("?")&&e.includes(":")?new L(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new L(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new L(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Ki=e=>{let t=e.trim();if(Gi.test(t))throw new L(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new L(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new L(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new L(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new L(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},tt=(e,t={})=>{let r=e.trim();pu(r);let s=Hi(r,t);if(s.isFunction)return{type:s.type,name:s.name,args:s.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let i=0;for(let n of r)n==="["?i++:n==="]"&&i--;if(i!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},jr=(e,t={})=>{let r=e,s=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,u)=>{let c=`__ESCAPED_${s.length}__`;return s.push(u),c}),r=r.replace(/\\(#\{[^}]*\})/g,(o,u)=>{let c=`__ESCAPED_${s.length}__`;return s.push(u),c}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(su)],n=[...r.matchAll(iu)],a=[...i.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,u)=>o.match.index-u.match.index);if(a.length===0){let o=r;for(let u=0;u<s.length;u++)o=o.replace(`__ESCAPED_${u}__`,s[u]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:u}=a[0];try{return u==="variable"?tt(o[1],t):Ki(o[1])}catch(c){if(c.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw c}}let l=[],p=0;for(let{match:o,type:u}of a){let[c,d]=o,h=o.index;if(h>p){let f=r.substring(p,h);for(let m=0;m<s.length;m++)f=f.replace(`__ESCAPED_${m}__`,s[m]);f&&l.push(f)}try{let f;u==="variable"?f=tt(d.trim(),t):f=Ki(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(c);else throw f}p=h+c.length}if(p<r.length){let o=r.substring(p);for(let u=0;u<s.length;u++)o=o.replace(`__ESCAPED_${u}__`,s[u]);o&&l.push(o)}return{type:v.INTERPOLATION,parts:l}};var ve=(e,t)=>typeof e=="string"?jr(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?cu(e,t):uu(e,t):{type:v.LITERAL,value:e},cu=(e,t)=>{let r=[],s=!1;for(let i=0;i<e.length;i++){let n=e[i];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let l=Object.keys(n);if(l.length===1&&l[0].startsWith("$for ")){let p=Ji(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=ve(n,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(s=!0)}return{type:v.ARRAY,items:r,fast:!s}},uu=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new L("$partial value must be a string");if(e.$partial.trim()==="")throw new L("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[y]of n)for(let g of p)if(y===g||y.startsWith(g+" ")||y.startsWith(g+"#")){o.push(g);break}if(o.length>0)throw new L(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:u,$when:c,...d}=e,h={},f=!1;for(let[y,g]of Object.entries(d)){let _=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(_=y.slice(1)),h[_]=g,f=!0}let m=null;if(f&&(m=ve(h,t),m.type===v.OBJECT)){let y=!1;for(let g of m.properties)if(g.value.type===v.VARIABLE||g.value.type===v.INTERPOLATION||g.value.type===v.FUNCTION||g.value.type===v.CONDITIONAL||g.value.type===v.LOOP||g.value.type===v.OBJECT&&!g.value.fast||g.value.type===v.ARRAY&&!g.value.fast){y=!0;break}y&&(m.fast=!1)}let b={type:v.PARTIAL,name:u,data:m};if(c!==void 0){let y;if(typeof c=="string"){if(c.trim()==="")throw new L("Empty condition expression after '$when'");y=ee(c,t)}else y={type:v.LITERAL,value:c};b.whenCondition=y}return b}for(let[p,o]of n)if(p==="$when"){if(i!==null)throw new L("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new L("Missing condition expression after '$when'");let u=typeof o=="string"?o:JSON.stringify(o);if(u.trim()==="")throw new L("Empty condition expression after '$when'");i=ee(u,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new L("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[p,o]=n[a];if(p==="$when"){a++;continue}if(p.startsWith("$if ")||p.match(/^\$if#\w+\s/)||p.match(/^\$if\s+\w+.*:$/)){let u=du(n,a,t);r.push({key:p,value:u.node}),s=!0,a=u.nextIndex}else if(p.startsWith("$for ")){let u=Ji(p,o,t);r.push({key:p,value:u}),s=!0,a++}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new L(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new L("Missing condition expression after '$if'");{let u=ve(o,t);(u.type===v.FUNCTION||u.type===v.CONDITIONAL||u.type===v.LOOP||u.type===v.PARTIAL||u.type===v.OBJECT&&!u.fast||u.type===v.ARRAY&&!u.fast)&&(s=!0);let c=jr(p,t),d={key:p,value:u};(c.type!==v.LITERAL||c.value!==p)&&(d.parsedKey=c),r.push(d),a++}}}let l={type:v.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},du=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let c=a.match(/^\$if#(\w+)\s+(.+)$/);if(c)p=c[1],o=c[2];else throw new L(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());Br(o);let u=ee(o,r);for(s.push(u),i.push(ve(l,r)),n++;n<e.length;){let[c,d]=e[n],h=!1,f;if(p?c.startsWith(`$elif#${p} `)?(f=c.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(c===`$else#${p}`||c===`$else#${p}:`)&&(h=!0,f=null):c.startsWith("$elif ")?(f=c.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(c==="$else"||c==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{Br(f);let m=ee(f,r);s.push(m)}if(i.push(ve(d,r)),n++,f===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},ee=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),u=0,c=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?u++:o[d]===")"&&u--,u<0){c=!1;break}if(c&&u===0)return ee(o,t)}let r=Ee(e,"||");if(r!==-1)return{type:v.BINARY,op:D.OR,left:ee(e.substring(0,r).trim(),t),right:ee(e.substring(r+2).trim(),t)};let s=Ee(e,"&&");if(s!==-1)return{type:v.BINARY,op:D.AND,left:ee(e.substring(0,s).trim(),t),right:ee(e.substring(s+2).trim(),t)};let i=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:o,type:u}of i){let c=Ee(e,o);if(c!==-1)return{type:v.BINARY,op:u,left:ee(e.substring(0,c).trim(),t),right:ee(e.substring(c+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:o,type:u}of l){let c=0;for(;c<e.length;){let d=Ee(e.substring(c),o);if(d===-1)break;let h=c+d;h>n&&(n=h,a={op:o,type:u}),c=h+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:ee(e.substring(0,n).trim(),t),right:ee(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(Ee(e,o)!==-1)throw new L(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:Qe.NOT,operand:ee(e.substring(1).trim(),t)}:qi(e,t)},Ee=(e,t)=>{let r=0,s=0;for(;s<=e.length-t.length;){if(e[s]==="(")r++;else if(e[s]===")")r--;else if(r===0&&e.substring(s,s+t.length)===t)return s;s++}return-1},fu=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},qi=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return tt(r,t);let i=fu(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return tt(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},Ji=(e,t,r)=>{let s=e.substring(5).trim();Di(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new L(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let n=i[1].trim(),a=i[2].trim(),l,p=null;if(n.includes(",")){let c=n.split(",").map(d=>d.trim());if(c.length!==2)throw new L(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);l=c[0],p=c[1]}else l=n;let o=qi(a,r),u=ve(t,r);return{type:v.LOOP,itemVar:l,indexVar:p,iterable:o,body:u}};var hu=(e,t={})=>{let{functions:r={}}=t;return ve(e,r)},ht=hu;var Fr={};N(Fr,{now:()=>mu});var mu=()=>Date.now();var yu=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...Fr,...s},a=ht(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=ht(o,{functions:n});return et(a,t,{functions:n,partials:l})},rt=yu;var we=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);var Yi=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,s])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof s=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(i={})=>{let n=i===void 0?{}:i;if(!we(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return s.call(e,n)}})}})};var rn=Symbol.for("immer-nothing"),Xi=Symbol.for("immer-draftable"),ae=Symbol.for("immer-state");function ce(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ve=Object.getPrototypeOf;function Pe(e){return!!e&&!!e[ae]}function ke(e){return e?sn(e)||Array.isArray(e)||!!e[Xi]||!!e.constructor?.[Xi]||vt(e)||wt(e):!1}var gu=Object.prototype.constructor.toString();function sn(e){if(!e||typeof e!="object")return!1;let t=Ve(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===gu}function mt(e,t){bt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function bt(e){let t=e[ae];return t?t.type_:Array.isArray(e)?1:vt(e)?2:wt(e)?3:0}function zr(e,t){return bt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function nn(e,t,r){let s=bt(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function bu(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function vt(e){return e instanceof Map}function wt(e){return e instanceof Set}function Ae(e){return e.copy_||e.base_}function Ur(e,t){if(vt(e))return new Map(e);if(wt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=sn(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[ae];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],l=s[a];l.writable===!1&&(l.writable=!0,l.configurable=!0),(l.get||l.set)&&(s[a]={configurable:!0,writable:!0,enumerable:l.enumerable,value:e[a]})}return Object.create(Ve(e),s)}else{let s=Ve(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function Jr(e,t=!1){return _t(e)||Pe(e)||!ke(e)||(bt(e)>1&&(e.set=e.add=e.clear=e.delete=vu),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>Jr(s,!0))),e}function vu(){ce(2)}function _t(e){return Object.isFrozen(e)}var wu={};function $e(e){let t=wu[e];return t||ce(0,e),t}var st;function an(){return st}function _u(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Zi(e,t){t&&($e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Kr(e){Hr(e),e.drafts_.forEach(xu),e.drafts_=null}function Hr(e){e===st&&(st=e.parent_)}function Qi(e){return st=_u(st,e)}function xu(e){let t=e[ae];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function en(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[ae].modified_&&(Kr(t),ce(4)),ke(e)&&(e=yt(t,e),t.parent_||gt(t,e)),t.patches_&&$e("Patches").generateReplacementPatches_(r[ae].base_,e,t.patches_,t.inversePatches_)):e=yt(t,r,[]),Kr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==rn?e:void 0}function yt(e,t,r){if(_t(t))return t;let s=t[ae];if(!s)return mt(t,(i,n)=>tn(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return gt(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,a=!1;s.type_===3&&(n=new Set(i),i.clear(),a=!0),mt(n,(l,p)=>tn(e,s,i,l,p,r,a)),gt(e,i,!1),r&&e.patches_&&$e("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function tn(e,t,r,s,i,n,a){if(Pe(i)){let l=n&&t&&t.type_!==3&&!zr(t.assigned_,s)?n.concat(s):void 0,p=yt(e,i,l);if(nn(r,s,p),Pe(p))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(ke(i)&&!_t(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;yt(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&gt(e,i)}}function gt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Jr(t,r)}function Eu(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:an(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=Yr;r&&(i=[s],n=it);let{revoke:a,proxy:l}=Proxy.revocable(i,n);return s.draft_=l,s.revoke_=a,l}var Yr={get(e,t){if(t===ae)return e;let r=Ae(e);if(!zr(r,t))return Au(e,r,t);let s=r[t];return e.finalized_||!ke(s)?s:s===Mr(e.base_,t)?(Wr(e),e.copy_[t]=qr(s,e)):s},has(e,t){return t in Ae(e)},ownKeys(e){return Reflect.ownKeys(Ae(e))},set(e,t,r){let s=on(Ae(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=Mr(Ae(e),t),n=i?.[ae];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(bu(r,i)&&(r!==void 0||zr(e.base_,t)))return!0;Wr(e),Gr(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Mr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wr(e),Gr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Ae(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){ce(11)},getPrototypeOf(e){return Ve(e.base_)},setPrototypeOf(){ce(12)}},it={};mt(Yr,(e,t)=>{it[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});it.deleteProperty=function(e,t){return it.set.call(this,e,t,void 0)};it.set=function(e,t,r){return Yr.set.call(this,e[0],t,r,e[0])};function Mr(e,t){let r=e[ae];return(r?Ae(r):e)[t]}function Au(e,t,r){let s=on(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function on(e,t){if(!(t in e))return;let r=Ve(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=Ve(r)}}function Gr(e){e.modified_||(e.modified_=!0,e.parent_&&Gr(e.parent_))}function Wr(e){e.copy_||(e.copy_=Ur(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var ku=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,s)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(p=n,...o){return a.produce(p,u=>r.call(this,u,...o))}}typeof r!="function"&&ce(6),s!==void 0&&typeof s!="function"&&ce(7);let i;if(ke(t)){let n=Qi(this),a=qr(t,void 0),l=!0;try{i=r(a),l=!1}finally{l?Kr(n):Hr(n)}return Zi(n,s),en(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===rn&&(i=void 0),this.autoFreeze_&&Jr(i,!0),s){let n=[],a=[];$e("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else ce(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...l)=>this.produceWithPatches(a,p=>t(p,...l));let s,i;return[this.produce(t,r,(a,l)=>{s=a,i=l}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ke(e)||ce(8),Pe(e)&&(e=$u(e));let t=Qi(this),r=qr(e,void 0);return r[ae].isManual_=!0,Hr(t),r}finishDraft(e,t){let r=e&&e[ae];(!r||!r.isManual_)&&ce(9);let{scope_:s}=r;return Zi(s,t),en(void 0,s)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let i=t[r];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}r>-1&&(t=t.slice(r+1));let s=$e("Patches").applyPatches_;return Pe(e)?s(e,t):this.produce(e,i=>s(i,t))}};function qr(e,t){let r=vt(e)?$e("MapSet").proxyMap_(e,t):wt(e)?$e("MapSet").proxySet_(e,t):Eu(e,t);return(t?t.scope_:an()).drafts_.push(r),r}function $u(e){return Pe(e)||ce(10,e),ln(e)}function ln(e){if(!ke(e)||_t(e))return e;let t=e[ae],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Ur(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Ur(e,!0);return mt(r,(s,i)=>{nn(r,s,ln(i))}),t&&(t.finalized_=!1),r}var oe=new ku,pn=oe.produce,Um=oe.produceWithPatches.bind(oe),Km=oe.setAutoFreeze.bind(oe),Hm=oe.setUseStrictShallowCopy.bind(oe),Gm=oe.applyPatches.bind(oe),qm=oe.createDraft.bind(oe),Jm=oe.finishDraft.bind(oe);var cn=(e,t,r)=>{let{createInitialState:s,...i}=e,n={},a={},l={};return s&&(l=s({props:t,constants:r})),Object.entries(i).forEach(([p,o])=>{if(p.startsWith("select")){n[p]=(...u)=>o({state:l,props:t,constants:r},...u);return}a[p]=(u={})=>{let c=u===void 0?{}:u;if(!we(c))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=pn(l,d=>o({state:d,props:t,constants:r},c)),l}}),{getState:()=>l,...a,...n}};var un=e=>!we(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{un(t)}),Object.freeze(e)),dn=({setupConstants:e,fileConstants:t})=>{let r=we(e)?e:{},s=we(t)?t:{};return un({...r,...s})};var fn=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,l])=>` ${a}: ${l};`).join(`
1075
- `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let p=Object.entries(a).map(([o,u])=>{let c=s(u);return` ${o} {
1076
- ${c.split(`
1077
- `).map(d=>d?` ${d}`:"").join(`
1074
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let r=t.composedPath();(r[0]===this._dialogElement||r[0].nodeName==="DIALOG"&&r[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,r,i){t==="open"?i!==null&&!this._isOpen?this.isConnected&&this._show():i===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&r!==i&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),i=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let s=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,s.width,s.height,i);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,i,s,n){let p=t,l=r;switch(n){case"t":p=t-i/2,l=r-s-8;break;case"ts":p=t,l=r-s-8;break;case"te":p=t-i,l=r-s-8;break;case"r":p=t+8,l=r-s/2;break;case"rs":p=t+8,l=r;break;case"re":p=t+8,l=r-s;break;case"b":p=t-i/2,l=r+8;break;case"bs":p=t,l=r+8;break;case"be":p=t-i,l=r+8;break;case"l":p=t-i-8,l=r-s/2;break;case"ls":p=t-i-8,l=r;break;case"le":p=t-i-8,l=r-s;break;default:p=t,l=r+8;break}let o=8;return p=Math.max(o,Math.min(p,window.innerWidth-i-o)),l=Math.max(o,Math.min(l,window.innerHeight-s-o)),{left:p,top:l}}get popover(){return this._popoverContainer}},Dr=({render:e,html:t})=>Dt;var js=(e,t)=>{let{store:r,render:i}=e;r.toggleOpen({}),i()},Vs=Object.freeze(Object.defineProperty({__proto__:null,handleClickHeader:js},Symbol.toStringTag,{value:"Module"})),Ds=()=>Object.freeze({open:!1}),Ps=["id","class","style","slot","label","content"],Bs=(e={})=>Object.entries(e).filter(([t])=>!Ps.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ws=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Bs(t)}),Fs=({state:e})=>{e.open=!e.open},zs=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ds,selectViewData:Ws,toggleOpen:Fs},Symbol.toStringTag,{value:"Module"})),Ms=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index),a=Array.isArray(i.items)?i.items[n]:void 0;if(a){if(a.disabled||a.current){s.preventDefault();return}typeof a.href=="string"&&a.href.length>0||s.preventDefault(),r(new CustomEvent("item-click",{detail:{id:a.id,path:a.path,href:a.href,item:a,index:n,trigger:s.type}}))}},Ks=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:Ms},Symbol.toStringTag,{value:"Module"})),Us=()=>Object.freeze({}),Hs=["id","class","style","slot","items","sep","max","separator"],qs=(e={})=>Object.entries(e).filter(([t])=>!Hs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Js=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},Gs=e=>`${e}`.replace(/"/g,"&quot;"),Ys=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},Qs=e=>e.map((t,r)=>{let i=typeof t.href=="string"&&t.href.length>0,s=t.path!==void 0&&t.path!==null&&`${t.path}`!="",n=!!t.current,a=!!t.disabled,p=!n&&!a&&(i||s||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),o=[t.newTab?'target="_blank"':"",l?`rel="${Gs(l)}"`:""].filter(Boolean).join(" ");return{...t,label:t.label||"",index:r,href:i?t.href:void 0,path:s?t.path:void 0,isCurrent:n,isDisabled:a,isInteractive:p,linkExtraAttrs:o,c:n?"fg":"mu-fg"}}),Xs=({props:e})=>{let t=qs(e),r=Array.isArray(e.items)?e.items:[],i=Js(e.max),s=e.sep||"breadcrumb-arrow",n=Qs(r),a=Ys(n,i),p=[];return a.forEach((l,o)=>{p.push(l),o<a.length-1&&p.push({isSeparator:!0})}),{containerAttrString:t,items:p,sep:s}},Zs=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Us,selectViewData:Xs},Symbol.toStringTag,{value:"Module"})),en=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},tn=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=Number(s.currentTarget.dataset.index??s.currentTarget.id.slice(6)),a=i.items[n],p=a?.type||"item";if(!a||p!=="item"||a.disabled){s.preventDefault();return}a.href||s.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:a,id:a.id,path:a.path,href:a.href,trigger:s.type}}))},rn=Object.freeze(Object.defineProperty({__proto__:null,handleClickMenuItem:tn,handleClosePopover:en},Symbol.toStringTag,{value:"Module"})),sn=()=>Object.freeze({}),nn=e=>`${e}`.replace(/"/g,"&quot;"),an=e=>e.map((t,r)=>{let i=t.type||"item",s=i==="separator",n=i==="label",a=i==="item",p=!!t.disabled,l=a&&!p,o=p?"mu-fg":"fg",c=p?"mu":"",d=p?"":"ac",h=typeof t.href=="string"&&t.href.length>0,f=t.rel||(t.newTab?"noopener noreferrer":""),u=[t.newTab?'target="_blank"':"",f?`rel="${nn(f)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:i,isSeparator:s,isLabel:n,isItem:a,isDisabled:p,isInteractive:l,hasHref:h,linkExtraAttrs:u,c:o,bgc:c,hoverBgc:d}}),on=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:an(t),open:!!e.open,x:e.x||0,y:e.y||0,w:e.w||"300",h:e.h||"300",place:e.place||"bs"}},ln=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:sn,selectViewData:on},Symbol.toStringTag,{value:"Module"})),w={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},V={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Mt={NOT:0},E=class extends Error{constructor(e){super(`Parse Error: ${e}`),this.name="JemplParseError"}},oe=class extends Error{constructor(e){super(`Render Error: ${e}`),this.name="JemplRenderError"}},Pr=e=>{if(!e||e.trim()==="")throw new E("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new E(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new E(`Incomplete comparison expression - missing right operand (got: '${e}')`)},pn=e=>{if(e.trim().endsWith(" in"))throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new E(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new E(`Missing iterable expression after 'in' (got: '$for ${e}')`);let i=t.includes(",")?t.split(",").map(s=>s.trim()):[t.trim()];for(let s of i){if(!s)throw new E(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`);if(!/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(s))throw new E(`Invalid loop syntax (got: '$for ${e}')`)}},dn=(e,t,r=!1)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new oe(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new oe(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},cn=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)},un=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=T(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},T=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return F(e.var,r,i);if(e.type===w.LITERAL)return e.value;if(e.type===w.VARIABLE)return F(e.path,r,i);if(e.type===w.INTERPOLATION)return fn(e.parts,t,r,i);switch(e.type){case w.FUNCTION:return hi(e,t,r,i);case w.BINARY:return fi(e,t,r,i);case w.UNARY:return yi(e,t,r,i);case w.CONDITIONAL:return mn(e,t,r,i);case w.LOOP:return _n(e,t,r,i);case w.OBJECT:return An(e,t,r,i);case w.ARRAY:return $n(e,t,r,i);case w.PARTIAL:return kn(e,t,r,i);case w.PATH_REFERENCE:return En(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Br=new Map,hn=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},F=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=Br.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=hn(l.trim());i.push(...o)}Br.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},fn=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=T(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},hi=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw cn(e.name,s);let a=e.args.map(p=>T(p,t,r,i));return n(...a)},Ie=(e,t,r,i)=>{if(e.var&&!e.type)return F(e.var,r,i);switch(e.type){case w.VARIABLE:return F(e.path,r,i);case w.LITERAL:return e.value;case w.BINARY:return fi(e,t,r,i);case w.UNARY:return yi(e,t,r,i);case w.FUNCTION:return hi(e,t,r,i);default:return T(e,t,r,i)}},fi=(e,t,r,i)=>{if(e.op===V.AND||e.op===V.OR){let a=Ie(e.left,t,r,i),p=Ie(e.right,t,r,i);switch(e.op){case V.AND:return a&&p;case V.OR:return a||p}}let s=T(e.left,t,r,i),n=T(e.right,t,r,i);switch(e.op){case V.EQ:return s==n;case V.NEQ:return s!=n;case V.GT:return s>n;case V.LT:return s<n;case V.GTE:return s>=n;case V.LTE:return s<=n;case V.IN:return Array.isArray(n)?n.includes(s):!1;case V.ADD:if(typeof s!="number"||typeof n!="number")throw new oe(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case V.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new oe(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},yi=(e,t,r,i)=>{let s=e.op===Mt.NOT?Ie(e.operand,t,r,i):T(e.operand,t,r,i);switch(e.op){case Mt.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},yn=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===w.VARIABLE)if(F(s.path,r,i)){let n=e.bodies[0];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?T(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=F(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=F(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=T(d,t,r,i);c.push(h!=null?String(h):"")}a[l]=c.join("")}else a[l]=T(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===w.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?T(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===w.LITERAL)a[l]=o.value;else if(o.type===w.VARIABLE)a[l]=F(o.path,r,i);else if(o.type===w.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===w.VARIABLE){let h=F(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=T(d,t,r,i);c.push(h!=null?String(h):"")}a[l]=c.join("")}else a[l]=T(o,t,r,i)}return a}}}return null},mn=(e,t,r,i)=>{let s=yn(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Ie(a,t,r,i))return T(e.bodies[n],t,r,i)}return mi},gn=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===w.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===w.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===w.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===w.LITERAL)c[h]=f.value;else if(f.type===w.VARIABLE){let u=f.path;if(u===i)c[h]=o;else if(u.startsWith(i+".")){let y=u.substring(i.length+1);c[h]=o[y]}else return null}else if(f.type===w.INTERPOLATION){let u=[],y=!0;for(let g of f.parts)if(typeof g=="string")u.push(g);else if(g.type===w.VARIABLE){let b=g.path;if(b===i)u.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let m=b.substring(i.length+1),_=o[m];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},bn=(e,t)=>{let r=e.body,i=e.itemVar,s=gn(e,t);if(s!==null)return s;if(r.type===w.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===w.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===w.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===w.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===w.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let h=d.substring(i.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let h=o[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},vn=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===w.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},h={...i,[p]:c,...l&&{[l]:o}};h.__paths__||(h.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let u=f.split("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let u of a.properties){let y=u.parsedKey?T(u.parsedKey,t,r,h):u.key,g=u.value;if(g.type===w.LITERAL)d[y]=g.value;else if(g.type===w.VARIABLE){let b=g.path;if(b===p)d[y]=c;else if(b===l)d[y]=o;else if(b.startsWith(p+".")){let m=b.substring(p.length+1);!m.includes(".")&&!m.includes("[")?d[y]=c[m]:d[y]=F(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[y]=F(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(g.type===w.INTERPOLATION){let b=[];for(let m of g.parts)if(typeof m=="string")b.push(m);else if(m.type===w.VARIABLE){let _=m.path,A;if(_===p)A=c;else if(_===l)A=o;else if(_.startsWith(p+".")){let $=_.substring(p.length+1);!$.includes(".")&&!$.includes("[")?A=c[$]:A=F(_,r,{...i,[p]:c,...l&&{[l]:o}})}else A=F(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(A!=null?String(A):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},A=T(m,t,r,_);b.push(A!=null?String(A):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[y]=T(g,t,r,b)}}n.push(d)}return n}return null},wn=(e,t,r)=>{let i=e.body;if(i.type===w.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===w.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===w.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===w.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===w.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===w.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},_n=(e,t,r,i)=>{let s=T(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===w.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===w.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===w.VARIABLE?f.path:f.type===w.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${h})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw dn(d,s,c)}if(!e.indexVar){let o=wn(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=bn(e,s);if(o!==null)return o}let n=vn(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===w.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===w.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=T(e.body,t,r,c);if(Array.isArray(d)&&d.length===1&&!l){let h=d[0];a.push(h===void 0?{}:h)}else a.push(d===void 0?{}:d)}return a},xn=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?T(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===w.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?T(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===w.LITERAL)l[d]=h.value;else if(h.type===w.VARIABLE)l[d]=F(h.path,r,i);else if(h.type===w.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===w.VARIABLE){let y=F(u.path,r,i);f.push(y!=null?String(y):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(h.type===w.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,g=u.value;if(g.type===w.LITERAL)f[y]=g.value;else if(g.type===w.VARIABLE)f[y]=F(g.path,r,i);else if(g.type===w.INTERPOLATION){let b=[];for(let m of g.parts)if(typeof m=="string")b.push(m);else if(m.type===w.VARIABLE){let _=F(m.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[y]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},An=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Ie(e.whenCondition,s,r,i))return;let n=xn(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?T(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===w.LITERAL)l[c]=d.value;else if(d.type===w.VARIABLE)l[c]=F(d.path,r,i);else if(d.type===w.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===w.VARIABLE){let u=F(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=T(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=T(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=T(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return T(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===w.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=T(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=T(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?T(l.parsedKey,t,r,i):l.key,d=T(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},mi={},$n=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===w.LOOP){let a=T(n,t,r,i);Array.isArray(a)&&n.flatten!==!1?s.push(...a):s.push(a)}else{let a=T(n,t,r,i);a!==mi&&a!==void 0&&s.push(a)}return s},kn=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Ie(a,l,r,i))return;if(!p[s])throw new oe(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new oe(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=T(n,t,r,i);d={...d,...f}}return T(c,t,d,h)},En=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new oe(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new oe(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new oe(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Sn=/\$\{([^}]*)\}/g,Cn=/#\{([^}]*)\}/g,gi=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=In(s,t);return{isFunction:!0,type:w.FUNCTION,name:i,args:n}},In=(e,t={})=>e.trim()?On(e).map(r=>Tn(r.trim(),t)):[],On=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Tn=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:w.LITERAL,value:parseFloat(e)};if(e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};let r=gi(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Se(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return X(i,t)}catch{return{type:w.VARIABLE,path:i}}return{type:w.VARIABLE,path:i}},bi=/^\w+\(.*\)$/,Ln=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Rn=e=>{if(!(!e||e.trim()===""||bi.test(e))&&Ln.test(e))throw e.includes("?")&&e.includes(":")?new E(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new E(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new E(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Wr=e=>{let t=e.trim();if(bi.test(t))throw new E(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new E(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new E(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new E(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new E(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:w.PATH_REFERENCE,path:t}},tt=(e,t={})=>{let r=e.trim();Rn(r);let i=gi(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:w.VARIABLE,path:r}},vi=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Sn)],n=[...r.matchAll(Cn)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:w.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?tt(o[1],t):Wr(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:w.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,h]=o,f=o.index;if(f>l){let u=r.substring(l,f);for(let y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=tt(h.trim(),t):u=Wr(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:w.INTERPOLATION,parts:p}},_e=(e,t)=>typeof e=="string"?vi(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?jn(e,t):Vn(e,t):{type:w.LITERAL,value:e},Nn=e=>{let{$each:t,...r}=e;if(typeof t!="string")throw new E("$each value must be a non-empty string");let i=t.trim();if(i==="")throw new E("$each value must be a non-empty string");if(Object.keys(r).length===0)throw new E("Empty $each body not allowed");if(r.$partial!==void 0)throw new E("Cannot use $partial with $each at the same level. Wrap $partial in a parent object if you need conditionals.");return{[`$for ${i}`]:r}},jn=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){if(n.$each!==void 0)try{let l=Nn(n),o=Object.keys(l);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=Fr(o[0],l[o[0]],t,!0);r.push(c),i=!0;continue}}catch(l){throw l instanceof E?l:new E(l.message)}let p=Object.keys(n);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let l=Fr(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=_e(n,t);r.push(a),(a.type===w.FUNCTION||a.type===w.CONDITIONAL||a.type===w.LOOP||a.type===w.PARTIAL||a.type===w.OBJECT&&!a.fast||a.type===w.ARRAY&&!a.fast)&&(i=!0)}return{type:w.ARRAY,items:r,fast:!i}},Vn=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new E("$partial value must be a string");if(e.$partial.trim()==="")throw new E("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let m of l)if(b===m||b.startsWith(m+" ")||b.startsWith(m+"#")){o.push(m);break}if(o.length>0)throw new E(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,m]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=m,u=!0}let y=null;if(u&&(y=_e(f,t),y.type===w.OBJECT)){let b=!1;for(let m of y.properties)if(m.value.type===w.VARIABLE||m.value.type===w.INTERPOLATION||m.value.type===w.FUNCTION||m.value.type===w.CONDITIONAL||m.value.type===w.OBJECT&&!m.value.fast||m.value.type===w.ARRAY&&!m.value.fast){b=!0;break}b&&(y.fast=!1)}let g={type:w.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new E("Empty condition expression after '$when'");b=X(d,t)}else b={type:w.LITERAL,value:d};g.whenCondition=b}return g}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new E("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new E("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new E("Empty condition expression after '$when'");s=X(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new E("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l==="$each")throw new E("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=Dn(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let c=l.match(/^\$for(?::(\w+))?\s/)?.[1]||"",d=c?`:${c}`:"";throw new E(`$for loops must be inside arrays - use '- $for${d} item in items:' instead of '$for${d} item in items:'. For cleaner object generation syntax, consider using $each.`)}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new E(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new E("Missing condition expression after '$if'");{let c=_e(o,t);(c.type===w.FUNCTION||c.type===w.CONDITIONAL||c.type===w.PARTIAL||c.type===w.OBJECT&&!c.fast||c.type===w.ARRAY&&!c.fast)&&(i=!0);let d=vi(l,t),h={key:l,value:c};(d.type!==w.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),a++}}}let p={type:w.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},Dn=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new E(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());Pr(o);let c=X(o,r);for(i.push(c),s.push(_e(p,r)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)i.push(null);else{Pr(u);let y=X(u,r);i.push(y)}if(s.push(_e(h,r)),n++,u===null)break}else break}return{node:{type:w.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},X=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let h=0;h<o.length;h++)if(o[h]==="("?c++:o[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return X(o,t)}let r=Se(e,"||");if(r!==-1)return{type:w.BINARY,op:V.OR,left:X(e.substring(0,r).trim(),t),right:X(e.substring(r+2).trim(),t)};let i=Se(e,"&&");if(i!==-1)return{type:w.BINARY,op:V.AND,left:X(e.substring(0,i).trim(),t),right:X(e.substring(i+2).trim(),t)};let s=[{op:">=",type:V.GTE},{op:"<=",type:V.LTE},{op:"==",type:V.EQ},{op:"!=",type:V.NEQ},{op:">",type:V.GT},{op:"<",type:V.LT},{op:" in ",type:V.IN}];for(let{op:o,type:c}of s){let d=Se(e,o);if(d!==-1)return{type:w.BINARY,op:c,left:X(e.substring(0,d).trim(),t),right:X(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:V.ADD},{op:" - ",type:V.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let h=Se(e.substring(d),o);if(h===-1)break;let f=d+h;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:w.BINARY,op:a.type,left:X(e.substring(0,n).trim(),t),right:X(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Se(e,o)!==-1)throw new E(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:w.UNARY,op:Mt.NOT,operand:X(e.substring(1).trim(),t)}:wi(e,t)},Se=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},Pn=e=>{if(e=e.trim(),e==="true")return{type:w.LITERAL,value:!0};if(e==="false")return{type:w.LITERAL,value:!1};if(e==="null")return{type:w.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:w.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:w.LITERAL,value:""};if(e==="{}")return{type:w.LITERAL,value:{}};if(e==="[]")return{type:w.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:w.LITERAL,value:t}:{type:w.VARIABLE,path:e}},wi=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return tt(r,t);let i=Pn(r);if(i.type===w.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:w.VARIABLE,path:r};try{return tt(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Bn=(e,t=!1)=>{try{pn(e)}catch(r){if(r instanceof E&&t){let i=r.message.replace(/\$for/g,"$each");throw new E(i.replace("Parse Error: ",""))}throw r}},Fr=(e,t,r,i=!1)=>{let s=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(s);if(!n){let g=i?"$each":"$for";throw new E(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let a=n[1],p=n[2].trim();Bn(p,i);let l=p.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let g=i?"$each":"$for";throw new E(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${p}')`)}let o=l[1].trim(),c=l[2].trim(),d,h=null;if(o.includes(",")){let g=o.split(",").map(b=>b.trim());if(g.length!==2)throw new E(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);d=g[0],h=g[1]}else d=o;let f=["this","undefined","null","true","false"];if(f.includes(d))throw new E(`Reserved variable name: ${d}`);if(h&&f.includes(h))throw new E(`Reserved variable name: ${h}`);let u=wi(c,r),y=_e(t,r);return{type:w.LOOP,itemVar:d,indexVar:h,iterable:u,body:y,flatten:a!=="nested"}},zr=(e,t={})=>{let{functions:r={}}=t;return _e(e,r)},Wn=()=>Date.now(),Fn=Object.freeze(Object.defineProperty({__proto__:null,now:Wn},Symbol.toStringTag,{value:"Module"})),zn=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...Fn,...i},a=zr(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=zr(o,{functions:n});return un(a,t,{functions:n,partials:p})},tr=e=>e!==null&&typeof e=="object",rt=e=>tr(e)&&!Array.isArray(e),Mn=e=>typeof e=="string"&&e.includes("."),_i=e=>typeof e=="string"&&/[\[\]]/.test(e);function xi(e,t){let r={};for(let i of t){if(typeof i!="string"||i.length===0)continue;let s=le(e,i);s!==void 0&&ue(r,i,s)}return r}function Kn(e){if(!rt(e)||!Array.isArray(e.fields))return e;let t=(r=[])=>r.map(i=>{if(!rt(i))return i;if(typeof i.$when=="string"&&i.$when.trim().length>0){let{$when:s,...n}=i,a=Array.isArray(n.fields)?{...n,fields:t(n.fields)}:n;return{[`$if ${s}`]:a}}return Array.isArray(i.fields)?{...i,fields:t(i.fields)}:i});return{...e,fields:t(e.fields)}}var le=(e,t,r=void 0)=>{if(!t||!tr(e)||_i(t))return r;let i=t.split(".").filter(n=>n!==""),s=e;for(let n of i){if(s==null||!(n in s))return Object.prototype.hasOwnProperty.call(e,t)?e[t]:r;s=s[n]}return s},ue=(e,t,r)=>{if(!tr(e)||typeof t!="string"||t.length===0||_i(t))return e;let i=t.split(".").filter(n=>n!=="");if(i.length===0)return e;Mn(t)&&Object.prototype.hasOwnProperty.call(e,t)&&delete e[t];let s=e;for(let n=0;n<i.length-1;n++){let a=i[n];(!(a in s)||typeof s[a]!="object"||s[a]===null)&&(s[a]={}),s=s[a]}return s[i[i.length-1]]=r,e},Un=["id","class","style","slot","form","defaultValues","disabled","context"],Hn=(e={})=>Object.entries(e).filter(([t,r])=>!(Un.includes(t)||r==null||typeof r=="object"||typeof r=="function")).map(([t,r])=>`${t}=${String(r)}`).join(" "),qn={email:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,url:/^https?:\/\/.+/},ce={required:"This field is required",minLength:e=>`Must be at least ${e} characters`,maxLength:e=>`Must be at most ${e} characters`,pattern:"Invalid format",invalidDate:"Invalid date format",invalidTime:"Invalid time format",invalidDateTime:"Invalid date and time format",minTemporal:e=>`Must be on or after ${e}`,maxTemporal:e=>`Must be on or before ${e}`},Jn="input-date",Gn="input-time",Yn="input-datetime",Qn=/^(\d{4})-(\d{2})-(\d{2})$/,Xn=/^(\d{2}):(\d{2})(?::(\d{2}))?$/,Zn=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}(?::\d{2})?)$/,ea=e=>{if(typeof e!="string")return null;let t=Qn.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=Number(t[3]);if(!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||i<1||i>12||s<1||s>31)return null;let n=new Date(Date.UTC(r,i-1,s));return n.getUTCFullYear()===r&&n.getUTCMonth()===i-1&&n.getUTCDate()===s?{year:r,month:i,day:s}:null},ta=e=>{if(typeof e!="string")return null;let t=Xn.exec(e);if(!t)return null;let r=Number(t[1]),i=Number(t[2]),s=t[3]===void 0?0:Number(t[3]);return!Number.isInteger(r)||!Number.isInteger(i)||!Number.isInteger(s)||r<0||r>23||i<0||i>59||s<0||s>59?null:{hour:r,minute:i,second:s}},Ai=e=>{let t=ta(e);return t?`${String(t.hour).padStart(2,"0")}:${String(t.minute).padStart(2,"0")}:${String(t.second).padStart(2,"0")}`:null},$i=e=>ea(e)?e:null,ra=e=>{if(typeof e!="string")return null;let t=Zn.exec(e);if(!t)return null;let r=$i(t[1]),i=Ai(t[2]);return!r||!i?null:`${r}T${i}`},ia=e=>e===Jn?{normalize:$i,invalidMessage:ce.invalidDate}:e===Gn?{normalize:Ai,invalidMessage:ce.invalidTime}:e===Yn?{normalize:ra,invalidMessage:ce.invalidDateTime}:null,sa=(e,t)=>{let r=ia(e.type);if(!r||t==null||t==="")return null;let i=r.normalize(String(t));if(!i)return r.invalidMessage;if(e.min!==void 0&&e.min!==null&&String(e.min)!==""){let s=r.normalize(String(e.min));if(s&&i<s)return ce.minTemporal(String(e.min))}if(e.max!==void 0&&e.max!==null&&String(e.max)!==""){let s=r.normalize(String(e.max));if(s&&i>s)return ce.maxTemporal(String(e.max))}return null},lt=(e,t)=>{if(e.required){let i=t==null||t===""||typeof t=="boolean"&&t===!1,s=e.type==="input-number"&&t===null;if(e.type==="input-number"?s:i)return typeof e.required=="object"&&e.required.message?e.required.message:ce.required}let r=sa(e,t);if(r)return r;if(Array.isArray(e.rules))for(let i of e.rules){let s=na(i,t);if(s)return s}return null},na=(e,t)=>{if(t==null||t==="")return null;let r=String(t);switch(e.rule){case"minLength":return r.length<e.value?e.message||ce.minLength(e.value):null;case"maxLength":return r.length>e.value?e.message||ce.maxLength(e.value):null;case"pattern":{let i=qn[e.value];if(!i)try{i=new RegExp(e.value)}catch{return e.message||ce.pattern}return i.test(r)?null:e.message||ce.pattern}default:return null}},pt=(e,t)=>{let r={},i=ie(e);for(let s of i){let n=le(t,s.name),a=lt(s,n);a&&(r[s.name]=a)}return{valid:Object.keys(r).length===0,errors:r}},aa=["section","read-only-text","slot"],rr=e=>!aa.includes(e.type),ie=e=>{let t=[];for(let r of e)r.type==="section"&&Array.isArray(r.fields)?t.push(...ie(r.fields)):rr(r)&&t.push(r);return t},ir=e=>{switch(e.type){case"input-text":case"input-date":case"input-time":case"input-datetime":case"input-textarea":case"popover-input":return"";case"input-number":return null;case"select":return null;case"checkbox":return!1;case"color-picker":return"#000000";case"slider":case"slider-with-input":return e.min!==void 0?e.min:0;case"image":return null;default:return null}},sr=(e,t=0)=>{let r=[],i=t;for(let s of e)if(s.type==="section"){if(r.push({...s,_isSection:!0,_idx:i}),i++,Array.isArray(s.fields)){let n=sr(s.fields,i);r.push(...n),i+=n.length}}else r.push({...s,_isSection:!1,_idx:i}),i++;return r},oa=()=>Object.freeze({formValues:{},errors:{},reactiveMode:!1,tooltipState:{open:!1,x:0,y:0,content:""}}),ee=({state:e,props:t})=>{let{form:r={}}=t||{},i=Kn(r),s=rt(t?.context)?t.context:{},n=rt(e?.formValues)?e.formValues:{},a={...s,...n,formValues:n};return Object.keys(a).length>0?zn(i,a):i},la=({state:e,props:t})=>{let r=Hn(t),i=ee({state:e,props:t}),s=i.fields||[],n=!!t?.disabled,a=sr(s);a.forEach((d,h)=>{if(d._arrIdx=h,d._isSection)return;let f=rr(d);if(d._disabled=n||!!d.disabled,f&&d.name&&(d._error=e.errors[d.name]||null),d.type==="input-text"&&(d._inputType=d.inputType||"text"),d.type==="select"){let u=le(e.formValues,d.name);d._selectedValue=u!==void 0?u:null,d.placeholder=d.placeholder||"",d.noClear=d.clearable===!1}if(d.type==="image"){let u=le(e.formValues,d.name);d._imageSrc=u&&String(u).trim()?u:null,d.placeholderText=d.placeholderText||"No Image"}if(d.type==="read-only-text"&&(d.content=d.content||""),d.type==="checkbox"){let u=typeof d.content=="string"?d.content:typeof d.checkboxLabel=="string"?d.checkboxLabel:"";d._checkboxText=u}});let p=i.actions||{buttons:[]},l=p.layout||"split",o=(p.buttons||[]).map((d,h)=>({...d,_globalIdx:h,variant:d.variant||"se",_disabled:n||!!d.disabled,pre:d.pre||"",suf:d.suf||""})),c;return l==="split"?c={_layout:"split",buttons:o,_leftButtons:o.filter(d=>d.align==="left"),_rightButtons:o.filter(d=>d.align!=="left")}:c={_layout:l,buttons:o,_allButtons:o},{containerAttrString:r,title:i?.title||"",description:i?.description||"",flatFields:a,actions:c,formValues:e.formValues,tooltipState:e.tooltipState}},ke=({state:e,props:t})=>{let r=ee({state:e,props:t}),i=ie(r.fields||[]);return xi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},pa=({state:e,props:t},r={})=>{let{name:i,value:s}=r;i&&(ue(e.formValues,i,s),Ge({state:e,props:t}))},Ge=({state:e,props:t})=>{if(!t)return;let r=ee({state:e,props:t}),i=ie(r.fields||[]);e.formValues=xi(e.formValues,i.map(s=>s.name).filter(s=>typeof s=="string"&&s.length>0))},da=({state:e},t={})=>{let{values:r}=t;!r||typeof r!="object"||Object.keys(r).forEach(i=>{ue(e.formValues,i,r[i])})},ca=({state:e},t={})=>{let{defaultValues:r={}}=t;e.formValues=r?structuredClone(r):{},e.errors={},e.reactiveMode=!1},ua=({state:e},t={})=>{e.errors=t.errors||{}},ha=({state:e},t={})=>{let{name:r}=t;r&&e.errors[r]&&delete e.errors[r]},fa=({state:e})=>{e.reactiveMode=!0},ya=({state:e},t={})=>{let{x:r,y:i,content:s}=t;e.tooltipState={open:!0,x:r,y:i,content:s}},ma=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}},ga=Object.freeze(Object.defineProperty({__proto__:null,clearFieldError:ha,collectAllDataFields:ie,createInitialState:oa,flattenFields:sr,get:le,getDefaultValue:ir,hideTooltip:ma,isDataField:rr,pruneHiddenValues:Ge,resetFormValues:ca,selectForm:ee,selectFormValues:ke,selectViewData:la,set:ue,setErrors:ua,setFormFieldValue:pa,setFormValues:da,setReactiveMode:fa,showTooltip:ya,validateField:lt,validateForm:pt},Symbol.toStringTag,{value:"Module"})),ki=({field:e,target:t,value:r})=>{!e||!t||["slider-with-input","popover-input"].includes(e.type)&&(r==null?t.removeAttribute("value"):t.setAttribute("value",String(r)))},Ei=({form:e,formValues:t={},refs:r,formDisabled:i=!1})=>{let s=e.fields||[],n=0,a=p=>{for(let l of p){if(l.type==="section"){n++,Array.isArray(l.fields)&&a(l.fields);continue}let o=r[`field${n}`];if(n++,!o)continue;let c=i||!!l.disabled;if(["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"].includes(l.type)){let d=le(t,l.name);if(d==null?o.removeAttribute("value"):o.setAttribute("value",String(d)),l.type==="slider-with-input"&&o.store?.setValue){let h=Number(d??0);o.store.setValue({value:Number.isFinite(h)?h:0}),typeof o.render=="function"&&o.render()}l.type==="popover-input"&&o.store?.setValue&&(o.store.setValue({value:d==null?"":String(d)}),typeof o.render=="function"&&o.render())}l.type==="checkbox"&&(le(t,l.name)?o.setAttribute("checked",""):o.removeAttribute("checked")),["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input"].includes(l.type)&&l.placeholder&&o.getAttribute("placeholder")!==l.placeholder&&(l.placeholder===void 0||l.placeholder===null?o.removeAttribute("placeholder"):o.setAttribute("placeholder",l.placeholder)),c?o.setAttribute("disabled",""):o.removeAttribute("disabled")}};a(s)},ba=(e,t)=>{let r=t?.defaultValues||{},i={};Object.keys(r).forEach(p=>{ue(i,p,r[p])});let s=ee({state:{formValues:i},props:t}),n=ie(s.fields||[]),a={};for(let p of n){let l=le(r,p.name);l!==void 0?ue(a,p.name,l):ue(a,p.name,ir(p))}e.resetFormValues({defaultValues:a})},va=e=>{let{store:t,props:r}=e;ba(t,r)},wa=e=>{let{props:t,refs:r,render:i}=e,s=e.store.getState(),n=ee({state:s,props:t});Ei({form:n,formValues:s.formValues,refs:r,formDisabled:!!t?.disabled}),i()},_a=(e,t)=>{let{newProps:r}=t,{store:i,render:s,refs:n}=e,a=!!r?.disabled,p=i.getState();Ge({state:p,props:r});let l=ee({state:p,props:r});Ei({form:l,formValues:p.formValues,refs:n,formDisabled:a}),s()},xa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Ge({state:o,props:n});let c=ee({state:o,props:n}),d=ie(c.fields||[]).find(h=>h.name===p);if(ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let h=lt(d,l);h?r.setErrors({errors:{...o.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-input",{bubbles:!0,detail:{name:p,value:l,values:ke({state:r.getState(),props:n})}}))},Aa=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event,p=a.currentTarget.dataset.fieldName;if(!p||!a.detail||!Object.prototype.hasOwnProperty.call(a.detail,"value"))return;let l=a.detail.value;r.setFormFieldValue({name:p,value:l});let o=r.getState();Ge({state:o,props:n});let c=ee({state:o,props:n}),d=ie(c.fields||[]).find(h=>h.name===p);if(ki({field:d,target:a.currentTarget,value:l}),o.reactiveMode&&d){let h=lt(d,l);h?r.setErrors({errors:{...o.errors,[p]:h}}):r.clearFieldError({name:p})}s(),i(new CustomEvent("form-change",{bubbles:!0,detail:{name:p,value:l,values:ke({state:r.getState(),props:n})}}))},$a=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event.currentTarget.dataset.actionId;if(!a)return;let p=r.getState(),l=ee({state:p,props:n}),o=((l.actions||{}).buttons||[]).find(d=>d.id===a),c=ke({state:p,props:n});if(o&&o.validate){let d=ie(l.fields||[]),{valid:h,errors:f}=pt(d,p.formValues);r.setErrors({errors:f}),h||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c,valid:h,errors:f}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:a,values:c}}))},ka=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{store:i,dispatchEvent:s,props:n}=e,a=r.currentTarget.dataset.fieldName;s(new CustomEvent("form-field-event",{bubbles:!0,detail:{name:a,event:r.type,values:ke({state:i.getState(),props:n})}}))},Ea=(e,t)=>{let{store:r,dispatchEvent:i,render:s,props:n}=e,a=t._event;if(a.key==="Enter"&&!a.shiftKey){let p=a.target;if(p.tagName==="TEXTAREA"||p.tagName==="RTGL-TEXTAREA")return;a.preventDefault();let l=r.getState(),o=ee({state:l,props:n}),c=(o.actions||{}).buttons||[],d=c.find(f=>f.validate)||c[0];if(!d)return;let h=ke({state:l,props:n});if(d.validate){let f=ie(o.fields||[]),{valid:u,errors:y}=pt(f,l.formValues);r.setErrors({errors:y}),u||r.setReactiveMode(),s(),i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h,valid:u,errors:y}}))}else i(new CustomEvent("form-action",{bubbles:!0,detail:{actionId:d.id,values:h}}))}},Sa=(e,t)=>{let{store:r,render:i,props:s}=e,n=t._event,a=n.currentTarget.dataset.fieldName,p=ee({state:r.getState(),props:s}),l=ie(p.fields||[]).find(o=>o.name===a);if(l&&l.tooltip){let o=n.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:typeof l.tooltip=="string"?l.tooltip:l.tooltip.content||""}),i()}},Ca=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},Ia=Object.freeze(Object.defineProperty({__proto__:null,handleActionClick:$a,handleAfterMount:wa,handleBeforeMount:va,handleImageClick:ka,handleKeyDown:Ea,handleOnUpdate:_a,handleTooltipMouseEnter:Sa,handleTooltipMouseLeave:Ca,handleValueChange:Aa,handleValueInput:xa},Symbol.toStringTag,{value:"Module"})),Oa=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","color-picker","slider","slider-with-input","popover-input"],Ta=["input-text","input-date","input-time","input-datetime","input-number","input-textarea","popover-input","slider-with-input"],La=({ref:e,fieldType:t,value:r,forceRefresh:i=!1})=>{if(Oa.includes(t)){if(i&&e.removeAttribute("value"),r==null){if(Ta.includes(t)&&i){if(t==="popover-input"){e.removeAttribute("value");return}e.setAttribute("value","");return}e.removeAttribute("value");return}e.setAttribute("value",String(r))}},Si=({ref:e,value:t})=>{e&&e?.store?.updateSelectedValue&&(e.store.updateSelectedValue({value:t}),typeof e.render=="function"&&e.render())},Ra=e=>{let t=new Map;return!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("[data-field-name]").forEach(r=>{let i=r.getAttribute("data-field-name");i&&t.set(i,r)}),t},Mr=e=>e?.renderTarget?e.renderTarget:e?.shadowRoot?e.shadowRoot:e?.shadow,Na=({root:e,values:t={}})=>{!e||typeof e.querySelectorAll!="function"||e.querySelectorAll("rtgl-select[data-field-name]").forEach(r=>{let i=r.dataset?.fieldName;if(!i)return;let s=le(t,i);Si({ref:r,value:s})})},ja=function(){let e=this.store.getState();return ke({state:e,props:this.props})},Va=function(e={}){let t=e&&typeof e=="object"&&e.values&&typeof e.values=="object"?e.values:e;if(!t||typeof t!="object"||Array.isArray(t))return;this.store.setFormValues({values:t}),this.store.pruneHiddenValues();let r=this.store.getState(),i=ee({state:r,props:this.props}),s=ie(i.fields||[]),n=Ra(Mr(this));for(let p of s){if(!p.name)continue;let l=n.get(p.name);if(!l)continue;let o=Object.prototype.hasOwnProperty.call(t,p.name),c=le(t,p.name);if(!o&&c===void 0)continue;let d=le(r.formValues,p.name);La({ref:l,fieldType:p.type,value:d,forceRefresh:!0}),typeof l?.tagName=="string"&&l.tagName.toUpperCase()==="RTGL-SELECT"&&Si({ref:l,value:d}),p.type==="checkbox"&&(d?l.setAttribute("checked",""):l.removeAttribute("checked"))}this.render();let a=()=>{let p=this.store.getState();Na({root:Mr(this),values:p.formValues})};a(),setTimeout(()=>{a()},0)},Da=function(){let e=this.store.getState(),t=ee({state:e,props:this.props}),r=ie(t.fields||[]),{valid:i,errors:s}=pt(r,e.formValues);return this.store.setErrors({errors:s}),i||this.store.setReactiveMode(),this.render(),{valid:i,errors:s}},Pa=function(){let e=this.props?.defaultValues||{},t={};Object.keys(e).forEach(n=>{ue(t,n,e[n])});let r=ee({state:{formValues:t},props:this.props}),i=ie(r.fields||[]),s={};for(let n of i){let a=le(e,n.name);a!==void 0?ue(s,n.name,a):ue(s,n.name,ir(n))}this.store.resetFormValues({defaultValues:s}),this.setValues(s)},Ba=Object.freeze(Object.defineProperty({__proto__:null,getValues:ja,reset:Pa,setValues:Va,validate:Da},Symbol.toStringTag,{value:"Module"})),Wa=e=>{let t=e.selectUiType();return t==="dropdown"||t==="formDialog"?null:e.selectConfig().mode==="confirm"?!1:null},ge=({store:e,render:t,globalUI:r,emitResult:i=!1,result:s})=>{if(!e.selectIsOpen())return;let n=s!==void 0?s:Wa(e);e.closeAll(),t(),i&&r.emit("event",n)},dt=({store:e,render:t,globalUI:r})=>{e.selectIsOpen()&&ge({store:e,render:t,globalUI:r,emitResult:!0})},Fa=(e,t)=>{setTimeout(()=>{let{store:r,refs:i}=e;if(!r.selectIsOpen()||r.selectUiType()!=="formDialog")return;let s=r.selectFormDialogConfig?.();if(!s||s.key!==t||typeof s.mount!="function")return;let n=i.formDialog;n&&s.mount(n)},0)},za=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},Ma=e=>{let{store:t,render:r,globalUI:i}=e,s=t.selectConfig().mode==="confirm"?!0:null;ge({store:t,render:r,globalUI:i,emitResult:!0,result:s})},Ka=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:!1})},Ua=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0,result:null})},Ha=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event,{index:a,item:p}=n.detail;ge({store:r,render:i,globalUI:s,emitResult:!0,result:{index:a,item:p}})},qa=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return dt({store:r,render:i,globalUI:s}),r.setAlertConfig(n),i(),new Promise(a=>{s.once("event",()=>{a()})})},Ja=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return dt({store:r,render:i,globalUI:s}),r.setConfirmConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},Ga=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;return dt({store:r,render:i,globalUI:s}),r.setDropdownConfig(n),i(),new Promise(a=>{s.once("event",p=>{a(p)})})},Ya=async(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t;dt({store:r,render:i,globalUI:s}),r.setFormDialogConfig(n),i();let a=r.selectFormDialogConfig?.().key;return Fa(e,a),new Promise(p=>{s.once("event",l=>{p(l)})})},Qa=(e,t)=>{let{store:r,render:i,globalUI:s}=e,n=t._event?.detail||{};n.valid!==!1&&ge({store:r,render:i,globalUI:s,emitResult:!0,result:n})},Xa=(e,t)=>{let{store:r,refs:i}=e,s=t._event?.detail||{},n=r.selectFormDialogConfig?.();typeof n?.onFieldEvent=="function"&&n.onFieldEvent({detail:s,formEl:i.formDialog||null})},Za=e=>{let{store:t,render:r,globalUI:i}=e;ge({store:t,render:r,globalUI:i,emitResult:!0})},eo=Object.freeze(Object.defineProperty({__proto__:null,handleCancel:Ka,handleCloseAll:Za,handleConfirm:Ma,handleDialogClose:za,handleDropdownClose:Ua,handleDropdownItemClick:Ha,handleFormAction:Qa,handleFormFieldEvent:Xa,handleShowAlert:qa,handleShowConfirm:Ja,handleShowDropdownMenu:Ga,handleShowFormDialog:Ya},Symbol.toStringTag,{value:"Module"})),to=new Set(["sm","md","lg","f"]),Kr=e=>!e||typeof e!="object"||Array.isArray(e)?{}:e,Kt=(e,t="md")=>to.has(e)?e:t,ro=()=>Object.freeze({isOpen:!1,uiType:"dialog",config:{status:void 0,title:"",message:"",confirmText:"OK",cancelText:"Cancel",mode:"alert"},dropdownConfig:{items:[],x:0,y:0,place:"bs"},formDialogConfig:{form:null,defaultValues:{},context:{},disabled:!1,size:"md",key:0,onFieldEvent:null,mount:null}}),io=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showAlert");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"OK",cancelText:"",mode:"alert"},e.uiType="dialog",e.isOpen=!0},so=({state:e},t={})=>{if(!t.message)throw new Error("message is required for showConfirm");e.config={status:t.status||void 0,title:t.title||"",message:t.message,confirmText:t.confirmText||"Yes",cancelText:t.cancelText||"Cancel",mode:"confirm"},e.uiType="dialog",e.isOpen=!0},no=({state:e},t={})=>{if(!t.items||!Array.isArray(t.items))throw new Error("items array is required for showDropdown");e.dropdownConfig={items:t.items,x:t.x||0,y:t.y||0,place:t.place||"bs"},e.uiType="dropdown",e.isOpen=!0},ao=({state:e},t={})=>{if(!t.form||typeof t.form!="object"||Array.isArray(t.form))throw new Error("form object is required for showFormDialog");let r=e.formDialogConfig?.key||0;e.formDialogConfig={form:t.form,defaultValues:Kr(t.defaultValues),context:Kr(t.context),disabled:!!t.disabled,size:Kt(t.size,"md"),key:r+1,onFieldEvent:typeof t.onFieldEvent=="function"?t.onFieldEvent:null,mount:typeof t.mount=="function"?t.mount:null},e.uiType="formDialog",e.isOpen=!0},oo=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},lo=({state:e})=>e.config,po=({state:e})=>e.dropdownConfig,co=({state:e})=>e.formDialogConfig,uo=({state:e})=>e.uiType,ho=({state:e})=>e.isOpen,fo=({state:e})=>{let t=e.isOpen&&e.uiType==="dialog",r=e.isOpen&&e.uiType==="formDialog";return{isOpen:e.isOpen,uiType:e.uiType,config:e.config,dropdownConfig:{items:e.dropdownConfig?.items||[],x:e.dropdownConfig?.x||0,y:e.dropdownConfig?.y||0,place:e.dropdownConfig?.place||"bs"},formDialogConfig:{form:e.formDialogConfig?.form||{fields:[],actions:{buttons:[]}},defaultValues:e.formDialogConfig?.defaultValues||{},context:e.formDialogConfig?.context||{},disabled:!!e.formDialogConfig?.disabled,size:Kt(e.formDialogConfig?.size,"md"),key:e.formDialogConfig?.key||0},isDialogOpen:t,isFormDialogOpen:r,isDialogContainerOpen:t||r,isDropdownOpen:e.isOpen&&e.uiType==="dropdown",dialogSize:r?Kt(e.formDialogConfig?.size,"md"):"sm"}},yo=Object.freeze(Object.defineProperty({__proto__:null,closeAll:oo,createInitialState:ro,selectConfig:lo,selectDropdownConfig:po,selectFormDialogConfig:co,selectIsOpen:ho,selectUiType:uo,selectViewData:fo,setAlertConfig:io,setConfirmConfig:so,setDropdownConfig:no,setFormDialogConfig:ao},Symbol.toStringTag,{value:"Module"})),mo=(e,t)=>{let{dispatchEvent:r,store:i}=e;t._event,console.log("handle click start",i.selectPath()),r(new CustomEvent("start-click",{detail:{path:i.selectPath()}}))},go=Object.freeze(Object.defineProperty({__proto__:null,handleClickStart:mo},Symbol.toStringTag,{value:"Module"})),bo=()=>Object.freeze({}),vo=["id","class","style","slot","start"],wo=(e={})=>Object.entries(e).filter(([t])=>!vo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),_o=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},xo=({props:e})=>{let t=_o(e.start)||e.start;return{containerAttrString:wo(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Ao=({props:e})=>e.start?.path,$o=({state:e})=>{},ko=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:bo,selectPath:Ao,selectViewData:xo,setState:$o},Symbol.toStringTag,{value:"Module"})),Ur=(e,t,r)=>{let{store:i,render:s}=r,n,a=-1/0;if(e.forEach(p=>{let l=p.getBoundingClientRect();l.top<=t&&l.top>a&&(a=l.top,n=p.id)}),!n){let p=1/0;e.forEach(l=>{let o=l.getBoundingClientRect();o.top>t&&o.top<p&&(p=o.top,n=l.id)})}n&&n!==i.selectCurrentId()&&(i.setCurrentId({id:n}),s())},Eo=(e,t,r,i)=>{let{store:s,render:n}=i,a=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),p=Array.from(a),l=p.map(c=>{let d=1,h=c.tagName.toLowerCase();return h==="h1"?d=1:h==="h2"?d=2:h==="h3"?d=3:h==="h4"?d=4:h==="rtgl-text"&&(d=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:d}});s.setItems({items:l}),Ur(p,r,i),n();let o=Ur.bind(void 0,p,r,i);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},So=e=>{let{props:t}=e,r=()=>{};return requestAnimationFrame(()=>{let i=document.getElementById(t.targetId);if(!i)return;let s=window;t.scrollContainerId&&(s=document.getElementById(t.scrollContainerId)||window);let n=parseInt(t.offsetTop||"100",10);r=Eo(i,s,n,e)}),()=>{r()}},Co=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:So},Symbol.toStringTag,{value:"Module"})),Io=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Oo=({state:e})=>{let t=((r,i)=>{let s=new Set,n=r.findIndex(p=>p.id===i);if(n===-1)return s;let a=r[n].level;for(let p=n-1;p>=0;p--)if(r[p].level<a){let l=r[p].level;s.add(r[p].id);for(let o=p-1;o>=0;o--)r[o].level<l&&(s.add(r[o].id),l=r[o].level);break}return s})(e.items,e.currentId);return{items:e.items.map(r=>{let i={1:"0",2:"12px",3:"24px",4:"32px"},s=r.id===e.currentId,n=t.has(r.id),a=s||n;return{...r,c:a?"fg":"mu-fg",ml:i[r.level]||"",bc:a?"fg":"mu-fg"}}),currentId:e.currentId}},To=({state:e})=>e,Lo=({state:e})=>e.currentId,Ro=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},No=({state:e},t={})=>{e.currentId=t.id},jo=({state:e},t={})=>{e.contentContainer=t.container},Vo=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Io,selectCurrentId:Lo,selectState:To,selectViewData:Oo,setContentContainer:jo,setCurrentId:No,setItems:Ro},Symbol.toStringTag,{value:"Module"})),Ye=e=>e==null||e===!0?"":String(e),Ci=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=Ye(t);r.setValue({value:n}),r.closePopover({}),s(new CustomEvent("value-change",{detail:{value:n},bubbles:!0})),i()},Do=e=>{let{store:t,props:r}=e;if(r.value!==void 0){let i=Ye(r.value);t.setValue({value:i}),t.setTempValue({value:i})}},Po=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e;if(r?.value!==i?.value){let a=Ye(i?.value);s.setValue({value:a}),s.getState().isOpen||s.setTempValue({value:a})}n()},Bo=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;let a=t._event,p=Ye(n.value);r.setValue({value:p}),r.setTempValue({value:p}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}}),i(),setTimeout(()=>{let{input:l}=s;if(!l)return;l.value=p,l.focus();let o=l.shadowRoot?.querySelector("input, textarea");o&&typeof o.focus=="function"&&o.focus()},50)},Wo=(e,t)=>{let{store:r,render:i}=e;r.closePopover({}),i()},Fo=(e,t)=>{let{store:r}=e,i=t._event,s=Ye(i.detail.value);r.setTempValue({value:s})},zo=e=>{let{store:t,refs:r}=e,{input:i}=r,s=i?i.value:t.getState().tempValue;Ci(e,s)},Mo=(e,t)=>{let{store:r,refs:i}=e,s=t._event;if(s.key==="Enter"){s.preventDefault(),s.stopPropagation();let{input:n}=i,a=n?n.value:r.getState().tempValue;Ci(e,a)}else s.key==="Escape"&&(s.preventDefault(),s.stopPropagation(),r.closePopover({}),e.render())},Ko=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Do,handleInputChange:Fo,handleInputKeydown:Mo,handleOnUpdate:Po,handlePopoverClose:Wo,handleSubmitClick:zo,handleTextClick:Bo},Symbol.toStringTag,{value:"Module"})),Uo=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),Ho=({props:e,state:t})=>{let r=typeof t.value=="string"&&t.value.length>0,i=r?t.value:"-",s=typeof e.placeholder=="string"?e.placeholder:"",n=typeof e.label=="string"?e.label:"",a=!!e.disabled;return{isOpen:t.isOpen,position:t.position,value:i,valueColor:r?"fg":"mu-fg",tempValue:t.tempValue,placeholder:s,label:n,disabled:a}},qo=({state:e},t={})=>{e.tempValue=t.value},Jo=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},Go=({state:e})=>{e.isOpen=!1,e.tempValue=""},Yo=({state:e},t={})=>{e.value=t.value},Qo=({state:e})=>e.value,Xo=Object.freeze(Object.defineProperty({__proto__:null,closePopover:Go,createInitialState:Uo,openPopover:Jo,selectValue:Qo,selectViewData:Ho,setTempValue:qo,setValue:Yo},Symbol.toStringTag,{value:"Module"})),Me=(e,t)=>{if(e===t)return!0;if(e==null||t==null||typeof e!="object"||typeof t!="object")return!1;let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let s of r)if(!i.includes(s)||!Me(e[s],t[s]))return!1;return!0},Zo=e=>{let{store:t,props:r,render:i}=e;if(r.selectedValue!==null&&r.selectedValue!==void 0&&r.options){let s=r.options.find(n=>Me(n.value,r.selectedValue));s&&(t.updateSelectedValue({value:s?.value}),i())}},el=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=!1;i?.disabled&&!r?.disabled&&(s.closeOptionsPopover({}),a=!0),r.selectedValue!==i.selectedValue&&(s.updateSelectedValue({value:i.selectedValue}),a=!0),a&&n()},tl=(e,t)=>{let{store:r,render:i,refs:s,props:n}=e;if(n.disabled)return;t._event.stopPropagation();let a=s.selectButton,p=a.firstElementChild,l=p?p.getBoundingClientRect():a.getBoundingClientRect(),o=r.selectSelectedValue(),c=o!==null?o:n.selectedValue,d=null;c!=null&&n.options&&(d=n.options.findIndex(h=>Me(h.value,c)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:l.bottom+12,x:l.left-24},selectedIndex:d}),i()},rl=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},il=(e,t)=>{let{render:r,dispatchEvent:i,props:s,store:n}=e;if(s.disabled)return;let a=t._event;a.stopPropagation();let p=a.currentTarget.id.slice(6),l=Number(p),o=s.options[p];n.updateSelectedValue({value:o?.value}),s.onChange&&typeof s.onChange=="function"&&s.onChange(o.value),i(new CustomEvent("value-change",{detail:{value:o.value,label:o.label,index:l,item:o},bubbles:!0})),r()},sl=(e,t)=>{let{store:r,render:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),i()},nl=(e,t)=>{let{store:r,render:i}=e;r.clearHoveredOption({}),i()},al=(e,t)=>{let{store:r,render:i,dispatchEvent:s,props:n}=e;n.disabled||(t._event.stopPropagation(),r.clearSelectedValue({}),n.onChange&&typeof n.onChange=="function"&&n.onChange(void 0),s(new CustomEvent("value-change",{detail:{value:void 0,label:void 0,index:null,item:void 0},bubbles:!0})),i())},ol=(e,t)=>{if(e.props.disabled)return;let{store:r,render:i,dispatchEvent:s}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),s(new CustomEvent("add-option-click",{bubbles:!0})),i()},ll=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!0}),i()},pl=(e,t)=>{let{store:r,render:i}=e;r.setHoveredAddOption({isHovered:!1}),i()},dl=Object.freeze(Object.defineProperty({__proto__:null,handleAddOptionClick:ol,handleAddOptionMouseEnter:ll,handleAddOptionMouseLeave:pl,handleBeforeMount:Zo,handleButtonClick:tl,handleClearClick:al,handleClickOptionsPopoverOverlay:rl,handleOnUpdate:el,handleOptionClick:il,handleOptionMouseEnter:sl,handleOptionMouseLeave:nl},Symbol.toStringTag,{value:"Module"})),cl=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption","disabled"],ul=(e={})=>Object.entries(e).filter(([t])=>!cl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),hl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),fl=({state:e,props:t})=>{let r=ul(t),i=!!t.disabled,s=Object.prototype.hasOwnProperty.call(t||{},"selectedValue")?t.selectedValue:e.selectedValue,n=t.placeholder||"Select an option",a=!0,p=t.options||[],l=p.find(c=>Me(c.value,s));l&&(n=l.label,a=!1);let o=p.map((c,d)=>{let h=Me(c.value,s),f=e.hoveredOptionId===d;return{...c,isSelected:h,bgc:f?"ac":h?"mu":""}});return{containerAttrString:r,isDisabled:i,isOpen:e.isOpen,position:e.position,options:o,selectedValue:s,selectedLabel:n,selectedLabelColor:a?"mu-fg":"fg",hasValue:s!=null,showClear:!i&&!t.noClear&&s!=null,showAddOption:!i&&!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},yl=({state:e})=>e,ml=({state:e})=>e.selectedValue,gl=({state:e},t={})=>{let{position:r,selectedIndex:i}=t;e.position=r,e.isOpen=!0,i!=null&&(e.hoveredOptionId=i)},bl=({state:e})=>{e.isOpen=!1},vl=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},wl=({state:e})=>{e.selectedValue=void 0},_l=({state:e},t={})=>{e.hoveredOptionId=t.optionId},xl=({state:e})=>{e.hoveredOptionId=null},Al=({state:e})=>{e.selectedValue=void 0},$l=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered},kl=Object.freeze(Object.defineProperty({__proto__:null,clearHoveredOption:xl,clearSelectedValue:Al,closeOptionsPopover:bl,createInitialState:hl,openOptionsPopover:gl,resetSelection:wl,selectSelectedValue:ml,selectState:yl,selectViewData:fl,setHoveredAddOption:$l,setHoveredOption:_l,updateSelectedValue:vl},Symbol.toStringTag,{value:"Module"})),El=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n,a=r.selectHeader();s.currentTarget.id==="headerLabel"?n=a.labelPath:s.currentTarget.id==="headerImage"?n=a.image.path:s.currentTarget.id==="header"&&(n=a.path),i(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},Sl=(e,t)=>{let{store:r,dispatchEvent:i}=e,s=t._event,n=s.currentTarget.dataset.itemId||s.currentTarget.id.slice(4),a=r.selectItem(n);i(new CustomEvent("item-click",{detail:{item:a},bubbles:!0,composed:!0}))},Cl=Object.freeze(Object.defineProperty({__proto__:null,handleHeaderClick:El,handleItemClick:Sl},Symbol.toStringTag,{value:"Module"})),Il=()=>Object.freeze({}),Ol=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],Tl=(e={})=>Object.entries(e).filter(([t])=>!Ol.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ke=e=>{if(e!=null){if(typeof e=="object")return e;if(typeof e=="string")try{return JSON.parse(decodeURIComponent(e))}catch{try{return JSON.parse(e)}catch{return}}}},Ll=e=>{if(e===!0)return!0;if(e===!1||e===void 0||e===null)return!1;if(typeof e=="string"){let t=e.trim().toLowerCase();return t===""||t==="true"}return!1},Rl=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function nr(e,t=null){let r=[];for(let i of e){let s=i.id||i.href||i.path,n=t===s;if(r.push({id:s,title:i.title,href:i.href,type:i.type||"item",icon:i.icon,hrefAttr:i.href?`href=${i.href}`:"",isSelected:n,itemBgc:n?"ac":"bg",itemHoverBgc:n?"ac":"mu"}),i.items&&Array.isArray(i.items))for(let a of i.items){let p=a.id||a.href||a.path,l=t===p;r.push({id:p,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Nl=({props:e})=>{let t=Ke(e.header)||e.header,r=Ke(e.items)||e.items,i=e.selectedItemId,s=Tl(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},p=r?nr(r,i):[],l=!Ll(e.hideHeader),o=e.bwr||"xs",c=Rl(e.w,n),d=n==="full"?"fs":"c",h=n==="full"?"fs":"c",f=n==="full"?"lg":"sm",u=n==="full"?"md":"sm",y=n==="shrunk-lg"?48:40,g=n==="shrunk-lg"?28:20,b=n==="shrunk-lg"?"md":"sm",m=n==="full",_=n==="full",A=n==="full"?"fs":"c",$=n==="full"?"":`ah=${h}`,k=n==="full"?"f":y;return{containerAttrString:s,mode:n,header:a,items:p,sidebarWidth:c,headerAlign:d,itemAlign:h,headerPadding:f,itemPadding:u,itemHeight:y,iconSize:g,firstLetterSize:b,showLabels:m,showGroupLabels:_,itemContentAlign:A,itemAlignAttr:$,itemWidth:k,headerWidth:k,selectedItemId:i,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",showHeader:l,rightBorderWidth:o}},jl=({props:e})=>Ke(e.header)||e.header,Vl=({state:e,props:t})=>{let r=Ke(t.items)||t.items;return(r?nr(r):[]).find(i=>i.active)},Dl=({props:e},t)=>{let r=Ke(e.items)||e.items;return(r?nr(r):[]).find(i=>i.id===t)},Pl=({state:e})=>{},Bl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Il,selectActiveItem:Vl,selectHeader:jl,selectItem:Dl,selectViewData:Nl,setState:Pl},Symbol.toStringTag,{value:"Module"})),Wl=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Fl=(e,t)=>{let{oldProps:r,newProps:i}=t,{store:s,render:n}=e,a=r?.key!==i?.key,p=r?.value!==i?.value;if(a||p){let l=i?.value??0;s.setValue({value:l}),n()}},zl=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},Ml=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event,a=Number(n.detail.value),p=(typeof n.composedPath=="function"?n.composedPath():[]).find(l=>l?.tagName==="RTGL-SLIDER-INPUT")||n.currentTarget?.getRootNode?.()?.host;r.setValue({value:a}),p&&typeof p.setAttribute=="function"&&p.setAttribute("value",String(a)),i(),s(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))},Kl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Wl,handleOnUpdate:Fl,handleValueChange:zl,handleValueInput:Ml},Symbol.toStringTag,{value:"Module"})),Ul=()=>Object.freeze({value:0}),Hl=({state:e,props:t})=>({key:t.key,value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1,disabled:!!t.disabled}),ql=({state:e},t={})=>{e.value=t.value},Jl=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ul,selectViewData:Hl,setValue:ql},Symbol.toStringTag,{value:"Module"})),Gl=e=>{},Yl=(e,t)=>{let{dispatchEvent:r,props:i}=e,s=t._event,n=parseInt(s.currentTarget.id.slice(3),10),a=i.data?.rows?.[n];a&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:a}}))},Ql=(e,t)=>{let{store:r,render:i,dispatchEvent:s}=e,n=t._event.currentTarget.dataset.columnKey,a=r.selectSortInfo(),p="asc";a.column===n&&(a.direction==="asc"?p="desc":a.direction==="desc"&&(p=null)),p?r.setSortColumn({column:n,direction:p}):r.clearSort(),i(),s(new CustomEvent("header-click",{detail:{column:n,direction:p,sortInfo:p?{column:n,direction:p}:null}}))},Xl=Object.freeze(Object.defineProperty({__proto__:null,handleBeforeMount:Gl,handleHeaderClick:Ql,handleRowClick:Yl},Symbol.toStringTag,{value:"Module"})),Zl=()=>Object.freeze({sortColumn:null,sortDirection:null}),ep=["id","class","style","slot","data"],tp=(e={})=>Object.entries(e).filter(([t])=>!ep.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),rp=(e,t)=>{let r=t.split("."),i=e;for(let s of r){if(i==null)return null;i=i[s]}return i},ip=({state:e,props:t})=>{let r=tp(t),i=t.data||{columns:[],rows:[]},s=i.rows.map((n,a)=>{let p=i.columns.map(l=>{let o=rp(n,l.key);return{key:l.key,value:o!=null?String(o):""}});return{index:a,cells:p}});return{containerAttrString:r,columns:i.columns||[],rows:s||[]}},sp=({state:e})=>e,np=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),ap=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},op=({state:e})=>{e.sortColumn=null,e.sortDirection=null},lp=Object.freeze(Object.defineProperty({__proto__:null,clearSort:op,createInitialState:Zl,selectSortInfo:np,selectState:sp,selectViewData:ip,setSortColumn:ap},Symbol.toStringTag,{value:"Module"})),pp=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))},dp=Object.freeze(Object.defineProperty({__proto__:null,handleClickItem:pp},Symbol.toStringTag,{value:"Module"})),cp=()=>Object.freeze({}),up=["id","class","style","slot","items","selectedTab"],hp=(e={})=>Object.entries(e).filter(([t])=>!up.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),fp=({props:e})=>{let t=hp(e),r=e.items||[],i=e.selectedTab,s=r.map(n=>({...n,isSelected:n.id===i,bgColor:n.id===i?"ac":"",borderColor:n.id===i?"":"tr",textColor:n.id===i?"":"mu-fg"}));return{containerAttrString:t,items:s,selectedTab:i}},yp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:cp,selectViewData:fp},Symbol.toStringTag,{value:"Module"})),mp=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),gp=()=>Object.freeze({}),bp=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""}),vp=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:gp,selectViewData:bp},Symbol.toStringTag,{value:"Module"})),wp=async e=>{let{props:t,store:r,render:i,refs:s}=e,{waveformData:n}=t;r.setWaveformData({data:n}),i();let a=s.canvas;a&&Ii(n,a)},_p=async(e,t)=>{let{store:r,render:i,refs:s,props:n}=e,{waveformData:a}=n;if(!a){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:a}),i();let p=s.canvas;p&&Ii(a,p)};async function Ii(e,t){let r=t.getContext("2d"),i=t.getBoundingClientRect(),s=i.width,n=i.height;t.width=s,t.height=n;let a=t.width,p=t.height;if(r.clearRect(0,0,a,p),r.fillStyle="#1a1a1a",r.fillRect(0,0,a,p),!e||!e.amplitudes)return;let l=e.amplitudes,o=p/2,c=r.createLinearGradient(0,0,0,p);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let d=Math.max(1,a/l.length),h=.2;for(let f=0;f<l.length;f++){let u=l[f]/255*(p*.85),y=f*d,g=o-u/2;r.fillStyle=c,r.fillRect(y,g,Math.max(1,d*(1-h)),u)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,o),r.lineTo(a,o),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var xp=Object.freeze(Object.defineProperty({__proto__:null,handleAfterMount:wp,handleOnUpdate:_p},Symbol.toStringTag,{value:"Module"})),Ap=()=>Object.freeze({waveformData:null}),$p=({state:e},t={})=>{e.waveformData=t.data},kp=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData}),Ep=Object.freeze(Object.defineProperty({__proto__:null,createInitialState:Ap,selectViewData:kp,setWaveformData:$p},Symbol.toStringTag,{value:"Module"})),Oi=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ti=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ut=e=>{if(e!=null)return e===""?!0:e},Hr=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return Ut(r);let i=Oi(t);if(i!==t){let s=e.getAttribute(i);if(s!==null)return Ut(s)}},Sp=(e,t)=>{let r=new Set(t);return new Proxy({},{get(i,s){if(typeof s=="string"&&r.has(s)){let n=e[s];return n!==void 0?n:Hr(e,s)}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(i,s){return typeof s=="string"&&r.has(s)},ownKeys(){return[...r]},getOwnPropertyDescriptor(i,s){if(typeof s=="string"&&r.has(s))return{configurable:!0,enumerable:!0,get:()=>{let n=e[s];return n!==void 0?n:Hr(e,s)}}}})},Cp=({schema:e,methodExports:t=[]})=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("componentName is required.");if(typeof e.componentName!="string"||e.componentName.trim()==="")throw new Error("componentName is required.");if(Object.prototype.hasOwnProperty.call(e,"attrsSchema"))throw new Error("attrsSchema is not supported.");if(Object.prototype.hasOwnProperty.call(e,"methods")){let r=e.methods;if(!r||typeof r!="object"||Array.isArray(r))throw new Error("methods must be an object schema with a properties map.");if(Object.prototype.hasOwnProperty.call(r,"type")&&r.type!=="object")throw new Error("methods.type must be 'object'.");if(!r.properties||typeof r.properties!="object"||Array.isArray(r.properties))throw new Error("methods.properties must be an object keyed by method name.");for(let i of Object.keys(r.properties))if(!t.includes(i))throw new Error(`method '${i}' is declared in schema but missing in .methods.js exports.`)}return!0},v={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9,PARTIAL:10,PATH_REFERENCE:11},D={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ht={NOT:0},R=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},re=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}},qr=e=>{if(!e||e.trim()==="")throw new R("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new R(`Invalid comparison operator '${e.includes("===")?"===":"!=="}' - did you mean '${r}'? (got: '${e}')`)}let t=["<",">","<=",">=","==","!="];for(let r of t)if(e.trim().endsWith(r))throw new R(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Ip=e=>{if(e.trim().endsWith(" in"))throw new R(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new R(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new R(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(t.includes(",")){let i=t.split(",").map(s=>s.trim());for(let s of i)if(!s)throw new R(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new R(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)},Op=(e,t,r=!1)=>{if(t===null)return new re(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new re(`Cannot iterate over undefined value at '$for ${e}'`);let i=typeof t;return r?new re(`Cannot iterate over non-array value in loop '${e}' - got ${i} instead`):new re(`Cannot iterate over non-array value (got: ${i}) at '$for ${e}'`)},Tp=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new re(`Unknown function '${e}' (${r})`)},Li=(e,t,r={})=>{let i={},s={};r&&typeof r=="object"&&(r.functions!==void 0||r.partials!==void 0?(i=r.functions||{},s=r.partials||{}):typeof r=="object"&&(i=r));let n=L(e,{functions:i,partials:s},t,{});return n===void 0?{}:n},L=(e,t,r,i)=>{if(t.functions,e.var&&!e.type)return z(e.var,r,i);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return z(e.path,r,i);if(e.type===v.INTERPOLATION)return Rp(e.parts,t,r,i);switch(e.type){case v.FUNCTION:return Ri(e,t,r,i);case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return ji(e,t,r,i);case v.CONDITIONAL:return jp(e,t,r,i);case v.LOOP:return Wp(e,t,r,i);case v.OBJECT:return zp(e,t,r,i);case v.ARRAY:return Mp(e,t,r,i);case v.PARTIAL:return Kp(e,t,r,i);case v.PATH_REFERENCE:return Up(e,t,r,i);default:throw new Error(`Unknown node type: ${e.type}`)}},Jr=new Map,Lp=e=>{let t=[],r="",i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(n==="[")r&&(t.push({type:"property",value:r}),r=""),i=!0;else if(n==="]"){if(i&&r){let a=r.trim();if(/^\d+$/.test(a))t.push({type:"index",value:parseInt(a,10)});else if(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'")){let p=a.slice(1,-1);t.push({type:"property",value:p})}else t.push({type:"property",value:a});r=""}i=!1}else r+=n}return r&&t.push({type:"property",value:r}),t},z=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let i=Jr.get(e);if(!i){let n=[],a="",p=0;for(let l=0;l<e.length;l++){let o=e[l];o==="["?(p++,a+=o):o==="]"?(p--,a+=o):o==="."&&p===0?a&&(n.push(a),a=""):a+=o}a&&n.push(a),i=[];for(let l of n){let o=Lp(l.trim());i.push(...o)}Jr.set(e,i)}let s=t;for(let n=0;n<i.length;n++){let a=i[n];if(a.type==="property"&&a.value in r){s=r[a.value];continue}if(s==null)return;(a.type==="property"||a.type==="index")&&(s=s[a.value])}return s},Rp=(e,t,r,i)=>{let s=[];for(let n of e)if(typeof n=="string")s.push(n);else{let a=L(n,t,r,i);s.push(a!=null?String(a):"")}return s.join("")},Ri=(e,t,r,i)=>{let s=t.functions||t,n=s[e.name];if(!n)throw Tp(e.name,s);let a=e.args.map(p=>L(p,t,r,i));return n(...a)},Oe=(e,t,r,i)=>{if(e.var&&!e.type)return z(e.var,r,i);switch(e.type){case v.VARIABLE:return z(e.path,r,i);case v.LITERAL:return e.value;case v.BINARY:return Ni(e,t,r,i);case v.UNARY:return ji(e,t,r,i);case v.FUNCTION:return Ri(e,t,r,i);default:return L(e,t,r,i)}},Ni=(e,t,r,i)=>{if(e.op===D.AND||e.op===D.OR){let a=Oe(e.left,t,r,i),p=Oe(e.right,t,r,i);switch(e.op){case D.AND:return a&&p;case D.OR:return a||p}}let s=L(e.left,t,r,i),n=L(e.right,t,r,i);switch(e.op){case D.EQ:return s==n;case D.NEQ:return s!=n;case D.GT:return s>n;case D.LT:return s<n;case D.GTE:return s>=n;case D.LTE:return s<=n;case D.IN:return Array.isArray(n)?n.includes(s):!1;case D.ADD:if(typeof s!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof s} + ${typeof n}`);return s+n;case D.SUBTRACT:if(typeof s!="number"||typeof n!="number")throw new re(`Arithmetic operations require numbers. Got ${typeof s} - ${typeof n}`);return s-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ji=(e,t,r,i)=>{let s=e.op===Ht.NOT?Oe(e.operand,t,r,i):L(e.operand,t,r,i);switch(e.op){case Ht.NOT:return!s;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Np=(e,t,r,i)=>{if(e.conditions.length===2&&e.conditions[1]===null){let s=e.conditions[0];if(s.type===v.VARIABLE)if(z(s.path,r,i)){let n=e.bodies[0];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?L(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=z(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=z(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=L(d,t,r,i);c.push(h!=null?String(h):"")}a[l]=c.join("")}else a[l]=L(o,t,r,i)}return a}}else{let n=e.bodies[1];if(n.type===v.OBJECT&&n.properties.length<=5){let a={};for(let p of n.properties){let l=p.parsedKey?L(p.parsedKey,t,r,i):p.key,o=p.value;if(o.type===v.LITERAL)a[l]=o.value;else if(o.type===v.VARIABLE)a[l]=z(o.path,r,i);else if(o.type===v.INTERPOLATION){let c=[];for(let d of o.parts)if(typeof d=="string")c.push(d);else if(d.type===v.VARIABLE){let h=z(d.path,r,i);c.push(h!=null?String(h):"")}else{let h=L(d,t,r,i);c.push(h!=null?String(h):"")}a[l]=c.join("")}else a[l]=L(o,t,r,i)}return a}}}return null},jp=(e,t,r,i)=>{let s=Np(e,t,r,i);if(s!==null)return s;for(let n=0;n<e.conditions.length;n++){let a=e.conditions[n];if(a===null||Oe(a,t,r,i))return L(e.bodies[n],t,r,i)}return Vi},Vp=(e,t)=>{let r=e.body,i=e.itemVar;if(r.type===v.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===v.VARIABLE){let s=r.conditions[0].path,n=r.bodies[0];if(s.startsWith(i+".")){let a=s.substring(i.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let p=[];for(let l=0;l<t.length;l++){let o=t[l];if(o[a]){let c={};for(let d of n.properties){let h=d.key,f=d.value;if(f.type===v.LITERAL)c[h]=f.value;else if(f.type===v.VARIABLE){let u=f.path;if(u===i)c[h]=o;else if(u.startsWith(i+".")){let y=u.substring(i.length+1);c[h]=o[y]}else return null}else if(f.type===v.INTERPOLATION){let u=[],y=!0;for(let g of f.parts)if(typeof g=="string")u.push(g);else if(g.type===v.VARIABLE){let b=g.path;if(b===i)u.push(o!=null?String(o):"");else if(b.startsWith(i+".")){let m=b.substring(i.length+1),_=o[m];u.push(_!=null?String(_):"")}else{y=!1;break}}else{y=!1;break}if(!y)return null;c[h]=u.join("")}else return null}p.push(c)}}return p}}}return null},Dp=(e,t)=>{let r=e.body,i=e.itemVar,s=Vp(e,t);if(s!==null)return s;if(r.type===v.OBJECT&&r.properties.length<=5){for(let p of r.properties)if(p.parsedKey)return null;let n=[],a=!0;for(let p of r.properties){let l=p.key,o=p.value;if(o.type===v.LITERAL)n.push({key:l,type:"literal",value:o.value});else if(o.type===v.VARIABLE){let c=o.path;if(c===i)n.push({key:l,type:"item"});else if(c.startsWith(i+".")){let d=c.substring(i.length+1);if(!d.includes(".")&&!d.includes("["))n.push({key:l,type:"prop",prop:d});else{a=!1;break}}else{a=!1;break}}else if(o.type===v.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===v.VARIABLE){let d=c.path;if(d===i)n.push({key:l,type:"item_string"});else if(d.startsWith(i+".")){let h=d.substring(i.length+1);if(!h.includes(".")&&!h.includes("["))n.push({key:l,type:"prop_string",prop:h});else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}else{a=!1;break}}if(a){let p=new Array(t.length);if(n.length===3&&n[0].type==="prop"&&n[0].key==="id"&&n[1].type==="prop_string"&&n[1].key==="title"&&n[2].type==="prop"&&n[2].key==="completed")for(let l=0;l<t.length;l++){let o=t[l];p[l]={id:o.id,title:o.title!=null?String(o.title):"",completed:o.completed}}else for(let l=0;l<t.length;l++){let o=t[l],c={};for(let d of n)if(d.type==="literal")c[d.key]=d.value;else if(d.type==="item")c[d.key]=o;else if(d.type==="prop")c[d.key]=o[d.prop];else if(d.type==="item_string")c[d.key]=o!=null?String(o):"";else if(d.type==="prop_string"){let h=o[d.prop];c[d.key]=h!=null?String(h):""}p[l]=c}return p}}return null},Pp=(e,t,r,i,s)=>{let n=[],a=e.body;if(a.type===v.OBJECT&&a.fast!==!1){let p=e.itemVar,l=e.indexVar;for(let o=0;o<s.length;o++){let c=s[o],d={},h={...i,[p]:c,...l&&{[l]:o}};h.__paths__||(h.__paths__=i.__paths__||{});let f=e.iterable.path||"";if(i&&i.__paths__&&f){let u=f.split("."),y=u[0];y in i.__paths__&&(f=i.__paths__[y],u.length>1&&(f+="."+u.slice(1).join(".")))}h.__paths__={...h.__paths__,[p]:`${f}[${o}]`,...l&&{[l]:o}};for(let u of a.properties){let y=u.parsedKey?L(u.parsedKey,t,r,h):u.key,g=u.value;if(g.type===v.LITERAL)d[y]=g.value;else if(g.type===v.VARIABLE){let b=g.path;if(b===p)d[y]=c;else if(b===l)d[y]=o;else if(b.startsWith(p+".")){let m=b.substring(p.length+1);!m.includes(".")&&!m.includes("[")?d[y]=c[m]:d[y]=z(b,r,{...i,[p]:c,...l&&{[l]:o}})}else d[y]=z(b,r,{...i,[p]:c,...l&&{[l]:o}})}else if(g.type===v.INTERPOLATION){let b=[];for(let m of g.parts)if(typeof m=="string")b.push(m);else if(m.type===v.VARIABLE){let _=m.path,A;if(_===p)A=c;else if(_===l)A=o;else if(_.startsWith(p+".")){let $=_.substring(p.length+1);!$.includes(".")&&!$.includes("[")?A=c[$]:A=z(_,r,{...i,[p]:c,...l&&{[l]:o}})}else A=z(_,r,{...i,[p]:c,...l&&{[l]:o}});b.push(A!=null?String(A):"")}else{let _={...i,[p]:c,...l&&{[l]:o}},A=L(m,t,r,_);b.push(A!=null?String(A):"")}d[y]=b.join("")}else{let b={...i,[p]:c,...l&&{[l]:o}};d[y]=L(g,t,r,b)}}n.push(d)}return n}return null},Bp=(e,t,r)=>{let i=e.body;if(i.type===v.OBJECT&&i.properties.length===1&&i.properties[0].key==="$if item.visible"){let s=i.properties[0].value;if(s.type===v.CONDITIONAL&&s.conditions.length===1&&s.conditions[0].type===v.VARIABLE&&s.conditions[0].path==="item.visible"){let n=s.bodies[0];if(n.type===v.OBJECT&&n.properties.length===2){let a=n.properties[0],p=n.properties[1];if(a.key==="id"&&a.value.type===v.VARIABLE&&a.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===v.CONDITIONAL){let l=[];for(let o=0;o<t.length;o++){let c=t[o];if(c.visible){let d={id:c.id};c.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${c.name}`):(d.highlight=!1,d.message=c.name),l.push(d)}}return l}}}}return null},Wp=(e,t,r,i)=>{let s=L(e.iterable,t,r,i);if(!Array.isArray(s)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!0;let h=e.iterable.args.map(f=>f.type===v.LITERAL?typeof f.value=="string"?`'${f.value}'`:String(f.value):f.type===v.VARIABLE?f.path:f.type===v.FUNCTION?`${f.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${h})`}else o=e.iterable.path||"undefined";let d=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw Op(d,s,c)}if(!e.indexVar){let o=Bp(e,s,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Dp(e,s);if(o!==null)return o}let n=Pp(e,t,r,i,s);if(n!==null)return n;let a=[],p=e.iterable.path||"";if(i&&i.__paths__&&p){let o=p.split("."),c=o[0];c in i.__paths__&&(p=i.__paths__[c],o.length>1&&(p+="."+o.slice(1).join(".")))}let l=!1;e.body.type===v.ARRAY&&(e.body.items.length<=1?l=!1:l=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===v.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<s.length;o++){let c=e.indexVar?{...i,[e.itemVar]:s[o],[e.indexVar]:o}:{...i,[e.itemVar]:s[o]};c.__paths__||(c.__paths__=i.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${p}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let d=L(e.body,t,r,c);Array.isArray(d)&&d.length===1&&!l?a.push(d[0]):a.push(d)}return a},Fp=(e,t,r,i)=>{if(e.whenCondition)return null;if(e.properties.length===1){let s=e.properties[0],n=s.parsedKey?L(s.parsedKey,t,r,i):s.key,a=s.value;if(a.type===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let p={},l={},o=!0;for(let c of a.properties){let d=c.parsedKey?L(c.parsedKey,t,r,i):c.key,h=c.value;if(h.type===v.LITERAL)l[d]=h.value;else if(h.type===v.VARIABLE)l[d]=z(h.path,r,i);else if(h.type===v.INTERPOLATION){let f=[];for(let u of h.parts)if(typeof u=="string")f.push(u);else if(u.type===v.VARIABLE){let y=z(u.path,r,i);f.push(y!=null?String(y):"")}else{o=!1;break}if(!o)break;l[d]=f.join("")}else if(h.type===v.OBJECT&&h.properties.length<=5){let f={};for(let u of h.properties){let y=u.key,g=u.value;if(g.type===v.LITERAL)f[y]=g.value;else if(g.type===v.VARIABLE)f[y]=z(g.path,r,i);else if(g.type===v.INTERPOLATION){let b=[];for(let m of g.parts)if(typeof m=="string")b.push(m);else if(m.type===v.VARIABLE){let _=z(m.path,r,i);b.push(_!=null?String(_):"")}else{o=!1;break}if(!o)break;f[y]=b.join("")}else{o=!1;break}}if(!o)break;l[d]=f}else{o=!1;break}}if(o)return p[n]=l,p}}return null},zp=(e,t,r,i)=>{let s=t.functions||t;if(e.whenCondition&&!Oe(e.whenCondition,s,r,i))return;let n=Fp(e,t,r,i);if(n!==null)return n;if(e.fast){let l={};for(let o of e.properties){let c=o.parsedKey?L(o.parsedKey,t,r,i):o.key,d=o.value;if(d.type===v.LITERAL)l[c]=d.value;else if(d.type===v.VARIABLE)l[c]=z(d.path,r,i);else if(d.type===v.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===v.VARIABLE){let u=z(f.path,r,i);h.push(u!=null?String(u):"")}else{let u=L(f,t,r,i);h.push(u!=null?String(u):"")}l[c]=h.join("")}else l[c]=L(d,t,r,i)}return l}let a={},p=!1;for(let l of e.properties)if(!l.key.startsWith("$if ")&&!l.key.match(/^\$if\s+\w+.*:?$/)&&!l.key.startsWith("$elif")&&!l.key.startsWith("$else")&&!l.key.startsWith("$for ")){p=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let o=L(l.value,t,r,i);if(!p&&o!==null&&o!==void 0)return Array.isArray(o)&&o.length===1?o[0]:o;typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.assign(a,o)}else if(l.key.startsWith("$for ")){if(e.properties.length===1)return L(l.value,t,r,i)}else{let o=l.value;if(o&&o.type===v.OBJECT&&o.properties){let c=o.properties.find(d=>d.key.startsWith("$for "));if(c){let d=L(c.value,t,r,i);d!==void 0&&(a[l.key]=d)}else{let d=L(l.value,t,r,i);d!==void 0&&(a[l.key]=d)}}else{let c=l.parsedKey?L(l.parsedKey,t,r,i):l.key,d=L(l.value,t,r,i);d!==void 0&&(a[c]=d)}}return a},Vi={},Mp=(e,t,r,i)=>{let s=[];for(let n of e.items)if(n.type===v.LOOP){let a=L(n,t,r,i);s.push(a)}else{let a=L(n,t,r,i);a!==Vi&&a!==void 0&&s.push(a)}return s},Kp=(e,t,r,i)=>{let{name:s,data:n,whenCondition:a}=e,p=t.partials||{},l=t.functions||t;if(a&&!Oe(a,l,r,i))return;if(!p[s])throw new re(`Partial '${s}' is not defined`);let o=i._partialStack||[];if(o.includes(s))throw new re(`Circular partial reference detected: ${s}`);let c=p[s],d=r,h={...i,_partialStack:[...o,s]};if(i){d={...r};for(let f of Object.keys(i))f.startsWith("_")||(d[f]=i[f])}if(n){let f=L(n,t,r,i);d={...d,...f}}return L(c,t,d,h)},Up=(e,t,r,i)=>{let{path:s}=e,n=s.split("."),a=n[0],p=n.slice(1);if(!i||!(a in i))throw new re(`Path reference '#{${s}}' refers to '${a}' which is not a loop variable in the current scope`);if(i.__paths__||(i.__paths__={}),!(a in i.__paths__))throw new re(`Path reference '#{${s}}' cannot be resolved - path tracking may not be initialized properly`);let l=i.__paths__[a];if(typeof l=="number"){if(p.length>0)throw new re(`Path reference '#{${s}}' - cannot access properties on index variable '${a}'`);return String(l)}return p.length>0&&(l+="."+p.join(".")),l},Hp=/\$\{([^}]*)\}/g,qp=/#\{([^}]*)\}/g,Di=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,i,s]=r,n=Jp(s,t);return{isFunction:!0,type:v.FUNCTION,name:i,args:n}},Jp=(e,t={})=>e.trim()?Gp(e).map(r=>Yp(r.trim(),t)):[],Gp=e=>{let t=[],r="",i=0,s=!1,n="";for(let a=0;a<e.length;a++){let p=e[a],l=a>0?e[a-1]:"";!s&&(p==='"'||p==="'")?(s=!0,n=p,r+=p):s&&p===n&&l!=="\\"?(s=!1,n="",r+=p):!s&&p==="("?(i++,r+=p):!s&&p===")"?(i--,r+=p):!s&&p===","&&i===0?(t.push(r),r=""):r+=p}return r&&t.push(r),t},Yp=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:v.LITERAL,value:parseFloat(e)};if(e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};let r=Di(e,t);if(r.isFunction)return{type:r.type,name:r.name,args:r.args};let i=e.trim(),s=[{op:" + ",type:"ADD"},{op:" - ",type:"SUBTRACT"}],n=-1;for(let{op:a,type:p}of s){let l=0;for(;l<i.length;){let o=Ce(i.substring(l),a);if(o===-1)break;let c=l+o;c>n&&(n=c),l=c+a.length}}if(n!==-1)try{return Z(i,t)}catch{return{type:v.VARIABLE,path:i}}return{type:v.VARIABLE,path:i}},Pi=/^\w+\(.*\)$/,Qp=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Xp=e=>{if(!(!e||e.trim()===""||Pi.test(e))&&Qp.test(e))throw e.includes("?")&&e.includes(":")?new R(`Complex expressions not supported in variable replacements - consider calculating the value in your data instead. Offending expression: "${e}"`):e.includes("||")||e.includes("&&")||e.includes("??")?new R(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new R(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},Gr=e=>{let t=e.trim();if(Pi.test(t))throw new R(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new R(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new R(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new R(`Logical operators not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("?")&&t.includes(":"))throw new R(`Complex expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);return{type:v.PATH_REFERENCE,path:t}},it=(e,t={})=>{let r=e.trim();Xp(r);let i=Di(r,t);if(i.isFunction)return{type:i.type,name:i.name,args:i.args};if(r.includes("[")&&!/[\s+\-*/%|&?:]/.test(r)){let s=0;for(let n of r)n==="["?s++:n==="]"&&s--;if(s!==0)throw new Error("Invalid array index syntax")}return{type:v.VARIABLE,path:r}},Bi=(e,t={})=>{let r=e,i=[];(e.includes("\\${")||e.includes("\\#{"))&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC_VAR$1"),r=r.replace(/\\\\(#\{[^}]*\})/g,"\\DOUBLE_ESC_PATH$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let d=`__ESCAPED_${i.length}__`;return i.push(c),d}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let s=[...r.matchAll(Hp)],n=[...r.matchAll(qp)],a=[...s.map(o=>({match:o,type:"variable"})),...n.map(o=>({match:o,type:"pathref"}))].sort((o,c)=>o.match.index-c.match.index);if(a.length===0){let o=r;for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&i.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?it(o[1],t):Gr(o[1])}catch(d){if(d.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw d}}let p=[],l=0;for(let{match:o,type:c}of a){let[d,h]=o,f=o.index;if(f>l){let u=r.substring(l,f);for(let y=0;y<i.length;y++)u=u.replace(`__ESCAPED_${y}__`,i[y]);u&&p.push(u)}try{let u;c==="variable"?u=it(h.trim(),t):u=Gr(h.trim()),p.push(u)}catch(u){if(u.message==="Invalid array index syntax")p.push(d);else throw u}l=f+d.length}if(l<r.length){let o=r.substring(l);for(let c=0;c<i.length;c++)o=o.replace(`__ESCAPED_${c}__`,i[c]);o&&p.push(o)}return{type:v.INTERPOLATION,parts:p}},xe=(e,t)=>typeof e=="string"?Bi(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Zp(e,t):ed(e,t):{type:v.LITERAL,value:e},Zp=(e,t)=>{let r=[],i=!1;for(let s=0;s<e.length;s++){let n=e[s];if(typeof n=="object"&&n!==null&&!Array.isArray(n)){let p=Object.keys(n);if(p.length===1&&p[0].startsWith("$for ")){let l=Fi(p[0],n[p[0]],t);r.push(l),i=!0;continue}}let a=xe(n,t);r.push(a),(a.type===v.FUNCTION||a.type===v.CONDITIONAL||a.type===v.LOOP||a.type===v.PARTIAL||a.type===v.OBJECT&&!a.fast||a.type===v.ARRAY&&!a.fast)&&(i=!0)}return{type:v.ARRAY,items:r,fast:!i}},ed=(e,t)=>{let r=[],i=!1,s=null,n=Object.entries(e),a=0;if(e.$partial!==void 0){if(typeof e.$partial!="string")throw new R("$partial value must be a string");if(e.$partial.trim()==="")throw new R("$partial value cannot be an empty string");let l=["$if","$elif","$else","$for"],o=[];for(let[b]of n)for(let m of l)if(b===m||b.startsWith(m+" ")||b.startsWith(m+"#")){o.push(m);break}if(o.length>0)throw new R(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:d,...h}=e,f={},u=!1;for(let[b,m]of Object.entries(h)){let _=b;(b.startsWith("\\$")||b.startsWith("$$"))&&(_=b.slice(1)),f[_]=m,u=!0}let y=null;if(u&&(y=xe(f,t),y.type===v.OBJECT)){let b=!1;for(let m of y.properties)if(m.value.type===v.VARIABLE||m.value.type===v.INTERPOLATION||m.value.type===v.FUNCTION||m.value.type===v.CONDITIONAL||m.value.type===v.LOOP||m.value.type===v.OBJECT&&!m.value.fast||m.value.type===v.ARRAY&&!m.value.fast){b=!0;break}b&&(y.fast=!1)}let g={type:v.PARTIAL,name:c,data:y};if(d!==void 0){let b;if(typeof d=="string"){if(d.trim()==="")throw new R("Empty condition expression after '$when'");b=Z(d,t)}else b={type:v.LITERAL,value:d};g.whenCondition=b}return g}for(let[l,o]of n)if(l==="$when"){if(s!==null)throw new R("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new R("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new R("Empty condition expression after '$when'");s=Z(c,t),i=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new R("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;a<n.length;){let[l,o]=n[a];if(l==="$when"){a++;continue}if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let c=td(n,a,t);r.push({key:l,value:c.node}),i=!0,a=c.nextIndex}else if(l.startsWith("$for ")){let c=Fi(l,o,t);r.push({key:l,value:c}),i=!0,a++}else{if(l.startsWith("$elif ")||l.startsWith("$else"))throw new R(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new R("Missing condition expression after '$if'");{let c=xe(o,t);(c.type===v.FUNCTION||c.type===v.CONDITIONAL||c.type===v.LOOP||c.type===v.PARTIAL||c.type===v.OBJECT&&!c.fast||c.type===v.ARRAY&&!c.fast)&&(i=!0);let d=Bi(l,t),h={key:l,value:c};(d.type!==v.LITERAL||d.value!==l)&&(h.parsedKey=d),r.push(h),a++}}}let p={type:v.OBJECT,properties:r,fast:!i};return s&&(p.whenCondition=s),p},td=(e,t,r={})=>{let i=[],s=[],n=t,[a,p]=e[n],l=null,o;if(a.startsWith("$if#")){let d=a.match(/^\$if#(\w+)\s+(.+)$/);if(d)l=d[1],o=d[2];else throw new R(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());qr(o);let c=Z(o,r);for(i.push(c),s.push(xe(p,r)),n++;n<e.length;){let[d,h]=e[n],f=!1,u;if(l?d.startsWith(`$elif#${l} `)?(u=d.substring(`$elif#${l} `.length),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d===`$else#${l}`||d===`$else#${l}:`)&&(f=!0,u=null):d.startsWith("$elif ")?(u=d.substring(6),u.endsWith(":")&&(u=u.slice(0,-1).trim()),f=!0):(d==="$else"||d==="$else:")&&(f=!0,u=null),f){if(u===null)i.push(null);else{qr(u);let y=Z(u,r);i.push(y)}if(s.push(xe(h,r)),n++,u===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:i,bodies:s,id:l},nextIndex:n}},Z=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,d=!0;for(let h=0;h<o.length;h++)if(o[h]==="("?c++:o[h]===")"&&c--,c<0){d=!1;break}if(d&&c===0)return Z(o,t)}let r=Ce(e,"||");if(r!==-1)return{type:v.BINARY,op:D.OR,left:Z(e.substring(0,r).trim(),t),right:Z(e.substring(r+2).trim(),t)};let i=Ce(e,"&&");if(i!==-1)return{type:v.BINARY,op:D.AND,left:Z(e.substring(0,i).trim(),t),right:Z(e.substring(i+2).trim(),t)};let s=[{op:">=",type:D.GTE},{op:"<=",type:D.LTE},{op:"==",type:D.EQ},{op:"!=",type:D.NEQ},{op:">",type:D.GT},{op:"<",type:D.LT},{op:" in ",type:D.IN}];for(let{op:o,type:c}of s){let d=Ce(e,o);if(d!==-1)return{type:v.BINARY,op:c,left:Z(e.substring(0,d).trim(),t),right:Z(e.substring(d+o.length).trim(),t)}}let n=-1,a=null,p=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:o,type:c}of p){let d=0;for(;d<e.length;){let h=Ce(e.substring(d),o);if(h===-1)break;let f=d+h;f>n&&(n=f,a={op:o,type:c}),d=f+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:Z(e.substring(0,n).trim(),t),right:Z(e.substring(n+a.op.length).trim(),t)};let l=[" * "," / "," % "];for(let o of l)if(Ce(e,o)!==-1)throw new R(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:Ht.NOT,operand:Z(e.substring(1).trim(),t)}:Wi(e,t)},Ce=(e,t)=>{let r=0,i=0;for(;i<=e.length-t.length;){if(e[i]==="(")r++;else if(e[i]===")")r--;else if(r===0&&e.substring(i,i+t.length)===t)return i;i++}return-1},rd=e=>{if(e=e.trim(),e==="true")return{type:v.LITERAL,value:!0};if(e==="false")return{type:v.LITERAL,value:!1};if(e==="null")return{type:v.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:v.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:v.LITERAL,value:""};if(e==="{}")return{type:v.LITERAL,value:{}};if(e==="[]")return{type:v.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:v.LITERAL,value:t}:{type:v.VARIABLE,path:e}},Wi=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return it(r,t);let i=rd(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return it(r,t)}catch(s){if(s.message&&s.message.includes("not supported"))return i;throw s}},Fi=(e,t,r)=>{let i=e.substring(5).trim();Ip(i);let s=i.match(/^(.+?)\s+in\s+(.+)$/);if(!s)throw new R(`Invalid loop syntax - missing 'in' keyword (got: '$for ${i}')`);let n=s[1].trim(),a=s[2].trim(),p,l=null;if(n.includes(",")){let d=n.split(",").map(h=>h.trim());if(d.length!==2)throw new R(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);p=d[0],l=d[1]}else p=n;let o=Wi(a,r),c=xe(t,r);return{type:v.LOOP,itemVar:p,indexVar:l,iterable:o,body:c}},Yr=(e,t={})=>{let{functions:r={}}=t;return xe(e,r)},id=()=>Date.now(),sd=Object.freeze(Object.defineProperty({__proto__:null,now:id},Symbol.toStringTag,{value:"Module"})),zi=(e,t,r={})=>{let{functions:i={},partials:s={}}=r,n={...sd,...i},a=Yr(e,{functions:n}),p={};for(let[l,o]of Object.entries(s))p[l]=Yr(o,{functions:n});return Li(a,t,{functions:n,partials:p})},Ue=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),nd=(e,t)=>{!t||typeof t!="object"||Object.entries(t).forEach(([r,i])=>{if(r==="default")throw new Error("[Methods] Invalid method name 'default'. Use named exports in .methods.js; default export is not supported.");if(typeof i=="function"){if(r in e)throw new Error(`[Methods] Cannot define method '${r}' because it already exists on the component instance.`);Object.defineProperty(e,r,{configurable:!0,enumerable:!1,writable:!1,value:(s={})=>{let n=s===void 0?{}:s;if(!Ue(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return i.call(e,n)}})}})},Mi=Symbol.for("immer-nothing"),Qr=Symbol.for("immer-draftable"),se=Symbol.for("immer-state");function pe(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Te=Object.getPrototypeOf;function Le(e){return!!e&&!!e[se]}function Ae(e){return e?Ki(e)||Array.isArray(e)||!!e[Qr]||!!e.constructor?.[Qr]||ut(e)||ht(e):!1}var ad=Object.prototype.constructor.toString();function Ki(e){if(!e||typeof e!="object")return!1;let t=Te(e);if(t===null)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object?!0:typeof r=="function"&&Function.toString.call(r)===ad}function st(e,t){ct(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,i)=>t(i,r,e))}function ct(e){let t=e[se];return t?t.type_:Array.isArray(e)?1:ut(e)?2:ht(e)?3:0}function qt(e,t){return ct(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Ui(e,t,r){let i=ct(e);i===2?e.set(t,r):i===3?e.add(r):e[t]=r}function od(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function ut(e){return e instanceof Map}function ht(e){return e instanceof Set}function ve(e){return e.copy_||e.base_}function Jt(e,t){if(ut(e))return new Map(e);if(ht(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Ki(e);if(t===!0||t==="class_only"&&!r){let i=Object.getOwnPropertyDescriptors(e);delete i[se];let s=Reflect.ownKeys(i);for(let n=0;n<s.length;n++){let a=s[n],p=i[a];p.writable===!1&&(p.writable=!0,p.configurable=!0),(p.get||p.set)&&(i[a]={configurable:!0,writable:!0,enumerable:p.enumerable,value:e[a]})}return Object.create(Te(e),i)}else{let i=Te(e);if(i!==null&&r)return{...e};let s=Object.create(i);return Object.assign(s,e)}}function ar(e,t=!1){return ft(e)||Le(e)||!Ae(e)||(ct(e)>1&&(e.set=e.add=e.clear=e.delete=ld),Object.freeze(e),t&&Object.entries(e).forEach(([r,i])=>ar(i,!0))),e}function ld(){pe(2)}function ft(e){return Object.isFrozen(e)}var pd={};function $e(e){let t=pd[e];return t||pe(0,e),t}var He;function Hi(){return He}function dd(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xr(e,t){t&&($e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Gt(e){Yt(e),e.drafts_.forEach(cd),e.drafts_=null}function Yt(e){e===He&&(He=e.parent_)}function Zr(e){return He=dd(He,e)}function cd(e){let t=e[se];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ei(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[se].modified_&&(Gt(t),pe(4)),Ae(e)&&(e=nt(t,e),t.parent_||at(t,e)),t.patches_&&$e("Patches").generateReplacementPatches_(r[se].base_,e,t.patches_,t.inversePatches_)):e=nt(t,r,[]),Gt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Mi?e:void 0}function nt(e,t,r){if(ft(t))return t;let i=t[se];if(!i)return st(t,(s,n)=>ti(e,i,t,s,n,r)),t;if(i.scope_!==e)return t;if(!i.modified_)return at(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;let s=i.copy_,n=s,a=!1;i.type_===3&&(n=new Set(s),s.clear(),a=!0),st(n,(p,l)=>ti(e,i,s,p,l,r,a)),at(e,s,!1),r&&e.patches_&&$e("Patches").generatePatches_(i,r,e.patches_,e.inversePatches_)}return i.copy_}function ti(e,t,r,i,s,n,a){if(Le(s)){let p=n&&t&&t.type_!==3&&!qt(t.assigned_,i)?n.concat(i):void 0,l=nt(e,s,p);if(Ui(r,i,l),Le(l))e.canAutoFreeze_=!1;else return}else a&&r.add(s);if(Ae(s)&&!ft(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;nt(e,s),(!t||!t.scope_.parent_)&&typeof i!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,i)&&at(e,s)}}function at(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ar(t,r)}function ud(e,t){let r=Array.isArray(e),i={type_:r?1:0,scope_:t?t.scope_:Hi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},s=i,n=or;r&&(s=[i],n=qe);let{revoke:a,proxy:p}=Proxy.revocable(s,n);return i.draft_=p,i.revoke_=a,p}var or={get(e,t){if(t===se)return e;let r=ve(e);if(!qt(r,t))return hd(e,r,t);let i=r[t];return e.finalized_||!Ae(i)?i:i===Pt(e.base_,t)?(Bt(e),e.copy_[t]=Xt(i,e)):i},has(e,t){return t in ve(e)},ownKeys(e){return Reflect.ownKeys(ve(e))},set(e,t,r){let i=qi(ve(e),t);if(i?.set)return i.set.call(e.draft_,r),!0;if(!e.modified_){let s=Pt(ve(e),t),n=s?.[se];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(od(r,s)&&(r!==void 0||qt(e.base_,t)))return!0;Bt(e),Qt(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Pt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Bt(e),Qt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ve(e),i=Reflect.getOwnPropertyDescriptor(r,t);return i&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:i.enumerable,value:r[t]}},defineProperty(){pe(11)},getPrototypeOf(e){return Te(e.base_)},setPrototypeOf(){pe(12)}},qe={};st(or,(e,t)=>{qe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});qe.deleteProperty=function(e,t){return qe.set.call(this,e,t,void 0)};qe.set=function(e,t,r){return or.set.call(this,e[0],t,r,e[0])};function Pt(e,t){let r=e[se];return(r?ve(r):e)[t]}function hd(e,t,r){let i=qi(t,r);return i?"value"in i?i.value:i.get?.call(e.draft_):void 0}function qi(e,t){if(!(t in e))return;let r=Te(e);for(;r;){let i=Object.getOwnPropertyDescriptor(r,t);if(i)return i;r=Te(r)}}function Qt(e){e.modified_||(e.modified_=!0,e.parent_&&Qt(e.parent_))}function Bt(e){e.copy_||(e.copy_=Jt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var fd=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,r,i)=>{if(typeof t=="function"&&typeof r!="function"){let n=r;r=t;let a=this;return function(p=n,...l){return a.produce(p,o=>r.call(this,o,...l))}}typeof r!="function"&&pe(6),i!==void 0&&typeof i!="function"&&pe(7);let s;if(Ae(t)){let n=Zr(this),a=Xt(t,void 0),p=!0;try{s=r(a),p=!1}finally{p?Gt(n):Yt(n)}return Xr(n,i),ei(s,n)}else if(!t||typeof t!="object"){if(s=r(t),s===void 0&&(s=t),s===Mi&&(s=void 0),this.autoFreeze_&&ar(s,!0),i){let n=[],a=[];$e("Patches").generateReplacementPatches_(t,s,n,a),i(n,a)}return s}else pe(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(n,...a)=>this.produceWithPatches(n,p=>t(p,...a));let i,s;return[this.produce(t,r,(n,a)=>{i=n,s=a}),i,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Ae(e)||pe(8),Le(e)&&(e=yd(e));let t=Zr(this),r=Xt(e,void 0);return r[se].isManual_=!0,Yt(t),r}finishDraft(e,t){let r=e&&e[se];(!r||!r.isManual_)&&pe(9);let{scope_:i}=r;return Xr(i,t),ei(void 0,i)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let s=t[r];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}r>-1&&(t=t.slice(r+1));let i=$e("Patches").applyPatches_;return Le(e)?i(e,t):this.produce(e,s=>i(s,t))}};function Xt(e,t){let r=ut(e)?$e("MapSet").proxyMap_(e,t):ht(e)?$e("MapSet").proxySet_(e,t):ud(e,t);return(t?t.scope_:Hi()).drafts_.push(r),r}function yd(e){return Le(e)||pe(10,e),Ji(e)}function Ji(e){if(!Ae(e)||ft(e))return e;let t=e[se],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Jt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=Jt(e,!0);return st(r,(i,s)=>{Ui(r,i,Ji(s))}),t&&(t.finalized_=!1),r}var ne=new fd,md=ne.produce;ne.produceWithPatches.bind(ne);ne.setAutoFreeze.bind(ne);ne.setUseStrictShallowCopy.bind(ne);ne.applyPatches.bind(ne);ne.createDraft.bind(ne);ne.finishDraft.bind(ne);var gd=(e,t,r)=>{let{createInitialState:i,...s}=e,n={},a={},p={};return i&&(p=i({props:t,constants:r})),Object.entries(s).forEach(([l,o])=>{if(l.startsWith("select")){n[l]=(...c)=>o({state:p,props:t,constants:r},...c);return}a[l]=(c={})=>{let d=c===void 0?{}:c;if(!Ue(d))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return p=md(p,h=>o({state:h,props:t,constants:r},d)),p}}),{getState:()=>p,...a,...n}},Gi=e=>!Ue(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Gi(t)}),Object.freeze(e)),bd=({setupConstants:e,fileConstants:t})=>{let r=Ue(e)?e:{},i=Ue(t)?t:{};return Gi({...r,...i})},vd=(e,t)=>{if(!t||typeof t!="object")return"";let r="",i=n=>Object.entries(n).map(([a,p])=>` ${a}: ${p};`).join(`
1075
+ `),s=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let l=Object.entries(a).map(([o,c])=>{let d=i(c);return` ${o} {
1076
+ ${d.split(`
1077
+ `).map(h=>h?` ${h}`:"").join(`
1078
1078
  `)}
1079
1079
  }`}).join(`
1080
1080
  `);return`${n} {
1081
- ${p}
1082
- }`}let l=s(a);return`${n} {
1083
1081
  ${l}
1084
- }`};return Object.entries(t).forEach(([n,a])=>{let l=i(n,a);l&&(r+=(r?`
1082
+ }`}let p=i(a);return`${n} {
1083
+ ${p}
1084
+ }`};return Object.entries(t).forEach(([n,a])=>{let p=s(n,a);p&&(r+=(r?`
1085
1085
 
1086
- `:"")+l)}),r};var xt=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...xt(r));else{if(r&&typeof r=="object"){let s=Object.entries(r);if(s.length>0){let[i,n]=s[0];Array.isArray(n)&&(r={[i]:xt(n)})}}t.push(r)}return t},[]):e;var Xr=":",Su=new Set(["__proto__","constructor","prototype"]),Cu=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,hn=e=>Cu.test(e),mn=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let l=t[a];if(!i&&l===".")s&&(r.push(s),s="");else if(!i&&l==="[")s&&(r.push(s),s=""),i=!0;else if(i&&l==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let p=Number(s);r.push(Number.isNaN(p)?s:p)}s=""}i=!1,n=null}else i&&(l==='"'||l==="'")&&(n?l===n&&(n=null):n=l),s+=l}return s&&r.push(s),r.reduce((a,l)=>{if(a==null)return;let p=typeof l=="number"?l:String(l);if(!(typeof p=="string"&&Su.has(p)))return a[p]},e)},Iu=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase());var yn=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:s})=>{let i={},n={},a=g=>{if(g==="role"||g.startsWith("aria-")||g.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${g}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(g,_,x)=>{let E=Iu(g);if(!E)throw new Error(`[Parser] Invalid ${x} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,E))throw new Error(`[Parser] Duplicate prop binding '${E}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[E]=_},p=(g,_)=>{if(!hn(g))throw new Error(`[Parser] Invalid ${_} attribute name '${g}' on '${r}'.`)};if(!e)return{attrs:i,props:n};let o=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,u,c=new Set;for(;(u=o.exec(e))!==null;){let g=u[1],_=u[2]??u[3]??u[4]??"";if(c.add(g),g.startsWith(".")){i[g]=_;continue}if(g.startsWith(Xr)){let x=g.substring(1),E=_;if(u[4]!==void 0&&u[4]!==""){let A=u[4],S=mn(t,A);S!==void 0&&(E=S)}l(x,E,"property-form");continue}if(g.startsWith("?")){let x=g.substring(1);p(x,"boolean toggle");let E=_;a(x);let A;E==="true"?A=!0:E==="false"||E===""?A=!1:A=mn(t,E),A&&(i[x]=""),s&&x!=="id"&&l(x,!!A,"boolean attribute-form");continue}p(g,"binding"),i[g]=_,s&&g!=="id"&&l(g,_,"attribute-form")}let d=e,h=[],f,m=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(f=m.exec(e))!==null;)h.push(f[0]);h.forEach(g=>{d=d.replace(g," ")});let b=/(\S+?)(?=\s|$)/g,y;for(;(y=b.exec(d))!==null;){let g=y[1];if(!g.startsWith(".")&&!(c.has(g)||g.startsWith(Xr)||g.includes("="))){if(g.startsWith("?")){let _=g.substring(1);p(_,"boolean toggle"),a(_),i[_]="",s&&_!=="id"&&l(_,!0,"boolean attribute-form");continue}if(!hn(g))throw new Error(`[Parser] Invalid attribute token '${g}' on '${r}'.`);!c.has(g)&&!g.startsWith(Xr)&&!g.includes("=")&&(i[g]="",s&&g!=="id"&&l(g,!0,"boolean attribute-form"))}}return{attrs:i,props:n}};var Ou=/^[a-z][a-zA-Z0-9]*\*?$/,Tu=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,Lu=/^[a-z][a-zA-Z0-9]*$/,gn=new Set(["window","document"]),Et=e=>Object.entries(e||{}).map(([t,r])=>{if(gn.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let s="id",i=t;t.startsWith(".")?(s="class",i=t.slice(1)):t.startsWith("#")&&(s="id",i=t.slice(1));let n=i.endsWith("*")?i.slice(0,-1):i;if(gn.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(s==="id"&&!Ou.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(s==="class"&&!Tu.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let a=i.endsWith("*"),l=a?i.slice(0,-1):i;return{refKey:t,refConfig:r,targetType:s,isWildcard:a,prefix:l}}),wn=e=>{if(!Lu.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},bn=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,At=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let s=[],i=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){bn({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&s.push({...n,matchedValue:e});return}let a=i.find(l=>bn({value:l,prefix:n.prefix,isWildcard:n.isWildcard}));a&&s.push({...n,matchedValue:a})}),s.length===0?null:(s.sort((n,a)=>{let l=n.targetType==="id"?2:1,p=a.targetType==="id"?2:1;return l!==p?p-l:!n.isWildcard&&a.isWildcard?-1:n.isWildcard&&!a.isWildcard?1:a.prefix.length-n.prefix.length}),s[0])},nt=({optionName:e,optionValue:t,eventType:r,refKey:s})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${s}'. Expected boolean.`)},vn=({optionName:e,optionValue:t,eventType:r,refKey:s})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${s}'. Expected non-negative number.`)},_n=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let s=Object.prototype.hasOwnProperty.call(t,"debounce"),i=Object.prototype.hasOwnProperty.call(t,"throttle");if(nt({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),nt({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),nt({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),nt({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),nt({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),vn({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),vn({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),s&&i)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:s,hasThrottle:i}};var kt=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Ru=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:s})=>{let i=n=>{let a=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof s!="function"?a:s(a,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let a=i(n);t.handleCallStoreAction({...a,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let a=i(n);t[e.handler]({...a,_event:n})}:(e.handler&&r?.(e.handler),null)},Nu=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:s,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:a=null,nowFn:l=Date.now,setTimeoutFn:p=setTimeout,clearTimeoutFn:o=clearTimeout})=>u=>{let c=n.get(i)||{},d=u.currentTarget||a;if(e.once)if(d){if(c.onceTargets||(c.onceTargets=new WeakSet),c.onceTargets.has(d)){n.set(i,c);return}c.onceTargets.add(d)}else if(c.onceTriggered){n.set(i,c);return}else c.onceTriggered=!0;if(e.targetOnly&&u.target!==u.currentTarget){n.set(i,c);return}if(e.preventDefault&&u.preventDefault(),e.stopImmediatePropagation?u.stopImmediatePropagation():e.stopPropagation&&u.stopPropagation(),r){c.debounceTimer&&o(c.debounceTimer),c.debounceTimer=p(()=>{let h=c.debounceTimer;try{t(u)}catch(f){throw o(h),c.debounceTimer=null,f}c.debounceTimer=null},e.debounce),n.set(i,c);return}if(s){Object.prototype.hasOwnProperty.call(c,"lastThrottleAt")||(c.lastThrottleAt=void 0);let h=l();if(c.lastThrottleAt===void 0||h-c.lastThrottleAt>=e.throttle){c.lastThrottleAt=h,n.set(i,c),t(u);return}n.set(i,c);return}n.set(i,c),t(u)},$t=({eventType:e,eventConfig:t,refKey:r,handlers:s,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:o=Date.now,setTimeoutFn:u=setTimeout,clearTimeoutFn:c=clearTimeout})=>{let{hasDebounce:d,hasThrottle:h}=_n({eventType:e,eventConfig:t,refKey:r}),f=Ru({eventConfig:t,handlers:s,onMissingHandler:p,parseAndRenderFn:l});return f?Nu({eventConfig:t,callback:f,hasDebounce:d,hasThrottle:h,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:u,clearTimeoutFn:c}):null};var xn=({h:e,template:t,viewData:r,refs:s,handlers:i,createComponentUpdateHook:n})=>{let a=et(t,r,{}),l=xt(a),p=Vu({h:e,items:l,refs:s,handlers:i,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},Vu=({h:e,items:t,refs:r={},handlers:s={},viewData:i={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let a=Et(r),l=a.some(o=>o.targetType==="id");function p(o,u=""){return o.map((c,d)=>{let h=u?`${u}.${d}`:String(d);if(typeof c=="string"||typeof c=="number")return String(c);if(typeof c!="object"||c===null)return console.warn("Skipping invalid item in DOM structure:",c),null;let f=Object.entries(c);if(f.length===0)return null;let[m,b]=f[0];if(!isNaN(Number(m)))return Array.isArray(b)?p(b,h):typeof b=="object"&&b!==null&&Object.entries(b).length>0?p([b],h):String(b);f.length>1&&console.warn("Item has multiple keys, processing only the first:",m);let y,g,_=m.indexOf(" ");_===-1?(y=m,g=""):(y=m.substring(0,_),g=m.substring(_+1).trim());let x=y.split(/[.#]/)[0],E=x.includes("-"),A,S;try{({attrs:A,props:S}=yn({attrsString:g,viewData:i,tagName:x,isWebComponent:E}))}catch(F){throw new Error(`[Parser] Failed to parse bindings for selector '${y}' with attrs '${g}': ${F.message}`)}let $=y.match(/#([^.#\s]+)/);$&&!Object.prototype.hasOwnProperty.call(A,"id")&&(A.id=$[1]);let R=null;A.id&&(R=A.id);let B=(y.match(/\.([^.#]+)/g)||[]).map(F=>F.substring(1)),H=typeof A.class=="string"?A.class.split(/\s+/).filter(Boolean):[],ne=[...new Set([...B,...H])],me=Object.create(null),Ie=null;if(!E){B.forEach(Oe=>{me[Oe]=!0});let F=y.match(/#([^.#\s]+)/);F&&(Ie=F[1])}let ot;typeof b=="string"||typeof b=="number"?ot=String(b):Array.isArray(b)?ot=p(b,h):ot=[],Ie&&!E&&(A.id=Ie);let It=Object.create(null);if(a.length>0){l&&R&&wn(R);let F=At({elementIdForRefs:R,classNames:ne,refMatchers:a});if(F){let Oe=F.refKey,ss=F.matchedValue||R||Oe;if(F.refConfig&&F.refConfig.eventListeners){let la=F.refConfig.eventListeners,pa=kt(s);Object.entries(la).forEach(([Ot,ca])=>{let ua=`${Oe}:${ss}:${Ot}`,is=$t({eventType:Ot,eventConfig:ca,refKey:Oe,handlers:s,eventRateLimitState:pa,stateKey:ua,parseAndRenderFn:rt,onMissingHandler:da=>{console.warn(`[Parser] Handler '${da}' for refKey '${Oe}' (matching '${ss}') is referenced but not found in available handlers.`)}});is&&(It[Ot]=is)})}}}let ye={};if(R?ye.key=R:y&&(ye.key=`${y}-${h}`),Object.keys(A).length>0&&(ye.attrs=A),Object.keys(me).length>0&&(ye.class=me),Object.keys(It).length>0&&(ye.on=It),Object.keys(S).length>0&&(ye.props=S),E&&typeof n=="function"){let F=n({selector:y,tagName:x});F&&(ye.hook=F)}try{return e(x,ye,ot)}catch(F){throw new Error(`[Parser] Error creating virtual node for '${x}': ${F.message}`)}}).filter(Boolean)}return p(t)};var En=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>({...e,refs:t,dispatchEvent:r,store:s,render:i}),Pu=({store:e,render:t,parseAndRenderFn:r})=>s=>{let{_event:i,_action:n}=s,a=r(s,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](a),t()},An=({handlers:e,deps:t,parseAndRenderFn:r})=>{let s={handleCallStoreAction:Pu({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(i=>{s[i]=n=>e[i](t,n)}),s},Du=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},kn=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return Du(r)},$n=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Sn=({attributeName:e,oldValue:t,newValue:r,deps:s,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:a})=>{let l=n(e),p={};i.forEach(d=>{let h=s.props[d];h!==void 0&&(p[d]=h)});let o={...p},u=a(t),c=a(r);return u===void 0?delete o[l]:o[l]=u,c===void 0?delete p[l]:p[l]=c,{changedProp:l,oldProps:o,newProps:p}};var Bu=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Cn=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:s,timing:i={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let a=[],l=new Set,p=kt(t);return Object.entries(e).forEach(([o,u])=>{if(o!=="window"&&o!=="document")return;let c=Bu({refKey:o,targets:r});!c||!u?.eventListeners||Object.entries(u.eventListeners).forEach(([d,h])=>{let f=`${o}:${d}`;l.add(f);let m=$t({eventType:d,eventConfig:h,refKey:o,handlers:t,eventRateLimitState:p,stateKey:f,fallbackCurrentTarget:c,parseAndRenderFn:s,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:b=>{n(`[Runtime] Handler '${b}' for global ref '${o}' is referenced but not found in available handlers.`)}});m&&(c.addEventListener(d,m),a.push(()=>{c.removeEventListener(d,m)}))})}),()=>{a.forEach(o=>o()),l.forEach(o=>{let u=p.get(o);u&&u.debounceTimer&&i.clearTimeoutFn(u.debounceTimer),p.delete(o)})}};var ju=e=>Et(e),Fu=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([i,n])=>{n&&t.push(i)});let s=e?.data?.attrs?.class;return typeof s=="string"&&s.split(/\s+/).filter(Boolean).forEach(i=>t.push(i)),[...new Set(t)]};var In=({rootVNode:e,refs:t})=>{let r={},s=ju(t),i=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,l=Fu(n),p=At({elementIdForRefs:a,classNames:l,refMatchers:s});if(n.elm&&p){let o=a||p.refKey;r[o]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),r};var On=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(s=>{r.add(s),r.add(t(s))}),[...r]},Tn=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>En({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i}),Ln=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Rn=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let s=0;return r.forEach(i=>{i&&i.debounceTimer&&(t(i.debounceTimer),s+=1)}),r.clear(),s};var Nn=({instance:e})=>Tn({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Vn=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:s=An,runBeforeMountFn:i=kn,attachGlobalRefListenersFn:n=Cn,runAfterMountFn:a=$n})=>{let l=Nn({instance:e});return e.transformedHandlers=s({handlers:e.handlers,deps:l,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:l}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),a({handlers:e.handlers,deps:l}),l},Pn=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Rn({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Dn=({instance:e,attributeName:t,oldValue:r,newValue:s,scheduleFrameFn:i})=>{if(!(r===s||!e.render)){if(e.handlers?.handleOnUpdate){let n=Nn({instance:e}),a=Sn({attributeName:t,oldValue:r,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:ft,normalizeAttributeValue:dt});e.handlers.handleOnUpdate(n,a);return}i(()=>{e.render()})}},Bn=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=xn,collectRefElementsFn:s=In,onError:i=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let a=s({rootVNode:e._oldVNode,refs:e.refs});return Ln({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}};var Mu=`
1086
+ `:"")+p)}),r},Zt=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Zt(r));else{if(r&&typeof r=="object"){let i=Object.entries(r);if(i.length>0){let[s,n]=i[0];Array.isArray(n)&&(r={[s]:Zt(n)})}}t.push(r)}return t},[]):e,Wt=":",wd=new Set(["__proto__","constructor","prototype"]),_d=/^[A-Za-z_][A-Za-z0-9_.:-]*$/,ri=e=>_d.test(e),ii=(e,t)=>{if(!t)return e;let r=[],i="",s=!1;for(let n=0;n<t.length;n++){let a=t[n];if(!s&&a===".")i&&(r.push(i),i="");else if(!s&&a==="[")i&&(r.push(i),i=""),s=!0;else if(s&&a==="]"){if(i){if(i.startsWith('"')&&i.endsWith('"')||i.startsWith("'")&&i.endsWith("'"))r.push(i.slice(1,-1));else{let p=Number(i);r.push(Number.isNaN(p)?i:p)}i=""}s=!1}else i+=a}return i&&r.push(i),r.reduce((n,a)=>{if(n==null)return;let p=typeof a=="number"?a:String(a);if(!(typeof p=="string"&&wd.has(p)))return n[p]},e)},xd=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ad=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:i})=>{let s={},n={},a=m=>{if(m==="role"||m.startsWith("aria-")||m.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${m}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},p=(m,_,A)=>{let $=xd(m);if(!$)throw new Error(`[Parser] Invalid ${A} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,$))throw new Error(`[Parser] Duplicate prop binding '${$}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[$]=_},l=(m,_)=>{if(!ri(m))throw new Error(`[Parser] Invalid ${_} attribute name '${m}' on '${r}'.`)};if(!e)return{attrs:s,props:n};let o=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,c,d=new Set;for(;(c=o.exec(e))!==null;){let m=c[1],_=c[2]??c[3]??c[4]??"";if(d.add(m),m.startsWith(".")){s[m]=_;continue}if(m.startsWith(Wt)){let A=m.substring(1),$=_;if(c[4]!==void 0&&c[4]!==""){let k=c[4],I=ii(t,k);I!==void 0&&($=I)}p(A,$,"property-form");continue}if(m.startsWith("?")){let A=m.substring(1);l(A,"boolean toggle");let $=_;a(A);let k;$==="true"?k=!0:$==="false"||$===""?k=!1:k=ii(t,$),k&&(s[A]=""),i&&A!=="id"&&p(A,!!k,"boolean attribute-form");continue}l(m,"binding"),s[m]=_,i&&m!=="id"&&p(m,_,"attribute-form")}let h=e,f=[],u,y=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(u=y.exec(e))!==null;)f.push(u[0]);f.forEach(m=>{h=h.replace(m," ")});let g=/(\S+?)(?=\s|$)/g,b;for(;(b=g.exec(h))!==null;){let m=b[1];if(!m.startsWith(".")&&!(d.has(m)||m.startsWith(Wt)||m.includes("="))){if(m.startsWith("?")){let _=m.substring(1);l(_,"boolean toggle"),a(_),s[_]="",i&&_!=="id"&&p(_,!0,"boolean attribute-form");continue}if(!ri(m))throw new Error(`[Parser] Invalid attribute token '${m}' on '${r}'.`);!d.has(m)&&!m.startsWith(Wt)&&!m.includes("=")&&(s[m]="",i&&m!=="id"&&p(m,!0,"boolean attribute-form"))}}return{attrs:s,props:n}},$d=/^[a-z][a-zA-Z0-9]*\*?$/,kd=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,Ed=/^[a-z][a-zA-Z0-9]*$/,si=new Set(["window","document"]),Yi=e=>Object.entries(e||{}).map(([t,r])=>{if(si.has(t))return{refKey:t,refConfig:r,targetType:"global",isWildcard:!1,prefix:t};let i="id",s=t;t.startsWith(".")?(i="class",s=t.slice(1)):t.startsWith("#")&&(i="id",s=t.slice(1));let n=s.endsWith("*")?s.slice(0,-1):s;if(si.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(i==="id"&&!$d.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(i==="class"&&!kd.test(s))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let a=s.endsWith("*"),p=a?s.slice(0,-1):s;return{refKey:t,refConfig:r,targetType:i,isWildcard:a,prefix:p}}),Sd=e=>{if(!Ed.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},ni=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,Qi=({elementIdForRefs:e,classNames:t=[],refMatchers:r})=>{let i=[],s=Array.isArray(t)?t:[];return r.forEach(n=>{if(n.targetType==="global")return;if(n.targetType==="id"){ni({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&i.push({...n,matchedValue:e});return}let a=s.find(p=>ni({value:p,prefix:n.prefix,isWildcard:n.isWildcard}));a&&i.push({...n,matchedValue:a})}),i.length===0?null:(i.sort((n,a)=>{let p=n.targetType==="id"?2:1,l=a.targetType==="id"?2:1;return p!==l?l-p:!n.isWildcard&&a.isWildcard?-1:n.isWildcard&&!a.isWildcard?1:a.prefix.length-n.prefix.length}),i[0])},Fe=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&typeof t!="boolean")throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected boolean.`)},ai=({optionName:e,optionValue:t,eventType:r,refKey:i})=>{if(t!==void 0&&(typeof t!="number"||Number.isNaN(t)||!Number.isFinite(t)||t<0))throw new Error(`[Parser] Invalid '${e}' for event '${r}' on ref '${i}'. Expected non-negative number.`)},Cd=({eventType:e,eventConfig:t,refKey:r})=>{if(typeof t!="object"||t===null)throw new Error(`[Parser] Invalid event config for event '${e}' on ref '${r}'.`);let i=Object.prototype.hasOwnProperty.call(t,"debounce"),s=Object.prototype.hasOwnProperty.call(t,"throttle");if(Fe({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Fe({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Fe({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Fe({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Fe({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),ai({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),ai({optionName:"throttle",optionValue:t.throttle,eventType:e,refKey:r}),i&&s)throw new Error(`[Parser] Event '${e}' on ref '${r}' cannot define both 'debounce' and 'throttle'.`);if(t.handler&&t.action)throw new Error("Each listener can have handler or action but not both");if(!t.handler&&!t.action)throw new Error("Each listener must define either handler or action");return{hasDebounce:i,hasThrottle:s}},Xi=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),Id=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:i})=>{let s=n=>{let a=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof i!="function"?a:i(a,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let a=s(n);t.handleCallStoreAction({...a,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let a=s(n);t[e.handler]({...a,_event:n})}:(e.handler&&r?.(e.handler),null)},Od=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:i,stateKey:s,eventRateLimitState:n,fallbackCurrentTarget:a=null,nowFn:p=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:o=clearTimeout})=>c=>{let d=n.get(s)||{},h=c.currentTarget||a;if(e.once)if(h){if(d.onceTargets||(d.onceTargets=new WeakSet),d.onceTargets.has(h)){n.set(s,d);return}d.onceTargets.add(h)}else if(d.onceTriggered){n.set(s,d);return}else d.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(s,d);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){d.debounceTimer&&o(d.debounceTimer),d.debounceTimer=l(()=>{let f=d.debounceTimer;try{t(c)}catch(u){throw o(f),d.debounceTimer=null,u}d.debounceTimer=null},e.debounce),n.set(s,d);return}if(i){Object.prototype.hasOwnProperty.call(d,"lastThrottleAt")||(d.lastThrottleAt=void 0);let f=p();if(d.lastThrottleAt===void 0||f-d.lastThrottleAt>=e.throttle){d.lastThrottleAt=f,n.set(s,d),t(c);return}n.set(s,d);return}n.set(s,d),t(c)},Zi=({eventType:e,eventConfig:t,refKey:r,handlers:i,eventRateLimitState:s,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:p,onMissingHandler:l,nowFn:o=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:d=clearTimeout})=>{let{hasDebounce:h,hasThrottle:f}=Cd({eventType:e,eventConfig:t,refKey:r}),u=Id({eventConfig:t,handlers:i,onMissingHandler:l,parseAndRenderFn:p});return u?Od({eventConfig:t,callback:u,hasDebounce:h,hasThrottle:f,stateKey:n,eventRateLimitState:s,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:c,clearTimeoutFn:d}):null},Td=({h:e,template:t,viewData:r,refs:i,handlers:s,createComponentUpdateHook:n})=>{let a=Li(t,r,{}),p=Zt(a),l=Ld({h:e,items:p,refs:i,handlers:s,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},Ld=({h:e,items:t,refs:r={},handlers:i={},viewData:s={},createComponentUpdateHook:n})=>{if(!Array.isArray(t))throw new Error("[Parser] Input to createVirtualDom must be an array, got "+typeof t);let a=Yi(r),p=a.some(o=>o.targetType==="id");function l(o,c=""){return o.map((d,h)=>{let f=c?`${c}.${h}`:String(h);if(typeof d=="string"||typeof d=="number")return String(d);if(typeof d!="object"||d===null)return console.warn("Skipping invalid item in DOM structure:",d),null;let u=Object.entries(d);if(u.length===0)return null;let[y,g]=u[0];if(!isNaN(Number(y)))return Array.isArray(g)?l(g,f):typeof g=="object"&&g!==null&&Object.entries(g).length>0?l([g],f):String(g);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let b,m,_=y.indexOf(" ");_===-1?(b=y,m=""):(b=y.substring(0,_),m=y.substring(_+1).trim());let A=b.split(/[.#]/)[0],$=A.includes("-"),k,I;try{({attrs:k,props:I}=Ad({attrsString:m,viewData:s,tagName:A,isWebComponent:$}))}catch(M){throw new Error(`[Parser] Failed to parse bindings for selector '${b}' with attrs '${m}': ${M.message}`)}let S=b.match(/#([^.#\s]+)/);S&&!Object.prototype.hasOwnProperty.call(k,"id")&&(k.id=S[1]);let j=null;k.id&&(j=k.id);let W=(b.match(/\.([^.#]+)/g)||[]).map(M=>M.substring(1)),P=typeof k.class=="string"?k.class.split(/\s+/).filter(Boolean):[],U=[...new Set([...W,...P])],Q=Object.create(null),fe=null;if(!$){W.forEach(Ee=>{Q[Ee]=!0});let M=b.match(/#([^.#\s]+)/);M&&(fe=M[1])}let be;typeof g=="string"||typeof g=="number"?be=String(g):Array.isArray(g)?be=l(g,f):be=[],fe&&!$&&(k.id=fe);let yt=Object.create(null);if(a.length>0){p&&j&&Sd(j);let M=Qi({elementIdForRefs:j,classNames:U,refMatchers:a});if(M){let Ee=M.refKey,lr=M.matchedValue||j||Ee;if(M.refConfig&&M.refConfig.eventListeners){let ns=M.refConfig.eventListeners,as=Xi(i);Object.entries(ns).forEach(([mt,os])=>{let ls=`${Ee}:${lr}:${mt}`,pr=Zi({eventType:mt,eventConfig:os,refKey:Ee,handlers:i,eventRateLimitState:as,stateKey:ls,parseAndRenderFn:zi,onMissingHandler:ps=>{console.warn(`[Parser] Handler '${ps}' for refKey '${Ee}' (matching '${lr}') is referenced but not found in available handlers.`)}});pr&&(yt[mt]=pr)})}}}let ye={};if(j?ye.key=j:b&&(ye.key=`${b}-${f}`),Object.keys(k).length>0&&(ye.attrs=k),Object.keys(Q).length>0&&(ye.class=Q),Object.keys(yt).length>0&&(ye.on=yt),Object.keys(I).length>0&&(ye.props=I),$&&typeof n=="function"){let M=n({selector:b,tagName:A});M&&(ye.hook=M)}try{return e(A,ye,be)}catch(M){throw new Error(`[Parser] Error creating virtual node for '${A}': ${M.message}`)}}).filter(Boolean)}return l(t)},Rd=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>({...e,refs:t,dispatchEvent:r,store:i,render:s}),Nd=({store:e,render:t,parseAndRenderFn:r})=>i=>{let{_event:s,_action:n}=i,a=r(i,{_event:s});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](a),t()},jd=({handlers:e,deps:t,parseAndRenderFn:r})=>{let i={handleCallStoreAction:Nd({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(s=>{i[s]=n=>e[s](t,n)}),i},Vd=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Dd=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return Vd(r)},Pd=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Bd=({attributeName:e,oldValue:t,newValue:r,deps:i,propsSchemaKeys:s,toCamelCase:n,normalizeAttributeValue:a})=>{let p=n(e),l={};s.forEach(h=>{let f=i.props[h];f!==void 0&&(l[h]=f)});let o={...l},c=a(t),d=a(r);return c===void 0?delete o[p]:o[p]=c,d===void 0?delete l[p]:l[p]=d,{changedProp:p,oldProps:o,newProps:l}},Wd=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Fd=({refs:e={},handlers:t={},targets:r={window:globalThis.window,document:globalThis.document},parseAndRenderFn:i,timing:s={nowFn:Date.now,setTimeoutFn:setTimeout,clearTimeoutFn:clearTimeout},warnFn:n=console.warn})=>{let a=[],p=new Set,l=Xi(t);return Object.entries(e).forEach(([o,c])=>{if(o!=="window"&&o!=="document")return;let d=Wd({refKey:o,targets:r});!d||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([h,f])=>{let u=`${o}:${h}`;p.add(u);let y=Zi({eventType:h,eventConfig:f,refKey:o,handlers:t,eventRateLimitState:l,stateKey:u,fallbackCurrentTarget:d,parseAndRenderFn:i,nowFn:s.nowFn,setTimeoutFn:s.setTimeoutFn,clearTimeoutFn:s.clearTimeoutFn,onMissingHandler:g=>{n(`[Runtime] Handler '${g}' for global ref '${o}' is referenced but not found in available handlers.`)}});y&&(d.addEventListener(h,y),a.push(()=>{d.removeEventListener(h,y)}))})}),()=>{a.forEach(o=>o()),p.forEach(o=>{let c=l.get(o);c&&c.debounceTimer&&s.clearTimeoutFn(c.debounceTimer),l.delete(o)})}},zd=e=>Yi(e),Md=e=>{let t=[],r=e?.data?.class;r&&typeof r=="object"&&Object.entries(r).forEach(([s,n])=>{n&&t.push(s)});let i=e?.data?.attrs?.class;return typeof i=="string"&&i.split(/\s+/).filter(Boolean).forEach(s=>t.push(s)),[...new Set(t)]},Kd=({rootVNode:e,refs:t})=>{let r={},i=zd(t),s=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,p=Md(n),l=Qi({elementIdForRefs:a,classNames:p,refMatchers:i});if(n.elm&&l){let o=a||l.refKey;r[o]=n.elm}Array.isArray(n.children)&&n.children.forEach(s)};return s(e),r},Ud=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(i=>{r.add(i),r.add(t(i))}),[...r]},Hd=({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s})=>Rd({baseDeps:e,refs:t,dispatchEvent:r,store:i,render:s}),qd=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Jd=({transformedHandlers:e,clearTimerFn:t=clearTimeout})=>{let r=e?.__eventRateLimitState;if(!(r instanceof Map))return 0;let i=0;return r.forEach(s=>{s&&s.debounceTimer&&(t(s.debounceTimer),i+=1)}),r.clear(),i},es=({instance:e})=>Hd({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Gd=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:i=jd,runBeforeMountFn:s=Dd,attachGlobalRefListenersFn:n=Fd,runAfterMountFn:a=Pd})=>{let p=es({instance:e});return e.transformedHandlers=i({handlers:e.handlers,deps:p,parseAndRenderFn:t}),e._unmountCallback=s({handlers:e.handlers,deps:p}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),a({handlers:e.handlers,deps:p}),p},Yd=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Jd({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Qd=({instance:e,attributeName:t,oldValue:r,newValue:i,scheduleFrameFn:s})=>{if(!(r===i||!e.render)&&!(e.isConnected===!1||!e.renderTarget)){if(e.handlers?.handleOnUpdate){let n=es({instance:e}),a=Bd({attributeName:t,oldValue:r,newValue:i,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Ti,normalizeAttributeValue:Ut});e.handlers.handleOnUpdate(n,a);return}s(()=>{e.render()})}},Xd=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=Td,collectRefElementsFn:i=Kd,onError:s=n=>{console.error("Error during render:",n)}})=>{if(!e.patch)return console.error("Patch function is not defined!"),null;if(!e.template)return console.error("Template is not defined!"),null;try{let n=r({h:e._snabbdomH,template:e.template,viewData:e.viewData,refs:e.refs,handlers:e.transformedHandlers,createComponentUpdateHook:t});e._oldVNode?e._oldVNode=e.patch(e._oldVNode,n):e._oldVNode=e.patch(e.renderTarget,n);let a=i({rootVNode:e._oldVNode,refs:e.refs});return qd({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return s(n),e._oldVNode||null}},Zd=`
1087
1087
  a, a:link, a:visited, a:hover, a:active {
1088
1088
  display: contents;
1089
1089
  color: inherit;
@@ -1095,4 +1095,4 @@ ${l}
1095
1095
  font: inherit;
1096
1096
  cursor: pointer;
1097
1097
  }
1098
- `,jn=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:s=i=>document.createElement(i)})=>{let i=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Mu);let a=[n];if(t){let p=r();p.replaceSync(t),a.push(p)}i.adoptedStyleSheets=a;let l=s("div");return l.style.cssText="display: contents;",i.appendChild(l),l.parentNode||e.appendChild(l),e.style.display="contents",{shadow:i,renderTarget:l,adoptedStyleSheets:a}};var St=(e,t=requestAnimationFrame)=>t(e);var Fn=({scheduleFrameFn:e=St}={})=>({update:(t,r)=>{let s=t.data?.props||{},i=r.data?.props||{};if(!(JSON.stringify(s)!==JSON.stringify(i)))return;let a=r.elm;!a||typeof a.render!="function"||(a.setAttribute("isDirty","true"),e(()=>{if(a.render(),a.removeAttribute("isDirty"),a.handlers&&a.handlers.handleOnUpdate){let l={...a.deps,store:a.store,render:a.render.bind(a),handlers:a.handlers,dispatchEvent:a.dispatchEvent.bind(a),refs:a.refIds||{}};a.handlers.handleOnUpdate(l,{oldProps:s,newProps:i})}}))}});var Mn=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:s,refs:i,styles:n,handlers:a,methods:l,constants:p,store:o,patch:u,h:c,deps:d})=>{class h extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let b={};return this.store.selectViewData&&(b=this.store.selectViewData()),b}connectedCallback(){let b=jn({host:this,cssText:this.cssText});this.shadow=b.shadow,this.renderTarget=b.renderTarget,Vn({instance:this,parseAndRenderFn:rt,renderFn:this.render})}disconnectedCallback(){Pn({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(b,y,g){Dn({instance:this,attributeName:b,oldValue:y,newValue:g,scheduleFrameFn:St})}render=()=>{Bn({instance:this,createComponentUpdateHookFn:Fn})}}class f extends h{static get observedAttributes(){return On({propsSchemaKeys:r,toKebabCase:Dr})}constructor(){super(),this.constants=dn({setupConstants:d?.constants,fileConstants:p}),this.propsSchema=t,this.props=t?Vi(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=cn(o,this.props,this.constants),this.template=s,this.handlers=a,this.methods=l,this.refs=i,this.patch=u,this.deps={...d,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},Yi(this,this.methods),this._snabbdomH=c,this.cssText=fn(e,n)}}return f};function Se(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var De=Array.isArray;function Be(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Wu(e,t){return document.createElement(e,t)}function zu(e,t,r){return document.createElementNS(e,t,r)}function Uu(){return Ce(document.createDocumentFragment())}function Ku(e){return document.createTextNode(e)}function Hu(e){return document.createComment(e)}function Gu(e,t,r){if(he(e)){let s=e;for(;s&&he(s);)s=Ce(s).parent;e=s??e}he(t)&&(t=Ce(t,e)),r&&he(r)&&(r=Ce(r).firstChildNode),e.insertBefore(t,r)}function qu(e,t){e.removeChild(t)}function Ju(e,t){he(t)&&(t=Ce(t,e)),e.appendChild(t)}function zn(e){if(he(e)){for(;e&&he(e);)e=Ce(e).parent;return e??null}return e.parentNode}function Yu(e){var t;if(he(e)){let r=Ce(e),s=zn(r);if(s&&r.lastChildNode){let i=Array.from(s.childNodes),n=i.indexOf(r.lastChildNode);return(t=i[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function Xu(e){return e.tagName}function Zu(e,t){e.textContent=t}function Qu(e){return e.textContent}function ed(e){return e.nodeType===1}function td(e){return e.nodeType===3}function rd(e){return e.nodeType===8}function he(e){return e.nodeType===11}function Ce(e,t){var r,s,i;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(s=n.firstChildNode)!==null&&s!==void 0||(n.firstChildNode=e.firstChild),(i=n.lastChildNode)!==null&&i!==void 0||(n.lastChildNode=e.lastChild),n}var Un={createElement:Wu,createElementNS:zu,createTextNode:Ku,createDocumentFragment:Uu,createComment:Hu,insertBefore:Gu,removeChild:qu,appendChild:Ju,parentNode:zn,nextSibling:Yu,tagName:Xu,setTextContent:Zu,getTextContent:Qu,isElement:ed,isText:td,isComment:rd,isDocumentFragment:he};function Ct(e){return e===void 0}function ie(e){return e!==void 0}var Zr=Se("",{},[],void 0,void 0);function at(e,t){var r,s;let i=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((s=t.data)===null||s===void 0?void 0:s.is),a=e.sel===t.sel,l=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&l}function sd(){throw new Error("The document fragment is not supported on this platform.")}function id(e,t){return e.isElement(t)}function nd(e,t){return e.isDocumentFragment(t)}function ad(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let a=(s=e[n])===null||s===void 0?void 0:s.key;a!==void 0&&(i[a]=n)}return i}var od=["create","update","remove","destroy","pre","post"];function Kn(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:Un;for(let f of od)for(let m of e){let b=m[f];b!==void 0&&s[f].push(b)}function n(f){let m=f.id?"#"+f.id:"",b=f.getAttribute("class"),y=b?"."+b.split(" ").join("."):"";return Se(i.tagName(f).toLowerCase()+m+y,{},[],void 0,f)}function a(f){return Se(void 0,{},[],void 0,f)}function l(f,m){return function(){if(--m===0){let y=i.parentNode(f);y!==null&&i.removeChild(y,f)}}}function p(f,m){var b,y,g,_;let x,E=f.data;if(E!==void 0){let $=(b=E.hook)===null||b===void 0?void 0:b.init;ie($)&&($(f),E=f.data)}let A=f.children,S=f.sel;if(S==="!")Ct(f.text)&&(f.text=""),f.elm=i.createComment(f.text);else if(S==="")f.elm=i.createTextNode(f.text);else if(S!==void 0){let $=S.indexOf("#"),R=S.indexOf(".",$),U=$>0?$:S.length,B=R>0?R:S.length,H=$!==-1||R!==-1?S.slice(0,Math.min(U,B)):S,ne=f.elm=ie(E)&&ie(x=E.ns)?i.createElementNS(x,H,E):i.createElement(H,E);for(U<B&&ne.setAttribute("id",S.slice(U+1,B)),R>0&&ne.setAttribute("class",S.slice(B+1).replace(/\./g," ")),x=0;x<s.create.length;++x)s.create[x](Zr,f);if(Be(f.text)&&(!De(A)||A.length===0)&&i.appendChild(ne,i.createTextNode(f.text)),De(A))for(x=0;x<A.length;++x){let Ie=A[x];Ie!=null&&i.appendChild(ne,p(Ie,m))}let me=f.data.hook;ie(me)&&((y=me.create)===null||y===void 0||y.call(me,Zr,f),me.insert&&m.push(f))}else if(!((g=r?.experimental)===null||g===void 0)&&g.fragments&&f.children){for(f.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:sd)(),x=0;x<s.create.length;++x)s.create[x](Zr,f);for(x=0;x<f.children.length;++x){let $=f.children[x];$!=null&&i.appendChild(f.elm,p($,m))}}else f.elm=i.createTextNode(f.text);return f.elm}function o(f,m,b,y,g,_){for(;y<=g;++y){let x=b[y];x!=null&&i.insertBefore(f,p(x,_),m)}}function u(f){var m,b;let y=f.data;if(y!==void 0){(b=(m=y?.hook)===null||m===void 0?void 0:m.destroy)===null||b===void 0||b.call(m,f);for(let g=0;g<s.destroy.length;++g)s.destroy[g](f);if(f.children!==void 0)for(let g=0;g<f.children.length;++g){let _=f.children[g];_!=null&&typeof _!="string"&&u(_)}}}function c(f,m,b,y){for(var g,_;b<=y;++b){let x,E,A=m[b];if(A!=null)if(ie(A.sel)){u(A),x=s.remove.length+1,E=l(A.elm,x);for(let $=0;$<s.remove.length;++$)s.remove[$](A,E);let S=(_=(g=A?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;ie(S)?S(A,E):E()}else A.children?(u(A),c(f,A.children,0,A.children.length-1)):i.removeChild(f,A.elm)}}function d(f,m,b,y){let g=0,_=0,x=m.length-1,E=m[0],A=m[x],S=b.length-1,$=b[0],R=b[S],U,B,H,ne;for(;g<=x&&_<=S;)E==null?E=m[++g]:A==null?A=m[--x]:$==null?$=b[++_]:R==null?R=b[--S]:at(E,$)?(h(E,$,y),E=m[++g],$=b[++_]):at(A,R)?(h(A,R,y),A=m[--x],R=b[--S]):at(E,R)?(h(E,R,y),i.insertBefore(f,E.elm,i.nextSibling(A.elm)),E=m[++g],R=b[--S]):at(A,$)?(h(A,$,y),i.insertBefore(f,A.elm,E.elm),A=m[--x],$=b[++_]):(U===void 0&&(U=ad(m,g,x)),B=U[$.key],Ct(B)?(i.insertBefore(f,p($,y),E.elm),$=b[++_]):Ct(U[R.key])?(i.insertBefore(f,p(R,y),i.nextSibling(A.elm)),R=b[--S]):(H=m[B],H.sel!==$.sel?i.insertBefore(f,p($,y),E.elm):(h(H,$,y),m[B]=void 0,i.insertBefore(f,H.elm,E.elm)),$=b[++_]));_<=S&&(ne=b[S+1]==null?null:b[S+1].elm,o(f,ne,b,_,S,y)),g<=x&&c(f,m,g,x)}function h(f,m,b){var y,g,_,x,E,A,S,$;let R=(y=m.data)===null||y===void 0?void 0:y.hook;(g=R?.prepatch)===null||g===void 0||g.call(R,f,m);let U=m.elm=f.elm;if(f===m)return;if(m.data!==void 0||ie(m.text)&&m.text!==f.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(x=f.data)!==null&&x!==void 0||(f.data={});for(let ne=0;ne<s.update.length;++ne)s.update[ne](f,m);(S=(A=(E=m.data)===null||E===void 0?void 0:E.hook)===null||A===void 0?void 0:A.update)===null||S===void 0||S.call(A,f,m)}let B=f.children,H=m.children;Ct(m.text)?ie(B)&&ie(H)?B!==H&&d(U,B,H,b):ie(H)?(ie(f.text)&&i.setTextContent(U,""),o(U,null,H,0,H.length-1,b)):ie(B)?c(U,B,0,B.length-1):ie(f.text)&&i.setTextContent(U,""):f.text!==m.text&&(ie(B)&&c(U,B,0,B.length-1),i.setTextContent(U,m.text)),($=R?.postpatch)===null||$===void 0||$.call(R,f,m)}return function(m,b){let y,g,_,x=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(id(i,m)?m=n(m):nd(i,m)&&(m=a(m)),at(m,b)?h(m,b,x):(g=m.elm,_=i.parentNode(g),p(b,x),_!==null&&(i.insertBefore(_,b.elm,i.nextSibling(g)),c(_,[m],0,0))),y=0;y<x.length;++y)x[y].data.hook.insert(x[y]);for(y=0;y<s.post.length;++y)s.post[y]();return b}}function Hn(e,t){let r,s,i=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(a,s)&&i.classList.remove(s);for(s in a)r=a[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var Gn={create:Hn,update:Hn};function qn(e,t){let r,s,i,n=t.elm,a=e.data.props,l=t.data.props;if(!(!a&&!l)&&a!==l){a=a||{},l=l||{};for(r in l)s=l[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var Jn={create:qn,update:qn};var ld="http://www.w3.org/1999/xlink",pd="http://www.w3.org/2000/xmlns/",cd="http://www.w3.org/XML/1998/namespace";function Yn(e,t){let r,s=t.elm,i=e.data.attrs,n=t.data.attrs;if(!(!i&&!n)&&i!==n){i=i||{},n=n||{};for(r in n){let a=n[r];i[r]!==a&&(a===!0?s.setAttribute(r,""):a===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,a):r.charCodeAt(3)===58?s.setAttributeNS(cd,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(pd,r,a):s.setAttributeNS(ld,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var Xn={create:Yn,update:Yn};var Zn=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,ud=function(e){Zn(function(){Zn(e)})},Qr=!1;function dd(e,t,r){ud(function(){e[t]=r})}function Qn(e,t){let r,s,i=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let l="delayed"in n;for(s in n)s in a||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in a)if(r=a[s],s==="delayed"&&a.delayed)for(let p in a.delayed)r=a.delayed[p],(!l||r!==n.delayed[p])&&dd(i.style,p,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function fd(e){let t,r,s=e.elm,i=e.data.style;if(!(!i||!(t=i.destroy)))for(r in t)s.style[r]=t[r]}function hd(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Qr||(e.elm.offsetLeft,Qr=!0);let s,i=e.elm,n=0,a=r.remove,l=0,p=[];for(s in a)p.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)p.indexOf(u[n])!==-1&&l++;i.addEventListener("transitionend",function(c){c.target===i&&--l,l===0&&t()})}function md(){Qr=!1}var ea={pre:md,create:Qn,update:Qn,destroy:fd,remove:hd};function ta(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let s=0;s<e.length;s++)ta(e[s],t,r)}function yd(e,t){let r=e.type,s=t.data.on;s&&s[r]&&ta(s[r],t,e)}function gd(){return function e(t){yd(t,e.vnode)}}function es(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,l;if(r!==n){if(r&&s)if(n)for(l in r)n[l]||i.removeEventListener(l,s,!1);else for(l in r)i.removeEventListener(l,s,!1);if(n){let p=t.listener=e.listener||gd();if(p.vnode=t,r)for(l in n)r[l]||a.addEventListener(l,p,!1);else for(l in n)a.addEventListener(l,p,!1)}}}var ra={create:es,update:es,destroy:es};var bd=()=>Kn([Gn,Jn,Xn,ea,ra]),sa=bd;function ia(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let s=0;s<t.length;++s){let i=t[s];if(typeof i=="string")continue;let n=i.data;n!==void 0&&ia(n,i.children,i.sel)}}function na(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),De(r)?i=r:Be(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(De(t)?i=t:Be(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)Be(i[a])&&(i[a]=Se(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&ia(s,i,e),Se(e,s,i,n,void 0)}var vd=sa(),wd=({handlers:e,methods:t,constants:r,schema:s,view:i,store:n},a)=>{if(!i)throw new Error("view is not defined");if(!s||typeof s!="object"||Array.isArray(s))throw new Error("schema is required. Define component metadata in .schema.yaml.");let l=s,{template:p,refs:o,styles:u}=i;Pi({schema:l,methodExports:Object.keys(t||{})});let c=l.componentName,d=l.propsSchema,h=d?.properties?[...new Set(Object.keys(d.properties).map(f=>ft(f)))]:[];return Mn({elementName:c,propsSchema:d,propsSchemaKeys:h,template:p,refs:o,styles:u,handlers:e,methods:t,constants:r,store:n,patch:vd,h:na,deps:a})},ts=wd;var _d=e=>{let t={};return{once:(r,s)=>{t[r]||(t[r]=[]);let i=(...n)=>{s(...n),t[r]=t[r].filter(a=>a!==i)};t[r].push(i)},emit:(r,...s)=>{t[r]&&t[r].forEach(i=>{i(...s)})},showAlert:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");e.transformedHandlers.handleShowAlert(r)},showConfirm:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.handleShowConfirm(r)},showDropdownMenu:async r=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.handleShowDropdownMenu(r)},closeAll:async()=>{if(!e)throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.");return e.transformedHandlers.handleCloseAll()}}},aa=_d;var xd=aa(),Ed={globalUI:xd},oa={components:Ed};var rs={components:{accordionItem:{handlers:Zt,schema:Rs,store:Qt,view:Ns},breadcrumb:{handlers:er,schema:Vs,store:tr,view:Ps},dropdownMenu:{handlers:rr,schema:Ds,store:sr,view:Bs},form:{handlers:fr,methods:hr,schema:ai,store:dr,view:oi},globalUi:{handlers:mr,schema:li,store:yr,view:pi},navbar:{handlers:gr,schema:ci,store:br,view:ui},pageOutline:{handlers:vr,schema:fi,store:wr,view:hi},popoverInput:{handlers:_r,schema:yi,store:xr,view:gi},select:{handlers:Er,schema:bi,store:Ar,view:vi},sidebar:{handlers:kr,schema:wi,store:Sr,view:_i},sliderInput:{handlers:Cr,schema:xi,store:Ir,view:Ei},table:{handlers:Or,schema:Ai,store:Tr,view:ki},tabs:{handlers:Lr,schema:$i,store:Rr,view:Si},tooltip:{handlers:Ci,schema:Ii,store:Nr,view:Oi},waveform:{handlers:Vr,schema:Li,store:Pr,view:Ri}}};Object.keys(rs).forEach(e=>{Object.keys(rs[e]).forEach(t=>{let r=rs[e][t],s=ts({...r},oa[e]),i=r.schema?.componentName;if(!i)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(i,s)})});customElements.define("rtgl-button",us({}));customElements.define("rtgl-view",ms({}));customElements.define("rtgl-text",gs({}));customElements.define("rtgl-image",ws({}));customElements.define("rtgl-svg",xs({}));customElements.define("rtgl-input",ge({}));customElements.define("rtgl-input-date",Es({}));customElements.define("rtgl-input-time",As({}));customElements.define("rtgl-input-datetime",ks({}));customElements.define("rtgl-input-number",$s({}));customElements.define("rtgl-textarea",Ss({}));customElements.define("rtgl-color-picker",Cs({}));customElements.define("rtgl-slider",Is({}));customElements.define("rtgl-checkbox",Os({}));customElements.define("rtgl-dialog",Ts({}));customElements.define("rtgl-popover",Ls({}));})();
1098
+ `,ec=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:i=s=>document.createElement(s)})=>{let s=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Zd);let a=[n];if(t){let l=r();l.replaceSync(t),a.push(l)}s.adoptedStyleSheets=a;let p=i("div");return p.style.cssText="display: contents;",s.appendChild(p),p.parentNode||e.appendChild(p),e.style.display="contents",{shadow:s,renderTarget:p,adoptedStyleSheets:a}},ts=(e,t=requestAnimationFrame)=>t(e),tc=({scheduleFrameFn:e=ts}={})=>({update:(t,r)=>{let i=t.data?.props||{},s=r.data?.props||{};if(JSON.stringify(i)===JSON.stringify(s))return;let n=r.elm;!n||typeof n.render!="function"||(n.setAttribute("isDirty","true"),e(()=>{if(n.render(),n.removeAttribute("isDirty"),n.handlers&&n.handlers.handleOnUpdate){let a={...n.deps,store:n.store,render:n.render.bind(n),handlers:n.handlers,dispatchEvent:n.dispatchEvent.bind(n),refs:n.refIds||{}};n.handlers.handleOnUpdate(a,{oldProps:i,newProps:s})}}))}}),rc=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:i,refs:s,styles:n,handlers:a,methods:p,constants:l,store:o,patch:c,h:d,deps:h})=>{class f extends HTMLElement{elementName;styles;_snabbdomH;store;props;propsSchema;template;handlers;methods;constants;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_globalListenersCleanup;_oldVNode;deps;_propsSchemaKeys=[];cssText;static get observedAttributes(){return["key"]}get viewData(){let g={};return this.store.selectViewData&&(g=this.store.selectViewData()),g}connectedCallback(){let g=ec({host:this,cssText:this.cssText});this.shadow=g.shadow,this.renderTarget=g.renderTarget,Gd({instance:this,parseAndRenderFn:zi,renderFn:this.render})}disconnectedCallback(){Yd({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(g,b,m){Qd({instance:this,attributeName:g,oldValue:b,newValue:m,scheduleFrameFn:ts})}render=()=>{Xd({instance:this,createComponentUpdateHookFn:tc})}}class u extends f{static get observedAttributes(){return Ud({propsSchemaKeys:r,toKebabCase:Oi})}constructor(){super(),this.constants=bd({setupConstants:h?.constants,fileConstants:l}),this.propsSchema=t,this.props=t?Sp(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=gd(o,this.props,this.constants),this.template=i,this.handlers=a,this.methods=p,this.refs=s,this.patch=c,this.deps={...h,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},nd(this,this.methods),this._snabbdomH=d,this.cssText=vd(e,n)}}return u};function Je(e,t,r,i,s){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:i,elm:s,key:n}}var ot=Array.isArray;function et(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function ic(e,t){return document.createElement(e,t)}function sc(e,t,r){return document.createElementNS(e,t,r)}function nc(){return we(document.createDocumentFragment())}function ac(e){return document.createTextNode(e)}function oc(e){return document.createComment(e)}function lc(e,t,r){if(he(e)){let i=e;for(;i&&he(i);)i=we(i).parent;e=i??e}he(t)&&(t=we(t,e)),r&&he(r)&&(r=we(r).firstChildNode),e.insertBefore(t,r)}function pc(e,t){e.removeChild(t)}function dc(e,t){he(t)&&(t=we(t,e)),e.appendChild(t)}function rs(e){if(he(e)){for(;e&&he(e);)e=we(e).parent;return e??null}return e.parentNode}function cc(e){var t;if(he(e)){let r=we(e),i=rs(r);if(i&&r.lastChildNode){let s=Array.from(i.childNodes),n=s.indexOf(r.lastChildNode);return(t=s[n+1])!==null&&t!==void 0?t:null}return null}return e.nextSibling}function uc(e){return e.tagName}function hc(e,t){e.textContent=t}function fc(e){return e.textContent}function yc(e){return e.nodeType===1}function mc(e){return e.nodeType===3}function gc(e){return e.nodeType===8}function he(e){return e.nodeType===11}function we(e,t){var r,i,s;let n=e;return(r=n.parent)!==null&&r!==void 0||(n.parent=t??null),(i=n.firstChildNode)!==null&&i!==void 0||(n.firstChildNode=e.firstChild),(s=n.lastChildNode)!==null&&s!==void 0||(n.lastChildNode=e.lastChild),n}var bc={createElement:ic,createElementNS:sc,createTextNode:ac,createDocumentFragment:nc,createComment:oc,insertBefore:lc,removeChild:pc,appendChild:dc,parentNode:rs,nextSibling:cc,tagName:uc,setTextContent:hc,getTextContent:fc,isElement:yc,isText:mc,isComment:gc,isDocumentFragment:he};function Ze(e){return e===void 0}function te(e){return e!==void 0}var Ft=Je("",{},[],void 0,void 0);function ze(e,t){var r,i;let s=e.key===t.key,n=((r=e.data)===null||r===void 0?void 0:r.is)===((i=t.data)===null||i===void 0?void 0:i.is),a=e.sel===t.sel,p=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&s&&n&&p}function vc(){throw new Error("The document fragment is not supported on this platform.")}function wc(e,t){return e.isElement(t)}function _c(e,t){return e.isDocumentFragment(t)}function xc(e,t,r){var i;let s={};for(let n=t;n<=r;++n){let a=(i=e[n])===null||i===void 0?void 0:i.key;a!==void 0&&(s[a]=n)}return s}var Ac=["create","update","remove","destroy","pre","post"];function $c(e,t,r){let i={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},s=bc;for(let u of Ac)for(let y of e){let g=y[u];g!==void 0&&i[u].push(g)}function n(u){let y=u.id?"#"+u.id:"",g=u.getAttribute("class"),b=g?"."+g.split(" ").join("."):"";return Je(s.tagName(u).toLowerCase()+y+b,{},[],void 0,u)}function a(u){return Je(void 0,{},[],void 0,u)}function p(u,y){return function(){if(--y===0){let g=s.parentNode(u);g!==null&&s.removeChild(g,u)}}}function l(u,y){var g,b,m,_;let A,$=u.data;if($!==void 0){let S=(g=$.hook)===null||g===void 0?void 0:g.init;te(S)&&(S(u),$=u.data)}let k=u.children,I=u.sel;if(I==="!")Ze(u.text)&&(u.text=""),u.elm=s.createComment(u.text);else if(I==="")u.elm=s.createTextNode(u.text);else if(I!==void 0){let S=I.indexOf("#"),j=I.indexOf(".",S),W=S>0?S:I.length,P=j>0?j:I.length,U=S!==-1||j!==-1?I.slice(0,Math.min(W,P)):I,Q=u.elm=te($)&&te(A=$.ns)?s.createElementNS(A,U,$):s.createElement(U,$);for(W<P&&Q.setAttribute("id",I.slice(W+1,P)),j>0&&Q.setAttribute("class",I.slice(P+1).replace(/\./g," ")),A=0;A<i.create.length;++A)i.create[A](Ft,u);if(et(u.text)&&(!ot(k)||k.length===0)&&s.appendChild(Q,s.createTextNode(u.text)),ot(k))for(A=0;A<k.length;++A){let be=k[A];be!=null&&s.appendChild(Q,l(be,y))}let fe=u.data.hook;te(fe)&&((b=fe.create)===null||b===void 0||b.call(fe,Ft,u),fe.insert&&y.push(u))}else if(!((m=void 0)===null||m===void 0)&&m.fragments&&u.children){for(u.elm=((_=s.createDocumentFragment)!==null&&_!==void 0?_:vc)(),A=0;A<i.create.length;++A)i.create[A](Ft,u);for(A=0;A<u.children.length;++A){let S=u.children[A];S!=null&&s.appendChild(u.elm,l(S,y))}}else u.elm=s.createTextNode(u.text);return u.elm}function o(u,y,g,b,m,_){for(;b<=m;++b){let A=g[b];A!=null&&s.insertBefore(u,l(A,_),y)}}function c(u){var y,g;let b=u.data;if(b!==void 0){(g=(y=b?.hook)===null||y===void 0?void 0:y.destroy)===null||g===void 0||g.call(y,u);for(let m=0;m<i.destroy.length;++m)i.destroy[m](u);if(u.children!==void 0)for(let m=0;m<u.children.length;++m){let _=u.children[m];_!=null&&typeof _!="string"&&c(_)}}}function d(u,y,g,b){for(var m,_;g<=b;++g){let A,$,k=y[g];if(k!=null)if(te(k.sel)){c(k),A=i.remove.length+1,$=p(k.elm,A);for(let S=0;S<i.remove.length;++S)i.remove[S](k,$);let I=(_=(m=k?.data)===null||m===void 0?void 0:m.hook)===null||_===void 0?void 0:_.remove;te(I)?I(k,$):$()}else k.children?(c(k),d(u,k.children,0,k.children.length-1)):s.removeChild(u,k.elm)}}function h(u,y,g,b){let m=0,_=0,A=y.length-1,$=y[0],k=y[A],I=g.length-1,S=g[0],j=g[I],W,P,U,Q;for(;m<=A&&_<=I;)$==null?$=y[++m]:k==null?k=y[--A]:S==null?S=g[++_]:j==null?j=g[--I]:ze($,S)?(f($,S,b),$=y[++m],S=g[++_]):ze(k,j)?(f(k,j,b),k=y[--A],j=g[--I]):ze($,j)?(f($,j,b),s.insertBefore(u,$.elm,s.nextSibling(k.elm)),$=y[++m],j=g[--I]):ze(k,S)?(f(k,S,b),s.insertBefore(u,k.elm,$.elm),k=y[--A],S=g[++_]):(W===void 0&&(W=xc(y,m,A)),P=W[S.key],Ze(P)?(s.insertBefore(u,l(S,b),$.elm),S=g[++_]):Ze(W[j.key])?(s.insertBefore(u,l(j,b),s.nextSibling(k.elm)),j=g[--I]):(U=y[P],U.sel!==S.sel?s.insertBefore(u,l(S,b),$.elm):(f(U,S,b),y[P]=void 0,s.insertBefore(u,U.elm,$.elm)),S=g[++_]));_<=I&&(Q=g[I+1]==null?null:g[I+1].elm,o(u,Q,g,_,I,b)),m<=A&&d(u,y,m,A)}function f(u,y,g){var b,m,_,A,$,k,I,S;let j=(b=y.data)===null||b===void 0?void 0:b.hook;(m=j?.prepatch)===null||m===void 0||m.call(j,u,y);let W=y.elm=u.elm;if(u===y)return;if(y.data!==void 0||te(y.text)&&y.text!==u.text){(_=y.data)!==null&&_!==void 0||(y.data={}),(A=u.data)!==null&&A!==void 0||(u.data={});for(let Q=0;Q<i.update.length;++Q)i.update[Q](u,y);(I=(k=($=y.data)===null||$===void 0?void 0:$.hook)===null||k===void 0?void 0:k.update)===null||I===void 0||I.call(k,u,y)}let P=u.children,U=y.children;Ze(y.text)?te(P)&&te(U)?P!==U&&h(W,P,U,g):te(U)?(te(u.text)&&s.setTextContent(W,""),o(W,null,U,0,U.length-1,g)):te(P)?d(W,P,0,P.length-1):te(u.text)&&s.setTextContent(W,""):u.text!==y.text&&(te(P)&&d(W,P,0,P.length-1),s.setTextContent(W,y.text)),(S=j?.postpatch)===null||S===void 0||S.call(j,u,y)}return function(u,y){let g,b,m,_=[];for(g=0;g<i.pre.length;++g)i.pre[g]();for(wc(s,u)?u=n(u):_c(s,u)&&(u=a(u)),ze(u,y)?f(u,y,_):(b=u.elm,m=s.parentNode(b),l(y,_),m!==null&&(s.insertBefore(m,y.elm,s.nextSibling(b)),d(m,[u],0,0))),g=0;g<_.length;++g)_[g].data.hook.insert(_[g]);for(g=0;g<i.post.length;++g)i.post[g]();return y}}function oi(e,t){let r,i,s=t.elm,n=e.data.class,a=t.data.class;if(!(!n&&!a)&&n!==a){n=n||{},a=a||{};for(i in n)n[i]&&!Object.prototype.hasOwnProperty.call(a,i)&&s.classList.remove(i);for(i in a)r=a[i],r!==n[i]&&s.classList[r?"add":"remove"](i)}}var kc={create:oi,update:oi};function li(e,t){let r,i,s,n=t.elm,a=e.data.props,p=t.data.props;if(!(!a&&!p)&&a!==p){a=a||{},p=p||{};for(r in p)i=p[r],s=a[r],s!==i&&(r!=="value"||n[r]!==i)&&(n[r]=i)}}var Ec={create:li,update:li},Sc="http://www.w3.org/1999/xlink",Cc="http://www.w3.org/2000/xmlns/",Ic="http://www.w3.org/XML/1998/namespace",pi=58,Oc=120,Tc=109;function di(e,t){let r,i=t.elm,s=e.data.attrs,n=t.data.attrs;if(!(!s&&!n)&&s!==n){s=s||{},n=n||{};for(r in n){let a=n[r];s[r]!==a&&(a===!0?i.setAttribute(r,""):a===!1?i.removeAttribute(r):r.charCodeAt(0)!==Oc?i.setAttribute(r,a):r.charCodeAt(3)===pi?i.setAttributeNS(Ic,r,a):r.charCodeAt(5)===pi?r.charCodeAt(1)===Tc?i.setAttributeNS(Cc,r,a):i.setAttributeNS(Sc,r,a):i.setAttribute(r,a))}for(r in s)r in n||i.removeAttribute(r)}}var Lc={create:di,update:di},ci=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Rc=function(e){ci(function(){ci(e)})},er=!1;function Nc(e,t,r){Rc(function(){e[t]=r})}function ui(e,t){let r,i,s=t.elm,n=e.data.style,a=t.data.style;if(!n&&!a||n===a)return;n=n||{},a=a||{};let p="delayed"in n;for(i in n)i in a||(i[0]==="-"&&i[1]==="-"?s.style.removeProperty(i):s.style[i]="");for(i in a)if(r=a[i],i==="delayed"&&a.delayed)for(let l in a.delayed)r=a.delayed[l],(!p||r!==n.delayed[l])&&Nc(s.style,l,r);else i!=="remove"&&r!==n[i]&&(i[0]==="-"&&i[1]==="-"?s.style.setProperty(i,r):s.style[i]=r)}function jc(e){let t,r,i=e.elm,s=e.data.style;if(!(!s||!(t=s.destroy)))for(r in t)i.style[r]=t[r]}function Vc(e,t){let r=e.data.style;if(!r||!r.remove){t();return}er||(e.elm.offsetLeft,er=!0);let i,s=e.elm,n=0,a=r.remove,p=0,l=[];for(i in a)l.push(i),s.style[i]=a[i];let o=getComputedStyle(s)["transition-property"].split(", ");for(;n<o.length;++n)l.indexOf(o[n])!==-1&&p++;s.addEventListener("transitionend",function(c){c.target===s&&--p,p===0&&t()})}function Dc(){er=!1}var Pc={pre:Dc,create:ui,update:ui,destroy:jc,remove:Vc};function is(e,t,r){if(typeof e=="function")e.call(t,r,t);else if(typeof e=="object")for(let i=0;i<e.length;i++)is(e[i],t,r)}function Bc(e,t){let r=e.type,i=t.data.on;i&&i[r]&&is(i[r],t,e)}function Wc(){return function e(t){Bc(t,e.vnode)}}function zt(e,t){let r=e.data.on,i=e.listener,s=e.elm,n=t&&t.data.on,a=t&&t.elm,p;if(r!==n){if(r&&i)if(n)for(p in r)n[p]||s.removeEventListener(p,i,!1);else for(p in r)s.removeEventListener(p,i,!1);if(n){let l=t.listener=e.listener||Wc();if(l.vnode=t,r)for(p in n)r[p]||a.addEventListener(p,l,!1);else for(p in n)a.addEventListener(p,l,!1)}}}var Fc={create:zt,update:zt,destroy:zt},zc=()=>$c([kc,Ec,Lc,Pc,Fc]);function ss(e,t,r){if(e.ns="http://www.w3.org/2000/svg",r!=="foreignObject"&&t!==void 0)for(let i=0;i<t.length;++i){let s=t[i];if(typeof s=="string")continue;let n=s.data;n!==void 0&&ss(n,s.children,s.sel)}}function Mc(e,t,r){let i={},s,n,a;if(r!==void 0?(t!==null&&(i=t),ot(r)?s=r:et(r)?n=r.toString():r&&r.sel&&(s=[r])):t!=null&&(ot(t)?s=t:et(t)?n=t.toString():t&&t.sel?s=[t]:i=t),s!==void 0)for(a=0;a<s.length;++a)et(s[a])&&(s[a]=Je(void 0,void 0,void 0,s[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&ss(i,s,e),Je(e,i,s,n,void 0)}var Kc=zc(),Uc=({handlers:e,methods:t,constants:r,schema:i,view:s,store:n},a)=>{if(!s)throw new Error("view is not defined");if(!i||typeof i!="object"||Array.isArray(i))throw new Error("schema is required. Define component metadata in .schema.yaml.");let p=i,{template:l,refs:o,styles:c}=s;Cp({schema:p,methodExports:Object.keys(t||{})});let d=p.componentName,h=p.propsSchema,f=h?.properties?[...new Set(Object.keys(h.properties).map(u=>Ti(u)))]:[];return rc({elementName:d,propsSchema:h,propsSchemaKeys:f,template:l,refs:o,styles:c,handlers:e,methods:t,constants:r,store:n,patch:Kc,h:Mc,deps:a})},Hc=e=>{let t={};return{once:(r,i)=>{t[r]||(t[r]=[]);let s=(...n)=>{i(...n),t[r]=t[r].filter(a=>a!==s)};t[r].push(s)},emit:(r,...i)=>{t[r]&&t[r].forEach(s=>{s(...i)})},showAlert:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showConfirm:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showFormDialog:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},showDropdownMenu:async r=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")},closeAll:async()=>{throw new Error("globalUIElement is not set. Make sure to initialize the global UI component and pass it to createGlobalUIManager.")}}},qc=Hc(),Jc={globalUI:qc},Gc={components:Jc},Yc={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Qc={refs:{header:{eventListeners:{click:{handler:"handleClickHeader"}}}},styles:{".content-wrapper":{display:"grid","grid-template-rows":"0fr",transition:"grid-template-rows 0.2s ease-out"},".content-wrapper.open":{"grid-template-rows":"1fr"},".content-inner":{overflow:"hidden"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=v ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c w=f pv=md cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-svg svg=${chevronIcon} wh=16 c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg svg=",{type:1,path:"chevronIcon"}," wh=16 c=mu-fg"]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'div class="${openClass}"',value:{type:9,items:[{type:8,properties:[{key:"div class=content-inner",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view pb=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"content"}}],fast:!0},{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['div class="',{type:1,path:"openClass"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=v ",{type:1,path:"containerAttrString"}]}}],fast:!0}],fast:!0}},Xc={componentName:"rtgl-breadcrumb",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},href:{type:"string"},path:{type:"string"},current:{type:"boolean"},disabled:{type:"boolean"},click:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"}}}},sep:{type:"string",default:"breadcrumb-arrow"},max:{type:"number"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"},path:{type:"string"},href:{type:"string"},item:{type:"object"},index:{type:"number"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},Zc={refs:{"item*":{eventListeners:{click:{handler:"handleClickItem"}}}},styles:{a:{"text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md p=sm ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isSeparator",value:{type:6,conditions:[{type:1,path:"item.isSeparator"},{type:1,path:"item.isEllipsis"},{type:4,op:6,left:{type:1,path:"item.isInteractive"},right:{type:1,path:"item.href"}},{type:1,path:"item.isInteractive"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${sep} c=mu-fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"sep"}," c=mu-fg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#item${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#item",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-index=${item.index} cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-index=",{type:1,path:"item.index"}," cur=pointer"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md p=sm ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},eu={componentName:"rtgl-dropdown-menu",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]},id:{type:"string"},path:{type:"string"},href:{type:"string"},disabled:{type:"boolean"},newTab:{type:"boolean"},rel:{type:"string"},testId:{type:"string"}}}},open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},w:{type:"string"},h:{type:"string"}}},events:{close:{type:"object"},"item-click":{type:"object",properties:{index:{type:"number"},item:{type:"object"},id:{type:"string"},path:{type:"string"},href:{type:"string"},trigger:{type:"string"}}}},methods:{type:"object",properties:{}}},tu={refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},styles:{a:{display:"block",width:"100%","text-decoration":"none",color:"inherit"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${w} h=${h} sv g=xs slot=content bgc=mu br=md",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"$if item.isLabel",value:{type:6,conditions:[{type:1,path:"item.isLabel"},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.isDisabled"}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:4,op:6,left:{type:1,path:"item.hasHref"},right:{type:1,path:"item.linkExtraAttrs"}}},{type:4,op:6,left:{type:1,path:"item.isItem"},right:{type:1,path:"item.hasHref"}},{type:1,path:"item.isItem"},{type:1,path:"item.isSeparator"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f ph=lg pv=md br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f ph=lg pv=md br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} ${item.linkExtraAttrs} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," ",{type:1,path:"item.linkExtraAttrs"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"a#option${i} href=${item.href} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a#option",{type:1,path:"i"}," href=",{type:1,path:"item.href"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f h-bgc=${item.hoverBgc} ph=lg pv=md cur=pointer br=md bgc=${item.bgc} data-index=${item.index} data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${item.c}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"item.c"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f h-bgc=",{type:1,path:"item.hoverBgc"}," ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"item.bgc"}," data-index=",{type:1,path:"item.index"}," data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1 ph=lg mv=md bgc=bo",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," sv g=xs slot=content bgc=mu br=md"]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}]}}],fast:!1}],fast:!1}},ru={componentName:"rtgl-form",propsSchema:{type:"object",properties:{form:{type:"object"},defaultValues:{type:"object"},context:{type:"object"},disabled:{type:"boolean"}}},events:{"form-input":{},"form-change":{},"form-field-event":{},"form-action":{}},methods:{type:"object",properties:{getValues:{type:"function"},setValues:{type:"function"},validate:{type:"function"},reset:{type:"function"}}}},iu={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#formContainer w=f p=md g=lg ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"$if title",value:{type:6,conditions:[{type:1,path:"title"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if description",value:{type:6,conditions:[{type:1,path:"description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=lg w=f",value:{type:9,items:[{type:7,itemVar:"field",indexVar:"i",iterable:{type:1,path:"flatFields"},body:{type:9,items:[{type:8,properties:[{key:"$if field._isSection",value:{type:6,conditions:[{type:1,path:"field._isSection"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=md",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !field._isSection",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"field._isSection"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=f",value:{type:9,items:[{type:8,properties:[{key:"$if field.label || field.description",value:{type:6,conditions:[{type:4,op:7,left:{type:1,path:"field.label"},right:{type:1,path:"field.description"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md av=c",value:{type:9,items:[{type:8,properties:[{key:"$if field.label",value:{type:6,conditions:[{type:1,path:"field.label"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.required",value:{type:6,conditions:[{type:1,path:"field.required"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text c=fg s=sm",value:{type:0,value:"*"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field.tooltip",value:{type:6,conditions:[{type:1,path:"field.tooltip"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${field._idx} data-field-name=${field.name} svg="info" wh=16 c=mu-fg cur=help ml=xs',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg#tooltipIcon",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' svg="info" wh=16 c=mu-fg cur=help ml=xs']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if field.description",value:{type:6,conditions:[{type:1,path:"field.description"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${field._idx} data-field-name=${field.name} w=f type=${field._inputType} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f type=",{type:1,path:"field._inputType"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-date"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-date"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-date#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-date#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-time"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-time"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-time#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-time#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-datetime"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-datetime"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-datetime#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-datetime#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${field._idx} data-field-name=${field.name} w=f rows=${field.rows} placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${field._idx} data-field-name=${field.name} w=f :options=flatFields[${field._arrIdx}].options ?no-clear=${field.noClear} :selectedValue=flatFields[${field._arrIdx}]._selectedValue :placeholder=${field.placeholder} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f :options=flatFields[",{type:1,path:"field._arrIdx"},"].options ?no-clear=",{type:1,path:"field.noClear"}," :selectedValue=flatFields[",{type:1,path:"field._arrIdx"},"]._selectedValue :placeholder=",{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${field._idx} data-field-name=${field.name} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slider-with-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slider-with-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${field._idx} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} ?disabled=${field._disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${field._idx} data-field-name=${field.name} label="${field.label}" placeholder=${field.placeholder} ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" placeholder=',{type:1,path:"field.placeholder"}," ?disabled=",{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "checkbox"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"checkbox"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-checkbox#field${field._idx} data-field-name=${field.name} label="${field._checkboxText}" ?disabled=${field._disabled}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-checkbox#field",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field._checkboxText"},'" ?disabled=',{type:1,path:"field._disabled"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:1,path:"field._imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${field._idx} data-field-name=${field.name} src=${field._imageSrc} w=${field.width} h=${field.height} cur=pointer",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," src=",{type:1,path:"field._imageSrc"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "image" && !field._imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"image"}},right:{type:5,op:0,operand:{type:1,path:"field._imageSrc"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#image${field._idx} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholderText"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#image",{type:1,path:"field._idx"}," data-field-name=",{type:1,path:"field.name"}," w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," bc=ac bw=sm ah=c av=c cur=pointer p=md"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.content"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.type == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.type"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${field._idx} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"field._idx"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if field._error",value:{type:6,conditions:[{type:1,path:"field._error"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=de",value:{type:1,path:"field._error"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"$if actions.buttons.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"actions.buttons.length"},right:{type:0,value:0}}],bodies:[{type:9,items:[{type:8,properties:[{key:'$if actions._layout == "split"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"split"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h w=f g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._leftButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view d=h g=sm ah=e w=1fg",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._rightButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "vertical"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"vertical"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'$if actions._layout == "stretch"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"actions._layout"},right:{type:0,value:"stretch"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions._allButtons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${button._globalIdx} data-action-id=${button.id} v=${button.variant} w=f ?disabled=${button._disabled} pre=${button.pre} suf=${button.suf}",value:{type:1,path:"button.label"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"button._globalIdx"}," data-action-id=",{type:1,path:"button.id"}," v=",{type:1,path:"button.variant"}," w=f ?disabled=",{type:1,path:"button._disabled"}," pre=",{type:1,path:"button.pre"}," suf=",{type:1,path:"button.suf"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:'rtgl-tooltip ?open=${tooltipState.open} x=${tooltipState.x} y=${tooltipState.y} place="t" content="${tooltipState.content}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-tooltip ?open=",{type:1,path:"tooltipState.open"}," x=",{type:1,path:"tooltipState.x"}," y=",{type:1,path:"tooltipState.y"},' place="t" content="',{type:1,path:"tooltipState.content"},'"']}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#formContainer w=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},su={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}},nu={refs:{dialog:{eventListeners:{close:{handler:"handleDialogClose"}}},confirmButton:{eventListeners:{click:{handler:"handleConfirm"}}},cancelButton:{eventListeners:{click:{handler:"handleCancel"}}},formDialog:{eventListeners:{"form-action":{handler:"handleFormAction"},"form-field-event":{handler:"handleFormFieldEvent"}}},dropdownMenu:{eventListeners:{close:{handler:"handleDropdownClose"},"item-click":{handler:"handleDropdownItemClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-dialog#dialog ?open=${isDialogContainerOpen} s=${dialogSize}",value:{type:9,items:[{type:8,properties:[{key:"$if isFormDialogOpen",value:{type:6,conditions:[{type:1,path:"isFormDialogOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=${formDialogConfig.disabled} key=form-dialog-${formDialogConfig.key}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-form#formDialog slot=content :form=formDialogConfig.form :defaultValues=formDialogConfig.defaultValues :context=formDialogConfig.context ?disabled=",{type:1,path:"formDialogConfig.disabled"}," key=form-dialog-",{type:1,path:"formDialogConfig.key"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"$if !isFormDialogOpen",value:{type:6,conditions:[{type:5,op:0,operand:{type:1,path:"isFormDialogOpen"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content g=lg p=lg",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=c av=c g=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=24 av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"config.title"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"config.message"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h g=md mt=lg w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"$if config.mode == 'confirm'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"config.mode"},right:{type:0,value:"confirm"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-button#cancelButton v=se",value:{type:1,path:"config.cancelText"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-button#confirmButton v=pr",value:{type:1,path:"config.confirmText"}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-dialog#dialog ?open=",{type:1,path:"isDialogContainerOpen"}," s=",{type:1,path:"dialogSize"}]}}],fast:!1},{type:8,properties:[{key:"rtgl-dropdown-menu#dropdownMenu ?open=${isDropdownOpen} x=${dropdownConfig.x} y=${dropdownConfig.y} place=${dropdownConfig.place} :items=dropdownConfig.items key=dropdown-${isDropdownOpen}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-dropdown-menu#dropdownMenu ?open=",{type:1,path:"isDropdownOpen"}," x=",{type:1,path:"dropdownConfig.x"}," y=",{type:1,path:"dropdownConfig.y"}," place=",{type:1,path:"dropdownConfig.place"}," :items=dropdownConfig.items key=dropdown-",{type:1,path:"isDropdownOpen"}]}}],fast:!0}],fast:!1}},au={componentName:"rtgl-navbar",propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},events:{"start-click":{type:"object",properties:{path:{type:"string"}}}},methods:{type:"object",properties:{}}},ou={refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},anchors:[[{"rtgl-text s=lg":"${start.label}"},{"$if start.image && start.image.src":[{"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}":null}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view bgc=bg d=h h=48 av=c w=f ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if start.href",value:{type:6,conditions:[{type:1,path:"start.href"},{type:1,path:"start.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${start.href}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["a href=",{type:1,path:"start.href"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#start d=h av=c g=md cur=pointer",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"start.label"}}],fast:!0},{type:8,properties:[{key:"$if start.image && start.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"start.image"},right:{type:1,path:"start.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image w=${start.image.width} h=${start.image.height} src=${start.image.src} alt=${start.image.alt}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"start.image.width"}," h=",{type:1,path:"start.image.height"}," src=",{type:1,path:"start.image.src"}," alt=",{type:1,path:"start.image.alt"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=1fg",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view d=h av=c g=lg",value:{type:9,items:[{type:8,properties:[{key:"slot name=right",value:{type:0,value:null}}],fast:!0}],fast:!0}}],fast:!0}],fast:!1},parsedKey:{type:2,parts:["rtgl-view bgc=bg d=h h=48 av=c w=f ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},lu={componentName:"rtgl-page-outline",propsSchema:{type:"object",properties:{targetId:{type:"string"},scrollContainerId:{type:"string"},offsetTop:{type:"string"}}},events:{onItemClick:{type:"object"}},methods:{type:"object",properties:{}}},pu={refs:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272 d=v pr=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=1fg sv mt=xl",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'rtgl-view d=h bwl=xs bc="${item.bc}" pv=sm av=c href=${item.href} pl=md',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=${item.ml}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-view w=",{type:1,path:"item.ml"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=${item.c} h-c=fg",value:{type:1,path:"item.title"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.c"}," h-c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view d=h bwl=xs bc="',{type:1,path:"item.bc"},'" pv=sm av=c href=',{type:1,path:"item.href"}," pl=md"]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}},du={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"},disabled:{type:"boolean",default:!1}}},events:{"value-change":{}},methods:{type:"object",properties:{}}},cu={refs:{textDisplay:{eventListeners:{click:{handler:"handleTextClick"}}},popover:{eventListeners:{close:{handler:"handlePopoverClose"}}},input:{eventListeners:{"value-input":{handler:"handleInputChange"},keydown:{handler:"handleInputKeydown"}}},submit:{eventListeners:{click:{handler:"handleSubmitClick"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view#textDisplay w=f cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=${valueColor}",value:{type:1,path:"value"},parsedKey:{type:2,parts:["rtgl-text c=",{type:1,path:"valueColor"}]}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view g=md w=240 slot=content bgc=mu br=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"label"}}],fast:!0},{type:8,properties:[{key:"rtgl-input#input w=f placeholder=${placeholder} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit ?disabled=${disabled}",value:{type:0,value:"Submit"},parsedKey:{type:2,parts:["rtgl-button#submit ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!0}],fast:!0}},uu={componentName:"rtgl-select",propsSchema:{type:"object",properties:{placeholder:{type:"string"},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"},testId:{type:"string"}}}},selectedValue:{type:"any"},onChange:{type:"function"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},disabled:{type:"boolean"},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}},hu={refs:{selectButton:{eventListeners:{click:{handler:"handleButtonClick"}}},clearButton:{eventListeners:{click:{handler:"handleClearClick"}}},popover:{eventListeners:{close:{handler:"handleClickOptionsPopoverOverlay"}}},"option*":{eventListeners:{click:{handler:"handleOptionClick"},mouseenter:{handler:"handleOptionMouseEnter"},mouseleave:{handler:"handleOptionMouseLeave"}}},optionAdd:{eventListeners:{click:{handler:"handleAddOptionClick"},mouseenter:{handler:"handleAddOptionMouseEnter"},mouseleave:{handler:"handleAddOptionMouseLeave"}}}},template:{type:9,items:[{type:8,properties:[{key:'rtgl-button#selectButton v=ol ${containerAttrString} ?disabled=${isDisabled} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c ah=s w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg ta=s c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg ta=s c=",{type:1,path:"selectedLabelColor"}," ellipsis"]}}],fast:!0},{type:8,properties:[{key:"$if showClear",value:{type:6,conditions:[{type:1,path:"showClear"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#clearButton ml=md svg=x wh=16 c=mu-fg cur=pointer data-testid="select-clear-button"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-svg ml=md svg=chevronDown wh=16 c=mu-fg",value:{type:0,value:null}}],fast:!0}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-button#selectButton v=ol ",{type:1,path:"containerAttrString"}," ?disabled=",{type:1,path:"isDisabled"},' data-testid="select-button"']}}],fast:!1},{type:8,properties:[{key:"rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y} place=rs",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=mu br=md sv=true",value:{type:9,items:[{type:7,itemVar:"option",indexVar:"i",iterable:{type:1,path:"options"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#option${i} w=f ph=lg pv=md cur=pointer br=md bgc=${option.bgc} data-testid=${option.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=s",value:{type:1,path:"option.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option",{type:1,path:"i"}," w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"option.bgc"}," data-testid=",{type:1,path:"option.testId"}]}}],fast:!0}],fast:!0}},{type:8,properties:[{key:"$if showAddOption",value:{type:6,conditions:[{type:1,path:"showAddOption"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f bw=xs bc=mu bwt=sm",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=${addOptionBgc} data-testid="select-add-option"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=ac",value:{type:1,path:"addOptionLabel"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#optionAdd w=f ph=lg pv=md cur=pointer br=md bgc=",{type:1,path:"addOptionBgc"},' data-testid="select-add-option"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}," place=rs"]}}],fast:!1}],fast:!1}},fu={componentName:"rtgl-sidebar",propsSchema:{type:"object",properties:{mode:{type:"string"},hideHeader:{type:"boolean",default:!1},w:{type:"string"},bwr:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{type:"string"},testId:{type:"string"},image:{type:"object",properties:{src:{type:"string"},width:{type:"number"},height:{type:"number"},alt:{type:"string"}}}}},items:{type:"array",items:{type:"object",properties:{title:{type:"string"},slug:{type:"string"},type:{type:"string"},items:{type:"array"},testId:{type:"string"}}}}}},events:{"header-click":{type:"object",properties:{path:{type:"string"}}},"item-click":{type:"object",properties:{item:{type:"object"}}}},methods:{type:"object",properties:{}}},yu={refs:{headerImage:{eventListeners:{click:{handler:"handleHeaderClick"}}},headerLabel:{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item*":{eventListeners:{click:{handler:"handleItemClick"}}}},anchors:[[{"$if header.image && header.image.src":[{"$if header.image.href":[{"a href=${header.image.href}":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],"$elif header.image.path":[{"rtgl-view#headerImage cur=pointer":[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}],$else:[{'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"':null}]}]},{"$if header.label && showLabels":[{"$if header.labelHref":[{"rtgl-text href=${header.labelHref} s=lg":"${header.label}"}],"$elif header.labelPath":[{"rtgl-view#headerLabel cur=pointer":[{"rtgl-text s=lg":"${header.label}"}]}],$else:[{"rtgl-text s=lg":"${header.label}"}]}]}]],template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=${sidebarWidth} d=v bwr=${rightBorderWidth} ah=${ah} ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if showHeader",value:{type:6,conditions:[{type:1,path:"showHeader"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view ph=${headerPadding} pv=lg",value:{type:9,items:[{type:8,properties:[{key:"$if header.href",value:{type:6,conditions:[{type:1,path:"header.href"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view href=${header.href} d=h av=c ah=${headerAlign} g=lg w=${headerWidth}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view href=",{type:1,path:"header.href"}," d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}]}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#header d=h av=c ah=${headerAlign} g=lg w=${headerWidth} cur=pointer data-testid=${header.testId}",value:{type:9,items:[{type:9,items:[{type:8,properties:[{key:"$if header.image && header.image.src",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.image"},right:{type:1,path:"header.image.src"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.image.href",value:{type:6,conditions:[{type:1,path:"header.image.href"},{type:1,path:"header.image.path"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"a href=${header.image.href}",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["a href=",{type:1,path:"header.image.href"}]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerImage cur=pointer",value:{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'rtgl-image w=${header.image.width} h=${header.image.height} src=${header.image.src} alt="${header.image.alt}"',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image w=",{type:1,path:"header.image.width"}," h=",{type:1,path:"header.image.height"}," src=",{type:1,path:"header.image.src"},' alt="',{type:1,path:"header.image.alt"},'"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"$if header.label && showLabels",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"header.label"},right:{type:1,path:"showLabels"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"$if header.labelHref",value:{type:6,conditions:[{type:1,path:"header.labelHref"},{type:1,path:"header.labelPath"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text href=${header.labelHref} s=lg",value:{type:1,path:"header.label"},parsedKey:{type:2,parts:["rtgl-text href=",{type:1,path:"header.labelHref"}," s=lg"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view#headerLabel cur=pointer",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-text s=lg",value:{type:1,path:"header.label"}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#header d=h av=c ah=",{type:1,path:"headerAlign"}," g=lg w=",{type:1,path:"headerWidth"}," cur=pointer data-testid=",{type:1,path:"header.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view ph=",{type:1,path:"headerPadding"}," pv=lg"]}}],fast:!1}],fast:!1}],id:null}}],fast:!1},{type:8,properties:[{key:"rtgl-view w=f h=1fg sv ph=${headerPadding} pb=lg g=xs ah=${ah}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:'$if item.type == "groupLabel"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"groupLabel"}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showGroupLabels",value:{type:6,conditions:[{type:1,path:"showGroupLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=32 av=c ph=md",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=xs c=mu-fg",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view mt=md h=1 bgc=mu",value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view#item${i} data-item-id=${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=pointer data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"$if item.icon",value:{type:6,conditions:[{type:1,path:"item.icon"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=${itemContentAlign} g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=16 svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=16 svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h ah=",{type:1,path:"itemContentAlign"}," g=sm"]}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-svg wh=${iconSize} svg=${item.icon} c=fg",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-svg wh=",{type:1,path:"iconSize"}," svg=",{type:1,path:"item.icon"}," c=fg"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"$if showLabels",value:{type:6,conditions:[{type:1,path:"showLabels"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"item.title"}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=${iconSize} br=f bgc=mu av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=${firstLetterSize} c=fg",value:{type:1,path:"item.title.charAt(0).toUpperCase()"},parsedKey:{type:2,parts:["rtgl-text s=",{type:1,path:"firstLetterSize"}," c=fg"]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view wh=",{type:1,path:"iconSize"}," br=f bgc=mu av=c ah=c"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view#item",{type:1,path:"i"}," data-item-id=",{type:1,path:"item.id"}," ",{type:1,path:"item.hrefAttr"}," h=",{type:1,path:"itemHeight"}," av=c ",{type:1,path:"itemAlignAttr"}," ph=",{type:1,path:"itemPadding"}," w=",{type:1,path:"itemWidth"}," h-bgc=",{type:1,path:"item.itemHoverBgc"}," br=lg bgc=",{type:1,path:"item.itemBgc"}," cur=pointer data-testid=",{type:1,path:"item.testId"}]}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=1fg sv ph=",{type:1,path:"headerPadding"}," pb=lg g=xs ah=",{type:1,path:"ah"}]}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view h=f w=",{type:1,path:"sidebarWidth"}," d=v bwr=",{type:1,path:"rightBorderWidth"}," ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},mu={componentName:"rtgl-slider-input",propsSchema:{type:"object",properties:{key:{type:"string"},value:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"},disabled:{type:"boolean",default:!1}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}},gu={refs:{input:{eventListeners:{"value-input":{handler:"handleValueInput"},"value-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"value-change":{handler:"handleValueChange"},"value-input":{handler:"handleValueInput"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c g=md w=${w}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-slider#slider key=${key} w=f type=range min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider key=",{type:1,path:"key"}," w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#input key=${key} w=f min=${min} max=${max} step=${step} value=${value} ?disabled=${disabled}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#input key=",{type:1,path:"key"}," w=f min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}," ?disabled=",{type:1,path:"disabled"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}},bu={componentName:"rtgl-table",propsSchema:{type:"object",properties:{data:{type:"object",properties:{columns:{type:"array",items:{type:"object",properties:{key:{type:"string"},label:{type:"string"}}}},rows:{type:"array",items:{type:"object"}}}},responsive:{type:"boolean",default:!0}}},events:{},methods:{type:"object",properties:{}}},vu={refs:{"row*":{eventListeners:{click:{handler:"handleRowClick"}}},"header*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},styles:{table:{width:"100%","border-collapse":"collapse","border-spacing":0},thead:{"border-bottom":"2px solid var(--border)"},th:{padding:"12px","text-align":"left","font-weight":500,color:"var(--foreground)","background-color":"var(--muted)",cursor:"pointer",position:"sticky",top:0,"z-index":1},"tbody tr":{"border-bottom":"1px solid var(--border)"},"tbody tr:last-child":{"border-bottom":"none"},td:{padding:"12px",color:"var(--foreground)"},".table-container":{width:"100%",height:"100%",overflow:"auto"},".empty-state":{"text-align":"center",padding:"24px",color:"var(--muted-foreground)"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view.table-container ${containerAttrString}",value:{type:9,items:[{type:8,properties:[{key:"$if rows.length > 0",value:{type:6,conditions:[{type:4,op:2,left:{type:1,path:"rows.length"},right:{type:0,value:0}},null],bodies:[{type:9,items:[{type:8,properties:[{key:"table",value:{type:9,items:[{type:8,properties:[{key:"thead",value:{type:9,items:[{type:8,properties:[{key:"tr",value:{type:9,items:[{type:7,itemVar:"column",indexVar:"i",iterable:{type:1,path:"columns"},body:{type:9,items:[{type:8,properties:[{key:"th#header${i} data-column-key=${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header",{type:1,path:"i"}," data-column-key=",{type:1,path:"column.key"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1},{type:8,properties:[{key:"tbody",value:{type:9,items:[{type:7,itemVar:"row",indexVar:"rowIndex",iterable:{type:1,path:"rows"},body:{type:9,items:[{type:8,properties:[{key:"tr#row${rowIndex}",value:{type:9,items:[{type:7,itemVar:"cell",indexVar:"cellIndex",iterable:{type:1,path:"row.cells"},body:{type:9,items:[{type:8,properties:[{key:"td",value:{type:1,path:"cell.value"}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["tr#row",{type:1,path:"rowIndex"}]}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},{type:9,items:[{type:8,properties:[{key:"rtgl-view.empty-state w=f p=xl",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"No data available"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view.table-container ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},wu={componentName:"rtgl-tabs",propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},id:{type:"string"},testId:{type:"string"}}}},selectedTab:{type:"string"}}},events:{"item-click":{type:"object",properties:{id:{type:"string"}}}},methods:{type:"object",properties:{}}},_u={refs:{"tab*":{eventListeners:{click:{handler:"handleClickItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h g=sm bgc=mu p=sm br=lg ${containerAttrString}",value:{type:9,items:[{type:7,itemVar:"item",indexVar:"i",iterable:{type:1,path:"items"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-view#tab${i} data-id=${item.id} cur=pointer bgc=${item.bgColor} bw=xs bc=${item.borderColor} pv=md ph=lg br=lg data-testid=${item.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm c=${item.textColor}",value:{type:1,path:"item.label"},parsedKey:{type:2,parts:["rtgl-text s=sm c=",{type:1,path:"item.textColor"}]}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#tab",{type:1,path:"i"}," data-id=",{type:1,path:"item.id"}," cur=pointer bgc=",{type:1,path:"item.bgColor"}," bw=xs bc=",{type:1,path:"item.borderColor"}," pv=md ph=lg br=lg data-testid=",{type:1,path:"item.testId"}]}}],fast:!0}],fast:!0}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view d=h g=sm bgc=mu p=sm br=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}},xu={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"boolean"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}},Au={template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} place=${place} no-overlay",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view slot=content bgc=bg bc=bo br=md p=sm ah=c av=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text ta=c s=sm c=fg",value:{type:1,path:"content"}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," place=",{type:1,path:"place"}," no-overlay"]}}],fast:!0}],fast:!0},refs:{}},$u={componentName:"rtgl-waveform",propsSchema:{type:"object",properties:{w:{type:"string",description:"Width of the waveform visualizer",default:"250"},h:{type:"string",description:"Height of the waveform visualizer",default:"150"},cur:{type:"string",description:"cursor"},waveformData:{type:"object",description:"File ID of the waveform data in object storage"},isLoading:{type:"boolean",description:"Whether the waveform data is currently being loaded"}}},events:[],methods:{type:"object",properties:{}}},ku={refs:{canvas:{selector:"canvas"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view pos=rel w=${w} h=${h} cur=${cur}",value:{type:9,items:[{type:8,properties:[{key:"$if isLoading",value:{type:6,conditions:[{type:1,path:"isLoading"},null],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=f av=c ah=c",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:0,value:"..."}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},{type:9,items:[{type:8,properties:[{key:'canvas#canvas style="width:100%; height:100%;"',value:{type:0,value:null}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view pos=rel w=",{type:1,path:"w"}," h=",{type:1,path:"h"}," cur=",{type:1,path:"cur"}]}}],fast:!1}],fast:!1}},x={};x.components={};x.components.accordionItem={};x.components.accordionItem.handlers=Vs;x.components.accordionItem.schema=Yc;x.components.accordionItem.store=zs;x.components.accordionItem.view=Qc;x.components.breadcrumb={};x.components.breadcrumb.handlers=Ks;x.components.breadcrumb.schema=Xc;x.components.breadcrumb.store=Zs;x.components.breadcrumb.view=Zc;x.components.dropdownMenu={};x.components.dropdownMenu.handlers=rn;x.components.dropdownMenu.schema=eu;x.components.dropdownMenu.store=ln;x.components.dropdownMenu.view=tu;x.components.form={};x.components.form.handlers=Ia;x.components.form.methods=Ba;x.components.form.schema=ru;x.components.form.store=ga;x.components.form.view=iu;x.components.globalUi={};x.components.globalUi.handlers=eo;x.components.globalUi.schema=su;x.components.globalUi.store=yo;x.components.globalUi.view=nu;x.components.navbar={};x.components.navbar.handlers=go;x.components.navbar.schema=au;x.components.navbar.store=ko;x.components.navbar.view=ou;x.components.pageOutline={};x.components.pageOutline.handlers=Co;x.components.pageOutline.schema=lu;x.components.pageOutline.store=Vo;x.components.pageOutline.view=pu;x.components.popoverInput={};x.components.popoverInput.handlers=Ko;x.components.popoverInput.schema=du;x.components.popoverInput.store=Xo;x.components.popoverInput.view=cu;x.components.select={};x.components.select.handlers=dl;x.components.select.schema=uu;x.components.select.store=kl;x.components.select.view=hu;x.components.sidebar={};x.components.sidebar.handlers=Cl;x.components.sidebar.schema=fu;x.components.sidebar.store=Bl;x.components.sidebar.view=yu;x.components.sliderInput={};x.components.sliderInput.handlers=Kl;x.components.sliderInput.schema=mu;x.components.sliderInput.store=Jl;x.components.sliderInput.view=gu;x.components.table={};x.components.table.handlers=Xl;x.components.table.schema=bu;x.components.table.store=lp;x.components.table.view=vu;x.components.tabs={};x.components.tabs.handlers=dp;x.components.tabs.schema=wu;x.components.tabs.store=yp;x.components.tabs.view=_u;x.components.tooltip={};x.components.tooltip.handlers=mp;x.components.tooltip.schema=xu;x.components.tooltip.store=vp;x.components.tooltip.view=Au;x.components.waveform={};x.components.waveform.handlers=xp;x.components.waveform.schema=$u;x.components.waveform.store=Ep;x.components.waveform.view=ku;Object.keys(x).forEach(e=>{Object.keys(x[e]).forEach(t=>{let r=x[e][t],i=Uc({...r},Gc[e]),s=r.schema?.componentName;if(!s)throw new Error(`[Build] Missing schema.componentName for ${e}/${t}. Define it in .schema.yaml.`);customElements.define(s,i)})});customElements.define("rtgl-button",mr({}));customElements.define("rtgl-view",wr({}));customElements.define("rtgl-text",xr({}));customElements.define("rtgl-image",kr({}));customElements.define("rtgl-svg",Sr({}));customElements.define("rtgl-input",me({}));customElements.define("rtgl-input-date",Cr({}));customElements.define("rtgl-input-time",Ir({}));customElements.define("rtgl-input-datetime",Or({}));customElements.define("rtgl-input-number",Tr({}));customElements.define("rtgl-textarea",Lr({}));customElements.define("rtgl-color-picker",Rr({}));customElements.define("rtgl-slider",Nr({}));customElements.define("rtgl-checkbox",jr({}));customElements.define("rtgl-dialog",Vr({}));customElements.define("rtgl-popover",Dr({}));})();