@rettangoli/ui 0.1.2-rc7 → 0.1.2-rc8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
- var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,a)=>{s+=r+(t[a]||"")}),s}var X=["xs","sm","md","lg","xl"],I={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",ta:"text-align",c:"color",cur:"cursor"},y=Object.keys(I),x=e=>e.concat(X.flatMap(t=>e.map(s=>`${t}-${s}`))),V={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)"},p=(e,t={})=>{let s="";for(let[r,a]of Object.entries(V)){r!=="default"&&(s+=`${a} {`);for(let[i,o]of Object.entries(e)){let l=t[i]?` ${t[i]} `:" ";for(let[h,g]of Object.entries(o)){let u=I[i],f=g.startsWith("--")?`var(${g})`:g,v=r==="default"?i:`${r}-${i}`,T=r==="default"?`h-${i}`:`${r}-h-${i}`;if(u){let D=u.split(" ").map(J=>`${J}: ${f};`).join(" ");s+=`
2
- :host([${v}="${h}"])${l}{
1
+ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,l)=>{s+=r+(t[l]||"")}),s}var X=["xs","sm","md","lg","xl"],I={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",ta:"text-align",c:"color",cur:"cursor"},y=Object.keys(I),x=e=>e.concat(X.flatMap(t=>e.map(s=>`${t}-${s}`))),V={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)"},p=(e,t={})=>{let s="";for(let[r,l]of Object.entries(V)){r!=="default"&&(s+=`${l} {`);for(let[i,o]of Object.entries(e)){let a=t[i]?` ${t[i]} `:" ";for(let[h,g]of Object.entries(o)){let u=I[i],f=g.startsWith("--")?`var(${g})`:g,v=r==="default"?i:`${r}-${i}`,T=r==="default"?`h-${i}`:`${r}-h-${i}`;if(u){let D=u.split(" ").map(J=>`${J}: ${f};`).join(" ");s+=`
2
+ :host([${v}="${h}"])${a}{
3
3
  ${D}
4
4
  }
5
- :host([${T}="${h}"]:hover)${l}{
5
+ :host([${T}="${h}"]:hover)${a}{
6
6
  ${D}
7
7
  }
8
8
  `}else s+=`
9
- :host([${v}="${h}"])${l}{
9
+ :host([${v}="${h}"])${a}{
10
10
  ${g}
11
11
  }
12
- :host([${T}="${h}"]:hover)${l}{
12
+ :host([${T}="${h}"]:hover)${a}{
13
13
  ${g}
14
14
  }
15
- `}}r!=="default"&&(s+="}")}return s};function Y(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Z=e=>/%$/.test(e),c=e=>{if(e!==void 0)return Z(e)?e:Y(e)?`${e}px`:Object.keys(n).includes(e)?`var(${n[e]})`:e},n={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function w(e,t=":host"){let s="";for(let[r,a]of Object.entries(V)){r!=="default"&&(s+=`${a} {
16
- `);let i="";for(let[o,l]of Object.entries(e[r]))l!=null&&(i+=`${o}: ${l};
15
+ `}}r!=="default"&&(s+="}")}return s};function Y(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Z=e=>/%$/.test(e),c=e=>{if(e!==void 0)return Z(e)?e:Y(e)?`${e}px`:Object.keys(n).includes(e)?`var(${n[e]})`:e},n={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function w(e,t=":host"){let s="";for(let[r,l]of Object.entries(V)){r!=="default"&&(s+=`${l} {
16
+ `);let i="";for(let[o,a]of Object.entries(e[r]))a!=null&&(i+=`${o}: ${a};
17
17
  `);s+=`${t} {
18
18
  ${i.trim()}
19
19
  }
@@ -258,7 +258,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,a)=>{s+=r+(
258
258
 
259
259
  ${L}
260
260
  ${S}
261
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,s,r){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let s=this.getAttribute("href");if(s){let r=document.createElement("a");r.setAttribute("href",s);let a=this.getAttribute("target");a&&r.setAttribute("target",a),r.appendChild(this._buttonElement),this.shadow.appendChild(r),this._containerElement=r}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let s={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},r={sm:14,md:18,lg:22},a=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let l={sm:14,lg:22},h=this.getAttribute("s");i=l[h]||18}else i=r[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",a),this._iconElement.setAttribute("wh",i.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},B=({render:e,html:t})=>$;var H=d`
261
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,s,r){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let s=this.getAttribute("href");if(s){let r=document.createElement("a");r.setAttribute("href",s);let l=this.getAttribute("target");l&&r.setAttribute("target",l),r.appendChild(this._buttonElement),this.shadow.appendChild(r),this._containerElement=r}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let s={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},r={sm:14,md:18,lg:22},l=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let a={sm:14,lg:22},h=this.getAttribute("s");i=a[h]||18}else i=r[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",l),this._iconElement.setAttribute("wh",i.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},B=({render:e,html:t})=>$;var H=d`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -427,7 +427,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,a)=>{s+=r+(
427
427
  bottom: 0;
428
428
  z-index: 1;
429
429
  }
430
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...x([...y,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),h=c(l===null?this.getAttribute(o("w")):l),g=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="flex !important")});let a=w(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}},q=({render:e,html:t})=>C;var nt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
430
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...x([...y,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,s?this._linkElement.target=s:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="flex !important")});let l=w(this._styles);l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l)}},q=({render:e,html:t})=>C;var nt={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
431
431
  font-size: var(--h1-font-size);
432
432
  font-weight: var(--h1-font-weight);
433
433
  line-height: var(--h1-line-height);
@@ -541,7 +541,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,a)=>{s+=r+(
541
541
  ${k}
542
542
  ${b}
543
543
  ${m}
544
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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 x([...y,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,s?this._linkElement.target=s:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),h=c(l===null?this.getAttribute(o("w")):l),g=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("o")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let a=w(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),r=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),r!==null&&this._imgElement.setAttribute("height",r)}connectedCallback(){this._updateImageAttributes()}},K=({render:e,html:t})=>M;var Q=d`
544
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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 x([...y,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),s=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,s?this._linkElement.target=s:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,s,r){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),u=this.getAttribute(o("o")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let l=w(this._styles);l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),r=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),r!==null&&this._imgElement.setAttribute("height",r)}connectedCallback(){this._updateImageAttributes()}},K=({render:e,html:t})=>M;var Q=d`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -700,7 +700,7 @@ var rettangoli=(()=>{function d(e,...t){let s="";return e.forEach((r,a)=>{s+=r+(
700
700
  }
701
701
  ${b}
702
702
  ${m}
703
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){if(["type","placeholder","disabled","value","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,l=this.getAttribute(o("wh")),h=c(l===null?this.getAttribute(o("w")):l),g=c(l===null?this.getAttribute(o("h")):l),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let a=w(this._styles,"input");a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.getAttribute("value"),a=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r!==null&&(this._inputElement.value=r),a?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},G=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(d`
703
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...x([...y,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,s,r){if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(i=>{let o=v=>`${i==="default"?"":`${i}-`}${v}`,a=this.getAttribute(o("wh")),h=c(a===null?this.getAttribute(o("w")):a),g=c(a===null?this.getAttribute(o("h")):a),u=this.getAttribute(o("op")),f=this.getAttribute(o("z"));f!==null&&(this._styles[i]["z-index"]=f),u!==null&&(this._styles[i].opacity=u),h==="f"?this._styles[i].width="var(--width-stretch)":h!==void 0&&(this._styles[i].width=h,this._styles[i]["min-width"]=h,this._styles[i]["max-width"]=h),g==="f"?this._styles[i].height="100%":g!==void 0&&(this._styles[i].height=g,this._styles[i]["min-height"]=g,this._styles[i]["max-height"]=g),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let l=w(this._styles,"input");l!==this._lastStyleString&&(this._styleElement.textContent=l,this._lastStyleString=l)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),r=this.getAttribute("value"),l=this.getAttribute("step"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),r!==null&&(this._inputElement.value=r),l!==null?this._inputElement.setAttribute("step",l):this._inputElement.removeAttribute("step"),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},G=({render:e,html:t})=>O;var W=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(d`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)Nr(e,r,{get:t[r],enumerable:!0})};function O(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var jr=["xs","sm","md","lg","xl"],xt={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",ta:"text-align",c:"color",cur:"cursor"},q=Object.keys(xt),J=e=>e.concat(jr.flatMap(t=>e.map(r=>`${t}-${r}`))),_t={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)"},K=(e,t={})=>{let r="";for(let[s,i]of Object.entries(_t)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,h]of Object.entries(a)){let u=xt[n],y=h.startsWith("--")?`var(${h})`:h,E=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(u){let c=u.split(" ").map(d=>`${d}: ${y};`).join(" ");r+=`
1
+ var rettangoli=(()=>{var Vr=Object.defineProperty;var N=(e,t)=>{for(var r in t)Vr(e,r,{get:t[r],enumerable:!0})};function O(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Dr=["xs","sm","md","lg","xl"],St={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",ta:"text-align",c:"color",cur:"cursor"},q=Object.keys(St),J=e=>e.concat(Dr.flatMap(t=>e.map(r=>`${t}-${r}`))),kt={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)"},K=(e,t={})=>{let r="";for(let[s,i]of Object.entries(kt)){s!=="default"&&(r+=`${i} {`);for(let[n,a]of Object.entries(e)){let o=t[n]?` ${t[n]} `:" ";for(let[l,h]of Object.entries(a)){let u=St[n],y=h.startsWith("--")?`var(${h})`:h,E=s==="default"?n:`${s}-${n}`,T=s==="default"?`h-${n}`:`${s}-h-${n}`;if(u){let c=u.split(" ").map(d=>`${d}: ${y};`).join(" ");r+=`
2
2
  :host([${E}="${l}"])${o}{
3
3
  ${c}
4
4
  }
@@ -12,7 +12,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
12
12
  :host([${T}="${l}"]:hover)${o}{
13
13
  ${h}
14
14
  }
15
- `}}s!=="default"&&(r+="}")}return r};function Pr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Vr=e=>/%$/.test(e),L=e=>{if(e!==void 0)return Vr(e)?e:Pr(e)?`${e}px`:Object.keys($).includes(e)?`var(${$[e]})`:e},$={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="";for(let[s,i]of Object.entries(_t)){s!=="default"&&(r+=`${i} {
15
+ `}}s!=="default"&&(r+="}")}return r};function Mr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Rr=e=>/%$/.test(e),L=e=>{if(e!==void 0)return Rr(e)?e:Mr(e)?`${e}px`:Object.keys($).includes(e)?`var(${$[e]})`:e},$={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="";for(let[s,i]of Object.entries(kt)){s!=="default"&&(r+=`${i} {
16
16
  `);let n="";for(let[a,o]of Object.entries(e[s]))o!=null&&(n+=`${a}: ${o};
17
17
  `);r+=`${t} {
18
18
  ${n.trim()}
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var Dr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$,s:{sm:`
61
+ `;var zr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},Rr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},St=K(Dr,Rr);var ie=O`
107
+ `}},Wr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Et=K(zr,Wr);var ie=O`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -256,9 +256,9 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
256
256
  display: contents;
257
257
  }
258
258
 
259
- ${St}
259
+ ${Et}
260
260
  ${se}
261
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let s=document.createElement("a");s.setAttribute("href",r);let i=this.getAttribute("target");i&&s.setAttribute("target",i),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},i=r[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let o={sm:14,lg:22},l=this.getAttribute("s");n=o[l]||18}else n=s[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",i),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=L(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},kt=({render:e,html:t})=>Ie;var Et=O`
261
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._containerElement=null,this._buttonElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._iconElement=null,this._buttonElement.appendChild(this._slotElement)}static get observedAttributes(){return["key","href","target","w","t","icon","disabled","v","s","sq","ip"]}connectedCallback(){this._updateButton()}attributeChangedCallback(t,r,s){this._updateButton()}_updateButton(){this.shadow.innerHTML="",this._updateIcon(),this.hasAttribute("sq")||this._updateWidth(),this.hasAttribute("disabled")?this._buttonElement.setAttribute("disabled",""):this._buttonElement.removeAttribute("disabled");let r=this.getAttribute("href");if(r){let s=document.createElement("a");s.setAttribute("href",r);let i=this.getAttribute("target");i&&s.setAttribute("target",i),s.appendChild(this._buttonElement),this.shadow.appendChild(s),this._containerElement=s}else this.shadow.appendChild(this._buttonElement),this._containerElement=this._buttonElement}_updateIcon(){this._iconElement&&(this._iconElement.remove(),this._iconElement=null);let t=this.getAttribute("icon");if(t){let r={pr:"pr-fg",se:"ac-fg",de:"pr-fg",ol:"ac-fg",gh:"ac-fg",lk:"ac-fg"},s={sm:14,md:18,lg:22},i=r[this.getAttribute("v")]||"pr-fg",n=18;if(this.hasAttribute("sq")){let o={sm:14,lg:22},l=this.getAttribute("s");n=o[l]||18}else n=s[this.getAttribute("t")]||18;this._iconElement=document.createElement("rtgl-svg"),this._iconElement.setAttribute("svg",t),this._iconElement.setAttribute("c",i),this._iconElement.setAttribute("wh",n.toString()),this.getAttribute("ip")==="s"?this._buttonElement.insertBefore(this._iconElement,this._slotElement):this._buttonElement.appendChild(this._iconElement)}}_updateWidth(){let t=L(this.getAttribute("w"));t==="f"?this._buttonElement.style.width="var(--width-stretch)":t!=null?(this._buttonElement.style.width=t,this._buttonElement.style.minWidth=t,this._buttonElement.style.maxWidth=t):(this._buttonElement.style.width="",this._buttonElement.style.minWidth="",this._buttonElement.style.maxWidth="")}},At=({render:e,html:t})=>Ie;var $t=O`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
329
329
  justify-content: center;
330
330
  }
331
331
  }
332
- `;var Mr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},R=K(Mr);var At=O`
332
+ `;var Fr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},M=K(Fr);var Ct=O`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
347
347
  flex-wrap: nowrap;
348
348
  }
349
349
 
350
- `;var ce={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},zr={bgc:{pr:`
350
+ `;var ce={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Hr={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
387
387
  left: 0;
388
388
  top: 0;
389
389
  height: 100%;
390
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:$,pr:$,pb:$,pl:$,p:$,ph:$,pv:$,g:$,gv:$,gh:$,bw:ce,bwt:ce,bwr:ce,bwb:ce,bwl:ce,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"}},fe=K(zr);var Wr={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},z=K(Wr);var Te=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
390
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:$,pr:$,pb:$,pl:$,p:$,ph:$,pv:$,g:$,gv:$,gh:$,bw:ce,bwt:ce,bwr:ce,bwb:ce,bwl:ce,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"}},me=K(Hr);var Br={mt:$,mr:$,mb:$,ml:$,m:$,mh:$,mv:$},z=K(Br);var Te=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
391
391
  slot {
392
392
  display: contents;
393
393
  }
@@ -407,11 +407,11 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
407
407
  }
408
408
 
409
409
  ${se}
410
- ${At}
411
- ${Et}
410
+ ${Ct}
411
+ ${$t}
412
412
  ${z}
413
- ${R}
414
- ${fe}
413
+ ${M}
414
+ ${me}
415
415
  ${ie}
416
416
 
417
417
  :host([href]) {
@@ -427,7 +427,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
427
427
  bottom: 0;
428
428
  z-index: 1;
429
429
  }
430
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...J([...q,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=Y(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},$t=({render:e,html:t})=>Te;var Fr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
430
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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","target","op",...J([...q,"wh","w","h","hidden","sh","sv","z"])]}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="flex !important")});let i=Y(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},Ot=({render:e,html:t})=>Te;var Kr={ta:{s:"start",c:"center",e:"end",j:"justify"},s:{h1:`
431
431
  font-size: var(--h1-font-size);
432
432
  font-weight: var(--h1-font-weight);
433
433
  line-height: var(--h1-line-height);
@@ -467,7 +467,7 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
467
467
  font-weight: var(--xs-font-weight);
468
468
  line-height: var(--xs-line-height);
469
469
  letter-spacing: var(--xs-letter-spacing);
470
- `}},Ct=K(Fr);var Hr={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},me=K(Hr);var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
470
+ `}},It=K(Kr);var Ur={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},ye=K(Ur);var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -498,11 +498,11 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
498
498
  bottom: 0;
499
499
  z-index: 1;
500
500
  }
501
- ${Ct}
502
- ${me}
501
+ ${It}
502
+ ${ye}
503
503
  ${z}
504
- ${R}
505
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=L(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=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},Ot=({render:e,html:t})=>Le;var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
504
+ ${M}
505
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","target"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,r,s){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=L(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=""),t==="f"?this.style.width="var(--width-stretch)":t!==void 0?this.style.width=t:this.style.width=""}_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");this._slotElement.parentNode!==this.shadow&&this.shadow.appendChild(this._slotElement),t?(this._linkElement||(this._linkElement=document.createElement("a"),this.shadow.appendChild(this._linkElement)),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target")):this._linkElement&&(this.shadow.removeChild(this._linkElement),this._linkElement=null)}},Tt=({render:e,html:t})=>Le;var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
506
506
  :host {
507
507
  border-style: solid;
508
508
  box-sizing: border-box;
@@ -538,10 +538,10 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
538
538
  cursor: pointer;
539
539
  }
540
540
 
541
- ${fe}
541
+ ${me}
542
542
  ${z}
543
- ${R}
544
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return J([...q,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("o")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},It=({render:e,html:t})=>Ne;var Tt=O`
543
+ ${M}
544
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return J([...q,"key","src","href","target","wh","w","h","hidden","height","width","z"])}_styles={default:{},sm:{},md:{},lg:{},xl:{}};_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),r=this.getAttribute("target");t?(this._linkElement||(this._linkElement=document.createElement("a")),this._linkElement.href=t,r?this._linkElement.target=r:this._linkElement.removeAttribute("target"),this._linkElement.appendChild(this._imgElement),this._linkElement.parentNode!==this.shadow&&this.shadow.appendChild(this._linkElement)):this._linkElement?(this._imgElement.parentNode===this._linkElement&&this.shadow.appendChild(this._imgElement),this._linkElement.parentNode===this.shadow&&this.shadow.removeChild(this._linkElement),this._linkElement=null):this._imgElement.parentNode!==this.shadow&&this.shadow.appendChild(this._imgElement)}attributeChangedCallback(t,r,s){if(t==="href"||t==="target"){this._updateDOM();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("o")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),r=this.getAttribute("width"),s=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),r!==null&&this._imgElement.setAttribute("width",r),s!==null&&this._imgElement.setAttribute("height",s)}connectedCallback(){this._updateImageAttributes()}},Lt=({render:e,html:t})=>Ne;var Nt=O`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -661,11 +661,11 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
661
661
  :host {
662
662
  color: var(--foreground);
663
663
  }
664
- ${me}
665
- ${Tt}
664
+ ${ye}
665
+ ${Nt}
666
666
  ${se}
667
- ${R}
668
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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=L(t===null?this.getAttribute("w"):t),s=L(t===null?this.getAttribute("h"):t);r&&(this.style.width=r),s&&(this.style.height=s)}_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=""}},Lt=({render:e,html:t})=>je;var Pe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
667
+ ${M}
668
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),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=L(t===null?this.getAttribute("w"):t),s=L(t===null?this.getAttribute("h"):t);r&&(this.style.width=r),s&&(this.style.height=s)}_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=""}},jt=({render:e,html:t})=>je;var Pe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
669
669
  :host {
670
670
  display: contents;
671
671
  }
@@ -699,8 +699,8 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
699
699
  cursor: not-allowed;
700
700
  }
701
701
  ${z}
702
- ${R}
703
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","value","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.getAttribute("value"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Nt=({render:e,html:t})=>Pe;var Ve=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
702
+ ${M}
703
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},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._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","s",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("input-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["type","placeholder","disabled","value","step","s"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,"input");i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",r=this.getAttribute("placeholder"),s=this.getAttribute("value"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),r!==null?this._inputElement.setAttribute("placeholder",r):this._inputElement.removeAttribute("placeholder"),s!==null&&(this._inputElement.value=s),i!==null?this._inputElement.setAttribute("step",i):this._inputElement.removeAttribute("step"),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Pt=({render:e,html:t})=>Pe;var Ve=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -724,8 +724,8 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
724
724
  border-color: var(--foreground);
725
725
  }
726
726
  ${z}
727
- ${R}
728
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,s){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder")}},jt=({render:e,html:t})=>Ve;var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
727
+ ${M}
728
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._textareaElement=document.createElement("textarea"),this._textareaElement.setAttribute("type","text"),this.shadow.appendChild(this._textareaElement)}static get observedAttributes(){return["key","w","ellipsis","cols","rows","placeholder"]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}attributeChangedCallback(t,r,s){this._updateTextareaAttributes()}_updateTextareaAttributes(){let t=this.getAttribute("cols"),r=this.getAttribute("rows"),s=this.getAttribute("placeholder");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),r!==null?this._textareaElement.setAttribute("rows",r):this._textareaElement.removeAttribute("rows"),s!==null?this._textareaElement.setAttribute("placeholder",s):this._textareaElement.removeAttribute("placeholder")}},Vt=({render:e,html:t})=>Ve;var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
729
729
  :host {
730
730
  display: contents;
731
731
  }
@@ -747,8 +747,8 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
747
747
  opacity: 0.5;
748
748
  }
749
749
  ${z}
750
- ${R}
751
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Pt=({render:e,html:t})=>De;var Re=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
750
+ ${M}
751
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=t=>{this.dispatchEvent(new CustomEvent("colorpicker-change",{detail:{value:this._inputElement.value}}))};_onInput=t=>{this.dispatchEvent(new CustomEvent("colorpicker-input",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let a=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(this._styles,'input[type="color"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Dt=({render:e,html:t})=>De;var Me=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(O`
752
752
  :host {
753
753
  display: contents;
754
754
  }
@@ -801,8 +801,8 @@ var rettangoli=(()=>{var Nr=Object.defineProperty;var V=(e,t)=>{for(var r in t)N
801
801
  cursor: not-allowed;
802
802
  }
803
803
  ${z}
804
- ${R}
805
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){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=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(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),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()}},Vt=({render:e,html:t})=>Re;var Me={};V(Me,{handleClickDialogueOverlay:()=>Br});var Br=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};V(ze,{INITIAL_STATE:()=>Kr,selectState:()=>qr,setState:()=>Jr,toViewData:()=>Ur});var Kr=Object.freeze({}),Ur=({props:e,attrs:t})=>({isOpen:e.isOpen,w:t.w||600,position:{x:0,y:0}}),qr=({state:e})=>e,Jr=e=>{};var Dt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{w:{type:"string"}}},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:null,template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view z=9999 pos=fix cor=full ah=c sv=true style="scrollbar-width: none;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-overlay pos=fix cor=full ah=c av=c bgc=bg op=0.5",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=10vh",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=${w} br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=",{type:1,path:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var We={};V(We,{handleClickMenuItem:()=>Gr,handleClickPopoverOverlay:()=>Yr});var Yr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Gr=(e,t)=>{let{dispatchEvent:r}=t,s=parseInt(e.currentTarget.id.replace("option-","")),i=t.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var Fe={};V(Fe,{INITIAL_STATE:()=>Xr,selectState:()=>Zr,setState:()=>es,toViewData:()=>Qr});var Xr=Object.freeze({}),Qr=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),Zr=({state:e})=>e,es=e=>{};var Rt={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popover:{eventListeners:{"click-overlay":{handler:"handleClickPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background 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.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],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#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],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}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var He={};V(He,{handleActionClick:()=>rs,handleColorPickerChange:()=>ns,handleInputChange:()=>ss,handleOnMount:()=>ts,handleSelectChange:()=>is,handleSliderChange:()=>as});var ts=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},ye=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},rs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},ss=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},is=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.selectedValue}),ye(i,e.detail.selectedValue,r.selectFormValues(),s))},ns=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))},as=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),ye(i,e.detail.value,r.selectFormValues(),s))};var Be={};V(Be,{INITIAL_STATE:()=>os,selectFormValues:()=>ds,selectState:()=>hs,setFormFieldValue:()=>fs,setFormValues:()=>us,toViewData:()=>cs});var os=Object.freeze({formValues:{}}),ls=["id","class","style","slot"],ps=e=>Object.entries(e).filter(([t])=>!ls.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),cs=({state:e,props:t,attrs:r})=>{let s=ps(r),i=structuredClone(t.form.fields||[]),n=t.defaultValues||{};return i.forEach(a=>{a.defaultValue=n[a.name]}),{containerAttrString:s,title:t.form?.title||"",description:t?.form?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}},hs=({state:e})=>e,ds=({state:e})=>e.formValues,us=(e,t)=>{e.formValues=t||{}},fs=(e,{name:t,value:r})=>{e.formValues[t]=r};var Mt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{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:"inputText"},placeholder:{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"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{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"}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{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:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],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#select-${field.name} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," value=",{type:1,path:"field.defaultValue"}]}}],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#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{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"}," value=",{type:1,path:"field.defaultValue"}]}}],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-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};V(Ke,{handleClickStart:()=>ms});var ms=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ue={};V(Ue,{INITIAL_STATE:()=>ys,selectPath:()=>ws,setState:()=>xs,toViewData:()=>vs});var ys=Object.freeze({}),gs=["id","class","style","slot"],bs=e=>Object.entries(e).filter(([t])=>!gs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),vs=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:bs(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ws=({props:e})=>e.start.path,xs=e=>{};var zt={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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 qe={};V(qe,{handleOnMount:()=>Ss});var Wt=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(a=>{let o=a.getBoundingClientRect();o.top<=20&&o.top>n&&(n=o.top,i=a.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},_s=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),a=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(a),Wt(n,t),s();let o=Wt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},Ss=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=_s(r,e);return()=>{s()}})};var Je={};V(Je,{INITIAL_STATE:()=>ks,selectCurrentId:()=>$s,selectState:()=>As,setContentContainer:()=>Is,setCurrentId:()=>Os,setItems:()=>Cs,toViewData:()=>Es});var ks=Object.freeze({items:[],currentId:null,contentContainer:null}),Es=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),As=({state:e})=>e,$s=({state:e})=>e.currentId,Cs=(e,t)=>{e.items=t},Os=(e,t)=>{e.currentId=t},Is=(e,t)=>{e.contentContainer=t};var Ft={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm 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 pv=xs av=c href=${item.href}",value:{type:9,items:[{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 pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};V(Ye,{handleClickOverlay:()=>Ts});var Ts=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Ge={};V(Ge,{INITIAL_STATE:()=>Ls,selectState:()=>js,toViewData:()=>Ns});var Ls=Object.freeze({}),Ns=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),js=({state:e})=>e;var Ht={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#popoverOverlay pos=fix cor=full",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=mu',value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view#popoverContainer pos=fix style="left: ',{type:1,path:"position.x"},"px; top: ",{type:1,path:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Xe={};V(Xe,{handleButtonClick:()=>Vs,handleClickOptionsPopoverOverlay:()=>Ds,handleOnMount:()=>Ps,handleOptionClick:()=>Rs});var Ps=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=>n.value===r.selectedValue);i&&(t.updateSelectOption(i),s())}},Vs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Ds=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Rs=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var Qe={};V(Qe,{INITIAL_STATE:()=>Ms,closeOptionsPopover:()=>Hs,openOptionsPopover:()=>Fs,selectState:()=>Ws,toViewData:()=>zs,updateSelectOption:()=>Bs});var Ms=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),zs=({state:e,props:t})=>{let r=t.placeholder||"Select an option",s=e.selectedValue!==null?e.selectedValue:t.selectedValue;if(s!=null&&t.options){let n=t.options.find(a=>a.value===s);n&&(r=n.label)}else e.selectedLabel&&(r=e.selectedLabel);let i=(t.options||[]).map(n=>({...n,isSelected:n.value===s,bgc:n.value===s?"mu":""}));return{isOpen:e.isOpen,position:e.position,options:i,selectedValue:s,selectedLabel:r,placeholder:t.placeholder||"Select an option"}},Ws=({state:e})=>e,Fs=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Hs=e=>{e.isOpen=!1},Bs=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Bt={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{eventListeners:{"click-overlay":{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:9,items:[{type:1,path:"selectedLabel"}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background 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 h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",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 h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ze={};V(Ze,{handleHeaderClick:()=>Ks,handleItemClick:()=>Us});var Ks=(e,t)=>{let{store:r,dispatchEvent:s}=t,i,n=r.selectHeader();e.currentTarget.id==="header-label"?i=n.labelPath:e.currentTarget.id==="header-image"?i=n.image.path:e.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},Us=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var tt={};V(tt,{INITIAL_STATE:()=>qs,selectActiveItem:()=>Qs,selectHeader:()=>Xs,selectItem:()=>Zs,setState:()=>ei,toViewData:()=>Gs});var qs=Object.freeze({}),Js=["id","class","style","slot"],Ys=e=>Object.entries(e).filter(([t])=>!Js.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function et(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 o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var Gs=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=Ys(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],u=o==="full"?272:64,y=o==="full"?"fs":"c",E=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,b=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:u,headerAlign:y,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:f,showLabels:g,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:b,headerWidth:b,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Xs=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Qs=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),Zs=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?et(i):[]).find(a=>a.id===s)},ei=e=>{};var Kt={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f 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-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p title="${item.title}"',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:"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=p title="',{type:1,path:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f 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"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};V(rt,{handleHeaderClick:()=>si,handleOnMount:()=>ti,handleRowClick:()=>ri});var ti=e=>{},ri=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},si=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var st={};V(st,{INITIAL_STATE:()=>ii,clearSort:()=>di,selectSortInfo:()=>ci,selectState:()=>pi,setSortColumn:()=>hi,toViewData:()=>li});var ii=Object.freeze({sortColumn:null,sortDirection:null}),ni=["id","class","style","slot"],ai=e=>Object.entries(e).filter(([t])=>!ni.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),oi=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},li=({state:e,props:t,attrs:r})=>{let s=ai(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let u=oi(a,h.key);return{key:h.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},pi=({state:e})=>e,ci=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),hi=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},di=e=>{e.sortColumn=null,e.sortDirection=null};var Ut={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{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-${row.index}",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:"row.index"}]}}],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 Qt=Symbol.for("immer-nothing"),qt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function U(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function ae(e){return!!e&&!!e[F]}function Z(e){return e?Zt(e)||Array.isArray(e)||!!e[qt]||!!e.constructor?.[qt]||xe(e)||_e(e):!1}var ui=Object.prototype.constructor.toString();function Zt(e){if(!e||typeof e!="object")return!1;let t=ne(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)===ui}function ge(e,t){we(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function we(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:xe(e)?2:_e(e)?3:0}function at(e,t){return we(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function er(e,t,r){let s=we(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function fi(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xe(e){return e instanceof Map}function _e(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function ot(e,t){if(xe(e))return new Map(e);if(_e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=Zt(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[F];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(ne(e),s)}else{let s=ne(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function dt(e,t=!1){return Se(e)||ae(e)||!Z(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=mi),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>dt(s,!0))),e}function mi(){U(2)}function Se(e){return Object.isFrozen(e)}var yi={};function ee(e){let t=yi[e];return t||U(0,e),t}var he;function tr(){return he}function gi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function lt(e){pt(e),e.drafts_.forEach(bi),e.drafts_=null}function pt(e){e===he&&(he=e.parent_)}function Yt(e){return he=gi(he,e)}function bi(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Gt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(lt(t),U(4)),Z(e)&&(e=be(t,e),t.parent_||ve(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=be(t,r,[]),lt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Qt?e:void 0}function be(e,t,r){if(Se(t))return t;let s=t[F];if(!s)return ge(t,(i,n)=>Xt(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ve(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),ge(n,(o,l)=>Xt(e,s,i,o,l,r,a)),ve(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function Xt(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!at(t.assigned_,s)?n.concat(s):void 0,l=be(e,i,o);if(er(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!Se(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;be(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ve(e,i)}}function ve(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&dt(t,r)}function vi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:tr(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=ut;r&&(i=[s],n=de);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var ut={get(e,t){if(t===F)return e;let r=Q(e);if(!at(r,t))return wi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===it(e.base_,t)?(nt(e),e.copy_[t]=ht(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=rr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=it(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(fi(r,i)&&(r!==void 0||at(e.base_,t)))return!0;nt(e),ct(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 it(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nt(e),ct(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){U(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){U(12)}},de={};ge(ut,(e,t)=>{de[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});de.deleteProperty=function(e,t){return de.set.call(this,e,t,void 0)};de.set=function(e,t,r){return ut.set.call(this,e[0],t,r,e[0])};function it(e,t){let r=e[F];return(r?Q(r):e)[t]}function wi(e,t,r){let s=rr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function rr(e,t){if(!(t in e))return;let r=ne(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ne(r)}}function ct(e){e.modified_||(e.modified_=!0,e.parent_&&ct(e.parent_))}function nt(e){e.copy_||(e.copy_=ot(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var xi=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(l=n,...h){return a.produce(l,u=>r.call(this,u,...h))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Yt(this),a=ht(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?lt(n):pt(n)}return Jt(n,s),Gt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===Qt&&(i=void 0),this.autoFreeze_&&dt(i,!0),s){let n=[],a=[];ee("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else U(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Z(e)||U(8),ae(e)&&(e=_i(e));let t=Yt(this),r=ht(e,void 0);return r[F].isManual_=!0,pt(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return Jt(s,t),Gt(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=ee("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ht(e,t){let r=xe(e)?ee("MapSet").proxyMap_(e,t):_e(e)?ee("MapSet").proxySet_(e,t):vi(e,t);return(t?t.scope_:tr()).drafts_.push(r),r}function _i(e){return ae(e)||U(10,e),sr(e)}function sr(e){if(!Z(e)||Se(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=ot(e,t.scope_.immer_.useStrictShallowCopy_)}else r=ot(e,!0);return ge(r,(s,i)=>{er(r,s,sr(i))}),t&&(t.finalized_=!1),r}var H=new xi,ir=H.produce,Ua=H.produceWithPatches.bind(H),qa=H.setAutoFreeze.bind(H),Ja=H.setUseStrictShallowCopy.bind(H),Ya=H.applyPatches.bind(H),Ga=H.createDraft.bind(H),Xa=H.finishDraft.bind(H);var N={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},ke={NOT:0};var oe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var nr=(e,t)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new oe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},ar=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)};var Si=(e,t,r={})=>D(e,r,t,{}),D=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return or(e.path,r,s);case N.INTERPOLATION:return ki(e.parts,t,r,s);case N.FUNCTION:return lr(e,t,r,s);case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.CONDITIONAL:return Ei(e,t,r,s);case N.LOOP:return Ai(e,t,r,s);case N.OBJECT:return $i(e,t,r,s);case N.ARRAY:return Ci(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},or=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n=0;n<s.length;n++){let a=s[n];if(r.hasOwnProperty(a)){i=r[a];continue}if(i==null)return;i=i[a]}return i},ki=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=D(n,t,r,s);i+=a!=null?String(a):""}return i},lr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw ar(e.name,t);let n=e.args.map(a=>D(a,t,r,s));return i(...n)},Ee=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return or(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return pr(e,t,r,s);case N.UNARY:return cr(e,t,r,s);case N.FUNCTION:return lr(e,t,r,s);default:return D(e,t,r,s)}},pr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Ee(e.left,t,r,s),o=Ee(e.right,t,r,s);switch(e.op){case B.AND:return a&&o;case B.OR:return a||o}}let i=D(e.left,t,r,s),n=D(e.right,t,r,s);switch(e.op){case B.EQ:return i==n;case B.NEQ:return i!=n;case B.GT:return i>n;case B.LT:return i<n;case B.GTE:return i>=n;case B.LTE:return i<=n;case B.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},cr=(e,t,r,s)=>{let i=e.op===ke.NOT?Ee(e.operand,t,r,s):D(e.operand,t,r,s);switch(e.op){case ke.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},Ei=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Ee(n,t,r,s))return D(e.bodies[i],t,r,s)}return{}},Ai=(e,t,r,s)=>{let i=D(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw nr(a,i)}let n=[];for(let a=0;a<i.length;a++){let o=Object.create(s);o[e.itemVar]=i[a],e.indexVar&&(o[e.indexVar]=a);let l=D(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},$i=(e,t,r,s)=>{let i={},n=null,a=!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 ")){a=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let l=D(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===N.OBJECT&&l.properties){let h=l.properties.find(u=>u.key.startsWith("$for "));if(h){let u=D(h.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=D(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let h=o.parsedKey?D(o.parsedKey,t,r,s):o.key,u=D(o.value,t,r,s);u!==void 0&&(i[h]=u)}}return i},Ci=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=D(n,t,r,s);i.push(a)}else i.push(D(n,t,r,s));return i},Ae=Si;var $e=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...$e(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]:$e(n)})}}t.push(r)}return t},[]):e;var Ti=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},hr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ae(t,r,{}),a=$e(n),o=Li({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Li=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,h)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let u=Object.entries(l);if(u.length===0)return console.warn("Skipping empty object item:",l),null;let[y,E]=u[0];if(!isNaN(Number(y)))return Array.isArray(E)?n(E,`${o}.${y}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${y}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let T,p,c=y.indexOf(" ");c===-1?(T=y,p=""):(T=y.substring(0,c),p=y.substring(c+1).trim());let d=T.split(/[.#]/)[0],f=d.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let I=v[1].substring(1),j=v[4];_[I]=Ti(i,j)}else g[v[1]]=v[2]||v[3]||v[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=m[1]);let x=null;g.id?x=g.id:f&&(x=d);let b=Object.create(null),k=null;if(f)k=d;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let j=I.substring(1);b[j]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${y}`):w=[],k&&!f&&(g.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let I="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(v)}catch(j){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${I}`,j)}}else x===v&&S.push(v)}),S.length>0){S.sort((I,j)=>{let M=!I.includes("*"),X=!j.includes("*");return M&&!X?-1:!M&&X?1:j.length-I.length});let v=S[0];if(r[v]&&r[v].eventListeners){let I=r[v].eventListeners;Object.entries(I).forEach(([j,M])=>{M.handler&&s[M.handler]?A[j]=X=>{s[M.handler](X)}:M.handler&&console.warn(`[Parser] Handler '${M.handler}' for refKey '${v}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let C={};if(x)C.key=x;else if(T){let S=o?`${o}.${h}`:String(h);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);C.key+=`-${v}`}}Object.keys(g).length>0&&(C.attrs=g),Object.keys(b).length>0&&(C.class=b),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,v)=>{let I=S.data?.props||{},j=v.data?.props||{},M=S.data?.attrs||{},X=v.data?.attrs||{},Ir=JSON.stringify(I)!==JSON.stringify(j),Tr=JSON.stringify(M)!==JSON.stringify(X);if(Ir||Tr){let P=v.elm;P&&P.render&&typeof P.render=="function"&&(P.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(P.render(),P.removeAttribute("isDirty"),P.handlers&&P.handlers.handleOnUpdate){let Lr={...P.deps||{},store:P.store,render:P.render.bind(P),handlers:P.handlers,dispatchEvent:P.dispatchEvent.bind(P),refIds:P.refIds||{},getRefIds:()=>P.refIds||{}};P.handlers.handleOnUpdate({oldProps:I,newProps:j,oldAttrs:M,newAttrs:X},Lr)}}))}}});try{return e(d,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Ni=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
804
+ ${M}
805
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"closed"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...J([...q,"wh","w","h","hidden","visible","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=t=>{this.dispatchEvent(new CustomEvent("slider-input",{detail:{value:this._inputElement.value}}))};_onChange=t=>{this.dispatchEvent(new CustomEvent("slider-change",{detail:{value:this._inputElement.value}}))};attributeChangedCallback(t,r,s){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=E=>`${n==="default"?"":`${n}-`}${E}`,o=this.getAttribute(a("wh")),l=L(o===null?this.getAttribute(a("w")):o),h=L(o===null?this.getAttribute(a("h")):o),u=this.getAttribute(a("op")),y=this.getAttribute(a("z"));y!==null&&(this._styles[n]["z-index"]=y),u!==null&&(this._styles[n].opacity=u),l==="f"?this._styles[n].width="var(--width-stretch)":l!==void 0&&(this._styles[n].width=l,this._styles[n]["min-width"]=l,this._styles[n]["max-width"]=l),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(a("hidden"))&&(this._styles[n].display="none !important"),this.hasAttribute(a("visible"))&&(this._styles[n].display="block !important")});let i=Y(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),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()}},Mt=({render:e,html:t})=>Me;var Re={};N(Re,{handleClickDialogueOverlay:()=>qr});var qr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close-dialogue"))};var ze={};N(ze,{INITIAL_STATE:()=>Jr,selectState:()=>Gr,setState:()=>Xr,toViewData:()=>Yr});var Jr=Object.freeze({}),Yr=({props:e,attrs:t})=>({isOpen:e.isOpen,w:t.w||600,position:{x:0,y:0}}),Gr=({state:e})=>e,Xr=e=>{};var Rt={elementName:"rtgl-dialog",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{w:{type:"string"}}},propsSchema:{type:"object",properties:{isOpen:{type:"boolean"}}},refs:{"dialog-overlay":{eventListeners:{click:{handler:"handleClickDialogueOverlay"}}}},events:{"close-dialogue":{type:"object",properties:{}}},styles:null,template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:'rtgl-view z=9999 pos=fix cor=full ah=c sv=true style="scrollbar-width: none;"',value:{type:9,items:[{type:8,properties:[{key:"rtgl-view#dialog-overlay pos=fix cor=full ah=c av=c bgc=bg op=0.5",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view h=10vh",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:"rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=${w} br=sm",value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#dialog-container z=100 bw=xs p=lg bgc=bg w=",{type:1,path:"w"}," br=sm"]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var We={};N(We,{handleClickMenuItem:()=>Zr,handleClickPopoverOverlay:()=>Qr});var Qr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))},Zr=(e,t)=>{let{dispatchEvent:r}=t,s=parseInt(e.currentTarget.id.replace("option-","")),i=t.props.items[s];r(new CustomEvent("click-item",{detail:{index:s,item:i}}))};var Fe={};N(Fe,{INITIAL_STATE:()=>es,selectState:()=>rs,setState:()=>ss,toViewData:()=>ts});var es=Object.freeze({}),ts=({state:e,props:t})=>({items:t.items||[],isOpen:t.isOpen||!1,position:t.position||{x:0,y:0}}),rs=({state:e})=>e,ss=e=>{};var zt={elementName:"rtgl-dropdown-menu",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{label:{type:"string"},type:{type:"string",enum:["label","item","separator"]}}}},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popover:{eventListeners:{"click-overlay":{handler:"handleClickPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background 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.type == 'label'",value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"label"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"item"}},{type:4,op:0,left:{type:1,path:"item.type"},right:{type:0,value:"separator"}}],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#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"item.label"}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view#option-",{type:1,path:"i"}," w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=mu"]}}],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}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var He={};N(He,{handleActionClick:()=>ns,handleColorPickerChange:()=>ls,handleInputChange:()=>as,handleOnMount:()=>is,handleSelectChange:()=>os,handleSliderChange:()=>ps,handleSliderInputChange:()=>cs});var is=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},he=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},ns=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("action-","");s(new CustomEvent("action-click",{detail:{actionId:i,formValues:r.selectFormValues()}}))},as=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},os=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("select-","");i&&e.detail.selectedValue!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.selectedValue}),he(i,e.detail.selectedValue,r.selectFormValues(),s))},ls=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("colorpicker-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},ps=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))},cs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("slider-input-","");i&&e.detail.value!==void 0&&(r.setFormFieldValue({name:i,value:e.detail.value}),he(i,e.detail.value,r.selectFormValues(),s))};var Be={};N(Be,{INITIAL_STATE:()=>hs,selectFormValues:()=>ys,selectState:()=>ms,setFormFieldValue:()=>bs,setFormValues:()=>gs,toViewData:()=>fs});var hs=Object.freeze({formValues:{}}),ds=["id","class","style","slot"],us=e=>Object.entries(e).filter(([t])=>!ds.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),fs=({state:e,props:t,attrs:r})=>{let s=us(r),i=structuredClone(t.form.fields||[]),n=t.defaultValues||{};return i.forEach(a=>{a.defaultValue=n[a.name]}),{containerAttrString:s,title:t.form?.title||"",description:t?.form?.description||"",fields:i,actions:t?.form?.actions||{buttons:[]},formValues:e.formValues}},ms=({state:e})=>e,ys=({state:e})=>e.formValues,gs=(e,t)=>{e.formValues=t||{}},bs=(e,{name:t,value:r})=>{e.formValues[t]=r};var Wt={elementName:"rtgl-form",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{defaultValues:{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:"inputText"},placeholder:{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"},options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}},required:["id","label","value"]}}},required:["name","label","inputType","options"],additionalProperties:!1},{type:"object",properties:{name:{type:"string"},label:{type:"string"},description:{type:"string"},inputType:{const:"colorPicker"},value:{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"}},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"}},required:["name","label","inputType"],additionalProperties:!1}]}},actions:{type:"object",properties:{buttons:{type:"array",items:{type:"object",properties:{id:{type:"string"},content:{type:"string"}},required:["id","content"]}}}}}}}},refs:{"action-*":{eventListeners:{click:{handler:"handleActionClick"}}},"input-*":{eventListeners:{"input-change":{handler:"handleInputChange"}}},"select-*":{eventListeners:{"select-change":{handler:"handleSelectChange"}}},"colorpicker-*":{eventListeners:{"colorpicker-change":{handler:"handleColorPickerChange"}}},"slider-*":{eventListeners:{"slider-change":{handler:"handleSliderChange"}}},"slider-input-*":{eventListeners:{"slider-input-value-change":{handler:"handleSliderInputChange"}}}},events:{"form-change":{}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f h=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:"rtgl-text s=lg",value:{type:1,path:"title"}}],fast:!0},{type:8,properties:[{key:"rtgl-text c=mu-fg",value:{type:1,path:"description"}}],fast:!0}],fast:!0}}],fast:!0},{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:"rtgl-view g=sm",value:{type:9,items:[{type:8,properties:[{key:"rtgl-text",value:{type:1,path:"field.label"}}],fast:!0},{type:8,properties:[{key:"rtgl-text s=sm c=mu-fg",value:{type:1,path:"field.description"}}],fast:!0}],fast:!0}}],fast:!0},{type:8,properties:[{key:'$if field.inputType == "inputText"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"inputText"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-input#input-${field.name} w=f placeholder=${field.placeholder} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input-",{type:1,path:"field.name"}," w=f placeholder=",{type:1,path:"field.placeholder"}," value=",{type:1,path:"field.defaultValue"}]}}],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#select-${field.name} w=f .options=fields[${i}].options .placeholder=fields[${i}].placeholder .selectedValue=fields[${i}].defaultValue",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-select#select-",{type:1,path:"field.name"}," w=f .options=fields[",{type:1,path:"i"},"].options .placeholder=fields[",{type:1,path:"i"},"].placeholder .selectedValue=fields[",{type:1,path:"i"},"].defaultValue"]}}],fast:!0}],fast:!0}],id:null}}],fast:!1},{type:8,properties:[{key:'$if field.inputType == "colorPicker"',value:{type:6,conditions:[{type:4,op:0,left:{type:1,path:"field.inputType"},right:{type:0,value:"colorPicker"}}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-color-picker#colorpicker-",{type:1,path:"field.name"}," value=",{type:1,path:"field.defaultValue"}]}}],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#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider-",{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"}," value=",{type:1,path:"field.defaultValue"}]}}],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#slider-input-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider-input#slider-input-",{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"}," defaultValue=",{type:1,path:"field.defaultValue"}]}}],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-${button.id}",value:{type:1,path:"button.content"},parsedKey:{type:2,parts:["rtgl-button#action-",{type:1,path:"button.id"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f h=f p=md g=lg ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var Ke={};N(Ke,{handleClickStart:()=>vs});var vs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ue={};N(Ue,{INITIAL_STATE:()=>ws,selectPath:()=>ks,setState:()=>Es,toViewData:()=>Ss});var ws=Object.freeze({}),xs=["id","class","style","slot"],_s=e=>Object.entries(e).filter(([t])=>!xs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),Ss=({state:e,props:t,attrs:r})=>{console.log("attrs",{attrs:r,entries:Object.entries(r)});let s=r.start?JSON.parse(decodeURIComponent(r.start)):t.start;return{containerAttrString:_s(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ks=({props:e})=>e.start.path,Es=e=>{};var Ft={elementName:"rtgl-navbar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}},hasImage:{type:"boolean"},hasHref:{type:"boolean"}}}}},propsSchema:{type:"object",properties:{start:{type:"object",properties:{label:{type:"string"},href:{type:"string"},image:{type:"object",properties:{src:{type:"string"}}}}}}},refs:{start:{eventListeners:{click:{handler:"handleClickStart"}}}},events:{clickStart:{type:"object",properties:{path:{type:"string"}}}},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=lg 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=lg g=md cur=p",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=lg 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 flex=1",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 qe={};N(qe,{handleOnMount:()=>$s});var Ht=(e,t)=>{let{store:r,render:s}=t,i,n=-1/0;e.forEach(a=>{let o=a.getBoundingClientRect();o.top<=20&&o.top>n&&(n=o.top,i=a.id)}),i&&i!==r.selectCurrentId()&&(r.setCurrentId(i),s())},As=(e,t)=>{let{store:r,render:s}=t,i=e.querySelectorAll("rtgl-text[id]"),n=Array.from(i),a=n.map(l=>({id:l.id,href:`#${l.id}`,title:l.textContent}));r.setItems(a),Ht(n,t),s();let o=Ht.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},$s=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=As(r,e);return()=>{s()}})};var Je={};N(Je,{INITIAL_STATE:()=>Cs,selectCurrentId:()=>Ts,selectState:()=>Is,setContentContainer:()=>js,setCurrentId:()=>Ns,setItems:()=>Ls,toViewData:()=>Os});var Cs=Object.freeze({items:[],currentId:null,contentContainer:null}),Os=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Is=({state:e})=>e,Ts=({state:e})=>e.currentId,Ls=(e,t)=>{e.items=t},Ns=(e,t)=>{e.currentId=t},js=(e,t)=>{e.contentContainer=t};var Bt={elementName:"rtgl-page-outline",viewDataSchema:{type:"object",properties:{items:{type:"array",items:{type:"object",properties:{slug:{type:"string"},title:{type:"string"}}}},selectedSlug:{type:"string",nullable:!0}}},propsSchema:{type:"object",properties:{}},refs:{},events:{onItemClick:{type:"object"}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-view h=f w=272",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view w=f g=sm 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 pv=xs av=c href=${item.href}",value:{type:9,items:[{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 pv=xs av=c href=",{type:1,path:"item.href"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ye={};N(Ye,{handleClickOverlay:()=>Ps});var Ps=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("click-overlay"))};var Ge={};N(Ge,{INITIAL_STATE:()=>Vs,selectState:()=>Ms,toViewData:()=>Ds});var Vs=Object.freeze({}),Ds=({state:e,props:t})=>({isOpen:t.isOpen,position:t.position}),Ms=({state:e})=>e;var Kt={elementName:"rtgl-popover",viewDataSchema:{type:"object",properties:{isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},placement:{type:"string"}}},propsSchema:{type:"object",properties:{placement:{type:"string",default:"bottom"},isOpen:{type:"boolean"},position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}}}},refs:{popoverOverlay:{eventListeners:{click:{handler:"handleClickOverlay"}}}},styles:{"@keyframes popover-in":{from:{opacity:0,transform:"scale(0.95)"},to:{opacity:1,transform:"scale(1)"}},"#popoverContainer":{animation:"popover-in 150ms cubic-bezier(0.16, 1, 0.3, 1)","transform-origin":"top"}},template:{type:9,items:[{type:8,properties:[{key:"$if isOpen",value:{type:6,conditions:[{type:1,path:"isOpen"}],bodies:[{type:9,items:[{type:8,properties:[{key:"rtgl-view#popoverOverlay pos=fix cor=full",value:{type:0,value:null}}],fast:!0},{type:8,properties:[{key:'rtgl-view#popoverContainer pos=fix style="left: ${position.x}px; top: ${position.y}px;" id=floatingElement bw=xs p=md bgc=mu',value:{type:9,items:[{type:8,properties:[{key:"slot name=content",value:{type:0,value:null}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:['rtgl-view#popoverContainer pos=fix style="left: ',{type:1,path:"position.x"},"px; top: ",{type:1,path:"position.y"},'px;" id=floatingElement bw=xs p=md bgc=mu']}}],fast:!0}],fast:!0}],id:null}}],fast:!1}],fast:!1}};var Xe={};N(Xe,{handleButtonClick:()=>zs,handleClickOptionsPopoverOverlay:()=>Ws,handleOnMount:()=>Rs,handleOptionClick:()=>Fs});var Rs=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=>n.value===r.selectedValue);i&&(t.updateSelectOption(i),s())}},zs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Ws=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Fs=(e,t)=>{let{render:r,dispatchEvent:s,props:i,store:n}=t,a=e.currentTarget.id.replace("option-",""),o=i.options[a];n.updateSelectOption(o),i.onChange&&typeof i.onChange=="function"&&i.onChange(o.value),s(new CustomEvent("option-selected",{detail:{value:o.value,label:o.label},bubbles:!0})),s(new CustomEvent("select-change",{detail:{selectedValue:o.value},bubbles:!0})),r()};var Qe={};N(Qe,{INITIAL_STATE:()=>Hs,closeOptionsPopover:()=>qs,openOptionsPopover:()=>Us,selectState:()=>Ks,toViewData:()=>Bs,updateSelectOption:()=>Js});var Hs=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Bs=({state:e,props:t})=>{let r=t.placeholder||"Select an option",s=e.selectedValue!==null?e.selectedValue:t.selectedValue;if(s!=null&&t.options){let n=t.options.find(a=>a.value===s);n&&(r=n.label)}else e.selectedLabel&&(r=e.selectedLabel);let i=(t.options||[]).map(n=>({...n,isSelected:n.value===s,bgc:n.value===s?"mu":""}));return{isOpen:e.isOpen,position:e.position,options:i,selectedValue:s,selectedLabel:r,placeholder:t.placeholder||"Select an option"}},Ks=({state:e})=>e,Us=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},qs=e=>{e.isOpen=!1},Js=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Ut={elementName:"rtgl-select",viewDataSchema:{type:"object"},propsSchema:{type:"object",properties:{options:{type:"array",items:{type:"object",properties:{id:{type:"string"},label:{type:"string"},value:{type:"any"}}}},selectedValue:{type:"any"},placeholder:{type:"string"},onChange:{type:"function"}}},refs:{"select-button":{eventListeners:{click:{handler:"handleButtonClick"}}},popover:{eventListeners:{"click-overlay":{handler:"handleClickOptionsPopoverOverlay"}}},"option-*":{eventListeners:{click:{handler:"handleOptionClick"}}}},events:{},template:{type:9,items:[{type:8,properties:[{key:"rtgl-button#select-button v=ol",value:{type:9,items:[{type:1,path:"selectedLabel"}],fast:!0}}],fast:!0},{type:8,properties:[{key:"rtgl-popover#popover .isOpen=isOpen .position=position",value:{type:9,items:[{type:8,properties:[{key:"rtgl-view wh=300 g=xs slot=content bgc=background 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 h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}",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 h-bgc=ac ph=lg pv=md cur=p br=md bgc=",{type:1,path:"option.bgc"}]}}],fast:!0}],fast:!0}}],fast:!1}}],fast:!1}],fast:!1}}],fast:!1}],fast:!1}};var Ze={};N(Ze,{handleHeaderClick:()=>Ys,handleItemClick:()=>Gs});var Ys=(e,t)=>{let{store:r,dispatchEvent:s}=t,i,n=r.selectHeader();e.currentTarget.id==="header-label"?i=n.labelPath:e.currentTarget.id==="header-image"?i=n.image.path:e.currentTarget.id==="header"&&(i=n.path),s(new CustomEvent("headerClick",{detail:{path:i},bubbles:!0,composed:!0}))},Gs=(e,t)=>{let{store:r,dispatchEvent:s}=t,i=e.currentTarget.id.replace("item-",""),n=r.selectItem(i);s(new CustomEvent("itemClick",{detail:{item:n},bubbles:!0,composed:!0}))};var tt={};N(tt,{INITIAL_STATE:()=>Xs,selectActiveItem:()=>ri,selectHeader:()=>ti,selectItem:()=>si,setState:()=>ii,toViewData:()=>ei});var Xs=Object.freeze({}),Qs=["id","class","style","slot"],Zs=e=>Object.entries(e).filter(([t])=>!Qs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function et(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 o=a.id||a.href||a.path,l=t===o;r.push({id:o,title:a.title,href:a.href,type:a.type||"item",icon:a.icon,hrefAttr:a.href?`href=${a.href}`:"",isSelected:l,itemBgc:l?"ac":"bg",itemHoverBgc:l?"ac":"mu"})}}return r}var ei=({state:e,props:t,attrs:r})=>{let s=r.header?JSON.parse(decodeURIComponent(r.header)):t.header,i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items,n=r.selectedItemId||t.selectedItemId,a=Zs(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],u=o==="full"?272:64,y=o==="full"?"fs":"c",E=o==="full"?"fs":"c",T=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,f=o==="shrunk-lg"?"md":"sm",g=o==="full",_=o==="full",m=o==="full"?"fs":"c",x=o==="full"?"":`ah=${E}`,b=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:u,headerAlign:y,itemAlign:E,headerPadding:T,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:f,showLabels:g,showGroupLabels:_,itemContentAlign:m,itemAlignAttr:x,itemWidth:b,headerWidth:b,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},ti=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,ri=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),si=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?et(i):[]).find(a=>a.id===s)},ii=e=>{};var qt={elementName:"rtgl-sidebar",viewDataSchema:{type:"object",properties:{containerAttrString:{type:"string"},mode:{type:"string",enum:["full","shrunk","shrunk-lg"],default:"full"},sidebarWidth:{type:"number"},headerAlign:{type:"string"},itemAlign:{type:"string"},headerPadding:{type:"string"},itemPadding:{type:"string"},itemHeight:{type:"number"},iconSize:{type:"number"},firstLetterSize:{type:"string"},showLabels:{type:"boolean"},showGroupLabels:{type:"boolean"},itemContentAlign:{type:"string"},itemAlignAttr:{type:"string"},itemWidth:{type:"string"},headerWidth:{type:"string"},selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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"},active:{type:"boolean"},icon:{type:"string"}}}}}},propsSchema:{type:"object",properties:{selectedItemId:{type:"string"},header:{type:"object",properties:{label:{type:"string"},href:{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"}}}}}},refs:{"header-image":{eventListeners:{click:{handler:"handleHeaderClick"}}},"header-label":{eventListeners:{click:{handler:"handleHeaderClick"}}},header:{eventListeners:{click:{handler:"handleHeaderClick"}}},"item-*":{eventListeners:{click:{handler:"handleItemClick"}}}},events:{headerClick:{type:"object",properties:{path:{type:"string"}}}},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#header-image cur=p":[{'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#header-label cur=p":[{"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} bwr=xs ah=${ah} ${containerAttrString}",value:{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#header-image cur=p",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#header-label cur=p",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=p",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#header-image cur=p",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#header-label cur=p",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=p"]}}],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},{type:8,properties:[{key:"rtgl-view w=f 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-bg",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-${item.id} ${item.hrefAttr} h=${itemHeight} av=c ${itemAlignAttr} ph=${itemPadding} w=${itemWidth} h-bgc=${item.itemHoverBgc} br=lg bgc=${item.itemBgc} cur=p title="${item.title}"',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:"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=p title="',{type:1,path:"item.title"},'"']}}],fast:!1}],fast:!1}],id:null}}],fast:!1}],fast:!1}}],fast:!1},parsedKey:{type:2,parts:["rtgl-view w=f 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"}," bwr=xs ah=",{type:1,path:"ah"}," ",{type:1,path:"containerAttrString"}]}}],fast:!1}],fast:!1}};var rt={};N(rt,{handleOnMount:()=>ni,handleValueChange:()=>ai});var ni=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},ai=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=Number(e.detail.value);r.setValue(n),s(),i(new CustomEvent("slider-input-value-change",{detail:{value:n},bubbles:!0}))};var st={};N(st,{INITIAL_STATE:()=>oi,setValue:()=>pi,toViewData:()=>li});var oi=Object.freeze({value:0}),li=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),pi=(e,t)=>{e.value=t};var Jt={elementName:"rtgl-slider-input",viewDataSchema:{type:"object"},attrsSchema:{type:"object",properties:{defaultValue:{type:"string",default:"0"},w:{type:"string",default:""},min:{type:"string",default:"0"},max:{type:"string",default:"100"},step:{type:"string",default:"1"}}},refs:{input:{eventListeners:{"input-change":{handler:"handleValueChange"}}},slider:{eventListeners:{"slider-change":{handler:"handleValueChange"}}}},events:{"form-change":{}},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 w=80% type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=80% 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-input#input w=20% type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=20% 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},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var it={};N(it,{handleHeaderClick:()=>di,handleOnMount:()=>ci,handleRowClick:()=>hi});var ci=e=>{},hi=(e,t)=>{let{dispatchEvent:r,props:s}=t,i=parseInt(e.currentTarget.id.replace("row-","")),n=s.data?.rows?.[i];n&&r(new CustomEvent("row-click",{detail:{rowIndex:i,rowData:n}}))},di=(e,t)=>{let{store:r,render:s,dispatchEvent:i}=t,n=e.currentTarget.id.replace("header-",""),a=r.selectSortInfo(),o="asc";a.column===n&&(a.direction==="asc"?o="desc":a.direction==="desc"&&(o=null)),o?r.setSortColumn({column:n,direction:o}):r.clearSort(),s(),i(new CustomEvent("header-click",{detail:{column:n,direction:o,sortInfo:o?{column:n,direction:o}:null}}))};var nt={};N(nt,{INITIAL_STATE:()=>ui,clearSort:()=>xi,selectSortInfo:()=>vi,selectState:()=>bi,setSortColumn:()=>wi,toViewData:()=>gi});var ui=Object.freeze({sortColumn:null,sortDirection:null}),fi=["id","class","style","slot"],mi=e=>Object.entries(e).filter(([t])=>!fi.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),yi=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},gi=({state:e,props:t,attrs:r})=>{let s=mi(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let u=yi(a,h.key);return{key:h.key,value:u!=null?String(u):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},bi=({state:e})=>e,vi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),wi=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},xi=e=>{e.sortColumn=null,e.sortDirection=null};var Yt={elementName:"rtgl-table",viewDataSchema:{type:"object",properties:{columns:{type:"array"},rows:{type:"array"},containerAttrString:{type:"string"}}},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}}},refs:{"row-*":{eventListeners:{click:{handler:"handleRowClick"}}},"header-*":{eventListeners:{click:{handler:"handleHeaderClick"}}}},events:{},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-${column.key}",value:{type:1,path:"column.label"},parsedKey:{type:2,parts:["th#header-",{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-${row.index}",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:"row.index"}]}}],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 tr=Symbol.for("immer-nothing"),Gt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function U(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ne=Object.getPrototypeOf;function ae(e){return!!e&&!!e[F]}function Z(e){return e?rr(e)||Array.isArray(e)||!!e[Gt]||!!e.constructor?.[Gt]||xe(e)||_e(e):!1}var _i=Object.prototype.constructor.toString();function rr(e){if(!e||typeof e!="object")return!1;let t=ne(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)===_i}function ge(e,t){we(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function we(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:xe(e)?2:_e(e)?3:0}function lt(e,t){return we(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sr(e,t,r){let s=we(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function Si(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function xe(e){return e instanceof Map}function _e(e){return e instanceof Set}function Q(e){return e.copy_||e.base_}function pt(e,t){if(xe(e))return new Map(e);if(_e(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=rr(e);if(t===!0||t==="class_only"&&!r){let s=Object.getOwnPropertyDescriptors(e);delete s[F];let i=Reflect.ownKeys(s);for(let n=0;n<i.length;n++){let a=i[n],o=s[a];o.writable===!1&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(s[a]={configurable:!0,writable:!0,enumerable:o.enumerable,value:e[a]})}return Object.create(ne(e),s)}else{let s=ne(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function ft(e,t=!1){return Se(e)||ae(e)||!Z(e)||(we(e)>1&&(e.set=e.add=e.clear=e.delete=ki),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ft(s,!0))),e}function ki(){U(2)}function Se(e){return Object.isFrozen(e)}var Ei={};function ee(e){let t=Ei[e];return t||U(0,e),t}var de;function ir(){return de}function Ai(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xt(e,t){t&&(ee("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ct(e){ht(e),e.drafts_.forEach($i),e.drafts_=null}function ht(e){e===de&&(de=e.parent_)}function Qt(e){return de=Ai(de,e)}function $i(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Zt(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(ct(t),U(4)),Z(e)&&(e=be(t,e),t.parent_||ve(t,e)),t.patches_&&ee("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=be(t,r,[]),ct(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tr?e:void 0}function be(e,t,r){if(Se(t))return t;let s=t[F];if(!s)return ge(t,(i,n)=>er(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return ve(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),ge(n,(o,l)=>er(e,s,i,o,l,r,a)),ve(e,i,!1),r&&e.patches_&&ee("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function er(e,t,r,s,i,n,a){if(ae(i)){let o=n&&t&&t.type_!==3&&!lt(t.assigned_,s)?n.concat(s):void 0,l=be(e,i,o);if(sr(r,s,l),ae(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(Z(i)&&!Se(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;be(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&ve(e,i)}}function ve(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ft(t,r)}function Ci(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:ir(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=mt;r&&(i=[s],n=ue);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var mt={get(e,t){if(t===F)return e;let r=Q(e);if(!lt(r,t))return Oi(e,r,t);let s=r[t];return e.finalized_||!Z(s)?s:s===at(e.base_,t)?(ot(e),e.copy_[t]=ut(s,e)):s},has(e,t){return t in Q(e)},ownKeys(e){return Reflect.ownKeys(Q(e))},set(e,t,r){let s=nr(Q(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=at(Q(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Si(r,i)&&(r!==void 0||lt(e.base_,t)))return!0;ot(e),dt(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 at(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ot(e),dt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Q(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){U(11)},getPrototypeOf(e){return ne(e.base_)},setPrototypeOf(){U(12)}},ue={};ge(mt,(e,t)=>{ue[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});ue.deleteProperty=function(e,t){return ue.set.call(this,e,t,void 0)};ue.set=function(e,t,r){return mt.set.call(this,e[0],t,r,e[0])};function at(e,t){let r=e[F];return(r?Q(r):e)[t]}function Oi(e,t,r){let s=nr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function nr(e,t){if(!(t in e))return;let r=ne(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ne(r)}}function dt(e){e.modified_||(e.modified_=!0,e.parent_&&dt(e.parent_))}function ot(e){e.copy_||(e.copy_=pt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ii=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(l=n,...h){return a.produce(l,u=>r.call(this,u,...h))}}typeof r!="function"&&U(6),s!==void 0&&typeof s!="function"&&U(7);let i;if(Z(t)){let n=Qt(this),a=ut(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?ct(n):ht(n)}return Xt(n,s),Zt(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===tr&&(i=void 0),this.autoFreeze_&&ft(i,!0),s){let n=[],a=[];ee("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else U(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...o)=>this.produceWithPatches(a,l=>t(l,...o));let s,i;return[this.produce(t,r,(a,o)=>{s=a,i=o}),s,i]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){Z(e)||U(8),ae(e)&&(e=Ti(e));let t=Qt(this),r=ut(e,void 0);return r[F].isManual_=!0,ht(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&U(9);let{scope_:s}=r;return Xt(s,t),Zt(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=ee("Patches").applyPatches_;return ae(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ut(e,t){let r=xe(e)?ee("MapSet").proxyMap_(e,t):_e(e)?ee("MapSet").proxySet_(e,t):Ci(e,t);return(t?t.scope_:ir()).drafts_.push(r),r}function Ti(e){return ae(e)||U(10,e),ar(e)}function ar(e){if(!Z(e)||Se(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=pt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=pt(e,!0);return ge(r,(s,i)=>{sr(r,s,ar(i))}),t&&(t.finalized_=!1),r}var H=new Ii,or=H.produce,ro=H.produceWithPatches.bind(H),so=H.setAutoFreeze.bind(H),io=H.setUseStrictShallowCopy.bind(H),no=H.applyPatches.bind(H),ao=H.createDraft.bind(H),oo=H.finishDraft.bind(H);var j={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},B={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},ke={NOT:0};var oe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var lr=(e,t)=>{if(t===null)return new oe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new oe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new oe(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},pr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new oe(`Unknown function '${e}' (${r})`)};var Li=(e,t,r={})=>D(e,r,t,{}),D=(e,t,r,s)=>{switch(e.type){case j.LITERAL:return e.value;case j.VARIABLE:return cr(e.path,r,s);case j.INTERPOLATION:return Ni(e.parts,t,r,s);case j.FUNCTION:return hr(e,t,r,s);case j.BINARY:return dr(e,t,r,s);case j.UNARY:return ur(e,t,r,s);case j.CONDITIONAL:return ji(e,t,r,s);case j.LOOP:return Pi(e,t,r,s);case j.OBJECT:return Vi(e,t,r,s);case j.ARRAY:return Di(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},cr=(e,t,r)=>{if(!e)return;if(r.hasOwnProperty(e))return r[e];let s=e.split("."),i=t;for(let n=0;n<s.length;n++){let a=s[n];if(r.hasOwnProperty(a)){i=r[a];continue}if(i==null)return;i=i[a]}return i},Ni=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=D(n,t,r,s);i+=a!=null?String(a):""}return i},hr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw pr(e.name,t);let n=e.args.map(a=>D(a,t,r,s));return i(...n)},Ee=(e,t,r,s)=>{switch(e.type){case j.VARIABLE:return cr(e.path,r,s);case j.LITERAL:return e.value;case j.BINARY:return dr(e,t,r,s);case j.UNARY:return ur(e,t,r,s);case j.FUNCTION:return hr(e,t,r,s);default:return D(e,t,r,s)}},dr=(e,t,r,s)=>{if(e.op===B.AND||e.op===B.OR){let a=Ee(e.left,t,r,s),o=Ee(e.right,t,r,s);switch(e.op){case B.AND:return a&&o;case B.OR:return a||o}}let i=D(e.left,t,r,s),n=D(e.right,t,r,s);switch(e.op){case B.EQ:return i==n;case B.NEQ:return i!=n;case B.GT:return i>n;case B.LT:return i<n;case B.GTE:return i>=n;case B.LTE:return i<=n;case B.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},ur=(e,t,r,s)=>{let i=e.op===ke.NOT?Ee(e.operand,t,r,s):D(e.operand,t,r,s);switch(e.op){case ke.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},ji=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||Ee(n,t,r,s))return D(e.bodies[i],t,r,s)}return{}},Pi=(e,t,r,s)=>{let i=D(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw lr(a,i)}let n=[];for(let a=0;a<i.length;a++){let o=Object.create(s);o[e.itemVar]=i[a],e.indexVar&&(o[e.indexVar]=a);let l=D(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Vi=(e,t,r,s)=>{let i={},n=null,a=!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 ")){a=!0;break}for(let o of e.properties)if(o.key.startsWith("$if ")||o.key.match(/^\$if\s+\w+.*:?$/)){let l=D(o.value,t,r,s);if(!a&&l!==null&&l!==void 0)return Array.isArray(l)&&l.length===1?l[0]:l;typeof l=="object"&&l!==null&&!Array.isArray(l)&&Object.assign(i,l)}else if(!o.key.startsWith("$for ")){let l=o.value;if(l&&l.type===j.OBJECT&&l.properties){let h=l.properties.find(u=>u.key.startsWith("$for "));if(h){let u=D(h.value,t,r,s);u!==void 0&&(i[o.key]=u)}else{let u=D(o.value,t,r,s);u!==void 0&&(i[o.key]=u)}}else{let h=o.parsedKey?D(o.parsedKey,t,r,s):o.key,u=D(o.value,t,r,s);u!==void 0&&(i[h]=u)}}return i},Di=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===j.LOOP){let a=D(n,t,r,s);i.push(a)}else i.push(D(n,t,r,s));return i},Ae=Li;var $e=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...$e(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]:$e(n)})}}t.push(r)}return t},[]):e;var zi=(e,t)=>{if(!t)return e;let r=[],s="",i=!1,n=null;for(let a=0;a<t.length;a++){let o=t[a];if(!i&&o===".")s&&(r.push(s),s="");else if(!i&&o==="[")s&&(r.push(s),s=""),i=!0;else if(i&&o==="]"){if(s){if(s.startsWith('"')&&s.endsWith('"')||s.startsWith("'")&&s.endsWith("'"))r.push(s.slice(1,-1));else{let l=Number(s);r.push(isNaN(l)?s:l)}s=""}i=!1,n=null}else i&&(o==='"'||o==="'")&&(n?o===n&&(n=null):n=o),s+=o}return s&&r.push(s),r.reduce((a,o)=>a&&a[o],e)},fr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ae(t,r,{}),a=$e(n),o=Wi({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Wi=({h:e,items:t,refs:r={},handlers:s={},viewData:i={}})=>{if(!Array.isArray(t))return console.error("Input to createVirtualDom must be an array."),[e("div",{},[])];function n(a,o=""){return a.map((l,h)=>{if(typeof l=="string"||typeof l=="number")return String(l);if(typeof l!="object"||l===null)return console.warn("Skipping invalid item in DOM structure:",l),null;let u=Object.entries(l);if(u.length===0)return console.warn("Skipping empty object item:",l),null;let[y,E]=u[0];if(!isNaN(Number(y)))return Array.isArray(E)?n(E,`${o}.${y}`):typeof E=="object"&&E!==null&&Object.entries(E).length>0?n([E],`${o}.${y}`):String(E);u.length>1&&console.warn("Item has multiple keys, processing only the first:",y);let T,p,c=y.indexOf(" ");c===-1?(T=y,p=""):(T=y.substring(0,c),p=y.substring(c+1).trim());let d=T.split(/[.#]/)[0],f=d.includes("-"),g={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,v;for(;(v=S.exec(p))!==null;)if(v[1].startsWith(".")){let I=v[1].substring(1),P=v[4];_[I]=zi(i,P)}else g[v[1]]=v[2]||v[3]||v[4]}let m=T.match(/#([^.#\s]+)/);m&&!Object.prototype.hasOwnProperty.call(g,"id")&&(g.id=m[1]);let x=null;g.id?x=g.id:f&&(x=d);let b=Object.create(null),k=null;if(f)k=d;else{let S=T.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let P=I.substring(1);b[P]=!0});let v=T.match(/#([^.#\s]+)/);v&&(k=v[1])}let w;typeof E=="string"||typeof E=="number"?w=String(E):Array.isArray(E)?w=n(E,`${o}.${y}`):w=[],k&&!f&&(g.id=k);let A=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(v=>{if(v.includes("*")){let I="^"+v.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(v)}catch(P){console.warn(`[Parser] Invalid regex pattern created from refKey '${v}': ${I}`,P)}}else x===v&&S.push(v)}),S.length>0){S.sort((I,P)=>{let R=!I.includes("*"),X=!P.includes("*");return R&&!X?-1:!R&&X?1:P.length-I.length});let v=S[0];if(r[v]&&r[v].eventListeners){let I=r[v].eventListeners;Object.entries(I).forEach(([P,R])=>{R.handler&&s[R.handler]?A[P]=X=>{s[R.handler](X)}:R.handler&&console.warn(`[Parser] Handler '${R.handler}' for refKey '${v}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let C={};if(x)C.key=x;else if(T){let S=o?`${o}.${h}`:String(h);if(C.key=`${T}-${S}`,Object.keys(_).length>0){let v=JSON.stringify(_).substring(0,50);C.key+=`-${v}`}}Object.keys(g).length>0&&(C.attrs=g),Object.keys(b).length>0&&(C.class=b),Object.keys(A).length>0&&(C.on=A),Object.keys(_).length>0&&(C.props=_),f&&(C.hook={update:(S,v)=>{let I=S.data?.props||{},P=v.data?.props||{},R=S.data?.attrs||{},X=v.data?.attrs||{},Nr=JSON.stringify(I)!==JSON.stringify(P),jr=JSON.stringify(R)!==JSON.stringify(X);if(Nr||jr){let V=v.elm;V&&V.render&&typeof V.render=="function"&&(V.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(V.render(),V.removeAttribute("isDirty"),V.handlers&&V.handlers.handleOnUpdate){let Pr={...V.deps||{},store:V.store,render:V.render.bind(V),handlers:V.handlers,dispatchEvent:V.dispatchEvent.bind(V),refIds:V.refIds||{},getRefIds:()=>V.refIds||{}};V.handlers.handleOnUpdate({oldProps:I,newProps:P,oldAttrs:R,newAttrs:X},Pr)}}))}}});try{return e(d,C,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:C,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Fi=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
806
806
  `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,h])=>{let u=s(h);return` ${l} {
807
807
  ${u.split(`
808
808
  `).map(y=>y?` ${y}`:"").join(`
@@ -814,7 +814,7 @@ ${o}
814
814
  ${o}
815
815
  }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
816
816
 
817
- `:"")+o)}),r},ji=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Pi(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},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(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Vi(e,t){let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i))return 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:()=>e[i]}}})}var ft=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
817
+ `:"")+o)}),r},Hi=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Bi(e){return new Proxy({},{get(t,r){if(typeof r=="string")return e.getAttribute(r)},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(t,r){return typeof r=="string"&&e.hasAttribute(r)},ownKeys(){return e.getAttributeNames()},getOwnPropertyDescriptor(t,r){if(typeof r=="string"&&e.hasAttribute(r))return{configurable:!0,enumerable:!0,get:()=>e.getAttribute(r)}}})}function Ki(e,t){let r=new Set(t);return new Proxy({},{get(s,i){if(typeof i=="string"&&r.has(i))return 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:()=>e[i]}}})}var yt=class extends HTMLElement{elementName;styles;h;store;props;propsSchema;template;handlers;transformedHandlers={};refs;refIds={};patch;_unmountCallback;_oldVNode;deps;cssText;static get observedAttributes(){return["key"]}get viewData(){return this.store.toViewData()}connectedCallback(){this.shadow=this.attachShadow({mode:"open"});let t=new CSSStyleSheet;t.replaceSync(`
818
818
  a, a:link, a:visited, a:hover, a:active {
819
819
  display: contents;
820
820
  color: inherit;
@@ -826,4 +826,4 @@ ${o}
826
826
  font: inherit;
827
827
  cursor: pointer;
828
828
  }
829
- `);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.subscriptions&&(this.unsubscribeAll=ji(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){r!==s&&this.render&&requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=hr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Di=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([h,u])=>{h.startsWith("select")?a[h]=(...y)=>u({state:l,props:t,attrs:r},...y):o[h]=y=>(l=ir(l,E=>u(E,y)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},Ri=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:h,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class y extends ft{static get observedAttributes(){return["key"]}constructor(){super();let T=Pi(this);this.propsSchema=o,this.props=o?Vi(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=Di(r,this.props,T),this.template=l,this.handlers=e,this.refs=h,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Ni(a,u)}}return y},mt=Ri;function te(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 le=Array.isArray;function pe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Mi(e,t){return document.createElement(e,t)}function zi(e,t,r){return document.createElementNS(e,t,r)}function Wi(){return re(document.createDocumentFragment())}function Fi(e){return document.createTextNode(e)}function Hi(e){return document.createComment(e)}function Bi(e,t,r){if(G(e)){let s=e;for(;s&&G(s);)s=re(s).parent;e=s??e}G(t)&&(t=re(t,e)),r&&G(r)&&(r=re(r).firstChildNode),e.insertBefore(t,r)}function Ki(e,t){e.removeChild(t)}function Ui(e,t){G(t)&&(t=re(t,e)),e.appendChild(t)}function ur(e){if(G(e)){for(;e&&G(e);)e=re(e).parent;return e??null}return e.parentNode}function qi(e){var t;if(G(e)){let r=re(e),s=ur(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 Ji(e){return e.tagName}function Yi(e,t){e.textContent=t}function Gi(e){return e.textContent}function Xi(e){return e.nodeType===1}function Qi(e){return e.nodeType===3}function Zi(e){return e.nodeType===8}function G(e){return e.nodeType===11}function re(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 fr={createElement:Mi,createElementNS:zi,createTextNode:Fi,createDocumentFragment:Wi,createComment:Hi,insertBefore:Bi,removeChild:Ki,appendChild:Ui,parentNode:ur,nextSibling:qi,tagName:Ji,setTextContent:Yi,getTextContent:Gi,isElement:Xi,isText:Qi,isComment:Zi,isDocumentFragment:G};function Ce(e){return e===void 0}function W(e){return e!==void 0}var yt=te("",{},[],void 0,void 0);function ue(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,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function en(){throw new Error("The document fragment is not supported on this platform.")}function tn(e,t){return e.isElement(t)}function rn(e,t){return e.isDocumentFragment(t)}function sn(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 nn=["create","update","remove","destroy","pre","post"];function mr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:fr;for(let p of nn)for(let c of e){let d=c[p];d!==void 0&&s[p].push(d)}function n(p){let c=p.id?"#"+p.id:"",d=p.getAttribute("class"),f=d?"."+d.split(" ").join("."):"";return te(i.tagName(p).toLowerCase()+c+f,{},[],void 0,p)}function a(p){return te(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let f=i.parentNode(p);f!==null&&i.removeChild(f,p)}}}function l(p,c){var d,f,g,_;let m,x=p.data;if(x!==void 0){let w=(d=x.hook)===null||d===void 0?void 0:d.init;W(w)&&(w(p),x=p.data)}let b=p.children,k=p.sel;if(k==="!")Ce(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(k==="")p.elm=i.createTextNode(p.text);else if(k!==void 0){let w=k.indexOf("#"),A=k.indexOf(".",w),C=w>0?w:k.length,S=A>0?A:k.length,v=w!==-1||A!==-1?k.slice(0,Math.min(C,S)):k,I=p.elm=W(x)&&W(m=x.ns)?i.createElementNS(m,v,x):i.createElement(v,x);for(C<S&&I.setAttribute("id",k.slice(C+1,S)),A>0&&I.setAttribute("class",k.slice(S+1).replace(/\./g," ")),m=0;m<s.create.length;++m)s.create[m](yt,p);if(pe(p.text)&&(!le(b)||b.length===0)&&i.appendChild(I,i.createTextNode(p.text)),le(b))for(m=0;m<b.length;++m){let M=b[m];M!=null&&i.appendChild(I,l(M,c))}let j=p.data.hook;W(j)&&((f=j.create)===null||f===void 0||f.call(j,yt,p),j.insert&&c.push(p))}else if(!((g=r?.experimental)===null||g===void 0)&&g.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:en)(),m=0;m<s.create.length;++m)s.create[m](yt,p);for(m=0;m<p.children.length;++m){let w=p.children[m];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function h(p,c,d,f,g,_){for(;f<=g;++f){let m=d[f];m!=null&&i.insertBefore(p,l(m,_),c)}}function u(p){var c,d;let f=p.data;if(f!==void 0){(d=(c=f?.hook)===null||c===void 0?void 0:c.destroy)===null||d===void 0||d.call(c,p);for(let g=0;g<s.destroy.length;++g)s.destroy[g](p);if(p.children!==void 0)for(let g=0;g<p.children.length;++g){let _=p.children[g];_!=null&&typeof _!="string"&&u(_)}}}function y(p,c,d,f){for(var g,_;d<=f;++d){let m,x,b=c[d];if(b!=null)if(W(b.sel)){u(b),m=s.remove.length+1,x=o(b.elm,m);for(let w=0;w<s.remove.length;++w)s.remove[w](b,x);let k=(_=(g=b?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;W(k)?k(b,x):x()}else b.children?(u(b),y(p,b.children,0,b.children.length-1)):i.removeChild(p,b.elm)}}function E(p,c,d,f){let g=0,_=0,m=c.length-1,x=c[0],b=c[m],k=d.length-1,w=d[0],A=d[k],C,S,v,I;for(;g<=m&&_<=k;)x==null?x=c[++g]:b==null?b=c[--m]:w==null?w=d[++_]:A==null?A=d[--k]:ue(x,w)?(T(x,w,f),x=c[++g],w=d[++_]):ue(b,A)?(T(b,A,f),b=c[--m],A=d[--k]):ue(x,A)?(T(x,A,f),i.insertBefore(p,x.elm,i.nextSibling(b.elm)),x=c[++g],A=d[--k]):ue(b,w)?(T(b,w,f),i.insertBefore(p,b.elm,x.elm),b=c[--m],w=d[++_]):(C===void 0&&(C=sn(c,g,m)),S=C[w.key],Ce(S)?(i.insertBefore(p,l(w,f),x.elm),w=d[++_]):Ce(C[A.key])?(i.insertBefore(p,l(A,f),i.nextSibling(b.elm)),A=d[--k]):(v=c[S],v.sel!==w.sel?i.insertBefore(p,l(w,f),x.elm):(T(v,w,f),c[S]=void 0,i.insertBefore(p,v.elm,x.elm)),w=d[++_]));_<=k&&(I=d[k+1]==null?null:d[k+1].elm,h(p,I,d,_,k,f)),g<=m&&y(p,c,g,m)}function T(p,c,d){var f,g,_,m,x,b,k,w;let A=(f=c.data)===null||f===void 0?void 0:f.hook;(g=A?.prepatch)===null||g===void 0||g.call(A,p,c);let C=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||W(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(m=p.data)!==null&&m!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(k=(b=(x=c.data)===null||x===void 0?void 0:x.hook)===null||b===void 0?void 0:b.update)===null||k===void 0||k.call(b,p,c)}let S=p.children,v=c.children;Ce(c.text)?W(S)&&W(v)?S!==v&&E(C,S,v,d):W(v)?(W(p.text)&&i.setTextContent(C,""),h(C,null,v,0,v.length-1,d)):W(S)?y(C,S,0,S.length-1):W(p.text)&&i.setTextContent(C,""):p.text!==c.text&&(W(S)&&y(C,S,0,S.length-1),i.setTextContent(C,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,d){let f,g,_,m=[];for(f=0;f<s.pre.length;++f)s.pre[f]();for(tn(i,c)?c=n(c):rn(i,c)&&(c=a(c)),ue(c,d)?T(c,d,m):(g=c.elm,_=i.parentNode(g),l(d,m),_!==null&&(i.insertBefore(_,d.elm,i.nextSibling(g)),y(_,[c],0,0))),f=0;f<m.length;++f)m[f].data.hook.insert(m[f]);for(f=0;f<s.post.length;++f)s.post[f]();return d}}function yr(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 gr={create:yr,update:yr};function br(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var vr={create:br,update:br};var an="http://www.w3.org/1999/xlink",on="http://www.w3.org/2000/xmlns/",ln="http://www.w3.org/XML/1998/namespace";function wr(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(ln,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(on,r,a):s.setAttributeNS(an,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var xr={create:wr,update:wr};var _r=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,pn=function(e){_r(function(){_r(e)})},gt=!1;function cn(e,t,r){pn(function(){e[t]=r})}function Sr(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 o="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 l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&cn(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function hn(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 dn(e,t){let r=e.data.style;if(!r||!r.remove){t();return}gt||(e.elm.offsetLeft,gt=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&o++;i.addEventListener("transitionend",function(y){y.target===i&&--o,o===0&&t()})}function un(){gt=!1}var kr={pre:un,create:Sr,update:Sr,destroy:hn,remove:dn};function Er(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++)Er(e[s],t,r)}function fn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Er(s[r],t,e)}function mn(){return function e(t){fn(t,e.vnode)}}function bt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||mn();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var Ar={create:bt,update:bt,destroy:bt};var yn=()=>mr([gr,vr,xr,kr,Ar]),vt=yn;function $r(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&&$r(n,i.children,i.sel)}}function wt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),le(r)?i=r:pe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(le(t)?i=t:pe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)pe(i[a])&&(i[a]=te(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&$r(s,i,e),te(e,s,i,n,void 0)}var gn={},Cr={components:gn},Or=vt();var Oe={components:{dialog:{handlers:Me,store:ze,view:Dt},dropdownMenu:{handlers:We,store:Fe,view:Rt},form:{handlers:He,store:Be,view:Mt},navbar:{handlers:Ke,store:Ue,view:zt},pageOutline:{handlers:qe,store:Je,view:Ft},popover:{handlers:Ye,store:Ge,view:Ht},select:{handlers:Xe,store:Qe,view:Bt},sidebar:{handlers:Ze,store:tt,view:Kt},table:{handlers:rt,store:st,view:Ut}}};Object.keys(Oe).forEach(e=>{Object.keys(Oe[e]).forEach(t=>{let r=mt({...Oe[e][t],patch:Or,h:wt},Cr[e]);customElements.define(Oe[e][t].view.elementName,r)})});customElements.define("rtgl-button",kt({}));customElements.define("rtgl-view",$t({}));customElements.define("rtgl-text",Ot({}));customElements.define("rtgl-image",It({}));customElements.define("rtgl-svg",Lt({}));customElements.define("rtgl-input",Nt({}));customElements.define("rtgl-textarea",jt({}));customElements.define("rtgl-color-picker",Pt({}));customElements.define("rtgl-slider",Vt({}));})();
829
+ `);let r=[t];if(this.cssText){let i=new CSSStyleSheet;i.replaceSync(this.cssText),r.push(i)}this.shadow.adoptedStyleSheets=r,this.renderTarget=document.createElement("div"),this.renderTarget.style.cssText="display: contents;",this.shadow.appendChild(this.renderTarget),this.transformedHandlers={},this.renderTarget.parentNode||this.appendChild(this.renderTarget),this.style.display="contents";let s={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this)};Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.subscriptions&&(this.unsubscribeAll=Hi(this.handlers.subscriptions(s))),this.handlers?.handleOnMount&&(this._unmountCallback=this.handlers?.handleOnMount(s)),this.render()}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){r!==s&&this.render&&requestAnimationFrame(()=>{this.render()})}render=()=>{if(!this.patch){console.error("Patch function is not defined!");return}if(!this.template){console.error("Template is not defined!");return}try{let t={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)},r=fr({h:this.h,template:this.template,viewData:this.viewData,refs:this.refs,handlers:this.transformedHandlers}),s={},i=n=>{n.data?.attrs&&n.data.attrs.id&&(s[n.data.attrs.id]=n),n.children&&n.children.forEach(i)};i(r),this.refIds=s,this._oldVNode?this._oldVNode=this.patch(this._oldVNode,r):this._oldVNode=this.patch(this.renderTarget,r)}catch(t){console.error("Error during patching:",t)}}},Ui=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([h,u])=>{h.startsWith("select")?a[h]=(...y)=>u({state:l,props:t,attrs:r},...y):o[h]=y=>(l=or(l,E=>u(E,y)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},qi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,template:l,refs:h,styles:u}=t;if(!s)throw new Error("Patch is not defined");if(!i)throw new Error("h is not defined");if(!t)throw new Error("view is not defined");class y extends yt{static get observedAttributes(){return["key"]}constructor(){super();let T=Bi(this);this.propsSchema=o,this.props=o?Ki(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=u,this.store=Ui(r,this.props,T),this.template=l,this.handlers=e,this.refs=h,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:T,props:this.props},this.h=i,this.cssText=Fi(a,u)}}return y},gt=qi;function te(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 le=Array.isArray;function pe(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Ji(e,t){return document.createElement(e,t)}function Yi(e,t,r){return document.createElementNS(e,t,r)}function Gi(){return re(document.createDocumentFragment())}function Xi(e){return document.createTextNode(e)}function Qi(e){return document.createComment(e)}function Zi(e,t,r){if(G(e)){let s=e;for(;s&&G(s);)s=re(s).parent;e=s??e}G(t)&&(t=re(t,e)),r&&G(r)&&(r=re(r).firstChildNode),e.insertBefore(t,r)}function en(e,t){e.removeChild(t)}function tn(e,t){G(t)&&(t=re(t,e)),e.appendChild(t)}function yr(e){if(G(e)){for(;e&&G(e);)e=re(e).parent;return e??null}return e.parentNode}function rn(e){var t;if(G(e)){let r=re(e),s=yr(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 sn(e){return e.tagName}function nn(e,t){e.textContent=t}function an(e){return e.textContent}function on(e){return e.nodeType===1}function ln(e){return e.nodeType===3}function pn(e){return e.nodeType===8}function G(e){return e.nodeType===11}function re(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 gr={createElement:Ji,createElementNS:Yi,createTextNode:Xi,createDocumentFragment:Gi,createComment:Qi,insertBefore:Zi,removeChild:en,appendChild:tn,parentNode:yr,nextSibling:rn,tagName:sn,setTextContent:nn,getTextContent:an,isElement:on,isText:ln,isComment:pn,isDocumentFragment:G};function Ce(e){return e===void 0}function W(e){return e!==void 0}var bt=te("",{},[],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),a=e.sel===t.sel,o=!e.sel&&e.sel===t.sel?typeof e.text==typeof t.text:!0;return a&&i&&n&&o}function cn(){throw new Error("The document fragment is not supported on this platform.")}function hn(e,t){return e.isElement(t)}function dn(e,t){return e.isDocumentFragment(t)}function un(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 fn=["create","update","remove","destroy","pre","post"];function br(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:gr;for(let p of fn)for(let c of e){let d=c[p];d!==void 0&&s[p].push(d)}function n(p){let c=p.id?"#"+p.id:"",d=p.getAttribute("class"),f=d?"."+d.split(" ").join("."):"";return te(i.tagName(p).toLowerCase()+c+f,{},[],void 0,p)}function a(p){return te(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let f=i.parentNode(p);f!==null&&i.removeChild(f,p)}}}function l(p,c){var d,f,g,_;let m,x=p.data;if(x!==void 0){let w=(d=x.hook)===null||d===void 0?void 0:d.init;W(w)&&(w(p),x=p.data)}let b=p.children,k=p.sel;if(k==="!")Ce(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(k==="")p.elm=i.createTextNode(p.text);else if(k!==void 0){let w=k.indexOf("#"),A=k.indexOf(".",w),C=w>0?w:k.length,S=A>0?A:k.length,v=w!==-1||A!==-1?k.slice(0,Math.min(C,S)):k,I=p.elm=W(x)&&W(m=x.ns)?i.createElementNS(m,v,x):i.createElement(v,x);for(C<S&&I.setAttribute("id",k.slice(C+1,S)),A>0&&I.setAttribute("class",k.slice(S+1).replace(/\./g," ")),m=0;m<s.create.length;++m)s.create[m](bt,p);if(pe(p.text)&&(!le(b)||b.length===0)&&i.appendChild(I,i.createTextNode(p.text)),le(b))for(m=0;m<b.length;++m){let R=b[m];R!=null&&i.appendChild(I,l(R,c))}let P=p.data.hook;W(P)&&((f=P.create)===null||f===void 0||f.call(P,bt,p),P.insert&&c.push(p))}else if(!((g=r?.experimental)===null||g===void 0)&&g.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:cn)(),m=0;m<s.create.length;++m)s.create[m](bt,p);for(m=0;m<p.children.length;++m){let w=p.children[m];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function h(p,c,d,f,g,_){for(;f<=g;++f){let m=d[f];m!=null&&i.insertBefore(p,l(m,_),c)}}function u(p){var c,d;let f=p.data;if(f!==void 0){(d=(c=f?.hook)===null||c===void 0?void 0:c.destroy)===null||d===void 0||d.call(c,p);for(let g=0;g<s.destroy.length;++g)s.destroy[g](p);if(p.children!==void 0)for(let g=0;g<p.children.length;++g){let _=p.children[g];_!=null&&typeof _!="string"&&u(_)}}}function y(p,c,d,f){for(var g,_;d<=f;++d){let m,x,b=c[d];if(b!=null)if(W(b.sel)){u(b),m=s.remove.length+1,x=o(b.elm,m);for(let w=0;w<s.remove.length;++w)s.remove[w](b,x);let k=(_=(g=b?.data)===null||g===void 0?void 0:g.hook)===null||_===void 0?void 0:_.remove;W(k)?k(b,x):x()}else b.children?(u(b),y(p,b.children,0,b.children.length-1)):i.removeChild(p,b.elm)}}function E(p,c,d,f){let g=0,_=0,m=c.length-1,x=c[0],b=c[m],k=d.length-1,w=d[0],A=d[k],C,S,v,I;for(;g<=m&&_<=k;)x==null?x=c[++g]:b==null?b=c[--m]:w==null?w=d[++_]:A==null?A=d[--k]:fe(x,w)?(T(x,w,f),x=c[++g],w=d[++_]):fe(b,A)?(T(b,A,f),b=c[--m],A=d[--k]):fe(x,A)?(T(x,A,f),i.insertBefore(p,x.elm,i.nextSibling(b.elm)),x=c[++g],A=d[--k]):fe(b,w)?(T(b,w,f),i.insertBefore(p,b.elm,x.elm),b=c[--m],w=d[++_]):(C===void 0&&(C=un(c,g,m)),S=C[w.key],Ce(S)?(i.insertBefore(p,l(w,f),x.elm),w=d[++_]):Ce(C[A.key])?(i.insertBefore(p,l(A,f),i.nextSibling(b.elm)),A=d[--k]):(v=c[S],v.sel!==w.sel?i.insertBefore(p,l(w,f),x.elm):(T(v,w,f),c[S]=void 0,i.insertBefore(p,v.elm,x.elm)),w=d[++_]));_<=k&&(I=d[k+1]==null?null:d[k+1].elm,h(p,I,d,_,k,f)),g<=m&&y(p,c,g,m)}function T(p,c,d){var f,g,_,m,x,b,k,w;let A=(f=c.data)===null||f===void 0?void 0:f.hook;(g=A?.prepatch)===null||g===void 0||g.call(A,p,c);let C=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||W(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(m=p.data)!==null&&m!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(k=(b=(x=c.data)===null||x===void 0?void 0:x.hook)===null||b===void 0?void 0:b.update)===null||k===void 0||k.call(b,p,c)}let S=p.children,v=c.children;Ce(c.text)?W(S)&&W(v)?S!==v&&E(C,S,v,d):W(v)?(W(p.text)&&i.setTextContent(C,""),h(C,null,v,0,v.length-1,d)):W(S)?y(C,S,0,S.length-1):W(p.text)&&i.setTextContent(C,""):p.text!==c.text&&(W(S)&&y(C,S,0,S.length-1),i.setTextContent(C,c.text)),(w=A?.postpatch)===null||w===void 0||w.call(A,p,c)}return function(c,d){let f,g,_,m=[];for(f=0;f<s.pre.length;++f)s.pre[f]();for(hn(i,c)?c=n(c):dn(i,c)&&(c=a(c)),fe(c,d)?T(c,d,m):(g=c.elm,_=i.parentNode(g),l(d,m),_!==null&&(i.insertBefore(_,d.elm,i.nextSibling(g)),y(_,[c],0,0))),f=0;f<m.length;++f)m[f].data.hook.insert(m[f]);for(f=0;f<s.post.length;++f)s.post[f]();return d}}function vr(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 wr={create:vr,update:vr};function xr(e,t){let r,s,i,n=t.elm,a=e.data.props,o=t.data.props;if(!(!a&&!o)&&a!==o){a=a||{},o=o||{};for(r in o)s=o[r],i=a[r],i!==s&&(r!=="value"||n[r]!==s)&&(n[r]=s)}}var _r={create:xr,update:xr};var mn="http://www.w3.org/1999/xlink",yn="http://www.w3.org/2000/xmlns/",gn="http://www.w3.org/XML/1998/namespace";function Sr(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(gn,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(yn,r,a):s.setAttributeNS(mn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var kr={create:Sr,update:Sr};var Er=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,bn=function(e){Er(function(){Er(e)})},vt=!1;function vn(e,t,r){bn(function(){e[t]=r})}function Ar(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 o="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 l in a.delayed)r=a.delayed[l],(!o||r!==n.delayed[l])&&vn(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function wn(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 xn(e,t){let r=e.data.style;if(!r||!r.remove){t();return}vt||(e.elm.offsetLeft,vt=!0);let s,i=e.elm,n=0,a=r.remove,o=0,l=[];for(s in a)l.push(s),i.style[s]=a[s];let u=getComputedStyle(i)["transition-property"].split(", ");for(;n<u.length;++n)l.indexOf(u[n])!==-1&&o++;i.addEventListener("transitionend",function(y){y.target===i&&--o,o===0&&t()})}function _n(){vt=!1}var $r={pre:_n,create:Ar,update:Ar,destroy:wn,remove:xn};function Cr(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++)Cr(e[s],t,r)}function Sn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Cr(s[r],t,e)}function kn(){return function e(t){Sn(t,e.vnode)}}function wt(e,t){let r=e.data.on,s=e.listener,i=e.elm,n=t&&t.data.on,a=t&&t.elm,o;if(r!==n){if(r&&s)if(n)for(o in r)n[o]||i.removeEventListener(o,s,!1);else for(o in r)i.removeEventListener(o,s,!1);if(n){let l=t.listener=e.listener||kn();if(l.vnode=t,r)for(o in n)r[o]||a.addEventListener(o,l,!1);else for(o in n)a.addEventListener(o,l,!1)}}}var Or={create:wt,update:wt,destroy:wt};var En=()=>br([wr,_r,kr,$r,Or]),xt=En;function Ir(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&&Ir(n,i.children,i.sel)}}function _t(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),le(r)?i=r:pe(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(le(t)?i=t:pe(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)pe(i[a])&&(i[a]=te(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Ir(s,i,e),te(e,s,i,n,void 0)}var An={},Tr={components:An},Lr=xt();var Oe={components:{dialog:{handlers:Re,store:ze,view:Rt},dropdownMenu:{handlers:We,store:Fe,view:zt},form:{handlers:He,store:Be,view:Wt},navbar:{handlers:Ke,store:Ue,view:Ft},pageOutline:{handlers:qe,store:Je,view:Bt},popover:{handlers:Ye,store:Ge,view:Kt},select:{handlers:Xe,store:Qe,view:Ut},sidebar:{handlers:Ze,store:tt,view:qt},sliderInput:{handlers:rt,store:st,view:Jt},table:{handlers:it,store:nt,view:Yt}}};Object.keys(Oe).forEach(e=>{Object.keys(Oe[e]).forEach(t=>{let r=gt({...Oe[e][t],patch:Lr,h:_t},Tr[e]);customElements.define(Oe[e][t].view.elementName,r)})});customElements.define("rtgl-button",At({}));customElements.define("rtgl-view",Ot({}));customElements.define("rtgl-text",Tt({}));customElements.define("rtgl-image",Lt({}));customElements.define("rtgl-svg",jt({}));customElements.define("rtgl-input",Pt({}));customElements.define("rtgl-textarea",Vt({}));customElements.define("rtgl-color-picker",Dt({}));customElements.define("rtgl-slider",Mt({}));})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/ui",
3
- "version": "0.1.2-rc7",
3
+ "version": "0.1.2-rc8",
4
4
  "description": "A UI component library for building web interfaces.",
5
5
  "main": "dist/rettangoli-esm.min.js",
6
6
  "type": "module",
@@ -76,3 +76,15 @@ export const handleSliderChange = (e, deps) => {
76
76
  dispatchFormChange(name, e.detail.value, store.selectFormValues(), dispatchEvent);
77
77
  }
78
78
  };
79
+
80
+ export const handleSliderInputChange = (e, deps) => {
81
+ const { store, dispatchEvent } = deps;
82
+ const name = e.currentTarget.id.replace("slider-input-", "");
83
+ if (name && e.detail.value !== undefined) {
84
+ store.setFormFieldValue({
85
+ name: name,
86
+ value: e.detail.value,
87
+ });
88
+ dispatchFormChange(name, e.detail.value, store.selectFormValues(), dispatchEvent);
89
+ }
90
+ };
@@ -109,6 +109,29 @@ propsSchema:
109
109
  - label
110
110
  - inputType
111
111
  additionalProperties: false
112
+ - type: object
113
+ properties:
114
+ name:
115
+ type: string
116
+ label:
117
+ type: string
118
+ description:
119
+ type: string
120
+ inputType:
121
+ const: slider-input
122
+ min:
123
+ type: number
124
+ max:
125
+ type: number
126
+ step:
127
+ type: number
128
+ value:
129
+ type: number
130
+ required:
131
+ - name
132
+ - label
133
+ - inputType
134
+ additionalProperties: false
112
135
  actions:
113
136
  type: object
114
137
  properties:
@@ -146,6 +169,10 @@ refs:
146
169
  eventListeners:
147
170
  slider-change:
148
171
  handler: handleSliderChange
172
+ slider-input-*:
173
+ eventListeners:
174
+ slider-input-value-change:
175
+ handler: handleSliderInputChange
149
176
 
150
177
  events:
151
178
  form-change: {}
@@ -169,6 +196,8 @@ template:
169
196
  - rtgl-color-picker#colorpicker-${field.name} value=${field.defaultValue}:
170
197
  - $if field.inputType == "slider":
171
198
  - rtgl-slider#slider-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} value=${field.defaultValue}:
199
+ - $if field.inputType == "slider-input":
200
+ - rtgl-slider-input#slider-input-${field.name} w=f min=${field.min} max=${field.max} step=${field.step} defaultValue=${field.defaultValue}:
172
201
  - rtgl-view g=sm w=f:
173
202
  - rtgl-view d=h ah=e g=sm w=f:
174
203
  - $for button, i in actions.buttons:
@@ -0,0 +1,24 @@
1
+ export const handleOnMount = (deps) => {
2
+ const { store, attrs } = deps;
3
+ store.setValue(attrs.defaultValue || 0);
4
+ }
5
+
6
+ export const handleValueChange = (e, deps) => {
7
+ const { store, render, dispatchEvent } = deps;
8
+ const newValue = Number(e.detail.value);
9
+
10
+ store.setValue(newValue);
11
+
12
+ // Re-render to sync slider and input
13
+ render();
14
+
15
+ // Dispatch event for external listeners
16
+ dispatchEvent(
17
+ new CustomEvent("slider-input-value-change", {
18
+ detail: {
19
+ value: newValue,
20
+ },
21
+ bubbles: true,
22
+ }),
23
+ );
24
+ };
@@ -0,0 +1,17 @@
1
+ export const INITIAL_STATE = Object.freeze({
2
+ value: 0
3
+ });
4
+
5
+ export const toViewData = ({ state, attrs }) => {
6
+ return {
7
+ value: state.value,
8
+ w: attrs.w || '',
9
+ min: attrs.min || 0,
10
+ max: attrs.max || 100,
11
+ step: attrs.step || 1
12
+ };
13
+ }
14
+
15
+ export const setValue = (state, newValue) => {
16
+ state.value = newValue;
17
+ }
@@ -0,0 +1,41 @@
1
+ elementName: rtgl-slider-input
2
+
3
+ viewDataSchema:
4
+ type: object
5
+
6
+ attrsSchema:
7
+ type: object
8
+ properties:
9
+ defaultValue:
10
+ type: string
11
+ default: '0'
12
+ w:
13
+ type: string
14
+ default: ''
15
+ min:
16
+ type: string
17
+ default: '0'
18
+ max:
19
+ type: string
20
+ default: '100'
21
+ step:
22
+ type: string
23
+ default: '1'
24
+
25
+ refs:
26
+ input:
27
+ eventListeners:
28
+ input-change:
29
+ handler: handleValueChange
30
+ slider:
31
+ eventListeners:
32
+ slider-change:
33
+ handler: handleValueChange
34
+
35
+ events:
36
+ form-change: {}
37
+
38
+ template:
39
+ - rtgl-view d=h av=c g=md w=${w}:
40
+ - rtgl-slider#slider w=80% type=range min=${min} max=${max} step=${step} value=${value}:
41
+ - rtgl-input#input w=20% type=number min=${min} max=${max} step=${step} value=${value}:
@@ -120,7 +120,7 @@ class RettangoliInputElement extends HTMLElement {
120
120
 
121
121
  attributeChangedCallback(name, oldValue, newValue) {
122
122
  // Handle input-specific attributes first
123
- if (["type", "placeholder", "disabled", "value", "s"].includes(name)) {
123
+ if (["type", "placeholder", "disabled", "value", "step", "s"].includes(name)) {
124
124
  this._updateInputAttributes();
125
125
  return;
126
126
  }
@@ -194,6 +194,7 @@ class RettangoliInputElement extends HTMLElement {
194
194
  const type = this.getAttribute("type") || "text";
195
195
  const placeholder = this.getAttribute("placeholder");
196
196
  const value = this.getAttribute("value");
197
+ const step = this.getAttribute("step");
197
198
  const isDisabled = this.hasAttribute('disabled');
198
199
 
199
200
  this._inputElement.setAttribute("type", type);
@@ -208,6 +209,12 @@ class RettangoliInputElement extends HTMLElement {
208
209
  this._inputElement.value = value;
209
210
  }
210
211
 
212
+ if (step !== null) {
213
+ this._inputElement.setAttribute("step", step);
214
+ } else {
215
+ this._inputElement.removeAttribute("step");
216
+ }
217
+
211
218
  if (isDisabled) {
212
219
  this._inputElement.setAttribute("disabled", "");
213
220
  } else {