@rettangoli/ui 1.0.0-rc7 → 1.0.0-rc9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rettangoli-iife-ui.min.js +57 -57
- package/dist/themes/base.css +9 -4
- package/package.json +1 -1
- package/src/themes/base.css +9 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var In=Object.defineProperty;var R=(e,t)=>{for(var r in t)In(e,r,{get:t[r],enumerable:!0})};var Oe=`
|
|
2
2
|
:host([href]) {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
position: relative;
|
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
16
|
-
${d
|
|
15
|
+
`,Te=({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")},Le=({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 Te({linkElement:a,href:s,newTab:i,rel:n}),a.parentNode!==e&&e.appendChild(a),a},mt=({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 Te({linkElement:a,href:s,newTab:i,rel:n}),t.parentNode!==a&&a.appendChild(t),a.parentNode!==e&&e.appendChild(a),a};var ne=["default","sm","md","lg","xl"],K=()=>ne.reduce((e,t)=>(e[t]={},e),{});var On=/^([1-9]|1[0-2])fg$/,yt=e=>typeof e=="string"&&On.test(e),H=({styleBucket:e,axis:t,dimension:r,fillValue:s,allowFlexGrow:i=!1,lockBounds:n=!0})=>{if(r!==void 0){if(r==="f"){e[t]=s;return}if(i&&yt(r)){e["flex-grow"]=r.slice(0,-2),e["flex-basis"]="0%";return}e[t]=r,n&&(e[`min-${t}`]=r,e[`max-${t}`]=r)}},gt=({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&&yt(t)){e.width="",e.flexGrow=t.slice(0,-2),e.flexBasis="0%",e.minWidth=i;return}if(t!=null){e.width=t,e.flexGrow="",e.flexBasis="",e.minWidth="";return}e.width="",e.flexGrow="",e.flexBasis="",e.minWidth=""};function L(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Tn=["sm","md","lg","xl"],Rr={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",gv:"row-gap",gh:"column-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(Rr),ee=e=>e.concat(Tn.flatMap(t=>e.map(r=>`${t}-${r}`))),Nr={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 s="";for(let[i,n]of Object.entries(Nr)){i!=="default"&&(s+=`${n} {`);for(let[a,l]of Object.entries(e))for(let[p,o]of Object.entries(l)){let c=Rr[a],u=o.startsWith("--")?`var(${o})`:o,d=i==="default"?a:`${i}-${a}`,h=i==="default"?`h-${a}`:`${i}-h-${a}`,f=(m,g=!1)=>{let y=g?`:host([${m}="${p}"]:hover)`:`:host([${m}="${p}"])`;if(r)return r.split(",").map(_=>`${y} ${_.trim()}`).join(", ");let w=t[a];return w?`${y} ${w}`:y};if(c){let g=c.split(" ").map(y=>`${y}: ${u};`).join(" ");s+=`
|
|
16
|
+
${f(d)}{
|
|
17
17
|
${g}
|
|
18
18
|
}
|
|
19
|
-
${
|
|
19
|
+
${f(h,!0)}{
|
|
20
20
|
${g}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
|
-
${d
|
|
24
|
-
${
|
|
23
|
+
${f(d)}{
|
|
24
|
+
${o}
|
|
25
25
|
}
|
|
26
|
-
${
|
|
27
|
-
${
|
|
26
|
+
${f(h,!0)}{
|
|
27
|
+
${o}
|
|
28
28
|
}
|
|
29
|
-
`}i!=="default"&&(s+="}")}return s};function
|
|
30
|
-
`);let
|
|
29
|
+
`}i!=="default"&&(s+="}")}return s};function Ln(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Rn=e=>/%$/.test(e),Nn=e=>/^([1-9]|1[0-2])fg$/.test(e),N=e=>{if(e!==void 0)return Nn(e)||Rn(e)?e:Ln(e)?`${e}px`:Object.keys(S).includes(e)?`var(${S[e]})`:e},S={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function te(e,t=":host"){let r="",s=["default","xl","lg","md","sm"];for(let i of s){let n=Nr[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;
|
|
31
31
|
`);r+=`${t} {
|
|
32
|
-
${
|
|
32
|
+
${a.trim()}
|
|
33
33
|
}
|
|
34
34
|
`,i!=="default"&&(r+=`}
|
|
35
|
-
`)}return r}var
|
|
35
|
+
`)}return r}var de=(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)||!de(e[i],t[i]))return!1;return!0};var Pn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}},
|
|
84
|
+
`}},Pr=G(Pn,{},".surface");var Vn=[{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(L`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -248,8 +248,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
248
248
|
color: inherit;
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
${
|
|
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
|
|
251
|
+
${Pr}
|
|
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 Vn){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?(Te({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=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()}},Vr=({render:e,html:t})=>vt;var Dr=L`
|
|
253
253
|
|
|
254
254
|
:host([d="h"]) {
|
|
255
255
|
flex-direction: row;
|
|
@@ -320,7 +320,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
320
320
|
justify-content: center;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
`;var
|
|
323
|
+
`;var Dn={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"}},F=G(Dn);var jr=L`
|
|
324
324
|
:host([sh]:not([sv])) {
|
|
325
325
|
overflow-x: scroll;
|
|
326
326
|
flex-wrap: nowrap;
|
|
@@ -367,7 +367,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
367
367
|
flex-wrap: nowrap;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
-
`;var
|
|
370
|
+
`;var Re={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},jn={bgc:{pr:`
|
|
371
371
|
background-color: var(--primary);
|
|
372
372
|
`,se:`
|
|
373
373
|
background-color: var(--secondary);
|
|
@@ -407,7 +407,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
407
407
|
left: 0;
|
|
408
408
|
top: 0;
|
|
409
409
|
height: 100%;
|
|
410
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:S,pr:S,pb:S,pl:S,p:S,ph:S,pv:S,g:S,gv:S,gh:S,bw:
|
|
410
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:S,pr:S,pb:S,pl:S,p:S,ph:S,pv:S,g:S,gv:S,gh:S,bw:Re,bwt:Re,bwr:Re,bwb:Re,bwl:Re,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"}},Br=G(jn);var Bn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S},q=G(Bn);var He=L`
|
|
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 $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
417
417
|
margin: 0;
|
|
418
418
|
font: inherit;
|
|
419
419
|
}
|
|
420
|
-
`;var
|
|
420
|
+
`;var bt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
421
421
|
slot {
|
|
422
422
|
display: contents;
|
|
423
423
|
}
|
|
@@ -433,14 +433,14 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
|
|
436
|
-
${Dr}
|
|
437
436
|
${jr}
|
|
437
|
+
${Dr}
|
|
438
438
|
${q}
|
|
439
|
-
${
|
|
439
|
+
${F}
|
|
440
440
|
${Br}
|
|
441
|
-
${
|
|
442
|
-
${
|
|
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",...
|
|
441
|
+
${He}
|
|
442
|
+
${Oe}
|
|
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",...ee([...ue,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=K();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Le({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=K(),ne.forEach(r=>{let s=_=>`${r==="default"?"":`${r}-`}${_}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(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),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),H({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")),c=this.getAttribute(s("ah")),u=this.getAttribute(s("av"));o==="h"?this._styles[r]["flex-direction"]="row":o==="v"?this._styles[r]["flex-direction"]="column":r==="default"&&!o&&["sm","md","lg","xl"].some(x=>this.hasAttribute(`${x}-d`))&&(this._styles[r]["flex-direction"]="column");let d=o==="h",h=o==="v"||!o;d&&(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"),u==="c"?(this._styles[r]["align-items"]="center",this._styles[r]["align-content"]="center"):u==="e"?(this._styles[r]["align-items"]="flex-end",this._styles[r]["align-content"]="flex-end"):u==="s"&&(this._styles[r]["align-items"]="flex-start")),h&&(c!==null||u!==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"),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"));let f=this.hasAttribute(s("wrap")),m=this.hasAttribute(s("no-wrap"));f&&(this._styles[r]["flex-wrap"]="wrap"),m&&(this._styles[r]["flex-wrap"]="nowrap");let g=this.hasAttribute(s("sh")),y=this.hasAttribute(s("sv")),w=this.getAttribute(s("overflow"));g&&y?(this._styles[r].overflow="scroll",this._styles[r]["flex-wrap"]="nowrap"):g?(this._styles[r]["overflow-x"]="scroll",this._styles[r]["flex-wrap"]="nowrap"):y&&(this._styles[r]["overflow-y"]="scroll",this._styles[r]["flex-wrap"]="nowrap"),w==="hidden"&&(this._styles[r].overflow="hidden",this._styles[r]["flex-wrap"]="nowrap")});let t=te(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()}},Wr=({render:e,html:t})=>bt;var Wn={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 $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
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
|
-
`}},Mr=G(
|
|
483
|
+
`}},Mr=G(Wn);var Mn={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);"}},Ge=G(Mn);var wt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
484
484
|
:host {
|
|
485
485
|
display: block;
|
|
486
486
|
font-size: var(--md-font-size);
|
|
@@ -499,12 +499,12 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
499
499
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
500
500
|
color: var(--anchor-color-hover);
|
|
501
501
|
}
|
|
502
|
-
${
|
|
502
|
+
${Oe}
|
|
503
503
|
${Mr}
|
|
504
|
-
${
|
|
504
|
+
${Ge}
|
|
505
505
|
${q}
|
|
506
|
-
${
|
|
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=
|
|
506
|
+
${F}
|
|
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=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=""),gt({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Le({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:r,rel:s})}},zr=({render:e,html:t})=>wt;var Ne={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},zn={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:Ne,bwt:Ne,bwr:Ne,bwb:Ne,bwl:Ne,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"}},Fr=e=>G(zn,{},e);var Fn={mt:S,mr:S,mb:S,ml:S,m:S,mh:S,mv:S},Ur=e=>G(Fn,{},e);var _t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
508
508
|
:host {
|
|
509
509
|
display: contents;
|
|
510
510
|
}
|
|
@@ -531,7 +531,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
531
531
|
height: auto;
|
|
532
532
|
}
|
|
533
533
|
|
|
534
|
-
${
|
|
534
|
+
${He}
|
|
535
535
|
|
|
536
536
|
a {
|
|
537
537
|
display: block;
|
|
@@ -540,9 +540,9 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
540
540
|
}
|
|
541
541
|
|
|
542
542
|
${Fr("img, a")}
|
|
543
|
-
${
|
|
544
|
-
${
|
|
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
|
|
543
|
+
${Ur("img, a")}
|
|
544
|
+
${F}
|
|
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 ee([...ue,"key","src","alt","href","new-tab","rel","wh","w","h","hide","show","op","z","of"])}_styles=K();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=mt({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=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(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),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({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=te(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 Hr=L`
|
|
546
546
|
:host([pt="xs"]) svg {
|
|
547
547
|
padding-top: var(--spacing-xs);
|
|
548
548
|
}
|
|
@@ -658,16 +658,16 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
658
658
|
padding-top: var(--spacing-xl);
|
|
659
659
|
padding-bottom: var(--spacing-xl);
|
|
660
660
|
}
|
|
661
|
-
`;var xt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(
|
|
661
|
+
`;var xt=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
662
662
|
:host {
|
|
663
663
|
color: var(--foreground);
|
|
664
664
|
flex-shrink: 0;
|
|
665
665
|
}
|
|
666
|
-
${
|
|
666
|
+
${Ge}
|
|
667
667
|
${Hr}
|
|
668
668
|
${q}
|
|
669
|
-
${
|
|
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=
|
|
669
|
+
${F}
|
|
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=N(t===null?this.getAttribute("w"):t),s=N(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=""}},Gr=({render:e,html:t})=>xt;var Un=["mt","mr","mb","ml","m","mh","mv","cur"],At=class e extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","s"];static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
671
671
|
:host {
|
|
672
672
|
display: contents;
|
|
673
673
|
}
|
|
@@ -701,8 +701,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
701
701
|
cursor: not-allowed;
|
|
702
702
|
}
|
|
703
703
|
${q}
|
|
704
|
-
${
|
|
705
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
704
|
+
${F}
|
|
705
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),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","s",...ee([...Un,"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=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(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),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({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=te(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 r=this.getAttribute("type")==="password"?"password":"text",s=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",r),s?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},qr=({render:e,html:t})=>At;var Kn=["mt","mr","mb","ml","m","mh","mv","cur"],Et=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(L`
|
|
706
706
|
:host {
|
|
707
707
|
display: contents;
|
|
708
708
|
}
|
|
@@ -736,8 +736,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
736
736
|
cursor: not-allowed;
|
|
737
737
|
}
|
|
738
738
|
${q}
|
|
739
|
-
${
|
|
740
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
739
|
+
${F}
|
|
740
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),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",...ee([...Kn,"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=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(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),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({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=te(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()}},Jr=({render:e,html:t})=>Et;var kt=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
741
741
|
:host {
|
|
742
742
|
display: contents;
|
|
743
743
|
}
|
|
@@ -761,8 +761,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
761
761
|
border-color: var(--foreground);
|
|
762
762
|
}
|
|
763
763
|
${q}
|
|
764
|
-
${
|
|
765
|
-
`))}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",...
|
|
764
|
+
${F}
|
|
765
|
+
`))}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",...ee([...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=N(l===null?this.getAttribute(a("w")):l),o=N(l===null?this.getAttribute(a("h")):l),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),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=te(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")}},Yr=({render:e,html:t})=>kt;var Hn=["mt","mr","mb","ml","m","mh","mv","cur"],Gn=/^#[0-9a-fA-F]{6}$/,$t=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
766
766
|
:host {
|
|
767
767
|
display: contents;
|
|
768
768
|
}
|
|
@@ -784,8 +784,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
784
784
|
opacity: 0.5;
|
|
785
785
|
}
|
|
786
786
|
${q}
|
|
787
|
-
${
|
|
788
|
-
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=
|
|
787
|
+
${F}
|
|
788
|
+
`))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles=K(),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",...ee([...Hn,"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=K(),ne.forEach(r=>{let s=o=>`${r==="default"?"":`${r}-`}${o}`,i=this.getAttribute(s("wh")),n=N(i===null?this.getAttribute(s("w")):i),a=N(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),H({styleBucket:this._styles[r],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),H({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=te(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=Gn.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()}},Xr=({render:e,html:t})=>$t;var St=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
789
789
|
:host {
|
|
790
790
|
display: contents;
|
|
791
791
|
}
|
|
@@ -838,8 +838,8 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
838
838
|
cursor: not-allowed;
|
|
839
839
|
}
|
|
840
840
|
${q}
|
|
841
|
-
${
|
|
842
|
-
`))}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",...
|
|
841
|
+
${F}
|
|
842
|
+
`))}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",...ee([...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=N(l===null?this.getAttribute(a("w")):l),o=N(l===null?this.getAttribute(a("h")):l),c=this.getAttribute(a("op")),u=this.getAttribute(a("z"));u!==null&&(this._styles[n]["z-index"]=u),c!==null&&(this._styles[n].opacity=c),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=te(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()}},Zr=({render:e,html:t})=>St;var Ct=40,qn=6,It=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
843
843
|
:host {
|
|
844
844
|
display: contents;
|
|
845
845
|
}
|
|
@@ -916,7 +916,7 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
916
916
|
animation: none;
|
|
917
917
|
}
|
|
918
918
|
}
|
|
919
|
-
`))}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<
|
|
919
|
+
`))}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<qn&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(r>=s-2*Ct){this._slotElement.style.marginTop=`${Ct}px`,this._slotElement.style.marginBottom=`${Ct}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}},Qr=({render:e,html:t})=>It;var Ot=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(L`
|
|
920
920
|
:host {
|
|
921
921
|
display: contents;
|
|
922
922
|
}
|
|
@@ -970,19 +970,19 @@ var rettangoli=(()=>{var $n=Object.defineProperty;var L=(e,t)=>{for(var r in t)$
|
|
|
970
970
|
min-width: 200px;
|
|
971
971
|
max-width: 400px;
|
|
972
972
|
}
|
|
973
|
-
`))}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:o}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let a=t,l=r;switch(n){case"t":a=t-s/2,l=r-i-8;break;case"ts":a=t,l=r-i-8;break;case"te":a=t-s,l=r-i-8;break;case"r":a=t+8,l=r-i/2;break;case"rs":a=t+8,l=r;break;case"re":a=t+8,l=r-i;break;case"b":a=t-s/2,l=r+8;break;case"bs":a=t,l=r+8;break;case"be":a=t-s,l=r+8;break;case"l":a=t-s-8,l=r-i/2;break;case"ls":a=t-s-8,l=r;break;case"le":a=t-s-8,l=r-i;break;default:a=t,l=r+8;break}let p=8;return a=Math.max(p,Math.min(a,window.innerWidth-s-p)),l=Math.max(p,Math.min(l,window.innerHeight-i-p)),{left:a,top:l}}get popover(){return this._popoverContainer}},es=({render:e,html:t})=>It;var Ot={};L(Ot,{handleClickHeader:()=>Hn});var Hn=(e,t)=>{let{store:r,render:s}=e;r.toggleOpen({}),s()};var ts={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var Tt={};L(Tt,{createInitialState:()=>Gn,selectViewData:()=>Yn,toggleOpen:()=>Xn});var Gn=()=>Object.freeze({open:!1}),qn=["id","class","style","slot","label","content"],Jn=(e={})=>Object.entries(e).filter(([t])=>!qn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Yn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Jn(t)}),Xn=({state:e})=>{e.open=!e.open};var rs={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 Lt={};L(Lt,{handleClickItem:()=>Qn});var Qn=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index),o=Array.isArray(s.items)?s.items[n]:void 0;if(!o)return;if(o.disabled||o.current){i.preventDefault();return}typeof o.href=="string"&&o.href.length>0||i.preventDefault(),r(new CustomEvent("item-click",{detail:{id:o.id,path:o.path,href:o.href,item:o,index:n,trigger:i.type}}))};var ss={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 Rt={};L(Rt,{createInitialState:()=>Zn,selectViewData:()=>oo});var Zn=()=>Object.freeze({}),eo=["id","class","style","slot","items","sep","max","separator"],to=(e={})=>Object.entries(e).filter(([t])=>!eo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ro=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},so=e=>`${e}`.replace(/"/g,"""),io=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},no=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,o=!!t.disabled,a=!n&&!o&&(s||i||!!t.click),l=t.rel||(t.newTab?"noopener noreferrer":""),p=[t.newTab?'target="_blank"':"",l?`rel="${so(l)}"`:""].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:o,isInteractive:a,linkExtraAttrs:p,c:n?"fg":"mu-fg"}}),oo=({props:e})=>{let t=to(e),r=Array.isArray(e.items)?e.items:[],s=ro(e.max),i=e.sep||"breadcrumb-arrow",n=no(r),o=io(n,s),a=[];return o.forEach((l,p)=>{a.push(l),p<o.length-1&&a.push({isSeparator:!0})}),{containerAttrString:t,items:a,sep:i}};var is={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 Nt={};L(Nt,{handleClickMenuItem:()=>lo,handleClosePopover:()=>ao});var ao=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},lo=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=Number(i.currentTarget.dataset.index??i.currentTarget.id.slice(6)),o=s.items[n],a=o?.type||"item";if(!o||a!=="item"||o.disabled){i.preventDefault();return}o.href||i.preventDefault(),r(new CustomEvent("item-click",{detail:{index:n,item:o,id:o.id,path:o.path,href:o.href,trigger:i.type}}))};var ns={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:"string"},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 Vt={};L(Vt,{createInitialState:()=>po,selectViewData:()=>fo});var po=()=>Object.freeze({}),co=e=>`${e}`.replace(/"/g,"""),uo=e=>e.map((t,r)=>{let s=t.type||"item",i=s==="separator",n=s==="label",o=s==="item",a=!!t.disabled,l=o&&!a,p=a?"mu-fg":"fg",u=a?"mu":"",c=a?"":"ac",f=typeof t.href=="string"&&t.href.length>0,h=t.rel||(t.newTab?"noopener noreferrer":""),d=[t.newTab?'target="_blank"':"",h?`rel="${co(h)}"`:""].filter(Boolean).join(" ");return{...t,index:r,type:s,isSeparator:i,isLabel:n,isItem:o,isDisabled:a,isInteractive:l,hasHref:f,linkExtraAttrs:d,c:p,bgc:u,hoverBgc:c}}),fo=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:uo(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 os={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 Pt={};L(Pt,{handleActionClick:()=>bo,handleAfterMount:()=>yo,handleBeforeMount:()=>mo,handleImageClick:()=>xo,handleInputChange:()=>wo,handleKeyDown:()=>$o,handleOnUpdate:()=>go,handleSelectAddOption:()=>Eo,handleTooltipMouseEnter:()=>Ao,handleTooltipMouseLeave:()=>ko,handleWaveformClick:()=>_o});var as=({form:e,defaultValues:t={},refs:r})=>{let{fields:s=[]}=e;s.forEach((i,n)=>{let o=r[`field${n}`];if(o){if(["input-textarea","input-text","input-number","color-picker","slider","slider-input","popover-input"].includes(i.inputType)){let a=t[i.name];a==null?o.removeAttribute("value"):o.setAttribute("value",a)}["input-text","input-textarea"].includes(i.inputType)&&i.placeholder&&o.getAttribute("placeholder")!==i.placeholder&&(i.placeholder===void 0||i.placeholder===null?o.removeAttribute("placeholder"):o.setAttribute("placeholder",i.placeholder))}})},ho=e=>{for(let t in e)if(t.startsWith("field")){let r=e[t];if(r&&r.focus){r.focus();return}}},mo=e=>{let{store:t,props:r}=e;t.setFormValues({formValues:r.defaultValues})},yo=e=>{let{props:t,refs:r,render:s}=e,{form:i={},defaultValues:n}=t;as({form:i,defaultValues:n,refs:r}),s(),t?.autofocus&&setTimeout(()=>{ho(r)},50)},go=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n,refs:o}=e,{form:a={},defaultValues:l}=s;if(r?.key!==s?.key){as({form:a,defaultValues:l,refs:o}),i.setFormValues({formValues:l}),n();return}n()},vo=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},bo=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.actionId||i.currentTarget.id.slice(6);s(new CustomEvent("action-click",{detail:{actionId:n,formValues:r.selectFormValues()}}))},wo=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.fieldName||i.currentTarget.id.slice(5);if(n&&i.detail&&Object.prototype.hasOwnProperty.call(i.detail,"value")){let o=i.detail.value;r.setFormFieldValue({name:n,value:o}),vo(n,o,r.selectFormValues(),s)}},xo=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(5);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},_o=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(8);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},Eo=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.fieldName||i.currentTarget.id.slice(5);s(new CustomEvent("action-click",{detail:{actionId:"select-options-add",name:n,formValues:r.selectFormValues()}}))},Ao=(e,t)=>{let{store:r,render:s,props:i}=e,n=t._event,o=n.currentTarget.dataset.fieldName||n.currentTarget.id.slice(11),l=i.form.fields.find(p=>p.name===o);if(l&&l.tooltip){let p=n.currentTarget.getBoundingClientRect();r.showTooltip({x:p.left+p.width/2,y:p.top-8,content:l.tooltip.content}),s()}},ko=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},$o=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t._event;if(n.key==="Enter"&&!n.shiftKey){let o=n.target;if(o.tagName==="TEXTAREA"||o.tagName==="RTGL-TEXTAREA")return;n.preventDefault();let p=((i.form||{}).actions||{}).buttons||[];if(p.length>0){let u=p[0].id,c=r.selectFormValues();s(new CustomEvent("action-click",{detail:{actionId:u,formValues:c}}))}}};var ls={componentName:"rtgl-form",propsSchema:{type:"object",properties:{key:{type:"string"},autofocus:{type:"boolean"},defaultValues:{type:"object"},context:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"input-text"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}},required:["label","value"]}},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"color-picker"},value:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"popover-input"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"},testId:{type:"string"}},required:["id","content"]}}}}}}}},events:{"form-change":{},"extra-event":{},"action-click":{}},methods:{type:"object",properties:{}}};var zt={};L(zt,{createInitialState:()=>ia,getFormFieldValue:()=>ua,hideTooltip:()=>ma,selectForm:()=>Ge,selectFormValues:()=>ca,selectState:()=>pa,selectViewData:()=>la,setFormFieldValue:()=>fa,setFormValues:()=>da,showTooltip:()=>ha});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},V={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8,ADD:10,SUBTRACT:11},Ne={NOT:0};var k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},X=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var jt=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}')`)},ps=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 cs=(e,t,r=!1)=>{if(t===null)return new X(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new X(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new X(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new X(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},us=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new X(`Unknown function '${e}' (${r})`)};var So=(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 o=I(e,{functions:s,partials:i},t,{});return o===void 0?{}:o},I=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return M(e.var,r,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return M(e.path,r,s);if(e.type===v.INTERPOLATION)return Io(e.parts,t,r,s);switch(e.type){case v.FUNCTION:return fs(e,t,r,s);case v.BINARY:return hs(e,t,r,s);case v.UNARY:return ms(e,t,r,s);case v.CONDITIONAL:return To(e,t,r,s);case v.LOOP:return Po(e,t,r,s);case v.OBJECT:return Do(e,t,r,s);case v.ARRAY:return Bo(e,t,r,s);case v.PARTIAL:return Wo(e,t,r,s);case v.PATH_REFERENCE:return Mo(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ds=new Map,Co=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 o=r.trim();if(/^\d+$/.test(o))t.push({type:"index",value:parseInt(o,10)});else if(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'")){let a=o.slice(1,-1);t.push({type:"property",value:a})}else t.push({type:"property",value:o});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=ds.get(e);if(!s){let n=[],o="",a=0;for(let l=0;l<e.length;l++){let p=e[l];p==="["?(a++,o+=p):p==="]"?(a--,o+=p):p==="."&&a===0?o&&(n.push(o),o=""):o+=p}o&&n.push(o),s=[];for(let l of n){let p=Co(l.trim());s.push(...p)}ds.set(e,s)}let i=t;for(let n=0;n<s.length;n++){let o=s[n];if(o.type==="property"&&o.value in r){i=r[o.value];continue}if(i==null)return;(o.type==="property"||o.type==="index")&&(i=i[o.value])}return i},Io=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=I(n,t,r,s);i.push(o!=null?String(o):"")}return i.join("")},fs=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw us(e.name,i);let o=e.args.map(a=>I(a,t,r,s));return n(...o)},Ee=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case v.VARIABLE:return M(e.path,r,s);case v.LITERAL:return e.value;case v.BINARY:return hs(e,t,r,s);case v.UNARY:return ms(e,t,r,s);case v.FUNCTION:return fs(e,t,r,s);default:return I(e,t,r,s)}},hs=(e,t,r,s)=>{if(e.op===V.AND||e.op===V.OR){let o=Ee(e.left,t,r,s),a=Ee(e.right,t,r,s);switch(e.op){case V.AND:return o&&a;case V.OR:return o||a}}let i=I(e.left,t,r,s),n=I(e.right,t,r,s);switch(e.op){case V.EQ:return i==n;case V.NEQ:return i!=n;case V.GT:return i>n;case V.LT:return i<n;case V.GTE:return i>=n;case V.LTE:return i<=n;case V.IN:return Array.isArray(n)?n.includes(i):!1;case V.ADD:if(typeof i!="number"||typeof n!="number")throw new X(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case V.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new X(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ms=(e,t,r,s)=>{let i=e.op===Ne.NOT?Ee(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case Ne.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Oo=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(M(i.path,r,s)){let o=e.bodies[0];if(o.type===v.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,u=l.value;if(u.type===v.LITERAL)a[p]=u.value;else if(u.type===v.VARIABLE)a[p]=M(u.path,r,s);else if(u.type===v.INTERPOLATION){let c=[];for(let f of u.parts)if(typeof f=="string")c.push(f);else if(f.type===v.VARIABLE){let h=M(f.path,r,s);c.push(h!=null?String(h):"")}else{let h=I(f,t,r,s);c.push(h!=null?String(h):"")}a[p]=c.join("")}else a[p]=I(u,t,r,s)}return a}}else{let o=e.bodies[1];if(o.type===v.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?I(l.parsedKey,t,r,s):l.key,u=l.value;if(u.type===v.LITERAL)a[p]=u.value;else if(u.type===v.VARIABLE)a[p]=M(u.path,r,s);else if(u.type===v.INTERPOLATION){let c=[];for(let f of u.parts)if(typeof f=="string")c.push(f);else if(f.type===v.VARIABLE){let h=M(f.path,r,s);c.push(h!=null?String(h):"")}else{let h=I(f,t,r,s);c.push(h!=null?String(h):"")}a[p]=c.join("")}else a[p]=I(u,t,r,s)}return a}}}return null},To=(e,t,r,s)=>{let i=Oo(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Ee(o,t,r,s))return I(e.bodies[n],t,r,s)}return ys},Lo=(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 o=i.substring(s.length+1);if(n.type===v.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let a=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[o]){let u={};for(let c of n.properties){let f=c.key,h=c.value;if(h.type===v.LITERAL)u[f]=h.value;else if(h.type===v.VARIABLE){let d=h.path;if(d===s)u[f]=p;else if(d.startsWith(s+".")){let m=d.substring(s.length+1);u[f]=p[m]}else return null}else if(h.type===v.INTERPOLATION){let d=[],m=!0;for(let g of h.parts)if(typeof g=="string")d.push(g);else if(g.type===v.VARIABLE){let y=g.path;if(y===s)d.push(p!=null?String(p):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),x=p[w];d.push(x!=null?String(x):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;u[f]=d.join("")}else return null}a.push(u)}}return a}}}return null},Ro=(e,t)=>{let r=e.body,s=e.itemVar,i=Lo(e,t);if(i!==null)return i;if(r.type===v.OBJECT&&r.properties.length<=5&&!r.whenCondition){for(let a of r.properties)if(a.parsedKey)return null;let n=[],o=!0;for(let a of r.properties){let l=a.key,p=a.value;if(p.type===v.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===v.VARIABLE){let u=p.path;if(u===s)n.push({key:l,type:"item"});else if(u.startsWith(s+".")){let c=u.substring(s.length+1);if(!c.includes(".")&&!c.includes("["))n.push({key:l,type:"prop",prop:c});else{o=!1;break}}else{o=!1;break}}else if(p.type===v.INTERPOLATION&&p.parts.length===1){let u=p.parts[0];if(u.type===v.VARIABLE){let c=u.path;if(c===s)n.push({key:l,type:"item_string"});else if(c.startsWith(s+".")){let f=c.substring(s.length+1);if(!f.includes(".")&&!f.includes("["))n.push({key:l,type:"prop_string",prop:f});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let a=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 p=t[l];a[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],u={};for(let c of n)if(c.type==="literal")u[c.key]=c.value;else if(c.type==="item")u[c.key]=p;else if(c.type==="prop")u[c.key]=p[c.prop];else if(c.type==="item_string")u[c.key]=p!=null?String(p):"";else if(c.type==="prop_string"){let f=p[c.prop];u[c.key]=f!=null?String(f):""}a[l]=u}return a}}return null},No=(e,t,r,s,i)=>{let n=[],o=e.body;if(o.type===v.OBJECT&&o.fast!==!1){let a=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let u=i[p],c={},f={...s,[a]:u,...l&&{[l]:p}};f.__paths__||(f.__paths__=s.__paths__||{});let h=e.iterable.path||"";if(s&&s.__paths__&&h){let d=h.split("."),m=d[0];m in s.__paths__&&(h=s.__paths__[m],d.length>1&&(h+="."+d.slice(1).join(".")))}f.__paths__={...f.__paths__,[a]:`${h}[${p}]`,...l&&{[l]:p}};for(let d of o.properties){let m=d.parsedKey?I(d.parsedKey,t,r,f):d.key,g=d.value;if(g.type===v.LITERAL)c[m]=g.value;else if(g.type===v.VARIABLE){let y=g.path;if(y===a)c[m]=u;else if(y===l)c[m]=p;else if(y.startsWith(a+".")){let w=y.substring(a.length+1);!w.includes(".")&&!w.includes("[")?c[m]=u[w]:c[m]=M(y,r,{...s,[a]:u,...l&&{[l]:p}})}else c[m]=M(y,r,{...s,[a]:u,...l&&{[l]:p}})}else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let x=w.path,_;if(x===a)_=u;else if(x===l)_=p;else if(x.startsWith(a+".")){let E=x.substring(a.length+1);!E.includes(".")&&!E.includes("[")?_=u[E]:_=M(x,r,{...s,[a]:u,...l&&{[l]:p}})}else _=M(x,r,{...s,[a]:u,...l&&{[l]:p}});y.push(_!=null?String(_):"")}else{let x={...s,[a]:u,...l&&{[l]:p}},_=I(w,t,r,x);y.push(_!=null?String(_):"")}c[m]=y.join("")}else{let y={...s,[a]:u,...l&&{[l]:p}};c[m]=I(g,t,r,y)}}n.push(c)}return n}return null},Vo=(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 o=n.bodies[0];if(o.type===v.OBJECT&&o.properties.length===2){let a=o.properties[0],l=o.properties[1];if(a.key==="id"&&a.value.type===v.VARIABLE&&a.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===v.CONDITIONAL){let p=[];for(let u=0;u<t.length;u++){let c=t[u];if(c.visible){let f={id:c.id};c.highlighted?(f.highlight=!0,f.message=`This item is highlighted: ${c.name}`):(f.highlight=!1,f.message=c.name),p.push(f)}}return p}}}}return null},Po=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let p,u=!1;if(e.iterable.type===v.FUNCTION){u=!0;let f=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(", ");p=`${e.iterable.name}(${f})`}else p=e.iterable.path||"undefined";let c=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${p}`;throw cs(c,i,u)}if(!e.indexVar){let p=Vo(e,i,e.itemVar);if(p!==null)return p}if(!e.indexVar){let p=Ro(e,i);if(p!==null)return p}let n=No(e,t,r,s,i);if(n!==null)return n;let o=[],a=e.iterable.path||"";if(s&&s.__paths__&&a){let p=a.split("."),u=p[0];u in s.__paths__&&(a=s.__paths__[u],p.length>1&&(a+="."+p.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(p=>p.type===v.OBJECT&&p.properties.some(u=>u.key.startsWith("$if ")||u.key.startsWith("$when "))));for(let p=0;p<i.length;p++){let u=e.indexVar?{...s,[e.itemVar]:i[p],[e.indexVar]:p}:{...s,[e.itemVar]:i[p]};u.__paths__||(u.__paths__=s.__paths__||{}),u.__paths__={...u.__paths__,[e.itemVar]:`${a}[${p}]`},e.indexVar&&(u.__paths__[e.indexVar]=p);let c=I(e.body,t,r,u);if(Array.isArray(c)&&c.length===1&&!l){let f=c[0];o.push(f===void 0?{}:f)}else o.push(c===void 0?{}:c)}return o},jo=(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,o=i.value;if(o.type===v.OBJECT&&o.properties.length<=10&&!o.whenCondition){let a={},l={},p=!0;for(let u of o.properties){let c=u.parsedKey?I(u.parsedKey,t,r,s):u.key,f=u.value;if(f.type===v.LITERAL)l[c]=f.value;else if(f.type===v.VARIABLE)l[c]=M(f.path,r,s);else if(f.type===v.INTERPOLATION){let h=[];for(let d of f.parts)if(typeof d=="string")h.push(d);else if(d.type===v.VARIABLE){let m=M(d.path,r,s);h.push(m!=null?String(m):"")}else{p=!1;break}if(!p)break;l[c]=h.join("")}else if(f.type===v.OBJECT&&f.properties.length<=5){let h={};for(let d of f.properties){let m=d.key,g=d.value;if(g.type===v.LITERAL)h[m]=g.value;else if(g.type===v.VARIABLE)h[m]=M(g.path,r,s);else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let x=M(w.path,r,s);y.push(x!=null?String(x):"")}else{p=!1;break}if(!p)break;h[m]=y.join("")}else{p=!1;break}}if(!p)break;l[c]=h}else{p=!1;break}}if(p)return a[n]=l,a}}return null},Do=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!Ee(e.whenCondition,i,r,s))return;let n=jo(e,t,r,s);if(n!==null)return n;if(e.fast){let p={};for(let u of e.properties){let c=u.parsedKey?I(u.parsedKey,t,r,s):u.key,f=u.value;if(f.type===v.LITERAL)p[c]=f.value;else if(f.type===v.VARIABLE)p[c]=M(f.path,r,s);else if(f.type===v.INTERPOLATION){let h=[];for(let d of f.parts)if(typeof d=="string")h.push(d);else if(d.type===v.VARIABLE){let m=M(d.path,r,s);h.push(m!=null?String(m):"")}else{let m=I(d,t,r,s);h.push(m!=null?String(m):"")}p[c]=h.join("")}else p[c]=I(f,t,r,s)}return p}let o={},a=null,l=!1;for(let p of e.properties)if(!p.key.startsWith("$if ")&&!p.key.match(/^\$if\s+\w+.*:?$/)&&!p.key.startsWith("$elif")&&!p.key.startsWith("$else")&&!p.key.startsWith("$for ")){l=!0;break}for(let p of e.properties)if(p.key.startsWith("$if ")||p.key.match(/^\$if\s+\w+.*:?$/)){let u=I(p.value,t,r,s);if(!l&&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(o,u)}else if(p.key.startsWith("$for ")){if(e.properties.length===1)return I(p.value,t,r,s)}else{let u=p.value;if(u&&u.type===v.OBJECT&&u.properties){let c=u.properties.find(f=>f.key.startsWith("$for "));if(c){let f=I(c.value,t,r,s);f!==void 0&&(o[p.key]=f)}else{let f=I(p.value,t,r,s);f!==void 0&&(o[p.key]=f)}}else{let c=p.parsedKey?I(p.parsedKey,t,r,s):p.key,f=I(p.value,t,r,s);f!==void 0&&(o[c]=f)}}return o},ys={},Bo=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let o=I(n,t,r,s);Array.isArray(o)&&n.flatten!==!1?i.push(...o):i.push(o)}else{let o=I(n,t,r,s);o!==ys&&o!==void 0&&i.push(o)}return i},Wo=(e,t,r,s)=>{let{name:i,data:n,whenCondition:o}=e,a=t.partials||{},l=t.functions||t;if(o&&!Ee(o,l,r,s))return;if(!a[i])throw new X(`Partial '${i}' is not defined`);let p=s._partialStack||[];if(p.includes(i))throw new X(`Circular partial reference detected: ${i}`);let u=a[i],c=r,f={...s,_partialStack:[...p,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,f)},Mo=(e,t,r,s)=>{let{path:i}=e,n=i.split("."),o=n[0],a=n.slice(1);if(!s||!(o in s))throw new X(`Path reference '#{${i}}' refers to '${o}' which is not a loop variable in the current scope`);if(s.__paths__||(s.__paths__={}),!(o in s.__paths__))throw new X(`Path reference '#{${i}}' cannot be resolved - path tracking may not be initialized properly`);let l=s.__paths__[o];if(typeof l=="number"){if(a.length>0)throw new X(`Path reference '#{${i}}' - cannot access properties on index variable '${o}'`);return String(l)}return a.length>0&&(l+="."+a.join(".")),l},Dt=So;var zo=/\$\{([^}]*)\}/g,Fo=/#\{([^}]*)\}/g,vs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Ko(i,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:n}},Ko=(e,t={})=>e.trim()?Uo(e).map(s=>Ho(s.trim(),t)):[],Uo=e=>{let t=[],r="",s=0,i=!1,n="";for(let o=0;o<e.length;o++){let a=e[o],l=o>0?e[o-1]:"";!i&&(a==='"'||a==="'")?(i=!0,n=a,r+=a):i&&a===n&&l!=="\\"?(i=!1,n="",r+=a):!i&&a==="("?(s++,r+=a):!i&&a===")"?(s--,r+=a):!i&&a===","&&s===0?(t.push(r),r=""):r+=a}return r&&t.push(r),t},Ho=(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=vs(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,o=null;for(let{op:a,type:l}of i){let p=0;for(;p<s.length;){let u=ye(s.substring(p),a);if(u===-1)break;let c=p+u;c>n&&(n=c,o={op:a,type:l}),p=c+a.length}}if(n!==-1)try{return J(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},bs=/^\w+\(.*\)$/,Go=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,qo=e=>{if(!(!e||e.trim()===""||bs.test(e))&&Go.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(bs.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:v.PATH_REFERENCE,path:t}},Ve=(e,t={})=>{let r=e.trim();qo(r);let s=vs(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}},Bt=(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,(p,u)=>{let c=`__ESCAPED_${s.length}__`;return s.push(u),c}),r=r.replace(/\\(#\{[^}]*\})/g,(p,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(zo)],n=[...r.matchAll(Fo)],o=[...i.map(p=>({match:p,type:"variable"})),...n.map(p=>({match:p,type:"pathref"}))].sort((p,u)=>p.match.index-u.match.index);if(o.length===0){let p=r;for(let u=0;u<s.length;u++)p=p.replace(`__ESCAPED_${u}__`,s[u]);return{type:v.LITERAL,value:p}}if(o.length===1&&o[0].match[0]===r&&s.length===0){let{match:p,type:u}=o[0];try{return u==="variable"?Ve(p[1],t):gs(p[1])}catch(c){if(c.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw c}}let a=[],l=0;for(let{match:p,type:u}of o){let[c,f]=p,h=p.index;if(h>l){let d=r.substring(l,h);for(let m=0;m<s.length;m++)d=d.replace(`__ESCAPED_${m}__`,s[m]);d&&a.push(d)}try{let d;u==="variable"?d=Ve(f.trim(),t):d=gs(f.trim()),a.push(d)}catch(d){if(d.message==="Invalid array index syntax")a.push(c);else throw d}l=h+c.length}if(l<r.length){let p=r.substring(l);for(let u=0;u<s.length;u++)p=p.replace(`__ESCAPED_${u}__`,s[u]);p&&a.push(p)}return{type:v.INTERPOLATION,parts:a}};var de=(e,t)=>typeof e=="string"?Bt(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Yo(e,t):Xo(e,t):{type:v.LITERAL,value:e},Jo=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}},Yo=(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 l=Jo(n),p=Object.keys(l);if(p.length===1&&/^\$for(?::\w+)?\s/.test(p[0])){let u=ws(p[0],l[p[0]],t,!0);r.push(u),s=!0;continue}}catch(l){throw l instanceof k?l:new k(l.message)}let a=Object.keys(n);if(a.length===1&&/^\$for(?::\w+)?\s/.test(a[0])){let l=ws(a[0],n[a[0]],t);r.push(l),s=!0;continue}}let o=de(n,t);r.push(o),(o.type===v.FUNCTION||o.type===v.CONDITIONAL||o.type===v.LOOP||o.type===v.PARTIAL||o.type===v.OBJECT&&!o.fast||o.type===v.ARRAY&&!o.fast)&&(s=!0)}return{type:v.ARRAY,items:r,fast:!s}},Xo=(e,t)=>{let r=[],s=!1,i=null,n=Object.entries(e),o=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 l=["$if","$elif","$else","$for"],p=[];for(let[y]of n)for(let w of l)if(y===w||y.startsWith(w+" ")||y.startsWith(w+"#")){p.push(w);break}if(p.length>0)throw new k(`Cannot use $partial with ${p.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:u,$when:c,...f}=e,h={},d=!1;for(let[y,w]of Object.entries(f)){let x=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(x=y.slice(1)),h[x]=w,d=!0}let m=null;if(d&&(m=de(h,t),m.type===v.OBJECT)){let y=!1;for(let w of m.properties)if(w.value.type===v.VARIABLE||w.value.type===v.INTERPOLATION||w.value.type===v.FUNCTION||w.value.type===v.CONDITIONAL||w.value.type===v.OBJECT&&!w.value.fast||w.value.type===v.ARRAY&&!w.value.fast){y=!0;break}y&&(m.fast=!1)}let g={type:v.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=J(c,t)}else y={type:v.LITERAL,value:c};g.whenCondition=y}return g}for(let[l,p]of n)if(l==="$when"){if(i!==null)throw new k("Multiple '$when' directives on the same object are not allowed");if(p==null)throw new k("Missing condition expression after '$when'");let u=typeof p=="string"?p:JSON.stringify(p);if(u.trim()==="")throw new k("Empty condition expression after '$when'");i=J(u,t),s=!0}else if(l.startsWith("$when#")||l.startsWith("$when "))throw new k("'$when' does not support ID syntax or inline conditions - use '$when' as a property");for(;o<n.length;){let[l,p]=n[o];if(l==="$when"){o++;continue}if(l==="$each")throw new k("$each can only be used inside arrays");if(l.startsWith("$if ")||l.match(/^\$if#\w+\s/)||l.match(/^\$if\s+\w+.*:$/)){let u=Qo(n,o,t);r.push({key:l,value:u.node}),s=!0,o=u.nextIndex}else if(/^\$for(?::\w+)?\s/.test(l)){let u=l.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(l.startsWith("$elif ")||l.startsWith("$else"))throw new k(`'${l.split(" ")[0]}' without matching '$if'`);if(l==="$if"||l==="$if:")throw new k("Missing condition expression after '$if'");{let u=de(p,t);(u.type===v.FUNCTION||u.type===v.CONDITIONAL||u.type===v.PARTIAL||u.type===v.OBJECT&&!u.fast||u.type===v.ARRAY&&!u.fast)&&(s=!0);let c=Bt(l,t),f={key:l,value:u};(c.type!==v.LITERAL||c.value!==l)&&(f.parsedKey=c),r.push(f),o++}}}let a={type:v.OBJECT,properties:r,fast:!s};return i&&(a.whenCondition=i),a},Qo=(e,t,r={})=>{let s=[],i=[],n=t,[o,a]=e[n],l=null,p;if(o.startsWith("$if#")){let c=o.match(/^\$if#(\w+)\s+(.+)$/);if(c)l=c[1],p=c[2];else throw new k(`Invalid conditional syntax: ${o}`)}else p=o.substring(4),p.endsWith(":")&&(p=p.slice(0,-1).trim());jt(p);let u=J(p,r);for(s.push(u),i.push(de(a,r)),n++;n<e.length;){let[c,f]=e[n],h=!1,d;if(l?c.startsWith(`$elif#${l} `)?(d=c.substring(`$elif#${l} `.length),d.endsWith(":")&&(d=d.slice(0,-1).trim()),h=!0):(c===`$else#${l}`||c===`$else#${l}:`)&&(h=!0,d=null):c.startsWith("$elif ")?(d=c.substring(6),d.endsWith(":")&&(d=d.slice(0,-1).trim()),h=!0):(c==="$else"||c==="$else:")&&(h=!0,d=null),h){if(d===null)s.push(null);else{jt(d);let m=J(d,r);s.push(m)}if(i.push(de(f,r)),n++,d===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:i,id:l},nextIndex:n}},J=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let p=e.slice(1,-1),u=0,c=!0;for(let f=0;f<p.length;f++)if(p[f]==="("?u++:p[f]===")"&&u--,u<0){c=!1;break}if(c&&u===0)return J(p,t)}let r=ye(e,"||");if(r!==-1)return{type:v.BINARY,op:V.OR,left:J(e.substring(0,r).trim(),t),right:J(e.substring(r+2).trim(),t)};let s=ye(e,"&&");if(s!==-1)return{type:v.BINARY,op:V.AND,left:J(e.substring(0,s).trim(),t),right:J(e.substring(s+2).trim(),t)};let i=[{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:p,type:u}of i){let c=ye(e,p);if(c!==-1)return{type:v.BINARY,op:u,left:J(e.substring(0,c).trim(),t),right:J(e.substring(c+p.length).trim(),t)}}let n=-1,o=null,a=[{op:" + ",type:V.ADD},{op:" - ",type:V.SUBTRACT}];for(let{op:p,type:u}of a){let c=0;for(;c<e.length;){let f=ye(e.substring(c),p);if(f===-1)break;let h=c+f;h>n&&(n=h,o={op:p,type:u}),c=h+p.length}}if(n!==-1&&o)return{type:v.BINARY,op:o.type,left:J(e.substring(0,n).trim(),t),right:J(e.substring(n+o.op.length).trim(),t)};let l=[" * "," / "," % "];for(let p of l)if(ye(e,p)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${p}"`);return e.startsWith("!")?{type:v.UNARY,op:Ne.NOT,operand:J(e.substring(1).trim(),t)}:xs(e,t)},ye=(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},Zo=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}},xs=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return Ve(r,t);let i=Zo(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return Ve(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},ea=(e,t=!1)=>{let r=t?"$each":"$for";try{ps(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}},ws=(e,t,r,s=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let g=s?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let o=n[1],a=n[2].trim();ea(a,s);let l=a.match(/^(.+?)\s+in\s+(.+)$/);if(!l){let g=s?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${a}')`)}let p=l[1].trim(),u=l[2].trim(),c,f=null;if(p.includes(",")){let g=p.split(",").map(y=>y.trim());if(g.length!==2)throw new k(`Invalid loop variables: ${p}. Expected format: "item" or "item, index"`);c=g[0],f=g[1]}else c=p;let h=["this","undefined","null","true","false"];if(h.includes(c))throw new k(`Reserved variable name: ${c}`);if(f&&h.includes(f))throw new k(`Reserved variable name: ${f}`);let d=xs(u,r),m=de(t,r);return{type:v.LOOP,itemVar:c,indexVar:f,iterable:d,body:m,flatten:o!=="nested"}};var ta=(e,t={})=>{let{functions:r={}}=t;return de(e,r)},He=ta;var Wt={};L(Wt,{now:()=>ra});var ra=()=>Date.now();var sa=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...Wt,...s},o=He(e,{functions:n}),a={};for(let[l,p]of Object.entries(i))a[l]=He(p,{functions:n});return Dt(o,t,{functions:n,partials:a})},Mt=sa;function _s(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}var ia=()=>Object.freeze({formValues:{},tooltipState:{open:!1,x:0,y:0,content:""}}),Es=(e,t,r=void 0)=>{if(!t)return;let s=t.split(/[\[\].]/).filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return r;i=i[n]}return i},na=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(n=>n!=="");t.includes("[")&&t in e&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let o=s[n];if(!(o in i)||typeof i[o]!="object"||i[o]===null){let a=s[n+1],l=/^\d+$/.test(a);i[o]=l?[]:{}}i=i[o]}return i[s[s.length-1]]=r,e},oa=["id","class","style","slot","form","defaultValues","context","autofocus","key"],aa=(e={})=>Object.entries(e).filter(([t])=>!oa.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ge=({props:e})=>{let{form:t={}}=e,{context:r}=e;return r?Mt(t,r):t},la=({state:e,props:t})=>{let r=aa(t),s=Ge({state:e,props:t}),i=structuredClone(s.fields||[]);return i.forEach(n=>{let o=Es(e.formValues,n.name);if(["read-only-text"].includes(n.inputType)&&(n.defaultValue=o),["select"].includes(n.inputType)){let a=t?.defaultValues;a&&a[n.name]!==void 0&&(n.selectedValue=a[n.name])}if(n.inputType==="image"){let a=n.src;n.imageSrc=a&&a.trim()?a:null,n.placeholderText=n.placeholder||"No Image"}if(n.inputType==="waveform"){let a=n.waveformData;n.waveformData=a||null,n.placeholderText=n.placeholder||"No Waveform"}}),{key:t?.key,containerAttrString:r,title:s?.title||"",description:s?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,tooltipState:e.tooltipState}},pa=({state:e})=>e,ca=({state:e,props:t})=>{let r=Ge({state:e,props:t});return _s(e.formValues,r.fields.map(s=>s.name))},ua=({state:e},t)=>Es(e.formValues,t),da=({state:e},t={})=>{e.formValues=t.formValues||{}},fa=({state:e,props:t},r={})=>{let{name:s,value:i}=r;if(!s)return;na(e.formValues,s,i);let n=Ge({state:e,props:t}),o=_s(e.formValues,n.fields.map(a=>a.name));e.formValues=o},ha=({state:e},t={})=>{let{x:r,y:s,content:i}=t;e.tooltipState={open:!0,x:r,y:s,content:i}},ma=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}};var As={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleInputChange"},"value-change":{handler:"handleInputChange"},"add-option-click":{handler:"handleSelectAddOption"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}}},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:"fields"},body:{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.label && field.tooltip",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"field.label"},right:{type:1,path:"field.tooltip"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${i} 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:"i"}," 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.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${i} data-field-name=${field.name} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${i} data-field-name=${field.name} w=f rows=${field.rows} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${i} data-field-name=${field.name} label="${field.label}" data-testid=${field.testId}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" data-testid=',{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${i} data-field-name=${field.name} key=${key} w=f :options=fields[${i}].options ?no-clear=fields[${i}].noClear :addOption=fields[${i}].addOption :selectedValue=#{field.selectedValue} :placeholder=#{field.placeholder} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f :options=fields[",{type:1,path:"i"},"].options ?no-clear=fields[",{type:1,path:"i"},"].noClear :addOption=fields[",{type:1,path:"i"},"].addOption :selectedValue=#{field.selectedValue} :placeholder=#{field.placeholder} data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${i} data-field-name=${field.name} key=${key} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${i} data-field-name=${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${i} data-field-name=${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=pointer data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},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${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md data-testid=${field.testId}",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:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform${i} data-field-name=${field.name} :waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=pointer data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," :waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md data-testid=${field.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform",{type:1,path:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${i} data-field-name=${field.name} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${i} data-action-id=${button.id} data-testid=${button.testId}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"i"}," data-action-id=",{type:1,path:"button.id"}," data-testid=",{type:1,path:"button.testId"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],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 Ft={};L(Ft,{closeAll:()=>Aa,handleCancel:()=>va,handleConfirm:()=>ga,handleDialogClose:()=>ya,handleDropdownClose:()=>ba,handleDropdownItemClick:()=>wa,showAlert:()=>xa,showConfirm:()=>_a,showDropdownMenu:()=>Ea});var ya=(e,t)=>{let{store:r,render:s}=e;r.closeAll(),s()},ga=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!0)},va=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!1)},ba=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",null)},wa=(e,t)=>{let{store:r,render:s,globalUI:i}=e,n=t._event,{index:o,item:a}=n.detail;r.closeAll(),s(),i.emit("event",{index:o,item:a})},xa=(e,t)=>{let{store:r,render:s}=e,i=t;r.selectIsOpen()&&(r.closeAll(),s()),r.setAlertConfig(i),s()},_a=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(o=>{i.once("event",a=>{o(a)})})},Ea=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(o=>{i.once("event",a=>{o(a)})})},Aa=e=>{let{store:t,render:r}=e;t.selectIsOpen()&&(t.closeAll(),r())};var ks={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}};var Kt={};L(Kt,{closeAll:()=>Ia,createInitialState:()=>ka,selectConfig:()=>Oa,selectDropdownConfig:()=>Ta,selectIsOpen:()=>Ra,selectUiType:()=>La,selectViewData:()=>Na,setAlertConfig:()=>$a,setConfirmConfig:()=>Sa,setDropdownConfig:()=>Ca});var ka=()=>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"}}),$a=({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},Sa=({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},Ca=({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},Ia=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Oa=({state:e})=>e.config,Ta=({state:e})=>e.dropdownConfig,La=({state:e})=>e.uiType,Ra=({state:e})=>e.isOpen,Na=({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 $s={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 Ut={};L(Ut,{handleClickStart:()=>Va});var Va=(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 Ss={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 Ht={};L(Ht,{createInitialState:()=>Pa,selectPath:()=>Ma,selectViewData:()=>Wa,setState:()=>za});var Pa=()=>Object.freeze({}),ja=["id","class","style","slot","start"],Da=(e={})=>Object.entries(e).filter(([t])=>!ja.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ba=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}}}},Wa=({props:e})=>{let t=Ba(e.start)||e.start;return{containerAttrString:Da(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Ma=({props:e})=>e.start?.path,za=({state:e})=>{};var Cs={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 Gt={};L(Gt,{handleBeforeMount:()=>Ka});var Is=(e,t,r)=>{let{store:s,render:i}=r,n,o=-1/0;if(e.forEach(a=>{let l=a.getBoundingClientRect();l.top<=t&&l.top>o&&(o=l.top,n=a.id)}),!n){let a=1/0;e.forEach(l=>{let p=l.getBoundingClientRect();p.top>t&&p.top<a&&(a=p.top,n=l.id)})}n&&n!==s.selectCurrentId()&&(s.setCurrentId({id:n}),i())},Fa=(e,t,r,s)=>{let{store:i,render:n}=s,o=e.querySelectorAll("h1[id], h2[id], h3[id], h4[id], rtgl-text[id]"),a=Array.from(o),l=a.map(u=>{let c=1,f=u.tagName.toLowerCase();return f==="h1"?c=1:f==="h2"?c=2:f==="h3"?c=3:f==="h4"?c=4:f==="rtgl-text"&&(c=parseInt(u.getAttribute("data-level")||"1",10)),{id:u.id,href:`#${u.id}`,title:u.textContent,level:c}});i.setItems({items:l}),Is(a,r,s),n();let p=Is.bind(void 0,a,r,s);return t.addEventListener("scroll",p,{passive:!0}),()=>{t.removeEventListener("scroll",p)}},Ka=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=Fa(s,i,n,e)}),()=>{r()}};var Os={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 qt={};L(qt,{createInitialState:()=>Ua,selectCurrentId:()=>qa,selectState:()=>Ga,selectViewData:()=>Ha,setContentContainer:()=>Xa,setCurrentId:()=>Ya,setItems:()=>Ja});var Ua=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Ha=({state:e})=>{let r=((s,i)=>{let n=new Set,o=s.findIndex(l=>l.id===i);if(o===-1)return n;let a=s[o].level;for(let l=o-1;l>=0;l--)if(s[l].level<a){let p=s[l].level;n.add(s[l].id);for(let u=l-1;u>=0;u--)s[u].level<p&&(n.add(s[u].id),p=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,o=r.has(s.id),a=n||o;return{...s,c:a?"fg":"mu-fg",ml:i[s.level]||"",bc:a?"fg":"mu-fg"}}),currentId:e.currentId}},Ga=({state:e})=>e,qa=({state:e})=>e.currentId,Ja=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Ya=({state:e},t={})=>{e.currentId=t.id},Xa=({state:e},t={})=>{e.contentContainer=t.container};var Ts={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 Jt={};L(Jt,{handleBeforeMount:()=>Qa,handleInputChange:()=>rl,handleInputKeydown:()=>il,handleOnUpdate:()=>Za,handlePopoverClose:()=>tl,handleSubmitClick:()=>sl,handleTextClick:()=>el});var Qa=e=>{let{store:t,props:r}=e;r.value!==void 0&&t.setValue({value:r.value||""})},Za=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let o=s?.value??"";i.setValue({value:o})}n()},el=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,o=t._event,a=r.selectValue();r.setTempValue({value:a}),r.openPopover({position:{x:o.currentTarget.getBoundingClientRect().left,y:o.currentTarget.getBoundingClientRect().bottom}});let{input:l}=i;l.value=a,s(),n.autoFocus&&setTimeout(()=>{l.focus()},50)},tl=(e,t)=>{let{store:r,render:s}=e;r.closePopover({}),s()},rl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,o=t._event.detail.value;r.setTempValue({value:o}),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0})),s()},sl=e=>{let{store:t,render:r,dispatchEvent:s,refs:i}=e,{input:n}=i,o=n.value;t.setValue({value:o}),t.closePopover({}),s(new CustomEvent("value-change",{detail:{value:o},bubbles:!0})),r()},il=(e,t)=>{let{store:r,render:s,dispatchEvent:i,refs:n}=e,o=t._event;if(o.key==="Enter"){let{input:a}=n,l=a.value;r.closePopover({}),i(new CustomEvent("value-change",{detail:{value:l},bubbles:!0})),s()}else o.key==="Escape"&&(r.closePopover({}),s())};var Ls={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}};var Yt={};L(Yt,{closePopover:()=>pl,createInitialState:()=>nl,openPopover:()=>ll,selectValue:()=>ul,selectViewData:()=>ol,setTempValue:()=>al,setValue:()=>cl});var nl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),ol=({props:e,state:t})=>{let r=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:r,tempValue:t.tempValue,placeholder:e.placeholder??"",label:e.label}},al=({state:e},t={})=>{e.tempValue=t.value},ll=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},pl=({state:e})=>{e.isOpen=!1,e.tempValue=""},cl=({state:e},t={})=>{e.value=t.value},ul=({state:e})=>e.value;var Rs={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",value:{type:1,path:"value"}}],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=bg 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}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],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 Xt={};L(Xt,{handleAddOptionClick:()=>wl,handleAddOptionMouseEnter:()=>xl,handleAddOptionMouseLeave:()=>_l,handleBeforeMount:()=>dl,handleButtonClick:()=>hl,handleClearClick:()=>bl,handleClickOptionsPopoverOverlay:()=>ml,handleOnUpdate:()=>fl,handleOptionClick:()=>yl,handleOptionMouseEnter:()=>gl,handleOptionMouseLeave:()=>vl});var dl=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=>ue(n.value,r.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),s())}},fl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.key!==s?.key&&s?.key){i.resetSelection({});let o=s?.selectedValue,a=s?.options||[];if(o!=null&&a){let l=a.find(p=>ue(p.value,o));l&&i.updateSelectedValue({value:l.value})}n()}else r.selectedValue!==s.selectedValue&&(i.updateSelectedValue({value:s.selectedValue}),n())},hl=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e;t._event.stopPropagation();let a=i.selectButton,l=a.firstElementChild,p=l?l.getBoundingClientRect():a.getBoundingClientRect(),u=r.selectSelectedValue(),c=u!==null?u:n.selectedValue,f=null;c!=null&&n.options&&(f=n.options.findIndex(h=>ue(h.value,c)),f===-1&&(f=null)),r.openOptionsPopover({position:{y:p.bottom+12,x:p.left-24},selectedIndex:f}),s()},ml=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},yl=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=e,o=t._event;o.stopPropagation();let a=o.currentTarget.id.slice(6),l=Number(a),p=i.options[a];n.updateSelectedValue({value:p?.value}),i.onChange&&typeof i.onChange=="function"&&i.onChange(p.value),s(new CustomEvent("value-change",{detail:{value:p.value,label:p.label,index:l,item:p},bubbles:!0})),r()},gl=(e,t)=>{let{store:r,render:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),s()},vl=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption({}),s()},bl=(e,t)=>{let{store:r,render:s,dispatchEvent:i,props:n}=e;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()},wl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),s()},xl=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!0}),s()},_l=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!1}),s()};var Ns={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"}}},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}};var Qt={};L(Qt,{clearHoveredOption:()=>Nl,clearSelectedValue:()=>Vl,closeOptionsPopover:()=>Ol,createInitialState:()=>kl,openOptionsPopover:()=>Il,resetSelection:()=>Ll,selectSelectedValue:()=>Cl,selectState:()=>Sl,selectViewData:()=>$l,setHoveredAddOption:()=>Pl,setHoveredOption:()=>Rl,updateSelectedValue:()=>Tl});var El=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption"],Al=(e={})=>Object.entries(e).filter(([t])=>!El.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),kl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),$l=({state:e,props:t})=>{let r=Al(t),s=e.selectedValue!==null?e.selectedValue:t.selectedValue,i=t.placeholder||"Select an option",n=!0,o=t.options||[],a=o.find(p=>ue(p.value,s));a&&(i=a.label,n=!1);let l=o.map((p,u)=>{let c=ue(p.value,s),f=e.hoveredOptionId===u;return{...p,isSelected:c,bgc:f?"ac":c?"mu":""}});return{containerAttrString:r,isOpen:e.isOpen,position:e.position,options:l,selectedValue:s,selectedLabel:i,selectedLabelColor:n?"mu-fg":"fg",hasValue:s!=null,showClear:!t.noClear&&s!=null,showAddOption:!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Sl=({state:e})=>e,Cl=({state:e})=>e.selectedValue,Il=({state:e},t={})=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Ol=({state:e})=>{e.isOpen=!1},Tl=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Ll=({state:e})=>{e.selectedValue=void 0},Rl=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Nl=({state:e})=>{e.hoveredOptionId=null},Vl=({state:e})=>{e.selectedValue=void 0},Pl=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered};var Vs={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} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg 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"},' 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",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 Zt={};L(Zt,{handleHeaderClick:()=>jl,handleItemClick:()=>Dl});var jl=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n,o=r.selectHeader();i.currentTarget.id==="headerLabel"?n=o.labelPath:i.currentTarget.id==="headerImage"?n=o.image.path:i.currentTarget.id==="header"&&(n=o.path),s(new CustomEvent("header-click",{detail:{path:n},bubbles:!0,composed:!0}))},Dl=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.itemId||i.currentTarget.id.slice(4),o=r.selectItem(n);s(new CustomEvent("item-click",{detail:{item:o},bubbles:!0,composed:!0}))};var Ps={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 tr={};L(tr,{createInitialState:()=>Bl,selectActiveItem:()=>Hl,selectHeader:()=>Ul,selectItem:()=>Gl,selectViewData:()=>Kl,setState:()=>ql});var Bl=()=>Object.freeze({}),Wl=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],Ml=(e={})=>Object.entries(e).filter(([t])=>!Wl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Pe=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}}}},zl=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},Fl=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function er(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 o of s.items){let a=o.id||o.href||o.path,l=t===a;r.push({id:a,title:o.title,href:o.href,type:o.type||"item",icon:o.icon,hrefAttr:o.href?`href=${o.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Kl=({props:e})=>{let t=Pe(e.header)||e.header,r=Pe(e.items)||e.items,s=e.selectedItemId,i=Ml(e),n=e.mode||"full",o=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},a=r?er(r,s):[],l=!zl(e.hideHeader),p=e.bwr||"xs",u=Fl(e.w,n),c=n==="full"?"fs":"c",f=n==="full"?"fs":"c",h=n==="full"?"lg":"sm",d=n==="full"?"md":"sm",m=n==="shrunk-lg"?48:40,g=n==="shrunk-lg"?28:20,y=n==="shrunk-lg"?"md":"sm",w=n==="full",x=n==="full",_=n==="full"?"fs":"c",E=n==="full"?"":`ah=${f}`,A=n==="full"?"f":m;return{containerAttrString:i,mode:n,header:o,items:a,sidebarWidth:u,headerAlign:c,itemAlign:f,headerPadding:h,itemPadding:d,itemHeight:m,iconSize:g,firstLetterSize:y,showLabels:w,showGroupLabels:x,itemContentAlign:_,itemAlignAttr:E,itemWidth:A,headerWidth:A,selectedItemId:s,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",showHeader:l,rightBorderWidth:p}},Ul=({props:e})=>Pe(e.header)||e.header,Hl=({state:e,props:t})=>{let r=Pe(t.items)||t.items;return(r?er(r):[]).find(i=>i.active)},Gl=({props:e},t)=>{let r=Pe(e.items)||e.items;return(r?er(r):[]).find(i=>i.id===t)},ql=({state:e})=>{};var js={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 rr={};L(rr,{handleBeforeMount:()=>Jl,handleOnUpdate:()=>Yl,handleValueChange:()=>Xl,handleValueInput:()=>Ql});var Jl=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Yl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let o=s?.value??0;i.setValue({value:o}),n()}},Xl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value);r.setValue({value:o}),s(),i(new CustomEvent("value-change",{detail:{value:o},bubbles:!0}))},Ql=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,o=Number(n.detail.value);r.setValue({value:o}),s(),i(new CustomEvent("value-input",{detail:{value:o},bubbles:!0}))};var Ds={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"}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}};var sr={};L(sr,{createInitialState:()=>Zl,selectViewData:()=>ep,setValue:()=>tp});var Zl=()=>Object.freeze({value:0}),ep=({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}),tp=({state:e},t={})=>{e.value=t.value};var Bs={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}",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"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input key=",{type:1,path:"key"}," w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],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 ir={};L(ir,{handleBeforeMount:()=>rp,handleHeaderClick:()=>ip,handleRowClick:()=>sp});var rp=e=>{},sp=(e,t)=>{let{dispatchEvent:r,props:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(3),10),o=s.data?.rows?.[n];o&&r(new CustomEvent("row-click",{detail:{rowIndex:n,rowData:o}}))},ip=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,o=t._event.currentTarget.dataset.columnKey,a=r.selectSortInfo(),l="asc";a.column===o&&(a.direction==="asc"?l="desc":a.direction==="desc"&&(l=null)),l?r.setSortColumn({column:o,direction:l}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:o,direction:l,sortInfo:l?{column:o,direction:l}:null}}))};var Ws={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 nr={};L(nr,{clearSort:()=>fp,createInitialState:()=>np,selectSortInfo:()=>up,selectState:()=>cp,selectViewData:()=>pp,setSortColumn:()=>dp});var np=()=>Object.freeze({sortColumn:null,sortDirection:null}),op=["id","class","style","slot","data"],ap=(e={})=>Object.entries(e).filter(([t])=>!op.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),lp=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},pp=({state:e,props:t})=>{let r=ap(t),s=t.data||{columns:[],rows:[]},i=s.rows.map((n,o)=>{let a=s.columns.map(l=>{let p=lp(n,l.key);return{key:l.key,value:p!=null?String(p):""}});return{index:o,cells:a}});return{containerAttrString:r,columns:s.columns||[],rows:i||[]}},cp=({state:e})=>e,up=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),dp=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},fp=({state:e})=>{e.sortColumn=null,e.sortDirection=null};var Ms={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 or={};L(or,{handleClickItem:()=>hp});var hp=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))};var zs={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 ar={};L(ar,{createInitialState:()=>mp,selectViewData:()=>vp});var mp=()=>Object.freeze({}),yp=["id","class","style","slot","items","selectedTab"],gp=(e={})=>Object.entries(e).filter(([t])=>!yp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),vp=({props:e})=>{let t=gp(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 Fs={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 Ks={};var Us={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var lr={};L(lr,{createInitialState:()=>bp,selectViewData:()=>wp});var bp=()=>Object.freeze({}),wp=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""});var Hs={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 pr={};L(pr,{handleAfterMount:()=>xp,handleOnUpdate:()=>_p});var xp=async e=>{let{props:t,store:r,render:s,refs:i}=e,{waveformData:n}=t;r.setWaveformData({data:n}),s();let o=i.canvas;o&&Gs(n,o)},_p=async(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,{waveformData:o}=n;if(!o){console.log("waveform handleOnUpdate: no waveformData provided");return}r.setWaveformData({data:o}),s();let a=i.canvas;a&&Gs(o,a)};async function Gs(e,t){let r=t.getContext("2d"),s=t.getBoundingClientRect(),i=s.width,n=s.height;t.width=i,t.height=n;let o=t.width,a=t.height;if(r.clearRect(0,0,o,a),r.fillStyle="#1a1a1a",r.fillRect(0,0,o,a),!e||!e.amplitudes)return;let l=e.amplitudes,p=a/2,u=r.createLinearGradient(0,0,0,a);u.addColorStop(0,"#404040"),u.addColorStop(.5,"#A1A1A1"),u.addColorStop(1,"#404040");let c=Math.max(1,o/l.length),f=.2;for(let h=0;h<l.length;h++){let m=l[h]/255*(a*.85),g=h*c,y=p-m/2;r.fillStyle=u,r.fillRect(g,y,Math.max(1,c*(1-f)),m)}r.strokeStyle="rgba(255, 255, 255, 0.1)",r.lineWidth=1,r.beginPath(),r.moveTo(0,p),r.lineTo(o,p),r.stroke(),r.shadowBlur=10,r.shadowColor="#2196F3"}var qs={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 cr={};L(cr,{createInitialState:()=>Ep,selectViewData:()=>kp,setWaveformData:()=>Ap});var Ep=()=>Object.freeze({waveformData:null}),Ap=({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});var Js={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 ur=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Je=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),qe=e=>{if(e!=null)return e===""?!0:e},Ys=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return qe(r);let s=ur(t);if(s!==t){let i=e.getAttribute(s);if(i!==null)return qe(i)}},Xs=(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:Ys(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:Ys(e,i)}}}})};var Qs=({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 b={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},P={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},je={NOT:0};var B=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Ae=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var dr=e=>{if(!e||e.trim()==="")throw new B("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new B(`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 B(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Zs=e=>{if(e.trim().endsWith(" in"))throw new B(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new B(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new B(`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 B(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new B(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var ei=(e,t)=>{if(t===null)return new Ae(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Ae(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new Ae(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},ti=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Ae(`Unknown function '${e}' (${r})`)};var $p=(e,t,r={})=>T(e,r,t,{}),T=(e,t,r,s)=>{if(e.var&&!e.type)return F(e.var,r,s);if(e.type===b.LITERAL)return e.value;if(e.type===b.VARIABLE)return F(e.path,r,s);if(e.type===b.INTERPOLATION)return Sp(e.parts,t,r,s);switch(e.type){case b.FUNCTION:return ri(e,t,r,s);case b.BINARY:return si(e,t,r,s);case b.UNARY:return ii(e,t,r,s);case b.CONDITIONAL:return Ip(e,t,r,s);case b.LOOP:return Np(e,t,r,s);case b.OBJECT:return Pp(e,t,r,s);case b.ARRAY:return jp(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},fe=new Map,F=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=fe.get(e);s||(s=e.split("."),fe.set(e,s));let i=t;for(let n=0;n<s.length;n++){let o=s[n];if(o in r){i=r[o];continue}if(i==null)return;i=i[o]}return i},Sp=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let o=T(n,t,r,s);i.push(o!=null?String(o):"")}return i.join("")},ri=(e,t,r,s)=>{let i=t[e.name];if(!i)throw ti(e.name,t);let n=e.args.map(o=>T(o,t,r,s));return i(...n)},Ye=(e,t,r,s)=>{if(e.var&&!e.type)return F(e.var,r,s);switch(e.type){case b.VARIABLE:return F(e.path,r,s);case b.LITERAL:return e.value;case b.BINARY:return si(e,t,r,s);case b.UNARY:return ii(e,t,r,s);case b.FUNCTION:return ri(e,t,r,s);default:return T(e,t,r,s)}},si=(e,t,r,s)=>{if(e.op===P.AND||e.op===P.OR){let o=Ye(e.left,t,r,s),a=Ye(e.right,t,r,s);switch(e.op){case P.AND:return o&&a;case P.OR:return o||a}}let i=T(e.left,t,r,s),n=T(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;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ii=(e,t,r,s)=>{let i=e.op===je.NOT?Ye(e.operand,t,r,s):T(e.operand,t,r,s);switch(e.op){case je.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Cp=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===b.VARIABLE)if(F(i.path,r,s)){let o=e.bodies[0];if(o.type===b.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?T(l.parsedKey,t,r,s):l.key,u=l.value;if(u.type===b.LITERAL)a[p]=u.value;else if(u.type===b.VARIABLE)a[p]=F(u.path,r,s);else if(u.type===b.INTERPOLATION){let c=[];for(let f of u.parts)if(typeof f=="string")c.push(f);else if(f.type===b.VARIABLE){let h=F(f.path,r,s);c.push(h!=null?String(h):"")}else{let h=T(f,t,r,s);c.push(h!=null?String(h):"")}a[p]=c.join("")}else a[p]=T(u,t,r,s)}return a}}else{let o=e.bodies[1];if(o.type===b.OBJECT&&o.properties.length<=5){let a={};for(let l of o.properties){let p=l.parsedKey?T(l.parsedKey,t,r,s):l.key,u=l.value;if(u.type===b.LITERAL)a[p]=u.value;else if(u.type===b.VARIABLE)a[p]=F(u.path,r,s);else if(u.type===b.INTERPOLATION){let c=[];for(let f of u.parts)if(typeof f=="string")c.push(f);else if(f.type===b.VARIABLE){let h=F(f.path,r,s);c.push(h!=null?String(h):"")}else{let h=T(f,t,r,s);c.push(h!=null?String(h):"")}a[p]=c.join("")}else a[p]=T(u,t,r,s)}return a}}}return null},Ip=(e,t,r,s)=>{let i=Cp(e,t,r,s);if(i!==null)return i;for(let n=0;n<e.conditions.length;n++){let o=e.conditions[n];if(o===null||Ye(o,t,r,s))return T(e.bodies[n],t,r,s)}return ni},Op=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===b.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===b.VARIABLE){let i=r.conditions[0].path,n=r.bodies[0];if(i.startsWith(s+".")){let o=i.substring(s.length+1);if(n.type===b.OBJECT&&n.properties.length<=5){for(let l of n.properties)if(l.parsedKey)return null;let a=[];for(let l=0;l<t.length;l++){let p=t[l];if(p[o]){let u={};for(let c of n.properties){let f=c.key,h=c.value;if(h.type===b.LITERAL)u[f]=h.value;else if(h.type===b.VARIABLE){let d=h.path;if(d===s)u[f]=p;else if(d.startsWith(s+".")){let m=d.substring(s.length+1);u[f]=p[m]}else return null}else if(h.type===b.INTERPOLATION){let d=[],m=!0;for(let g of h.parts)if(typeof g=="string")d.push(g);else if(g.type===b.VARIABLE){let y=g.path;if(y===s)d.push(p!=null?String(p):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),x=p[w];d.push(x!=null?String(x):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;u[f]=d.join("")}else return null}a.push(u)}}return a}}}return null},Tp=(e,t)=>{let r=e.body,s=e.itemVar,i=Op(e,t);if(i!==null)return i;if(r.type===b.OBJECT&&r.properties.length<=5){for(let a of r.properties)if(a.parsedKey)return null;let n=[],o=!0;for(let a of r.properties){let l=a.key,p=a.value;if(p.type===b.LITERAL)n.push({key:l,type:"literal",value:p.value});else if(p.type===b.VARIABLE){let u=p.path;if(u===s)n.push({key:l,type:"item"});else if(u.startsWith(s+".")){let c=u.substring(s.length+1);if(!c.includes("."))n.push({key:l,type:"prop",prop:c});else{o=!1;break}}else{o=!1;break}}else if(p.type===b.INTERPOLATION&&p.parts.length===1){let u=p.parts[0];if(u.type===b.VARIABLE){let c=u.path;if(c===s)n.push({key:l,type:"item_string"});else if(c.startsWith(s+".")){let f=c.substring(s.length+1);if(!f.includes("."))n.push({key:l,type:"prop_string",prop:f});else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}else{o=!1;break}}if(o){let a=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 p=t[l];a[l]={id:p.id,title:p.title!=null?String(p.title):"",completed:p.completed}}else for(let l=0;l<t.length;l++){let p=t[l],u={};for(let c of n)if(c.type==="literal")u[c.key]=c.value;else if(c.type==="item")u[c.key]=p;else if(c.type==="prop")u[c.key]=p[c.prop];else if(c.type==="item_string")u[c.key]=p!=null?String(p):"";else if(c.type==="prop_string"){let f=p[c.prop];u[c.key]=f!=null?String(f):""}a[l]=u}return a}}return null},Lp=(e,t,r,s,i)=>{let n=[],o=e.body;if(o.type===b.OBJECT&&o.fast!==!1){let a=e.itemVar,l=e.indexVar;for(let p=0;p<i.length;p++){let u=i[p],c={},f={...s,[a]:u,...l&&{[l]:p}};for(let h of o.properties){let d=h.parsedKey?T(h.parsedKey,t,r,f):h.key,m=h.value;if(m.type===b.LITERAL)c[d]=m.value;else if(m.type===b.VARIABLE){let g=m.path;if(g===a)c[d]=u;else if(g===l)c[d]=p;else if(g.startsWith(a+".")){let y=g.substring(a.length+1);if(!y.includes("."))c[d]=u[y];else{let w=fe.get(y)||(fe.set(y,y.split(".")),fe.get(y)),x=u;for(let _ of w){if(x==null){x=void 0;break}x=x[_]}c[d]=x}}else c[d]=F(g,r,{...s,[a]:u,...l&&{[l]:p}})}else if(m.type===b.INTERPOLATION){let g=[];for(let y of m.parts)if(typeof y=="string")g.push(y);else if(y.type===b.VARIABLE){let w=y.path,x;if(w===a)x=u;else if(w===l)x=p;else if(w.startsWith(a+".")){let _=w.substring(a.length+1);if(!_.includes("."))x=u[_];else{let E=fe.get(_)||(fe.set(_,_.split(".")),fe.get(_)),A=u;for(let C of E){if(A==null){A=void 0;break}A=A[C]}x=A}}else x=F(w,r,{...s,[a]:u,...l&&{[l]:p}});g.push(x!=null?String(x):"")}else{let w={...s,[a]:u,...l&&{[l]:p}},x=T(y,t,r,w);g.push(x!=null?String(x):"")}c[d]=g.join("")}else{let g={...s,[a]:u,...l&&{[l]:p}};c[d]=T(m,t,r,g)}}n.push(c)}return n}return null},Rp=(e,t,r)=>{let s=e.body;if(s.type===b.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===b.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===b.VARIABLE&&n.conditions[0].path==="item.visible"){let o=n.bodies[0];if(o.type===b.OBJECT&&o.properties.length===2){let a=o.properties[0],l=o.properties[1];if(a.key==="id"&&a.value.type===b.VARIABLE&&a.value.path==="item.id"&&l.key==="$if item.highlighted"&&l.value.type===b.CONDITIONAL){let p=[];for(let u=0;u<t.length;u++){let c=t[u];if(c.visible){let f={id:c.id};c.highlighted?(f.highlight=!0,f.message=`This item is highlighted: ${c.name}`):(f.highlight=!1,f.message=c.name),p.push(f)}}return p}}}}return null},Np=(e,t,r,s)=>{let i=T(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw ei(a,i)}if(!e.indexVar){let a=Rp(e,i,e.itemVar);if(a!==null)return a}if(!e.indexVar){let a=Tp(e,i);if(a!==null)return a}let n=Lp(e,t,r,s,i);if(n!==null)return n;let o=[];for(let a=0;a<i.length;a++){let l=e.indexVar?{...s,[e.itemVar]:i[a],[e.indexVar]:a}:{...s,[e.itemVar]:i[a]},p=T(e.body,t,r,l);Array.isArray(p)&&p.length===1?o.push(p[0]):o.push(p)}return o},Vp=(e,t,r,s)=>{if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?T(i.parsedKey,t,r,s):i.key,o=i.value;if(o.type===b.OBJECT&&o.properties.length<=10){let a={},l={},p=!0;for(let u of o.properties){let c=u.parsedKey?T(u.parsedKey,t,r,s):u.key,f=u.value;if(f.type===b.LITERAL)l[c]=f.value;else if(f.type===b.VARIABLE)l[c]=F(f.path,r,s);else if(f.type===b.INTERPOLATION){let h=[];for(let d of f.parts)if(typeof d=="string")h.push(d);else if(d.type===b.VARIABLE){let m=F(d.path,r,s);h.push(m!=null?String(m):"")}else{p=!1;break}if(!p)break;l[c]=h.join("")}else if(f.type===b.OBJECT&&f.properties.length<=5){let h={};for(let d of f.properties){let m=d.key,g=d.value;if(g.type===b.LITERAL)h[m]=g.value;else if(g.type===b.VARIABLE)h[m]=F(g.path,r,s);else if(g.type===b.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===b.VARIABLE){let x=F(w.path,r,s);y.push(x!=null?String(x):"")}else{p=!1;break}if(!p)break;h[m]=y.join("")}else{p=!1;break}}if(!p)break;l[c]=h}else{p=!1;break}}if(p)return a[n]=l,a}}return null},Pp=(e,t,r,s)=>{let i=Vp(e,t,r,s);if(i!==null)return i;if(e.fast){let l={};for(let p of e.properties){let u=p.parsedKey?T(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===b.LITERAL)l[u]=c.value;else if(c.type===b.VARIABLE)l[u]=F(c.path,r,s);else if(c.type===b.INTERPOLATION){let f=[];for(let h of c.parts)if(typeof h=="string")f.push(h);else if(h.type===b.VARIABLE){let d=F(h.path,r,s);f.push(d!=null?String(d):"")}else{let d=T(h,t,r,s);f.push(d!=null?String(d):"")}l[u]=f.join("")}else l[u]=T(c,t,r,s)}return l}let n={},o=null,a=!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 ")){a=!0;break}for(let l of e.properties)if(l.key.startsWith("$if ")||l.key.match(/^\$if\s+\w+.*:?$/)){let p=T(l.value,t,r,s);if(!a&&p!==null&&p!==void 0)return Array.isArray(p)&&p.length===1?p[0]:p;typeof p=="object"&&p!==null&&!Array.isArray(p)&&Object.assign(n,p)}else if(!l.key.startsWith("$for ")){let p=l.value;if(p&&p.type===b.OBJECT&&p.properties){let u=p.properties.find(c=>c.key.startsWith("$for "));if(u){let c=T(u.value,t,r,s);c!==void 0&&(n[l.key]=c)}else{let c=T(l.value,t,r,s);c!==void 0&&(n[l.key]=c)}}else{let u=l.parsedKey?T(l.parsedKey,t,r,s):l.key,c=T(l.value,t,r,s);c!==void 0&&(n[u]=c)}}return n},ni={},jp=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===b.LOOP){let o=T(n,t,r,s);i.push(o)}else{let o=T(n,t,r,s);o!==ni&&i.push(o)}return i},De=$p;var Dp=/\$\{([^}]*)\}/g,ai=e=>{let t=e.match(/^(\w+)\((.*)\)$/);if(!t)return{isFunction:!1};let[,r,s]=t,i=Bp(s);return{isFunction:!0,type:b.FUNCTION,name:r,args:i}},Bp=e=>e.trim()?Wp(e).map(r=>Mp(r.trim())):[],Wp=e=>{let t=[],r="",s=0,i=!1,n="";for(let o=0;o<e.length;o++){let a=e[o],l=o>0?e[o-1]:"";!i&&(a==='"'||a==="'")?(i=!0,n=a,r+=a):i&&a===n&&l!=="\\"?(i=!1,n="",r+=a):!i&&a==="("?(s++,r+=a):!i&&a===")"?(s--,r+=a):!i&&a===","&&s===0?(t.push(r),r=""):r+=a}return r&&t.push(r),t},Mp=e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:b.LITERAL,value:parseFloat(e)};if(e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};let t=ai(e);return t.isFunction?{type:t.type,name:t.name,args:t.args}:{type:b.VARIABLE,path:e}},zp=/^\w+\(.*\)$/,Fp=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Kp=e=>{if(!(!e||e.trim()===""||zp.test(e))&&Fp.test(e))throw e.includes("?")&&e.includes(":")?new B(`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 B(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new B(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},oi=(e,t={})=>{let r=e.trim();Kp(r);let s=ai(r);return s.isFunction?{type:s.type,name:s.name,args:s.args}:{type:b.VARIABLE,path:r}},fr=(e,t={})=>{let r=e,s=[];e.includes("\\${")&&(r=e.replace(/\\\\(\$\{[^}]*\})/g,"\\DOUBLE_ESC$1"),r=r.replace(/\\(\$\{[^}]*\})/g,(a,l)=>{let p=`__ESCAPED_${s.length}__`;return s.push(l),p}),r=r.replace(/\\DOUBLE_ESC/g,"\\"));let i=[...r.matchAll(Dp)];if(i.length===0){let a=r;for(let l=0;l<s.length;l++)a=a.replace(`__ESCAPED_${l}__`,s[l]);return{type:b.LITERAL,value:a}}if(i.length===1&&i[0][0]===r&&s.length===0)return oi(i[0][1],t);let n=[],o=0;for(let a of i){let[l,p]=a,u=a.index;if(u>o){let f=r.substring(o,u);for(let h=0;h<s.length;h++)f=f.replace(`__ESCAPED_${h}__`,s[h]);f&&n.push(f)}let c=oi(p.trim(),t);n.push(c),o=u+l.length}if(o<r.length){let a=r.substring(o);for(let l=0;l<s.length;l++)a=a.replace(`__ESCAPED_${l}__`,s[l]);a&&n.push(a)}return{type:b.INTERPOLATION,parts:n}};var ge=(e,t)=>typeof e=="string"?fr(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Up(e,t):Hp(e,t):{type:b.LITERAL,value:e},Up=(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 a=Object.keys(n);if(a.length===1&&a[0].startsWith("$for ")){let l=li(a[0],n[a[0]],t);r.push(l),s=!0;continue}}let o=ge(n,t);r.push(o),(o.type===b.FUNCTION||o.type===b.CONDITIONAL||o.type===b.LOOP||o.type===b.OBJECT&&!o.fast||o.type===b.ARRAY&&!o.fast)&&(s=!0)}return{type:b.ARRAY,items:r,fast:!s}},Hp=(e,t)=>{let r=[],s=!1,i=Object.entries(e),n=0;for(;n<i.length;){let[o,a]=i[n];if(o.startsWith("$if ")||o.match(/^\$if#\w+\s/)||o.match(/^\$if\s+\w+.*:$/)){let l=Gp(i,n,t);r.push({key:o,value:l.node}),s=!0,n=l.nextIndex}else if(o.startsWith("$for ")){let l=li(o,a,t);r.push({key:o,value:l}),s=!0,n++}else{if(o.startsWith("$elif ")||o.startsWith("$else"))throw new B(`'${o.split(" ")[0]}' without matching '$if'`);if(o==="$if"||o==="$if:")throw new B("Missing condition expression after '$if'");{let l=ge(a,t);(l.type===b.FUNCTION||l.type===b.CONDITIONAL||l.type===b.LOOP||l.type===b.OBJECT&&!l.fast||l.type===b.ARRAY&&!l.fast)&&(s=!0);let p=fr(o,t),u={key:o,value:l};(p.type!==b.LITERAL||p.value!==o)&&(u.parsedKey=p),r.push(u),n++}}}return{type:b.OBJECT,properties:r,fast:!s}},Gp=(e,t,r={})=>{let s=[],i=[],n=t,[o,a]=e[n],l=null,p;if(o.startsWith("$if#")){let c=o.match(/^\$if#(\w+)\s+(.+)$/);if(c)l=c[1],p=c[2];else throw new B(`Invalid conditional syntax: ${o}`)}else p=o.substring(4),p.endsWith(":")&&(p=p.slice(0,-1).trim());dr(p);let u=ne(p);for(s.push(u),i.push(ge(a,r)),n++;n<e.length;){let[c,f]=e[n],h=!1,d;if(l?c.startsWith(`$elif#${l} `)?(d=c.substring(`$elif#${l} `.length),d.endsWith(":")&&(d=d.slice(0,-1).trim()),h=!0):(c===`$else#${l}`||c===`$else#${l}:`)&&(h=!0,d=null):c.startsWith("$elif ")?(d=c.substring(6),d.endsWith(":")&&(d=d.slice(0,-1).trim()),h=!0):(c==="$else"||c==="$else:")&&(h=!0,d=null),h){if(d===null)s.push(null);else{dr(d);let m=ne(d);s.push(m)}if(i.push(ge(f,r)),n++,d===null)break}else break}return{node:{type:b.CONDITIONAL,conditions:s,bodies:i,id:l},nextIndex:n}},ne=e=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")"))return ne(e.slice(1,-1));let t=Xe(e,"||");if(t!==-1)return{type:b.BINARY,op:P.OR,left:ne(e.substring(0,t).trim()),right:ne(e.substring(t+2).trim())};let r=Xe(e,"&&");if(r!==-1)return{type:b.BINARY,op:P.AND,left:ne(e.substring(0,r).trim()),right:ne(e.substring(r+2).trim())};let s=[{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:n,type:o}of s){let a=Xe(e,n);if(a!==-1)return{type:b.BINARY,op:o,left:ne(e.substring(0,a).trim()),right:ne(e.substring(a+n.length).trim())}}let i=[" + "," - "," * "," / "," % "];for(let n of i)if(Xe(e,n)!==-1)throw new B(`Arithmetic expressions not supported in conditionals - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`);return e.startsWith("!")?{type:b.UNARY,op:je.NOT,operand:ne(e.substring(1).trim())}:qp(e)},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},qp=e=>{if(e=e.trim(),e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:b.LITERAL,value:""};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:b.LITERAL,value:t}:{type:b.VARIABLE,path:e}},li=(e,t,r)=>{let s=e.substring(5).trim();Zs(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new B(`Invalid loop syntax - missing 'in' keyword (got: '$for ${s}')`);let n=i[1].trim(),o=i[2].trim(),a,l=null;if(n.includes(",")){let c=n.split(",").map(f=>f.trim());if(c.length!==2)throw new B(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);a=c[0],l=c[1]}else a=n;let p={type:b.VARIABLE,path:o},u=ge(t,r);return{type:b.LOOP,itemVar:a,indexVar:l,iterable:p,body:u}};var Jp=(e,t={})=>{let{functions:r={}}=t;return ge(e,r)},hr=Jp;var mr={};L(mr,{now:()=>Yp});var Yp=()=>Date.now();var Xp=(e,t,r={})=>{let{functions:s={}}=r,i={...mr,...s},n=hr(e,{functions:i});return De(n,t,i)},Be=Xp;var he=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);var pi=(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(!he(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return s.call(e,n)}})}})};var mi=Symbol.for("immer-nothing"),ci=Symbol.for("immer-draftable"),te=Symbol.for("immer-state");function ie(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ke=Object.getPrototypeOf;function $e(e){return!!e&&!!e[te]}function be(e){return e?yi(e)||Array.isArray(e)||!!e[ci]||!!e.constructor?.[ci]||rt(e)||st(e):!1}var Qp=Object.prototype.constructor.toString();function yi(e){if(!e||typeof e!="object")return!1;let t=ke(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)===Qp}function Qe(e,t){tt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function tt(e){let t=e[te];return t?t.type_:Array.isArray(e)?1:rt(e)?2:st(e)?3:0}function vr(e,t){return tt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function gi(e,t,r){let s=tt(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Zp(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function rt(e){return e instanceof Map}function st(e){return e instanceof Set}function ve(e){return e.copy_||e.base_}function br(e,t){if(rt(e))return new Map(e);if(st(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=yi(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[te];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let o=i[n],a=s[o];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(s[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(ke(e),s)}else{let s=ke(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function Ar(e,t=!1){return it(e)||$e(e)||!be(e)||(tt(e)>1&&(e.set=e.add=e.clear=e.delete=ec),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>Ar(s,!0))),e}function ec(){ie(2)}function it(e){return Object.isFrozen(e)}var tc={};function we(e){let t=tc[e];return t||ie(0,e),t}var We;function vi(){return We}function rc(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ui(e,t){t&&(we("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wr(e){xr(e),e.drafts_.forEach(sc),e.drafts_=null}function xr(e){e===We&&(We=e.parent_)}function di(e){return We=rc(We,e)}function sc(e){let t=e[te];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[te].modified_&&(wr(t),ie(4)),be(e)&&(e=Ze(t,e),t.parent_||et(t,e)),t.patches_&&we("Patches").generateReplacementPatches_(r[te].base_,e,t.patches_,t.inversePatches_)):e=Ze(t,r,[]),wr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==mi?e:void 0}function Ze(e,t,r){if(it(t))return t;let s=t[te];if(!s)return Qe(t,(i,n)=>hi(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return et(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;let i=s.copy_,n=i,o=!1;s.type_===3&&(n=new Set(i),i.clear(),o=!0),Qe(n,(a,l)=>hi(e,s,i,a,l,r,o)),et(e,i,!1),r&&e.patches_&&we("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function hi(e,t,r,s,i,n,o){if($e(i)){let a=n&&t&&t.type_!==3&&!vr(t.assigned_,s)?n.concat(s):void 0,l=Ze(e,i,a);if(gi(r,s,l),$e(l))e.canAutoFreeze_=!1;else return}else o&&r.add(i);if(be(i)&&!it(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Ze(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&et(e,i)}}function et(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ar(t,r)}function ic(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:vi(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=kr;r&&(i=[s],n=Me);let{revoke:o,proxy:a}=Proxy.revocable(i,n);return s.draft_=a,s.revoke_=o,a}var kr={get(e,t){if(t===te)return e;let r=ve(e);if(!vr(r,t))return nc(e,r,t);let s=r[t];return e.finalized_||!be(s)?s:s===yr(e.base_,t)?(gr(e),e.copy_[t]=Er(s,e)):s},has(e,t){return t in ve(e)},ownKeys(e){return Reflect.ownKeys(ve(e))},set(e,t,r){let s=bi(ve(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=yr(ve(e),t),n=i?.[te];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Zp(r,i)&&(r!==void 0||vr(e.base_,t)))return!0;gr(e),_r(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 yr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gr(e),_r(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=ve(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){ie(11)},getPrototypeOf(e){return ke(e.base_)},setPrototypeOf(){ie(12)}},Me={};Qe(kr,(e,t)=>{Me[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Me.deleteProperty=function(e,t){return Me.set.call(this,e,t,void 0)};Me.set=function(e,t,r){return kr.set.call(this,e[0],t,r,e[0])};function yr(e,t){let r=e[te];return(r?ve(r):e)[t]}function nc(e,t,r){let s=bi(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function bi(e,t){if(!(t in e))return;let r=ke(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ke(r)}}function _r(e){e.modified_||(e.modified_=!0,e.parent_&&_r(e.parent_))}function gr(e){e.copy_||(e.copy_=br(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var oc=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 o=this;return function(l=n,...p){return o.produce(l,u=>r.call(this,u,...p))}}typeof r!="function"&&ie(6),s!==void 0&&typeof s!="function"&&ie(7);let i;if(be(t)){let n=di(this),o=Er(t,void 0),a=!0;try{i=r(o),a=!1}finally{a?wr(n):xr(n)}return ui(n,s),fi(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===mi&&(i=void 0),this.autoFreeze_&&Ar(i,!0),s){let n=[],o=[];we("Patches").generateReplacementPatches_(t,i,n,o),s(n,o)}return i}else ie(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(o,...a)=>this.produceWithPatches(o,l=>t(l,...a));let s,i;return[this.produce(t,r,(o,a)=>{s=o,i=a}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){be(e)||ie(8),$e(e)&&(e=ac(e));let t=di(this),r=Er(e,void 0);return r[te].isManual_=!0,xr(t),r}finishDraft(e,t){let r=e&&e[te];(!r||!r.isManual_)&&ie(9);let{scope_:s}=r;return ui(s,t),fi(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=we("Patches").applyPatches_;return $e(e)?s(e,t):this.produce(e,i=>s(i,t))}};function Er(e,t){let r=rt(e)?we("MapSet").proxyMap_(e,t):st(e)?we("MapSet").proxySet_(e,t):ic(e,t);return(t?t.scope_:vi()).drafts_.push(r),r}function ac(e){return $e(e)||ie(10,e),wi(e)}function wi(e){if(!be(e)||it(e))return e;let t=e[te],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=br(e,t.scope_.immer_.useStrictShallowCopy_)}else r=br(e,!0);return Qe(r,(s,i)=>{gi(r,s,wi(i))}),t&&(t.finalized_=!1),r}var re=new oc,xi=re.produce,ch=re.produceWithPatches.bind(re),uh=re.setAutoFreeze.bind(re),dh=re.setUseStrictShallowCopy.bind(re),fh=re.applyPatches.bind(re),hh=re.createDraft.bind(re),mh=re.finishDraft.bind(re);var _i=(e,t,r)=>{let{createInitialState:s,...i}=e,n={},o={},a={};return s&&(a=s({props:t,constants:r})),Object.entries(i).forEach(([l,p])=>{if(l.startsWith("select")){n[l]=(...u)=>p({state:a,props:t,constants:r},...u);return}o[l]=(u={})=>{let c=u===void 0?{}:u;if(!he(c))throw new Error(`[Store] Action '${l}' expects payload to be an object.`);return a=xi(a,f=>p({state:f,props:t,constants:r},c)),a}}),{getState:()=>a,...o,...n}};var Ei=e=>!he(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{Ei(t)}),Object.freeze(e)),Ai=({setupConstants:e,fileConstants:t})=>{let r=he(e)?e:{},s=he(t)?t:{};return Ei({...r,...s})};var ki=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([o,a])=>` ${o}: ${a};`).join(`
|
|
974
|
-
`),i=(n,
|
|
975
|
-
${
|
|
976
|
-
`).map(
|
|
973
|
+
`))}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}},es=({render:e,html:t})=>Ot;var Tt={};R(Tt,{handleClickHeader:()=>Jn});var Jn=(e,t)=>{let{store:r,render:s}=e;r.toggleOpen({}),s()};var ts={componentName:"rtgl-accordion-item",propsSchema:{type:"object",properties:{label:{type:"string"},content:{type:"string"},w:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var Lt={};R(Lt,{createInitialState:()=>Yn,selectViewData:()=>Qn,toggleOpen:()=>ea});var Yn=()=>Object.freeze({open:!1}),Xn=["id","class","style","slot","label","content"],Zn=(e={})=>Object.entries(e).filter(([t])=>!Xn.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Qn=({state:e,props:t})=>({label:t.label||"",content:t.content||"",openClass:e.open?"content-wrapper open":"content-wrapper",chevronIcon:e.open?"chevronUp":"chevronDown",containerAttrString:Zn(t)}),ea=({state:e})=>{e.open=!e.open};var rs={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 Rt={};R(Rt,{handleClickItem:()=>ta});var ta=(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 ss={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 Nt={};R(Nt,{createInitialState:()=>ra,selectViewData:()=>pa});var ra=()=>Object.freeze({}),sa=["id","class","style","slot","items","sep","max","separator"],ia=(e={})=>Object.entries(e).filter(([t])=>!sa.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),na=e=>{if(e==null||e==="")return;let t=Number(e);return Number.isNaN(t)?void 0:t},aa=e=>`${e}`.replace(/"/g,"""),oa=(e,t)=>{if(!t||t<3||e.length<=t)return e;let r=t-2;return[e[0],{isEllipsis:!0,label:"..."},...e.slice(-r)]},la=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="${aa(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"}}),pa=({props:e})=>{let t=ia(e),r=Array.isArray(e.items)?e.items:[],s=na(e.max),i=e.sep||"breadcrumb-arrow",n=la(r),a=oa(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 is={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 Pt={};R(Pt,{handleClickMenuItem:()=>ua,handleClosePopover:()=>ca});var ca=(e,t)=>{let{dispatchEvent:r}=e;r(new CustomEvent("close"))},ua=(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 ns={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:"string"},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 Vt={};R(Vt,{createInitialState:()=>da,selectViewData:()=>ma});var da=()=>Object.freeze({}),fa=e=>`${e}`.replace(/"/g,"""),ha=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",c=l?"mu":"",u=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="${fa(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:c,hoverBgc:u}}),ma=({props:e})=>{let t=Array.isArray(e.items)?e.items:[];return{items:ha(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 as={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 Dt={};R(Dt,{handleActionClick:()=>_a,handleAfterMount:()=>va,handleBeforeMount:()=>ga,handleImageClick:()=>Aa,handleInputChange:()=>xa,handleKeyDown:()=>Ca,handleOnUpdate:()=>ba,handleSelectAddOption:()=>ka,handleTooltipMouseEnter:()=>$a,handleTooltipMouseLeave:()=>Sa,handleWaveformClick:()=>Ea});var os=({form:e,defaultValues:t={},refs:r})=>{let{fields:s=[]}=e;s.forEach((i,n)=>{let a=r[`field${n}`];if(a){if(["input-textarea","input-text","input-number","color-picker","slider","slider-input","popover-input"].includes(i.inputType)){let l=t[i.name];l==null?a.removeAttribute("value"):a.setAttribute("value",l)}["input-text","input-textarea"].includes(i.inputType)&&i.placeholder&&a.getAttribute("placeholder")!==i.placeholder&&(i.placeholder===void 0||i.placeholder===null?a.removeAttribute("placeholder"):a.setAttribute("placeholder",i.placeholder))}})},ya=e=>{for(let t in e)if(t.startsWith("field")){let r=e[t];if(r&&r.focus){r.focus();return}}},ga=e=>{let{store:t,props:r}=e;t.setFormValues({formValues:r.defaultValues})},va=e=>{let{props:t,refs:r,render:s}=e,{form:i={},defaultValues:n}=t;os({form:i,defaultValues:n,refs:r}),s(),t?.autofocus&&setTimeout(()=>{ya(r)},50)},ba=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n,refs:a}=e,{form:l={},defaultValues:p}=s;if(r?.key!==s?.key){os({form:l,defaultValues:p,refs:a}),i.setFormValues({formValues:p}),n();return}n()},wa=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},_a=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.actionId||i.currentTarget.id.slice(6);s(new CustomEvent("action-click",{detail:{actionId:n,formValues:r.selectFormValues()}}))},xa=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.fieldName||i.currentTarget.id.slice(5);if(n&&i.detail&&Object.prototype.hasOwnProperty.call(i.detail,"value")){let a=i.detail.value;r.setFormFieldValue({name:n,value:a}),wa(n,a,r.selectFormValues(),s)}},Aa=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(5);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},Ea=(e,t)=>{let r=t._event;r.type==="contextmenu"&&r.preventDefault();let{dispatchEvent:s}=e,i=r.currentTarget.dataset.fieldName||r.currentTarget.id.slice(8);s(new CustomEvent("extra-event",{detail:{name:i,x:r.clientX,y:r.clientY,trigger:r.type}}))},ka=(e,t)=>{let{store:r,dispatchEvent:s}=e,i=t._event,n=i.currentTarget.dataset.fieldName||i.currentTarget.id.slice(5);s(new CustomEvent("action-click",{detail:{actionId:"select-options-add",name:n,formValues:r.selectFormValues()}}))},$a=(e,t)=>{let{store:r,render:s,props:i}=e,n=t._event,a=n.currentTarget.dataset.fieldName||n.currentTarget.id.slice(11),p=i.form.fields.find(o=>o.name===a);if(p&&p.tooltip){let o=n.currentTarget.getBoundingClientRect();r.showTooltip({x:o.left+o.width/2,y:o.top-8,content:p.tooltip.content}),s()}},Sa=e=>{let{store:t,render:r}=e;t.hideTooltip({}),r()},Ca=(e,t)=>{let{store:r,dispatchEvent:s,props:i}=e,n=t._event;if(n.key==="Enter"&&!n.shiftKey){let a=n.target;if(a.tagName==="TEXTAREA"||a.tagName==="RTGL-TEXTAREA")return;n.preventDefault();let o=((i.form||{}).actions||{}).buttons||[];if(o.length>0){let c=o[0].id,u=r.selectFormValues();s(new CustomEvent("action-click",{detail:{actionId:c,formValues:u}}))}}};var ls={componentName:"rtgl-form",propsSchema:{type:"object",properties:{key:{type:"string"},autofocus:{type:"boolean"},defaultValues:{type:"object"},context:{type:"object"},form:{type:"object",properties:{title:{type:"string"},description:{type:"string"},fields:{type:"array",items:{anyOf:[{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"input-text"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"select"},placeholder:{type:"string"},noClear:{type:"boolean"},addOption:{type:"object",properties:{label:{type:"string"}}},options:{type:"array",items:{type:"object",properties:{label:{type:"string"},value:{type:"any"}},required:["label","value"]}},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"color-picker"},value:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"slider-input"},min:{type:"number"},max:{type:"number"},step:{type:"number"},value:{type:"number"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"image"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"waveform"},width:{type:"number"},height:{type:"number"},placeholder:{type:"string"},defaultValue:{type:"object"},waveformData:{type:"object"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"popover-input"},placeholder:{type:"string"},testId:{type:"string"},tooltip:{type:"object",properties:{content:{type:"string"}}}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"},testId:{type:"string"}},required:["id","content"]}}}}}}}},events:{"form-change":{},"extra-event":{},"action-click":{}},methods:{type:"object",properties:{}}};var Ft={};R(Ft,{createInitialState:()=>ao,getFormFieldValue:()=>ho,hideTooltip:()=>vo,selectForm:()=>Je,selectFormValues:()=>fo,selectState:()=>uo,selectViewData:()=>co,setFormFieldValue:()=>yo,setFormValues:()=>mo,showTooltip:()=>go});var b={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},Pe={NOT:0};var k=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Z=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var jt=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}')`)},ps=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 cs=(e,t,r=!1)=>{if(t===null)return new Z(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Z(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Z(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Z(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},us=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Z(`Unknown function '${e}' (${r})`)};var Ia=(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=C(e,{functions:s,partials:i},t,{});return a===void 0?{}:a},C=(e,t,r,s)=>{let i=t.functions||t;if(e.var&&!e.type)return M(e.var,r,s);if(e.type===b.LITERAL)return e.value;if(e.type===b.VARIABLE)return M(e.path,r,s);if(e.type===b.INTERPOLATION)return Ta(e.parts,t,r,s);switch(e.type){case b.FUNCTION:return fs(e,t,r,s);case b.BINARY:return hs(e,t,r,s);case b.UNARY:return ms(e,t,r,s);case b.CONDITIONAL:return Ra(e,t,r,s);case b.LOOP:return ja(e,t,r,s);case b.OBJECT:return Wa(e,t,r,s);case b.ARRAY:return Ma(e,t,r,s);case b.PARTIAL:return za(e,t,r,s);case b.PATH_REFERENCE:return Fa(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ds=new Map,Oa=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=ds.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=Oa(p.trim());s.push(...o)}ds.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},Ta=(e,t,r,s)=>{let i=[];for(let n of e)if(typeof n=="string")i.push(n);else{let a=C(n,t,r,s);i.push(a!=null?String(a):"")}return i.join("")},fs=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw us(e.name,i);let a=e.args.map(l=>C(l,t,r,s));return n(...a)},Ee=(e,t,r,s)=>{if(e.var&&!e.type)return M(e.var,r,s);switch(e.type){case b.VARIABLE:return M(e.path,r,s);case b.LITERAL:return e.value;case b.BINARY:return hs(e,t,r,s);case b.UNARY:return ms(e,t,r,s);case b.FUNCTION:return fs(e,t,r,s);default:return C(e,t,r,s)}},hs=(e,t,r,s)=>{if(e.op===V.AND||e.op===V.OR){let a=Ee(e.left,t,r,s),l=Ee(e.right,t,r,s);switch(e.op){case V.AND:return a&&l;case V.OR:return a||l}}let i=C(e.left,t,r,s),n=C(e.right,t,r,s);switch(e.op){case V.EQ:return i==n;case V.NEQ:return i!=n;case V.GT:return i>n;case V.LT:return i<n;case V.GTE:return i>=n;case V.LTE:return i<=n;case V.IN:return Array.isArray(n)?n.includes(i):!1;case V.ADD:if(typeof i!="number"||typeof n!="number")throw new Z(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case V.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new Z(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ms=(e,t,r,s)=>{let i=e.op===Pe.NOT?Ee(e.operand,t,r,s):C(e.operand,t,r,s);switch(e.op){case Pe.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},La=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===b.VARIABLE)if(M(i.path,r,s)){let a=e.bodies[0];if(a.type===b.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?C(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===b.LITERAL)l[o]=c.value;else if(c.type===b.VARIABLE)l[o]=M(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let h=M(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=C(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=C(c,t,r,s)}return l}}else{let a=e.bodies[1];if(a.type===b.OBJECT&&a.properties.length<=5){let l={};for(let p of a.properties){let o=p.parsedKey?C(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===b.LITERAL)l[o]=c.value;else if(c.type===b.VARIABLE)l[o]=M(c.path,r,s);else if(c.type===b.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===b.VARIABLE){let h=M(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=C(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=C(c,t,r,s)}return l}}}return null},Ra=(e,t,r,s)=>{let i=La(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||Ee(a,t,r,s))return C(e.bodies[n],t,r,s)}return ys},Na=(e,t)=>{let r=e.body,s=e.itemVar;if(r.type===b.CONDITIONAL&&r.conditions.length===1&&r.conditions[0].type===b.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===b.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 c={};for(let u of n.properties){let d=u.key,h=u.value;if(h.type===b.LITERAL)c[d]=h.value;else if(h.type===b.VARIABLE){let f=h.path;if(f===s)c[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);c[d]=o[m]}else return null}else if(h.type===b.INTERPOLATION){let f=[],m=!0;for(let g of h.parts)if(typeof g=="string")f.push(g);else if(g.type===b.VARIABLE){let y=g.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),_=o[w];f.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[d]=f.join("")}else return null}l.push(c)}}return l}}}return null},Pa=(e,t)=>{let r=e.body,s=e.itemVar,i=Na(e,t);if(i!==null)return i;if(r.type===b.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===b.LITERAL)n.push({key:p,type:"literal",value:o.value});else if(o.type===b.VARIABLE){let c=o.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop",prop:u});else{a=!1;break}}else{a=!1;break}}else if(o.type===b.INTERPOLATION&&o.parts.length===1){let c=o.parts[0];if(c.type===b.VARIABLE){let u=c.path;if(u===s)n.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.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],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},Va=(e,t,r,s,i)=>{let n=[],a=e.body;if(a.type===b.OBJECT&&a.fast!==!1){let l=e.itemVar,p=e.indexVar;for(let o=0;o<i.length;o++){let c=i[o],u={},d={...s,[l]:c,...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?C(f.parsedKey,t,r,d):f.key,g=f.value;if(g.type===b.LITERAL)u[m]=g.value;else if(g.type===b.VARIABLE){let y=g.path;if(y===l)u[m]=c;else if(y===p)u[m]=o;else if(y.startsWith(l+".")){let w=y.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[m]=c[w]:u[m]=M(y,r,{...s,[l]:c,...p&&{[p]:o}})}else u[m]=M(y,r,{...s,[l]:c,...p&&{[p]:o}})}else if(g.type===b.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===b.VARIABLE){let _=w.path,x;if(_===l)x=c;else if(_===p)x=o;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?x=c[A]:x=M(_,r,{...s,[l]:c,...p&&{[p]:o}})}else x=M(_,r,{...s,[l]:c,...p&&{[p]:o}});y.push(x!=null?String(x):"")}else{let _={...s,[l]:c,...p&&{[p]:o}},x=C(w,t,r,_);y.push(x!=null?String(x):"")}u[m]=y.join("")}else{let y={...s,[l]:c,...p&&{[p]:o}};u[m]=C(g,t,r,y)}}n.push(u)}return n}return null},Da=(e,t,r)=>{let s=e.body;if(s.type===b.OBJECT&&s.properties.length===1&&s.properties[0].key==="$if item.visible"){let n=s.properties[0].value;if(n.type===b.CONDITIONAL&&n.conditions.length===1&&n.conditions[0].type===b.VARIABLE&&n.conditions[0].path==="item.visible"){let a=n.bodies[0];if(a.type===b.OBJECT&&a.properties.length===2){let l=a.properties[0],p=a.properties[1];if(l.key==="id"&&l.value.type===b.VARIABLE&&l.value.path==="item.id"&&p.key==="$if item.highlighted"&&p.value.type===b.CONDITIONAL){let o=[];for(let c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},ja=(e,t,r,s)=>{let i=C(e.iterable,t,r,s);if(!Array.isArray(i)){let o,c=!1;if(e.iterable.type===b.FUNCTION){c=!0;let d=e.iterable.args.map(h=>h.type===b.LITERAL?typeof h.value=="string"?`'${h.value}'`:String(h.value):h.type===b.VARIABLE?h.path:h.type===b.FUNCTION?`${h.name}(...)`:"?").join(", ");o=`${e.iterable.name}(${d})`}else o=e.iterable.path||"undefined";let u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw cs(u,i,c)}if(!e.indexVar){let o=Da(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Pa(e,i);if(o!==null)return o}let n=Va(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("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],o.length>1&&(l+="."+o.slice(1).join(".")))}let p=!1;e.body.type===b.ARRAY&&(e.body.items.length<=1?p=!1:p=e.body._shouldPreserveArray??=e.body.items.some(o=>o.type===b.OBJECT&&o.properties.some(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let c=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=C(e.body,t,r,c);if(Array.isArray(u)&&u.length===1&&!p){let d=u[0];a.push(d===void 0?{}:d)}else a.push(u===void 0?{}:u)}return a},Ba=(e,t,r,s)=>{if(e.whenCondition)return null;if(e.properties.length===1){let i=e.properties[0],n=i.parsedKey?C(i.parsedKey,t,r,s):i.key,a=i.value;if(a.type===b.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?C(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===b.LITERAL)p[u]=d.value;else if(d.type===b.VARIABLE)p[u]=M(d.path,r,s);else if(d.type===b.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===b.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[u]=h.join("")}else if(d.type===b.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,g=f.value;if(g.type===b.LITERAL)h[m]=g.value;else if(g.type===b.VARIABLE)h[m]=M(g.path,r,s);else if(g.type===b.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===b.VARIABLE){let _=M(w.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[u]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},Wa=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!Ee(e.whenCondition,i,r,s))return;let n=Ba(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?C(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===b.LITERAL)o[u]=d.value;else if(d.type===b.VARIABLE)o[u]=M(d.path,r,s);else if(d.type===b.INTERPOLATION){let h=[];for(let f of d.parts)if(typeof f=="string")h.push(f);else if(f.type===b.VARIABLE){let m=M(f.path,r,s);h.push(m!=null?String(m):"")}else{let m=C(f,t,r,s);h.push(m!=null?String(m):"")}o[u]=h.join("")}else o[u]=C(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 c=C(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return C(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===b.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=C(u.value,t,r,s);d!==void 0&&(a[o.key]=d)}else{let d=C(o.value,t,r,s);d!==void 0&&(a[o.key]=d)}}else{let u=o.parsedKey?C(o.parsedKey,t,r,s):o.key,d=C(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},ys={},Ma=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===b.LOOP){let a=C(n,t,r,s);Array.isArray(a)&&n.flatten!==!1?i.push(...a):i.push(a)}else{let a=C(n,t,r,s);a!==ys&&a!==void 0&&i.push(a)}return i},za=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!Ee(a,p,r,s))return;if(!l[i])throw new Z(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new Z(`Circular partial reference detected: ${i}`);let c=l[i],u=r,d={...s,_partialStack:[...o,i]};if(s){u={...r};for(let h of Object.keys(s))h.startsWith("_")||(u[h]=s[h])}if(n){let h=C(n,t,r,s);u={...u,...h}}return C(c,t,u,d)},Fa=(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 Z(`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 Z(`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 Z(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},Bt=Ia;var Ua=/\$\{([^}]*)\}/g,Ka=/#\{([^}]*)\}/g,vs=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Ha(i,t);return{isFunction:!0,type:b.FUNCTION,name:s,args:n}},Ha=(e,t={})=>e.trim()?Ga(e).map(s=>qa(s.trim(),t)):[],Ga=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},qa=(e,t={})=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(/^-?\d+(\.\d+)?$/.test(e))return{type:b.LITERAL,value:parseFloat(e)};if(e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};let r=vs(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 c=ge(s.substring(o),l);if(c===-1)break;let u=o+c;u>n&&(n=u,a={op:l,type:p}),o=u+l.length}}if(n!==-1)try{return J(s,t)}catch{return{type:b.VARIABLE,path:s}}return{type:b.VARIABLE,path:s}},bs=/^\w+\(.*\)$/,Ja=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Ya=e=>{if(!(!e||e.trim()===""||bs.test(e))&&Ja.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(bs.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:b.PATH_REFERENCE,path:t}},Ve=(e,t={})=>{let r=e.trim();Ya(r);let s=vs(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:b.VARIABLE,path:r}},Wt=(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,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(Ua)],n=[...r.matchAll(Ka)],a=[...i.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<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:b.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?Ve(o[1],t):gs(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:b.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,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;c==="variable"?f=Ve(d.trim(),t):f=gs(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(u);else throw f}p=h+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:b.INTERPOLATION,parts:l}};var fe=(e,t)=>typeof e=="string"?Wt(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Za(e,t):Qa(e,t):{type:b.LITERAL,value:e},Xa=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}},Za=(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=Xa(n),o=Object.keys(p);if(o.length===1&&/^\$for(?::\w+)?\s/.test(o[0])){let c=ws(o[0],p[o[0]],t,!0);r.push(c),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=ws(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=fe(n,t);r.push(a),(a.type===b.FUNCTION||a.type===b.CONDITIONAL||a.type===b.LOOP||a.type===b.PARTIAL||a.type===b.OBJECT&&!a.fast||a.type===b.ARRAY&&!a.fast)&&(s=!0)}return{type:b.ARRAY,items:r,fast:!s}},Qa=(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 w of p)if(y===w||y.startsWith(w+" ")||y.startsWith(w+"#")){o.push(w);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:c,$when:u,...d}=e,h={},f=!1;for(let[y,w]of Object.entries(d)){let _=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(_=y.slice(1)),h[_]=w,f=!0}let m=null;if(f&&(m=fe(h,t),m.type===b.OBJECT)){let y=!1;for(let w of m.properties)if(w.value.type===b.VARIABLE||w.value.type===b.INTERPOLATION||w.value.type===b.FUNCTION||w.value.type===b.CONDITIONAL||w.value.type===b.OBJECT&&!w.value.fast||w.value.type===b.ARRAY&&!w.value.fast){y=!0;break}y&&(m.fast=!1)}let g={type:b.PARTIAL,name:c,data:m};if(u!==void 0){let y;if(typeof u=="string"){if(u.trim()==="")throw new k("Empty condition expression after '$when'");y=J(u,t)}else y={type:b.LITERAL,value:u};g.whenCondition=y}return g}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 c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new k("Empty condition expression after '$when'");i=J(c,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 c=eo(n,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(/^\$for(?::\w+)?\s/.test(p)){let c=p.match(/^\$for(?::(\w+))?\s/)?.[1]||"",u=c?`:${c}`:"";throw new k(`$for loops must be inside arrays - use '- $for${u} item in items:' instead of '$for${u} 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 c=fe(o,t);(c.type===b.FUNCTION||c.type===b.CONDITIONAL||c.type===b.PARTIAL||c.type===b.OBJECT&&!c.fast||c.type===b.ARRAY&&!c.fast)&&(s=!0);let u=Wt(p,t),d={key:p,value:c};(u.type!==b.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:b.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},eo=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new k(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());jt(o);let c=J(o,r);for(s.push(c),i.push(fe(l,r)),n++;n<e.length;){let[u,d]=e[n],h=!1,f;if(p?u.startsWith(`$elif#${p} `)?(f=u.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(h=!0,f=null):u.startsWith("$elif ")?(f=u.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u==="$else"||u==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{jt(f);let m=J(f,r);s.push(m)}if(i.push(fe(d,r)),n++,f===null)break}else break}return{node:{type:b.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},J=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return J(o,t)}let r=ge(e,"||");if(r!==-1)return{type:b.BINARY,op:V.OR,left:J(e.substring(0,r).trim(),t),right:J(e.substring(r+2).trim(),t)};let s=ge(e,"&&");if(s!==-1)return{type:b.BINARY,op:V.AND,left:J(e.substring(0,s).trim(),t),right:J(e.substring(s+2).trim(),t)};let i=[{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 i){let u=ge(e,o);if(u!==-1)return{type:b.BINARY,op:c,left:J(e.substring(0,u).trim(),t),right:J(e.substring(u+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:V.ADD},{op:" - ",type:V.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=ge(e.substring(u),o);if(d===-1)break;let h=u+d;h>n&&(n=h,a={op:o,type:c}),u=h+o.length}}if(n!==-1&&a)return{type:b.BINARY,op:a.type,left:J(e.substring(0,n).trim(),t),right:J(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(ge(e,o)!==-1)throw new k(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:b.UNARY,op:Pe.NOT,operand:J(e.substring(1).trim(),t)}:_s(e,t)},ge=(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},to=e=>{if(e=e.trim(),e==="true")return{type:b.LITERAL,value:!0};if(e==="false")return{type:b.LITERAL,value:!1};if(e==="null")return{type:b.LITERAL,value:null};if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return{type:b.LITERAL,value:e.slice(1,-1)};if(e==='""'||e==="''")return{type:b.LITERAL,value:""};if(e==="{}")return{type:b.LITERAL,value:{}};if(e==="[]")return{type:b.LITERAL,value:[]};let t=Number(e);return!isNaN(t)&&isFinite(t)?{type:b.LITERAL,value:t}:{type:b.VARIABLE,path:e}},_s=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return Ve(r,t);let i=to(r);if(i.type===b.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:b.VARIABLE,path:r};try{return Ve(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},ro=(e,t=!1)=>{let r=t?"$each":"$for";try{ps(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}},ws=(e,t,r,s=!1)=>{let i=/^\$for(?::(\w+))?\s+(.+)$/,n=e.match(i);if(!n){let g=s?"$each":"$for";throw new k(`Invalid loop syntax (got: '${e.replace("$for",g)}')`)}let a=n[1],l=n[2].trim();ro(l,s);let p=l.match(/^(.+?)\s+in\s+(.+)$/);if(!p){let g=s?"$each":"$for";throw new k(`Invalid loop syntax - missing 'in' keyword (got: '${g} ${l}')`)}let o=p[1].trim(),c=p[2].trim(),u,d=null;if(o.includes(",")){let g=o.split(",").map(y=>y.trim());if(g.length!==2)throw new k(`Invalid loop variables: ${o}. Expected format: "item" or "item, index"`);u=g[0],d=g[1]}else u=o;let h=["this","undefined","null","true","false"];if(h.includes(u))throw new k(`Reserved variable name: ${u}`);if(d&&h.includes(d))throw new k(`Reserved variable name: ${d}`);let f=_s(c,r),m=fe(t,r);return{type:b.LOOP,itemVar:u,indexVar:d,iterable:f,body:m,flatten:a!=="nested"}};var so=(e,t={})=>{let{functions:r={}}=t;return fe(e,r)},qe=so;var Mt={};R(Mt,{now:()=>io});var io=()=>Date.now();var no=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...Mt,...s},a=qe(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=qe(o,{functions:n});return Bt(a,t,{functions:n,partials:l})},zt=no;function xs(e,t){return t.reduce((r,s)=>(s in e&&(r[s]=e[s]),r),{})}var ao=()=>Object.freeze({formValues:{},tooltipState:{open:!1,x:0,y:0,content:""}}),As=(e,t,r=void 0)=>{if(!t)return;let s=t.split(/[\[\].]/).filter(n=>n!==""),i=e;for(let n of s){if(i==null||!(n in i))return r;i=i[n]}return i},oo=(e,t,r)=>{let s=t.split(/[\[\].]/).filter(n=>n!=="");t.includes("[")&&t in e&&delete e[t];let i=e;for(let n=0;n<s.length-1;n++){let a=s[n];if(!(a in i)||typeof i[a]!="object"||i[a]===null){let l=s[n+1],p=/^\d+$/.test(l);i[a]=p?[]:{}}i=i[a]}return i[s[s.length-1]]=r,e},lo=["id","class","style","slot","form","defaultValues","context","autofocus","key"],po=(e={})=>Object.entries(e).filter(([t])=>!lo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Je=({props:e})=>{let{form:t={}}=e,{context:r}=e;return r?zt(t,r):t},co=({state:e,props:t})=>{let r=po(t),s=Je({state:e,props:t}),i=structuredClone(s.fields||[]);return i.forEach(n=>{let a=As(e.formValues,n.name);if(["read-only-text"].includes(n.inputType)&&(n.defaultValue=a),["select"].includes(n.inputType)){let l=t?.defaultValues;l&&l[n.name]!==void 0&&(n.selectedValue=l[n.name])}if(n.inputType==="image"){let l=n.src;n.imageSrc=l&&l.trim()?l:null,n.placeholderText=n.placeholder||"No Image"}if(n.inputType==="waveform"){let l=n.waveformData;n.waveformData=l||null,n.placeholderText=n.placeholder||"No Waveform"}}),{key:t?.key,containerAttrString:r,title:s?.title||"",description:s?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues,tooltipState:e.tooltipState}},uo=({state:e})=>e,fo=({state:e,props:t})=>{let r=Je({state:e,props:t});return xs(e.formValues,r.fields.map(s=>s.name))},ho=({state:e},t)=>As(e.formValues,t),mo=({state:e},t={})=>{e.formValues=t.formValues||{}},yo=({state:e,props:t},r={})=>{let{name:s,value:i}=r;if(!s)return;oo(e.formValues,s,i);let n=Je({state:e,props:t}),a=xs(e.formValues,n.fields.map(l=>l.name));e.formValues=a},go=({state:e},t={})=>{let{x:r,y:s,content:i}=t;e.tooltipState={open:!0,x:r,y:s,content:i}},vo=({state:e})=>{e.tooltipState={...e.tooltipState,open:!1}};var Es={refs:{formContainer:{eventListeners:{keydown:{handler:"handleKeyDown"}}},"action*":{eventListeners:{click:{handler:"handleActionClick"}}},"tooltipIcon*":{eventListeners:{mouseenter:{handler:"handleTooltipMouseEnter"},mouseleave:{handler:"handleTooltipMouseLeave"}}},"field*":{eventListeners:{"value-input":{handler:"handleInputChange"},"value-change":{handler:"handleInputChange"},"add-option-click":{handler:"handleSelectAddOption"}}},"image*":{eventListeners:{click:{handler:"handleImageClick"},contextmenu:{handler:"handleImageClick"}}},"waveform*":{eventListeners:{click:{handler:"handleWaveformClick"},contextmenu:{handler:"handleWaveformClick"}}}},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:"fields"},body:{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.label && field.tooltip",value:{type:6,conditions:[{type:4,op:6,left:{type:1,path:"field.label"},right:{type:1,path:"field.tooltip"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-svg#tooltipIcon${i} 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:"i"}," 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.inputType == "read-only-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"read-only-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-text s=sm",value:{type:1,path:"field.defaultValue"}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-text"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-text"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-number"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-number"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input-number#field${i} data-field-name=${field.name} w=f data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input-number#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "input-textarea"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"input-textarea"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-textarea#field${i} data-field-name=${field.name} w=f rows=${field.rows} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-textarea#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," w=f rows=",{type:1,path:"field.rows"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "popover-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"popover-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-popover-input#field${i} data-field-name=${field.name} label="${field.label}" data-testid=${field.testId}',value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-popover-input#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"},' label="',{type:1,path:"field.label"},'" data-testid=',{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "select"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"select"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-select#field${i} data-field-name=${field.name} key=${key} w=f :options=fields[${i}].options ?no-clear=fields[${i}].noClear :addOption=fields[${i}].addOption :selectedValue=#{field.selectedValue} :placeholder=#{field.placeholder} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f :options=fields[",{type:1,path:"i"},"].options ?no-clear=fields[",{type:1,path:"i"},"].noClear :addOption=fields[",{type:1,path:"i"},"].addOption :selectedValue=",{type:11,path:"field.selectedValue"}," :placeholder=",{type:11,path:"field.placeholder"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "color-picker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"color-picker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#field${i} data-field-name=${field.name} key=${key} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider#field${i} data-field-name=${field.name} key=${key} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#field",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," key=",{type:1,path:"key"}," w=f min=",{type:1,path:"field.min"}," max=",{type:1,path:"field.max"}," step=",{type:1,path:"field.step"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slider-input"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slider-input"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-slider-input#field${i} data-field-name=${field.name} w=f min=${field.min} max=${field.max} step=${field.step} data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#field",{type:1,path:"i"}," 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"}," data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"image"}},right:{type:1,path:"field.imageSrc"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-image#image${i} data-field-name=${field.name} src=${field.imageSrc} w=${field.width} h=${field.height} cur=pointer data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-image#image",{type:1,path:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "image" && !field.imageSrc',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},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${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md data-testid=${field.testId}",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:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:1,path:"field.waveformData"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-waveform#waveform${i} data-field-name=${field.name} :waveformData=fields[${i}].waveformData w=${field.width} h=${field.height} cur=pointer data-testid=${field.testId}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-waveform#waveform",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," :waveformData=fields[",{type:1,path:"i"},"].waveformData w=",{type:1,path:"field.width"}," h=",{type:1,path:"field.height"}," cur=pointer data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "waveform" && !field.waveformData',value:{type:6,conditions:[{type:4,op:6,left:{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"waveform"}},right:{type:5,op:0,operand:{type:1,path:"field.waveformData"}}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#waveform${i} data-field-name=${field.name} w=${field.width} h=${field.height} bc=ac bw=sm ah=c av=c cur=pointer p=md data-testid=${field.testId}",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text c=mu-fg ta=c",value:{type:1,path:"field.placeholder"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#waveform",{type:1,path:"i"}," 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 data-testid=",{type:1,path:"field.testId"}]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "slot"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"slot"}}],bodies:[{type:9,items:[{type:8,properties:[{key:'slot#fieldSlot${i} data-field-name=${field.name} name=${field.slot} style="display: contents;"',value:{type:0,value:null},parsedKey:{type:2,parts:["slot#fieldSlot",{type:1,path:"i"}," data-field-name=",{type:1,path:"field.name"}," name=",{type:1,path:"field.slot"},' style="display: contents;"']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}}],fast:!1},{type:8,properties:[{key:"rtgl-view g=sm w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h ah=e g=sm w=f",value:{type:9,items:[{type:7,itemVar:"button",indexVar:"i",iterable:{type:1,path:"actions.buttons"},body:{type:9,items:[{type:8,properties:[{key:"rtgl-button#action${i} data-action-id=${button.id} data-testid=${button.testId}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action",{type:1,path:"i"}," data-action-id=",{type:1,path:"button.id"}," data-testid=",{type:1,path:"button.testId"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],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 Ut={};R(Ut,{closeAll:()=>So,handleCancel:()=>_o,handleConfirm:()=>wo,handleDialogClose:()=>bo,handleDropdownClose:()=>xo,handleDropdownItemClick:()=>Ao,showAlert:()=>Eo,showConfirm:()=>ko,showDropdownMenu:()=>$o});var bo=(e,t)=>{let{store:r,render:s}=e;r.closeAll(),s()},wo=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!0)},_o=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",!1)},xo=(e,t)=>{let{store:r,render:s,globalUI:i}=e;r.closeAll(),s(),i.emit("event",null)},Ao=(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})},Eo=(e,t)=>{let{store:r,render:s}=e,i=t;r.selectIsOpen()&&(r.closeAll(),s()),r.setAlertConfig(i),s()},ko=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)})})},$o=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)})})},So=e=>{let{store:t,render:r}=e;t.selectIsOpen()&&(t.closeAll(),r())};var ks={componentName:"rtgl-global-ui",propsSchema:{type:"object",properties:{}},events:[],methods:{type:"object",properties:{}}};var Kt={};R(Kt,{closeAll:()=>Lo,createInitialState:()=>Co,selectConfig:()=>Ro,selectDropdownConfig:()=>No,selectIsOpen:()=>Vo,selectUiType:()=>Po,selectViewData:()=>Do,setAlertConfig:()=>Io,setConfirmConfig:()=>Oo,setDropdownConfig:()=>To});var Co=()=>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"}}),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},Oo=({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},To=({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},Lo=({state:e})=>{e.isOpen=!1,e.uiType="dialog"},Ro=({state:e})=>e.config,No=({state:e})=>e.dropdownConfig,Po=({state:e})=>e.uiType,Vo=({state:e})=>e.isOpen,Do=({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 $s={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 Ht={};R(Ht,{handleClickStart:()=>jo});var jo=(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 Ss={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 Gt={};R(Gt,{createInitialState:()=>Bo,selectPath:()=>Uo,selectViewData:()=>Fo,setState:()=>Ko});var Bo=()=>Object.freeze({}),Wo=["id","class","style","slot","start"],Mo=(e={})=>Object.entries(e).filter(([t])=>!Wo.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),zo=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}}}},Fo=({props:e})=>{let t=zo(e.start)||e.start;return{containerAttrString:Mo(e),start:t||{label:"",image:{src:"",width:32,height:32,alt:""}}}},Uo=({props:e})=>e.start?.path,Ko=({state:e})=>{};var Cs={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 qt={};R(qt,{handleBeforeMount:()=>Go});var Is=(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())},Ho=(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(c=>{let u=1,d=c.tagName.toLowerCase();return d==="h1"?u=1:d==="h2"?u=2:d==="h3"?u=3:d==="h4"?u=4:d==="rtgl-text"&&(u=parseInt(c.getAttribute("data-level")||"1",10)),{id:c.id,href:`#${c.id}`,title:c.textContent,level:u}});i.setItems({items:p}),Is(l,r,s),n();let o=Is.bind(void 0,l,r,s);return t.addEventListener("scroll",o,{passive:!0}),()=>{t.removeEventListener("scroll",o)}},Go=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=Ho(s,i,n,e)}),()=>{r()}};var Os={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 Jt={};R(Jt,{createInitialState:()=>qo,selectCurrentId:()=>Xo,selectState:()=>Yo,selectViewData:()=>Jo,setContentContainer:()=>el,setCurrentId:()=>Qo,setItems:()=>Zo});var qo=()=>Object.freeze({items:[],currentId:null,contentContainer:null}),Jo=({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 c=p-1;c>=0;c--)s[c].level<o&&(n.add(s[c].id),o=s[c].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}},Yo=({state:e})=>e,Xo=({state:e})=>e.currentId,Zo=({state:e},t={})=>{e.items=Array.isArray(t.items)?t.items:[]},Qo=({state:e},t={})=>{e.currentId=t.id},el=({state:e},t={})=>{e.contentContainer=t.container};var Ts={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 Yt={};R(Yt,{handleBeforeMount:()=>tl,handleInputChange:()=>nl,handleInputKeydown:()=>ol,handleOnUpdate:()=>rl,handlePopoverClose:()=>il,handleSubmitClick:()=>al,handleTextClick:()=>sl});var tl=e=>{let{store:t,props:r}=e;r.value!==void 0&&t.setValue({value:r.value||""})},rl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let a=s?.value??"";i.setValue({value:a})}n()},sl=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e,a=t._event,l=r.selectValue();r.setTempValue({value:l}),r.openPopover({position:{x:a.currentTarget.getBoundingClientRect().left,y:a.currentTarget.getBoundingClientRect().bottom}});let{input:p}=i;p.value=l,s(),n.autoFocus&&setTimeout(()=>{p.focus()},50)},il=(e,t)=>{let{store:r,render:s}=e;r.closePopover({}),s()},nl=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,a=t._event.detail.value;r.setTempValue({value:a}),i(new CustomEvent("value-input",{detail:{value:a},bubbles:!0})),s()},al=e=>{let{store:t,render:r,dispatchEvent:s,refs:i}=e,{input:n}=i,a=n.value;t.setValue({value:a}),t.closePopover({}),s(new CustomEvent("value-change",{detail:{value:a},bubbles:!0})),r()},ol=(e,t)=>{let{store:r,render:s,dispatchEvent:i,refs:n}=e,a=t._event;if(a.key==="Enter"){let{input:l}=n,p=l.value;r.closePopover({}),i(new CustomEvent("value-change",{detail:{value:p},bubbles:!0})),s()}else a.key==="Escape"&&(r.closePopover({}),s())};var Ls={componentName:"rtgl-popover-input",propsSchema:{type:"object",properties:{value:{type:"string"},placeholder:{type:"string"},label:{type:"string"},autoFocus:{type:"boolean"}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}};var Xt={};R(Xt,{closePopover:()=>dl,createInitialState:()=>ll,openPopover:()=>ul,selectValue:()=>hl,selectViewData:()=>pl,setTempValue:()=>cl,setValue:()=>fl});var ll=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},value:"",tempValue:""}),pl=({props:e,state:t})=>{let r=t.value||"-";return{isOpen:t.isOpen,position:t.position,value:r,tempValue:t.tempValue,placeholder:e.placeholder??"",label:e.label}},cl=({state:e},t={})=>{e.tempValue=t.value},ul=({state:e},t={})=>{let{position:r}=t;e.position=r,e.isOpen=!0,e.hasUnsavedChanges=!1},dl=({state:e})=>{e.isOpen=!1,e.tempValue=""},fl=({state:e},t={})=>{e.value=t.value},hl=({state:e})=>e.value;var Rs={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",value:{type:1,path:"value"}}],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=bg 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}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f placeholder=",{type:1,path:"placeholder"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=f ah=e",value:{type:9,items:[{type:8,properties:[{key:"rtgl-button#submit",value:{type:0,value:"Submit"}}],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 Zt={};R(Zt,{handleAddOptionClick:()=>Al,handleAddOptionMouseEnter:()=>El,handleAddOptionMouseLeave:()=>kl,handleBeforeMount:()=>ml,handleButtonClick:()=>gl,handleClearClick:()=>xl,handleClickOptionsPopoverOverlay:()=>vl,handleOnUpdate:()=>yl,handleOptionClick:()=>bl,handleOptionMouseEnter:()=>wl,handleOptionMouseLeave:()=>_l});var ml=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=>de(n.value,r.selectedValue));i&&(t.updateSelectedValue({value:i?.value}),s())}},yl=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.key!==s?.key&&s?.key){i.resetSelection({});let a=s?.selectedValue,l=s?.options||[];if(a!=null&&l){let p=l.find(o=>de(o.value,a));p&&i.updateSelectedValue({value:p.value})}n()}else r.selectedValue!==s.selectedValue&&(i.updateSelectedValue({value:s.selectedValue}),n())},gl=(e,t)=>{let{store:r,render:s,refs:i,props:n}=e;t._event.stopPropagation();let l=i.selectButton,p=l.firstElementChild,o=p?p.getBoundingClientRect():l.getBoundingClientRect(),c=r.selectSelectedValue(),u=c!==null?c:n.selectedValue,d=null;u!=null&&n.options&&(d=n.options.findIndex(h=>de(h.value,u)),d===-1&&(d=null)),r.openOptionsPopover({position:{y:o.bottom+12,x:o.left-24},selectedIndex:d}),s()},vl=e=>{let{store:t,render:r}=e;t.closeOptionsPopover({}),r()},bl=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=e,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()},wl=(e,t)=>{let{store:r,render:s}=e,i=t._event,n=parseInt(i.currentTarget.id.slice(6),10);r.setHoveredOption({optionId:n}),s()},_l=(e,t)=>{let{store:r,render:s}=e;r.clearHoveredOption({}),s()},xl=(e,t)=>{let{store:r,render:s,dispatchEvent:i,props:n}=e;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()},Al=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,{_event:n}=t;n.stopPropagation(),r.closeOptionsPopover({}),i(new CustomEvent("add-option-click",{bubbles:!0})),s()},El=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!0}),s()},kl=(e,t)=>{let{store:r,render:s}=e;r.setHoveredAddOption({isHovered:!1}),s()};var Ns={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"}}},w:{type:"string"}}},events:{"value-change":{},"add-option-click":{}},methods:{type:"object",properties:{}}};var Qt={};R(Qt,{clearHoveredOption:()=>Dl,clearSelectedValue:()=>jl,closeOptionsPopover:()=>Rl,createInitialState:()=>Cl,openOptionsPopover:()=>Ll,resetSelection:()=>Pl,selectSelectedValue:()=>Tl,selectState:()=>Ol,selectViewData:()=>Il,setHoveredAddOption:()=>Bl,setHoveredOption:()=>Vl,updateSelectedValue:()=>Nl});var $l=["id","class","style","slot","placeholder","selectedValue","onChange","options","noClear","addOption"],Sl=(e={})=>Object.entries(e).filter(([t])=>!$l.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Cl=()=>Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,hoveredOptionId:null,hoveredAddOption:!1}),Il=({state:e,props:t})=>{let r=Sl(t),s=e.selectedValue!==null?e.selectedValue:t.selectedValue,i=t.placeholder||"Select an option",n=!0,a=t.options||[],l=a.find(o=>de(o.value,s));l&&(i=l.label,n=!1);let p=a.map((o,c)=>{let u=de(o.value,s),d=e.hoveredOptionId===c;return{...o,isSelected:u,bgc:d?"ac":u?"mu":""}});return{containerAttrString:r,isOpen:e.isOpen,position:e.position,options:p,selectedValue:s,selectedLabel:i,selectedLabelColor:n?"mu-fg":"fg",hasValue:s!=null,showClear:!t.noClear&&s!=null,showAddOption:!!t.addOption,addOptionLabel:t.addOption?.label?`+ ${t.addOption.label}`:"+ Add",addOptionBgc:e.hoveredAddOption?"ac":""}},Ol=({state:e})=>e,Tl=({state:e})=>e.selectedValue,Ll=({state:e},t={})=>{let{position:r,selectedIndex:s}=t;e.position=r,e.isOpen=!0,s!=null&&(e.hoveredOptionId=s)},Rl=({state:e})=>{e.isOpen=!1},Nl=({state:e},t={})=>{e.selectedValue=t.value,e.isOpen=!1},Pl=({state:e})=>{e.selectedValue=void 0},Vl=({state:e},t={})=>{e.hoveredOptionId=t.optionId},Dl=({state:e})=>{e.hoveredOptionId=null},jl=({state:e})=>{e.selectedValue=void 0},Bl=({state:e},t={})=>{e.hoveredAddOption=!!t.isHovered};var Ps={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} data-testid="select-button"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view d=h av=c w=f",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text w=1fg c=${selectedLabelColor} ellipsis",value:{type:1,path:"selectedLabel"},parsedKey:{type:2,parts:["rtgl-text w=1fg 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"},' 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",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 er={};R(er,{handleHeaderClick:()=>Wl,handleItemClick:()=>Ml});var Wl=(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}))},Ml=(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 Vs={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 rr={};R(rr,{createInitialState:()=>zl,selectActiveItem:()=>Jl,selectHeader:()=>ql,selectItem:()=>Yl,selectViewData:()=>Gl,setState:()=>Xl});var zl=()=>Object.freeze({}),Fl=["id","class","style","slot","header","items","selectedItemId","mode","hideHeader","w","bwr"],Ul=(e={})=>Object.entries(e).filter(([t])=>!Fl.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),De=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}}}},Kl=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},Hl=(e,t)=>e!=null&&e!==""?e:t==="full"?272:64;function tr(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 Gl=({props:e})=>{let t=De(e.header)||e.header,r=De(e.items)||e.items,s=e.selectedItemId,i=Ul(e),n=e.mode||"full",a=t||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},l=r?tr(r,s):[],p=!Kl(e.hideHeader),o=e.bwr||"xs",c=Hl(e.w,n),u=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,g=n==="shrunk-lg"?28:20,y=n==="shrunk-lg"?"md":"sm",w=n==="full",_=n==="full",x=n==="full"?"fs":"c",A=n==="full"?"":`ah=${d}`,E=n==="full"?"f":m;return{containerAttrString:i,mode:n,header:a,items:l,sidebarWidth:c,headerAlign:u,itemAlign:d,headerPadding:h,itemPadding:f,itemHeight:m,iconSize:g,firstLetterSize:y,showLabels:w,showGroupLabels:_,itemContentAlign:x,itemAlignAttr:A,itemWidth:E,headerWidth:E,selectedItemId:s,ah:n==="shrunk-lg"||n==="shrunk-md"?"c":"",showHeader:p,rightBorderWidth:o}},ql=({props:e})=>De(e.header)||e.header,Jl=({state:e,props:t})=>{let r=De(t.items)||t.items;return(r?tr(r):[]).find(i=>i.active)},Yl=({props:e},t)=>{let r=De(e.items)||e.items;return(r?tr(r):[]).find(i=>i.id===t)},Xl=({state:e})=>{};var Ds={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 sr={};R(sr,{handleBeforeMount:()=>Zl,handleOnUpdate:()=>Ql,handleValueChange:()=>ep,handleValueInput:()=>tp});var Zl=e=>{let{store:t,props:r}=e;t.setValue({value:r.value??0})},Ql=(e,t)=>{let{oldProps:r,newProps:s}=t,{store:i,render:n}=e;if(r?.value!==s?.value){let a=s?.value??0;i.setValue({value:a}),n()}},ep=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value);r.setValue({value:a}),s(),i(new CustomEvent("value-change",{detail:{value:a},bubbles:!0}))},tp=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=e,n=t._event,a=Number(n.detail.value);r.setValue({value:a}),s(),i(new CustomEvent("value-input",{detail:{value:a},bubbles:!0}))};var js={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"}}},events:{"value-input":{},"value-change":{}},methods:{type:"object",properties:{}}};var ir={};R(ir,{createInitialState:()=>rp,selectViewData:()=>sp,setValue:()=>ip});var rp=()=>Object.freeze({value:0}),sp=({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}),ip=({state:e},t={})=>{e.value=t.value};var Bs={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}",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"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input key=${key} w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input key=",{type:1,path:"key"}," w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],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 nr={};R(nr,{handleBeforeMount:()=>np,handleHeaderClick:()=>op,handleRowClick:()=>ap});var np=e=>{},ap=(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}}))},op=(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 Ws={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 ar={};R(ar,{clearSort:()=>yp,createInitialState:()=>lp,selectSortInfo:()=>hp,selectState:()=>fp,selectViewData:()=>dp,setSortColumn:()=>mp});var lp=()=>Object.freeze({sortColumn:null,sortDirection:null}),pp=["id","class","style","slot","data"],cp=(e={})=>Object.entries(e).filter(([t])=>!pp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),up=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},dp=({state:e,props:t})=>{let r=cp(t),s=t.data||{columns:[],rows:[]},i=s.rows.map((n,a)=>{let l=s.columns.map(p=>{let o=up(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||[]}},fp=({state:e})=>e,hp=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),mp=({state:e},{column:t,direction:r}={})=>{e.sortColumn=t,e.sortDirection=r},yp=({state:e})=>{e.sortColumn=null,e.sortDirection=null};var Ms={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 or={};R(or,{handleClickItem:()=>gp});var gp=(e,t)=>{let{dispatchEvent:r}=e,i=t._event.currentTarget.dataset.id;r(new CustomEvent("item-click",{detail:{id:i}}))};var zs={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 lr={};R(lr,{createInitialState:()=>vp,selectViewData:()=>_p});var vp=()=>Object.freeze({}),bp=["id","class","style","slot","items","selectedTab"],wp=(e={})=>Object.entries(e).filter(([t])=>!bp.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),_p=({props:e})=>{let t=wp(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 Fs={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 Us={};var Ks={componentName:"rtgl-tooltip",propsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},place:{type:"string"},content:{type:"string"}}},events:[],methods:{type:"object",properties:{}}};var pr={};R(pr,{createInitialState:()=>xp,selectViewData:()=>Ap});var xp=()=>Object.freeze({}),Ap=({props:e})=>({open:!!e.open,x:e.x||0,y:e.y||0,place:e.place||"t",content:e.content||""});var Hs={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 cr={};R(cr,{handleAfterMount:()=>Ep,handleOnUpdate:()=>kp});var Ep=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&&Gs(n,a)},kp=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&&Gs(a,l)};async function Gs(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,c=r.createLinearGradient(0,0,0,l);c.addColorStop(0,"#404040"),c.addColorStop(.5,"#A1A1A1"),c.addColorStop(1,"#404040");let u=Math.max(1,a/p.length),d=.2;for(let h=0;h<p.length;h++){let m=p[h]/255*(l*.85),g=h*u,y=o-m/2;r.fillStyle=c,r.fillRect(g,y,Math.max(1,u*(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 qs={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 ur={};R(ur,{createInitialState:()=>$p,selectViewData:()=>Cp,setWaveformData:()=>Sp});var $p=()=>Object.freeze({waveformData:null}),Sp=({state:e},t={})=>{e.waveformData=t.data},Cp=({state:e,props:t})=>({isLoading:t.isLoading,w:t.w||"250",h:t.h||"150",cur:t.cur,waveformData:t.waveformData});var Js={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(),Xe=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ye=e=>{if(e!=null)return e===""?!0:e},Ys=(e,t)=>{let r=e.getAttribute(t);if(r!==null)return Ye(r);let s=dr(t);if(s!==t){let i=e.getAttribute(s);if(i!==null)return Ye(i)}},Xs=(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:Ys(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:Ys(e,i)}}}})};var Zs=({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},je={NOT:0};var O=class extends Error{constructor(t){super(`Parse Error: ${t}`),this.name="JemplParseError"}},Q=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var fr=e=>{if(!e||e.trim()==="")throw new O("Missing condition expression after '$if'");if(e.includes("===")||e.includes("!==")){let r=e.includes("===")?"==":"!=";throw new O(`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 O(`Incomplete comparison expression - missing right operand (got: '${e}')`)},Qs=e=>{if(e.trim().endsWith(" in"))throw new O(`Missing iterable expression after 'in' (got: '$for ${e}')`);if(!e.includes(" in "))throw new O(`Invalid loop syntax - missing 'in' keyword (got: '$for ${e}')`);let[t,r]=e.split(" in ");if(!r||r.trim()==="")throw new O(`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 O(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)}else if(!t.trim())throw new O(`Invalid loop variable - variable name cannot be empty (got: '$for ${e}')`)};var ei=(e,t,r=!1)=>{if(t===null)return new Q(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new Q(`Cannot iterate over undefined value at '$for ${e}'`);let s=typeof t;return r?new Q(`Cannot iterate over non-array value in loop '${e}' - got ${s} instead`):new Q(`Cannot iterate over non-array value (got: ${s}) at '$for ${e}'`)},ti=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new Q(`Unknown function '${e}' (${r})`)};var Ip=(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 z(e.var,r,s);if(e.type===v.LITERAL)return e.value;if(e.type===v.VARIABLE)return z(e.path,r,s);if(e.type===v.INTERPOLATION)return Tp(e.parts,t,r,s);switch(e.type){case v.FUNCTION:return si(e,t,r,s);case v.BINARY:return ii(e,t,r,s);case v.UNARY:return ni(e,t,r,s);case v.CONDITIONAL:return Rp(e,t,r,s);case v.LOOP:return jp(e,t,r,s);case v.OBJECT:return Wp(e,t,r,s);case v.ARRAY:return Mp(e,t,r,s);case v.PARTIAL:return zp(e,t,r,s);case v.PATH_REFERENCE:return Fp(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ri=new Map,Op=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},z=(e,t,r)=>{if(!e)return;if(e in r)return r[e];let s=ri.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=Op(p.trim());s.push(...o)}ri.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},Tp=(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("")},si=(e,t,r,s)=>{let i=t.functions||t,n=i[e.name];if(!n)throw ti(e.name,i);let a=e.args.map(l=>I(l,t,r,s));return n(...a)},ke=(e,t,r,s)=>{if(e.var&&!e.type)return z(e.var,r,s);switch(e.type){case v.VARIABLE:return z(e.path,r,s);case v.LITERAL:return e.value;case v.BINARY:return ii(e,t,r,s);case v.UNARY:return ni(e,t,r,s);case v.FUNCTION:return si(e,t,r,s);default:return I(e,t,r,s)}},ii=(e,t,r,s)=>{if(e.op===D.AND||e.op===D.OR){let a=ke(e.left,t,r,s),l=ke(e.right,t,r,s);switch(e.op){case D.AND:return a&&l;case D.OR:return a||l}}let i=I(e.left,t,r,s),n=I(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 Q(`Arithmetic operations require numbers. Got ${typeof i} + ${typeof n}`);return i+n;case D.SUBTRACT:if(typeof i!="number"||typeof n!="number")throw new Q(`Arithmetic operations require numbers. Got ${typeof i} - ${typeof n}`);return i-n;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ni=(e,t,r,s)=>{let i=e.op===je.NOT?ke(e.operand,t,r,s):I(e.operand,t,r,s);switch(e.op){case je.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Lp=(e,t,r,s)=>{if(e.conditions.length===2&&e.conditions[1]===null){let i=e.conditions[0];if(i.type===v.VARIABLE)if(z(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?I(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=z(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let h=z(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=I(c,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?I(p.parsedKey,t,r,s):p.key,c=p.value;if(c.type===v.LITERAL)l[o]=c.value;else if(c.type===v.VARIABLE)l[o]=z(c.path,r,s);else if(c.type===v.INTERPOLATION){let u=[];for(let d of c.parts)if(typeof d=="string")u.push(d);else if(d.type===v.VARIABLE){let h=z(d.path,r,s);u.push(h!=null?String(h):"")}else{let h=I(d,t,r,s);u.push(h!=null?String(h):"")}l[o]=u.join("")}else l[o]=I(c,t,r,s)}return l}}}return null},Rp=(e,t,r,s)=>{let i=Lp(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||ke(a,t,r,s))return I(e.bodies[n],t,r,s)}return ai},Np=(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 c={};for(let u of n.properties){let d=u.key,h=u.value;if(h.type===v.LITERAL)c[d]=h.value;else if(h.type===v.VARIABLE){let f=h.path;if(f===s)c[d]=o;else if(f.startsWith(s+".")){let m=f.substring(s.length+1);c[d]=o[m]}else return null}else if(h.type===v.INTERPOLATION){let f=[],m=!0;for(let g of h.parts)if(typeof g=="string")f.push(g);else if(g.type===v.VARIABLE){let y=g.path;if(y===s)f.push(o!=null?String(o):"");else if(y.startsWith(s+".")){let w=y.substring(s.length+1),_=o[w];f.push(_!=null?String(_):"")}else{m=!1;break}}else{m=!1;break}if(!m)return null;c[d]=f.join("")}else return null}l.push(c)}}return l}}}return null},Pp=(e,t)=>{let r=e.body,s=e.itemVar,i=Np(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 c=o.path;if(c===s)n.push({key:p,type:"item"});else if(c.startsWith(s+".")){let u=c.substring(s.length+1);if(!u.includes(".")&&!u.includes("["))n.push({key:p,type:"prop",prop:u});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 u=c.path;if(u===s)n.push({key:p,type:"item_string"});else if(u.startsWith(s+".")){let d=u.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],c={};for(let u of n)if(u.type==="literal")c[u.key]=u.value;else if(u.type==="item")c[u.key]=o;else if(u.type==="prop")c[u.key]=o[u.prop];else if(u.type==="item_string")c[u.key]=o!=null?String(o):"";else if(u.type==="prop_string"){let d=o[u.prop];c[u.key]=d!=null?String(d):""}l[p]=c}return l}}return null},Vp=(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 c=i[o],u={},d={...s,[l]:c,...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,g=f.value;if(g.type===v.LITERAL)u[m]=g.value;else if(g.type===v.VARIABLE){let y=g.path;if(y===l)u[m]=c;else if(y===p)u[m]=o;else if(y.startsWith(l+".")){let w=y.substring(l.length+1);!w.includes(".")&&!w.includes("[")?u[m]=c[w]:u[m]=z(y,r,{...s,[l]:c,...p&&{[p]:o}})}else u[m]=z(y,r,{...s,[l]:c,...p&&{[p]:o}})}else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let _=w.path,x;if(_===l)x=c;else if(_===p)x=o;else if(_.startsWith(l+".")){let A=_.substring(l.length+1);!A.includes(".")&&!A.includes("[")?x=c[A]:x=z(_,r,{...s,[l]:c,...p&&{[p]:o}})}else x=z(_,r,{...s,[l]:c,...p&&{[p]:o}});y.push(x!=null?String(x):"")}else{let _={...s,[l]:c,...p&&{[p]:o}},x=I(w,t,r,_);y.push(x!=null?String(x):"")}u[m]=y.join("")}else{let y={...s,[l]:c,...p&&{[p]:o}};u[m]=I(g,t,r,y)}}n.push(u)}return n}return null},Dp=(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 c=0;c<t.length;c++){let u=t[c];if(u.visible){let d={id:u.id};u.highlighted?(d.highlight=!0,d.message=`This item is highlighted: ${u.name}`):(d.highlight=!1,d.message=u.name),o.push(d)}}return o}}}}return null},jp=(e,t,r,s)=>{let i=I(e.iterable,t,r,s);if(!Array.isArray(i)){let o,c=!1;if(e.iterable.type===v.FUNCTION){c=!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 u=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${o}`;throw ei(u,i,c)}if(!e.indexVar){let o=Dp(e,i,e.itemVar);if(o!==null)return o}if(!e.indexVar){let o=Pp(e,i);if(o!==null)return o}let n=Vp(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("."),c=o[0];c in s.__paths__&&(l=s.__paths__[c],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(c=>c.key.startsWith("$if ")||c.key.startsWith("$when "))));for(let o=0;o<i.length;o++){let c=e.indexVar?{...s,[e.itemVar]:i[o],[e.indexVar]:o}:{...s,[e.itemVar]:i[o]};c.__paths__||(c.__paths__=s.__paths__||{}),c.__paths__={...c.__paths__,[e.itemVar]:`${l}[${o}]`},e.indexVar&&(c.__paths__[e.indexVar]=o);let u=I(e.body,t,r,c);Array.isArray(u)&&u.length===1&&!p?a.push(u[0]):a.push(u)}return a},Bp=(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===v.OBJECT&&a.properties.length<=10&&!a.whenCondition){let l={},p={},o=!0;for(let c of a.properties){let u=c.parsedKey?I(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)p[u]=d.value;else if(d.type===v.VARIABLE)p[u]=z(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=z(f.path,r,s);h.push(m!=null?String(m):"")}else{o=!1;break}if(!o)break;p[u]=h.join("")}else if(d.type===v.OBJECT&&d.properties.length<=5){let h={};for(let f of d.properties){let m=f.key,g=f.value;if(g.type===v.LITERAL)h[m]=g.value;else if(g.type===v.VARIABLE)h[m]=z(g.path,r,s);else if(g.type===v.INTERPOLATION){let y=[];for(let w of g.parts)if(typeof w=="string")y.push(w);else if(w.type===v.VARIABLE){let _=z(w.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[u]=h}else{o=!1;break}}if(o)return l[n]=p,l}}return null},Wp=(e,t,r,s)=>{let i=t.functions||t;if(e.whenCondition&&!ke(e.whenCondition,i,r,s))return;let n=Bp(e,t,r,s);if(n!==null)return n;if(e.fast){let o={};for(let c of e.properties){let u=c.parsedKey?I(c.parsedKey,t,r,s):c.key,d=c.value;if(d.type===v.LITERAL)o[u]=d.value;else if(d.type===v.VARIABLE)o[u]=z(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=z(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[u]=h.join("")}else o[u]=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 c=I(o.value,t,r,s);if(!p&&c!==null&&c!==void 0)return Array.isArray(c)&&c.length===1?c[0]:c;typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.assign(a,c)}else if(o.key.startsWith("$for ")){if(e.properties.length===1)return I(o.value,t,r,s)}else{let c=o.value;if(c&&c.type===v.OBJECT&&c.properties){let u=c.properties.find(d=>d.key.startsWith("$for "));if(u){let d=I(u.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 u=o.parsedKey?I(o.parsedKey,t,r,s):o.key,d=I(o.value,t,r,s);d!==void 0&&(a[u]=d)}}return a},ai={},Mp=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===v.LOOP){let a=I(n,t,r,s);i.push(a)}else{let a=I(n,t,r,s);a!==ai&&a!==void 0&&i.push(a)}return i},zp=(e,t,r,s)=>{let{name:i,data:n,whenCondition:a}=e,l=t.partials||{},p=t.functions||t;if(a&&!ke(a,p,r,s))return;if(!l[i])throw new Q(`Partial '${i}' is not defined`);let o=s._partialStack||[];if(o.includes(i))throw new Q(`Circular partial reference detected: ${i}`);let c=l[i],u=r,d={...s,_partialStack:[...o,i]};if(s){u={...r};for(let h of Object.keys(s))h.startsWith("_")||(u[h]=s[h])}if(n){let h=I(n,t,r,s);u={...u,...h}}return I(c,t,u,d)},Fp=(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 Q(`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 Q(`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 Q(`Path reference '#{${i}}' - cannot access properties on index variable '${a}'`);return String(p)}return l.length>0&&(p+="."+l.join(".")),p},Be=Ip;var Up=/\$\{([^}]*)\}/g,Kp=/#\{([^}]*)\}/g,li=(e,t={})=>{let r=e.match(/^(\w+)\((.*)\)$/);if(!r)return{isFunction:!1};let[,s,i]=r,n=Hp(i,t);return{isFunction:!0,type:v.FUNCTION,name:s,args:n}},Hp=(e,t={})=>e.trim()?Gp(e).map(s=>qp(s.trim(),t)):[],Gp=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},qp=(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=li(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 c=ve(s.substring(o),l);if(c===-1)break;let u=o+c;u>n&&(n=u,a={op:l,type:p}),o=u+l.length}}if(n!==-1)try{return Y(s,t)}catch{return{type:v.VARIABLE,path:s}}return{type:v.VARIABLE,path:s}},pi=/^\w+\(.*\)$/,Jp=/\s[+\-*/%]\s|\|\||&&|\?\?|.*\?.*:/,Yp=e=>{if(!(!e||e.trim()===""||pi.test(e))&&Jp.test(e))throw e.includes("?")&&e.includes(":")?new O(`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 O(`Logical operators not supported in variable replacements - consider calculating the value in your data instead (operators like ||, &&, ?? are not supported). Offending expression: "${e}"`):new O(`Arithmetic expressions not supported in variable replacements - consider calculating '${e}' in your data instead (expressions with +, -, *, /, % are not supported). Offending expression: "${e}"`)},oi=e=>{let t=e.trim();if(pi.test(t))throw new O(`Functions are not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(t.includes("["))throw new O(`Array indices not supported in path references - use simple variable names or properties. Offending expression: "#{${e}}"`);if(/[+\-*/%]/.test(t))throw new O(`Arithmetic expressions not supported in path references - path references can only refer to loop variables. Offending expression: "#{${e}}"`);if(/\|\||&&/.test(t))throw new O(`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 O(`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}},We=(e,t={})=>{let r=e.trim();Yp(r);let s=li(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}},hr=(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,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\(#\{[^}]*\})/g,(o,c)=>{let u=`__ESCAPED_${s.length}__`;return s.push(c),u}),r=r.replace(/\\DOUBLE_ESC_VAR/g,"\\"),r=r.replace(/\\DOUBLE_ESC_PATH/g,"\\"));let i=[...r.matchAll(Up)],n=[...r.matchAll(Kp)],a=[...i.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<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);return{type:v.LITERAL,value:o}}if(a.length===1&&a[0].match[0]===r&&s.length===0){let{match:o,type:c}=a[0];try{return c==="variable"?We(o[1],t):oi(o[1])}catch(u){if(u.message==="Invalid array index syntax")return{type:v.LITERAL,value:r};throw u}}let l=[],p=0;for(let{match:o,type:c}of a){let[u,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;c==="variable"?f=We(d.trim(),t):f=oi(d.trim()),l.push(f)}catch(f){if(f.message==="Invalid array index syntax")l.push(u);else throw f}p=h+u.length}if(p<r.length){let o=r.substring(p);for(let c=0;c<s.length;c++)o=o.replace(`__ESCAPED_${c}__`,s[c]);o&&l.push(o)}return{type:v.INTERPOLATION,parts:l}};var he=(e,t)=>typeof e=="string"?hr(e,t):typeof e=="object"&&e!==null?Array.isArray(e)?Xp(e,t):Zp(e,t):{type:v.LITERAL,value:e},Xp=(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=ui(l[0],n[l[0]],t);r.push(p),s=!0;continue}}let a=he(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}},Zp=(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 O("$partial value must be a string");if(e.$partial.trim()==="")throw new O("$partial value cannot be an empty string");let p=["$if","$elif","$else","$for"],o=[];for(let[y]of n)for(let w of p)if(y===w||y.startsWith(w+" ")||y.startsWith(w+"#")){o.push(w);break}if(o.length>0)throw new O(`Cannot use $partial with ${o.join(", ")} at the same level. Wrap $partial in a parent object if you need conditionals.`);let{$partial:c,$when:u,...d}=e,h={},f=!1;for(let[y,w]of Object.entries(d)){let _=y;(y.startsWith("\\$")||y.startsWith("$$"))&&(_=y.slice(1)),h[_]=w,f=!0}let m=null;if(f&&(m=he(h,t),m.type===v.OBJECT)){let y=!1;for(let w of m.properties)if(w.value.type===v.VARIABLE||w.value.type===v.INTERPOLATION||w.value.type===v.FUNCTION||w.value.type===v.CONDITIONAL||w.value.type===v.LOOP||w.value.type===v.OBJECT&&!w.value.fast||w.value.type===v.ARRAY&&!w.value.fast){y=!0;break}y&&(m.fast=!1)}let g={type:v.PARTIAL,name:c,data:m};if(u!==void 0){let y;if(typeof u=="string"){if(u.trim()==="")throw new O("Empty condition expression after '$when'");y=Y(u,t)}else y={type:v.LITERAL,value:u};g.whenCondition=y}return g}for(let[p,o]of n)if(p==="$when"){if(i!==null)throw new O("Multiple '$when' directives on the same object are not allowed");if(o==null)throw new O("Missing condition expression after '$when'");let c=typeof o=="string"?o:JSON.stringify(o);if(c.trim()==="")throw new O("Empty condition expression after '$when'");i=Y(c,t),s=!0}else if(p.startsWith("$when#")||p.startsWith("$when "))throw new O("'$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 c=Qp(n,a,t);r.push({key:p,value:c.node}),s=!0,a=c.nextIndex}else if(p.startsWith("$for ")){let c=ui(p,o,t);r.push({key:p,value:c}),s=!0,a++}else{if(p.startsWith("$elif ")||p.startsWith("$else"))throw new O(`'${p.split(" ")[0]}' without matching '$if'`);if(p==="$if"||p==="$if:")throw new O("Missing condition expression after '$if'");{let c=he(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)&&(s=!0);let u=hr(p,t),d={key:p,value:c};(u.type!==v.LITERAL||u.value!==p)&&(d.parsedKey=u),r.push(d),a++}}}let l={type:v.OBJECT,properties:r,fast:!s};return i&&(l.whenCondition=i),l},Qp=(e,t,r={})=>{let s=[],i=[],n=t,[a,l]=e[n],p=null,o;if(a.startsWith("$if#")){let u=a.match(/^\$if#(\w+)\s+(.+)$/);if(u)p=u[1],o=u[2];else throw new O(`Invalid conditional syntax: ${a}`)}else o=a.substring(4),o.endsWith(":")&&(o=o.slice(0,-1).trim());fr(o);let c=Y(o,r);for(s.push(c),i.push(he(l,r)),n++;n<e.length;){let[u,d]=e[n],h=!1,f;if(p?u.startsWith(`$elif#${p} `)?(f=u.substring(`$elif#${p} `.length),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u===`$else#${p}`||u===`$else#${p}:`)&&(h=!0,f=null):u.startsWith("$elif ")?(f=u.substring(6),f.endsWith(":")&&(f=f.slice(0,-1).trim()),h=!0):(u==="$else"||u==="$else:")&&(h=!0,f=null),h){if(f===null)s.push(null);else{fr(f);let m=Y(f,r);s.push(m)}if(i.push(he(d,r)),n++,f===null)break}else break}return{node:{type:v.CONDITIONAL,conditions:s,bodies:i,id:p},nextIndex:n}},Y=(e,t={})=>{if(e=e.trim(),e.startsWith("(")&&e.endsWith(")")){let o=e.slice(1,-1),c=0,u=!0;for(let d=0;d<o.length;d++)if(o[d]==="("?c++:o[d]===")"&&c--,c<0){u=!1;break}if(u&&c===0)return Y(o,t)}let r=ve(e,"||");if(r!==-1)return{type:v.BINARY,op:D.OR,left:Y(e.substring(0,r).trim(),t),right:Y(e.substring(r+2).trim(),t)};let s=ve(e,"&&");if(s!==-1)return{type:v.BINARY,op:D.AND,left:Y(e.substring(0,s).trim(),t),right:Y(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:c}of i){let u=ve(e,o);if(u!==-1)return{type:v.BINARY,op:c,left:Y(e.substring(0,u).trim(),t),right:Y(e.substring(u+o.length).trim(),t)}}let n=-1,a=null,l=[{op:" + ",type:D.ADD},{op:" - ",type:D.SUBTRACT}];for(let{op:o,type:c}of l){let u=0;for(;u<e.length;){let d=ve(e.substring(u),o);if(d===-1)break;let h=u+d;h>n&&(n=h,a={op:o,type:c}),u=h+o.length}}if(n!==-1&&a)return{type:v.BINARY,op:a.type,left:Y(e.substring(0,n).trim(),t),right:Y(e.substring(n+a.op.length).trim(),t)};let p=[" * "," / "," % "];for(let o of p)if(ve(e,o)!==-1)throw new O(`Arithmetic operations are not allowed in conditionals: "${o}"`);return e.startsWith("!")?{type:v.UNARY,op:je.NOT,operand:Y(e.substring(1).trim(),t)}:ci(e,t)},ve=(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},ec=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}},ci=(e,t)=>{let r=e.trim();if(r.match(/^(\w+)\((.*)\)$/))return We(r,t);let i=ec(r);if(i.type===v.LITERAL)return i;if(/^[a-zA-Z_$][\w.$]*$/.test(r))return{type:v.VARIABLE,path:r};try{return We(r,t)}catch(n){if(n.message&&n.message.includes("not supported"))return i;throw n}},ui=(e,t,r)=>{let s=e.substring(5).trim();Qs(s);let i=s.match(/^(.+?)\s+in\s+(.+)$/);if(!i)throw new O(`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 u=n.split(",").map(d=>d.trim());if(u.length!==2)throw new O(`Invalid loop variables: ${n}. Expected format: "item" or "item, index"`);l=u[0],p=u[1]}else l=n;let o=ci(a,r),c=he(t,r);return{type:v.LOOP,itemVar:l,indexVar:p,iterable:o,body:c}};var tc=(e,t={})=>{let{functions:r={}}=t;return he(e,r)},Ze=tc;var mr={};R(mr,{now:()=>rc});var rc=()=>Date.now();var sc=(e,t,r={})=>{let{functions:s={},partials:i={}}=r,n={...mr,...s},a=Ze(e,{functions:n}),l={};for(let[p,o]of Object.entries(i))l[p]=Ze(o,{functions:n});return Be(a,t,{functions:n,partials:l})},Me=sc;var me=e=>e!==null&&typeof e=="object"&&!Array.isArray(e);var di=(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(!me(n))throw new Error(`[Methods] Method '${r}' expects payload to be an object.`);return s.call(e,n)}})}})};var vi=Symbol.for("immer-nothing"),fi=Symbol.for("immer-draftable"),se=Symbol.for("immer-state");function ae(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var $e=Object.getPrototypeOf;function Se(e){return!!e&&!!e[se]}function we(e){return e?bi(e)||Array.isArray(e)||!!e[fi]||!!e.constructor?.[fi]||st(e)||it(e):!1}var ic=Object.prototype.constructor.toString();function bi(e){if(!e||typeof e!="object")return!1;let t=$e(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)===ic}function Qe(e,t){rt(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function rt(e){let t=e[se];return t?t.type_:Array.isArray(e)?1:st(e)?2:it(e)?3:0}function vr(e,t){return rt(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wi(e,t,r){let s=rt(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function nc(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function st(e){return e instanceof Map}function it(e){return e instanceof Set}function be(e){return e.copy_||e.base_}function br(e,t){if(st(e))return new Map(e);if(it(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=bi(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[se];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($e(e),s)}else{let s=$e(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function Er(e,t=!1){return nt(e)||Se(e)||!we(e)||(rt(e)>1&&(e.set=e.add=e.clear=e.delete=ac),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>Er(s,!0))),e}function ac(){ae(2)}function nt(e){return Object.isFrozen(e)}var oc={};function _e(e){let t=oc[e];return t||ae(0,e),t}var ze;function _i(){return ze}function lc(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function hi(e,t){t&&(_e("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wr(e){_r(e),e.drafts_.forEach(pc),e.drafts_=null}function _r(e){e===ze&&(ze=e.parent_)}function mi(e){return ze=lc(ze,e)}function pc(e){let t=e[se];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function yi(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[se].modified_&&(wr(t),ae(4)),we(e)&&(e=et(t,e),t.parent_||tt(t,e)),t.patches_&&_e("Patches").generateReplacementPatches_(r[se].base_,e,t.patches_,t.inversePatches_)):e=et(t,r,[]),wr(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==vi?e:void 0}function et(e,t,r){if(nt(t))return t;let s=t[se];if(!s)return Qe(t,(i,n)=>gi(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return tt(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),Qe(n,(l,p)=>gi(e,s,i,l,p,r,a)),tt(e,i,!1),r&&e.patches_&&_e("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function gi(e,t,r,s,i,n,a){if(Se(i)){let l=n&&t&&t.type_!==3&&!vr(t.assigned_,s)?n.concat(s):void 0,p=et(e,i,l);if(wi(r,s,p),Se(p))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(we(i)&&!nt(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;et(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&tt(e,i)}}function tt(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Er(t,r)}function cc(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:_i(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=kr;r&&(i=[s],n=Fe);let{revoke:a,proxy:l}=Proxy.revocable(i,n);return s.draft_=l,s.revoke_=a,l}var kr={get(e,t){if(t===se)return e;let r=be(e);if(!vr(r,t))return uc(e,r,t);let s=r[t];return e.finalized_||!we(s)?s:s===yr(e.base_,t)?(gr(e),e.copy_[t]=Ar(s,e)):s},has(e,t){return t in be(e)},ownKeys(e){return Reflect.ownKeys(be(e))},set(e,t,r){let s=xi(be(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=yr(be(e),t),n=i?.[se];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(nc(r,i)&&(r!==void 0||vr(e.base_,t)))return!0;gr(e),xr(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 yr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gr(e),xr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=be(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){ae(11)},getPrototypeOf(e){return $e(e.base_)},setPrototypeOf(){ae(12)}},Fe={};Qe(kr,(e,t)=>{Fe[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Fe.deleteProperty=function(e,t){return Fe.set.call(this,e,t,void 0)};Fe.set=function(e,t,r){return kr.set.call(this,e[0],t,r,e[0])};function yr(e,t){let r=e[se];return(r?be(r):e)[t]}function uc(e,t,r){let s=xi(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function xi(e,t){if(!(t in e))return;let r=$e(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=$e(r)}}function xr(e){e.modified_||(e.modified_=!0,e.parent_&&xr(e.parent_))}function gr(e){e.copy_||(e.copy_=br(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var dc=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,c=>r.call(this,c,...o))}}typeof r!="function"&&ae(6),s!==void 0&&typeof s!="function"&&ae(7);let i;if(we(t)){let n=mi(this),a=Ar(t,void 0),l=!0;try{i=r(a),l=!1}finally{l?wr(n):_r(n)}return hi(n,s),yi(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===vi&&(i=void 0),this.autoFreeze_&&Er(i,!0),s){let n=[],a=[];_e("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else ae(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){we(e)||ae(8),Se(e)&&(e=fc(e));let t=mi(this),r=Ar(e,void 0);return r[se].isManual_=!0,_r(t),r}finishDraft(e,t){let r=e&&e[se];(!r||!r.isManual_)&&ae(9);let{scope_:s}=r;return hi(s,t),yi(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 Se(e)?s(e,t):this.produce(e,i=>s(i,t))}};function Ar(e,t){let r=st(e)?_e("MapSet").proxyMap_(e,t):it(e)?_e("MapSet").proxySet_(e,t):cc(e,t);return(t?t.scope_:_i()).drafts_.push(r),r}function fc(e){return Se(e)||ae(10,e),Ai(e)}function Ai(e){if(!we(e)||nt(e))return e;let t=e[se],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=br(e,t.scope_.immer_.useStrictShallowCopy_)}else r=br(e,!0);return Qe(r,(s,i)=>{wi(r,s,Ai(i))}),t&&(t.finalized_=!1),r}var ie=new dc,Ei=ie.produce,gh=ie.produceWithPatches.bind(ie),vh=ie.setAutoFreeze.bind(ie),bh=ie.setUseStrictShallowCopy.bind(ie),wh=ie.applyPatches.bind(ie),_h=ie.createDraft.bind(ie),xh=ie.finishDraft.bind(ie);var ki=(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]=(...c)=>o({state:l,props:t,constants:r},...c);return}a[p]=(c={})=>{let u=c===void 0?{}:c;if(!me(u))throw new Error(`[Store] Action '${p}' expects payload to be an object.`);return l=Ei(l,d=>o({state:d,props:t,constants:r},u)),l}}),{getState:()=>l,...a,...n}};var $i=e=>!me(e)||Object.isFrozen(e)?e:(Object.values(e).forEach(t=>{$i(t)}),Object.freeze(e)),Si=({setupConstants:e,fileConstants:t})=>{let r=me(e)?e:{},s=me(t)?t:{};return $i({...r,...s})};var Ci=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,l])=>` ${a}: ${l};`).join(`
|
|
974
|
+
`),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let p=Object.entries(a).map(([o,c])=>{let u=s(c);return` ${o} {
|
|
975
|
+
${u.split(`
|
|
976
|
+
`).map(d=>d?` ${d}`:"").join(`
|
|
977
977
|
`)}
|
|
978
978
|
}`}).join(`
|
|
979
979
|
`);return`${n} {
|
|
980
|
+
${p}
|
|
981
|
+
}`}let l=s(a);return`${n} {
|
|
980
982
|
${l}
|
|
981
|
-
}`}let
|
|
982
|
-
${a}
|
|
983
|
-
}`};return Object.entries(t).forEach(([n,o])=>{let a=i(n,o);a&&(r+=(r?`
|
|
983
|
+
}`};return Object.entries(t).forEach(([n,a])=>{let l=i(n,a);l&&(r+=(r?`
|
|
984
984
|
|
|
985
|
-
`:"")+a)}),r};var nt=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...nt(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]:nt(n)})}}t.push(r)}return t},[]):e;var $i=":",lc=new Set(["__proto__","constructor","prototype"]),Si=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let o=0;o<t.length;o++){let a=t[o];if(!i&&a===".")s&&(r.push(s),s="");else if(!i&&a==="[")s&&(r.push(s),s=""),i=!0;else if(i&&a==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(Number.isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(a==='"'||a==="'")&&(n?a===n&&(n=null):n=a),s+=a}return s&&r.push(s),r.reduce((o,a)=>{if(o==null)return;let l=typeof a=="number"?a:String(a);if(!(typeof l=="string"&&lc.has(l)))return o[l]},e)},pc=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ci=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:s})=>{let i={},n={},o=y=>{if(y==="role"||y.startsWith("aria-")||y.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${y}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},a=(y,w,x)=>{let _=pc(y);if(!_)throw new Error(`[Parser] Invalid ${x} 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[_]=w};if(!e)return{attrs:i,props:n};let l=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,p,u=new Set;for(;(p=l.exec(e))!==null;){let y=p[1],w=p[2]??p[3]??p[4]??"";if(u.add(y),y.startsWith(".")){i[y]=w;continue}if(y.startsWith($i)){let x=y.substring(1),_=w;if(p[4]!==void 0&&p[4]!==""){let E=p[4],A=Si(t,E);A!==void 0&&(_=A)}a(x,_,"property-form");continue}if(y.startsWith("?")){let x=y.substring(1),_=w;o(x);let E;_==="true"?E=!0:_==="false"||_===""?E=!1:E=Si(t,_),E&&(i[x]=""),s&&x!=="id"&&a(x,!!E,"boolean attribute-form");continue}i[y]=w,s&&y!=="id"&&a(y,w,"attribute-form")}let c=e,f=[],h,d=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(h=d.exec(e))!==null;)f.push(h[0]);f.forEach(y=>{c=c.replace(y," ")});let m=/\b(\S+?)(?=\s|$)/g,g;for(;(g=m.exec(c))!==null;){let y=g[1];y.startsWith(".")||!u.has(y)&&!y.startsWith($i)&&!y.includes("=")&&(i[y]="",s&&y!=="id"&&a(y,!0,"boolean attribute-form"))}return{attrs:i,props:n}};var cc=/^[a-z][a-zA-Z0-9]*\*?$/,uc=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,dc=/^[a-z][a-zA-Z0-9]*$/,Ii=new Set(["window","document"]),ot=e=>Object.entries(e||{}).map(([t,r])=>{if(Ii.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(Ii.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(s==="id"&&!cc.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(s==="class"&&!uc.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Class refs must start with '.' and use class-compatible names (optional '*').`);let o=i.endsWith("*"),a=o?i.slice(0,-1):i;return{refKey:t,refConfig:r,targetType:s,isWildcard:o,prefix:a}}),Li=e=>{if(!dc.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Oi=({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"){Oi({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&s.push({...n,matchedValue:e});return}let o=i.find(a=>Oi({value:a,prefix:n.prefix,isWildcard:n.isWildcard}));o&&s.push({...n,matchedValue:o})}),s.length===0?null:(s.sort((n,o)=>{let a=n.targetType==="id"?2:1,l=o.targetType==="id"?2:1;return a!==l?l-a:!n.isWildcard&&o.isWildcard?-1:n.isWildcard&&!o.isWildcard?1:o.prefix.length-n.prefix.length}),s[0])},ze=({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.`)},Ti=({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.`)},Ri=({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(ze({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),ze({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),ze({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),ze({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),ze({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Ti({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Ti({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 lt=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),fc=({eventConfig:e,handlers:t,onMissingHandler:r,parseAndRenderFn:s})=>{let i=n=>{let o=e.payload&&typeof e.payload=="object"&&!Array.isArray(e.payload)?e.payload:{};return typeof s!="function"?o:s(o,{_event:n})};if(e.action){if(typeof t.handleCallStoreAction!="function")throw new Error(`[Runtime] Action listener '${e.action}' requires handlers.handleCallStoreAction.`);return n=>{let o=i(n);t.handleCallStoreAction({...o,_event:n,_action:e.action})}}return e.handler&&t[e.handler]?n=>{let o=i(n);t[e.handler]({...o,_event:n})}:(e.handler&&r?.(e.handler),null)},hc=({eventConfig:e,callback:t,hasDebounce:r,hasThrottle:s,stateKey:i,eventRateLimitState:n,fallbackCurrentTarget:o=null,nowFn:a=Date.now,setTimeoutFn:l=setTimeout,clearTimeoutFn:p=clearTimeout})=>u=>{let c=n.get(i)||{},f=u.currentTarget||o;if(e.once)if(f){if(c.onceTargets||(c.onceTargets=new WeakSet),c.onceTargets.has(f)){n.set(i,c);return}c.onceTargets.add(f)}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&&p(c.debounceTimer),c.debounceTimer=l(()=>{let h=c.debounceTimer;try{t(u)}catch(d){throw p(h),c.debounceTimer=null,d}c.debounceTimer=null},e.debounce),n.set(i,c);return}if(s){Object.prototype.hasOwnProperty.call(c,"lastThrottleAt")||(c.lastThrottleAt=void 0);let h=a();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)},pt=({eventType:e,eventConfig:t,refKey:r,handlers:s,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:o=null,parseAndRenderFn:a,onMissingHandler:l,nowFn:p=Date.now,setTimeoutFn:u=setTimeout,clearTimeoutFn:c=clearTimeout})=>{let{hasDebounce:f,hasThrottle:h}=Ri({eventType:e,eventConfig:t,refKey:r}),d=fc({eventConfig:t,handlers:s,onMissingHandler:l,parseAndRenderFn:a});return d?hc({eventConfig:t,callback:d,hasDebounce:f,hasThrottle:h,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:o,nowFn:p,setTimeoutFn:u,clearTimeoutFn:c}):null};var Ni=({h:e,template:t,viewData:r,refs:s,handlers:i,createComponentUpdateHook:n})=>{let o=De(t,r,{}),a=nt(o),l=mc({h:e,items:a,refs:s,handlers:i,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},l)},mc=({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 o=ot(r),a=o.some(p=>p.targetType==="id");function l(p,u=""){return p.map((c,f)=>{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 h=Object.entries(c);if(h.length===0)return null;let[d,m]=h[0];if(!isNaN(Number(d)))return Array.isArray(m)?l(m,`${u}.${d}`):typeof m=="object"&&m!==null&&Object.entries(m).length>0?l([m],`${u}.${d}`):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",d);let g,y,w=d.indexOf(" ");w===-1?(g=d,y=""):(g=d.substring(0,w),y=d.substring(w+1).trim());let x=g.split(/[.#]/)[0],_=x.includes("-"),E,A;try{({attrs:E,props:A}=Ci({attrsString:y,viewData:i,tagName:x,isWebComponent:_}))}catch(D){throw new Error(`[Parser] Failed to parse bindings for selector '${g}' with attrs '${y}': ${D.message}`)}let C=g.match(/#([^.#\s]+)/);C&&!Object.prototype.hasOwnProperty.call(E,"id")&&(E.id=C[1]);let $=null;E.id&&($=E.id);let W=(g.match(/\.([^.#]+)/g)||[]).map(D=>D.substring(1)),j=typeof E.class=="string"?E.class.split(/\s+/).filter(Boolean):[],K=[...new Set([...W,...j])],Y=Object.create(null),pe=null;if(!_){W.forEach(ae=>{Y[ae]=!0});let D=g.match(/#([^.#\s]+)/);D&&(pe=D[1])}let me;typeof m=="string"||typeof m=="number"?me=String(m):Array.isArray(m)?me=l(m,`${u}.${d}`):me=[],pe&&!_&&(E.id=pe);let dt=Object.create(null);if(o.length>0){a&&$&&Li($);let D=at({elementIdForRefs:$,classNames:K,refMatchers:o});if(D){let ae=D.refKey,Tr=D.matchedValue||$||ae;if(D.refConfig&&D.refConfig.eventListeners){let xn=D.refConfig.eventListeners,_n=lt(s);Object.entries(xn).forEach(([ft,En])=>{let An=`${ae}:${Tr}:${ft}`,Lr=pt({eventType:ft,eventConfig:En,refKey:ae,handlers:s,eventRateLimitState:_n,stateKey:An,parseAndRenderFn:Be,onMissingHandler:kn=>{console.warn(`[Parser] Handler '${kn}' for refKey '${ae}' (matching '${Tr}') is referenced but not found in available handlers.`)}});Lr&&(dt[ft]=Lr)})}}}let oe={};if($)oe.key=$;else if(g){let D=u?`${u}.${f}`:String(f);oe.key=`${g}-${D}`;let ae=Object.keys(A);ae.length>0&&(oe.key+=`-p:${ae.join(",")}`)}if(Object.keys(E).length>0&&(oe.attrs=E),Object.keys(Y).length>0&&(oe.class=Y),Object.keys(dt).length>0&&(oe.on=dt),Object.keys(A).length>0&&(oe.props=A),_&&typeof n=="function"){let D=n({selector:g,tagName:x});D&&(oe.hook=D)}try{return e(x,oe,me)}catch(D){throw new Error(`[Parser] Error creating virtual node for '${x}': ${D.message}`)}}).filter(Boolean)}return l(t)};var Vi=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>({...e,refs:t,dispatchEvent:r,store:s,render:i}),yc=({store:e,render:t,parseAndRenderFn:r})=>s=>{let{_event:i,_action:n}=s,o=r(s,{_event:i});if(!e[n])throw new Error(`[Store] Action 'store.${n}' is not defined.`);e[n](o),t()},Pi=({handlers:e,deps:t,parseAndRenderFn:r})=>{let s={handleCallStoreAction:yc({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(i=>{s[i]=n=>e[i](t,n)}),s},gc=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},ji=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return gc(r)},Di=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},Bi=({attributeName:e,oldValue:t,newValue:r,deps:s,propsSchemaKeys:i,toCamelCase:n,normalizeAttributeValue:o})=>{let a=n(e),l={};i.forEach(f=>{let h=s.props[f];h!==void 0&&(l[f]=h)});let p={...l},u=o(t),c=o(r);return u===void 0?delete p[a]:p[a]=u,c===void 0?delete l[a]:l[a]=c,{changedProp:a,oldProps:p,newProps:l}};var vc=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Wi=({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 o=[],a=new Set,l=lt(t);return Object.entries(e).forEach(([p,u])=>{if(p!=="window"&&p!=="document")return;let c=vc({refKey:p,targets:r});!c||!u?.eventListeners||Object.entries(u.eventListeners).forEach(([f,h])=>{let d=`${p}:${f}`;a.add(d);let m=pt({eventType:f,eventConfig:h,refKey:p,handlers:t,eventRateLimitState:l,stateKey:d,fallbackCurrentTarget:c,parseAndRenderFn:s,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:g=>{n(`[Runtime] Handler '${g}' for global ref '${p}' is referenced but not found in available handlers.`)}});m&&(c.addEventListener(f,m),o.push(()=>{c.removeEventListener(f,m)}))})}),()=>{o.forEach(p=>p()),a.forEach(p=>{let u=l.get(p);u&&u.debounceTimer&&i.clearTimeoutFn(u.debounceTimer),l.delete(p)})}};var bc=e=>ot(e),wc=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 Mi=({rootVNode:e,refs:t})=>{let r={},s=bc(t),i=n=>{if(!n||typeof n!="object")return;let o=n?.data?.attrs?.id,a=wc(n),l=at({elementIdForRefs:o,classNames:a,refMatchers:s});if(n.elm&&l){let p=o||l.refKey;r[p]=n.elm}Array.isArray(n.children)&&n.children.forEach(i)};return i(e),r};var zi=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(s=>{r.add(s),r.add(t(s))}),[...r]},Fi=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>Vi({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i}),Ki=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),Ui=({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 Hi=({instance:e})=>Fi({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Gi=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:s=Pi,runBeforeMountFn:i=ji,attachGlobalRefListenersFn:n=Wi,runAfterMountFn:o=Di})=>{let a=Hi({instance:e});return e.transformedHandlers=s({handlers:e.handlers,deps:a,parseAndRenderFn:t}),e._unmountCallback=i({handlers:e.handlers,deps:a}),e._globalListenersCleanup=n({refs:e.refs,handlers:e.transformedHandlers,parseAndRenderFn:t}),r(),o({handlers:e.handlers,deps:a}),a},qi=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),Ui({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Ji=({instance:e,attributeName:t,oldValue:r,newValue:s,scheduleFrameFn:i})=>{if(!(r===s||!e.render)){if(e.handlers?.handleOnUpdate){let n=Hi({instance:e}),o=Bi({attributeName:t,oldValue:r,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Je,normalizeAttributeValue:qe});e.handlers.handleOnUpdate(n,o);return}i(()=>{e.render()})}},Yi=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=Ni,collectRefElementsFn:s=Mi,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 o=s({rootVNode:e._oldVNode,refs:e.refs});return Ki({refIds:e.refIds,nextRefIds:o}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}};var xc=`
|
|
985
|
+
`:"")+l)}),r};var at=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...at(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]:at(n)})}}t.push(r)}return t},[]):e;var Ii=":",hc=new Set(["__proto__","constructor","prototype"]),Oi=(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"&&hc.has(p)))return a[p]},e)},mc=e=>e.replace(/-([a-z0-9])/g,(t,r)=>r.toUpperCase()),Ti=({attrsString:e="",viewData:t={},tagName:r,isWebComponent:s})=>{let i={},n={},a=y=>{if(y==="role"||y.startsWith("aria-")||y.startsWith("data-"))throw new Error(`[Parser] Invalid boolean attribute '?${y}'. Use normal binding for value-carrying attributes such as aria-*, data-*, and role.`)},l=(y,w,_)=>{let x=mc(y);if(!x)throw new Error(`[Parser] Invalid ${_} prop name on '${r}'.`);if(Object.prototype.hasOwnProperty.call(n,x))throw new Error(`[Parser] Duplicate prop binding '${x}' on '${r}'. Use only one of 'name=value' or ':name=value'.`);n[x]=w};if(!e)return{attrs:i,props:n};let p=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g,o,c=new Set;for(;(o=p.exec(e))!==null;){let y=o[1],w=o[2]??o[3]??o[4]??"";if(c.add(y),y.startsWith(".")){i[y]=w;continue}if(y.startsWith(Ii)){let _=y.substring(1),x=w;if(o[4]!==void 0&&o[4]!==""){let A=o[4],E=Oi(t,A);E!==void 0&&(x=E)}l(_,x,"property-form");continue}if(y.startsWith("?")){let _=y.substring(1),x=w;a(_);let A;x==="true"?A=!0:x==="false"||x===""?A=!1:A=Oi(t,x),A&&(i[_]=""),s&&_!=="id"&&l(_,!!A,"boolean attribute-form");continue}i[y]=w,s&&y!=="id"&&l(y,w,"attribute-form")}let u=e,d=[],h,f=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]*))/g;for(;(h=f.exec(e))!==null;)d.push(h[0]);d.forEach(y=>{u=u.replace(y," ")});let m=/\b(\S+?)(?=\s|$)/g,g;for(;(g=m.exec(u))!==null;){let y=g[1];y.startsWith(".")||!c.has(y)&&!y.startsWith(Ii)&&!y.includes("=")&&(i[y]="",s&&y!=="id"&&l(y,!0,"boolean attribute-form"))}return{attrs:i,props:n}};var yc=/^[a-z][a-zA-Z0-9]*\*?$/,gc=/^[a-zA-Z][a-zA-Z0-9_-]*\*?$/,vc=/^[a-z][a-zA-Z0-9]*$/,Li=new Set(["window","document"]),ot=e=>Object.entries(e||{}).map(([t,r])=>{if(Li.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(Li.has(n))throw new Error(`[Parser] Invalid ref key '${t}'. Reserved global keys must be exactly 'window' or 'document'.`);if(s==="id"&&!yc.test(i))throw new Error(`[Parser] Invalid ref key '${t}'. Use camelCase IDs (optional '#', optional '*') or class refs with '.' prefix.`);if(s==="class"&&!gc.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}}),Pi=e=>{if(!vc.test(e))throw new Error(`[Parser] Invalid element id '${e}' for refs. Use camelCase ids only. Kebab-case ids are not supported.`)},Ri=({value:e,prefix:t,isWildcard:r})=>typeof e!="string"||e.length===0?!1:r?e.startsWith(t):e===t,lt=({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"){Ri({value:e,prefix:n.prefix,isWildcard:n.isWildcard})&&s.push({...n,matchedValue:e});return}let a=i.find(l=>Ri({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])},Ue=({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.`)},Ni=({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.`)},Vi=({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(Ue({optionName:"preventDefault",optionValue:t.preventDefault,eventType:e,refKey:r}),Ue({optionName:"stopPropagation",optionValue:t.stopPropagation,eventType:e,refKey:r}),Ue({optionName:"stopImmediatePropagation",optionValue:t.stopImmediatePropagation,eventType:e,refKey:r}),Ue({optionName:"targetOnly",optionValue:t.targetOnly,eventType:e,refKey:r}),Ue({optionName:"once",optionValue:t.once,eventType:e,refKey:r}),Ni({optionName:"debounce",optionValue:t.debounce,eventType:e,refKey:r}),Ni({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 pt=e=>(e.__eventRateLimitState||Object.defineProperty(e,"__eventRateLimitState",{value:new Map,enumerable:!1,configurable:!0}),e.__eventRateLimitState),bc=({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)},wc=({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})=>c=>{let u=n.get(i)||{},d=c.currentTarget||a;if(e.once)if(d){if(u.onceTargets||(u.onceTargets=new WeakSet),u.onceTargets.has(d)){n.set(i,u);return}u.onceTargets.add(d)}else if(u.onceTriggered){n.set(i,u);return}else u.onceTriggered=!0;if(e.targetOnly&&c.target!==c.currentTarget){n.set(i,u);return}if(e.preventDefault&&c.preventDefault(),e.stopImmediatePropagation?c.stopImmediatePropagation():e.stopPropagation&&c.stopPropagation(),r){u.debounceTimer&&o(u.debounceTimer),u.debounceTimer=p(()=>{let h=u.debounceTimer;try{t(c)}catch(f){throw o(h),u.debounceTimer=null,f}u.debounceTimer=null},e.debounce),n.set(i,u);return}if(s){Object.prototype.hasOwnProperty.call(u,"lastThrottleAt")||(u.lastThrottleAt=void 0);let h=l();if(u.lastThrottleAt===void 0||h-u.lastThrottleAt>=e.throttle){u.lastThrottleAt=h,n.set(i,u),t(c);return}n.set(i,u);return}n.set(i,u),t(c)},ct=({eventType:e,eventConfig:t,refKey:r,handlers:s,eventRateLimitState:i,stateKey:n,fallbackCurrentTarget:a=null,parseAndRenderFn:l,onMissingHandler:p,nowFn:o=Date.now,setTimeoutFn:c=setTimeout,clearTimeoutFn:u=clearTimeout})=>{let{hasDebounce:d,hasThrottle:h}=Vi({eventType:e,eventConfig:t,refKey:r}),f=bc({eventConfig:t,handlers:s,onMissingHandler:p,parseAndRenderFn:l});return f?wc({eventConfig:t,callback:f,hasDebounce:d,hasThrottle:h,stateKey:n,eventRateLimitState:i,fallbackCurrentTarget:a,nowFn:o,setTimeoutFn:c,clearTimeoutFn:u}):null};var Di=({h:e,template:t,viewData:r,refs:s,handlers:i,createComponentUpdateHook:n})=>{let a=Be(t,r,{}),l=at(a),p=_c({h:e,items:l,refs:s,handlers:i,viewData:r,createComponentUpdateHook:n});return e("div",{style:{display:"contents"}},p)},_c=({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=ot(r),l=a.some(o=>o.targetType==="id");function p(o,c=""){return o.map((u,d)=>{if(typeof u=="string"||typeof u=="number")return String(u);if(typeof u!="object"||u===null)return console.warn("Skipping invalid item in DOM structure:",u),null;let h=Object.entries(u);if(h.length===0)return null;let[f,m]=h[0];if(!isNaN(Number(f)))return Array.isArray(m)?p(m,`${c}.${f}`):typeof m=="object"&&m!==null&&Object.entries(m).length>0?p([m],`${c}.${f}`):String(m);h.length>1&&console.warn("Item has multiple keys, processing only the first:",f);let g,y,w=f.indexOf(" ");w===-1?(g=f,y=""):(g=f.substring(0,w),y=f.substring(w+1).trim());let _=g.split(/[.#]/)[0],x=_.includes("-"),A,E;try{({attrs:A,props:E}=Ti({attrsString:y,viewData:i,tagName:_,isWebComponent:x}))}catch(B){throw new Error(`[Parser] Failed to parse bindings for selector '${g}' with attrs '${y}': ${B.message}`)}let T=g.match(/#([^.#\s]+)/);T&&!Object.prototype.hasOwnProperty.call(A,"id")&&(A.id=T[1]);let $=null;A.id&&($=A.id);let W=(g.match(/\.([^.#]+)/g)||[]).map(B=>B.substring(1)),j=typeof A.class=="string"?A.class.split(/\s+/).filter(Boolean):[],U=[...new Set([...W,...j])],X=Object.create(null),ce=null;if(!x){W.forEach(le=>{X[le]=!0});let B=g.match(/#([^.#\s]+)/);B&&(ce=B[1])}let ye;typeof m=="string"||typeof m=="number"?ye=String(m):Array.isArray(m)?ye=p(m,`${c}.${f}`):ye=[],ce&&!x&&(A.id=ce);let ft=Object.create(null);if(a.length>0){l&&$&&Pi($);let B=lt({elementIdForRefs:$,classNames:U,refMatchers:a});if(B){let le=B.refKey,Tr=B.matchedValue||$||le;if(B.refConfig&&B.refConfig.eventListeners){let En=B.refConfig.eventListeners,kn=pt(s);Object.entries(En).forEach(([ht,$n])=>{let Sn=`${le}:${Tr}:${ht}`,Lr=ct({eventType:ht,eventConfig:$n,refKey:le,handlers:s,eventRateLimitState:kn,stateKey:Sn,parseAndRenderFn:Me,onMissingHandler:Cn=>{console.warn(`[Parser] Handler '${Cn}' for refKey '${le}' (matching '${Tr}') is referenced but not found in available handlers.`)}});Lr&&(ft[ht]=Lr)})}}}let oe={};if($)oe.key=$;else if(g){let B=c?`${c}.${d}`:String(d);oe.key=`${g}-${B}`;let le=Object.keys(E);le.length>0&&(oe.key+=`-p:${le.join(",")}`)}if(Object.keys(A).length>0&&(oe.attrs=A),Object.keys(X).length>0&&(oe.class=X),Object.keys(ft).length>0&&(oe.on=ft),Object.keys(E).length>0&&(oe.props=E),x&&typeof n=="function"){let B=n({selector:g,tagName:_});B&&(oe.hook=B)}try{return e(_,oe,ye)}catch(B){throw new Error(`[Parser] Error creating virtual node for '${_}': ${B.message}`)}}).filter(Boolean)}return p(t)};var ji=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>({...e,refs:t,dispatchEvent:r,store:s,render:i}),xc=({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()},Bi=({handlers:e,deps:t,parseAndRenderFn:r})=>{let s={handleCallStoreAction:xc({store:t.store,render:t.render,parseAndRenderFn:r})};return Object.keys(e||{}).forEach(i=>{s[i]=n=>e[i](t,n)}),s},Ac=e=>{if(e&&typeof e.then=="function")throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");return e},Wi=({handlers:e,deps:t})=>{if(!e?.handleBeforeMount)return;let r=e.handleBeforeMount(t);return Ac(r)},Mi=({handlers:e,deps:t})=>{e?.handleAfterMount&&e.handleAfterMount(t)},zi=({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},c=a(t),u=a(r);return c===void 0?delete o[l]:o[l]=c,u===void 0?delete p[l]:p[l]=u,{changedProp:l,oldProps:o,newProps:p}};var Ec=({refKey:e,targets:t})=>e==="window"?t.window:e==="document"?t.document:null,Fi=({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=pt(t);return Object.entries(e).forEach(([o,c])=>{if(o!=="window"&&o!=="document")return;let u=Ec({refKey:o,targets:r});!u||!c?.eventListeners||Object.entries(c.eventListeners).forEach(([d,h])=>{let f=`${o}:${d}`;l.add(f);let m=ct({eventType:d,eventConfig:h,refKey:o,handlers:t,eventRateLimitState:p,stateKey:f,fallbackCurrentTarget:u,parseAndRenderFn:s,nowFn:i.nowFn,setTimeoutFn:i.setTimeoutFn,clearTimeoutFn:i.clearTimeoutFn,onMissingHandler:g=>{n(`[Runtime] Handler '${g}' for global ref '${o}' is referenced but not found in available handlers.`)}});m&&(u.addEventListener(d,m),a.push(()=>{u.removeEventListener(d,m)}))})}),()=>{a.forEach(o=>o()),l.forEach(o=>{let c=p.get(o);c&&c.debounceTimer&&i.clearTimeoutFn(c.debounceTimer),p.delete(o)})}};var kc=e=>ot(e),$c=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 Ui=({rootVNode:e,refs:t})=>{let r={},s=kc(t),i=n=>{if(!n||typeof n!="object")return;let a=n?.data?.attrs?.id,l=$c(n),p=lt({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 Ki=({propsSchemaKeys:e=[],toKebabCase:t})=>{let r=new Set(["key"]);return e.forEach(s=>{r.add(s),r.add(t(s))}),[...r]},Hi=({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i})=>ji({baseDeps:e,refs:t,dispatchEvent:r,store:s,render:i}),Gi=({refIds:e,nextRefIds:t={}})=>(Object.keys(e).forEach(r=>{delete e[r]}),Object.assign(e,t),e),qi=({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 Ji=({instance:e})=>Hi({baseDeps:e.deps,refs:e.refIds,dispatchEvent:e.dispatchEvent.bind(e),store:e.store,render:e.render.bind(e)}),Yi=({instance:e,parseAndRenderFn:t,renderFn:r,createTransformedHandlersFn:s=Bi,runBeforeMountFn:i=Wi,attachGlobalRefListenersFn:n=Fi,runAfterMountFn:a=Mi})=>{let l=Ji({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},Xi=({instance:e,clearTimerFn:t=clearTimeout})=>(e._unmountCallback&&e._unmountCallback(),e._globalListenersCleanup&&e._globalListenersCleanup(),qi({transformedHandlers:e.transformedHandlers,clearTimerFn:t})),Zi=({instance:e,attributeName:t,oldValue:r,newValue:s,scheduleFrameFn:i})=>{if(!(r===s||!e.render)){if(e.handlers?.handleOnUpdate){let n=Ji({instance:e}),a=zi({attributeName:t,oldValue:r,newValue:s,deps:n,propsSchemaKeys:e._propsSchemaKeys,toCamelCase:Xe,normalizeAttributeValue:Ye});e.handlers.handleOnUpdate(n,a);return}i(()=>{e.render()})}},Qi=({instance:e,createComponentUpdateHookFn:t,parseViewFn:r=Di,collectRefElementsFn:s=Ui,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 Gi({refIds:e.refIds,nextRefIds:a}),e._oldVNode}catch(n){return i(n),e._oldVNode||null}};var Sc=`
|
|
986
986
|
a, a:link, a:visited, a:hover, a:active {
|
|
987
987
|
display: contents;
|
|
988
988
|
color: inherit;
|
|
@@ -994,4 +994,4 @@ ${a}
|
|
|
994
994
|
font: inherit;
|
|
995
995
|
cursor: pointer;
|
|
996
996
|
}
|
|
997
|
-
`,Xi=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:s=i=>document.createElement(i)})=>{let i=e.attachShadow({mode:"open"}),n=r();n.replaceSync(xc);let o=[n];if(t){let l=r();l.replaceSync(t),o.push(l)}i.adoptedStyleSheets=o;let a=s("div");return a.style.cssText="display: contents;",i.appendChild(a),a.parentNode||e.appendChild(a),e.style.display="contents",{shadow:i,renderTarget:a,adoptedStyleSheets:o}};var ct=(e,t=requestAnimationFrame)=>t(e);var Qi=({scheduleFrameFn:e=ct}={})=>({update:(t,r)=>{let s=t.data?.props||{},i=r.data?.props||{};if(!(JSON.stringify(s)!==JSON.stringify(i)))return;let o=r.elm;!o||typeof o.render!="function"||(o.setAttribute("isDirty","true"),e(()=>{if(o.render(),o.removeAttribute("isDirty"),o.handlers&&o.handlers.handleOnUpdate){let a={...o.deps,store:o.store,render:o.render.bind(o),handlers:o.handlers,dispatchEvent:o.dispatchEvent.bind(o),refs:o.refIds||{}};o.handlers.handleOnUpdate(a,{oldProps:s,newProps:i})}}))}});var Zi=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:s,refs:i,styles:n,handlers:o,methods:a,constants:l,store:p,patch:u,h:c,deps:f})=>{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 g={};return this.store.selectViewData&&(g=this.store.selectViewData()),g}connectedCallback(){let g=Xi({host:this,cssText:this.cssText});this.shadow=g.shadow,this.renderTarget=g.renderTarget,Gi({instance:this,parseAndRenderFn:Be,renderFn:this.render})}disconnectedCallback(){qi({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(g,y,w){Ji({instance:this,attributeName:g,oldValue:y,newValue:w,scheduleFrameFn:ct})}render=()=>{Yi({instance:this,createComponentUpdateHookFn:Qi})}}class d extends h{static get observedAttributes(){return zi({propsSchemaKeys:r,toKebabCase:ur})}constructor(){super(),this.constants=Ai({setupConstants:f?.constants,fileConstants:l}),this.propsSchema=t,this.props=t?Xs(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=_i(p,this.props,this.constants),this.template=s,this.handlers=o,this.methods=a,this.refs=i,this.patch=u,this.deps={...f,store:this.store,render:this.render,handlers:o,props:this.props,constants:this.constants},pi(this,this.methods),this._snabbdomH=c,this.cssText=ki(e,n)}}return d};function xe(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 Se=Array.isArray;function Ce(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function _c(e,t){return document.createElement(e,t)}function Ec(e,t,r){return document.createElementNS(e,t,r)}function Ac(){return _e(document.createDocumentFragment())}function kc(e){return document.createTextNode(e)}function $c(e){return document.createComment(e)}function Sc(e,t,r){if(le(e)){let s=e;for(;s&&le(s);)s=_e(s).parent;e=s??e}le(t)&&(t=_e(t,e)),r&&le(r)&&(r=_e(r).firstChildNode),e.insertBefore(t,r)}function Cc(e,t){e.removeChild(t)}function Ic(e,t){le(t)&&(t=_e(t,e)),e.appendChild(t)}function tn(e){if(le(e)){for(;e&&le(e);)e=_e(e).parent;return e??null}return e.parentNode}function Oc(e){var t;if(le(e)){let r=_e(e),s=tn(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 Tc(e){return e.tagName}function Lc(e,t){e.textContent=t}function Rc(e){return e.textContent}function Nc(e){return e.nodeType===1}function Vc(e){return e.nodeType===3}function Pc(e){return e.nodeType===8}function le(e){return e.nodeType===11}function _e(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 rn={createElement:_c,createElementNS:Ec,createTextNode:kc,createDocumentFragment:Ac,createComment:$c,insertBefore:Sc,removeChild:Cc,appendChild:Ic,parentNode:tn,nextSibling:Oc,tagName:Tc,setTextContent:Lc,getTextContent:Rc,isElement:Nc,isText:Vc,isComment:Pc,isDocumentFragment:le};function ut(e){return e===void 0}function ee(e){return e!==void 0}var $r=xe("",{},[],void 0,void 0);function Fe(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),o=e.sel===t.sel,a=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return o&&i&&n&&a}function jc(){throw new Error("The document fragment is not supported on this platform.")}function Dc(e,t){return e.isElement(t)}function Bc(e,t){return e.isDocumentFragment(t)}function Wc(e,t,r){var s;let i={};for(let n=t;n<=r;++n){let o=(s=e[n])===null||s===void 0?void 0:s.key;o!==void 0&&(i[o]=n)}return i}var Mc=["create","update","remove","destroy","pre","post"];function sn(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:rn;for(let d of Mc)for(let m of e){let g=m[d];g!==void 0&&s[d].push(g)}function n(d){let m=d.id?"#"+d.id:"",g=d.getAttribute("class"),y=g?"."+g.split(" ").join("."):"";return xe(i.tagName(d).toLowerCase()+m+y,{},[],void 0,d)}function o(d){return xe(void 0,{},[],void 0,d)}function a(d,m){return function(){if(--m===0){let y=i.parentNode(d);y!==null&&i.removeChild(y,d)}}}function l(d,m){var g,y,w,x;let _,E=d.data;if(E!==void 0){let $=(g=E.hook)===null||g===void 0?void 0:g.init;ee($)&&($(d),E=d.data)}let A=d.children,C=d.sel;if(C==="!")ut(d.text)&&(d.text=""),d.elm=i.createComment(d.text);else if(C==="")d.elm=i.createTextNode(d.text);else if(C!==void 0){let $=C.indexOf("#"),N=C.indexOf(".",$),W=$>0?$:C.length,j=N>0?N:C.length,K=$!==-1||N!==-1?C.slice(0,Math.min(W,j)):C,Y=d.elm=ee(E)&&ee(_=E.ns)?i.createElementNS(_,K,E):i.createElement(K,E);for(W<j&&Y.setAttribute("id",C.slice(W+1,j)),N>0&&Y.setAttribute("class",C.slice(j+1).replace(/\./g," ")),_=0;_<s.create.length;++_)s.create[_]($r,d);if(Ce(d.text)&&(!Se(A)||A.length===0)&&i.appendChild(Y,i.createTextNode(d.text)),Se(A))for(_=0;_<A.length;++_){let me=A[_];me!=null&&i.appendChild(Y,l(me,m))}let pe=d.data.hook;ee(pe)&&((y=pe.create)===null||y===void 0||y.call(pe,$r,d),pe.insert&&m.push(d))}else if(!((w=r?.experimental)===null||w===void 0)&&w.fragments&&d.children){for(d.elm=((x=i.createDocumentFragment)!==null&&x!==void 0?x:jc)(),_=0;_<s.create.length;++_)s.create[_]($r,d);for(_=0;_<d.children.length;++_){let $=d.children[_];$!=null&&i.appendChild(d.elm,l($,m))}}else d.elm=i.createTextNode(d.text);return d.elm}function p(d,m,g,y,w,x){for(;y<=w;++y){let _=g[y];_!=null&&i.insertBefore(d,l(_,x),m)}}function u(d){var m,g;let y=d.data;if(y!==void 0){(g=(m=y?.hook)===null||m===void 0?void 0:m.destroy)===null||g===void 0||g.call(m,d);for(let w=0;w<s.destroy.length;++w)s.destroy[w](d);if(d.children!==void 0)for(let w=0;w<d.children.length;++w){let x=d.children[w];x!=null&&typeof x!="string"&&u(x)}}}function c(d,m,g,y){for(var w,x;g<=y;++g){let _,E,A=m[g];if(A!=null)if(ee(A.sel)){u(A),_=s.remove.length+1,E=a(A.elm,_);for(let $=0;$<s.remove.length;++$)s.remove[$](A,E);let C=(x=(w=A?.data)===null||w===void 0?void 0:w.hook)===null||x===void 0?void 0:x.remove;ee(C)?C(A,E):E()}else A.children?(u(A),c(d,A.children,0,A.children.length-1)):i.removeChild(d,A.elm)}}function f(d,m,g,y){let w=0,x=0,_=m.length-1,E=m[0],A=m[_],C=g.length-1,$=g[0],N=g[C],W,j,K,Y;for(;w<=_&&x<=C;)E==null?E=m[++w]:A==null?A=m[--_]:$==null?$=g[++x]:N==null?N=g[--C]:Fe(E,$)?(h(E,$,y),E=m[++w],$=g[++x]):Fe(A,N)?(h(A,N,y),A=m[--_],N=g[--C]):Fe(E,N)?(h(E,N,y),i.insertBefore(d,E.elm,i.nextSibling(A.elm)),E=m[++w],N=g[--C]):Fe(A,$)?(h(A,$,y),i.insertBefore(d,A.elm,E.elm),A=m[--_],$=g[++x]):(W===void 0&&(W=Wc(m,w,_)),j=W[$.key],ut(j)?(i.insertBefore(d,l($,y),E.elm),$=g[++x]):ut(W[N.key])?(i.insertBefore(d,l(N,y),i.nextSibling(A.elm)),N=g[--C]):(K=m[j],K.sel!==$.sel?i.insertBefore(d,l($,y),E.elm):(h(K,$,y),m[j]=void 0,i.insertBefore(d,K.elm,E.elm)),$=g[++x]));x<=C&&(Y=g[C+1]==null?null:g[C+1].elm,p(d,Y,g,x,C,y)),w<=_&&c(d,m,w,_)}function h(d,m,g){var y,w,x,_,E,A,C,$;let N=(y=m.data)===null||y===void 0?void 0:y.hook;(w=N?.prepatch)===null||w===void 0||w.call(N,d,m);let W=m.elm=d.elm;if(d===m)return;if(m.data!==void 0||ee(m.text)&&m.text!==d.text){(x=m.data)!==null&&x!==void 0||(m.data={}),(_=d.data)!==null&&_!==void 0||(d.data={});for(let Y=0;Y<s.update.length;++Y)s.update[Y](d,m);(C=(A=(E=m.data)===null||E===void 0?void 0:E.hook)===null||A===void 0?void 0:A.update)===null||C===void 0||C.call(A,d,m)}let j=d.children,K=m.children;ut(m.text)?ee(j)&&ee(K)?j!==K&&f(W,j,K,g):ee(K)?(ee(d.text)&&i.setTextContent(W,""),p(W,null,K,0,K.length-1,g)):ee(j)?c(W,j,0,j.length-1):ee(d.text)&&i.setTextContent(W,""):d.text!==m.text&&(ee(j)&&c(W,j,0,j.length-1),i.setTextContent(W,m.text)),($=N?.postpatch)===null||$===void 0||$.call(N,d,m)}return function(m,g){let y,w,x,_=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(Dc(i,m)?m=n(m):Bc(i,m)&&(m=o(m)),Fe(m,g)?h(m,g,_):(w=m.elm,x=i.parentNode(w),l(g,_),x!==null&&(i.insertBefore(x,g.elm,i.nextSibling(w)),c(x,[m],0,0))),y=0;y<_.length;++y)_[y].data.hook.insert(_[y]);for(y=0;y<s.post.length;++y)s.post[y]();return g}}function nn(e,t){let r,s,i=t.elm,n=e.data.class,o=t.data.class;if(!(!n&&!o)&&n!==o){n=n||{},o=o||{};for(s in n)n[s]&&!Object.prototype.hasOwnProperty.call(o,s)&&i.classList.remove(s);for(s in o)r=o[s],r!==n[s]&&i.classList[r?"add":"remove"](s)}}var on={create:nn,update:nn};function an(e,t){let r,s,i,n=t.elm,o=e.data.props,a=t.data.props;if(!(!o&&!a)&&o!==a){o=o||{},a=a||{};for(r in a)s=a[r],i=o[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var ln={create:an,update:an};var zc="http://www.w3.org/1999/xlink",Fc="http://www.w3.org/2000/xmlns/",Kc="http://www.w3.org/XML/1998/namespace";function pn(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 o=n[r];i[r]!==o&&(o===!0?s.setAttribute(r,""):o===!1?s.removeAttribute(r):r.charCodeAt(0)!==120?s.setAttribute(r,o):r.charCodeAt(3)===58?s.setAttributeNS(Kc,r,o):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(Fc,r,o):s.setAttributeNS(zc,r,o):s.setAttribute(r,o))}for(r in i)r in n||s.removeAttribute(r)}}var cn={create:pn,update:pn};var un=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Uc=function(e){un(function(){un(e)})},Sr=!1;function Hc(e,t,r){Uc(function(){e[t]=r})}function dn(e,t){let r,s,i=t.elm,n=e.data.style,o=t.data.style;if(!n&&!o||n===o)return;n=n||{},o=o||{};let a="delayed"in n;for(s in n)s in o||(s[0]==="-"&&s[1]==="-"?i.style.removeProperty(s):i.style[s]="");for(s in o)if(r=o[s],s==="delayed"&&o.delayed)for(let l in o.delayed)r=o.delayed[l],(!a||r!==n.delayed[l])&&Hc(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function Gc(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 qc(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Sr||(e.elm.offsetLeft,Sr=!0);let s,i=e.elm,n=0,o=r.remove,a=0,l=[];for(s in o)l.push(s),i.style[s]=o[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&a++;i.addEventListener("transitionend",function(c){c.target===i&&--a,a===0&&t()})}function Jc(){Sr=!1}var fn={pre:Jc,create:dn,update:dn,destroy:Gc,remove:qc};function hn(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++)hn(e[s],t,r)}function Yc(e,t){let r=e.type,s=t.data.on;s&&s[r]&&hn(s[r],t,e)}function Xc(){return function e(t){Yc(t,e.vnode)}}function Cr(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,o=t&&t.elm,a;if(r!==n){if(r&&s)if(n)for(a in r)n[a]||i.removeEventListener(a,s,!1);else for(a in r)i.removeEventListener(a,s,!1);if(n){let l=t.listener=e.listener||Xc();if(l.vnode=t,r)for(a in n)r[a]||o.addEventListener(a,l,!1);else for(a in n)o.addEventListener(a,l,!1)}}}var mn={create:Cr,update:Cr,destroy:Cr};var Qc=()=>sn([on,ln,cn,fn,mn]),yn=Qc;function gn(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&&gn(n,i.children,i.sel)}}function vn(e,t,r){let s={},i,n,o;if(r!==void 0?(t!==null&&(s=t),Se(r)?i=r:Ce(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(Se(t)?i=t:Ce(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(o=0;o<i.length;++o)Ce(i[o])&&(i[o]=xe(void 0,void 0,void 0,i[o],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&gn(s,i,e),xe(e,s,i,n,void 0)}var Zc=yn(),eu=({handlers:e,methods:t,constants:r,schema:s,view:i,store:n},o)=>{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 a=s,{template:l,refs:p,styles:u}=i;Qs({schema:a,methodExports:Object.keys(t||{})});let c=a.componentName,f=a.propsSchema,h=f?.properties?[...new Set(Object.keys(f.properties).map(d=>Je(d)))]:[];return Zi({elementName:c,propsSchema:f,propsSchemaKeys:h,template:l,refs:p,styles:u,handlers:e,methods:t,constants:r,store:n,patch:Zc,h:vn,deps:o})},Ir=eu;var tu=e=>{let t={};return{once:(r,s)=>{t[r]||(t[r]=[]);let i=(...n)=>{s(...n),t[r]=t[r].filter(o=>o!==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.showAlert(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.showConfirm(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.showDropdownMenu(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.closeAll()}}},bn=tu;var ru=bn(),su={globalUI:ru},wn={components:su};var Or={components:{accordionItem:{handlers:Ot,schema:ts,store:Tt,view:rs},breadcrumb:{handlers:Lt,schema:ss,store:Rt,view:is},dropdownMenu:{handlers:Nt,schema:ns,store:Vt,view:os},form:{handlers:Pt,schema:ls,store:zt,view:As},globalUi:{handlers:Ft,schema:ks,store:Kt,view:$s},navbar:{handlers:Ut,schema:Ss,store:Ht,view:Cs},pageOutline:{handlers:Gt,schema:Os,store:qt,view:Ts},popoverInput:{handlers:Jt,schema:Ls,store:Yt,view:Rs},select:{handlers:Xt,schema:Ns,store:Qt,view:Vs},sidebar:{handlers:Zt,schema:Ps,store:tr,view:js},sliderInput:{handlers:rr,schema:Ds,store:sr,view:Bs},table:{handlers:ir,schema:Ws,store:nr,view:Ms},tabs:{handlers:or,schema:zs,store:ar,view:Fs},tooltip:{handlers:Ks,schema:Us,store:lr,view:Hs},waveform:{handlers:pr,schema:qs,store:cr,view:Js}}};Object.keys(Or).forEach(e=>{Object.keys(Or[e]).forEach(t=>{let r=Or[e][t],s=Ir({...r},wn[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",Pr({}));customElements.define("rtgl-view",Wr({}));customElements.define("rtgl-text",zr({}));customElements.define("rtgl-image",Ur({}));customElements.define("rtgl-svg",Gr({}));customElements.define("rtgl-input",qr({}));customElements.define("rtgl-input-number",Jr({}));customElements.define("rtgl-textarea",Yr({}));customElements.define("rtgl-color-picker",Xr({}));customElements.define("rtgl-slider",Qr({}));customElements.define("rtgl-dialog",Zr({}));customElements.define("rtgl-popover",es({}));})();
|
|
997
|
+
`,en=({host:e,cssText:t,createStyleSheet:r=()=>new CSSStyleSheet,createElement:s=i=>document.createElement(i)})=>{let i=e.attachShadow({mode:"open"}),n=r();n.replaceSync(Sc);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 ut=(e,t=requestAnimationFrame)=>t(e);var tn=({scheduleFrameFn:e=ut}={})=>({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 rn=({elementName:e,propsSchema:t,propsSchemaKeys:r,template:s,refs:i,styles:n,handlers:a,methods:l,constants:p,store:o,patch:c,h:u,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 g={};return this.store.selectViewData&&(g=this.store.selectViewData()),g}connectedCallback(){let g=en({host:this,cssText:this.cssText});this.shadow=g.shadow,this.renderTarget=g.renderTarget,Yi({instance:this,parseAndRenderFn:Me,renderFn:this.render})}disconnectedCallback(){Xi({instance:this,clearTimerFn:clearTimeout})}attributeChangedCallback(g,y,w){Zi({instance:this,attributeName:g,oldValue:y,newValue:w,scheduleFrameFn:ut})}render=()=>{Qi({instance:this,createComponentUpdateHookFn:tn})}}class f extends h{static get observedAttributes(){return Ki({propsSchemaKeys:r,toKebabCase:dr})}constructor(){super(),this.constants=Si({setupConstants:d?.constants,fileConstants:p}),this.propsSchema=t,this.props=t?Xs(this,r):{},this._propsSchemaKeys=r,this.elementName=e,this.styles=n,this.store=ki(o,this.props,this.constants),this.template=s,this.handlers=a,this.methods=l,this.refs=i,this.patch=c,this.deps={...d,store:this.store,render:this.render,handlers:a,props:this.props,constants:this.constants},di(this,this.methods),this._snabbdomH=u,this.cssText=Ci(e,n)}}return f};function xe(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 Ce=Array.isArray;function Ie(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Cc(e,t){return document.createElement(e,t)}function Ic(e,t,r){return document.createElementNS(e,t,r)}function Oc(){return Ae(document.createDocumentFragment())}function Tc(e){return document.createTextNode(e)}function Lc(e){return document.createComment(e)}function Rc(e,t,r){if(pe(e)){let s=e;for(;s&&pe(s);)s=Ae(s).parent;e=s??e}pe(t)&&(t=Ae(t,e)),r&&pe(r)&&(r=Ae(r).firstChildNode),e.insertBefore(t,r)}function Nc(e,t){e.removeChild(t)}function Pc(e,t){pe(t)&&(t=Ae(t,e)),e.appendChild(t)}function nn(e){if(pe(e)){for(;e&&pe(e);)e=Ae(e).parent;return e??null}return e.parentNode}function Vc(e){var t;if(pe(e)){let r=Ae(e),s=nn(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 Dc(e){return e.tagName}function jc(e,t){e.textContent=t}function Bc(e){return e.textContent}function Wc(e){return e.nodeType===1}function Mc(e){return e.nodeType===3}function zc(e){return e.nodeType===8}function pe(e){return e.nodeType===11}function Ae(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 an={createElement:Cc,createElementNS:Ic,createTextNode:Tc,createDocumentFragment:Oc,createComment:Lc,insertBefore:Rc,removeChild:Nc,appendChild:Pc,parentNode:nn,nextSibling:Vc,tagName:Dc,setTextContent:jc,getTextContent:Bc,isElement:Wc,isText:Mc,isComment:zc,isDocumentFragment:pe};function dt(e){return e===void 0}function re(e){return e!==void 0}var $r=xe("",{},[],void 0,void 0);function Ke(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 Fc(){throw new Error("The document fragment is not supported on this platform.")}function Uc(e,t){return e.isElement(t)}function Kc(e,t){return e.isDocumentFragment(t)}function Hc(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 Gc=["create","update","remove","destroy","pre","post"];function on(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:an;for(let f of Gc)for(let m of e){let g=m[f];g!==void 0&&s[f].push(g)}function n(f){let m=f.id?"#"+f.id:"",g=f.getAttribute("class"),y=g?"."+g.split(" ").join("."):"";return xe(i.tagName(f).toLowerCase()+m+y,{},[],void 0,f)}function a(f){return xe(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 g,y,w,_;let x,A=f.data;if(A!==void 0){let $=(g=A.hook)===null||g===void 0?void 0:g.init;re($)&&($(f),A=f.data)}let E=f.children,T=f.sel;if(T==="!")dt(f.text)&&(f.text=""),f.elm=i.createComment(f.text);else if(T==="")f.elm=i.createTextNode(f.text);else if(T!==void 0){let $=T.indexOf("#"),P=T.indexOf(".",$),W=$>0?$:T.length,j=P>0?P:T.length,U=$!==-1||P!==-1?T.slice(0,Math.min(W,j)):T,X=f.elm=re(A)&&re(x=A.ns)?i.createElementNS(x,U,A):i.createElement(U,A);for(W<j&&X.setAttribute("id",T.slice(W+1,j)),P>0&&X.setAttribute("class",T.slice(j+1).replace(/\./g," ")),x=0;x<s.create.length;++x)s.create[x]($r,f);if(Ie(f.text)&&(!Ce(E)||E.length===0)&&i.appendChild(X,i.createTextNode(f.text)),Ce(E))for(x=0;x<E.length;++x){let ye=E[x];ye!=null&&i.appendChild(X,p(ye,m))}let ce=f.data.hook;re(ce)&&((y=ce.create)===null||y===void 0||y.call(ce,$r,f),ce.insert&&m.push(f))}else if(!((w=r?.experimental)===null||w===void 0)&&w.fragments&&f.children){for(f.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Fc)(),x=0;x<s.create.length;++x)s.create[x]($r,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,g,y,w,_){for(;y<=w;++y){let x=g[y];x!=null&&i.insertBefore(f,p(x,_),m)}}function c(f){var m,g;let y=f.data;if(y!==void 0){(g=(m=y?.hook)===null||m===void 0?void 0:m.destroy)===null||g===void 0||g.call(m,f);for(let w=0;w<s.destroy.length;++w)s.destroy[w](f);if(f.children!==void 0)for(let w=0;w<f.children.length;++w){let _=f.children[w];_!=null&&typeof _!="string"&&c(_)}}}function u(f,m,g,y){for(var w,_;g<=y;++g){let x,A,E=m[g];if(E!=null)if(re(E.sel)){c(E),x=s.remove.length+1,A=l(E.elm,x);for(let $=0;$<s.remove.length;++$)s.remove[$](E,A);let T=(_=(w=E?.data)===null||w===void 0?void 0:w.hook)===null||_===void 0?void 0:_.remove;re(T)?T(E,A):A()}else E.children?(c(E),u(f,E.children,0,E.children.length-1)):i.removeChild(f,E.elm)}}function d(f,m,g,y){let w=0,_=0,x=m.length-1,A=m[0],E=m[x],T=g.length-1,$=g[0],P=g[T],W,j,U,X;for(;w<=x&&_<=T;)A==null?A=m[++w]:E==null?E=m[--x]:$==null?$=g[++_]:P==null?P=g[--T]:Ke(A,$)?(h(A,$,y),A=m[++w],$=g[++_]):Ke(E,P)?(h(E,P,y),E=m[--x],P=g[--T]):Ke(A,P)?(h(A,P,y),i.insertBefore(f,A.elm,i.nextSibling(E.elm)),A=m[++w],P=g[--T]):Ke(E,$)?(h(E,$,y),i.insertBefore(f,E.elm,A.elm),E=m[--x],$=g[++_]):(W===void 0&&(W=Hc(m,w,x)),j=W[$.key],dt(j)?(i.insertBefore(f,p($,y),A.elm),$=g[++_]):dt(W[P.key])?(i.insertBefore(f,p(P,y),i.nextSibling(E.elm)),P=g[--T]):(U=m[j],U.sel!==$.sel?i.insertBefore(f,p($,y),A.elm):(h(U,$,y),m[j]=void 0,i.insertBefore(f,U.elm,A.elm)),$=g[++_]));_<=T&&(X=g[T+1]==null?null:g[T+1].elm,o(f,X,g,_,T,y)),w<=x&&u(f,m,w,x)}function h(f,m,g){var y,w,_,x,A,E,T,$;let P=(y=m.data)===null||y===void 0?void 0:y.hook;(w=P?.prepatch)===null||w===void 0||w.call(P,f,m);let W=m.elm=f.elm;if(f===m)return;if(m.data!==void 0||re(m.text)&&m.text!==f.text){(_=m.data)!==null&&_!==void 0||(m.data={}),(x=f.data)!==null&&x!==void 0||(f.data={});for(let X=0;X<s.update.length;++X)s.update[X](f,m);(T=(E=(A=m.data)===null||A===void 0?void 0:A.hook)===null||E===void 0?void 0:E.update)===null||T===void 0||T.call(E,f,m)}let j=f.children,U=m.children;dt(m.text)?re(j)&&re(U)?j!==U&&d(W,j,U,g):re(U)?(re(f.text)&&i.setTextContent(W,""),o(W,null,U,0,U.length-1,g)):re(j)?u(W,j,0,j.length-1):re(f.text)&&i.setTextContent(W,""):f.text!==m.text&&(re(j)&&u(W,j,0,j.length-1),i.setTextContent(W,m.text)),($=P?.postpatch)===null||$===void 0||$.call(P,f,m)}return function(m,g){let y,w,_,x=[];for(y=0;y<s.pre.length;++y)s.pre[y]();for(Uc(i,m)?m=n(m):Kc(i,m)&&(m=a(m)),Ke(m,g)?h(m,g,x):(w=m.elm,_=i.parentNode(w),p(g,x),_!==null&&(i.insertBefore(_,g.elm,i.nextSibling(w)),u(_,[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 g}}function ln(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 pn={create:ln,update:ln};function cn(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 un={create:cn,update:cn};var qc="http://www.w3.org/1999/xlink",Jc="http://www.w3.org/2000/xmlns/",Yc="http://www.w3.org/XML/1998/namespace";function dn(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(Yc,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(Jc,r,a):s.setAttributeNS(qc,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var fn={create:dn,update:dn};var hn=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,Xc=function(e){hn(function(){hn(e)})},Sr=!1;function Zc(e,t,r){Xc(function(){e[t]=r})}function mn(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])&&Zc(i.style,p,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function Qc(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 eu(e,t){let r=e.data.style;if(!r||!r.remove){t();return}Sr||(e.elm.offsetLeft,Sr=!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 c=getComputedStyle(i)["transition-property"].split(", ");for(;n<c.length;++n)p.indexOf(c[n])!==-1&&l++;i.addEventListener("transitionend",function(u){u.target===i&&--l,l===0&&t()})}function tu(){Sr=!1}var yn={pre:tu,create:mn,update:mn,destroy:Qc,remove:eu};function gn(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++)gn(e[s],t,r)}function ru(e,t){let r=e.type,s=t.data.on;s&&s[r]&&gn(s[r],t,e)}function su(){return function e(t){ru(t,e.vnode)}}function Cr(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||su();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 vn={create:Cr,update:Cr,destroy:Cr};var iu=()=>on([pn,un,fn,yn,vn]),bn=iu;function wn(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&&wn(n,i.children,i.sel)}}function _n(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),Ce(r)?i=r:Ie(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(Ce(t)?i=t:Ie(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)Ie(i[a])&&(i[a]=xe(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&wn(s,i,e),xe(e,s,i,n,void 0)}var nu=bn(),au=({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:c}=i;Zs({schema:l,methodExports:Object.keys(t||{})});let u=l.componentName,d=l.propsSchema,h=d?.properties?[...new Set(Object.keys(d.properties).map(f=>Xe(f)))]:[];return rn({elementName:u,propsSchema:d,propsSchemaKeys:h,template:p,refs:o,styles:c,handlers:e,methods:t,constants:r,store:n,patch:nu,h:_n,deps:a})},Ir=au;var ou=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.showAlert(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.showConfirm(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.showDropdownMenu(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.closeAll()}}},xn=ou;var lu=xn(),pu={globalUI:lu},An={components:pu};var Or={components:{accordionItem:{handlers:Tt,schema:ts,store:Lt,view:rs},breadcrumb:{handlers:Rt,schema:ss,store:Nt,view:is},dropdownMenu:{handlers:Pt,schema:ns,store:Vt,view:as},form:{handlers:Dt,schema:ls,store:Ft,view:Es},globalUi:{handlers:Ut,schema:ks,store:Kt,view:$s},navbar:{handlers:Ht,schema:Ss,store:Gt,view:Cs},pageOutline:{handlers:qt,schema:Os,store:Jt,view:Ts},popoverInput:{handlers:Yt,schema:Ls,store:Xt,view:Rs},select:{handlers:Zt,schema:Ns,store:Qt,view:Ps},sidebar:{handlers:er,schema:Vs,store:rr,view:Ds},sliderInput:{handlers:sr,schema:js,store:ir,view:Bs},table:{handlers:nr,schema:Ws,store:ar,view:Ms},tabs:{handlers:or,schema:zs,store:lr,view:Fs},tooltip:{handlers:Us,schema:Ks,store:pr,view:Hs},waveform:{handlers:cr,schema:qs,store:ur,view:Js}}};Object.keys(Or).forEach(e=>{Object.keys(Or[e]).forEach(t=>{let r=Or[e][t],s=Ir({...r},An[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",Vr({}));customElements.define("rtgl-view",Wr({}));customElements.define("rtgl-text",zr({}));customElements.define("rtgl-image",Kr({}));customElements.define("rtgl-svg",Gr({}));customElements.define("rtgl-input",qr({}));customElements.define("rtgl-input-number",Jr({}));customElements.define("rtgl-textarea",Yr({}));customElements.define("rtgl-color-picker",Xr({}));customElements.define("rtgl-slider",Zr({}));customElements.define("rtgl-dialog",Qr({}));customElements.define("rtgl-popover",es({}));})();
|